:root {
  --ink: #171716;
  --paper: #f3f1eb;
  --white: #ffffff;
  --muted: #716f68;
  --line: #d8d5cc;
  --green: #3d9a67;
  --yellow: #e3b73f;
  --red: #d54b45;
  --grey: #a6a49d;
  --soft-green: #e7f2eb;
  --soft-yellow: #faf0d3;
  --soft-red: #f8dfdc;
  --radius: 14px;
  --shadow: 0 18px 55px rgba(27, 25, 20, .08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: Helvetica, "Helvetica Neue", Arial, sans-serif; font-size: 16px; line-height: 1.45; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
.skip-link { position: fixed; left: 1rem; top: -4rem; z-index: 100; padding: .75rem 1rem; background: var(--white); color: var(--ink); }
.skip-link:focus { top: 1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.topbar { position: sticky; top: 0; z-index: 50; height: 74px; padding: 0 clamp(18px, 4vw, 64px); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; background: rgba(243,241,235,.94); backdrop-filter: blur(16px); border-bottom: 1px solid var(--line); }
.brand-block { display: flex; align-items: center; gap: 13px; min-width: 255px; }
.header-logo-frame { width: 72px; height: 50px; display: grid; place-items: center; }
.header-logo { width: 72px; height: 50px; object-fit: contain; mix-blend-mode: multiply; }
.brand-divider { width: 1px; height: 30px; background: var(--line); }
.brand-project { display: grid; gap: 1px; line-height: 1; }
.brand-project strong { font-size: .76rem; letter-spacing: .06em; }
.brand-project small { color: var(--muted); font-size: .63rem; letter-spacing: .18em; }
.nav-tabs { display: flex; gap: 4px; padding: 4px; background: #e6e3dc; border-radius: 999px; }
.nav-tab { border: 0; background: transparent; color: #64615b; padding: 9px 16px; border-radius: 999px; font-size: .875rem; }
.nav-tab.is-active { background: var(--white); color: var(--ink); box-shadow: 0 2px 9px rgba(0,0,0,.08); }
.header-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; }
.revision-pill { padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: .78rem; color: var(--muted); }
.icon-button { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: transparent; }
.icon-button svg, .search-field svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }

main { max-width: 1520px; margin: 0 auto; padding: clamp(34px, 5vw, 76px) clamp(18px, 4vw, 64px) 70px; }
.tab-panel { display: none; animation: panel-in .25s ease; }
.tab-panel.is-active { display: block; }
@keyframes panel-in { from { opacity: 0; transform: translateY(4px); } }
.page-heading, .section-title-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 28px; margin-bottom: 38px; }
.eyebrow { margin: 0 0 10px; color: var(--muted); font-size: .72rem; letter-spacing: .13em; font-weight: 700; }
h1 { margin: 0; font-family: Baskerville, "Baskerville Old Face", "Times New Roman", serif; font-size: clamp(2.7rem, 5.5vw, 5.9rem); line-height: .9; letter-spacing: -.045em; font-weight: 400; }
h2 { margin: 0; font-family: Baskerville, "Baskerville Old Face", "Times New Roman", serif; font-size: clamp(1.55rem, 2.2vw, 2.25rem); line-height: 1.05; letter-spacing: -.025em; font-weight: 400; }
.update-note { min-width: 220px; display: grid; gap: 3px; padding-bottom: 4px; font-size: .85rem; color: var(--muted); }
.update-note strong { color: var(--ink); font-size: 1rem; }
.update-note a { margin-top: 10px; color: var(--ink); text-underline-offset: 3px; }

.headline-grid { display: grid; grid-template-columns: .9fr 1.15fr 1.15fr .88fr; gap: 16px; margin-bottom: 16px; }
.headline-card, .panel { background: var(--white); border: 1px solid rgba(23,23,22,.08); border-radius: var(--radius); box-shadow: var(--shadow); }
.headline-card { min-height: 260px; padding: 26px; display: flex; flex-direction: column; }
.headline-card.dark { background: var(--ink); color: var(--paper); }
.metric-label { font-size: .72rem; letter-spacing: .12em; font-weight: 700; color: var(--muted); }
.dark .metric-label { color: #a6a39a; }
.metric-number { margin-top: auto; font-family: Baskerville, "Baskerville Old Face", "Times New Roman", serif; font-size: clamp(4rem, 6.2vw, 6.6rem); line-height: .82; letter-spacing: -.055em; font-weight: 400; }
.metric-foot { display: flex; justify-content: space-between; gap: 12px; margin-top: 22px; color: #c4c1b8; font-size: .85rem; }
.metric-foot b { color: var(--paper); }
.metric-caption { display: block; color: var(--muted); font-size: .86rem; margin-top: 10px; }
.feature-layout { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 126px; align-items: end; gap: 16px; }
.donut { width: 160px; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; position: relative; background: conic-gradient(var(--green) 0 20%, var(--yellow) 20% 80%, var(--red) 80% 82%, #d9d6ce 82%); }
.donut::after { content: ""; position: absolute; inset: 17px; border-radius: 50%; background: var(--white); }
.donut div { z-index: 1; text-align: center; }
.donut strong { display: block; font-size: 1.65rem; letter-spacing: -.04em; }
.donut span { font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.compact-donut { width: 122px; }
.compact-donut::after { inset: 14px; }
.metric-detail { display: block; margin-top: 12px; color: var(--muted); font-size: .72rem; line-height: 1.3; }
.text-button { align-self: flex-start; margin-top: 20px; padding: 0 0 3px; border: 0; border-bottom: 1px solid var(--ink); background: transparent; font-size: .82rem; }

.content-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(300px, .82fr); gap: 16px; margin-bottom: 16px; }
.panel { padding: 28px; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 22px; margin-bottom: 26px; }
.legend { max-width: 400px; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px 15px; font-size: .72rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--grey); }
.status-dot.complete { background: var(--green); }
.status-dot.incomplete { background: var(--yellow); }
.status-dot.not-started { background: var(--red); }
.activity-list { display: grid; gap: 15px; }
.activity-row { display: grid; grid-template-columns: minmax(190px, 1.25fr) 2.4fr 46px; gap: 16px; align-items: center; }
.activity-name { font-size: .82rem; font-weight: 550; }
.stack-bar { height: 12px; display: flex; overflow: hidden; border-radius: 999px; background: #e2dfd7; }
.stack-bar span { min-width: 0; }
.stack-bar .complete { background: var(--green); }
.stack-bar .incomplete { background: var(--yellow); }
.stack-bar .not-started { background: var(--red); }
.stack-bar .unassessed { background: #c7c4bc; }
.activity-percent { font-size: .78rem; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.issue-panel { background: #1f1e1c; color: var(--paper); box-shadow: none; }
.issue-panel .eyebrow { color: #aaa69d; }
.issue-counts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 27px 0 24px; }
.issue-count { padding: 14px 10px; background: #2b2a27; border-radius: 9px; }
.issue-count strong { display: block; font-size: 1.6rem; letter-spacing: -.04em; }
.issue-count span { color: #aaa69d; font-size: .7rem; }
.issue-preview { display: grid; gap: 0; border-top: 1px solid #3b3935; }
.issue-item { padding: 14px 0; border-bottom: 1px solid #3b3935; }
.issue-item strong { display: block; font-size: .82rem; }
.issue-item span { display: block; color: #aaa69d; font-size: .76rem; margin-top: 3px; line-height: 1.35; }
.secondary-button { width: 100%; margin-top: 22px; padding: 12px 16px; border: 1px solid #53504a; border-radius: 8px; background: transparent; color: var(--paper); }
.floor-panel { margin-top: 16px; }
.panel-note { margin: 2px 0 0; color: var(--muted); font-size: .8rem; }
.floor-grid { display: grid; grid-template-columns: repeat(7, minmax(110px, 1fr)); gap: 9px; }
.floor-card { padding: 17px 16px; text-align: left; border: 1px solid var(--line); background: #faf9f6; border-radius: 10px; transition: transform .2s, border-color .2s; }
.floor-card:hover { transform: translateY(-2px); border-color: #9d9990; }
.floor-card strong { display: block; font-size: 1.5rem; letter-spacing: -.04em; }
.floor-card span { color: var(--muted); font-size: .72rem; }
.floor-mini { display: flex; height: 5px; margin-top: 15px; overflow: hidden; border-radius: 999px; background: #d5d2ca; }
.floor-mini i.complete { background: var(--green); }.floor-mini i.incomplete { background: var(--yellow); }.floor-mini i.not-started { background: var(--red); }.floor-mini i.unassessed { background: var(--grey); }

.section-title-row h1 { font-size: clamp(2.6rem, 5vw, 5rem); }
.result-count { text-align: right; }
.result-count strong { display: block; font-size: 2rem; line-height: 1; }
.result-count span { color: var(--muted); font-size: .75rem; }
.filter-bar { display: grid; grid-template-columns: minmax(260px, 1.8fr) repeat(4, minmax(125px, .65fr)) auto; gap: 10px; align-items: end; margin-bottom: 14px; }
.filter-bar.compact { grid-template-columns: minmax(260px, 1fr) 190px auto; }
.filter-bar label { display: grid; gap: 6px; color: var(--muted); font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.filter-bar select, .search-field { height: 45px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); color: var(--ink); }
.filter-bar select { width: 100%; padding: 0 34px 0 12px; text-transform: none; font-size: .84rem; letter-spacing: 0; }
.search-field { display: flex !important; grid-template-columns: auto 1fr !important; align-items: center; gap: 9px !important; padding: 0 13px; }
.search-field input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); text-transform: none; letter-spacing: 0; font-size: .84rem; }
.clear-button { height: 45px; border: 0; background: transparent; color: var(--muted); font-size: .8rem; text-decoration: underline; text-underline-offset: 3px; }
.table-shell { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--white); box-shadow: var(--shadow); }
.data-table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.data-table th { padding: 14px 16px; text-align: left; background: #ece9e2; color: var(--muted); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; }
.data-table td { padding: 15px 16px; border-top: 1px solid #e7e4dc; vertical-align: middle; }
.data-table tbody tr { transition: background .15s; }
.data-table tbody tr:hover { background: #faf9f6; }
.room-id { font-weight: 650; }
.table-secondary { color: var(--muted); }
.status-pill { display: inline-flex; align-items: center; gap: 7px; padding: 5px 9px; border-radius: 999px; font-size: .74rem; white-space: nowrap; }
.status-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--grey); }
.status-pill.complete { background: var(--soft-green); }.status-pill.complete::before { background: var(--green); }
.status-pill.incomplete { background: var(--soft-yellow); }.status-pill.incomplete::before { background: var(--yellow); }
.status-pill.not-started { background: var(--soft-red); }.status-pill.not-started::before { background: var(--red); }
.status-pill.unassessed { background: #eeece7; }
.row-button { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; background: transparent; font-size: 1.1rem; }
.empty-state { padding: 50px 20px; text-align: center; color: var(--muted); }
.pending-table td:nth-child(5) { max-width: 500px; }

footer { max-width: 1520px; margin: 0 auto; padding: 30px clamp(18px, 4vw, 64px); border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 20px; color: var(--muted); font-size: .72rem; }
footer div { display: flex; align-items: center; gap: 12px; }
footer img { width: 52px; height: 38px; object-fit: contain; mix-blend-mode: multiply; }

dialog { width: min(760px, calc(100vw - 28px)); max-height: calc(100vh - 40px); border: 0; border-radius: 16px; padding: 32px; color: var(--ink); box-shadow: 0 28px 100px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(20,19,17,.62); backdrop-filter: blur(4px); }
.dialog-close { position: absolute; right: 18px; top: 14px; width: 36px; height: 36px; border: 0; background: transparent; font-size: 1.8rem; }
.detail-header { padding-right: 40px; margin-bottom: 24px; }
.detail-header h2 { font-size: 2.4rem; }
.detail-meta { margin-top: 8px; color: var(--muted); font-size: .82rem; }
.detail-status-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; }
.detail-status { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; background: #f4f2ed; border-radius: 8px; }
.detail-status span:first-child { font-size: .76rem; }
.detail-comment { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.detail-comment p { margin: 5px 0 0; color: #55524d; }
.note-dialog { width: min(560px, calc(100vw - 28px)); }
.note-dialog h2 { margin-bottom: 18px; }
.note-dialog > p:last-child { color: #55524d; line-height: 1.6; }

@media (max-width: 1060px) {
  .topbar { grid-template-columns: auto 1fr auto; }
  .brand-project, .revision-pill { display: none; }
  .brand-block { min-width: 0; }
  .brand-divider { display: none; }
  .headline-grid { grid-template-columns: 1fr 1fr; }
  .headline-card:last-child { grid-column: auto; min-height: 240px; }
  .content-grid { grid-template-columns: 1fr; }
  .floor-grid { grid-template-columns: repeat(4, 1fr); }
  .filter-bar { grid-template-columns: repeat(3, 1fr); }
  .search-field { grid-column: span 2; }
}

@media (max-width: 720px) {
  .topbar { height: auto; min-height: 64px; padding: 10px 16px; grid-template-columns: 1fr auto; }
  .nav-tabs { order: 3; grid-column: 1 / -1; width: 100%; }
  .nav-tab { flex: 1; padding: 8px 7px; }
  main { padding-top: 38px; }
  .page-heading, .section-title-row { align-items: flex-start; flex-direction: column; }
  h1 { font-size: 3.05rem; }
  .update-note { min-width: 0; }
  .headline-grid { grid-template-columns: 1fr; }
  .headline-card, .headline-card:last-child { grid-column: auto; min-height: 230px; }
  .feature-layout { grid-template-columns: 1fr 122px; }
  .donut { width: 116px; }
  .panel { padding: 20px; }
  .panel-heading { flex-direction: column; }
  .legend { justify-content: flex-start; }
  .activity-row { grid-template-columns: 1fr 42px; gap: 8px 12px; }
  .stack-bar { grid-column: 1 / -1; grid-row: 2; }
  .floor-grid { grid-template-columns: repeat(2, 1fr); }
  .filter-bar, .filter-bar.compact { grid-template-columns: 1fr 1fr; }
  .search-field { grid-column: 1 / -1; }
  .table-shell { overflow-x: auto; }
  .data-table { min-width: 820px; }
  footer { align-items: flex-start; flex-direction: column; }
  .detail-status-grid { grid-template-columns: 1fr; }
}

@media print {
  body { background: #fff; }
  .topbar, .update-note a, .header-actions, .nav-tabs, .filter-bar, .row-button, footer { display: none !important; }
  main { max-width: none; padding: 0; }
  .tab-panel { display: none !important; }
  #overview { display: block !important; }
  .headline-card, .panel { box-shadow: none; break-inside: avoid; }
  .issue-panel { background: #fff; color: #111; border: 1px solid #ccc; }
  .issue-panel .eyebrow, .issue-item span { color: #666; }
  .secondary-button { display: none; }
}
