/* Schibsted Grotesk: SIL Open Font License 1.1 (see /fonts/SchibstedGrotesk-LICENSE.txt), the one font for words and
   numbers since Nov 2026. Geist files stay for anything that still names them; IBM Plex stays for exported PDFs. */
@font-face { font-family: 'Schibsted Grotesk'; font-style: normal; font-weight: 400 900; font-display: swap; src: url(/fonts/SchibstedGrotesk-Variable.woff2) format("woff2"); }
@font-face { font-family: 'Schibsted Grotesk'; font-style: italic; font-weight: 400 900; font-display: swap; src: url(/fonts/SchibstedGrotesk-Italic-Variable.woff2) format("woff2"); }
/* Geist + Geist Mono: SIL Open Font License 1.1, Vercel (see /fonts/Geist-LICENSE.txt). */
@font-face { font-family: 'Geist'; font-style: normal; font-weight: 100 900; font-display: swap; src: url(/fonts/Geist-Variable.woff2) format("woff2"); }
@font-face { font-family: 'Geist Mono'; font-style: normal; font-weight: 100 900; font-display: swap; src: url(/fonts/GeistMono-Variable.woff2) format("woff2"); }

:root {
  /* The product's look (not any one company's): graphite trim, blue for anything clickable, soft red only for
     what Ben flags. Every color on screen comes from here, so Dark is just the second set below. */
  color-scheme: light;
  --brand: #16191D;          /* primary buttons, active tabs, bars */
  --brand-dark: #16191D;     /* headings and strong text */
  --brand-light: #9DB4F5;    /* focus rings */
  --brand-hover: #2C3136;
  --on-brand: #FFFFFF;       /* text on a --brand fill */
  --link: #2456B8;           /* anything you can click that isn't a button */
  --ink: #16191D;
  --text: #2A2E33;
  --ink-2: #60656A;
  --muted: #60656A;
  --gray: #8C949A;
  --line: #E4E4DF;
  --line-2: #EEEEEA;
  --bg: #F7F7F4;
  --card: #FFFFFF;
  --soft: #F0F0EC;
  --accent: #2456B8;
  --accent-ink: #2456B8;
  --accent-soft: #E8EEFA;
  --good: #2F6F52;
  --good-soft: #EAF3EE;
  --bad: #B5413B;
  --bad-soft: #FBEEEE;
  --pin: #E04F4F;            /* Ben's red pin: the one signature color, marks only */
  --warn: #A8741A;
  --warn-soft: #FBF4E6;
  --warn-line: #EBD9AF;
  --shadow: 0 1px 2px rgba(20, 24, 27, .04), 0 8px 24px rgba(20, 24, 27, .06);
  --radius: 16px;            /* round: content cards, dialogs */
  --radius-sm: 4px;          /* square: menu items, buttons, inputs (the structure) */
  /* motion (Acrocorinth Design System): every press, lift and slide uses these */
  --dur-instant: 90ms; --dur-quick: 160ms; --dur-move: 240ms; --dur-settle: 400ms;
  --ease-standard: cubic-bezier(.2, 0, 0, 1); --ease-enter: cubic-bezier(0, 0, 0, 1); --ease-exit: cubic-bezier(.3, 0, 1, 1);
  --shadow-2: 0 2px 4px rgba(20, 24, 27, .06), 0 16px 40px rgba(20, 24, 27, .12);
  --sans: 'Schibsted Grotesk', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'Schibsted Grotesk', system-ui, sans-serif;   /* numbers use the same font, with even-width digits */
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --brand: #ECEFF1;
  --brand-dark: #ECEFF1;
  --brand-light: #5C78C9;
  --brand-hover: #FFFFFF;
  --on-brand: #0D0F11;
  --link: #8AA9FF;
  --ink: #ECEFF1;
  --text: #D9DEE1;
  --ink-2: #98A2A8;
  --muted: #98A2A8;
  --gray: #6E787E;
  --line: #262B2F;
  --line-2: #1B1F22;
  --bg: #0D0F11;
  --card: #14171A;
  --soft: #1F2327;
  --accent: #8AA9FF;
  --accent-ink: #8AA9FF;
  --accent-soft: #1C2333;
  --good: #6FCF97;
  --good-soft: #15281D;
  --bad: #FF8A8A;
  --bad-soft: #2E1A1C;
  --pin: #FF8080;
  --warn: #E5B567;
  --warn-soft: #2A2316;
  --warn-line: #4A3D22;
  --shadow: 0 0 0 1px rgba(255, 255, 255, .02), 0 12px 32px rgba(0, 0, 0, .45);
  --shadow-2: 0 0 0 1px rgba(255, 255, 255, .04), 0 20px 48px rgba(0, 0, 0, .6);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--sans);
  font-feature-settings: 'tnum' 1, 'lnum' 1; /* numbers line up in columns */
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  font-weight: 400;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }

/* ---------- buttons & inputs ---------- */
.btn {
  font: inherit; font-weight: 500; cursor: pointer;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  padding: 8px 14px; border-radius: var(--radius-sm); display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap;
  transition: background var(--dur-instant) var(--ease-standard), border-color var(--dur-instant) var(--ease-standard), transform var(--dur-instant) var(--ease-standard);
}
.btn:active:not(:disabled) { transform: scale(.98); }
.btn:hover { border-color: var(--gray); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn.primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn.dark { background: var(--brand-dark); border-color: var(--brand-dark); color: var(--on-brand); }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--muted); }
.btn.small { padding: 5px 10px; font-size: 12px; }
.btn.danger { color: inherit; } /* no red text in Acrocorinth */
.btn:disabled { opacity: .5; cursor: default; }
.iconbtn {
  border: 0; background: transparent; cursor: pointer; color: var(--muted);
  padding: 4px 6px; border-radius: 6px; font-size: 14px; line-height: 1;
}
.iconbtn:hover { background: var(--line-2); color: var(--ink); }

input, select, textarea {
  font: inherit; color: inherit; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 7px 10px; background: var(--card); width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-light); outline-offset: -1px; border-color: transparent; }
label.field { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 500; color: var(--muted); }
label.field > span { font-size: 12px; }

/* ---------- layout ---------- */
#view { padding: 28px 32px 40px; max-width: 1600px; margin: 0 auto; }
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 4px 0 16px; flex-wrap: wrap; }
.pagehead h1 { margin: 0; font-weight: 400; font-size: 28px; color: var(--ink); letter-spacing: -.5px; }
.pagehead .sub { color: var(--muted); margin-top: 2px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); gap: 12px; }
.card-head h2 { margin: 0; font-size: 14px; font-weight: 500; color: var(--ink); letter-spacing: -.1px; }
.card-body { padding: 16px; }
.grid { display: grid; gap: 12px; }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }

/* ---------- sign in ---------- */
/* sign-in: full screen over the app frame, Paul's ring breathing behind a centered card */
.signin { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: var(--bg); overflow: hidden; }
.signin[hidden] { display: none; }
.signin-orb { position: absolute; left: 50%; top: 50%; width: min(96vmin, 1040px); height: min(96vmin, 1040px); transform: translate(-50%, -50%); pointer-events: none; }
@media (max-width: 700px) and (orientation: portrait) { .signin-orb { width: min(92vh, 820px); height: min(92vh, 820px); } } /* phones: the ring wraps above and below the card */
.signin-card { position: relative; z-index: 1; background: rgba(255, 255, 255, .88); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 40px 36px; text-align: center; max-width: 360px; width: 100%; }
.signin-mark { color: var(--ink); }
.signin-card h1 { font-weight: 400; color: var(--ink); font-size: 28px; letter-spacing: -.5px; margin: 18px 0 4px; }
.signin-card .btn { width: 100%; justify-content: center; margin: 18px 0 10px; padding: 11px; }
.signin-card { max-width: 380px; }
.signin-sub { margin: 0 0 22px; color: var(--muted); font-size: 14px; }
.signin-form { display: flex; flex-direction: column; gap: 14px; text-align: left; }
.signin-form[hidden] { display: none; }
.signin-form label.field > span { font-size: 12.5px; color: var(--ink-2); }
.signin-form input[type=email], .signin-form input[type=password] { height: 42px; padding: 0 12px; font-size: 15px; background: #FFFFFF; }
.signin-form .btn { margin: 4px 0 0; height: 44px; padding: 0; font-weight: 600; }
.signin-err { margin: -4px 0 0; font-size: 13px; color: var(--ink); display: flex; gap: 8px; align-items: baseline; }
.signin-err::before { content: ''; flex: 0 0 auto; width: 6px; height: 6px; border-radius: 50%; background: var(--pin); transform: translateY(-1px); } /* Paul's red pin marks the problem; the words stay black */
.signin-err[hidden] { display: none; }
.signin-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 2px; font-size: 12.5px; color: var(--ink-2); }
.signin-row-c { justify-content: center; }
.signin-stay { display: flex; align-items: center; gap: 7px; cursor: pointer; }
.signin-stay input { width: 14px; height: 14px; margin: 0; accent-color: var(--brand); }
.signin-link { border: 0; background: none; padding: 0; font: inherit; color: var(--ink-2); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line); }
.signin-link:hover { color: var(--ink); text-decoration-color: currentColor; }
.signin-note { margin: 16px 0 0; }
.signin-note:empty { display: none; }
.signin-pw { position: relative; }
.signin-pw .signin-link { position: absolute; right: 0; top: 0; font-size: 12.5px; line-height: 17px; z-index: 1; } /* sits on the Password label's line */

