/* Design Create Innovate portal.
   Palette is lifted from the logo tile: slate ground, teal mountains, silver ring.
   Type: IBM Plex Sans (OFL), self-hosted because the CSP allows fonts from 'self' only. */
@font-face {
  font-family: "IBM Plex Sans"; font-style: normal; font-weight: 100 700; font-display: swap;
  src: url("/static/fonts/ibm-plex-sans-latin.woff2") format("woff2");
}
:root {
  --bg: #f3f5f6; --card: #fff; --ink: #16202a; --ink-2: #394552; --muted: #5d6975; --line: #dde3e7; --line-2: #c5ced5;
  --slate: #1f2b36; --slate-2: #2b3a47; --silver: #c9d2d9;
  --accent: #177a73; --accent-hover: #11625c; --accent-soft: #e7f2f1; --accent-ink: #fff;
  --ok: #2b7a3e; --warn: #9a6200; --bad: #b42323;
  --radius: 8px; --shadow: 0 1px 2px rgba(22,32,42,.05), 0 4px 14px rgba(22,32,42,.05);
  font-family: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); line-height: 1.5; -webkit-font-smoothing: antialiased; display: flex; flex-direction: column; min-height: 100vh; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }
main { width: 100%; max-width: 1040px; margin: 0 auto; padding: 32px 20px 56px; flex: 1; }
main.wide { max-width: 1240px; }
h1 { font-size: 1.85rem; line-height: 1.2; font-weight: 600; letter-spacing: -.01em; margin: 0 0 .4em; }
h2 { font-size: 1.12rem; font-weight: 600; margin: 0 0 .7em; }
h3 { font-size: 1rem; font-weight: 600; margin: 1em 0 .4em; }
.lead { font-size: 1.08rem; color: var(--ink-2); max-width: 62ch; margin: 0 0 1.6em; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.pre { white-space: pre-wrap; }
.error { color: var(--bad); font-weight: 600; min-height: 1em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- header / footer */
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px 24px; flex-wrap: wrap; padding: 12px max(20px, calc((100% - 1200px) / 2)); background: var(--slate); color: #fff; border-bottom: 3px solid var(--accent); }
.topbar a { color: #fff; text-decoration: none; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand .logo { height: 42px; width: auto; display: block; border-radius: 8px; }
.brand-name { font-weight: 600; font-size: 1.05rem; letter-spacing: .01em; }
.mark { background: var(--accent); color: #fff; padding: 3px 7px; border-radius: 6px; letter-spacing: .04em; font-size: .9rem; }
.nav { display: flex; gap: 6px 22px; align-items: center; flex-wrap: wrap; font-size: .95rem; }
.topbar .nav a { color: var(--silver); padding: 4px 0; border-bottom: 2px solid transparent; }
.topbar .nav a:hover { color: #fff; border-bottom-color: var(--accent); }
.foot { background: var(--slate); color: var(--silver); font-size: .88rem; }
.foot-inner { max-width: 1200px; margin: 0 auto; padding: 22px 20px; display: flex; justify-content: space-between; gap: 8px 24px; flex-wrap: wrap; }
.foot a { color: #fff; }
.foot .foot-name { color: #fff; font-weight: 600; }
body.admin .foot { background: transparent; color: var(--muted); }
body.admin .foot .foot-name, body.admin .foot a { color: var(--ink-2); }

/* ---------- surfaces */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow); margin-bottom: 20px; }
.card.inset { box-shadow: none; background: #f8fafa; }
.card.narrow { max-width: 400px; margin: 40px auto; }
.cards.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.card.big { display: block; text-decoration: none; color: inherit; }
.card.big:hover { border-color: var(--accent); }
.page-head { margin-bottom: 8px; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .76rem; font-weight: 600; color: var(--accent); margin: 0 0 10px; }

/* ---------- home */
.hero { padding: 16px 0 28px; max-width: 720px; }
.hero h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); line-height: 1.15; }
.hero .lead { margin-bottom: 0; }
.paths { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; margin-bottom: 36px; }
.path { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 28px 24px; box-shadow: var(--shadow); color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.path:hover { border-color: var(--accent); box-shadow: 0 2px 4px rgba(22,32,42,.06), 0 10px 28px rgba(22,32,42,.08); color: inherit; }
.path h2 { font-size: 1.35rem; margin: 0 0 8px; }
.path p { margin: 0 0 14px; color: var(--ink-2); }
.path .spec { font-size: .86rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 12px; min-height: 4.2em; }
.path .cta { align-self: flex-start; margin-top: auto; display: inline-flex; align-items: center; min-height: 42px; padding: 9px 18px; border-radius: 6px; background: var(--accent); color: #fff; font-weight: 600; transition: background .15s; }
.path:hover .cta { background: var(--accent-hover); }
.path p { flex: 0 0 auto; }
.path .spec { margin-bottom: 20px; }
.alt { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0 40px; border-top: 1px solid var(--line-2); margin-bottom: 36px; }
.alt > div { padding: 22px 0 4px; display: flex; flex-direction: column; }
.alt > div a { margin-top: auto; }
.alt h3 { margin: 0 0 4px; font-size: 1.02rem; }
.alt p { margin: 0 0 10px; color: var(--ink-2); }
.alt a { font-weight: 600; text-decoration: none; }
.alt a:hover { text-decoration: underline; }
.steps { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 28px; }
.steps h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin-bottom: 16px; }
.steps ol { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px 32px; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 34px 1fr; gap: 0 12px; }
.steps li::before { content: counter(step); grid-row: span 2; width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: .9rem; }
.steps li b { font-weight: 600; }
.steps li span { color: var(--muted); font-size: .92rem; }

/* ---------- controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; border: 1px solid var(--line-2); background: #fff; color: var(--ink); padding: 9px 18px; border-radius: 6px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s; }
.btn:hover { border-color: var(--ink-2); color: var(--ink); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn.primary:disabled { opacity: .55; cursor: not-allowed; }
.btn.danger { color: var(--bad); }
button.link { background: none; border: 0; color: inherit; font: inherit; cursor: pointer; padding: 0; text-decoration: underline; }
.card button.link { color: var(--accent); }
form.inline { display: inline; }
label { display: block; font-weight: 500; font-size: .9rem; color: var(--ink-2); margin: 0 0 14px; }
label.check { font-weight: 400; color: var(--ink); display: flex; gap: 10px; align-items: center; }
input, select, textarea { display: block; width: 100%; margin-top: 5px; padding: 9px 11px; border: 1px solid var(--line-2); border-radius: 6px; font: inherit; font-size: .95rem; color: var(--ink); background: #fff; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(23,122,115,.15); }
select { appearance: none; -webkit-appearance: none; padding-right: 32px; text-overflow: ellipsis;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%235d6975' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 11px center; }
label.check input { width: auto; margin: 0; }
input[type=checkbox] { width: 17px; height: 17px; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); }
textarea { resize: vertical; }
::placeholder { color: #98a2ab; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); margin: 0 0 16px; padding: 12px 16px 2px; min-width: 0; }
legend { font-weight: 600; font-size: .9rem; padding: 0 6px; color: var(--ink); }
/* At most two columns: four-across contact fields read cramped on wide pages. */
.grid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(max(240px, calc(50% - 20px)), 1fr)); gap: 0 20px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(max(200px, calc(33.3% - 14px)), 1fr)); gap: 0 20px; }
.form-section { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 20px; }
.form-section > h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.form-foot { display: flex; align-items: center; gap: 12px 20px; flex-wrap: wrap; margin-top: 6px; }
.form-foot .error:empty { display: none; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.flash { padding: 11px 15px; border-radius: 6px; margin-bottom: 18px; background: #e8f0fb; }
.flash.ok { background: #e6f4ea; } .flash.warn { background: #fdf3e1; }
.staging-banner { background: #7a3e00; color: #fff; text-align: center; font-size: 13px; font-weight: 600; padding: 6px 10px; letter-spacing: .02em; }
.manual-link { margin: 4px 0 16px; }
.note { font-size: .88rem; color: var(--muted); }
.samples { list-style: none; padding: 0; margin: 0; } .samples li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.samples a { font-weight: 600; word-break: break-all; }
.status-card h1 { margin-bottom: .3em; }
.status-card .ref { font-variant-numeric: tabular-nums; }

/* ---------- admin editors */
.editor fieldset.card { padding: 12px 16px 4px; } .editor legend { font-weight: 700; padding: 0 6px; }
.editor h3 { margin: 10px 0 6px; font-size: .95rem; color: var(--muted); }
.editor small { display: block; font-weight: 400; margin-top: 3px; } .editor small.hint { color: var(--muted); }
.editor label.bad input, .editor label.bad select, .editor label.bad textarea { border-color: var(--bad); }
pre.doc { white-space: pre-wrap; overflow-wrap: anywhere; font: 15px/1.55 "IBM Plex Sans", system-ui, -apple-system, sans-serif; margin: 0; }
.pill { display: inline-block; padding: 1px 9px; border-radius: 99px; font-size: .74rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; background: #e9ecef; color: #495057; vertical-align: middle; }
.s-new, .s-sent, .s-open, .s-requested { background: #e8f0fb; color: #1c4fa0; }
.s-accepted, .s-paid, .s-quoted, .s-confirmed { background: #e6f4ea; color: var(--ok); }
.s-declined, .s-void, .s-expired, .s-overdue { background: #fbeaea; color: var(--bad); }
.s-draft, .s-review { background: #fdf3e1; color: var(--warn); }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 8px 9px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .76rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.num { text-align: right; white-space: nowrap; }
table.lines tfoot td { border-bottom: 0; }
table.lines tr.total td, table.paysum tr.total td { font-weight: 700; font-size: 1.05rem; border-top: 2px solid var(--ink); }
table.meta th { text-transform: none; letter-spacing: 0; font-size: .9rem; width: 40%; }
table.edit input, table.edit select { margin: 0; padding: 5px 7px; }
.w-full { width: 100%; } .w-num { width: 90px; }
.stats { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 18px; min-width: 130px; }
.stat b { display: block; font-size: 1.6rem; font-weight: 600; }
.stat span { color: var(--muted); font-size: .85rem; }
.events { list-style: none; padding: 0; margin: 0; } .events li { padding: 4px 0; border-bottom: 1px dashed var(--line); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.actions form { margin: 0; }
.totals-inline { text-align: right; margin: 8px 0 14px; }

/* ---------- print quote */
.print-layout { display: grid; grid-template-columns: 1fr 360px; gap: 20px; align-items: start; margin-bottom: 20px; }
@media (max-width: 900px) { .print-layout { grid-template-columns: 1fr; } }
.summary { position: sticky; top: 16px; margin-bottom: 0; }
.summary h2 { display: flex; justify-content: space-between; align-items: baseline; }
.dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 40px 20px; border: 2px dashed var(--line-2); border-radius: var(--radius); background: #fff; text-align: center; cursor: pointer; font-weight: 400; color: var(--ink); transition: border-color .15s, background .15s; }
.dropzone:hover { border-color: var(--accent); }
.dropzone strong { font-size: 1.05rem; font-weight: 600; }
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone input { display: none; }
.item { display: grid; grid-template-columns: 220px 1fr; gap: 18px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-top: 14px; box-shadow: var(--shadow); }
@media (max-width: 640px) { .item { grid-template-columns: 1fr; } }
.item canvas { width: 100%; height: 200px; background: linear-gradient(#f1f4f6, #dfe5e9); border-radius: 6px; display: block; touch-action: none; }
.item .placeholder { height: 200px; display: flex; align-items: center; justify-content: center; border-radius: 6px; background: #eef2f4; color: var(--muted); text-align: center; padding: 12px; font-size: .9rem; }
.item h3 { margin: 4px 0 2px; word-break: break-all; font-size: 1rem; }
.item .opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 14px; margin-top: 12px; }
.item .opts label { font-size: .82rem; margin-bottom: 10px; }
.item .opts label.check { grid-column: 1 / -1; }
.item .opts select, .item .opts input { font-size: .9rem; padding-top: 7px; padding-bottom: 7px; }
.item .stats-line { font-size: .86rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.item .warn { color: var(--warn); font-size: .88rem; }
.item .remove { float: right; min-height: 32px; padding: 4px 12px; font-size: .85rem; font-weight: 500; }
#estimate table td { padding: 6px 4px; font-size: .9rem; }
.big-total { font-size: 1.7rem; font-weight: 600; text-align: right; margin: 10px 0 4px; font-variant-numeric: tabular-nums; }
.range { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; margin: 14px 0; }
.range strong { font-size: 1.6rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.files { list-style: none; padding: 0; } .files li { padding: 3px 0; }
.attach { margin-bottom: 14px; } .attach input { display: none; }
.viewer-box { margin-top: 12px; } .viewer-box canvas { width: 100%; height: 380px; background: linear-gradient(#f1f4f6, #dfe5e9); border-radius: 6px; display: block; touch-action: none; }

/* ---------- documents (quotes / invoices) */
.doc { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 32px 36px; margin-bottom: 20px; box-shadow: var(--shadow); }
.doc-head { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; border-bottom: 3px solid var(--accent); padding-bottom: 16px; margin-bottom: 18px; }
.doc-logo { height: 76px; width: auto; display: block; margin-bottom: 8px; border-radius: 8px; }
.doc-biz { font-size: 1.3rem; font-weight: 700; }
.doc-kind { text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; }
.doc-number { font-size: 1.4rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.doc-meta table.meta th { width: auto; padding-right: 14px; }
.doc-to { margin-bottom: 18px; }
.terms li { font-size: .88rem; color: var(--ink-2); }
.paid-stamp { font-size: 1.3rem; font-weight: 700; color: var(--ok); }
.accept-box, .pay-box { border-color: var(--accent); }
/* Phones: a wide table scrolls inside its own card instead of widening the page (which made
   mobile browsers zoom the whole admin page out — caught by the 390px smoke pass). */
@media (max-width: 640px) {
  main { padding: 22px 14px 40px; }
  .card, .doc { overflow-x: auto; padding: 18px 16px; }
  .path { padding: 22px 20px; }
  .path .cta { align-self: stretch; justify-content: center; }
  .form-foot .btn.primary { width: 100%; }
  .brand-name { font-size: .95rem; }
  .brand .logo { height: 36px; }
}
/* Quote/invoice on phones: each line becomes a compact block (description, then "qty × unit"
   and the amount) instead of a four-column table that scrolls sideways. */
@media (max-width: 640px) {
  .doc { overflow-x: visible; padding: 20px 16px; }
  .doc-head { gap: 12px; }
  .doc-meta { width: 100%; }
  .doc-logo { height: 56px; }
  table.lines thead { display: none; }
  table.lines, table.lines tbody, table.lines tfoot { display: block; }
  table.lines tbody tr { display: grid; grid-template-columns: auto 1fr auto; gap: 2px 6px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  table.lines tbody td { border: 0; padding: 0; }
  table.lines td.desc { grid-column: 1 / -1; font-weight: 500; }
  table.lines td.qty, table.lines td.unit { text-align: left; color: var(--muted); font-size: .9rem; }
  table.lines td.qty::after { content: " ×"; }
  table.lines td.amt { font-weight: 600; }
  table.lines tbody td[class=""], table.lines tbody td:not([class]) { grid-column: 1 / -1; color: var(--muted); font-size: .8rem; }
  table.lines tfoot tr { display: flex; justify-content: space-between; gap: 12px; }
  table.lines tfoot td { text-align: left; padding: 6px 0; }
  table.lines tfoot td.num:last-child { text-align: right; }
  .doc-actions .btn { flex: 1; }
  .doc-actions [data-print] { display: none; }
  table.lines tbody tr.one td.qty, table.lines tbody tr.one td.unit { display: none; }
  table.lines tbody tr.one { grid-template-columns: 1fr auto; }
  table.lines tbody tr.one td.amt { grid-column: 2; }
  table.lines.paysum tbody tr { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; }
  table.lines.paysum tbody td { grid-column: auto; color: inherit; font-size: inherit; }
  .accept-box .btn.primary { width: 100%; }
}
.doc-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn.ghost { background: transparent; }
.preview-bar { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; background: #fdf3e1; border: 1px solid #f1d9a8; color: #6b4a0b; border-radius: var(--radius); padding: 10px 14px; margin-bottom: 14px; font-size: .92rem; }
form[inert] { opacity: .6; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.search-row { display: flex; gap: 8px; align-items: center; margin: 4px 0 16px; max-width: 560px; }
.search-row input { margin: 0; flex: 1; }
.table-scroll { overflow-x: auto; }
ul.plain { list-style: none; padding: 0; margin: 0 0 12px; } ul.plain li { padding: 4px 0; }
/* Long unbroken file paths (the editors show where the saved copy lives) must wrap, not widen the
   page: at 390px a DATA_DIR path pushed /admin/rates and /admin/business to 431px. Fieldsets default
   to min-width:min-content, which defeats the card's overflow rule above, hence min-width:0. */
code { overflow-wrap: anywhere; }
.print-only { display: none; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print {
  @page { size: letter; margin: 0.6in 0.6in 0.75in;
    @bottom-right { content: "Page " counter(page) " of " counter(pages); font: 9pt system-ui, sans-serif; color: #666; } }
  .print-only { display: block !important; }
  .no-print, .topbar, .foot, .staging-banner, .flash { display: none !important; }
  body { background: #fff; font-size: 11pt; display: block; } main { padding: 0; max-width: none; }
  .doc { border: 0; padding: 0; margin: 0; box-shadow: none; }
  .doc-head, .pill, .paid-stamp { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  table.lines thead { display: table-header-group; }
  table.lines tr, .terms li, .how-to-pay, .doc-to, .accepted-line { break-inside: avoid; }
  .how-to-pay { border: 1px solid #999; border-radius: 6px; padding: 8px 12px; margin: 14px 0; }
}

/* records */
.records-table tr.total td { font-weight: 600; border-top: 2px solid var(--line-2); }
form.year-pick { display: flex; flex-direction: row; flex-wrap: nowrap; gap: 8px; align-items: center; margin: 0; }
form.year-pick select { margin: 0; width: auto; min-width: 96px; }
form.year-pick .btn { margin: 0; }
.stats.stats-5 { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.stats.stats-5 .stat { min-width: 0; }
.nowrap { white-space: nowrap; }
@media (max-width: 700px) {
  .stats.stats-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats.stats-5 .stat:last-child { grid-column: 1 / -1; }
  .records-table .opt { display: none; }
  .records-table { font-size: .86rem; }
  .records-table th, .records-table td { padding-left: 5px; padding-right: 5px; }
  .records-table th { letter-spacing: 0; }
  .dl-row .btn { flex: 1 1 100%; }
  .unpaid-table th:nth-child(2), .unpaid-table td:nth-child(2) { display: none; }
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* test-customer marker (admin only) */
.badge { display: inline-block; font-size: .7em; font-weight: 600; letter-spacing: .04em; padding: .1em .45em; border-radius: 4px; background: #fde68a; color: #713f12; vertical-align: middle; }

/* quote lead-time chart (customer page): name | when | bar. Bars are SVG in day units. */
.gantt { margin: 10px 0 12px; }
.g-row, .g-axis { display: grid; grid-template-columns: minmax(0, 15em) 6.5em minmax(0, 1fr); gap: 4px 14px; align-items: center; }
.g-row { padding: 9px 0; border-bottom: 1px solid var(--line); }
.g-name { font-weight: 500; }
.g-when { color: var(--ink-2); font-size: .9rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.g-row.wait .g-name, .g-row.wait .g-when { color: var(--muted); font-style: italic; font-weight: 400; }
.g-bar { display: block; width: 100%; height: 18px; overflow: visible; }
.g-track { fill: var(--bg); }
.g-fill { fill: var(--accent); }
.g-track { stroke: none; }
.g-grid { stroke: var(--line); stroke-width: 1px; }
.g-pause { stroke: #b54708; stroke-width: 3px; }
.g-axis { padding-top: 4px; font-size: .78rem; color: var(--muted); }
.g-ends { display: flex; justify-content: space-between; }
@media (max-width: 640px) {
  .g-row { grid-template-columns: minmax(0, 1fr) auto; }
  .g-bar { grid-column: 1 / -1; }
  .g-axis { grid-template-columns: minmax(0, 1fr); }
  .g-axis > span:not(.g-ends) { display: none; }
}
@media print {
  .gantt { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .g-row { break-inside: avoid; }
}

/* a box with its unit beside it ("$ [ 12.88 ]", "[ 4 ] hours") */
.unit-box { display: flex; align-items: center; gap: 6px; margin-top: 5px; }
.unit-box input, .unit-box select { margin-top: 0; flex: 1 1 auto; min-width: 0; }
.unit-box input.w-num { flex: 0 0 90px; }
.unit-box .unit { color: var(--muted); font-size: .85rem; font-weight: 400; white-space: nowrap; }
table.edit .unit-box { margin: 0; }
table.edit .unit-box input.w-num { flex-basis: 72px; }

/* ---------- projects, Now, time, expenses (2026-10-12) */
.p-lead, .p-quoted { background: #e8f0fb; color: #1c4fa0; }
.p-active { background: #e6f4ea; color: var(--ok); }
.p-waiting, .p-on_hold { background: #fdf3e1; color: var(--warn); }
.p-delivered { background: var(--accent-soft); color: var(--accent-hover); }
.p-closed { background: #e9ecef; color: #495057; }
.p-lost { background: #fbeaea; color: var(--bad); }
.due-late { color: var(--bad); font-weight: 600; }
.due-soon { color: var(--warn); font-weight: 600; }
.neg { color: var(--bad); }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.board { display: grid; grid-template-columns: repeat(5, minmax(200px, 1fr)); gap: 14px; margin-bottom: 20px; align-items: start; }
.bcol { background: #eaeef1; border-radius: var(--radius); padding: 10px; min-width: 0; }
.bcol h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); margin: 2px 4px 10px; }
.pcard { display: flex; flex-direction: column; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 10px; text-decoration: none; color: inherit; box-shadow: var(--shadow); overflow-wrap: anywhere; }
.pcard:hover { border-color: var(--accent); color: inherit; }
.pcode { font-size: .74rem; color: var(--muted); letter-spacing: .04em; }
.pnext { font-size: .88rem; color: var(--ink-2); }
.timer { border-left: 4px solid var(--line-2); }
.timer.on { border-left-color: var(--accent); background: var(--accent-soft); }
.timer .eyebrow { margin-bottom: 6px; }
.timer-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; justify-content: space-between; }
.timer-row label { margin: 0; } .timer-row .grow { flex: 1 1 220px; }
.timer-clock { font-size: 2rem; font-weight: 600; font-variant-numeric: tabular-nums; margin-top: 4px; }
.big-tap { min-height: 48px; min-width: 96px; font-size: 1.05rem; }
ul.tasks { list-style: none; padding: 0; margin: 0 0 12px; }
ul.tasks li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
ul.tasks li.done .task-body span:first-child { text-decoration: line-through; color: var(--muted); }
.task-body { flex: 1; min-width: 0; overflow-wrap: anywhere; }
button.tick { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line-2); background: #fff; cursor: pointer; padding: 0; flex: none; }
button.tick:hover { border-color: var(--accent); }
button.tick.on { background: var(--accent); border-color: var(--accent); }
.btn.small { padding: 6px 14px; min-height: 44px; font-size: .9rem; }
button.link.small { font-size: .82rem; color: var(--muted); }
.task-add { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.task-add input[name=title] { flex: 1 1 200px; margin: 0; }
.task-add .unit-box input { margin: 0; }
.stats-money .stat { flex: 1 1 140px; }
table.expenses tr.void td { color: var(--muted); text-decoration: line-through; }
.project-link { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; padding: 12px 16px; }
.project-link label { flex: 1 1 240px; margin: 0; }
details.card > summary { cursor: pointer; font-weight: 600; }
.pre { white-space: pre-wrap; }
@media (max-width: 1100px) { .board { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); } }
@media (max-width: 640px) {
  .board { grid-template-columns: 1fr; }
  .timer-row > * { flex: 1 1 100%; }
  .timer-row .big-tap { width: 100%; }
  .stats-money .stat { flex: 1 1 calc(50% - 12px); min-width: 0; }
}

/* books phase 2 */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.tile { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: inherit; }
.tile b { font-size: 1.3rem; }
.tile:hover { border-color: var(--line-2); }
.neg { color: #b42318; } .pos { color: #067647; }
.big { font-size: 1.15rem; font-weight: 600; }
.bank-lines { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.bank-line .suggest { margin: 8px 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.bank-line .suggest p { flex: 1 1 100%; margin: 0; }
.bank-line .bulk-pick { display: inline-flex; gap: 6px; align-items: center; margin: 4px 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
.grid2 .span2 { grid-column: 1 / -1; }
.bulk { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.checks { list-style: none; padding: 0; display: grid; gap: 8px; }
.check.fail { border-left: 4px solid #b42318; } .check.todo { border-left: 4px solid #b54708; } .check.ok { border-left: 4px solid #067647; }
.ok-box { border-left: 4px solid #067647; }
.review-nudge { display: block; text-decoration: none; color: inherit; border-left: 4px solid var(--accent); }
.btn.link { background: none; border: none; text-decoration: underline; padding: 0 4px; }
.reject code, .bank-line code { word-break: break-all; }
@media (max-width: 560px) {
  .grid2 { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: 1fr 1fr; }
  .tile b { font-size: 1.05rem; }
}
