/* Layout: black signage bar over white ledger pages; one 1120px column, the log itself widens to 1440px. Light-only by choice, matching Safer's white/orange/black. */
:root {
  --paper: #FFFFFF;
  --wash: #F4F3F1;
  --zebra: #FAF9F7;
  --ink: #16171A;
  --ink-2: #4D4F54;
  --ink-3: #6E7076;
  --line: #E2DFDB;
  --line-strong: #B9B5AF;
  --black: #111214;
  --black-line: #34363B;
  --on-black: #FFFFFF;
  --on-black-2: #B9BBBF;
  --orange: #F26A1B;
  --orange-hover: #E05A0C;
  --orange-wash: #FFF2E8;
  --orange-line: #F3CDB2;
  --orange-ink: #A8430A;
  --focus: #1F5FD6;
  --ok: #1D7A3A;
  --ok-wash: #E5F3E9;
  --wait: #6E4E00;
  --wait-wash: #FFF4CC;
  --wait-strong: #F2C230;
  --bad: #B42318;
  --bad-wash: #FCEBEA;
  --void: #8A8C90;
  --scrim: rgba(17, 18, 20, 0.55);
  --shadow: rgba(17, 18, 20, 0.22);
  --shadow-soft: rgba(17, 18, 20, 0.10);
  --display: "Barlow Semi Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
  --body: "Atkinson Hyperlegible", "Segoe UI", system-ui, -apple-system, sans-serif;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--paper); }
body { margin: 0; font-family: var(--body); font-size: 18px; line-height: 1.5; color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; }
body.modal-open { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.08; margin: 0; text-wrap: balance; color: var(--ink); }
h1 { font-size: clamp(32px, 4vw, 44px); }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.gutter { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
@media (min-width: 900px) { .gutter { padding-left: max(32px, env(safe-area-inset-left, 0px)); padding-right: max(32px, env(safe-area-inset-right, 0px)); } }
.ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- Bars ---------- */
.topbar { background: var(--black); color: var(--on-black); }
.bar-inner { max-width: 1440px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; padding-block: 8px; }
.brand { display: inline-flex; align-items: center; gap: 10px; background: none; border: 0; padding: 0; cursor: pointer; color: var(--on-black); font-family: var(--display); font-weight: 700; font-size: 28px; letter-spacing: 0.01em; }
.logo { width: 34px; height: 34px; flex: none; }
.logo .lg-bg { fill: var(--orange); }
.logo .lg-ink { fill: none; stroke: var(--black); stroke-width: 2.4; stroke-linecap: round; }
.bar-right { display: flex; align-items: center; gap: 8px; }
.bar-user { color: var(--on-black-2); font-size: 16px; margin-right: 6px; }
.bar-btn { background: transparent; border: 2px solid var(--black-line); color: var(--on-black); border-radius: 8px; min-height: 44px; padding: 0 14px; font-weight: 700; font-size: 16px; cursor: pointer; }
.bar-btn:hover { border-color: var(--orange); }
a.bar-btn { display: inline-flex; align-items: center; text-decoration: none; }
.bar-btn.solid { background: var(--orange); border-color: var(--orange); color: var(--black); }
@media (max-width: 600px) { .bar-user { display: none; } .brand { font-size: 24px; } .bar-btn { padding: 0 10px; font-size: 15px; } }

/* ---------- Page scaffolding ---------- */
.page { max-width: 1120px; margin: 0 auto; padding-block: 28px 72px; }
.page.wide { max-width: 1440px; }
.back { display: inline-flex; align-items: center; gap: 8px; background: none; border: 0; padding: 8px 0; margin-bottom: 12px; font-weight: 700; font-size: 17px; color: var(--ink-2); cursor: pointer; }
.back:hover { color: var(--ink); }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; margin-bottom: 24px; }
.page-head > div { min-width: 0; }
.eyebrow { font-family: var(--display); font-weight: 600; font-size: 16px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--orange-ink); margin-bottom: 6px; }
.hint { color: var(--ink-2); font-size: 17px; margin-top: 8px; max-width: 70ch; }
.section-label { font-size: 16px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); margin: 36px 0 14px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 22px; border-radius: 8px; border: 2px solid transparent; font-weight: 700; font-size: 18px; line-height: 1.1; cursor: pointer; text-align: center; white-space: nowrap; }
.btn-primary { background: var(--orange); border-color: var(--orange); color: var(--black); }
.btn-primary:hover { background: var(--orange-hover); border-color: var(--orange-hover); }
.btn-outline { background: var(--paper); border-color: var(--ink); color: var(--ink); }
.btn-outline:hover { background: var(--wash); }
.btn-danger { background: var(--bad); border-color: var(--bad); color: var(--on-black); }
.btn-block { width: 100%; }
.btn-sm { min-height: 44px; padding: 0 16px; font-size: 16px; }
.btn-text { background: none; border: 0; padding: 8px 4px; font-weight: 700; font-size: 17px; cursor: pointer; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.btn-text.danger { color: var(--bad); }
.btn-text.sm { font-size: 15px; padding: 2px 4px; }

/* ---------- Fields ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label, .lbl { font-weight: 700; font-size: 16px; color: var(--ink); }
.opt { font-weight: 400; color: var(--ink-3); }
input[type="text"], input[type="email"], input[type="password"], input[type="date"], select, textarea {
  width: 100%; min-height: 52px; padding: 10px 12px; border: 2px solid var(--line-strong); border-radius: 8px; background: var(--paper); font-size: 18px; color: var(--ink);
}
textarea { min-height: 0; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { border-color: var(--ink); outline: 3px solid var(--focus); outline-offset: 1px; }
input:disabled, select:disabled, textarea:disabled { background: var(--wash); color: var(--ink-3); border-color: var(--line); cursor: not-allowed; }
.btn:disabled, .btn:disabled:hover { opacity: 0.4; cursor: not-allowed; }
.money { position: relative; }
.money > span { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-2); pointer-events: none; }
.money input { padding-left: 28px; font-variant-numeric: tabular-nums; }
.err { color: var(--bad); font-weight: 700; font-size: 16px; }
.help { color: var(--ink-2); font-size: 15px; }
.pw-row { display: flex; justify-content: space-between; align-items: baseline; }

/* ---------- Login ---------- */
.auth { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 620px; }
.auth-side { background: var(--black); color: var(--on-black); display: flex; }
.auth-side-inner { width: 100%; max-width: 600px; margin-left: auto; padding-block: 44px 52px; display: flex; flex-direction: column; gap: 28px; }
.auth-side .brand { font-size: 34px; cursor: default; }
.auth-side .logo { width: 42px; height: 42px; }
.auth-head { font-size: clamp(36px, 4.4vw, 58px); color: var(--on-black); }
.auth-head span { color: var(--orange); display: block; }
.ruled { list-style: none; margin: auto 0 0; padding: 0; border-top: 1px solid var(--black-line); }
.ruled li { display: flex; justify-content: space-between; align-items: baseline; font-family: var(--display); font-weight: 500; font-size: 22px; color: var(--on-black-2); padding: 9px 0; border-bottom: 1px solid var(--black-line); }
.ruled li span { font-weight: 600; font-size: 15px; letter-spacing: 0.1em; color: var(--orange); }
.auth-main { display: flex; align-items: center; justify-content: center; padding-block: 44px; }
.auth-form-wrap { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 20px; }
.auth-form-wrap h2 { font-size: 38px; }
#login-form { display: flex; flex-direction: column; gap: 16px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--ink-2); font-size: 16px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; min-height: 0; }
  .auth-side-inner { margin: 0; max-width: none; padding-block: 24px 28px; gap: 14px; }
  .ruled { display: none; }
  .auth-head { font-size: 32px; }
  .auth-main { padding-block: 28px 48px; }
}

