/*
 * PhysiologicPRISM signed-in look (premium UI: Stage 2 colours, font, shared parts;
 * Stage 3 the app shell: side menu, footer, cookie notice).
 *
 * Founder's choice, 3 Dec 2026 (design canvas "PhysiologicPRISM — premium look",
 * artboards marked CHOSEN): dark green menu, vivid cyan #14c2b6 buttons with
 * DARK text (white text on #14c2b6 fails contrast, about 2.3:1), warm off-white
 * page, white cards, Plus Jakarta Sans.
 *
 * Loaded only by base.html (signed-in pages), straight after style.css and
 * before each page's own <style>, so a page's own rules still win until it is
 * cleaned up in Stage 4. media="screen": printed bills and reports are unchanged.
 * The public site (base_public.html) does not load this file.
 */

@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('fonts/plus-jakarta-sans/PlusJakartaSans-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* latin-ext carries the rupee sign (U+20B9) */
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('fonts/plus-jakarta-sans/PlusJakartaSans-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* The palette */
  --prism-font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --prism-ink: #1c2321;
  --prism-muted: #5f6662;
  --prism-bg: #f3f1ec;
  --prism-surface: #ffffff;
  --prism-field: #fdfcfa;
  --prism-border: #e6e1d7;
  --prism-border-strong: #dcd7cc;
  --prism-menu: #0b2f2d;
  --prism-menu-text: #b9d6d3;
  --prism-accent: #14c2b6;
  --prism-accent-hover: #11aba0;
  --prism-on-accent: #04312e;
  --prism-link: #0b6e67;
  --prism-tint: #dcf5f2;
  --prism-focus: 0 0 0 3px rgba(20, 194, 182, 0.35);
  --prism-shadow: 0 1px 2px rgba(28, 35, 33, 0.04), 0 6px 16px rgba(28, 35, 33, 0.05);
  /* Quiet surfaces and colours that carry meaning (Stage 4). Page styles use
     them as var(--prism-x, old colour): theme.css is screen only, so on paper
     the old colour applies and printouts do not change. */
  --prism-radius-lg: 18px;
  --prism-tint-soft: #eef8f6;
  --prism-tint-border: #b9e8e3;
  --prism-neutral: #ece9e3;
  --prism-neutral-hover: #e2ded5;
  --prism-ok: #1d6b45;
  --prism-ok-bg: #e7f5ee;
  --prism-ok-border: #8fcfab;
  --prism-ok-solid: #1f7a50;
  --prism-warn: #6b4200;
  --prism-warn-bg: #fdf6e9;
  --prism-warn-border: #e2b765;
  --prism-warn-solid: #e9a23b;
  --prism-danger: #b3261e;
  --prism-danger-bg: #fdecea;
  --prism-danger-border: #e8a59c;
  --prism-danger-solid: #c0392b;
  --prism-danger-solid-hover: #a93226;

  /* The old names (style.css and page styles use them) now point at the palette */
  --primary: var(--prism-menu);
  --primary-hover: #134541;
  --primary-light: #4f8f88;
  --dark-green: var(--prism-menu);
  --mid-green: var(--prism-link);
  --shadow-green: var(--prism-border);
  --background: var(--prism-bg);
  --background-gradient-start: var(--prism-bg);
  --background-gradient-end: var(--prism-bg);
  --background-alt: #ece9e3;
  --text-primary: var(--prism-ink);
  --text-secondary: var(--prism-muted);
  --text-tertiary: #858a86;
  --border: var(--prism-border);
  --border-light: #eee9e0;
  --shadow-color: rgba(28, 35, 33, 0.06);
  --shadow-color-hover: rgba(28, 35, 33, 0.1);
  --radius-sm: 10px;
  --radius-md: 12px;
  --radius-lg: 18px;
}

/* ── Page and text ─────────────────────────────────────────────────────── */
body {
  font-family: var(--prism-font);
  background: var(--prism-bg);
  color: var(--prism-ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
h3 { font-size: 18px; font-weight: 600; }
/* Signed-in pages: headings and text in ink. Public pages keep inheriting,
   so text on their dark hero bands stays white. :where() adds no weight. */
:where(body:not(.public-site)) :is(h1, h2, h3, p) { color: var(--prism-ink); }
a { color: var(--prism-link); }

:where(body:not(.public-site)) .container { padding: 32px 24px; }
/* Most pages put their own .container inside base.html's: one set of margins,
   not two (responsive.css already does this on phones). Signed-in pages only;
   :where() keeps the weight these rules had before the public site loaded
   this file, so public pages keep their own margins. */
:where(body:not(.public-site)) .container .container { padding: 0; }

:focus-visible {
  outline: 2px solid var(--prism-accent);
  outline-offset: 2px;
}

/* ── Form fields ───────────────────────────────────────────────────────── */
.input-field,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="date"],
input[type="number"],
select,
textarea {
  font-family: inherit;
  font-size: 16px;   /* below 16 px, iPhones zoom the page when a field is tapped */
  border: 1px solid var(--prism-border-strong);
  border-radius: 12px;
  background-color: var(--prism-field);
  color: var(--prism-ink);
  box-shadow: none;
}

.input-field:focus,
input:focus,
select:focus,
textarea:focus {
  border-color: var(--prism-accent);
  box-shadow: var(--prism-focus);
}

.form-group label,
.field-block label { color: var(--prism-ink); }

/* ── Buttons: cyan with dark text ──────────────────────────────────────── */
.button,
.small-button,
.ai-btn-primary {
  background-color: var(--prism-accent);
  color: var(--prism-on-accent);
  font-family: inherit;
  font-weight: 600;
  box-shadow: none;
}

.button {
  height: 44px;
  padding: 0 18px;
  border-radius: 12px;
  font-size: 15px;
  gap: 8px;
}

.button:hover,
.small-button:hover,
.ai-btn-primary:hover {
  background-color: var(--prism-accent-hover);
  color: var(--prism-on-accent);
  transform: none;
  box-shadow: none;
}

.button:active { transform: none; box-shadow: none; }

.small-button { border-radius: 10px; }

.button-secondary,
.ai-btn-secondary {
  background-color: var(--prism-surface);
  color: var(--prism-ink);
  border: 1px solid var(--prism-border-strong);
  font-family: inherit;
  box-shadow: none;
}

.button-secondary {
  height: 44px;
  padding: 0 18px;
  font-size: 15px;
}

.button-secondary:hover,
.ai-btn-secondary:hover {
  background-color: #f8f6f2;
  border-color: var(--prism-border-strong);
  transform: none;
  box-shadow: none;
}

.ai-btn-primary,
.ai-btn-secondary {
  height: 44px;
  padding: 0 18px;
  font-size: 15px;
}

/* ── Cards ─────────────────────────────────────────────────────────────── */
.card,
.plan-card,
.stat-card,
.content-card,
.container-card {
  background: var(--prism-surface);
  border: 1px solid var(--prism-border);
  border-radius: 18px;
  box-shadow: var(--prism-shadow);
}

.card:hover,
.plan-card:hover,
.stat-card:hover {
  transform: none;
  box-shadow: var(--prism-shadow);
}

.stat-card-number { color: var(--prism-ink); letter-spacing: -0.02em; }
.stat-card-label { color: var(--prism-muted); }

/* ── Tables ────────────────────────────────────────────────────────────── */
th,
td { border-color: var(--prism-border); }

.data-table {
  border: 1px solid var(--prism-border);
  border-radius: 18px;
  box-shadow: none;
}

.data-table thead { background: #fbfaf7; color: var(--prism-muted); }

.data-table th {
  color: var(--prism-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--prism-border);
}

.data-table td { border-bottom-color: #f3f0ea; }
/* Tables that become cards on phones (responsive.css): the cards carry the borders. */
@media screen and (max-width: 900px) {
  table.cards-on-small { border: 0; }
}
.data-table tbody tr:hover { background-color: #faf8f4; }

/* ── Messages ──────────────────────────────────────────────────────────── */
.flash-messages .flash,
.flash {
  border-radius: 12px;
  box-shadow: none;
  border: 1px solid transparent;
}

.flash.error   { background-color: #fdecea; color: #611a15; border-color: #f3c7c1; }
.flash.success { background-color: #e7f5ee; color: #1b5e20; border-color: #bfe3cc; }
.flash.warning { background-color: #fdf3dc; color: #6b4200; border-color: #f0dcae; }
.flash.info    { background-color: #e8f1fb; color: #1e3a5f; border-color: #c8dbf0; }

/* ── App shell (Stage 3): side menu, footer, things fixed to the screen ─ */
/* The side menu from 1101 px; up to 1100 px a bar across the top with the
   menu button (the same breakpoint the old bar used, responsive.css). */
.app-sidebar {
  background: var(--prism-menu);
  color: var(--prism-menu-text);
  box-sizing: border-box;
  z-index: 950;
}

.app-sidebar-top { display: flex; flex-direction: column; gap: 22px; }

.app-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px;
  color: #ffffff;
  text-decoration: none;
}
.app-brand:hover { color: #ffffff; }

/* The clinic's real logo (static/logo-wide.png, logo.png trimmed), on a white
   tile: its dark lettering does not read on the green menu. */
.app-brand-logo {
  display: block;
  width: auto;
  height: 48px;
  padding: 6px 12px;
  background: #ffffff;
  border-radius: 12px;
  box-sizing: content-box;
}

/* Add Patient: the one cyan button, its two choices drop down under it */
.app-add-patient { position: relative; }
.app-add-patient > summary.button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
  list-style: none;
  cursor: pointer;
  white-space: nowrap;
}
.app-add-patient > summary::-webkit-details-marker { display: none; }
.app-add-patient > summary::marker { content: ''; }
.app-add-patient[open] > summary .icon:last-child { transform: rotate(180deg); }

.app-add-patient .nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 960;
  list-style: none;
  margin: 0;
  padding: 6px;
  min-width: 220px;
  background: var(--prism-surface);
  border: 1px solid var(--prism-border);
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(28, 35, 33, 0.18);
}
.app-add-patient .nav-dropdown-menu a {
  display: block;
  padding: 11px 12px;
  border-radius: 10px;
  color: var(--prism-ink);
  text-decoration: none;
  font-size: 15px;
  white-space: nowrap;
}
.app-add-patient .nav-dropdown-menu a:hover { background: var(--prism-bg); }

.app-menu-toggle { display: none; }

.app-menu { display: flex; flex-direction: column; gap: 16px; }

.app-menu-group {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.app-menu-quiet {
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* .app-sidebar in front: the keyboard button also carries keyboardShortcuts.css's
   old round-button rules, which these replace. */
.app-sidebar .side-link {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 42px;
  height: auto;
  min-width: 0;
  padding: 0 14px;
  box-sizing: border-box;
  border: 0;
  border-radius: 12px;
  background: transparent;
  box-shadow: none;
  color: var(--prism-menu-text);
  font: 500 15px/1.2 var(--prism-font);
  justify-content: flex-start;
  text-align: left;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transform: none;
}
.app-sidebar .app-menu-quiet .side-link { min-height: 38px; font-size: 14px; }

.app-sidebar .side-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  transform: none;
  box-shadow: none;
}

.app-sidebar .side-link[aria-current="page"] {
  background: rgba(20, 194, 182, 0.16);
  color: #ffffff;
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--prism-accent);
}

/* Unread count: at the end of the Notifications row, no pulsing */
.app-sidebar .notification-badge {
  position: static;
  margin-left: auto;
  animation: none;
  background: #c0392b;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
}

.app-account {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  padding: 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}
.app-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--prism-accent);
  color: var(--prism-on-accent);
  font: 700 13px/36px var(--prism-font);
  text-align: center;
  flex: none;
}
.app-account-name {
  min-width: 0;
  font-weight: 600;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The copyright line, at the end of the page instead of a box fixed in the
   corner. Room underneath for the AI notice fixed to the bottom. */
.app-footer {
  padding: 24px 24px 64px;
  text-align: center;
  font-size: 12px;
  color: var(--prism-muted);
}

/* AI notice along the bottom: same words and place, quieter colours */
.ai-disclaimer {
  background-color: #fbfaf7;
  border-top-color: var(--prism-border);
  color: var(--prism-muted);
  box-shadow: none;
}
.ai-disclaimer svg { color: var(--prism-muted); }

/* "Press ? for shortcuts" hint: above the AI notice, menu colours */
.keyboard-shortcuts-indicator {
  bottom: 56px;
  background: var(--prism-menu);
  box-shadow: 0 6px 16px rgba(28, 35, 33, 0.18);
}

/* Cookie notice: a compact card in the corner instead of a dark band across
   the screen. Same words and buttons (the component is shared with the public
   site, which keeps its own look; this file is not loaded there). The two
   answers look the same, so neither is pushed. */
#cookieConsentBanner {
  left: auto !important;
  right: 24px !important;
  bottom: 56px !important;
  max-width: 440px;
  padding: 20px !important;
  background-color: var(--prism-surface) !important;
  color: var(--prism-ink) !important;
  border: 1px solid var(--prism-border);
  border-radius: 18px;
  box-shadow: 0 18px 40px rgba(28, 35, 33, 0.18) !important;
}
#cookieConsentBanner > div {
  flex-direction: column;
  align-items: stretch !important;
  gap: 14px !important;
}
#cookieConsentBanner > div > div:first-child { min-width: 0 !important; }
#cookieConsentBanner h3 { color: var(--prism-ink) !important; font-size: 16px !important; }
#cookieConsentBanner p { color: var(--prism-ink) !important; font-size: 13px !important; line-height: 1.5 !important; }
#cookieConsentBanner a { color: var(--prism-link) !important; }
#cookieConsentBanner .button {
  flex: 1 1 0;
  height: auto !important;
  min-height: 44px;
  background-color: var(--prism-accent) !important;
  color: var(--prism-on-accent) !important;
  border-radius: 12px !important;
  font-weight: 600;
  white-space: normal !important;
}
#cookieSettingsLink {
  background-color: var(--prism-menu) !important;
  border-radius: 10px !important;
}

@media screen and (min-width: 1101px) {
  .app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 248px;
    padding: 22px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 22px;
    overflow-y: auto;
  }
  .app-menu { flex: 1; }
  .app-menu-bottom { margin-top: auto; }

  /* The page, the AI notice and the bottom-left helpers start right of the menu */
  .app-sidebar ~ .app-main { margin-left: 248px; }
  .app-sidebar ~ .ai-disclaimer { left: 248px; }
  .app-sidebar ~ .keyboard-shortcuts-indicator { left: 272px; }
  .app-sidebar ~ #cookieSettingsLink { left: 260px !important; }
}

@media screen and (max-width: 1100px) {
  .app-sidebar {
    position: sticky;
    top: 0;
    padding: 10px 16px;
  }
  .app-sidebar-top { flex-direction: row; align-items: center; gap: 12px; }
  .app-brand { margin-right: auto; padding: 0; min-height: 44px; min-width: 44px; }
  .app-brand-logo { height: 40px; padding: 5px 10px; }
  .app-add-patient > summary.button { width: auto; min-height: 44px; }
  .app-add-patient .nav-dropdown-menu { left: auto; right: 0; }

  .app-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    background: transparent;
    color: #ffffff;
    cursor: pointer;
  }
  .app-menu-toggle.active { background: rgba(255, 255, 255, 0.1); }

  .app-menu { display: none; }
  .app-menu.active {
    display: flex;
    max-height: calc(100vh - 64px);
    overflow-y: auto;
    padding: 14px 0 8px;
  }
  .app-sidebar .side-link { min-height: 44px; }
  .app-sidebar .app-menu-quiet .side-link { min-height: 44px; }

  #cookieConsentBanner { left: 12px !important; right: 12px !important; max-width: none; }
}

