:root {
  color-scheme: light;
  --bg: #eef5ff;
  --ink: #071d3a;
  --muted: #5a6f8a;
  --line: #c8d8ee;
  --panel: #ffffff;
  --accent: #2878f0;
  --accent-2: #ffd229;
  --accent-3: #0b2f63;
  --warn: #956500;
  --bad: #c93434;
  --deep: #061936;
  --soft-blue: #e7f0ff;
  --soft-green: #eef8e7;
  --soft-yellow: #fff7cf;
  --soft-red: #fff0ed;
  --shadow: 0 18px 50px rgba(7, 29, 58, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(40, 120, 240, 0.18), transparent 34%),
    linear-gradient(315deg, rgba(255, 210, 41, 0.22), transparent 28%),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

.shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 28px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 28px;
  align-items: end;
  min-height: 235px;
  padding: 28px 0 22px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 850px;
  margin-bottom: 18px;
  font-size: clamp(2.2rem, 4.5vw, 5.2rem);
  line-height: 0.96;
  letter-spacing: 0;
}

h1 span {
  color: var(--accent);
}

#heroByWord {
  color: #c89500;
}

h2 {
  margin-bottom: 0;
  font-size: 1.05rem;
  letter-spacing: 0;
}

.lede {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.55;
}

.hero-panel,
.control-panel,
.demo-stage,
.value-strip article,
.scenario-switch,
.lens-panel,
.chart-panel,
.table-panel,
.explain-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hero-panel {
  display: grid;
  gap: 12px;
  padding: 22px;
  border-top: 4px solid var(--accent-2);
}

.hero-panel div {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-weight: 700;
}

.hero-panel strong {
  font-size: 2rem;
  line-height: 1;
}

.hero-panel p {
  margin: 0;
  color: var(--muted);
}

.status-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--bad);
}

.status-dot.active {
  background: #71b340;
}

.workspace {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 22px;
}

.control-panel {
  align-self: start;
  padding: 18px;
}

.panel-header {
  margin-bottom: 14px;
}

.context-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.38;
}

.panel-header.compact {
  margin-top: 4px;
}

.user-list {
  display: grid;
  gap: 10px;
}

.user-card {
  width: 100%;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.user-card.active {
  border-color: var(--accent);
  background: var(--soft-blue);
}

.avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-3));
  font-weight: 900;
}

.user-card h3 {
  margin: 0 0 4px;
  font-size: 0.96rem;
}

.user-card p,
.user-card small {
  margin: 0;
  color: var(--muted);
  line-height: 1.35;
}

.divider {
  height: 1px;
  margin: 18px 0;
  background: var(--line);
}

.toggle-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 13px 0;
  border-top: 1px solid var(--line);
}

.toggle-row strong,
.toggle-row small {
  display: block;
}

.toggle-row small {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.35;
}

.toggle-row input {
  flex: 0 0 auto;
  width: 46px;
  height: 26px;
  accent-color: var(--accent);
}

.demo-stage {
  min-width: 0;
  padding: 16px;
}

.value-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin-bottom: 16px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #c8d8ee;
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(7, 29, 58, 0.08);
}

.value-strip article {
  min-height: 126px;
  padding: 16px;
  border: 0;
  border-right: 1px solid #dbe6f6;
  border-radius: 0;
  box-shadow: none;
}

.value-strip .value-primary {
  color: var(--ink);
  background: var(--soft-blue);
  border-top: 4px solid var(--accent-2);
}

.value-strip article:last-child {
  border-right: 0;
}

.value-strip span,
.value-strip strong,
.value-strip p {
  display: block;
}

.value-strip span {
  margin-bottom: 10px;
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.value-strip strong {
  font-size: 1.15rem;
}

.value-strip p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.38;
}

.value-strip .value-primary span,
.value-strip .value-primary p {
  color: var(--muted);
}

.value-strip .value-primary strong {
  color: var(--ink);
}

.scenario-switch {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
  padding: 16px;
  color: var(--ink);
  background: #fff;
  border-color: #b7cae8;
  box-shadow: none;
}

.scenario-switch .eyebrow {
  color: var(--accent);
}

.scenario-switch h2 {
  color: var(--ink);
}

.scenario-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.scenario-tab {
  min-height: 104px;
  padding: 14px;
  text-align: left;
  color: var(--muted);
  background: #f6f9ff;
  border: 1px solid #d6e3f7;
  border-radius: 8px;
  cursor: pointer;
}

.scenario-tab.active {
  color: var(--ink);
  background: #fff;
  border-color: var(--accent);
  box-shadow: inset 5px 0 0 var(--accent), inset 0 -4px 0 var(--accent-2), 0 10px 22px rgba(7, 29, 58, 0.08);
}

.scenario-tab span,
.scenario-tab strong,
.scenario-tab small {
  display: block;
}

.scenario-tab span {
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.scenario-tab strong {
  font-size: 1rem;
  color: inherit;
}

.scenario-tab small {
  margin-top: 7px;
  line-height: 1.35;
}

.lens-panel {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  margin-bottom: 16px;
  padding: 16px;
  box-shadow: none;
  border-color: #b7cae8;
}

#lensNarrative {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.4;
}

