:root {
  --bg: #f4f7f5;
  --surface: #ffffff;
  --surface-2: #f8faf9;
  --text: #13201b;
  --muted: #5f6f68;
  --line: #e2e8e4;
  --brand: #0f6b4f;
  --brand-2: #14905f;
  --brand-soft: #e3f3ec;
  --danger: #c2410c;
  --good: #15803d;
  --warn: #b45309;
  --c1: #0f6b4f; --c2: #3b82c4; --c3: #e0a53a; --c4: #14a37f; --c5: #8fb6dc; --c6: #e07a5f; --c7: #7a6fc4; --c8: #9aa5a0;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 40, 30, .06), 0 4px 16px rgba(16, 40, 30, .05);
  --sidebar: 248px;
  --topbar: 60px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1513; --surface: #16201d; --surface-2: #1b2723; --text: #e6efeb; --muted: #94a6a0; --line: #263531;
    --brand: #3fbf8f; --brand-2: #5fd3a6; --brand-soft: #173a2e; --danger: #f08a5d; --good: #4ade80; --warn: #fbbf24;
    --c1: #3fbf8f; --c2: #6aa9e0; --c3: #f0bf5e; --c5: #456f96;
    --shadow: 0 1px 2px rgba(0,0,0,.3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] { --bg: #0e1513; --surface: #16201d; --text: #e6efeb; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.5 Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
h1 { font-size: 1.55rem; margin: 0 0 4px; letter-spacing: -.01em; }
h2 { font-size: 1.2rem; margin: 0 0 8px; }
h3 { font-size: 1rem; margin: 0 0 12px; }
p { margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.center { text-align: center; justify-content: center; }
.mt { margin-top: 20px; }
.mb { margin-bottom: 16px; }
.bad-text { color: var(--danger); }

/* ---------- Top bar & layout ---------- */
.topbar { position: sticky; top: 0; z-index: 30; height: var(--topbar); display: flex; align-items: center; gap: 14px; padding: 0 18px;
  background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); width: calc(var(--sidebar) - 36px); }
.brand.big { justify-content: center; font-size: 1.3rem; margin-bottom: 10px; width: auto; }
.logo { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; font-size: .8rem; letter-spacing: .02em; }
.top-org { font-weight: 600; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.year-pick { display: flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--muted); }
.year-pick select { width: auto; padding: 6px 10px; }
.menu-btn { display: none; }
.user-menu { position: relative; }
.avatar { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--brand-soft); color: var(--brand); font-weight: 700; cursor: pointer; }
.user-drop { position: absolute; right: 0; top: 46px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 12px; display: grid; gap: 6px; min-width: 220px; z-index: 100; }
.user-drop[hidden] { display: none; }

/* Plan Switcher & Simulation Dropdown */
.plan-switcher-wrap { position: relative; }
.plan-pill-btn {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 12px; font-size: 0.8rem; font-weight: 600; cursor: pointer; color: var(--text);
  display: flex; align-items: center; gap: 6px; transition: all 0.2s ease;
}
.plan-pill-btn:hover { border-color: var(--brand); background: var(--brand-soft); }
.plan-drop {
  position: absolute; right: 0; top: 38px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow); padding: 8px; display: grid; gap: 4px; min-width: 270px; z-index: 100;
}
.plan-drop[hidden] { display: none; }
.plan-opt-btn {
  display: flex; align-items: flex-start; gap: 10px; width: 100%; text-align: left;
  background: transparent; border: 1px solid transparent; border-radius: 8px; padding: 8px 10px;
  cursor: pointer; font-size: 0.84rem; color: var(--text);
}
.plan-opt-btn:hover { background: var(--surface-2); }
.plan-opt-btn.active { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); font-weight: 600; }

.layout { display: flex; min-height: calc(100vh - var(--topbar)); }
.sidebar { width: var(--sidebar); flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--line); padding: 14px 10px 20px;
  position: sticky; top: var(--topbar); height: calc(100vh - var(--topbar)); overflow-y: auto; display: flex; flex-direction: column; }