/* ---------- Learn more ---------- */
.learn h1 { font-size: clamp(38px, 5.2vw, 62px); max-width: 17ch; }
.lede { font-size: 21px; line-height: 1.5; color: var(--ink-2); max-width: 60ch; margin-top: 16px; }
.learn-cta { margin-top: 24px; display: flex; gap: 12px; flex-wrap: wrap; }
.learn-logs { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); max-width: 820px; }
.learn-logs li { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); align-items: start; }
.learn-logs .ic { width: 30px; height: 30px; color: var(--orange-ink); margin-top: 2px; }
.learn-logs h3 { font-size: 24px; }
.learn-logs p { color: var(--ink-2); font-size: 17px; margin-top: 2px; }
.steps { list-style: none; counter-reset: s; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.steps li { counter-increment: s; padding: 18px; border: 2px solid var(--line); border-radius: 10px; font-size: 18px; }
.steps li::before { content: counter(s); display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--orange); color: var(--black); font-family: var(--display); font-weight: 700; font-size: 22px; margin-bottom: 10px; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 48px; margin-top: 44px; }
.two h3 { font-size: 26px; margin-bottom: 8px; }
.two p { color: var(--ink-2); }
@media (max-width: 760px) { .steps, .two { grid-template-columns: 1fr; } }
.foot { border-top: 1px solid var(--line); }
.foot-inner { max-width: 1120px; margin: 0 auto; padding-block: 20px; color: var(--ink-3); font-size: 15px; }

/* ---------- Roles & pills ---------- */
.role { display: inline-flex; align-items: center; font-family: var(--display); font-weight: 600; font-size: 15px; letter-spacing: 0.06em; text-transform: uppercase; padding: 3px 12px; border-radius: 999px; white-space: nowrap; border: 1.5px solid transparent; line-height: 1.3; }
.role-admin { background: var(--black); color: var(--on-black); border-color: var(--black); }
.role-contributor { background: var(--orange-wash); color: var(--orange-ink); border-color: var(--orange); }
.role-reader { background: var(--paper); color: var(--ink-2); border-color: var(--line-strong); }
.pill { display: inline-block; font-size: 14px; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; line-height: 1.35; }
.pill-ok { background: var(--ok-wash); color: var(--ok); }
.pill-wait { background: var(--wait-wash); color: var(--wait); }
.pill-bad { background: var(--bad-wash); color: var(--bad); }
.pill-void { background: var(--wash); color: var(--ink-3); border: 1px solid var(--line-strong); }
.pill-done { background: var(--wash); color: var(--ink); }