/* ---------- tables ---------- */
table { border-collapse: collapse; width: 100%; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 500; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--line-2); white-space: nowrap; }
td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--line-2); }
.tablewrap { overflow-x: auto; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 3px; font-size: 11px; font-weight: 600; background: var(--line-2); color: var(--ink-2); }
.pill.Bidding { background: var(--soft); color: var(--brand); }
.pill.s-estimating, .statussel.s-estimating { background: var(--warn-soft); color: var(--warn); }
.pill.s-bid-submitted, .statussel.s-bid-submitted { background: var(--accent-soft); color: var(--link); }
.pill.s-active, .statussel.s-active { background: var(--good-soft); color: var(--good); }
.pill.s-complete, .statussel.s-complete { background: var(--soft); color: #3f4a52; }
.pill.s-lost-on-hold, .statussel.s-lost-on-hold { background: #fbd5d5; color: #a11d1d; }
.pill[class*=" s-"]::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: currentColor; margin-right: 5px; vertical-align: 1px; }
.statussel option { background: var(--card); color: var(--text); }
.statussel { width: auto; min-width: 128px; border: 0; border-radius: 3px; font-size: 12px; font-weight: 700; padding: 3px 8px; cursor: pointer; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.chip { font: inherit; font-weight: 400; font-size: 13px; border: 1px solid var(--line); background: var(--card); color: var(--ink-2); border-radius: 999px; padding: 6px 13px; cursor: pointer; }
.chip span { color: var(--muted); font-weight: 500; margin-left: 2px; }
.chip.active { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.chip.active span { color: var(--on-brand); opacity: .7; }
.pill.Submitted { background: var(--soft); color: var(--brand-dark); }
.pill.Awarded, .pill.Active { background: var(--good-soft); color: var(--good); }
.pill.Lost { background: var(--bad-soft); color: var(--bad); }
.pill.Imported { background: var(--soft); color: var(--muted); }
.pill.Superseded { background: transparent; color: var(--muted); }
.search { max-width: 320px; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }

/* ---------- estimate editor ---------- */
.tabs { display: flex; gap: 8px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs button, .tabs a {
  text-decoration: none; display: inline-block;
  font: inherit; font-weight: 400; background: none; border: 0; cursor: pointer;
  padding: 10px 8px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tabs button.active, .tabs a.active { color: var(--ink); font-weight: 500; border-bottom-color: var(--ink); }
.tabs .count { font-size: 11px; background: var(--bad); color: var(--on-brand); border-radius: 3px; padding: 1px 6px; margin-left: 4px; }

.totalsbar {
  position: sticky; bottom: 0; z-index: 20; margin: 16px -20px -20px;
  background: var(--brand-dark); color: var(--on-brand); padding: 10px 20px;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.totalsbar .spacer + * { white-space: nowrap; }
.totalsbar .t { display: flex; flex-direction: column; }
.totalsbar .t span { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--gray); }
.totalsbar .t b { font-size: 16px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.totalsbar .t.big b { font-size: 20px; color: var(--brand-light); }
.totalsbar .spacer { flex: 1; }
.dirty-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand-light); display: inline-block; }
.savestate { font-size: 12px; color: var(--gray); display: flex; align-items: center; gap: 6px; }

.division { margin-bottom: 14px; }
.division-head {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  background: var(--line-2); border-bottom: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0;
}
.division-head h3 { margin: 0; font-size: 14px; font-weight: 500; color: var(--brand-dark); flex: 1; }
.division-head .divtotal { font-weight: 700; color: var(--brand-dark); font-variant-numeric: tabular-nums; }
.lines { width: 100%; table-layout: fixed; }
.lines th, .lines td { padding: 5px 6px; }
.lines td { vertical-align: top; }
.lines input, .lines select, .lines textarea { padding: 5px 7px; border-color: transparent; background: transparent; border-radius: 4px; }
.lines input:hover, .lines select:hover, .lines textarea:hover { border-color: var(--line); background: var(--card); }
.lines textarea { resize: none; overflow: hidden; min-height: 30px; line-height: 1.35; }
.lines select { padding-right: 2px; }
.lines .calc { padding: 6px 7px; font-variant-numeric: tabular-nums; text-align: right; }
.lines .calc.total { font-weight: 600; }
.lines tr.flag td { background: var(--bad-soft); }
.lines tr.flag select.sys { border-color: var(--bad); background: var(--card); }
.lines input.num { text-align: right; }
.hint { display: block; font-size: 11px; line-height: 1.25; color: var(--link); cursor: pointer; padding: 0 7px; text-align: right; white-space: normal; }
.hint:hover { text-decoration: underline; }
.rowactions { display: flex; gap: 0; justify-content: flex-end; opacity: .35; }
tr:hover .rowactions { opacity: 1; }
.addline { display: flex; gap: 8px; padding: 10px 14px; align-items: center; }
.addline input { max-width: 420px; }

.banner { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 14px; display: flex; gap: 10px; align-items: center; }
.banner.warn { background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn-line); } /* amber: no red text in Acrocorinth */
.banner.info { background: var(--warn-soft); border: 1px solid var(--line); color: var(--brand-dark); }

.sys-row { display: grid; grid-template-columns: 1fr 120px 32px; gap: 8px; margin-bottom: 8px; align-items: center; }
.rates { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 10px; }

/* summary */
.summary td, .summary th { padding: 7px 12px; }
.summary tr.subtotal td { font-weight: 700; color: var(--brand-dark); border-top: 1px solid var(--brand-dark); }
.summary tr.grand td { font-weight: 600; font-size: 16px; background: var(--brand); color: var(--on-brand); }
.summary tr.section td { font-weight: 700; font-style: italic; color: var(--accent); font-size: 13px; padding-top: 16px; }

/* history */
.stats { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; min-width: 140px; }
.stat span { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.stat b { font-size: 18px; color: var(--brand-dark); font-variant-numeric: tabular-nums; }

/* dialog */
dialog { border: 1px solid var(--line); border-radius: var(--radius); padding: 0; width: min(560px, 94vw); box-shadow: 0 20px 60px rgba(0,0,0,.25); background: var(--card); color: var(--text); }
dialog::backdrop { background: rgba(10, 12, 14, .45); }
dialog .card-head { border-radius: var(--radius) var(--radius) 0 0; }
dialog .foot { padding: 12px 16px; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line); }
.checks { display: flex; flex-direction: column; gap: 8px; }
.checks label { display: flex; gap: 8px; align-items: center; font-weight: 500; }
.checks input { width: auto; }

.picker { max-height: 340px; overflow: auto; border: 1px solid var(--line); border-radius: 3px; }
.picker button { display: flex; width: 100%; text-align: left; gap: 10px; border: 0; background: var(--card); padding: 8px 10px; cursor: pointer; font: inherit; border-bottom: 1px solid var(--line-2); }
.picker button:hover, .picker button:focus { background: var(--soft); outline: none; }
.picker .no { font-family: var(--mono); color: var(--muted); width: 44px; flex-shrink: 0; }
.picker .rt { margin-left: auto; color: var(--muted); }

.drop { display: block; border: 2px dashed var(--gray); border-radius: 4px; padding: 36px; text-align: center; background: var(--card); cursor: pointer; }
.drop.over { border-color: var(--brand); background: var(--soft); }

.toast {
  position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%) translateY(20px);
  background: var(--brand-dark); color: var(--on-brand); padding: 10px 16px; border-radius: var(--radius-sm); opacity: 0;
  transition: .2s; pointer-events: none; z-index: 100; max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateX(-50%); }
.toast.err { background: var(--bad); }

@media (max-width: 900px) {
  .grid.cols-4, .grid.cols-3 { grid-template-columns: 1fr 1fr; }
  .rates { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 600px) {
  .hide-sm { display: none; }
  .pagehead .actions { width: 100%; }
  .pagehead .actions .search { max-width: none; flex: 1 1 100%; }
  .grid.cols-4, .grid.cols-3 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  #view { padding: 14px; }
  .totalsbar { margin: 16px -14px -14px; gap: 14px; }
}
a.btn { text-decoration: none; }

.chip .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.dot.s-estimating { background: var(--warn); } .dot.s-bid-submitted { background: var(--link); } .dot.s-active { background: var(--good); }
.dot.s-complete { background: var(--gray); } .dot.s-lost-on-hold { background: var(--gray); opacity: .6; }

/* ---------- financials ---------- */
.fin-2col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.fin-2col .card + .card { margin-top: 0; }
.fin-payapp { grid-template-columns: minmax(0, 2.2fr) minmax(280px, 1fr); }
#finBody > .card + .card, #finBody > .fin-2col + .card, #finBody > .card + .fin-2col { margin-top: 16px; }
#finBody > .card { margin-bottom: 0; }
td.over, .over { color: var(--warn); }
td.under { color: var(--good); }
tfoot td { font-weight: 700; color: var(--brand-dark); border-top: 1px solid var(--brand-dark); background: var(--line-2); }
.fin-table td { white-space: nowrap; }
.fin-table td:nth-child(3) { white-space: normal; }
.fin-table input { padding: 4px 6px; min-width: 70px; }
.fin-table input.num, .fin-lines input.num { text-align: right; }
.g703 td:nth-child(2) { white-space: normal; min-width: 180px; }
.g703 input { width: 110px; }
.fin-lines input, .fin-lines select { border-color: var(--line); background: var(--card); }
.fin-lines tfoot td { background: transparent; border-top: 1px solid var(--line); }
tr.flag td { background: var(--bad-soft); }
dialog:has(form.wide) { width: min(900px, 96vw); }
.pill.fin-draft { background: var(--soft); color: var(--muted); }
.pill.fin-pending, .pill.fin-submitted { background: var(--warn-soft); color: var(--warn); }
.pill.fin-executed, .pill.fin-approved { background: var(--good-soft); color: var(--good); }
.pill.fin-paid { background: var(--accent-soft); color: var(--link); }
.pill.fin-closed { background: var(--soft); color: #3f4a52; }
.pill.fin-void, .pill.fin-rejected { background: var(--warn-soft); color: var(--warn); }
@media (max-width: 1100px) { .fin-2col, .fin-payapp { grid-template-columns: minmax(0, 1fr); } }
.pill.fin-profit { background: var(--soft); color: var(--brand); font-size: 10px; padding: 1px 6px; }
tfoot tr.sub td { font-weight: 600; color: var(--ink-2); border-top: 0; background: var(--line-2); }
.dc-form { display: grid; grid-template-columns: 150px minmax(160px, 1fr) minmax(220px, 1.4fr) 130px; gap: 12px; align-items: end; }
.dc-form > :nth-child(5) { grid-column: span 2; }
.dc-form .dc-go { display: flex; justify-content: flex-end; }
a.pill { text-decoration: none; }
@media (max-width: 900px) { .dc-form { grid-template-columns: 1fr 1fr; } .dc-form .dc-wide { grid-column: span 2; } }
/* live updates */
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #1f9d55; margin-right: 6px; vertical-align: 1px; box-shadow: 0 0 0 0 rgba(31,157,85,.5); animation: livepulse 2s infinite; }
@keyframes livepulse { 0% { box-shadow: 0 0 0 0 rgba(31,157,85,.45); } 70% { box-shadow: 0 0 0 6px rgba(31,157,85,0); } 100% { box-shadow: 0 0 0 0 rgba(31,157,85,0); } }
.presence { color: var(--ink-2); white-space: nowrap; }
.banner.live-banner { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn); }

/* Project documents */
#docsCard { position: relative; }
#docsCard .dropnote { display: none; }
#docsCard.over { border: 2px dashed var(--brand); background: var(--soft); }
#docsCard.over .dropnote { display: flex; position: absolute; inset: 0; align-items: center; justify-content: center; font-size: 16px; font-weight: 600; color: var(--brand-dark); background: var(--soft); border-radius: var(--radius); pointer-events: none; }
.doctable .docopen { font-weight: 500; color: var(--link); text-decoration: none; word-break: break-word; }
.doctable .docopen:hover { text-decoration: underline; }
.doctable select.docfolder { max-width: 170px; font-size: 12px; padding: 4px 6px; }
.chips select.chip.chipmore { width: auto; flex: 0 0 auto; border-style: dashed; color: var(--ink-2); font-weight: 600; padding: 5px 10px; height: auto; }
.docpath { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin: -2px 0 10px; font-size: 14px; }
.docpath a { color: var(--link); }
.doctable .docsubopen { font-weight: 600; color: var(--ink); text-decoration: none; }
.doctable tr.docsub:hover .docsubopen { text-decoration: underline; }
.doctable tr.open td { background: var(--line-2); }
.doctable tr.docdetail td { background: var(--line-2); padding: 14px 16px; }
.doctable .pill { margin-top: 4px; }
.pill.docreview { background: var(--soft); color: var(--brand-dark); }
.pill.docwarn { background: var(--warn-soft); color: var(--warn); }
.docgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 720px) { .docgrid { grid-template-columns: minmax(0, 1fr); } }
.impbar { height: 8px; background: var(--line-2); border-radius: 3px; margin: 10px 0 8px; overflow: hidden; }
.impbar > div { height: 100%; background: var(--brand); transition: width .4s; }

/* Awarded Sub: name + proposal link */
.subwrap { display: flex; align-items: center; gap: 2px; }
.subwrap input { flex: 1; min-width: 0; }
.subwrap .iconbtn { flex: none; font-size: 13px; }
.subwrap .iconbtn.clip { opacity: .35; }
tr:hover .subwrap .iconbtn.clip, .subwrap .iconbtn.clip:focus { opacity: 1; }
a.sublink { flex: 1; min-width: 0; padding: 6px 4px; color: var(--link); text-decoration: underline; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
a.sublink::before { content: '📄 '; text-decoration: none; display: inline-block; margin-right: 2px; }
.plist { max-height: 280px; overflow: auto; }
.pitem { display: flex; gap: 8px; align-items: flex-start; padding: 6px 8px; border-radius: 3px; cursor: pointer; }
.pitem:hover { background: var(--line-2); }
.pitem.match b { color: var(--ink); }
.pitem input { margin-top: 3px; }

/* ---------- Timecards ---------- */
.tc-weekbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.tc-week { display: flex; align-items: center; gap: 8px; font-size: 16px; color: var(--brand-dark); }
.tc-saved { margin-left: auto; }
.pill.tc-open { background: var(--warn-soft); color: var(--warn); }
.pill.tc-submitted { background: var(--accent-soft); color: var(--link); }
.pill.tc-approved { background: var(--good-soft); color: var(--good); }
.pill.tc-not-started { background: var(--soft); color: var(--muted); }
.tc-over { color: var(--warn); }
.tc-warn { color: var(--warn); }
.banner.tc-warn { background: var(--warn-soft); border-color: var(--warn-line); }
.tc-rows { display: grid; }
.tc-row { display: grid; grid-template-columns: 130px minmax(180px, 1.5fr) 205px 80px minmax(140px, 1.3fr) 36px; gap: 8px; align-items: center; padding: 8px 14px; border-bottom: 1px solid var(--line-2); }
.tc-rows:not(:has(.tc-row > div:nth-child(6))) .tc-row { grid-template-columns: 130px 205px 80px minmax(140px, 1fr) 36px; }
.tc-row.tc-head { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; background: var(--line-2); padding-top: 6px; padding-bottom: 6px; }
.tc-row select, .tc-row input { width: 100%; min-width: 0; }
.tc-row input[data-f="hours"], .tc-row .num { text-align: right; }
.tc-add { display: flex; gap: 8px; flex-wrap: wrap; padding: 10px 14px; align-items: center; }
.tc-add input { min-width: 0; }
.tc-days { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.tc-days > div { padding: 8px 10px; text-align: center; border-right: 1px solid var(--line-2); }
.tc-days > div:last-child { border-right: 0; background: var(--line-2); }
.tc-days span { display: block; font-size: 11px; color: var(--muted); }
.tc-days b { font-variant-numeric: tabular-nums; color: var(--brand-dark); }
.tc-days .hol span::after { content: ' ★'; }
.tc-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }
.tc-team input[data-f="name"] { width: 100%; min-width: 140px; }
.tc-team tr.muted td { opacity: .55; }
@media (max-width: 760px) {
  .tc-row.tc-head { display: none; }
  .tc-row, .tc-rows:not(:has(.tc-row > div:nth-child(6))) .tc-row { grid-template-columns: 1fr 1fr 36px; }
  .tc-row > div:nth-child(1) { grid-column: 1 / 2; }
  .tc-row > div:nth-child(2) { grid-column: 2 / 4; }
  .tc-row > div { grid-column: auto; }
  .tc-row > div:has(input[data-f="notes"]) { grid-column: 1 / 3; }
  .tc-days { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tc-days > div { border-bottom: 1px solid var(--line-2); }
  .tc-actions .btn { flex: 1; }
}
.tc-card { margin-bottom: 14px; }
.tc-req { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 12px 16px; border-top: 1px solid var(--line-2); flex-wrap: wrap; }
.tc-req-btns { display: flex; gap: 8px; }
.tc-reqform { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tc-reqform .tc-wide { grid-column: 1 / -1; }
.tc-hol { display: flex; gap: 12px; padding: 4px 0; }
.tc-hol span { min-width: 150px; color: var(--muted); }
.tc-locked { background: var(--line-2); }
.tabs .tc-count { background: var(--brand); }
.pill.tc-req-pending { background: var(--warn-soft); color: var(--warn); }
.pill.tc-req-approved { background: var(--good-soft); color: var(--good); }
.pill.tc-req-denied { background: var(--soft); color: #3f4a52; }
.pill.tc-req-cancelled { background: var(--soft); color: var(--muted); }
@media (max-width: 760px) { .tc-reqform { grid-template-columns: 1fr 1fr; } .tc-req-btns { width: 100%; } .tc-req-btns .btn { flex: 1; } }
.tc-kind { display: flex; gap: 22px; flex-wrap: wrap; font-size: 14px; }
.tc-kind label { display: flex; gap: 6px; align-items: center; cursor: pointer; font-weight: 600; color: var(--brand-dark); }
.tc-kind input { width: auto; margin: 0; }

/* Project contacts */
.cttable td { vertical-align: top; }
.ctsrc { margin-top: 3px; line-height: 1.35; }
.pill.ct-role { background: var(--soft); color: var(--brand-dark); font-weight: 600; }
.card-head { gap: 10px; flex-wrap: wrap; }

/* drag a document onto a folder */
.doctable tr[draggable] { cursor: grab; }
.doctable tr.dragging td { opacity: .45; }
.docdragging tr.docsub td { background: var(--line-2); }
.doctable tr.docsub.dropover td { background: var(--brand); }
.doctable tr.docsub.dropover td, .doctable tr.docsub.dropover a, .doctable tr.docsub.dropover .muted { color: var(--on-brand); }
.chip.dropover, .docpath a.dropover { outline: 2px solid var(--brand); outline-offset: 2px; }

/* Job Notes */
.notenew, .noteeditbox { width: 100%; box-sizing: border-box; font: inherit; resize: vertical; }
.notelist { margin-top: 14px; border-top: 1px solid var(--line); }
.note { padding: 12px 0; border-bottom: 1px solid var(--line); }
.notehead { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; margin-bottom: 4px; }
.notebody { white-space: pre-wrap; word-break: break-word; }
.noteacts { white-space: nowrap; }
.note .linkbtn { background: none; border: 0; padding: 0 2px; font: inherit; font-size: 12px; color: var(--muted); cursor: pointer; text-decoration: underline; }
.note .linkbtn:hover { color: var(--brand-dark); }

/* bid due date on the Projects list */
.duecell { white-space: nowrap; }
.duein { font: inherit; font-size: 13px; padding: 3px 6px; border: 1px solid var(--line); border-radius: 3px; background: var(--card); color: var(--ink); }
.duein.soon { border-color: var(--warn-line); background: var(--warn-soft); font-weight: 600; }
.duein.past { border-color: var(--gray); background: var(--soft); color: var(--muted); }

/* Final tag on a job's estimate versions */
.finalsel { font: inherit; font-size: 12px; padding: 2px 4px; border: 1px solid var(--line); border-radius: 3px; background: transparent; color: var(--muted); }
.finalsel.on { color: var(--brand-dark); border-color: var(--brand); font-weight: 600; background: var(--soft); }
/* an older version that a newer one replaced: quiet, not a call to action */
.finalsel.on.Superseded { color: var(--muted); border-color: var(--line); font-weight: 500; background: transparent; }
.hint.outside { color: var(--warn); font-weight: 600; }

/* Financials */
.fin-h3 { font-size: 13px; color: var(--brand-dark); margin: 0 0 6px; }
.fin-files { width: 100%; }
.fin-files td { padding: 7px 8px; vertical-align: middle; }
.fin-files tr.std td { background: var(--line-2); }
.dropzone { border: 1px dashed transparent; border-radius: 3px; }
.dropzone.over { border-color: var(--brand); background: var(--soft); }
/* Changes */
.chchip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 3px 8px; margin: 2px 4px 2px 0; border: 1px solid var(--line); border-radius: 3px; background: var(--card); cursor: pointer; white-space: nowrap; }
.chchip:hover { border-color: var(--brand); }
.chtable td { vertical-align: top; }
.chsides { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.chsides h3 { margin: 0 0 6px; font-size: 13px; }
.chsides .chchip { display: flex; width: fit-content; margin-bottom: 6px; }
.chtotals { display: flex; gap: 24px; padding: 8px 0; border-top: 1px solid var(--line); }
@media (max-width: 720px) { .chsides { grid-template-columns: minmax(0, 1fr); } }
.fin-table [data-buy] { visibility: hidden; }
.fin-table tr:hover [data-buy], .fin-table [data-buy]:focus { visibility: visible; }
@media (hover: none) { .fin-table [data-buy] { visibility: visible; } }

/* Job Facts */
.factpill { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 3px; white-space: nowrap; }
.factpill.ok { background: var(--good-soft); color: var(--good); }
.factpill.mid { background: var(--soft); color: var(--brand-dark); }
.factpill.low { background: var(--soft); color: var(--muted); }
.factpill.warn { background: var(--warn-soft); color: var(--warn); }
.factsources { margin-top: 6px; display: grid; gap: 4px; }
.factsource { padding: 4px 8px; border-left: 3px solid var(--line); background: var(--line-2); }
.factsource.agree { border-left-color: var(--good); }
.factsource.off { border-left-color: var(--warn-line); }
.facttable .linkbtn { background: none; border: 0; padding: 0; font: inherit; font-size: 11px; color: var(--muted); text-decoration: underline; cursor: pointer; }

/* Supers and carpenters: no folder rename/delete or approve-all (the server blocks them too).
   They can delete documents, contacts and notes; those go to Recently deleted for 30 days. */
.field-user #docRenameFolder, .field-user #docDeleteFolder, .field-user .ctapproveall { display: none !important; }
.fin-table a.fin-drill { color: var(--link); text-decoration: underline; text-underline-offset: 3px; }
.fin-table a.fin-drill:hover { color: var(--ink); }
.fin-table input.fin-fc { width: 100px; text-align: right; }

/* Executive dashboard */
.exstats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.exstat { min-width: 0; }
.exstat b { font-size: 22px; display: block; margin-top: 2px; }
.exstat .over { color: var(--warn); } .exstat .under { color: var(--good); }
.exgrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; margin-bottom: 14px; }
.exgrid .card { margin: 0; }
.exgrid .exwide { grid-column: 1 / -1; }
.exbody { padding: 12px 16px 14px; }
.exbars { display: grid; gap: 4px; }
.exbar, .exgantt-row { display: grid; grid-template-columns: minmax(120px, 30%) minmax(0, 1fr) 128px; align-items: center; gap: 10px; padding: 5px 4px; border-radius: 3px; color: var(--text); text-decoration: none; }
.exbar:hover, .exgantt-row:hover, .exbar:focus-visible, .exgantt-row:focus-visible { background: var(--line-2); outline: none; }
.exbar-l { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.exbar-t { position: relative; height: 16px; }
.exbar-track { display: block; height: 100%; background: var(--line-2); border-radius: 0 4px 4px 0; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.exbar-fill { display: block; height: 100%; background: var(--brand); border-radius: 0 4px 4px 0; }
.exbar-fill.neg { background: var(--warn); border-radius: 4px 0 0 4px; }
.exzero { position: absolute; top: -3px; bottom: -3px; width: 1px; background: var(--gray); }
.extick { position: absolute; top: -4px; bottom: -4px; width: 3px; margin-left: -1.5px; background: var(--brand-dark); border-radius: 2px; box-shadow: 0 0 0 2px var(--card); }
.exbar-v { font-size: 13px; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.exbar-v.warn { color: var(--warn); font-weight: 600; }
.exlegend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 12px; color: var(--ink-2); }
.exlegend .sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -2px; }
.sw-billed, .sw-done { background: var(--brand); }
.sw-left { background: var(--line-2); box-shadow: inset 0 0 0 1px var(--line); }
.sw-neg { background: var(--warn); }
.sw-tick { width: 3px !important; background: var(--brand-dark); }
.sw-diamond { width: 9px !important; height: 9px !important; background: var(--brand-dark); transform: rotate(45deg); border-radius: 1px !important; }
.sw-today { width: 2px !important; background: var(--warn); }
.exgantt-t { position: relative; height: 18px; }
.exgantt-axis .exgantt-t { height: 16px; border-bottom: 1px solid var(--line); }
.exgantt-axis .exgantt-t span { position: absolute; bottom: 2px; font-size: 11px; color: var(--muted); white-space: nowrap; padding-left: 3px; border-left: 1px solid var(--line); }
.exgantt-axis:hover { background: none; }
.exspan { position: absolute; top: 2px; bottom: 2px; background: var(--line-2); box-shadow: inset 0 0 0 1px var(--line); border-radius: 4px; overflow: hidden; }
.exspan.late { box-shadow: inset 0 0 0 1.5px var(--warn); }
.exspan-done { display: block; height: 100%; background: var(--brand); opacity: .85; }
.exbilled { position: absolute; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; background: var(--brand-dark); transform: rotate(45deg); border-radius: 1px; box-shadow: 0 0 0 2px var(--card); }
.extoday { position: absolute; top: -6px; bottom: -6px; width: 2px; margin-left: -1px; background: var(--warn); opacity: .8; }
.excols { display: flex; align-items: flex-end; gap: 6px; height: 190px; }
.excol { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: stretch; height: 100%; }
.excol-v { font-size: 11px; text-align: center; color: var(--ink-2); font-variant-numeric: tabular-nums; min-height: 15px; white-space: nowrap; }
.excol-bar { flex: 1; display: flex; align-items: flex-end; justify-content: center; border-bottom: 1px solid var(--line); }
.excol-bar span { display: block; width: min(44px, 80%); background: var(--brand); border-radius: 4px 4px 0 0; }
.excol:hover .excol-bar span { background: var(--brand-hover); }
.excol-l { font-size: 11px; text-align: center; color: var(--muted); margin-top: 4px; white-space: nowrap; }
.exalerts { margin-bottom: 14px; }
.exalerts ul { list-style: none; margin: 0; padding: 6px 16px 10px; }
.exalerts li { display: grid; grid-template-columns: 18px minmax(140px, max-content) 1fr; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line-2); font-size: 13px; align-items: baseline; }
.exalerts li:last-child { border-bottom: 0; }
.exalerts li a { font-weight: 600; white-space: nowrap; }
.exicon { font-size: 11px; color: var(--muted); }
.exalerts .lv2 .exicon, .exalerts .lv2 > span:last-child { color: var(--warn); font-weight: 600; }
.exalerts .lv1 .exicon { color: var(--warn); }
.extable th.sortable { cursor: pointer; white-space: nowrap; user-select: none; }
.extable td { white-space: nowrap; }
.extable tfoot td { font-weight: 700; border-top: 2px solid var(--line); }
.extable .over { color: var(--warn); } .extable .under { color: var(--good); }
.extable .linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--link); cursor: pointer; text-decoration: underline dotted; }
.exnote { padding: 10px 16px 14px; }
.exdates { grid-template-columns: 1fr 1fr; }
.extip { position: fixed; z-index: 1000; max-width: 320px; background: var(--brand-dark); color: var(--on-brand); font-size: 12px; line-height: 1.45; padding: 8px 10px; border-radius: 3px; box-shadow: 0 6px 18px rgba(0, 0, 0, .25); pointer-events: none; }
.extip b { font-weight: 700; }
@media (max-width: 1000px) { .exstats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .exgrid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) {
  .exbar, .exgantt-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "l v" "t t"; row-gap: 4px; }
  .exbar-l { grid-area: l; } .exbar-v { grid-area: v; } .exbar-t, .exgantt-t { grid-area: t; }
  .exgantt-axis .exbar-l, .exgantt-axis .exbar-v { display: none; }
  .exalerts li { grid-template-columns: 18px 1fr; } .exalerts li > span:last-child { grid-column: 2; }
  .exstat b { font-size: 18px; }
}
.exstat b span { display: inline; font-size: inherit; font-weight: inherit; text-transform: none; letter-spacing: normal; }
.fin-cleanup { margin-bottom: 14px; }
.fin-cleanup ul { list-style: none; margin: 0; padding: 4px 16px 10px; }
.fin-cleanup li { display: grid; grid-template-columns: 18px auto 1fr auto; gap: 10px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.fin-cleanup li:last-child { border-bottom: 0; }
.fin-cleanup .exicon { font-size: 11px; color: var(--muted); }
.fin-cleanup .lv2 .exicon { color: var(--warn); } .fin-cleanup .lv1 .exicon { color: var(--warn); }
@media (max-width: 640px) { .fin-cleanup li { grid-template-columns: 18px 1fr; } .fin-cleanup li > :nth-child(n+3) { grid-column: 2; } }

.totalsbar .t b .pct { font-size: 12px; font-weight: 600; opacity: .75; margin-left: 4px; }

/* Awarded Sub · Proposal: drop zone and what was read */
.dropzone { border: 2px dashed var(--line); border-radius: 4px; padding: 14px; text-align: center; display: grid; gap: 6px; justify-items: center; }
.dropzone.over { border-color: var(--brand); background: var(--soft); }
.readcard { border: 1px solid var(--line); border-radius: 4px; padding: 10px 12px; background: var(--line-2); }
.pperson { display: block; margin-top: 4px; }
/* Awarded Sub · Proposal window: wide enough for long proposal names, no sideways scroll */
dialog:has(form.propdrop) { width: min(780px, 96vw); }
form.propdrop { overflow-x: hidden; }
form.propdrop .card-body { max-height: calc(100vh - 200px); overflow-y: auto; }
.pitem input[type=radio], .pperson input, #pothers input { width: auto; flex: none; }
.pitem > span { min-width: 0; overflow-wrap: anywhere; }
.fin-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; margin-left: auto; cursor: pointer; white-space: nowrap; }
.fin-toggle input { width: auto; margin: 0; }

/* disclaimers: edit / remove on each row */
.disc-row .discacts { display: flex; gap: 2px; opacity: .35; }
.disc-row:hover .discacts, .disc-row .discacts:focus-within { opacity: 1; }
.disc-edit { margin: 6px 0; display: grid; gap: 6px; }
.disc-edit textarea { width: 100%; font: inherit; font-size: 13px; }
.disc-editbtns { text-align: right; }
@keyframes finFlash { from { background: var(--warn-soft); } to { background: transparent; } }
.fin-flash td { animation: finFlash 2.4s ease-out; }
.fin-lock { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; }
.fin-unlock { display: flex; gap: 6px; align-items: center; }
.fin-unlock input { width: 240px; }
.chsides .chchip { cursor: pointer; }
dialog input:disabled, dialog select:disabled, dialog textarea:disabled { background: var(--line-2); color: var(--ink-2); cursor: not-allowed; opacity: 1; }
.fin-unlocked { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; background: var(--warn-soft); border: 1px solid var(--warn-line); color: var(--warn); }
/* change event lines */
.celines td { vertical-align: middle; }
.celines input.num { width: 110px; }
.celines .chchip { font-size: 11px; padding: 2px 6px; }
.celines tr.cemark td { font-size: 12px; color: var(--ink-2); border-top: 0; padding-top: 2px; padding-bottom: 2px; }
.celines tr.cetotal td { border-top: 1px solid var(--line); }
.ceactions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
dialog:has(form.cedialog) { width: min(1240px, 97vw); }
.celines select { min-width: 0; width: 100%; }
.celines td:nth-child(1) { width: 26%; } .celines td:nth-child(2) { width: 24%; } .celines td:nth-child(3) { width: 18%; }
.cechip { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 3px; background: var(--line-2); cursor: pointer; white-space: nowrap; }
.cechip.fin-approved { background: var(--good-soft); color: var(--good); } .cechip.fin-draft, .cechip.fin-pending { background: var(--warn-soft); color: var(--warn); }
.cechip.fin-void, .cechip.fin-rejected { text-decoration: line-through; color: var(--muted); }
.celines input.cepct { width: 64px; }

/* DocuSign status + backup files */
.esbanner { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.esbanner .essteps { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; margin-top: 6px; }
.esstep { background: var(--card); border: 1px solid var(--line); border-radius: 3px; padding: 2px 9px; font-size: 12px; }
.esstep.es-completed { border-color: var(--good); }
.esarrow { color: var(--muted); }
.esbtns { display: flex; gap: 6px; flex-wrap: wrap; }
.cefiles .fbhead { display: flex; align-items: center; gap: 10px; margin: 4px 0 6px; }
.cefiles .fbhead h3 { margin: 0; font-size: 13px; }
.cefiles .fbhead label.btn { margin-left: auto; }
.cefiles .dropzone { min-height: 44px; }
.cefiles .fin-files { width: 100%; }
.cefiles .fin-files td { text-align: left; padding: 6px 8px; vertical-align: middle; }
.cefiles .fin-files td.num { text-align: right; width: 70px; }
/* ---------------- Books ---------------- */
.bk-count { font-size: 11px; background: var(--brand); color: var(--on-brand); border-radius: 3px; padding: 1px 7px; margin-left: 4px; }
.bk-drop { margin-bottom: 14px; padding: 16px; }
.bk-split { display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); gap: 14px; align-items: start; }
.bk-split .bk-listcard { position: sticky; top: 16px; max-height: calc(100vh - 96px); overflow: auto; }
.bk-split .bk-list .hide-sm { display: none; }
.bk-list tr.open td { background: var(--soft); }
.bk-detail .card-body { padding-top: 12px; }
.bk-twocol { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 16px; align-items: start; }
.bk-preview { border: 1px solid var(--line); border-radius: var(--radius); background: var(--line-2); height: min(78vh, 900px); overflow: hidden; position: sticky; top: 16px; }
.bk-preview iframe, .bk-preview img { width: 100%; height: 100%; border: 0; display: block; object-fit: contain; background: var(--card); }
.bk-form { display: grid; gap: 10px; align-content: start; min-width: 0; }
.bk-form .span-2 { grid-column: span 2; }
.bk-h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 14px 0 6px; }
.bk-lines { width: 100%; }
.bk-lines td { vertical-align: top; }
.bk-lines input:not([type=checkbox]), .bk-lines select { width: 100%; min-width: 0; }
.bk-gc input[data-r=vendor] { min-width: 150px; }
.bk-gc select { min-width: 150px; }
.bk-skipped td { opacity: .45; }
.bk-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.bk-rule { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--brand); background: var(--soft); border-radius: 4px; padding: 1px 5px; margin-left: 4px; white-space: nowrap; }
.bk-off, .bk-flag { color: var(--warn); } /* amber, not red */
.bk-flag + .bk-flag { margin-top: 2px; }
.bk-ok { color: var(--good); font-weight: 600; }
.bk-filedto { margin: 8px 0 0; padding-left: 18px; }
.pill.bk-reading { background: var(--soft); color: var(--brand); }
.pill.bk-warn, .pill.bk-conf-low { background: var(--warn-soft); color: var(--warn); }
.pill.bk-conf-high { background: var(--good-soft); color: var(--good); }
.pill.bk-conf-medium { background: var(--accent-soft); color: var(--link); }
.pill.bk-payroll { background: #e8e1f5; color: #4b2f86; }
.pill.bk-gcpay { background: var(--accent-soft); color: var(--link); }
.pill.bk-receipt, .pill.bk-invoice { background: var(--good-soft); color: var(--good); }
@media (max-width: 1100px) { .bk-twocol { grid-template-columns: 1fr; } .bk-preview { position: static; height: 60vh; } }
@media (max-width: 860px) { .bk-split { grid-template-columns: 1fr; } .bk-split .bk-listcard { position: static; max-height: 40vh; } }
.bk-alloc { display: grid; gap: 8px; }
.bk-line { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.2fr) 120px; gap: 8px 10px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--line-2); position: relative; }
.bk-line .bk-what { grid-column: 1 / -1; }
.bk-line select, .bk-line input { width: 100%; min-width: 0; }
.bk-line .bk-rm { position: absolute; top: 6px; right: 6px; }
.bk-allocfoot { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.bk-form .grid input, .bk-form .grid select { width: 100%; min-width: 0; }
.bk-form .tablewrap { max-width: 100%; }
.bk-detail { min-width: 0; overflow: hidden; }
.bk-form > * { min-width: 0; }
.bk-form { grid-template-columns: minmax(0, 1fr); }
.bk-gcrow { grid-template-columns: 44px repeat(6, minmax(0, 1fr)); }
.bk-gcrow .bk-gcsub { grid-column: span 3; }
.bk-gcrow label:nth-child(2), .bk-gcrow label:nth-child(3) { grid-column: span 2; }
.bk-skip input { width: auto !important; margin-top: 8px; }
.bk-gcrow.bk-skipped { opacity: .5; }

.card.ctover { outline: 2px dashed var(--brand); outline-offset: -2px; background: var(--soft); }
.thsf { font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--muted); font-size: 12px; margin-top: 2px; }
.qtywarn .qtyrow { margin-top: 4px; }
.qtywarn .linkbtn { margin-left: 6px; }

