/* ==========================================================================
   Evolution Support console

   Flow follows Friday: a dashboard of numbered updates, boards split into
   folders, list or stage views, and a details panel on the right.
   Look follows Mixtura: white, hairline rules, square corners, no soft
   shadows, Playfair Display for headings and DM Sans for everything else.

   House rules (from Mixtura): hairlines are `box-shadow: inset` where a
   border would add height; no gradients, blurs or feathered shadows.
   ========================================================================== */

:root {
  --ink: #2d2d2d;
  --ink-2: #555555;
  --muted: #9b9b9b;
  --line: #e5e5e5;
  --line-2: #cccccc;
  --wash: #f8f8f8;
  --wash-2: #f4f4f4;
  --white: #ffffff;
  --accent: #b8283f;          /* eyebrows, active marks; change here to rebrand */

  /* Stage colours: Friday's pill codes */
  --s-new: #ececec;
  --s-progress: #246caf;
  --s-review: #e4a951;
  --s-done: #36971e;
  --s-red: #d64545;
  --s-overdue: #c0504d;

  --display: "Playfair Display", Georgia, "Times New Roman", serif;
  --body: "DM Sans", "Helvetica Neue", Arial, sans-serif;

  --top: 60px;
  --nav: 236px;
  --panel: 360px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font: 400 14px/1.55 var(--body);
  font-variant-numeric: lining-nums;  /* Playfair defaults to old-style figures ("01" reads "oı") */
  letter-spacing: .2px;
}
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
a { color: inherit; }
code { font: 12.5px/1.4 ui-monospace, "SF Mono", Consolas, monospace; background: var(--wash-2); padding: 1px 5px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

/* --- type -------------------------------------------------------------- */

.eyebrow {
  display: block;
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 2.5px;
  text-transform: uppercase;
}
.eyebrow.quiet { color: var(--muted); }
.display { font-family: var(--display); font-weight: 600; letter-spacing: -.5px; line-height: 1.1; }
.muted { color: var(--muted); }
.ink2 { color: var(--ink-2); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }

.label {
  display: inline-block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

/* --- shell ------------------------------------------------------------- */

.top {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--top);
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 24px;
  background: var(--white);
  box-shadow: inset 0 -1px 0 var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark { width: 22px; height: 22px; background: var(--ink); position: relative; flex: none; }
.brand-mark::after { content: ""; position: absolute; right: -4px; bottom: -4px; width: 9px; height: 9px; background: var(--accent); box-shadow: 0 0 0 2px var(--white); }
.brand b { font-family: var(--display); font-size: 19px; font-weight: 600; letter-spacing: -.3px; }
.top-product { color: var(--muted); font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; }
.top-spacer { flex: 1; }
.top a, .top button.linklike { font-size: 12px; font-weight: 500; letter-spacing: 1.5px; text-transform: uppercase; text-decoration: none; }
.top a:hover, .top button.linklike:hover { color: var(--accent); }
.top a.brand { font-size: inherit; letter-spacing: normal; text-transform: none; }
.top a.brand:hover { color: inherit; }
.linklike { background: none; border: 0; padding: 0; cursor: pointer; }

.shell { display: grid; grid-template-columns: var(--nav) minmax(0, 1fr); min-height: calc(100vh - var(--top)); }

.nav {
  position: sticky;
  top: var(--top);
  align-self: start;
  height: calc(100vh - var(--top));
  overflow-y: auto;
  padding: 20px 12px 24px;
  box-shadow: inset -1px 0 0 var(--line);
}
.nav-group { padding: 16px 12px 6px; }
.nav-group:first-child { padding-top: 0; }
.nav a {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 6px 12px;
  color: var(--ink-2);
  text-decoration: none;
  font-size: 14px;
}
.nav a:hover { color: var(--ink); background: var(--wash); }
.nav a.active { color: var(--ink); font-weight: 600; box-shadow: inset 2px 0 0 var(--accent); background: var(--wash); }
.nav a .n { margin-left: auto; color: var(--muted); font-size: 12px; font-weight: 400; font-variant-numeric: tabular-nums; }
.nav a .n.hot { color: var(--accent); font-weight: 600; }
.nav .folder { min-height: 30px; padding: 4px 12px 4px 28px; font-size: 13px; position: relative; }
.nav .folder::before { content: ""; position: absolute; left: 16px; top: 0; bottom: 0; width: 1px; background: var(--line-2); }
.nav .folder.active { box-shadow: none; background: none; font-weight: 600; }
.nav .folder.active::before { width: 2px; left: 15px; background: var(--ink); }
.nav-sep { height: 1px; margin: 14px 12px 0; background: var(--line); }

.view { min-width: 0; outline: none; }

/* --- page: main + right panel ------------------------------------------ */

.page { display: grid; grid-template-columns: minmax(0, 1fr) var(--panel); min-height: calc(100vh - var(--top)); }
.page.single { grid-template-columns: minmax(0, 1fr); }
.main { min-width: 0; padding: 32px 40px 64px; }
.main.narrow > * { max-width: 760px; }

.aside {
  position: sticky;
  top: var(--top);
  align-self: start;
  height: calc(100vh - var(--top));
  overflow-y: auto;
  box-shadow: inset 1px 0 0 var(--line);
  background: var(--white);
}
.pn { position: relative; }
.pn > .aside-close { position: absolute; top: 14px; right: 14px; }

/* Side panel folded to a rail until a row is selected or the summary is called */
.page.railed { grid-template-columns: minmax(0, 1fr) 44px; }
.rail-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
  height: 100%;
  padding: 22px 0;
  background: none;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}
.rail-btn:hover { background: var(--wash); color: var(--ink); }
.rail-icon { font-size: 16px; line-height: 1; }
.rail-label { writing-mode: vertical-rl; font-size: 11px; font-weight: 600; letter-spacing: 2.5px; text-transform: uppercase; }

.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 24px; }
.head h1 { font-family: var(--display); font-size: 36px; font-weight: 600; letter-spacing: -.8px; line-height: 1.05; margin-top: 10px; }
.head p { max-width: 640px; margin-top: 10px; color: var(--ink-2); }
.crumbs { color: var(--muted); font-size: 11.5px; font-weight: 600; letter-spacing: 2.5px; text-transform: uppercase; }
.crumbs a { color: var(--accent); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* --- controls ---------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 16px;
  background: var(--white);
  border: 0;
  box-shadow: inset 0 0 0 1px var(--line-2);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: box-shadow 160ms ease, background 160ms ease, color 160ms ease;
}
.btn:hover:not(:disabled) { box-shadow: inset 0 0 0 1px var(--ink); }
.btn:disabled { color: var(--muted); cursor: not-allowed; }
.btn.solid { background: var(--ink); box-shadow: none; color: var(--white); }
.btn.solid:hover:not(:disabled) { background: var(--accent); }
.btn.solid:disabled { background: var(--line-2); color: var(--white); }
.btn.small { min-height: 30px; padding: 5px 12px; font-size: 11px; }
.btn.ai::before { content: "✦"; color: var(--accent); font-size: 12px; letter-spacing: 0; }
.btn.solid.ai::before { color: inherit; }
.btn.block { width: 100%; }

