/*
 * Ask Biggie design system.
 * Calm and precise (clarity, deference, depth), built to work hard: high contrast, big targets, no fuss.
 * Structure comes from space and type, not boxes. Orange is for the one thing to do next.
 */

/* ---------- tokens ---------- */
:root {
  --paper: #F7F6F3;
  --surface: #FFFFFF;
  --surface-2: #F1EFEB;
  --surface-3: #E9E6E0;
  --ink: #15130F;
  --ink-2: #4A453D;
  --muted: #827B71;
  --line: rgba(21, 19, 15, 0.08);
  --line-strong: rgba(21, 19, 15, 0.16);
  --accent: #F26A1B;
  --accent-hover: #DE5A0D;
  --accent-ink: #FFFFFF;
  --accent-soft: #FFF0E5;
  --accent-text: #C2510F;
  --good: #1E7F46;
  --good-soft: #E3F4E9;
  --warn: #9A6A00;
  --warn-soft: #FBF1D6;
  --crit: #B83A2A;
  --crit-soft: #FBE5E1;
  --info: #2F5D8A;
  --info-soft: #E3EDF7;
  --glass: rgba(247, 246, 243, 0.78);

  --shadow-1: 0 1px 2px rgba(21, 19, 15, 0.05), 0 1px 1px rgba(21, 19, 15, 0.03);
  --shadow-2: 0 1px 2px rgba(21, 19, 15, 0.04), 0 6px 20px rgba(21, 19, 15, 0.06);
  --shadow-3: 0 2px 6px rgba(21, 19, 15, 0.06), 0 18px 48px rgba(21, 19, 15, 0.14);
  --focus: 0 0 0 3px var(--paper), 0 0 0 5px var(--accent);

  --font-display: 'Poppins', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'IBM Plex Sans', 'Segoe UI', system-ui, sans-serif;

  /* type scale */
  --t-xs: 12px; --t-sm: 13.5px; --t-base: 15px; --t-md: 17px; --t-lg: 21px; --t-xl: 28px; --t-2xl: 34px;
  /* spacing: 4px rhythm */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px; --s-12: 48px;
  /* radii */
  --r-sm: 8px; --r-md: 12px; --r-lg: 18px; --r-xl: 24px; --r-full: 999px;

  --tab-h: 64px;
  --control-h: 40px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0D0C0B;
    --surface: #171512;
    --surface-2: #1F1C18;
    --surface-3: #2A2621;
    --ink: #F4F1EB;
    --ink-2: #CEC6BA;
    --muted: #958C80;
    --line: rgba(244, 241, 235, 0.08);
    --line-strong: rgba(244, 241, 235, 0.16);
    --accent: #FF7A2B;
    --accent-hover: #FF8C47;
    --accent-ink: #1A110A;
    --accent-soft: #34200F;
    --accent-text: #FF9A5C;
    --good: #5FCC8E; --good-soft: #15291D;
    --warn: #E8B54A; --warn-soft: #2E2510;
    --crit: #F2826F; --crit-soft: #351A15;
    --info: #8FB9E4; --info-soft: #172433;
    --glass: rgba(13, 12, 11, 0.72);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-2: 0 1px 2px rgba(0, 0, 0, 0.35), 0 8px 24px rgba(0, 0, 0, 0.35);
    --shadow-3: 0 2px 8px rgba(0, 0, 0, 0.4), 0 20px 56px rgba(0, 0, 0, 0.55);
    color-scheme: dark;
  }
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--t-base);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; margin: 0; color: var(--ink); text-wrap: balance; }
h1 { font-size: var(--t-xl); line-height: 1.15; letter-spacing: -0.025em; }
h2 { font-size: var(--t-md); line-height: 1.3; letter-spacing: -0.012em; margin-bottom: var(--s-3); }
h3 { font-size: var(--t-base); line-height: 1.35; letter-spacing: -0.008em; }
p { margin: 0; text-wrap: pretty; }
a { color: var(--accent-text); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
svg { width: 20px; height: 20px; flex: none; }
.muted { color: var(--muted); }
.small, .note { font-size: var(--t-sm); }
.note { color: var(--muted); margin-top: var(--s-2); }
.warn { color: var(--warn); }
.error { color: var(--crit); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: var(--s-2); z-index: 50; background: var(--ink); color: var(--paper); padding: var(--s-2) var(--s-3); border-radius: var(--r-sm); }
.skip:focus { left: var(--s-2); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-sm); }
::selection { background: var(--accent-soft); color: var(--ink); }

/* ---------- controls ---------- */
button, a.button {
  font: inherit; font-size: var(--t-sm); font-weight: 500;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: var(--control-h); padding: 0 var(--s-4);
  border-radius: var(--r-full); border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink);
  cursor: pointer; text-decoration: none; line-height: 1.2; text-align: center;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .1s ease, box-shadow .15s ease;
}
button:hover, a.button:hover { border-color: var(--ink-2); color: var(--ink); }
button:active, a.button:active { transform: scale(0.98); }
button:disabled { opacity: .45; cursor: progress; transform: none; }
button.primary, a.button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; box-shadow: 0 1px 0 rgba(255,255,255,.15) inset, 0 1px 2px rgba(194, 81, 15, .25); }
button.primary:hover, a.button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-ink); }
button.quiet { background: transparent; border-color: transparent; color: var(--ink-2); padding: 0 var(--s-3); }
button.quiet:hover { background: var(--surface-2); border-color: transparent; }
button.danger { color: var(--crit); }
.icon-button { width: var(--control-h); padding: 0; background: transparent; border-color: transparent; color: var(--ink-2); }
.icon-button:hover { background: var(--surface-2); border-color: transparent; }
textarea, select, input {
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--r-md);
  transition: border-color .15s ease, box-shadow .15s ease;
}
textarea:focus, select:focus, input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
select { min-height: 36px; padding: 0 32px 0 var(--s-3); appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='%23827B71' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; font-size: var(--t-sm); }