/* ---------------- Books: Ledger and Settings ---------------- */
.bk-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.bk-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.bk-toolbar select { max-width: 260px; }
.bk-toolbar .spacer { flex: 1; }
.bk-toolbar .field.inline { display: flex; align-items: center; gap: 8px; }
.bk-ledger { width: 100%; }
.bk-ledger td { vertical-align: top; }
.bk-ledger tbody.lg-entry { border-top: 2px solid var(--line); }
.bk-ledger tbody.lg-entry:hover td { background: var(--line-2); }
.bk-ledger .lg-date { white-space: nowrap; }
.bk-ledger .lg-acct a { color: inherit; text-decoration: none; }
.bk-ledger .lg-acct a:hover { text-decoration: underline; }
.bk-ledger .lg-cr { padding-left: 28px; }
.bk-ledger .lg-actions { white-space: nowrap; text-align: right; }
.bk-ledger .lg-group td { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--line-2); }
.bk-months { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.bk-month { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; display: grid; gap: 4px; }
.bk-month.closed { background: var(--line-2); }
.bk-line .bk-wide { grid-column: span 2; }

.mailitems { display: flex; flex-direction: column; }
.mailitem { padding: 12px 16px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.mailitem:first-child { border-top: 0; }
.mailtop { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.mailfiles a { font-weight: 500; }
.mailacts { display: flex; gap: 8px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.mailacts select { max-width: min(420px, 100%); }

/* ---------- chat pieces shared with Ben (public/ben.js) ---------- */
.as-files { margin-top: 4px; font-size: 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.as-files span { display: inline-flex; align-items: center; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 3px; padding: 3px 8px; color: var(--text); }
.as-sources { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; }
.as-sources a { color: var(--link); }
.as-doc { color: var(--link); font-weight: 600; text-decoration: none; border-bottom: 1px solid currentColor; }
.as-doc:hover { border-bottom-color: var(--link); }
.as-link { color: var(--link); text-decoration: none; border-bottom: 1px dotted var(--link); }
.as-link:hover { border-bottom-style: solid; }
.as-docs { margin-top: 4px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; font-size: 12.5px; }
.as-table { overflow-x: auto; margin: 4px 0 8px; } .as-table table { font-size: 12.5px; border-collapse: collapse; }
.as-table th, .as-table td { border-bottom: 1px solid var(--line-2); padding: 4px 8px; text-align: left; white-space: nowrap; }
.as-pending { display: flex; flex-wrap: wrap; gap: 6px; }
.as-chip { background: var(--soft); border-radius: 3px; padding: 3px 4px 3px 8px; font-size: 12px; display: inline-flex; align-items: center; gap: 4px; }
.as-chip-img { padding-left: 3px; }
.as-chip-img img { width: 40px; height: 30px; object-fit: cover; border-radius: 2px; border: 1px solid var(--line, rgba(0,0,0,.12)); background: #fff; }
.ben-shots { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; margin-bottom: 6px; }
.ben-shot { display: block; padding: 0; border: 1px solid var(--line, rgba(0,0,0,.12)); border-radius: 6px; overflow: hidden; background: var(--soft); cursor: zoom-in; max-width: min(320px, 100%); }
.ben-shot img { display: block; max-width: 100%; max-height: 240px; object-fit: contain; }
.ben-shot.loading { width: 160px; height: 100px; }
.ben-shot.loading img, .ben-shot.missing img { display: none; }
.ben-shot.missing { width: 160px; height: 40px; cursor: default; }
.ben-shot-view { border: 0; padding: 0; background: transparent; max-width: 94vw; max-height: 94vh; cursor: zoom-out; }
.ben-shot-view::backdrop { background: rgba(0,0,0,.75); }
.ben-shot-view img { display: block; max-width: 94vw; max-height: 88vh; object-fit: contain; background: #fff; }
.ben-shot-cap { color: #fff; font-size: 12px; text-align: center; padding-top: 6px; }
.as-chip button { border: 0; background: none; cursor: pointer; color: var(--muted); min-width: 24px; min-height: 24px; }
.as-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); animation: asPulse 1s ease-in-out infinite; vertical-align: middle; }
@keyframes asPulse { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Ben: the chat-first home (public/ben.js) ---------- */
/* Home: chat list + chat. Any other page: the chat on the left, the page beside it (#view, unchanged). */
body.ben-on #app { display: flex; align-items: flex-start; }
.ben { position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex: 0 0 420px; min-width: 0;
  background: var(--bg); border-right: 1px solid var(--line); }
body.ben-on #page { flex: 1 1 auto; min-width: 0; }
body.ben-on #view { margin: 0 auto; }
body.ben-home #page { display: none; }
body.ben-home .ben { flex: 1 1 auto; border-right: 0; }
body.ben-full .ben { display: none; }
.ben-rail { display: none; flex: 0 0 264px; width: 264px; flex-direction: column; gap: 18px; padding: 16px 12px; background: var(--card);
  border-right: 1px solid var(--line); overflow-y: auto; }
body.ben-home .ben-rail { display: flex; }
body.ben-rail-open .ben-rail { display: flex; position: absolute; z-index: 6; top: 0; bottom: 0; left: 0; box-shadow: 8px 0 24px rgba(0,59,73,.12); }
.ben-new { justify-content: center; min-height: 40px; }
.ben-sec { display: flex; flex-direction: column; gap: 2px; }
.ben-h { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 0 8px 6px; }
.ben-item { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 3px; color: var(--text);
  text-decoration: none; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; min-height: 36px; }
.ben-item > span { overflow: hidden; text-overflow: ellipsis; }
.ben-item:hover { background: var(--line-2); }
.ben-item.on { background: var(--soft); color: var(--brand-dark); font-weight: 600; }
.ben-item .mono { font-family: var(--mono); color: var(--muted); font-weight: 500; }
.ben-tag { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--brand); }
.ben-dot { flex: 0 0 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
.ben-none { padding: 4px 10px; }
.ben-pick { margin-top: 6px; font-size: 13px; }
.ben-alerts { margin-top: auto; border-top: 1px solid var(--line-2); padding-top: 14px; }
.ben-alerts .muted { padding: 0 8px; }
.ben-toggle { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 4px 8px; min-height: 36px; cursor: pointer; }
.ben-hint { display: block; font-size: 12px; color: var(--muted); }
.ben-toggle input { width: 18px; height: 18px; accent-color: var(--brand); flex: 0 0 auto; }

.ben-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; position: relative; }
.ben-main.drop { outline: 3px dashed var(--brand); outline-offset: -8px; }
.ben-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--card); min-height: 56px; }
.ben-titles { flex: 1 1 auto; min-width: 0; }
.ben-title { font-weight: 600; color: var(--brand-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ben-sub { font-size: 12px; color: var(--muted); }
.ben-railbtn, .ben-fullbtn { min-width: 36px; min-height: 36px; display: inline-flex; align-items: center; justify-content: center; }
body.ben-home .ben-railbtn, body.ben-home .ben-fullbtn { display: none; }
.ben-msgs { flex: 1 1 auto; overflow-y: auto; padding: 20px 16px; font-size: 14px; }
.ben-thread, .ben-empty, .ben-compose > * { max-width: 820px; margin-left: auto; margin-right: auto; }
.ben-thread { display: flex; flex-direction: column; gap: 14px; }
.ben-msgs p { margin: 0 0 6px; line-height: 1.55; } .ben-msgs ul, .ben-msgs ol { margin: 0 0 6px; padding-left: 20px; }
.ben-row { display: flex; gap: 10px; align-items: flex-start; }
.ben-row.mine { flex-direction: column; align-items: flex-end; gap: 4px; }
.ben-row > div { min-width: 0; }
.ben-av { flex: 0 0 auto; width: 22px; height: 22px; margin: 3px; border-radius: 50%; border: 1.5px dotted var(--ink-2); color: transparent; font-size: 0; }
.ben-orb { display: block; width: 220px; height: 220px; margin: 0 0 14px -30px; }
.ben-orb-sm { width: 28px; height: 28px; display: inline-block; flex: 0 0 auto; margin-right: 10px; }
.ben-working { display: flex; align-items: center; }
.ben-av.person { border: 0; width: 28px; height: 28px; margin: 0; background: var(--soft); color: var(--brand-dark); font-size: 12px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.ben-bubble { padding: 10px 12px; border-radius: 3px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; max-width: min(78%, 640px); }
.ben-row.mine .ben-bubble { max-width: min(85%, 640px); }
.ben-bubble.mine { background: var(--brand-dark); color: var(--on-brand); }
.ben-bubble.other { background: var(--card); border: 1px solid var(--line); max-width: 100%; }
.ben-meta { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.ben-answer { min-width: 0; max-width: 100%; overflow-wrap: anywhere; padding-top: 4px; }
.ben-act { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); padding-left: 38px; }
.ben-act svg { color: var(--good); flex: 0 0 auto; }
.ben-act.error, .ben-act.pending { color: var(--ink); }
.ben-act.error::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); flex: 0 0 auto; margin: 0 4px; }
.ben-card { flex: 1 1 auto; background: var(--card); border: 1px solid var(--line); border-top: 3px solid var(--line); border-radius: 3px; padding: 14px 16px;
  display: flex; flex-direction: column; gap: 10px; max-width: 560px; }
.ben-card.open { border-top-color: var(--brand); }
.ben-card-head { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--brand-dark); }
.ben-card-head svg { color: var(--brand); }
.ben-card-what { line-height: 1.5; }
.ben-card-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.ben-card-btns .btn { min-height: 40px; }
.ben-card-state { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.ben-card-state.ok { color: var(--good); }
.ben-card-state.bad { color: var(--ink); font-weight: 600; }
.ben-empty { padding: 24px 4px; color: var(--muted); }
.ben-empty h2 { margin: 0 0 6px; font-size: 24px; font-weight: 600; color: var(--brand-dark); letter-spacing: -.3px; }
.ben-empty p { margin: 0 0 10px; }
.ben-tries { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 18px; }
.ben-try { font: inherit; font-size: 13px; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 10px; padding: 8px 12px; cursor: pointer; min-height: 36px; }
.ben-try:hover { border-color: var(--brand-light); color: var(--brand); }
.ben-working { padding: 0 16px 6px; min-height: 18px; color: var(--muted); max-width: 852px; margin: 0 auto; font-size: 13px; }
.ben-working, .ben-compose { width: 100%; box-sizing: border-box; }
.ben-compose { padding: 4px 16px 16px; display: flex; flex-direction: column; gap: 6px; }
.ben-compose > * { width: 100%; }
.ben-form { display: flex; align-items: flex-end; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 8px; box-shadow: var(--shadow);
  transition: border-color var(--dur-quick) var(--ease-standard), box-shadow var(--dur-quick) var(--ease-standard); }
.ben-form:focus-within { border-color: var(--muted); box-shadow: var(--shadow-2); }
.ben-form textarea { flex: 1 1 auto; min-width: 0; border: 0; resize: none; padding: 9px 0; max-height: 200px; line-height: 1.4; }
.ben-form textarea:focus { outline: none; }
.ben-iconbtn { flex: 0 0 auto; width: 40px; height: 40px; border: 0; background: transparent; color: var(--muted); border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  transition: background var(--dur-instant) var(--ease-standard), color var(--dur-instant) var(--ease-standard), transform var(--dur-instant) var(--ease-standard); }
.ben-iconbtn:hover { color: var(--ink); background: var(--soft); }
.ben-iconbtn:active { transform: scale(.94); }
.ben-iconbtn.primary { background: var(--brand); color: var(--on-brand); margin-left: 4px; }
.ben-iconbtn.primary:hover { background: var(--brand-hover); color: var(--on-brand); }
.ben-iconbtn:disabled { opacity: .5; }
.ben-askbtn { min-height: 40px; }
.ben-fab { display: none; position: fixed; left: 80px; bottom: 16px; z-index: 40; align-items: center; gap: 8px; background: var(--brand); color: var(--on-brand);
  border: 0; border-radius: 3px; padding: 10px 16px; font: inherit; font-weight: 600; box-shadow: 0 6px 18px rgba(0,59,73,.22); cursor: pointer; min-height: 44px; }
body.ben-full .ben-fab { display: inline-flex; }
.ben-down { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 10px 20px; background: var(--soft); border-bottom: 1px solid var(--line); color: var(--brand-dark); }
.ben-down span { flex: 1 1 auto; }
@media print { .ben, .ben-fab, .ben-down { display: none !important; } body.ben-on #app { display: block; } body.ben-home #page { display: block; } }
/* phones and small tablets: the chat OR the page, with a button back to the chat */
@media (max-width: 900px) {
  body.ben-on #app { display: block; }
  body.ben-on:not(.ben-home) .ben { display: none; }
  body.ben-on:not(.ben-home) .ben-fab { display: inline-flex; }
  body.ben-home .ben { position: static; height: calc(100dvh - 64px); }
  body.ben-home .ben-rail { display: none; }
  body.ben-home .ben-railbtn { display: inline-flex; }
  body.ben-home.ben-rail-open .ben-rail { display: flex; width: min(300px, 86vw); }
  .ben-form textarea { font-size: 16px; } /* no zoom-on-focus on iPhone */
  .ben-msgs { padding: 14px 12px; }
  .ben-compose { padding: 4px 10px 12px; }
  body.ben-on #view { padding-bottom: 80px; }
}
/* ---------------- Books: Reports ---------------- */
.rp-head { margin: 4px 0 10px; }
.rp-head h2 { margin: 2px 0; font-size: 20px; }
.rp-table td, .rp-table th { white-space: nowrap; }
.rp-table td:first-child { white-space: normal; min-width: 220px; }
.rp-table .rp-sub td { border-top: 1px solid var(--line); background: var(--line-2); }
.rp-table .rp-key td { border-top: 2px solid var(--ink-2); font-size: 15px; }
.bk-report .card { overflow: hidden; }
@media print {
  body.printing-report header, body.printing-report nav, body.printing-report .pagehead, body.printing-report .tabs,
  body.printing-report .bk-chips, body.printing-report .bk-toolbar, body.printing-report #toast { display: none !important; }
  body.printing-report .card { box-shadow: none; border: 0; }
  body.printing-report .tablewrap { overflow: visible; }
  body.printing-report .rp-table { font-size: 10px; }
}
.bk-toolbar label.checks { display: flex; flex-direction: row; align-items: center; gap: 6px; align-self: flex-end; padding-bottom: 10px; }
.bk-toolbar label.checks input { margin: 0; width: auto; }

/* ---------------- Books: Dashboard ---------------- */
.bk-tiles .bk-tile { text-decoration: none; color: inherit; min-width: 190px; cursor: pointer; }
.bk-tiles .bk-tile:hover { border-color: var(--brand); }
.bk-tiles .bk-tile .small { margin-top: 2px; line-height: 1.35; }
.db-table td:first-child { min-width: 180px; }
.db-late { font-weight: 700; color: var(--brand-dark); }
.db-sync { display: flex; align-items: center; gap: 12px; justify-content: space-between; }
.db-head h2 { margin: 0; font-size: 22px; }
.db-more summary { padding: 10px 14px; cursor: pointer; color: var(--muted); }
.db-backup { margin: 4px 0 2px; gap: 8px; flex-wrap: wrap; }

/* ================= New look (Nov 2026): quiet labels, one accent, Ben's pinpoints =================
   Status labels are outlined text with a small colored dot instead of colored badges. */
.pill, .cechip, .factpill {
  background: transparent !important; color: var(--ink-2) !important; border: 1px solid var(--line);
  border-radius: 999px; font-weight: 500; padding: 1px 9px; font-size: 11.5px;
}
.pill { --dot: transparent; }
.pill::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--dot); margin-right: 6px; vertical-align: 1px; }
.pill:not([class*=" s-"]):not([class*=" fin-"]):not([class*=" tc-"]):not(.Bidding):not(.Submitted):not(.Awarded):not(.Active):not(.Lost)::before { display: none; }
.pill[class*=" s-"]::before { background: var(--dot); }
.pill.s-active, .pill.Active, .pill.Awarded, .pill.fin-executed, .pill.fin-approved, .pill.tc-approved, .pill.tc-req-approved, .pill.bk-conf-high { --dot: var(--good); }
.pill.s-estimating, .pill.Bidding, .pill.fin-pending, .pill.fin-submitted, .pill.tc-open, .pill.tc-req-pending, .pill.bk-warn, .pill.bk-conf-low { --dot: var(--warn); }
.pill.s-bid-submitted, .pill.Submitted, .pill.fin-paid, .pill.tc-submitted { --dot: var(--link); }
.pill.s-complete, .pill.fin-closed, .pill.fin-draft, .pill.tc-not-started, .pill.tc-req-denied, .pill.tc-req-cancelled, .pill.Imported { --dot: var(--gray); }
.pill.s-lost-on-hold, .pill.Lost, .pill.fin-void, .pill.fin-rejected { --dot: var(--gray); }
.pill.fin-void, .pill.fin-rejected { text-decoration: line-through; }
.statussel { background: var(--card) !important; color: var(--ink) !important; border: 1px solid var(--line) !important; border-radius: 999px; font-weight: 500 !important; }
.statussel.s-active { box-shadow: inset 3px 0 0 var(--good); }
.statussel.s-estimating { box-shadow: inset 3px 0 0 var(--warn); }
.statussel.s-bid-submitted { box-shadow: inset 3px 0 0 var(--link); }
.statussel.s-complete, .statussel.s-lost-on-hold { box-shadow: inset 3px 0 0 var(--gray); }
.chip.active { background: var(--ink); border-color: var(--ink); color: var(--on-brand); }
.card { border-radius: var(--radius); }
.card-head { padding: 14px 18px; }
.card-body { padding: 18px; }
.stat, .bk-month, .bk-line, .readcard, .exbar-track, .exspan { border-radius: var(--radius-sm); }
.stat b, .exstat b, .totalsbar .t b, .divtotal, .num, td.num, .calc { font-family: var(--mono); font-weight: 500; }
.stat span { text-transform: none; letter-spacing: 0; font-size: 12px; }
.stat b { color: var(--ink); }
a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--brand-light); outline-offset: 1px; }
.banner { border-radius: var(--radius-sm); }
.banner.info { background: var(--accent-soft); border: 1px solid var(--line); color: var(--ink); }
.banner.warn, .banner.live-banner, .banner.tc-warn, .fin-unlocked { background: var(--warn-soft); border: 1px solid var(--warn-line); color: var(--ink); }
.totalsbar { background: var(--card); color: var(--ink); border-top: 1px solid var(--line); box-shadow: 0 -8px 24px rgba(0,0,0,.04); }
.totalsbar .t span { color: var(--muted); text-transform: none; letter-spacing: 0; font-size: 11.5px; }
.totalsbar .t.big b { color: var(--ink); }
.savestate { color: var(--muted); }
.dirty-dot { background: var(--link); }
.summary tr.grand td { background: var(--ink); color: var(--on-brand); }
.summary tr.section td { color: var(--ink-2); font-style: normal; }
tfoot td { color: var(--ink); border-top: 1px solid var(--line); }
.lines tr.flag td, tr.flag td { background: var(--bad-soft); }
td.over, .over, .tc-over, .exbar-v.warn { color: var(--warn); }
.toast.err { background: var(--bad); color: #fff; }
.live-dot { background: var(--good); }
.pill.bk-payroll, .pill.bk-gcpay, .pill.bk-receipt, .pill.bk-invoice, .pill.bk-reading, .pill.ct-role, .pill.docreview, .pill.docwarn { --dot: transparent; }

/* ---------- the rail: product mark, pages, then search, theme, company, account ---------- */
body { padding-left: 64px; }
.rail {
  position: fixed; z-index: 40; left: 0; top: 0; bottom: 0; width: 64px;
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 0 14px;
  background: var(--card); border-right: 1px solid var(--line);
}
.rail .brand { color: var(--ink); display: flex; width: 40px; height: 40px; align-items: center; justify-content: center; margin-bottom: 14px; border-radius: var(--radius-sm); }
.nav { display: flex; flex-direction: column; gap: 4px; align-items: center; }
.nav a, .rail-btn {
  position: relative; width: 40px; height: 40px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center;
  color: var(--muted); text-decoration: none; background: transparent; border: 0; cursor: pointer; padding: 0;
  transition: background var(--dur-instant) var(--ease-standard), color var(--dur-instant) var(--ease-standard), transform var(--dur-instant) var(--ease-standard);
}
.nav a:active, .rail-btn:active { transform: scale(.94); }
.nav a span { display: none; }
.nav a:hover, .rail-btn:hover { color: var(--ink); background: var(--line-2); }
.nav a.active { color: var(--ink); background: var(--soft); }
/* the name of each icon on hover / keyboard focus */
.nav a::after, .rail-btn::after {
  content: attr(data-label); position: absolute; left: 50px; top: 50%; transform: translateY(-50%); white-space: nowrap;
  background: var(--ink); color: var(--on-brand); font-size: 12px; padding: 4px 8px; border-radius: 6px; pointer-events: none;
  opacity: 0; transition: opacity .12s; z-index: 50;
}
.nav a:hover::after, .nav a:focus-visible::after, .rail-btn:hover::after, .rail-btn:focus-visible::after { opacity: 1; }
.user { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.workspace { width: 40px; height: 40px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: #FFFFFF; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.workspace .brand-logo { width: 26px; height: 26px; object-fit: contain; display: block; }
.acct { position: relative; }
.avatar { width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--ink); color: var(--on-brand); font: 500 12px var(--sans); cursor: pointer; }
.acct-menu { position: absolute; left: 44px; bottom: 0; min-width: 220px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px; display: flex; flex-direction: column; gap: 10px; z-index: 60; }
.acct-email { font-size: 13px; color: var(--ink-2); word-break: break-all; }
.acct-menu .btn { justify-content: center; }
#themeBtn2 { display: none; }
@media (max-width: 760px) { #themeBtn2 { display: inline-flex; } }

/* ---------- ⌘K ---------- */
.pk { width: min(620px, 94vw); padding: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--card); color: var(--text); box-shadow: 0 24px 80px rgba(0,0,0,.28); margin-top: 14vh; }
.pk::backdrop { background: rgba(10, 12, 14, .35); }
.pk-box { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); color: var(--muted); }
.pk-box input { border: 0; padding: 4px 0; font-size: 16px; background: transparent; color: var(--ink); }
.pk-box input:focus, .pk-box input:focus-visible { outline: none; }
.pk-box kbd { font: 11px var(--mono); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; color: var(--muted); }
.pk-list { list-style: none; margin: 0; padding: 6px; max-height: 50vh; overflow-y: auto; }
.pk-list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm); cursor: pointer; }
.pk-list li.on { background: var(--soft); }
.pk-label { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pk-kind { color: var(--muted); font-size: 12px; white-space: nowrap; }
.pk-none { color: var(--muted); cursor: default !important; }

/* ---------- phones: the rail becomes a bottom bar ---------- */
@media (max-width: 760px) {
  body { padding-left: 0; padding-bottom: 64px; }
  .rail { top: auto; right: 0; width: auto; height: 64px; flex-direction: row; justify-content: space-around; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line); }
  .rail .brand, .workspace, #cmdkBtn, #themeBtn { display: none; }
  .nav { flex-direction: row; gap: 2px; flex: 1; justify-content: space-around; overflow-x: auto; scrollbar-width: none; }
  .nav a { width: auto; min-width: 52px; flex: 0 0 auto; height: 52px; flex-direction: column; gap: 2px; font-size: 10.5px; }
  .nav a span { display: block; }
  .nav a::after, .rail-btn::after { display: none; }
  .user { margin: 0; flex-direction: row; }
  .acct-menu { left: auto; right: 0; bottom: 44px; }
  .ben-fab { left: 16px; bottom: 80px; }
  body.ben-home .ben { height: calc(100dvh - 64px); }
  #view { padding: 18px 16px 24px; }
  .totalsbar { bottom: 64px; }
}
@media print { .rail { display: none !important; } body { padding: 0 !important; } }

/* =====================================================================================================
   The new look, applied to every page (matches the approved mockups: Geist, graphite trim, blue links).
   Kept as one layer at the end so each screen picks it up without being rewritten by hand.
   ===================================================================================================== */
#page { min-width: 0; }
#view { max-width: 1480px; padding: 28px 32px 48px; }

/* top bar: where you are + search / ask */
.topbar { position: sticky; top: 0; z-index: 15; display: flex; align-items: center; gap: 16px; padding: 12px 32px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line); font-size: 13px; }
.crumbs { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 8px; white-space: nowrap; overflow: hidden; color: var(--muted); }
.crumbs a { color: var(--muted); text-decoration: none; overflow: hidden; text-overflow: ellipsis; }
.crumbs a:hover { color: var(--link); }
.crumbs [aria-current] { color: var(--ink); overflow: hidden; text-overflow: ellipsis; }
.crumbs .sep { color: var(--gray); }
.topsearch { font: inherit; display: flex; align-items: center; gap: 8px; min-width: 280px; padding: 6px 8px 6px 10px; cursor: text;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card); color: var(--muted); }
.topsearch:hover { border-color: var(--gray); }
.topsearch-label { flex: 1 1 auto; text-align: left; }
.topsearch kbd { font-family: var(--mono); font-size: 11px; border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; color: var(--muted); }
/* Back: top left of every screen (public/backnav.js) */
.topback { font: inherit; flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px 5px 8px; margin-left: -8px; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card); color: var(--ink); }
.topback:hover { border-color: var(--gray); color: var(--link); }
.topback:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.topback[hidden] { display: none; }
/* the crumbs already say where "back" is */
body.has-topbar .pagehead > div > a.small:first-child { display: none; }

