/* The brand look (crivo): Paper ground, Ink text and actions, Moss for secondary text, the lime
   "Current" accent only on Ink (the sidebar, dark mode). Bricolage Grotesque headlines, Instrument Sans
   body, JetBrains Mono labels. */
:root {
  --bg: #f4f5f0;
  --card: #ffffff;
  --line: #daddd4;
  --tag: #eceee8;
  --ink: #0d1b1e;
  --body: #1e2b2e;
  --muted: #4a6158;
  --accent: #0d1b1e;          /* actions: Ink */
  --accent-hover: #24363a;
  --on-accent: #f4f5f0;       /* text on an action */
  --accent-ink: #2f5446;      /* links and small accent text, dark enough on Paper */
  --current: #c8f560;         /* the lime accent, on Ink only */
  --dark: #0d1b1e;
  --dark-panel: #0d1b1e;
  --dark-raised: #1a2e33;
  --dark-line: #2a3d42;
  --mine: #e7f3cf;
  --ok: #2f6b4f;
  --serif: "Bricolage Grotesque", "Instrument Sans", system-ui, sans-serif;   /* headlines */
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --radius: 18px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1b1e; --card: #13262a; --line: #2a3d42; --tag: #1a2e33;
    --ink: #f4f5f0; --body: #d5ddd8; --muted: #9fb3a9; --accent: #c8f560; --accent-hover: #b6e64a;
    --on-accent: #0d1b1e; --accent-ink: #c8f560; --mine: #23361f; --ok: #8fd19e; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1b1e; --card: #13262a; --line: #2a3d42; --tag: #1a2e33;
  --ink: #f4f5f0; --body: #d5ddd8; --muted: #9fb3a9; --accent: #c8f560; --accent-hover: #b6e64a;
  --on-accent: #0d1b1e; --accent-ink: #c8f560; --mine: #23361f; --ok: #8fd19e; color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
  margin: 0; background: var(--bg); color: var(--body);
  font-family: var(--sans); font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-ink); text-underline-offset: 3px; }
h1, h2, h3 { color: var(--ink); font-family: var(--serif); font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; }
h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); margin: .1em 0 .3em; }
h2 { font-size: 1.75rem; margin: 0 0 .4em; }
h3 { font-size: 1.25rem; margin: 0 0 .5em; }

