/* Account colour schemes share the same contrast and status colours. */
:root[data-theme="lavender"] {
  --canvas: #f6f3fc; --canvas-rgb: 246 243 252;
  --surface: #fefcff; --surface-rgb: 254 252 255; --surface-inset: #fdfbff;
  --blush-100: #eee7f7; --blush-200: #e5d9f2; --line: #e4ddec; --line-rgb: 228 221 236;
  --line-strong: #92809f; --ink: #443c52; --ink-soft: #685d76;
  --accent-rose: #e6d4f4; --rose-rgb: 230 212 244; --accent-mauve: #d6dff6; --mauve-rgb: 214 223 246;
  --link: #71508b; --accent-text: #715582; --button-ink: #493851; --focus: #7b6096;
}
:root[data-theme="sage"] {
  --canvas: #f3f7f1; --canvas-rgb: 243 247 241;
  --surface: #fffef9; --surface-rgb: 255 254 249; --surface-inset: #fcfdf9;
  --blush-100: #e9f0e4; --blush-200: #dce8d5; --line: #dce5d7; --line-rgb: 220 229 215;
  --line-strong: #81917b; --ink: #3e493d; --ink-soft: #5d6b58;
  --accent-rose: #d6e7ce; --rose-rgb: 214 231 206; --accent-mauve: #f3e6cb; --mauve-rgb: 243 230 203;
  --link: #526f49; --accent-text: #536b4c; --button-ink: #3f5039; --focus: #607853;
}
/* Peach blossom */
:root[data-theme="peach"] {
  --canvas: #fff5ef; --canvas-rgb: 255 245 239; --surface: #fffdfb; --surface-rgb: 255 253 251; --surface-inset: #fffdfb;
  --blush-100: #fce7da; --blush-200: #f8d9c5; --line: #fbe4d6; --line-rgb: 251 228 214; --line-strong: #a18475;
  --ink: #533f38; --ink-soft: #71594f; --accent-rose: #f8d9c5; --rose-rgb: 248 217 197; --accent-mauve: #f3e3cf; --mauve-rgb: 243 227 207;
  --link: #875943; --accent-text: #875943; --button-ink: #533f38; --focus: #875943;
}
.theme-preview.theme-preview-peach i { background: #fff5ef; }.theme-preview.theme-preview-peach i:nth-child(2) { background: #f8d9c5; }.theme-preview.theme-preview-peach i:nth-child(3) { background: #f3e3cf; }

/* Buttercream */
:root[data-theme="buttercream"] {
  --canvas: #fffbef; --canvas-rgb: 255 251 239; --surface: #fffefb; --surface-rgb: 255 254 251; --surface-inset: #fffefb;
  --blush-100: #faf2d3; --blush-200: #f5e8b7; --line: #f9f0cd; --line-rgb: 249 240 205; --line-strong: #998b69;
  --ink: #4d4633; --ink-soft: #6c6247; --accent-rose: #f5e8b7; --rose-rgb: 245 232 183; --accent-mauve: #efdfca; --mauve-rgb: 239 223 202;
  --link: #786235; --accent-text: #786235; --button-ink: #4d4633; --focus: #786235;
}
.theme-preview.theme-preview-buttercream i { background: #fffbef; }.theme-preview.theme-preview-buttercream i:nth-child(2) { background: #f5e8b7; }.theme-preview.theme-preview-buttercream i:nth-child(3) { background: #efdfca; }

/* Blue sky */
:root[data-theme="sky"] {
  --canvas: #f2f8fd; --canvas-rgb: 242 248 253; --surface: #fcfdff; --surface-rgb: 252 253 255; --surface-inset: #fcfdff;
  --blush-100: #e0eefa; --blush-200: #cee5f7; --line: #dcedf9; --line-rgb: 220 237 249; --line-strong: #7b91a4;
  --ink: #374959; --ink-soft: #52687b; --accent-rose: #cee5f7; --rose-rgb: 206 229 247; --accent-mauve: #dce6f6; --mauve-rgb: 220 230 246;
  --link: #456a89; --accent-text: #456a89; --button-ink: #374959; --focus: #456a89;
}
.theme-preview.theme-preview-sky i { background: #f2f8fd; }.theme-preview.theme-preview-sky i:nth-child(2) { background: #cee5f7; }.theme-preview.theme-preview-sky i:nth-child(3) { background: #dce6f6; }

/* Fresh mint */
:root[data-theme="mint"] {
  --canvas: #f1faf5; --canvas-rgb: 241 250 245; --surface: #fcfefd; --surface-rgb: 252 254 253; --surface-inset: #fcfefd;
  --blush-100: #def2e8; --blush-200: #ccebdc; --line: #dbf1e6; --line-rgb: 219 241 230; --line-strong: #718f7e;
  --ink: #374d43; --ink-soft: #526d5e; --accent-rose: #ccebdc; --rose-rgb: 204 235 220; --accent-mauve: #e2efd1; --mauve-rgb: 226 239 209;
  --link: #436e58; --accent-text: #436e58; --button-ink: #374d43; --focus: #436e58;
}
.theme-preview.theme-preview-mint i { background: #f1faf5; }.theme-preview.theme-preview-mint i:nth-child(2) { background: #ccebdc; }.theme-preview.theme-preview-mint i:nth-child(3) { background: #e2efd1; }

/* Lilac bloom */
:root[data-theme="lilac"] {
  --canvas: #fbf3fc; --canvas-rgb: 251 243 252; --surface: #fefcfe; --surface-rgb: 254 252 254; --surface-inset: #fefcfe;
  --blush-100: #f5e4f5; --blush-200: #efd4ee; --line: #f4e0f4; --line-rgb: 244 224 244; --line-strong: #a084a3;
  --ink: #513b53; --ink-soft: #745b75; --accent-rose: #efd4ee; --rose-rgb: 239 212 238; --accent-mauve: #e8d9f6; --mauve-rgb: 232 217 246;
  --link: #805284; --accent-text: #805284; --button-ink: #513b53; --focus: #805284;
}
.theme-preview.theme-preview-lilac i { background: #fbf3fc; }.theme-preview.theme-preview-lilac i:nth-child(2) { background: #efd4ee; }.theme-preview.theme-preview-lilac i:nth-child(3) { background: #e8d9f6; }

/* Soft coral */
:root[data-theme="coral"] {
  --canvas: #fff4f2; --canvas-rgb: 255 244 242; --surface: #fffdfc; --surface-rgb: 255 253 252; --surface-inset: #fffdfc;
  --blush-100: #fbe2e0; --blush-200: #f7d1cd; --line: #fadfdc; --line-rgb: 250 223 220; --line-strong: #a6817d;
  --ink: #543d3c; --ink-soft: #755856; --accent-rose: #f7d1cd; --rose-rgb: 247 209 205; --accent-mauve: #f8e2cf; --mauve-rgb: 248 226 207;
  --link: #8c5351; --accent-text: #8c5351; --button-ink: #543d3c; --focus: #8c5351;
}
.theme-preview.theme-preview-coral i { background: #fff4f2; }.theme-preview.theme-preview-coral i:nth-child(2) { background: #f7d1cd; }.theme-preview.theme-preview-coral i:nth-child(3) { background: #f8e2cf; }

/* Periwinkle */
:root[data-theme="periwinkle"] {
  --canvas: #f3f4fd; --canvas-rgb: 243 244 253; --surface: #fcfdff; --surface-rgb: 252 253 255; --surface-inset: #fcfdff;
  --blush-100: #e5e8fa; --blush-200: #d7dcf8; --line: #e2e6fa; --line-rgb: 226 230 250; --line-strong: #858caa;
  --ink: #3e425b; --ink-soft: #5e6580; --accent-rose: #d7dcf8; --rose-rgb: 215 220 248; --accent-mauve: #e7ddf5; --mauve-rgb: 231 221 245;
  --link: #535f91; --accent-text: #535f91; --button-ink: #3e425b; --focus: #535f91;
}
.theme-preview.theme-preview-periwinkle i { background: #f3f4fd; }.theme-preview.theme-preview-periwinkle i:nth-child(2) { background: #d7dcf8; }.theme-preview.theme-preview-periwinkle i:nth-child(3) { background: #e7ddf5; }

/* Champagne */
:root[data-theme="champagne"] {
  --canvas: #fcf8f0; --canvas-rgb: 252 248 240; --surface: #fefdfc; --surface-rgb: 254 253 252; --surface-inset: #fefdfc;
  --blush-100: #f6ecd9; --blush-200: #efdfc2; --line: #f4e9d4; --line-rgb: 244 233 212; --line-strong: #968469;
  --ink: #504637; --ink-soft: #72644f; --accent-rose: #efdfc2; --rose-rgb: 239 223 194; --accent-mauve: #eedcd7; --mauve-rgb: 238 220 215;
  --link: #7d6241; --accent-text: #7d6241; --button-ink: #504637; --focus: #7d6241;
}
.theme-preview.theme-preview-champagne i { background: #fcf8f0; }.theme-preview.theme-preview-champagne i:nth-child(2) { background: #efdfc2; }.theme-preview.theme-preview-champagne i:nth-child(3) { background: #eedcd7; }

/* Seafoam */
:root[data-theme="seafoam"] {
  --canvas: #eff9f8; --canvas-rgb: 239 249 248; --surface: #fbfefd; --surface-rgb: 251 254 253; --surface-inset: #fbfefd;
  --blush-100: #ddf1ee; --blush-200: #cbe9e5; --line: #d9efed; --line-rgb: 217 239 237; --line-strong: #708f8b;
  --ink: #354d4c; --ink-soft: #516d6a; --accent-rose: #cbe9e5; --rose-rgb: 203 233 229; --accent-mauve: #dcecf0; --mauve-rgb: 220 236 240;
  --link: #406f6a; --accent-text: #406f6a; --button-ink: #354d4c; --focus: #406f6a;
}
.theme-preview.theme-preview-seafoam i { background: #eff9f8; }.theme-preview.theme-preview-seafoam i:nth-child(2) { background: #cbe9e5; }.theme-preview.theme-preview-seafoam i:nth-child(3) { background: #dcecf0; }

/* Vanilla mocha */
:root[data-theme="mocha"] {
  --canvas: #f8f3ee; --canvas-rgb: 248 243 238; --surface: #fdfcfb; --surface-rgb: 253 252 251; --surface-inset: #fdfcfb;
  --blush-100: #f0e4da; --blush-200: #e7d5c5; --line: #eee1d5; --line-rgb: 238 225 213; --line-strong: #978171;
  --ink: #4e4038; --ink-soft: #6e5e53; --accent-rose: #e7d5c5; --rose-rgb: 231 213 197; --accent-mauve: #e9d9d4; --mauve-rgb: 233 217 212;
  --link: #7b5844; --accent-text: #7b5844; --button-ink: #4e4038; --focus: #7b5844;
}
.theme-preview.theme-preview-mocha i { background: #f8f3ee; }.theme-preview.theme-preview-mocha i:nth-child(2) { background: #e7d5c5; }.theme-preview.theme-preview-mocha i:nth-child(3) { background: #e9d9d4; }
.theme-options { min-inline-size: 0; border: 0; padding: 0; margin: 0 0 1.5rem; display: grid; gap: .8rem; }
.theme-options legend { margin-bottom: 1rem; font-weight: 750; }
.theme-option { display: grid; grid-template-columns: auto 5rem minmax(0, 1fr); align-items: center; gap: .8rem; padding: 1rem; border: 1px solid var(--line-strong); border-radius: var(--radius-md); cursor: pointer; }
.theme-option:has(input:checked) { background: var(--blush-100); box-shadow: 0 0 0 2px var(--focus); }
.theme-preview { display: flex; overflow: hidden; height: 2.5rem; border-radius: .6rem; }
.theme-preview i { flex: 1; background: #fcf6f8; }.theme-preview i:nth-child(2) { background: #f6d3e0; }.theme-preview i:nth-child(3) { background: #e2d6f4; }
.theme-preview-lavender i { background: #f6f3fc; }.theme-preview-lavender i:nth-child(2) { background: #e6d4f4; }.theme-preview-lavender i:nth-child(3) { background: #d6dff6; }
.theme-preview-sage i { background: #f3f7f1; }.theme-preview-sage i:nth-child(2) { background: #d6e7ce; }.theme-preview-sage i:nth-child(3) { background: #f3e6cb; }
.stat-link { display: block; color: var(--ink); text-decoration: none; min-height: 110px; }
.stat-link:hover { border-color: var(--focus); }.stat-link::after { pointer-events: none; }.stat-link small { color: var(--ink-soft); font-size: .7rem; }
.period-shortcuts { margin-bottom: .8rem; }.money-period { display: flex; flex-wrap: wrap; align-items: end; gap: .8rem; padding: 1rem; margin-bottom: 1rem; }.money-period .field { flex: 1 1 10rem; margin: 0; min-width: 0; }.money-period .errorlist { width: 100%; }
.money-breakdown { padding: 1.2rem; margin-top: 1.5rem; }.money-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: .8rem; padding: 1rem; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }.money-row:last-child { border: 0; }.money-row small { display: block; color: var(--ink-soft); overflow-wrap: anywhere; }.money-row > div { min-width: 0; }.money-row > strong { white-space: nowrap; }
section[id] { scroll-margin-top: 10rem; }
/* Client details and signed cards must wrap rather than enlarge the viewport. */
.detail-card { padding: 1rem 1.2rem; }.detail-list dt, .detail-list dd { min-width: 0; overflow-wrap: anywhere; }.detail-list dd { max-width: 65%; text-align: right; }
.content-grid > *, .client-title > div, .page-heading > div, .section-heading > div { min-width: 0; }
.client-title h1, .safety-card-hero, .signed-summary, .acknowledgement-card, .care-profile-card, .privacy-callout { overflow-wrap: anywhere; }
fieldset { min-inline-size: 0; }.safety-section legend { max-width: 100%; overflow-wrap: anywhere; }.safety-section .field > label { align-items: flex-start; flex-wrap: wrap; }.required { flex-shrink: 0; }
.check-row input { flex: 0 0 auto; }.check-row span { min-width: 0; overflow-wrap: anywhere; }.safety-card-hero > div, .signed-summary > div { min-width: 0; flex: 1 1 16rem; }.flag-list span { overflow-wrap: anywhere; max-width: 100%; }
.mobile-calendar, .mobile-agenda { display: none; }
@media (max-width: 760px) {
  .detail-list div { display: grid; grid-template-columns: 1fr; gap: .2rem; }.detail-list dd { max-width: 100%; text-align: left; }
  .page-heading.row-between { display: grid; grid-template-columns: minmax(0, 1fr); }.page-heading.row-between > .button { width: 100%; }
  .section-heading { align-items: flex-start; gap: .7rem; flex-wrap: wrap; }.section-heading > a { min-height: 44px; display: inline-flex; align-items: center; }
  .client-hero .action-row { display: grid; grid-template-columns: 1fr; }.signed-summary, .safety-card-hero { padding: 1rem; }.safety-card-hero > .button { width: 100%; }
  .sticky-form-actions { position: static; }.safety-form { padding-bottom: 1rem; }.theme-option { grid-template-columns: auto 4rem minmax(0, 1fr); padding: .9rem .7rem; gap: .6rem; }
  .money-row { grid-template-columns: minmax(0, 1fr) auto; }.money-row > .button { grid-column: 1 / -1; }.money-row > span:last-child { display: none; }
  section[id] { scroll-margin-top: 5.5rem; }
  .mobile-calendar { display: block; }.calendar-mode-day .mobile-agenda { display: grid; gap: .7rem; }
  .calendar-mode-day > .calendar-controls, .calendar-mode-day > .calendar-legend, .calendar-mode-day > .calendar-scroll { display: none; }
  .calendar-heading h1 { font-size: 1.65rem; }.calendar-heading p { display: none; }.calendar-heading > .button { width: auto; min-height: 44px; }
  .mobile-diary-actions { display: flex; gap: .5rem; margin-bottom: .9rem; }.mobile-diary-actions > :first-child { flex: 1; }
  .date-strip a[aria-current="date"] { background: var(--blush-200); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
  .mobile-date-navigation { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .35rem; align-items: center; }.mobile-date-navigation form { min-width: 0; display: flex; gap: .3rem; }.mobile-date-navigation input { min-width: 0; padding-inline: .35rem; }
  .mobile-view-switch { display: flex; gap: 1rem; margin: .5rem 0; }.mobile-view-switch a { display: inline-flex; min-height: 44px; align-items: center; }.mobile-view-switch a[aria-current] { color: var(--ink); font-weight: 750; text-decoration: none; }
  .diary-filters { margin-bottom: 1rem; }.diary-filters summary { min-height: 44px; cursor: pointer; padding: .5rem 0; color: var(--ink-soft); }.diary-filters form { padding: .5rem 0; }
  .agenda-entry { display: grid; grid-template-columns: 3rem minmax(0, 1fr) auto; gap: .7rem; padding: 1rem; text-decoration: none; color: var(--ink); }.agenda-entry p { margin: .2rem 0; }.agenda-entry small { display: block; color: var(--ink-soft); overflow-wrap: anywhere; }.agenda-entry .badge { margin-top: .5rem; }.agenda-entry > div { min-width: 0; overflow-wrap: anywhere; }.agenda-block { background: var(--amber-100); }.agenda-time strong { color: var(--accent-text); }
}

.money-date-details { margin-bottom: 1rem; }.money-date-details > summary { min-height: 44px; padding: .65rem 0; color: var(--link); cursor: pointer; }.money-date-details[open] > summary { margin-bottom: .5rem; }
@media (max-width: 760px) { .calendar-heading > .button { display: none; }.mobile-view-switch { justify-content: space-between; gap: .5rem; }.mobile-view-switch a { font-size: .9rem; } }

@media (min-width: 700px) { .theme-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }.theme-option { grid-template-columns: auto 3.5rem minmax(0, 1fr); padding: .8rem; gap: .6rem; } }