/* page headers */
.pagehead { align-items: flex-end; margin: 0 0 22px; }
.pagehead h1 { font-size: 30px; font-weight: 450; letter-spacing: -.6px; line-height: 1.15; }
.pagehead .sub { margin-top: 6px; font-size: 13.5px; }
.pagehead .actions { gap: 8px; }

/* numbers strips: one card, hairline dividers, big mono figures */
.stats { display: flex; flex-wrap: wrap; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; margin-bottom: 22px; }
.stat { flex: 1 1 180px; background: var(--card); border: 0; border-radius: 0; padding: 16px 18px; min-width: 0; }
.stat span { font-size: 12px; text-transform: none; letter-spacing: 0; color: var(--muted); }
.stat b { display: block; margin-top: 6px; font-family: var(--mono); font-size: 20px; font-weight: 500; color: var(--ink); letter-spacing: -.3px; }
.stat .small { margin-top: 4px; }

/* tables */
th { background: transparent; font-size: 11px; letter-spacing: .05em; font-weight: 500; color: var(--muted); padding: 11px 12px; }
td { padding: 11px 12px; color: var(--ink); }
td.num, th.num { font-family: var(--mono); font-size: 13px; }
th.num { font-family: var(--sans); font-size: 11px; }
tbody tr:last-child td { border-bottom: 0; }
tr.clickable:hover td { background: var(--soft); }
tfoot td { background: transparent; border-top: 1px solid var(--line); color: var(--ink); font-weight: 600; }
tfoot tr.sub td { background: transparent; }
.card .tablewrap { border-radius: var(--radius); }
.card > .tablewrap > table thead th:first-child, .card > .tablewrap > table td:first-child { padding-left: 18px; }
.card > .tablewrap > table thead th:last-child, .card > .tablewrap > table td:last-child { padding-right: 18px; }
.card-head { padding: 14px 18px; }
.card-head h2 { font-size: 14.5px; }
.card + .card, #finBody > .card + .card { margin-top: 18px; }