/* ---------- header (glass) and navigation ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: var(--s-4);
  height: 64px; padding: 0 var(--s-6);
  background: var(--glass); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: var(--s-2); font-family: var(--font-display); font-weight: 700; font-size: var(--t-md); letter-spacing: -0.02em; color: var(--ink); text-decoration: none; justify-self: start; }
.brand img { width: 34px; height: 34px; border-radius: 50%; background: var(--surface-2); object-fit: cover; box-shadow: var(--shadow-1); }
.nav { justify-self: center; display: flex; gap: 2px; padding: 4px; background: var(--surface-2); border-radius: var(--r-full); }
.nav a { position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: var(--r-full); color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: var(--t-sm); white-space: nowrap; transition: background-color .15s ease, color .15s ease; }
.nav a svg { width: 18px; height: 18px; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-full); background: var(--accent); color: var(--accent-ink); font: 600 11.5px/1 var(--font-body); }
.count.quiet { background: var(--surface-3); color: var(--ink-2); }
.count[hidden] { display: none; }
.who { justify-self: end; display: flex; align-items: center; gap: var(--s-2); min-width: 0; }
.portal { font-size: var(--t-xs); padding: 4px 10px; border-radius: var(--r-full); background: var(--surface-2); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
#client-switch { max-width: 190px; }
.me { display: inline-flex; align-items: center; gap: var(--s-2); min-width: 0; }
.avatar-me { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--paper); font: 600 13px/1 var(--font-display); flex: none; }
.me-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.me-text #me-name { font-size: var(--t-sm); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.me-text #me-role { font-size: var(--t-xs); }

@media (max-width: 1280px) {
  .portal { display: none; }
}
@media (max-width: 1180px) {
  .me-text { display: none; }
  #client-switch { max-width: 150px; }
}
@media (max-width: 960px) and (min-width: 761px) {
  .brand span { display: none; }
  .nav a { padding: 7px 10px; }
}
/* Phones and small tablets: a tab bar at the bottom, like an iPhone app. */
@media (max-width: 760px) {
  /* No blur on the header here: a blurred parent traps the fixed tab bar inside it. */
  .top { grid-template-columns: auto 1fr; height: 56px; padding: 0 var(--s-4); padding-top: env(safe-area-inset-top); -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--paper); }
  .brand span { display: none; }
  .me-text { display: none; }
  .nav {
    position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; justify-self: stretch;
    height: calc(var(--tab-h) + env(safe-area-inset-bottom)); padding: 6px var(--s-2) env(safe-area-inset-bottom);
    border-radius: 0; gap: 0; justify-content: space-around;
    background: var(--glass); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
    border-top: 1px solid var(--line);
  }
  .nav a { flex: 1; flex-direction: column; gap: 2px; padding: 6px 0; font-size: 11px; border-radius: var(--r-md); min-width: 0; }
  .nav a svg { width: 24px; height: 24px; }
  .nav a[aria-current="page"] { background: transparent; box-shadow: none; color: var(--accent-text); }
  .nav .count { position: absolute; top: 2px; left: calc(50% + 6px); }
  #client-switch { max-width: 150px; }
}

/* ---------- page frame ---------- */
main { max-width: 1120px; margin: 0 auto; padding: var(--s-8) var(--s-6) 120px; animation: enter .28s ease both; }
main:focus { outline: none; }
@media (max-width: 760px) { main { padding: var(--s-5) var(--s-4) calc(var(--tab-h) + 96px); } h1 { font-size: 24px; } }
@keyframes enter { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Surfaces float on soft shadow, not borders. */
.panel { background: var(--surface); border-radius: var(--r-lg); padding: var(--s-6); box-shadow: var(--shadow-2); }
@media (max-width: 760px) { .panel { padding: var(--s-5); border-radius: var(--r-lg); } }
.page { display: flex; flex-direction: column; gap: var(--s-5); }
.page > h1, .page-head h1 { font-size: var(--t-2xl); }
@media (max-width: 760px) { .page > h1, .page-head h1 { font-size: 26px; } }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.back { color: var(--muted); text-decoration: none; font-size: var(--t-sm); font-weight: 500; display: inline-flex; align-items: center; gap: 4px; }
.back:hover { color: var(--ink); }
.more { display: inline-flex; margin-top: var(--s-3); font-size: var(--t-sm); font-weight: 500; text-decoration: none; }
.empty { padding: var(--s-10) 0; text-align: center; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-4); align-items: center; }

/* Status: a coloured dot and quiet words. Only "act" is loud. */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: var(--t-xs); font-weight: 500; padding: 3px 10px 3px 8px; border-radius: var(--r-full); background: var(--surface-2); color: var(--ink-2); white-space: nowrap; line-height: 1.4; }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.pill.tiny { padding: 2px 8px 2px 7px; }
.pill.act { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.pill.wait { color: var(--info); background: var(--info-soft); }
.pill.good { color: var(--good); background: var(--good-soft); }
.pill.warn { color: var(--warn); background: var(--warn-soft); }
.pill.muted { color: var(--muted); }
.pill.u-critical { color: var(--crit); background: var(--crit-soft); font-weight: 600; }
.pill.u-high { color: var(--warn); background: var(--warn-soft); }
.pill.u-normal { color: var(--ink-2); }
.pill.u-low { color: var(--good); background: var(--good-soft); }
.pill.ev-applied, .pill.ev-estimate_accepted, .pill.ev-booked { color: var(--good); background: var(--good-soft); }
.pill.ev-failed, .pill.ev-rolled_back { color: var(--crit); background: var(--crit-soft); }
.pill.ev-reapproval, .pill.ev-urgency { color: var(--warn); background: var(--warn-soft); }

/* Lists: rows divided by hairlines, not boxes. */
.items { list-style: none; margin: 0 calc(-1 * var(--s-3)); padding: 0; display: flex; flex-direction: column; }
.items > li + li { border-top: 1px solid var(--line); }
.item {
  display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); flex-wrap: wrap;
  padding: var(--s-3); border-radius: var(--r-md); color: var(--ink); text-decoration: none;
  transition: background-color .15s ease;
}
a.item:hover, button.item:hover { background: var(--surface-2); }
button.item { width: 100%; min-height: 0; border: 0; background: transparent; font: inherit; text-align: left; font-size: var(--t-base); border-radius: var(--r-md); }
button.item:active { transform: none; }
.item.current { background: var(--accent-soft); }
.item-title { font-weight: 500; overflow-wrap: anywhere; min-width: 0; flex: 1 1 220px; }
.item-meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.items.list { margin: 0; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-2); padding: var(--s-2); }
.items.list .item { padding: var(--s-4); }