.more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 0 3px;
  background: none;
  border: 0;
  box-shadow: inset 0 -1px 0 var(--ink);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
}
.more::after { content: "→"; letter-spacing: 0; transition: transform 160ms ease; }
.more:hover::after { transform: translateX(3px); }
.more.plain::after { content: none; }

input[type="text"], input[type="password"], input[type="number"], input[type="search"], select, textarea {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  background: var(--white);
  border: 0;
  border-radius: 0;
  box-shadow: inset 0 0 0 1px var(--line-2);
  font-size: 14px;
  transition: box-shadow 160ms ease;
}
input:focus, select:focus, textarea:focus { outline: none; box-shadow: inset 0 0 0 1px var(--ink); }
select {
  appearance: none;
  padding-right: 32px;
  background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%232d2d2d' stroke-width='1.3'/%3E%3C/svg%3E") no-repeat right 12px center;
  cursor: pointer;
}
select.inline { width: auto; min-height: 32px; padding: 4px 30px 4px 10px; font-size: 13px; }
textarea { min-height: 110px; resize: vertical; line-height: 1.55; }
.field { display: block; margin-top: 16px; }
.field > .label { display: block; margin-bottom: 6px; }
.field .hint { display: block; margin-top: 6px; color: var(--muted); font-size: 12.5px; }
.row-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 14px; }