.lens-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  padding: 6px;
  background: #f0f5ff;
  border: 1px solid #d6e3f7;
  border-radius: 8px;
}

.lens-card {
  min-height: 72px;
  padding: 10px;
  text-align: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  color: var(--muted);
}

.lens-card.active {
  color: var(--ink);
  border-color: #a9c5f5;
  background: #fff;
  box-shadow: 0 8px 18px rgba(7, 29, 58, 0.09), inset 0 -4px 0 var(--accent-2);
}

.lens-card strong,
.lens-card small {
  display: block;
}

.lens-chip {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  justify-content: center;
  margin-bottom: 7px;
  padding: 2px 8px;
  color: var(--deep);
  background: rgba(255, 210, 41, 0.28);
  border: 1px solid rgba(255, 210, 41, 0.7);
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 900;
}

.lens-card.active .lens-chip {
  background: var(--accent-2);
}

.insight-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.insight-card {
  min-height: 96px;
  padding: 14px;
  background: var(--deep);
  color: #fff;
  border-radius: 8px;
}

.insight-card:nth-child(2) {
  background: #113e7d;
}

.insight-card:nth-child(3) {
  background: var(--accent);
}

.insight-card span,
.insight-card strong {
  display: block;
}

.insight-card span {
  color: #bdd5ff;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.insight-card strong {
  margin-top: 8px;
  line-height: 1.3;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.tab {
  padding: 10px 12px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  font-weight: 800;
}

.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.metric {
  min-height: 112px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metric span {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  font-size: 1.75rem;
  line-height: 1;
}

.metric small {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.35;
}

.report-layout {
  display: grid;
  grid-template-columns: 420px minmax(0, 1fr);
  gap: 16px;
}

.chart-panel,
.table-panel,
.explain-panel {
  padding: 16px;
  box-shadow: none;
}

.section-heading {
  margin-bottom: 18px;
}

.section-heading.row,
.audit-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  color: var(--accent);
  background: var(--soft-blue);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 900;
  white-space: nowrap;
}

.bar-chart {
  display: grid;
  gap: 12px;
}

.bar-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 78px;
  gap: 10px;
  align-items: center;
}

.bar-track {
  height: 34px;
  overflow: hidden;
  background: #edf1f4;
  border-radius: 6px;
}

.bar-fill {
  height: 100%;
  min-width: 3px;
  background: linear-gradient(90deg, var(--accent), #63a4ff);
  border-radius: 6px;
  transition: width 220ms ease;
}

.bar-row strong,
.bar-row span {
  font-size: 0.9rem;
}

.bar-row span:last-child {
  color: var(--muted);
  text-align: right;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: 0.9rem;
}

th {
  color: var(--muted);
  background: #f5f7f9;
  font-size: 0.76rem;
  text-transform: uppercase;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.blocked {
  color: #7a2b21;
  background: var(--soft-red);
}

.allowed {
  color: #1f5f40;
  background: var(--soft-green);
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 900;
}

.tag.allowed {
  background: var(--soft-green);
}

.tag.blocked {
  background: var(--soft-red);
}

.tag.masked {
  color: var(--warn);
  background: var(--soft-yellow);
}

.policy-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.policy-card {
  min-height: 180px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.policy-card.active {
  border-color: var(--accent);
  background: var(--soft-blue);
}

.policy-card h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.policy-card p {
  color: var(--muted);
  line-height: 1.45;
}

.policy-card code {
  display: block;
  padding: 10px;
  color: #23313f;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--line);
  border-radius: 6px;
  white-space: normal;
}

.flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.flow div {
  min-height: 112px;
  padding: 14px;
  background: #f7f9fb;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.flow strong,
.flow span {
  display: block;
}

.flow span {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.38;
}

.audit-header {
  margin-bottom: 16px;
}

.secondary-btn {
  min-height: 38px;
  padding: 8px 12px;
  color: var(--accent);
  background: var(--soft-blue);
  border: 1px solid #c8e1eb;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 900;
}

.audit-list {
  display: grid;
  gap: 10px;
}

.audit-item {
  display: grid;
  grid-template-columns: 115px minmax(0, 1fr) 170px;
  gap: 14px;
  align-items: center;
  padding: 13px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.audit-item strong,
.audit-item span,
.audit-item small {
  display: block;
}

.audit-item small {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.35;
}

@media (max-width: 1120px) {
  .hero,
  .workspace,
  .report-layout,
  .scenario-switch,
  .lens-panel {
    grid-template-columns: 1fr;
  }

  .metrics,
  .policy-grid,
  .flow,
  .value-strip,
  .insight-strip,
  .scenario-tabs,
  .lens-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .shell {
    padding: 16px;
  }

  .hero {
    min-height: auto;
  }

  h1 {
    font-size: 2.35rem;
  }

  .metrics,
  .policy-grid,
  .flow,
  .value-strip,
  .insight-strip,
  .scenario-tabs,
  .lens-list {
    grid-template-columns: 1fr;
  }

  .tabs {
    overflow-x: auto;
  }

  .audit-item {
    grid-template-columns: 1fr;
  }
}