.filters { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.filters button { min-height: 36px; font-size: var(--t-sm); background: transparent; border-color: var(--line-strong); color: var(--ink-2); }
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ---------- Home ---------- */
.hero { display: flex; gap: var(--s-6); align-items: center; padding: var(--s-4) 0 var(--s-8); }
.hero .pose { width: 112px; height: 112px; object-fit: contain; flex: none; filter: drop-shadow(0 10px 18px rgba(21, 19, 15, .12)); }
.hero-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--s-2); }
.hero h1 { font-size: var(--t-2xl); }
.hero-body > p { font-size: var(--t-md); color: var(--muted); }
.ask-big {
  display: flex; align-items: flex-end; gap: var(--s-2); margin-top: var(--s-4);
  background: var(--surface); border-radius: var(--r-xl); padding: var(--s-2) var(--s-2) var(--s-2) var(--s-5); box-shadow: var(--shadow-2);
  transition: box-shadow .2s ease;
}
.ask-big:focus-within { box-shadow: var(--shadow-2), 0 0 0 4px var(--accent-soft); }
.ask-big textarea { flex: 1; border: 0; background: transparent; resize: none; padding: var(--s-3) 0; min-height: 48px; font-size: var(--t-md); box-shadow: none; }
.ask-big textarea:focus { box-shadow: none; }
.ask-big button { min-height: 48px; padding: 0 var(--s-5); }
@media (max-width: 760px) {
  .hero { flex-direction: column; text-align: center; gap: var(--s-3); padding: var(--s-2) 0 var(--s-6); }
  .hero .pose { width: 88px; height: 88px; }
  .hero h1 { font-size: 26px; }
  .hero-body > p { font-size: var(--t-base); }
  .ask-big { flex-direction: column; align-items: stretch; padding: var(--s-2); border-radius: var(--r-lg); }
  .ask-big textarea { padding: var(--s-3); }
}
.home-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-5); align-items: start; }
@media (max-width: 860px) { .home-grid { grid-template-columns: 1fr; gap: var(--s-4); } }
.home-grid .wide { grid-column: 1 / -1; }
.home-grid h2 { display: flex; align-items: center; gap: var(--s-2); }
.panel.clients { margin-bottom: var(--s-5); }
.ideas { background: linear-gradient(180deg, var(--accent-soft), var(--surface) 70%); }
.idea { display: flex; flex-direction: column; gap: var(--s-2); padding: var(--s-3); }
.stat { font-family: var(--font-display); font-size: 40px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.meter { height: 8px; background: var(--surface-3); border-radius: var(--r-full); overflow: hidden; margin: var(--s-3) 0 var(--s-2); }
.meter span { display: block; height: 100%; background: var(--accent); border-radius: inherit; transition: width .6s cubic-bezier(.2, .8, .2, 1); }
.meter.over span { background: var(--crit); }
.meter.small { height: 4px; margin: var(--s-2) 0; }

/* ---------- Ask Biggie: the conversation ---------- */
main[data-view="ask"] { max-width: 820px; padding-bottom: var(--s-6); }
.chat { display: flex; flex-direction: column; height: calc(100dvh - 64px - 56px); min-height: 460px; }
@media (max-width: 760px) { main[data-view="ask"] { padding: 0 0 calc(var(--tab-h) + env(safe-area-inset-bottom)); } .chat { height: calc(100dvh - 56px - var(--tab-h) - env(safe-area-inset-bottom)); min-height: 360px; } }
.chat-head { display: flex; gap: var(--s-3); align-items: center; padding: 0 var(--s-2) var(--s-4); border-bottom: 1px solid var(--line); }
.chat-head .pose { width: 52px; height: 52px; object-fit: contain; }
.chat-head h1 { font-size: var(--t-lg); }
.chat-title { flex: 1; min-width: 0; }
.chat-tools { display: flex; gap: var(--s-2); flex-shrink: 0; }
.chat-tools .small-button { min-height: 36px; padding: 0 var(--s-3); font-size: var(--t-sm); }
.chat-head p { font-size: var(--t-sm); }
@media (max-width: 760px) { .chat-head { padding: var(--s-3) var(--s-4); } .chat-head .pose { width: 40px; height: 40px; } .chat-head p { display: none; } .chat-tools .small-button { min-height: 40px; } }
.thread { list-style: none; margin: 0; padding: var(--s-5) var(--s-2); display: flex; flex-direction: column; gap: var(--s-4); overflow-y: auto; flex: 1; scroll-behavior: auto; overscroll-behavior: contain; }
@media (max-width: 760px) { .thread { padding: var(--s-4); } }
.msg { display: flex; gap: var(--s-2); align-items: flex-end; max-width: min(92%, 640px); animation: enter .22s ease both; }
.msg.client { align-self: flex-end; flex-direction: row-reverse; }
.face { width: 32px; height: 32px; border-radius: 50%; background: var(--surface-2); flex: none; object-fit: cover; }
.bubble { background: var(--surface); border-radius: 20px 20px 20px 6px; padding: 10px 14px; white-space: pre-wrap; overflow-wrap: anywhere; min-width: 0; box-shadow: var(--shadow-1); }
.msg.client .bubble { background: var(--ink); color: var(--paper); border-radius: 20px 20px 6px 20px; box-shadow: none; }
.msg.client .bubble a { color: inherit; }
.msg.pending .bubble { color: var(--muted); display: inline-flex; align-items: center; gap: var(--s-3); }
.typing { display: inline-flex; gap: 4px; }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite ease-in-out; }
.typing span:nth-child(2) { animation-delay: .15s; }
.typing span:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-2px); } }
.chips { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-3); white-space: normal; }
.chips button { min-height: 36px; background: var(--surface); border-color: var(--accent); color: var(--accent-text); font-weight: 500; }
.chips button:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); }
.composer {
  display: flex; align-items: flex-end; gap: var(--s-2); margin: var(--s-2) var(--s-2) 0;
  background: var(--surface); border-radius: var(--r-xl); padding: 6px 6px 6px var(--s-4); box-shadow: var(--shadow-2);
}
.composer:focus-within { box-shadow: var(--shadow-2), 0 0 0 4px var(--accent-soft); }
.composer textarea { flex: 1; resize: none; border: 0; background: transparent; padding: 10px 0; max-height: 160px; box-shadow: none; }
.composer textarea:focus { box-shadow: none; }
.composer button { min-height: 40px; }
@media (max-width: 760px) { .composer { margin: 0 var(--s-3) var(--s-3); } }