/* ---------- Projects ---------- */
.project-list { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.project-row { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px 24px; padding: 20px 10px; background: var(--paper); border: 0; border-bottom: 1px solid var(--line); text-align: left; cursor: pointer; }
.project-row:hover { background: var(--orange-wash); }
.pr-name { display: block; font-family: var(--display); font-weight: 700; font-size: 26px; line-height: 1.15; }
.pr-meta { display: block; color: var(--ink-2); font-size: 16px; margin-top: 4px; }
.pr-open { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; white-space: nowrap; }
@media (max-width: 600px) { .project-row { grid-template-columns: minmax(0, 1fr) auto; padding: 18px 4px; } .pr-open { display: none; } .pr-name { font-size: 22px; } }
.role-key { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 28px; margin-top: 28px; }
.role-key > div { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.role-key p { font-size: 16px; color: var(--ink-2); }
@media (max-width: 760px) { .role-key { grid-template-columns: 1fr; } }

/* ---------- Dashboard ---------- */
.proj-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 16px 24px; padding-bottom: 22px; border-bottom: 2px solid var(--ink); }
.proj-head > div { min-width: 0; }
.proj-head h1 { font-size: clamp(32px, 4vw, 46px); }
.proj-meta { display: flex; flex-wrap: wrap; gap: 4px 22px; margin-top: 10px; color: var(--ink-2); font-size: 17px; }
.proj-meta b { color: var(--ink); }
.ph-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.ph-side small { font-size: 14px; color: var(--ink-2); font-weight: 700; }
.proj-num { font-family: var(--display); font-weight: 600; font-size: 21px; color: var(--ink-2); margin-top: 6px; letter-spacing: 0.02em; }
.summary { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line-strong); border-radius: 10px; margin-top: 20px; overflow: hidden; }
.summary > div { background: var(--paper); padding: 10px 14px; min-width: 0; }
.s-label { font-size: 14px; color: var(--ink-2); font-weight: 700; line-height: 1.25; }
.s-val { font-family: var(--display); font-weight: 700; font-size: 24px; font-variant-numeric: tabular-nums; line-height: 1.2; }
.s-val.muted { color: var(--ink-3); font-size: 18px; padding-top: 3px; }
.s-sub { font-size: 13px; color: var(--ink-3); line-height: 1.3; }
@media (max-width: 1099px) { .summary { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary > div { padding: 10px 12px; }
  .s-val { font-size: 21px; }
}
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 900px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tile { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 20px; border: 2px solid var(--line); border-radius: 10px; background: var(--paper); text-align: left; cursor: pointer; min-height: 150px; min-width: 0; color: var(--ink); }
.tile:hover { border-color: var(--line-strong); background: var(--zebra); }
.tile .ic { width: 30px; height: 30px; color: var(--ink-3); }
.tile-name { font-family: var(--display); font-weight: 700; font-size: 24px; line-height: 1.1; color: var(--ink-2); }
.tile-soon { margin-top: auto; font-size: 14px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.06em; }
.tile.live { border-color: var(--ink); }
.tile.live:hover { border-color: var(--orange); background: var(--orange-wash); }
.tile.live .ic { color: var(--orange-ink); width: 34px; height: 34px; }
.tile.live .tile-name { color: var(--ink); font-size: 25px; }
.tile-top { display: flex; align-items: center; gap: 12px; }
.tile-stats { display: flex; flex-wrap: wrap; gap: 8px; max-width: 100%; min-width: 0; }
.tile-stats .pill { white-space: normal; max-width: 100%; }
.tile-go { margin-top: auto; display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
@media (max-width: 480px) { .tile { padding: 16px; min-height: 130px; } .tile-name { font-size: 21px; } .tile.live .tile-name { font-size: 23px; } .tile.live .ic { width: 28px; height: 28px; } }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
@media (max-width: 600px) { .actions .btn { flex: 1 1 100%; } }

/* ---------- Change event log ---------- */
.log-tools { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 20px; margin: 0 0 12px; }
.open-note { font-weight: 700; font-size: 19px; }
.open-note span { font-weight: 400; color: var(--ink-2); font-size: 16px; }
.check { display: inline-flex; align-items: center; gap: 10px; font-size: 17px; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--black); margin: 0; }
.count { color: var(--ink-2); font-size: 16px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line-strong); border-radius: 10px; }
table.log { width: 100%; min-width: 1180px; border-collapse: collapse; font-size: 16px; }
.log th { background: var(--black); color: var(--on-black); font-family: var(--display); font-weight: 600; font-size: 15px; letter-spacing: 0.04em; text-transform: uppercase; text-align: left; vertical-align: bottom; padding: 12px 10px; line-height: 1.2; }
.log th.num { text-align: right; }
.log td { background: var(--paper); padding: 14px 10px; border-top: 1px solid var(--line); vertical-align: top; line-height: 1.4; }
.log th:first-child, .log td.c-no { position: sticky; left: 0; z-index: 1; }
.log tbody tr[data-no] { cursor: pointer; }
.log tbody tr:nth-child(even) td { background: var(--zebra); }
.log tbody tr[data-no]:hover td { background: var(--orange-wash); }
.log tbody tr:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.log .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.c-no { font-weight: 700; white-space: nowrap; }
.c-no .pill { display: block; width: fit-content; margin-top: 4px; }
.c-desc { min-width: 230px; max-width: 360px; }
.c-ven { min-width: 140px; }
.c-rem { min-width: 210px; max-width: 300px; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sub { display: block; font-size: 14px; color: var(--ink-3); }
.dash { color: var(--ink-3); }
.log tr.is-void td { color: var(--void); }
.log tr.is-void .c-desc { text-decoration: line-through; }
.log tr.is-void .pill:not(.pill-void) { opacity: 0.55; }
.log tfoot td { border-top: 2px solid var(--ink); background: var(--wash); font-weight: 700; padding: 14px 10px; }
.t-label { font-family: var(--display); font-size: 18px; }
.t-note { display: block; font-family: var(--body); font-weight: 400; font-size: 14px; color: var(--ink-2); }
.empty-row td { padding: 28px 16px; color: var(--ink-2); text-align: center; }
.cards { display: none; gap: 12px; }
@media (max-width: 760px) { .table-wrap { display: none; } .cards { display: grid; } }
.ev-card { display: flex; flex-direction: column; gap: 8px; width: 100%; text-align: left; padding: 16px; border: 1.5px solid var(--line-strong); border-radius: 10px; background: var(--paper); cursor: pointer; color: var(--ink); }
.ev-card:hover { border-color: var(--ink); }
.ev-card > span { display: block; }
.ev-top { display: flex !important; justify-content: space-between; gap: 10px; font-size: 16px; color: var(--ink-2); }
.ev-top b { color: var(--ink); font-size: 17px; }
.ev-desc { font-size: 17px; line-height: 1.4; }
.ev-bot { display: flex !important; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.ev-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.ev-money { font-variant-numeric: tabular-nums; font-weight: 700; }
.ev-money small { font-weight: 400; color: var(--ink-2); font-size: 14px; margin-right: 6px; }
.ev-card.is-void { color: var(--void); }
.ev-card.is-void .ev-desc { text-decoration: line-through; }
.ev-totals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 14px 16px; border-radius: 10px; background: var(--wash); border-top: 2px solid var(--ink); }
.ev-totals span { display: block; font-size: 14px; color: var(--ink-2); }
.ev-totals b { font-variant-numeric: tabular-nums; }
.ev-totals .t-note { grid-column: 1 / -1; }
.add-row { margin-top: 18px; }
.btn-add { width: 100%; min-height: 60px; font-size: 19px; }
.banner { padding: 12px 16px; border-radius: 8px; font-size: 16px; }
.banner-info { background: var(--wash); color: var(--ink-2); border: 1px solid var(--line); }
.banner-void { background: var(--wash); border: 1px solid var(--line-strong); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.banner-void p { flex: 1 1 260px; }

.proj-tenure { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 8px; font-size: 17px; color: var(--ink-2); }
.proj-tenure b { color: var(--ink); }
.tag { font-family: var(--display); font-weight: 600; font-size: 15px; letter-spacing: 0.06em; text-transform: uppercase; padding: 2px 10px; border-radius: 6px; background: var(--wash); border: 1px solid var(--line-strong); color: var(--ink); }
.s-sub.strong { color: var(--ink); font-weight: 700; font-size: 13px; }
.link-btn { background: none; border: 0; padding: 0; font-weight: 700; color: var(--orange-ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: inherit; }
.link-line { font-size: 16px; color: var(--ink-2); }
table.log.rfi { min-width: 1280px; }
.c-title { min-width: 160px; font-weight: 700; }
.c-who { min-width: 110px; }
.head-btns { display: flex; flex-wrap: wrap; gap: 10px; }
.pill-alert { background: var(--bad); color: var(--on-black); }
.log tr.is-late td.c-no { box-shadow: inset 5px 0 0 var(--bad); }
.ev-card.is-late { border-left: 6px solid var(--bad); }
.open-note .alert { color: var(--bad); font-weight: 700; font-size: 17px; }
.s-sub.alert { color: var(--bad); font-weight: 700; font-size: 13px; }
.banner-alert { background: var(--bad-wash); color: var(--bad); border: 1px solid var(--bad); font-weight: 700; }
.banner-alert.soft { font-weight: 400; color: var(--ink); }
.banner-alert.soft b { color: var(--bad); }
.rec-tools { display: flex; justify-content: flex-end; }

/* ---------- Account ---------- */
.acct-sec { border-top: 2px solid var(--ink); padding-block: 18px 28px; display: flex; flex-direction: column; gap: 16px; max-width: 760px; }
.acct-h { font-size: 26px; }
.acct-save { padding-block: 0 32px; }
.static { min-height: 52px; display: flex; align-items: center; font-size: 18px; overflow-wrap: anywhere; }
.logo-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; }
.logo-box { width: 240px; max-width: 100%; height: 96px; border: 2px dashed var(--line-strong); border-radius: 8px; display: grid; place-items: center; padding: 10px; background: var(--paper); color: var(--ink-3); font-size: 15px; text-align: center; }
.logo-box.has { border-style: solid; border-color: var(--line); }
.logo-box img { max-width: 100%; max-height: 72px; object-fit: contain; }
.logo-btns { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.lh-paper { background: var(--paper); border: 1px solid var(--line-strong); box-shadow: 0 8px 24px var(--shadow-soft); padding: 22px 24px 28px; max-width: 680px; }
.lh-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-bottom: 12px; border-bottom: 2px solid var(--ink); font-family: Helvetica, Arial, sans-serif; }
.lh-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.lh-left img { display: block; max-height: 44px; max-width: 140px; object-fit: contain; }
.lh-co { font-weight: 700; font-size: 19px; overflow-wrap: anywhere; }
.lh-co.empty { color: var(--ink-3); font-weight: 400; font-style: italic; }
.lh-right { text-align: right; flex: none; }
.lh-right b { display: block; font-size: 15px; }
.lh-right span { font-size: 12px; color: var(--ink-2); }
.lh-body { display: flex; flex-direction: column; gap: 10px; padding-top: 16px; }
.lh-body span { height: 9px; border-radius: 3px; background: var(--wash); }
.lh-body span:nth-child(2) { width: 85%; }
.lh-body span:nth-child(3) { width: 60%; }
@media (max-width: 520px) { .lh-top { flex-direction: column; align-items: flex-start; } .lh-right { text-align: left; } }

/* ---------- Directory ---------- */
.dir-sec { margin-top: 32px; }
.dir-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-bottom: 10px; border-bottom: 2px solid var(--ink); }
.dir-head h2 { font-size: 26px; }
.dir-cols, .dir-row { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1.5fr) minmax(0, 1.45fr) minmax(0, 0.95fr) minmax(0, 0.95fr); gap: 4px 16px; padding: 12px 8px; }
.dir-cols { font-family: var(--display); font-weight: 600; font-size: 14px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); padding-block: 8px 6px; }
.dir-row { width: 100%; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; font-size: 16px; line-height: 1.4; color: var(--ink); border-radius: 0; }
button.dir-row { cursor: pointer; }
button.dir-row:hover { background: var(--orange-wash); }
.dc { min-width: 0; overflow-wrap: anywhere; }
.dc i { display: none; font-style: normal; font-size: 13px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-3); }
.dc-name b { display: block; font-size: 17px; }
.dc-ph { font-variant-numeric: tabular-nums; white-space: nowrap; }
.dir-empty { padding: 14px 8px; color: var(--ink-3); font-size: 16px; }
@media (max-width: 1180px) {
  .dir-cols { display: none; }
  .dir-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 16px; padding: 14px 6px; }
  .dc-email { grid-column: span 2; }
  .dc i { display: block; }
}
@media (max-width: 640px) {
  .dir-row { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 14px 4px; }
  .dc-name, .dc-addr, .dc-email { grid-column: 1 / -1; }
}