.nav-group { margin-bottom: 14px; }
.nav-title { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 4px 10px; font-weight: 600; }
.nav-group-btn {
  display: flex; align-items: center; justify-content: space-between; width: 100%; background: transparent;
  border: 0; font: inherit; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted);
  padding: 6px 10px; font-weight: 600; cursor: pointer; border-radius: 6px; text-align: left;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-group-btn:hover { background: var(--surface-2); color: var(--brand); }
.nav-group-arrow { font-size: .65rem; color: var(--muted); transition: transform 0.2s ease; margin-left: 6px; }
.nav-group-collapsible.expanded .nav-group-arrow { color: var(--brand); }
.nav-sub-items { transition: all 0.2s ease; }
.nav-link { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; color: var(--text); font-size: .9rem; }
.nav-link:hover { background: var(--surface-2); }
.nav-link.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.nav-ic { width: 20px; text-align: center; font-size: .9rem; }
.side-foot { margin-top: auto; padding: 10px; }
.scrim { display: none; }
.main { flex: 1; min-width: 0; padding: 26px 30px 60px; max-width: 1280px; }

/* ---------- Page pieces ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head > div:first-child { flex: 1 1 380px; min-width: 0; }
.eyebrow { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--brand); font-weight: 600; }
.row-gap { display: flex; gap: 8px; align-items: center; }
.wrap { flex-wrap: wrap; }
.pill { font-size: .78rem; padding: 4px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-weight: 600; white-space: nowrap; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-bottom: 16px; min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.card-head h3 { margin: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-2.inner { gap: 12px; }
.grid-2 > .card { margin-bottom: 0; }
.grid-2 + .card, .grid-2 + .grid-2 { margin-top: 16px; }
.empty-state { text-align: center; padding: 40px 20px; }
.empty-state .row-gap { justify-content: center; margin-top: 12px; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpis.compact { margin-bottom: 4px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); min-width: 0; }
.card .kpi { box-shadow: none; background: var(--surface-2); }
.kpi-label { font-size: .78rem; color: var(--muted); font-weight: 500; }
.kpi-value { font-size: 1.45rem; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; overflow-wrap: anywhere; }
.kpi-unit { font-size: .75rem; color: var(--muted); font-weight: 500; margin-left: 5px; }
.kpi-sub { font-size: .78rem; color: var(--muted); margin-top: 2px; }
.kpi.good .kpi-sub { color: var(--good); font-weight: 600; }
.kpi.bad .kpi-sub { color: var(--danger); font-weight: 600; }

/* ---------- Buttons & forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 10px; padding: 9px 15px; font: inherit; font-size: .88rem; font-weight: 600;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; white-space: nowrap; min-height: 40px; }
.btn:hover { border-color: var(--brand); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-2); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); }
.btn.sm { padding: 5px 11px; min-height: 32px; font-size: .8rem; }
.btn.block { width: 100%; }
.icon-btn { border: 0; background: transparent; font-size: 1.2rem; cursor: pointer; color: var(--text); width: 40px; height: 40px; border-radius: 10px; }
.icon-btn:hover { background: var(--surface-2); }

input, select, textarea { width: 100%; font: inherit; font-size: .92rem; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; min-height: 40px; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--brand) 35%, transparent); border-color: var(--brand); }
input[type="checkbox"] { width: 18px; height: 18px; min-height: 0; accent-color: var(--brand); flex-shrink: 0; }
select.sm, input.sm { padding: 5px 8px; min-height: 34px; font-size: .82rem; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px 16px; }
.form-grid.one { grid-template-columns: 1fr; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.field > label { font-size: .82rem; font-weight: 600; color: var(--muted); }
.field.check { flex-direction: row; align-items: center; gap: 10px; font-size: .9rem; }
.help { font-size: .76rem; color: var(--muted); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -4px; padding: 0 4px; }
.tbl { width: 100%; border-collapse: collapse; font-size: .88rem; }
.tbl th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl tfoot td { font-weight: 700; border-bottom: 0; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl.gri td:first-child { white-space: nowrap; font-weight: 600; color: var(--brand); }
.tbl.screening input { min-width: 180px; }
.indent { padding-left: 16px; display: inline-block; color: var(--muted); }
.empty { padding: 24px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 12px; }

.badge { display: inline-block; font-size: .72rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.badge.good { background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good); border-color: transparent; }
.badge.warn { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); border-color: transparent; }
.badge.bad { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); border-color: transparent; }
.badge.info { background: var(--brand-soft); color: var(--brand); border-color: transparent; }

.kv { display: grid; grid-template-columns: minmax(130px, 34%) 1fr; gap: 8px 14px; margin: 0; font-size: .9rem; }
.kv dt { color: var(--muted); font-weight: 500; }
.kv dd { margin: 0; overflow-wrap: anywhere; }

.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.chk { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; }
.chk-ic { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: .75rem; font-weight: 700; flex-shrink: 0; margin-top: 1px; }
.chk.ok .chk-ic { background: color-mix(in srgb, var(--good) 16%, transparent); color: var(--good); }
.chk.bad .chk-ic { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); }
.chk.warn .chk-ic { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }

.callout { background: var(--brand-soft); border-radius: 12px; padding: 12px 14px; font-size: .88rem; margin-bottom: 16px; }
.callout.warn { background: color-mix(in srgb, var(--warn) 12%, var(--surface)); }
.decl { margin: 0; padding: 14px 16px; border-left: 4px solid var(--brand); background: var(--surface-2); border-radius: 0 10px 10px 0; font-style: italic; }

.report-tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 16px; padding-bottom: 4px; scrollbar-width: thin; }
.report-tabs a { padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: .84rem; white-space: nowrap; }
.report-tabs a.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.report-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.report-tile { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; color: var(--text); background: var(--surface-2); }
a.report-tile:hover { border-color: var(--brand); }

/* ---------- Charts ---------- */
.donut-wrap { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.donut { width: 170px; height: 170px; flex-shrink: 0; }
.donut-val { font-size: 20px; font-weight: 700; fill: var(--text); }
.donut-lbl { font-size: 11px; fill: var(--muted); }
.legend { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; flex: 1; min-width: 180px; font-size: .86rem; }
.legend li { display: flex; align-items: center; gap: 8px; }
.legend.inline { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; font-size: .8rem; color: var(--muted); }
.lg-name { flex: 1; }
.lg-val { font-variant-numeric: tabular-nums; font-weight: 600; }
.lg-pct { color: var(--muted); width: 40px; text-align: right; }
.sw { width: 11px; height: 11px; border-radius: 3px; display: inline-block; flex-shrink: 0; }
.sw.line { height: 0; border-top: 2px dashed var(--danger); border-radius: 0; }
.chart { width: 100%; height: auto; display: block; }
.chart .axis { font-size: 11px; fill: var(--muted); }
.chart .axis.strong { fill: var(--text); font-weight: 600; }
.hbars { display: grid; gap: 10px; }
.hbar-top { display: flex; justify-content: space-between; gap: 10px; font-size: .84rem; margin-bottom: 4px; }
.hbar-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-val { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.hbar-track { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.hbar-fill { height: 100%; border-radius: 99px; }
.stackbar { display: flex; height: 12px; border-radius: 99px; overflow: hidden; background: var(--surface-2); }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(8, 20, 15, .45); z-index: 50; display: grid; place-items: center; padding: 20px; }
.modal { background: var(--surface); border-radius: 18px; width: min(680px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; }
.modal-body { padding: 18px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: space-between; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--line); }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 20px); opacity: 0; background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 10px; font-size: .88rem; z-index: 60; transition: .25s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 20% 10%, var(--brand-soft), transparent 50%), var(--bg); }
.login-card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 28px; box-shadow: var(--shadow); text-align: center; }
.login-card form { text-align: left; margin: 18px 0 8px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .8rem; margin: 14px 0; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.login-card .small { margin-top: 14px; }

/* ---------- Responsive: tablet & phone ---------- */
@media (max-width: 1000px) {
  .grid-2 { grid-template-columns: 1fr; }
  .main { padding: 20px 20px 60px; }
}
@media (max-width: 860px) {
  .menu-btn { display: inline-block; margin-left: -8px; }
  .brand { width: auto; }
  .sidebar { position: fixed; left: 0; top: var(--topbar); bottom: 0; height: auto; z-index: 40; transform: translateX(-105%); transition: transform .22s ease; box-shadow: var(--shadow); }
  .sidebar.open { transform: none; }
  .scrim.show { display: block; position: fixed; inset: var(--topbar) 0 0 0; background: rgba(8, 20, 15, .4); z-index: 35; }
}
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .topbar { padding: 0 12px; gap: 8px; }
  .topbar .brand-name, .top-org { display: none; }
  .year-pick { margin-left: auto; }
  .main { padding: 16px 16px 60px; }
  h1 { font-size: 1.3rem; }
  .page-head .row-gap { width: 100%; }
  .page-head .row-gap .btn { flex: 1; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 12px; }
  .kpi-value { font-size: 1.2rem; }
  .card { padding: 14px; border-radius: 12px; }
  .donut-wrap { justify-content: center; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 8px; }
  /* Tables become stacked cards on phones */
  .tbl:not(.screening) thead { display: none; }
  .tbl:not(.screening), .tbl:not(.screening) tbody, .tbl:not(.screening) tr, .tbl:not(.screening) td, .tbl:not(.screening) tfoot { display: block; width: 100%; }
  .tbl:not(.screening) tr { border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; margin-bottom: 8px; background: var(--surface); }
  .tbl:not(.screening) td { border: 0; padding: 4px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .tbl:not(.screening) td::before { content: attr(data-label); color: var(--muted); font-size: .78rem; text-align: left; font-weight: 500; }
  .tbl:not(.screening) td[data-label=""]::before { content: none; }
  .tbl:not(.screening) td[data-label=""] { justify-content: flex-end; }
  .tbl:not(.screening) tfoot tr { background: var(--brand-soft); }
  .tbl:not(.screening) tfoot td:empty { display: none; }
  .tbl.gri td:first-child { white-space: normal; }
  .modal-backdrop { padding: 0; place-items: end stretch; }
  .modal { border-radius: 18px 18px 0 0; max-height: 92vh; width: 100%; }
}


/* ---------- Company switcher, filters, upload ---------- */
.org-sel { width: auto; max-width: 340px; flex: 0 1 auto; font-weight: 600; padding: 6px 10px; margin-right: auto; }
.filters .form-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px 12px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.chip { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 999px; padding: 6px 13px; font: inherit; font-size: .84rem; font-weight: 600; cursor: pointer; min-height: 36px; }
.chip.on { border-color: var(--brand); color: var(--text); background: var(--brand-soft); }
.chip:not(.on) .sw { opacity: .3; }
.drop { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 26px 16px; border: 2px dashed var(--line); border-radius: 14px; cursor: pointer; text-align: center; background: var(--surface-2); }
.drop:hover, .drop.over { border-color: var(--brand); background: var(--brand-soft); }
.drop-ic { font-size: 1.6rem; color: var(--brand); }
code { font-size: .8rem; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; overflow-wrap: anywhere; }
details summary { cursor: pointer; color: var(--brand); font-weight: 600; margin-bottom: 8px; }
.good-text { color: var(--good); font-weight: 600; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
@media (max-width: 640px) {
  .org-sel { max-width: 150px; font-size: .82rem; }
  .year-pick { margin-left: 0; font-size: 0; gap: 0; }
  .filters .form-grid { grid-template-columns: 1fr 1fr; }
}


/* ---------- Quick-fill buttons & form instructions ---------- */
.quick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.quick-btn { display: flex; align-items: center; gap: 12px; text-align: left; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); color: var(--text); font: inherit; cursor: pointer; min-height: 64px; transition: border-color .15s, background .15s, transform .1s; }
.quick-btn:hover { border-color: var(--brand); background: var(--brand-soft); }
.quick-btn:active { transform: scale(.98); }
.q-ic { font-size: 1.35rem; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; background: var(--surface); flex-shrink: 0; }
.q-txt { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.q-txt strong { font-size: .9rem; }
.q-plus { font-size: 1.3rem; color: var(--brand); font-weight: 700; }
.guide { background: var(--brand-soft); border-radius: 12px; padding: 10px 14px; margin-bottom: 16px; font-size: .86rem; }
.guide summary { color: var(--brand); font-weight: 700; margin: 0; }
.guide-body { margin-top: 8px; }
.guide-body p { margin: 0 0 8px; }
.guide-body ol { margin: 0 0 8px; padding-left: 20px; display: grid; gap: 4px; }
.g-ex { background: var(--surface); border-radius: 8px; padding: 8px 10px; }
.g-tip { color: var(--muted); }
@media (max-width: 640px) { .quick-grid { grid-template-columns: 1fr 1fr; gap: 8px; } .quick-btn { flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px; } .q-plus { display: none; } .q-txt .muted { display: none; } }

/* ---------- Gap reporting ---------- */
.gap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.gap-tile { display: flex; flex-direction: column; gap: 8px; text-align: left; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); color: var(--text); font: inherit; cursor: pointer; }
.gap-tile:hover, .gap-tile.on { border-color: var(--brand); background: var(--brand-soft); }
.gap-top { display: flex; justify-content: space-between; gap: 8px; font-size: .86rem; }
.gap-pct { font-weight: 700; font-variant-numeric: tabular-nums; }
.score { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.score-fill { height: 100%; border-radius: 99px; }
.score-fill.good { background: var(--good); } .score-fill.warn { background: var(--warn); } .score-fill.bad { background: var(--danger); }
.nav-title { color: var(--brand); }
@media (max-width: 640px) { .gap-grid { grid-template-columns: 1fr 1fr; gap: 8px; } }

/* ---------- Gap assessment report ---------- */
.report-cover { background: linear-gradient(135deg, var(--brand-soft), var(--surface)); }
.cover-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.exec { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.exec-score { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 22px; border-radius: 16px; background: var(--surface-2); min-width: 150px; }
.exec-score .big { font-size: 2.4rem; font-weight: 700; line-height: 1; }
.exec-score.good .big { color: var(--good); } .exec-score.warn .big { color: var(--warn); } .exec-score.bad .big { color: var(--danger); }
.exec-text { flex: 1; min-width: 240px; }
.top-actions { padding-left: 20px; display: grid; gap: 8px; margin: 0; }
.heatmap { border-collapse: separate; border-spacing: 4px; width: 100%; font-size: .8rem; }
.heatmap th { font-weight: 600; color: var(--muted); padding: 4px; white-space: nowrap; text-align: center; }
.heatmap .hm-row { text-align: left; color: var(--text); }
.hm { text-align: center; padding: 8px 4px; border-radius: 8px; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 58px; }
.hm.good { background: color-mix(in srgb, var(--good) 22%, transparent); color: var(--good); }
.hm.warn { background: color-mix(in srgb, var(--warn) 22%, transparent); color: var(--warn); }
.hm.bad { background: color-mix(in srgb, var(--danger) 20%, transparent); color: var(--danger); }
.hm.na { background: var(--surface-2); color: var(--muted); font-weight: 400; }
.hm.click:hover { outline: 2px solid var(--brand); }
.gap-sec-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.gap-sec-head > div:first-child { flex: 1 1 320px; }
.gap-score { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.gap-score span:first-child { font-size: 1.8rem; font-weight: 700; }
.gap-score.good span:first-child { color: var(--good); } .gap-score.warn span:first-child { color: var(--warn); } .gap-score.bad span:first-child { color: var(--danger); }
.gap-counts { display: flex; gap: 14px; flex-wrap: wrap; font-size: .82rem; color: var(--muted); margin: 6px 0 14px; }
.gap-items { display: grid; gap: 10px; }
.gap-item { border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 10px; padding: 12px 14px; background: var(--surface); break-inside: avoid; }
.gap-item.gap { border-left-color: var(--danger); } .gap-item.partial { border-left-color: var(--warn); } .gap-item.met { border-left-color: var(--good); }
.gi-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.gi-clause { font-size: .74rem; font-weight: 700; color: var(--brand); background: var(--brand-soft); padding: 2px 7px; border-radius: 6px; }
.gi-grid { display: grid; grid-template-columns: 170px 1fr; gap: 4px 12px; margin: 0 0 8px; font-size: .85rem; }
.gi-grid dt { color: var(--muted); }
.gi-grid dd { margin: 0; }
.plan { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.plan-col { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; }
.plan-col h4 { margin: 0 0 8px; }
.plan-col ol { padding-left: 18px; margin: 0; display: grid; gap: 6px; font-size: .85rem; }
.method { display: grid; gap: 4px; padding-left: 18px; }
@media (max-width: 900px) { .plan { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .gi-grid { grid-template-columns: 1fr; } .gi-grid dd { margin-bottom: 6px; } .exec-score { width: 100%; } }
@media print { .gap-sec { break-before: page; } }

/* ---------- Landing page ---------- */
.landing { min-height: 100vh; background: radial-gradient(circle at 10% 0%, var(--brand-soft), transparent 45%), var(--bg); }
.l-nav { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 28px; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.l-nav .brand { width: auto; }
.l-links { display: flex; gap: 22px; font-size: .9rem; }
.l-links a { color: var(--text); }
.l-hero { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(320px, 420px); gap: 40px; align-items: center; max-width: 1180px; margin: 0 auto; padding: 56px 28px 40px; }
.l-hero h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); line-height: 1.15; margin: 14px 0; letter-spacing: -.02em; }
.l-hero .hl { color: var(--brand); }
.l-hero p { font-size: 1.05rem; max-width: 560px; margin-bottom: 20px; }
.l-stats { display: flex; gap: 28px; margin-top: 28px; }
.l-stats div { display: flex; flex-direction: column; }
.l-stats strong { font-size: 1.6rem; color: var(--brand); }
.l-stats span { font-size: .82rem; color: var(--muted); }
.l-auth { padding: 22px; margin: 0; }
.l-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 12px; margin-bottom: 16px; }
.l-tab { border: 0; background: transparent; padding: 9px 6px; border-radius: 9px; font: inherit; font-size: .82rem; font-weight: 600; color: var(--muted); cursor: pointer; }
.l-tab.on { background: var(--surface); color: var(--brand); box-shadow: var(--shadow); }
.l-err { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); border-radius: 8px; padding: 8px 10px; font-size: .85rem; }
.l-err a { font-weight: 700; }
.l-note { margin-top: 12px; }
.l-section { max-width: 1180px; margin: 0 auto; padding: 40px 28px; }
.l-section h2, .l-cta h2 { text-align: center; font-size: 1.6rem; margin-bottom: 18px; }
.l-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.l-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.l-card h3 { margin: 4px 0 6px; }
.l-ic { font-size: 1.6rem; }
.l-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.l-chip { padding: 8px 16px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-weight: 600; font-size: .88rem; }
.l-cta { text-align: center; padding: 40px 28px 30px; }
.l-foot { text-align: center; padding: 20px; border-top: 1px solid var(--line); }

/* ---------- Pricing & checkout ---------- */
.pricing-controls { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin: 14px 0 20px; }
.pricing-controls select { width: auto; min-width: 230px; }
.cycle { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 4px; }
.cycle button { border: 0; background: transparent; font: inherit; font-size: .86rem; font-weight: 600; padding: 7px 14px; border-radius: 9px; cursor: pointer; color: var(--muted); }
.cycle button.on { background: var(--surface); color: var(--brand); box-shadow: var(--shadow); }
.save { font-size: .7rem; background: var(--brand-soft); color: var(--brand); padding: 1px 6px; border-radius: 99px; margin-left: 4px; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); max-width: 860px; margin: 0 auto 14px; gap: 20px; }
.plan { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 24px 20px; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow); }
.plan.popular { border: 2px solid var(--brand); }
.plan.sel { border: 2px solid var(--brand); background: var(--brand-soft); }
.plan h3 { margin: 0; font-size: 1.15rem; }
.plan-badge { position: absolute; top: -11px; left: 50%; transform: translateX(-50%); background: var(--brand); color: #fff; font-size: .72rem; font-weight: 700; padding: 3px 10px; border-radius: 99px; white-space: nowrap; }
.plan-price { display: flex; align-items: baseline; gap: 6px; margin-top: 8px; }
.plan-price strong { font-size: 1.7rem; letter-spacing: -.01em; }
.plan-bill { min-height: 2.4em; }
.plan ul { list-style: none; padding: 0; margin: 8px 0 14px; display: grid; gap: 6px; font-size: .86rem; flex: 1; }
.plans.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; max-width: 100%; margin: 0 0 14px; }
.plans.compact .plan { padding: 16px 14px; }
.plans.compact .plan ul { display: none; }
.plans.compact .plan-price strong { font-size: 1.3rem; }
.modal.checkout { width: min(860px, 100%); }
.pay-methods { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; }
.pay-opt { display: flex; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; font-size: .88rem; }
.pay-opt.on { border-color: var(--brand); background: var(--brand-soft); }
.pay-opt input { width: 16px; height: 16px; min-height: 0; accent-color: var(--brand); }
.order { margin-top: 16px; background: var(--surface-2); border-radius: 12px; padding: 12px 14px; display: grid; gap: 6px; }
.order > div { display: flex; justify-content: space-between; gap: 10px; }
.plan-pill { background: var(--brand-soft); color: var(--brand); border-radius: 10px; padding: 8px 10px; font-size: .82rem; font-weight: 600; }
@media (max-width: 900px) {
  .l-hero { grid-template-columns: 1fr; padding-top: 32px; }
  .plans { grid-template-columns: 1fr; }
  .plans.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
}
@media (max-width: 640px) {
  .l-nav { padding: 10px 16px; }
  .l-links { display: none; }
  .l-nav .row-gap .btn.ghost { display: none; }
  .l-hero, .l-section { padding-left: 16px; padding-right: 16px; }
  .l-stats { gap: 18px; }
  .plans.compact { grid-template-columns: 1fr; }
  .plans.compact .plan { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
  .plans.compact .plan .btn { width: 100%; }
  .pricing-controls select { min-width: 0; width: 100%; }
}

/* ---------- Targets ---------- */
.trows { display: grid; gap: 10px; }
.trow { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--surface-2); }
.trow:hover, .trow.on { border-color: var(--brand); background: var(--brand-soft); }
.trow-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-bottom: 8px; font-size: .9rem; }
.trow-nums { margin-top: 6px; }
.tbar { position: relative; height: 10px; border-radius: 99px; background: var(--line); }
.tbar-fill { height: 100%; border-radius: 99px; }
.tbar-fill.good { background: var(--good); } .tbar-fill.bad { background: var(--danger); } .tbar-fill.warn { background: var(--warn); }
.tbar-mark { position: absolute; top: -4px; width: 2px; height: 18px; background: var(--text); border-radius: 2px; transform: translateX(-1px); }
.target-strip { border-color: var(--brand); }

