/* =====================================================================
   Harbor — theme
   Palette & type derived from Tideline: navy ink, warm cream, sea blue,
   gold. Fraunces (display) + Inter (UI). One signature: the lighthouse.
   ===================================================================== */

:root {
  --bg:          #f2efe8;
  --bg-surface:  #f7f5f0;
  --bg-card:     #ffffff;
  --ink:         #0d2238;
  --ink-soft:    #5f6b73;
  --ink-faint:   #8c969d;
  --line:        #d9dee2;
  --line-soft:   rgba(13, 34, 56, 0.08);
  --accent:      #3c6f8f;   /* sea blue */
  --accent-deep: #2c566f;
  --accent-soft: #d8e2ea;
  --sun:         #c89954;   /* gold */
  --sun-soft:    #f6e2b0;
  --sun-deep:    #a87d3c;
  --navy:        #0b2330;   /* topbar / brand ground */
  --clay:        #8a5a52;   /* used sparingly, cancelled only */
  --dusty-red:   #b06058;   /* dusty red — Needs attention */

  --radius:    14px;
  --radius-sm: 10px;
  --radius-xs: 7px;
  --shadow:    0 1px 2px rgba(13,34,56,.04), 0 4px 16px rgba(13,34,56,.06);
  --shadow-lg: 0 8px 40px rgba(13,34,56,.12);

  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --maxw: 1120px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:         #0a1b25;
    --bg-surface: #0f2532;
    --bg-card:    #143042;
    --ink:        #f4ede0;
    --ink-soft:   #a8becc;
    --ink-faint:  #7c95a4;
    --line:       #284859;
    --line-soft:  rgba(255,255,255,0.07);
    --dusty-red:  #cf837a;
    --accent:     #5b94b4;
    --accent-soft:#1d3a4b;
    --sun:        #e2b667;
    --sun-soft:   #2a3a3f;
    --navy:       #081a24;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }

body {
  margin: 0;
  font-family: var(--ui);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 500;
  line-height: 1.15;
  margin: 0 0 .4em;
  letter-spacing: -0.01em;
}
h1 { font-size: 1.7rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

p { margin: 0 0 1rem; }

.eyebrow {
  font-family: var(--ui);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--ink-faint);
}

/* --- Layout ---------------------------------------------------------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.page { padding: 28px 0 64px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.muted { color: var(--ink-soft); }

.grid { display: grid; gap: 16px; }
.grid-kpi { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.grid-2 { grid-template-columns: 1.6fr 1fr; align-items: start; }
@media (max-width: 760px) { .grid-2 { grid-template-columns: 1fr; } }

/* --- Topbar ---------------------------------------------------------- */
.topbar { background: var(--navy); color: #f4ede0; }
.topbar .wrap { display: flex; align-items: center; gap: 18px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: #f4ede0; font-family: var(--display); font-size: 1.2rem; font-weight: 600; letter-spacing: .01em; }
.brand:hover { text-decoration: none; }
.brand svg { display: block; }
.brand .beam { color: var(--sun); }

.topnav { display: flex; gap: 4px; margin-left: 8px; }
.topnav a { color: #cdd8e0; padding: 7px 12px; border-radius: var(--radius-xs); font-size: .9rem; font-weight: 500; }
.topnav a:hover { background: rgba(255,255,255,.08); text-decoration: none; }
.topnav a.active { color: #fff; background: rgba(255,255,255,.12); }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.topbar-menu { display: flex; align-items: center; gap: 18px; flex: 1; }
.nav-toggle { display: none; margin-left: auto; background: transparent; border: 0; color: #f4ede0; padding: 8px; border-radius: var(--radius-xs); cursor: pointer; }
.nav-toggle:hover { background: rgba(255,255,255,.10); }
@media (max-width: 860px) {
  .topbar .wrap { position: relative; }
  .nav-toggle { display: inline-flex; }
  .topbar-menu { display: none; position: absolute; top: 60px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; background: var(--navy); padding: 8px 12px 14px; box-shadow: var(--shadow-lg); z-index: 60; }
  .topbar.nav-open .topbar-menu { display: flex; }
  .topnav { flex-direction: column; gap: 2px; margin: 0; }
  .topnav a { padding: 11px 12px; font-size: .95rem; }
  .topbar-right { margin-left: 0; margin-top: 8px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.12); }
  .usermenu { gap: 16px; flex-wrap: wrap; }
}

/* location switcher */
.switcher { position: relative; }
.switcher-btn { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.08); color: #f4ede0; border: 1px solid rgba(255,255,255,.14); padding: 6px 12px; border-radius: var(--radius-xs); font: inherit; font-size: .88rem; cursor: pointer; }
.switcher-btn .loc-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--sun); }
.switcher-btn:hover { background: rgba(255,255,255,.14); }
.switcher-menu { position: absolute; top: calc(100% + 8px); right: 0; min-width: 240px; background: var(--bg-card); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); padding: 6px; z-index: 50; max-height: 60vh; overflow: auto; }
.switcher-menu[hidden] { display: none; }
.switcher-menu .grouplabel { font-size: .68rem; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-faint); padding: 8px 10px 4px; }
.switcher-menu a { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 10px; border-radius: var(--radius-xs); color: var(--ink); font-size: .9rem; }
.switcher-menu a:hover { background: var(--bg-surface); text-decoration: none; }
.switcher-menu a.current { background: var(--accent-soft); }
.switcher-menu a small { color: var(--ink-faint); }

.usermenu { display: flex; align-items: center; gap: 10px; font-size: .85rem; color: #cdd8e0; }
.usermenu .pill-super { background: var(--sun); color: var(--navy); font-weight: 600; font-size: .66rem; text-transform: uppercase; letter-spacing: .05em; padding: 2px 7px; border-radius: 99px; }
.usermenu a { color: #cdd8e0; }
.usermenu .username { font-weight: 500; color: #f4ede0; }
.usermenu .admin-cog { display: inline-flex; align-items: center; color: #cdd8e0; padding: 4px; border-radius: var(--radius-xs); }
.usermenu .admin-cog:hover { color: #fff; background: rgba(255,255,255,.10); }

/* Dashboard first-row controls (search + location), moved out of the top bar */
.dash-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.switcher-btn--light { background: var(--bg-card); color: var(--ink); border: 1px solid var(--line); }
.switcher-btn--light:hover { background: var(--bg-surface); }
.switcher-btn--light .loc-dot { background: var(--sun); }

/* Dashboard toolbar — a 4-column row that lines up with the KPI cards below.
   Search fills the first 3 columns; the location chooser is the 4th. */
.dash-toolbar { display: grid; grid-template-columns: repeat(4, minmax(190px, 1fr)); gap: 16px; margin-bottom: 22px; }
.dash-toolbar .dash-search { grid-column: span 3; margin: 0; position: relative; display: flex; }
.dash-toolbar .dash-search-icon { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--sun); pointer-events: none; }
.dash-toolbar .dash-search input {
  width: 100%; height: 48px; box-sizing: border-box; padding: 10px 18px 10px 46px;
  background: #b9cfdc; border: 1px solid #93b3c6; color: #16323f; border-radius: 12px;
  font: inherit; font-size: .92rem; outline: none;
}
.dash-toolbar .dash-search input::placeholder { color: #5b7689; }
.dash-toolbar .dash-search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(60,111,143,.18); background: #c6d8e3; }
.dash-toolbar .switcher { grid-column: span 1; }
.dash-toolbar .switcher-btn { width: 100%; height: 48px; justify-content: space-between; border-radius: 12px; padding: 6px 16px; font-size: .9rem; }
.dash-toolbar .switcher-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
@media (max-width: 760px) {
  .dash-toolbar { grid-template-columns: 1fr; }
  .dash-toolbar .dash-search, .dash-toolbar .switcher { grid-column: auto; }
}

/* --- Cards ----------------------------------------------------------- */
.card { background: var(--bg-card); border: 1px solid var(--line-soft); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card h2 { margin-top: 0; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-head h2, .card-head h3 { margin: 0; }
.card-head a { font-size: .85rem; }

/* Collapsible card — one arrow to the left of the title; status below the title */
details.card-collapse { padding: 0; overflow: hidden; }
details.card-collapse > summary.card-summary { list-style: none; cursor: pointer; display: flex; align-items: flex-start; gap: 11px; padding: 16px 20px; user-select: none; }
details.card-collapse > summary.card-summary::-webkit-details-marker { display: none; }
details.card-collapse > summary.card-summary::marker { content: ""; }
details.card-collapse > summary.card-summary:hover { background: var(--bg-surface); }
details.card-collapse .card-chev { flex: none; margin-top: 4px; color: var(--ink-faint); transition: transform .15s ease; }
details.card-collapse[open] > summary.card-summary .card-chev { transform: rotate(90deg); }
details.card-collapse .summary-head { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
details.card-collapse .summary-head h2 { margin: 0; font-size: 1.05rem; line-height: 1.2; }
details.card-collapse .card-status { align-self: flex-start; font-size: .8rem; color: var(--ink-soft); background: var(--bg-surface); border: 1px solid var(--line-soft); padding: 3px 11px; border-radius: 99px; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
details.card-collapse[open] > summary.card-summary { border-bottom: 1px solid var(--line-soft); }
details.card-collapse > .card-body { padding: 16px 20px 18px; }
details.card-collapse > summary.card-summary .card-action { margin-left: auto; flex: none; align-self: center; }

/* AI confirmation modal */
.ai-modal { position: fixed; inset: 0; background: rgba(13,34,56,.45); display: flex; align-items: center; justify-content: center; z-index: 200; padding: 20px; }
.ai-modal[hidden] { display: none; }
.ai-modal-box { background: var(--bg-card); border: 1px solid var(--line-soft); border-radius: var(--radius); box-shadow: var(--shadow-lg); max-width: 460px; padding: 24px; }
.ai-modal-box h3 { margin: 0 0 10px; }
.ai-modal-box p { margin: 0 0 10px; color: var(--ink-soft); font-size: .92rem; line-height: 1.5; }
.ai-modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }

/* App modal viewer (documents / pages open here instead of new tabs) */
.hmodal { position: fixed; inset: 0; background: rgba(13,34,56,.5); display: none; align-items: center; justify-content: center; z-index: 300; padding: 24px; }
.hmodal.open { display: flex; }
.hmodal-box { background: var(--bg-card); border-radius: var(--radius); box-shadow: var(--shadow-lg); width: min(980px, 96vw); height: min(90vh, 1040px); display: flex; flex-direction: column; overflow: hidden; }
.hmodal-head { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-bottom: 1px solid var(--line-soft); }
.hmodal-title { font-weight: 600; font-size: .95rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hmodal-actions { display: flex; align-items: center; gap: 4px; }
.hmodal-ext, .hmodal-close { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 8px; border: 0; background: transparent; color: var(--ink-soft); cursor: pointer; font-size: 1.25rem; line-height: 1; text-decoration: none; }
.hmodal-ext { font-size: 1.05rem; }
.hmodal-ext:hover, .hmodal-close:hover { background: var(--bg-surface); color: var(--ink); }
.hmodal-body { flex: 1; background: var(--bg-surface); padding: 18px 24px; }
.hmodal-frame { width: 100%; height: 100%; border: 1px solid var(--line-soft); border-radius: 10px; display: block; background: #fff; }
@media (max-width: 760px) { .hmodal { padding: 0; } .hmodal-box { width: 100vw; height: 100vh; border-radius: 0; } .hmodal-body { padding: 12px; } }

/* Schedule month calendar */
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.cal-head h2 { margin: 0; }
.cal-nav { display: flex; gap: 6px; }
.cal-nav .btn { padding: 6px 12px; }
.cal-scroll { overflow-x: auto; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(96px, 1fr)); gap: 1px; background: var(--line-soft); border: 1px solid var(--line-soft); border-radius: var(--radius-sm); overflow: hidden; min-width: 680px; }
.cal-dow { background: var(--bg-surface); text-align: center; padding: 8px 4px; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); font-weight: 600; }
.cal-day { background: var(--bg-card); min-height: 92px; padding: 6px; display: flex; flex-direction: column; gap: 3px; }
.cal-day--out { background: var(--bg-surface); }
.cal-day--out .cal-date { color: var(--ink-faint); }
.cal-day--today { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-date { font-size: .8rem; color: var(--ink-soft); font-weight: 600; margin-bottom: 2px; }
.cal-ev { display: flex; gap: 5px; align-items: baseline; background: rgba(60,111,143,.10); color: var(--ink); border-left: 3px solid var(--accent); border-radius: 5px; padding: 3px 6px; font-size: .76rem; line-height: 1.25; text-decoration: none; overflow: hidden; }
.cal-ev:hover { background: rgba(60,111,143,.2); text-decoration: none; }
.cal-ev-time { color: var(--accent-deep); font-weight: 600; white-space: nowrap; }
.cal-ev-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Case hub — header band, stepper, record sections, workflow */
.case-header { background: var(--bg-card); border: 1px solid var(--line-soft); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 16px; }
.case-header-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.case-header-top h1 { margin: 4px 0 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 1.7rem; }
.case-status-form select { padding: 7px 12px; }
.case-meta { display: flex; flex-wrap: wrap; gap: 10px 28px; margin-top: 14px; }
.cm { display: flex; flex-direction: column; gap: 2px; }
.cm-k { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint); }
.cm-v { font-size: .95rem; }
.cm-select { padding: 3px 8px; font-size: .9rem; }
.case-steps { display: flex; gap: 4px; margin-top: 18px; overflow-x: auto; }
.step { display: flex; align-items: center; gap: 7px; padding: 6px 12px 6px 8px; border-radius: 99px; font-size: .82rem; white-space: nowrap; background: var(--bg-surface); color: var(--ink-faint); }
.step-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line); flex: none; }
.step--done { color: var(--accent-deep); } .step--done .step-dot { background: var(--accent); }
.step--cur { color: #fff; background: var(--accent); font-weight: 600; } .step--cur .step-dot { background: #fff; }
.step--todo .step-label { color: var(--ink-faint); }
.case-next { display: flex; align-items: center; gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.case-next-k { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint); }
.case-next-v { color: var(--ink-soft); font-size: .92rem; }

.frow { display: flex; gap: 12px; }
@media (max-width: 560px) { .frow { flex-direction: column; gap: 0; } }
.frow .field { flex: 1; }
.vgroup-h { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--sun); font-weight: 600; margin: 14px 0 6px; }
.vgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
@media (max-width: 560px) { .vgrid { grid-template-columns: 1fr; } }
.vcheck { display: flex; align-items: center; gap: 8px; font-size: .9rem; }
.vgrid > .vcheck { grid-column: 1 / -1; }
.vcheck input { width: auto; }

.wf { display: flex; flex-direction: column; }
.wf-row { display: flex; align-items: center; gap: 10px; padding: 12px 4px; border-bottom: 1px solid var(--line-soft); color: var(--ink); text-decoration: none; }
.wf-row:last-child { border-bottom: 0; }
.wf-row:hover { text-decoration: none; background: var(--bg-surface); margin: 0 -8px; padding-left: 12px; padding-right: 12px; border-radius: 8px; border-bottom-color: transparent; }
.wf-label { font-weight: 500; }
.wf-chip { margin-left: auto; font-size: .82rem; color: var(--ink-soft); }
.wf-go { color: var(--ink-faint); font-size: 1.1rem; }

/* Chat thread (staff card + family portal) */
.chat-thread { display: flex; flex-direction: column; gap: 8px; max-height: 340px; overflow: auto; padding: 4px 2px; }
.chat-msg { display: flex; flex-direction: column; max-width: 85%; }
.chat-in { align-self: flex-start; align-items: flex-start; }
.chat-out { align-self: flex-end; align-items: flex-end; }
.chat-bubble { padding: 8px 12px; border-radius: 13px; font-size: .9rem; line-height: 1.4; }
.chat-in .chat-bubble { background: var(--bg-surface); color: var(--ink); border-bottom-left-radius: 4px; }
.chat-out .chat-bubble { background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.chat-meta { font-size: .72rem; color: var(--ink-faint); margin-top: 2px; }

/* KPI tiles */
.kpi { background: var(--bg-card); border: 1px solid var(--line-soft); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 18px 16px; display: block; }
.kpi:hover { text-decoration: none; }
.kpi .kpi-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint); font-weight: 600; }
.kpi .kpi-value { font-family: var(--display); font-size: 2.2rem; font-weight: 500; line-height: 1; margin-top: 8px; color: var(--ink); }
.kpi.accent .kpi-value { color: var(--accent-deep); }
.kpi.sun { position: relative; }
.kpi.sun::before { content:""; position:absolute; top:0; left:0; width:3px; height:100%; background: var(--sun); border-radius: var(--radius) 0 0 var(--radius); }
.kpi.alert { position: relative; }
.kpi.alert::before { content:""; position:absolute; top:0; left:0; width:3px; height:100%; background: var(--dusty-red); border-radius: var(--radius) 0 0 var(--radius); }
.kpi.alert .kpi-value { color: var(--dusty-red); }

/* --- Lists ----------------------------------------------------------- */
.rows { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line-soft); }
.row:last-child { border-bottom: 0; }
.row .row-main { min-width: 0; flex: 1; }
.row .row-title { font-weight: 500; color: var(--ink); }
.row .row-sub { font-size: .82rem; color: var(--ink-soft); }
.row .row-meta { font-size: .8rem; color: var(--ink-faint); white-space: nowrap; }

/* --- Tables ---------------------------------------------------------- */
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data th { text-align: left; font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); }
table.data td { padding: 12px; border-bottom: 1px solid var(--line-soft); }
table.data tr:hover td { background: var(--bg-surface); }

/* --- Badges ---------------------------------------------------------- */
.badge { display: inline-block; font-size: .72rem; font-weight: 600; padding: 3px 9px; border-radius: 99px; letter-spacing: .01em; white-space: nowrap; }
.badge.is-new    { background: var(--sun-soft); color: var(--sun-deep); }
.badge.is-active { background: var(--accent-soft); color: var(--accent-deep); }
.badge.is-done   { background: #e3e8e4; color: #46584a; }
.badge.is-good   { background: #dcebe0; color: #2f6b43; }
.badge.is-muted  { background: #ece6e4; color: var(--clay); }
.badge.preneed   { background: #ece4f0; color: #6a4a7a; }

/* --- Buttons --------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; gap: 8px; font: inherit; font-weight: 500; font-size: .9rem; padding: 9px 16px; border-radius: var(--radius-sm); border: 1px solid transparent; cursor: pointer; transition: background .12s ease, border-color .12s ease; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-deep); }
.btn-gold { background: var(--sun); color: var(--navy); }
.btn-gold:hover { background: var(--sun-deep); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--bg-surface); }

/* --- Forms ----------------------------------------------------------- */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: .8rem; font-weight: 600; color: var(--ink-soft); margin-bottom: 5px; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=date], input[type=time], input[type=datetime-local], input[type=month], input[type=week], input[type=number], input[type=search], input[type=url], input[type=file], input[list], select, textarea {
  width: 100%; font: inherit; font-size: 16px; /* 16px stops iOS zoom */
  color: var(--ink); background: var(--bg-card);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 10px 12px;
}
input[type=file] { padding: 7px 12px; line-height: 1.4; cursor: pointer; }
input[type=file]::file-selector-button {
  font: inherit; font-size: .85rem; margin: 0 12px 0 0; padding: 6px 12px;
  color: var(--ink); background: var(--bg-surface);
  border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer;
}
input[type=file]::file-selector-button:hover { background: var(--line-soft); border-color: var(--accent); }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.form-error { background: #f7e6e2; color: #7a3b30; border: 1px solid #e2b9af; border-radius: var(--radius-sm); padding: 10px 14px; font-size: .9rem; margin-bottom: 16px; }
.form-note { font-size: .82rem; color: var(--ink-soft); }

/* --- Empty states ---------------------------------------------------- */
.empty { text-align: center; padding: 34px 20px; color: var(--ink-soft); }
.empty .empty-mark { color: var(--sun); opacity: .8; margin-bottom: 10px; }
.empty h3 { color: var(--ink); }

/* --- Focus visibility / motion --------------------------------------- */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* =====================================================================
   Login screen — the signature moment (lighthouse + harbor)
   ===================================================================== */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }

.auth-hero { background: var(--navy); color: #f4ede0; display: flex; flex-direction: column; justify-content: space-between; padding: 44px; position: relative; overflow: hidden; }
.auth-hero .beam-glow { position: absolute; top: -10%; right: -10%; width: 460px; height: 460px; background: radial-gradient(circle, rgba(200,153,84,.22), transparent 60%); pointer-events: none; }
.auth-hero .hero-mark { display: flex; align-items: center; gap: 12px; font-family: var(--display); font-size: 1.5rem; font-weight: 600; }
.auth-hero .hero-copy { max-width: 30ch; }
.auth-hero .hero-copy h2 { font-size: 2rem; color: #fff; margin-bottom: .3em; }
.auth-hero .hero-copy p { color: #c7d3db; margin: 0; }
.auth-hero .hero-foot { font-size: .8rem; color: #8da3b1; }

.auth-form { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-form .card { width: 100%; max-width: 360px; }
.auth-form h1 { font-size: 1.5rem; }

/* --- Total bar (arrangement estimate) --- */
.total { background: var(--navy); color: #f4ede0; padding: 14px 18px; }
.total-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.total-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }
.total-amt { font-family: var(--display); color: var(--sun); font-size: 1.8rem; line-height: 1; }

/* ---- Cremation & Disposition Authorization (on-screen fillable form) ---- */
.ca-doc { font-size: .95rem; color: var(--ink); }
.ca-intro { background: var(--bg-surface); border: 1px solid var(--line-soft); border-radius: var(--radius-sm); padding: 12px 14px; font-size: .9rem; color: var(--ink-soft); margin-bottom: 18px; }
.ca-sec { margin: 0 0 20px; }
.ca-sec-h { font-size: .85rem; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--accent-deep); border-bottom: 2px solid var(--line); padding-bottom: 5px; margin-bottom: 10px; }
.ca-sub-h { font-size: .8rem; font-weight: 700; color: var(--accent-deep); margin: 14px 0 6px; }
.ca-sec-key { background: var(--bg-surface); border: 1px solid var(--line-soft); border-left: 3px solid var(--accent); border-radius: var(--radius-sm); padding: 12px 14px; }
.ca-sec-key .ca-sec-h { border-bottom: 0; margin-bottom: 6px; }
.ca-p { font-size: .88rem; color: var(--ink-soft); line-height: 1.55; margin: 0 0 8px; }
.ca-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin-bottom: 6px; }
.ca-grid > div.ca-wide, .ca-grid > div.ca-ssn { grid-column: 1 / -1; }
@media (max-width: 620px) { .ca-grid { grid-template-columns: 1fr; } }
.ca-lbl { display: block; font-size: .72rem; letter-spacing: .4px; text-transform: uppercase; color: var(--ink-faint, #8a8f98); margin-bottom: 3px; }
.ca-fixed { display: block; font-weight: 600; color: var(--ink); padding: 6px 0; }
.ca-note { font-size: .78rem; color: var(--clay); margin-top: 4px; line-height: 1.4; }
.ca-input { width: 100%; }
.ca-opt { display: flex; gap: 9px; align-items: flex-start; padding: 8px 10px; margin: 5px 0; border: 1px solid var(--line-soft); border-radius: var(--radius-sm); cursor: pointer; font-size: .88rem; line-height: 1.45; background: #fff; }
.ca-opt:hover { border-color: var(--accent); }
.ca-opt input { margin-top: 3px; flex-shrink: 0; width: auto; }
.ca-opt-t { flex: 1; }
.ca-or { text-align: center; font-size: .7rem; letter-spacing: 2px; color: var(--ink-faint, #aaa); margin: 2px 0; }
.ca-subline { margin: 4px 0 10px 6px; display: flex; flex-direction: column; gap: 8px; }
.ca-inlinefield { margin: 8px 0; }
.ca-chk { display: inline-flex; align-items: center; gap: 6px; margin-right: 14px; font-size: .88rem; }
.ca-chk input { width: auto; }
.ca-actions { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line-soft); }

/* When a page is shown inside the document modal (iframe), keep content off the scrollbar */
/* Pages shown inside the document modal (iframe): no app chrome, content clears the scrollbar */
body.in-modal .topbar, body.in-modal .app-foot { display: none !important; }
body.in-modal main.wrap { padding-right: 40px; }
@media (max-width: 760px) { body.in-modal main.wrap { padding-right: 20px; } }

/* ---- Cremation authorization: guided step wizard ---- */
.ca-form[data-ca-wizard] .ca-step { border: 1px solid var(--line-soft); border-radius: var(--radius-sm); padding: 14px 16px; margin: 0 0 12px; background: #fff; }
.ca-form[data-ca-wizard] .ca-step .ca-sec-h { cursor: pointer; margin-bottom: 10px; }
.ca-form[data-ca-wizard] .ca-step.is-collapsed { background: var(--bg-surface); }
.ca-form[data-ca-wizard] .ca-step.is-collapsed > *:not(.ca-sec-h) { display: none !important; }
.ca-form[data-ca-wizard] .ca-step.is-collapsed .ca-sec-h { margin-bottom: 0; border-bottom: 0; }
.ca-form[data-ca-wizard] .ca-step.is-done .ca-sec-h::after { content: " ✓"; color: var(--accent); font-weight: 700; }
.ca-step-actions { margin-top: 14px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ca-step-err { color: var(--clay); font-size: .85rem; }
.ca-cond { margin: 2px 0 0; }
input.ca-invalid, select.ca-invalid, textarea.ca-invalid { border-color: var(--clay) !important; background: #fdf3f1 !important; }
.ca-opt.ca-invalid { border-color: var(--clay); background: #fdf3f1; }
.ca-cond.ca-invalid { outline: 1px solid var(--clay); border-radius: var(--radius-sm); padding: 4px; }

/* ---- Public legal pages (Terms, Privacy) ---- */
.legal-top { display: flex; align-items: center; gap: 10px; max-width: var(--maxw); margin: 0 auto; padding: 18px 20px; }
.legal-brand { display: inline-flex; align-items: center; gap: 8px; font-family: var(--display); font-size: 1.2rem; color: var(--ink); text-decoration: none; font-weight: 600; }
.legal-brand .beam { color: var(--accent); }
.legal-by { color: var(--ink-soft); font-size: .9rem; }
.legal { max-width: 760px; margin: 0 auto; padding: 8px 0 56px; }
.legal h1 { font-family: var(--display); font-size: 1.7rem; margin-bottom: 4px; }
.legal-eff { color: var(--ink-soft); margin: 0 0 4px; }
.legal-callout { background: var(--bg-surface); border: 1px solid var(--line-soft); border-left: 3px solid var(--accent); border-radius: var(--radius-sm); padding: 12px 14px; font-size: .92rem; color: var(--ink-soft); margin: 14px 0 28px; }
.legal h2 { font-family: var(--display); font-size: 1.15rem; color: var(--accent-deep); margin: 26px 0 8px; }
.legal p, .legal li { line-height: 1.65; color: var(--ink); }
.legal ul { padding-left: 20px; margin: 6px 0; }
.legal li { margin: 6px 0; }
.legal-foot { border-top: 1px solid var(--line-soft); margin-top: 24px; }
.legal-foot .wrap { padding: 18px 20px; font-size: .9rem; }
.legal-copy { color: var(--ink-soft); margin-top: 6px; font-size: .85rem; }
.app-foot { border-top: 1px solid var(--line-soft); margin-top: 8px; }
.app-foot .wrap { padding: 16px 20px; font-size: .82rem; color: var(--ink-soft); }
.app-foot a { color: var(--ink-soft); }
.auth-legal { text-align: center; margin-top: 16px; font-size: .85rem; }
.auth-legal a { color: var(--ink-soft); }

/* Service-mark superscript */
.sm { font-size: .62em; line-height: 0; }
.auth-foot { text-align: center; margin-top: 10px; font-size: .78rem; color: var(--ink-soft); }

/* ---- Searchable country dropdown ---- */
.csel { position: relative; }
.csel-btn { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 8px; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 9px 12px; font: inherit; color: var(--ink); cursor: pointer; }
.csel-btn:hover { border-color: var(--accent); }
.csel-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.csel-caret { color: var(--ink-soft); font-size: .8em; flex-shrink: 0; }
.csel-pop { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 60; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: 0 12px 32px rgba(13, 34, 56, .18); padding: 8px; }
.csel-search { width: 100%; margin: 0 0 6px; }
.csel-list { list-style: none; margin: 0; padding: 0; max-height: 240px; overflow-y: auto; }
.csel-opt { padding: 7px 10px; border-radius: 6px; cursor: pointer; font-size: .92rem; }
.csel-opt:hover { background: var(--bg-surface); }
.csel-opt.sel { background: var(--accent); color: #fff; }

/* ---- Death certificate worksheet completeness meter ---- */
.dw-bar { height: 12px; border-radius: 99px; background: var(--line-soft); overflow: hidden; }
.dw-bar span { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .3s ease; }
.dw-meter-label { margin-top: 8px; font-size: .9rem; color: var(--ink-soft); }

/* ---- Recommended-field marker + vital sections accordion / wizard ---- */
.req-mark { color: #b4452f; font-style: normal; font-weight: 700; margin-left: 1px; }
.vacc { margin: 4px 0; }
.vacc-item { border: 1px solid var(--line-soft); border-radius: 10px; margin-bottom: 10px; background: #fff; overflow: hidden; }
.vacc-head { width: 100%; display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: transparent; border: 0; cursor: pointer; font: inherit; text-align: left; }
.vacc-title { flex: 1; font-weight: 600; font-family: var(--display, Georgia), serif; color: var(--brand, #0d2238); }
.vacc-meta { font-size: .78rem; color: #9a9a9a; font-variant-numeric: tabular-nums; }
.vacc-chev { color: #aaa; transition: transform .2s ease; }
.vacc-item.open .vacc-chev { transform: rotate(180deg); }
.vacc-body { display: none; padding: 6px 14px 14px; border-top: 1px solid var(--line-soft); }
.vacc-item.open .vacc-body { display: block; }
.vacc-actions { margin-top: 12px; }

/* ---- Password reveal toggle + scrollable terms box ---- */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { width: 100%; padding-right: 40px; }
.pw-eye { position: absolute; top: 50%; right: 6px; transform: translateY(-50%); background: transparent; border: 0; cursor: pointer; font-size: 1rem; line-height: 1; padding: 4px 6px; opacity: .55; }
.pw-eye:hover { opacity: 1; }
.pw-eye.on { opacity: 1; }
.terms-ta { height: 200px; overflow: auto; resize: vertical; line-height: 1.5; }
textarea[readonly].terms-ta { background: #faf9f6; color: #4a4a4a; }
.badge.planning  { background: #f3dceb; color: #9b3d72; }

/* ---- Agenda: wide calendar (3 cols) + upcoming/tasks rail ---- */
.agenda-grid { display: grid; grid-template-columns: 3fr 1fr; gap: 16px; align-items: start; }
.agenda-grid > .card { margin-bottom: 0; }
@media (max-width: 980px) { .agenda-grid { grid-template-columns: 1fr; } }

/* ---- Calendar day-details modal ---- */
.cal-day.has-ev { cursor: pointer; }
.cal-day.has-ev:hover { background: var(--accent-soft); }
.cal-modal[hidden] { display: none; }
.cal-modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; }
.cal-modal-backdrop { position: absolute; inset: 0; background: rgba(13,34,56,.5); }
.cal-modal-box { position: relative; background: #fff; border-radius: 14px; max-width: 460px; width: calc(100% - 32px); max-height: 80vh; overflow: auto; padding: 22px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.cal-modal-x { position: absolute; top: 8px; right: 12px; background: transparent; border: 0; font-size: 1.6rem; line-height: 1; cursor: pointer; color: #999; }
.cal-modal-day { margin: 0 0 10px; font-family: var(--display, Georgia), serif; color: var(--brand, #0d2238); }
.cal-modal-ev { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line-soft); }
.cal-modal-ev:first-child { border-top: 0; }
.cal-modal-ev-time { width: 78px; flex: none; font-weight: 600; color: var(--accent); }
.cal-modal-ev-main { flex: 1; }
.cal-modal-ev-title { font-weight: 600; }
.cal-modal-ev-sub { color: #777; font-size: .9rem; margin-top: 2px; }
.cal-open-case { flex: none; align-self: center; }

/* ---- Address autocomplete ---- */
.addr-ac { position: relative; }
.addr-ac-menu { position: absolute; left: 0; right: 0; top: 100%; z-index: 60; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm, 8px); box-shadow: 0 12px 30px rgba(13,34,56,.16); margin-top: 4px; overflow: hidden; max-height: 280px; overflow-y: auto; }
.addr-ac-menu[hidden] { display: none; }
.addr-ac-item { padding: 9px 12px; cursor: pointer; font-size: .92rem; border-bottom: 1px solid var(--line-soft); }
.addr-ac-item:last-child { border-bottom: 0; }
.addr-ac-item:hover, .addr-ac-item.is-active { background: var(--accent-soft); }
.addr-ac-credit { padding: 6px 12px; font-size: .72rem; color: #9a948c; background: var(--bg-surface, #faf9f6); border-top: 1px solid var(--line-soft); }

/* Global top-bar search (Feature: search on every page) */
.topbar-search{display:flex;align-items:center;gap:6px;background:rgba(255,255,255,.10);border:1px solid rgba(255,255,255,.18);border-radius:999px;padding:5px 12px;margin-right:6px}
.topbar-search svg{color:rgba(255,255,255,.7);flex:none}
.topbar-search input{background:transparent;border:0;outline:0;color:#fff;font-size:.86rem;width:150px}
.topbar-search input::placeholder{color:rgba(255,255,255,.6)}
.topbar-search:focus-within{background:rgba(255,255,255,.16);border-color:rgba(255,255,255,.35)}
@media (max-width:860px){.topbar-search{width:100%;margin:8px 0 0;box-sizing:border-box}.topbar-search input{width:100%}}

/* Full-width card spanning all grid columns (e.g. Complete App Activity) */
.card-span-all { grid-column: 1 / -1; }

/* ============================================================
   Shared case navigation (includes/case_nav.php)
   Sticky header + desktop tabs + mobile section hub.
   ============================================================ */
.cn-head { position: sticky; top: 0; z-index: 20; background: var(--bg-card, #fff);
  border-bottom: 1px solid var(--line-soft); padding: 18px 20px 0;
  margin: -28px -20px 18px; }
.cn-head-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.cn-crumb { font-size: .8rem; margin-bottom: 3px; color: var(--ink-soft, #6b7785); }
.cn-crumb a { color: var(--accent, #3c6f8f); text-decoration: none; }
.cn-name { font-family: 'Fraunces', Georgia, serif; font-size: 1.6rem; font-weight: 600; color: var(--accent-deep, #0d2238); line-height: 1.1; }
.cn-dates { font-size: .85rem; color: var(--ink-soft, #6b7785); margin-top: 4px; }
.cn-meta { display: flex; align-items: center; gap: 18px; }
.cn-k { display: block; font-size: .7rem; color: var(--ink-soft, #6b7785); text-transform: uppercase; letter-spacing: .04em; }
.cn-bal { font-size: 1.25rem; font-weight: 600; }
.cn-cta { padding: 9px 16px; font-size: .9rem; white-space: nowrap; }

.cn-tabs { display: flex; gap: 22px; margin-top: 14px; overflow-x: auto; }
.cn-tab { font-size: .9rem; color: var(--ink-soft, #6b7785); text-decoration: none; padding: 11px 1px 12px; border-bottom: 2px solid transparent; white-space: nowrap; }
.cn-tab:hover { color: var(--accent-deep, #0d2238); }
.cn-tab.on { color: var(--accent-deep, #0d2238); border-bottom-color: var(--gold, #c89954); font-weight: 500; }

/* mobile-only pieces hidden on desktop */
.cn-hub, .cn-back { display: none; }

@media (max-width: 720px) {
  .cn-head { padding: 14px 20px 0; margin: -28px -20px 16px; }
  .cn-name { font-size: 1.35rem; }
  .cn-tabs { display: none; }                 /* tabs → hub on mobile */
  .cn-meta { width: 100%; justify-content: space-between; margin-top: 4px; }
  .cn-head { padding-bottom: 14px; }

  .cn-hub { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; margin-bottom: 16px; }
  .cn-tile { display: flex; flex-direction: column; justify-content: space-between; min-height: 92px;
    background: var(--bg-card, #fff); border: 1px solid var(--line-soft, #e2ddd0); border-radius: 12px;
    padding: 13px; text-decoration: none; color: inherit; }
  .cn-tile:active { transform: scale(.985); }
  .cn-tic { font-size: 1.2rem; color: var(--accent, #3c6f8f); line-height: 1; }
  .cn-tname { font-size: .9rem; font-weight: 500; color: var(--accent-deep, #0d2238); margin-top: 10px; }
  .cn-tstat { font-size: .78rem; color: var(--ink-soft, #6b7785); margin-top: 2px; }
  .cn-tile.due { border-color: #e6c3ba; background: #fdf4f1; }
  .cn-tile.due .cn-tstat { color: var(--clay, #a4442f); font-weight: 500; }
  .cn-tile.attn { border-color: #e7d6b4; background: #fdf8ee; }
  .cn-tile.attn .cn-tstat { color: #854f0b; font-weight: 500; }

  .cn-back { display: inline-flex; align-items: center; gap: 6px; font-size: .92rem; font-weight: 500;
    color: var(--accent-deep, #0d2238); text-decoration: none; margin-bottom: 12px; }
  .cn-back span { color: var(--accent, #3c6f8f); font-size: 1.2rem; }
}

/* case-nav header right cluster (controls + balance/cta) */
.cn-right { display: flex; flex-direction: column; align-items: flex-end; gap: 9px; }
.cn-controls { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.cn-controls select { font-size: .82rem; padding: 5px 8px; }
@media (max-width: 720px) {
  .cn-right { align-items: stretch; width: 100%; }
  .cn-controls { justify-content: flex-start; }
}

/* Persistent top navigation on desktop (≥861px = above the hamburger breakpoint).
   The case sub-nav then sticks just beneath the 60px topbar. */
@media (min-width: 861px) {
  .topbar { position: sticky; top: 0; z-index: 100; }
  .cn-head { top: 60px; }
}

/* Clickable rows (data-href, handled by harbor.js) — cursor + keyboard focus ring */
[data-href] { cursor: pointer; }
[data-href]:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 6px; }

/* Sign-in: single, streamlined column on phones (compact branded hero → card → legal).
   Placed after the base .auth rules so these overrides win regardless of source order. */
@media (max-width: 820px) {
  .auth { display: block; min-height: 100dvh; }
  .auth-hero { justify-content: flex-start; gap: 12px; padding: 26px 24px 30px; }
  .auth-hero .beam-glow { width: 300px; height: 300px; top: -8%; }
  .auth-hero .hero-copy { max-width: none; }
  .auth-hero .hero-copy h2 { font-size: 1.5rem; }
  .auth-hero .hero-foot { display: none; }
  .auth-form { padding: 26px 22px 40px; }
}

/* Passkey (Face ID / Touch ID) sign-in UI */
.pk-block { margin-top: 16px; }
.pk-or { display: flex; align-items: center; gap: 12px; color: var(--ink-soft); font-size: .8rem; margin: 4px 0 12px; }
.pk-or::before, .pk-or::after { content: ""; height: 1px; background: var(--line-soft); flex: 1; }
.pk-btn { width: 100%; justify-content: center; }
.pk-status { font-size: .82rem; color: var(--ink-soft); margin-top: 8px; min-height: 1.1em; text-align: center; }
.pk-status.is-error { color: var(--clay); }

/* ---- Public marketing landing (includes/landing.php) ---- */
.lp { min-height: 100dvh; display: flex; flex-direction: column; background: var(--cream, #f2efe8); }
.lp-bar { display: flex; align-items: center; justify-content: space-between; padding: 18px 28px; max-width: 1080px; width: 100%; margin: 0 auto; }
.lp-brand { display: flex; align-items: center; gap: 10px; color: var(--navy, #0d2238); font-family: var(--display); font-size: 1.25rem; font-weight: 600; text-decoration: none; }
.lp-brand svg { display: block; }
.lp-hero { background: var(--navy, #0d2238); color: #f4ede0; position: relative; overflow: hidden; }
.lp-glow { position: absolute; top: -20%; right: -8%; width: 540px; height: 540px; background: radial-gradient(circle, rgba(200,153,84,.22), transparent 60%); pointer-events: none; }
.lp-hero-grid { max-width: 1320px; margin: 0 auto; padding: 80px 28px; position: relative;
  display: grid; grid-template-columns: 1fr 1fr 1.9fr; align-items: center; gap: 40px; }
.lp-hero-text { grid-column: 1 / 3; }
.lp-hero-logo { grid-column: 3 / 4; display: flex; align-items: center; justify-content: center; }
.lp-hero-logo img { width: 100%; max-width: 640px; height: auto; display: block; }
.lp-eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .8rem; color: var(--sun, #c89954); font-weight: 600; margin: 0 0 14px; }
.lp-h1 { font-family: var(--display); font-size: clamp(2.4rem, 6vw, 4rem); line-height: 1.04; color: #fff; margin: 0 0 .35em; max-width: 16ch; }
.lp-sub { font-size: 1.15rem; line-height: 1.6; color: #c7d3db; max-width: 56ch; margin: 0 0 28px; }
.lp-cta { display: flex; flex-wrap: wrap; gap: 12px; }
.btn-ghost-light { background: transparent; color: #f4ede0; border: 1px solid rgba(244,237,224,.45); }
.btn-ghost-light:hover { background: rgba(244,237,224,.08); text-decoration: none; }
.lp-features { max-width: 1080px; margin: 0 auto; padding: 64px 28px; width: 100%; }
.lp-h2 { font-family: var(--display); font-size: clamp(1.5rem, 3vw, 2rem); color: var(--navy, #0d2238); margin: 0 0 32px; }
.lp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 22px; }
.lp-feature { background: #fff; border: 1px solid var(--line-soft, #e6e1d6); border-radius: 14px; padding: 22px 22px 24px; }
.lp-feature h3 { font-family: var(--display); font-size: 1.15rem; color: var(--navy, #0d2238); margin: 0 0 .4em; }
.lp-feature p { color: var(--ink-soft, #5c6670); line-height: 1.55; margin: 0; font-size: .96rem; }
.lp-foot { margin-top: auto; border-top: 1px solid var(--line-soft, #e6e1d6); max-width: 1080px; width: 100%; margin-left: auto; margin-right: auto; padding: 24px 28px; display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; justify-content: space-between; font-size: .82rem; color: var(--ink-soft, #5c6670); }
.lp-foot-links a { color: var(--ink-soft, #5c6670); }
@media (max-width: 600px) { .lp-hero-grid { padding: 52px 22px 60px; } .lp-features { padding: 48px 22px; } }

/* ---- Brand logo images (outlined-path SVG lockups) ---- */
.brand-logo { height: 32px; width: auto; display: block; }
.hero-logo { height: 64px; width: auto; display: block; }
.lp-brand-logo { height: 40px; width: auto; display: block; }
.legal-logo { height: 30px; width: auto; display: block; }
@media (max-width: 600px) { .hero-logo { height: 52px; } .brand-logo { height: 28px; } }

/* Hero stacks below 900px (logo under the text) */
@media (max-width: 900px) {
  .lp-hero-grid { grid-template-columns: 1fr; gap: 30px; padding: 56px 24px 64px; }
  .lp-hero-text, .lp-hero-logo { grid-column: 1; }
  .lp-hero-logo { justify-content: flex-start; }
  .lp-hero-logo img { max-width: 340px; }
}

/* ---- Request-a-demo modal ---- */
.demo-modal { position: fixed; inset: 0; background: rgba(8,18,30,.62); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; z-index: 1000; overflow-y: auto; }
.demo-modal[hidden] { display: none; }
.demo-box { background: #fff; border-radius: 16px; max-width: 480px; width: 100%; padding: 28px 26px 26px; position: relative; box-shadow: 0 24px 60px rgba(0,0,0,.3); }
.demo-x { position: absolute; top: 10px; right: 14px; background: none; border: none; font-size: 1.7rem; line-height: 1; color: var(--ink-soft,#5c6670); cursor: pointer; }
.demo-box h2 { font-family: var(--display); color: var(--navy,#0d2238); font-size: 1.5rem; margin: 0 0 .3em; }
.demo-lead { color: var(--ink-soft,#5c6670); margin: 0 0 18px; font-size: .95rem; line-height: 1.5; }
.demo-fields { display: flex; flex-direction: column; gap: 12px; }
.demo-fields .muted { color: var(--ink-soft,#5c6670); font-weight: 400; }
.demo-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.demo-send { width: 100%; justify-content: center; margin-top: 4px; }
.demo-status { font-size: .85rem; min-height: 1.1em; text-align: center; color: var(--ink-soft,#5c6670); }
.demo-status.is-error { color: var(--clay,#a8432e); }
.demo-done { text-align: center; padding: 8px 0 4px; }
.demo-done p { margin: 0 0 10px; color: var(--ink,#1a1a1a); }