/* Ben's pinpoints instead of red rows */
tr.flag td, .lines tr.flag td { background: transparent; }
tr.flag > td:first-child, tr.pin > td:first-child { position: relative; }
tr.flag > td:first-child::before, tr.pin > td:first-child::before {
  content: ""; position: absolute; left: 5px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%;
  background: var(--pin); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pin) 18%, transparent); }
.card > .tablewrap > table tr.flag > td:first-child::before, .card > .tablewrap > table tr.pin > td:first-child::before { left: 7px; }
.lines tr.flag > td:first-child::before { top: 18px; left: 0; }
.lines tr.flag select.sys { border-color: color-mix(in srgb, var(--pin) 60%, var(--line)); }

/* the profit / summary tables: calmer totals */
.summary tr.subtotal td { border-top: 1px solid var(--line); color: var(--ink); font-weight: 600; }
.summary tr.grand td { background: transparent; color: var(--ink); font-size: 16px; font-weight: 600; border-top: 1px solid var(--ink); }
.summary tr.grand td.num { font-family: var(--mono); }
.summary tr.section td { font-style: normal; color: var(--muted); font-weight: 500; font-size: 11px; letter-spacing: .05em; text-transform: uppercase; padding-top: 18px; }

/* status: outlined, never red text */
.pill.s-lost-on-hold, .statussel.s-lost-on-hold, .pill.Lost { background: transparent; color: var(--muted); }
.banner.info { background: var(--card); border: 1px solid var(--line); color: var(--ink-2); }
.toast.err { background: var(--brand-dark); }
.tabs { gap: 22px; margin-bottom: 22px; }
.tabs button, .tabs a { padding: 10px 0; }
.tabs .count { background: transparent; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; }
.chip { padding: 5px 12px; }

/* Ben's read: one line at the top of a page */
.ben-read { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; margin: 0 0 22px; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--card); font-size: 14px; line-height: 1.55; color: var(--ink); }
.ben-read-mark { flex: 0 0 26px; width: 26px; height: 26px; display: block; margin-top: -1px; }
.ben-read-text { min-width: 0; }
.ben-read-text b { font-weight: 550; }
.ben-read .mono { font-family: var(--mono); font-size: 13px; }
.ben-read-acts { white-space: nowrap; }
.ben-read-acts a, .ben-read-acts .linkbtn { color: var(--link); text-decoration: none; font: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.ben-read-acts a:hover, .ben-read-acts .linkbtn:hover { text-decoration: underline; }
.ben-read-acts .sep { color: var(--gray); margin: 0 6px; }
.pinmark { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--pin); vertical-align: 2px; margin-right: 6px;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--pin) 18%, transparent); }

@media (max-width: 760px) {
  .topbar { padding: 10px 14px; gap: 10px; }
  .topsearch { min-width: 0; padding: 6px 8px; }
  .topsearch-label, .topsearch kbd { display: none; }
  .crumbs > :not(:last-child) { display: none; }
  .topback { margin-left: 0; padding: 6px; }
  .topback-label { display: none; }
  #view { padding: 18px 14px 88px; }
  .pagehead h1 { font-size: 24px; }
  .stat { flex-basis: 45%; padding: 12px 14px; }
  .stat b { font-size: 17px; }
  .ben-read { padding: 12px; font-size: 13.5px; }
}
@media print { .topbar, .ben-read { display: none !important; } }
td.mono { font-family: var(--mono); font-size: 13px; }
.pname { font-weight: 500; color: var(--ink); }
tr.flag > td:first-child::before, tr.pin > td:first-child::before { top: 19px; margin-top: -3px; }
.pagehead .actions .search { width: 280px; flex: 0 1 280px; }
details.explain { margin: 0 0 14px; font-size: 13px; color: var(--muted); }
details.explain summary { cursor: pointer; color: var(--link); width: max-content; }
details.explain p { margin: 8px 0 0; max-width: 900px; line-height: 1.55; color: var(--ink-2); }
/* the button that opens Ben's chat beside a page: quiet, bottom right, above any totals bar */
.ben-fab { left: auto; right: 24px; bottom: 20px; border-radius: 999px; padding: 8px 16px 8px 12px; min-height: 40px; font-weight: 500;
  background: var(--card); color: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow); }