/* Friday's filter bar, drawn with a single hairline */
.filters { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; padding: 6px 16px; box-shadow: inset 0 0 0 1px var(--line); }
.filters label { display: flex; align-items: center; gap: 10px; }
.filters select.inline { box-shadow: none; padding-left: 0; font-weight: 600; background-position: right 8px center; }

/* Tabs: uppercase labels with an underline */
.tabs { display: flex; gap: 28px; flex-wrap: wrap; box-shadow: inset 0 -1px 0 var(--line); margin-bottom: 4px; }
.tabs a {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 10px 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-decoration: none;
}
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--ink); box-shadow: inset 0 -2px 0 var(--ink); }
.tabs a .n { font-size: 11px; letter-spacing: 0; color: inherit; font-variant-numeric: tabular-nums; }
.tabs a.red .n { color: var(--s-red); }
.tabs a.on.red { color: var(--s-red); box-shadow: inset 0 -2px 0 var(--s-red); }

.switch { display: inline-flex; box-shadow: inset 0 0 0 1px var(--line-2); }
.switch a { padding: 9px 14px; font-size: 11px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; text-decoration: none; color: var(--ink-2); }
.switch a + a { box-shadow: inset 1px 0 0 var(--line-2); }
.switch a:hover { color: var(--ink); }
.switch a.on { background: var(--ink); color: var(--white); }

/* --- pills ------------------------------------------------------------- */

