/* Permits design system ("Direction B", approved by Dean 2026-09-28). */
:root {
  --ink: #101828;
  --muted: #475467;
  --faint: #98A2B3;
  --line: #DDE3EA;
  --soft: #EEF1F5;
  --bg: #EEF1F5;
  --card: #FFFFFF;
  --teal: #0FA68A;
  --teal-dark: #0B7461;
  --blue: #2F6FED;
  --link: #1F5FD6;
  --violet: #7B5CFA;
  --orange: #F28C28;
  --red: #E5484D;
  --red-ink: #A3161B;
  --red-bg: #FDE7E8;
  --yellow: #F5B400;
  --yellow-ink: #7A5600;
  --yellow-bg: #FEF5D6;
  --green: #30A46C;
  --green-ink: #17603C;
  --green-bg: #E1F5EA;
  --radius: 16px;
  --mono: "Geist Mono", ui-monospace, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: Geist, system-ui, sans-serif; color: var(--ink); background: var(--bg); font-size: 14px; line-height: 1.45; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.hidden { display: none !important; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 50; height: 64px; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 18px; padding: 0 24px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 800; font-size: 18px; letter-spacing: -0.02em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: #0F2A44; display: inline-flex; align-items: center; justify-content: center; }
.modules { display: flex; gap: 6px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.modules::-webkit-scrollbar { display: none; }
.module { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px 0 6px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--ink); font-size: 13px; font-weight: 600; white-space: nowrap; }
.module:hover { text-decoration: none; background: var(--soft); }
.module.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.module .dot { width: 28px; height: 28px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; }
.module .badge { background: var(--red); color: #fff; border-radius: 999px; font-size: 11px; padding: 1px 7px; }
.avatar { width: 36px; height: 36px; border-radius: 999px; background: var(--ink); color: #fff; display: inline-flex;
  align-items: center; justify-content: center; font-size: 13px; font-weight: 700; border: 0; cursor: pointer; }
.user-menu { position: relative; margin-left: auto; }  /* top right: its menu opens over the page, not the side menu (Dean, 2026-10-03) */
.user-menu .menu { position: absolute; right: 0; top: 44px; background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 30px rgba(16,24,40,.15); min-width: 220px; padding: 6px; }
.user-menu .menu a, .user-menu .menu button { display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: 8px;
  color: var(--ink); background: none; border: 0; font: inherit; cursor: pointer; }
.user-menu .menu a:hover, .user-menu .menu button:hover { background: var(--soft); text-decoration: none; }

/* ---------- page ---------- */
.page { padding: 20px 24px 40px; max-width: 1600px; margin: 0 auto; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.page-title { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.span-3 { grid-column: span 3; } .span-4 { grid-column: span 4; } .span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; } .span-7 { grid-column: span 7; } .span-8 { grid-column: span 8; }
.span-9 { grid-column: span 9; } .span-12 { grid-column: span 12; }
.stack { display: flex; flex-direction: column; gap: 16px; }

/* ---------- county band (white + seal only) ---------- */
.county-band { background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 14px; padding: 10px 24px; }
.county-band .name { font-size: 17px; font-weight: 800; }
.county-band .rules { font-size: 12px; color: var(--muted); }
.county-band .links { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.seal { border-radius: 999px; background: #fff; box-shadow: 0 0 0 2px var(--line); display: inline-flex; align-items: center; justify-content: center;
  overflow: hidden; flex-shrink: 0; }
.seal img { object-fit: contain; width: 90%; height: 90%; }

/* ---------- cards ---------- */
.card { background: var(--card); border-radius: var(--radius); padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.label { font-size: 12px; font-weight: 700; letter-spacing: .06em; color: var(--muted); text-transform: uppercase; }
.big { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; }

/* ---------- pills / chips ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 4px 10px; white-space: nowrap; }
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 999px; background: currentColor; opacity: .9; }
.pill.red { background: var(--red-bg); color: var(--red-ink); } .pill.red::before { background: var(--red); }
.pill.yellow { background: var(--yellow-bg); color: var(--yellow-ink); } .pill.yellow::before { background: var(--yellow); }
.pill.green { background: var(--green-bg); color: var(--green-ink); } .pill.green::before { background: var(--green); }
.pill.grey { background: var(--soft); color: var(--muted); } .pill.grey::before { background: var(--faint); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); font-size: 13px; font-weight: 600; white-space: nowrap; }
.chip:hover { text-decoration: none; background: var(--soft); }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip.attention { border-color: var(--red); background: #FFF5F5; }
.chip .count { font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 7px; background: var(--soft); color: var(--muted); }
.chip.on .count { background: var(--teal); color: #fff; }
.chip .att { min-width: 20px; height: 20px; border-radius: 999px; background: var(--red); color: #fff; font-size: 11px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center; }

/* ---------- to-do strip ---------- */
.todo { display: flex; gap: 10px; flex-wrap: wrap; align-items: stretch; flex: 1; min-width: 0; }  /* cards share the line, wrap when full */
.todo a { display: flex; flex-direction: column; background: #fff; border-radius: 12px; padding: 10px 14px; color: var(--ink);
  box-shadow: inset 4px 0 0 var(--c, var(--teal)); min-width: 170px; flex: 1 1 200px; max-width: 420px; }
.todo a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.todo a:hover { text-decoration: none; background: #FAFBFC; }
.todo b { font-size: 14px; }
.todo span { font-size: 12px; color: var(--muted); }

/* ---------- pipeline ---------- */
.pipeline { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.stage { border: 1px solid #E4E8EE; border-top: 6px solid var(--c); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; color: var(--ink); }
.stage:hover { text-decoration: none; background: #FAFBFC; }
.stage .n { font-size: 30px; font-weight: 800; }
.stage .sub { font-size: 12px; font-weight: 600; color: var(--cc, var(--muted)); }

/* ---------- lists / tables ---------- */
.list { display: flex; flex-direction: column; }
.list-row { display: grid; gap: 12px; align-items: center; padding: 11px 0; border-top: 1px solid var(--soft); color: var(--ink); }
a.list-row:hover { text-decoration: none; background: #FAFBFC; }
table.data { width: 100%; border-collapse: collapse; }
table.data th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data td { padding: 10px; border-bottom: 1px solid var(--soft); vertical-align: middle; }
table.data tr:hover td { background: #FAFBFC; }
.kv { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 6px 12px; font-size: 14px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* ---------- shot clock ---------- */
.clock { display: flex; flex-direction: column; gap: 4px; min-width: 180px; }
.clock .top { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; }
.clock .left { font-weight: 700; }
.clock .bar { height: 8px; border-radius: 999px; background: var(--soft); overflow: hidden; }
.clock .bar i { display: block; height: 100%; border-radius: 999px; }
.clock.paused .bar i { background: repeating-linear-gradient(45deg, #C8D0DA 0 6px, #E4E8EE 6px 12px); }

/* ---------- buttons & forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 999px;
  font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; border: 1px solid #C8D0DA; background: #fff; color: var(--ink); white-space: nowrap; }
.btn:hover { text-decoration: none; background: var(--soft); }
.btn.primary { background: var(--teal); border-color: var(--teal); color: #fff; } .btn.primary:hover { background: var(--teal-dark); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.danger { color: #B42318; border-color: var(--red); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 12px; }
.signup-btn { display: flex; width: 100%; height: 48px; font-size: 16px; font-weight: 600; border: 2px solid var(--teal); color: var(--teal); }
.btn[disabled], .btn.locked { color: var(--faint); border-style: dashed; cursor: not-allowed; background: #fff; }
.btn.done { background: var(--green-bg); color: var(--green-ink); border-color: transparent; }
form.inline { display: inline; }
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; }
input[type=text], input[type=tel], input[type=email], input[type=password], input[type=search], input[type=date], input[type=number], input[type=url], select, textarea {
  font: inherit; font-size: 14px; border: 1px solid #C8D0DA; border-radius: 10px; padding: 0 12px; height: 42px; background: #fff; color: var(--ink); width: 100%; }
textarea { padding: 10px 12px; height: auto; min-height: 90px; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible { outline: 3px solid rgba(15,166,138,.35); outline-offset: 1px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.errorlist { color: var(--red-ink); font-size: 12px; margin: 0; padding-left: 16px; }
.flash { border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; font-weight: 600; }
.flash.success { background: var(--green-bg); color: var(--green-ink); }
.flash.warning, .flash.error { background: var(--red-bg); color: var(--red-ink); }
.flash.info { background: #EAF1FF; color: #1747A3; }

/* ---------- stepper ---------- */
.stepper { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(var(--steps, 7), minmax(0, 1fr)); }
.stepper li { display: flex; flex-direction: column; gap: 6px; }
.stepper .node { display: flex; align-items: center; }
.stepper .dot { width: 28px; height: 28px; border-radius: 999px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; color: #fff; }
.stepper .line { height: 4px; flex: 1; background: #D0D5DD; }
.stepper .done .dot { background: var(--green); } .stepper .done .line { background: var(--green); }
.stepper .current .dot { background: var(--yellow); }
.stepper .todo-step .dot { background: #D0D5DD; }
.stepper b { font-size: 13px; } .stepper span { font-size: 12px; color: var(--muted); }
/* The next document to make (Create Recommendation, Permit, ...) sits above the line leaving the step it follows. */
.stepper[data-actions] { padding-top: 40px; }
.stepper li { position: relative; }
.stepper .step-action { position: absolute; top: -40px; right: 4px; white-space: nowrap; z-index: 1; display: flex; gap: 4px; align-items: center; }
.stepper .step-action .btn.sm { height: 28px; padding: 0 10px; font-size: 12px; }
/* Each button sits just left of the circle it leads to, so neighbors never overlap; Permit and Criteria share the slot
   before the Permit circle (Dean, 2026-10-15) with short labels */
.stepper .step-action.pair .btn.sm { padding: 0 8px; }
.stepper .step-action.tight .btn.sm { padding: 0 6px; font-size: 11px; height: 24px; }
.stepper .step-action .lbl-short, .stepper .step-action.tighter .lbl-full { display: none; }
.stepper .step-action.tighter .lbl-short { display: inline; }

/* ---------- map ---------- */
.map { height: 420px; border-radius: 12px; overflow: hidden; background: #F7F9FB; }
.leaflet-container { font-family: Geist, system-ui, sans-serif; }
.att-badge { background: var(--red); color: #fff; border-radius: 999px; font-weight: 800; font-size: 12px; min-width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.25); }

/* ---------- misc ---------- */
.doc-ico { width: 34px; height: 34px; border-radius: 9px; background: var(--soft); color: var(--muted); display: inline-flex;
  align-items: center; justify-content: center; font-size: 10px; font-weight: 800; flex-shrink: 0; }
.bar { height: 10px; border-radius: 999px; background: var(--soft); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 999px; background: var(--yellow); }
.empty { color: var(--muted); padding: 18px 0; text-align: center; }
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 12px; }
dialog { border: 0; border-radius: 18px; padding: 0; box-shadow: 0 30px 80px rgba(16,24,40,.35); width: min(960px, 96vw); }
dialog::backdrop { background: rgba(16,24,40,.45); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .span-3, .span-4, .span-5, .span-6, .span-7, .span-8, .span-9 { grid-column: span 12; }
  .pipeline { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .topbar { padding: 0 12px; gap: 10px; }
  .brand span.word { display: none; }
  .module { padding: 0 10px 0 4px; }
  .module .label-text { display: none; }
  .page { padding: 14px 12px 32px; }
  .page-title { font-size: 22px; }
  .pipeline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; }
  .stepper { grid-template-columns: repeat(var(--steps, 7), minmax(56px, 1fr)); overflow-x: auto; }
  .stepper[data-actions] { grid-template-columns: repeat(var(--steps, 7), minmax(150px, 1fr)); }  /* room for the buttons on the line */
  .county-band { padding: 8px 12px; } .county-band .links { display: none; }
  .hide-mobile { display: none !important; }
  table.data .hide-mobile { display: none; }
}

/* ---------- MapLibre map chrome ---------- */
.map-styles { position: absolute; top: 10px; left: 10px; z-index: 2; display: flex; gap: 2px; background: #fff; border-radius: 999px; padding: 3px;
  box-shadow: 0 2px 10px rgba(16,24,40,.15); }
.map-styles button { height: 28px; padding: 0 12px; border: 0; border-radius: 999px; background: transparent; color: #344054; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.map-styles button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.map-reset { position: absolute; bottom: 10px; left: 10px; z-index: 2; height: 30px; padding: 0 12px; border: 0; border-radius: 999px; background: #fff;
  box-shadow: 0 2px 10px rgba(16,24,40,.15); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.maplibregl-popup-content { font-family: Geist, system-ui, sans-serif; font-size: 13px; border-radius: 10px; padding: 8px 12px; box-shadow: 0 8px 20px rgba(16,24,40,.18); }
.att-badge { cursor: pointer; }
@media (max-width: 640px) { .map-styles button { padding: 0 8px; } }

/* ---------- sign-in pages ---------- */
.page.auth { max-width: 460px; padding-top: 48px; }
.page.auth .auth-brand { margin-bottom: 28px; font-size: 22px; }
.page.auth form { background: #fff; border-radius: var(--radius); padding: 22px; }
.page.auth form .btn { width: 100%; }
.page.auth .row form { background: none; padding: 0; }
.btn.provider { width: 100%; background: #fff; }
.btn.link-btn { border: 0; background: none; color: var(--link); padding: 0; height: auto; }

/* ---------- view as ---------- */
.viewas-banner { position: sticky; top: 64px; z-index: 40; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: #FFF3E6; border-bottom: 2px solid var(--orange); padding: 8px 24px; font-size: 14px; }
.viewas-banner span { flex: 1; }
.month-bar { display: block; border-radius: 4px 4px 2px 2px; transition: filter .12s, transform .12s; }
.month-bar:hover, .month-bar:focus-visible { filter: brightness(1.15); transform: scaleY(1.04); transform-origin: bottom; }

/* ---------- state switcher (segmented) ---------- */
.seg { display: inline-flex; background: #fff; border: 1px solid var(--line, #E4E7EC); border-radius: 999px; padding: 3px; gap: 2px; margin-right: 6px; }
.seg a { padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; color: inherit; text-decoration: none; }
.seg a.on { background: #101828; color: #fff; }
.seg a:not(.on):hover { background: #F2F4F7; }

/* ---------- escrow ---------- */
.esc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0; }
.esc-grid > div { background: #F4F7FA; border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; }
.esc-grid span { font-size: 12px; color: var(--muted, #667085); }
.esc-grid b { font-size: 20px; font-weight: 800; }
.esc-grid em { font-style: normal; font-size: 12px; color: var(--muted, #667085); }
.bad { color: #B42318; font-weight: 700; }
.good { color: #067647; font-weight: 700; }
td.num, th.num { text-align: right; white-space: nowrap; }
.esc-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 8px; align-items: end; }
.esc-form label { display: flex; flex-direction: column; gap: 2px; }
.esc-form label.wide { grid-column: 1 / -1; }
button.link { background: none; border: 0; color: var(--muted, #667085); cursor: pointer; padding: 2px 6px; }
button.link:hover { color: #B42318; }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat-cards .card { padding: 14px 16px; }
.stat-cards .n { font-size: 26px; font-weight: 800; display: block; }

/* ---------- users ---------- */
.user-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px 14px; align-content: start; }
.user-form h2, .user-form .wide { grid-column: 1 / -1; }
.user-form label { display: flex; flex-direction: column; gap: 3px; }
.user-form label.check { flex-direction: row; align-items: center; gap: 8px; }
.user-form fieldset { border: 1px solid var(--line, #E4E7EC); border-radius: 12px; padding: 8px 12px; }
.juris-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px 10px; margin: 4px 0; }

/* ---------- components on the job page ---------- */
.comp-list { display: flex; flex-direction: column; gap: 8px; }
.comp { border: 1px solid var(--line, #E4E7EC); border-radius: 12px; padding: 0 14px; }
.comp[open] { padding-bottom: 10px; }
.comp > summary { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 0; cursor: pointer; list-style: none; }
.comp summary::-webkit-details-marker { display: none; }
.comp > summary::before { content: "▸"; color: var(--muted, #667085); transition: transform .15s; }
.comp[open] > summary::before { transform: rotate(90deg); }
.comp-code { font-family: "Geist Mono", monospace; font-size: 12px; font-weight: 600; background: #F2F4F7; border-radius: 6px; padding: 2px 6px; }
.comp-meta { margin-left: auto; }
.comp-items { table-layout: auto; }
.comp-items td { vertical-align: top; padding-top: 5px; padding-bottom: 5px; }
.comp-items td.ok { width: 22px; text-align: center; }
/* Label a third of the width (so it stays on a line or two), value takes the rest, the analyst's condition picker only
   as wide as its button (it used to take 42% and squeeze the labels — Dean, 2026-10-02: "scrolling for a mile"). */
.comp-items td.lbl { width: 34%; }
.comp-items td.val { word-break: break-word; }
.comp-items td.cond-cell { width: 1%; white-space: nowrap; }
.help-i { display: inline-grid; place-items: center; width: 16px; height: 16px; margin-left: 5px; border: 1px solid #D0D5DD; border-radius: 50%; background: #fff;
  color: #667085; font: italic 600 11px/1 Georgia, serif; cursor: help; vertical-align: 1px; padding: 0; }
.help-i:hover { border-color: #2F6FED; color: #2F6FED; }
.comp-items .help { max-width: 60ch; margin-top: 2px; }
.comp-items tr.missing td { background: #FFF6F5; }
a.file { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.comp-files { display: grid; gap: 2px; }
.cchips { display: inline-flex; gap: 3px; flex-wrap: wrap; }
.cchip { font-family: "Geist Mono", monospace; font-size: 11px; font-weight: 600; border-radius: 5px; padding: 1px 5px; border: 1px solid transparent; }
.cchip.green { background: #E1F5EA; color: #17603C; }
.cchip.yellow { background: #FEF4D6; color: #7A5A00; }
.cchip.red { background: #FDE8E7; color: #A3161B; }
.cchip.grey { background: #F2F4F7; color: #667085; }
@media (max-width: 700px) { .comp-items td.lbl { width: 45%; } .comp-meta { margin-left: 0; width: 100%; } }

/* ---------- shot clock ---------- */
.clk-warn { border-radius: 10px; padding: 8px 10px; font-size: 13px; margin-top: 8px; }
.clk-warn.red { background: #FDE8E7; color: #A3161B; }
.clk-warn.yellow { background: #FEF4D6; color: #7A5A00; }
.clk-timeline { list-style: none; padding: 0; margin: 10px 0 0; border-left: 2px solid var(--line, #E4E7EC); }
.clk-timeline > li { padding: 4px 0 8px 12px; position: relative; }
.clk-timeline > li::before { content: ""; position: absolute; left: -6px; top: 9px; width: 10px; height: 10px; border-radius: 50%; background: #0FA68A; }
.clk-timeline > li.bad-ev::before { background: #E5484D; }
.clk-timeline ul { margin: 4px 0 0 16px; padding: 0; }
.clk-f { display: none !important; }
form[data-kind="incomplete"] .clk-incomplete, form[data-kind="resubmitted"] .clk-resubmitted,
form[data-kind="tolling"] .clk-tolling, form[data-kind="decision"] .clk-decision { display: flex !important; }
.work-item { border-top: 1px solid var(--soft, #F2F4F7); padding: 10px 0; }
.work-item summary { cursor: pointer; display: flex; flex-direction: column; gap: 2px; list-style: none; }
.work-item summary::-webkit-details-marker { display: none; }

/* ---------- reports ---------- */
.report-card { display: flex; flex-direction: column; text-decoration: none; color: inherit; min-height: 130px; }
.report-card:hover { box-shadow: 0 4px 18px rgba(16,24,40,.08); }
.report-table { font-size: 12px; }
.report-table th { background: #00467F; color: #fff; font-size: 11px; }
.report-table tbody tr:nth-child(even) { background: #F1F5FB; }
.report-table tr.hl-new, .hl-new { background: #D7EEBF !important; }
.report-table td.hl-chg, .hl-chg { background: #FCF6A0; font-weight: 700; }
.report-table tr.struck td { text-decoration: line-through; color: #667085; }
.report-table tfoot td { font-weight: 800; border-top: 2px solid #00467F; }
/* The comparison breaks out of the page column to use the whole window width, and nearly its whole height. */
/* the page's own width, centered with the cards above it: 100vw ran under the side menu (Dean, 2026-11-02) */
.compare-card { width: 100%; margin-left: 0; box-sizing: border-box; }
.compare { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);  /* never wider than half: a zoomed page scrolls inside */ gap: 10px; height: calc(100vh - 70px); }
.compare > div { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.compare iframe { flex: 1; width: 100%; border: 1px solid var(--line, #E4E7EC); border-radius: 8px; background: #fff; }
.compare .doc-viewer, .full .doc-viewer { flex: 1; display: flex; flex-direction: column; min-height: 0; margin: 0; }
.compare .pdfv-scroll, .full .pdfv-scroll { flex: 1; height: auto; min-height: 0; }
.doc-viewer.embedded [data-act="close"] { display: none; }
@media (max-width: 900px) { .compare { grid-template-columns: 1fr; height: auto; } .compare iframe, .compare .doc-viewer { height: 70vh; } }
pre.sig { font: inherit; margin: 4px 0; padding: 6px 10px; background: #F4F7FA; border-radius: 8px; white-space: pre-wrap; }
.idle-warn { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 100; background: #101828; color: #fff;
  padding: 12px 16px; border-radius: 12px; display: flex; gap: 14px; align-items: center; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.idle-warn.hidden { display: none; }
a.card { color: inherit; text-decoration: none; display: block; }
.stat-cards a.card:hover { border-color: var(--line-strong, #c9d1dc); }
.stat-cards a.card.on { outline: 2px solid #2F6FED; outline-offset: -2px; }
th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable:hover { color: #2F6FED; }
th.sortable::after { content: "↕"; opacity: .25; font-size: 10px; margin-left: 4px; }
th.sortable[data-dir="asc"]::after { content: "▲"; opacity: .8; }
th.sortable[data-dir="desc"]::after { content: "▼"; opacity: .8; }
/* WTS-site colors: cyan = saved by the agent, orange = fee invoiced (unpaid), white = required */
.pill.cyan { background: #D9F7FA; color: #0B6470; } .pill.cyan::before { background: #00B8CC; }
.pill.orange { background: #FDEBD8; color: #8A4B00; } .pill.orange::before { background: #F28A00; }
.pill.white { background: #fff; color: #475467; box-shadow: inset 0 0 0 1px #D0D5DD; } .pill.white::before { background: #D0D5DD; }
.cchip.cyan { background: #D9F7FA; color: #0B6470; }
.cchip.orange { background: #FDEBD8; color: #8A4B00; }
.cchip.white { background: #fff; color: #475467; box-shadow: inset 0 0 0 1px #D0D5DD; }
/* Approved with conditions: green / orange diagonal split, as on the WTS site (Dean, 2026-11-12) */
.cchip.green.cond { background: linear-gradient(135deg, #E1F5EA 0 50%, #FDD9B5 50% 100%); color: #17603C; }

/* Live pages: shown instead of reloading while someone is typing or viewing a PDF (base.html). */
.live-note { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; align-items: center; gap: 10px;
  background: #fff; border: 1px solid var(--line, #E4E7EC); border-radius: 999px; padding: 6px 8px 6px 16px; box-shadow: 0 6px 20px rgba(16,24,40,.14); font-size: 14px; }
.live-note.hidden { display: none; }

/* Job page Documents card: one collapsible section per component / stage (permits/doc_groups.py). */
.doc-groups { display: flex; flex-direction: column; gap: 8px; }
.doc-group { border: 1px solid var(--line, #E4E7EC); border-radius: 12px; }
.doc-group > summary { display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer; list-style: none; }
.doc-group > summary::-webkit-details-marker { display: none; }
.doc-group > summary::before { content: "▸"; font-size: 11px; color: var(--muted); transition: transform .15s; }
.doc-group[open] > summary::before { transform: rotate(90deg); }
.doc-group > .list { padding: 0 12px 8px; }

/* Timeline circles link to the job's matching section or document. */
.stepper .step-link { display: flex; flex-direction: column; gap: 6px; color: inherit; text-decoration: none; }
.stepper .step-link:hover b { text-decoration: underline; }
.stepper .step-link:hover .dot { box-shadow: 0 0 0 4px rgba(15,166,138,.18); }
.stepper li.inert .step-link { cursor: default; }
.stepper li.inert .step-link:hover b { text-decoration: none; }
.stepper li.inert .step-link:hover .dot { box-shadow: none; }
.stepper .step-doc { color: var(--teal-ink, #0B6E5F); text-decoration: underline; text-underline-offset: 2px; }
.stepper .step-doc.viewing { font-weight: 700; }
.stepper li:has(.step-doc) .dot { cursor: pointer; }
.stepper .denied .dot { background: var(--red, #E5484D); }
/* Job numbers are what Dean scans for: make them the most prominent thing in a row / on the job page. */
.jobno { font-family: "Geist Mono", monospace; font-weight: 800; font-size: 15px; color: var(--ink, #101828); letter-spacing: -.01em; text-decoration: none; }
a.jobno:hover { text-decoration: underline; }
.jobno-title { font-family: "Geist Mono", monospace; font-size: 30px; font-weight: 800; letter-spacing: -.02em; margin: 0; }
.job-name { font-size: 17px; font-weight: 600; color: var(--muted, #667085); align-self: flex-end; padding-bottom: 3px; }
.stepper .step-approve { display: flex; gap: 4px; align-items: center; margin-top: 4px; }
.stepper .step-approve input[type=date] { font-size: 11px; padding: 2px 4px; width: 8.4em; }
/* Dashboard, one county picked: all its jobs under Needs your attention (scrolls inside the card). */
.county-jobs { max-height: 560px; overflow: auto; border: 1px solid var(--line, #E4E7EC); border-radius: 10px; }
.county-jobs table { margin: 0; }
.county-jobs thead th { position: sticky; top: 0; background: var(--card, #fff); z-index: 1; }
/* Job details panel (job page, WTS staff). */
.job-details > summary { display: flex; gap: 12px; align-items: baseline; cursor: pointer; list-style: none; }
.job-details > summary::-webkit-details-marker { display: none; }
.job-details > summary::before { content: "▸"; color: var(--muted); }
.job-details[open] > summary::before { content: "▾"; }
.jd-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-top: 14px; }
.jd-block { border: 1px solid var(--line, #E4E7EC); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.jd-block h3 { margin: 0 0 4px; }
.jd-wide { grid-column: 1 / -1; max-height: 260px; overflow: auto; }
.jd-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.jd-row > span:first-child { color: var(--muted); font-size: 13px; }
.jd-row input { width: 12em; }
.jd-add { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.jd-add input, .jd-add select { width: auto; flex: 1 1 8em; }
.jd-hist { padding: 3px 0; border-bottom: 1px solid var(--soft, #F2F4F7); }
.jd-block input, .jd-block select { font: inherit; font-size: 13px; padding: 5px 8px; height: 32px; border: 1px solid var(--line, #D0D5DD); border-radius: 8px; background: #fff; box-sizing: border-box; }
.jd-block .btn { align-self: flex-start; }
/* Marking component items / files as permit conditions during review. */
.cond-cell { width: 1%; white-space: nowrap; text-align: right; }
.cond-tag { display: inline-flex; align-items: center; gap: 4px; background: #FEF5D6; color: #7A5A00; border-radius: 6px; padding: 1px 6px; font-size: 12px; font-weight: 600; }
.cond-pick { display: inline-block; font-size: 12px; }
.cond-pick > summary { cursor: pointer; color: var(--muted); list-style: none; }
.cond-pick > summary::-webkit-details-marker { display: none; }
.cond-pick form { display: flex; gap: 4px; margin-top: 4px; }
.cond-pick select { font-size: 12px; padding: 2px 4px; width: auto; }
.file-wrap { display: inline-flex; align-items: center; gap: 6px; margin-right: 10px; }
.cond-pick > summary::before, .cond-pick > summary::after { content: none !important; display: none; }
/* Inspections: trip upload and report builder. */
.trip-drop { border: 2px dashed var(--line, #D0D5DD); border-radius: 12px; padding: 22px; text-align: center; }
.trip-drop.over, .dropzone.over { border-color: var(--green, #0FA68A); background: #F0FBF8; }
.trip-log { max-height: 220px; overflow: auto; margin: 6px 0 0; padding-left: 18px; }
.unmatched { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.um img { width: 100%; height: 110px; object-fit: cover; border-radius: 8px; }
.insp-top { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 16px; }
.insp-top label { display: flex; flex-direction: column; gap: 2px; }
.insp-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.insp-tray { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; }
@media (max-width: 900px) { .insp-layout { grid-template-columns: 1fr; } .insp-tray { position: static; max-height: none; } }
.insp-sec { margin-bottom: 14px; }
.insp-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; padding: 8px 0; border-bottom: 1px solid var(--soft, #F2F4F7); }
.insp-note { grid-column: 1 / -1; font-size: 13px; }
.insp-choice { display: inline-flex; gap: 4px; }
.insp-choice .ch input { display: none; }
.insp-choice .ch span { display: inline-block; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line, #D0D5DD); font-size: 12px; font-weight: 600; cursor: pointer; }
.insp-choice .ch-pass input:checked + span { background: #00B050; color: #fff; border-color: #00B050; }
.insp-choice .ch-fail input:checked + span { background: #E5484D; color: #fff; border-color: #E5484D; }
.insp-choice .ch-na input:checked + span { background: #7F7F7F; color: #fff; border-color: #7F7F7F; }
.dropzone { margin-top: 10px; border: 2px dashed var(--line, #E4E7EC); border-radius: 10px; padding: 8px; min-height: 90px; }
.dropzone .photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-top: 6px; }
.ph { margin: 0; cursor: grab; }
.ph.dragging { opacity: .4; }
.ph img { width: 100%; height: 110px; object-fit: cover; border-radius: 8px; display: block; }
.ph figcaption { display: flex; gap: 4px; }
.ph .cap { font-size: 12px; padding: 2px 6px; flex: 1; min-width: 0; }
/* Adjacent owners: original list next to the cleaned one. */
.notice-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.notice-layout { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .notice-layout { grid-template-columns: 1fr; } }
.notice-src { position: sticky; top: 12px; }
.notice-src iframe { width: 100%; height: calc(100vh - 160px); border: 1px solid var(--line, #E4E7EC); border-radius: 8px; }
.notice-src .raw { max-height: calc(100vh - 160px); overflow: auto; }
.owner { border-bottom: 1px solid var(--soft, #F2F4F7); padding: 8px 0; }
.owner.off { opacity: .45; }
.owner-grid { display: grid; grid-template-columns: 3fr 2fr 3fr 2fr 50px 70px 56px; gap: 4px; }
.owner-grid input { font-size: 13px; padding: 4px 6px; min-width: 0; }
.owner-foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 4px; }
/* ---- Left toolbar (QuickBooks-style rail with fly-outs) ---- */
.rail { position: fixed; left: 0; top: 0; bottom: 0; width: 84px; z-index: 60; background: #fff; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: stretch; gap: 2px; padding: 10px 0; }
.rail-brand { width: 40px; height: 40px; border-radius: 12px; background: #0F2A44; display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; }
.rail-item { position: relative; }
.rail-btn { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 4px; color: var(--ink); text-decoration: none; font-size: 12px; }
.rail-btn:hover { text-decoration: none; }
.rail-ico { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: #344054; transition: background .12s; }
.rail-btn:hover .rail-ico { background: var(--soft); }
.rail-item.on .rail-ico { background: #0B4F45; color: #fff; }
.rail-item.on .rail-label { font-weight: 700; }
.flyout { display: none; position: absolute; left: 76px; top: 0; min-width: 220px; background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(16,24,40,.14); padding: 8px; z-index: 70; }
.rail-item:hover .flyout, .rail-item:focus-within .flyout { display: block; }
.fly-title { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 6px 10px 8px; }
.flyout a { display: block; padding: 9px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.flyout a:hover, .flyout a.on { background: var(--soft); }
.flyout a.on { font-weight: 700; }
body.with-rail .topbar, body.with-rail .page, body.with-rail .viewas-banner, body.with-rail .county-band { margin-left: 84px; }
body.with-rail .topbar .brand { display: none; }
@media (max-width: 760px) {
  .rail { top: auto; bottom: 0; width: auto; right: 0; height: 64px; flex-direction: row; justify-content: space-around; padding: 4px 6px;
    border-right: 0; border-top: 1px solid var(--line); }
  .rail-brand { display: none; }
  .rail-ico { width: 34px; height: 30px; }
  .rail-btn { font-size: 11px; padding: 4px 2px; gap: 2px; }
  .flyout { left: auto; right: 0; top: auto; bottom: 60px; }
  body.with-rail .topbar, body.with-rail .page, body.with-rail .viewas-banner, body.with-rail .county-band { margin-left: 0; }
  body.with-rail .page { padding-bottom: 90px; }
  body.with-rail .topbar .brand { display: flex; }
}

.rail-more-item, .navsheet { display: none; }
.rail-more { border: 0; background: none; font: inherit; cursor: pointer; width: 100%; }
@media (max-width: 760px) {
  /* the bar: four sections + Menu, evenly spaced, nothing scrolls or pops over it */
  .rail { overflow: visible; justify-content: space-around; gap: 0; padding-bottom: env(safe-area-inset-bottom); height: calc(64px + env(safe-area-inset-bottom)); }
  .rail-item { flex: 1 1 0; min-width: 0; }
  .rail > .rail-item:nth-of-type(n+5):not(.rail-more-item) { display: none; }
  .rail-more-item { display: block; }
  .flyout, .rail-item:hover .flyout, .rail-item:focus-within .flyout { display: none !important; }
  .rail-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* Menu: every section and its pages, full screen above the bar */
  .navsheet { position: fixed; inset: 0 0 calc(64px + env(safe-area-inset-bottom)) 0; z-index: 70; overflow-y: auto; background: #fff; padding: 12px 16px 24px; }
  body.nav-open .navsheet { display: block; }
  body.nav-open { overflow: hidden; }
  .navsheet-head { position: sticky; top: -12px; display: flex; justify-content: space-between; align-items: center; padding: 8px 0 12px; background: #fff; font-size: 18px; }
  .navsheet-sec { padding: 10px 0; border-top: 1px solid var(--soft); }
  .navsheet-sec h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
  .navsheet-sec a { display: block; padding: 10px 12px; border-radius: 10px; color: var(--ink); font-size: 16px; text-decoration: none; }
  .navsheet-sec a.on { background: #E3F5F0; font-weight: 700; }
}

/* Documents open on the page under their row (static/js/doc_viewer.js) */
.doc-viewer { margin: 6px 0 10px; border: 1px solid var(--line, #E4E7EC); border-radius: 10px; background: #fff; overflow: hidden; }
.doc-viewer-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 10px; background: var(--soft, #F2F4F7); }
.doc-viewer-bar b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.dv-name { display: flex; flex-direction: column; min-width: 0; flex: 1 1 160px; }
.dv-title { margin: 0; font-size: 17px; font-weight: 700; }
.doc-viewer.titled .doc-viewer-bar { flex-wrap: wrap; padding: 10px 12px; }
.doc-viewer.titled .doc-viewer-bar b { font-weight: 400; font-size: 12px; color: var(--muted); }
.doc-viewer-frame { display: block; width: 100%; height: 70vh; border: 0; background: #fff; }
img.doc-viewer-frame { height: auto; max-height: 70vh; object-fit: contain; }
.list-row.viewing, a.file.viewing { background: #EAF2FF; }

/* Trip planner */
.trip-grid { display: grid; grid-template-columns: minmax(280px, 380px) 1fr; gap: 14px; align-items: start; }
@media (max-width: 900px) { .trip-grid { grid-template-columns: 1fr; } }
.trip-list { max-height: 70vh; overflow: auto; }
.trip-list summary { cursor: pointer; padding: 6px 0; }
.trip-job { display: flex; gap: 8px; align-items: flex-start; padding: 5px 4px; border-radius: 6px; cursor: pointer; }
.trip-job:hover { background: var(--soft, #F2F4F7); }
.trip-route { margin: 0; padding-left: 22px; } .trip-route li { padding: 5px 0; }
.trip-num span { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #2F6FED; color: #fff; font: 600 12px/1 system-ui; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.35); }

/* Agent reminders */
details.rem { border-top: 1px solid var(--line, #E4E7EC); padding: 8px 0; }
details.rem > summary { cursor: pointer; list-style: none; }
details.rem > summary::-webkit-details-marker { display: none; }

.places-pop { position: absolute; z-index: 2000; margin: 0; padding: 4px 0; list-style: none; background: #fff; border: 1px solid var(--line, #E4E7EC); border-radius: 8px; box-shadow: 0 8px 24px rgba(16,24,40,.12); max-height: 260px; overflow: auto; }
.places-pop li { padding: 7px 12px; font-size: 14px; cursor: pointer; }
.places-pop li:hover, .places-pop li.on { background: #EAF2FF; }

/* Google maps (static/js/gmaps.js) */
.gmap-tip { position: absolute; z-index: 5; pointer-events: none; background: #fff; border-radius: 6px; padding: 6px 9px; font-size: 13px; line-height: 1.35; box-shadow: 0 4px 14px rgba(16,24,40,.18); max-width: 260px; }
.gm-style .map-reset { position: static; margin: 0 0 24px 10px; }

/* Withdrawn jobs (11052): the step where it stopped, and steps no longer expected */
.stepper .withdrawn .dot { background: #fff; box-shadow: inset 0 0 0 2px #98A2B3; }
.stepper .withdrawn .dot::after { content: "✕"; color: #667085; font-size: 11px; font-weight: 700; }
.stepper .na .dot { background: #fff; box-shadow: inset 0 0 0 2px #E4E7EC; }
.stepper .na b, .stepper .na span { color: #98A2B3; }
/* Document rows: open on the left, trash on the right (WTS) */
.doc-row { align-items: center; }
.doc-row .doc-link { display: grid; grid-template-columns: 36px minmax(0,1fr); gap: 12px; align-items: center; color: inherit; text-decoration: none; min-width: 0; }
.doc-row .doc-link:hover b { color: var(--blue, #2F6FED); }
.icon-btn { display: inline-grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 8px; background: transparent; color: #98A2B3; cursor: pointer; padding: 0; }
.icon-btn:hover { background: #FDE8E7; color: #A3161B; }
.icon-btn.sm { width: 22px; height: 22px; vertical-align: middle; }
/* Drag-and-drop file areas (static/js/dropfiles.js) */
.drop-area { display: inline-flex; align-items: center; gap: 8px; min-width: 260px; padding: 9px 14px; border: 1.5px dashed #C7CDD6; border-radius: 10px;
  background: #FAFBFC; color: #475467; font-size: 14px; cursor: pointer; position: relative; }
.drop-area:hover { border-color: #2F6FED; }
.drop-area.over { border-color: #2F6FED; background: #EAF2FF; }
.drop-area.has-file { border-style: solid; border-color: #30A46C; background: #F0FAF4; }
.drop-area .drop-icon { font-size: 18px; color: #98A2B3; }
.drop-area .drop-name { font-weight: 600; color: #17603C; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.drop-area .drop-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
/* Dashboard left column (Needs your attention + Ongoing jobs). Its own name: ".stack" is used inside cards. */
.col-stack { display: flex; flex-direction: column; gap: 16px; align-self: start; min-width: 0; }
.col-stack > .card { margin: 0; }
.cond-jobs { max-height: 340px; overflow-y: auto; margin-top: 4px; border-top: 1px solid var(--soft); }
.pill.salmon { background: #FEE4E2; color: #B42318; } .pill.salmon::before { background: #F97066; }

/* Sales call list */
.calls-grid { display: grid; grid-template-columns: minmax(260px, 340px) 1fr; gap: 14px; align-items: start; }
@media (max-width: 900px) { .calls-grid { grid-template-columns: 1fr; } }
.cq-list { max-height: 72vh; overflow: auto; }
.cq-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 8px; color: var(--ink); text-decoration: none; border-top: 1px solid var(--soft); }
.cq-row:hover { background: #FAFBFC; text-decoration: none; }
.cq-row.on { background: #EAF2FF; }
.calls-two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 1100px) { .calls-two { grid-template-columns: 1fr; } }
.calls-hist { max-height: 340px; overflow: auto; }
.call-link { display: inline-flex; align-items: center; gap: 3px; margin-right: 8px; }
.outcomes { display: flex; flex-wrap: wrap; gap: 6px; }
.outcomes label { cursor: pointer; }
.outcomes input { position: absolute; opacity: 0; }
.outcomes span { display: inline-block; padding: 5px 11px; border: 1px solid #D0D5DD; border-radius: 999px; font-size: 13px; }
.outcomes input:checked + span { background: #2F6FED; border-color: #2F6FED; color: #fff; }
.outcomes input:focus-visible + span { outline: 2px solid #2F6FED; outline-offset: 2px; }

/* ---- Sales ---- */
.funnel { display: flex; flex-wrap: wrap; gap: 8px; }
.funnel-step { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; color: inherit; text-decoration: none; }
.funnel-step b { font-size: 18px; }
.sales-map-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 14px; }
.sales-map { height: calc(100vh - 220px); min-height: 480px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
.sales-panel { max-height: calc(100vh - 220px); overflow: auto; }
.sp-head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.sp-box { background: var(--soft); border-radius: 10px; padding: 8px 10px; margin: 8px 0; font-size: 13px; }
.sp-contact { padding: 6px 0; border-bottom: 1px solid var(--line); }
@media (max-width: 900px) { .sales-map-wrap { grid-template-columns: 1fr; } .sales-map { height: 60vh; } }
.cal { padding: 0; overflow: hidden; }
.cal-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-head div { padding: 8px; font-size: 12px; font-weight: 700; color: var(--muted); text-align: center; border-bottom: 1px solid var(--line); }
.cal-day { min-height: 88px; min-width: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 4px 6px; font-size: 12px; }
.cal-day.out { background: #FAFBFC; color: var(--faint); }
.cal-day.today .cal-n { background: #0B4F45; color: #fff; border-radius: 999px; padding: 0 6px; }
.cal-n { font-weight: 700; display: inline-block; margin-bottom: 2px; }
.cal-ev { display: flex; align-items: center; gap: 5px; padding: 1px 2px; margin: 1px 0; font-size: 11.5px; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-radius: 4px; }
.cal-ev > i { flex: none; width: 7px; height: 7px; border-radius: 50%; background: #98A2B3; }
.cal-ev a { color: inherit; overflow: hidden; text-overflow: ellipsis; } .cal-ev b { font-weight: 600; color: var(--muted); }
.cal-ev:hover { background: #F2F4F7; } .cal-ev.done { color: var(--muted); } .cal-ev.done a { text-decoration: none; }
.cal-ev.k-meeting > i, .cal-ev.k-presentation > i { background: #6941C6; } .cal-ev.k-conference > i { background: #9E77ED; }
.cal-ev.k-commission > i { background: #F28A00; } .cal-ev.k-follow_up > i, .cal-ev.k-call_due > i { background: #00B8CC; }
.cal-ev.k-call > i { background: #30A46C; } .cal-ev.k-email > i { background: #2E90FA; } .cal-ev.k-deadline > i { background: #E5484D; }
.cal-ev.k-google > i { background: #fff; border: 1.5px solid #667085; }
.cal-more summary { font-size: 11px; color: var(--muted); cursor: pointer; padding: 1px 2px; list-style: none; } .cal-more summary::-webkit-details-marker { display: none; }
.cal-key { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 8px 0 10px; } .cal-key .cal-ev { display: inline-flex; }

/* Client onboarding questionnaire (public, by private link) */
.page.onboard { max-width: 760px; }
.ob-head { display: flex; gap: 12px; align-items: center; margin: 8px 0 14px; }
.ob-brand { font-weight: 700; font-size: 18px; color: var(--navy, #1b2a4a); }
.ob-steps { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 12px; }
.ob-steps a { font-size: 12px; padding: 3px 8px; border-radius: 999px; background: #fff; border: 1px solid #dde2ea; color: inherit; text-decoration: none; }
.ob-steps a.on { background: var(--navy, #1b2a4a); color: #fff; border-color: transparent; }
.ob-form .page-title { margin: 2px 0 6px; }
.ob-intro { color: #4a5568; line-height: 1.5; }
.ob-field { margin: 16px 0; display: flex; flex-direction: column; gap: 6px; }
.ob-field[hidden] { display: none; }
.ob-label { font-weight: 600; }
.ob-label .req { color: #c0392b; }
.ob-opt { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; line-height: 1.35; }
.ob-opt input { margin-top: 3px; }
.ob-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.ob-grid .wide { grid-column: 1 / -1; }
.ob-money input { width: 9em; }
.ob-note { background: #f4f6fa; border-left: 3px solid #9aa8bf; padding: 8px 10px; margin: 0; line-height: 1.45; }
.ob-nav { display: flex; justify-content: space-between; gap: 8px; margin-top: 20px; }
.ob-nav .btn.primary { margin-left: auto; }
.ob-docs li { margin: 6px 0; }
@media (max-width: 560px) { .ob-grid { grid-template-columns: 1fr; } }
.page.onboard input:not([type=radio]):not([type=checkbox]), .page.onboard textarea { max-width: 100%; box-sizing: border-box; }
.ob-grid > * { min-width: 0; }

/* Ordinances */
.ord-text { max-height: 72vh; overflow: auto; font-family: Georgia, "Times New Roman", serif; font-size: 14px; line-height: 1.5; padding-right: 6px; }
.ord-text p { margin: 0 0 8px; padding: 2px 4px 2px 34px; position: relative; white-space: pre-wrap; border-radius: 4px; }
.ord-text p.hl { background: #fff6b8; }
.ord-text .pn { position: absolute; left: 0; width: 28px; text-align: right; font: 11px/1.9 var(--font, system-ui); color: #9aa3b2; }
.proposal { border-top: 1px solid #e6e9ef; padding: 12px 0; }
.proposal:first-of-type { border-top: 0; }
.prop-item { padding: 8px 0; border-bottom: 1px dashed #eceff4; }
.prop-item.sev-must b { color: #c0392b; }
.diff { margin-top: 4px; font-family: Georgia, serif; font-size: 13px; line-height: 1.45; }
.diff del { display: block; background: #fdecea; color: #8a1c13; text-decoration: line-through; padding: 3px 6px; border-radius: 4px; margin-bottom: 3px; }
.diff ins { display: block; background: #e7f6ec; color: #145c2c; text-decoration: none; padding: 3px 6px; border-radius: 4px; }
.spin { display: inline-block; width: 12px; height: 12px; border: 2px solid #c9d1de; border-top-color: #1b2a4a; border-radius: 50%; animation: spin 0.8s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.steps input[type=text], .steps input[type=date], .steps input[type=number] { width: 100%; min-width: 0; padding: 4px 6px; font-size: 13px; }
.steps tr.done td { opacity: 0.6; }
.steps tr.late td:first-child { box-shadow: inset 3px 0 0 #c0392b; }
.overdue { color: #c0392b; font-weight: 600; }
.track { margin: 0; padding-left: 22px; }
.track li { margin: 6px 0; }
.track li.done { opacity: 0.6; }
.track li.late b { color: #c0392b; }

/* Claude's document review badges (permits/doc_review.py) */
.dr { display: inline-block; margin-left: 6px; vertical-align: top; }
.dr > summary { display: inline-block; cursor: pointer; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; list-style: none; background: #eef1f6; color: #4a5568; }
.dr > summary::-webkit-details-marker { display: none; }
.dr-ok > summary { background: #e7f6ec; color: #17603C; }
.dr-issues > summary { background: #fdecea; color: #a1261b; }
.dr-unclear > summary { background: #fff4d6; color: #8a5a00; }
.dr[open] { display: block; margin: 6px 0 8px; }
.dr-body { margin-top: 6px; padding: 8px 10px; border: 1px solid #e6e9ef; border-radius: 8px; background: #fbfcfe; font-size: 13px; line-height: 1.45; }
.dr-body p { margin: 0 0 6px; }
.dr-list { margin: 0 0 6px; padding-left: 4px; list-style: none; }
.dr-list li { margin: 2px 0; }
.dr-list .dr-fail b { color: #c0392b; }
.dr-list .dr-pass b { color: #17603C; }
.dr-list .dr-unclear b { color: #b07800; }
.dr-ask { margin-left: 6px; }

/* Ordinance / contract boards: attention · in progress · coming up, then a tile per county */
.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
@media (max-width: 1100px) { .board { grid-template-columns: 1fr; } }
.board-col { max-height: 430px; overflow: auto; }
.board-col .count { background: #eef1f6; border-radius: 999px; padding: 0 8px; font-size: 12px; font-weight: 700; }
.bitem { display: flex; flex-direction: column; gap: 1px; padding: 9px 10px 9px 12px; margin: 6px 0; border-radius: 10px; background: #f7f9fc; color: var(--ink); border-left: 4px solid #c9d1de; }
.bitem:hover { text-decoration: none; background: #eef3fb; }
.bitem span { font-size: 13px; }
.bitem small { font-size: 12px; color: var(--muted); }
.bitem.tone-red { border-left-color: #d64545; background: #fdf3f2; }
.bitem.tone-amber { border-left-color: #e0a100; background: #fffaeb; }
.bitem.tone-blue { border-left-color: #3a78d8; }
.bitem.tone-green { border-left-color: #17a35b; }
.prog { display: block; height: 5px; background: #e3e8ef; border-radius: 3px; margin: 5px 0 2px; overflow: hidden; }
.prog span { display: block; height: 100%; background: #17a35b; }
.empty-ok { display: flex; gap: 6px; align-items: center; color: #17603C; font-size: 13px; }
.tl { display: grid; grid-template-columns: 52px 1fr; gap: 10px; padding: 8px 0; border-top: 1px solid #eef1f5; color: var(--ink); font-size: 13px; }
.tl:first-of-type { border-top: 0; }
.tl:hover { text-decoration: none; background: #f7f9fc; }
.tl small { display: block; color: var(--muted); font-size: 12px; }
.tl-date { text-align: center; background: #eef3fb; border-radius: 8px; padding: 3px 0; line-height: 1.15; }
.tl-date b { display: block; font-size: 13px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.tile { background: #fff; border-radius: 12px; padding: 12px 14px; color: var(--ink); display: block; }
a.tile:hover { text-decoration: none; box-shadow: 0 0 0 2px #dbe5f5; }
.tile-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.tile-head b { font-size: 15px; margin-right: auto; }
.tile-seal { display: flex; flex: none; }  /* the county seal, top right (Dean, 2026-10-08) */
.tag { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: #eef3fb; color: #2d5aa0; }
.tag.tag-note { background: #f3eefb; color: #6b3fa0; }
.tag.tone-green { background: #e7f6ec; color: #17603C; }
.tag.tone-amber { background: #fff4d6; color: #8a5a00; }
.tag.tone-red { background: #fdecea; color: #a1261b; }
.tile-rows > * { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; border-top: 1px solid #f1f3f7; font-size: 13px; color: var(--ink); }
.tile-rows > a:hover { text-decoration: none; color: var(--link, #2d5aa0); }
.tile-rows span { color: var(--muted); }
.tile-rows small { color: var(--muted); font-size: 11px; margin-left: 4px; }

/* Contract inspector page */
.ijobs { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; }
.ijob { border: 1px solid #e6e9ef; border-radius: 10px; padding: 10px 12px; }
.assign-list { max-height: 320px; overflow: auto; display: flex; flex-direction: column; gap: 3px; }
.trip-job-extra { margin: -2px 0 8px 26px; line-height: 1.5; }
.job-upload { display: inline-flex; gap: 6px; align-items: center; margin-top: 4px; padding: 3px 9px; border: 1px dashed #b9c3d3; border-radius: 8px; cursor: pointer; font-size: 12px; }
.job-upload.over { background: #eef3fb; border-color: #3a78d8; }
.trip-tip { font-size: 13px; line-height: 1.4; color: var(--ink); }
/* New applications chart on the dashboard: Y = jobs, X = months */
.mchart { display: grid; grid-template-columns: 14px 24px 1fr; column-gap: 4px; margin-top: 8px; }
.mchart-ytitle { writing-mode: vertical-rl; transform: rotate(180deg); text-align: center; }
.mchart-y { display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; height: 64px; align-self: end; border-right: 1px solid var(--line); padding-right: 4px; line-height: 1; }
.mchart-bars { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 4px; align-items: end; height: 84px; border-bottom: 1px solid var(--line); }
.mchart-col { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-end; text-align: center; }
.mchart-col .small { font-size: 11px; line-height: 16px; }
.mchart-x { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 4px; text-align: center; font-size: 11px; padding-top: 2px; }
.mchart-xtitle { text-align: center; }
.golive { display: grid; gap: 10px; }
.golive fieldset { border: 0; padding: 0; margin: 0; }
.golive-report { margin-top: 12px; border-top: 1px solid var(--soft); padding-top: 8px; }
.golive-report ul { margin: 4px 0 8px; padding-left: 18px; list-style: none; }
.doc-viewer-wide .doc-viewer-frame { height: 80vh; }
/* Ask Claude on the call list / sales record */
.research textarea { width: 100%; }
.research .chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 10px; cursor: pointer; }
.research .chip:hover { background: var(--soft); }
.research-item { border-top: 1px solid var(--soft); padding: 8px 0; }
.research-answer p { margin: 4px 0; } .research-answer ul { margin: 4px 0; padding-left: 18px; }
.calls-map-card { margin-bottom: 14px; padding: 10px 14px; }
.calls-map-card summary { cursor: pointer; }
.calls-map { height: 300px; border-radius: 10px; margin-top: 8px; position: relative; }
.att-row { display: flex; flex-direction: column; gap: 2px; border-left: 4px solid var(--c); padding-left: 10px; }
.insp-line { margin-top: 4px; color: var(--green-ink); font-weight: 600; }
.cond-note { color: var(--yellow-ink); font-weight: 600; }
/* A component item its conditional approval (or a permit condition) is waiting on */
.comp-items tr.conditional td { background: #FFF4E5; }
.comp-items tr.conditional td.lbl b { color: #B54708; }
.comp-items tr.conditional td.ok { box-shadow: inset 4px 0 0 var(--orange); }
/* Job page: timeline + step drawers + side rail (templates/permits/job_detail.html, Dean 2026-10-03) */
.jd-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.jd-main { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.jd-rail { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.jd-rail .card { padding: 14px 16px; }
.jd-timeline { margin-bottom: 0; }
/* the tower's small map at the timeline's bottom right; a click fills the browser window with it (Dean, 2026-10-26) */
.jd-timeline.has-map { position: relative; min-height: 290px; }
.jd-map { position: absolute; right: 16px; bottom: 14px; width: 260px; height: 110px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--soft); z-index: 2; }
.jd-map-el { position: absolute; inset: 0; }
.jd-map-open { position: absolute; inset: 0; z-index: 3; border: 0; background: transparent; cursor: zoom-in; display: flex; align-items: flex-end; justify-content: flex-start;
  padding: 6px 8px; font: inherit; font-size: 11px; font-weight: 600; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .8); }
.jd-map:not(.max) .gmnoprint, .jd-map:not(.max) .gm-fullscreen-control, .jd-map:not(.max) .gm-style-cc, .jd-map:not(.max) .maplibregl-ctrl { display: none !important; }
.jd-map-bar { display: none; }
.jd-map.max { position: fixed; inset: 0; width: auto; height: auto; border: 0; border-radius: 0; z-index: 1000; }
.jd-map.max .jd-map-open { display: none; }
.jd-map.max .jd-map-el { top: 52px; }
.jd-map.max .jd-map-bar { display: flex; align-items: center; gap: 12px; height: 52px; padding: 0 16px; background: var(--card); border-bottom: 1px solid var(--line); }
.jd-map.max .jd-map-bar .btn { margin-left: auto; }
.jd-map.max .jd-map-bar a.btn + .btn { margin-left: 0; }
.stepper li.open > .step-link b { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 6px; text-decoration-color: var(--teal); }
.stepper .step-link { cursor: pointer; }
.drawer { border-top: 4px solid var(--teal); gap: 10px; }
.drawer-head { display: flex; align-items: baseline; gap: 10px; }
.drawer-head h2 { font-size: 18px; }
.drawer-close { margin-left: auto; }
.drawer .comp-bare .comp-list { display: flex; flex-direction: column; gap: 8px; }
.letter-set { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.letter-head { display: flex; gap: 8px; align-items: center; }
.letter-others summary { cursor: pointer; color: var(--muted); }
.letter-others .other-row { opacity: .85; }
.insp-row { gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--soft); }
.jd-tools { gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.jd-all-files { flex: 1 1 100%; }
.jd-all-files > summary { list-style: none; display: inline-flex; }
.jd-all-files > summary::-webkit-details-marker { display: none; }
.jd-all-files[open] > summary { margin-bottom: 10px; }
@media (max-width: 1100px) { .jd-layout { grid-template-columns: 1fr; } }
.drawer[hidden] { display: none !important; }
.jd-timeline { margin-bottom: 14px; }
.jd-layout { grid-template-columns: minmax(0, 1fr) 380px; }
.jd-rail table { font-size: 12px; }
.jd-rail table td, .jd-rail table th { padding: 6px 4px; }
.drawer section.card { padding: 0; background: none; box-shadow: none; border: 0; }
.drawer > section.card > .card-head .label { display: none; }
.cons-insp { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--soft); }
a.cchip { text-decoration: none; cursor: pointer; } a.cchip:hover { filter: brightness(.95); outline: 2px solid rgba(15,166,138,.35); }
/* PDF viewer (PDF.js): drag to pan, Ctrl+wheel / buttons to zoom */
.pdfv-scroll { height: 75vh; overflow: auto; background: #525659; cursor: grab; text-align: center; overscroll-behavior: contain; touch-action: pan-x pan-y pinch-zoom; }
.pdfv-scroll.dragging { cursor: grabbing; user-select: none; }
.pdfv-pages { display: inline-flex; flex-direction: column; align-items: center; gap: 10px; padding: 12px; }
.pdfv-slot { background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.35); }
.pdfv-slot canvas { display: block; }
.pdfv-zoom { min-width: 3.5em; text-align: center; }
.doc-viewer:fullscreen { display: flex; flex-direction: column; background: #fff; }
.doc-viewer:fullscreen .pdfv-scroll { height: auto; flex: 1; }
/* Fill window: the viewer covers the browser window (not the screen) until "Back to page" or Esc (Dean, 2026-11-02) */
.doc-viewer.dv-max { position: fixed; inset: 0; z-index: 1000; margin: 0; border-radius: 0; display: flex; flex-direction: column; max-width: none; }
.doc-viewer.dv-max .pdfv-scroll, .doc-viewer.dv-max .doc-viewer-frame { height: auto; max-height: none; flex: 1; min-height: 0; }
.doc-viewer.dv-max [data-act="close"] { display: none; }
body.dv-maxed { overflow: hidden; }
/* report tables in the viewer: one scroll box (both scrollbars in view), header stays on top, cells wrap at a sane width */
.doc-viewer.tv { margin: 0; }
.tv-scroll { max-height: 75vh; overflow: auto; scrollbar-gutter: stable; cursor: grab; overscroll-behavior: contain; background: #fff; }
.tv-scroll.dragging { cursor: grabbing; user-select: none; }
.tv-scroll table.data { width: max-content; }
.tv-scroll table.data td { max-width: 240px; }
.tv-scroll table.data thead th { position: sticky; top: 0; z-index: 1; }
.doc-viewer.tv.dv-max .tv-scroll, .doc-viewer.tv:fullscreen .tv-scroll { max-height: none; flex: 1; min-height: 0; }
.compare-card.dv-fill { position: fixed; inset: 0; z-index: 999; margin: 0 !important; border-radius: 0; display: flex; flex-direction: column; }
.compare-card.dv-fill .compare { flex: 1; height: auto; min-height: 0; }
[data-fill].on { background: var(--ink); color: #fff; border-color: var(--ink); }
.doc-viewer-bar .btn.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.doc-viewer { max-width: 100%; min-width: 0; }
/* Component requirements as tiles (templates/permits/_components.html) */
.comp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); grid-auto-flow: row dense; gap: 8px; margin: 10px 0 4px; }
.ci { border: 1px solid var(--line); border-radius: 12px; padding: 9px 11px; background: #fff; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ci.has-file { grid-column: span 2; }
.ci.missing { border-color: #F3B8B9; background: #FFF6F6; }
.ci.conditional { border-color: #F7B267; background: #FFF4E5; box-shadow: inset 4px 0 0 var(--orange); }
.ci.conditional .ci-label { color: #B54708; }
.ci-head { display: flex; align-items: flex-start; gap: 6px; }
.ci-ok { flex: none; width: 16px; padding-top: 1px; }
.ci-label { font-size: 13px; line-height: 1.3; position: relative; cursor: default; }
.ci-label[data-tip] { text-decoration: underline dotted #98A2B3; text-underline-offset: 3px; cursor: help; }
.ci-cond { margin-left: auto; flex: none; font-size: 12px; }
.ci-val { font-size: 13px; min-width: 0; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.ci-val .file { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.ci-val .file-wrap { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-width: 0; }
.ci-num { font-weight: 600; }
/* hover help: the item's explanation pops up over its name */
[data-tip]:hover::after, [data-tip]:focus-visible::after { content: attr(data-tip); position: absolute; left: 0; top: calc(100% + 6px); z-index: 30;
  width: max-content; max-width: 340px; padding: 8px 10px; border-radius: 8px; background: #101828; color: #fff; font-size: 12px; font-weight: 400;
  line-height: 1.45; white-space: normal; box-shadow: 0 8px 24px rgba(16,24,40,.25); pointer-events: none; }
.comp-grid > .doc-viewer { grid-column: 1 / -1; }
@media (max-width: 640px) { .ci.has-file { grid-column: auto; } }
/* Component requirements as grouped label | answer lists (templates/permits/_components.html, Dean 2026-10-04) */
.cstat { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 10px 0 2px; font-size: 13px; color: var(--muted); }
.cstat .att-n { color: #B42318; }
.cfilter { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.cgroups { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 6px 36px; margin-top: 6px; }
.cgroup h4 { margin: 14px 0 4px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.crows { border-top: 1px solid var(--line); }
.crow { display: grid; grid-template-columns: 16px minmax(150px, 40%) minmax(0, 1fr) 24px; gap: 10px; align-items: start; padding: 7px 4px; border-bottom: 1px solid var(--soft); font-size: 13px; }
.crow:hover { background: #FAFBFC; }
.cmark { color: var(--faint); font-weight: 700; text-align: center; line-height: 1.5; }
.crow.st-done .cmark { color: var(--green); }
.crow.st-problem { background: #FFF6F6; } .crow.st-problem .cmark, .crow.st-problem .clabel { color: #B42318; }
.crow.st-conditional { background: #FFF6EB; } .crow.st-conditional .cmark, .crow.st-conditional .clabel { color: #B54708; }
.crow.st-waiting .clabel { color: var(--muted); }
.clabel { line-height: 1.5; position: relative; }
.clabel .has-tip { text-decoration: underline dotted #98A2B3; text-underline-offset: 3px; cursor: help; position: relative; }
.cval { min-width: 0; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; line-height: 1.5; }
.chip-wrap { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; max-width: 100%; }
.doc-chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink); font-size: 12px; font-weight: 600; max-width: 100%; }
.doc-chip:hover { border-color: var(--teal); text-decoration: none; background: #F0FAF7; }
.doc-chip.viewing { border-color: var(--teal); background: #E3F5F0; }
.row-menu { position: relative; }
.row-menu > summary { list-style: none; cursor: pointer; color: var(--faint); font-weight: 800; text-align: center; border-radius: 6px; line-height: 1.3; }
.row-menu > summary::-webkit-details-marker { display: none; }
.row-menu > summary:hover, .row-menu[open] > summary { color: var(--ink); background: var(--soft); }
.row-menu-box { position: absolute; right: 0; top: 24px; z-index: 25; min-width: 240px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; box-shadow: 0 10px 28px rgba(16,24,40,.16); display: flex; flex-direction: column; gap: 6px; }
.comp.only-att .crow:not(.st-problem):not(.st-conditional):not(.st-look) { display: none; }
.comp.only-att .cgroup:not(:has(.st-problem, .st-conditional, .st-look)) { display: none; }
@media (max-width: 640px) { .cgroups { grid-template-columns: 1fr; } .crow { grid-template-columns: 16px 1fr 24px; } .crow .cval { grid-column: 2 / 3; } }
.row-menu > summary { display: inline-block; width: 22px; height: 22px; }
.row-menu > summary::before, .row-menu > summary::after { content: none !important; display: none !important; }
.crow { align-items: center; }
.siting-pick { display: flex; flex-direction: column; gap: 3px; width: 100%; }
.siting-pick select { font-size: 13px; padding: 4px 8px; height: auto; }
/* component open/close: a clear chevron button (Dean, 2026-10-04) */
.comp > summary::before { content: ""; flex: none; width: 26px; height: 26px; border-radius: 8px; background: var(--soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23101828' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l6 6-6 6'/%3E%3C/svg%3E") center no-repeat; transition: transform .15s, background-color .15s; }
.comp > summary:hover::before { background-color: #DDE3EA; }
.comp[open] > summary::before { transform: rotate(90deg); background-color: #E3F5F0; }
/* Analyst invoices in the side rail: a stack per invoice */
.inv-list { display: flex; flex-direction: column; }
.inv { padding: 10px 0; border-top: 1px solid var(--soft); display: flex; flex-direction: column; gap: 4px; }
.inv:first-child { border-top: 0; padding-top: 2px; }
.inv-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.inv-amt { font-weight: 700; font-variant-numeric: tabular-nums; }
.inv-status { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.inv-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 2px; }
.inv-more { position: relative; }
.inv-more > summary { list-style: none; cursor: pointer; color: var(--link); padding: 4px 6px; border-radius: 6px; }
.inv-more > summary::-webkit-details-marker { display: none; }
.inv-more[open] > summary { background: var(--soft); }
.inv-more-box { position: absolute; right: 0; top: 30px; z-index: 25; width: 290px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  box-shadow: 0 10px 28px rgba(16,24,40,.16); display: flex; flex-direction: column; gap: 10px; }
.inv-more-box form { display: flex; flex-direction: column; gap: 6px; }
.inv-more-box input, .inv-more-box select { font-size: 12px; height: 30px; padding: 2px 6px; width: auto; max-width: 100%; }
.reg-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 10px; }
.reg-chip { display: flex; flex-direction: column; gap: 1px; padding: 7px 12px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-size: 12px; min-width: 140px; }
.reg-chip b { font-size: 13px; }
.reg-chip span { color: var(--muted); }
a.reg-chip:hover { text-decoration: none; border-color: var(--teal); }
.reg-chip.green { border-color: #A6DDBF; background: #F1FAF5; }
.reg-chip.red { border-color: #F3B8B9; background: #FFF6F6; } .reg-chip.red span { color: #B42318; font-weight: 600; }
.reg-chip.grey { opacity: .7; }
.doc-chip.supp { background: #fff; border-style: dashed; }
.doc-chip.supp.staff { color: var(--muted); }
.supp-form { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--soft); min-width: 260px; }
.reg-supps { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: -4px 0 10px; font-size: 12px; }
.reg-supps a { padding: 3px 9px; border: 1px dashed var(--line); border-radius: 8px; color: var(--ink); background: #fff; }
.reg-chip.amber { border-color: #F5D08A; background: #FFF9EB; } .reg-chip.amber span { color: #93600B; }
.regdoc-flag { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 8px; padding: 9px 12px;
  border-radius: 10px; background: #FFF8E6; border-left: 4px solid var(--yellow, #F5B700); font-size: 13px; }
.regdoc-tools { margin: 0 0 10px; font-size: 13px; }
.regdoc-tools > summary { cursor: pointer; font-weight: 600; color: var(--link); padding: 4px 0; }
.regdoc-tools > form { margin-top: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.regdoc-hist { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--soft); }
.ci-item { display: flex; flex-direction: column; gap: 4px; padding: 8px 0; border-top: 1px solid var(--soft); }
.ci-item:first-of-type { border-top: 0; }
.ci-item form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 2px; }

.test-on { color: #fff; background: #D92D20; padding: 1px 7px; border-radius: 6px; }

/* New application (templates/permits/application_new.html) */
.na { display: flex; flex-direction: column; gap: 16px; }
.na-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 8px; }
.na-grid[hidden], .na label[hidden] { display: none; }
.na-grid .wide { grid-column: 1 / -1; }

/* Agent component form (templates/permits/component_edit.html) */
.cf-fixes { margin: 0 0 16px; padding: 14px 18px; border-radius: 14px; background: #FFF6F6; border: 1px solid #F3B8B9; }
.cf-fixes h2 { margin: 0 0 6px; font-size: 16px; color: #B42318; }
.cf-fixes ol { margin: 6px 0; padding-left: 20px; } .cf-fixes li { margin: 3px 0; }
.cf-locked { margin: 0 0 16px; padding: 12px 16px; border-radius: 12px; background: var(--soft); }
.cf-groups { display: block; }
.cf-group[hidden] { display: none; }
.cf-group { border-top-left-radius: 0; }
.cf-tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.cf-tab { font: inherit; font-weight: 600; font-size: 14px; padding: 10px 16px; border: 1px solid var(--line); border-bottom: 0; border-radius: 12px 12px 0 0;
  background: var(--soft); color: var(--muted); cursor: pointer; }
.cf-tab[aria-selected="true"] { background: #fff; color: var(--ink); }
.cf-badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: #D92D20; color: #fff; font-size: 11px; }
.cf-row input:not([type=radio]):not([type=checkbox]):not([type=file]), .cf-row select, .cf-row textarea { width: 100%; }
.cf-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 14px; padding: 12px 0; border-top: 1px solid var(--soft); scroll-margin-top: 90px; }
.cf-group .cf-row:first-of-type { border-top: 0; }
.cf-row.fix { margin: 0 -12px; padding: 12px; border-radius: 10px; background: #FFF6F6; box-shadow: inset 4px 0 0 #D92D20; }
.cf-row.fix .cf-label > b { color: #B42318; }
.cf-note { margin-top: 6px; padding: 7px 10px; border-radius: 8px; background: #fff; border: 1px solid #F3B8B9; color: #7A271A; font-size: 13px; }
.cf-input { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cf-contact { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; } .cf-contact .wide { grid-column: 1 / -1; }
.cf-doc { display: flex; flex-wrap: wrap; gap: 6px; }
.cf-supp summary { cursor: pointer; font-size: 13px; color: var(--link); font-weight: 600; }
.cf-supp[open] { display: flex; flex-direction: column; gap: 6px; padding: 8px; border: 1px dashed var(--line); border-radius: 10px; }
.cf-bar { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 16px; padding: 12px 16px;
  background: rgba(255, 255, 255, .95); backdrop-filter: blur(6px); border: 1px solid var(--line); border-radius: 14px; }
.cf-bar .small { margin-right: auto; }
@media (max-width: 640px) { .cf-row { grid-template-columns: 1fr; } .cf-contact { grid-template-columns: 1fr; } }
.crow .cfix { display: block; margin-top: 4px; padding: 5px 8px; border-radius: 7px; background: #fff; border: 1px solid #F3B8B9; color: #7A271A; font-size: 12px; }
.comp-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 8px 0; }

/* Parts of the application in order (templates/permits/_app_steps.html) */
.appsteps { margin: 0 0 16px; padding: 14px 16px; background: #fff; border-radius: 16px; box-shadow: 0 1px 2px rgba(16, 24, 40, .05); }
.appsteps ol { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; counter-reset: none; }
.appsteps li { flex: 1 1 200px; }
.appsteps li a { display: flex; gap: 10px; align-items: center; height: 100%; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; color: var(--ink); }
.appsteps li a:hover { text-decoration: none; border-color: var(--teal); }
.as-n { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--soft); color: var(--muted); }
.as-t { display: flex; flex-direction: column; line-height: 1.25; font-size: 13px; } .as-t span { color: var(--muted); font-size: 12px; }
.as-approved .as-n, .as-invoiced .as-n, .as-waived .as-n { background: var(--green, #12B76A); color: #fff; }
.as-ready .as-n { background: #FDB022; color: #fff; }
.as-revision a { border-color: #F3B8B9; background: #FFF6F6; } .as-revision .as-n { background: #D92D20; color: #fff; } .as-revision .as-t span { color: #B42318; }
.as-next a { border-color: var(--teal); background: #F0FAF7; box-shadow: 0 0 0 3px rgba(15, 166, 138, .12); } .as-next .as-n { background: var(--teal); color: #fff; }
.as-locked a { opacity: .6; }
.as-ph { display: flex; gap: 10px; align-items: center; height: 100%; padding: 10px 12px; border: 1.5px dashed var(--line); border-radius: 12px; color: var(--muted); }
.as-here a { outline: 2px solid var(--ink); outline-offset: 1px; }
.as-line { margin: 10px 0 0; font-size: 14px; font-weight: 600; }
.pi-checks { margin: 0 0 10px; padding: 10px 14px; border-radius: 10px; background: #FFF8E6; border-left: 4px solid var(--yellow, #F5B700); font-size: 13px; }
.pi-checks ul { margin: 4px 0 0; padding-left: 18px; } .pi-checks li.ok { color: var(--muted); }
.as-revision.as-next a { border-color: #D92D20; background: #FFF6F6; box-shadow: 0 0 0 3px rgba(217, 45, 32, .12); } .as-revision.as-next .as-n { background: #D92D20; }
.pr-checks { margin: 0; padding-left: 18px; } .pr-checks li { margin: 4px 0; } .pr-checks li.warn { color: #93600B; font-weight: 600; } .pr-checks li.ok { color: var(--muted); }
.pr-part { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; margin-top: 8px; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; }
.pr-part:has(input:checked) { border-color: var(--teal); background: #F0FAF7; }
.pr-part > span { display: flex; flex-direction: column; gap: 2px; } .pr-part .small { color: var(--muted); }
.comp-add { gap: 6px; margin-top: 10px; }
/* the greyed-out Submit's reason, above the button (it sits at the bottom of the screen) */
.tip-up { position: relative; display: inline-block; }
.tip-up[data-tip]:hover::after, .tip-up[data-tip]:focus-visible::after { top: auto; bottom: calc(100% + 8px); left: auto; right: 0; width: 280px; }
.tip-up .btn[disabled] { pointer-events: none; opacity: .55; }

/* jumping to a component keeps its header (code, name, status, buttons) in view below the top bar */
details.comp, .cf-row, .drawer { scroll-margin-top: 84px; }

/* Revision notes written on the job page (Dean, 2026-10-04: no separate page) */
.crow { grid-template-columns: 16px minmax(150px, 40%) minmax(0, 1fr) 52px; }
.crow-tools { display: flex; gap: 2px; justify-content: flex-end; align-items: start; }
.fixpop { position: relative; }
.fixpop > summary { list-style: none; cursor: pointer; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 6px; color: var(--muted); }
.fixpop > summary::-webkit-details-marker { display: none; }
.fixpop > summary:hover, .fixpop[open] > summary { background: #FFF6F6; color: #B42318; }
.fixpop-box { position: absolute; right: 0; top: 28px; z-index: 30; width: 320px; display: flex; flex-direction: column; gap: 6px; padding: 12px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px rgba(16, 24, 40, .16); }
.cdraft { display: flex; gap: 6px; align-items: start; margin-top: 4px; padding: 5px 8px; border-radius: 7px; background: #fff; border: 1px dashed #F3B8B9; color: #7A271A; font-size: 12px; }
.cdraft .link { color: #B42318; }
.sb-dialog { width: min(720px, calc(100vw - 32px)); border: 0; border-radius: 16px; padding: 20px; box-shadow: 0 24px 64px rgba(16, 24, 40, .3); }
.sb-dialog::backdrop { background: rgba(16, 24, 40, .45); }
.pi-review { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px 20px; margin: 4px 0 12px; padding: 14px; border-radius: 12px;
  background: #FFFBF0; border: 1px solid #F5D08A; font-size: 13px; }
.pi-review > .row { grid-column: 1 / -1; }

/* ---------- phones (Dean, 2026-10-04: overlapping text, cut-off menus) ---------- */
@media (max-width: 640px) {
  html, body { overflow-x: hidden; }
  .page-head { flex-wrap: wrap; gap: 10px; }
  .page-head > * { min-width: 0; }
  .row { flex-wrap: wrap; }
  .kv dd, .kv dt, .list-row, .cval, .small { overflow-wrap: anywhere; }
  .page img, .page iframe, .page video, .page canvas { max-width: 100%; }
  /* tables scroll sideways inside their card instead of pushing the page wide */
  .page table { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  /* the job timeline: a compact strip that scrolls sideways, starting at the current step */
  .jd-timeline { overflow: hidden; padding-left: 10px; padding-right: 10px; }
  .jd-timeline .stepper, .jd-timeline .stepper[data-actions] { grid-template-columns: repeat(var(--steps, 7), 118px); overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 6px; }
  .jd-timeline .stepper li { scroll-snap-align: start; }
  .jd-timeline .stepper .step-action .btn.sm { padding: 0 8px; font-size: 11px; }
  .jd-timeline .stepper b { font-size: 12px; }
  .jd-timeline.has-map { min-height: 0; }
  .jd-map:not(.max) { position: relative; right: auto; bottom: auto; width: 100%; height: 120px; margin-top: 10px; }
  /* list rows with fixed columns stack */
  .list-row { grid-template-columns: 1fr !important; gap: 4px; }
  .cf-bar { flex-wrap: wrap; } .cf-bar .small { flex-basis: 100%; }
  .comp-actions { gap: 6px; } .comp-actions form.row { flex-wrap: wrap; }
  .comp > summary { flex-wrap: wrap; row-gap: 4px; }
  .comp-meta { flex-basis: 100%; }
  .viewas-banner { font-size: 12px; padding: 8px 12px; }
  dialog, .sb-dialog { width: calc(100vw - 16px); max-height: calc(100vh - 32px); padding: 14px; }
  .fixpop-box { width: min(320px, calc(100vw - 40px)); }
}
@media (max-width: 1100px) { .calls-two { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 900px) { .calls-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) { .rail-more { font-size: 11px; color: var(--ink); } body.nav-open .rail-more .rail-ico { background: #0B4F45; color: #fff; } }
@media (max-width: 640px) { .board, .jd-layout, .trip-grid, .insp-layout, .notice-layout, .sales-map-wrap, .cgroups, .cf-groups { grid-template-columns: minmax(0, 1fr) !important; } }
@media (max-width: 640px) { .trip-side .user-form { grid-template-columns: minmax(0, 1fr) !important; } .research .chip { white-space: normal; text-align: left; } }
@media (max-width: 640px) { .page input, .page select, .page textarea { max-width: 100%; box-sizing: border-box; } }

/* Component sections as outlined boxes that fold away (Dean, 2026-10-05: "a separate box within a box") */
.cgroups { gap: 14px 18px; margin-top: 10px; align-items: start; }
.cgroup { border: 1.5px solid #D0D5DD; border-radius: 14px; background: #fff; overflow: hidden; }
.cgroup.has-att { border-color: #F3B8B9; }
.cgroup-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 14px; cursor: pointer; list-style: none;
  background: #F4F6F9; border-bottom: 1.5px solid #E4E7EC; }
.cgroup-head::-webkit-details-marker { display: none; }
.cgroup-head::before { content: "▾"; font-size: 13px; color: var(--muted); transition: transform .15s; margin-right: -2px; }
.cgroup:not([open]) > .cgroup-head { border-bottom: 0; }
.cgroup:not([open]) > .cgroup-head::before { transform: rotate(-90deg); }
.cgroup-title { flex: 1; font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ink); }
.cgroup-count { font-size: 12px; color: var(--muted); white-space: nowrap; }
.cgroup.all-done .cgroup-count { color: var(--green, #12B76A); font-weight: 700; }
.cgroup.has-att .cgroup-head { background: #FFF6F6; border-bottom-color: #F3B8B9; }
.cgroup > .crows { padding: 2px 10px 6px; }
.cgroup .crow:last-child { border-bottom: 0; }
.cgroup-head:hover .cgroup-title { text-decoration: underline; text-underline-offset: 3px; }

/* Reply to the document reviewer (lessons) */
.dr-reply { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--soft); }
.dr-reply textarea { width: 100%; font: inherit; font-size: 13px; }
.dr-lessons { margin-top: 8px; padding: 8px 10px; border-radius: 8px; background: #F4F8FB; display: flex; flex-direction: column; gap: 3px; }

/* Relief / Conditional on required documents (Dean, 2026-10-05) */
.rc-buttons { display: inline-flex; gap: 6px; margin-top: 4px; }
.rcpop { position: relative; }
.rcpop > summary { list-style: none; cursor: pointer; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: #344054; }
.rcpop > summary::-webkit-details-marker { display: none; }
.rcpop > summary:hover, .rcpop[open] > summary { border-color: var(--teal); color: var(--teal-dark, #0B6E5E); }
.rcpop-box { position: absolute; left: 0; top: 30px; z-index: 30; width: 340px; display: flex; flex-direction: column; gap: 8px; padding: 12px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px rgba(16, 24, 40, .16); }
.rcpop-box label { display: flex; flex-direction: column; gap: 3px; }
.relief-tag { display: inline-flex; gap: 6px; align-items: center; margin-top: 4px; padding: 3px 9px; border-radius: 8px; background: #EEF4FF; color: #1D3A8A; font-size: 12px; }
.crow.st-relief .cmark { color: #2F6FED; }
@media (max-width: 640px) { .rcpop-box { width: min(340px, calc(100vw - 40px)); } }
.cgroup { overflow: visible; }
.cgroup-head { border-radius: 12px 12px 0 0; }
.cgroup:not([open]) > .cgroup-head { border-radius: 12px; }
.cgroup .crow { position: relative; } .cgroup .crow:has(details[open]) { z-index: 20; }

/* Agent job summary (templates/permits/_agent_summary.html) */
.as-grid { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(0, 1.6fr) minmax(240px, 1fr); gap: 16px; margin-bottom: 16px; align-items: start; }
.as-card { margin: 0; }
.as-h { margin: 0 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--soft); font-size: 16px; text-align: center; color: #1D5D99; }
.as-ring-row { display: flex; align-items: center; justify-content: center; gap: 18px; }
.as-ring { width: 120px; height: 120px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.as-ring span { width: 58px; height: 58px; border-radius: 50%; background: #fff; }
.as-pct { font-size: 34px; font-weight: 300; line-height: 1; } .as-pct-l { color: #2E7D32; font-size: 13px; margin-bottom: 8px; }
.as-legend { list-style: none; margin: 0; padding: 0; font-size: 12px; } .as-legend li { display: flex; align-items: center; gap: 6px; margin: 3px 0; }
.as-legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.as-steps { list-style: none; margin: 0; padding: 0; max-height: 330px; overflow-y: auto; }
.as-steps li { display: flex; gap: 10px; align-items: baseline; padding: 9px 2px; border-bottom: 1px solid var(--soft); font-size: 14px; }
.as-steps .muted { font-size: 12px; }
.as-dot { flex: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid #98A2B3; display: inline-grid; place-items: center; font-size: 11px; font-weight: 800; position: relative; top: 3px; }
.as-done .as-dot { background: var(--green, #12B76A); border-color: var(--green, #12B76A); color: #fff; } .as-done a, .as-done b { color: #2E7D32; }
.as-current .as-dot { border-color: #2F6FED; box-shadow: inset 0 0 0 3px #fff; background: #2F6FED; } .as-current a, .as-current b { color: #1D4ED8; }
.as-attention .as-dot { background: #D92D20; border-color: #D92D20; color: #fff; } .as-attention a, .as-attention b { color: #B42318; }
.as-todo a, .as-todo b { color: #475467; font-weight: 500; }
.as-side { display: flex; flex-direction: column; gap: 16px; }
.as-act { margin: 0 0 10px; } .as-act .btn { white-space: normal; text-align: left; height: auto; min-height: 30px; padding: 6px 12px; }
.as-fee { font-size: 30px; font-weight: 600; text-align: center; color: #1D5D99; margin-bottom: 6px; } .as-side .as-card:last-child .small { text-align: center; }
.as-fee-st { display: inline-block; margin-top: 4px; padding: 2px 10px; border-radius: 999px; font-weight: 700; background: var(--soft); }
.as-fee-st.green { background: var(--green-bg, #E8F7EE); color: var(--green-ink, #067647); } .as-fee-st.amber { background: #FFF4E5; color: #93600B; }
@media (max-width: 1100px) { .as-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .as-wf { grid-column: 1 / -1; order: 3; } }
@media (max-width: 640px) { .as-grid { grid-template-columns: minmax(0, 1fr); } }

.comp-add select { width: auto; max-width: 260px; } .comp-add { align-items: center; }

/* Sign in with Google / Apple / Microsoft / Facebook: a row of square logo buttons */
.provider-row { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.provider-form { margin: 0; }
.provider-btn { width: 64px; height: 52px; display: grid; place-items: center; border: 1px solid #D0D5DD; border-radius: 8px; background: #fff; cursor: pointer;
  transition: border-color .12s, box-shadow .12s; }
.provider-btn:hover { border-color: #98A2B3; box-shadow: 0 2px 8px rgba(16, 24, 40, .1); }
.provider-btn:focus-visible { outline: 3px solid rgba(15, 166, 138, .35); outline-offset: 2px; }
.page.auth .provider-row form { background: none; padding: 0; border-radius: 0; box-shadow: none; }
tr.row-link { cursor: pointer; } tr.row-link:hover td { background: #F6F9FC; }

/* An open review uses the component's full width; problems open, passed checks folded (Dean, 2026-10-05) */
.cgroups > .cgroup:has(.dr[open]) { grid-column: 1 / -1; }
.crow:has(.dr[open]) { grid-template-columns: 16px minmax(150px, 22%) minmax(0, 1fr) 52px; }
.dr[open] .dr-body { font-size: 13px; }
.dr-probs { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 8px; margin: 8px 0; }
.dr-f { border: 1px solid #F3B8B9; border-radius: 10px; background: #fff; }
.dr-f.dr-unclear { border-color: #F5D08A; }
.dr-f > summary { cursor: pointer; padding: 7px 10px; font-weight: 600; list-style: none; }
.dr-f > summary::-webkit-details-marker { display: none; }
.dr-f.dr-fail > summary b { color: #c0392b; } .dr-f.dr-unclear > summary b { color: #b07800; }
.dr-f > div { padding: 0 10px 9px 26px; color: #475467; }
.dr-passed { margin: 4px 0 8px; }
.dr-passed > summary { cursor: pointer; color: #17603C; font-weight: 600; padding: 4px 0; }
.dr-passed .dr-list { margin-top: 4px; columns: 2 320px; column-gap: 24px; } .dr-passed .dr-list li { break-inside: avoid; }
.dr-list .dr-na b { color: #98A2B3; }
.as-map { height: 260px; border-radius: 12px; overflow: hidden; }

/* Income by county (escrow page) */
.inc-head { flex-wrap: wrap; gap: 10px; }
.inc-head select { width: auto; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.seg button { font: inherit; font-size: 13px; padding: 6px 12px; border: 0; background: #fff; cursor: pointer; }
.seg button.on { background: var(--ink); color: #fff; }
.inc-body { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(0, 2.2fr); gap: 20px; align-items: start; }
.inc-bars { display: flex; align-items: flex-end; justify-content: space-around; gap: 10px; height: 230px; padding: 0 6px; border-bottom: 1px solid var(--line); }
.inc-col { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 1; max-width: 90px; }
.inc-stack { width: 100%; display: flex; flex-direction: column; border-radius: 6px 6px 0 0; overflow: hidden; }
.inc-stack i, .inc-legend i { display: block; }
.inc-stack .county, .inc-legend .county { background: #2F6FED; } .inc-stack .wts, .inc-legend .wts { background: #0FA68A; } .inc-stack .refund, .inc-legend .refund { background: #F3B8B9; }
.inc-legend { display: flex; gap: 14px; justify-content: center; margin-top: 8px; } .inc-legend span { display: inline-flex; align-items: center; gap: 5px; }
.inc-legend i { width: 10px; height: 10px; border-radius: 2px; }
.inc-table td, .inc-table th { white-space: nowrap; } .inc-total td { border-top: 2px solid var(--line); }
@media (max-width: 900px) { .inc-body { grid-template-columns: minmax(0, 1fr); } }
/* agent summary, compact (Dean, 2026-10-05: less white space, bigger map) */
.as-grid { grid-template-columns: minmax(250px, 0.9fr) minmax(0, 1.3fr) minmax(0, 1.5fr); align-items: stretch; gap: 14px; }
.as-grid.no-map { grid-template-columns: minmax(250px, 0.9fr) minmax(0, 2fr); }
.as-side { gap: 14px; }
.as-card { padding: 14px 16px; }
.as-h { margin: 0 0 8px; padding-bottom: 6px; font-size: 15px; }
.as-ring { width: 92px; height: 92px; } .as-ring span { width: 44px; height: 44px; }
.as-pct { font-size: 28px; } .as-pct-l { margin-bottom: 4px; }
.as-steps { max-height: none; } .as-steps li { padding: 8px 2px; }
.as-fee-row { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.as-fee { font-size: 24px; margin: 0; }
.as-map-card { display: flex; flex-direction: column; }
.as-map { flex: 1; min-height: 360px; height: auto; }
@media (max-width: 1100px) { .as-grid, .as-grid.no-map { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .as-wf { grid-column: auto; order: 0; } .as-map-card { grid-column: 1 / -1; } }
@media (max-width: 640px) { .as-grid, .as-grid.no-map { grid-template-columns: minmax(0, 1fr); } .as-map { min-height: 280px; } }

/* Numbered sections on the agent's form (Dean, 2026-10-05) */
.cf-steps-note { margin: 4px 0 8px; font-size: 14px; }
.cf-tabs { gap: 8px; margin-bottom: 0; }
.cf-tab { display: flex; align-items: center; gap: 10px; padding: 10px 16px 10px 12px; border: 1.5px solid var(--line); border-bottom: 0; border-radius: 14px 14px 0 0;
  background: var(--soft); color: var(--ink); min-width: 170px; text-align: left; }
.cf-tab[aria-selected="true"] { background: #fff; border-color: var(--teal); box-shadow: inset 0 3px 0 var(--teal); }
.cf-num { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px; background: #fff; border: 2px solid #98A2B3; color: #475467; }
.cf-tab[aria-selected="true"] .cf-num { background: var(--teal); border-color: var(--teal); color: #fff; }
.cf-tab.is-done .cf-num { background: var(--green, #12B76A); border-color: var(--green, #12B76A); color: #fff; }
.cf-tab.has-fix .cf-num { background: #D92D20; border-color: #D92D20; color: #fff; }
.cf-tab-t { display: flex; flex-direction: column; line-height: 1.2; } .cf-tab-t b { font-size: 14px; } .cf-tab-t small { font-size: 12px; color: var(--muted); font-weight: 500; }
.cf-tab.has-fix .cf-tab-t small { color: #B42318; font-weight: 700; } .cf-tab.is-done .cf-tab-t small { color: #067647; }
.cf-group { border: 1.5px solid var(--teal); }
.cf-stepof { color: var(--muted); }
@media (max-width: 640px) { .cf-tab { min-width: 0; flex: 1 1 45%; border-radius: 12px; border-bottom: 1.5px solid var(--line); } }
.inc-stack i { position: relative; display: flex; align-items: center; justify-content: center; }
.inc-stack em { font-style: normal; color: #fff; font-weight: 700; font-size: 12px; line-height: 1.05; text-align: center; display: flex; flex-direction: column; }
.inc-stack em small { font-size: 9.5px; font-weight: 600; opacity: .85; text-transform: uppercase; letter-spacing: .03em; }
.inc-col { max-width: 110px; }
/* the income chart stays in its own column whatever the number of years */
.inc-body > div { min-width: 0; }
.inc-bars { overflow: hidden; gap: 6px; }
.inc-col { min-width: 0; max-width: 110px; }
.inc-col > .small { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.inc-stack em { font-size: 11px; overflow: hidden; }

/* Why Submit is greyed out (agent form) */
.cf-wait { display: flex; gap: 12px; align-items: flex-start; margin: 0 0 14px; padding: 12px 16px; border-radius: 12px; background: #FFF8E6; border: 1px solid #F5D08A; }
.cf-wait.done { background: #F0FAF7; border-color: #9FD8CB; }
.cf-wait-i { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: #F5B700; color: #fff; }
.cf-wait.done .cf-wait-i { background: var(--green, #12B76A); }
.cf-wait .small { margin-top: 2px; color: #475467; }
.cf-wait-short { font-size: 12px; font-weight: 700; color: #93600B; }
.btn.test-pay { border: 1.5px dashed #D92D20; color: #B42318; background: #FFF6F6; }
/* Section boxes shaded lightly in their component's status color (Dean, 2026-10-06: easier to tell apart) */
.comp.tint-red .cgroup { --tint: 229, 72, 77; } .comp.tint-yellow .cgroup { --tint: 245, 180, 0; }
.comp.tint-cyan .cgroup { --tint: 0, 184, 204; } .comp.tint-green .cgroup { --tint: 48, 164, 108; }
.comp.tint-red .cgroup, .comp.tint-yellow .cgroup, .comp.tint-cyan .cgroup, .comp.tint-green .cgroup {
  background: rgba(var(--tint), .05); border-color: rgba(var(--tint), .45); }
.comp.tint-red .cgroup-head, .comp.tint-yellow .cgroup-head, .comp.tint-cyan .cgroup-head, .comp.tint-green .cgroup-head {
  background: rgba(var(--tint), .12); border-bottom-color: rgba(var(--tint), .3); }
.comp[class*="tint-"] .crow:hover { background: rgba(255, 255, 255, .6); }
.comp[class*="tint-"] .cgroup.has-att { border-color: #F3B8B9; }
/* Shot-clock bar under job numbers: shrinks left to right as the deadline nears */
.clkbar { display: block; width: 64px; height: 5px; margin-top: 4px; border-radius: 3px; background: #EAECF0; overflow: hidden; }
.clkbar i { display: block; height: 100%; border-radius: 3px; }
.clkbar.clk-green i { background: #30A46C; } .clkbar.clk-yellow i { background: #F5B400; } .clkbar.clk-red i { background: #E5484D; }
.clkbar.clk-grey i { background: #D0D5DD; }
.clkbar.clk-tolled i { background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.55) 0 3px, transparent 3px 6px); opacity: .7; }
.clkbar.clk-over { background: #FDE2E1; } .clkbar.clk-over i { animation: clkpulse 1.6s ease-in-out infinite; }
@keyframes clkpulse { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .clkbar.clk-over i { animation: none; } }

/* Sales overview: a small map at the top right (Dean, 2026-10-06: "map is too big... top right, a quarter size") */
.sales-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 34%); gap: 14px; align-items: start; margin-bottom: 14px; }
.sales-top-l > .card:last-child { margin-bottom: 0 !important; }
.sales-top-l .stat-cards { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.sales-mini { padding: 12px 14px; }
.sales-mini .card-head { margin-bottom: 6px; }
.sales-mini .sales-map-wrap { display: block; }
.sales-mini .sales-map { height: 300px; min-height: 0; }
.map-key { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 6px; color: var(--muted); }
.map-key i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.sales-dlg { width: min(560px, calc(100vw - 32px)); max-height: 80vh; border: 0; border-radius: 16px; padding: 18px; box-shadow: 0 20px 60px rgba(16, 24, 40, .25); }
.sales-dlg::backdrop { background: rgba(16, 24, 40, .35); }
@media (max-width: 900px) { .sales-top { grid-template-columns: minmax(0, 1fr); } }
.research-item { position: relative; padding-right: 28px; }
.research-x { position: absolute; top: 2px; right: 0; width: 24px; height: 24px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; font-size: 13px; }
.research-x:hover { background: #F2F4F7; color: #B42318; }
/* WTS brief pop-up: the width of the brief's page (8 in + margins), zoom and pan (Dean, 2026-10-06) */
.brief-dlg { width: min(940px, calc(100vw - 24px)); height: min(92vh, 1200px); padding: 0; border: 0; border-radius: 14px; overflow: hidden; box-shadow: 0 20px 60px rgba(16,24,40,.3); }
.brief-dlg[open] { display: flex; flex-direction: column; }
.brief-dlg::backdrop { background: rgba(16, 24, 40, .45); }
.brief-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 12px; background: #F4F6F9; border-bottom: 1px solid var(--line); }
.brief-title { flex: 1; min-width: 120px; }
.brief-zoom { display: inline-flex; align-items: center; gap: 4px; } .brief-zoom [data-zl] { min-width: 44px; text-align: center; font-size: 12px; color: var(--muted); }
.brief-actions { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.brief-edit-note { padding: 6px 12px; background: #FFF8E1; border-bottom: 1px solid #F5D78E; }
.brief-frame { flex: 1; width: 100%; border: 0; background: #fff; }
.sales-dlg { width: min(840px, calc(100vw - 32px)); max-height: 88vh; }
.research-proposal { display: grid; gap: 4px; margin: 8px 0; padding: 10px 12px; border: 1px solid #B9E6D3; background: #F2FBF7; border-radius: 10px; }
.research-proposal label { display: flex; gap: 6px; align-items: flex-start; }
.brief-diff { margin: 6px 0; } .brief-diff .del { background: #FDECEC; text-decoration: line-through; padding: 4px 6px; border-radius: 6px; }
.brief-diff .add { background: #E7F7EE; padding: 4px 6px; border-radius: 6px; margin-top: 3px; }
/* A component with problems (Dean, 2026-10-06): the good rows green, the offending ones red; each box's header says
   which it holds (red when anything in it needs attention, green when it's all in) */
.comp.tint-red .cgroup { background: #fff; border-color: #E4C2C2; }
.comp.tint-red .crow.st-done { background: rgba(48, 164, 108, .08); }
.comp.tint-red .crow.st-problem { background: rgba(229, 72, 77, .12); }
.comp.tint-red .crow.st-conditional { background: rgba(245, 180, 0, .14); }
.comp.tint-red .cgroup.has-att > .cgroup-head { background: rgba(229, 72, 77, .14); border-bottom-color: rgba(229, 72, 77, .3); }
.comp.tint-red .cgroup.all-done > .cgroup-head { background: rgba(48, 164, 108, .14); border-bottom-color: rgba(48, 164, 108, .3); }
.comp.tint-red .cgroup.all-done { border-color: rgba(48, 164, 108, .45); }
.comp.tint-red .cgroup:not(.has-att):not(.all-done) > .cgroup-head { background: #F4F6F9; border-bottom-color: #E4E7EC; }

/* Claude's review of a file opens as a pop-up in the middle of the screen, not inside the row (Dean, 2026-10-06:
   "it expands the box down and out of position... perhaps using pop-ups") */
details.dr[open]::before { content: ""; position: fixed; inset: 0; background: rgba(16, 24, 40, .35); z-index: 990; }
details.dr[open] > .dr-body { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 991; width: min(640px, calc(100vw - 32px));
  max-height: 82vh; overflow: auto; background: #fff; border-radius: 14px; padding: 18px 20px 14px; box-shadow: 0 20px 60px rgba(16, 24, 40, .3); text-align: left; }
.pop-x { float: right; margin: -6px -8px 0 8px; width: 28px; height: 28px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 15px; cursor: pointer; }
.pop-x:hover { background: #F2F4F7; color: var(--ink); }
.fixpop-box, .row-menu-box { z-index: 60; }

/* What to fix on an item: a red tag that opens a pop-up on hover or click (Dean, 2026-10-06) */
.fixnote { position: relative; display: inline-block; margin-left: 6px; vertical-align: middle; }
.fixnote > summary { list-style: none; cursor: pointer; font-size: 12px; font-weight: 700; color: #B42318; background: #FEE4E2; border: 1px solid #F8B4AE; border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.fixnote > summary::-webkit-details-marker { display: none; }
.fixnote-box { display: none; position: absolute; left: 0; top: calc(100% + 6px); z-index: 70; width: min(360px, calc(100vw - 40px)); background: #fff; border: 1px solid #F8B4AE;
  border-radius: 12px; padding: 12px 14px; box-shadow: 0 12px 30px rgba(16, 24, 40, .18); font-weight: 400; color: var(--ink); }
.fixnote-box p { margin: 6px 0; }
.fixnote[open] > .fixnote-box, .fixnote:hover > .fixnote-box { display: block; }

/* Build a report: choices on the left, the preview on the right, each scrolling on its own (no long page) */
.rb-layout { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: 14px; align-items: start; }
.rb-panel { display: flex; flex-direction: column; gap: 12px; max-height: calc(100vh - 170px); overflow: auto; position: sticky; top: 12px; }
.rb-sec { display: flex; flex-direction: column; gap: 6px; }
.rb-group summary { cursor: pointer; font-weight: 700; color: var(--muted); padding: 3px 0; }
.rb-field { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 2px 0 2px 4px; }
.rb-field label { display: flex; gap: 6px; align-items: center; }
.rb-preview { min-width: 0; }
.rb-table { overflow: auto; max-height: calc(100vh - 260px); }
.rb-table thead th { position: sticky; top: 0; background: #fff; z-index: 1; }
.rb-saved { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.rb-chip { display: inline-flex; gap: 4px; align-items: center; border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; font-size: 12.5px; }
.rb-chip.on { border-color: var(--green); background: #EAF7F0; }
@media (max-width: 900px) { .rb-layout { grid-template-columns: minmax(0, 1fr); } .rb-panel { position: static; max-height: none; } }

button.cal-ev { width: 100%; border: 0; background: transparent; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.cal-dlg .cal-desc { white-space: pre-wrap; margin-top: 10px; max-height: 50vh; overflow: auto; font-size: 13.5px; line-height: 1.45; }
/* Discuss a finding with Claude (review_chat.js) */
/* the two actions under a finding: matching pill buttons; an open one takes the full row below */
.dr-acts { display: flex; flex-wrap: wrap; gap: 8px; padding: 2px 10px 10px 26px; }
.dr-acts > details { flex: 0 0 auto; }
.dr-acts > details[open] { flex: 1 1 100%; order: 2; }
.dr-acts > details > summary.btn { list-style: none; cursor: pointer; font-weight: 600; }
.dr-acts > details > summary::-webkit-details-marker { display: none; }
.dr-chat > summary.btn { color: var(--teal); border-color: var(--teal); }
.dr-chat > summary.btn:hover, .dr-chat[open] > summary.btn { background: var(--teal); color: #fff; }
.dr-accept > summary.btn { color: var(--green-ink); }
.dr-accept > summary.btn:hover, .dr-accept[open] > summary.btn { background: var(--green-bg); border-color: transparent; }
.dr-acts > details[open] > summary { margin-bottom: 8px; }
.dr-accept > form { padding: 8px 10px; border: 1px solid var(--soft); border-radius: 10px; background: #fbfcfe; }
.dr-chat .dr-thread:empty { display: none; }
li > .dr-chat { margin: 4px 0 6px; }
li > .dr-chat > summary.btn { list-style: none; cursor: pointer; font-weight: 600; color: var(--teal); border-color: var(--teal); }
li > .dr-chat > summary::-webkit-details-marker { display: none; }
.dr-thread { display: flex; flex-direction: column; gap: 6px; max-height: 360px; overflow-y: auto; margin: 4px 0 6px; }
.dr-msg { padding: 6px 9px; border-radius: 10px; max-width: 92%; white-space: pre-wrap; font-size: 13px; }
.dr-msg > b { display: block; color: #667085; font-weight: 600; margin-bottom: 1px; }
.dr-msg.me { align-self: flex-end; background: #E8F0FB; }
.dr-msg.ai { align-self: flex-start; background: #F2F4F7; }
.dr-msg.err { background: #fdecea; color: #a1261b; }
.dr-rev { margin-top: 4px; font-weight: 600; color: #17603C; }
.dr-lesson { margin-top: 6px; padding: 6px 8px; border-radius: 8px; background: #fff; border: 1px dashed #B9C7DA; display: flex; flex-direction: column; gap: 4px; white-space: normal; }
.dr-lesson textarea, .dr-say textarea { width: 100%; font: inherit; font-size: 13px; }
.dr-say { display: flex; flex-direction: column; gap: 4px; }
/* Review popup: "Show the document" puts the file beside the review */
.dr-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; padding-right: 30px; }
.dr-head > b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dr-head .dr-show { flex: 0 0 auto; color: var(--teal); border-color: var(--teal); }
.dr-docpane { display: none; }
details.dr[open] > .dr-body.split { width: min(1500px, calc(100vw - 32px)); height: 88vh; max-height: 88vh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  column-gap: 18px; align-content: start; }
.dr-body.split > * { grid-column: 2; }
.dr-body.split > .pop-x { grid-column: 2; justify-self: end; float: none; grid-row: 1; margin: -6px -8px 0 0; }
.dr-body.split > .dr-head { grid-row: 1; }
.dr-body.split > .dr-docpane { display: block; grid-column: 1; grid-row: 1 / span 40; position: sticky; top: 0; height: calc(88vh - 34px); border: 1px solid var(--soft); border-radius: 10px; overflow: hidden; background: #F2F4F7; }
.dr-docpane iframe, .dr-docpane img { width: 100%; height: 100%; border: 0; display: block; object-fit: contain; }
@media (max-width: 900px) {
  details.dr[open] > .dr-body.split { display: block; height: auto; }
  .dr-body.split > .dr-docpane { position: static; height: 55vh; margin-bottom: 10px; }
}

/* ---------- The review workspace (review_workspace.html; Dean, 2026-10-08: "redesigned for easier use and
   organization"): items | the file | the selected item. Full height, each pane scrolls on its own, nothing floats. */
.page.ws-page { max-width: none; padding: 0; }
.ws [hidden] { display: none !important; }
.ws { display: flex; flex-direction: column; height: calc(100vh - 64px); background: var(--bg); }
/* in place on the job page: the drawers and side cards step aside while a component is reviewed (Dean, 2026-10-08) */
/* in its component's box on the job page: the box's own header names it, so the review's header is just the actions */
.ws.ws-inline { height: calc(100vh - 150px); min-height: 520px; margin: 8px 0 4px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.ws-inline .ws-top { padding: 8px 12px; gap: 10px; }
.ws-inline .ws-title { display: none; }
.ws-inline .ws-main { grid-template-columns: 360px minmax(0, 1fr); }  /* two panes: the items (each opens in place) and the document (Dean, 2026-10-08) */
.ws-it { align-items: start; }
.ws-txt { display: flex; flex-direction: column; min-width: 0; }
.ws-sub { font-size: 12.5px; color: var(--muted); line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.ws-it.on .ws-sub { color: var(--ink); }
.ws-list .ws-pane { margin: 2px 2px 10px 12px; padding: 10px 10px 4px; border-left: 3px solid var(--teal); background: #F7FBFA; border-radius: 0 10px 10px 0; font-size: 13px; }
.ws-list .ws-pane .ws-card { padding: 8px 10px; margin-bottom: 8px; }
.ws-list .ws-pane .ws-answer .ws-val { display: none; }  /* the answer is on the row */
.ws-list .ws-pane .ws-help { margin: 0 0 8px; }
.ws-ai-btn { display: flex; align-items: center; gap: 6px; width: 100%; margin: 0 0 8px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff;
  font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.ws-ai-btn span { margin-left: auto; color: var(--teal); font-weight: 600; }
.ws-ai-btn.v-issues { border-color: #F3B8B9; background: #FFF6F6; } .ws-ai-btn.v-unclear { border-color: #F5D98B; background: #FFFBEB; } .ws-ai-btn.v-ok { border-color: #B7E4C7; }
.ws-doc { position: relative; }
.ws-ai-pop { position: absolute; top: 58px; right: 14px; max-height: calc(100% - 70px); width: min(460px, 75%); z-index: 6; display: flex; flex-direction: column; background: #fff;
  border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px rgba(16, 24, 40, .22); }
.ws-ai-pop[hidden] { display: none !important; }
.ws-ai-head { display: flex; align-items: baseline; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.ws-ai-what { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-ai-head .link { font-size: 16px; }
.ws-ai-body { overflow-y: auto; padding: 10px 12px; min-height: 0; flex: 1; }
.ws-inline .ws-side { padding: 10px 8px; font-size: 13px; }
.ws-inline .ws-side .ws-card { padding: 9px 10px; }
.ws-inline .ws-side .ws-h { font-size: 15px; }
.ws-inline .ws-side .btn { white-space: normal; text-align: left; }
.ws-inline .ws-choice { flex-wrap: wrap; }
.ws-inline .ws-doc-bar .ws-doc-pick { min-width: 0; flex: 1; }
.ws-thumbs.on, .ws-full.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.ws-doc:fullscreen { height: 100vh; padding: 12px 16px; background: var(--bg); }
.ws-doc.ws-max { position: fixed; inset: 0; z-index: 1000; height: auto; padding: 12px 16px; background: var(--bg); }  /* when the browser refuses full screen */
body.ws-maxed { overflow: hidden; }
.ws-inline .ws-comp:not(.here) { display: none; }  /* the other parts are the boxes below */
.ws-inline .ws-comp.here { border: 0; margin: 0; }
.ws-inline .ws-comp.here > .ws-ch { display: none; }
.ws-loading { padding: 18px 4px; }
details.comp[data-review-box] { scroll-margin-top: 76px; }
.comp-review:empty { display: none; }
/* the side column stays, narrower: labels above values, nothing wraps mid-email (Dean, 2026-10-08) */
.jd-layout { grid-template-columns: minmax(0, 1fr) 290px !important; }
.jd-rail .kv { grid-template-columns: minmax(0, 1fr); gap: 0; font-size: 13.5px; }
.jd-rail .kv dt { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); margin-top: 8px; }
.jd-rail .kv dt:first-child { margin-top: 0; }
.jd-rail .kv dd a[href^="mailto:"] { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; overflow-wrap: normal; }
.jd-rail .card { padding: 12px 14px; }
@media (max-width: 1100px) { .jd-layout { grid-template-columns: minmax(0, 1fr) !important; } }
.ws-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 10px 18px; background: #fff; border-bottom: 1px solid var(--line); }
.ws-title { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.ws-title b { font-size: 17px; }
.ws-progress { color: var(--muted); }
.ws-acts { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.ws-other { font-family: var(--mono); font-weight: 600; padding: 3px 8px; border-radius: 6px; background: var(--soft); color: var(--muted); }
.ws-other:hover { background: #E2E7EE; text-decoration: none; }
.ws-pop { position: relative; }
.ws-pop > summary { list-style: none; cursor: pointer; } .ws-pop > summary::-webkit-details-marker { display: none; }
.ws-pop-box { position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; width: 280px; gap: 8px; padding: 12px; background: #fff;
  border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 30px rgba(16, 24, 40, .16); }
.ws-pop-box label { display: flex; flex-direction: column; gap: 4px; }

.ws-main { flex: 1; min-height: 0; display: grid; grid-template-columns: 280px minmax(0, 1fr) minmax(360px, 430px); }
.ws-list, .ws-side { overflow-y: auto; min-height: 0; }
.ws-list { background: #fff; border-right: 1px solid var(--line); padding: 10px 8px 16px; }
.ws-filter { display: flex; gap: 4px; padding: 3px; margin: 0 4px 10px; background: var(--soft); border-radius: 10px; }
.ws-filter button { flex: 1; border: 0; background: none; border-radius: 8px; padding: 6px 4px; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--muted); cursor: pointer; }
.ws-filter button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(16, 24, 40, .1); }
.ws-comp { margin: 0 2px 8px; border: 1px solid var(--line); border-radius: 12px; background: #fff; overflow: hidden; }
.ws-comp.here { border-color: var(--teal); }
.ws-comp > .ws-ch { display: flex; align-items: center; gap: 8px; padding: 8px 10px; cursor: pointer; list-style: none; background: var(--soft); }
.ws-comp.tint-yellow > .ws-ch { background: var(--yellow-bg); } .ws-comp.tint-green > .ws-ch { background: var(--green-bg); } .ws-comp.tint-red > .ws-ch { background: var(--red-bg); } .ws-comp.tint-cyan > .ws-ch { background: #E1F7FA; }
.ws-comp > .ws-ch::-webkit-details-marker, .ws-group > .ws-gh::-webkit-details-marker { display: none; }
.ws-comp > .ws-ch::before, .ws-group > .ws-gh > span:first-child::before { content: "▸"; display: inline-block; width: 10px; margin-right: 6px; color: var(--faint); transition: transform .12s; }
.ws-comp[open] > .ws-ch::before, .ws-group[open] > .ws-gh > span:first-child::before { transform: rotate(90deg); }
.ws-ct { display: flex; flex-direction: column; min-width: 0; font-weight: 600; font-size: 13.5px; line-height: 1.25; }
.ws-ct small { font-weight: 500; font-size: 11.5px; color: var(--muted); }
.ws-comp > :not(summary) { margin-left: 4px; margin-right: 4px; }
.ws-comp > :last-child:not(summary) { margin-bottom: 6px; }
.ws-none { padding: 8px 10px; margin: 0; }
.ws-group > .ws-gh { cursor: pointer; list-style: none; }
a.ws-it { text-decoration: none; }
.ws-gh { display: flex; justify-content: space-between; padding: 10px 10px 4px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
/* Each item is a card: name, the file (or answer), and its state in words on the right (Dean, 2026-10-14) */
.ws-it { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 8px; width: 100%; margin: 0 0 6px; padding: 8px 10px;
  border: 1px solid var(--line); border-left: 4px solid #CBD2DC; border-radius: 10px; background: #fff;
  font: inherit; font-size: 13.5px; text-align: left; color: var(--ink); cursor: pointer; }
.ws-it:hover { border-color: #AEB8C6; background: #FAFBFC; }
.ws-it.on { background: #E6F6F2; border-color: var(--teal); box-shadow: 0 0 0 1px var(--teal); }
.ws-it.st-done, .ws-it.st-relief { border-left-color: var(--green); }
.ws-it.st-filed { border-left-color: #6B8FD6; }
.ws-it.st-problem { border-left-color: var(--red); }
.ws-it.st-conditional { border-left-color: #E0A800; }
.ws-it.st-look { border-left-color: #E0A800; }
.ws-it .ws-lab { font-weight: 600; white-space: normal; }
.ws-files { display: flex; flex-direction: column; gap: 4px; margin-top: 5px; }
.ws-offform { margin-top: 14px; padding-top: 10px; border-top: 2px dashed #C9CFD8; }
.ws-offform > .ws-gh { color: #6B7280; }
.ws-offnote { margin: 2px 4px 8px; color: #6B7280; }
.ws-chip { display: flex; align-items: center; gap: 7px; min-width: 0; padding: 5px 8px; border: 1px solid #C9D6EE; border-radius: 7px; background: #F3F7FE; color: #1F3F7A; font-weight: 500; }
.ws-chip[data-show] { cursor: pointer; }
.ws-chip[data-show]:hover { border-color: #8FA9DA; }
.ws-chip.on { border-color: #1F3F7A; box-shadow: inset 0 0 0 1px #1F3F7A; background: #E3ECFB; }
.ws-file-ic { flex: none; font-size: 9.5px; font-weight: 800; letter-spacing: .04em; padding: 2px 4px; border-radius: 4px; background: #C8352F; color: #fff; }
.ws-file-nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }  /* one line; the full name is in the tooltip */
.ws-nofile { display: inline-block; align-self: flex-start; margin-top: 5px; padding: 3px 8px; border: 1px dashed #C2CAD5; border-radius: 7px; font-size: 12px; color: var(--muted); }
.ws-sub.ws-val-on { color: var(--ink); margin-top: 2px; }
.ws-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.ws-state { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; background: var(--soft); color: var(--muted); }
.st-done .ws-state, .st-relief .ws-state { background: var(--green-bg); color: var(--green-ink); }
.st-filed .ws-state { background: #E8F0FB; color: #1F4FA8; }
.st-problem .ws-state { background: var(--red-bg); color: var(--red-ink); }
.st-conditional .ws-state { background: var(--yellow-bg); color: var(--yellow-ink); }
.st-look .ws-state { background: var(--yellow-bg); color: var(--yellow-ink); }
.ws-it.st-reviewing { border-left-color: var(--teal); }
.st-reviewing .ws-state { background: #E6F6F2; color: #0B6E5F; }
.ws-tick b { font-variant-numeric: tabular-nums; }
.ws-tick { display: inline-flex; align-items: center; gap: 3px; }
.ws-clock { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; vertical-align: -2px; }
.ws-hand { transform-origin: 8px 8px; animation: ws-tick 4s steps(8) infinite; }
@keyframes ws-tick { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ws-hand { animation: none; } }
.ws-tick.done .ws-clock { display: none; }
.ws-tick.done b { font-weight: 700; }
.ws-lab { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-mark { font-weight: 700; text-align: center; color: var(--faint); }
.st-done .ws-mark, .st-relief .ws-mark, .ws-mark.st-done, .ws-mark.st-relief { color: var(--green); }
.st-problem .ws-mark, .ws-mark.st-problem { color: var(--red); }
.st-conditional .ws-mark, .ws-mark.st-conditional { color: var(--yellow-ink); }
.ws-badges { display: flex; gap: 3px; }
.ws-queue { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; background: var(--teal); color: #fff; cursor: pointer; }
.ws-queue:hover, .ws-queue:focus-visible { background: var(--teal-dark); outline: none; }
.ws-badges i { font-style: normal; font-size: 11px; font-weight: 700; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; }
.b-note { background: var(--red-bg); color: var(--red-ink); } .b-rel { background: #E8F0FB; color: #1F4FA8; } .b-cond { background: var(--yellow-bg); color: var(--yellow-ink); }
.b-ai.v-ok { background: var(--green-bg); color: var(--green-ink); } .b-ai.v-issues { background: var(--red-bg); color: var(--red-ink); }
.b-ai.v-unclear { background: var(--yellow-bg); color: var(--yellow-ink); } .b-ai.v-working { background: var(--soft); color: var(--muted); }
.ws.only-att .ws-it:not([data-att="1"]):not(.on) { display: none; }
.ws.only-att .ws-group:not(:has(.ws-it[data-att="1"], .ws-it.on)) { display: none; }
.ws.only-att .ws-comp:not(.here):not(:has(.ws-it[data-att="1"])) { display: none; }
.ws-keys { padding: 12px 10px 0; margin: 0; }
.ws-list .cfix { margin: 0 6px 8px; }

.ws-doc { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 10px 12px; gap: 8px; }
.ws-doc-bar { display: flex; align-items: center; gap: 10px; }
.ws-doc-pick { max-width: 100%; min-width: 0; flex: 0 1 auto; }
.ws-doc-view { flex: 1; min-height: 0; background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: auto; display: flex; }
.ws-doc-view iframe { flex: 1; width: 100%; height: 100%; border: 0; border-radius: 12px; }
.ws-doc-view img { max-width: 100%; height: auto; margin: auto; display: block; }
.ws-empty { margin: auto; padding: 40px; color: var(--muted); text-align: center; }

.ws-side { background: #fff; border-left: 1px solid var(--line); padding: 16px 18px 40px; }
.ws-pane { display: flex; flex-direction: column; gap: 12px; }
.ws-h { display: flex; gap: 8px; align-items: baseline; margin: 0; font-size: 18px; line-height: 1.3; }
.ws-help { margin: -6px 0 0; }
.ws-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.ws-cap { display: flex; gap: 8px; align-items: center; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.ws-verdict { margin-left: auto; text-transform: none; letter-spacing: 0; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--soft); color: var(--muted); }
.ws-ai.v-ok .ws-verdict { background: var(--green-bg); color: var(--green-ink); }
.ws-ai.v-issues .ws-verdict { background: var(--red-bg); color: var(--red-ink); }
.ws-ai.v-unclear .ws-verdict { background: var(--yellow-bg); color: var(--yellow-ink); }
.ws-val { font-size: 15px; font-weight: 600; white-space: pre-wrap; }
.ws-file { display: flex; align-items: center; gap: 6px; } .ws-file.supp { padding-left: 18px; }
.ws-file .link { display: inline-flex; align-items: center; gap: 6px; text-align: left; }
.ws-sum { margin: 0; color: var(--muted); }
.ws-fold > summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); padding: 2px 0; }
.ws-fold[open] > summary { margin-bottom: 8px; }
.ws-side .dr-f { border: 1px solid #F3B8B9; border-radius: 10px; background: #FFFBFB; }
.ws-side .dr-f.dr-unclear { border-color: #F5D08A; background: #FFFDF5; }
.ws-side .dr-f.dr-pass { border-color: #B7E1C8; background: #F6FCF8; }
.ws-side .dr-fh { padding: 9px 12px 2px; font-weight: 600; }
.ws-side .dr-f.dr-fail .dr-fh b { color: #c0392b; } .ws-side .dr-f.dr-unclear .dr-fh b { color: #b07800; } .ws-side .dr-f.dr-pass .dr-fh b { color: var(--green); }
.ws-side .dr-detail { padding: 2px 12px 8px 12px; color: #475467; }
.ws-side .dr-acts { padding: 0 12px 12px 12px; gap: 6px; }
.ws-side .dr-thread { max-height: none; }
.ws-side .dr-msg { max-width: 100%; }
.ws-side .dr-list { columns: auto; }
.ws-choice { display: flex; flex-wrap: wrap; gap: 6px; }
.ws-choice .btn.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.ws-form { gap: 8px; padding: 10px 12px; background: #FAFBFC; border: 1px solid var(--soft); border-radius: 10px; }
.ws-form label { display: flex; flex-direction: column; gap: 4px; }
.ws-form textarea, .ws-form input:not([type=checkbox]):not([type=radio]), .ws-form select, .ws-card textarea { width: 100%; }
.ws-tag { font-size: 13px; padding: 6px 10px; border-radius: 8px; }
.ws-tag.t-note { background: var(--red-bg); } .ws-tag.t-rel { background: #E8F0FB; } .ws-tag.t-cond { background: var(--yellow-bg); }
@media (max-width: 1200px) { .ws-main { grid-template-columns: 210px minmax(0, 1fr) 350px; } }
@media (max-width: 900px) {
  .ws { height: auto; } .ws-main { grid-template-columns: minmax(0, 1fr); }
  .ws-list { max-height: 40vh; border-right: 0; border-bottom: 1px solid var(--line); }
  .ws-doc { height: 70vh; } .ws-side { border-left: 0; }
}

/* the job page's component lists: an overview that opens the workspace at an item */
.crow.ws-link { cursor: pointer; grid-template-columns: 16px minmax(150px, 40%) minmax(0, 1fr); }
.crow.ws-link:hover { background: rgba(15, 166, 138, .06); }
a.dr-go { display: inline-block; margin-left: 6px; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: #eef1f6; color: #4a5568; vertical-align: top; }
a.dr-go:hover { text-decoration: none; filter: brightness(.96); }
a.dr-go.dr-ok { background: #e7f6ec; color: #17603C; } a.dr-go.dr-issues { background: #fdecea; color: #a1261b; } a.dr-go.dr-unclear { background: #fff4d6; color: #8a5a00; }

/* Job page, WTS: each component is a summary that opens the review workspace (Dean, 2026-10-08: "just use this page") */
.comp-sum { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 4px 0 8px; }
.comp-att { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.comp-att a { font-size: 13px; padding: 3px 10px; border-radius: 999px; background: var(--red-bg); color: var(--red-ink); text-decoration: none; }
.comp-att a.cond { background: var(--yellow-bg); color: var(--yellow-ink); }
.comp-att a:hover { filter: brightness(.96); }
.ws-scope { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 8px 0; }
.ws-gh { gap: 6px; } .ws-gh > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .ws-gh > span:last-child { flex: none; }
.ws-list .ws-group > summary.ws-gh { flex-wrap: nowrap; }
.ws-it [data-ai] { cursor: pointer; } .ws-it [data-ai]:hover { outline: 2px solid currentColor; outline-offset: 1px; }
.b-ai.v-none { background: var(--soft); color: var(--faint); }

/* Invoices page (Dean, 2026-10-09): selection total on top, paid invoices folded by year */
.pay-bar{position:sticky;top:64px;z-index:5;background:var(--card);display:flex;gap:14px;flex-wrap:wrap;align-items:center;padding:8px 0 10px;margin-bottom:6px;border-bottom:1px solid var(--line)}
.pay-sel{font-size:15px;padding:6px 12px;border-radius:8px;background:var(--soft);white-space:nowrap}
.pay-sel.on{background:var(--green-bg);color:var(--green-ink)}
.pay-sel [data-sum]{font-size:17px}
.inv-year{border-top:1px solid var(--line)}
.inv-year > summary{display:flex;gap:14px;align-items:baseline;padding:10px 4px;cursor:pointer}
.inv-year > summary .inv-year-sum{margin-left:auto}
.inv-year[open] > summary{border-bottom:1px solid var(--line)}
.inv-qb > summary{cursor:pointer}
.inv-year > summary, .inv-qb > summary{list-style:none}
.inv-year > summary::-webkit-details-marker, .inv-qb > summary::-webkit-details-marker{display:none}
.inv-year > summary::before, .inv-qb > summary::before{content:"▸";color:var(--muted);transition:transform .15s;display:inline-block}
.inv-year[open] > summary::before, .inv-qb[open] > summary::before{transform:rotate(90deg)}
.inv-qb > summary{display:flex;gap:10px;align-items:center}
.inv-qb > summary{justify-content:flex-start}.inv-qb > summary > .pill, .inv-qb > summary > span:last-child{margin-left:auto}
/* Invoices folded into Finance's Income by county card (Dean, 2026-10-09) */
.inv-fold{margin:-4px 0 14px;border-bottom:1px solid var(--line)}
.inv-fold > summary{display:flex;gap:12px;align-items:baseline;cursor:pointer;list-style:none;padding:4px 0 12px}
.inv-fold > summary::-webkit-details-marker{display:none}
.inv-fold > summary::before{content:"▸";color:var(--muted);display:inline-block;transition:transform .15s}
.inv-fold[open] > summary::before{transform:rotate(90deg)}
.inv-fold > summary h2{margin:0}
.inv-body{padding-bottom:10px}
.inv-sec{margin-bottom:14px}
.inv-sec .card-head h3{margin:0}
.inv-fold .pay-bar{top:64px}
/* Same chevron as the job page's component boxes (Dean, 2026-10-09: "bigger and colored to match the others") */
.inv-fold > summary::before, .inv-year > summary::before, .inv-qb > summary::before { content: ""; flex: none; width: 26px; height: 26px; border-radius: 8px; background: var(--soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23101828' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l6 6-6 6'/%3E%3C/svg%3E") center no-repeat; transition: transform .15s, background-color .15s; }
.inv-fold[open] > summary::before, .inv-year[open] > summary::before, .inv-qb[open] > summary::before { transform: rotate(90deg); background-color: #E3F5F0; }
.inv-fold > summary, .inv-year > summary { align-items: center; }
/* A file nobody has checked yet: not a green check (Dean, 2026-10-09) */
.st-filed .ws-mark, .crow.st-filed .cmark { color: var(--muted); }

/* Finance: the stat cards in one short row (Dean, 2026-10-12: "too large... could be presented in much less space") */
.stat-cards.slim { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-bottom: 12px; }
.stat-cards.slim .card { padding: 7px 12px; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; }
.stat-cards.slim .card > :first-child { grid-column: 2; grid-row: 1; line-height: 1.2; }
.stat-cards.slim .n { grid-column: 1; grid-row: 1 / span 2; font-size: 20px; line-height: 1; }
.stat-cards.slim .card > :last-child { grid-column: 2; grid-row: 2; font-size: 11.5px; line-height: 1.25; }

/* Finance → Books (permits/qbo_books.py) */
.bk-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.bk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.bk-card { border: 1px solid var(--line, #e3e7ee); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.bk-card h3 { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 0 4px; font-weight: 700; }
.bk-card h4 { font-size: 12px; margin: 10px 0 2px; color: var(--muted); font-weight: 600; }
.bk-n { font-size: 20px; font-weight: 800; margin-bottom: 6px; }
.bk-chg { font-size: 12px; font-weight: 600; }
.bk-chg.up { color: #1E9E57; } .bk-chg.down { color: #C2410C; }
.bk-list { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.bk-list td { padding: 2px 0; vertical-align: top; }
.bk-list td.num { text-align: right; white-space: nowrap; padding-left: 8px; font-variant-numeric: tabular-nums; }
.bk-list td.bad { color: #C2410C; }
.bk-list tr.tot td { border-top: 1px solid var(--line, #e3e7ee); font-weight: 700; }
.bk-bars { display: flex; align-items: flex-end; gap: 4px; height: 80px; }
.bk-bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 2px; }
.bk-bar i { display: block; width: 100%; min-height: 2px; background: #1FA37A; border-radius: 3px 3px 0 0; }
.bk-bar span { font-size: 10px; color: var(--muted); }
.bk-line { width: 100%; height: 80px; display: block; }
.bk-line polyline { fill: none; stroke: #1FA37A; stroke-width: 2; vector-effect: non-scaling-stroke; }
.bk-line .z { stroke: var(--line, #e3e7ee); stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.bk-axis { display: flex; justify-content: space-between; }
.bk-age { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--line, #e3e7ee); margin-bottom: 6px; }
.bk-age i, .bk-dot { display: inline-block; height: 100%; }
.bk-dot { width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; vertical-align: 0; }
.a0 { background: #1FA37A; } .a1 { background: #8FD3B8; } .a2 { background: #F2B544; } .a3 { background: #E8833A; } .a4 { background: #C2410C; }
.bk-who summary { cursor: pointer; color: #2F6FED; margin-top: 4px; }
/* Send back: what Claude found, ticked to go in the same email */
.sb-flag { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px 10px; margin: 0; max-height: 220px; overflow-y: auto; }
.sb-flag legend { padding: 0 4px; }
.sb-flag-it { display: grid; grid-template-columns: 18px 1fr; gap: 6px; align-items: start; line-height: 1.35; }

.crow.st-look .cmark { color: var(--yellow-ink); }
.cf-heights { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cf-heights input { width: 120px; max-width: 120px; }
/* tower loading gauge (permits/tower_loading.py) */
.ld-card .ld-row { display: grid; gap: 4px; margin: 6px 0 10px; }
.ld-top { display: flex; align-items: baseline; gap: 8px; }
.ld-pct { font-size: 22px; font-weight: 700; }
.ld-bar { position: relative; height: 12px; border-radius: 6px; background: #E8ECF2; overflow: hidden; }
.ld-fill { position: absolute; inset: 0 auto 0 0; border-radius: 6px; background: var(--green, #1F9D55); }
.ld-near .ld-fill { background: #E0A800; } .ld-over .ld-fill { background: #D64545; }
.ld-near .ld-pct { color: #9A6B00; } .ld-over .ld-pct { color: #B42318; }
.ld-100 { position: absolute; top: 0; bottom: 0; left: 83.333%; width: 2px; background: #5B6472; }
.ld-hist .ld-row { margin: 4px 0 6px; } .ld-hist .ld-pct { font-size: 15px; } .ld-hist .ld-bar { height: 8px; }
.ld-compare { padding: 4px 0 8px; border-bottom: 1px solid var(--line, #E3E7EE); margin-bottom: 8px; }
.ld-mini { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; white-space: nowrap; }
.ld-mini .ld-bar { width: 64px; height: 7px; border-radius: 4px; }
.ld-mini.ld-near b { color: #9A6B00; } .ld-mini.ld-over b { color: #B42318; }
.ld-people { margin-top: 4px; display: flex; align-items: center; gap: 6px; }
.ws-ld { display: block; margin-top: 4px; }
td .ld-mini { display: flex; margin-top: 4px; }
/* Invoice pills sit on one line across the timeline, pinned to the bottom of each step. "Pending" until sent, then
   the date sent, then the date paid; the color says which (Dean, 2026-10-23). */
.stepper .step-invoice { margin-top: auto; padding-top: 4px; }
.inv-pill { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 11px; font-weight: 600; line-height: 1;
  font-family: inherit; border: 1px solid transparent; text-decoration: none; white-space: nowrap; cursor: pointer; }
.inv-pill:hover { text-decoration: none; filter: brightness(.96); }
.inv-pill.white { background: #fff; color: var(--muted); border-color: #D0D5DD; cursor: default; }
.inv-pill.white:hover { filter: none; }
.inv-pill.orange { background: #FDEBD8; color: #8A4B00; }
.inv-pill.cyan { background: #D9F7FA; color: #0B6470; }
.inv-pill.yellow { background: #FEF4D6; color: #7A5A00; }
.inv-pill.red { background: #FDE8E7; color: #A3161B; }
.inv-pill.green { background: #E1F5EA; color: #17603C; }
.inv-pill.grey { background: #F2F4F7; color: #667085; }

/* Report drafts: sent-by-month grid */
.rs-grid th.rs-month { white-space: nowrap; vertical-align: bottom; }
.rs-grid .rs-sum { font-weight: 400; text-transform: none; letter-spacing: 0; }
.rs-grid td.rs-cell { white-space: nowrap; }
.rs { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; text-decoration: none; }
.rs-sent { background: var(--green-bg); color: var(--green-ink); }
.rs-draft { background: var(--yellow-bg); color: var(--yellow-ink); }
.rs-missing { background: var(--red-bg); color: var(--red-ink); }
.rs-t-draft { color: var(--yellow-ink); font-weight: 600; }
.rs-t-missing { color: var(--red-ink); font-weight: 600; }
/* Job page map: the tower's current loading and a link to its record (Dean, 2026-11-03) */
.jd-map-tower { position: absolute; top: 6px; right: 6px; z-index: 4; display: flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px;
  background: var(--card); box-shadow: 0 1px 3px rgba(0, 0, 0, .25); font-size: 11px; white-space: nowrap; }
.jd-map-tower a { font-weight: 600; }
.jd-map.max .jd-map-tower { display: none; }

/* Hearing date / time / place: notices page, Notice & hearing drawer, timeline popover (Dean, 2026-11-12) */
.hearing-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin: 6px 0 10px; }
.hearing-form label { display: flex; flex-direction: column; gap: 2px; font-size: 11px; font-weight: 600; color: var(--muted); }
.hearing-form .hf-body { flex: 1 1 220px; } .hearing-form .hf-addr { flex: 2 1 280px; }
.hearing-form input { font-size: 13px; }
.notice-hearing { margin-bottom: 14px; }
.stepper .step-hear { position: relative; margin-top: 4px; }
.stepper .step-hear > summary { list-style: none; cursor: pointer; display: inline-block; }
.stepper .step-hear > summary::-webkit-details-marker { display: none; }
.stepper .step-hear-pop { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; width: min(560px, 86vw); background: #fff;
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; box-shadow: 0 10px 30px rgba(16,24,40,.16); }
.stepper .step-hear-pop .hearing-form { margin: 0; }
.stepper .step-hear > summary.inv-pill.white { cursor: pointer; border-style: dashed; }
.stepper .step-hear > summary.inv-pill.white:hover { background: var(--soft); }

/* Adjacent-owner notices: the mini timeline (Dean, 2026-11-25) */
.nsteps { margin-bottom: 12px; }
.nsteps .stepper li > .inv-pill { align-self: flex-start; margin-top: 2px; }
.nsteps .step-action form.inline { display: inline; }
.nsteps-drawers .drawer { margin-bottom: 12px; }
.nsteps-drawers .drawer-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; margin-bottom: 10px; }
.nsteps-drawers .drawer-head h2 { font-size: 16px; margin: 0; }
.nsteps-drawers .drawer-head [data-nclose] { margin-left: auto; }
