/* The hub's look, from the design canvas: Acceptance Path's palette, Onest and
   Merriweather (served by the hub), a deep-teal sidebar, parchment pages. */
@font-face { font-family: "Onest"; src: url("/static/fonts/onest-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Onest"; src: url("/static/fonts/onest-600.woff2") format("woff2"); font-weight: 600 700; font-display: swap; }
@font-face { font-family: "Merriweather"; src: url("/static/fonts/merriweather-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  --bg: #F7F0E4;
  --panel: #FFF9F1;
  --ink: #103E40;
  --body: #4F6665;
  --muted: #4F6665;
  --line: #E6DAC6;
  --line-soft: #EFE6D6;
  --accent: #185D60;
  --accent-ink: #ffffff;
  --accent-soft: #D8EBE7;
  --action: #B94F36;
  --action-hover: #A9442E;
  --side: #103E40;
  --ok: #185D60;
  --warn: #A9442E;
  --error-bg: #FBE9E4;
  --error-ink: #A9442E;
  --ok-bg: #D8EBE7;
  --radius: 14px 14px 14px 5px;
  --serif: "Merriweather", Georgia, serif;
  color-scheme: light;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
}

a { color: var(--accent); font-weight: 600; text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 0.92em; }
h1 { font: 400 1.75rem/1.25 var(--serif); margin: 0 0 0.25rem; color: var(--ink); }
h2 { font-size: 0.95rem; font-weight: 700; margin: 0 0 0.75rem; color: var(--ink); }
h3 { font-size: 0.92rem; font-weight: 700; margin: 0 0 0.5rem; }
.muted { color: var(--muted); font-weight: 400; }
.note { color: var(--warn); font-size: 0.9rem; margin: 0.25rem 0; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--action-hover); margin: 0.75rem 0 0.25rem; }

/* Shell: sidebar and page */
.shell { display: grid; grid-template-columns: 224px minmax(0, 1fr); min-height: 100vh; }
.side {
  background: var(--side);
  color: #E9F2F0;
  padding: 24px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.side .logo { display: block; padding: 0 8px; }
.side .logo img { display: block; width: 172px; max-width: 100%; height: auto; }
.side .logo span { display: block; margin-top: 4px; padding-left: 4px; font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: #A9C9C5; }
.side nav.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 3px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); }
.side nav.modes a { display: flex; align-items: center; justify-content: center; min-height: 34px; border-radius: 999px; color: #E9F2F0; font-size: 12px; }
.side nav.modes a[aria-current="true"] { background: #F7F0E4; color: var(--ink); }
.side .groups { display: flex; flex-direction: column; gap: 14px; }
.side .group { display: flex; flex-direction: column; gap: 2px; }
.side .group-name { padding: 0 12px 4px; font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: #A9C9C5; }
.side .group a { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 0 12px; border-radius: 999px; color: #E9F2F0; font-weight: 500; font-size: 13px; }
.side .ico { flex: none; width: 17px; height: 17px; opacity: 0.85; }
.side .group a[aria-current="page"] .ico { opacity: 1; }
.side .group a:hover { background: rgba(255, 255, 255, 0.08); text-decoration: none; }
.side .group a[aria-current="page"] { background: var(--accent-soft); color: var(--ink); font-weight: 600; }
.side .who { margin-top: auto; display: flex; flex-direction: column; gap: 2px; padding: 12px 12px 0; border-top: 1px solid var(--accent); font-size: 12px; color: #A9C9C5; word-break: break-all; }
.side .who button.link { display: inline-flex; align-items: center; gap: 8px; color: #F7F0E4; padding: 0; min-height: 36px; justify-content: flex-start; font-size: 12px; }
body.mode-ehr .side { background: #0B3032; }
body.signed-out .shell { display: block; }

main { max-width: 1320px; margin: 0; padding: 28px 32px 3rem; width: 100%; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; padding: 12px 14px; gap: 10px; flex-direction: column; }
  .side .logo img { width: 150px; }
  .side .logo span { display: none; }
  .side .groups { display: flex; flex-direction: row; gap: 4px; overflow-x: auto; padding-bottom: 2px; }
  .side .group { flex-direction: row; gap: 4px; }
  .side .group-name { display: none; }
  .side .group a { white-space: nowrap; min-height: 40px; }
  .side .who { flex-direction: row; justify-content: space-between; align-items: center; margin-top: 0; padding-top: 8px; }
  main { padding: 18px 16px 3rem; }
}
.page-head { margin-bottom: 1rem; }
.crumb { margin: 0 0 0.25rem; font-size: 0.9rem; }
.contact { display: flex; flex-wrap: wrap; gap: 0.35rem 1rem; margin: 0.25rem 0 0; }
.badge {
  display: inline-block;
  margin: 0.5rem 0 0;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.35rem;
  margin-bottom: 1.1rem;
}
.narrow { max-width: 440px; margin: 2rem auto; }

.flash { padding: 0.7rem 0.9rem; border-radius: var(--radius); margin: 0 0 1rem; }
.flash.ok { background: var(--ok-bg); color: var(--ok); }
.flash.error { background: var(--error-bg); color: var(--error-ink); }
.status { min-height: 1.5em; }
.status.error { color: var(--error-ink); }

button {
  font: inherit;
  font-weight: 600;
  min-height: 44px;
  padding: 0.5rem 0.95rem;
  border-radius: 8px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
  border-radius: 999px;
}
button.secondary { background: transparent; color: var(--accent); }
button.link { background: none; border: 0; color: var(--accent); padding: 0.25rem; min-height: 44px; font-weight: 500; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

label { display: flex; flex-direction: column; gap: 0.25rem; font-weight: 600; font-size: 0.92rem; margin-bottom: 0.8rem; }
label .muted, label .note { font-weight: 400; }
label.check { flex-direction: row; align-items: center; gap: 0.5rem; font-weight: 500; }
input, select, textarea {
  font: inherit;
  min-height: 44px;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  width: 100%;
}
input[type="checkbox"] { width: 20px; min-height: 20px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); margin: 0 0 1rem; padding: 0.8rem 1rem 0.4rem; }
legend { font-weight: 700; padding: 0 0.35rem; }
form.inline { display: inline; }
details summary { cursor: pointer; color: var(--accent); min-height: 44px; display: flex; align-items: center; }

/* Board */
.board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(240px, 1fr);
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}
.column { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.75rem; }
.column h2 { font-size: 0.92rem; display: flex; justify-content: space-between; gap: 0.5rem; }
.count { color: var(--muted); font-weight: 500; }
.column ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.card {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
  background: var(--bg);
}
.card:hover { border-color: var(--accent); }
.card .muted { font-size: 0.85rem; }

@media (max-width: 720px) {
  .board { grid-auto-flow: row; grid-auto-columns: auto; overflow-x: visible; }
}

/* Case */
.case-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
@media (max-width: 900px) { .case-grid { grid-template-columns: 1fr; } }
.steps { list-style: none; margin: 0; padding: 0; }
.step { display: flex; gap: 0.75rem; padding: 0.8rem 0; border-top: 1px solid var(--line); }
.step:first-child { border-top: 0; }
.mark {
  flex: 0 0 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--line);
  display: grid;
  place-items: center;
  font-weight: 700;
}
.step.done .mark { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.step.skipped .mark { color: var(--muted); }
.step .body { flex: 1; min-width: 0; }
.step .label { font-weight: 600; }
.step.done .label, .step.skipped .label { color: var(--muted); }
.meta { color: var(--muted); font-size: 0.88rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-top: 0.5rem; }
.actions .note { flex-basis: 100%; }
.cost { display: grid; grid-template-columns: 1fr 1fr; gap: 0 0.75rem; width: 100%; align-items: end; }
.cost .wide { grid-column: 1 / -1; }
.cost button { justify-self: start; margin-bottom: 0.8rem; }
@media (max-width: 480px) { .cost { grid-template-columns: 1fr; } }
.outcomes { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.activity { list-style: none; margin: 0; padding: 0; font-size: 0.88rem; }
.activity li { display: flex; flex-direction: column; padding: 0.45rem 0; border-top: 1px solid var(--line); }
.activity li:first-child { border-top: 0; }

/* Tables */
table.list { width: 100%; border-collapse: collapse; background: transparent; }
table.list th, table.list td { text-align: left; padding: 0.7rem 0.75rem; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.list th { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); border-bottom-color: var(--line); white-space: nowrap; }
@media (max-width: 640px) {
  table.list thead { display: none; }
  table.list tr { display: block; border-bottom: 1px solid var(--line); padding: 0.4rem 0; }
  table.list td { display: block; border: 0; padding: 0.15rem 0.6rem; }
}

/* Settings */
.conns { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.conn p { margin: 0.25rem 0; }
.ok { color: var(--ok); }
.warn { color: var(--warn); }
.add-staff { margin-top: 1rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 0.75rem; align-items: end; }
.add-staff h3 { grid-column: 1 / -1; }
.add-staff button { margin-bottom: 0.8rem; }

/* Sign-in */
.qr img { display: block; width: 200px; height: 200px; image-rendering: pixelated; background: #fff; padding: 6px; border-radius: 8px; }

/* Matcher */
.page-head:has(.button) { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; }
a.button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.5rem 0.95rem;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  text-decoration: none;
}
.subnav { display: flex; flex-wrap: wrap; gap: 0.25rem; margin: 0 0 1rem; border-bottom: 1px solid var(--line); }
.subnav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.8rem;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 3px solid transparent;
}
.subnav a[aria-current="page"] { border-bottom-color: var(--accent); color: var(--accent); font-weight: 600; }
.badge.bad { background: var(--error-bg); color: var(--error-ink); }
td .badge { margin: 0; white-space: nowrap; }
ul.checks { list-style: none; margin: 0 0 0.5rem; padding: 0; }
ul.checks li { padding: 0.35rem 0; border-top: 1px solid var(--line); }
ul.checks li:first-child { border-top: 0; }
ul.checks li.ok::before { content: "¹3  "; }
ul.checks li.warn::before { content: "!  "; font-weight: 700; }
dl.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0.4rem 1rem; margin: 0; }
dl.facts dt { color: var(--muted); font-size: 0.9rem; }
dl.facts dd { margin: 0; }
@media (max-width: 560px) { dl.facts { grid-template-columns: 1fr; } dl.facts dd { margin-bottom: 0.4rem; } }
.match { padding: 0.6rem 0; border-top: 1px solid var(--line); }
.match:first-of-type { border-top: 0; }
.match p { margin: 0.25rem 0; }
pre.wrap { white-space: pre-wrap; word-break: break-word; background: var(--bg); padding: 0.6rem; border-radius: 8px; max-height: 320px; overflow: auto; }
table.grid th, table.grid td { padding: 0.2rem 0.4rem; }
table.grid label.check { margin: 0; font-weight: 400; }

/* Counselors */
.head-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
a.button.secondary { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.panel .page-head { margin-bottom: 0.5rem; }
.panel .page-head h2 { margin: 0; }
details.week { border: 1px solid var(--line); border-radius: var(--radius); padding: 0 0.8rem 0.6rem; margin: 0 0 0.75rem; }
details.week summary { gap: 0.75rem; flex-wrap: wrap; color: var(--ink); }
details.week summary .muted { font-size: 0.88rem; }
table.week-grid { border-collapse: collapse; margin: 0.25rem 0 0.75rem; }
table.week-grid th { text-align: left; font-size: 0.85rem; color: var(--muted); padding: 0.2rem 0.5rem 0.2rem 0; }
table.week-grid td { padding: 0.2rem 0.5rem 0.2rem 0; }
table.week-grid input[type="time"] { width: 8.5rem; }
label.day {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  min-height: 44px;
  min-width: 8.5rem;
  padding: 0 0.6rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
}
label.day:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
@media (max-width: 560px) {
  details.week { padding: 0 0.5rem 0.5rem; }
  table.week-grid { width: 100%; table-layout: fixed; }
  table.week-grid th:first-child { width: 38%; }
  table.week-grid td { padding-right: 0.3rem; }
  label.day { min-width: 0; padding: 0 0.4rem; gap: 0.35rem; font-size: 0.85rem; overflow: hidden; }
  table.week-grid input[type="time"] { width: 100%; min-width: 0; padding: 0.3rem 0.2rem; font-size: 0.85rem; }
}
.counselor-form > button { margin-bottom: 1rem; }

/* Insurance */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0.5rem; }
.plan-grid label.day { min-width: 0; }
.narrow-input { max-width: 5rem; }

/* EHR */
.day-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 0 0 1rem; }
.day-nav h1 { margin: 0 0.5rem 0 0; }
.day-nav form { display: flex; gap: 0.5rem; align-items: center; margin-left: auto; }
.day-nav select { width: auto; }
.sync-line { font-size: 0.88rem; color: var(--muted); margin: 0 0 1rem; display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }
.appt-time { white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 600; }
.status-pill { display: inline-block; padding: 0.1rem 0.55rem; border-radius: 999px; font-size: 0.82rem; background: var(--accent-soft); color: var(--accent); }
.status-pill.off { background: var(--error-bg); color: var(--error-ink); }
.chart-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1rem; align-items: flex-start; margin-bottom: 1rem; }
.chart-head h1 { margin: 0; }
.chart-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 1rem; align-items: start; }
@media (max-width: 900px) { .chart-grid { grid-template-columns: 1fr; } }
.search { display: flex; gap: 0.5rem; margin: 0 0 1rem; flex-wrap: wrap; }
.search input { flex: 1 1 16rem; }
.search select { width: auto; }
.messages li { list-style: none; padding: 0.5rem 0; border-top: 1px solid var(--line); }
.messages ul { padding: 0; margin: 0; }
.messages .in { color: var(--ink); }
.messages .meta { display: block; }

/* Today */
.today-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.25rem; }
.today-head p { margin: 0 0 0.25rem; }
.pill-search input { width: min(320px, 100%); border-radius: 999px; border-color: #A9C9C5; background: #fff; padding: 0.5rem 1rem; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .kpis { grid-template-columns: 1fr; } }
.kpi { display: flex; flex-direction: column; gap: 0.35rem; padding: 1.1rem 1.25rem; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); font-weight: 400; }
.kpi:hover { text-decoration: none; border-color: #A9C9C5; }
.kpi-label { font-size: 13px; color: var(--muted); }
.kpi-value { font-size: 28px; font-weight: 600; line-height: 1.1; }
.kpi-sub { font-size: 13px; color: var(--muted); }
.today-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
@media (max-width: 1000px) { .today-grid { grid-template-columns: 1fr; } }
.tasks, .attention, .connections { list-style: none; margin: 0; padding: 0; }
.task { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; min-height: 52px; padding: 0.5rem 0; border-bottom: 1px solid var(--line-soft); }
.task-text { flex: 1 1 16rem; font-size: 14px; }
.attention li { display: flex; align-items: flex-start; gap: 0.75rem; padding: 0.65rem 0; border-bottom: 1px solid var(--line-soft); }
.attention li:last-child { border-bottom: 0; }
.attention li > span:not(.chip):not(.appt-time) { display: flex; flex-direction: column; gap: 2px; flex: 1; font-size: 14px; }
.attention li > a { margin-left: auto; font-size: 13px; }
.connections li { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; padding: 0.35rem 0; font-size: 13px; }
.chip { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.chip.wait { background: #EFE6D6; color: #4F6665; }
.chip.over { background: #FBE9E4; color: #A9442E; }
.chip.today { background: #D8EBE7; color: #185D60; }
.chip.done { background: #185D60; color: #fff; }

/* ---------- onboarding pipeline ---------- */
button.small, a.button.small { min-height: 34px; padding: 0.3rem 0.8rem; font-size: 13px; }
.p-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.25rem; margin-bottom: 0.9rem; }
.p-head h1 { margin: 0; }
.p-filters { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.p-filter { display: inline-flex; align-items: center; gap: 0.35rem; min-height: 34px; padding: 0 0.75rem; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font-size: 13px; font-weight: 500; }
.p-filter:hover { text-decoration: none; border-color: var(--accent); }
.p-filter[aria-current="true"] { background: var(--ink); border-color: var(--ink); color: #F7F0E4; }
.p-filter .n { font-size: 12px; opacity: 0.75; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: #C9B99E; }
.dot.team { background: var(--action); }
.dot.booked { background: var(--accent); }
.p-tools { display: flex; align-items: center; gap: 0.5rem; margin-left: auto; }
.p-tools form { margin: 0; }
.p-tools .pill-search input { min-height: 34px; width: 12rem; }

.pipeline { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.6rem; align-items: start; }
.p-col { background: #F1E8D8; border-radius: 12px; padding: 0.55rem 0.45rem 0.45rem; min-width: 0; }
.p-col.hold { background: #EDE7DD; }
.p-col h2 { display: flex; align-items: center; justify-content: space-between; margin: 0 0.3rem 0.35rem; font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink); }
.p-col h2 .n { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.p-mine { margin: -0.15rem 0.3rem 0.4rem; font-size: 11.5px; font-weight: 600; color: var(--action-hover); }
.p-empty { margin: 0.4rem 0.3rem; font-size: 12.5px; color: var(--muted); }
.p-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.35rem; }
.p-card { display: flex; flex-direction: column; gap: 2px; padding: 0.45rem 0.55rem 0.5rem 0.6rem; border-radius: 8px; background: var(--panel); border-left: 3px solid #C9B99E; color: var(--ink); font-weight: 400; box-shadow: 0 1px 0 rgba(16, 62, 64, 0.06); min-height: 44px; }
.p-card:hover { text-decoration: none; background: #fff; }
.p-card.team { border-left-color: var(--action); }
.p-card.booked { border-left-color: var(--accent); }
.p-card.hold { border-left-color: #A69A86; }
.p-top { display: flex; align-items: baseline; justify-content: space-between; gap: 0.4rem; min-width: 0; }
.p-top strong { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-chip { flex: none; font-size: 11px; font-weight: 600; color: var(--muted); }
.p-chip.late { color: var(--action-hover); }
.p-chip.booked { color: var(--accent); }
.p-next { font-size: 12.5px; line-height: 1.35; color: var(--body); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.p-card.team .p-next { color: var(--ink); font-weight: 500; }
.p-next .muted { font-weight: 400; }
.p-foot { margin-top: 0.9rem; font-size: 12.5px; max-width: 80ch; }
@media (max-width: 1180px) { .pipeline { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 720px) {
  .pipeline { grid-template-columns: 1fr; }
  .p-tools { margin-left: 0; width: 100%; }
  .p-tools .pill-search { flex: 1; }
  .p-tools .pill-search input { width: 100%; }
}

/* ---------- a case ---------- */
.case-head { margin-bottom: 0.75rem; }
.case-head .crumb { margin: 0 0 0.1rem; }
.case-title { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.75rem; }
.case-title h1 { margin: 0; }
.case-facts { display: flex; flex-wrap: wrap; gap: 0.2rem 0.9rem; margin: 0.3rem 0 0; font-size: 13.5px; }
.case-main { display: grid; gap: 0.75rem; min-width: 0; }
.case-main .panel, .case-side .panel { margin: 0; }
.next-panel { border-left: 4px solid var(--action); padding-top: 0.8rem; padding-bottom: 0.9rem; }
.next-panel.client, .next-panel.hold { border-left-color: #C9B99E; }
.next-panel.booked { border-left-color: var(--accent); }
.next-top { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; font-size: 13px; }
.next-panel .eyebrow { margin: 0; }
.next-panel h2 { margin: 0.1rem 0 0.35rem; font-family: var(--serif); font-size: 1.2rem; font-weight: 400; }
.next-panel > p { margin: 0 0 0.4rem; }
.step-actions { margin-top: 0.4rem; display: grid; gap: 0.5rem; }
.checklist { padding-top: 0.2rem; padding-bottom: 0.2rem; }
details.stage + details.stage { border-top: 1px solid var(--line); }
details.stage > summary { display: grid; grid-template-columns: 1fr 5rem 2.6rem; align-items: center; gap: 0.75rem; min-height: 44px; cursor: pointer; list-style: none; font-weight: 600; font-size: 14px; }
details.stage > summary::-webkit-details-marker { display: none; }
details.stage > summary .stage-name::before { content: '▸'; display: inline-block; width: 1rem; color: var(--muted); }
details.stage[open] > summary .stage-name::before { content: '▾'; }
.bar { -webkit-appearance: none; appearance: none; display: block; width: 100%; min-width: 0; height: 6px; border: 0; border-radius: 999px; background: var(--line-soft); overflow: hidden; color: var(--accent); }
.bar::-webkit-progress-bar { background: var(--line-soft); border-radius: 999px; }
.bar::-webkit-progress-value { background: var(--accent); border-radius: 999px; }
.bar::-moz-progress-bar { background: var(--accent); border-radius: 999px; }
.stage-n { font-size: 12px; font-weight: 600; color: var(--muted); text-align: right; }
ul.rows { list-style: none; margin: 0 0 0.5rem; padding: 0; }
.row { display: grid; grid-template-columns: 1.4rem minmax(0, 1fr) auto; align-items: center; gap: 0.5rem; padding: 0.3rem 0 0.3rem 1rem; min-height: 40px; }
.row .mark { width: 1.2rem; height: 1.2rem; font-size: 11px; }
.row.done .mark { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.row.skipped .mark { color: var(--muted); }
.row-body { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 0.6rem; min-width: 0; }
.row-label { font-size: 13.5px; font-weight: 500; }
.row.done .row-label, .row.skipped .row-label { color: var(--muted); }
.row-meta { font-size: 12px; color: var(--muted); }
.row.focused { background: #FBEFE6; border-radius: 8px; }
.row-here { font-size: 12px; font-weight: 600; color: var(--action-hover); }
.row-act { font-size: 13px; }
.row-act form { margin: 0; }
.row-act button { min-height: 32px; padding: 0.2rem 0.7rem; font-size: 12.5px; background: transparent; color: var(--accent); }
.row-act button.link { padding: 0.2rem 0.4rem; font-weight: 500; }
.case-side { display: grid; gap: 0.75rem; align-content: start; min-width: 0; }
.panel.compact { padding: 0.8rem 0.9rem; }
.panel.compact h2 { margin-bottom: 0.4rem; }
.side-form { display: grid; gap: 0.25rem; margin: 0; }
.side-form + .side-form { margin-top: 0.6rem; }
.side-form label { font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.inline-field { display: flex; gap: 0.4rem; }
.inline-field select, .inline-field input { flex: 1; min-width: 0; min-height: 34px; font-size: 13px; }
.outcomes { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.tiny { font-size: 12px; margin: 0.4rem 0 0; }
.case-side details > summary { cursor: pointer; min-height: 36px; display: flex; align-items: center; gap: 0.3rem; }
.message-form, .contact-form, .headway { display: grid; gap: 0.5rem; }
.message-form textarea { width: 100%; min-height: 4.5em; font: inherit; font-size: 14px; padding: 0.55rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); resize: vertical; }
.message-form button, .headway button { justify-self: start; }
fieldset.choice { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.2rem 1rem; }
fieldset.choice legend { font-weight: 600; font-size: 13.5px; margin-bottom: 0.15rem; padding: 0; }
fieldset.choice label, .headway label { display: inline-flex; align-items: center; gap: 0.4rem; min-height: 38px; font-size: 14px; }
.headway { grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); column-gap: 1rem; row-gap: 0; }
.headway button, .headway .meta { grid-column: 1 / -1; }

input[type="radio"], input[type="checkbox"] { width: 18px; height: 18px; min-height: 18px; padding: 0; margin: 0; flex: none; accent-color: var(--accent); }
fieldset.choice.stacked { flex-direction: column; gap: 0; }
fieldset.choice.stacked label { display: flex; align-items: center; gap: 0.6rem; min-height: 38px; }
.paperwork-form { display: grid; gap: 0.35rem; }
.paperwork-form .muted { font-size: 13px; }
details.other-form > summary { cursor: pointer; font-size: 13px; color: var(--accent); font-weight: 600; min-height: 32px; display: flex; align-items: center; }
details.other-form select { margin-top: 0.25rem; max-width: 30rem; }
fieldset.choice label, .headway label { flex-direction: row; margin: 0; font-weight: 500; }
.side-form label, .message-form label { margin-bottom: 0; }
