/* Backbook app shell. Modelled on triage tools rather than CRMs: quiet chrome, hairline rows on white,
   one accent (sky) for "needs you", green for done. Type scale 12 / 13 / 15 / 20 / 30, spacing 4–8–12–16–24–32–48. */
:root {
  --page: #ffffff; --side: #f7f8fa; --line: #eceef2; --line-2: #e2e5ea;
  --ink: #0e1726; --ink-2: #3a4352; --muted: #6b7280; --faint: #9aa1ad;
  --accent: #1a73c8; --mark: #c4e3ff; --wash: #f2f8ff; --ok: #147a3d;
  --sans: "Host Grotesk", "Helvetica Neue", Arial, sans-serif;
  --mono: "Host Grotesk", "Helvetica Neue", Arial, sans-serif; /* figures use tabular numbers instead of a monospace face */
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --page: #0c0f15; --side: #10141c; --line: #1c222d; --line-2: #262d3a;
  --ink: #e8edf5; --ink-2: #c3cad6; --muted: #8e97a6; --faint: #6b7586;
  --accent: #86c3ff; --mark: #1d4a70; --wash: #111c2b; --ok: #5ccf98; } }
:root[data-theme="dark"] {
  --page: #0c0f15; --side: #10141c; --line: #1c222d; --line-2: #262d3a;
  --ink: #e8edf5; --ink-2: #c3cad6; --muted: #8e97a6; --faint: #6b7586;
  --accent: #86c3ff; --mark: #1d4a70; --wash: #111c2b; --ok: #5ccf98; }

body { background: var(--page); color: var(--ink); font-size: 15px; font-variant-numeric: tabular-nums; }
.shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh; }

/* Sidebar */
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 24px; padding: 20px 12px 16px; background: var(--side); border-right: 1px solid var(--line); }
.side .wordmark { padding: 4px 10px; font-size: 17px; }
.nav { display: grid; gap: 2px; }
.nav a { display: flex; justify-content: space-between; align-items: center; padding: 7px 10px; border-radius: 6px; font-size: 14px; color: var(--ink-2); text-decoration: none; }
.nav a:hover { background: var(--line); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--page); color: var(--ink); font-weight: 500; box-shadow: 0 0 0 1px var(--line-2); }
.nav-n { font: 400 12px/1 var(--mono); color: var(--muted); }
.side-foot { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.side-foot p { margin: 0; font-size: 12px; line-height: 1.5; color: var(--muted); }
.demo-badge { justify-self: start; }

/* Page */
.page { max-width: 1040px; width: 100%; margin: 0; padding: 40px 48px 96px; }
.ph { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px 24px; flex-wrap: wrap; padding-bottom: 20px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.ph h1 { font-size: 30px; font-weight: 600; letter-spacing: -0.035em; line-height: 1.1; }
.ph-date { margin: 0 0 6px; font-size: 13px; color: var(--muted); }
.ph-right { display: flex; align-items: center; gap: 16px; }
.ph-meta { font-size: 13px; color: var(--muted); }
.hint-line { margin: 16px 0 0; font-size: 13px; color: var(--muted); }
kbd { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; margin-left: 2px; border-radius: 4px; border: 1px solid currentColor; font: 500 11px/1 var(--mono); opacity: .6; }
.btn kbd { border-color: rgba(255,255,255,.4); opacity: .8; }
.btn-quiet kbd { border-color: var(--line-2); }
.btn { border-radius: 7px; font-size: 14px; padding: 0 14px; min-height: 36px; gap: 8px; }
.btn-quiet { background: var(--page); border-color: var(--line-2); color: var(--ink); }
.btn-quiet:hover { border-color: var(--ink-2); background: var(--page); color: var(--ink); }

/* Sections + rows */
.sec { margin-top: 28px; }
.sec-h { display: flex; align-items: baseline; gap: 8px; margin: 0 0 6px; padding: 0 12px; font-size: 13px; font-weight: 500; color: var(--muted); }
.sec-h span { font: 400 12px/1 var(--mono); color: var(--faint); }
.list { list-style: none; margin: 0; padding: 0; }
.item { border-radius: 8px; }
.item > button, .later-row { position: relative; width: 100%; display: grid; grid-template-columns: minmax(0, 13rem) minmax(0, 1fr) 8.5rem 6.5rem 4.5rem; align-items: center; gap: 16px; padding: 11px 12px; background: none; border: 0; border-radius: 8px; text-align: left; cursor: pointer; font-size: 15px; color: var(--ink); }
.later-row { cursor: default; }
.item > button:hover, .item.sel > button { background: var(--side); }
.item.sel > button { box-shadow: inset 0 0 0 1px var(--line-2); }
.item.hot > button::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 2px; background: var(--accent); }
.i-name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.i-why { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.i-tag .tag { font-size: 12px; padding: 4px 9px; border-radius: 999px; background: var(--wash); border: 1px solid var(--line-2); color: var(--ink-2); white-space: nowrap; }
.i-lender { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.i-when { justify-self: end; font: 400 13px/1 var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.item.hot .i-when { color: var(--ink); }
.i-when.ok { color: var(--ok); }
.collapsed { width: 100%; display: flex; justify-content: space-between; gap: 16px; padding: 11px 12px; border: 1px dashed var(--line-2); border-radius: 8px; background: none; font-size: 15px; text-align: left; cursor: pointer; color: var(--ink); }
.collapsed:hover { background: var(--side); }
.collapsed .muted { font-size: 13px; }
.page-foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 32px; padding: 14px 12px 0; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.page-foot a { color: var(--ink); }
.keys { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 12px; }
.keys kbd { margin: 0 2px 0 6px; }
.blank { padding: 48px 12px; display: grid; gap: 10px; max-width: 520px; }
.blank h2 { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; }
.blank p { color: var(--muted); }
.blank.done h2 { font-size: 30px; }

/* Review */
.rvh { display: flex; align-items: center; gap: 16px; padding-bottom: 16px; margin-bottom: 28px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.rvh .link { padding: 4px 0; font-size: 13px; }
.rvh-n { margin-left: auto; font-family: var(--mono); font-size: 12px; }
.segs { display: flex; gap: 3px; }
.segs i { width: 18px; height: 4px; border-radius: 2px; background: var(--line-2); }
.segs i.done { background: var(--ok); }
.segs i.now { background: var(--accent); }
.rv { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; align-items: start; }
@media (min-width: 1000px) { .rv { grid-template-columns: minmax(0, 18rem) minmax(0, 1fr); gap: 48px; } }
.rv-client, .rv-compose { background: none; border: 0; padding: 0; }
.rv-client { display: grid; gap: 24px; }
.rv-who h1 { font-size: 30px; font-weight: 600; }
.chip { font-size: 13px; padding: 4px 10px; background: var(--side); border-color: var(--line-2); }
.chip.hot { background: var(--mark); }
.rv-client .facts { grid-template-columns: 1fr; gap: 0; border-top: 1px solid var(--line); }
.rv-client .facts div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.rv-client .facts dt { font-size: 13px; }
.rv-client .facts dd, .rv-client .facts dd.mono { font-size: 14px; text-align: right; }
.talk { border-top: 0; padding-top: 0; }
.talk h2 { font-size: 13px; }
.talk li { border-radius: 8px; padding: 10px 12px; border-color: var(--line-2); }
.talk li.on { border-color: var(--accent); background: var(--wash); }
.talk li p { font-size: 14px; }
.talk .talk-from { font-size: 12px; font-style: italic; }
.memo textarea { border-radius: 8px; border-color: var(--line-2); font-size: 14px; }
.rv-compose { display: grid; gap: 14px; }
.compose-head { padding-bottom: 4px; }
.rv-compose .message { min-height: 200px; border-radius: 10px; border: 1px solid var(--line-2); padding: 18px; font-size: 16px; line-height: 1.65; box-shadow: 0 1px 2px rgba(14,23,38,.04); }
.rv-compose .meta { font-size: 12px; }
.rv-actions { border-top: 0; padding-top: 4px; gap: 8px; }
.slide-in { animation: slide-in .28s cubic-bezier(.2,.8,.2,1); }
@keyframes slide-in { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .slide-in { animation: none; } }
.finish { display: grid; gap: 14px; max-width: 640px; padding-top: 24px; }
.finish h1 { font-size: 36px; font-weight: 600; letter-spacing: -0.04em; }
.finish-sum { color: var(--muted); }
.finish .list { margin-top: 8px; border-top: 1px solid var(--line); }
.finish .later-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 0 0 2rem; }
.finish-next { font-size: 13px; }

/* Other views inherit the calmer page */
.page-head h1 { font-size: 30px; font-weight: 600; }
.card { border-radius: 10px; }

/* Phone */
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: sticky; top: 0; z-index: 10; height: auto; flex-direction: row; align-items: center; gap: 12px; padding: 10px 16px; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .side .wordmark { padding: 0; flex: none; }
  .nav { display: flex; gap: 2px; }
  .nav a { padding: 6px 8px; white-space: nowrap; }
  .side-foot { display: none; }
  .page { padding: 24px 16px 80px; }
  .item > button, .later-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; gap: 2px 12px; }
  .i-name { grid-column: 1; grid-row: 1; }
  .i-why { grid-column: 1; grid-row: 2; font-size: 13px; white-space: normal; }
  .i-tag { grid-column: 2; grid-row: 2; justify-self: end; }
  .i-lender { display: none; }
  .i-when { grid-column: 2; grid-row: 1; }
  .ph-right { width: 100%; justify-content: space-between; }
  .keys, .page-foot .keys, .rvh .keys { display: none; }
  .segs i { width: 10px; }
  .rv-actions kbd { display: none; }
}

/* Calls to action: deep green */
:root { --cta: #0b4f2a; --cta-hover: #083b1f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --cta: #1f7a47; --cta-hover: #26905a; } }
:root[data-theme="dark"] { --cta: #1f7a47; --cta-hover: #26905a; }
.btn:not(.btn-quiet):not(.btn-danger) { background: var(--cta); border-color: var(--cta); color: #fff; }
.btn:not(.btn-quiet):not(.btn-danger):hover { background: var(--cta-hover); border-color: var(--cta-hover); color: #fff; }
.btn-done { background: var(--cta); border-color: var(--cta); }
.segs i.done { background: var(--cta); }
.item.hot > button::before { background: var(--cta); }
.talk li.on { border-color: var(--cta); }
@media (max-width: 860px) { .side { overflow: hidden; } .nav { overflow-x: auto; min-width: 0; scrollbar-width: none; } .nav::-webkit-scrollbar { display: none; } }

/* ===== Remaining views on the same system ===== */
.ph-count { font: 400 14px/1 var(--mono); color: var(--muted); margin-left: 6px; letter-spacing: 0; }
.search { width: 16rem; max-width: 100%; min-height: 36px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 7px; font-size: 14px; background: var(--page); }
.cols-head { display: grid; grid-template-columns: minmax(0, 13rem) minmax(0, 1fr) 8.5rem 11rem 5.5rem; gap: 16px; padding: 18px 12px 6px; font-size: 12px; color: var(--faint); }
.cols-head span:last-child { text-align: right; }
.crow { grid-template-columns: minmax(0, 13rem) minmax(0, 1fr) 8.5rem 11rem 5.5rem !important; }
@media (max-width: 860px) { .cols-head { display: none; } .crow { grid-template-columns: minmax(0, 1fr) auto !important; } }

/* Import + mapping */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px 24px; flex-wrap: wrap; padding-bottom: 20px; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.page-head h1 { font-size: 30px; font-weight: 600; letter-spacing: -0.035em; }
.import-grid { margin-top: 28px; gap: 32px; }
.drop { border: 1px dashed var(--line-2); border-radius: 12px; padding: 40px 32px; background: var(--side); }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--wash); }
.drop strong { font-size: 17px; font-weight: 500; }
.help { padding: 20px; border: 1px solid var(--line); border-radius: 12px; }
.help h2 { font-size: 15px; font-weight: 500; }
.help ul { border-top: 0; }
.help li { border-bottom: 1px solid var(--line); font-size: 13px; padding: 9px 0; }
.help li:last-child { border-bottom: 0; }
.table-scroll { border: 1px solid var(--line); border-radius: 12px; }
.mapping th, .mapping td { padding: 10px 14px; border-bottom: 1px solid var(--line); }
.mapping thead th { background: var(--side); border-bottom: 1px solid var(--line); font-family: var(--sans); font-size: 12px; color: var(--muted); }
.mapping tbody tr:last-child td { border-bottom: 0; }
.mapping select { border-radius: 7px; border-color: var(--line-2); }
.check { padding: 16px 20px; border: 1px solid var(--line); border-radius: 12px; font-size: 14px; }
.issues ul { border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; }
.issues li { border-bottom: 1px solid var(--line); }
.issues li:last-child { border-bottom: 0; }

/* Settings */
.settings { gap: 32px; max-width: 680px; margin-top: 28px; }
.settings section { padding: 24px; border: 1px solid var(--line); border-radius: 12px; gap: 16px; }
.settings h2 { font-size: 15px; font-weight: 500; padding: 0; border: 0; }
.field input, .field select, .field textarea { border-radius: 7px; border-color: var(--line-2); min-height: 38px; font-size: 15px; }
.field label { font-size: 13px; }

/* Client panel (dialog) */
.sheet { border-left: 1px solid var(--line); box-shadow: -24px 0 60px -30px rgba(14,23,38,.25); }
.sheet::backdrop { background: rgba(14,23,38,.18); }
.sheet-inner { gap: 20px; padding: 28px 28px 40px; }
.sheet-head h2 { font-size: 26px; font-weight: 600; letter-spacing: -0.03em; }
.sheet .facts { border-top: 1px solid var(--line); }
.sheet .facts div { border-bottom: 1px solid var(--line); padding: 9px 0; font-size: 14px; }
.sheet .facts dd.mono { font-family: var(--sans); font-size: 14px; }
.sheet .composer { border-top: 0; padding-top: 0; }
.sheet .message { border-radius: 10px; border-color: var(--line-2); }
.close { border-radius: 7px; border-color: var(--line-2); }
.toast { border-radius: 8px; }
.later-row { grid-template-columns: minmax(0, 13rem) minmax(0, 1fr) 4rem 9rem 10rem; }
.later-row .i-when, .later-row .link { justify-self: end; white-space: nowrap; }
@media (max-width: 860px) { .later-row { grid-template-columns: minmax(0, 1fr) auto; } }

/* Review gets the whole page */
.page.wide { max-width: none; padding: 32px 56px 64px; }
.page.wide .rv { grid-template-columns: minmax(0, 1fr); gap: 40px; min-height: calc(100vh - 150px); }
@media (min-width: 1000px) { .page.wide .rv { grid-template-columns: minmax(20rem, 5fr) minmax(0, 8fr); gap: 56px; } }
.page.wide .rv-who h1 { font-size: 40px; letter-spacing: -0.04em; }
.page.wide .chip { font-size: 14px; padding: 6px 12px; }
.page.wide .rv-client { gap: 32px; align-content: start; }
.page.wide .rv-client .facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; }
.page.wide .rv-client .facts div { padding: 12px 0; }
.page.wide .rv-client .facts dt { font-size: 13px; }
.page.wide .rv-client .facts dd, .page.wide .rv-client .facts dd.mono { font-size: 16px; }
.page.wide .talk li p { font-size: 15px; }
.page.wide .rv-compose { gap: 18px; align-content: start; }
.page.wide .rv-compose .message { min-height: 340px; font-size: 18px; line-height: 1.7; padding: 24px 26px; }
.page.wide .compose-head { font-size: 15px; }
.page.wide .rv-actions .btn { min-height: 44px; font-size: 15px; padding: 0 18px; }
.page.wide .rvh { margin-bottom: 36px; }
@media (max-width: 860px) { .page.wide { padding: 20px 16px 64px; } .page.wide .rv-who h1 { font-size: 30px; } .page.wide .rv-compose .message { min-height: 260px; font-size: 16px; } .page.wide .rv-client .facts { grid-template-columns: 1fr; } }

/* Urgency colours for the bar beside a name */
:root { --u-now: #c3341f; --u-soon: #c98a0b; --u-week: #0b4f2a; --u-later: #c9ced6; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --u-now: #ff7b63; --u-soon: #e9b44c; --u-week: #4fbf85; --u-later: #3a4352; } }
:root[data-theme="dark"] { --u-now: #ff7b63; --u-soon: #e9b44c; --u-week: #4fbf85; --u-later: #3a4352; }
.item[class*="u-"] > button::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 2px; }
.item.u-now > button::before { background: var(--u-now); }
.item.u-soon > button::before { background: var(--u-soon); }
.item.u-week > button::before { background: var(--u-week); }
.item.u-later > button::before { background: var(--u-later); }
.item.u-now .i-when { color: var(--u-now); }
.item.u-soon .i-when, .item.u-week .i-when { color: var(--ink); }
.legend { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 3px; border-radius: 2px; margin-left: 8px; }
.legend i:first-child { margin-left: 0; }
.legend i.u-now { background: var(--u-now); } .legend i.u-soon { background: var(--u-soon); } .legend i.u-week { background: var(--u-week); } .legend i.u-later { background: var(--u-later); }
@media (max-width: 860px) { .legend { width: 100%; } }

/* Today: list + rate monitor */
.page:has(.today-grid) { max-width: 1360px; }
.today-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; }
@media (min-width: 1240px) { .today-grid { grid-template-columns: minmax(0, 1fr) 300px; } }
.item > button { grid-template-columns: minmax(0, 12rem) minmax(0, 1fr) 8rem 10.5rem 4.5rem; }
.mon-col { align-self: start; position: sticky; top: 24px; }
.monitor { padding: 20px; border: 1px solid var(--line); border-radius: 12px; display: grid; gap: 16px; background: var(--page); }
.monitor h2 { font-size: 15px; font-weight: 600; }
.monitor h3 { font-size: 13px; font-weight: 500; display: flex; gap: 8px; align-items: baseline; }
.monitor h3 span { font: 400 12px/1 var(--mono); color: var(--muted); }
.m-note { margin: -8px 0 0; font-size: 12px; color: var(--muted); line-height: 1.5; }
.m-stats { display: grid; gap: 0; border-top: 1px solid var(--line); }
.m-stats div { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.m-stats span { color: var(--muted); }
.m-stats b { font: 500 13px/1 var(--mono); }
.m-hist { display: grid; gap: 4px; }
.m-row { display: grid; grid-template-columns: 2.6rem 1fr 1.2rem; align-items: center; gap: 8px; font: 400 11px/1 var(--mono); color: var(--muted); }
.m-row i { height: 8px; border-radius: 2px; background: var(--line-2); min-width: 2px; }
.m-row em { font-style: normal; text-align: right; }
.m-row.bench span { color: var(--cta); font-weight: 500; }
.m-row.bench i { background: var(--cta); }
.m-bench { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.m-input { display: flex; align-items: center; border: 1px solid var(--line-2); border-radius: 7px; padding: 0 10px; background: var(--page); }
.m-input:focus-within { border-color: var(--accent); }
.m-input input { flex: 1; min-width: 0; border: 0; padding: 8px 0; font: 500 15px/1 var(--mono); background: transparent; color: var(--ink); box-shadow: none !important; }
.m-input i { font-style: normal; color: var(--muted); }
.m-list { list-style: none; margin: -6px 0 0; padding: 0; border-top: 1px solid var(--line); }
.m-list li { border-bottom: 1px solid var(--line); }
.m-list button { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 9px 2px; background: none; border: 0; text-align: left; cursor: pointer; font-size: 13px; color: var(--ink); }
.m-list button:hover { background: var(--side); }
.m-list span { display: grid; gap: 2px; font-weight: 500; }
.m-list em { font: 400 11px/1.2 var(--mono); color: var(--muted); font-style: normal; }
.m-list b { font: 500 12px/1 var(--mono); color: var(--cta); }
@media (max-width: 1239px) { .mon-col { position: static; } }
.item > button:not(.crow) { grid-template-columns: minmax(0, 13rem) minmax(0, 1fr) auto 4.5rem; gap: 20px; padding: 12px 12px 12px 16px; }
.i-who { display: grid; gap: 3px; min-width: 0; }
.i-loan { font: 400 12px/1.2 var(--mono); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.i-why { white-space: normal; line-height: 1.35; }
.item[class*="u-"] > button::before { top: 14px; bottom: 14px; }
.page.wide .rv-client .facts div { display: grid; gap: 4px; justify-content: stretch; }
.page.wide .rv-client .facts dd, .page.wide .rv-client .facts dd.mono { text-align: left; white-space: nowrap; }
@media (max-width: 860px) {
  .item > button:not(.crow) { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto auto; }
  .i-who { grid-column: 1; grid-row: 1; }
  .item > button:not(.crow) .i-why { grid-column: 1 / -1; grid-row: 2; }
  .item > button:not(.crow) .i-tag { grid-column: 1 / -1; grid-row: 3; justify-self: start; }
  .item > button:not(.crow) .i-when { grid-column: 2; grid-row: 1; }
}
/* Monitor visible at laptop widths too */
@media (min-width: 1100px) { .today-grid { grid-template-columns: minmax(0, 1fr) 280px; gap: 32px; } .mon-col { position: sticky; } }
@media (min-width: 1100px) and (max-width: 1360px) { .page:has(.today-grid) { padding-left: 32px; padding-right: 32px; } .item > button:not(.crow) { grid-template-columns: minmax(0, 11rem) minmax(0, 1fr) auto 4rem; gap: 14px; } }
@media (max-width: 1099px) { .today-grid { grid-template-columns: minmax(0, 1fr); } .mon-col { order: -1; position: static; } .m-hist, .m-list, .monitor .m-note:last-child { display: none; } .m-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; border: 0; } .m-stats div { display: grid; border: 0; padding: 0; gap: 4px; } }

.m-note:first-child { margin-top: 0; }
.mon-col .sec-h { padding: 0 20px; }
@media (max-width: 1099px) { .today-grid { gap: 0; } .monitor h3 { display: none; } }

/* Appearance switch */
.theme-sw { margin-top: auto; align-self: flex-start; display: flex; gap: 2px; padding: 2px; margin-left: 10px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--page); }
.theme-sw + .side-foot { margin-top: 0; }
.theme-sw button { display: grid; place-items: center; width: 28px; height: 24px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer; }
.theme-sw button:hover { color: var(--ink); }
.theme-sw button[aria-checked="true"] { background: var(--line); color: var(--ink); }
.theme-sw svg { width: 15px; height: 15px; }
@media (max-width: 860px) { .theme-sw { order: 3; margin: 0 0 0 auto; flex: none; align-self: center; border: 0; padding: 0; background: none; } .theme-sw button:not([aria-checked="true"]) { display: none; } .theme-sw button[aria-checked="true"] { background: none; color: var(--muted); } }
@media (max-width: 860px) { .side .wordmark { order: 0; } }

/* Ready to send */
.auto { margin-top: 24px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--page); overflow: hidden; }
.auto-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px 24px; padding: 18px 20px; background: var(--wash); }
.auto-title h2 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.auto-title p { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.auto-head.busy .auto-title h2 { color: var(--ink-2); }
.auto-acts { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.auto-acts .btn { min-height: 40px; }
.auto-acts .btn:disabled { opacity: .45; cursor: default; }
.auto-q { max-width: 26rem; font-size: 13px; color: var(--ink-2); text-align: right; }
.chev { width: 14px; height: 14px; transition: transform .2s; }
.chev.up { transform: rotate(180deg); }
.auto-sign { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.auto-sign input { width: 14rem; max-width: 100%; padding: 7px 10px; border: 1px solid var(--line-2); border-radius: 7px; font: inherit; color: var(--ink); background: var(--page); }
.auto-list { border-top: 1px solid var(--line); }
.auto-item { display: grid; grid-template-columns: 24px 13rem auto minmax(0, 1fr); gap: 4px 16px; align-items: start; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.auto-item:last-child { border-bottom: 0; }
.auto-item.off .auto-who, .auto-item.off .auto-msg { opacity: .45; }
.auto-item.sent { background: var(--side); }
.auto-check { padding-top: 2px; }
.auto-check input { width: 16px; height: 16px; accent-color: var(--cta); }
.auto-who { display: grid; gap: 3px; font-size: 14px; }
.auto-who span { font-size: 13px; color: var(--muted); }
.auto-ch { display: flex; padding: 2px; border: 1px solid var(--line-2); border-radius: 7px; }
.auto-ch button { padding: 4px 9px; border: 0; border-radius: 5px; background: none; font: 500 12px/1 var(--sans); color: var(--muted); cursor: pointer; }
.auto-ch button[aria-pressed="true"] { background: var(--line); color: var(--ink); }
.auto-ch button:disabled { opacity: .35; cursor: default; }
.auto-msg { display: grid; gap: 6px; min-width: 0; }
.auto-msg textarea, .auto-subj { width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; font: 14px/1.5 var(--sans); color: var(--ink); background: var(--page); resize: vertical; }
.auto-subj { font-weight: 500; }
.auto-msg textarea:focus, .auto-subj:focus { outline: none; border-color: var(--accent); }
.auto-msg textarea:disabled { color: var(--muted); }
.auto-foot { display: flex; justify-content: space-between; gap: 12px; font: 400 12px/1.4 var(--sans); color: var(--muted); }
.auto-foot em { font-style: normal; color: var(--ok); }
.auto-foot strong { color: var(--u-now); font-weight: 500; }
@media (max-width: 1099px) { .auto-item { grid-template-columns: 24px minmax(0, 1fr) auto; } .auto-msg { grid-column: 2 / -1; } }
@media (max-width: 640px) {
  .auto-head { grid-template-columns: 1fr; padding: 16px; }
  .auto-acts { justify-content: flex-start; }
  .auto-acts .btn { flex: 1; }
  .auto-q { text-align: left; flex-basis: 100%; }
  .auto-item { padding: 14px 16px; }
}
.btn-small { min-height: 32px; padding: 0 12px; font-size: 13px; }
.auto-foot { align-items: baseline; } .auto-foot .link { padding: 0; font-size: 12px; flex: none; }
.auto-msg textarea { overflow: hidden; }

/* Monitor: market line and estimates */
.m-cash { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.m-cash b { font: 500 15px/1 var(--mono); color: var(--ink); }
.m-cash em { font: 400 12px/1 var(--mono); font-style: normal; }
.m-cash em.up { color: var(--u-now); }
.m-cash em.down { color: var(--ok); }
.est { font-style: normal; font-size: 11px; color: var(--faint); }
.m-bench small { font-size: 12px; color: var(--faint); }
.m-bench small.stale { color: var(--u-soon); }
.monitor h3 + .m-list { margin-top: -6px; }
.facts .wide { grid-column: 1 / -1; }
.facts dd { overflow-wrap: anywhere; }
.m-list b { white-space: nowrap; }
.m-more { margin: -10px 0 0; font-size: 12px; color: var(--faint); }
.m-how { font-size: 12px; color: var(--muted); }
.m-how summary { cursor: pointer; list-style: none; color: var(--muted); }
.m-how summary::-webkit-details-marker { display: none; }
.m-how summary::after { content: ' +'; }
.m-how[open] summary::after { content: ' −'; }
.m-how summary:hover { color: var(--ink); }
.m-how p { margin: 8px 0 0; line-height: 1.5; }

/* Import: two choices */
.imp { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; margin-top: 28px; }
.imp-drop, .imp-sample { display: grid; align-content: center; justify-items: start; gap: 8px; padding: 32px; border-radius: 14px; }
.imp-drop { min-height: 260px; border: 1.5px dashed var(--line-2); background: var(--side); cursor: pointer; transition: border-color .15s, background .15s; }
.imp-drop:hover, .imp-drop.over { border-color: var(--accent); background: var(--wash); }
.imp-drop strong { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; }
.imp-drop span:not(.btn):not(.imp-icon), .imp-sample span { font-size: 14px; color: var(--muted); }
.imp-drop .btn { margin-top: 12px; }
.imp-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--page); border: 1px solid var(--line-2); color: var(--ink); margin-bottom: 4px; }
.imp-icon svg { width: 20px; height: 20px; }
.imp-sample { border: 1px solid var(--line); }
.imp-sample strong { font-size: 16px; font-weight: 600; }
.imp-sample .btn { margin-top: 8px; }
.imp-foot { margin-top: 16px; font-size: 13px; color: var(--muted); }
.imp-foot .link { padding: 0; font-size: 13px; }
@media (max-width: 760px) { .imp { grid-template-columns: 1fr; } .imp-drop { min-height: 200px; padding: 24px; } .imp-sample { padding: 24px; } }

/* Sorting sequence */
.sorting { max-width: 520px; margin: 8vh auto 0; display: grid; gap: 6px; }
.sorting h1 { font-size: 30px; letter-spacing: -0.02em; }
.sort-sub { margin: 0 0 20px; color: var(--muted); font-size: 14px; }
.sort-steps { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 4px; }
.sort-steps li { display: grid; grid-template-columns: 22px 1fr; gap: 14px; align-items: start; padding: 12px 0; border-bottom: 1px solid var(--line); opacity: .28; transform: translateY(4px); transition: opacity .4s ease, transform .4s ease; }
.sort-steps li.now, .sort-steps li.done { opacity: 1; transform: none; }
.sort-steps li div { display: grid; gap: 3px; }
.sort-steps strong { font-size: 15px; font-weight: 500; }
.sort-steps span { font-size: 13px; color: var(--muted); }
.sort-steps li span { opacity: 0; transition: opacity .35s ease .15s; }
.sort-steps li.done span { opacity: 1; }
.sort-steps i { width: 18px; height: 18px; margin-top: 1px; border-radius: 50%; border: 1.5px solid var(--line-2); position: relative; }
.sort-steps li.now i { border-color: var(--accent); border-right-color: transparent; animation: spin .8s linear infinite; }
.sort-steps li.done i { border-color: var(--cta); background: var(--cta); }
.sort-steps li.done i::after { content: ''; position: absolute; left: 5px; top: 2px; width: 4px; height: 8px; border: solid #fff; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
@keyframes spin { to { transform: rotate(360deg); } }
.sorting .link { justify-self: start; padding: 0; font-size: 13px; }
@media (prefers-reduced-motion: reduce) { .sort-steps li, .sort-steps li span { transition: none; } .sort-steps li.now i { animation: none; } }

/* Ruled rows: a hairline between every client, and above and below each group */
.page .list { border-top: 1px solid var(--line); }
.page .list > .item { border-bottom: 1px solid var(--line); border-radius: 0; }
.page .list > .item > button, .page .list .later-row { border-radius: 0; }
.page .list > .item.sel > button { box-shadow: none; }
.page .list > .blank { border-bottom: 0; }
.today-main .collapsed { border-radius: 0; border-left: 0; border-right: 0; border-style: solid; border-color: var(--line); }
.page-foot { border-top-color: var(--line); }
@media (max-width: 1099px) { .monitor .m-more, .monitor .m-how { display: none; } }
.optout-line { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.optout-line .link { padding: 0; font-size: 13px; }
.auto-ch-label { font-size: 12px; color: var(--muted); padding-top: 3px; }
.page .actions label.btn { cursor: pointer; }