@media screen and (max-width: 480px) {
  .app-brand-logo { height: 34px; padding: 5px 9px; }
}

/* ── Page buttons recoloured by meaning (Stage 4) ──────────────────────── */
/* Page styles give some buttons a red, green or dark background inline
   (var(--prism-danger-solid, ...) etc.); the cyan buttons' dark text would
   be unreadable there, so they get white text. Grey ones get dark text. */
:is(.button, button, .btn, a)[style*="--prism-danger-solid"],
:is(.button, button, .btn, a)[style*="--prism-ok-solid"],
:is(.button, button, .btn, a)[style*="--prism-menu"] { color: #fff; }
:is(.button, button, .btn, a)[style*="--prism-danger-solid"]:hover { background: var(--prism-danger-solid-hover) !important; color: #fff; }
:is(.button, button, .btn, a)[style*="--prism-neutral"] { color: var(--prism-ink); }

/* ── Diary calendar (FullCalendar, Stage 4) ───────────────────────────── */
.fc {
  --fc-border-color: var(--prism-border);
  --fc-today-bg-color: rgba(20, 194, 182, 0.08);
  --fc-button-bg-color: var(--prism-surface);
  --fc-button-border-color: var(--prism-border-strong);
  --fc-button-text-color: var(--prism-ink);
  --fc-button-hover-bg-color: var(--prism-tint-soft);
  --fc-button-hover-border-color: var(--prism-border-strong);
  --fc-button-active-bg-color: var(--prism-tint);
  --fc-button-active-border-color: var(--prism-tint-border);
  --fc-event-bg-color: var(--prism-link);
  --fc-event-border-color: var(--prism-link);
  --fc-now-indicator-color: var(--prism-danger-solid);
}
.fc .fc-button { border-radius: 10px; font-weight: 600; box-shadow: none; }
.fc .fc-button-primary:not(:disabled).fc-button-active,
.fc .fc-button-primary:not(:disabled):active { color: var(--prism-link); }
.fc .fc-button:focus-visible { box-shadow: var(--prism-focus); }
.fc .fc-toolbar-title { color: var(--prism-ink); font-weight: 700; letter-spacing: -0.01em; }
.fc .fc-col-header-cell-cushion { color: var(--prism-ink); font-weight: 600; text-decoration: none; }
.fc .fc-daygrid-day-number { color: var(--prism-muted); text-decoration: none; }

/* ── Dashboard (Stage 4) ───────────────────────────────────────────────── */
/* Tiles: a small label, a big number. A coloured edge only when it means
   something (a quota running out). */
.analytics-dashboard .stats-grid .stat-card {
  align-items: flex-start;
  justify-content: flex-start;
  text-align: left;
  min-height: 0;
  padding: 20px 22px;
  border: 1px solid var(--prism-border);
}
.analytics-dashboard .stats-grid .stat-card.warning { box-shadow: inset 4px 0 0 var(--prism-warn-solid), var(--prism-shadow); }
.analytics-dashboard .stats-grid .stat-card.danger { box-shadow: inset 4px 0 0 var(--prism-danger-solid), var(--prism-shadow); }
.analytics-dashboard .stat-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--prism-muted);
}
.analytics-dashboard .stat-value { font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.analytics-dashboard .stat-subtext { display: flex; align-items: center; gap: 4px; color: var(--prism-muted); }

.analytics-dashboard .progress-section {
  border: 1px solid var(--prism-border);
  border-radius: 18px;
  box-shadow: var(--prism-shadow);
}
.analytics-dashboard .section-header { display: flex; align-items: center; gap: 8px; }
.analytics-dashboard .progress-section > .section-header:first-child { margin-top: 0; }
.analytics-dashboard .progress-bar-container { height: 8px; background: var(--prism-neutral); }

/* One style for notices: soft fill, thin border, rounded */
.analytics-dashboard .alert-box[class],
.incomplete-alert {
  border: 1px solid var(--prism-warn-border);
  border-left-width: 1px;
  border-radius: 14px;
  box-shadow: none;
}
.analytics-dashboard .alert-box.info { border-color: var(--prism-tint-border); }
.analytics-dashboard .alert-box.success { border-color: var(--prism-ok-border); }
.analytics-dashboard .alert-box > span:first-child { align-self: flex-start; }
.incomplete-alert { background: var(--prism-warn-bg); padding: 18px 20px; }
.incomplete-alert-title { color: var(--prism-warn); }
.incomplete-alert-text { color: var(--prism-ink); }
.incomplete-alert-badge { background: #fbeccf; color: var(--prism-warn); border-color: #efdcb5; }
.incomplete-alert-button,
.incomplete-alert-button:hover {
  background: var(--prism-accent);
  color: var(--prism-on-accent);
  border-radius: 12px;
}
.incomplete-alert-button:hover { background: var(--prism-accent-hover); }

/* Quick Actions: one quiet row of secondary buttons */
.analytics-dashboard .action-btn,
.analytics-dashboard .action-btn.secondary {
  background: var(--prism-surface);
  color: var(--prism-ink);
  border: 1px solid var(--prism-border-strong);
  border-radius: 12px;
  padding: 10px 18px;
}
.analytics-dashboard .action-btn:hover,
.analytics-dashboard .action-btn.secondary:hover { background: var(--prism-tint-soft); color: var(--prism-ink); }
.analytics-dashboard .action-btn .icon { color: var(--prism-link); }
.analytics-dashboard .action-dropdown-menu { border: 1px solid var(--prism-border); border-radius: 14px; }

/* ── Assessment screens (Stage 4) ───────────────────────────────────── */
/* Each step's form is one white card (class added in the ten assessment
   templates); its sections are divided by lines (assessment_page_styles). */
.assessment-card {
  background: var(--prism-surface);
  border: 1px solid var(--prism-border);
  border-radius: 18px;
  padding: 26px 28px 0;
  box-shadow: var(--prism-shadow);
}

/* Save & Continue stays in view: a bar along the bottom of the card, above
   the AI notice fixed to the screen. Save on the right, Back on the left. */
.assessment-card .assessment-button-container,
.assessment-card .gt-buttons {
  position: sticky;
  bottom: 38px;
  z-index: 30;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 28px -28px 0;
  padding: 14px 28px;
  background: #fdfcfa;
  border-top: 1px solid var(--prism-border);
  border-radius: 0 0 18px 18px;
}
.assessment-card .assessment-button-container > [type="submit"],
.assessment-card .gt-buttons > [type="submit"] { order: 10; margin-left: auto; }

.button.assessment-back {
  background: transparent;
  color: var(--prism-link);
  border: 0;
  padding: 0 10px;
}
.button.assessment-back:hover { background: var(--prism-tint); color: var(--prism-link); }

/* AI buttons: pale amber, so AI is never mistaken for the main action */
.button.ai-action,
.ai-btn {
  background: #fdf6e9;
  color: #5c3b00;
  border: 1px solid #efdcb5;
}
.button.ai-action:hover,
.ai-btn:hover { background: #fbedd2; color: #5c3b00; }
.ai-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-top: 0;
  padding: 0;
  border-radius: 10px;
  font-size: 1em;
}

/* The "Press ? for shortcuts" hint (first 5 seconds) sits above the Save bar. */
body:has(.assessment-card) .keyboard-shortcuts-indicator { bottom: 126px; }

@media screen and (max-width: 768px) {
  .assessment-card .assessment-button-container,
  .assessment-card .gt-buttons { bottom: 46px; }
}
@media screen and (max-width: 576px) {
  .assessment-card { padding: 18px 16px 0; }
  .assessment-card .assessment-button-container,
  .assessment-card .gt-buttons { margin: 24px -16px 0; padding: 6px 16px 10px; gap: 4px 10px; }
  .assessment-card .assessment-button-container .button.assessment-back,
  .assessment-card .gt-buttons .button.assessment-back { min-height: 36px; height: 36px; font-size: 14px; }
  /* Risk Factors' row has four buttons, too tall to keep on a phone screen:
     it stays at the end of the form there. */
  .assessment-card .assessment-button-container:has(> :nth-child(3)) { position: static; }
  .assessment-card .assessment-button-container > [type="submit"],
  .assessment-card .gt-buttons > [type="submit"] { flex: 1 1 100%; }
}

/* ── Icons (templates/components/icon.html) ────────────────────────────── */
.icon { flex: none; vertical-align: middle; }

/* ── AI suggestions panel ──────────────────────────────────────────────── */
.ai-modal-content { border-radius: 18px; }

/* ── Public site (Stage 5, founder 3 Dec 2026: "give the public pages the
   same look") ──────────────────────────────────────────────────────────── */
/* base_public.html (<body class="public-site">) and the standalone public
   pages. Each page draws its own top bar and footer with its own colours
   (.homepage-navbar on most, .fw-nav on the cheat-sheet pages); ":root"
   lifts these rules above the page's own, as responsive.css does on phones. */

:root .homepage-navbar,
:root .fw-nav {
  background: var(--prism-menu);
  box-shadow: none;
  border-bottom: 0;
}

/* The clinic's logo on its white tile, as in the app's menu; the name beside
   it is already in the logo. */
:root .homepage-navbar .logo,
:root .fw-nav .logo { color: #ffffff; }
:root .homepage-navbar .logo img,
:root .fw-nav > a:first-child img {
  display: block;
  width: auto;
  height: 40px;
  padding: 5px 10px;
  background: #ffffff;
  border-radius: 10px;
  box-sizing: content-box;
}
:root .homepage-navbar .logo span { display: none; }

:root .homepage-navbar .nav-links a,
:root .homepage-navbar .nav-links .dropdown,
:root .homepage-navbar .dropdown-toggle,
:root .fw-nav a {
  color: var(--prism-menu-text);
  font-weight: 500;
  opacity: 1;
}
:root .homepage-navbar .nav-links a:hover,
:root .homepage-navbar .dropdown:hover .dropdown-toggle,
:root .fw-nav a:hover { color: #ffffff; opacity: 1; }

:root .homepage-navbar .dropdown-menu {
  background: var(--prism-surface);
  border: 1px solid var(--prism-border);
  border-radius: 12px;
  box-shadow: var(--prism-shadow);
}
:root .homepage-navbar .dropdown-menu a { color: var(--prism-ink); }
:root .homepage-navbar .dropdown-menu a:hover { background: var(--prism-tint-soft); color: var(--prism-link); }

/* "Start Free Trial" / "Sign in" in the bar: the one cyan button */
:root .homepage-navbar .cta-btn,
:root .homepage-navbar .nav-links a.cta-btn {
  background: var(--prism-accent);
  color: var(--prism-on-accent);
  border: 0;
  border-radius: 10px;
  padding: 10px 18px;
  font-weight: 600;
}
:root .homepage-navbar .nav-links a.cta-btn:hover { background: var(--prism-accent-hover); color: var(--prism-on-accent); }

/* Page footers: the menu green, light text */
:root .homepage-footer,
:root .security-footer {
  background: var(--prism-menu);
  color: var(--prism-menu-text);
}
:root .homepage-footer h3,
:root .homepage-footer h4,
:root .security-footer h3,
:root .security-footer h4 { color: #ffffff; }
:root .homepage-footer a,
:root .security-footer a { color: var(--prism-menu-text); }
:root .homepage-footer a:hover,
:root .security-footer a:hover { color: #ffffff; }
:root .homepage-footer p,
:root .security-footer p { color: var(--prism-menu-text); }

/* Line icons that replaced emoji in a badge or heading box: the box's own
   font size (the size the emoji had) sets the icon's size, a little smaller
   because a line icon fills its square. */
.public-site [class*="icon"] > svg.icon:only-child {
  width: 0.85em;
  height: 0.85em;
}

/* Text on the bands that are now menu green (they were purple or teal
   gradients with white text): style.css gives headings and paragraphs the
   dark ink colour, so they follow the band instead. Two levels deep only,
   so a white card inside a band keeps its own dark text. */
:root :is(.trial-hero, .reviews-hero, .final-cta, .faq-cta, .cta-section, .security-cta,
          .partnership-callout, .copyright-framework-section, .privacy-section,
          .research-features, .pilot-section, .use-cases, .pilot-structure, .segment-card,
          .framework-hero, .plan-card.featured) > :is(h1, h2, h3, h4, p, li),
:root :is(.trial-hero, .reviews-hero, .final-cta, .faq-cta, .cta-section, .security-cta,
          .partnership-callout, .copyright-framework-section, .privacy-section,
          .research-features, .pilot-section, .use-cases, .pilot-structure, .segment-card,
          .framework-hero, .plan-card.featured) > :not([class*="card"]) > :is(h1, h2, h3, h4, p, li) {
  color: inherit;
}

/* Public pages size their own buttons (big hero buttons have tall padding):
   the button grows to fit instead of the app's fixed 44 px. */
:where(.public-site) .button { height: auto; min-height: 44px; }

/* The app's font on every public page (standalone pages set their own on
   body); headings or blocks with their own font keep it. */
:root body.public-site { font-family: var(--prism-font); }