/* ---------- Budget ---------- */
.ledger { max-width: 780px; border-top: 2px solid var(--ink); }
.ledger-sec { padding: 18px 0 6px; border-bottom: 1px solid var(--line-strong); }
.ledger-sec:last-child { border-bottom: 0; }
.ledger-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 17px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--orange-ink); margin-bottom: 4px; }
.ledger-head small { font-family: var(--body); font-size: 14px; letter-spacing: 0; text-transform: none; font-weight: 400; color: var(--ink-3); }
.l-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 20px; width: 100%; padding: 12px 8px; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; color: var(--ink); border-radius: 0; }
.ledger-head + .l-row { border-top: 0; }
button.l-row { cursor: pointer; }
button.l-row:hover { background: var(--orange-wash); }
.l-label { font-size: 18px; font-weight: 700; min-width: 0; }
.l-label small { display: block; font-weight: 400; font-size: 15px; color: var(--ink-2); }
.l-amt { font-family: var(--display); font-weight: 700; font-size: 26px; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.l-amt.muted { color: var(--ink-3); font-size: 19px; font-weight: 600; }
.l-amt.neg { color: var(--bad); }
.l-amt .pct { font-size: 0.62em; color: var(--ink-2); margin-left: 10px; }
.l-row.margin .l-label { font-size: 22px; }
.l-row.margin .l-amt { font-size: 38px; line-height: 1.15; border-bottom: 4px double var(--ink); }
.l-row.margin .l-amt.neg { border-bottom-color: var(--bad); }
.l-row.worst .l-label { font-weight: 400; color: var(--ink-2); }
.l-row.worst .l-amt { font-size: 22px; color: var(--ink-2); }
.ledger-note { margin-top: 18px; max-width: 780px; color: var(--ink-2); font-size: 16px; }
@media (max-width: 480px) { .l-amt { font-size: 22px; } .l-row.margin .l-amt { font-size: 28px; } .l-label { font-size: 17px; } }

/* ---------- Schedule ---------- */
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
table.log.sched { min-width: 860px; }
.log.sched th:first-child { position: static; }
.log.sched th.c-drag, .log.sched td.c-drag { width: 52px; padding-left: 6px; padding-right: 0; }
.log.sched .c-tno { width: 64px; font-weight: 700; }
.log.sched .c-act { min-width: 220px; }
.log.sched .c-act .pill { display: table; margin-top: 4px; }
.log.sched .c-dur { width: 92px; }
.log.sched .c-date { width: 108px; }
.log.sched .c-done { width: 104px; }
.log.sched .c-mat { width: 96px; }
.log.sched tbody tr.t-done td { color: var(--void); }
.log.sched tbody tr.t-late td { background: var(--bad-wash); }
.log.sched tbody tr.t-late td:first-child { box-shadow: inset 5px 0 0 var(--bad); }
.log.sched tbody tr.t-late td.c-end { color: var(--bad); font-weight: 700; }
.log.sched tbody tr[data-no]:hover td { background: var(--orange-wash); }
.drag { width: 40px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 6px; background: none; color: var(--ink-3); cursor: grab; touch-action: none; padding: 0; }
.drag:hover { background: var(--wash); color: var(--ink); }
.drag .ic { width: 24px; height: 24px; }
body.is-dragging, body.is-dragging * { cursor: grabbing !important; user-select: none; -webkit-user-select: none; }
body.is-dragging [data-item] { transition: transform 0.15s ease; }
body.is-dragging [data-item].dragging { transition: none; position: relative; z-index: 5; }
.log tbody tr.dragging td { background: var(--orange-wash) !important; }
.log tbody tr.dragging { outline: 2px solid var(--orange); }
.task-card.dragging { box-shadow: 0 10px 28px var(--shadow); border-color: var(--orange); }
@media (prefers-reduced-motion: reduce) { body.is-dragging [data-item] { transition: none; } }
.done-box { display: inline-flex; align-items: center; justify-content: center; padding: 6px; cursor: pointer; }
.done-box input { width: 26px; height: 26px; margin: 0; accent-color: var(--ok); cursor: pointer; }
.done-box input:disabled { cursor: not-allowed; }
.lock-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 12px; border: 1.5px dashed var(--line-strong); border-radius: 8px; background: var(--wash); color: var(--ink-3); font-weight: 700; font-size: 15px; cursor: not-allowed; white-space: nowrap; }
.lock-btn .ic { width: 18px; height: 18px; }
.c-tl { position: relative; width: 30%; min-width: 280px; }
.log.sched td.c-tl { padding: 0 14px; }
.log.sched th.c-tl { padding: 12px 14px; vertical-align: bottom; }
.tl { position: absolute; inset: 0 14px; }
.tl-head { position: relative; height: 18px; }
.tl-lbl { position: absolute; top: 0; padding-left: 4px; font-size: 13px; letter-spacing: 0.04em; color: var(--on-black-2); white-space: nowrap; }
.tl-m { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line); }
.tl-today { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--orange); z-index: 1; }
.tl-bar { position: absolute; top: 50%; height: 14px; margin-top: -7px; border-radius: 4px; background: var(--ink); z-index: 2; min-width: 4px; }
.tl-bar.b-done { background: var(--line-strong); }
.tl-bar.b-late { background: var(--bad); }
.tl-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; font-size: 15px; color: var(--ink-2); }
.tl-legend span { display: inline-flex; align-items: center; gap: 6px; }
.tl-legend i { display: inline-block; width: 18px; height: 10px; border-radius: 3px; background: var(--ink); }
.tl-legend i.k-late { background: var(--bad); }
.tl-legend i.k-done { background: var(--line-strong); }
.tl-legend i.k-today { width: 3px; height: 16px; border-radius: 0; background: var(--orange); }
@media (max-width: 1279px) { .c-tl, .tl-legend { display: none; } }
/* slim schedule lines: a schedule can run to 100 tasks */
.log.sched td { padding-top: 7px; padding-bottom: 7px; }
.log.sched .drag { height: 32px; }
.log.sched .done-box { padding: 2px; }
.log.sched .done-box input { width: 22px; height: 22px; }
.log.sched .lock-btn { min-height: 28px; padding: 0 8px; font-size: 14px; }
.log.sched .c-act .pill { display: inline-block; margin: 0 0 0 8px; vertical-align: 1px; }
.cards.slim { gap: 6px; }
.task-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; padding: 0 2px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--paper); }
.task-card.no-drag { grid-template-columns: minmax(0, 1fr) auto; }
.task-card .drag { width: 32px; height: 40px; }
.task-card .drag .ic { width: 20px; height: 20px; }
.task-card .done-box { padding: 4px; }
.task-card .done-box input { width: 24px; height: 24px; }
.tc-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; padding: 6px 4px; border: 0; background: none; text-align: left; color: var(--ink); cursor: pointer; }
.task-card.no-drag .tc-main { padding-left: 10px; }
.tc-line1 { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.tc-no { flex: none; min-width: 1.7em; font-size: 15px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.tc-desc { min-width: 0; font-size: 16px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc-line2 { padding-left: calc(1.7em + 8px); font-size: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.task-card.t-done .tc-desc, .task-card.t-done .tc-line2, .task-card.t-done .tc-no { color: var(--void); }
.task-card.t-late { border-left: 4px solid var(--bad); background: var(--bad-wash); }
.task-card.t-late .tc-line2 { color: var(--bad); font-weight: 700; }
.sched-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 18px; }
.pill-plain { background: var(--paper); color: var(--ink-2); border: 1px solid var(--line-strong); }
/* look-ahead on the dashboard */
.la-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px; margin: 36px 0 12px; }
.la-head .section-label { margin: 0; }
.la-range { font-size: 16px; color: var(--ink-2); font-weight: 700; }
.lookahead { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.la-row { width: 100%; display: grid; grid-template-columns: 84px minmax(0, 1fr) auto auto; align-items: center; gap: 6px 18px; padding: 13px 10px; border: 0; border-bottom: 1px solid var(--line); background: var(--paper); text-align: left; font-size: 17px; color: var(--ink); cursor: pointer; }
.la-row:hover { background: var(--orange-wash); }
.la-no { font-weight: 700; white-space: nowrap; }
.la-desc { min-width: 0; }
.la-dates { color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 16px; }
.la-row.is-late { background: var(--bad-wash); box-shadow: inset 5px 0 0 var(--bad); }
.la-row.is-late .la-dates { color: var(--bad); font-weight: 700; }
.la-row.is-late:hover { background: var(--orange-wash); }
@media (max-width: 640px) {
  .la-row { grid-template-columns: minmax(0, 1fr) auto; padding: 12px 6px 12px 12px; }
  .la-desc { grid-column: 1 / -1; grid-row: 2; font-weight: 700; }
  .la-dates { grid-column: 1 / -1; grid-row: 3; }
}
/* task popup: date picker, stepper, move */
.date-btn { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 52px; padding: 10px 12px; border: 2px solid var(--line-strong); border-radius: 8px; background: var(--paper); font-size: 18px; text-align: left; color: var(--ink); cursor: pointer; font-variant-numeric: tabular-nums; }
.date-btn:hover:not(:disabled) { border-color: var(--ink); }
.date-btn[aria-expanded="true"] { border-color: var(--ink); }
.date-btn:disabled { background: var(--wash); color: var(--ink-3); border-color: var(--line); cursor: not-allowed; }
.date-btn .ic { color: var(--ink-2); }
.cal { border: 2px solid var(--ink); border-radius: 10px; padding: 12px; background: var(--paper); max-width: 380px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.cal-head b { font-family: var(--display); font-size: 22px; }
.cal-nav { width: 44px; height: 44px; border: 2px solid var(--line-strong); border-radius: 8px; background: var(--paper); font-size: 24px; line-height: 1; cursor: pointer; color: var(--ink); }
.cal-nav:hover { border-color: var(--ink); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-dow { text-align: center; font-size: 13px; font-weight: 700; color: var(--ink-2); padding: 4px 0; }
.cal-dow.we { color: var(--line-strong); }
.cal-day { height: 44px; border: 0; border-radius: 8px; background: var(--wash); font-size: 17px; font-weight: 700; color: var(--ink); cursor: pointer; font-variant-numeric: tabular-nums; padding: 0; }
.cal-day:hover:not(:disabled) { background: var(--orange-wash); box-shadow: inset 0 0 0 2px var(--orange); }
.cal-day:disabled { background: transparent; color: var(--line-strong); font-weight: 400; cursor: not-allowed; }
.cal-day.is-today { box-shadow: inset 0 0 0 2px var(--ink); }
.cal-day.is-sel, .cal-day.is-sel:hover:not(:disabled) { background: var(--black); color: var(--on-black); box-shadow: none; }
.cal-note { font-size: 14px; color: var(--ink-2); margin-top: 8px; }
.stepper { display: flex; align-items: stretch; }
.stepper input { text-align: center; border-radius: 0; border-left-width: 0; border-right-width: 0; min-width: 0; font-variant-numeric: tabular-nums; }
.step { flex: none; width: 52px; min-height: 52px; border: 2px solid var(--line-strong); background: var(--wash); font-size: 24px; font-weight: 700; color: var(--ink); cursor: pointer; padding: 0; }
.step:first-child { border-radius: 8px 0 0 8px; }
.step:last-child { border-radius: 0 8px 8px 0; }
.step:hover:not(:disabled) { background: var(--orange-wash); }
.step:disabled { color: var(--ink-3); cursor: not-allowed; }
.end-val { font-weight: 700; }
.move-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 8px 8px 8px 14px; border-radius: 8px; background: var(--wash); }
.move-pos { font-weight: 700; }
.move-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.move-btns .btn { min-height: 40px; padding: 0 14px; font-size: 15px; gap: 6px; }
.move-btns .btn .ic { width: 18px; height: 18px; }
.move-btns .btn:disabled { opacity: 0.45; cursor: not-allowed; }
@media (max-width: 640px) { .move-row { padding: 8px; } .move-pos { padding-left: 6px; } .move-btns { width: 100%; } }

/* ---------- Submittals ---------- */
table.log.subs { min-width: 2260px; }
.log.subs .c-prod { min-width: 230px; max-width: 300px; }
.log.subs .c-title { min-width: 150px; }
.orig { display: block; color: var(--void); text-decoration: line-through; }
.altp { display: block; margin-top: 3px; }
.altp b { color: var(--orange-ink); }
.log tbody tr.is-concern td { background: var(--bad-wash); }
.log tbody tr.is-concern td:first-child { box-shadow: inset 5px 0 0 var(--bad); }
.log tbody tr.is-concern td.c-due { color: var(--bad); font-weight: 700; }
.log tbody tr[data-no].is-concern:hover td { background: var(--orange-wash); }
.c-due .pill { display: table; margin-top: 4px; }
.alert-txt { color: var(--bad) !important; font-weight: 700; }
.btn.mini { min-height: 34px; padding: 0 10px; font-size: 14px; gap: 6px; border-width: 1.5px; }
.btn.mini .ic { width: 18px; height: 18px; }
.tools-right { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; }
.filter { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; }
.filter select { width: auto; max-width: 100%; min-height: 44px; padding: 6px 10px; font-size: 16px; }
.unit { position: relative; }
.unit input { padding-right: 76px; font-variant-numeric: tabular-nums; }
.unit span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-2); pointer-events: none; }
.due-box { padding: 12px 14px; border-radius: 8px; background: var(--wash); }
.due-val { font-family: var(--display); font-weight: 700; font-size: 26px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.due-val.is-late { color: var(--bad); }
.mat-list { list-style: none; margin: 0 0 10px; padding: 0; border-top: 1px solid var(--line); }
.mat-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 16px; }
.mat-list li > span { min-width: 0; }
.mat-list .pill { margin-left: 4px; }
.link-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 6px; }
.link-row select { flex: 1 1 240px; width: auto; }
.log.sched .c-mat .pill { display: table; margin: 2px 0; }
.slim-card { display: flex; flex-direction: column; gap: 2px; width: 100%; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--paper); text-align: left; color: var(--ink); cursor: pointer; }
.slim-card .tc-line1 .pill { margin-left: auto; flex: none; }
.sc-no { flex: none; font-size: 15px; font-variant-numeric: tabular-nums; }
.sc-line2 { font-size: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.slim-card.is-concern { border-left: 4px solid var(--bad); background: var(--bad-wash); }
.slim-card.is-concern .sc-line2 { color: var(--bad); font-weight: 700; }
.slim-card.is-void { color: var(--void); }
.slim-card.is-void .tc-desc { text-decoration: line-through; }

/* ---------- Notebook ---------- */
table.log.nb { min-width: 640px; }
.log.nb .c-no { width: 70px; }
.log.nb .c-body { min-width: 280px; }
.log.nb .c-body .clamp { -webkit-line-clamp: 3; }
.sc-line2.trunc { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Meeting minutes ---------- */
.switch { display: inline-flex; border: 2px solid var(--ink); border-radius: 8px; overflow: hidden; }
.switch button { min-width: 120px; min-height: 48px; padding: 0 22px; border: 0; border-left: 2px solid var(--ink); background: var(--paper); font-weight: 700; font-size: 18px; color: var(--ink); cursor: pointer; }
.switch button:first-child { border-left: 0; }
.switch button[aria-pressed="true"] { background: var(--black); color: var(--on-black); }
.switch button:hover:not([aria-pressed="true"]) { background: var(--wash); }
.meet-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 20px; margin-bottom: 14px; }
table.log.meet { min-width: 640px; }
.log.meet .c-no { width: 130px; }
.log.meet .c-with { min-width: 200px; }
.add-bottom { margin-top: 16px; }
.mt-page { max-width: 980px; }
.mt-page .page-head h1 { overflow-wrap: anywhere; }
.att-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; }
.att-group { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; border: 1.5px solid var(--line-strong); border-radius: 10px; }
.att-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.att-head b { font-family: var(--display); font-size: 21px; }
textarea.grow-sm { field-sizing: content; min-height: 5em; }
textarea.grow { field-sizing: content; min-height: 8em; }
.mt-sec { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.mt-sec-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 12px; }
.mt-sec-title { font-size: 25px; }
.mt-actions { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-top: 26px; padding-top: 16px; border-top: 2px solid var(--ink); }
.mt-page .history { margin-top: 18px; }
.pick-sec { margin: 8px 0 2px; font-family: var(--display); font-weight: 600; font-size: 16px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--orange-ink); }
.pick-row { display: flex; align-items: flex-start; gap: 12px; padding: 9px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.pick-row:hover { background: var(--orange-wash); }
.pick-row input { flex: none; width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--black); }
.pick-row span { display: flex; flex-direction: column; min-width: 0; }
.pick-row small { color: var(--ink-2); font-size: 15px; }
@media (max-width: 640px) { .switch { width: 100%; } .switch button { flex: 1 1 0; min-width: 0; } }

