/* ============================================================================
   DEMO session-note mockup — layout/palette still styled off elizai-v2's
   product theme (C:\Users\dsing\elizai-v2\app\theme.ts / globals.css): bg
   #f4f1ed, card #fff (radius 16, soft shadow), text #2f2f2f, heading
   #4e4e4e, button #b8a295 / hover #9e8679. v7: typeface changed to Crimson
   Text, chosen for a client-facing register, applied here too so the
   whole prototype (not just /status) reads as one client-facing register.
   Self-hosted, same four files status.css already loads from
   board/public/fonts/ — declared again here (not shared via one @import)
   because this file still needs to load standalone.
   ========================================================================== */
@font-face {
  font-family: 'Crimson Text';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/crimson-text-400.woff2) format('woff2');
}
@font-face {
  font-family: 'Crimson Text';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(fonts/crimson-text-600.woff2) format('woff2');
}
@font-face {
  font-family: 'Crimson Text';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(fonts/crimson-text-700.woff2) format('woff2');
}
@font-face {
  font-family: 'Crimson Text';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/crimson-text-400-italic.woff2) format('woff2');
}

:root {
  --bg: #f4f1ed;
  --text: #2f2f2f;
  --heading: #4e4e4e;
  --card: #ffffff;
  --border: #ddd;
  --inner-bg: #fafafa;
  --button: #b8a295;
  --button-hover: #9e8679;
  --button-secondary: #cfc4b8;
  --button-secondary-hover: #bfb2a3;
  --accent-active: #4a7c59;
  --accent-idle: #c56c6c;
  --font: 'Crimson Text', Georgia, 'Times New Roman', serif;
}

* { box-sizing: border-box; }

html, body {
  max-width: 100vw;
  overflow-x: hidden;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

/* Form controls never inherit font by default (the same gap fixed in
   status.css when Crimson Text was adopted there) — force them onto the
   page font so every input/select/button in the session table matches. */
input, textarea, select, button { font-family: var(--font); }

.skip {
  position: absolute; left: -999px; top: 0; z-index: 10;
  background: var(--text); color: #fff; padding: 10px 16px; font-family: var(--font);
}
.skip:focus { left: 12px; top: 12px; }

h1, h2, h3, h4 { color: var(--heading); font-weight: 500; margin: 0; }

.mock-shell {
  width: 100%;
  margin: 0;
  padding: clamp(20px, 3vw, 40px) clamp(20px, 5vw, 56px) 64px;
}

/* v7: simple top-level nav shared by /mockup and /schedule, with room left
   for the Information/Syntonics tabs v8 adds — a plain flex row of links,
   not a component that needs to know how many tabs exist yet. */
.proto-nav {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
}
.proto-nav__link {
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: .9rem;
  font-weight: 600;
  color: var(--heading);
  text-decoration: none;
  background: var(--card);
}
.proto-nav__link:hover { border-color: var(--button); }
.proto-nav__link.is-current { background: var(--button); border-color: var(--button); color: #fff; }

.mock-topbar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.mock-eyebrow {
  margin: 0;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--button-hover);
}
.mock-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-top: 4px;
}
.mock-back {
  font-size: .9rem;
  color: var(--button-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---- action row: round buttons that launch the capture/progress flows or
   switch to search/reports. Replaces the old flat tab strip. Stays visible
   across every view (it is the way back into an action, not a per-view
   indicator), and lives above the patient file. ---- */
.action-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 28px 0 0;
}
.round-btn {
  font-family: var(--font);
  font-size: .92rem;
  font-weight: 600;
  color: var(--heading);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 12px 20px;
  min-height: 46px;
  cursor: pointer;
}
.round-btn:hover { border-color: var(--button); color: var(--text); }
.round-btn:focus-visible { outline: 2px solid var(--button-hover); outline-offset: 2px; }
.round-btn.is-current { border-color: var(--button); color: var(--text); background: #f3ece7; }
.round-btn--primary {
  background: var(--button);
  border-color: var(--button);
  color: #fff;
}
.round-btn--primary:hover { background: var(--button-hover); border-color: var(--button-hover); color: #fff; }
.round-btn--secondary {
  background: var(--inner-bg);
  border-color: var(--border);
  color: var(--button-hover);
}
.round-btn--secondary:hover { border-color: var(--button); }

/* ---- tool band: Filters + Summary, given their own row with a subtly
   different background so they read as a distinct reports toolbar, not
   part of the primary write-a-note action cluster above. ---- */
.tool-band {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 12px 0 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: #f0e6d9;
  border: 1px solid #e3d5c2;
}
.tool-band__label {
  font-size: .74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--button-hover);
  margin-right: 2px;
}
.tool-band__btn { min-height: 38px; padding: 8px 16px; font-size: .86rem; background: #fff; }

.mock-panel { display: none; margin-top: 24px; }
.mock-panel.is-active { display: block; }

/* ---- patient page view ---- */
.pcard {
  background: var(--card);
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  padding: clamp(18px, 3vw, 28px);
  margin-bottom: 20px;
}

.pheader__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}
.pheader__name { font-size: 1.4rem; color: var(--text); }
.pheader__nickname { font-size: .95rem; color: var(--heading); font-weight: 400; }
.pheader__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--inner-bg);
  border: 1px solid var(--border);
  color: var(--heading);
  white-space: nowrap;
}
.pheader__badge--yes { color: var(--accent-active); border-color: #cfe3d4; background: #eef6f0; }
.pheader__badge--no { color: var(--accent-idle); border-color: #f0d7d7; background: #fbeeee; }

.pfields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px 24px;
  margin-top: 18px;
}
.pfield__label {
  margin: 0 0 3px;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--button-hover);
}
.pfield__value {
  margin: 0;
  font-size: .95rem;
  line-height: 1.5;
  color: var(--text);
}
.pfield--wide { grid-column: 1 / -1; }

