:root {
  --bg: #f4f5f8;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --ink: #111318;
  --muted: #667085;
  --line: #d8dde7;
  --black: #0b0c0f;
  --red: #c81e1e;
  --red-soft: #fff1f1;
  --yellow: #b7791f;
  --yellow-soft: #fff8dc;
  --green: #10783f;
  --green-soft: #effaf3;
  --blue: #1f5fbf;
  --blue-soft: #eef5ff;
  --radius: 8px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
}
button, input, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.eyebrow {
  margin: 0 0 6px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.lock-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.lock-card {
  width: min(520px, 100%);
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 24px 80px rgba(17, 19, 24, .12);
}
.product-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: white;
  background: var(--black);
  border-radius: var(--radius);
  font-weight: 900;
}
h1, h2, h3, p { overflow-wrap: anywhere; }
h1 { margin: 0; font-size: clamp(24px, 4vw, 34px); line-height: 1.1; letter-spacing: 0; }
h2 { margin: 0; font-size: clamp(20px, 2.6vw, 28px); line-height: 1.18; letter-spacing: 0; }
h3 { margin: 0; font-size: 16px; line-height: 1.25; letter-spacing: 0; }
p { color: var(--muted); line-height: 1.58; }
.lock-copy { margin: 14px 0 0; }
.unlock-form { display: grid; gap: 10px; margin-top: 24px; }
label { display: grid; gap: 6px; color: var(--ink); font-size: 12px; font-weight: 900; }
.unlock-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
input, select {
  min-height: 42px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  color: var(--ink);
  padding: 0 12px;
  outline: none;
}
input:focus, select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(31, 95, 191, .13);
}
.unlock-form button, .signal-foot button, .ghost-btn {
  min-height: 42px;
  border: 0;
  border-radius: var(--radius);
  padding: 0 15px;
  color: white;
  background: var(--black);
  font-weight: 900;
}
small { min-height: 18px; color: var(--red); font-weight: 800; }

.shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 390px;
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px;
  background: #101114;
  color: white;
}
.side-brand {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 54px;
}
.side-brand .product-mark { background: white; color: var(--black); }
.side-brand strong, .side-brand span { display: block; }
.side-brand span { margin-top: 3px; color: rgba(255,255,255,.62); font-size: 12px; }
.nav { display: grid; gap: 8px; }
.nav-item {
  width: 100%;
  display: grid;
  gap: 3px;
  padding: 12px;
  text-align: left;
  color: rgba(255,255,255,.68);
  background: transparent;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius);
}
.nav-item strong { color: white; font-size: 14px; }
.nav-item span { font-size: 12px; }
.nav-item.active {
  color: #111318;
  background: white;
  border-color: white;
}
.nav-item.active strong { color: #111318; }
.side-note {
  margin-top: auto;
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--radius);
  color: rgba(255,255,255,.7);
  font-size: 12px;
  line-height: 1.5;
}
.side-note strong { color: white; }

.main-panel { min-width: 0; padding: 18px; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 6;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
  margin-bottom: 14px;
  background: rgba(244,245,248,.92);
  border: 1px solid rgba(216,221,231,.76);
  border-radius: var(--radius);
  backdrop-filter: blur(18px);
}
.meta-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(82px, 1fr));
  gap: 8px;
}
.meta-strip div {
  min-height: 54px;
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.meta-strip span { display: block; color: var(--muted); font-size: 11px; font-weight: 800; }
.meta-strip strong { display: block; margin-top: 4px; font-size: 16px; }
.content { display: grid; gap: 14px; }
.panel {
  min-width: 0;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.panel-title {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 14px;
}
.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 14px;
}
.lead-copy { max-width: 920px; margin: 10px 0 14px; }
.brief-list, .backlog-list, .filtered-list { display: grid; gap: 10px; }

.signal-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-left: 4px solid var(--red);
  border-radius: var(--radius);
}
.signal-card.compact { border-left-color: var(--blue); }
.signal-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.badge-stack, .drawer-badges, .tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: flex-start;
}
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 7px;
  color: #262626;
  background: #f1f3f6;
  border: 1px solid #d8dde7;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}