/* Cards Biggie posts in the conversation: plain white sheets on a soft shadow. */
.card { margin-top: var(--s-3); background: var(--surface); border-radius: var(--r-lg); padding: var(--s-4) var(--s-5); white-space: normal; box-shadow: var(--shadow-2); color: var(--ink); }
.bubble > .card { margin-left: -6px; margin-right: -6px; }
.card.brief { box-shadow: var(--shadow-2), inset 3px 0 0 var(--accent); }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s-3); flex-wrap: wrap; margin-bottom: var(--s-1); }
.card-head h3 { font-size: var(--t-md); }
.step { padding-top: var(--s-3); margin-top: var(--s-3); border-top: 1px solid var(--line); }
.step ul { margin: var(--s-2) 0 0; padding-left: 18px; color: var(--ink-2); font-size: var(--t-sm); }
.step li + li { margin-top: 2px; }
.step details summary { cursor: pointer; color: var(--good); font-size: var(--t-sm); font-weight: 500; margin-top: var(--s-2); list-style: none; display: inline-flex; align-items: center; gap: 6px; }
.step details summary::before { content: '✓'; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--good-soft); font-size: 11px; }
.checks li.pass::marker { content: '✓  '; color: var(--good); }
.checks li.fail::marker { content: '✗  '; color: var(--crit); }
.rows { margin: var(--s-2) 0 0; }
.rows dt { font-size: var(--t-sm); color: var(--muted); margin-top: var(--s-3); }
.rows dt.current { color: var(--accent-text); font-weight: 600; }
.rows dd { margin: 2px 0 0; font-weight: 500; overflow-wrap: anywhere; }
.rows dd .pill { margin-left: var(--s-2); }
.brief-progress { margin-top: var(--s-2); }
.brief-progress > p.small { font-weight: 600; color: var(--ink-2); }
.brief-progress details summary { cursor: pointer; color: var(--muted); font-size: var(--t-sm); margin-top: var(--s-2); }
.offers { margin-top: var(--s-4); padding-top: var(--s-3); border-top: 1px solid var(--line); }
.offers h3 { font-size: var(--t-sm); color: var(--accent-text); margin-bottom: var(--s-1); text-transform: none; }
.offers ul { margin: 0; padding: 0; list-style: none; }
.offers li { padding: var(--s-2) 0; display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }
.offers li + li { border-top: 1px solid var(--line); }
.offers li.declined > span:first-child { color: var(--muted); }
.offer-actions { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.offer-actions button { min-height: 32px; padding: 0 var(--s-3); font-size: var(--t-xs); }
.urgency { display: flex; align-items: center; gap: var(--s-3); margin-top: var(--s-4); flex-wrap: wrap; }
.urgency label { font-weight: 500; font-size: var(--t-sm); }
.team-brief { margin-top: var(--s-3); padding: var(--s-3) var(--s-4); background: var(--surface-2); border-radius: var(--r-md); }
.slots { display: flex; flex-direction: column; gap: var(--s-2); width: 100%; }
.slots button { justify-content: flex-start; text-align: left; border-radius: var(--r-md); min-height: 48px; }
.slots button:hover { border-color: var(--accent); background: var(--accent-soft); }

/* ---------- a request's own page ---------- */
.detail { max-width: 780px; margin: 0 auto; width: 100%; }
.detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s-3); flex-wrap: wrap; }
.detail-head h1 { font-size: var(--t-2xl); }
@media (max-width: 760px) { .detail-head h1 { font-size: 26px; } }
.panel.next { box-shadow: var(--shadow-2); }
.panel.next.needs { box-shadow: var(--shadow-2), 0 0 0 2px var(--accent); }
.panel.next h2 { font-size: var(--t-sm); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: var(--s-2); font-family: var(--font-body); font-weight: 600; }
.panel.next > p { font-size: var(--t-md); }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.timeline li { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 0 0 var(--s-4) var(--s-5); }
.timeline li::before { content: ''; position: absolute; left: 3px; top: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--surface-3); box-shadow: 0 0 0 3px var(--surface); }
.timeline li:first-child::before { background: var(--accent); }
.timeline li::after { content: ''; position: absolute; left: 6.5px; top: 18px; bottom: 0; width: 1px; background: var(--line-strong); }
.timeline li:last-child::after { display: none; }

