/* CPA Architecture — Practice Management mockup
   Brand cues taken from cpaarchitecture.com: charcoal, muted gold, Archivo + Inter. */

:root {
  --charcoal: #252525;
  --ink: #1e1e1c;
  --paper: #f4f2ec;
  --card: #ffffff;
  --line: #e4e0d4;
  --line-2: #cfc9b8;
  --gold: #af9f66;
  --gold-deep: #74672f;
  --gold-soft: #f3eedd;
  --muted: #696c6f;
  --go: #2a7654;
  --go-soft: #e2f0e9;
  --hold: #9a650b;
  --hold-soft: #fbf0d8;
  --no: #ad3b29;
  --no-soft: #f9e6e2;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(30, 30, 28, .05), 0 8px 24px -12px rgba(30, 30, 28, .18);
  --font-d: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --font-b: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --side: 256px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.5 var(--font-b);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p, dl, dd { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Shell ---------- */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--side);
  background: var(--charcoal); color: #fff;
  display: flex; flex-direction: column; padding: 28px 20px 20px;
  z-index: 20;
}
.brand { display: inline-flex; align-items: center; gap: 14px; text-decoration: none; color: #fff; }
.brand-logo { width: 62px; height: 54px; flex: none; }
.brand-text { font: 600 10.5px/1.4 var(--font-d); letter-spacing: .24em; text-transform: uppercase; color: var(--gold); }
.brand-text span { display: block; color: rgba(255, 255, 255, .55); letter-spacing: .08em; text-transform: none; font: 400 13px/1.4 var(--font-b); margin-top: 2px; }

.nav { margin-top: 44px; display: grid; gap: 4px; }
.nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: 10px;
  color: rgba(255, 255, 255, .68); text-decoration: none; font-weight: 500; font-size: 15px;
  transition: background .15s, color .15s;
}
.nav a svg { width: 20px; height: 20px; flex: none; }
.nav a:hover { color: #fff; background: rgba(255, 255, 255, .05); }
.nav a.active { color: #fff; background: rgba(175, 159, 102, .16); box-shadow: inset 2px 0 0 var(--gold); }
.nav a.active svg { color: var(--gold); }
.nav .count {
  margin-left: auto; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 99px;
  background: var(--gold); color: var(--charcoal);
}
.side-foot { margin-top: auto; font-size: 12.5px; line-height: 1.5; color: rgba(255, 255, 255, .45); }
.side-user { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 0 0; border-top: 1px solid rgba(255, 255, 255, .1); }
.side-user span { color: #fff; font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user button { flex: none; }
.side-foot button { background: none; border: 0; padding: 0; color: var(--gold); text-decoration: underline; text-underline-offset: 3px; }

.topbar { display: none; }
.topbar-out { margin-left: auto; background: none; border: 1px solid rgba(255, 255, 255, .25); color: #fff; border-radius: 8px; min-height: 36px; padding: 0 12px; font-size: 13px; font-weight: 600; }
.tabbar { display: none; }

main { margin-left: var(--side); padding: 36px 44px 80px; min-height: 100vh; }
.wrap { max-width: 1120px; margin: 0 auto; }

/* ---------- Type & primitives ---------- */
.eyebrow { font: 700 11.5px/1.3 var(--font-d); letter-spacing: .26em; text-transform: uppercase; color: var(--gold-deep); }
.display { font: 300 clamp(30px, 4.6vw, 50px)/1.04 var(--font-d); letter-spacing: .01em; text-transform: uppercase; text-wrap: balance; }
.h2 { font: 700 22px/1.2 var(--font-d); letter-spacing: -.01em; }
.h3 { font: 700 17px/1.25 var(--font-d); }
.sub { color: var(--muted); }
.small { font-size: 13.5px; }
.tag {
  display: inline-block; font: 700 10px/1 var(--font-d); letter-spacing: .1em; text-transform: uppercase;
  padding: 4px 7px; border-radius: 6px; background: var(--gold-soft); color: var(--gold-deep); vertical-align: middle; margin-left: 6px;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 10px; border: 1px solid transparent;
  font-weight: 600; font-size: 15px; text-decoration: none; white-space: nowrap;
  transition: transform .08s, background .15s, border-color .15s, color .15s;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; }
.btn-dark { background: var(--charcoal); color: #fff; }
.btn-dark:hover { background: #000; }
.btn-gold { background: var(--gold); color: var(--charcoal); }
.btn-gold:hover { background: #bdae77; }
.btn-line { background: var(--card); border-color: var(--line-2); }
.btn-line:hover { border-color: var(--ink); }
.btn-ghost { background: transparent; color: var(--muted); padding: 0 10px; }
.btn-ghost:hover { color: var(--ink); background: rgba(0, 0, 0, .05); }
.btn-danger { background: var(--no); color: #fff; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 8px; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--muted); font-size: 13.5px; text-decoration: underline; text-underline-offset: 3px; }
.linkbtn:hover { color: var(--ink); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 24px 0; }

.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px;
  font: 700 11px/1.2 var(--font-d); letter-spacing: .12em; text-transform: uppercase; white-space: nowrap;
}
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.go { background: var(--go-soft); color: var(--go); }
.pill.hold { background: var(--hold-soft); color: var(--hold); }
.pill.no { background: var(--no-soft); color: var(--no); }
.pill.neutral { background: #ecebe6; color: var(--muted); }

.bar { height: 8px; border-radius: 99px; background: #ebe8df; overflow: hidden; display: flex; }
.bar i { display: block; height: 100%; transition: width .4s cubic-bezier(.2, .8, .2, 1); }
.bar .inv { background: var(--go); }
.bar .sub { background: var(--gold); }

.alert {
  background: var(--hold-soft); border-left: 3px solid #c98a1b; border-radius: 0 8px 8px 0;
  padding: 12px 14px; font-size: 13.5px; line-height: 1.5; color: #5d3f08;
}

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background: var(--charcoal); color: #fff; border-radius: 18px; padding: 40px 40px 36px;
  background-image:
    linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 40px 40px;
}
.hero::after {
  content: ''; position: absolute; right: -110px; top: -110px; width: 260px; height: 260px;
  border: 1px solid rgba(175, 159, 102, .35); pointer-events: none;
}
.hero::before {
  content: ''; position: absolute; right: 30px; top: 30px; width: 220px; height: 220px;
  border: 1px solid rgba(255, 255, 255, .08); pointer-events: none;
}
.hero > * { position: relative; z-index: 1; }
.hero .eyebrow { color: var(--gold); }
.hero .display { margin-top: 14px; max-width: 15em; padding-right: 120px; }
.hero p { margin-top: 14px; color: rgba(255, 255, 255, .7); max-width: 34em; }
.hero-actions { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 10px; }
.hero .btn-line { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .3); }
.hero .btn-line:hover { border-color: #fff; }

/* ---------- Overview ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 20px; }
.stat { padding: 20px 22px; }
.stat .k { font: 600 11px/1.3 var(--font-d); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.stat .v { font: 300 40px/1.1 var(--font-d); margin-top: 10px; letter-spacing: -.01em; }
.stat .v small { font-size: 18px; color: var(--muted); font-weight: 400; }
.stat .d { font-size: 13.5px; color: var(--muted); margin-top: 4px; }
.stat.accent { background: var(--gold-soft); border-color: #e2d9b8; }
.stat.accent .v { color: var(--gold-deep); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; align-items: start; }
.grid-2 > * { min-width: 0; }
.list { list-style: none; margin: 0; padding: 8px 0; }
.list li + li { border-top: 1px solid var(--line); }
.row {
  display: flex; align-items: center; gap: 14px; padding: 14px 24px;
  text-decoration: none; color: inherit; width: 100%; background: none; border: 0; text-align: left;
}
a.row:hover { background: #faf9f5; }
.row .grow { flex: 1; min-width: 0; }
.row .t { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .s { display: block; font-size: 13.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scorechip {
  width: 44px; height: 44px; flex: none; border-radius: 50%; display: grid; place-items: center;
  font: 700 13.5px/1 var(--font-d); border: 2px solid var(--line-2); color: var(--muted);
}
.scorechip.go { border-color: var(--go); color: var(--go); }
.scorechip.hold { border-color: #d19a2a; color: var(--hold); }
.scorechip.no { border-color: var(--no); color: var(--no); }
.datechip {
  min-width: 64px; flex: none; text-align: center; padding: 8px 6px; border: 1px solid var(--line-2); border-radius: 8px;
  font: 600 12.5px/1.2 var(--font-d);
}
.datechip.late { border-color: var(--no); background: var(--no-soft); color: var(--no); }
.empty { padding: 28px 24px; color: var(--muted); font-size: 14.5px; }

/* ---------- Opportunity list ---------- */
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 36px 0 14px; }
.opp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.opp {
  display: flex; flex-direction: column; gap: 14px; padding: 22px; text-decoration: none;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.opp:hover { transform: translateY(-2px); border-color: var(--line-2); box-shadow: 0 2px 4px rgba(30, 30, 28, .05), 0 16px 32px -14px rgba(30, 30, 28, .25); }
.opp-top { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.opp h3 { font: 700 19px/1.2 var(--font-d); }
.opp-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.opp-meta div span { display: block; font: 600 10.5px/1.3 var(--font-d); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.opp-meta div b { font: 600 17px/1.4 var(--font-d); }

/* ---------- Evaluator ---------- */
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500; }
.back:hover { color: var(--ink); }
.ev-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px; margin-top: 14px; }
.ev-head h1 { font: 700 clamp(26px, 3.6vw, 36px)/1.1 var(--font-d); letter-spacing: -.015em; margin-top: 8px; }
.ev-actions { display: flex; gap: 8px; align-items: center; }

.tabs { display: flex; gap: 28px; margin-top: 26px; border-bottom: 1px solid var(--line-2); }
.tabs a {
  display: flex; align-items: baseline; gap: 10px; padding: 0 0 13px; margin-bottom: -1px;
  text-decoration: none; color: var(--muted); font: 600 16px/1 var(--font-d); border-bottom: 3px solid transparent;
}
.tabs a b { font-weight: 700; font-size: 13px; color: var(--line-2); }
.tabs a.active { color: var(--ink); border-color: var(--gold); }
.tabs a.active b { color: var(--gold-deep); }

.ev-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; margin-top: 24px; align-items: start; }
.ev-form { display: grid; gap: 20px; }
.sec { padding: 28px; }
.sec-title { display: flex; align-items: baseline; gap: 12px; }
.sec-title b { font: 300 30px/1 var(--font-d); color: var(--gold); }
.sec-title h2 { font: 700 22px/1.2 var(--font-d); letter-spacing: -.01em; }
.sec > .sub { margin-top: 6px; font-size: 15px; }

.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; margin-top: 22px; }
.fields .full { grid-column: 1 / -1; }
.field label, .lbl { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.field .opt { font-weight: 400; color: var(--muted); }
.input, .field select, .field textarea {
  width: 100%; min-height: 46px; padding: 10px 14px; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: #fdfcfa; transition: border-color .15s, box-shadow .15s;
}
.field textarea { min-height: 84px; resize: vertical; }
.input:focus, .field select:focus, .field textarea:focus { outline: 0; border-color: var(--gold-deep); box-shadow: 0 0 0 3px rgba(175, 159, 102, .28); background: #fff; }
.input:disabled { background: #f1efe9; color: var(--muted); }
.affix { position: relative; }
.affix > span { position: absolute; top: 0; bottom: 0; display: grid; place-items: center; width: 34px; color: var(--muted); pointer-events: none; }
.affix.pre > span { left: 0; }
.affix.pre .input { padding-left: 30px; }
.affix.post > span { right: 4px; width: auto; padding-right: 8px; font-size: 14px; }
.affix.post .input { padding-right: 30px; }
.help { font-size: 13px; line-height: 1.45; color: var(--muted); margin-top: 6px; }
.range { width: 100%; height: 28px; margin: 8px 0 0; accent-color: var(--gold-deep); cursor: pointer; }

/* services, allocations and risk questions share one row shape: label left, control right */
.svc-head { display: flex; justify-content: space-between; gap: 12px; margin-top: 22px; padding-bottom: 8px; font: 600 10.5px/1.3 var(--font-d); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.svc { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 16px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.svc .input { min-height: 44px; }
.check { display: flex; align-items: center; gap: 12px; cursor: pointer; font-weight: 500; }
.check input { width: 20px; height: 20px; flex: none; margin: 0; accent-color: var(--charcoal); }
.check input:not(:checked) + span { color: var(--muted); }
.risks { margin-top: 18px; }
.risks .svc:first-child { border-top: 0; }
.risks label { font-weight: 500; }

details.more { margin-top: 24px; border-top: 1px solid var(--line); }
details.more summary { display: flex; align-items: baseline; gap: 8px; padding: 16px 0 6px; cursor: pointer; list-style: none; font: 700 15px/1.3 var(--font-d); }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::before { content: '▸'; color: var(--gold-deep); transition: transform .15s; display: inline-block; }
details.more[open] summary::before { transform: rotate(90deg); }
details.more summary span { font: 400 13.5px/1.3 var(--font-b); color: var(--muted); }
details.more .fields { margin-top: 12px; }
.more-h { font: 700 15px/1.3 var(--font-d); margin: 28px 0 0; }
.more-h + .help { margin-bottom: 10px; }

.labor-head, .labor-row { display: grid; grid-template-columns: minmax(0, 1fr) 96px 96px; gap: 10px; align-items: center; }
.labor-head { margin-top: 14px; padding-bottom: 4px; font: 600 10.5px/1.3 var(--font-d); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.labor-row { padding: 6px 0; }
.labor-row small { display: block; font-size: 13px; color: var(--muted); line-height: 1.3; }
.labor-row b { font-size: 14px; font-weight: 600; }
.labor-row .input { min-height: 40px; padding: 8px 10px; }

.crits { margin-top: 6px; }
.crit { border: 0; margin: 0; padding: 20px 0; min-width: 0; }
.crit + .crit { border-top: 1px solid var(--line); }
.crit legend { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; width: 100%; padding: 0; font-weight: 600; float: left; }
.crit legend small { font: 600 12px/1 var(--font-d); color: var(--muted); white-space: nowrap; }
.crit .hint { clear: both; font-size: 14px; color: var(--muted); padding: 2px 0 12px; }
.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.scale label { position: relative; display: block; min-width: 0; }
.scale input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.scale span {
  display: flex; align-items: center; justify-content: center; gap: 6px; height: 46px; border-radius: 9px; border: 1px solid var(--line-2);
  background: #fdfcfa; color: var(--muted); transition: all .12s;
}
.scale b { font: 700 14px/1 var(--font-d); }
.scale i { font-style: normal; font-size: 13.5px; }
.scale label:hover span { border-color: var(--ink); color: var(--ink); }
.scale input:checked + span { background: var(--charcoal); border-color: var(--charcoal); color: #fff; }
.scale input:checked + span b { color: var(--gold); }
.scale input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }

/* live decision rail */
.rail { position: sticky; top: 24px; display: grid; gap: 14px; max-height: calc(100vh - 48px); overflow-y: auto; scrollbar-width: thin; }
.summary { background: var(--charcoal); color: #fff; border-radius: var(--radius); padding: 24px; }
.summary .eyebrow { color: var(--gold); }
.summary h3 { font: 700 20px/1.2 var(--font-d); letter-spacing: .03em; text-transform: uppercase; margin-top: 10px; }
.sum-main { display: grid; grid-template-columns: 112px 1fr; gap: 16px; align-items: center; margin-top: 16px; }
.sum-main p { font-size: 14px; line-height: 1.5; color: rgba(255, 255, 255, .78); }
.ring-wrap { position: relative; width: 112px; height: 112px; }
.ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 9; }
.ring .track { stroke: rgba(255, 255, 255, .1); }
.ring .val { stroke: var(--gold); stroke-linecap: round; transition: stroke-dashoffset .5s cubic-bezier(.2, .8, .2, 1), stroke .3s; }
.ring-num { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-num b { font: 600 30px/1 var(--font-d); }
.ring-num span { font: 600 8.5px/1 var(--font-d); letter-spacing: .14em; text-transform: uppercase; color: rgba(255, 255, 255, .55); margin-top: 5px; }
.sum-meta { font-size: 13px; color: rgba(255, 255, 255, .55); margin-top: 14px; }
.v-go { color: #7fd1a8; } .v-hold { color: #ecc572; } .v-no { color: #f09a8a; } .v-neutral { color: rgba(255, 255, 255, .85); }
.s-go { stroke: #5fbf90 !important; } .s-hold { stroke: #e3b451 !important; } .s-no { stroke: #e77f6c !important; }
.rail-card { padding: 20px 22px; }
.rail-card .btn { width: 100%; margin-top: 16px; }
.rail-card .alert { margin-top: 14px; }
.econ { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; margin-top: 14px; }
.econ span { display: block; font-size: 12.5px; color: var(--muted); }
.econ b { font: 600 22px/1.3 var(--font-d); }
.econ b.neg { color: var(--no); } .econ b.warn { color: var(--hold); } .econ b.pos { color: var(--go); }
.bd { margin-top: 12px; }
.bd > div { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 6px; }
.bd b { font-weight: 600; }
.bd .bar i { background: var(--charcoal); }
#sum-alerts { display: grid; gap: 10px; }
.mobile-sum { display: none; }

/* ---------- Report ---------- */
.report { margin-top: 24px; padding: 44px 48px; max-width: 900px; }
.rp-top { display: flex; justify-content: space-between; align-items: start; gap: 20px; padding-bottom: 22px; border-bottom: 2px solid var(--ink); }
.rp-logo { width: 92px; height: 80px; color: var(--ink); flex: none; }
.rp-top .rp-doc { text-align: right; font-size: 13px; color: var(--muted); }
.rp-top .rp-doc b { display: block; font: 700 11.5px/1.3 var(--font-d); letter-spacing: .22em; text-transform: uppercase; color: var(--ink); }
.rp-title { margin-top: 28px; }
.rp-title h2 { font: 700 30px/1.1 var(--font-d); letter-spacing: -.015em; }
.rp-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px 24px; margin-top: 18px; }
.rp-facts dt { font: 600 10.5px/1.3 var(--font-d); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.rp-facts dd { font-weight: 600; }
.rp-verdict { display: grid; grid-template-columns: auto 1fr; gap: 22px; align-items: center; margin-top: 24px; padding: 20px 24px; border-radius: var(--radius-sm); }
.rp-verdict.go { background: var(--go-soft); color: var(--go); }
.rp-verdict.hold { background: var(--hold-soft); color: var(--hold); }
.rp-verdict.no { background: var(--no-soft); color: var(--no); }
.rp-verdict.neutral { background: #ecebe6; color: var(--muted); }
.rp-verdict .big { font: 300 54px/1 var(--font-d); }
.rp-verdict .big small { font-size: 18px; opacity: .7; }
.rp-verdict b { font: 700 20px/1.2 var(--font-d); letter-spacing: .05em; text-transform: uppercase; }
.rp-verdict p { color: var(--ink); font-size: 15px; margin-top: 2px; }
.rp-verdict p.small { color: var(--muted); font-size: 13px; }
.rp-h { font: 700 11.5px/1.3 var(--font-d); letter-spacing: .22em; text-transform: uppercase; color: var(--gold-deep); margin: 32px 0 12px; }
.rp-crit { display: grid; grid-template-columns: 96px 1fr 62px; gap: 14px; align-items: center; padding: 8px 0; font-size: 14.5px; }
.rp-crit .bar { height: 6px; }
.rp-crit .bar i { background: var(--charcoal); }
.rp-crit b { text-align: right; font: 600 14px/1 var(--font-d); }
.rp-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.rp-table td { padding: 8px 0; border-bottom: 1px solid var(--line); }
.rp-table td:last-child { text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; white-space: nowrap; padding-left: 12px; }
.rp-table tr.total td { border-bottom: 0; border-top: 2px solid var(--ink); font-weight: 700; }
.rp-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 40px; }
.rp-list { margin: 0; padding-left: 18px; display: grid; gap: 8px; font-size: 15px; }
.rp-sign { display: grid; grid-template-columns: 2fr 1fr; gap: 32px; margin-top: 56px; }
.rp-sign div { border-top: 1px solid var(--ink); padding-top: 8px; font-size: 12.5px; color: var(--muted); }

/* ---------- Billing ---------- */
.queue { margin-top: 20px; border-color: #e2d9b8; background: linear-gradient(180deg, var(--gold-soft), #fff 70%); }
.queue .row { padding: 12px 24px; }
.queue .row .t, .queue .row .s { white-space: normal; }
.queue a.t { text-decoration: none; }
.queue a.t:hover { text-decoration: underline; }
.queue .status { width: 178px; flex: none; }
.amount { font: 600 16px/1.3 var(--font-d); font-variant-numeric: tabular-nums; }
.section-head .h2 + .sub { margin-top: 2px; }

.proj { margin-top: 24px; display: grid; gap: 0; }
.proj > .sec + .sec { margin-top: 16px; }
.fields.three { grid-template-columns: repeat(3, 1fr); margin-top: 0; }
.fields.three .seg { margin: 0; }
.fields.three .seg button { min-height: 42px; }
.proj-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; align-items: center; padding: 22px 24px; }
.proj-head h3 { font: 700 21px/1.2 var(--font-d); letter-spacing: -.01em; }
.proj-prog { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; font-size: 13.5px; color: var(--muted); }
.proj-tools { display: flex; gap: 4px; align-items: center; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 9px; padding: 2px; background: #f6f4ee; margin-right: 6px; }
.seg button { border: 0; background: none; min-height: 38px; padding: 0 13px; border-radius: 7px; font: 700 12px/1 var(--font-d); letter-spacing: .08em; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--charcoal); color: var(--gold); }
.iconbtn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; border: 0; background: transparent; color: var(--muted); }
.iconbtn:hover { background: rgba(0, 0, 0, .06); color: var(--ink); }
.iconbtn svg { width: 20px; height: 20px; transition: transform .2s; }
.proj.collapsed .chev svg { transform: rotate(-90deg); }
.proj.collapsed .phases { display: none; }

.phase { margin-top: 16px; padding: 20px 24px 14px; }
.phase.current { background: #fdfcf8; box-shadow: inset 3px 0 0 var(--gold); }
.phase-head { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; }
.phase-head .eyebrow { letter-spacing: .18em; }
.phase-fee { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.phase-fee .input { width: 132px; min-height: 38px; padding-top: 6px; padding-bottom: 6px; font-size: 14px; }
.ms-cols, .ms { display: grid; grid-template-columns: minmax(170px, 1.25fr) 78px 78px 146px 160px minmax(120px, 1fr); gap: 10px; align-items: center; }
.ms-cols { margin-top: 14px; padding-bottom: 6px; font: 600 10.5px/1.3 var(--font-d); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.ms { padding: 10px 0; border-top: 1px solid var(--line); }
.ms-name { display: flex; gap: 10px; align-items: flex-start; min-width: 0; }
.ms-name b { display: block; font-weight: 600; line-height: 1.35; }
.ms-amt { font-size: 13px; color: var(--muted); }
.ms-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; flex: none; background: #cfcabb; }
.ms[data-status="in_progress"] .ms-dot { background: #4b7bb5; }
.ms[data-status="ready"] .ms-dot { background: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.ms[data-status="invoiced"] .ms-dot { background: #5aa583; }
.ms[data-status="paid"] .ms-dot { background: var(--go); box-shadow: 0 0 0 3px var(--go-soft); }
.ms[data-status="on_hold"] .ms-dot { background: var(--no); }
.ms[data-status="na"] .ms-name b, .ms[data-status="paid"] .ms-name b { color: var(--muted); }
.ms-f { display: block; min-width: 0; }
.ms-f > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.ms-f .input { min-height: 40px; padding: 8px 10px; font-size: 14px; }
.ms-f .affix.post .input { padding-right: 26px; }
.ms-f textarea.input { display: block; resize: vertical; line-height: 1.4; field-sizing: content; max-height: 160px; }
.ms.overdue input[type="date"] { border-color: var(--no); color: var(--no); background: var(--no-soft); }
.phase-foot { margin-top: 8px; color: var(--muted); }
.phase-foot .warn { color: var(--no); font-weight: 600; }

/* project list: folders of one-line projects */
.group { margin-bottom: 14px; overflow: hidden; }
.group-head { display: flex; align-items: center; gap: 12px; width: 100%; padding: 16px 24px; border: 0; background: #faf9f5; text-align: left; border-bottom: 1px solid var(--line); }
.group-head h3 { font: 700 17px/1.25 var(--font-d); margin-right: auto; }
.group-head .chev { display: grid; color: var(--muted); }
.group-head .chev svg { width: 20px; height: 20px; transition: transform .2s; }
.group.collapsed .group-head { border-bottom: 0; }
.group.collapsed .chev svg { transform: rotate(-90deg); }
.group.collapsed .list, .group.collapsed .empty { display: none; }
.group .list { padding: 0; }
.prow > svg { width: 18px; height: 18px; flex: none; color: var(--line-2); }
.prow .tag { margin: 0; flex: none; }
.prow-prog { display: flex; align-items: center; gap: 10px; width: 150px; flex: none; }
.prow-prog .bar { flex: 1; }
.prow-prog b { font: 600 13.5px/1 var(--font-d); width: 38px; text-align: right; }
.section-head .seg { flex: none; margin: 0; }

/* upcoming deadlines */
.dl { margin-top: 20px; padding-bottom: 8px; }
.dl .card-head { padding-bottom: 18px; }
.dl .card-head + .dl-row { border-top-color: transparent; }
.dl-cols, .dl-row { display: grid; grid-template-columns: 132px minmax(0, 1.2fr) minmax(0, .9fr) minmax(0, 1.3fr) 130px; gap: 14px; align-items: center; padding: 0 24px; }
.dl-cols { margin-top: 0; padding-bottom: 8px; font: 600 10.5px/1.3 var(--font-d); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.dl-row { padding-top: 16px; padding-bottom: 16px; border-top: 1px solid var(--line); text-decoration: none; font-size: 14.5px; }
.dl-row:hover { background: #faf9f5; }
.dl-date b { display: block; font: 600 14.5px/1.3 var(--font-d); }
.dl-date small { font-size: 12.5px; color: var(--muted); }
.dl-row.late .dl-date b, .dl-row.late .dl-date small { color: var(--no); }
.dl-proj { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-sub { display: contents; }
.dl-pm, .dl-ms { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-done { display: flex; align-items: center; gap: 10px; }
.dl-done .bar { flex: 1; }
.dl-done b { font: 600 13.5px/1 var(--font-d); width: 38px; text-align: right; }
.dl-more { display: block; margin: 10px 24px 8px; }

/* one project: progress picture */
.viz-top { display: flex; align-items: center; gap: 22px; margin-top: 18px; }
.viz-big { font: 300 56px/1 var(--font-d); letter-spacing: -.02em; }
.viz-big small { font-size: 22px; color: var(--muted); }
.viz-top .grow { flex: 1; min-width: 0; display: grid; gap: 8px; }
.viz-top .bar { height: 10px; }
.vz { margin-top: 26px; }
.vz-head { display: flex; align-items: baseline; gap: 8px; font-size: 15px; }
.vz-head span.num { margin-left: auto; font-size: 13.5px; color: var(--muted); }
.vz-track { display: flex; gap: 4px; margin-top: 10px; }
.vz-seg { height: 18px; min-width: 0; border-radius: 5px; background: #ebe8df; overflow: hidden; }
.vz-seg i { display: block; height: 100%; background: #b9b3a2; transition: width .4s cubic-bezier(.2, .8, .2, 1); }
.vz-labels { display: flex; gap: 4px; margin-top: 8px; }
.vz-labels > div { min-width: 0; padding-right: 8px; border-left: 2px solid #d9d4c5; padding-left: 8px; }
.vz-labels b { display: block; font-size: 13px; font-weight: 600; line-height: 1.3; }
.vz-labels span { display: block; font-size: 12px; line-height: 1.4; color: var(--muted); }
.vz-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.vz-legend span { display: inline-flex; align-items: center; gap: 6px; }
.vz-legend i { width: 12px; height: 12px; border-radius: 3px; background: #b9b3a2; }
[data-status="in_progress"] > i, .vz-labels [data-status="in_progress"] { --st: #4b7bb5; }
[data-status="completed"] > i, .vz-labels [data-status="completed"] { --st: var(--charcoal); }
[data-status="ready"] > i, .vz-labels [data-status="ready"] { --st: var(--gold); }
[data-status="invoiced"] > i, .vz-labels [data-status="invoiced"] { --st: #5aa583; }
[data-status="paid"] > i, .vz-labels [data-status="paid"] { --st: var(--go); }
[data-status="on_hold"] > i, .vz-labels [data-status="on_hold"] { --st: var(--no); }
.vz-seg[data-status] > i, .vz-legend [data-status] > i { background: var(--st, #b9b3a2); }
.vz-labels [data-status] { border-left-color: var(--st, #d9d4c5); }
.vz-seg[data-status="on_hold"] { background: var(--no-soft); }
.vz-seg[data-status="na"] { background: repeating-linear-gradient(135deg, #ebe8df 0 6px, #f6f4ee 6px 12px); }
.ms[data-status="completed"] .ms-dot { background: var(--charcoal); }

/* project history: a spreadsheet-like table, typed into directly */
.tabs a:not(:has(b)) { padding-top: 2px; }
.wrap.wide { max-width: none; }
#hist { margin-top: 24px; }
.hist { padding: 22px 24px 18px; }
.hist + .hist { margin-top: 20px; }
.hist-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.hist > .help { margin-top: 12px; }
.htable-wrap { margin-top: 16px; overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; scrollbar-width: thin; scrollbar-color: var(--line-2) #f6f4ee; }
/* Macs hide scrollbars until you scroll, so draw one that is always there when the table is wider than the screen. */
.htable-wrap::-webkit-scrollbar { height: 12px; }
.htable-wrap::-webkit-scrollbar-track { background: #f6f4ee; }
.htable-wrap::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 6px; border: 3px solid #f6f4ee; }
.scroll-hint { display: none; margin-top: 8px; font-size: 13px; color: var(--gold-deep); font-weight: 600; }
.htable-wrap.scrolls + .scroll-hint { display: block; }
.htable { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 1240px; font-size: 13.5px; }
.htable th { position: sticky; top: 0; z-index: 2; background: #faf9f5; text-align: left; padding: 10px 6px; font: 600 10.5px/1.3 var(--font-d); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); white-space: nowrap; }
.htable td { padding: 3px 3px; border-bottom: 1px solid var(--line); vertical-align: middle; background: #fff; }
.htable tbody tr:hover td { background: #fdfcf8; }
.htable .none td { padding: 24px 12px; color: var(--muted); text-align: center; }
.htable tfoot td { background: var(--gold-soft); color: var(--gold-deep); font-weight: 600; padding: 10px 8px; border-bottom: 0; white-space: nowrap; }
.htable tfoot td.c-name { font-weight: 400; }
.htable .c-year { width: 56px; } .htable .c-units { width: 62px; } .htable .c-hours { width: 70px; } .htable .c-phase { width: 130px; } .htable .c-drafting { width: 124px; }
.htable .c-sf, .htable .c-fee { width: 90px; } .htable .c-costPerUnit { width: 84px; } .htable .c-costPerSF { width: 76px; }
.htable .c-name { min-width: 130px; } .htable .c-client { min-width: 120px; } .htable .c-discounts { min-width: 110px; } .htable .c-notes { min-width: 120px; } .htable .c-del { width: 36px; }
.htable td.calc { padding: 3px 8px; color: var(--gold-deep); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.yearpick { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); flex: none; }
.yearpick .input { width: 150px; min-height: 42px; }
.ranges { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin-top: 16px; }
.urange { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; background: #fdfcfa; }
.range-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.range-head b { font: 700 15px/1.3 var(--font-d); }
.urange ul { list-style: none; margin: 0; padding: 0; }
.urange li { display: flex; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.urange li > .num { flex: none; width: 40px; color: var(--muted); }
.urange li .grow { min-width: 0; }
.urange li b { display: block; font-weight: 600; }
.urange li small { display: block; font-size: 12.5px; color: var(--muted); }
.urange > p { margin-top: 4px; }
.htable .c-year, .htable .c-name { position: sticky; z-index: 1; }
.htable .c-year { left: 0; }
.htable .c-name { left: 56px; box-shadow: 1px 0 0 var(--line); }
.htable th.c-year, .htable th.c-name { z-index: 3; }
.cell { width: 100%; min-height: 38px; padding: 8px 5px; border: 1px solid transparent; border-radius: 6px; background: transparent; font-size: 14px; transition: border-color .15s, background .15s; }
.cell:hover { border-color: var(--line-2); }
.cell:focus { outline: 0; border-color: var(--gold-deep); background: #fff; box-shadow: 0 0 0 3px rgba(175, 159, 102, .28); }
.cell.num { text-align: right; }
select.cell { padding-right: 4px; }
.htable tfoot .num { text-align: right; }
.htable td.c-units, .htable td.c-costPerUnit, .htable td.c-sf, .htable td.c-costPerSF, .htable td.c-fee, .htable td.c-hours { text-align: right; }
.htable th.c-units, .htable th.c-costPerUnit, .htable th.c-sf, .htable th.c-costPerSF, .htable th.c-fee, .htable th.c-hours { text-align: right; }
.cmp { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 14px; }
.cmp th { font: 600 10.5px/1.3 var(--font-d); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); text-align: right; padding-bottom: 6px; }
.cmp td { padding: 7px 0; border-top: 1px solid var(--line); text-align: right; }
.cmp td:first-child { text-align: left; }
.cmp small { color: var(--muted); }
.cmp .now td { font-weight: 600; }
.rail-card .help a { color: var(--ink); font-weight: 600; }

@media (max-width: 1180px) {
  /* narrower screens: the manager and milestone share one line under the project name */
  .dl-cols { display: none; }
  .dl-row { grid-template-columns: 104px minmax(0, 1fr) 120px; gap: 5px 14px; padding-top: 16px; padding-bottom: 16px; }
  .dl-sub { display: block; grid-column: 2; font-size: 13.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .dl-pm, .dl-ms { display: inline; }
  .dl-pm::after { content: ' · '; }
  .dl-date { grid-row: 1 / span 2; align-self: center; }
  .dl-done { grid-column: 3; grid-row: 1 / span 2; }
}
@media (max-width: 860px) {
  .vz-labels { display: none; }
}
@media (max-width: 600px) {
  .hist { padding: 18px 14px 14px; }
  .htable .c-name { min-width: 150px; }
  .group-head { padding: 14px 18px; }
  .prow-prog { width: 96px; }
  .prow .tag { display: none; }
  .dl-cols, .dl-row { padding-left: 18px; padding-right: 18px; }
  .dl-row { grid-template-columns: 92px minmax(0, 1fr); }
  .dl-sub { white-space: normal; }
  .dl-done { grid-column: 2; grid-row: auto; margin-top: 4px; }
  .viz-top { gap: 14px; }
  .viz-big { font-size: 44px; }
  .section-head { flex-wrap: wrap; }
}

/* project schedule: bar chart in the style of the firm's sheet (dark panel, two-tone bars) + activity list */
.schedule .hist-head { align-items: flex-start; }
.schedule .hist-head .sub { margin-top: 6px; font-size: 15px; }
.schedule .actions { flex: none; align-items: center; }
.schedule .phase-fee .input { width: 150px; }
.gantt { margin-top: 20px; --gl: 270px; background: var(--charcoal); color: #fff; border-radius: 12px; padding: 16px 20px 14px; }
.gantt-title { font-size: 14px; color: rgba(255, 255, 255, .75); padding-bottom: 12px; margin-bottom: 4px; border-bottom: 2px solid var(--gold); display: flex; gap: 8px; flex-wrap: wrap; }
.gantt-title b { color: #fff; font-family: var(--font-d); letter-spacing: .02em; text-transform: uppercase; }
.gantt-title span { margin-left: auto; font-size: 12.5px; color: rgba(255, 255, 255, .55); }
.gantt-area { position: relative; margin-left: var(--gl); padding-top: 26px; padding-bottom: 18px; }
.gantt-axis { position: absolute; top: 4px; left: 0; right: 0; height: 20px; font: 600 11px/1 var(--font-d); color: rgba(255, 255, 255, .8); }
.gantt-axis span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.gantt-axis span:first-child { transform: none; }
.gantt-axis span:last-child { transform: translateX(-100%); }
.gantt-grid { position: absolute; top: 26px; bottom: 18px; left: 0; right: 0; pointer-events: none; }
.gantt-grid i { position: absolute; top: 0; bottom: 0; border-left: 1px solid rgba(255, 255, 255, .22); }
.gantt-row { position: relative; height: 42px; }
.gantt-label { position: absolute; right: 100%; width: var(--gl); padding-right: 14px; top: 0; height: 100%; display: flex; flex-direction: column; align-items: flex-end; justify-content: center; font-size: 12.5px; line-height: 1.2; text-align: right; color: #fff; overflow: hidden; }
.gantt-label b { font-weight: 600; }
.gantt-label small { font-size: 10.5px; color: var(--gold); font-variant-numeric: tabular-nums; white-space: nowrap; margin-top: 1px; }
.gantt-row.undated .gantt-label { color: rgba(255, 255, 255, .4); }
.gantt-row i { position: absolute; left: 0; height: 9px; border-radius: 0 3px 3px 0; }
.gantt-row .gb-lead, .gantt-key .gb-lead { top: 11px; background: var(--gold); }
.gantt-row .gb-full, .gantt-key .gb-full { top: 22px; background: #6fc6dc; }
.gantt-today { position: absolute; top: 26px; bottom: 18px; border-left: 2px dashed #f0a090; pointer-events: none; }
.gantt-today span { position: absolute; bottom: -16px; left: -1px; transform: translateX(-50%); font: 700 10px/1 var(--font-d); letter-spacing: .1em; text-transform: uppercase; color: #f0a090; background: var(--charcoal); padding: 0 4px; white-space: nowrap; }
.gantt-key { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, .12); font-size: 12px; color: rgba(255, 255, 255, .7); }
.gantt-key span { display: inline-flex; align-items: center; gap: 6px; }
.gantt-key i { width: 18px; height: 9px; border-radius: 2px; }
.sch.submit > .ms-f:first-child .input { background: #e3f2d9; border-color: #cfe6bf; }
.sch.compliance > .ms-f:first-child .input { background: #dcf0fb; border-color: #bfe0f2; }
.sch-cols, .sch { display: grid; grid-template-columns: minmax(130px, 1fr) 132px 132px 50px 132px minmax(200px, 1.6fr) 108px; gap: 10px; align-items: center; }
.sch textarea.input { max-height: 66px; }
.sch-cols { margin-top: 22px; padding-bottom: 6px; font: 600 10.5px/1.3 var(--font-d); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.sch { padding: 8px 0; border-top: 1px solid var(--line); }
.sch-days b { display: block; font: 600 15px/40px var(--font-d); text-align: center; }
.sch-tools { display: flex; justify-content: flex-end; gap: 0; }
.sch-tools .iconbtn { width: 36px; height: 36px; }
.sch-tools .iconbtn:disabled { opacity: .3; cursor: default; background: none; }
.sch-tools .iconbtn:disabled:hover { color: var(--muted); }

/* proposals table + printable pricing report */
.range-sum { font-size: 13px; color: var(--gold-deep); font-weight: 600; margin: -2px 0 8px; }
.ptable { min-width: 1060px; }
.ptable .c-submitted, .ptable .c-followup { width: 140px; }
.ptable .c-units { width: 66px; } .ptable .c-fee { width: 104px; } .ptable .c-costPerUnit { width: 90px; } .ptable .c-status { width: 124px; }
.ptable .c-name { min-width: 150px; } .ptable .c-client { min-width: 130px; } .ptable .c-notes { min-width: 160px; }
.ptable .c-submitted { left: 0; } .ptable .c-name { left: 140px; }
.ptable tr[data-status="awarded"] td { background: var(--go-soft); }
.ptable tr[data-status="lost"] td, .ptable tr[data-status="withdrawn"] td { background: #f3f1ea; color: var(--muted); }
.ptable tr[data-status="on_hold"] td { background: var(--hold-soft); }
.rp-landscape { max-width: none; }
.rp-intro { margin-top: 20px; color: var(--muted); font-size: 14.5px; max-width: 70em; }
.rp-wide { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.rp-wide th { text-align: left; font: 600 10.5px/1.3 var(--font-d); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--ink); }
.rp-wide td { padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.rp-wide td small { display: block; color: var(--muted); font-size: 12px; }
.rp-wide .r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rp-avg { margin-top: 8px; font-size: 13px; color: var(--gold-deep); font-weight: 600; }
@media (max-width: 860px) { .rp-wide { font-size: 12.5px; } .rp-wide th, .rp-wide td { padding: 6px 4px; } .report.rp-landscape { overflow-x: auto; } }
@media print { .rp-landscape .rp-wide { page-break-inside: auto; } .rp-wide tr { page-break-inside: avoid; } }

/* printable schedule */
.sched-report, .rp-landscape { page: landscape; }
.sched-chart { margin-top: 24px; }
.sched-chart .gantt { margin-top: 0; padding: 12px 16px 10px; }
/* on the printout the chart is a small illustration; the dated list is the record */
.sched-chart .gantt { --gl: 290px; }
.sched-chart .gantt-row { height: 32px; }
.sched-chart .gantt-label { font-size: 11px; }
.sched-chart .gantt-label small { font-size: 9.5px; }
.sched-chart .gantt-row .gb-lead { top: 8px; height: 6px; }
.sched-chart .gantt-row .gb-full { top: 17px; height: 6px; }
.sched-chart .gantt-key { display: none; }
.sched-chart .gantt-title span { display: inline; }
.sched-table { margin-top: 24px; }
.sched-table tr.submit td { background: #e3f2d9; }
.sched-table tr.compliance td { background: #dcf0fb; }
.rp-foot { margin-top: 24px; font-size: 12px; color: var(--muted); }
.phase-head .actions { gap: 14px; }
@page landscape { size: landscape; margin: 9mm; }
.ev-actions .sub { max-width: 32em; text-align: right; }
@media print {
  .gantt, .gantt *, .sched-table td, .htable tfoot td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  /* the schedule printout is scaled so chart and list share one landscape page */
  .sched-report { font-size: 10.5px; zoom: .82; }
  .sched-report .rp-top { padding-bottom: 12px; }
  .sched-report .rp-title { margin-top: 14px; }
  .sched-report .rp-title h2 { font-size: 22px; }
  .sched-report .rp-facts { margin-top: 10px; }
  .sched-chart { margin-top: 14px; page-break-inside: avoid; }
  .sched-chart .gantt { --gl: 250px; padding: 10px 14px 8px; }
  .sched-chart .gantt-row { height: 27px; }
  .sched-chart .gantt-label { font-size: 9.5px; }
  .sched-chart .gantt-label small { font-size: 8.5px; }
  .sched-chart .gantt-row .gb-lead { top: 7px; height: 5px; }
  .sched-chart .gantt-row .gb-full { top: 15px; height: 5px; }
  .sched-report { zoom: .78; }
  .sched-table { margin-top: 12px; }
  .sched-table th, .sched-table td { padding: 3px 6px; }
  .rp-foot { margin-top: 10px; }
}

/* project hub */
.hubtable { min-width: 1500px; table-layout: fixed; }
.hubtable .c-name { position: sticky; left: 0; z-index: 1; box-shadow: 1px 0 0 var(--line); }
.hubtable th.c-name { z-index: 3; }
.hubtable .c-year { position: static; }
.hubtable tr.late td.c-due .cell { color: var(--no); border-color: var(--no); background: var(--no-soft); }
.hubtable tr[data-status="complete"] td, .hubtable tr[data-status="approved"] td { background: var(--go-soft); }
.hubtable tr[data-status="on_hold"] td { background: var(--hold-soft); }
.hubtable tr[data-status="waiting"] td { background: #fbf6e6; }
.hubtable th { position: relative; padding-right: 22px; }
.col-x { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 15px; line-height: 1; }
.col-x:hover { background: var(--no-soft); color: var(--no); }

/* admin */
/* the Admin link is in the page for everyone but only shown to admins */
.nav a[data-admin-only], .tabbar a[data-admin-only] { display: none; }
body[data-admin] .nav [data-admin-only] { display: flex; }
.tabbar [data-admin-only] { display: none; }
body[data-admin] .tabbar [data-admin-only] { display: grid; }
body[data-admin] .tabbar { grid-template-columns: repeat(5, 1fr); }
.memtable th, .memtable td { padding: 10px 8px; white-space: nowrap; }
.memtable td b { font-weight: 600; }
.memtable tr.off td { color: var(--muted); }
.memtools { text-align: right; }
.memtools .linkbtn + .linkbtn { margin-left: 14px; }
.actlog .row { gap: 16px; }
.act-when { flex: none; width: 118px; font-size: 13px; color: var(--muted); }
.act-what { font-size: 14px; }
.act-what b { font-weight: 600; }
.act-x { width: 32px; height: 32px; opacity: .35; }
.actlog .row:hover .act-x { opacity: 1; }

/* repeat clients */
.picks { display: flex; gap: 14px; flex-wrap: wrap; }
.clients { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin-top: 16px; }
.client { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; background: #fdfcfa; }
.client-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.client-head b { font: 700 15px/1.3 var(--font-d); }
.cc-years { display: flex; align-items: flex-end; gap: 6px; height: 96px; margin-top: 12px; padding-top: 18px; border-bottom: 1px solid var(--line); }
.cc-y { position: relative; flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; min-width: 0; }
.cc-y i { display: block; width: 70%; max-width: 36px; background: var(--gold); border-radius: 4px 4px 0 0; min-height: 0; }
.cc-y b { position: absolute; top: -16px; font: 700 12px/1 var(--font-d); color: var(--gold-deep); }
.cc-y span { position: absolute; bottom: -18px; font-size: 11px; color: var(--muted); }
.client-list { margin-top: 26px; font-size: 13px; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.client-list small { color: var(--muted); font-size: 12px; }

/* attachments */
.proj > .files { margin-top: 16px; }
.files .list { padding: 0; margin-top: 14px; border-top: 1px solid var(--line); }
.files .row { padding: 10px 0; }
.files .empty { padding: 16px 0 0; }
.files .sub { margin-top: 6px; font-size: 15px; }
.filetype { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: 8px; background: var(--gold-soft); color: var(--gold-deep); font: 700 10.5px/1 var(--font-d); letter-spacing: .06em; text-transform: uppercase; }
.filelink { background: none; border: 0; padding: 0; text-align: left; max-width: 100%; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.filelink:hover { text-decoration-color: var(--ink); }
.uploads:empty { display: none; }

/* ---------- Dialog & toast ---------- */
dialog { border: 0; padding: 0; border-radius: 16px; width: min(540px, calc(100vw - 32px)); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .5); color: var(--ink); }
dialog::backdrop { background: rgba(25, 25, 25, .55); backdrop-filter: blur(2px); }
.dlg { padding: 28px; }
.dlg h2 { font: 700 22px/1.2 var(--font-d); }
.dlg .sub { margin-top: 6px; font-size: 15px; }
.dlg .fields { margin-top: 20px; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 26px; }
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.choice label { position: relative; margin: 0; }
.choice input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.choice span { display: grid; place-items: center; min-height: 46px; padding: 6px 10px; border: 1px solid var(--line-2); border-radius: 10px; background: #fdfcfa; font-weight: 600; font-size: 14px; text-align: center; }
.choice input:checked + span { background: var(--charcoal); border-color: var(--charcoal); color: var(--gold); }
.choice input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }
#project-form[data-track="zoning"] .only-ddcd, #project-form[data-track="ddcd"] .only-zoning { display: none; }
#toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--charcoal); color: #fff; padding: 12px 18px; border-radius: 10px; font-size: 14.5px; font-weight: 500;
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .5); transition: all .25s; z-index: 60; border-left: 3px solid var(--gold); max-width: calc(100vw - 32px);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  /* not enough room for the form and the live decision side by side: stack them and float a short verdict bar */
  .ev-layout { grid-template-columns: 1fr; }
  .rail { position: static; max-height: none; overflow: visible; }
  .has-mobile-sum { padding-bottom: 70px; }
  .mobile-sum {
    display: flex; align-items: center; gap: 12px; position: fixed; left: calc(var(--side) + 16px); right: 16px; bottom: 16px; z-index: 29;
    background: var(--charcoal); color: #fff; text-decoration: none; padding: 10px 14px; border-radius: 14px;
    box-shadow: 0 14px 30px -10px rgba(0, 0, 0, .55); border: 1px solid rgba(255, 255, 255, .1);
  }
  .mobile-sum .scorechip { width: 40px; height: 40px; border-color: var(--gold); color: #fff; }
  .mobile-sum .grow { flex: 1; min-width: 0; }
  .mobile-sum b { display: block; font: 700 13.5px/1.2 var(--font-d); letter-spacing: .08em; text-transform: uppercase; }
  .mobile-sum span.m { font-size: 12.5px; color: rgba(255, 255, 255, .6); }
  .mobile-sum em { font-style: normal; font-size: 13px; font-weight: 600; color: var(--gold); white-space: nowrap; }
  /* rating buttons get narrow here: put the word under the number */
  .scale { gap: 6px; }
  .scale span { flex-direction: column; gap: 3px; height: 54px; }
  .scale i { font-size: 11px; }
  /* billing rows stack: name on top, fields below with their labels showing */
  .ms-cols { display: none; }
  .ms { grid-template-columns: 90px 90px 1fr 1fr; align-items: end; padding: 14px 0; }
  .sch-cols { display: none; }
  .sch { grid-template-columns: 1fr 1fr 64px 1fr; align-items: end; padding: 14px 0; }
  .sch > .ms-f:first-child, .sch > .notes { grid-column: 1 / -1; }
  .sch-tools { grid-column: 1 / -1; justify-content: flex-start; }
  .gantt { --gl: 150px; }
  .fields.three { grid-template-columns: 1fr 1fr; }
  .ms-name, .ms-f.notes { grid-column: 1 / -1; }
  .ms-f > span { position: static; width: auto; height: auto; clip-path: none; display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
  .phase .ms:first-of-type { margin-top: 10px; }
}

@media (max-width: 860px) {
  .sidebar { display: none; }
  .topbar {
    display: flex; align-items: center; gap: 14px; position: sticky; top: 0; z-index: 30;
    background: var(--charcoal); color: #fff; padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  }
  .topbar .brand-logo { width: 46px; height: 40px; }
  .topbar .brand-text { border-left: 1px solid rgba(255, 255, 255, .2); padding-left: 14px; }
  .tabbar {
    display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: rgba(37, 37, 37, .97); backdrop-filter: blur(8px); padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(255, 255, 255, .08);
  }
  .tabbar a { position: relative; display: grid; justify-items: center; gap: 3px; padding: 7px 4px; color: rgba(255, 255, 255, .6); text-decoration: none; font-size: 11.5px; font-weight: 500; border-radius: 10px; }
  .tabbar a svg { width: 22px; height: 22px; }
  .tabbar a.active { color: var(--gold); }
  .tabbar .count { position: absolute; top: 2px; left: calc(50% + 6px); background: var(--gold); color: var(--charcoal); font-size: 10.5px; font-weight: 700; padding: 0 6px; border-radius: 99px; }
  main { margin-left: 0; padding: 16px 16px calc(96px + env(safe-area-inset-bottom)); }
  /* On phones every box people type into is 16px (so iOS does not zoom in on tap) and at least 44px tall. */
  .ms-f .input, .phase-fee .input, .queue .status, .cell, .labor-row .input, .hf .input { font-size: 16px; min-height: 44px; }
  .htable .c-year { width: 76px; } .htable .c-units, .htable .c-hours { width: 92px; } .htable .c-costPerSF { width: 104px; }
  .htable .c-costPerUnit, .htable .c-sf, .htable .c-fee { width: 118px; }
  .htable .c-name { left: 76px; }
  .htable .c-phase { width: 170px; }
  .hero { padding: 28px 22px 26px; border-radius: 16px; }
  .hero::before { display: none; }
  .hero::after { width: 120px; height: 120px; right: -50px; top: -50px; }
  .hero .display { padding-right: 40px; }
  .grid-2 { grid-template-columns: 1fr; }
  .mobile-sum { left: 10px; right: 10px; bottom: calc(70px + env(safe-area-inset-bottom)); }
  .report { padding: 28px 22px; }
  .rp-cols { grid-template-columns: 1fr; }
  #toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
}

@media (max-width: 600px) {
  .stats { gap: 10px; }
  .stat { padding: 16px; }
  .stat .v { font-size: 32px; }
  .sec, .rail-card { padding: 20px 18px; }
  .summary { padding: 20px 18px; }
  .card-head { padding: 18px 18px 0; }
  .row { padding: 13px 18px; }
  a.row { flex-wrap: wrap; row-gap: 8px; }
  a.row .scorechip + .grow { flex-basis: calc(100% - 58px); }
  a.row .pill { margin-left: 58px; }
  .queue .row { padding: 12px 18px; flex-wrap: wrap; }
  .queue .status { width: 100%; }
  .fields { grid-template-columns: 1fr; }
  .svc { grid-template-columns: minmax(0, 1fr) 118px; gap: 12px; }
  .labor-head, .labor-row { grid-template-columns: minmax(0, 1fr) 74px 74px; gap: 8px; }
  .scale { gap: 5px; }
  .scale i { font-size: 10px; }
  .section-head { margin-top: 28px; }
  .tabs { gap: 22px; }
  .proj-head { padding: 18px; }
  .proj-prog { grid-template-columns: 1fr; gap: 8px; }
  .phase { padding: 16px 18px 12px; }
  .ms { grid-template-columns: 1fr 1fr; }
  .ms-f:has(.status), .ms-f:has([type="date"]) { grid-column: 1 / -1; }
  .sch { grid-template-columns: 1fr 1fr; }
  .sch > .ms-f:has([type="date"]) { grid-column: auto; }
  .sch-days { grid-column: auto; }
  .gantt { --gl: 128px; }
  .gantt-label { font-size: 10.5px; padding-right: 8px; }
  .gantt-label small { font-size: 9px; }
  /* fewer date labels on a narrow chart so they do not run into each other */
  .gantt-axis span:nth-child(even), .gantt-grid i:nth-child(even) { display: none; }
  .fields.three { grid-template-columns: 1fr; }
  .rp-top .rp-doc { font-size: 12px; }
  .rp-verdict { grid-template-columns: 1fr; gap: 8px; }
  .rp-sign { grid-template-columns: 1fr; }
  .dlg { padding: 22px 18px; }
  .ev-actions .btn span { display: none; }
}

/* ---------- Sample workspace (/sample/) ---------- */
.sample-bar { display: none; }
body[data-sample][data-mode="app"] .sample-bar {
  display: block; position: sticky; top: 0; z-index: 15; margin-left: var(--side); padding: 10px 44px;
  background: var(--gold); color: var(--charcoal); font-size: 14px; line-height: 1.4;
}
.sample-bar a { font-weight: 600; margin-left: 6px; white-space: nowrap; }
@media (max-width: 860px) {
  /* on phones the bar sits under the top bar and scrolls with the page */
  body[data-sample][data-mode="app"] .sample-bar { position: static; margin-left: 0; padding: 10px 16px; }
}
#public .lp-ghost { color: var(--gold); padding: 0 12px; }
#public .lp-ghost:hover { color: #fff; }

/* ---------- Signed-out pages: start page, sign in, create account ---------- */
#boot, #public { display: none; }
body[data-mode="loading"] #boot { display: grid; }
body[data-mode="public"] #public { display: block; }
body:not([data-mode="app"]) > .sidebar, body:not([data-mode="app"]) > .topbar, body:not([data-mode="app"]) > .tabbar, body:not([data-mode="app"]) > main { display: none; }
body:not([data-mode="app"]) { background: var(--charcoal); }

#boot { min-height: 100vh; place-content: center; justify-items: center; gap: 18px; color: #fff; }
#boot span { font: 600 11px/1 var(--font-d); letter-spacing: .3em; text-transform: uppercase; color: var(--gold); }
.auth-mark { width: 124px; height: 108px; color: #fff; }

#public {
  min-height: 100vh; color: #fff;
  background-image: linear-gradient(rgba(255, 255, 255, .03) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .03) 1px, transparent 1px);
  background-size: 48px 48px;
}
#public .eyebrow { color: var(--gold); }
#public .btn-line { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .3); }
#public .btn-line:hover { border-color: #fff; }

.lp { max-width: 1180px; margin: 0 auto; padding: 0 40px; min-height: 100vh; display: flex; flex-direction: column; }
.lp-nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 28px 0; }
.lp-nav nav { display: flex; align-items: center; gap: 22px; }
.lp-link { color: rgba(255, 255, 255, .6); font-size: 14px; text-decoration: none; }
.lp-link:hover { color: #fff; }
.lp-hero { flex: 1; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 40px; align-items: center; padding: 40px 0 56px; }
.lp-copy .display { font-size: clamp(38px, 6vw, 72px); margin-top: 18px; }
.lp-copy p { margin-top: 20px; max-width: 30em; font-size: 18px; line-height: 1.55; color: rgba(255, 255, 255, .72); }
.lp-copy .hero-actions { margin-top: 32px; }
.lp-copy .btn { min-height: 50px; padding: 0 26px; font-size: 16px; }
.lp-art { width: 100%; max-width: 520px; justify-self: end; color: rgba(255, 255, 255, .7); }
.lp-gold { stroke: var(--gold); }
.lp-dim { fill: var(--gold); font: 600 11px var(--font-d); letter-spacing: .12em; }
.lp-features { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid rgba(255, 255, 255, .14); }
.lp-features div { padding: 30px 28px 34px 0; }
.lp-features div + div { padding-left: 28px; border-left: 1px solid rgba(255, 255, 255, .14); }
.lp-features b { display: block; font: 800 46px/1 var(--font-d); color: var(--gold); }
.lp-features h2 { font: 700 18px/1.3 var(--font-d); margin-top: 14px; }
.lp-features p { margin-top: 6px; font-size: 15px; line-height: 1.55; color: rgba(255, 255, 255, .65); }
.lp-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding: 22px 0 28px; border-top: 1px solid rgba(255, 255, 255, .14); font-size: 13px; color: rgba(255, 255, 255, .45); }

.auth { min-height: 100vh; display: grid; align-content: center; justify-items: center; gap: 26px; padding: 40px 16px; }
.auth-logo { display: block; line-height: 0; }
.auth-card { width: min(440px, 100%); padding: 34px 32px 28px; color: var(--ink); }
#public .auth-card .eyebrow { color: var(--gold-deep); }
.auth-card h1 { font: 700 30px/1.15 var(--font-d); letter-spacing: -.015em; margin-top: 10px; }
.auth-card > .sub { margin-top: 6px; overflow-wrap: anywhere; }
.auth-form { display: grid; gap: 16px; margin-top: 24px; }
.auth-form .btn { min-height: 50px; margin-top: 4px; }
.auth-form .btn:disabled { opacity: .6; cursor: default; }
.auth-error { background: var(--no-soft); color: #7d2a1c; border-radius: 8px; padding: 10px 12px; font-size: 14px; line-height: 1.45; }
.auth-note { background: var(--go-soft); color: #1d5a3f; border-radius: 8px; padding: 10px 12px; font-size: 14px; line-height: 1.45; margin-top: 16px; overflow-wrap: anywhere; }
.auth-links { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.auth-links .linkbtn { color: var(--ink); font-weight: 600; font-size: 14px; }

@media (max-width: 860px) {
  .lp { padding: 0 20px; }
  .lp-nav { padding: 18px 0; }
  .lp-nav .brand-logo { width: 46px; height: 40px; }
  .lp-link { display: none; }
  .lp-hero { grid-template-columns: 1fr; gap: 28px; padding: 24px 0 40px; }
  .lp-art { justify-self: center; max-width: 380px; }
  .lp-copy p { font-size: 16.5px; }
  .lp-features { grid-template-columns: 1fr; }
  .lp-features div, .lp-features div + div { padding: 24px 0; border-left: 0; }
  .lp-features div + div { border-top: 1px solid rgba(255, 255, 255, .14); }
  .auth-card { padding: 28px 22px 24px; }
}

@media print {
  body { background: #fff; }
  .sidebar, .topbar, .tabbar, .tabs, .back, .ev-head, .mobile-sum, .sample-bar, #toast, .no-print { display: none !important; }
  main { margin: 0; padding: 0; }
  .report { border: 0; box-shadow: none; margin: 0; padding: 0; max-width: none; }
  .rp-verdict, .bar, .bar i { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