/* Lean on purpose: a status should read at a glance without outweighing the text around it. */
.pill {
  display: inline-block;
  min-width: 76px;
  padding: 1px 7px;
  background: var(--s-new);
  color: var(--ink-2);
  font-size: 9.5px;
  font-weight: 600;
  line-height: 14px;
  letter-spacing: .7px;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
  vertical-align: middle;
}
.pill.auto { min-width: 0; }
.pill.progress { background: var(--s-progress); color: var(--white); }
.pill.review { background: var(--s-review); color: var(--ink); }
.pill.done { background: var(--s-done); color: var(--white); }
.pill.red { background: var(--s-red); color: var(--white); }
.pill.overdue { background: var(--s-overdue); color: var(--white); }
.pill.line { background: var(--white); box-shadow: inset 0 0 0 1px var(--line-2); color: var(--ink-2); }
.pill.ghost { background: var(--white); box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); }
.move { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.move .arrow { color: var(--muted); font-size: 15px; line-height: 1; }
.move .arrow.back { color: var(--s-red); }
.tag { display: inline-block; padding: 1px 6px; box-shadow: inset 0 0 0 1px var(--line-2); color: var(--ink-2); font-size: 10px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; white-space: nowrap; }
.tag.accent { box-shadow: inset 0 0 0 1px var(--accent); color: var(--accent); }

/* Friday's segmented progress bar under a stage */
.segs { display: flex; gap: 3px; margin-top: 7px; }
.segs i { width: 14px; height: 2px; background: var(--line-2); }
.segs i.on { background: var(--ink); }
.segs.done i.on { background: var(--s-done); }

/* Stage cell in a row: the pill with its progress bar directly underneath, both the same width */
.stage { display: flex; flex-direction: column; gap: 3px; width: 100%; max-width: 104px; padding-top: 2px; }
.stage .pill { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.stage .segs { margin-top: 0; gap: 2px; }
.stage .segs i { flex: 1; width: auto; }

/* --- Friday rows: number, two lines split by a hairline ---------------- */

.rows-head, .r { display: grid; grid-template-columns: var(--cols); column-gap: 16px; }
.rows-head { padding: 18px 0 8px; }
.rows-head > div { min-width: 0; }
.rows-head .label { display: block; }
.rows-head .label.u { padding-bottom: 5px; box-shadow: inset 0 -1px 0 var(--line-2); margin-bottom: 5px; width: fit-content; min-width: 64px; }

.r { position: relative; padding: 12px 8px 12px 0; cursor: pointer; grid-template-rows: auto auto; scroll-margin-top: calc(var(--top) + 8px); }
.r:focus-visible { outline-offset: -2px; }
.r > .num {
  grid-column: 1;
  grid-row: 1 / 3;
  align-self: center;
  justify-self: center;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  box-shadow: inset 0 0 0 1px var(--line-2);
  border-radius: 50%;
  background: var(--white);
  color: var(--ink-2);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  z-index: 1;
}
.r > .l1 { padding-bottom: 6px; box-shadow: inset 0 -1px 0 var(--line); min-width: 0; }
.r > .l2 { padding-top: 2px; min-width: 0; color: var(--ink-2); line-height: 1.4; }
/* Truncated text stops well before the next column; hovering it shows the full text (.tip) */
.r > .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: 28px; }
.r > .l1.t { font-weight: 600; }
.r:hover > .num { box-shadow: inset 0 0 0 1px var(--ink); color: var(--ink); }
.r:hover > .l1 { box-shadow: inset 0 -1px 0 var(--line-2); }
.r.sel { background: var(--wash); }
.r.sel > .num { background: var(--ink); color: var(--white); box-shadow: none; }
.red-text { color: var(--s-red); }

/* Full text of a truncated cell, laid over it */
.tip {
  position: fixed;
  z-index: 70;
  padding: 4px 10px;
  background: var(--white);
  box-shadow: inset 0 0 0 1px var(--ink);
  white-space: normal;
  overflow-wrap: anywhere;
  pointer-events: none;
}

/* The inner table under a selected row: same wash as the row, no rule on the left */
.sub { padding: 18px 8px 22px 60px; }
.r.sel + .sub { background: var(--wash); }
.sub-row { display: grid; grid-template-columns: var(--subcols, 1.2fr .6fr 1.6fr .8fr); gap: 16px; padding: 9px 0; box-shadow: inset 0 -1px 0 var(--line); font-size: 13px; align-items: baseline; }
.sub-row:last-child { box-shadow: none; }
.sub-row.head { padding: 4px 0 6px; box-shadow: inset 0 -1px 0 var(--line-2); }
.sub-row small { display: block; color: var(--muted); font-size: 12px; }
.sub-detail { padding: 4px 0 2px; color: var(--ink-2); font-size: 13.5px; max-width: 760px; overflow-wrap: anywhere; }
.sub-detail .row-actions { margin-top: 10px; }

/* Grouped list: one header per folder (Friday's board tabs, drawn as type + rule) */
.group { margin-top: 26px; }
.group-head { display: flex; align-items: baseline; gap: 12px; width: 100%; padding: 0 0 8px; background: none; border: 0; box-shadow: inset 0 -1px 0 var(--ink); cursor: pointer; text-align: left; }
.group-head .display { font-size: 21px; }
.group-head .n { color: var(--muted); font-size: 12px; }
.group-head .chev { margin-left: auto; color: var(--muted); transition: transform 160ms ease; }
.group.closed .chev { transform: rotate(-90deg); }
.group.closed .group-body { display: none; }

/* --- stage board ------------------------------------------------------- */

.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); margin-top: 20px; overflow-x: auto; box-shadow: inset 0 1px 0 var(--line); }
.col { min-height: 440px; padding: 0 14px 20px; box-shadow: inset -1px 0 0 var(--line); transition: background 120ms ease; }
.col:first-child { padding-left: 0; }
.col:last-child { box-shadow: none; padding-right: 0; }
.col-head { display: flex; align-items: center; gap: 8px; padding: 14px 0 12px; }
.col-head::before { content: ""; width: 8px; height: 8px; background: var(--c, var(--line-2)); flex: none; }
.col-head b { font-size: 12px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; }
.col-head .n { margin-left: auto; color: var(--muted); font-size: 12px; }
.col.drop { background: var(--wash); }
.card {
  display: block;
  margin-bottom: 10px;
  padding: 12px 14px;
  background: var(--white);
  box-shadow: inset 0 0 0 1px var(--line);
  cursor: grab;
  transition: box-shadow 140ms ease;
}
.card:hover { box-shadow: inset 0 0 0 1px var(--ink); }
.card.sel { box-shadow: inset 0 0 0 1px var(--ink), inset 3px 0 0 var(--accent); }
.card.dragging { opacity: .45; }
.card .t { font-weight: 600; line-height: 1.35; }
.card .m { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: 12px; }
.col-empty { padding: 18px 0; color: var(--muted); font-size: 12.5px; }