/* ---------- credits and history ---------- */
table.statement { width: 100%; border-collapse: collapse; margin-top: var(--s-4); font-size: var(--t-sm); }
.statement th, .statement td { text-align: left; padding: var(--s-3) var(--s-2); border-bottom: 1px solid var(--line); vertical-align: top; }
.statement th { font-size: var(--t-xs); color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.statement tr:last-child td { border-bottom: 0; }
.statement .num { text-align: right; font-variant-numeric: tabular-nums; }
.statement a { color: var(--ink); text-decoration: none; font-weight: 500; }
.statement a:hover { color: var(--accent-text); }
.log { list-style: none; margin: 0; padding: var(--s-2); display: flex; flex-direction: column; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-2); }
.log li { padding: var(--s-4); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px var(--s-3); align-items: start; }
.log li + li { border-top: 1px solid var(--line); }
.log .what { font-weight: 500; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.log .what:hover { color: var(--accent-text); }
.log .summary { grid-column: 1 / -1; color: var(--ink-2); font-size: var(--t-sm); overflow-wrap: anywhere; }

/* Working and error notes outside the chat. */
.working { display: flex; align-items: center; gap: var(--s-3); background: var(--surface); border-radius: var(--r-lg); padding: var(--s-3) var(--s-4); margin-bottom: var(--s-4); box-shadow: var(--shadow-2); animation: enter .2s ease both; }
.working .face { width: 32px; height: 32px; }
.working.error { box-shadow: var(--shadow-2), inset 3px 0 0 var(--crit); }

/* ---------- Talk to the team (bottom right) ---------- */
#team-chat { position: fixed; right: var(--s-6); bottom: var(--s-6); z-index: 25; display: flex; flex-direction: column; align-items: flex-end; gap: var(--s-3); }
main[data-view="ask"] ~ #team-chat { bottom: 104px; }
@media (max-width: 760px) {
  #team-chat { right: var(--s-3); bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + var(--s-3)); }
  main[data-view="ask"] ~ #team-chat { bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 76px); }
}
.chat-launcher { min-height: 48px; padding: 0 var(--s-4) 0 6px; gap: var(--s-2); background: var(--ink); color: var(--paper); border-color: var(--ink); box-shadow: var(--shadow-3); font-weight: 600; }
.chat-launcher:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); transform: translateY(-1px); }
@media (max-width: 760px) { .chat-launcher > span:nth-child(2) { display: none; } .chat-launcher { padding-right: 6px; } }
.avatars { display: inline-flex; }
.avatar { position: relative; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: inline-grid; place-items: center; font: 700 13px/1 var(--font-display); border: 2px solid var(--ink); margin-left: -8px; }
.avatar:first-child { margin-left: 0; }
.avatar .dot { position: absolute; right: -2px; bottom: -2px; border: 2px solid var(--ink); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.available { background: #2BB673; }
.dot.busy { background: var(--crit); }
.dot.away { background: var(--warn); }
.chat-panel { width: min(400px, calc(100vw - 24px)); max-height: min(600px, calc(100dvh - 180px)); display: flex; flex-direction: column; background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow-3); overflow: hidden; animation: pop .22s cubic-bezier(.2, .8, .2, 1) both; transform-origin: bottom right; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.chat-panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s-2); padding: var(--s-4) var(--s-5); background: var(--ink); color: var(--paper); }
.chat-panel-head h2 { margin: 0 0 2px; color: var(--paper); font-size: var(--t-md); }
.chat-panel-head .muted { color: color-mix(in srgb, var(--paper) 65%, transparent); }
.chat-panel-head button.quiet { color: var(--paper); min-height: 32px; }
.chat-panel-head button.quiet:hover { background: rgba(255, 255, 255, .1); }
.team-list { list-style: none; margin: 0; padding: var(--s-3) var(--s-5); display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-4); border-bottom: 1px solid var(--line); font-size: var(--t-sm); }
.team-list li { display: inline-flex; align-items: center; gap: 6px; }
.support-msgs { list-style: none; margin: 0; padding: var(--s-4) var(--s-5); display: flex; flex-direction: column; gap: var(--s-3); overflow-y: auto; flex: 1; min-height: 140px; background: var(--paper); }
.support-empty { padding: var(--s-6) var(--s-5); background: var(--paper); }
.smsg { display: flex; flex-direction: column; gap: 4px; max-width: 85%; }
.smsg.mine { align-self: flex-end; align-items: flex-end; }
.sbubble { background: var(--surface); border-radius: 16px 16px 16px 6px; padding: 8px 12px; white-space: pre-wrap; overflow-wrap: anywhere; box-shadow: var(--shadow-1); }
.smsg.mine .sbubble { background: var(--ink); color: var(--paper); border-radius: 16px 16px 6px 16px; box-shadow: none; }
.support-form { display: flex; gap: var(--s-2); padding: var(--s-3); border-top: 1px solid var(--line); align-items: flex-end; }
.support-form textarea { flex: 1; resize: none; padding: 10px 12px; background: var(--paper); border-color: transparent; }
.inbox-me { display: flex; align-items: center; gap: var(--s-2); padding: var(--s-3) var(--s-5); border-bottom: 1px solid var(--line); flex-wrap: wrap; font-size: var(--t-sm); }
.inbox-threads { display: flex; gap: 6px; padding: var(--s-2) var(--s-5); overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.inbox-threads button { min-height: 32px; font-size: var(--t-xs); white-space: nowrap; }
.inbox-threads button.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chat-panel > button.small { align-self: flex-start; margin: 0 var(--s-3) var(--s-3); min-height: 32px; font-size: var(--t-xs); }

/* ---------- sign in ---------- */
.login-page {
  min-height: 100dvh; display: grid; place-items: center; padding: var(--s-6) var(--s-4);
  background: radial-gradient(1200px 600px at 50% -10%, var(--accent-soft), transparent 70%), var(--paper);
}
.login { width: 100%; max-width: 400px; display: flex; flex-direction: column; align-items: center; gap: var(--s-2); text-align: center; animation: enter .3s ease both; }
.login .pose { width: 120px; height: 120px; object-fit: contain; filter: drop-shadow(0 12px 22px rgba(21, 19, 15, .14)); }
.login h1 { font-size: var(--t-xl); margin-top: var(--s-2); }
.login > p.muted:first-of-type { font-size: var(--t-md); }
.login-form { width: 100%; display: flex; flex-direction: column; gap: var(--s-2); text-align: left; margin: var(--s-5) 0 var(--s-3); background: var(--surface); border-radius: var(--r-xl); padding: var(--s-6); box-shadow: var(--shadow-2); }
.login-form label { font-size: var(--t-sm); font-weight: 600; color: var(--ink-2); }
.login-form input { min-height: 48px; padding: 0 var(--s-4); margin-bottom: var(--s-3); background: var(--paper); border-color: transparent; font-size: var(--t-base); }
.login-form button { min-height: 48px; margin-top: var(--s-1); font-size: var(--t-base); }
.login-form .error { font-size: var(--t-sm); }

/* Round send button with an arrow */
button.send { width: 40px; min-height: 40px; padding: 0; border-radius: 50%; }
button.send svg { width: 20px; height: 20px; }
@media (max-width: 760px) { .chat-launcher .avatar:nth-child(n+2) { display: none; } .chat-launcher { min-height: 44px; } .chat-launcher .avatar { width: 32px; height: 32px; } }
@media (max-width: 760px) { .filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--s-4)); padding: 2px var(--s-4); } .filters::-webkit-scrollbar { display: none; } .filters button { flex: none; } }