/* ---------- Popups ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; background: var(--scrim); display: flex; align-items: center; justify-content: center;
  padding: max(24px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(24px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
.sheet { background: var(--paper); width: 100%; max-width: 800px; max-height: 100%; border-radius: 12px; display: flex; flex-direction: column; box-shadow: 0 20px 60px var(--shadow); overflow: hidden; margin: 0; }
.sheet.narrow { max-width: 580px; }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 20px 24px 16px; border-bottom: 1px solid var(--line); }
.sheet-head h2 { font-size: 34px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.sheet-head h2:focus { outline: none; }
.sheet-head .eyebrow { margin-bottom: 2px; }
.x { width: 48px; height: 48px; border-radius: 8px; border: 2px solid var(--line-strong); background: var(--paper); font-size: 30px; line-height: 1; cursor: pointer; flex: none; display: grid; place-items: center; color: var(--ink); }
.x:hover { border-color: var(--ink); }
.sheet-body { overflow-y: auto; padding: 20px 24px 26px; display: flex; flex-direction: column; gap: 22px; flex: 1 1 auto; min-height: 0; }
.sheet-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 24px; border-top: 1px solid var(--line); background: var(--paper); }
.foot-btns { display: flex; gap: 10px; flex-wrap: wrap; margin-left: auto; }
.foot-msg { font-weight: 700; flex: 1 1 260px; font-size: 17px; }
.foot-msg.warn { color: var(--bad); }
@media (max-width: 640px) {
  .overlay { padding: 0; align-items: stretch; }
  .sheet, .sheet.narrow { max-width: none; border-radius: 0; height: 100%; }
  .sheet-head { padding-top: max(14px, env(safe-area-inset-top, 0px)); padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .sheet-head h2 { font-size: 28px; }
  .sheet-body { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .sheet-foot { padding-bottom: max(14px, env(safe-area-inset-bottom, 0px)); padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .foot-btns { width: 100%; }
  .foot-btns .btn { flex: 1 1 0; }
}
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.span3 { grid-column: 1 / -1; }
.span2 { grid-column: span 2; }
@media (max-width: 640px) { .grid3, .grid2 { grid-template-columns: 1fr; } .span2 { grid-column: auto; } }
.group { border: 0; margin: 0; padding: 18px 0 0; border-top: 1px solid var(--line); min-width: 0; }
.group legend, .group-title { float: left; width: 100%; padding: 0; margin: 0 0 12px; font-family: var(--display); font-weight: 600; font-size: 17px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--orange-ink); }
.group > :not(legend) { clear: both; }
.seg { display: inline-flex; border: 2px solid var(--ink); border-radius: 8px; overflow: hidden; max-width: 100%; }
.field > .seg { align-self: flex-start; }
.seg label { position: relative; display: block; }
.seg input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; margin: 0; cursor: pointer; }
.seg span { display: block; min-width: 84px; padding: 11px 20px; text-align: center; font-weight: 700; background: var(--paper); color: var(--ink); border-left: 2px solid var(--ink); white-space: nowrap; }
.seg label:first-child span { border-left: 0; }
.seg label:hover input:not(:checked):not(:disabled) + span { background: var(--wash); }
.seg input:checked + span { background: var(--black); color: var(--on-black); }
.seg label[data-tone="ok"] input:checked + span { background: var(--ok); color: var(--on-black); }
.seg label[data-tone="bad"] input:checked + span { background: var(--bad); color: var(--on-black); }
.seg label[data-tone="wait"] input:checked + span { background: var(--wait-strong); color: var(--black); }
.seg input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: -6px; }
.seg input:disabled { cursor: not-allowed; }
.seg input:disabled + span { opacity: 0.55; }
@media (max-width: 640px) { .seg { display: flex; width: 100%; } .seg label { flex: 1 1 0; } .seg span { min-width: 0; padding: 12px 6px; } }
.row-pair { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.notes { list-style: none; margin: 0 0 14px; padding: 0; border-top: 1px dashed var(--line-strong); }
.notes li { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 2px 14px; padding: 10px 0; border-bottom: 1px dashed var(--line-strong); }
.n-meta { font-size: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.n-meta b { display: block; color: var(--ink); font-size: 15px; }
.notes p { font-size: 17px; }
.notes .is-new p::after { content: "  Not saved yet"; color: var(--orange-ink); font-size: 14px; font-weight: 700; white-space: nowrap; }
.notes .empty { display: block; color: var(--ink-3); font-size: 16px; }
@media (max-width: 640px) { .notes li { grid-template-columns: 1fr; } .n-meta b { display: inline; margin-right: 8px; } }
.note-add { display: flex; flex-direction: column; gap: 8px; }
.note-add .btn { align-self: flex-start; }
.history summary { cursor: pointer; font-weight: 700; font-size: 16px; color: var(--ink-2); padding: 6px 0; }
.history ol { list-style: none; margin: 8px 0 0; padding: 0; font-size: 15px; color: var(--ink-2); }
.history li { display: grid; grid-template-columns: 96px 110px minmax(0, 1fr); gap: 2px 12px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.history li span:last-child { color: var(--ink); }
@media (max-width: 640px) { .history li { grid-template-columns: 1fr; } }
.members { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.members li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.m-who { min-width: 0; flex: 1 1 220px; }
.m-who b { display: block; }
.m-who span { color: var(--ink-2); font-size: 15px; overflow-wrap: anywhere; }
.m-who .pill { margin-top: 4px; }
.m-ctl { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.m-ctl select { width: auto; min-width: 170px; }
.add-head { font-size: 22px; margin-bottom: -8px; }
.invite { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.6fr) minmax(0, 1fr) auto; gap: 12px; align-items: end; }
@media (max-width: 780px) { .invite { grid-template-columns: repeat(2, minmax(0, 1fr)); } .invite .btn { grid-column: 1 / -1; } }
@media (max-width: 640px) { .invite { grid-template-columns: 1fr; } }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 100; background: var(--black); color: var(--on-black); padding: 14px 22px; border-radius: 8px; font-weight: 700; font-size: 17px; width: max-content; max-width: calc(100% - 32px); box-shadow: 0 8px 30px var(--shadow); text-align: center; }
@media (prefers-reduced-motion: no-preference) { .toast:not([hidden]) { animation: rise 0.18s ease-out; } @keyframes rise { from { transform: translate(-50%, 8px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } } }

/* ---------- Saving indicator (top bar, project screens) ---------- */
.save-state { display: inline-flex; align-items: center; gap: 7px; font-size: 15px; color: var(--on-black-2); margin-right: 6px; white-space: nowrap; }
.save-state::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--ok-dot, #3DBE6A); flex: none; }
.save-state.is-saving::before { background: var(--wait-strong); }
.save-state.is-error { color: #FFD2CC; font-weight: 700; }
.save-state.is-error::before { background: #FF6B5B; }
@media (max-width: 600px) {
  .bar-inner { flex-wrap: wrap; row-gap: 6px; }
  .bar-right { gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
  .brand { font-size: 22px; gap: 8px; }
  .bar-btn { padding: 0 9px; font-size: 14px; }
  /* On phones the saving note floats at the bottom corner, and only shows while saving or if something is wrong. */
  .save-state { position: fixed; z-index: 40; left: max(12px, env(safe-area-inset-left, 0px)); bottom: calc(12px + env(safe-area-inset-bottom, 0px)); margin: 0; padding: 7px 14px; border-radius: 999px; background: var(--black); color: var(--on-black); font-size: 14px; box-shadow: 0 4px 14px var(--shadow); }
  .save-state.is-saved { display: none; }
}

/* ---------- Owner page ---------- */
.owner-invite { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto; }
@media (max-width: 780px) { .owner-invite { grid-template-columns: 1fr; } }

.loading-note { padding-block: 48px; font-size: 20px; }

