:root {
  --bg: #efeae1;
  --paper: #fffdf8;
  --ink: #1c1915;
  --muted: #5f584e;
  --line: #e0d6c8;
  --accent: #8f2d16;
  --accent-ink: #fff8f3;
  --ok: #1d6b43;
  --warn: #8a5a00;
  --info: #1e4d6b;
  --shadow: 0 1px 0 rgba(28, 25, 21, 0.04);
  --sans: "Segoe UI", "Helvetica Neue", sans-serif;
  --mono: "Cascadia Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
html { font-size: 16px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.45;
}
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: #6d210f; }
.skip {
  position: absolute;
  left: 1rem;
  top: -3rem;
  background: var(--ink);
  color: white;
  padding: 0.4rem 0.7rem;
}
.skip:focus { top: 0.5rem; }

.shell { display: grid; grid-template-columns: 16.5rem 1fr; min-height: 100vh; }
.side {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem 0.85rem 0.9rem;
  background: var(--paper);
  border-right: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: inherit;
  text-decoration: none;
}
.side .brand small, .workspace small { color: var(--muted); }
.brand strong { display: block; font-size: 1.05rem; letter-spacing: 0.01em; }
.brand small { display: block; font-size: 0.78rem; }
.mark {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 6px;
  flex: none;
  background:
    radial-gradient(circle at 50% 42%, #f4f1ea 0 28%, transparent 30%),
    linear-gradient(#9c3418, #9c3418) center 78% / 46% 28% no-repeat,
    #3a342c;
}
.workspace { display: grid; gap: 0.4rem; }
.workspace-label, .who small { color: var(--muted); font-size: 0.75rem; }
.workspace select, .workspace .secondary { width: 100%; }
.pill {
  justify-self: start;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  font-size: 0.75rem;
  color: var(--muted);
  background: white;
}
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.mode-live { background: #e7f2ea; color: var(--ok); border-color: #b7d7c4; }
.mode-demo { background: #f3e4c2; color: #6d4a08; border-color: #e3d0a4; }
.side-nav { display: flex; flex-direction: column; gap: 0.15rem; }
.side-nav a {
  color: var(--ink);
  text-decoration: none;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
}
.side-nav a:hover { background: rgba(255,255,255,0.7); }
.side-nav a.active { background: #fff; box-shadow: var(--shadow); font-weight: 650; }
.side-nav em {
  display: inline-block;
  min-width: 1.2rem;
  margin-left: 0.3rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-style: normal;
  font-size: 0.75rem;
  text-align: center;
}
.account {
  margin-top: auto;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 0.6rem;
  align-items: center;
  padding-top: 0.8rem;
  border-top: 1px solid var(--line);
}
.account .who { display: grid; min-width: 0; }
.account .who strong, .account .who small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account a { grid-column: 1 / -1; }
.account form { grid-column: 1 / -1; }
.account button { width: 100%; }
.avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 650;
}
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(16rem, 1.05fr) minmax(20rem, 0.95fr); }
.auth-story {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2rem;
  padding: 2.2rem 2.4rem;
  background: var(--ink);
  color: #f6f1e8;
}
.auth-story .brand small { color: #cbbfae; }
.auth-story h2 { font-size: 1.7rem; line-height: 1.2; max-width: 28rem; }
.auth-story ul { margin: 1rem 0 0; padding-left: 1.1rem; max-width: 26rem; }
.auth-story li { margin: 0.35rem 0; }
.auth-story p { color: #cbbfae; margin: 0; }
.auth-panel { display: grid; place-items: center; padding: 2rem 1.25rem; }
.auth-card { width: min(100%, 26rem); }
.auth-card h1 { margin-bottom: 0.4rem; }
.auth-card .lede { margin-top: 0; }
.auth-card input:not([type=checkbox]) { width: 100%; }
.auth-mark { display: none; margin-bottom: 1.2rem; }
.auth-card button[type=submit] { width: 100%; }
.auth-links { margin: 0.9rem 0 0; }
main { padding: 1.4rem 1.5rem 3rem; max-width: 72rem; }
.auth-panel main, main.auth-panel { padding: 2rem 1.25rem; max-width: none; }
input:focus, select:focus, textarea:focus { outline: 2px solid #e7cfc6; border-color: #b36a56; }
h1 { font-size: 1.7rem; line-height: 1.15; margin: 0 0 0.35rem; font-weight: 650; }
h2 { font-size: 1.05rem; margin: 1.4rem 0 0.6rem; }
.org-block { margin-top: 1rem; }
.org-block h3 { margin: 0; font-size: 1rem; }
.org-block { margin-top: 1rem; }
.org-block h3 { margin: 0; font-size: 1rem; }
.kicker { color: var(--accent); font-size: 0.82rem; margin: 0 0 0.35rem; letter-spacing: 0.02em; }
.lede { font-size: 1.08rem; max-width: 40rem; }
.muted, .note, .empty { color: var(--muted); }
.note { margin-top: 0.2rem; max-width: 46rem; }
.page-head, .briefing-head, .actions { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.hero, .panel, .briefing, .stats article {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.hero { padding: 1.5rem 1.4rem 1.3rem; max-width: 44rem; }
.panel { padding: 1rem 1.1rem 1.15rem; margin: 0 0 1rem; }
.stack label, .filters label, .check { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.92rem; }
.stack { display: grid; gap: 0.8rem; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
label.check { flex-direction: row; align-items: center; gap: 0.45rem; }
fieldset { border: 1px solid var(--line); border-radius: 10px; display: grid; gap: 0.35rem; }
input, select, button {
  font: inherit;
  color: inherit;
}
input, select {
  background: white;
  border: 1px solid #d5cbbd;
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
}
button, .button {
  background: var(--accent);
  color: var(--accent-ink);
  border: 0;
  border-radius: 8px;
  padding: 0.5rem 0.85rem;
  text-decoration: none;
  cursor: pointer;
}
button.secondary, .button.secondary { background: transparent; color: var(--ink); border: 1px solid #cfc3b4; }
button:hover, .button:hover { filter: brightness(1.05); }
.banner {
  background: #e7f2ea;
  border: 1px solid #b7d7c4;
  color: #144b30;
  padding: 0.65rem 0.8rem;
  border-radius: 10px;
}
.banner.bad { background: #fdeee8; border-color: #efcfc3; color: #6d210f; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; margin: 1rem 0; }
.stats article { padding: 0.8rem 0.9rem; }
.stats span, .facts span { color: var(--muted); font-size: 0.78rem; }
.stats strong { display: block; font-size: 1.6rem; font-weight: 650; }
.stats strong.small { font-size: 0.95rem; font-weight: 600; }
.stats small, td small, .facts small { display: block; color: var(--muted); font-size: 0.78rem; }
.split { display: grid; grid-template-columns: 1.3fr 0.7fr; gap: 1.2rem; }
.alerts { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.45rem; }
.alerts a {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.7rem 0.75rem;
  color: inherit;
  text-decoration: none;
}
.alerts a:hover { border-color: #c8b8a4; }
.alerts strong { display: block; }
.sev {
  flex: none;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: 999px;
  padding: 0.15rem 0.45rem;
  background: var(--line);
}
.sev-high { background: #f3d2c6; color: #6d210f; }
.sev-medium { background: #f3e4c2; color: #6d4a08; }
.sev-low { background: #d5e4ef; color: #1e4d6b; }
.bars { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.4rem; }
.bars li { display: grid; grid-template-columns: 2.2rem 1fr 2rem; gap: 0.45rem; align-items: center; }
.bar { height: 0.55rem; background: #efe6da; border-radius: 99px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--accent); }
.table-wrap { overflow-x: auto; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.55rem 0.7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.78rem; color: var(--muted); font-weight: 600; }
.mono { font-family: var(--mono); font-size: 0.86rem; }
.filters { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: end; margin: 0.4rem 0 0.9rem; }
.filters.links a { color: var(--ink); text-decoration: none; padding: 0.3rem 0.55rem; border-radius: 999px; }
.filters.links a.on { background: var(--ink); color: #f6f1e8; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; margin-top: 0.6rem; }
.facts div { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 0.7rem 0.8rem; }
.facts strong { display: block; font-weight: 600; }
.briefing { padding: 0.9rem 1rem; margin: 0.8rem 0; }
.briefing p { margin: 0.4rem 0 0; max-width: 48rem; }
.pager { display: flex; gap: 0.8rem; align-items: center; }
.steps { margin: 0.4rem 0; padding-left: 1.2rem; }
.steps li { margin: 0.3rem 0; }
code { font-family: var(--mono); font-size: 0.88em; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { border-right: 0; border-bottom: 1px solid var(--line); }
  .account { margin-top: 0; }
  .side-nav { flex-direction: row; overflow-x: auto; }
  .side-nav a { white-space: nowrap; }
  .auth { grid-template-columns: 1fr; }
  .auth-story { display: none; }
  .auth-mark { display: flex; }
  .stats, .split, .facts, .pair { grid-template-columns: 1fr; }
  main { padding: 1rem; }
}