/* ---------- Growth Gap Healthcheck ---------- */
.eyebrow { font-family: var(--font-display); font-size: var(--t-xs); font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-text); margin-bottom: var(--s-1); }
.hc .lede { margin: calc(-1 * var(--s-2)) 0 var(--s-4); }
.low { --band: var(--crit); --band-soft: var(--crit-soft); }
.mid { --band: var(--warn); --band-soft: var(--warn-soft); }
.high { --band: var(--good); --band-soft: var(--good-soft); }
.none { --band: var(--muted); --band-soft: var(--surface-2); }

.hc-hero { display: flex; gap: var(--s-8); align-items: center; }
.hc-hero-body { display: flex; flex-direction: column; gap: var(--s-3); align-items: flex-start; min-width: 0; flex: 1; }
.hc-summary { font-size: var(--t-md); line-height: 1.5; }
.total-ring { position: relative; width: 168px; height: 168px; flex: none; }
.total-ring svg { width: 100%; height: 100%; }
.ring .track { fill: none; stroke: var(--surface-3); stroke-width: 10; }
.ring .fill { fill: none; stroke: var(--band); stroke-width: 10; stroke-linecap: round; transition: stroke-dasharray .8s cubic-bezier(.2, .8, .2, 1); }
.total-num { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.total-num .n { font-family: var(--font-display); font-size: 48px; font-weight: 700; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.total-num .d { font-size: var(--t-xs); color: var(--muted); margin-top: var(--s-1); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: var(--s-3); width: 100%; margin-top: var(--s-2); }
.tile { background: var(--surface-2); border-radius: var(--r-md); padding: var(--s-4); display: flex; flex-direction: column; gap: var(--s-1); }
.tile .big { font-family: var(--font-display); font-size: var(--t-xl); font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.tile .lbl { font-size: var(--t-xs); color: var(--muted); line-height: 1.35; }
.tile.accent { background: var(--ink); }
.tile.accent .big { color: var(--accent); }
.tile.accent .lbl { color: var(--paper); opacity: .75; }

.goalhook { background: var(--accent-soft); border-left: 3px solid var(--accent); border-radius: 0 var(--r-md) var(--r-md) 0; padding: var(--s-4) var(--s-5); font-size: var(--t-md); }
.goal-form { display: flex; flex-direction: column; gap: var(--s-4); }
.goal-form h2 { margin-bottom: var(--s-1); }
.goal-fields { display: flex; gap: var(--s-3); align-items: flex-end; flex-wrap: wrap; }
.goal-fields label { display: flex; flex-direction: column; gap: var(--s-1); flex: 1 1 200px; }
.goal-fields input { font: inherit; min-height: 44px; padding: 0 var(--s-3); border-radius: var(--r-md); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); }
.goal-fields input:focus { outline: none; box-shadow: var(--focus); }

.hc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-5); align-items: start; }
.areas { list-style: none; margin: 0; padding: 0; }
.area-row { display: flex; gap: var(--s-4); align-items: flex-start; padding: var(--s-4) 0; }
.area-row + .area-row { border-top: 1px solid var(--line); }
.area-row:first-child { padding-top: 0; }
.area-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--s-1); }
.area-top { display: flex; justify-content: space-between; gap: var(--s-3); align-items: baseline; flex-wrap: wrap; }
.impact { font-family: var(--font-display); font-weight: 600; font-size: var(--t-sm); color: var(--accent-text); white-space: nowrap; font-variant-numeric: tabular-nums; }
.score-badge { width: 48px; height: 48px; flex: none; border-radius: 50%; border: 2px solid var(--band); background: var(--band-soft); color: var(--band); display: flex; flex-direction: column; align-items: center; justify-content: center; font-family: var(--font-display); }
.score-badge .n { font-size: 18px; font-weight: 700; line-height: 1; }
.score-badge .d { font-size: 9px; opacity: .75; }
details.calc summary, details.limits summary { cursor: pointer; font-size: var(--t-xs); color: var(--muted); }
details.calc p { margin-top: var(--s-2); font-size: var(--t-sm); background: var(--surface-2); border-left: 3px solid var(--accent); border-radius: 0 var(--r-sm) var(--r-sm) 0; padding: var(--s-2) var(--s-3); color: var(--ink-2); }

.scorecard { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-6); }
.dept { display: flex; flex-direction: column; gap: var(--s-2); }
.dept-head { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 2px solid var(--ink); padding-bottom: var(--s-2); margin-bottom: var(--s-1); }
.dept-head h3 { font-size: var(--t-md); }
.dept-avg { font-family: var(--font-display); font-weight: 700; font-size: var(--t-lg); color: var(--accent-text); }
.dept-avg small { font-size: var(--t-xs); color: var(--muted); font-weight: 500; }
.dim { display: grid; grid-template-columns: 150px 1fr 20px; gap: var(--s-3); align-items: center; }
.dim-label { font-size: var(--t-sm); color: var(--ink-2); }
.dim-bar { height: 8px; background: var(--surface-3); border-radius: var(--r-full); overflow: hidden; }
.dim-bar span { display: block; height: 100%; border-radius: inherit; background: var(--band); }
.dim-score { font-family: var(--font-display); font-weight: 700; font-size: var(--t-sm); text-align: right; font-variant-numeric: tabular-nums; }
.dept > p { margin-top: var(--s-2); }

