:root {
  --bg: #0f1115;
  --panel: #171a21;
  --panel2: #1d212b;
  --line: #2a2f3a;
  --text: #e8eaf0;
  --muted: #8b93a5;
  --accent: #f59e0b;
  --green: #34d399;
  --red: #f87171;
  --amber-bg: #3a2f0a;
  --red-bg: #3a1410;
  --green-bg: #143a1a;
  --font: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { color-scheme: dark; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.45;
}

button { font: inherit; cursor: pointer; }

a { color: var(--accent); }

a:hover { text-decoration: none; }

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 20px 50px;
}

.noscript {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--red);
  border-radius: 8px;
  color: var(--text);
  background: var(--red-bg);
}

header.masthead {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.header-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

header h1 {
  margin: 4px 0 0;
  font-size: 22px;
  letter-spacing: -0.01em;
  font-weight: 700;
}

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

header p.sub {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  max-width: 640px;
}

.crosslink {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12.5px;
}

.ghost-button {
  min-height: 36px;
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 7px 14px;
  font-weight: 600;
  color: var(--muted);
  background: var(--panel);
  transition: background 0.15s;
}

.ghost-button:hover { background: var(--panel2); }

.layout {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.panel {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

.gauge-panel {
  position: sticky;
  top: 20px;
  text-align: center;
  padding: 20px 16px;
}

.gauge-panel h3 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 700;
}

.gauge-panel .status-line {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 12px;
  min-height: 30px;
}

.gauge-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 4px;
}

#gaugeSvg {
  width: 200px;
  height: 200px;
}

#gaugePctText { font-family: var(--font); }

.score-count {
  margin-top: 6px;
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
}

.score-count small {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

.score-pct {
  margin-top: 4px;
  color: var(--accent);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.02em;
}

.bench-labels {
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.bench-labels span {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.bench-low { background: var(--red-bg); color: var(--red); }
.bench-mid { background: var(--amber-bg); color: var(--accent); }
.bench-high { background: var(--green-bg); color: var(--green); }

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.panel-header h3 { margin: 4px 0 0; font-size: 18px; font-weight: 700; }
.muted { color: var(--muted); }

.checklist { display: grid; gap: 8px; }

.group-label {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.checklist .group-label:first-child { margin-top: 0; }

.check-item {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 10px;
  align-items: center;
  min-height: 52px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.check-item.done {
  border-color: var(--accent);
  background: #1f2412;
  border-left: 3px solid var(--green);
}

.check-toggle {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel2);
  color: transparent;
  font-weight: 700;
  font-size: 13px;
  transition: all 0.15s;
}

.check-item.done .check-toggle {
  color: var(--green);
  border-color: var(--green);
}

.check-toggle:focus-visible,
.info-button:focus-visible,
.ghost-button:focus-visible,
.primary-button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.check-item h4 {
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.35;
}

.check-item.done h4 { color: var(--muted); }

.info-button {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel2);
  color: var(--muted);
  font-weight: 700;
  font-size: 12px;
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  transition: all 0.15s;
}

.info-button:hover {
  background: #222a15;
  border-color: var(--accent);
  color: var(--accent);
}

.closing-note {
  margin: 14px 0 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel2);
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}

.help-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.74);
}

.help-overlay.active { display: flex; }

.help-panel {
  width: min(520px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 20px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
}

.guide-panel { width: min(680px, 100%); }

.help-panel .eyebrow { margin-bottom: 4px; }
.help-panel h2 { margin: 0 0 10px; font-size: 18px; line-height: 1.3; color: var(--text); }

.help-body p,
.guide-lede,
.guide-section p,
.guide-section li {
  color: #b8bcc8;
  font-size: 13px;
  line-height: 1.6;
}

.help-body p { margin: 0 0 10px; }
.help-body p:last-child { margin-bottom: 0; }

.help-body strong,
.guide-section strong {
  color: var(--text);
  font-weight: 700;
}

.help-why {
  margin: 0 0 12px;
  padding: 10px 14px;
  border: 1px solid #2a3a2a;
  border-radius: 8px;
  background: #1a2a18;
  color: #b8e0b0;
  font-size: 12.5px;
  line-height: 1.5;
}

.help-why strong {
  display: block;
  margin-bottom: 2px;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--green);
}

.guide-lede {
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel2);
  color: var(--text);
}

.guide-section { margin: 0 0 14px; }

.guide-section h3 {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
}

.guide-section p { margin: 0 0 8px; }

.guide-section ul {
  margin: 0;
  padding-left: 18px;
}

.guide-section li { margin: 0 0 4px; }

.guide-footer {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.help-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.primary-button {
  min-height: 36px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 7px 14px;
  font-weight: 600;
  color: #000;
  background: var(--accent);
  transition: background 0.15s;
}

.primary-button:hover { background: #d48806; }

.primary-button.is-done {
  color: var(--muted);
  background: var(--panel2);
  border-color: var(--line);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: 320px;
  padding: 11px 14px;
  border-radius: 8px;
  color: var(--text);
  background: #1a1f2e;
  border: 1px solid var(--line);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  font-size: 13px;
}

.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 800px) {
  .layout { grid-template-columns: 1fr; }
  .gauge-panel { position: static; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
