:root {
  --bg: #201522;
  --panel: #37223b;
  --accent: #f472b6;
  --accent-2: #38bdf8;
  --paper: #fff8f3;
  --ink: #2f1d2f;
  --muted: #64748b;
  --line: rgba(148, 163, 184, .34);
  --danger: #ef4444;
  --ok: #22c55e;
  color-scheme: light dark;
}
html[data-theme="light"] {
  --bg: #fff8f3;
  --panel: #ffffff;
  --ink: #2f1d2f;
}
html[data-theme="dark"] {
  --bg: #201522;
  --panel: #37223b;
  --ink: #eff6ff;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
}
.topbar {
  min-height: 82px;
  padding: 16px 28px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  background: color-mix(in srgb, var(--panel) 86%, transparent);
  border-bottom: 1px solid var(--line);
}
.brand-lockup { display: flex; gap: 14px; align-items: center; }
.brand-lockup img { border-radius: 14px; box-shadow: 0 12px 30px rgba(0,0,0,.18); }
.eyebrow { margin: 0 0 3px; color: var(--accent); text-transform: uppercase; font-size: 12px; font-weight: 800; letter-spacing: 0; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 28px; letter-spacing: 0; }
h2 { font-size: 21px; }
h3 { font-size: 16px; }
.theme-control { display: grid; gap: 4px; min-width: 150px; max-width: 100%; font-size: 12px; font-weight: 700; color: var(--muted); }
select, input, textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: color-mix(in srgb, var(--panel) 92%, white);
  color: var(--ink);
}
textarea { min-height: 92px; resize: vertical; }
button {
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  padding: 8px 12px;
  font-weight: 800;
  color: #061018;
  background: var(--accent);
  cursor: pointer;
  white-space: normal;
}
button.secondary { background: color-mix(in srgb, var(--accent-2) 70%, white); }
button.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
button.danger { background: #fecaca; color: #7f1d1d; }
button:disabled { opacity: .55; cursor: not-allowed; }
.app-proof-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  border-bottom: 1px solid var(--line);
  background: var(--line);
}
.app-proof-strip > div {
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  padding: 14px 28px;
  min-width: 0;
}
.app-proof-strip strong { display:block; font-size: 12px; color: var(--accent); text-transform: uppercase; letter-spacing: 0; }
.app-proof-strip span { display:block; margin-top: 5px; font-size: 14px; line-height: 1.35; }
.workspace { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: calc(100vh - 178px); }
.side-nav {
  padding: 18px;
  display: grid;
  align-content: start;
  gap: 8px;
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  border-right: 1px solid var(--line);
}
.side-nav button { width: 100%; justify-content: flex-start; background: transparent; color: var(--ink); border: 1px solid var(--line); }
.side-nav button.active { background: var(--accent); color: #061018; border-color: transparent; }
.content { min-width: 0; padding: 22px; display: grid; gap: 18px; align-content: start; }
.hero-grid, .panel-grid, .two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.three-col { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.panel, .metric, .record-card {
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  min-width: 0;
}
.metric strong { display:block; font-size: 28px; color: var(--accent); }
.metric span { color: var(--muted); }
.toolbar, .button-row { display:flex; flex-wrap: wrap; gap: 10px; align-items:center; }
.form-grid { display:grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; align-items:end; }
.timeline, .board, .report-box { display:grid; gap: 10px; }
.record-card { display:grid; gap: 8px; }
.record-card header { display:flex; justify-content: space-between; gap: 12px; align-items:start; }
.status-chip { display:inline-flex; align-items:center; min-height: 26px; border-radius: 999px; padding: 3px 9px; font-size: 12px; font-weight: 800; background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--ink); }
.warning { border-left: 4px solid var(--accent-2); }
.dangerline { border-left: 4px solid var(--danger); }
.okline { border-left: 4px solid var(--ok); }
.report-output {
  min-height: 220px;
  white-space: pre-wrap;
  background: #061018;
  color: #f8fafc;
  border-radius: 8px;
  padding: 16px;
  overflow: auto;
}
.footer-links { display:flex; gap: 18px; padding: 12px 28px; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--panel) 88%, transparent); }
.footer-links a { color: var(--accent); font-weight: 800; }
@media (max-width: 820px) {
  .topbar, .app-proof-strip, .workspace, .hero-grid, .panel-grid, .two-col, .three-col, .form-grid { grid-template-columns: 1fr; }
  .topbar { flex-direction: column; align-items: stretch; }
  .brand-lockup { min-width: 0; }
  .theme-control { width: 100%; }
  .workspace { display:block; }
  .side-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); border-right:0; border-bottom:1px solid var(--line); }
  .content { padding: 16px; }
}
