/* TenderDesk — plain, legible business UI. Brand colour comes from /c/<slug>/brand.css. */
:root {
  --brand: #1F3C88;
  --on-brand: #FFFFFF;
  --ink: #16181D;
  --ink-2: #4A5060;
  --ink-3: #6B7280;
  --line: #E3E6EC;
  --line-2: #D2D6DE;
  --bg: #F6F7F9;
  --card: #FFFFFF;
  --link: #1D4ED8;
  --good: #15803D;
  --good-bg: #ECFDF3;
  --warn: #9A5B00;
  --warn-bg: #FFF7E6;
  --bad: #B42318;
  --bad-bg: #FEF3F2;
  --info-bg: #EFF4FF;
  --radius: 6px;
  --focus: 0 0 0 3px rgba(29, 78, 216, .35);
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "Courier New", monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.55 var(--font); color: var(--ink); background: var(--bg); min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--link); }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 3px; }
h1 { font-size: 26px; line-height: 1.25; margin: 0 0 16px; font-weight: 600; }
h2 { font-size: 18px; margin: 0 0 12px; font-weight: 600; }
h3 { font-size: 15px; margin: 20px 0 8px; font-weight: 600; }
p { margin: 0 0 12px; }
.lead { color: var(--ink-2); max-width: 70ch; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; white-space: nowrap !important; border: 0 !important; }
.skip { position: absolute; left: -9999px; top: 8px; background: #fff; padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- top bar */
.support-banner { background: #7A2E0E; color: #fff; padding: 8px 20px; font-size: 14px; text-align: center; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 20px; height: 56px; background: var(--brand); color: var(--on-brand); position: sticky; top: 0; z-index: 20; }
.topbar a, .topbar summary { color: var(--on-brand); }
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 14px; min-width: 0; }
.product { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; white-space: nowrap; }
.product-mark { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 6px; background: rgba(255,255,255,.18); font-size: 13px; letter-spacing: .5px; font-weight: 700; }
body:not(.has-tenant) .product-mark { background: var(--brand); color: #fff; }
.topbar .product-mark { background: color-mix(in srgb, var(--on-brand) 18%, transparent); }
.toplink { text-decoration: none; font-weight: 500; padding: 6px 10px; border-radius: 6px; }
.toplink:hover { background: color-mix(in srgb, var(--on-brand) 12%, transparent); }
details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
.switcher, .usermenu { position: relative; }
.switcher summary, .usermenu summary { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 6px; min-width: 0; }
.switcher summary:hover, .usermenu summary:hover { background: color-mix(in srgb, var(--on-brand) 12%, transparent); }
.switcher-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 34vw; }
.avatar { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: color-mix(in srgb, var(--on-brand) 22%, transparent); font-size: 12px; font-weight: 700; }
.menu { position: absolute; top: calc(100% + 6px); left: 0; min-width: 260px; background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 30px rgba(16, 24, 40, .14); padding: 6px; z-index: 30; }
.menu-right { left: auto; right: 0; }
.menu-label { font-size: 12px; color: var(--ink-3); padding: 6px 10px 4px; margin: 0; overflow: hidden; text-overflow: ellipsis; }
.menu .menu-item { display: flex; justify-content: space-between; gap: 12px; width: 100%; text-align: left; padding: 8px 10px; border-radius: 6px; color: var(--ink); text-decoration: none; font: inherit; background: none; border: 0; cursor: pointer; }
.menu .menu-item:hover { background: var(--bg); }
.menu .menu-item.current { background: var(--info-bg); font-weight: 600; }
.menu .menu-item.muted { color: var(--ink-3); }
.menu-meta { color: var(--ink-3); font-size: 12px; white-space: nowrap; }

/* ---------- shell */
.shell { flex: 1; display: flex; width: 100%; max-width: 1400px; margin: 0 auto; }
.sidenav { width: 210px; flex: none; padding: 24px 12px; display: flex; flex-direction: column; gap: 2px; }
.sidenav a { display: block; padding: 8px 12px; border-radius: 6px; color: var(--ink-2); text-decoration: none; font-weight: 500; }
.sidenav a:hover { background: #fff; color: var(--ink); }
.sidenav a.active { background: #fff; color: var(--ink); box-shadow: inset 3px 0 0 var(--brand); }
.sidenav-role { margin-top: 16px; padding: 0 12px; font-size: 12px; color: var(--ink-3); }
.main { flex: 1; min-width: 0; padding: 28px 28px 48px; }
.main.narrow { max-width: 760px; margin: 0 auto; }
.footer { text-align: center; padding: 18px; color: var(--ink-3); font-size: 12px; }

/* ---------- cards and layout */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 18px; }
.card-danger { border-color: #F4C7C2; }
.center-card { text-align: center; margin-top: 40px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; }
.page-head h1 { margin-bottom: 4px; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: 12px; color: var(--ink-3); margin: 0 0 4px; font-weight: 600; }
.crumbs { margin: 0 0 6px; font-size: 13px; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; }
.stat-value { font-size: 26px; font-weight: 600; line-height: 1.2; }
.stat-label { color: var(--ink-3); font-size: 13px; }

/* ---------- forms */
.form label, .inline-form label { display: block; font-weight: 600; margin: 12px 0 4px; font-size: 14px; }
.form label:first-of-type { margin-top: 0; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=time], input[type=date], input[type=datetime-local], input[type=url], input[type=search], input:not([type]), select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--line-2); border-radius: 6px; padding: 9px 11px; min-height: 40px;
}
input:disabled { background: var(--bg); color: var(--ink-3); }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--link); box-shadow: var(--focus); outline: none; }
.help { color: var(--ink-3); font-size: 13px; margin: 4px 0 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 18px; }
.grid-2 > div, .grid-3 > div { margin-top: 8px; }
.grid-2 label, .grid-3 label { margin-top: 0; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.inline-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.inline-form label { margin: 0 0 4px; width: 100%; }
.inline-form input, .inline-form select { width: auto; flex: 1 1 200px; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-weight: 600; font-size: 14px; margin-bottom: 6px; padding: 0; }
.check-field .check-label, .form .check-label { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; margin: 6px 0; }
.check-label input { margin-top: 4px; width: 16px; height: 16px; flex: none; }
.radio-field { display: grid; gap: 8px; margin-bottom: 12px; }
.radio-card { display: flex !important; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; font-weight: 400 !important; margin: 0 !important; cursor: pointer; }
.radio-card:has(input:checked) { border-color: var(--brand); background: var(--info-bg); }
.radio-card input { margin-top: 4px; }
.color-row { display: flex; align-items: center; gap: 10px; }
.color-row input[type=color] { width: 52px; height: 40px; padding: 2px; border: 1px solid var(--line-2); border-radius: 6px; background: #fff; }
.code-input { max-width: 180px; letter-spacing: .2em; font-size: 18px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }

/* ---------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600; padding: 9px 16px; min-height: 40px; border-radius: 6px; border: 1px solid var(--line-2); background: #fff; color: var(--ink); text-decoration: none; cursor: pointer; margin-top: 14px; }
.inline-form .btn, .btn-row .btn, td .btn, .copyable .btn, .pager .btn { margin-top: 0; }
.btn:hover { background: var(--bg); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: color-mix(in srgb, var(--brand) 86%, #000); }
.btn-danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-danger:hover { background: #912018; }
.btn-quiet { border-color: transparent; color: var(--ink-2); }
.btn-small { padding: 5px 10px; min-height: 32px; font-size: 13px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: progress; }
.as-link { background: none; border: 0; }

/* ---------- alerts and tags */
.alert { border-radius: var(--radius); padding: 12px 14px; margin-bottom: 16px; border: 1px solid; }
.alert p:last-child { margin-bottom: 0; }
.alert-success { background: var(--good-bg); border-color: #ABEFC6; }
.alert-error { background: var(--bad-bg); border-color: #FECDCA; }
.alert-warning { background: var(--warn-bg); border-color: #FEDF89; }
.alert-info { background: var(--info-bg); border-color: #C7D7FE; }
.copyable { display: flex; gap: 8px; margin-top: 8px; }
.copyable input { flex: 1; font-size: 13px; }
.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: #EEF0F3; color: var(--ink-2); white-space: nowrap; }
.tag-good { background: var(--good-bg); color: var(--good); }
.tag-bad { background: var(--bad-bg); color: var(--bad); }
.tag-warn { background: var(--warn-bg); color: var(--warn); }
.tag-demo { background: #F4EBFF; color: #6941C6; }
.topbar .tag-demo { background: rgba(255,255,255,.9); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.dot-good { background: var(--good); }
.status-line { display: flex; align-items: center; gap: 8px; margin: 0; }

/* ---------- tables */
.table-wrap { position: relative; overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table thead th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); font-weight: 600; background: #FAFBFC; }
.table tbody tr:hover { background: #FAFBFC; }
.row-muted td { color: var(--ink-3); }
.actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.matrix td { text-align: center; }
.matrix th[scope=row] { font-weight: 400; }
.matrix .group-row th { background: var(--bg); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
.matrix td.changed { background: var(--warn-bg); }
.matrix input { width: 18px; height: 18px; }
.pager { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }

/* ---------- lists */
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px; margin: 0 0 12px; }
.facts dt { font-size: 12px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }
.facts dd { margin: 0; }
.plain { list-style: none; margin: 0; padding: 0; }
.plain li { padding: 4px 0; }
.list-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.list-card { display: flex; justify-content: space-between; gap: 12px; padding: 16px 18px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); }
.list-card:hover { border-color: var(--brand); }
.list-card-title { font-weight: 600; }
.list-card-meta { color: var(--ink-3); }
.checklist { list-style: none; padding: 0; margin: 12px 0 0; }
.checklist li { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.checklist .check { width: 22px; height: 22px; border: 2px solid var(--line-2); border-radius: 50%; display: inline-grid; place-items: center; font-size: 13px; flex: none; }
.checklist li.done { color: var(--ink-3); }
.checklist li.done .check { background: var(--good); border-color: var(--good); color: #fff; }
.progress { height: 8px; background: #EEF0F3; border-radius: 999px; overflow: hidden; }
.progress-bar { display: block; height: 100%; background: var(--good); }
.perm-list { list-style: none; padding: 0; margin: 0; font-size: 14px; }
.perm-list li { padding: 4px 0; }
.perm-list li.off { color: var(--ink-3); }
.perm-list li.on span:first-child { color: var(--good); font-weight: 700; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { display: grid; gap: 2px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.tl-when { font-size: 12px; color: var(--ink-3); }
.tl-what { font-weight: 600; }
.tl-who { color: var(--ink-2); }
.codes { columns: 2; font-size: 16px; padding-left: 28px; margin: 0 0 8px; }
.codes li { padding: 4px 0; }

/* ---------- MFA and logo */
.qr-row { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.qr { border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.secret { font-size: 16px; letter-spacing: .08em; word-break: break-all; }
.logo-row { display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap; }
.logo-preview { max-width: 200px; max-height: 100px; object-fit: contain; border: 1px solid var(--line); border-radius: 6px; padding: 8px; background: #fff; }
.logo-empty { width: 200px; height: 100px; border: 2px dashed var(--line-2); border-radius: 6px; display: grid; place-items: center; color: var(--ink-3); font-size: 13px; }

/* ---------- auth pages */
.auth { max-width: 400px; margin: 48px auto 0; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 32px 30px; }
.auth h1 { font-size: 22px; }
.auth-brand { display: flex; align-items: center; gap: 10px; font-weight: 600; margin-bottom: 22px; }
.auth-links { margin-top: 16px; font-size: 14px; }
.auth-note { font-size: 13px; color: var(--ink-3); margin-top: 16px; }

/* progress width steps (no inline styles under the CSP) */
.w-0{width:0}.w-5{width:5%}.w-10{width:10%}.w-15{width:15%}.w-20{width:20%}.w-25{width:25%}.w-30{width:30%}.w-35{width:35%}.w-40{width:40%}.w-45{width:45%}.w-50{width:50%}.w-55{width:55%}.w-60{width:60%}.w-65{width:65%}.w-70{width:70%}.w-75{width:75%}.w-80{width:80%}.w-85{width:85%}.w-90{width:90%}.w-95{width:95%}.w-100{width:100%}

/* ---------- responsive */
@media (max-width: 1024px) {
  .shell { flex-direction: column; }
  .sidenav { width: auto; flex-direction: row; overflow-x: auto; padding: 8px 12px; gap: 4px; border-bottom: 1px solid var(--line); background: #fff; }
  .sidenav a { white-space: nowrap; }
  .sidenav a.active { box-shadow: inset 0 -3px 0 var(--brand); }
  .sidenav-role { display: none; }
  .main { padding: 20px 16px 40px; }
  .cols { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  body { font-size: 15px; }
  h1 { font-size: 22px; }
  .topbar { padding: 0 12px; }
  .product-name, .username { display: none; }
  .switcher-name { max-width: 50vw; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .span-2, .span-3 { grid-column: auto; }
  .facts { grid-template-columns: 1fr; }
  .codes { columns: 1; }
  .card { padding: 16px; }
  .auth { margin-top: 16px; padding: 24px 20px; border-radius: 0; border-left: 0; border-right: 0; }
  .menu { min-width: 220px; }
  /* Tables become one card per row, each value labelled. */
  .table.stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table.stack, .table.stack tbody, .table.stack tr, .table.stack td { display: block; width: 100%; }
  .table.stack tr { border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 12px; margin-bottom: 10px; }
  .table.stack td { border: 0; padding: 6px 0; overflow-wrap: anywhere; }
  .table.stack td::before { content: attr(data-label); display: block; font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 1px; }
  .table.stack td[colspan] { display: block; }
  .table.stack td[colspan]::before { content: none; }
  .table.stack td.actions { display: flex; justify-content: flex-start; }
  .table.stack td.actions::before { content: none; }
  .table.stack td.nowrap { white-space: normal; }
  .table-wrap:has(.table.stack) { overflow: visible; margin: 0; padding: 0; }
}

/* ======================================================================= phase 2: register */
.sidenav-sep { display: block; height: 1px; background: var(--line); margin: 8px 12px; }
.text-bad { color: var(--bad); }
.prewrap { white-space: pre-wrap; }
.inline { display: inline; }
.btn-link { background: none; border: 0; padding: 0; color: var(--link); text-decoration: underline; cursor: pointer; font: inherit; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.card-warn { border-color: #FEDF89; background: var(--warn-bg); }
.field-error { color: var(--bad); font-size: 13px; margin: 4px 0 0; }
input[aria-invalid=true], select[aria-invalid=true], textarea[aria-invalid=true] { border-color: var(--bad); }
.empty { text-align: center; padding: 24px 8px; }
.ref { font-family: var(--mono); font-weight: 600; font-size: 13px; }
a.stat { text-decoration: none; color: inherit; }
a.stat:hover { border-color: var(--brand); }
.stat-money { font-size: 20px; }
.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.soon li { padding: 8px 0; border-top: 1px solid var(--line); }

/* status, deadline and priority badges — text plus colour, never colour alone */
.status { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 4px; background: #EEF0F3; color: #344054; white-space: nowrap; }
.status-identified { background: #F2F4F7; color: #344054; }
.status-qualification { background: #EFF8FF; color: #175CD3; }
.status-preparing { background: #EEF4FF; color: #3538CD; }
.status-internal_review { background: #FDF2FA; color: #C11574; }
.status-approved { background: #F0F9FF; color: #026AA2; border: 1px solid #B9E6FE; }
.status-submitted, .status-awaiting_outcome { background: #ECFDF3; color: #067647; }
.status-awarded { background: #067647; color: #fff; }
.status-unsuccessful { background: #FEF3F2; color: #B42318; }
.status-no_bid, .status-withdrawn, .status-cancelled { background: #F2F4F7; color: #667085; text-decoration: none; }
.deadline { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 7px; border-radius: 999px; border: 1px solid; white-space: nowrap; }
.deadline-open { color: var(--good); border-color: #ABEFC6; }
.deadline-soon { color: var(--warn); border-color: #FEC84B; background: var(--warn-bg); }
.deadline-closed { color: #475467; border-color: var(--line-2); background: #F2F4F7; }
.prio { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; padding: 1px 6px; border-radius: 4px; }
.prio-critical { background: var(--bad); color: #fff; }
.prio-high { background: #FFF4ED; color: #B93815; }
.prio-low { background: #F2F4F7; color: #667085; }
.tag-link { text-decoration: none; }
.tag-link:hover { text-decoration: underline; }

/* filters */
.filters { padding-bottom: 14px; }
.filter-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 14px; }
.filter-grid label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.filter-grid .span-2 { grid-column: span 2; }
.filters .btn-row { margin-top: 10px; }
.register td { font-size: 14px; }
.pager { align-items: center; }

/* board */
.board { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 12px; }
.board-col { background: #EEF0F3; border-radius: 8px; padding: 10px; min-height: 200px; }
.board-col.drop-ok { outline: 2px dashed var(--brand); outline-offset: -2px; }
.board-col-head { display: flex; justify-content: space-between; font-size: 14px; margin: 2px 4px 10px; }
.count { font-size: 12px; background: #fff; border-radius: 999px; padding: 0 8px; color: var(--ink-2); font-weight: 600; }
.board-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.board-card { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; cursor: grab; }
.board-card.dragging { opacity: .5; }
.board-card p { margin: 4px 0 0; }
.board-title { font-weight: 600; font-size: 14px; }
.board-move { display: flex; gap: 6px; margin-top: 8px; }
.board-move select { min-height: 32px; padding: 4px 8px; font-size: 13px; }
.board-empty { color: var(--ink-3); font-size: 13px; text-align: center; padding: 16px 0; }

/* calendar */
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0 0 12px; }
.cal { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cal-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-head div { padding: 8px; font-size: 12px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; background: #FAFBFC; border-bottom: 1px solid var(--line); }
.cal-cell { min-height: 110px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 6px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-cell:nth-child(7n) { border-right: 0; }
.cal-pad { background: #FAFBFC; }
.cal-today .cal-day { background: var(--brand); color: var(--on-brand); border-radius: 999px; padding: 0 7px; }
.cal-day { font-size: 13px; font-weight: 600; align-self: flex-start; }
.ev { display: block; font-size: 12px; padding: 2px 6px; border-radius: 4px; text-decoration: none; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 3px solid; }
.legend .ev { display: inline-block; }
.ev-time { font-family: var(--mono); font-size: 11px; color: var(--ink-2); }
.ev-closing { background: #FEF3F2; border-color: var(--bad); font-weight: 600; }
.ev-briefing { background: #EFF8FF; border-color: #2E90FA; }
.ev-questions { background: #FFFAEB; border-color: #F79009; }
.ev-review { background: #FDF2FA; border-color: #DD2590; }
.ev-target { background: #ECFDF3; border-color: #17B26A; }

/* opportunity workspace */
.opp-head h1 { margin-bottom: 8px; }
.opp-head .ref { font-size: 18px; margin-right: 6px; }
.opp-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.opp-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tabs a, .tab-later { padding: 9px 14px; text-decoration: none; color: var(--ink-2); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a.active { color: var(--ink); border-bottom-color: var(--brand); }
.tabs a:hover { color: var(--ink); }
.tab-later { color: #98A2B3; font-weight: 500; cursor: default; }
.facts-1 { grid-template-columns: 1fr; }
.radio-blocked { opacity: .75; cursor: not-allowed; }
.meter { margin-bottom: 14px; }
.meter-label { display: flex; justify-content: space-between; font-weight: 600; margin: 0 0 6px; }
.task-list { list-style: none; padding: 0; margin: 0; }
.task { display: flex; justify-content: space-between; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.task:first-child { border-top: 0; }
.task-main { flex: 1 1 260px; min-width: 0; }
.task-title { font-weight: 600; margin: 0 0 2px; }
.task-done .task-title, .task-cancelled .task-title { text-decoration: line-through; color: var(--ink-3); }
.task-overdue { box-shadow: inset 3px 0 0 var(--bad); padding-left: 10px; }
.task p { margin: 0 0 2px; }
.task-form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; flex: 0 1 auto; }
.task-form select, .task-form input[type=datetime-local] { width: auto; min-height: 34px; padding: 4px 8px; font-size: 13px; }
.task-form .check-label { margin: 0; }
.comments { list-style: none; padding: 0; margin: 0; }
.comments li { padding: 10px 0; border-top: 1px solid var(--line); }
.comments li:first-child { border-top: 0; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 6px; overflow: hidden; }
.seg a { padding: 7px 14px; text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: 14px; }
.seg a.active { background: var(--brand); color: var(--on-brand); }
.cat-list li { display: flex; gap: 10px; align-items: baseline; padding: 6px 0; border-top: 1px solid var(--line); }
.cat-list li span:first-child { flex: 1; }
.opp-form .card h2 .tag { vertical-align: middle; }
.form-actions { margin-bottom: 24px; }
.board-notice { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); background: #101828; color: #fff; padding: 10px 16px; border-radius: 6px; font-size: 14px; z-index: 50; }

@media (max-width: 1100px) {
  .opp-layout { grid-template-columns: minmax(0, 1fr); }
  .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .filter-grid { grid-template-columns: 1fr; }
  .filter-grid .span-2 { grid-column: auto; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .board { grid-auto-columns: minmax(78vw, 1fr); }
  .cal-row { grid-template-columns: 1fr; }
  .cal-head { display: none; }
  .cal-cell { min-height: 0; border-right: 0; }
  .cal-pad, .cal-none { display: none; }
  .task-form { width: 100%; }
  .page-head { flex-direction: column; align-items: flex-start; }
}

/* ---------------------------------------------------------------- phase 3: documents */
.subnav { margin-bottom: 16px; }
.grid-main { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .grid-main { grid-template-columns: minmax(0, 1fr); } }
.disclose > summary { display: inline-block; margin: 4px 0; }
.disclose[open] > summary { margin-bottom: 10px; }
summary .inline-h { display: inline; margin: 0; }
details.card > summary { display: block; }
.tag-strong { background: #E8EAF0; color: var(--ink); }
.text-good { color: var(--good); }
.notice { background: var(--warn-bg); border-radius: 6px; padding: 6px 10px; margin: 6px 0; }
.check-row { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.check-row legend { font-weight: 600; font-size: 14px; margin-bottom: 4px; padding: 0; }
.req-summary { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.req-tools { display: flex; flex-wrap: wrap; align-items: end; gap: 10px 18px; margin: 8px 0; }
.req-list { list-style: none; margin: 0; padding: 0; }
.req { border-left: 4px solid var(--line); }
.req-approved, .req-not_applicable { border-left-color: var(--good); }
.req-rejected, .req-missing { border-left-color: var(--bad); }
.req-uploaded, .req-under_review { border-left-color: #2E90FA; }
.req-requested { border-left-color: var(--warn); }
.req-name { margin: 0 0 4px; font-size: 16px; }
.req-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 2px 0 6px; }
.attachment { background: #F9FAFB; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin: 8px 0; overflow-wrap: anywhere; }
.attachment p { margin: 2px 0; }
.req-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.req-actions .inline-form { flex-wrap: wrap; }
.req-actions input[type=file] { max-width: 100%; }
.review-form textarea { min-height: 38px; }
.req-more { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.rstatus { display: inline-block; font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 999px; }
.rstatus-missing { background: var(--bad-bg); color: var(--bad); }
.rstatus-requested { background: var(--warn-bg); color: var(--warn); }
.rstatus-uploaded, .rstatus-under_review { background: #EFF8FF; color: #175CD3; }
.rstatus-approved { background: var(--good-bg); color: var(--good); }
.rstatus-rejected { background: var(--bad); color: #fff; }
.rstatus-not_applicable { background: #F2F4F7; color: #475467; }
.tpl-items li { margin: 6px 0; }
.req-actions { flex-direction: row; flex-wrap: wrap; align-items: flex-start; gap: 8px 12px; }
.req-actions > .review-form { flex: 1 1 360px; min-width: 0; }
.req-actions > .req-file { flex: 1 1 100%; order: 2; }
.req-actions > .req-hint:empty { display: none; }
.req-hint { flex: 1 1 100%; margin: 0; }
.review-form { margin: 0; }
.review-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.review-row .grow { flex: 1 1 220px; min-width: 0; }
.review-row select, .review-row input { width: 100%; }
.file-form { background: #F9FAFB; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin: 8px 0; }
.file-form label { margin-top: 0; }
.file-form select { max-width: 100%; }
.req-file[open] > summary { margin-bottom: 0; }
.req-tools > form { flex: 1 1 320px; min-width: 0; }
.req-tools select { min-width: 0; }
.req-more { flex-direction: row; flex-wrap: wrap; gap: 4px 18px; }
.req-more > details[open] { flex: 1 1 100%; }
details.review-form > summary { margin: 0; }
details.review-form[open] > form { margin-top: 8px; }
details.card > summary { display: flex; justify-content: space-between; align-items: center; }
details.card > summary::after { content: "Open"; font-size: 13px; font-weight: 600; color: var(--link); }
details.card[open] > summary::after { content: "Close"; }

/* ---------------------------------------------------------------- phase 4: readiness, packs, approval */
.readiness-score { margin: 0; }
.checks { list-style: none; margin: 8px 0 0; padding: 0; }
.check { border-top: 1px solid var(--line); padding: 10px 0; }
.check:first-child { border-top: 0; }
.check-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; margin: 0; }
.check-mark { display: inline-block; width: 1.2em; font-weight: 700; }
.check-pass .check-mark { color: var(--good); }
.check-fail .check-mark { color: var(--bad); }
.failures { margin: 6px 0 0 1.9em; padding: 0; list-style: disc; }
.failures li { margin: 4px 0; overflow-wrap: anywhere; }
.failures li.covered > span { text-decoration: line-through; text-decoration-color: var(--ink-3); }
.failures p { margin: 2px 0; }
.failures form { margin-top: 6px; }
#pack .facts { margin-bottom: 8px; }
#approval form { margin: 8px 0; }
.failures summary { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
.check-head { display: grid; grid-template-columns: 1.4em minmax(0, 1fr) auto; column-gap: 6px; align-items: baseline; }
@media (max-width: 640px) {
  .check-head { grid-template-columns: 1.4em minmax(0, 1fr); }
  .check-head .tag { grid-column: 2; justify-self: start; margin-top: 4px; }
}

/* ---------------------------------------------------------------- phase 5: notifications */
.bell { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 999px; color: inherit; }
.bell:hover, .bell:focus-visible { background: rgba(255,255,255,.15); }
.bell-count { position: absolute; top: 1px; right: -2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #D92D20; color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.notes { list-style: none; margin: 0; padding: 0; }
.note { border-top: 1px solid var(--line); padding: 12px 0; }
.note:first-child { border-top: 0; }
.note.unread { border-left: 3px solid var(--brand); padding-left: 12px; }
.note-title { font-weight: 600; }
.note p { margin: 4px 0; overflow-wrap: anywhere; }
#reminders .inline-form input { flex: 1 1 220px; }
/* The reminders card shows the next six; "Show all" reveals the rest without script. */
#reminders:has(.show-more:not([open])) .more-row { display: none; }

/* ---------------------------------------------------------------- phase 6: submission and outcomes */
.evidence-fields { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; margin: 4px 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 4px 16px; }
.evidence-fields legend { font-weight: 600; padding: 0 4px; }
.evidence-fields .help { grid-column: 1 / -1; }
.evidence-fields input[type=file] { max-width: 100%; }
.radio-row { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 20px; }
.radio-row legend { font-weight: 600; margin-bottom: 4px; padding: 0; }

/* ---------------------------------------------------------------- phase 7: reports */
.report-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.report-card { display: block; text-decoration: none; color: inherit; }
.report-card:hover h2, .report-card:focus-visible h2 { text-decoration: underline; }
.report-card h2 { margin: 0 0 4px; color: var(--link); }
.mini { display: flex; gap: 18px; margin: 10px 0 0; }
.mini dt { font-size: 12px; color: var(--ink-3); }
.mini dd { margin: 0; font-size: 20px; font-weight: 700; }
.stat-formula { display: block; font-size: 11px; color: var(--ink-3); margin-top: 4px; }
.report-table td.num, .report-table th.num { text-align: right; white-space: nowrap; }
@media (max-width: 640px) { .report-table td.num { text-align: left; } }

/* Phase 8: archive notices */
.alert-quiet { background: var(--card); border-color: var(--line-2); }
.alert .inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.alert .inline-form input { flex: 1 1 220px; max-width: 360px; }
.inline-details { margin-top: 8px; }
.inline-details summary { cursor: pointer; font-weight: 600; }
.inline-details .form { margin-top: 8px; max-width: 480px; }
.danger-zone { border-color: #FECDCA; }