/* ---------- Drill-down ---------- */
.click { cursor: pointer; }
.kpi.click { transition: border-color .15s, transform .1s, box-shadow .15s; }
.kpi.click:hover, .kpi.click:focus-visible { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); outline: none; }
.kpi.click:active, .hbar.click:active { transform: scale(.98); }
.kpi-label { display: flex; justify-content: space-between; gap: 6px; }
.go { color: var(--brand); font-weight: 700; }
.hbar.click { padding: 6px 8px; margin: -6px -8px; border-radius: 8px; }
.hbar.click:hover, .hbar.click:focus-visible { background: var(--brand-soft); outline: none; }
.legend li.click { padding: 3px 6px; margin: -3px -6px; border-radius: 6px; }
.legend li.click:hover { background: var(--brand-soft); }
circle.click:hover, rect.click:hover { opacity: .8; }
.stackbar .click:hover { filter: brightness(1.15); }
tr.click:hover td { background: var(--brand-soft); }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: -4px 0 14px; }
.crumb { border: 1px solid var(--brand); background: var(--brand-soft); color: var(--brand); border-radius: 999px; padding: 4px 11px; font: inherit; font-size: .8rem; font-weight: 600; cursor: pointer; }
.crumb.home { background: var(--surface); }
.crumb:hover { background: var(--brand); color: #fff; }
.crumbs .sep { color: var(--muted); }

/* ---------- Workspace Launchpad & All-Sections Buttons ---------- */
.launchpad-card-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 20px; box-shadow: var(--shadow); margin-bottom: 24px; }
.launchpad-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.launchpad-title-wrap { display: flex; align-items: center; gap: 12px; }
.launchpad-icon-badge { width: 44px; height: 44px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); display: flex; align-items: center; justify-content: center; font-size: 1.4rem; flex-shrink: 0; }
.launchpad-title-wrap h2 { margin: 0; font-size: 1.25rem; font-weight: 700; color: var(--text); letter-spacing: -0.01em; }
.launchpad-filter-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.launchpad-filter-btn { background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); font-size: 0.78rem; font-weight: 600; padding: 6px 14px; border-radius: 99px; cursor: pointer; transition: all 0.2s ease; }
.launchpad-filter-btn:hover { background: var(--surface); color: var(--text); border-color: var(--brand); }
.launchpad-filter-btn.active { background: var(--brand); color: #ffffff; border-color: var(--brand); }
.launchpad-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.launchpad-btn { display: flex; flex-direction: column; justify-content: space-between; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; text-decoration: none; color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,0.04); transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1); position: relative; overflow: hidden; text-align: left; cursor: pointer; }
.launchpad-btn:hover { transform: translateY(-3px); border-color: var(--brand); box-shadow: 0 10px 24px rgba(59, 107, 76, 0.12); }
.launchpad-btn:active { transform: translateY(-1px); }
.launchpad-btn-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.launchpad-btn-icon { width: 42px; height: 42px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.35rem; background: var(--surface-2); border: 1px solid var(--line); flex-shrink: 0; transition: transform 0.2s ease; }
.launchpad-btn:hover .launchpad-btn-icon { transform: scale(1.08); }
.launchpad-btn-badge { font-size: 0.7rem; font-weight: 600; padding: 3px 8px; border-radius: 6px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.launchpad-btn-badge.active { background: rgba(16, 185, 129, 0.12); color: #065f46; border-color: rgba(16, 185, 129, 0.3); }
.launchpad-btn-badge.locked { background: rgba(234, 179, 8, 0.15); color: #b45309; border-color: rgba(234, 179, 8, 0.35); }
.launchpad-btn-eyebrow { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin-bottom: 3px; }
.launchpad-btn-title { font-size: 0.98rem; font-weight: 700; color: var(--text); margin: 0 0 6px; line-height: 1.3; }
.launchpad-btn-desc { font-size: 0.8rem; color: var(--muted); margin: 0; line-height: 1.45; flex: 1; }
.launchpad-btn-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 0.78rem; font-weight: 600; color: var(--brand); }
.launchpad-btn-foot span:last-child { transition: transform 0.2s ease; }
.launchpad-btn:hover .launchpad-btn-foot span:last-child { transform: translateX(4px); }

/* ---------- Print ---------- */
@media print {
  .topbar, .sidebar, .no-print, .report-tabs, .scrim { display: none !important; }
  .main { padding: 0; max-width: none; }
  body { background: #fff; }
  .card, .kpi { box-shadow: none; break-inside: avoid; }
}