.ben-fab:hover { border-color: var(--gray); }
body:has(#totalsbar) .ben-fab { bottom: 84px; }
@media (max-width: 760px) { .ben-fab { left: auto; right: 14px; bottom: 80px; } body:has(#totalsbar) .ben-fab { bottom: 144px; } .pagehead .actions .search { width: auto; flex: 1 1 100%; } }
.ben-fab-mark { width: 22px; height: 22px; display: block; }

/* Ben's home: just the living presence and a greeting, centered */
.ben-empty.ben-hero { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  min-height: calc(100% - 20px); padding: 4vh 0 2vh; }
.ben-hero .ben-orb { width: min(420px, 62vw); height: min(420px, 62vw); margin: 0 0 8px; }
.ben-hero h2 { margin: 0; font-size: 30px; font-weight: 450; letter-spacing: -.6px; color: var(--ink); }
@media (max-width: 760px) { .ben-hero h2 { font-size: 24px; } }

/* Ben's home ring: the presence in the middle, the person's tools around it */
.ben-empty.ben-hero { max-width: 1080px; }
.ben-hub { position: relative; width: min(1040px, 100%); aspect-ratio: 1040 / 660; margin: 0 auto; }
.ben-hero .ben-hub .ben-orb { position: absolute; left: 50%; top: 50%; width: 46%; height: auto; aspect-ratio: 1; transform: translate(-50%, -50%); margin: 0; }
.hub-ring { position: absolute; inset: 9%; border: 1px dashed var(--line); border-radius: 50%; pointer-events: none; }
.hub-cap { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 27%; text-align: center; pointer-events: none; }
.ben-hero .hub-cap h2 { font-size: 22px; letter-spacing: -.4px; }
.hub-cap p { margin: 6px 0 0; font-size: 13.5px; color: var(--muted); }
.hub-tool { position: absolute; transform: translate(-50%, -50%); width: 190px; min-height: 64px; box-sizing: border-box; display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); color: var(--ink); text-decoration: none; text-align: left;
  box-shadow: var(--shadow); transition: transform var(--dur-quick) var(--ease-enter), box-shadow var(--dur-quick) var(--ease-enter), border-color var(--dur-quick); }
.hub-tool:hover, .hub-tool:focus-visible { transform: translate(-50%, -50%) translateY(-2px); box-shadow: var(--shadow-2); border-color: var(--ink-2); outline: none; color: var(--ink); text-decoration: none; }
.hub-ic { width: 36px; height: 36px; flex: none; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: var(--soft); color: var(--ink); }
.hub-tx { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hub-tx b { font-size: 14.5px; font-weight: 600; }
.hub-tx small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (prefers-reduced-motion: reduce) { .hub-tool { transition: none; } }
.hub-edit { position: absolute; right: 0; bottom: 0; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; }
.hub-edit:hover, .hub-edit:focus-visible { color: var(--ink); border-color: var(--ink-2); }
.hub-dialog { width: min(440px, calc(100vw - 32px)); border: 1px solid var(--line); border-radius: 14px; padding: 22px; background: var(--card); color: var(--ink); }
.hub-dialog::backdrop { background: rgba(10, 12, 14, .35); }
.hub-dialog h3 { margin: 0 0 4px; font-size: 18px; }
.hub-pick { display: flex; flex-direction: column; gap: 8px; margin: 14px 0 18px; }
.hub-pick label { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.hub-pick input { width: 18px; height: 18px; margin: 0; flex: none; accent-color: var(--brand); }
.hub-pick label:has(input:not(:checked)) { opacity: .55; }
.hub-dlg-actions { display: flex; justify-content: flex-end; gap: 8px; }
.ben-h-btns { display: inline-flex; align-items: center; gap: 2px; }
.ben-hbtn-icon { padding-left: 6px; padding-right: 6px; }
.mem-dialog { width: min(560px, calc(100vw - 32px)); }
.mem-add { display: flex; gap: 8px; margin: 14px 0 10px; }
.mem-add input { flex: 1; min-width: 0; min-height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); font: inherit; font-size: 14px; }
.mem-list { max-height: min(52vh, 460px); overflow: auto; display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.mem-row { display: flex; align-items: center; gap: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.mem-row .mem-edit { margin: 0; }
.mem-tx { flex: 1; min-width: 0; font-size: 14px; line-height: 1.45; }
.mem-tx small { font-size: 12px; }
.mem-none { padding: 12px 2px; }
.mem-lvl { width: auto; min-height: 38px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); font: inherit; font-size: 13px; padding: 0 8px; }
@media (max-width: 900px) {
  .ben-hub { aspect-ratio: auto; display: flex; flex-direction: column; align-items: center; gap: 10px; }
  .ben-hero .ben-hub .ben-orb { position: relative; left: auto; top: auto; transform: none; width: min(300px, 70vw); }
  .hub-ring { display: none; }
  .hub-cap { position: static; transform: none; width: auto; margin-top: -8px; }
  .hub-tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; width: 100%; margin-top: 12px; }
  .hub-tool, .hub-tool:hover, .hub-tool:focus-visible { position: static; transform: none; width: auto; }
  .hub-edit { position: static; margin-top: 4px; }
}

/* Ben's chat list: folders */
.ben-h-row { display: flex; align-items: center; justify-content: space-between; }
.ben-hbtn { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; margin: -6px -4px -4px 0; border: 0; border-radius: 6px;
  background: transparent; color: var(--muted); cursor: pointer; }
.ben-hbtn:hover { background: var(--line-2); color: var(--ink); }
.ben-folder { border-radius: 6px; }
.ben-folder-row { display: flex; align-items: center; gap: 7px; padding: 7px 8px 7px 6px; border-radius: 6px; color: var(--ink); cursor: pointer; min-height: 36px; user-select: none; }
.ben-folder-row:hover { background: var(--line-2); }
.ben-folder-row svg { flex: 0 0 auto; color: var(--muted); }
.ben-caret { display: inline-flex; color: var(--muted); transition: transform .15s; }
.ben-caret.open { transform: rotate(90deg); }
.ben-fname { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.ben-count { font-size: 12px; color: var(--muted); font-family: var(--mono); }
.ben-folder-kids { padding-left: 18px; display: flex; flex-direction: column; gap: 2px; }
.ben-folder-kids .ben-none { padding: 4px 10px 8px; }
.ben-loose { display: flex; flex-direction: column; gap: 2px; min-height: 12px; border-radius: 6px; }
.ben-more { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; margin: -4px -4px -4px 0; border: 0;
  border-radius: 5px; background: transparent; color: var(--muted); cursor: pointer; opacity: 0; }
.ben-item:hover .ben-more, .ben-folder-row:hover .ben-more, .ben-item.on .ben-more, .ben-more:focus-visible { opacity: 1; }
.ben-folder-row:hover .ben-count { display: none; }
.ben-more:hover { background: var(--line); color: var(--ink); }
@media (hover: none) { .ben-more { opacity: 1; } .ben-count { display: none; } }
.drop-on { background: var(--soft); box-shadow: inset 0 0 0 1px var(--link); }
.ben-editing { padding: 4px 6px; }
.ben-rename { flex: 1 1 auto; min-width: 0; font: inherit; padding: 5px 8px; border: 1px solid var(--link); border-radius: 5px; background: var(--card); color: var(--ink); outline: none; }
.ben-menu { position: fixed; z-index: 60; min-width: 200px; max-width: 280px; max-height: 60vh; overflow-y: auto; padding: 5px; background: var(--card);
  border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); font-size: 13.5px; }
.ben-menu button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 9px; border: 0; border-radius: 5px; background: transparent;
  color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.ben-menu button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ben-menu button svg { flex: 0 0 auto; color: var(--muted); }
.ben-menu button:hover, .ben-menu button:focus-visible { background: var(--line-2); outline: none; }
.ben-menu button.on { font-weight: 600; }
.ben-menu-sep { height: 1px; margin: 5px 4px; background: var(--line); }
.ben-menu-head { padding: 6px 9px 3px; font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.ben-hbtn { width: auto; gap: 5px; padding: 0 6px; font: inherit; font-size: 11px; letter-spacing: .04em; }

/* Collapsible boxes (collapse.js): click the title bar to fold a box down to its title */
.card.collapsible > .card-head { cursor: pointer; user-select: none; }
.card.collapsible > .card-head > h2 { display: flex; align-items: center; gap: 8px; }
.card.collapsible > .card-head > h2::before {
  content: ''; flex: none; width: 6px; height: 6px; margin: 0 2px 0 1px;
  border-right: 1.5px solid var(--muted, #888); border-bottom: 1.5px solid var(--muted, #888);
  transform: rotate(45deg) translate(-2px, -2px); transition: transform .15s ease;
}
.card.collapsible.collapsed > .card-head > h2::before { transform: rotate(-45deg); }
.card.collapsible > .card-head:hover > h2::before { border-color: var(--ink); }
.card.collapsible > .card-head:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.card.collapsed > :not(.card-head) { display: none !important; }
.card.collapsed > .card-head { border-bottom: 0; }
/* ---- Site weather card (public/weather.js) ---- */
.wx { --wx-sun: #C8901E; --wx-wet: var(--link); --wx-amber: #9A6A12; }
:root[data-theme="dark"] .wx { --wx-sun: #E5B567; --wx-amber: #E5B567; }
.wx-ico { flex: none; fill: none; stroke: var(--ink-2); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.wx-ico .wx-sun { stroke: var(--wx-sun); }
.wx-ico .wx-moon { stroke: var(--ink-2); }
.wx-ico .wx-wet { stroke: var(--wx-wet); }
.wx-ico .wx-bolt { stroke: var(--wx-sun); }
.wx-body { display: grid; grid-template-columns: auto auto minmax(0, 1fr); grid-template-areas: "now facts days" "watch watch watch" "detail detail detail"; gap: 14px 32px; align-items: center; }
.wx-now { grid-area: now; display: flex; gap: 14px; align-items: center; }
.wx-cond { font-size: 13px; color: var(--ink-2); }
.wx-temp { font-size: 40px; line-height: 1.05; font-weight: 300; letter-spacing: -1px; color: var(--ink); font-variant-numeric: tabular-nums; }
.wx-temp span { font-size: 15px; font-weight: 400; color: var(--muted); vertical-align: top; margin-left: 2px; letter-spacing: 0; }
.wx-hl b { font-family: var(--mono); font-weight: 500; color: var(--ink); }
.wx-facts { grid-area: facts; margin: 0; display: grid; gap: 6px; font-size: 13px; }
.wx-facts > div { display: flex; gap: 12px; }
.wx-facts dt { width: 86px; color: var(--muted); }
.wx-facts dd { margin: 0; color: var(--ink); font-variant-numeric: tabular-nums; }
.wx-days { grid-area: days; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.wx-day { font: inherit; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border: 1px solid transparent; border-radius: var(--radius-sm); background: transparent; color: var(--ink); cursor: pointer; }
.wx-day:hover { background: var(--line-2); }
.wx-day.on { border-color: var(--line); background: var(--line-2); }
.wx-day:first-child { background: var(--line-2); }
.wx-dl { font-size: 12px; color: var(--muted); }
.wx-day.flagged .wx-dl::after { content: ''; display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--wx-amber); margin-left: 4px; vertical-align: middle; }
.wx-hi { font-family: var(--mono); font-size: 13px; font-weight: 500; }
.wx-lo { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.wx-pop { font-size: 11px; color: var(--wx-wet); min-height: 14px; }
.wx-watch { grid-area: watch; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.wx-watch > span { margin-right: 4px; }
.wx-flag { font: inherit; font-size: 12px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; }
.wx-flag:hover { background: var(--line-2); }
.wx-flag.wx-heat, .wx-flag.wx-wind { border-color: var(--warn-line); background: var(--warn-soft); }
.wx-detail { grid-area: detail; color: var(--ink-2); border-top: 1px solid var(--line-2); padding-top: 10px; line-height: 1.5; }
.wx-alerts { border-bottom: 1px solid var(--warn-line); background: var(--warn-soft); padding: 8px 16px; display: grid; gap: 4px; }
.wx-alert summary { cursor: pointer; font-size: 13px; color: var(--ink); }
.wx-alert summary b { color: var(--wx-amber); font-weight: 600; }
@media (max-width: 1100px) {
  .wx-body { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "now facts" "watch watch" "days days" "detail detail"; }
}
@media (max-width: 600px) {
  .wx-body { grid-template-columns: minmax(0, 1fr); grid-template-areas: "now" "facts" "watch" "days" "detail"; }
}

/* Negative numbers are always red (tagged by negatives.js) */
.neg, td.neg, a.neg, b.neg, .num.neg { color: var(--bad) !important; }

/* ----- Drawings (drawings.js) ----- */
#dwgCard { position: relative; }
#dwgCard.over { border: 2px dashed var(--brand); background: var(--soft); }
#dwgCard .dropnote { display: none; }
#dwgCard.over .dropnote { display: flex; position: absolute; inset: 0; align-items: center; justify-content: center; font-size: 16px; font-weight: 600; color: var(--brand-dark); background: var(--soft); border-radius: var(--radius); pointer-events: none; }
.dwg-wait { justify-content: space-between; flex-wrap: wrap; }
.dwg-na { display: inline-flex; gap: 6px; align-items: center; margin: 2px 10px 2px 0; }
.dwg-tools { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.dwg-tools select { max-width: 320px; }
.dwg-tools input { flex: 1; min-width: 180px; }
.dwg-table td:first-child { white-space: nowrap; font-family: var(--mono); }
.dwg-group td { background: var(--soft); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.dwg-sets { margin-top: 14px; }
.dwg-sets summary { cursor: pointer; color: var(--muted); }
.dwg-sets table { margin-top: 8px; width: 100%; }
.dwg-review-head { display: grid; grid-template-columns: minmax(200px, 2fr) 160px 160px 1fr; gap: 12px; }
.dwg-review td { vertical-align: middle; }
.dwg-review input.bad { border-color: var(--warn); background: var(--warn-soft); }
.dwg-thumb canvas { display: block; width: 180px; height: auto; max-height: 150px; object-fit: contain; border: 1px solid var(--line); border-radius: 4px; background: #fff; }
.dwg-review-foot { display: flex; gap: 8px; margin-top: 14px; position: sticky; bottom: 0; background: var(--card); padding: 10px 0; border-top: 1px solid var(--line); }
@media (max-width: 700px) { .dwg-review-head { grid-template-columns: 1fr; } .dwg-thumb canvas { width: 120px; } }

body.dwg-open { overflow: hidden; }
.dwg-viewer { position: fixed; inset: 0; z-index: 1000; display: flex; flex-direction: column; background: #2a2f33; }
.dwg-bar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--card); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.dwg-name { flex: 1; min-width: 140px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.dwg-name b { font-family: var(--mono); }
.dwg-name .small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.dwg-bar select { max-width: 260px; }
.dwg-zoom { display: inline-flex; align-items: center; gap: 4px; }
.dwg-zoom #vPct { min-width: 46px; text-align: center; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.dwg-old { padding: 8px 14px; background: var(--warn-soft); color: var(--warn); border-bottom: 1px solid var(--warn-line); font-size: 13px; display: flex; gap: 10px; align-items: center; }
.dwg-old[hidden] { display: none; }
.dwg-stage { position: relative; flex: 1; overflow: hidden; touch-action: none; cursor: grab; user-select: none; }
.dwg-stage.grabbing { cursor: grabbing; }
.dwg-base { position: absolute; left: 0; top: 0; transform-origin: 0 0; background: #fff; box-shadow: 0 2px 18px rgba(0,0,0,.35); }
.dwg-detail { position: absolute; left: 0; top: 0; pointer-events: none; }
.dwg-loading { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); color: #fff; font-size: 14px; background: rgba(0,0,0,.45); padding: 8px 14px; border-radius: 8px; }
.dwg-loading[hidden] { display: none; }
/* Drawings review: live reading progress, zoomed sheet numbers, index suggestions */
.dwg-live { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.dwg-live[hidden] { display: none; }
.dwg-live b { flex: 1; max-width: 360px; height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.dwg-live i { display: block; height: 100%; width: 0; background: var(--brand); transition: width .25s ease; }
.dwg-review tr.dwg-waiting td { color: var(--muted); }
.dwg-review tr.dwg-waiting input { background: var(--soft); }
.dwg-thumb canvas.zoomed { width: 200px; max-height: 110px; }
.dwg-idx { display: block; margin-top: 4px; padding: 2px 8px; border: 1px dashed var(--line); border-radius: 6px; background: var(--soft); color: var(--muted); font: inherit; font-size: 12px; cursor: pointer; text-align: left; transition: background .12s ease, color .12s ease; }
.dwg-idx:hover { background: var(--card); color: var(--ink, inherit); border-color: var(--brand); }
@media (max-width: 700px) { .dwg-review-head { grid-template-columns: 1fr 1fr; } }
/* Drawings: links from callouts to other sheets */
.dwg-links { position: absolute; left: 0; top: 0; transform-origin: 0 0; pointer-events: none; z-index: 2; }
.dwg-link { position: absolute; pointer-events: auto; padding: 0; margin: -3px 0 0 -3px; box-sizing: content-box; border: 3px solid transparent; border-radius: 4px;
  background: rgba(37, 99, 235, .14); outline: 1.5px solid rgba(37, 99, 235, .55); cursor: pointer; transition: background .12s ease, outline-color .12s ease, transform .12s ease; }
.dwg-link:hover { background: rgba(37, 99, 235, .28); outline-color: rgba(37, 99, 235, .95); }
.dwg-link:active { transform: scale(.94); }
.dwg-ping { position: absolute; width: 0; height: 0; pointer-events: none; }
.dwg-ping::before { content: ''; position: absolute; left: -38px; top: -38px; width: 76px; height: 76px; border-radius: 50%; border: 4px solid #2563eb; box-shadow: 0 0 0 6px rgba(37,99,235,.25); animation: dwgPing 1.3s ease-out 2; }
@keyframes dwgPing { 0% { transform: scale(.4); opacity: 1; } 100% { transform: scale(1.6); opacity: 0; } }
#vBack[hidden] { display: none; }

/* Drawing markups */
.dwg-marks { position: absolute; left: 0; top: 0; transform-origin: 0 0; z-index: 1; pointer-events: none; overflow: visible; }
.dwg-marks .dwg-m { pointer-events: visiblePainted; cursor: pointer; transition: opacity .12s ease; }
.dwg-viewer.drawing .dwg-marks .dwg-m { pointer-events: none; }
.dwg-viewer.drawing #vStage { cursor: crosshair; }
.dwg-viewer.drawing .dwg-link { pointer-events: none; }
.dwg-marks .dwg-m.private { stroke-dasharray: none; }
.dwg-marks .dwg-m.earlier { opacity: .35; }
.dwg-marks .dwg-m:hover { opacity: .8; }
.dwg-marks .dwg-m.sel { filter: drop-shadow(0 0 3px rgba(37,99,235,.9)); }
.dwg-mtools { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); z-index: 5; display: flex; flex-direction: column; gap: 4px; align-items: center;
  padding: 6px; background: #fff; border-radius: 12px; box-shadow: 0 4px 18px rgba(0,0,0,.18); }
.dwg-mt { width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: #333; cursor: pointer;
  transition: background .12s ease, color .12s ease, transform .1s ease; }
.dwg-mt svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.dwg-mt:hover { background: #f1f3f5; }
.dwg-mt:active { transform: scale(.92); }
.dwg-mt.on { background: #e8efff; color: #2563eb; }
.dwg-mt-sep { width: 22px; height: 1px; background: #e5e7eb; margin: 3px 0; }
.dwg-sw { width: 20px; height: 20px; border-radius: 50%; border: 2px solid #fff; background: var(--c); box-shadow: 0 0 0 1px #d0d4d9; cursor: pointer; padding: 0;
  transition: transform .1s ease, box-shadow .12s ease; }
.dwg-sw:hover { transform: scale(1.12); }
.dwg-sw.on { box-shadow: 0 0 0 2px var(--c); }
.dwg-textin { position: absolute; z-index: 6; min-width: 180px; min-height: 34px; padding: 6px 8px; font: 600 14px Inter, Arial, sans-serif; border: 1.5px solid #2563eb;
  border-radius: 6px; background: rgba(255,255,255,.96); box-shadow: 0 4px 14px rgba(0,0,0,.15); resize: both; outline: none; }
.dwg-pop { position: absolute; z-index: 6; width: 236px; padding: 10px 12px; background: #fff; border-radius: 10px; box-shadow: 0 6px 24px rgba(0,0,0,.2);
  animation: dwgPop .12s ease-out; }
@keyframes dwgPop { from { opacity: 0; transform: translateY(4px) scale(.98); } to { opacity: 1; transform: none; } }
.dwg-pop-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; align-items: center; }
.dwg-pop-note { width: 100%; box-sizing: border-box; min-height: 52px; font: 14px Inter, Arial, sans-serif; }
.dwg-pop-text { font-size: 14px; white-space: pre-wrap; margin: 4px 0; }
.dwg-pop { width: 256px; max-height: calc(100% - 16px); overflow: auto; }
.dwg-pop-sw { display: flex; align-items: center; gap: 6px; font-size: 13px; margin-top: 8px; cursor: pointer; }
.dwg-replies { border-top: 1px solid #eceef1; margin-top: 10px; padding-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.dwg-reply { font-size: 13px; }
.dwg-reply .small { display: flex; align-items: center; gap: 6px; }
.dwg-x { margin-left: auto; border: 0; background: none; color: #999; cursor: pointer; font-size: 15px; line-height: 1; padding: 0 2px; border-radius: 4px; transition: color .12s, background .12s; }
.dwg-x:hover { color: #e5484d; background: #fdecec; }
.dwg-reply-in { display: flex; gap: 6px; }
.dwg-reply-in input { flex: 1; min-width: 0; font-size: 13px; padding: 5px 8px; }
.dwg-marks .dwg-m.sel { cursor: grabbing; }
.dwg-pop-sw input { width: auto; margin: 0; flex: none; }
.dwg-pop-sw span { flex: none; }

/* Markups: picked by their outline, handles, link badges, line sizes */
.dwg-marks .dwg-m.dwg-box { pointer-events: visibleStroke; }
.dwg-marks .dwg-m.dwg-hit { pointer-events: stroke; }
.dwg-marks .dwg-m.dwg-hit:hover { opacity: 1; }
.dwg-viewer.drawing .dwg-marks .dwg-hit, .dwg-viewer.drawing .dwg-marks .dwg-h, .dwg-viewer.drawing .dwg-marks .dwg-badge { pointer-events: none; }
.dwg-marks .dwg-m.closed { opacity: .45; }
/* callouts: the cloud is picked by its outline; the note (and its white backing) can be grabbed to move it alone */
.dwg-marks .dwg-m .dwg-co-cloud { pointer-events: visibleStroke; }
.dwg-marks .dwg-m [data-part=note] { pointer-events: all; cursor: move; }
.dwg-viewer.drawing .dwg-marks .dwg-m [data-part=note] { pointer-events: none; }
.dwg-marks .dwg-m.changed { filter: drop-shadow(0 0 2px #f59e0b) drop-shadow(0 0 4px rgba(245,158,11,.8)); }
.dwg-marks .dwg-h { pointer-events: all; fill: #fff; stroke: #2563eb; cursor: nwse-resize; }
.dwg-marks .dwg-h[data-h=ne], .dwg-marks .dwg-h[data-h=sw] { cursor: nesw-resize; }
.dwg-marks .dwg-h[data-h^=p] { cursor: move; }
.dwg-marks .dwg-badge { pointer-events: all; cursor: pointer; }
.dwg-marks .dwg-badge circle { fill: #2563eb; stroke: #fff; stroke-width: .6; }
.dwg-marks .dwg-badge text { fill: #fff; font-weight: 700; font-family: Inter, Arial, sans-serif; text-anchor: middle; }
.dwg-mt:disabled { opacity: .35; cursor: default; background: transparent; transform: none; }
.dwg-sz { width: 30px; height: 22px; display: grid; place-items: center; border: 0; border-radius: 6px; background: transparent; cursor: pointer; padding: 0; transition: background .12s ease; }
.dwg-sz i { display: block; width: 18px; height: var(--w); border-radius: 4px; background: #444; }
.dwg-sz:hover { background: #f1f3f5; }
.dwg-sz.on { background: #e8efff; }
.dwg-sz.on i { background: #2563eb; }
.dwg-tag { display: inline-block; font: 600 11px Inter, Arial, sans-serif; color: #4a5560; background: #eef0f3; border-radius: 4px; padding: 1px 5px; letter-spacing: .02em; }
.dwg-pop-title { width: 100%; box-sizing: border-box; font: 600 14px Inter, Arial, sans-serif; padding: 5px 7px; margin-bottom: 6px; border: 1px solid transparent; border-radius: 6px; background: #f6f7f9; }
.dwg-pop-title:hover { border-color: #e1e4e8; }
.dwg-pop-title:focus { border-color: #2563eb; background: #fff; outline: none; }
.dwg-pop-titletext { font: 600 14px Inter, Arial, sans-serif; margin-bottom: 4px; }
.dwg-pop-warn { font-size: 12.5px; color: #8a4b00; background: #fff6e5; border: 1px solid #f7d9a3; border-radius: 6px; padding: 5px 7px; margin: 2px 0 6px; }
.dwg-links-box { border-top: 1px solid #eceef1; margin-top: 10px; padding-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.dwg-links-h { display: flex; align-items: center; justify-content: space-between; }
.dwg-linkrow { display: flex; align-items: center; gap: 4px; }
.dwg-linkgo, .dwg-linkopt { flex: 1; min-width: 0; text-align: left; border: 0; background: none; padding: 4px 6px; border-radius: 6px; font: 13px Inter, Arial, sans-serif; color: #1d4ed8;
  cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: background .12s ease; }
.dwg-linkopt { color: #222; width: 100%; }
.dwg-linkgo:hover, .dwg-linkopt:hover { background: #eef3ff; }
.dwg-linkpick { margin-top: 4px; }
.dwg-linkq, .dwg-stampname { width: 100%; box-sizing: border-box; font-size: 13px; padding: 5px 8px; }
.dwg-stampname { flex: 1; width: auto; min-width: 0; }
.dwg-linklist { max-height: 180px; overflow: auto; margin-top: 4px; }
.dwg-stampmenu { position: absolute; z-index: 6; right: 66px; top: 50%; transform: translateY(-50%); width: 220px; max-height: 70%; overflow: auto; padding: 10px; background: #fff;
  border-radius: 10px; box-shadow: 0 6px 24px rgba(0,0,0,.2); animation: dwgPop .12s ease-out; }
.dwg-stamp-h { font: 600 13px Inter, Arial, sans-serif; margin-bottom: 6px; }
.dwg-stamp-row { display: flex; align-items: center; }
.dwg-stamp { flex: 1; display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 6px 8px; border-radius: 6px; font: 13px Inter, Arial, sans-serif; text-align: left; cursor: pointer; transition: background .12s ease; }
.dwg-stamp:hover { background: #f1f3f5; }
.dwg-stamp.on { background: #e8efff; color: #2563eb; }
.dwg-stamp-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.dwg-mlist { position: absolute; z-index: 5; left: 12px; top: 12px; bottom: 12px; width: 320px; display: flex; flex-direction: column; background: #fff; border-radius: 12px;
  box-shadow: 0 6px 24px rgba(0,0,0,.2); animation: dwgPop .12s ease-out; overflow: hidden; }
.dwg-mlist-h { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px 6px; font-size: 15px; }
.dwg-mlist-f { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 8px; border-bottom: 1px solid #eceef1; }
.dwg-mlist-q { flex: 1 1 100%; font-size: 13px; padding: 5px 8px; }
.dwg-mlist-body { flex: 1; overflow: auto; padding: 4px 6px; }
.dwg-mlist-g { font: 600 12px Inter, Arial, sans-serif; padding: 10px 6px 4px; color: #222; }
.dwg-mrow { display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 8px; cursor: pointer; transition: background .12s ease; }
.dwg-mrow:hover { background: #f4f6f8; }
.dwg-mrow.on { background: #eef3ff; }
.dwg-mrow-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dwg-mrow-n { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dwg-mlist-foot { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-top: 1px solid #eceef1; }

/* Version compare */
.dwg-changes { position: absolute; left: 0; top: 0; transform-origin: 0 0; pointer-events: none; z-index: 1; }
.dwg-chg { position: absolute; box-sizing: border-box; border: 2px dashed #f59e0b; border-radius: 6px; background: rgba(245, 158, 11, .06); margin: -4px; padding: 4px; box-sizing: content-box; }
.dwg-cmpbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 12px; background: #fff; border-bottom: 1px solid #e5e7eb; }
.dwg-segs { display: inline-flex; background: #f1f3f5; border-radius: 8px; padding: 2px; }
.dwg-seg { border: 0; background: transparent; padding: 5px 10px; border-radius: 6px; font: 600 13px Inter, Arial, sans-serif; color: #555; cursor: pointer; transition: background .12s, color .12s; }
.dwg-seg:hover { color: #111; }
.dwg-seg.on { background: #fff; color: #111; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.dwg-cmp-key { display: inline-flex; align-items: center; gap: 4px; }
.dwg-cmp-key i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-left: 6px; }
.dwg-cmpbar .dwg-pop-sw { margin: 0; }
.dwg-cmpbar #vCmpExit { margin-left: auto; }
.dwg-viewer.comparing #vCmp { background: #e8efff; color: #2563eb; }
.pill.dwg-changed { background: #fff4e0; color: #b45309; }
.dwg-cmpbar select { width: auto; max-width: 320px; }

/* estimates list: older versions grouped under a project */
tr.ver-child td { background: var(--line-2); font-size: 13px; }
.ver-toggle { margin-top: 4px; white-space: nowrap; }

/* Takeoff */
.dwg-tk { position: absolute; left: 0; top: 0; transform-origin: 0 0; z-index: 1; pointer-events: none; overflow: visible; }
.dwg-tk .tk-m { pointer-events: visiblePainted; cursor: pointer; }
.dwg-tk .tk-m.check:hover { opacity: .5; }
.dwg-viewer.tk-drawing .dwg-tk .tk-m:not(.check) { pointer-events: none; }
.dwg-viewer.tk-drawing #vStage { cursor: crosshair; }
.dwg-viewer.tk-on .dwg-mtools, .dwg-viewer.tk-on .dwg-marks { display: none; }
.dwg-viewer.tk-drawing .dwg-link { pointer-events: none; }
.dwg-tkpanel { position: absolute; left: 12px; top: 12px; bottom: 12px; width: 290px; z-index: 5; overflow: auto; background: #fff; border-radius: 12px;
  box-shadow: 0 4px 18px rgba(0,0,0,.18); padding: 12px; display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.dwg-tkpanel[hidden] { display: none; }
.tk-head { display: flex; align-items: center; justify-content: space-between; }
.tk-scale { border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; gap: 4px; }
.tk-scale.ok { background: #ecfdf3; }
.tk-scale.warn { background: #fff7e6; }
.tk-scale .btn { align-self: flex-start; }
.tk-check { background: #eef4ff; border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; }
.tk-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.tk-items { display: flex; flex-direction: column; gap: 2px; }
.tk-item { display: flex; gap: 8px; align-items: flex-start; padding: 7px 8px; border-radius: 8px; cursor: pointer; transition: background .12s; }
.tk-item:hover { background: #f4f5f7; }
.tk-item.on { background: #e8efff; }
.tk-item > i { width: 12px; height: 12px; border-radius: 3px; margin-top: 4px; flex: none; }
.tk-name { flex: 1; min-width: 0; }
.tk-pend { color: #2563eb; }
.tk-warn { color: #b45309; }
.tk-tools { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; background: #f6f7f9; border-radius: 8px; padding: 8px; }
.tk-tools > .small { width: 100%; }
.tk-hint { margin-top: 2px; }
.tk-form { display: flex; flex-direction: column; gap: 8px; background: #f6f7f9; border-radius: 8px; padding: 10px; }
.tk-form input:not([type]), .tk-form input[name=name], .tk-form select { width: 100%; box-sizing: border-box; }
.tk-form .tk-new { display: flex; gap: 6px; }
.tk-form .tk-new input { flex: 1; min-width: 0; }
.tk-del { color: #e5484d; }
.dwg-tklive { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 6; pointer-events: none; background: rgba(17,17,17,.85);
  color: #fff; font: 600 13px Inter, Arial, sans-serif; padding: 5px 10px; border-radius: 6px; }
.dwg-tklive:empty { display: none; }
.tk-sug { margin-top: 6px; padding: 6px 8px; border-radius: 6px; background: #f5f3ff; display: flex; flex-direction: column; gap: 4px; }
.tk-conf { font-size: 11px; padding: 1px 6px; border-radius: 10px; background: #eee; }
.tk-conf.high { background: #dcfce7; color: #166534; }
.tk-conf.medium { background: #fef3c7; color: #92400e; }
.tk-conf.low { background: #fee2e2; color: #991b1b; }

/* reduced motion (Acrocorinth Design System): presses and lifts become short fades */
@media (prefers-reduced-motion: reduce) {
  .btn, .nav a, .rail-btn, .ben-iconbtn, .ben-form { transition-duration: var(--dur-quick); }
  .btn:active, .nav a:active, .rail-btn:active, .ben-iconbtn:active { transform: none; }
}

/* ---------------- tools & rollout (public/tools.js) ---------------- */
/* Preview tag: a tool still being built (only the admin sees it) or in testing (admin + testers) */
.pv-tag { display: inline-block; margin-left: 6px; padding: 0 6px; border: 1px solid var(--line); border-radius: 999px; font-size: 10.5px; font-weight: 500; letter-spacing: .02em; color: var(--muted); vertical-align: 1px; line-height: 16px; }
.nav a.pv { position: relative; }
/* the Preview dot uses ::before so it never replaces the hover name (::after) */
.nav a.pv::before { content: ''; position: absolute; top: 6px; right: 6px; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.tabs .tabgroup { background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); font: inherit; cursor: pointer; white-space: nowrap; }
.tabs .tabgroup.active { color: var(--ink); font-weight: 500; border-bottom-color: var(--ink); }
.tabgroup-menu { position: fixed; z-index: 60; min-width: 260px; max-width: 340px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 32px rgba(0,0,0,.12); padding: 6px; }
.tabgroup-menu .tgm-head { padding: 6px 10px 4px; text-transform: uppercase; letter-spacing: .05em; font-size: 10.5px; }
.tabgroup-menu a { display: block; padding: 8px 10px; border-radius: 6px; color: var(--ink); text-decoration: none; }
.tabgroup-menu a:hover, .tabgroup-menu a:focus { background: var(--line-2); }
.pv-card .pv-head { display: flex; align-items: center; gap: 6px; }
.pv-card .pv-head h2 { margin: 0; }

/* Accounting → Reconcile */
.rc-table tr.rc-on td { background: var(--line-2); }
.rc-table input[type=checkbox] { width: 16px; height: 16px; cursor: pointer; }

/* Accounting → Pay bills */
.pill.warn { background: var(--warn-soft); border: 1px solid var(--warn-line); color: var(--ink); }
.pb-table td { vertical-align: top; }

/* Accounting → Dashboard: Needs a look */
.db-alerts .card-body { display: grid; gap: 6px; }
.db-alert { padding: 6px 10px; border-radius: var(--radius-sm); background: var(--line-2); }
.db-alert.warn { background: var(--warn-soft); border: 1px solid var(--warn-line); }
.db-alert a { color: var(--ink); text-decoration: none; }
.db-alert a:hover { text-decoration: underline; }
/* "Move" on an estimate version row: quiet until hovered */
.erows .linkbtn { background: none; border: 0; padding: 0 0 0 6px; font: inherit; font-size: 11px; color: var(--muted); cursor: pointer; text-decoration: underline; opacity: 0; transition: opacity .15s; }
.erows tr:hover .linkbtn, .erows .linkbtn:focus-visible { opacity: 1; }
@media (hover: none) { .erows .linkbtn { opacity: 1; } }

/* =====================================================================================================
   The app frame (Nov 2026 new look): a graphite bar across the top (product, company, search / ask, account)
   and a labeled menu down the left. Pages run the full width beside it. Phones keep the bottom bar.
   Every size here comes from two numbers, so anything that sticks to the top (the crumbs bar, Ben's chat,
   side panels) sits under the bar instead of behind it.
   ===================================================================================================== */
:root { --appbar-h: 56px; --rail-w: 232px; --appbar-bg: #14181B; --appbar-line: #14181B; --appbar-ink: #ECEFF1; --appbar-ink-2: #98A2A8;
  --appbar-field: #1E2327; --appbar-field-line: #2E3439; }
:root[data-theme="dark"] { --appbar-bg: #08090A; --appbar-line: #1B1F22; --appbar-field: #14171A; --appbar-field-line: #262B2F; }
body { padding-left: var(--rail-w); padding-top: var(--appbar-h); }

.appbar { position: fixed; z-index: 45; left: 0; right: 0; top: 0; height: var(--appbar-h); display: flex; align-items: center; gap: 16px;
  padding: 0 16px 0 20px; background: var(--appbar-bg); border-bottom: 1px solid var(--appbar-line); color: var(--appbar-ink); box-sizing: border-box; }
.appbar .brand { display: flex; align-items: center; gap: 10px; color: var(--appbar-ink); text-decoration: none; flex: 0 0 auto;
  width: calc(var(--rail-w) - 36px); height: auto; margin: 0; border-radius: 8px; }
.appbar .brand .brand-mark { flex: 0 0 auto; }
.appbar .brand-name { font-size: 15px; font-weight: 600; letter-spacing: -.2px; color: #FFFFFF; white-space: nowrap; }
.appbar .user { margin: 0; flex: 1 1 auto; min-width: 0; display: flex; flex-direction: row; align-items: center; gap: 12px; }
.appbar .user[hidden] { display: none; }
.appbar .workspace { width: auto; height: 32px; padding: 0 10px 0 4px; gap: 8px; border: 0; border-radius: 8px; background: transparent; color: #D9DEE1;
  font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: visible; }
.appbar .workspace .brand-logo { width: 24px; height: 24px; border-radius: 6px; background: #FFFFFF; padding: 2px; box-sizing: border-box; }
.appsearch { flex: 1 1 320px; max-width: 560px; margin: 0 auto; display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px 0 12px;
  background: var(--appbar-field); border: 1px solid var(--appbar-field-line); border-radius: 10px; color: var(--appbar-ink-2); font: inherit; font-size: 14px; cursor: text;
  transition: border-color var(--dur-instant) var(--ease-standard); min-width: 0; }
.appsearch:hover { border-color: #4A535A; }
.appsearch:focus-visible { outline: 2px solid var(--brand-light); outline-offset: 2px; }
.appsearch-label { flex: 1 1 auto; min-width: 0; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appsearch kbd { font: 11px var(--mono); color: var(--appbar-ink-2); border: 1px solid #353C42; border-radius: 5px; padding: 1px 6px; }
.appbar-right { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.appbar .rail-btn { width: 36px; height: 36px; color: #C9CFD3; border-radius: 10px; }
.appbar .rail-btn:hover { background: #22272B; color: #FFFFFF; }
.appbar .rail-btn::after { left: auto; right: 0; top: calc(100% + 6px); transform: none; }
.appbar .avatar { background: #ECEFF1; color: #14181B; margin-left: 4px; }
.appbar .acct-menu { left: auto; right: 0; bottom: auto; top: calc(100% + 8px); color: var(--text); }

/* the labeled menu */
.rail { top: var(--appbar-h); width: var(--rail-w); align-items: stretch; gap: 0; padding: 16px 12px 24px; box-sizing: border-box; overflow-y: auto; }
.rail .nav { align-items: stretch; gap: 2px; }
.nav-h { font-family: var(--mono); font-size: 11px; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); padding: 4px 12px 8px; }
.nav a { width: auto; height: 36px; justify-content: flex-start; gap: 12px; padding: 0 12px; border-radius: 10px; color: var(--text); font-size: 14px; }
.nav a span { display: inline; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav a svg { flex: 0 0 auto; color: var(--ink-2); }
.nav a:hover { background: var(--soft); color: var(--ink); }
.nav a.active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.nav a.active svg { color: var(--accent-ink); }
.nav a::after { display: none; }
.nav-ct { margin-left: auto; font: 400 11.5px var(--mono); color: var(--muted); }
.nav-ct:empty { display: none; }

/* everything that sticks to the top sits under the bar */
.topbar { top: var(--appbar-h); }
.topsearch { display: none; } /* search lives in the top bar now */
.ben { top: var(--appbar-h); height: calc(100vh - var(--appbar-h)); height: calc(100dvh - var(--appbar-h)); }
.bk-split .bk-listcard { top: calc(var(--appbar-h) + 16px); max-height: calc(100vh - var(--appbar-h) - 96px); }
.bk-preview { top: calc(var(--appbar-h) + 16px); }

/* pages use the full width beside the menu */
#view { max-width: 1840px; margin: 0; }
body.ben-on #view { margin: 0; }
.ben-fab { left: auto; }

/* narrower screens: the menu folds to icons (names on hover) */
@media (max-width: 1100px) and (min-width: 761px) {
  :root { --rail-w: 64px; }
  .appbar .brand { width: auto; }
  .appbar .brand-name, .appbar .ws-name { display: none; }
  .rail { padding: 16px 0; align-items: center; }
  .rail .nav { align-items: center; }
  .nav-h, .nav-ct { display: none; }
  .nav a { width: 40px; padding: 0; justify-content: center; }
  .nav a span { display: none; }
  .nav a::after { display: block; left: 50px; }
}
/* phones: the top bar keeps the mark, search and account; the menu is the bottom bar */
@media (max-width: 760px) {
  :root { --rail-w: 0px; --appbar-h: 52px; }
  body { padding-left: 0; }
  .appbar { padding: 0 12px; gap: 10px; }
  .appbar .brand { width: auto; }
  .appbar .brand-name, .appbar .workspace, .appsearch-label, .appsearch kbd, .appbar #themeBtn { display: none; }
  .appsearch, #cmdkBtn.appsearch { display: flex; flex: 0 0 auto; width: 36px; padding: 0; justify-content: center; margin: 0 0 0 auto; }
  .rail { top: auto; width: auto; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); }
  .rail .nav { flex-direction: row; align-items: center; }
  .nav-h, .nav-ct { display: none; }
  .nav a { width: auto; min-width: 52px; height: 52px; flex-direction: column; justify-content: center; gap: 2px; padding: 0 4px; font-size: 10.5px; }
  .nav a span { flex: 0 0 auto; }
  .nav a.active { background: var(--soft); }
  body.ben-home .ben { height: calc(100dvh - var(--appbar-h) - 64px); }
}
@media print { .appbar { display: none !important; } body { padding: 0 !important; } }
/* a job's header: one white band across the top of the page with its tabs attached underneath */
.jobband { margin: -28px -32px 24px; padding: 22px 32px 0; background: var(--card); border-bottom: 1px solid var(--line); }
.jobband .pagehead { margin-bottom: 12px; }
.jobband .pagehead h1 { font-size: 26px; font-weight: 550; letter-spacing: -.5px; }
.jobband .jobtabs, .jobband .fin-tabs { margin-bottom: 0; border-bottom: 0; }
.jobband .fin-tabs button { padding: 12px 0; }
.jobband:not(:has(.tabs)) { padding-bottom: 6px; }
.jobband .jobtabs a, .jobband .jobtabs .tabgroup { padding: 12px 0; border-bottom: 2px solid transparent; }
.jobband .jobtabs a.active, .jobband .jobtabs .tabgroup.active { border-bottom-color: var(--ink); color: var(--ink); }
@media (max-width: 760px) { .jobband { margin: -18px -14px 18px; padding: 16px 14px 0; } }


/* =====================================================================================================
   The look (Nov 19 2026, Acrocorinth Design System v2): black, red and white. One font for words and numbers.
   Square structure (menu, buttons, inputs) and round content (cards, Ben, search, status). Light only.
   ===================================================================================================== */
:root { --appbar-bg: #16191D; --appbar-line: #16191D; --appbar-ink: #F3F3EE; --appbar-ink-2: #A9AEB3; --appbar-field: #23272B; --appbar-field-line: #33383D;
  --icon-fill: #D9E3F7; --icon-fill-on: #F6CFCF; --dot-off: #C9C9C3; --line-dot: #C4C4BE; --radius-ben: 20px; }
/* even-width digits only where numbers stack in columns (Schibsted's tabular set also widens commas, so not in prose) */
body { font-feature-settings: normal; }   /* Schibsted's tabular set widens commas and periods, so prose stays proportional */
td.num, th.num { font-variant-numeric: normal; }   /* Schibsted's even-width digits space out commas; the approved tables use its normal digits */
.stat b, .exstat b { font-variant-numeric: normal; }   /* a single big figure reads best proportional */
/* round content */
.card, .stat, .exstat, .readcard, .bk-month, .signin-card, dialog { border-radius: var(--radius); }
dialog .card-head { border-radius: var(--radius) var(--radius) 0 0; }
.card .tablewrap { border-radius: 0 0 var(--radius) var(--radius); }
.ben-card, .ben-hub-card { border-radius: var(--radius-ben); }
.appsearch, .pill, .chip { border-radius: 999px; }
/* square structure */
.btn, .nav a, input, select, textarea { border-radius: var(--radius-sm); }
.nav a.active { background: var(--ink); color: #FFFFFF; }
.nav a.active svg { color: #FFFFFF; }
.nav a.active .ic-fill { fill: var(--icon-fill-on); }
/* filled icons: the soft shape behind each outline */
.ic-fill { fill: var(--icon-fill); }
/* numbers: the same font, evenly spaced digits, medium weight (no typewriter faces) */
.stat b, .exstat b { font-family: var(--sans); font-weight: 500; letter-spacing: -.2px; }
td.num, th.num, .num, .calc, .divtotal { font-family: var(--sans); }
/* Quiet cents (company setting): lighter digits, small grey $ and cents */
body.num-quiet .stat b, body.num-quiet .exstat b { font-weight: 400; }
.q-cur, .q-cents { font-size: .58em; color: var(--muted); font-weight: 400; vertical-align: .55em; letter-spacing: 0; }
.q-cur { margin-right: 1px; }
/* the job ring: the job number inside the Pinpoint ring */
.jobid { display: flex; align-items: center; gap: 16px; min-width: 0; }
.jobring { position: relative; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; color: var(--ink); }
.jobring .jobring-mark { position: absolute; inset: 0; width: 100%; height: 100%; }
.jobring b { position: relative; font-size: 12px; font-weight: 600; letter-spacing: -.3px; }
@media (max-width: 760px) { .jobring { width: 44px !important; height: 44px !important; } .jobring b { font-size: 11px; } }

/* ---------- Dashboard (role dashboards, public/mydash.js) ---------- */
.mdgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 14px; align-items: start; }
.mdtoday { margin-bottom: 14px; }
.mdtoday.exalerts li { grid-template-columns: 18px 1fr; }
.mdtoday.exalerts li a { white-space: normal; font-weight: 500; }
.mdcard .card-head h2 a { color: inherit; text-decoration: none; }
.mdcard .card-head h2 a:hover { text-decoration: underline; }
.mdbody { padding: 12px 16px; }
.mdtiles { margin-bottom: 4px; }
.mdtiles .mdtile { text-decoration: none; color: inherit; min-width: 96px; flex: 1 1 96px; }
.mdtiles .mdtile:hover { border-color: var(--brand); }
.mdrows { list-style: none; margin: 0; padding: 0; }
.mdrows li { border-bottom: 1px solid var(--line-2); }
.mdrows li:last-child { border-bottom: 0; }
.mdrows li > a { display: grid; grid-template-columns: 14px 1fr auto; gap: 8px; align-items: baseline; padding: 7px 0; color: inherit; text-decoration: none; font-size: 13px; }
.mdrows li > a:hover b { text-decoration: underline; }
.mdrows .mdl { display: flex; flex-direction: column; min-width: 0; }
.mdrows .mdl b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mdrows .mdv { font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mdmark { color: var(--warn); font-size: 10px; }
.mdrows .lv2 .mdmark { font-weight: 700; }
.mdnote, .mdmore { margin: 8px 0 0; }
.mdedit li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 16px; }
.mdctl { display: flex; gap: 6px; flex-shrink: 0; }
.mdsave { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 20px; }
@media (max-width: 640px) { .mdgrid { grid-template-columns: 1fr; } }

/* ---- Job Overview, the approved layout (Nov 19 2026): number cards, Budget watch, owner COs, agent card ---- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi { position: relative; background: var(--card, #fff); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 22px 20px; min-width: 0; }
.kpi-l { display: block; font-size: 13.5px; color: var(--text); margin-bottom: 6px; }
.kpi b { display: block; font-size: clamp(24px, 2.4vw, 31px); line-height: 1.15; font-weight: 500; letter-spacing: -.02em; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi b a { color: inherit; text-decoration: none; }
.kpi b a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.kpi.kpi-pos b { color: var(--good); }
.kpi.kpi-neg b { color: var(--bad); }
.kpi-s { font-size: 12.5px; color: var(--muted); margin-top: 8px; }
body.num-quiet .kpi b { font-weight: 400; }
.kpigrid { position: absolute; top: 16px; right: 18px; display: grid; grid-template-columns: repeat(4, 3px); gap: 4px; }
.kpigrid i { width: 3px; height: 3px; border-radius: 50%; background: #CFCFCA; }
.kpigrid i.pin { background: var(--pin); }
.dotprog { display: flex; gap: 4px; margin-top: 12px; flex-wrap: nowrap; overflow: hidden; }
.dotprog i { flex: none; width: 4.5px; height: 4.5px; border-radius: 50%; background: #E2E2DE; }
.dotprog i.on { background: var(--ink); }
.dotprog i.pin { background: var(--pin); }
.dotprog + .kpi-s { margin-top: 8px; }

.ovgrid { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 20px; align-items: start; margin-bottom: 20px; }
.ovstack { display: flex; flex-direction: column; gap: 20px; margin-bottom: 20px; }
.ovstack > .card, .ovmain > .card, .ovmain > div > .card { margin: 0; }
.ovside { position: sticky; top: 16px; }
.ovmain, .ovside { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.ov-card { margin: 0; overflow: hidden; }
.ov-card .card-head { border-bottom: 0; padding-bottom: 6px; }
.ov-card .card-head h2 { font-size: 17px; font-weight: 600; }
.ov-card .card-head a.small { margin-left: auto; }
td.code { color: var(--muted); letter-spacing: .02em; white-space: nowrap; }
td .neg, .ov-card .neg { color: var(--bad); font-weight: 600; }
td .pos, .ov-card .pos { color: var(--good); font-weight: 600; }

.colist { display: flex; flex-direction: column; padding: 0 0 6px; }
.corow { display: flex; align-items: center; gap: 10px; padding: 12px 20px; border-top: 1px dotted #D9D9D4; color: var(--text); text-decoration: none; }
.corow:hover { background: var(--soft); }
.corow .codot { flex: none; width: 5px; height: 5px; border-radius: 50%; background: var(--ink); }
.corow .codot.pin { background: var(--pin); }
.corow .conum { color: var(--muted); font-size: 13px; white-space: nowrap; }
.corow .cotitle { color: var(--link); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.corow .num { margin-left: auto; color: var(--ink); }
.corow.more { color: var(--link); justify-content: center; }

.estlist { display: flex; flex-direction: column; padding-bottom: 6px; }
.estrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-top: 1px dotted #D9D9D4; color: var(--text); text-decoration: none; }
.estrow:hover { background: var(--soft); }
.estrow > span:first-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.estrow b { font-weight: 500; color: var(--ink); }
.estrow .num { white-space: nowrap; }
.estrow .num.strong { font-weight: 600; color: var(--ink); }

/* the agent's black card */
.agentcard { background: var(--ink); color: #fff; border-radius: var(--radius-ben, 20px); padding: 34px 22px 22px; text-align: center; }
.agentcard .agent-ring { color: #fff; display: block; margin: 0 auto 18px; }
.agentcard h2 { color: #fff; font-size: 19px; font-weight: 600; margin: 0 0 6px; }
.agentcard p { color: #A9AEB3; font-size: 13.5px; margin: 0 0 18px; }
.agent-asks { display: flex; flex-direction: column; gap: 8px; }
.agent-ask { text-align: left; background: transparent; color: #fff; border: 1px solid #3A3F45; border-radius: 999px; padding: 9px 16px; font: inherit; font-size: 13.5px; cursor: pointer; }
.agent-ask:hover { background: #23272B; border-color: #4A5057; }

/* charts (optional widgets) */
.chart { width: 100%; height: auto; display: block; font-family: var(--sans); }
.chart .ch-l { font-size: 12px; fill: var(--muted); }
.chart .ch-v { font-size: 12px; fill: var(--ink); }
.chart .ch-axis { stroke: #D9D9D4; stroke-width: 1; stroke-dasharray: 2 3; }
.chart .ch-over { fill: var(--bad); }
.chart .ch-under { fill: var(--good); }
.chart .ch-line { fill: none; stroke: var(--ink); stroke-width: 1.6; }
.chart .ch-dot { fill: var(--ink); }
.chart .ch-pin { fill: var(--pin); }
.chart-key { display: flex; gap: 16px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.chart-key i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; vertical-align: 0; }
.chart-key i.ch-over { background: var(--bad); } .chart-key i.ch-under { background: var(--good); }

.jobband .pagehead .statussel { width: auto; border-radius: 999px; padding: 6px 28px 6px 12px; font-size: 13px; }

@media (max-width: 1180px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ovgrid { grid-template-columns: minmax(0, 1fr); } .ovside { position: static; } }
@media (max-width: 560px) { .kpis { grid-template-columns: minmax(0, 1fr); } }

/* ---- Quiet tables everywhere: sentence-case headers, no header band, dotted row lines ---- */
th { text-transform: none; letter-spacing: 0; font-size: 12.5px; font-weight: 500; color: var(--muted); background: transparent; border-bottom: 1px solid var(--line); }
td { border-bottom: 1px dotted #D9D9D4; }
tbody tr:last-child td { border-bottom: 0; }
tr.subtotal td, tr.grand td, tfoot td { border-bottom-style: solid; }

.ov-card a, .ov-card .card-head a.small { color: var(--link); text-decoration: none; }
.ov-card a:hover { text-decoration: underline; text-underline-offset: 3px; }
.ov-card table td a { color: var(--link); }
.ov-card .card-head { padding-top: 18px; }
/* Schibsted Grotesk's even-width digits put wide gaps around commas and periods ($2 , 009 , 999). The approved
   look uses its normal digits everywhere, so numbers read like the mockups. */
.num, .totalsbar .t b, .division-head .divtotal, .lines .calc, .stat b, .tc-days b, .exbar-v, .excol-v, .wx-temp, .wx-facts dd { font-variant-numeric: normal; }
.ovgrid .card, .ovgrid .agentcard { margin: 0; }

.kpis.kpis-1 { grid-template-columns: minmax(0, 280px); }
.kpi .statussel { border-radius: 999px; padding: 5px 28px 5px 12px; font-size: 14px; }
.kpi .kpi-s span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 560px) { .ov-card table.quiet td.code, .ov-card table.quiet th:first-child { display: none; } }