.psection { margin-top: 22px; }
.psection__label {
  margin: 0 0 6px;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--button-hover);
}
.psection__body {
  margin: 0;
  font-size: .95rem;
  line-height: 1.6;
  background: var(--inner-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}

/* ---- session list: newest-first cards, mirrors the source's row-per-session
   grid but rendered as readable cards instead of a 10-column table ---- */
.slist-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 28px 0 12px;
  flex-wrap: wrap;
}
.slist-heading__left { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.slist-heading h3 { font-size: 1.05rem; }
.slist-heading__progress-btn { min-height: 36px; padding: 7px 14px; font-size: .82rem; }
.slist-count { font-size: .85rem; color: var(--heading); }

/* ---- shared form fields (used by demographics edit, new-patient modal,
   progress-check band row, and inline session-table editing) ---- */
.cform-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.cfield { display: flex; flex-direction: column; gap: 6px; }
.cfield--wide { grid-column: 1 / -1; }
.cfield label {
  font-size: .8rem;
  font-weight: 700;
  color: var(--heading);
}
.cfield__opt { font-weight: 400; text-transform: none; color: #9a9a9a; font-size: .78rem; }
.cfield input,
.cfield select,
.cfield textarea {
  font-family: var(--font);
  font-size: .95rem;
  color: var(--text);
  background: var(--inner-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  resize: vertical;
}
.cfield input:focus-visible,
.cfield select:focus-visible,
.cfield textarea:focus-visible {
  outline: 2px solid var(--button-hover);
  outline-offset: 1px;
}

.cform-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 22px;
  flex-wrap: wrap;
}
.eliz-btn {
  font-family: var(--font);
  background: var(--button);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px 22px;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
}
.eliz-btn:hover { background: var(--button-hover); }
.eliz-btn-secondary {
  background: var(--button-secondary);
  color: var(--text);
}
.eliz-btn-secondary:hover { background: var(--button-secondary-hover); }
.cform-status { font-size: .88rem; color: var(--heading); }
.cform-status.is-ok { color: var(--accent-active); font-weight: 600; }

/* ---- generic help text block, used above search and anywhere a short
   explanatory line sits above form controls ---- */
.panel-help {
  font-size: .9rem;
  line-height: 1.55;
  color: var(--heading);
  background: var(--inner-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 0 0 18px;
}

.mock-foot {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: .82rem;
  line-height: 1.6;
  color: #8a8a8a;
}

/* ---- field tiering (patient header): required / usually-filled / more-fields --- */
.tier-label {
  margin: 20px 0 4px;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #9a9a9a;
}
.pcard > .tier-label:first-of-type { margin-top: 4px; }
.tier-label__note {
  text-transform: none;
  font-weight: 400;
  letter-spacing: normal;
  color: #b3b3b3;
  margin-left: 4px;
}
.pfield__opt {
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
  color: #b3b3b3;
  font-size: .75em;
}

.disclosure.more-fields {
  margin-top: 20px;
  border-top: 1px solid var(--border);
  padding-top: 4px;
}
.disclosure.more-fields > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 4px;
  font-family: var(--font);
  font-size: .85rem;
  font-weight: 700;
  color: var(--heading);
}
.disclosure.more-fields > summary::-webkit-details-marker { display: none; }
.disclosure.more-fields > summary::marker { content: ''; }
.disclosure__chev { width: 11px; height: 11px; flex: 0 0 auto; color: var(--heading); transition: transform .2s ease; }
.disclosure[open] > summary .disclosure__chev { transform: rotate(180deg); }
.disclosure.more-fields .disclosure__body { padding-top: 6px; }
@media (prefers-reduced-motion: reduce) {
  .disclosure__chev { transition: none; }
}

.proto-note {
  margin: 4px 0 16px;
  font-size: .85rem;
  color: var(--heading);
  background: var(--inner-bg);
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 8px 12px;
}

/* ---- MRN ---- */
.pheader__mrn {
  margin: 2px 0 0;
  font-size: .82rem;
  color: #9a9a9a;
  font-variant-numeric: tabular-nums;
}

/* ---- next appointments (v7, links out to /schedule) ---- */
.pheader__next-appts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: 10px 0 0;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--inner-bg);
  border: 1px solid var(--border);
}
.pheader__next-appts-label {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--heading);
}
.pheader__next-appt {
  font-size: .88rem;
  color: var(--button-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.pheader__next-appts-empty {
  margin: 10px 0 0;
  font-size: .85rem;
  color: #9a9a9a;
}

/* ---- activity report ---- */
.disclosure.activity-report { margin-top: 24px; }
.report-table-wrap { overflow-x: auto; }
.report-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.report-table th, .report-table td { text-align: left; padding: 8px 10px; vertical-align: top; }
.report-table thead th {
  border-bottom: 1px solid var(--border);
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #9a9a9a;
}
.report-table tbody tr { border-bottom: 1px solid var(--border); }
.report-table tbody tr:last-child { border-bottom: none; }
.report-table--clickable tbody tr:hover { background: var(--inner-bg); cursor: pointer; }
.report-table--clickable tbody tr:focus-visible { outline: 2px solid var(--button-hover); outline-offset: -2px; }
.report-table td:first-child { white-space: nowrap; font-weight: 600; }
.report-table td:nth-child(2) { white-space: nowrap; color: var(--heading); }
.report-table__empty { color: #9a9a9a; font-style: italic; }

/* ---- shared "edited" timestamp tag, shown on any row that has a
   sessionEdits/pcEdits/added-row edit applied ---- */
.session__edited-tag {
  font-size: .75rem;
  color: #9a9a9a;
  margin-left: 8px;
  display: inline-block;
}

/* ---- search ---- */
.search-row { margin-top: 16px; }
#searchInput {
  width: 100%;
  font-family: var(--font);
  font-size: 1rem;
  color: var(--text);
  background: var(--inner-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}
#searchInput:focus-visible { outline: 2px solid var(--button-hover); outline-offset: 1px; }
.search-results { margin-top: 18px; }
.search-hit {
  display: block;
  width: 100%;
  text-align: left;
  font-family: var(--font);
  background: var(--inner-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
  cursor: pointer;
}
.search-hit:hover { border-color: var(--button); }
.search-hit__title { font-size: .95rem; font-weight: 700; color: var(--text); }
.search-hit__meta { font-size: .8rem; color: var(--heading); margin-top: 2px; }
.search-hit__snippet { font-size: .85rem; color: var(--heading); margin-top: 6px; line-height: 1.5; }
.search-hit__snippet mark { background: #f3ece0; color: var(--text); border-radius: 3px; padding: 0 2px; }
.search-empty { color: #9a9a9a; font-size: .9rem; }
.search-flash { outline: 3px solid var(--button); outline-offset: 3px; border-radius: 14px; }

/* ============================================================================
   v3 additions: left week navigator, editable demographics, goals checklist,
   badges, dirty-date flag-and-fix, quick phrases, filters/period summary,
   print stylesheet.
   ========================================================================== */

/* ---- layout shell: navigator + main content ---- */
.nav-toggle {
  display: none;
  width: 100%;
  margin-top: 18px;
  font-family: var(--font);
  font-size: .95rem;
  font-weight: 600;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
  text-align: left;
}
.mock-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  margin-top: 18px;
}
.mock-main { flex: 1; min-width: 0; }

/* nav-rail is a fixed-height flex column: "Open chart" + recents stay put
   at the top, "+ New patient" stays put at the bottom, and only the day
   calendar in the middle (.nav-days-scroll) scrolls. This is what lets the
   calendar be continuously scrollable — past and future — without also
   scrolling the open-chart/recents controls out of reach. */
.nav-rail {
  flex: 0 0 240px;
  width: 240px;
  height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  background: var(--card);
  border-radius: 14px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.05);
  padding: 16px;
  overflow: hidden;
  position: sticky;
  top: 16px;
}
.nav-demo-note {
  margin: 0 0 12px;
  font-size: .78rem;
  color: var(--button-hover);
  font-style: italic;
}

/* ---- Open chart + recently opened charts: sits above the day-by-day
   navigator, top of the left column. Navigator itself stays navigation-only
   (no write-a-note affordance). ---- */
.nav-top { flex: 0 0 auto; margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.nav-openchart-btn {
  width: 100%;
  font-family: var(--font);
  font-size: .88rem;
  font-weight: 700;
  color: #fff;
  background: var(--button);
  border: none;
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  text-align: left;
}
.nav-openchart-btn:hover { background: var(--button-hover); }
.nav-recents { margin-top: 12px; }
.nav-recents__heading {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #9a9a9a;
  margin: 0 0 6px;
}
.nav-recents__empty { font-size: .78rem; color: #b3b3b3; margin: 0; font-style: italic; }
.nav-recent__btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  width: 100%;
  text-align: left;
  font-family: var(--font);
  background: transparent;
  border: none;
  border-radius: 6px;
  padding: 5px 4px;
  cursor: pointer;
}
.nav-recent__btn:hover { background: var(--inner-bg); }

/* Two-line navigator name notation: the abbreviated first-3+last-3 form
   (a compact shorthand, e.g. "JamExa" for Jamie Example)
   is the scannable primary label; the full name renders smaller beneath
   it. Used in both the day-by-day list and the recents list. */
.nav-name__abbrev { display: block; font-size: .88rem; font-weight: 700; color: var(--text); letter-spacing: .01em; }
.nav-name__full { display: block; font-size: .72rem; color: #9a9a9a; font-weight: 400; }

/* ---- continuously scrollable day calendar: the middle, flexible region
   of .nav-rail's column layout. Renders many weekday blocks in a row
   (past above, future below) and scrolls on its own, independent of the
   open-chart/recents block above and the "+ New patient" control below. ---- */
.nav-days-scroll {
  flex: 1 1 auto;
  min-height: 100px;
  overflow-y: auto;
  margin: 0 -4px;
  padding: 0 4px;
}
.nav-day { margin-bottom: 16px; scroll-margin-top: 4px; }
.nav-day__heading {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #9a9a9a;
  margin: 0 0 8px;
}
.nav-day--today .nav-day__heading { color: var(--button-hover); }
.nav-day__empty { font-size: .8rem; color: #b3b3b3; margin: 0; font-style: italic; }
.nav-patient { margin-bottom: 6px; }
.nav-patient__btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  text-align: left;
  font-family: var(--font);
  background: var(--inner-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
}
.nav-patient__btn:hover { border-color: var(--button); }
.nav-patient__btn--muted { opacity: .72; }
.nav-patient__time { font-size: .7rem; color: #9a9a9a; font-variant-numeric: tabular-nums; }
.nav-badge {
  display: inline-block;
  font-size: .65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  margin-top: 3px;
}
.nav-badge--gap { background: #fbeeee; color: var(--accent-idle); }
.nav-add { flex: 0 0 auto; margin-top: 4px; padding-top: 12px; border-top: 1px solid var(--border); }
.nav-add__btn {
  width: 100%;
  font-family: var(--font);
  font-size: .84rem;
  font-weight: 600;
  color: var(--button-hover);
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
}

@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .mock-layout { display: block; }
  .nav-rail {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: min(84vw, 300px);
    height: 100vh;
    border-radius: 0;
    transform: translateX(-100%);
    transition: transform .2s ease;
    z-index: 20;
    box-shadow: 4px 0 20px rgba(0,0,0,0.15);
  }
  .nav-rail.is-open { transform: translateX(0); }
  @media (prefers-reduced-motion: reduce) { .nav-rail { transition: none; } }
}


/* ---- header badges: completeness / gap / dirty-date ---- */
.pheader__badges { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.pct-badge, .gap-badge, .dirty-badge {
  display: inline-block;
  font-size: .74rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
  border: 1px solid transparent;
}
.pct-badge--high { background: #eef6f0; color: var(--accent-active); border-color: #cfe3d4; }
.pct-badge--mid { background: #fbf4e6; color: #a67c1e; border-color: #eddcb0; }
.pct-badge--low { background: #fbeeee; color: var(--accent-idle); border-color: #f0d7d7; }
.gap-badge { background: #fbeeee; color: var(--accent-idle); border-color: #f0d7d7; }
.dirty-badge {
  background: var(--inner-bg); color: var(--button-hover); border: 1px dashed var(--border);
  cursor: pointer; font-family: var(--font);
}

.pending-review-badge {
  display: inline-block;
  margin-top: 4px;
  font-size: .68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fbf4e6;
  color: #a67c1e;
  border: 1px solid #eddcb0;
  cursor: help;
}

/* ---- editable demographics ---- */
.header-edit-btn {
  margin-top: 14px;
  font-family: var(--font);
  font-size: .82rem;
  font-weight: 600;
  color: var(--button-hover);
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 14px;
  cursor: pointer;
}
.header-edit-btn:hover { border-color: var(--button); }
.pedit-form { margin-top: 18px; }
.edit-error { font-size: .85rem; color: var(--accent-idle); font-weight: 600; min-height: 1.2em; margin: 10px 0 0; }

/* ---- goals checklist ---- */
.goals-card__title { font-size: 1.05rem; margin-bottom: 14px; }
.goals-list { display: flex; flex-direction: column; gap: 12px; }
.goal-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}
.goal-row:first-child { border-top: none; padding-top: 0; }
.goal-row__text { margin: 0; font-size: .92rem; color: var(--text); flex: 1; min-width: 200px; }
.goal-row__toggles { display: flex; gap: 8px; }
.goal-toggle {
  font-family: var(--font);
  font-size: .8rem;
  font-weight: 600;
  color: var(--heading);
  background: var(--inner-bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
}
.goal-toggle.is-progressing { background: #fbf4e6; border-color: #eddcb0; color: #a67c1e; }
.goal-toggle.is-met { background: #eef6f0; border-color: #cfe3d4; color: var(--accent-active); }

/* ---- session counter / progress bar ---- */
.progress-wrap { margin: 16px 0; }
.progress-label { margin: 0 0 6px; font-size: .85rem; color: var(--heading); font-weight: 600; }
.progress-track { height: 8px; border-radius: 999px; background: var(--inner-bg); overflow: hidden; }
.progress-fill { height: 100%; background: var(--button); border-radius: 999px; }
.progress-due-flag {
  display: inline-block;
  margin-top: 8px;
  font-size: .78rem;
  font-weight: 700;
  color: #a67c1e;
  background: #fbf4e6;
  border: 1px solid #eddcb0;
  border-radius: 999px;
  padding: 4px 10px;
}
.print-btn { margin: 4px 0 16px; }

/* ---- dirty-date row highlight: a seed session whose date could not be
   fixed on a real .stable__row (this selector previously said the dead
   v2-era class .session--dirty and never actually matched anything ---- */
.stable__row--dirty { border-left: 4px solid var(--accent-idle); }

/* ---- new-patient modal body (built in JS into #newPatientModalBody,
   reuses .cform-grid/.cfield/.cform-actions and modal chrome below) ---- */
.dup-warning {
  margin: 10px 0 0;
  font-size: .84rem;
  color: var(--accent-idle);
  font-weight: 600;
}

/* ---- filters + period summary ---- */
.filter-bar { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; margin-bottom: 16px; }
.filter-field { display: flex; flex-direction: column; gap: 4px; font-size: .8rem; color: var(--heading); font-weight: 600; }
.filter-field select, .filter-field input {
  font-family: var(--font);
  font-size: .88rem;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--inner-bg);
  color: var(--text);
}

/* ---- open-chart modal ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(30, 26, 22, 0.5);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(16px, 5vw, 60px) 16px;
  z-index: 50;
  overflow-y: auto;
}
.modal-overlay[hidden] { display: none; }
.modal {
  background: var(--card);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.25);
  width: min(760px, 100%);
  padding: clamp(18px, 3vw, 28px);
}
.modal__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.modal__title { font-size: 1.15rem; }
.modal__close {
  font-family: var(--font);
  font-size: 1.4rem;
  line-height: 1;
  color: var(--heading);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}
.modal__close:hover { background: var(--inner-bg); }
.modal__filter {
  width: 100%;
  font-family: var(--font);
  font-size: .92rem;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--inner-bg);
  color: var(--text);
  margin-bottom: 14px;
}
.chart-filter-row { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; }
.chart-filter-row .modal__filter { margin-bottom: 0; flex: 1 1 auto; }
.chart-filter-row__add { flex: 0 0 auto; white-space: nowrap; }
@media (max-width: 480px) {
  .chart-filter-row { flex-wrap: wrap; }
  .chart-filter-row .modal__filter { flex-basis: 100%; }
}
.chart-table-wrap { overflow-x: auto; max-height: 55vh; }
.chart-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.chart-table th, .chart-table td { text-align: left; padding: 9px 10px; }
.chart-table thead th {
  position: sticky; top: 0;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #9a9a9a;
}
.chart-table tbody tr { border-bottom: 1px solid var(--border); cursor: pointer; }
.chart-table tbody tr:hover { background: var(--inner-bg); }
.chart-table tbody tr:last-child { border-bottom: none; }
.chart-table td:first-child { white-space: nowrap; color: var(--heading); font-variant-numeric: tabular-nums; }

/* ---- session table (Excel-like, one row per session, seven collapsible
   activity cells; a progress check is a distinct full-width band row,
   never a seven-cell row) ---- */
/* ---- session table: the table IS the editor (v5). Every row, every
   cell, is a live form control; nothing here is read-only text with a
   separate edit step. Table scrolls in its own container so extra
   activity columns never push the page itself sideways. ---- */
.stable-wrap { overflow-x: auto; margin-top: 14px; }
.stable { width: 100%; min-width: 780px; border-collapse: collapse; font-size: .86rem; }
.stable thead th {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #9a9a9a;
  white-space: nowrap;
}
.stable td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
/* Column dividers: a clearly visible vertical rule between every column
   (date / session / each activity), not just the horizontal row rules
   already there. Deliberately darker than --border so it reads as a real
   grid, not a hairline. */
.stable th, .stable td { border-right: 1px solid #c7b8a8; }
.stable th:last-child, .stable td:last-child { border-right: none; }
.stable tbody tr.stable__row:hover { background: var(--inner-bg); }
.stable__row--eval { border-left: 4px solid var(--button); }
.stable__row--eval .stable__num { color: var(--button-hover); font-weight: 700; }
.stable__date { white-space: nowrap; }
.stable__date-input {
  font-family: var(--font);
  font-variant-numeric: tabular-nums;
  font-size: .84rem;
  font-weight: 600;
  color: var(--text);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 3px 4px;
  width: 138px;
}
.stable__date-input:hover { border-color: var(--border); }
.stable__date-input:focus-visible { border-color: var(--button); outline: none; background: var(--inner-bg); }
.stable-dirty__raw { margin: 4px 0 0; font-size: .74rem; color: var(--accent-idle); font-style: italic; font-weight: 400; }

/* ---- session-level comments toggle: lives under the date cell (see
   the buildSessionRow comment), opens the same detail-row machinery an
   activity cell uses, keyed 'comments' instead of an activity index. ---- */
.stable-comments-btn {
  display: block;
  margin-top: 6px;
  font-family: var(--font);
  font-size: .72rem;
  font-weight: 600;
  color: var(--button-hover);
  background: none;
  border: 1px dashed var(--border);
  border-radius: 6px;
  padding: 2px 8px;
  cursor: pointer;
}
.stable-comments-btn:hover { border-color: var(--button); }
.stable-comments-btn.has-content { border-style: solid; background: #f3ece7; color: var(--text); }
.stable-comments-btn.is-expanded { background: var(--button); border-color: var(--button); color: #fff; }

.stable__num { white-space: nowrap; }
.stable-num__row { display: flex; align-items: center; gap: 6px; }
.stable__num-input {
  font-family: var(--font);
  font-size: .84rem;
  color: var(--text);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 3px 4px;
  width: 52px;
}
.stable__num-input:hover { border-color: var(--border); }
.stable__num-input:focus-visible { border-color: var(--button); outline: none; background: var(--inner-bg); }
.stable-row-delete {
  display: block;
  margin-top: 6px;
  font-family: var(--font);
  font-size: .72rem;
  font-weight: 600;
  color: #b3b3b3;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.stable-row-delete:hover { color: var(--accent-idle); }

.stable-activity-cell {
  cursor: pointer;
  border-radius: 6px;
  font-size: .82rem;
  color: var(--text);
}
.stable-activity-cell:hover { background: var(--inner-bg); }
.stable-activity-cell.is-expanded { background: #f3ece7; font-weight: 600; }
.stable-activity-cell.stable-activity-cell__empty { color: #cfcfcf; font-style: italic; }
.stable-activity-cell__rating { display: block; font-size: .72rem; color: var(--heading); }

.stable-addcol-btn {
  font-family: var(--font);
  font-size: .8rem;
  font-weight: 700;
  color: var(--button-hover);
  background: var(--inner-bg);
  border: 1px dashed var(--border);
  border-radius: 6px;
  width: 26px;
  height: 26px;
  cursor: pointer;
}
.stable-addcol-btn:hover { border-color: var(--button); }

/* detail row: opens beneath an activity cell, holds the name/rating
   editor plus the session's shared notes (with quick phrases) */
.stable__detail-row td {
  background: var(--inner-bg);
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.stable-detail__edit { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.stable-detail__edit select,
.stable-detail__custom {
  font-family: var(--font);
  font-size: .86rem;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 8px;
}
.stable-detail__remove {
  font-family: var(--font);
  font-size: .78rem;
  font-weight: 600;
  color: var(--accent-idle);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.stable-detail__notes-label {
  margin: 0 0 6px;
  font-size: .74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #9a9a9a;
}
.stable-detail__notes-input {
  width: 100%;
  font-family: var(--font);
  font-size: .9rem;
  line-height: 1.5;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  resize: vertical;
}
.stable-copyforward-btn { margin-top: 10px; }
/* Per-activity note is smaller than the session-comments textarea, and
   sits right under the name/rating pickers rather than after them with
   the same visual weight as a full session comment. */
.stable-detail__actnote-input { font-size: .85rem; }

/* progress-check band row: readable narrative content, visually distinct
   from a seven-cell session row, positioned chronologically among sessions,
   and just as editable as a session row (date + narrative) */
.stable__pc-row td {
  background: #eef3f6;
  border-bottom: 1px solid var(--border);
  border-left: 4px solid #5c85a6;
  padding: 14px 16px;
}
.stable-pc__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 6px; }
.stable-pc__label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #3f6785;
  background: #dce8ef;
  border-radius: 999px;
  padding: 3px 10px;
}
.stable-pc__date-input {
  font-family: var(--font);
  font-variant-numeric: tabular-nums;
  font-size: .84rem;
  font-weight: 600;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 6px;
}
.stable-pc__flag { font-size: .74rem; color: var(--accent-idle); font-weight: 600; }
.stable-pc__narrative-input {
  width: 100%;
  font-family: var(--font);
  font-size: .92rem;
  line-height: 1.6;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  resize: vertical;
}
.stable-pc__goals { margin: 8px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.stable-pc__goals li {
  font-size: .78rem;
  color: var(--heading);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 10px;
}
.stable-empty { padding: 16px 10px; color: #9a9a9a; font-style: italic; font-size: .88rem; }

/* ---- print: activity report only, no chrome ---- */
@media print {
  .mock-topbar, .nav-toggle, .nav-rail, .action-row,
  .tool-band, .print-btn, .proto-note, .mock-foot, .header-edit-btn,
  .goals-card, .modal-overlay { display: none !important; }
  .stable-row-delete, .stable-addcol-btn, .stable-comments-btn { display: none !important; }
  .mock-layout { display: block !important; margin: 0 !important; }
  .mock-main { width: 100% !important; }
  body { background: #fff; }
  .pcard, .stable-wrap { box-shadow: none !important; border: 1px solid #ccc; }
  .disclosure.activity-report { display: block !important; }
  .disclosure.activity-report > summary { display: none !important; }
  .disclosure.activity-report .disclosure__body { display: block !important; padding-top: 0 !important; }
}