.todos { list-style: none; margin: var(--s-4) 0 0; padding: 0; display: flex; flex-direction: column; }
.todo { display: flex; flex-direction: column; gap: var(--s-1); padding: var(--s-5) 0; }
.todo + .todo { border-top: 1px solid var(--line); }
.todo-head { display: flex; gap: var(--s-2); align-items: center; flex-wrap: wrap; margin-bottom: var(--s-1); }
.todo h3 { font-size: var(--t-md); }
.todo-foot { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); flex-wrap: wrap; margin-top: var(--s-3); }
.pill.k-idea { color: var(--info); background: var(--info-soft); }
.pill.k-fix { color: var(--crit); background: var(--crit-soft); }
.pill.k-tidy { color: var(--good); background: var(--good-soft); }

.trend { list-style: none; margin: 0; padding: 0; display: flex; gap: var(--s-2); align-items: flex-end; height: 160px; }
.trend li { flex: 1; max-width: 64px; height: 100%; }
.trend button { width: 100%; height: 100%; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: var(--s-1); padding: 0; border: 0; background: transparent; border-radius: var(--r-sm); }
.trend .bar-wrap { flex: 1; width: 60%; display: flex; align-items: flex-end; }
.trend .bar { display: block; width: 100%; background: var(--surface-3); border-radius: 6px 6px 2px 2px; }
.trend li.current .bar { background: var(--accent); }
.trend .v { font-family: var(--font-display); font-weight: 600; font-size: var(--t-sm); }
.trend .m { font-size: var(--t-xs); color: var(--muted); }