.badge.act-now, .badge.p0 { color: var(--red); background: var(--red-soft); border-color: #f4b4b4; }
.badge.verify, .badge.p1 { color: var(--yellow); background: var(--yellow-soft); border-color: #f1d37b; }
.badge.watch, .badge.p2 { color: var(--green); background: var(--green-soft); border-color: #b8e3c4; }
.badge.evidence { color: var(--blue); background: var(--blue-soft); border-color: #b8cdf4; }
.badge.vide-score { color: white; background: var(--black); border-color: var(--black); }
.vide-bars {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
}
.vide-bars span {
  display: grid;
  grid-template-columns: 18px 1fr 28px;
  gap: 5px;
  align-items: center;
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}
.vide-bars i {
  display: block;
  height: 7px;
  overflow: hidden;
  background: #e4e8ef;
  border-radius: 999px;
}
.vide-bars i::before {
  content: "";
  display: block;
  width: var(--value);
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--red));
  border-radius: inherit;
}
.vide-bars em {
  color: var(--ink);
  font-style: normal;
  text-align: right;
}
.signal-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.signal-foot button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
}

.health-panel { align-self: start; }
.metric-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 12px; }
.metric-list div {
  min-height: 78px;
  display: grid;
  align-content: center;
  padding: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.metric-list strong { font-size: 28px; line-height: 1; }
.metric-list span { margin-top: 6px; color: var(--muted); font-size: 12px; font-weight: 800; }
.audit-note {
  display: grid;
  gap: 5px;
  margin-top: 10px;
  padding: 12px;
  background: var(--blue-soft);
  border: 1px solid #c7d8f6;
  border-radius: var(--radius);
  color: #24456f;
  font-size: 12px;
  line-height: 1.5;
}

.filter-bar {
  display: grid;
  grid-template-columns: 1.5fr repeat(6, minmax(104px, 1fr));
  gap: 10px;
  padding: 12px;
  margin-bottom: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.filter-bar span { color: var(--muted); font-size: 11px; }
.ghost-btn {
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
}
.signal-table { display: grid; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.signal-row {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 70px 86px 100px 96px 58px;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 12px;
  text-align: left;
  color: var(--ink);
  background: white;
  border: 0;
  border-bottom: 1px solid var(--line);
}
.signal-row:last-child { border-bottom: 0; }
.signal-row:hover, .signal-row.selected { background: #f4f8ff; }
.main-cell { display: grid; gap: 4px; }
.main-cell small { color: var(--muted); font-weight: 700; }
.score { font-weight: 900; color: var(--red); }
.vide-cell {
  display: grid;
  gap: 2px;
}
.vide-cell strong { font-size: 18px; line-height: 1; }
.vide-cell small { color: var(--muted); font-size: 10px; font-weight: 900; }

.matrix {
  display: grid;
  grid-template-columns: 170px repeat(6, minmax(150px, 1fr));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: auto;
}
.matrix > div {
  min-height: 82px;
  padding: 12px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: white;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.matrix .matrix-head {
  min-height: 42px;
  color: var(--ink);
  background: #eceff3;
  font-weight: 900;
}
.matrix .matrix-name {
  color: var(--ink);
  background: var(--surface-2);
  font-weight: 900;
}
.backlog-card, .filtered-card {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.filtered-card { display: grid; border-left: 4px solid var(--green); }
.filtered-card span { color: var(--green); font-size: 12px; font-weight: 900; }
.playbook-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.playbook-card { min-height: 180px; }

.detail-drawer {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  background: white;
  border-left: 1px solid var(--line);
}
.detail-drawer.collapsed { display: none; }
.drawer-inner { display: grid; gap: 12px; padding: 18px; }
.drawer-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}
.drawer-close {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: white;
  font-weight: 900;
}
.detail-block {
  padding: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.detail-block h3 { margin-bottom: 6px; }
.detail-block p { margin: 0; font-size: 13px; }
.detail-block.green-line { border-left: 4px solid var(--green); }
.detail-block.yellow-line { border-left: 4px solid var(--yellow); }
.detail-block.red-line { border-left: 4px solid var(--red); }
.vide-detail { background: #fbfcff; }
.vide-rationale ul {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.evidence-list { display: grid; gap: 8px; }
.evidence-list a {
  display: grid;
  gap: 3px;
  padding: 10px;
  color: var(--blue);
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}
.evidence-list span { color: var(--muted); font-size: 11px; }

@media (max-width: 1280px) {
  .shell { grid-template-columns: 230px minmax(0, 1fr); }
  .detail-drawer {
    position: fixed;
    right: 0;
    top: 0;
    z-index: 20;
    width: min(420px, 100vw);
    box-shadow: -18px 0 48px rgba(17,19,24,.14);
  }
}
@media (max-width: 920px) {
  .shell { display: block; }
  .sidebar {
    position: static;
    height: auto;
  }
  .nav { grid-template-columns: repeat(2, 1fr); }
  .topbar, .overview-grid, .panel-title, .signal-head, .backlog-card { display: grid; grid-template-columns: 1fr; }
  .meta-strip, .metric-list, .playbook-grid { grid-template-columns: repeat(2, 1fr); }
  .filter-bar { grid-template-columns: 1fr 1fr; }
  .signal-row {
    grid-template-columns: 1fr;
    gap: 7px;
  }
}
@media (max-width: 620px) {
  .main-panel, .sidebar, .drawer-inner { padding: 12px; }
  .nav, .meta-strip, .metric-list, .filter-bar, .playbook-grid { grid-template-columns: 1fr; }
  .unlock-row { grid-template-columns: 1fr; }
  .detail-drawer { width: 100vw; }
}
