:root {
    color-scheme: light;
    --canvas: #f8f5ef;
    --paper: #fffdfa;
    --white: #fff;
    --ink: #332e28;
    --muted: #756d63;
    --accent: #a45e43;
    --earth: #79432e;
    --wash: #f5e8de;
    --line: #e6dcd1;
    --shadow: 0 6px 20px #563e2a08;
    font: 16px/1.45 system-ui, -apple-system, sans-serif;
    color: var(--ink);
    background: var(--canvas);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
p, h1, h2, h3, dl, dd { margin: 0; }
a { color: inherit; }
h1 { font: 500 clamp(2rem, 5vw, 3.15rem)/1.02 Georgia, serif; letter-spacing: -.045em; }
h2 { font-size: 1.05rem; line-height: 1.25; }
h3 { font-size: .88rem; }
.shell { max-width: 1200px; min-height: 100vh; min-height: 100dvh; margin: auto; overflow-x: clip; }
.brand { display: flex; align-items: center; gap: .62rem; min-height: 62px; padding: .4rem clamp(1rem, 4vw, 2rem); background: var(--paper); border-bottom: 1px solid var(--line); }
.brand img { object-fit: contain; flex: none; }
.brand strong { display: block; font: 500 1.3rem/1 Georgia, serif; letter-spacing: -.025em; }
.brand-title p { margin-top: .13rem; color: var(--muted); font-size: .69rem; }
.brand-account { margin-inline-start: auto; display: flex; align-items: center; gap: .4rem; min-height: 44px; text-decoration: none; color: var(--muted); font-weight: 600; }
.brand-account span, .client-avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--wash); color: var(--earth); font: 600 1rem/1 Georgia, serif; }
.brand-account small { font-size: .76rem; }
main { width: 100%; max-width: 940px; padding: 1.2rem clamp(1rem, 4vw, 2.4rem) 1.65rem; margin-inline: auto; min-width: 0; }
.navigation { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .3rem; background: var(--paper); }
.navigation a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .18rem; min-height: 49px; border-radius: .82rem; color: var(--muted); text-decoration: none; font-size: .7rem; font-weight: 600; }
.navigation a svg { flex: none; width: 20px; height: 20px; }
.navigation a:hover { background: var(--canvas); color: var(--accent); }
.navigation a[aria-current] { background: var(--wash); color: var(--earth); font-weight: 750; }
.heading, .toolbar, .row { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.heading, .toolbar, .spread { justify-content: space-between; }
.heading { margin-bottom: 1.05rem; gap: .55rem; }
.heading > div { min-width: 0; }
.heading > .button { flex-shrink: 0; }
.toolbar { margin: .8rem 0; }
.eyebrow { color: var(--earth); font-size: .66rem; font-weight: 750; text-transform: uppercase; letter-spacing: .115em; margin-bottom: .32rem; }
.button, button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: .5rem .85rem; border: 1px solid var(--line); border-radius: .78rem; background: var(--white); color: var(--ink); text-decoration: none; font: 650 .87rem/1.25 system-ui, sans-serif; cursor: pointer; }
.button:hover, button:hover { border-color: var(--accent); }
.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.primary:hover { background: var(--earth); border-color: var(--earth); }
button:disabled { opacity: .6; cursor: default; }
.panel, .flash, .hint { padding: .95rem; border: 1px solid var(--line); border-radius: 1.02rem; background: var(--white); box-shadow: var(--shadow); margin: .72rem 0; overflow-wrap: anywhere; }
.flash, .hint { background: var(--wash); }
.flash.error { color: #821f24; background: #fff1ef; }
.stack { display: grid; gap: .72rem; }
.stack > .button, .stack > button { justify-self: start; }
.inline-add > summary { width: fit-content; min-height: 44px; padding: .55rem .1rem; color: var(--accent); font-weight: 650; cursor: pointer; }
.inline-add > .stack { padding: 0 .15rem .55rem; }
.compact { max-width: 29rem; }
.pair, .fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .68rem; }
.fields { margin: 0 0 .7rem; }
dt, .muted { color: var(--muted); font-size: .84rem; }
dd, .preserve { white-space: pre-wrap; }
label { display: grid; align-content: start; gap: .26rem; min-width: 0; font-weight: 650; font-size: .81rem; }
input, select, textarea { display: block; width: 100%; min-width: 0; min-height: 44px; padding: .42rem .66rem; color: inherit; border: 1px solid var(--line); border-radius: .64rem; background: var(--paper); font: 400 1rem/1.35 system-ui, sans-serif; }
textarea { resize: vertical; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.agenda-toolbar { display: grid; gap: .56rem; }
.agenda-period { display: flex; align-items: center; gap: .38rem; }
.period { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; flex: 1; min-width: 0; min-height: 46px; border: 1px solid var(--line); border-radius: .88rem; background: var(--white); }
.period-arrow { display: grid; place-items: center; min-height: 44px; font-size: 1.55rem; line-height: 1; color: var(--accent); text-decoration: none; border-radius: .7rem; }
.period-arrow:hover { background: var(--wash); }
.period-label { padding: .3rem .12rem; font-size: .89rem; line-height: 1.2; text-align: center; }
.period-label::first-letter { text-transform: uppercase; }
.today-link { flex: none; display: grid; place-items: center; min-height: 44px; padding: 0 .28rem; color: var(--accent); font-size: .72rem; font-weight: 750; text-decoration: none; border-radius: .5rem; }
.today-link:hover { text-decoration: underline; }
.view-switch { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .19rem; padding: .2rem; border-radius: .85rem; background: var(--wash); }
.view-switch a { display: grid; place-items: center; min-height: 44px; padding: .25rem .65rem; border-radius: .65rem; color: var(--muted); text-decoration: none; font-size: .86rem; font-weight: 600; }
.view-switch a[aria-current] { background: var(--white); color: var(--earth); font-weight: 750; box-shadow: 0 1px 5px #563e2a1c; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .3rem; }
.calendar-weekday { color: var(--muted); font-size: .72rem; text-align: center; font-weight: 600; }
.calendar-day { display: flex; flex-direction: column; align-items: center; justify-content: space-between; min-height: 49px; padding: .25rem .1rem; background: var(--paper); border: 1px solid var(--line); border-radius: .54rem; text-decoration: none; font-variant-numeric: tabular-nums; }
.calendar-day:hover, .calendar-day[aria-current] { background: var(--wash); border-color: #d4ad95; }
.calendar-day[aria-current] > span:first-child { color: var(--accent); font-weight: 750; }
.calendar-count, .count-pill { display: inline-grid; place-items: center; padding: .12rem .4rem; border-radius: 1rem; color: var(--earth); background: var(--wash); font-size: .72rem; font-weight: 750; }
.count-pill { min-width: 1.65rem; }
.empty-note { padding: .75rem 0 .1rem; color: var(--muted); font-size: .84rem; }
.agenda-day h2::first-letter { text-transform: uppercase; }
.agenda-row { display: grid; grid-template-columns: 2.75rem minmax(0, 1fr) auto; align-items: center; gap: .55rem; padding: .64rem .54rem; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: .66rem; background: var(--paper); margin-top: .52rem; text-decoration: none; }
.agenda-row:hover { background: var(--wash); }
.appointment-clock { display: grid; font-variant-numeric: tabular-nums; line-height: 1.25; }
.appointment-clock time { color: var(--earth); font-size: .87rem; font-weight: 750; }
.appointment-clock small, .agenda-row p { color: var(--muted); font-size: .73rem; }
.agenda-row strong { display: block; overflow-wrap: anywhere; font-size: .9rem; }
.badge { width: fit-content; font-size: .68rem; line-height: 1.25; padding: .24rem .43rem; border-radius: .55rem; color: var(--earth); background: var(--wash); }
.client-search { display: grid; grid-template-columns: minmax(0, 1fr) 44px; align-items: center; gap: .12rem; padding: .13rem .18rem .13rem .37rem; background: var(--white); border: 1px solid var(--line); border-radius: .85rem; }
.client-search input { border: 0; background: transparent; font-size: 1rem; }
.client-search button { padding: 0; color: var(--accent); border: 0; background: var(--wash); border-radius: .65rem; }
.directory h2 { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.client-row, .settings-item { display: grid; align-items: center; gap: .65rem; padding: .62rem 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.client-row { grid-template-columns: 34px minmax(0, 1fr) auto; }
.client-row:first-of-type { margin-top: .32rem; }
.settings-item { grid-template-columns: minmax(0, 1fr) auto; }
.client-row:last-of-type, .settings-item:last-of-type { border-bottom: 0; }
.client-row:hover, .settings-item:hover { color: var(--accent); }
.client-row small, .settings-item small { display: block; color: var(--muted); font-size: .79rem; }
.item-chevron { color: var(--accent); font-size: 1.3rem; line-height: 1; }
.revenue-card { margin: .72rem 0; padding: 1.02rem; border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: 1.03rem; background: linear-gradient(120deg, var(--white) 38%, #faf1e9); box-shadow: var(--shadow); overflow-wrap: anywhere; }
.revenue-values { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .66rem; }
.revenue-values > div + div { border-left: 1px solid var(--line); padding-left: .67rem; }
.revenue-values h2 { color: var(--earth); font-size: .79rem; font-weight: 650; }
.amount, .metric-value { display: block; font: 500 clamp(1.23rem, 5.4vw, 2rem)/1.12 Georgia, serif; letter-spacing: -.035em; }
.amount { font-size: clamp(1.47rem, 6.5vw, 2.65rem); }
.revenue-values strong { margin-top: .35rem; }
.revenue-progress { color: var(--earth); gap: .38rem; }
.revenue-progress strong { font-variant-numeric: tabular-nums; }
.revenue-note { font-size: .72rem; color: var(--muted); }
.activity-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .63rem; margin: .72rem 0; }
.activity-metrics .panel { align-content: start; gap: .37rem; margin: 0; }
.activity-metrics h2 { font-size: .88rem; }
.activity-metrics .muted { font-size: .72rem; }
progress { width: 100%; height: .5rem; accent-color: var(--accent); }
.settings-shortcuts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .4rem; }
.settings-shortcuts a { display: grid; place-items: center; min-height: 44px; padding: .18rem; border-radius: .7rem; background: var(--wash); color: var(--earth); font-size: .79rem; font-weight: 650; text-decoration: none; }
.settings-shortcuts a:hover { background: #efdbcc; }
.settings-section { scroll-margin-top: 1rem; }
.settings-list { margin-top: -.2rem; }
[data-push-status] { margin-top: .4rem; }
@media (min-width: 720px) {
    .shell.has-navigation { display: grid; grid-template-columns: 178px minmax(0, 1fr); grid-template-rows: auto 1fr; }
    .brand { grid-column: 1 / -1; }
    .navigation { display: flex; flex-direction: column; gap: .4rem; border-right: 1px solid var(--line); padding: 1.25rem .8rem; }
    .navigation a { flex-direction: row; justify-content: start; gap: .65rem; padding: 0 .8rem; font-size: .88rem; }
    main { padding-top: 1.8rem; }
    .agenda-toolbar { grid-template-columns: minmax(14rem, 1fr) minmax(18rem, 1.4fr); align-items: center; }
    .client-search { max-width: 34rem; }
    .revenue-card { padding: 1.3rem; }
}
@media (max-width: 719px) {
    .shell.has-navigation { padding-bottom: calc(62px + env(safe-area-inset-bottom, 0px)); }
    .navigation { position: fixed; z-index: 2; inset: auto 0 0; padding: .26rem .55rem calc(.26rem + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); box-shadow: 0 -5px 20px #563e2a0c; }
    .calendar-count-label { display: none; }
}
@media (max-width: 420px) {
    .pair, .fields { grid-template-columns: 1fr; }
    .calendar-month { padding: .65rem; }
    .calendar-grid { gap: .2rem; }
    .calendar-weekday { font-size: .65rem; }
    .period-label { font-size: .79rem; }
    .panel { padding: .8rem; }
}
@media (max-width: 350px) {
    .agenda-row { grid-template-columns: 2.4rem minmax(0, 1fr); }
    .agenda-row .badge { grid-column: 2; }
    .heading > .button { padding-inline: .58rem; }
}
@media (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }
    main { animation: .24s cubic-bezier(.2,.7,.3,1) both soiyeux-in; }
    .navigation [aria-current] { animation: .2s ease-out both soiyeux-nav-in; }
    @keyframes soiyeux-in { from { opacity: .5; transform: translateX(12px); } }
    @keyframes soiyeux-nav-in { from { background-color: var(--paper); } }
}