.hc-total { display: flex; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; border-top: 2px solid var(--ink); padding-top: var(--s-5); }
.hc-total > div { display: flex; flex-direction: column; gap: var(--s-1); }
.hc-total .lbl { font-size: var(--t-xs); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.hc-total .val { font-family: var(--font-display); font-size: var(--t-2xl); font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; }
.hc-total .val.accent { color: var(--accent-text); }
details.limits ul { margin: var(--s-2) 0 0; padding-left: var(--s-5); display: flex; flex-direction: column; gap: var(--s-1); }
details.limits > p { margin-top: var(--s-2); }

.hc-mini-row { display: flex; gap: var(--s-5); align-items: center; }
.hc-mini .total-ring { width: 104px; height: 104px; }
.hc-mini .total-num .n { font-size: 30px; }
.hc-mini .total-num .d { font-size: 10px; }
.hc-empty { display: flex; gap: var(--s-6); align-items: center; }
.hc-empty .pose { width: 120px; height: 120px; object-fit: contain; flex: none; }
.hc-empty p { margin-top: var(--s-2); max-width: 60ch; }

@media (max-width: 760px) {
  .hc-hero { flex-direction: column; align-items: stretch; gap: var(--s-5); }
  .hc-hero .total-ring { align-self: center; width: 148px; height: 148px; }
  .hc-grid, .scorecard { grid-template-columns: 1fr; }
  .dim { grid-template-columns: 120px 1fr 20px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hc-empty { flex-direction: column; align-items: flex-start; }
  .hc-mini-row { align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) { .ring .fill { transition: none; } }

/* ---------- Requests: board and list ---------- */
.head-actions { display: flex; gap: var(--s-3); align-items: center; flex-wrap: wrap; }
.view-switch { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface-2); border-radius: var(--r-full); }
.view-switch button { min-height: 34px; padding: 0 var(--s-3); gap: 6px; border: 0; background: transparent; color: var(--ink-2); border-radius: var(--r-full); font-size: var(--t-sm); box-shadow: none; }
.view-switch button svg { width: 18px; height: 18px; }
.view-switch button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
main[data-view="board"] { max-width: 1440px; }

.kanban { display: grid; grid-template-columns: repeat(5, minmax(180px, 1fr)); gap: var(--s-4); align-items: start; overflow-x: auto; padding-bottom: var(--s-2); scroll-snap-type: x mandatory; overscroll-behavior-x: contain; }
.kcol { background: var(--surface-2); border-radius: var(--r-lg); padding: var(--s-3); display: flex; flex-direction: column; gap: var(--s-3); scroll-snap-align: start; min-width: 0; }
.kcol header { padding: var(--s-1) var(--s-2) 0; }
.kcol h2 { display: flex; align-items: center; gap: var(--s-2); font-size: var(--t-base); margin-bottom: 2px; }
.kcards { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-2); }
.kcard { display: flex; flex-direction: column; gap: var(--s-2); padding: var(--s-3) var(--s-4); background: var(--surface); border-radius: var(--r-md); box-shadow: var(--shadow-1); color: var(--ink); text-decoration: none; transition: box-shadow .15s ease, transform .15s ease; }
.kcard:hover { box-shadow: var(--shadow-2); transform: translateY(-1px); color: var(--ink); }
.kcard.needs { box-shadow: var(--shadow-1), 0 0 0 2px var(--accent); }
.kcard-title { font-weight: 500; line-height: 1.35; overflow-wrap: anywhere; }
.kcard-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.kcard-meta .pill { white-space: normal; }
.kcard-foot { display: flex; justify-content: space-between; gap: var(--s-2); flex-wrap: wrap; }
.kempty { padding: var(--s-4) var(--s-2); text-align: center; border: 1px dashed var(--line-strong); border-radius: var(--r-md); }
.kcol .more { align-self: flex-start; margin: 0; }
@media (max-width: 760px) {
  .kanban { grid-template-columns: repeat(5, 82%); margin: 0 calc(-1 * var(--s-4)); padding: 0 var(--s-4) var(--s-2); scroll-padding: 0 var(--s-4); }
  .head-actions { width: 100%; justify-content: space-between; }
}
@media (prefers-reduced-motion: reduce) { .kcard, .kcard:hover { transition: none; transform: none; } }

/* ---------- Tasks ---------- */
.tasks-link { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px 0 10px; border-radius: var(--r-full); color: var(--ink-2); text-decoration: none; font-size: var(--t-sm); font-weight: 500; background: var(--surface-2); }
.tasks-link:hover { color: var(--ink); }
.tasks-link[aria-current="page"] { background: var(--ink); color: var(--paper); }
.tasks-link .count { margin-left: 2px; }
@media (max-width: 760px) {
  .tasks-link { width: 40px; height: 40px; padding: 0; justify-content: center; }
  .tasks-word { display: none; }
  .tasks-link .count { position: absolute; top: -2px; right: -4px; margin: 0; }
}
.tasks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.tasks.panel { padding: var(--s-2) var(--s-5); }
.task { display: flex; align-items: center; gap: var(--s-4); padding: var(--s-4) 0; }
.task + .task { border-top: 1px solid var(--line); }
.task-tick { width: 20px; height: 20px; flex: none; border-radius: 6px; border: 2px solid var(--accent); }
.task.soft .task-tick { border-color: var(--line-strong); }
.task-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.task-verb { font-family: var(--font-display); font-weight: 600; font-size: var(--t-base); letter-spacing: -0.01em; }
.task-title { color: var(--ink-2); overflow-wrap: anywhere; }
.task > .button, .task > button { flex: none; }
.home-grid .task { gap: var(--s-3); padding: var(--s-3) 0; }
.home-grid .task-verb { font-size: var(--t-sm); }
.home-grid .task-title { font-size: var(--t-sm); }
.tasks-empty { display: flex; gap: var(--s-5); align-items: center; }
.tasks-empty .pose { width: 88px; height: 88px; object-fit: contain; flex: none; }
@media (max-width: 760px) {
  .task { flex-wrap: wrap; }
  .task > .button, .task > button { margin-left: calc(20px + var(--s-4)); }
  .tasks.panel { padding: var(--s-1) var(--s-4); }
}

/* ---------- Admin ---------- */
a.icon-button { display: inline-grid; place-items: center; height: var(--control-h); border-radius: var(--r-full); color: var(--ink-2); }
a.icon-button[hidden] { display: none; }
a.icon-button[aria-current="page"] { background: var(--ink); color: var(--paper); }
.admin-form { display: flex; flex-direction: column; gap: var(--s-3); }
.admin-form h2 { margin-bottom: 0; }
.admin-fields { display: flex; gap: var(--s-3); align-items: flex-end; flex-wrap: wrap; }
.admin-fields > span[hidden] { display: none; }
.field { display: flex; flex-direction: column; gap: var(--s-1); min-width: 0; }
.field input, .field select, .name-input, .prices input { font: inherit; min-height: 40px; padding: 0 var(--s-3); border-radius: var(--r-md); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); }
.field select { padding-right: 32px; min-height: 40px; }
.field input:focus, .field select:focus, .name-input:focus, .prices input:focus { outline: none; box-shadow: var(--focus); }
.field input[name="name"], .field input[name="email"] { width: 220px; max-width: 100%; }
.admin-rows { list-style: none; margin: 0; padding: 0; }
.admin-rows > li + li { border-top: 1px solid var(--line); }
.admin-row { display: flex; flex-direction: column; gap: var(--s-3); padding: var(--s-4) 0; }
.admin-row-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.admin-row-head strong { margin-right: var(--s-2); }
.name-input { font-weight: 600; min-width: 0; width: 280px; max-width: 100%; }
.admin-row .actions { margin: 0; }
.created { box-shadow: var(--shadow-2), 0 0 0 2px var(--accent); }
.secret { display: flex; gap: var(--s-3); align-items: center; flex-wrap: wrap; margin: var(--s-3) 0; }
.secret code { font: 600 var(--t-md)/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--surface-2); padding: var(--s-2) var(--s-3); border-radius: var(--r-sm); letter-spacing: .04em; }
.prices input { width: 110px; }
.prices td { vertical-align: middle; }
.admin-status { list-style: none; margin: 0 0 var(--s-3); padding: 0; display: flex; flex-direction: column; gap: var(--s-2); }
.email-preview { width: 100%; height: 460px; border: 1px solid var(--line); border-radius: var(--r-md); margin-top: var(--s-4); background: #F7F6F3; }
@media (max-width: 760px) {
  .field input[name="name"], .field input[name="email"], .name-input { width: 100%; }
  .admin-fields > .field, .admin-fields > span { flex: 1 1 100%; }
  .prices input { width: 76px; }
  .prices th:nth-child(4), .prices td:nth-child(4) { display: none; }
}

/* ---------- Printing the Healthcheck (Save as PDF) ---------- */
.print-only { display: none; }
@media print {
  @page { margin: 14mm; }
  :root { --paper: #FFFFFF; --surface: #FFFFFF; --surface-2: #F4F2EE; --surface-3: #E9E6E0; --ink: #15130F; --ink-2: #4A453D; --muted: #6E675D; --line: rgba(21,19,15,.12); --shadow-1: none; --shadow-2: none; --shadow-3: none; color-scheme: light; }
  body { background: #FFFFFF; font-size: 12.5px; }
  .top, .nav, #team-chat, .skip, .no-print, .filters, details.calc summary, .todo-foot .offer-actions { display: none !important; }
  .print-only { display: block; }
  main { max-width: none; padding: 0; animation: none; }
  .panel { box-shadow: none; border: 1px solid var(--line); break-inside: avoid; padding: 16px; }
  .hc-grid, .scorecard { grid-template-columns: 1fr 1fr; }
  .hc-hero { flex-direction: row; }
  .todo, .area-row, .dept, .hc-total { break-inside: avoid; }
  details.limits { display: block; }
  details.limits > * { display: block; }
  details.calc[open] p, details.calc p { display: block; }
  .tile.accent { background: #15130F; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .score-badge, .ring, .dim-bar span, .trend .bar, .pill { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a { color: inherit; text-decoration: none; }
}