/* --- right panel ------------------------------------------------------- */

.pn { padding: 28px 28px 48px; }
.pn-title { font-family: var(--display); font-size: 24px; font-weight: 600; letter-spacing: -.4px; line-height: 1.15; margin-top: 8px; }
.pn-sub { margin-top: 8px; color: var(--ink-2); font-size: 13px; }
.pn-sec { padding: 20px 0; box-shadow: inset 0 -1px 0 var(--line); }
.pn-sec:last-child { box-shadow: none; }
.pn-sec > .label { display: block; margin-bottom: 10px; }
.pn-sec p + p { margin-top: 8px; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 8px 12px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.person { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; box-shadow: inset 0 -1px 0 var(--line); font-size: 13.5px; }
.person:last-child { box-shadow: none; }
.person > :last-child { flex: none; }
.person > :first-child { min-width: 0; }
.person > :only-child { flex: 1 1 auto; overflow-wrap: anywhere; }
.person small { display: block; color: var(--muted); font-size: 12px; }
.quote { padding: 2px 0 2px 14px; box-shadow: inset 2px 0 0 var(--line-2); margin-bottom: 14px; font-family: var(--display); font-size: 15.5px; line-height: 1.4; }
.quote small { display: block; margin-top: 4px; font-family: var(--body); font-size: 12px; color: var(--muted); }
.history li { position: relative; padding: 0 0 14px 18px; font-size: 13px; }
.history li::before { content: ""; position: absolute; left: 3px; top: 7px; width: 5px; height: 5px; background: var(--ink); }
.history li::after { content: ""; position: absolute; left: 5px; top: 16px; bottom: 0; width: 1px; background: var(--line); }
.history li:last-child::after { content: none; }
.history small { display: block; color: var(--muted); font-size: 12px; }

/* Friday's numbered change-status stepper */
.stepper { display: flex; flex-wrap: wrap; }
.step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 0;
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
}
.step i { display: grid; place-items: center; width: 22px; height: 22px; box-shadow: inset 0 0 0 1px var(--line-2); font-style: normal; font-size: 11px; letter-spacing: 0; }
.step.past { color: var(--ink-2); }
.step.past i { box-shadow: inset 0 0 0 1px var(--ink); color: var(--ink); }
.step.now { color: var(--ink); cursor: default; }
.step.now i { background: var(--s-review); box-shadow: none; color: var(--ink); }
.step.fwd:hover { color: var(--s-progress); }
.step.fwd:hover i { background: var(--s-progress); color: var(--white); box-shadow: none; }
.step.back:hover { color: var(--s-red); }
.step.back:hover i { background: var(--s-red); color: var(--white); box-shadow: none; }

