/* The look of the screens. A small design system: tokens first, then the parts built from them.
   docs/DESIGN.md explains the tokens, the parts and the page patterns. Use the tokens; do not add
   new colors, sizes or radii in a page rule. */

@font-face { font-family: "B612 Mono"; src: url("fonts/b612-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "B612 Mono"; src: url("fonts/b612-mono-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }

/* ================================================================ tokens */

:root {
  /* Surfaces */
  --page: #FFFFFF;          /* the main area */
  --side: #F7F7F8;          /* the sidebar */
  --raised: #FFFFFF;        /* panels and cards */
  --sunk: #F4F4F5;          /* board columns, quiet fills, table heads */
  --hover: #ECECEE;         /* a pill under the pointer */
  --pressed: #E4E4E7;       /* the current entry, an active tab */
  /* Text */
  --ink: #18181B;
  --ink-soft: #3F3F46;
  --muted: #6B6B74;
  --faint: #9C9CA5;
  /* Lines: few and light */
  --line: #E7E7EA;
  --line-strong: #D4D4D8;
  /* The one accent: links, focus, the chosen state */
  --accent: #2F5BD3;
  --accent-deep: #2448AE;
  --accent-soft: #EDF1FC;
  /* States */
  --ok: #157A4C;     --ok-soft: #EAF6EF;
  --bad: #B42318;    --bad-soft: #FDEEEC;
  --warn: #8A5A00;   --warn-soft: #FFF6E0;
  --amber: #F2B01E;  --amber-deep: #C98A00;      /* Confirm send, and the given code */
  /* Type */
  --text: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --code: "B612 Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --fs-xs: .78rem; --fs-sm: .87rem; --fs: 1rem; --fs-md: 1.07rem; --fs-lg: 1.25rem; --fs-xl: 1.6rem;
  /* Space */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  /* Shape */
  --r-sm: 6px; --r: 8px; --r-md: 10px; --r-lg: 12px; --r-pill: 999px;
  --shadow: 0 1px 2px rgba(16, 16, 20, .04);
  --shadow-pop: 0 12px 32px rgba(16, 16, 20, .12), 0 2px 6px rgba(16, 16, 20, .06);
  /* Frame */
  --side-w: 260px; --side-mini: 64px;
}

/* ================================================================ base */

* { box-sizing: border-box; }
html { font-size: 15px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font-family: var(--text); line-height: 1.5;
  font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
h1, h2, h3, p, ul, ol, dl, dd, figure, fieldset { margin: 0; padding: 0; }
ul, ol { list-style: none; }
fieldset { border: 0; min-width: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-deep); text-decoration: underline; text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-sm); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.break { overflow-wrap: anywhere; }
.js .js-hide { display: none; }
[hidden] { display: none !important; }
.ico { width: 18px; height: 18px; flex: 0 0 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
code { font-family: var(--code); font-size: .88em; background: var(--sunk); padding: 1px 5px; border-radius: var(--r-sm); }

/* ================================================================ the frame: sidebar and main area */

.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.mobilebar, .scrim, .icon-button.side-close { display: none; }

.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: var(--s2);
  background: var(--side); padding: var(--s2) var(--s2) var(--s3); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.side-top { display: flex; align-items: center; justify-content: flex-end; min-height: 40px; padding: 0 var(--s1); }

.icon-button { display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: var(--r);
  background: none; color: var(--muted); cursor: pointer; }
.icon-button:hover { background: var(--hover); color: var(--ink); }

/* The tree */
.tree ul ul { margin-top: 1px; }
.tree li + li { margin-top: 1px; }
.tree-item { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 0 10px; border-radius: var(--r);
  color: var(--ink-soft); font-size: .95rem; font-weight: 450; text-decoration: none; cursor: pointer; }
.tree-item:hover { background: var(--hover); color: var(--ink); text-decoration: none; }
.tree-item.is-current { background: var(--pressed); color: var(--ink); font-weight: 550; }
.tree-item .ico { color: var(--muted); }
.tree-item.is-current .ico, .tree-item:hover .ico { color: var(--ink); }
.tree-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-details > ul { padding-left: 14px; }
.tree-summary { list-style: none; user-select: none; }
.tree-summary::-webkit-details-marker { display: none; }
.chev { width: 14px; height: 14px; flex: 0 0 14px; fill: none; stroke: var(--faint); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s; }
.tree-details[open] > .tree-summary .chev { transform: rotate(90deg); }
.tree-section { margin: var(--s3) 0 var(--s2); }
.tree-heading { padding: 0 10px; margin: 0 0 2px; font-size: var(--fs-xs); font-weight: 600; color: var(--faint); letter-spacing: .02em; }
.tree-heading a { color: inherit; }
.tree-heading a:hover, .tree-heading a[aria-current] { color: var(--ink); text-decoration: none; }
.shortcuts .tree-item { font-size: .92rem; }
.tree-admin { margin-top: auto; padding-top: var(--s3); }
.tree-summary .count { margin-left: auto; }
.tree-details[open] > .tree-summary .count { display: none; }

/* Counts on menu entries and tabs */
.count { display: inline-block; min-width: 20px; padding: 1px 6px; border-radius: var(--r-pill); background: var(--amber); color: var(--ink);
  font-size: var(--fs-xs); font-weight: 650; line-height: 1.35; text-align: center; }
.count + .count { margin-left: -4px; }
.count.wait { background: var(--accent); color: #fff; }
.count.red { background: var(--bad); color: #fff; }

/* The person, at the foot of the sidebar */
.side-foot { display: flex; align-items: center; gap: 10px; padding: var(--s2) 6px 0; border-top: 1px solid var(--line); margin-top: var(--s2); }
.tree-admin + .side-foot { margin-top: var(--s2); }
.tree + .side-foot { margin-top: auto; }
.who-badge { width: 32px; height: 32px; flex: 0 0 32px; border-radius: 50%; background: var(--ink-soft); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: .9rem; }
.who-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.who-name { font-weight: 550; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-role { color: var(--muted); font-size: var(--fs-xs); }

/* Folded to icons (desktop only) */
@media (min-width: 801px) {
  .nav-mini .shell { grid-template-columns: var(--side-mini) minmax(0, 1fr); }
  .nav-mini .side { padding-left: 10px; padding-right: 10px; align-items: stretch; }
  .nav-mini .side-top { justify-content: center; padding: 0; }
  .nav-mini .tree-label, .nav-mini .tree-heading, .nav-mini .chev, .nav-mini .who-text, .nav-mini .tree-summary { display: none; }
  .nav-mini .tree-item { justify-content: center; padding: 0; position: relative; }
  .nav-mini .tree-details > ul { padding-left: 0; }
  .nav-mini .tree-section { margin: var(--s2) 0; padding-top: var(--s2); border-top: 1px solid var(--line); }
  .nav-mini .tree-item .count { position: absolute; top: 2px; right: 0; min-width: 8px; width: 8px; height: 8px; padding: 0; font-size: 0; }
  .nav-mini .tree-item .count + .count { display: none; }
  .nav-mini .side-foot { flex-direction: column; padding-left: 0; padding-right: 0; }
}

.main { min-width: 0; background: var(--page); }
main { padding: var(--s6) 40px 64px; max-width: 1600px; }
.main > .notice, .main > .given { margin: var(--s4) 40px 0; }

/* ================================================================ page head, bars and tabs */

.head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s4); margin-bottom: var(--s5); }
.head h1 { font-size: var(--fs-xl); font-weight: 650; line-height: 1.2; letter-spacing: -.012em; }
.head h1 .plate { font-size: 1.1rem; vertical-align: 3px; margin-right: 6px; }
.crumb { font-size: var(--fs-sm); margin-bottom: var(--s1); }
.crumb a { color: var(--muted); }
.sub { margin-top: 6px; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; row-gap: 4px; }
.sep { margin-left: 10px; padding-left: 10px; border-left: 1px solid var(--line-strong); }
.lede { color: var(--muted); max-width: 76ch; margin-bottom: var(--s4); }
.hint { color: var(--muted); font-size: var(--fs-sm); margin-top: var(--s1); }
.empty { color: var(--muted); padding: var(--s3) 0; }
.n { font-weight: 400; color: var(--muted); margin-left: 3px; }

.bar { display: flex; align-items: center; justify-content: space-between; gap: var(--s3) var(--s5); flex-wrap: wrap; margin-bottom: var(--s4); }
.bar .lede { margin-bottom: 0; }
.tabs { display: flex; flex-wrap: wrap; gap: 2px; }
.tabs a { display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border-radius: var(--r-pill); color: var(--muted); font-weight: 500; font-size: .94rem; }
.tabs a:hover { background: var(--hover); color: var(--ink); text-decoration: none; }
.tabs a[aria-current] { background: var(--pressed); color: var(--ink); }
.filter { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
.filter label { margin: 0; color: var(--muted); font-size: var(--fs-sm); font-weight: 500; }
.filter select { width: auto; max-width: 240px; padding: 5px 10px; }
.filter input[type="date"] { width: auto; padding: 4px 8px; }
.filter.dates { margin: -6px 0 var(--s4); gap: var(--s2) var(--s2); }
.filter .pair { display: inline-flex; align-items: center; gap: var(--s2); margin-right: var(--s2); }
.dates-note { margin: -8px 0 var(--s3); }

/* ================================================================ buttons */

.button, button { font: inherit; cursor: pointer; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 0 16px;
  border: 1px solid var(--ink); border-radius: var(--r-md); background: var(--ink); color: #fff; font-weight: 550; text-decoration: none; white-space: nowrap; }
.button:hover { background: #2E2E33; border-color: #2E2E33; color: #fff; text-decoration: none; }
.button.second { background: var(--sunk); border-color: var(--sunk); color: var(--ink); }
.button.second:hover { background: var(--pressed); border-color: var(--pressed); color: var(--ink); }
.button.small { min-height: 30px; padding: 0 12px; font-size: var(--fs-sm); }
.button.wide { display: flex; width: 100%; min-height: 42px; }
.button.danger { background: var(--bad); border-color: var(--bad); }
.button.danger:hover { background: #8F1C13; border-color: #8F1C13; }
.button.off-button { background: var(--raised); color: var(--bad); border-color: #F1C9C4; }
.button.off-button:hover { background: var(--bad-soft); color: #8F1C13; border-color: var(--bad); }
.button:disabled, .button:disabled:hover { background: var(--pressed); border-color: var(--pressed); color: var(--faint); cursor: not-allowed; }
/* The first click of a send: the button turns amber and reads Confirm send. */
.button.armed, .button.armed:hover { background: var(--amber); border-color: var(--amber-deep); color: var(--ink); box-shadow: 0 0 0 3px rgba(242, 176, 30, .35); }
.quiet, .as-link, button.link { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; }
.quiet:hover, .as-link:hover, button.link:hover { color: var(--accent-deep); text-decoration: underline; text-underline-offset: 2px; }

/* ================================================================ forms */

label, legend { display: block; font-size: .9rem; font-weight: 550; margin: var(--s4) 0 6px; color: var(--ink); }
input[type="text"], input[type="email"], input[type="search"], input[type="date"], input[type="number"], input[type="file"], input[type="password"], input[type="url"], input:not([type]), select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--raised); border: 1px solid var(--line-strong); border-radius: var(--r); padding: 8px 12px; }
input:hover, select:hover, textarea:hover { border-color: #BDBDC4; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type="file"] { padding: 6px; background: var(--sunk); }
textarea { resize: vertical; min-height: 72px; }
input:disabled { background: var(--sunk); color: var(--muted); }
input::placeholder, textarea::placeholder { color: var(--faint); }
.short { width: 72px !important; text-transform: uppercase; }
.form { max-width: 580px; }
.wide-form { max-width: 760px; }
.form > label:first-of-type, .stack > label:first-of-type { margin-top: 0; }
.stack > .button, .stack > button { margin-top: var(--s4); }
.stack fieldset + label { margin-top: 18px; }
.inline { display: flex; gap: var(--s2); align-items: center; margin-top: 10px; }
.actions { display: flex; gap: var(--s4); align-items: center; margin-top: var(--s5); }
.row { display: flex; gap: var(--s4); align-items: center; justify-content: flex-end; margin-top: var(--s2); flex-wrap: wrap; }
.row.start { justify-content: flex-start; gap: 10px; }
.choice { display: flex; gap: var(--s2); align-items: baseline; font-weight: 400; font-size: var(--fs); margin: var(--s2) 0 0; cursor: pointer; }
.row .choice { margin: 0; }
.choice.wrap { padding: 8px 0; border-bottom: 1px solid var(--line); }
.choice input { flex: none; accent-color: var(--accent); }
.note-form textarea { display: block; }
.group { background: var(--raised); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s1) var(--s5) var(--s5); margin-bottom: var(--s4); }
.group legend { font-size: var(--fs-md); font-weight: 650; padding: 0 6px; margin: var(--s3) 0 0 -6px; }
.group > label:first-of-type { margin-top: var(--s1); }
.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--s4); }
.toggle input { width: 18px; height: 18px; accent-color: var(--accent); }

.picker { position: relative; }
.picker-list { position: absolute; z-index: 5; left: 0; right: 0; margin-top: 4px; background: var(--raised); border: 1px solid var(--line);
  border-radius: var(--r-md); box-shadow: var(--shadow-pop); max-height: 260px; overflow-y: auto; padding: 4px; }
.picker-list button { display: block; width: 100%; text-align: left; background: none; border: 0; border-radius: var(--r-sm); padding: 8px 10px; white-space: pre-wrap; color: var(--ink); }
.picker-list button:hover, .picker-list button:focus { background: var(--hover); }
.picker-list .empty { padding: 8px 10px; }
.preview { min-height: 1.6rem; margin-top: var(--s2); font-size: .95rem; }
.preview ul { margin: 4px 0 0; }
.preview li { padding: 2px 0; }

.letters { display: flex; flex-wrap: wrap; gap: 2px; margin-bottom: var(--s4); }
.letters a { width: 30px; height: 30px; display: grid; place-items: center; font-family: var(--code); font-size: .88rem; color: var(--ink-soft); border-radius: var(--r); }
.letters a:hover { background: var(--hover); text-decoration: none; color: var(--ink); }
.letters a[aria-current] { background: var(--ink); color: #fff; }

/* ================================================================ tables */

.grid { width: 100%; border-collapse: collapse; background: var(--raised); }
.grid th { text-align: left; font-size: var(--fs-sm); font-weight: 550; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.grid td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
/* A word is never cut. Long text wraps between words; years, codes, kinds, dates, amounts and names stay on one line. */
.grid td { overflow-wrap: normal; word-break: normal; }
.grid tbody tr:hover td { background: #FAFAFB; }
.grid tr:last-child td { border-bottom: 0; }
.grid .num { text-align: right; }
.grid .nowrap, .grid .num { white-space: nowrap; }
.grid td.grow, .grid th.grow { min-width: 11rem; }
.grid td.sorted { min-width: 9rem; }
.grid td.what { min-width: 8rem; }
.grid td.person { min-width: 12rem; }
.grid td.empty { padding: var(--s4) 12px; }
.grid .bad { color: var(--bad); font-weight: 600; }
.grid tr.refused td { color: var(--muted); }
.grid.tight th { padding: 4px 10px 6px 0; }
.grid.tight td { padding: 8px 10px 8px 0; }
.grid.tight tbody tr:hover td { background: none; }
.grid.tight td.empty { padding-left: 0; }
.grid.narrow { width: auto; min-width: 320px; }
.clip { max-width: 46ch; }
.th-sub { font-weight: 400; font-size: var(--fs-xs); }
.keys-col { white-space: nowrap; width: 1%; }
/* Emails and addresses: whole on a wide screen, cut anywhere on a phone so they never widen the page. */
.wrap-any, .grid td.wrap-any { overflow-wrap: break-word; }
/* A table wider than its box scrolls sideways inside it; the page itself never does. */
.scroll-x { position: relative; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.scroll-x > .grid { min-width: 100%; }
.scroll-x.more-right { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent); }
.scroll-x.more-left { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(to left, #000 calc(100% - 32px), transparent); }
.scroll-x.more-left.more-right { -webkit-mask-image: linear-gradient(to right, transparent, #000 32px, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(to right, transparent, #000 32px, #000 calc(100% - 48px), transparent); }

/* ================================================================ panels, facts, timeline */

.panel { background: var(--raised); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px var(--s5) var(--s5); margin-bottom: var(--s4); box-shadow: var(--shadow); }
.panel h2 { font-size: var(--fs-md); font-weight: 650; margin-bottom: var(--s3); }
.panel h3 { font-size: .95rem; font-weight: 650; margin: var(--s4) 0 6px; }
.panel > p + p, .panel > p + form, .panel > ul + form, .panel > p + ul { margin-top: var(--s2); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--s5); align-items: start; }
.split-even { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); align-items: start; }
.prose { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 78ch; }
.plain li { padding: 3px 0; overflow-wrap: anywhere; }
.people li { padding: 10px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.people li:last-child { border-bottom: 0; }
.facts { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 8px var(--s4); }
.facts dt { color: var(--muted); }
.facts dd { min-width: 0; overflow-wrap: anywhere; }
.facts dd:empty::after { content: "Not given"; color: var(--faint); }
details { margin-top: 10px; }
summary { cursor: pointer; color: var(--accent); font-weight: 550; }
.tree details { margin: 0; }
.tree summary { color: var(--ink-soft); font-weight: 450; }

.timeline { margin-top: var(--s4); }
.entry { padding: 10px 0 10px 14px; border-left: 2px solid var(--line); margin-bottom: var(--s2); }
.entry-negotiation { border-left-color: var(--amber); }
.entry-system { color: var(--muted); }
.entry-head { font-size: var(--fs-sm); color: var(--muted); margin-bottom: 3px; display: flex; flex-wrap: wrap; align-items: center; row-gap: 3px; }
.entry-head .tag { margin-left: 10px; }
.changes li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.changes li:last-child { border-bottom: 0; }
.rules li { padding: 2px 0; }

/* ================================================================ tags and notices */

.tag { display: inline-block; padding: 3px 9px; border-radius: var(--r-pill); background: var(--sunk); color: var(--ink-soft);
  font-size: var(--fs-xs); font-weight: 600; line-height: 1.3; white-space: nowrap; }
a.tag { text-decoration: none; }
a.tag:hover { background: var(--pressed); }
.tag-customer, .tag.agent-replied { background: var(--ok-soft); color: var(--ok); }
.tag-existing, .tag.agent-waiting { background: var(--accent-soft); color: var(--accent); }
.tag-unsure, .tag.agent-held { background: var(--warn-soft); color: var(--warn); }
.tag-supplier { background: var(--sunk); color: var(--ink); }
.tag-spam, .tag-phishing, .tag-flag, .tag.agent-uncertain, .tag.agent-failed, .tag.agent-spam { background: var(--bad-soft); color: var(--bad); }
.tag.agent { color: var(--muted); }
.tag.rule-tag { background: none; padding-left: 4px; padding-right: 4px; color: var(--muted); font-weight: 500; white-space: normal; overflow-wrap: anywhere; }
.sub.rule-line { margin-top: 2px; }

/* A lead that looks like spam or phishing: a banner under the head with the one click to dismiss it. */
.junk { display: flex; align-items: center; justify-content: space-between; gap: var(--s3) var(--s5); flex-wrap: wrap;
  margin: calc(-1 * var(--s2)) 0 var(--s5); padding: var(--s4) var(--s5); border-radius: var(--r-lg);
  background: var(--warn-soft); box-shadow: inset 4px 0 0 var(--amber); color: var(--ink); }
.junk-text { flex: 1 1 320px; min-width: 0; }
.junk h2 { font-size: var(--fs-md); font-weight: 650; color: var(--ink); }
.junk p { margin-top: 2px; color: var(--ink-soft); overflow-wrap: anywhere; }
/* The rules flagged it, the lead agent verified it: a quiet notice with a plain button. */
.junk.soft { padding: var(--s3) var(--s4); background: var(--sunk); box-shadow: inset 3px 0 0 var(--line-strong); }
.junk.soft .junk-text { margin: 0; color: var(--ink-soft); }
.junk.soft .button.second { background: var(--raised); border-color: var(--line-strong); }   /* visible against the gray notice */
.button.bright, .button.bright:hover { background: var(--amber); border-color: var(--amber-deep); color: var(--ink); }
.button.bright { min-height: 42px; padding: 0 20px; box-shadow: 0 0 0 3px rgba(242, 176, 30, .35); }
.button.bright:hover { background: var(--amber-deep); }

.notice { padding: 12px var(--s4); border-radius: var(--r-md); background: var(--ok-soft); color: #0F5136; max-width: 90ch; }
.notice.error { background: var(--bad-soft); color: #8F1C13; }
.notice.warn { background: var(--warn-soft); color: #6B4700; }
.notice a { color: inherit; text-decoration: underline; }
main .notice, .alone .notice { margin: 0 0 var(--s4); }
.notice.inside { margin: 0 0 var(--s3); max-width: none; }
.alert { background: var(--raised); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px var(--s5); margin-bottom: var(--s5); max-width: 900px; box-shadow: inset 4px 0 0 var(--amber); }
.alert h2 { font-size: var(--fs-md); font-weight: 650; margin-bottom: var(--s2); }
.alert p { margin-top: 10px; max-width: 76ch; }
.alert .num { text-align: right; }

/* A page that is being built */
.soon { max-width: 560px; padding: var(--s6) var(--s6); background: var(--sunk); border-radius: var(--r-lg); }
.soon-title { font-size: var(--fs-lg); font-weight: 650; margin-bottom: 6px; }
.soon p + p { color: var(--muted); }

/* ================================================================ the code plate and copying */

.plate { display: inline-block; font-family: var(--code); font-size: .84rem; line-height: 1; color: var(--ink); background: var(--sunk);
  border: 1px solid var(--line-strong); border-radius: var(--r-sm); white-space: nowrap; vertical-align: 1px; overflow: hidden; }
.plate span { display: inline-block; padding: 4px 5px 3px; }
.plate span + span { border-left: 1px solid var(--line-strong); font-weight: 700; background: var(--raised); }
a .plate { color: var(--ink); }
a:hover .plate { border-color: var(--accent); }
.plate-big { font-size: 2rem; border-width: 1px; border-left: 6px solid var(--amber); border-radius: var(--r); }
.plate-big span { padding: 10px 12px 8px; }
.plates { line-height: 2.1; }
.code-pair { white-space: nowrap; }
.copy-code { position: relative; display: inline-grid; place-items: center; width: 26px; height: 26px; margin: 0 0 0 3px; padding: 0; vertical-align: middle;
  background: none; border: 0; border-radius: var(--r-sm); color: var(--muted); cursor: pointer; }
.copy-code svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.copy-code:hover, .copy-code:focus-visible { color: var(--ink); background: var(--hover); }
.copy-code.copied { color: var(--ok); }
.copy-code.copied::after { content: "Copied"; position: absolute; left: calc(100% + 4px); top: 50%; transform: translateY(-50%); z-index: 2; padding: 3px 8px;
  font: 600 .75rem/1.2 var(--text); color: #fff; background: var(--ink); border-radius: var(--r-sm); white-space: nowrap; pointer-events: none; }
.head h1 .copy-code { vertical-align: 4px; }
.plate-big + .copy-code { vertical-align: 10px; margin-left: 8px; }

/* A code just given, or a deal just registered */
.given { display: flex; align-items: center; gap: var(--s5); background: var(--raised); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px var(--s5); box-shadow: var(--shadow); }
.given p { font-size: var(--fs-md); max-width: 70ch; }
.given .quiet { margin-top: 6px; }
.given.done { background: var(--ok-soft); border-color: transparent; box-shadow: none; }
.done-mark { width: 30px; height: 30px; flex: 0 0 30px; fill: none; stroke: var(--ok); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.done-title { font-weight: 650; }
.given.done p + p { margin-top: 2px; }

/* Contact details once opened */
.reveal a { overflow-wrap: anywhere; }
.reveal .left { color: var(--muted); font-size: var(--fs-sm); margin-left: 6px; white-space: nowrap; }

/* ================================================================ the deal board */

.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); gap: 10px; overflow-x: auto; padding-bottom: var(--s3); align-items: start; scrollbar-width: thin; }
.col { background: var(--sunk); border-radius: var(--r-lg); padding: 0 6px 6px; min-height: 120px; }
.col header { padding: 12px 8px 10px; }
.col h2 { font-size: .92rem; font-weight: 650; line-height: 1.25; }
.col header p { font-size: var(--fs-xs); color: var(--muted); margin-top: 2px; }
.col ol { display: grid; gap: 6px; }
.col.over { outline: 2px dashed var(--accent); outline-offset: -2px; }
.card { background: var(--raised); border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px; box-shadow: var(--shadow); }
.card[draggable="true"] { cursor: grab; }
.card:hover { border-color: var(--line-strong); }
.card.dragging { opacity: .45; }
.card a { display: block; color: var(--ink); text-decoration: none; }
.card a:hover .card-name { color: var(--accent); }
.card-name { display: block; font-weight: 550; font-size: .93rem; line-height: 1.3; margin-top: 4px; overflow-wrap: anywhere; }
.card .plate + .card-name { margin-top: 6px; }
.card-who { font-size: var(--fs-sm); color: var(--muted); margin-top: 3px; overflow-wrap: anywhere; }
.card-foot { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: var(--fs-xs); color: var(--muted); margin-top: 6px; }
.card-foot span:first-child { color: var(--ink); font-weight: 600; }
.card-foot span:empty { display: none; }
.board.more-right { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 64px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 64px), transparent); }
.board.more-left { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to left, #000 calc(100% - 40px), transparent); }
.board.more-left.more-right { -webkit-mask-image: linear-gradient(to right, transparent, #000 40px, #000 calc(100% - 64px), transparent); mask-image: linear-gradient(to right, transparent, #000 40px, #000 calc(100% - 64px), transparent); }
.board-hint { display: flex; justify-content: flex-end; margin: -10px 0 6px; }
.board-hint button { display: inline-flex; align-items: center; gap: 4px; background: none; border: 0; padding: 2px 0; color: var(--muted); font-size: var(--fs-sm); cursor: pointer; }
.board-hint button:hover { color: var(--ink); }
.board-hint svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.col-drops { display: grid; gap: 10px; }
.col-drop { display: none; min-height: 96px; background: transparent; border: 1px dashed var(--line-strong); }
.js .col-drop { display: block; }
.col-drop p { font-size: var(--fs-xs); color: var(--muted); padding: 0 8px 8px; }
.col-drop-won h2 { color: var(--ok); }
.col-drop-lost h2 { color: var(--bad); }

/* ================================================================ a deal: stage bar and closing */

.stagebar { display: flex; gap: 10px; align-items: stretch; margin: 0 0 var(--s5); }
.steps { display: flex; flex: 1 1 auto; min-width: 0; gap: 3px; }
.steps li { flex: 1 1 0; min-width: 0; display: flex; }
.steps-close { flex: 0 0 auto; gap: 6px; }
.steps-close li { flex: 0 0 auto; }
.step { flex: 1; display: flex; align-items: center; justify-content: center; text-align: center; min-height: 44px; padding: 5px 8px;
  font: inherit; font-size: var(--fs-xs); font-weight: 500; line-height: 1.2; color: var(--ink-soft); background: var(--sunk); border: 0; border-radius: var(--r); overflow-wrap: anywhere; }
.steps-close .step { padding: 5px 14px; min-width: 104px; }
button.step { cursor: pointer; }
button.step:hover { background: var(--pressed); color: var(--ink); }
.step-done { background: var(--accent-soft); color: var(--accent-deep); }
.step-now { background: var(--accent); color: #fff; font-weight: 650; }
.step-won:not(.step-now) { color: var(--ok); }
.step-lost:not(.step-now) { color: var(--bad); }
.step-now.step-won { background: var(--ok); color: #fff; }
.step-now.step-lost { background: var(--bad); color: #fff; }
.step[aria-pressed="true"] { background: var(--warn-soft); box-shadow: inset 0 0 0 1px var(--amber); }
.close-box { background: var(--warn-soft); border-radius: var(--r-lg); padding: var(--s3) var(--s4) 14px; margin: -8px 0 var(--s5); max-width: 760px; }
.close-box form { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) 14px; }
.close-box label { flex-basis: 100%; margin: 0; }
.close-box input { flex: 1 1 280px; width: auto; }
.give-to { margin-bottom: 14px; }
.give-to legend { margin-top: 0; }
.give-to .muted { font-size: var(--fs-sm); }
.import-sum { display: flex; flex-wrap: wrap; gap: var(--s2) 28px; margin: 4px 0 var(--s3); }
.import-sum dt { font-size: var(--fs-xs); color: var(--muted); }
.import-sum dd { font-size: 1.35rem; font-weight: 650; }

/* ================================================================ the dashboard */

.today { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); align-items: start; max-width: 1200px; }
.today .panel { margin: 0; }
.today-wide { grid-column: 1 / -1; }
.part-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s2); }
.part-head h2 { margin: 0; }
.part-head a { font-size: var(--fs-sm); white-space: nowrap; }
.part-list > li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px var(--s3); padding: 10px 0; border-bottom: 1px solid var(--line); }
.part-list > li:last-child { border-bottom: 0; }
.part-list > li > a { flex: 1 1 260px; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px var(--s2); color: var(--ink); }
.part-list > li > a:hover { text-decoration: none; }
.part-list > li > a:hover .part-main { color: var(--accent); }
.part-main { font-weight: 550; overflow-wrap: anywhere; }
.part-sub { color: var(--muted); font-size: var(--fs-sm); overflow-wrap: anywhere; }
.part-meta { display: flex; align-items: center; gap: var(--s2); }
.part-when { color: var(--muted); font-size: var(--fs-sm); white-space: nowrap; }
.part-note { flex-basis: 100%; color: var(--muted); font-size: var(--fs-sm); overflow-wrap: anywhere; }
.soon-part .soon-title { font-size: var(--fs); }

/* ================================================================ lookup and its live list */

.lookup-box { display: flex; gap: var(--s2); max-width: 760px; margin-bottom: var(--s4); }
.find-box { position: relative; flex: 1; }
.find-ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--faint); pointer-events: none; }
.lookup-box input[type="search"] { height: 46px; font-size: var(--fs-md); padding: 0 16px 0 42px; border-radius: var(--r-lg); }
.lookup-box .button { min-height: 46px; border-radius: var(--r-lg); padding: 0 20px; }
.find-list { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 6px); margin: 0; padding: 4px; background: var(--raised); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-pop); max-height: min(60vh, 560px); overflow-y: auto; overscroll-behavior: contain; scroll-padding: 0 0 40px; }
.find-list li a { display: flex; gap: 10px; align-items: center; padding: 8px 10px; color: inherit; text-decoration: none; border-radius: var(--r); }
.find-list li a[aria-selected="true"], .find-list li a:hover { background: var(--hover); }
.find-list .find-group { padding: 8px 10px 4px; font-size: var(--fs-xs); font-weight: 600; color: var(--faint); }
.find-list .label { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.find-list .label .name { overflow-wrap: anywhere; color: var(--ink); }
.find-list .label .note { font-size: var(--fs-xs); color: var(--muted); }
.find-list .sub { flex: 0 1 auto; max-width: 45%; overflow: hidden; text-overflow: ellipsis; margin: 0; text-align: right; color: var(--muted); font-size: var(--fs-sm); white-space: nowrap; }
.find-list .find-foot { position: sticky; bottom: -4px; background: var(--raised); border-top: 1px solid var(--line); margin-top: 4px; }
.find-list .find-foot a { display: block; padding: 8px 10px; font-size: var(--fs-sm); color: var(--muted); }
.find-list .find-foot a:hover { color: var(--ink); }
.find-list .empty { padding: 10px; }
.found-jump { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: -4px 0 14px; font-size: .9rem; }
.found { scroll-margin-top: 24px; }
.found .yr, .found .grid td:first-child, .found .grid td.yr { white-space: nowrap; }

/* ================================================================ people, activity, log */

.invite { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; margin: var(--s3) 0 var(--s4); }
.invite input { flex: 1; min-width: 220px; }
.invite input[type="email"] { width: auto; flex: 1; }
.invite select { width: auto; flex: 0 0 180px; }
.invite .invite-outside { flex: 1 0 100%; order: 3; margin: 0; font-size: .93rem; align-items: center; justify-content: flex-start; }
.invite .invite-outside input { flex: none; min-width: 0; width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.users th.perm, .users td.perm { text-align: center; width: 92px; font-size: var(--fs-sm); }
.users tr.waiting td { background: var(--warn-soft); }
.user-actions { white-space: nowrap; }
.user-actions form { display: inline-block; margin-right: var(--s2); }
.users-off { background: var(--sunk); box-shadow: none; }
.users-off .grid { background: transparent; }
.grid.activity td { vertical-align: middle; }
.grid.activity td:first-child { min-width: 140px; }
.grid.activity tr.flagged td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
.grid.activity tr.off td, .users-off td { color: var(--muted); }
.grid.activity tr.off a, .users-off strong { color: var(--muted); }
.flag-first { font-size: var(--fs-sm); }
.confirm { max-width: 640px; }
.confirm h2 { margin-bottom: 0; }
.confirm > p + p { margin-top: var(--s3); }
.flags-panel h2 { display: flex; align-items: center; gap: var(--s2); }
.flag-list li { display: flex; align-items: center; gap: var(--s3); padding: 10px 0; border-bottom: 1px solid var(--line); }
.flag-list li:last-child { border-bottom: 0; }
.flag-list .tag { flex: 0 0 auto; }
.flag-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.flag-list li.closed { color: var(--muted); }
.flag-list li.closed .tag { color: var(--muted); background: var(--sunk); }

.figures { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-bottom: var(--s1); }
.figures div { background: var(--sunk); border-radius: var(--r-lg); padding: 12px var(--s4); }
.figures dt { font-size: var(--fs-xs); color: var(--muted); }
.figures dd { font-size: 1.45rem; font-weight: 650; line-height: 1.25; }
.figures dd span { font-size: var(--fs-sm); font-weight: 400; color: var(--muted); }
.figures-note { margin-bottom: var(--s4); }

.bars { display: grid; grid-template-columns: repeat(30, minmax(0, 1fr)); gap: 3px; align-items: end; height: 150px; padding-bottom: 22px; position: relative; border-bottom: 1px solid var(--line); }
.bar-day { position: relative; height: 128px; display: flex; align-items: flex-end; }
.bar-fill { display: block; width: 100%; background: var(--accent); border-radius: 3px 3px 0 0; position: relative; min-height: 0; }
.bar-fill.h0 { height: 0; }
.bar-mark { position: absolute; left: 0; right: 0; top: -7px; height: 4px; background: var(--amber); border-radius: 2px; }
.bar-fill.h0 .bar-mark { top: -4px; }
.bar-label { position: absolute; top: 100%; left: 0; margin-top: 6px; font-size: .74rem; color: var(--muted); white-space: nowrap; }
.key-fill, .key-mark { display: inline-block; width: 12px; height: 10px; background: var(--accent); border-radius: 2px; vertical-align: -1px; margin-left: 6px; }
.key-fill { margin-left: 0; }
.key-mark { height: 4px; background: var(--amber); vertical-align: 2px; }
.bar-fill.h1 { height: 5%; } .bar-fill.h2 { height: 10%; } .bar-fill.h3 { height: 15%; } .bar-fill.h4 { height: 20%; }
.bar-fill.h5 { height: 25%; } .bar-fill.h6 { height: 30%; } .bar-fill.h7 { height: 35%; } .bar-fill.h8 { height: 40%; }
.bar-fill.h9 { height: 45%; } .bar-fill.h10 { height: 50%; } .bar-fill.h11 { height: 55%; } .bar-fill.h12 { height: 60%; }
.bar-fill.h13 { height: 65%; } .bar-fill.h14 { height: 70%; } .bar-fill.h15 { height: 75%; } .bar-fill.h16 { height: 80%; }
.bar-fill.h17 { height: 85%; } .bar-fill.h18 { height: 90%; } .bar-fill.h19 { height: 95%; } .bar-fill.h20 { height: 100%; }

/* Daily activity: the hours of one day, a 7 day trend in a table cell, sortable headings. */
.bars.hours { grid-template-columns: repeat(24, minmax(0, 1fr)); }
.trend { display: inline-flex; align-items: flex-end; gap: 2px; height: 22px; vertical-align: middle; }
.trend-day { display: flex; align-items: flex-end; width: 7px; height: 100%; background: var(--sunk); border-radius: 2px; }
.trend-day .bar-fill { border-radius: 2px; }
.sort-link { color: inherit; white-space: nowrap; }
.sort-link:hover { color: var(--ink); }
.sort-link.on { color: var(--ink); }
.sort-mark { font-size: var(--fs-xs); }
.grid.daily td:first-child { min-width: 140px; }
.grid.daily tfoot td { border-top: 1px solid var(--line-strong); border-bottom: 0; font-weight: 600; }
.grid.daily tr.off td, .grid.daily tr.off a { color: var(--muted); }
.head-actions { display: flex; flex-wrap: wrap; gap: var(--s2); }
.user-actions .remove-link { display: block; margin-top: 6px; font-size: var(--fs-sm); color: var(--bad); }

.log-filter { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; margin-bottom: 14px; }
.log-filter label { margin: 0 0 4px; font-size: var(--fs-sm); }
.log-filter select { width: auto; min-width: 180px; max-width: 260px; }
.log-filter input[type="date"] { width: auto; padding: 6px 10px; }
.log-filter-go { display: flex; align-items: center; gap: 14px; }
.grid.log td { font-size: .93rem; }
.grid.log td:nth-child(2), .grid.log td:nth-child(3) { min-width: 130px; }
.pages { display: flex; align-items: center; gap: 14px; margin-top: 14px; }

/* ================================================================ the lead agent */

.reply-form .facts { margin-bottom: 4px; }
.reply-text { margin-top: var(--s3); padding: var(--s3) 14px; background: var(--sunk); border-radius: var(--r-md); }
.preview-frame { display: block; width: 100%; min-height: 420px; border: 1px solid var(--line); border-radius: var(--r-md); background: #fff; }

/* ================================================================ quotes: the budget and the price by version */

.budget input.amount { width: 9.5rem; text-align: right; }
.budget input.pct { width: 5.5rem; text-align: right; }
.budget td input { padding-top: 5px; padding-bottom: 5px; }
.budget td.grow input { min-width: 12rem; }
.budget td label { margin: 0; font-weight: 400; }
.budget tr.sum td { font-weight: 600; background: var(--sunk); }
.budget tr.total td { font-size: var(--fs-md); }
.qbars { display: flex; gap: var(--s3); align-items: flex-end; height: 150px; padding-bottom: 22px; margin-bottom: var(--s4);
  border-bottom: 1px solid var(--line); max-width: 560px; }
.qbars .bar-day { flex: 1 1 0; max-width: 56px; }
.bar-fill.qdraft { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.quote-brief + .quote-brief { margin-top: var(--s4); padding-top: var(--s4); border-top: 1px solid var(--line); }
.quote-brief .sub { margin: 2px 0 var(--s2); }
.qactions { flex-wrap: wrap; }
input.qcode { width: 8rem; text-transform: uppercase; }
@media (max-width: 620px) {
  .budget td.nowrap { white-space: normal; min-width: 8rem; }
  .budget input.amount { width: 7.5rem; }
  .budget td.grow input { min-width: 10rem; }
}

/* ================================================================ signed out: sign in, codes */

.alone { min-height: 100vh; display: grid; place-content: start center; padding: 14vh 16px 40px; background: var(--side); }
.door { width: min(380px, 92vw); background: var(--raised); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s6) 30px; box-shadow: var(--shadow-pop); }
.door-org { color: var(--muted); font-size: .9rem; }
.door h1 { font-size: 1.75rem; font-weight: 650; line-height: 1.15; letter-spacing: -.012em; }
.door-what { color: var(--muted); margin: 6px 0 var(--s5); }
.door .stack { margin-top: 22px; }
.door .hint { margin-top: 10px; }
.door button.button.wide { width: 100%; }
.door-gap { margin-top: var(--s3); }
.door-back { margin-top: 18px; }
.door .door-logged { margin-top: var(--s5); padding-top: var(--s3); border-top: 1px solid var(--line); }
.door-again { margin-top: 14px; }
.door-again .hint, .door-again .quiet { font-size: var(--fs-sm); }
.alone .notice { width: min(380px, 92vw); }
.code-entry { font-family: var(--code); font-size: 1.5rem; letter-spacing: .3em; text-align: center; }
.devices { margin-top: 10px; }
.devices-all { margin-top: var(--s3); }

/* ================================================================ admin: AI vendors, agents, limits, prompts */

.ai-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--s4); align-items: start; }
.ai-cards .form, .ai-agent .stack { max-width: none; }
.ai-agent { margin-top: var(--s3); }
.ai-cards .facts + form, .ai-cards .notice + form { margin-top: var(--s4); }
.ai-prices li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px var(--s3); border-bottom: 1px solid var(--line); padding: 6px 0; }
.ai-prices li:last-child { border-bottom: 0; }
.ai-row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); }
.ai-editor textarea { font-family: var(--code); font-size: var(--fs-sm); line-height: 1.5; min-height: 320px; }
.ai-compare { margin-bottom: var(--s4); }
.ai-gap { margin-top: var(--s4); }
.diff { width: 100%; border-collapse: collapse; font-family: var(--code); font-size: var(--fs-sm); }
.diff td { padding: 1px var(--s2); vertical-align: top; }
.diff-n { width: 1%; color: var(--faint); text-align: right; white-space: nowrap; user-select: none; }
.diff-text { white-space: pre-wrap; overflow-wrap: anywhere; min-width: 16rem; }
.diff-add td { background: var(--ok-soft); }
.diff-del td { background: var(--bad-soft); }
.diff-del .diff-text { text-decoration: line-through; text-decoration-color: var(--faint); }
.diff-gap td { color: var(--muted); background: var(--sunk); font-family: var(--text); padding: var(--s1) var(--s2); }
@media (max-width: 1100px) { .ai-cards { grid-template-columns: minmax(0, 1fr); } }

/* ================================================================ admin: costs */

.tag-credits { background: var(--ok-soft); color: var(--ok); }
.cost-facts { grid-template-columns: 120px minmax(0, 1fr); }
.cost-lines td { min-width: 7rem; }
.cost-lines td.grow { min-width: 11rem; }
.cost-lines tfoot th { color: var(--ink); font-weight: 650; border-bottom: 0; border-top: 1px solid var(--line-strong); white-space: normal; }
.cost-vendor { border-top: 1px solid var(--line); padding-top: var(--s3); margin-top: var(--s3); }
.cost-vendor h3 { margin-top: 0; }
.cost-vendor > p { margin-bottom: 6px; }
.cost-vendor .facts { margin: var(--s3) 0; }
@media (max-width: 620px) { .cost-facts { grid-template-columns: minmax(0, 1fr); gap: 2px; } .cost-facts dd { margin-bottom: var(--s2); } }
/* Private Context: entries, suggestions, and how agents work */
.ctx-suggestion { border-top: 1px solid var(--line); padding: var(--s4) 0; }
.ctx-suggestion:first-of-type { border-top: 0; padding-top: var(--s2); }
.ctx-suggestion h3 { margin: 0 0 var(--s1); }
.ctx-text { margin: var(--s3) 0; overflow-wrap: anywhere; }
.ctx-source, .ctx-suggestion h3, .ctx-entry-head h1, .ctx-entry-head .sub { overflow-wrap: anywhere; min-width: 0; }
.ctx-entry-head > div { min-width: 0; }
.ctx-inline { margin-top: var(--s2); }
.ctx-form, .ctx-suggestion .stack { max-width: 720px; }
.ctx-agents { border: 0; padding: 0; margin: 18px 0 0; min-width: 0; }
.ctx-agents legend { font-weight: 600; padding: 0; }
.ctx-agents .choice span { overflow-wrap: anywhere; }
.ctx-list li { border-bottom: 1px solid var(--line); padding: 6px 0; }
.ctx-list li:last-child { border-bottom: 0; }
.ctx-facts { grid-template-columns: 110px minmax(0, 1fr); }
.ctx-prompt-text { font-family: var(--code); font-size: var(--fs-sm); line-height: 1.5; background: var(--sunk); border-radius: var(--r); padding: var(--s3); max-width: none; max-height: 480px; overflow: auto; }
.ctx-version { border-top: 1px solid var(--line); padding-top: var(--s2); }
.ctx-version summary { cursor: pointer; }

/* ================================================================ motion */

@media (prefers-reduced-motion: no-preference) {
  .tree-item, .tabs a, .button, .card, .letters a, .icon-button { transition: background-color .12s, border-color .12s, color .12s; }
  .side { transition: transform .2s ease, visibility .2s; }
}

/* ================================================================ narrower screens */

@media (max-width: 1100px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .split-even, .today { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 620px) { .cols { grid-template-columns: minmax(0, 1fr); } }

/* Phones: the sidebar is a drawer, opened from the bar at the top. */
@media (max-width: 800px) {
  .shell { display: block; }
  .mobilebar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: var(--s2); height: 52px; padding: 0 var(--s2);
    background: rgba(255, 255, 255, .92); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
  .mobilebar .icon-button { color: var(--ink); }
  .mobilebar-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .side { position: fixed; z-index: 50; left: 0; top: 0; bottom: 0; width: min(300px, 86vw); height: auto; transform: translateX(-102%); visibility: hidden; }
  .side-fold { display: none; }
  .icon-button.side-close { display: inline-grid; }
  .nav-open:checked ~ .shell .side { transform: none; visibility: visible; box-shadow: var(--shadow-pop); }
  .nav-open:checked ~ .shell .scrim { display: block; position: fixed; z-index: 40; inset: 0; background: rgba(16, 16, 20, .32); }
  .nav-open:focus-visible ~ .shell .mobilebar label { outline: 2px solid var(--accent); }
  main { padding: var(--s5) var(--s4) var(--s7); }
  .main > .notice, .main > .given { margin: var(--s4) var(--s4) 0; }
  .head { flex-wrap: wrap; align-items: flex-start; }
  .head h1 { font-size: 1.4rem; }
  .junk { padding: var(--s4); }
  .junk form, .junk .button.bright { width: 100%; }
  .junk.soft form, .junk.soft .button { width: auto; }
  .given { flex-direction: column; align-items: flex-start; }
  .given.done { flex-direction: row; gap: 14px; }
  .board { grid-auto-columns: 80vw; }
  .filter select { max-width: 60vw; }
  .filter.dates { margin-top: 0; }
  .wrap-any, .grid td.wrap-any { overflow-wrap: anywhere; }
  .grid td.wrap-any { min-width: 9rem; }
  .stagebar { flex-direction: column; gap: 6px; }
  .steps { flex-wrap: wrap; }
  .steps li { flex: 1 1 calc(33% - 3px); }
  .steps .step { min-height: 40px; }
  .steps-close li { flex: 1 1 0; }
  .find-list li a { flex-wrap: wrap; gap: 2px 10px; }
  .find-list .sub { max-width: none; text-align: left; flex-basis: 100%; white-space: normal; }
  .found .grid.tight th:nth-child(n+5), .found .grid.tight td:nth-child(n+5) { display: none; }
  .bars { gap: 2px; }
  .bar-label { font-size: .68rem; }
  .log-filter > div { flex: 1 1 140px; }
  .log-filter select, .log-filter input[type="date"] { width: 100%; min-width: 0; max-width: none; }
  .flag-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "tag close" "text text"; gap: 6px 10px; }
  .flag-list .tag { grid-area: tag; justify-self: start; }
  .flag-list form { grid-area: close; }
  .flag-text { grid-area: text; }
  .soon { padding: var(--s5); }
}

/* ================================================================ tasks */

.tag-urgent { background: var(--bad-soft); color: var(--bad); }
.tag-high { background: var(--warn-soft); color: var(--warn); }
.tag-low { color: var(--muted); }
.late { color: var(--bad); font-weight: 550; }
input[type="time"] { width: 100%; font: inherit; color: var(--ink); background: var(--raised); border: 1px solid var(--line-strong); border-radius: var(--r); padding: 8px 12px; }
.quick-add { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto auto auto; gap: var(--s3); align-items: end; padding: var(--s4) var(--s5); }
.quick-add label { margin: 0 0 6px; font-size: var(--fs-sm); }
.quick-add input, .quick-add select { height: 40px; }
.quick-add input[type="date"], .quick-add input[type="time"] { width: auto; }
.quick-add select { width: auto; max-width: 200px; }
.quick-add .button { min-height: 40px; }
.grid.tasks td { vertical-align: middle; }
.grid.tasks .task-title { font-weight: 550; overflow-wrap: anywhere; }
.grid.tasks tr.late-row td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
.task-act { display: inline; }
.task-list .part-meta { flex-wrap: wrap; }
.task-mail { margin-top: var(--s5); max-width: 760px; }
.task-mail p { flex: 1 1 260px; color: var(--muted); }
.task-form .actions { margin-top: var(--s4); }
@media (max-width: 800px) {
  .quick-add { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: var(--s4); }
  .quick-add .qa-title, .quick-add .qa-go { grid-column: 1 / -1; }
  .quick-add input[type="date"], .quick-add input[type="time"], .quick-add select { width: 100%; max-width: none; }
  .quick-add .qa-go .button { width: 100%; }
  /* Each task is a stacked row on a phone: the title first, then priority, due and the action. */
  .grid.tasks thead { display: none; }
  .grid.tasks, .grid.tasks tbody { display: block; }
  .grid.tasks tr { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 12px; border-bottom: 1px solid var(--line); }
  .grid.tasks tr:last-child { border-bottom: 0; }
  .grid.tasks td { display: block; padding: 0; border: 0; }
  .grid.tasks td.t-main { flex: 1 1 100%; order: -1; min-width: 0; }
  .grid.tasks td.t-due br { display: none; }
  .grid.tasks td.t-due .muted { margin-left: 4px; }
  .grid.tasks td.t-act { margin-left: auto; }
  .grid.tasks td.empty { flex: 1 1 100%; }
  .grid.tasks tr.late-row { box-shadow: inset 3px 0 0 var(--bad); }
  .grid.tasks tr.late-row td:first-child { box-shadow: none; }
}

/* ================================================================ the questions of a project */

.review { margin-top: var(--s4); padding: var(--s3) var(--s4); background: var(--sunk); border-radius: var(--r-md); }
.review h3 { font-size: var(--fs-md); font-weight: 650; margin: 0; }
.review .part-head { flex-wrap: wrap; margin-bottom: 0; }
.review .part-head .inline { margin-top: 0; }
.review .timeline { margin-top: var(--s3); }
.review .button.second { background: var(--raised); border-color: var(--line-strong); }   /* a button shape on the gray box */
.review .row.start details[open], #questions .row.start details[open] { flex-basis: 100%; }   /* room to proofread what the customer reads */
.review .row.start details[open] textarea, #questions .row.start details[open] textarea { width: 100%; }
.review .button.second:hover { background: var(--pressed); border-color: var(--line-strong); }
.review .row.start { align-items: flex-start; }                    /* Approve stays at the top when a form opens */
.entry-suggestion { border-left-color: var(--accent); }
.entry .prose { overflow-wrap: anywhere; }
.add-question { margin-top: var(--s4); }
.add-question label { margin-top: 0; }
.irl-export { margin-top: var(--s5); padding-top: var(--s4); border-top: 1px solid var(--line); }
.irl-export .choice { margin: 0; }
.check-result .facts dd { overflow-wrap: anywhere; }
.check-choices > form { margin-top: var(--s4); }
