/* Plan 042: the rebuilt Symptoms pages (the v4 prototype, docs/prototypes/symptom-home). The app's palette, Inter,
   icons and Bello; one type scale, one surface, one secondary button; severity never carried by colour alone; motion
   only when something changes. Scoped to .so-page. */
.so-page {
  --so-gutter: var(--gs-page-px, 18px);
  --so-ink: var(--gs-text-primary);
  --so-ink-2: var(--gs-text-secondary);
  --so-surface: var(--gs-card);
  --so-line: color-mix(in srgb, var(--gs-text-primary) 9%, transparent);
  --so-fill: color-mix(in srgb, var(--gs-text-primary) 6%, var(--gs-card));
  --so-fill-strong: color-mix(in srgb, var(--gs-text-primary) 10%, var(--gs-card));
  --so-shadow: 0 0 0 1px color-mix(in srgb, var(--gs-text-primary) 6%, transparent), 0 1px 2px rgb(0 0 0 / .04), 0 6px 16px rgb(0 0 0 / .035);
  --so-radius: 20px;
  --so-ease: cubic-bezier(.23, 1, .32, 1);
  /* The severity scale is shared with the form and Today's card (symptom_scale.css, review #8). */
  --so-none: var(--gs-sev-none); --so-none-ink: var(--gs-sev-none-on);
  --so-mild: var(--gs-sev-mild); --so-mild-ink: var(--gs-sev-mild-on);
  --so-moderate: var(--gs-sev-moderate); --so-moderate-ink: var(--gs-sev-moderate-on);
  --so-severe: var(--gs-sev-severe); --so-severe-ink: var(--gs-sev-severe-on);
  --so-dash: color-mix(in srgb, var(--gs-text-primary) 28%, transparent);
  --so-good-bg: color-mix(in srgb, var(--gs-sev-none) 12%, var(--gs-card)); --so-good-ink: #1E6B38;
  --so-warn-bg: color-mix(in srgb, #E08A1E 15%, var(--gs-card)); --so-warn-ink: #8A4B00;
  /* A warning is red, never the severe plum (plan 054, milestone 4): the alert, a flagged day and its dot. */
  --so-alert-bg: color-mix(in srgb, var(--gs-sev-warn) 8%, var(--gs-card)); --so-alert-ink: var(--gs-sev-warn-text); --so-flag: var(--gs-sev-warn);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px;
  margin-inline: calc(var(--gs-page-px, 18px) * -1);
  padding: 0 var(--so-gutter) 16px;
  color: var(--so-ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}
.dark .so-page {
  --so-shadow: 0 0 0 1px rgb(255 255 255 / .07);
  --so-fill: color-mix(in srgb, #FFFFFF 7%, var(--gs-card));
  --so-fill-strong: color-mix(in srgb, #FFFFFF 12%, var(--gs-card));
  --so-good-bg: color-mix(in srgb, #4CAF6E 18%, var(--gs-card)); --so-good-ink: #9BDDB0;
  --so-warn-bg: color-mix(in srgb, #F0913F 20%, var(--gs-card)); --so-warn-ink: #F8C690;
  --so-alert-bg: color-mix(in srgb, var(--gs-sev-warn) 16%, var(--gs-card));
}
.so-page [data-band="none"] { --so-b: var(--so-none); --so-b-ink: var(--so-none-ink); }
.so-page [data-band="mild"] { --so-b: var(--so-mild); --so-b-ink: var(--so-mild-ink); }
.so-page [data-band="moderate"] { --so-b: var(--so-moderate); --so-b-ink: var(--so-moderate-ink); }
.so-page [data-band="severe"] { --so-b: var(--so-severe); --so-b-ink: var(--so-severe-ink); }
.so-page :is(h1, h2, h3, p) { margin: 0; }

/* Type roles. */
.so-h2 { color: var(--so-ink); font-size: var(--gs-type-section-title-size); line-height: 1.25; font-weight: 700; letter-spacing: -.01em; }
.so-title { color: var(--so-ink); font-size: var(--gs-type-row-title-size); line-height: 1.3; font-weight: 600; }
.so-body { color: var(--so-ink); font-size: var(--gs-type-body-size); line-height: 1.5; text-wrap: pretty; }
.so-meta { color: var(--so-ink-2); font-size: var(--gs-type-label-size); line-height: 1.35; font-weight: 500; }
.so-num { font-variant-numeric: tabular-nums; }

/* The page's own header: Back on the left of a slim bar (the title moves into it on scroll), then the large title and
   its round actions. In the native app the native bar replaces the slim one. */
.so-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding-top: 2px; }
[data-hotwire-native] .so-head { padding-top: 0; }
.so-head > div { min-width: 0; }
.so-head .so-meta { margin-top: 4px; }
.so-round { display: grid; place-items: center; width: 42px; height: 42px; flex: none; padding: 0; border: 1px solid transparent; border-radius: 50%; background: var(--so-surface); box-shadow: var(--so-shadow); color: var(--so-ink); text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.so-round svg { width: 20px; height: 20px; }
.so-section { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.so-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 36px; }
.so-section-head > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; min-width: 0; }
/* Beside a long action ("Log symptoms", review #9) the meta moves under the title whole, never split mid-phrase. */
.so-section-head > div > .so-meta { white-space: nowrap; }

/* One surface; lists inside it separated by hairlines inset past the leading visual. */
.so-surface { border: 1px solid transparent; border-radius: var(--so-radius); background: var(--so-surface); box-shadow: var(--so-shadow); }
.so-pad { padding: 16px; }
.so-list { overflow: hidden; }
.so-list > * { position: relative; }
.so-list > * + *::before { content: ""; position: absolute; top: 0; inset-inline: 68px 0; height: 1px; background: var(--so-line); }
.so-list[data-plain] > * + *::before { inset-inline-start: 16px; }
.so-list > .so-next::before { display: none; }
/* A day's last row: how many check-ins, quieter than the symptoms above it. */
.so-list > .so-day-checkins { min-height: 52px; }
.so-list > .so-day-checkins::before { inset-inline-start: 16px; }
.so-day-checkins .so-title { font-weight: 500; }
.so-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 12px 16px; border: 0; background: transparent; color: var(--so-ink); font: inherit; text-align: start; text-decoration: none; -webkit-tap-highlight-color: transparent; }
a.so-row, button.so-row { cursor: pointer; }
a.so-row:active, button.so-row:active { background: var(--so-fill); }
@media (hover: hover) { :is(a, button).so-row:hover { background: var(--so-fill); } }
.so-row-text { flex: 1; min-width: 0; display: grid; gap: 4px; }
.so-row-end { display: grid; justify-items: end; gap: 4px; flex: none; }
.so-row > svg:last-child { flex: none; width: 20px; height: 20px; color: var(--so-ink-2); }
.so-value { color: var(--so-ink); font-size: var(--gs-type-row-title-size); line-height: 1.3; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.so-value small { margin-inline-start: 4px; color: var(--so-ink-2); font-size: var(--gs-type-label-size); font-weight: 500; }

/* Buttons: one primary (filled ink), one secondary (soft pill). Nothing underlined. */
.so-pill { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border: 1px solid transparent; border-radius: 999px; background: var(--so-fill-strong); color: var(--so-ink); font: inherit; font-size: var(--gs-type-body-small-size); font-weight: 600; white-space: nowrap; text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.so-pill svg { width: 18px; height: 18px; }
.so-pill--primary { background: var(--so-ink); color: var(--gs-card); }
.so-pill--small { min-height: 34px; padding: 0 12px; font-size: var(--gs-type-label-size); }
.so-pill--block { width: 100%; min-height: 48px; padding-block: 12px; font-size: var(--gs-type-row-title-size); line-height: 1.3; white-space: normal; text-align: center; }
.so-icon-button { display: grid; place-items: center; width: 36px; height: 36px; flex: none; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--so-ink-2); cursor: pointer; }
.so-icon-button svg { width: 18px; height: 18px; }
.so-inline-form { display: contents; }

/* Chips: direction in words, never colour alone. */
.so-chip { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; min-height: 24px; padding: 4px 8px 4px 8px; border-radius: 999px; background: var(--so-fill); color: var(--so-ink); font-size: var(--gs-type-caption-size); line-height: 1.35; font-weight: 650; }
.so-chip svg { width: 13px; height: 13px; flex: none; }
.so-chip[data-tone="good"] { background: var(--so-good-bg); color: var(--so-good-ink); }
.so-chip[data-tone="warn"] { background: var(--so-warn-bg); color: var(--so-warn-ink); }
.so-chip[data-tone="plain"] { padding-inline: 8px; }
.so-row-end .so-chip { white-space: nowrap; }

/* The week picker: each day's worst rating in its dot, a tick for a clear day, a dashed ring when nothing was logged.
   The ring slides to the chosen day; a swipe (or the hidden-until-focused links) moves the week. */
.so-week { position: relative; overflow: hidden; margin-inline: -6px; touch-action: pan-y; }
.so-week-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.so-day { display: grid; justify-items: center; gap: 8px; min-width: 0; padding: 4px 0 2px; border: 0; background: none; color: var(--so-ink); font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.so-day:disabled { cursor: default; }
.so-day-letter { color: var(--so-ink-2); font-size: var(--gs-type-caption-size); font-weight: 600; }
.so-dot { position: relative; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--so-b, transparent); color: var(--so-b-ink, var(--so-ink)); font-size: var(--gs-type-body-small-size); font-weight: 700; font-variant-numeric: tabular-nums; }
.so-dot > svg { width: 18px; height: 18px; stroke-width: 2.6; }
.so-dot[data-state="empty"] { border: 1.5px dashed var(--so-dash); }
.so-dot:is([data-state="future"], [data-state="before"]) { background: var(--so-fill); }
.so-dot[data-state="flagged"] { background: var(--so-alert-bg); color: var(--so-alert-ink); }
.so-dot[data-flag]::after { content: ""; position: absolute; top: -1px; inset-inline-end: -1px; width: 10px; height: 10px; border-radius: 50%; background: var(--so-flag); box-shadow: 0 0 0 2px var(--gs-sand, var(--gs-card)); }
.so-day-date { color: var(--so-ink-2); font-size: var(--gs-type-label-size); font-weight: 500; font-variant-numeric: tabular-nums; }
.so-day[data-today] .so-day-date { color: var(--so-ink); font-weight: 700; }
.so-day:disabled :is(.so-day-date, .so-day-letter) { opacity: .5; }
.so-week-ring { position: absolute; top: 0; left: 0; width: 46px; height: 46px; border-radius: 50%; box-shadow: 0 0 0 2px var(--so-ink); pointer-events: none; opacity: 0; }
.so-week-step { position: absolute; top: 0; z-index: 2; padding: 8px 12px; border-radius: 10px; background: var(--so-surface); color: var(--so-ink); font-size: var(--gs-type-label-size); font-weight: 600; text-decoration: none; clip-path: inset(50%); }
.so-week-step:focus-visible { clip-path: none; }
.so-week-step[data-step="earlier"] { inset-inline-start: 6px; }
.so-week-step[data-step="later"] { inset-inline-end: 6px; }
.so-day-panel[hidden] { display: none; }

/* The rating ring is shared with Today's card (symptom_scale.css, review #8). On the week strip a rated day is that
   ring at the dot's size; a clear day, a warning sign and an empty day keep their dot. */
.so-dot > .so-ring { --so-ring-size: 38px; }

/* Sparklines: a bar per day (height = rating, colour = band), or per week. */
.so-spark { display: flex; align-items: flex-end; gap: 4px; height: 30px; }
.so-spark i { display: block; width: 7px; min-height: 4px; height: calc(var(--h, 0) * 2.6px + 4px); border-radius: 3.5px; background: var(--so-b, var(--so-dash)); }
.so-spark i[data-band="none"] { height: 4px; }
.so-spark i[data-band="empty"] { height: 4px; background: var(--so-fill-strong); }
/* Last 7 days: a row of cards she swipes, one per symptom; the next card peeks at the edge. */
.so-trend-rail { display: flex; gap: 12px; margin: -4px calc(var(--so-gutter) * -1) -16px; padding: 4px var(--so-gutter) 16px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scroll-padding-inline: var(--so-gutter); list-style: none; scrollbar-width: none; }
.so-trend-rail::-webkit-scrollbar { display: none; }
.so-trend-rail > li { display: flex; flex: 0 0 156px; scroll-snap-align: start; }
.so-trend-card { display: flex; flex: 1; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; padding: 16px 16px 12px; color: var(--so-ink); text-decoration: none; -webkit-tap-highlight-color: transparent; }
@media (hover: hover) { .so-trend-card:hover { background: var(--so-fill); } }
.so-trend-name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; min-height: 2.6em; overflow-wrap: anywhere; }
.so-trend-value { display: flex; align-items: baseline; gap: 4px; }
.so-trend-value b { color: var(--so-ink); font-size: var(--gs-type-page-title-size); line-height: 1; font-weight: 700; letter-spacing: -.02em; }
.so-trend-value small { color: var(--so-ink-2); font-size: var(--gs-type-label-size); font-weight: 500; }
.so-spark--card { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; width: 100%; height: auto; margin-top: auto; padding-top: 4px; }
.so-spark-day { display: grid; justify-items: center; gap: 4px; }
.so-spark-bar { display: flex; align-items: flex-end; height: 30px; }
.so-spark--card i { width: 8px; border-radius: 4px; }
.so-spark-day small { color: var(--so-ink-2); font-size: var(--gs-type-caption-size); font-weight: 600; line-height: 1; }
.so-spark-day[data-today] small { color: var(--so-ink); font-weight: 700; }
.so-next--card { padding-top: 16px; }
.so-day-panel > .so-help-today { margin-top: 0; }
.so-empty-yesterday { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--so-line); }
.so-spark--weeks { height: 34px; }
.so-spark--weeks i { width: 8px; background: var(--so-ink); height: calc(var(--h, 0) * 4px + 4px); }
.so-spark--weeks i:first-child { background: var(--so-dash); }

/* The plan card. */
.so-plan { display: grid; gap: 16px; }
.so-plan-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.so-plan-week { display: flex; flex: 1; align-items: center; gap: 12px; min-width: 0; }
.so-plan-week .so-meta, .so-plan-top .so-chip { flex: none; white-space: nowrap; }
.so-steps { display: flex; flex: 1; gap: 4px; max-width: 99px; }
.so-steps i { flex: 1; min-width: 5px; max-width: 14px; height: 5px; border-radius: 3px; background: var(--so-fill-strong); }
.so-steps i[data-on] { background: var(--so-ink); }
.so-goal { color: var(--so-ink); font-size: var(--gs-type-heading-md-size); line-height: 1.3; font-weight: 650; text-wrap: balance; }
.so-goal-rows { display: grid; margin: 0 -16px -16px; }
.so-goal-row { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 12px 16px; border-top: 1px solid var(--so-line); color: var(--so-ink); text-decoration: none; }
.so-note { display: flex; align-items: flex-start; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--so-line); }
.so-note > img { width: 36px; height: 36px; flex: none; }
.so-note .so-row-text { padding-top: 2px; }
.so-moment { display: flex; align-items: center; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--so-line); }
.so-moment > img { width: 52px; height: 52px; flex: none; }
.so-trial-line { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--so-line); color: var(--so-ink); text-decoration: none; }
.so-trial-line .so-row-text { gap: 8px; }
.so-trial-line > svg:last-child { flex: none; width: 20px; height: 20px; color: var(--so-ink-2); }
.so-trial-steps { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.so-trial-steps i { height: 6px; border-radius: 3px; background: var(--so-fill-strong); }
.so-trial-steps i[data-on] { background: var(--so-none); }

/* Warning banner. */
.so-alert { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 16px; border-radius: var(--so-radius); background: var(--so-alert-bg); }
.so-alert-icon { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 50%; background: var(--so-surface); color: var(--so-alert-ink); }
.so-alert-icon svg { width: 20px; height: 20px; }
.so-alert a.so-row-text { color: inherit; text-decoration: none; }
.so-alert .so-pill { background: var(--so-surface); }

/* Day empty state, next step, new-user card. */
.so-empty { display: grid; gap: 12px; padding: 16px 16px; }
.so-empty-actions { display: flex; flex-wrap: wrap; gap: 8px; }
/* Day one (review #13): the page's one card, its two answers side by side, Log symptoms filled. */
.so-day-one .so-empty-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.so-day-one .so-empty-actions > form { display: grid; }
.so-day-one .so-empty-actions .so-pill { width: 100%; min-height: 44px; font-size: var(--gs-type-body-small-size); }
.so-next { display: grid; gap: 12px; padding: 2px 16px 16px; }
.so-next-why { display: flex; align-items: center; gap: 8px; }
.so-next-why svg { width: 15px; height: 15px; color: var(--so-warn-ink); }
.so-routine { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 16px; background: var(--so-fill); color: var(--so-ink); text-decoration: none; }
.so-routine img { width: 48px; height: 48px; flex: none; border-radius: 12px; object-fit: cover; outline: 1px solid oklch(0 0 0 / .1); outline-offset: -1px; }
.dark .so-routine img { outline-color: oklch(1 0 0 / .1); }
.so-play { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 50%; background: var(--so-ink); color: var(--gs-card); }
.so-play svg { width: 15px; height: 15px; translate: 1px 0; }
.so-report { display: grid; gap: 16px; }
.so-report-top { display: flex; align-items: center; gap: 12px; }
.so-report-icon { display: grid; place-items: center; width: 42px; height: 42px; flex: none; border-radius: 12px; background: var(--so-fill); color: var(--so-ink); }
.so-days7 { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.so-days7 span { display: grid; justify-items: center; gap: 4px; color: var(--so-ink-2); font-size: var(--gs-type-caption-size); font-weight: 600; }
.so-days7 i { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--so-dash); }
.so-days7 i[data-on] { border-color: var(--so-ink); background: var(--so-ink); color: var(--gs-card); }
.so-days7 i svg { width: 14px; height: 14px; stroke-width: 2.6; }

/* Segmented control with a sliding thumb. */
.so-seg { position: relative; display: grid; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; padding: 4px; border-radius: 13px; background: var(--so-fill-strong); }
.so-seg > :is(a, button) { position: relative; z-index: 1; display: grid; place-items: center; min-height: 36px; border: 0; border-radius: 10px; background: transparent; color: var(--so-ink-2); font: inherit; font-size: var(--gs-type-body-small-size); font-weight: 600; text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.so-seg > [aria-current="true"] { color: var(--so-ink); }
.so-seg-thumb { position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc((100% - 6px) / var(--n, 3)); border-radius: 10px; background: var(--so-surface); box-shadow: 0 1px 3px rgb(0 0 0 / .12), 0 0 0 .5px rgb(0 0 0 / .04); transform: translateX(calc(var(--i, 0) * 100%)); }
.dark .so-seg-thumb { background: color-mix(in srgb, #FFFFFF 18%, var(--gs-card)); }

/* The symptom chart: rounded bars coloured by band, a dash for a day with nothing logged. */
.so-chart-card { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 16px 16px 16px; }
.so-big { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.so-big > b { color: var(--so-ink); font-size: var(--gs-type-page-title-size); line-height: 1.1; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.so-big > span { color: var(--so-ink); font-size: var(--gs-type-row-title-size); font-weight: 600; }
.so-chart svg { display: block; width: 100%; height: 170px; overflow: visible; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.so-chart svg:focus-visible { outline: 2px solid var(--so-ink); outline-offset: 4px; border-radius: 8px; }
/* The chart keeps its own marks (review #8): its axis and plan labels are SVG text sized to the drawing, not a type role. */
.so-axis { fill: var(--so-ink-2); font-size: 11px; font-weight: 500; }
.so-grid-line { stroke: var(--so-line); stroke-width: 1; }
.so-chart rect[data-band] { fill: var(--so-b); }
.so-chart rect[data-band="empty"] { fill: var(--so-fill-strong); }
.so-bar-mark { transform-box: fill-box; transform-origin: 50% 100%; }
.so-bar-mark[data-selected] { stroke: var(--so-ink); stroke-width: 2; }
.so-plan-mark line { stroke: var(--so-ink-2); stroke-width: 1; stroke-dasharray: 2 4; }
.so-plan-mark text { fill: var(--so-ink-2); font-size: 11px; font-weight: 600; }
.so-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 0; padding: 0; list-style: none; color: var(--so-ink-2); font-size: var(--gs-type-caption-size); font-weight: 500; }
.so-legend li { display: inline-flex; align-items: center; gap: 8px; }
.so-legend i { display: block; width: 8px; height: 8px; border-radius: 3px; background: var(--so-b, var(--so-fill-strong)); }
.so-clue { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.so-kicker { display: flex; align-items: center; gap: 8px; color: var(--so-ink-2); font-size: var(--gs-type-caption-size); font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.so-kicker svg { width: 15px; height: 15px; }
.so-range[hidden] { display: none; }

/* History: the month, each day's worst rating as a small bar (height and colour), a tick for a clear day. */
.so-month-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.so-month-nav { display: flex; gap: 8px; }
.so-month-nav .so-round[aria-disabled="true"] { opacity: .35; pointer-events: none; }
.so-cal { padding: 12px 8px 16px; }
.so-cal-viewport { position: relative; overflow: hidden; touch-action: pan-y; }
.so-cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); row-gap: 4px; }
.so-cal-grid > span { display: grid; place-items: center; height: 28px; color: var(--so-ink-2); font-size: var(--gs-type-caption-size); font-weight: 600; }
.so-cal-day { display: grid; justify-items: center; align-content: start; gap: 4px; height: 54px; min-width: 0; padding: 4px 0 0; color: var(--so-ink); text-decoration: none; -webkit-tap-highlight-color: transparent; }
.so-cal-day[aria-disabled="true"] { color: color-mix(in srgb, var(--so-ink-2) 55%, transparent); pointer-events: none; }
.so-cal-n { position: relative; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; font-size: var(--gs-type-body-small-size); font-weight: 500; font-variant-numeric: tabular-nums; }
.so-cal-day[data-today] .so-cal-n { font-weight: 700; box-shadow: inset 0 0 0 1.5px var(--so-dash); }
.so-cal-day[aria-current="date"] .so-cal-n { background: var(--so-ink); color: var(--gs-card); box-shadow: none; font-weight: 700; }
.so-cal-n[data-flag]::after { content: ""; position: absolute; top: 0; inset-inline-end: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--so-flag); box-shadow: 0 0 0 2px var(--so-surface); }
.so-mark { display: block; width: 14px; border-radius: 3px; background: var(--so-b); }
.so-mark[data-band="mild"] { height: 5px; }
.so-mark[data-band="moderate"] { height: 9px; }
.so-mark[data-band="severe"] { height: 13px; }
.so-mark[data-band="none"] { display: grid; place-items: center; width: auto; height: auto; background: none; color: var(--so-none); }
.so-mark[data-band="none"] svg { width: 13px; height: 13px; stroke-width: 3; }
.so-cal-legend { justify-content: center; margin-top: 12px; }
.so-cal-legend i[data-band="mild"] { height: 5px; }
.so-cal-legend i[data-band="moderate"] { height: 9px; }
.so-cal-legend i[data-band="severe"] { height: 13px; }
.so-cal-legend svg { width: 13px; height: 13px; color: var(--so-none); stroke-width: 3; }

/* For your doctor. */
.so-table { width: 100%; border-collapse: collapse; font-size: var(--gs-type-body-small-size); font-variant-numeric: tabular-nums; }
.so-table thead th { padding: 0 0 8px; color: var(--so-ink-2); font-size: var(--gs-type-caption-size); font-weight: 600; text-align: end; }
.so-table :is(th, td):first-child { text-align: start; }
.so-table :is(td, tbody th) { padding: 12px 0 12px 8px; border-top: 1px solid var(--so-line); color: var(--so-ink); text-align: end; }
.so-table tbody th { padding-inline-start: 0; font-weight: 600; }
/* Plan 046: routines tried, for the doctor: the routine reads as words, the numbers stay on one line. */
.so-table--tried :is(th, td):nth-child(2) { text-align: start; }
.so-table--tried td:nth-child(n+3) { white-space: nowrap; }
/* Plain wrapping keeps a routine's name whole: "Push & release ·" over "7 → 4" on the narrowest phones. */
.so-tried { font-variant-numeric: tabular-nums; text-wrap: wrap; }
.so-tried-note { margin: 8px 4px 0; }
/* For your doctor: how she described each symptom; the line saying where it comes from sits as What you've tried's does. */
.so-described-note { margin: 8px 4px 0; }
#symptom-doctor-described .so-row { padding-block: 12px; }
.so-bullets { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.so-bullets li { display: flex; gap: 12px; color: var(--so-ink); font-size: var(--gs-type-body-size); line-height: 1.5; }
.so-bullets li::before { content: ""; flex: none; width: 6px; height: 6px; margin-top: .55em; border-radius: 50%; background: var(--so-ink-2); }
.so-actions-col { display: grid; gap: 12px; }

/* Motion: state changes only, never on arrival. Short, ease-out, interruptible. */
@media (prefers-reduced-motion: no-preference) {
  .so-week-ring { transition: transform 260ms var(--so-ease), opacity 150ms ease-out; }
  .so-seg-thumb { transition: transform 260ms var(--so-ease); }
  .so-page :is(.so-pill, .so-round, .so-routine, .so-day, .so-cal-day, .so-trend-card, .so-seg > *):not(:disabled) { transition: scale 150ms ease-out, background-color 150ms ease-out; }
  .so-page :is(.so-pill, .so-round, .so-routine, .so-day, .so-cal-day, .so-trend-card, .so-seg > *):not(:disabled):active { scale: .96; }
  .so-dot[data-just-saved] { animation: so-pop 260ms var(--so-ease) both; }
}
@keyframes so-pop { from { scale: .85; opacity: .4; } }


/* Every control shows where the keyboard is. */
.so-page :is(a, button, [tabindex]):focus-visible { outline: 2px solid var(--so-ink); outline-offset: 2px; }
.so-page .so-row:focus-visible { outline-offset: -2px; border-radius: inherit; }

/* A day's check-ins and one check-in, in their sheets (owner, 2026-11-19): the same rows, rings and type, without the
   page's own gutters. Under each symptom of a check-in, only what she gave, aligned with its name. */
.so-page.so-in-sheet { gap: 16px; margin-inline: 0; padding: 0 0 4px; }
.so-check-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.so-check-head > div { display: grid; gap: 2px; min-width: 0; }
.so-check-item { display: grid; }
.so-check-rows { display: grid; gap: 8px; margin: -4px 0 0; padding: 0 16px 16px 68px; }
/* Her answers get the wider column: they are what she reads. */
.so-check-rows > div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 12px; }
.so-check-rows dt { color: var(--so-ink-2); font-size: var(--gs-type-label-size); line-height: 1.35; font-weight: 500; text-wrap: balance; }
.so-check-rows dd { margin: 0; color: var(--so-ink); font-size: var(--gs-type-body-small-size); line-height: 1.4; overflow-wrap: anywhere; text-wrap: pretty; }
.so-in-sheet .so-row-text .so-title { text-wrap: pretty; }
/* A symptom's day: each thing that helped on its own line, a routine's numbers under its name. */
.so-check-line, .so-check-sub { display: block; }
.so-check-line + .so-check-line { margin-top: 4px; }
.so-check-sub { color: var(--so-ink-2); font-size: var(--gs-type-label-size); font-variant-numeric: tabular-nums; }
.so-check-note { display: grid; gap: 4px; }
.so-check-note p:last-child { color: var(--so-ink); font-size: var(--gs-type-body-size); line-height: 1.5; white-space: pre-line; }

/* A No just saved on this page: its moment under the day's line, once. */
.so-clear-moment { display: flex; align-items: flex-start; gap: 8px; margin: -4px 0 0; color: var(--so-ink-2); font-size: var(--gs-type-label-size); line-height: 1.35; font-weight: 500; }
.so-clear-moment svg { flex: none; width: 14px; height: 14px; margin-top: 2px; color: var(--so-none); }
.so-clear-moment b { color: var(--so-ink); font-weight: 600; }
/* One symptom on one day: Edit under each check-in, aligned with its name; the symptom over time as the last row. */
.so-check-actions { display: flex; align-items: center; gap: 8px; padding: 0 16px 16px 68px; }
/* Delete beside Edit: red words without a fill (4.5:1 on the card, not on the grey fill), the platform's destructive button. */
.so-pill--danger { background: transparent; color: var(--gs-red); }
@media (hover: hover) { .so-pill--danger:hover { background: var(--so-fill); } }
.so-check-rows + .so-check-actions { margin-top: -4px; }
.so-over-time { min-height: 52px; }

/* Plan 049, milestone 3: what her days found, once. A new clue near the top, its line in Bello's note, and her first
   week ready in the countdown's place; each opens where it lives. */
.so-clue-news > img { width: 36px; height: 36px; flex: none; }
.so-note-clue { justify-self: start; margin-top: 8px; }
a.so-report--ready { display: block; color: var(--so-ink); text-decoration: none; -webkit-tap-highlight-color: transparent; }
a.so-report--ready .so-row-text { gap: 4px; }
a.so-report--ready .so-report-top > svg:last-child { flex: none; width: 20px; height: 20px; color: var(--so-ink-2); }
a.so-report--ready:active { background: var(--so-fill); }
@media (hover: hover) { a.so-report--ready:hover { background: var(--so-fill); } }

/* Plan 054, milestone 6: her month, when it turns (symptoms/month, Symptoms::MonthRecap). Bello, one line, one circle a
   day in its band's colour (an answered day without a rating a soft grey, a day without an answer an empty ring), and
   what helped. The days fill in as a quick wave (symptom-month-recap sets data-reveal); with reduced motion, or on a
   plain evening, they're simply there. */
.so-recap { display: grid; justify-items: center; gap: 16px; padding: 4px 0 16px; text-align: center; }
.so-recap-page { padding: 16px var(--gs-page-px, 20px); }
.so-recap-bello { width: 64px; height: 64px; object-fit: contain; object-position: 50% 100%; transform-origin: 50% 92%; }
p.so-recap-line { margin: 0; color: var(--gs-text-primary); font-size: var(--gs-type-body-size); line-height: 1.4; text-wrap: balance; }
.so-recap-month { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px 4px; justify-self: stretch; }
.so-recap-wd { color: var(--gs-text-secondary); font-size: 11px; line-height: 1; text-align: center; }
.so-recap-day { justify-self: center; width: 24px; height: 24px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--gs-text-primary) 14%, transparent); }
.so-recap-day[data-pad] { visibility: hidden; }
.so-recap-day[data-answered] { background: color-mix(in srgb, var(--gs-text-primary) 10%, var(--gs-card)); box-shadow: none; }
.so-recap-day[data-band="none"] { background: color-mix(in srgb, var(--gs-sev-none) 45%, var(--gs-card)); }
.so-recap-day[data-band="mild"] { background: color-mix(in srgb, var(--gs-sev-mild) 60%, var(--gs-card)); }
.so-recap-day[data-band="moderate"] { background: color-mix(in srgb, var(--gs-sev-moderate) 60%, var(--gs-card)); }
.so-recap-day[data-band="severe"] { background: color-mix(in srgb, var(--gs-sev-severe) 60%, var(--gs-card)); }
.so-recap-helped { display: grid; gap: 2px; justify-self: stretch; padding: 12px 14px; border: 1px solid var(--gs-border); border-radius: 18px; text-align: start; }
p.so-recap-helped-title { margin: 0; font-size: var(--gs-type-body-size); font-weight: 600; }
p.so-recap-helped-meta { margin: 0; color: var(--gs-text-secondary); font-size: var(--gs-type-label-size); font-variant-numeric: tabular-nums; }
@keyframes so-recap-day-in { from { opacity: 0; transform: scale(.55); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: no-preference) {
  .so-recap-month[data-reveal] .so-recap-day:not([data-pad]) { animation: so-recap-day-in 260ms cubic-bezier(.2, 0, 0, 1) both; animation-delay: calc(var(--i) * 14ms); }
}