/* Summary panel: counts by stage */
.tally { display: grid; grid-template-columns: 1fr auto; }
.tally > * { padding: 9px 0; box-shadow: inset 0 -1px 0 var(--line); }
.tally .v { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; }

/* --- dashboard ---------------------------------------------------------- */

.stats { display: grid; grid-template-columns: repeat(2, 1fr); box-shadow: inset 0 0 0 1px var(--line); }
.stat { padding: 16px; box-shadow: inset -1px -1px 0 var(--line); text-decoration: none; }
.stat:hover { background: var(--wash); }
.stat .v { display: block; font-family: var(--display); font-size: 32px; font-weight: 600; line-height: 1; letter-spacing: -.5px; }
.stat .label { margin-top: 8px; }
.stat.red .v { color: var(--s-red); }
.minis { margin-top: 18px; }
.mini { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; box-shadow: inset 0 -1px 0 var(--line); font-size: 13px; }
.mini b { font-weight: 600; font-variant-numeric: tabular-nums; }

.needs a { display: block; padding: 12px 0 12px 18px; box-shadow: inset 0 -1px 0 var(--line); text-decoration: none; position: relative; }
.needs a:first-child { padding-top: 0; }
.needs a::before { content: ""; position: absolute; left: 0; top: 19px; width: 6px; height: 6px; background: var(--muted); }
.needs a:first-child::before { top: 7px; }
.needs a.action::before { background: var(--accent); }
.needs a.warn::before { background: var(--s-review); }
.needs a b { display: block; font-weight: 600; }
.needs a span { display: block; color: var(--ink-2); font-size: 12.5px; margin-top: 2px; }
.needs a:hover b { color: var(--accent); }

/* --- documents (reports, specs) --------------------------------------- */

.doc { max-width: 780px; }
.md { line-height: 1.65; overflow-wrap: anywhere; }
.md h1, .md h2, .md h3 { font-family: var(--display); font-weight: 600; letter-spacing: -.4px; line-height: 1.2; }
.md h1 { font-size: 30px; margin: 32px 0 12px; }
.md h2 { font-size: 23px; margin: 30px 0 10px; padding-top: 22px; box-shadow: inset 0 1px 0 var(--line); }
.md h3 { font-size: 18px; margin: 22px 0 8px; }
.md > :first-child { margin-top: 0; padding-top: 0; box-shadow: none; }
.md p { margin: 10px 0; }
.md ul, .md ol { margin: 10px 0; padding-left: 22px; }
.md ul { list-style: square; }
.md ol { list-style: decimal; }
.md li { margin: 4px 0; }
.md table { border-collapse: collapse; margin: 14px 0; font-size: 13.5px; width: 100%; }
.md th, .md td { text-align: left; padding: 8px 10px; box-shadow: inset 0 -1px 0 var(--line); vertical-align: top; }
.md th { color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; }
.md blockquote { margin: 12px 0; padding-left: 14px; box-shadow: inset 2px 0 0 var(--line-2); color: var(--ink-2); }
.md pre { background: var(--wash); padding: 12px 14px; overflow-x: auto; }
.md pre code { background: none; padding: 0; }
.md hr { border: 0; height: 1px; background: var(--line); margin: 22px 0; }

/* --- chat transcript (conversation panel) ------------------------------ */