/* ---- app shell: dark side toolbar + one view at a time ---- */
.logo {
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink);
  font-family: var(--serif); font-weight: 700; font-size: 1.55rem; letter-spacing: -0.04em; line-height: 1;
  white-space: nowrap; padding: 4px 8px;
}
.logo .mark { width: 30px; height: 30px; flex: none; }
.side .logo { color: #f4f5f0; }
.shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 6px;
  background: var(--dark-panel); color: #f4f5f0; padding: 16px 12px;
}
.side .logo { align-self: flex-start; margin: 0 4px 14px; }
.side h3 {
  color: #b9c6bf; font-family: var(--mono); font-size: .68rem; font-weight: 400; letter-spacing: .14em;
  text-transform: uppercase; margin: 16px 10px 6px;
}
.side .muted { color: #b9c6bf; }
.side input { background: var(--dark-raised); border-color: var(--dark-line); color: #f4f5f0; }
.side input::placeholder { color: #8d887f; }
.sidenav { display: flex; flex-direction: column; gap: 2px; }
.side-link {
  display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
  background: transparent; color: #f4f5f0; border-radius: 9px; padding: 9px 10px;
  font-weight: 400; font-size: .94rem; text-decoration: none;
}
.side-link:hover { background: var(--dark-raised); }
.side-link.on { background: var(--current); color: var(--dark); font-weight: 600; }
.side-link.on .sub { color: #2a3d42; }
.side-link.on .badge { background: var(--dark); color: var(--current); }
.side-link .label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-link .sub { display: block; font-size: .76rem; color: #b9c6bf; }
.side-link.primary { background: var(--dark-raised); }
.side-link.primary:hover { background: #34312c; }
.ico { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.badge {
  font-family: var(--mono); font-size: .66rem; letter-spacing: .04em; padding: 2px 7px; border-radius: 999px;
  background: #34312c; color: #d9d4ca; flex: none;
}
.badge.hot { background: var(--accent); color: var(--on-accent); }
.client-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.subnav { display: flex; flex-direction: column; gap: 1px; margin: 2px 0 8px 14px; padding-left: 8px; border-left: 1px solid var(--dark-line); }
.subnav .side-link { padding: 7px 10px; font-size: .88rem; }
.side-foot { margin-top: auto; padding: 12px 10px 4px; border-top: 1px solid var(--dark-line); font-size: .84rem; color: #b9c6bf; }
.side-foot .side-link { padding: 8px 0; color: #f4f5f0; }
.view { padding: 40px clamp(16px, 4vw, 56px) 80px; max-width: 1040px; width: 100%; min-width: 0; overflow-x: clip; }
.view-head { margin-bottom: 22px; }
.view-head h1 { font-size: clamp(2.2rem, 4.5vw, 3.4rem); margin: .15em 0 .2em; }
.view-head .lead { max-width: 640px; }
.view-head .actions { margin-top: 14px; }
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side, .sidenav { min-width: 0; }
  .side { position: sticky; top: 0; z-index: 10; height: auto; max-height: none; padding: 10px 12px; gap: 8px; }
  .side .logo { margin: 0; }
  .sidenav { flex-direction: row; overflow-x: auto; scrollbar-width: none; gap: 4px; }
  .sidenav .side-link { width: auto; flex: none; padding: 8px 12px; }
  .side-foot, .side h3.desk { display: none; }
  .view { padding-top: 24px; }
}

/* ---- layout + type helpers ---- */
.kicker {
  font-family: var(--mono); font-size: .74rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent-ink);
}
p.lead { color: var(--body); font-size: 1.15rem; margin-top: 0; }
.muted { color: var(--muted); font-size: .92rem; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; margin: 0 0 18px; box-shadow: 0 1px 2px rgb(25 25 25 / .03);
}
.step-num {
  display: inline-block; font-family: var(--mono); font-size: .72rem; letter-spacing: .14em;
  color: var(--accent-ink); margin-right: .7em; vertical-align: middle;
}
.step-num::before { content: "STEP "; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row > .grow { flex: 1; min-width: 160px; }
.field { margin-bottom: 14px; }

/* ---- forms ---- */
label { display: block; font-size: .88rem; font-weight: 500; color: var(--ink); margin-bottom: 6px; }
input, select, textarea, button { font: inherit; }
input, select, textarea {
  width: 100%; padding: 10px 13px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--ink);
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
button {
  border: 0; border-radius: 9px; padding: 10px 20px; cursor: pointer;
  background: var(--accent); color: var(--on-accent); font-weight: 500;
  transition: background .15s;
}
button:hover { background: var(--accent-hover); }
button.ghost { background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 999px; }
button.ghost:hover { border-color: var(--muted); background: var(--card); }
button.small { padding: 6px 13px; font-size: .86rem; }
button:disabled { opacity: .55; cursor: default; }
.btn-dark { background: var(--dark); color: #f4f5f0; }
.btn-dark:hover { background: #2f2d2a; }

/* ---- tags / chips / pills ---- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chip {
  background: var(--tag); color: var(--body); border: 1px solid transparent; border-radius: 7px;
  padding: 6px 12px; font-size: .9rem; font-weight: 400;
}
.chip:hover { background: var(--tag); border-color: var(--line); }
.chip.on { background: var(--accent); color: var(--on-accent); }
.pill {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px; background: var(--tag); color: var(--body); white-space: nowrap;
}
.pill.in_progress { background: #f6e1d7; color: #8a3f22; }
.pill.delivered { background: #dcebe0; color: #2c5c40; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .pill.in_progress { background: #4a2e22; color: #f2b59c; }
  :root:not([data-theme="light"]) .pill.delivered { background: #23392b; color: #9fd6b2; }
}

/* ---- plan ---- */
.plan-item { border-top: 1px solid var(--line); padding: 14px 0; }
.plan-item:first-of-type { border-top: 0; }
.plan-item .head { display: flex; gap: 10px; align-items: center; }
.plan-item .title { font-weight: 500; color: var(--ink); flex: 1; }
.star { background: none; border: 0; font-size: 1.3rem; padding: 0 4px; color: var(--muted); line-height: 1; }
.star:hover { background: none; color: var(--accent); }
.star.on { color: var(--accent); }
.comments { margin: 8px 0 0 32px; }
.comment { font-size: .93rem; margin: 4px 0; }
.comment b { font-weight: 600; color: var(--ink); }

/* ---- messages ---- */
.timeline { display: flex; flex-direction: column; gap: 10px; max-height: 540px; overflow-y: auto; padding: 2px; }
.msg {
  border: 1px solid var(--line); border-radius: 14px; padding: 11px 14px; background: var(--card);
  max-width: 88%;
}
.msg.mine { align-self: flex-end; background: var(--mine); border-color: transparent; }
.msg .meta { font-family: var(--mono); font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.msg .subject { font-weight: 600; color: var(--ink); }
.msg .body { white-space: pre-wrap; overflow-wrap: anywhere; }

.banner {
  background: var(--dark-panel); color: #f4f5f0; border-radius: var(--radius); padding: 18px 22px; margin-bottom: 18px;
}
.banner strong { font-family: var(--serif); font-weight: 400; font-size: 1.35rem; color: #f4f5f0; }
.banner .muted { color: #b3b1ab; }
.scale { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.scale button { min-width: 46px; background: var(--dark-raised); color: #f4f5f0; border: 1px solid var(--dark-line); }
.scale button:hover { background: var(--accent); color: var(--on-accent); }
.error { color: #b42318; font-size: .9rem; margin-top: 6px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .error { color: #ff9b8f; } }
.hidden { display: none !important; }

/* ---- consultant extras ---- */
.client-picker .side-link { align-items: flex-start; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-left: 7px; vertical-align: middle; }
.link-box { word-break: break-all; font-family: var(--mono); font-size: .82rem; background: var(--tag); padding: 9px 12px; border-radius: 9px; }
dl.answers { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
dl.answers dt { font-family: var(--mono); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding-top: 3px; }
dl.answers dd { margin: 0; overflow-wrap: anywhere; color: var(--ink); }
.login-wrap { max-width: 400px; margin: 10vh auto; padding: 0 16px; text-align: center; }
.login-wrap .logo { margin-bottom: 24px; }
.login-wrap .card { text-align: left; }

/* ---- overview tiles, lists, stepper, toast ---- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.stat .num { font-family: var(--serif); font-size: 2.4rem; line-height: 1; color: var(--ink); }
.stat .lbl { font-family: var(--mono); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-top: 8px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 760px) { .cols { grid-template-columns: 1fr; } }
.cols > .card { margin: 0; }
.list-row {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 11px 0;
  border: 0; border-top: 1px solid var(--line); border-radius: 0; background: none; color: var(--ink); font-weight: 400;
}
.list-row:first-of-type { border-top: 0; }
.list-row:hover { background: none; color: var(--accent-ink); }
.list-row .grow { flex: 1; min-width: 0; }
.link-btn { background: none; color: var(--accent-ink); padding: 0; font-weight: 500; font-family: var(--mono); font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; }
.link-btn:hover { background: none; text-decoration: underline; }
.callout { border-color: #b9dd5c; background: #f1f8de; }      /* a light wash of the lime accent */
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.filters button { background: var(--card); color: var(--body); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-size: .88rem; }
.filters button.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.steps { display: flex; gap: 8px; list-style: none; padding: 0; margin: 0 0 16px; flex-wrap: wrap; }
.steps button {
  display: flex; align-items: center; gap: 8px; background: var(--card); color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px 6px 6px; font-size: .88rem; font-weight: 500;
}
.steps button .n { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--tag); font-family: var(--mono); font-size: .74rem; }
.steps button.on { color: var(--ink); border-color: var(--ink); }
.steps button.on .n { background: var(--accent); color: var(--on-accent); }
.steps button.done .n { background: var(--ink); color: var(--bg); }
.step-nav { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.step-nav .spacer { flex: 1; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50;
  background: var(--dark); color: #f4f5f0; padding: 11px 18px; border-radius: 999px; font-size: .92rem;
  box-shadow: 0 6px 24px rgb(0 0 0 / .18);
}
.empty { text-align: center; padding: 26px 10px; color: var(--muted); }

/* ---- health score + KPIs ---- */
.health { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.health::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.health.healthy { background: #dcebe0; color: #2c5c40; }
.health.watch { background: #f6ead0; color: #7a5410; }
.health.at_risk { background: #f6dcd5; color: #9a3412; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .health.healthy { background: #23392b; color: #9fd6b2; }
  :root:not([data-theme="light"]) .health.watch { background: #3d3119; color: #f0cd85; }
  :root:not([data-theme="light"]) .health.at_risk { background: #44251d; color: #f2a58f; }
}
.bar { height: 8px; background: var(--tag); border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.bar.healthy > span { background: #3d7a57; }
.bar.watch > span { background: #c48a1d; }
.bar.at_risk > span { background: #c2410c; }
.kpi-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.kpi-table th { text-align: left; font-family: var(--mono); font-weight: 400; font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 0 10px 10px; white-space: nowrap; }
.kpi-table td { padding: 12px 10px; border-top: 1px solid var(--line); vertical-align: middle; }
.kpi-table tbody tr { cursor: pointer; }
.kpi-table tbody tr:hover td { background: var(--tag); }
.kpi-table .name strong { color: var(--ink); font-weight: 500; display: block; }
.kpi-table .mini { width: 90px; }
.table-wrap { overflow-x: auto; }
.bands { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.health.new { background: var(--tag); color: var(--muted); }
/* status colours as tokens, so the lights, the status bar and the "Needs you" dots agree */
:root { --st-good: #3d7a57; --st-watch: #c48a1d; --st-risk: #c2410c; --st-none: #b9b3a8; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --st-good: #6fbf8f; --st-watch: #e0b25a; --st-risk: #ec8a6c; --st-none: #6b665e; } }
:root[data-theme="dark"] { --st-good: #6fbf8f; --st-watch: #e0b25a; --st-risk: #ec8a6c; --st-none: #6b665e; }
.light { display: flex; gap: 7px; align-items: baseline; font-size: .88rem; color: var(--ink); }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--st-none); position: relative; top: 1px; }
.healthy > .dot, .light.healthy .dot { background: var(--st-good); }
.watch > .dot, .light.watch .dot { background: var(--st-watch); }
.at_risk > .dot, .light.at_risk .dot { background: var(--st-risk); }
.small { font-size: .8rem; }
.mini-row { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.mini-row > .small { white-space: nowrap; }
.health-table .bar.mini { width: 70px; flex: none; }
.bar.value > span { background: var(--accent); }
.spark { width: 96px; height: 28px; overflow: visible; flex: none; }
.spark polyline { fill: none; stroke: var(--muted); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.spark circle { fill: var(--accent); stroke: var(--card); stroke-width: 2; }
.spark circle:hover { r: 5; }
.spark .mid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 3; }
.status-bar { display: flex; gap: 2px; height: 14px; border-radius: 999px; overflow: hidden; margin: 6px 0 12px; background: var(--tag); }
.status-bar > span { min-width: 6px; }
.status-bar .healthy { background: var(--st-good); }
.status-bar .watch { background: var(--st-watch); }
.status-bar .at_risk { background: var(--st-risk); }
.status-bar .new { background: var(--st-none); }
.need { display: flex; gap: 10px; align-items: baseline; width: 100%; text-align: left; }
.health-table .name .health { margin: 4px 0; }
.health-table .name .muted { display: block; font-size: .8rem; }
.health-table td { min-width: 150px; }
.health-table td.name { min-width: 170px; }
.signals { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 12px; }
@media (max-width: 1100px) { .signals { grid-template-columns: repeat(2, 1fr); } }
.link-signal { background: none; border: 0; padding: 0; text-align: left; color: inherit; font-weight: inherit; cursor: pointer; }
.link-signal:hover { background: none; }
.link-signal:hover .kicker { text-decoration: underline; }
.signal .kicker { margin-bottom: 6px; }
.signal .spark { margin-top: 6px; }
@media (max-width: 760px) {
  .signals { grid-template-columns: 1fr; gap: 12px; }
  .health-table thead { display: none; }
  .health-table, .health-table tbody, .health-table tr, .health-table td { display: block; width: 100%; }
  .health-table tr { padding: 14px 0; border-top: 1px solid var(--line); }
  .health-table tbody tr:first-child { border-top: 0; padding-top: 0; }
  .health-table td { border: 0; padding: 6px 0; min-width: 0; }
  .health-table td[data-label]::before { content: attr(data-label); display: block; font-family: var(--mono); font-size: .62rem;
    letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
}
.side .badge.healthy { background: #23392b; color: #9fd6b2; }
.side .badge.watch { background: #3d3119; color: #f0cd85; }
.side .badge.at_risk { background: #44251d; color: #f2a58f; }
@media (max-width: 860px) {
  .sidenav .client-list, .sidenav .subnav { flex-direction: row; }
  .sidenav .subnav { border-left: 0; margin: 0; padding: 0; }
  .sidenav .client-list li { display: flex; gap: 4px; }
}

/* ---- richer plan: phases, checklists, tags, links, wins ---- */
.group-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.group-head h3 { margin: 0; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 0 32px; }
.tag { font-size: .78rem; padding: 2px 9px; border-radius: 7px; background: var(--tag); color: var(--body); }
.tag.overdue { background: #f6dcd5; color: #9a3412; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tag.overdue { background: #44251d; color: #f2a58f; } }
.steps-list { list-style: none; padding: 0; margin: 10px 0 0 32px; display: flex; flex-direction: column; gap: 4px; }
.step { display: flex; align-items: center; gap: 6px; }
.step label { display: flex; gap: 9px; align-items: center; font-weight: 400; font-size: .94rem; margin: 0; color: var(--body); cursor: pointer; }
.step.done span { text-decoration: line-through; color: var(--muted); }
input[type="checkbox"] { width: 17px; height: 17px; padding: 0; accent-color: var(--accent); flex: none; cursor: pointer; }
input[type="checkbox"]:disabled { cursor: default; }
.links-list { margin: 8px 0 0 32px; display: flex; flex-direction: column; gap: 2px; }
a.res { font-size: .92rem; text-decoration: none; }
a.res:hover { text-decoration: underline; }
button.x { background: none; color: var(--muted); padding: 0 6px; font-size: 1.1rem; line-height: 1; }
button.x:hover { background: none; color: var(--accent-ink); }
.item-notes { margin: 6px 0 0 32px; white-space: pre-wrap; color: var(--body); font-size: .94rem; }
details.edit { margin: 10px 0 0 32px; }
details.edit > summary { cursor: pointer; color: var(--accent-ink); font-family: var(--mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; list-style: none; }
details.edit > summary::-webkit-details-marker { display: none; }
details.edit[open] > summary { margin-bottom: 10px; }
.mini-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; align-items: end; margin-top: 8px; }
.mini-form .wide { grid-column: 1 / -1; }
.win { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); }
.win:first-of-type { border-top: 0; }
.win .ico { color: var(--accent); margin-top: 2px; }
.win .grow { flex: 1; min-width: 0; }

/* honeypot: off-screen for people, still filled in by naive bots */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---- guides ---- */
.guide-link { display: inline-flex; align-items: center; gap: 7px; margin: 8px 0 0 32px; background: none; color: var(--accent-ink); padding: 0; font-weight: 500; font-size: .92rem; }
.guide-link:hover { background: none; text-decoration: underline; }
.guide-link .ico { width: 16px; height: 16px; }
.guide { max-width: 720px; }
.guide h3 { font-size: 1.3rem; margin: 1.3em 0 .4em; }
.guide p { margin: .5em 0; }
.guide-list { margin: .4em 0; padding-left: 1.2em; }
.guide-list li { margin: .25em 0; }
.prompt { display: flex; gap: 12px; align-items: flex-start; background: var(--tag); border-left: 3px solid var(--accent); border-radius: 10px; padding: 12px 14px; margin: .8em 0; }
.prompt-text { flex: 1; font-size: .95rem; color: var(--ink); }
.guide-card { display: flex; gap: 12px; align-items: flex-start; width: 100%; text-align: left; background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; font-weight: 400; }
.guide-card:hover { background: var(--card); border-color: var(--accent); }
.guide-card .ico { color: var(--accent); margin-top: 2px; }
.guide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }

/* links styled as buttons (downloads) */
a.btn-link { display: inline-block; text-decoration: none; border-radius: 9px; padding: 10px 20px; font-weight: 500;
  background: var(--accent); color: var(--on-accent); }
a.btn-link:hover { background: var(--accent-hover); }
a.btn-link.ghost { background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 999px; }
a.btn-link.ghost:hover { border-color: var(--muted); }

.tag.feature { background: color-mix(in srgb, var(--accent) 16%, var(--card)); color: var(--ink); }
.tag.link { border: 0; cursor: pointer; font-weight: 400; }
.tag.link:hover { background: var(--line); }
.pill.overdue { background: #f6dcd5; color: #9a3412; }
.small { font-size: .82rem; }
.internal-note { margin: 8px 0; padding: 8px 12px; border-left: 3px solid #c48a1d; background: #f8f0dc; border-radius: 8px; font-size: .9rem; white-space: pre-wrap; color: #5c4210; }
textarea.internal { background: #fbf6ea; }
.check { font-weight: 400; gap: 8px; }
.check input { width: auto; }
.picker fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin: 0 0 8px; min-width: 0; }
.picker legend { font-size: .82rem; color: var(--muted); padding: 0 4px; }
.chips-check { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.board-col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.board-card { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left; background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; font-weight: 400; min-width: 0; overflow-wrap: anywhere; }
.board-card:hover { background: var(--card); border-color: var(--accent); }
.board-card strong { font-weight: 500; }
@media (max-width: 860px) { .board { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
@media (max-width: 520px) { .board { grid-template-columns: minmax(0, 1fr); } }
.matrix td.hit { font-weight: 600; color: var(--accent-ink); }
.history { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; font-size: .88rem; }
.history-row { overflow-wrap: anywhere; }
.feature-list { display: grid; gap: 8px; margin-top: 8px; }

/* ---- transcripts ---- */
.tx-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 16px; align-items: start; }
.tx-left { position: sticky; top: 12px; margin: 0; }
.tx-text { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 72vh; overflow-y: auto; font-size: .92rem; line-height: 1.6; }
.tx-right > .card { margin-top: 0; }
.tx-group summary { cursor: pointer; list-style: none; }
.tx-q { border-top: 1px solid var(--line); padding: 12px 0; }
.tx-q .head { display: flex; gap: 8px; align-items: center; }
.tx-q .title { flex: 1; font-weight: 500; color: var(--ink); }
.tx-q textarea.quote, .quote-shown { margin-top: 6px; font-size: .88rem; background: var(--tag); border-left: 3px solid var(--accent); }
.quote-shown { margin: 6px 0 0; padding: 6px 10px; border-radius: 6px; font-style: italic; }
.tx-bar { position: sticky; top: 0; z-index: 2; }
.from-call { font-size: .82rem; color: var(--muted); }
@media (max-width: 900px) { .tx-grid { grid-template-columns: minmax(0, 1fr); } .tx-left { position: static; } .tx-text { max-height: 40vh; } }
.tx-settings select { width: auto; max-width: 100%; }
.draft { border-left: 3px solid #c48a1d; }
.draft-facts { margin: 10px 0 0; }
.pinned summary { cursor: pointer; list-style: none; }
.composer-bar { position: sticky; top: 0; z-index: 2; }
.field-error { color: #b42318; font-size: .86rem; min-height: 0; margin-top: 4px; }
.has-error input, .has-error select, .has-error textarea { border-color: #b42318; outline: 1px solid #b42318; }
.task-editor { margin: 6px 0 12px; padding-left: 1.4em; display: flex; flex-direction: column; gap: 6px; }
.task-editor li { display: flex; gap: 6px; align-items: center; }
.task-editor li input { flex: 1; min-width: 0; }
.inline-title { flex: 1; min-width: 0; font-weight: 500; background: transparent; border-color: transparent; }
.inline-title:hover { border-color: var(--line); }

/* A dialog over the page, e.g. an email for the consultant to send by hand. */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(25, 25, 25, .45); display: flex;
  align-items: center; justify-content: center; padding: 16px; overflow-y: auto; }
.overlay .card { margin: 0; max-height: calc(100vh - 32px); overflow-y: auto; }

/* "View as client": the client portal, read-only, for a consultant to show on a call. */
.preview-banner { position: sticky; top: 0; z-index: 40; background: var(--accent); color: var(--on-accent); padding: 10px 16px;
  font-size: .92rem; text-align: center; }
.preview-banner a { color: #fff; text-decoration: underline; margin-left: 6px; }
body.preview #view :is(input, textarea, select) { pointer-events: none; opacity: .65; }

/* The test copy of the site (SITE_ENV=staging): impossible to mistake for the live one. */
.staging-banner { position: sticky; top: 0; z-index: 60; background: repeating-linear-gradient(45deg, #ffd84d, #ffd84d 12px, #f5c400 12px, #f5c400 24px);
  color: #0d1b1e; font-weight: 600; text-align: center; padding: 8px 16px; font-size: .9rem; }

/* --- client sessions: one card a session, readable in ten seconds, made for phones --- */
.session .session-title { font-family: var(--serif); font-weight: 500; font-size: 1.7rem; line-height: 1.2; margin: 2px 0 14px; }
.session .kicker, .past-body .kicker { margin-top: 16px; }
ul.did { margin: 6px 0 0; padding-left: 20px; }
ul.did li { margin: 3px 0; }
.savings { margin-top: 6px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.saving { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; padding: 9px 12px; }
.saving + .saving { border-top: 1px solid var(--line); }
.saving.total { background: var(--tag); }
.step-tick { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; font-size: 1rem; cursor: pointer; }
.step-tick + .step-tick { border-top: 1px solid var(--line); }
.step-tick input { width: 22px; height: 22px; margin: 1px 0 0; flex: none; accent-color: var(--accent); }
.step-tick.done span { text-decoration: line-through; color: var(--muted); }
.session .scale button, .past-body .scale button, .home-confidence .scale button { min-width: 48px; min-height: 44px; background: var(--card); color: var(--ink);
  border: 1px solid var(--line); border-radius: 12px; font-size: 1.05rem; }
.session .scale button.on, .past-body .scale button.on, .home-confidence .scale button.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
details.stuck { margin-top: 16px; }
details.stuck > summary { cursor: pointer; color: var(--accent-ink); font-weight: 500; list-style: none; padding: 6px 0; }
details.stuck > summary::-webkit-details-marker { display: none; }
details.stuck .comment { margin: 6px 0; }
details.stuck form { margin-top: 8px; }
.coming-up h3 { margin: 4px 0 0; }
details.past { border-top: 1px solid var(--line); }
details.past:first-of-type { border-top: 0; }
details.past > summary { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; padding: 12px 0; cursor: pointer; list-style: none; }
details.past > summary::-webkit-details-marker { display: none; }
details.past > summary .muted { min-width: 92px; }
.past-body { padding: 0 0 14px; }
.check-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 10px 0 0 32px; }
.check-row details.edit { margin: 0; flex-basis: 100%; }
.check-row details.edit:not([open]) { flex-basis: auto; }
details.edit > summary.btn-like, summary.btn-like { display: inline-block; text-transform: none; letter-spacing: 0; font-family: var(--sans); font-size: .86rem;
  color: var(--ink); border: 1px solid var(--line); border-radius: 999px; padding: 6px 13px; background: var(--card); }
@media (max-width: 640px) {
  .session .session-title { font-size: 1.45rem; }
  .check-row { margin-left: 0; }
  .saving b { flex-basis: 100%; }
}

/* Engagement settings, folded at the bottom of a client's Overview */
details.settings-fold { margin-top: 18px; }
details.settings-fold > summary { cursor: pointer; list-style: none; display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; }
details.settings-fold > summary::-webkit-details-marker { display: none; }
details.settings-fold[open] > summary { margin-bottom: 12px; }
.settings-part { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }

/* ---- Safe Start ---- */
.safe-hero { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.safe-hero h3 { margin: 2px 0 4px; font-size: 1.5rem; }
.safe-hero p { margin: 0; }
.ring { --pct: 0; width: 96px; height: 96px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: conic-gradient(var(--st-good) calc(var(--pct) * 1%), var(--tag) 0); }
.ring > span { width: 74px; height: 74px; border-radius: 50%; background: var(--card); display: grid; place-items: center;
  align-content: center; line-height: 1; }
.ring strong { font-family: var(--serif); font-size: 1.9rem; font-weight: 400; color: var(--ink); }
.ring small { color: var(--muted); font-size: .72rem; margin-top: 2px; }
.notice { background: #f6ead0; color: #5c3f0a; border-radius: var(--radius); padding: 10px 14px; margin-bottom: 14px; font-size: .92rem; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .notice { background: #3d3119; color: #f0cd85; } }

/* The traffic lights: bold, the first thing you read. */
.lights { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 10px; }
@media (max-width: 760px) { .lights { grid-template-columns: 1fr; } }
.light-panel { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--card); }
.light-band { padding: 12px 16px; display: flex; flex-direction: column; gap: 2px; }
.light-name { font-family: var(--serif); font-size: 1.45rem; line-height: 1.1; }
.light-sub { font-size: .85rem; opacity: .9; }
.light-panel.green .light-band { background: #2f6b4a; color: #fff; }
.light-panel.amber .light-band { background: #e3a92e; color: #2b1d02; }
.light-panel.red .light-band { background: #b23a1a; color: #fff; }
.light-panel ul { margin: 0; padding: 12px 16px 14px 34px; }
.light-panel li { margin: 6px 0; line-height: 1.4; }
.light-panel li .x { margin-left: 6px; }

/* Seven tiles, one per part. */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin-bottom: 14px; }
.tile { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; padding: 14px;
  background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); font-weight: 400;
  border-left: 5px solid var(--st-none); min-width: 0; }
.tile:hover { background: var(--card); border-color: var(--accent); }
.tile.on { box-shadow: 0 0 0 2px var(--accent); }
.tile.done { border-left-color: var(--st-good); }
.tile.going { border-left-color: var(--st-watch); }
.tile strong { font-weight: 500; }
.tile-mark { font-size: 1.1rem; line-height: 1; color: var(--muted); }
.tile.done .tile-mark { color: var(--st-good); }
.tile.going .tile-mark { color: var(--st-watch); }
.tile-count { font-family: var(--serif); font-size: 1.5rem; color: var(--ink); }
.tile .bar.mini { width: 100%; }
.tile.done .bar > span { background: var(--st-good); }
.tile.going .bar > span { background: var(--st-watch); }

/* A part's checks: short rows; details open on demand. */
.safe-panel .part-fields { margin: 4px 0 12px; gap: 10px; flex-wrap: wrap; align-items: center; }
.safe-panel .part-fields input { margin-left: 6px; }
.safe-row { border-top: 1px solid var(--line); padding: 10px 0; }
.safe-row-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.safe-row-head .title { color: var(--ink); }
.safe-row.done .title { color: var(--muted); }
.tick { width: 28px; height: 28px; flex: none; border-radius: 50%; padding: 0; display: grid; place-items: center;
  background: var(--card); color: #fff; border: 2px solid var(--line); font-size: .9rem; font-weight: 700; }
.tick:hover:not(:disabled) { border-color: var(--st-good); background: var(--card); }
.tick.on { background: var(--st-good); border-color: var(--st-good); }
.tick.na { background: var(--st-none); border-color: var(--st-none); }
.tick:disabled { cursor: default; opacity: .8; }
.safe-details { margin: 6px 0 0 38px; }
.safe-details > summary { cursor: pointer; color: var(--accent-ink); font-family: var(--mono); font-size: .66rem;
  letter-spacing: .1em; text-transform: uppercase; }
.safe-details[open] { padding-bottom: 6px; }
.safe-details textarea { flex: 1 1 260px; min-height: 44px; }
.safe-details .files { margin-top: 8px; }
.upload { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.safe-template-row { padding: 10px 0; border-top: 1px solid var(--line); }
.report h1 { margin: 4px 0; }
.report-facts { border-collapse: collapse; margin: 12px 0 18px; }
.report-facts th { text-align: left; font-weight: 500; padding: 4px 18px 4px 0; color: var(--ink); vertical-align: top; }
.report-facts td { padding: 4px 0; }
.report-part { margin-top: 18px; }
.report-item { padding: 8px 0; border-top: 1px solid var(--line); }
.report-item p { margin: 4px 0; }
.report-note { margin-top: 22px; }
.safe-doc .doc-body { white-space: pre-wrap; line-height: 1.6; margin-top: 12px; }
@media print {
  .side, .no-print, .toast, .sidenav, .side-foot { display: none !important; }
  .light-band, .ring, .tick, .tile { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .shell { display: block; }
  .view { padding: 0; max-width: none; }
  body { background: #fff; }
  .card { border: 0; box-shadow: none; }
}
/* Coaching and retention: sessions logged under the plan */
h2.plan-sessions { margin-top: 28px; }
details.log-session > summary { cursor: pointer; list-style: none; margin-bottom: 12px; }
details.log-session > summary::-webkit-details-marker { display: none; }
/* A guide read inside a session card */
.guide-inline { margin: 10px 0 0; }
.guide-inline > summary.guide-link { margin: 0; cursor: pointer; list-style: none; }
.guide-inline > summary.guide-link::-webkit-details-marker { display: none; }
.guide-inline > summary.guide-link .muted { white-space: nowrap; }
/* Client plan: each item opens to its sessions */
details.plan-card > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; }
details.plan-card > summary::-webkit-details-marker { display: none; }
details.plan-card[open] > summary { margin-bottom: 10px; }
details.plan-session { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; }
details.plan-session > summary { list-style: none; cursor: pointer; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
details.plan-session > summary::-webkit-details-marker { display: none; }
.session-thread { margin: 12px 0 4px; }
.session-thread .comment { margin: 6px 0; }
/* The client menu's "More" fold */
.side-more { background: none; border: 0; color: #b9c6bf; font-family: var(--mono); font-size: .72rem; letter-spacing: .12em;
  text-transform: uppercase; padding: 10px 10px 4px; cursor: pointer; text-align: left; }
.side-more:hover { color: #f4f5f0; background: none; }

@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .callout { border-color: #4f6b2a; background: #1d2f22; } }
:root[data-theme="dark"] .callout { border-color: #4f6b2a; background: #1d2f22; }
/* My tools: a tile per tool */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.tool { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 6px; min-height: 160px; }
.tool.new { border: 1.5px dashed #9aa79f; background: transparent; }
.tool-status { font-size: .84rem; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.tool-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #9aa79f; flex: none; }
.tool-status.working::before { background: #3d8a5f; }
.tool-status.paused::before { background: #c9902a; }
a.btn-link.small { padding: 6px 13px; font-size: .86rem; }
/* The one figure that matters most, on Ink with the lime accent */
.stat.hero { background: var(--dark); border-color: var(--dark); }
.stat.hero .lbl { color: #b9c6bf; }
.stat.hero .num { color: var(--current); }

/* A tool's runs (consultant Activity, client Recent activity) */
details.run > summary { cursor: pointer; list-style: none; }
details.run > summary::-webkit-details-marker { display: none; }
details.run[open] > summary { border-bottom-color: transparent; }
details.run > div { padding: 0 0 12px; }
.run-report { white-space: pre-wrap; background: var(--tag); padding: 12px 14px; border-radius: 9px; max-height: 360px; overflow: auto; }
.run-detail { white-space: pre-wrap; word-break: break-word; font-family: var(--mono); font-size: .74rem; background: var(--tag);
  padding: 10px 12px; border-radius: 9px; max-height: 220px; overflow: auto; margin: 6px 0; }