.chat { display: flex; flex-direction: column; gap: 14px; }
.msg { max-width: 92%; font-size: 13.5px; line-height: 1.55; }
.msg .who { display: block; margin-bottom: 4px; color: var(--muted); font-size: 10.5px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; }
.msg.customer { align-self: flex-end; padding: 10px 12px; background: var(--ink); color: var(--white); }
.msg.customer .who { color: rgba(255, 255, 255, .6); }
.msg.bot { padding: 10px 12px; background: var(--wash); }
.msg.support { padding: 10px 12px; box-shadow: inset 2px 0 0 var(--accent), inset 0 0 0 1px var(--line); }
.msg.system { color: var(--muted); font-size: 12.5px; }
.msg .md p { margin: 6px 0; }
.msg .md p:first-child { margin-top: 0; }
.msg .md p:last-child { margin-bottom: 0; }
.msg-events { display: flex; gap: 6px; flex-wrap: wrap; }

/* --- misc --------------------------------------------------------------- */

.empty { padding: 40px 0; color: var(--muted); }
.empty b { display: block; color: var(--ink); font-family: var(--display); font-size: 20px; font-weight: 600; margin-bottom: 6px; }
.notice { margin-bottom: 20px; padding: 14px 16px; box-shadow: inset 3px 0 0 var(--s-review), inset 0 0 0 1px var(--line); }
.notice.error { box-shadow: inset 3px 0 0 var(--s-red), inset 0 0 0 1px var(--line); }
.notice b { font-weight: 600; }
.ok-dot, .no-dot { display: inline-block; width: 8px; height: 8px; margin-right: 8px; vertical-align: 1px; }
.ok-dot { background: var(--s-done); }
.no-dot { background: var(--s-red); }
.section { padding: 28px 0; box-shadow: inset 0 -1px 0 var(--line); }
.section:first-of-type { padding-top: 8px; }
.section h2 { font-family: var(--display); font-size: 22px; font-weight: 600; letter-spacing: -.3px; }
.section > p { margin-top: 6px; color: var(--ink-2); }
.snippet { margin-top: 12px; padding: 14px 16px; background: var(--wash); font: 12.5px/1.6 ui-monospace, "SF Mono", Consolas, monospace; white-space: pre-wrap; word-break: break-all; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
.feature { padding: 10px 0; box-shadow: inset 0 -1px 0 var(--line); font-size: 13.5px; }
.feature small { display: block; color: var(--muted); font-size: 12px; }

.toast {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 60;
  max-width: 440px;
  padding: 12px 16px;
  background: var(--ink);
  color: var(--white);
  font-size: 13.5px;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}
.toast.show { opacity: 1; transform: none; }
.toast.error { background: var(--s-red); }

.spin { display: inline-block; width: 11px; height: 11px; border: 1.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.modal-back { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px; background: rgba(45, 45, 45, .4); }
.modal { width: min(580px, 100%); max-height: calc(100vh - 48px); overflow-y: auto; padding: 28px; background: var(--white); box-shadow: inset 0 0 0 1px var(--line-2); }
.modal h2 { font-family: var(--display); font-size: 24px; font-weight: 600; letter-spacing: -.3px; margin-top: 8px; }
.modal > p { margin-top: 8px; color: var(--ink-2); font-size: 13.5px; }
.stage-list { margin-top: 18px; box-shadow: inset 0 1px 0 var(--line); }
.stage-edit { display: grid; grid-template-columns: 1fr 160px auto; gap: 8px; align-items: center; padding: 8px 0; box-shadow: inset 0 -1px 0 var(--line); }
.stage-edit .ops { display: flex; gap: 2px; }
.icon-btn { width: 32px; height: 32px; display: grid; place-items: center; background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 14px; }
.icon-btn:hover:not(:disabled) { color: var(--ink); }
.icon-btn:disabled { opacity: .3; cursor: default; }
.icon-btn.danger:hover:not(:disabled) { color: var(--s-red); }

/* --- sign in ------------------------------------------------------------ */

.gate { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.gate-art { padding: 48px 56px; background: var(--wash); box-shadow: inset -1px 0 0 var(--line); display: flex; flex-direction: column; justify-content: space-between; gap: 40px; }
.gate-art .display { font-size: 50px; letter-spacing: -1.2px; max-width: 540px; margin-top: 18px; }
.gate-art p { max-width: 460px; margin-top: 18px; color: var(--ink-2); font-size: 15px; }
.gate-steps { max-width: 480px; margin-top: 36px; box-shadow: inset 0 1px 0 var(--line-2); }
.gate-steps div { display: grid; grid-template-columns: 40px 1fr; padding: 12px 0; box-shadow: inset 0 -1px 0 var(--line-2); font-size: 13.5px; }
.gate-steps b { font-family: var(--display); font-weight: 600; color: var(--accent); }
.gate-form { display: grid; place-items: center; padding: 48px 24px; }
.gate-form form { width: min(380px, 100%); }
.gate-form h1 { font-family: var(--display); font-size: 34px; font-weight: 600; letter-spacing: -.6px; margin-top: 10px; }
.gate-form p { margin-top: 10px; color: var(--ink-2); }

/* --- responsive --------------------------------------------------------- */

@media (max-width: 1440px) {
  .main { padding: 32px 32px 64px; }
}

@media (max-width: 1180px) {
  .page { grid-template-columns: minmax(0, 1fr); }
  .aside { display: none; }
  .page.railed { grid-template-columns: minmax(0, 1fr) 44px; }
  .page.railed .aside { display: block; }
  .page.has-sel .aside {
    display: block;
    position: fixed;
    top: var(--top);
    right: 0;
    bottom: 0;
    width: min(var(--panel), 100%);
    height: auto;
    align-self: stretch; /* "start" would shrink the fixed panel to its content, so it couldn't scroll */
    z-index: 40;
    box-shadow: inset 1px 0 0 var(--line-2);
  }
  .page.dash .aside { display: block; position: static; height: auto; box-shadow: inset 0 1px 0 var(--line); }
}

@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .nav { position: static; height: auto; display: flex; gap: 4px; overflow-x: auto; padding: 8px 12px; box-shadow: inset 0 -1px 0 var(--line); }
  .nav-group, .nav-sep, .nav .folder { display: none; }
  .nav a { white-space: nowrap; flex: none; }
  .main { padding: 24px 16px 48px; }
  .head h1 { font-size: 30px; }
  .top { gap: 16px; padding: 0 16px; }
  .top-product, .top .demo-link { display: none; }
  .brand b { font-size: 17px; white-space: nowrap; }
  .top button.linklike { white-space: nowrap; }
  .rows-head { display: none; }
  .r { grid-template-columns: 36px minmax(0, 1fr) !important; }
  .r > :not(.num) { grid-column: 2; }
  .r > .l1 ~ .l1, .r > .l2 ~ .l2 { box-shadow: none; padding-top: 0; padding-bottom: 2px; }
  .r > .num { grid-column: 1; grid-row: 1 / 9; align-self: start; }
  .r > .t { padding-right: 0; }
  .page.railed { grid-template-columns: minmax(0, 1fr); }
  .page.railed .aside { display: none; }
  .sub { padding-left: 16px; }
  .sub-row { grid-template-columns: 1fr 1fr; }
  .grid2 { grid-template-columns: 1fr; }
  .gate { grid-template-columns: 1fr; }
  .gate-art { display: none; }
}

/* The trail, under each turn of a chat */
.trail-lines { display: flex; flex-direction: column; gap: 8px; padding: 8px 0 8px 12px; box-shadow: inset 2px 0 0 var(--line-2); font-size: 12.5px; overflow-wrap: anywhere; }
.trail-lines .tl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 8px; align-items: baseline; }
.trail-lines .tl-t { color: var(--ink-2); }
.trail-lines .tl-r { grid-column: 2; color: var(--muted); font-size: 11.5px; }
.trail-lines small { grid-column: 2 / -1; color: var(--muted); font-size: 12px; line-height: 1.45; }
