:root {
  color-scheme: dark;
  --bg: #0c0c0d;
  --fg: #e8e8e8;
  --muted: #9a9a9a;
  --dim: #6b6b6b;
  --border: rgba(232, 232, 232, 0.12);
  --panel-bg: #131314;
  --panel-bg-hover: #1c1c1d;
  --accent: #e9b8c4;
  --accent-strong: #f0c8d4;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg); color: var(--fg);
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}
#app { max-width: 1120px; margin: 0 auto; padding: 2rem 1.5rem 4rem; }

.audit-nav { font-size: 0.85rem; color: var(--muted); margin-bottom: 1.5rem; font-family: inherit; }
.audit-nav a { color: var(--muted); text-decoration: none; }
.audit-nav a:hover { color: var(--accent-strong); }
.audit-nav .nav-sep { margin: 0 0.5rem; color: var(--dim); }
.audit-nav .nav-current { color: var(--fg); }

.audit-header { margin-bottom: 2rem; border-bottom: 1px solid var(--border); padding-bottom: 1.5rem; }
.audit-header h1 { font-weight: 400; letter-spacing: 0; margin: 0 0 0.25rem; font-size: 1rem; font-family: inherit; }
.audit-title-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.audit-subtitle { color: var(--muted); margin: 0.5rem 0 0; font-size: 0.85rem; line-height: 1.5; max-width: 70ch; font-family: inherit; }

.page-badge { font-family: inherit; font-size: 0.8rem; padding: 0.3rem 0.6rem; border-radius: 3px; border: 1px solid var(--border); color: var(--muted); }
.page-badge-pass, .page-badge-fail { background: transparent; }

.gallery-list { display: flex; flex-direction: column; gap: 0.5rem; }
.gallery-row {
  display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto;
  gap: 0.25rem 1rem; padding: 0.9rem 1.1rem;
  background: var(--panel-bg); border: 1px solid var(--border); border-radius: 4px;
  text-decoration: none; color: inherit;
  transition: background 0.15s, border-color 0.15s;
}
.gallery-row:hover { background: var(--panel-bg-hover); border-color: var(--accent-strong); }
.gallery-row-title { font-weight: 400; font-size: 0.95rem; color: var(--fg); letter-spacing: 0; }
.gallery-row-desc { grid-column: 1 / 2; color: var(--muted); font-size: 0.82rem; line-height: 1.5; max-width: 80ch; }
.gallery-row-arrow { grid-column: 2 / 3; grid-row: 1 / 3; color: var(--dim); font-size: 1rem; align-self: center; }
.gallery-row:hover .gallery-row-arrow { color: var(--accent-strong); }

.audit-cards { display: flex; flex-direction: column; gap: 1.25rem; }
.card { background: var(--panel-bg); border: 1px solid var(--border); border-radius: 4px; padding: 1rem 1.25rem; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.25rem; }
.card-title { margin: 0; font-size: 0.95rem; font-weight: 400; }
.card-badge { font-family: inherit; font-size: 0.75rem; padding: 0.18rem 0.45rem; border-radius: 3px; border: 1px solid var(--border); color: var(--muted); background: transparent; }
.card-desc { color: var(--muted); font-size: 0.85rem; line-height: 1.5; margin: 0.25rem 0 0.75rem; }
.card-visual { margin: 0.75rem 0; display: flex; justify-content: center; }
.card-visual svg { max-width: 100%; height: auto; border-radius: 4px; }
.card-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid var(--border); }

.chip { font-family: inherit; font-size: 0.78rem; padding: 0.22rem 0.55rem; border-radius: 3px; border: 1px solid var(--border); color: var(--muted); white-space: nowrap; background: transparent; }

.strip { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; }
.strip-item { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; }
.strip-caption { font-family: inherit; font-size: 0.75rem; color: var(--muted); }

.audit-table { border-collapse: collapse; font-family: inherit; font-size: 0.82rem; width: auto; margin: 0 auto; }
.audit-table th, .audit-table td { padding: 0.3rem 0.7rem; border: 1px solid var(--border); text-align: right; }
.audit-table th { background: var(--panel-bg); color: var(--fg); font-weight: 400; }
.audit-table td { color: var(--muted); }

.bar-chart { width: 100%; height: auto; }

/* ─────────────────────────────────────────────────────────────────
   Overrides for the dynkin explorer's inline <style> block.
   The bundle's internal CSS uses dark hex literals (#0b1020 / #1f2937
   navy from the squishy-thing IBM-Plex theme); we re-skin the panel
   chrome to inherit the squish.work palette while leaving canvas
   internals (which are pixel-rendered) intact.

   Two generations of class names are covered: the older `facts-bar`
   variant and the current `controls-panel` / `facts-dl` /
   `controls-actions` / `slider-label` variant.
   ───────────────────────────────────────────────────────────── */

/* All panel surfaces */
body .facts-bar,
body .sub-panel,
body .controls-panel {
  background: var(--panel-bg) !important;
  border: 1px solid var(--border) !important;
  border-radius: 4px !important;
}

/* Status row (older bundle): "Removed: α₀ · Subsystem: E₈ · Roots: 240" */
body .status-row {
  color: var(--fg) !important;
  font-family: inherit !important;
  font-size: 0.9rem !important;
}
body .status-label { color: var(--muted) !important; }
body .status-sep { color: var(--dim) !important; }

/* Buttons: reset / clear / def-reset / controls-actions */
body .status-row button,
body .controls-actions button,
body #dyn-reset,
body #dyn-clear,
body #def-reset {
  background: var(--bg) !important;
  color: var(--fg) !important;
  border: 1px solid var(--border) !important;
  border-radius: 3px !important;
  font-family: inherit !important;
  font-size: 0.78rem !important;
  padding: 0.18rem 0.55rem !important;
  cursor: pointer;
}
body .status-row button:hover,
body .controls-actions button:hover,
body #dyn-reset:hover,
body #dyn-clear:hover,
body #def-reset:hover {
  border-color: var(--accent-strong) !important;
  color: var(--accent-strong) !important;
}

/* Column titles ("DEFORMATION") */
body .col-title {
  color: var(--muted) !important;
  font-family: inherit !important;
  text-transform: uppercase !important;
  letter-spacing: 0.06em !important;
  font-size: 0.7rem !important;
}

/* Slider row (mode select + t value) */
body .slider-label {
  color: var(--muted) !important;
  font-family: inherit !important;
  font-size: 0.85rem !important;
}
body .slider-label select {
  background: var(--bg) !important;
  color: var(--fg) !important;
  border: 1px solid var(--border) !important;
  border-radius: 3px !important;
  font-family: inherit !important;
  font-size: 0.85rem !important;
  padding: 0.15rem 0.4rem !important;
}
body .slider-val { color: var(--accent-strong) !important; }
body .deform-note { color: var(--dim) !important; font-size: 0.7rem !important; }
body .pc-legend { color: var(--dim) !important; font-family: inherit !important; }

/* Facts grids — both old (sub-facts-dl) and new (facts-dl) */
body .sub-facts-dl,
body .facts-dl {
  font-family: inherit !important;
  font-size: 0.92rem !important;
}
body .sub-facts-dl dt,
body .facts-dl dt { color: var(--muted) !important; }
body .sub-facts-dl dd,
body .facts-dl dd { color: var(--fg) !important; }
body .sub-facts-dl dd strong,
body .facts-dl dd strong { color: var(--accent-strong) !important; }
body .facts-dl .facts-note { color: var(--muted) !important; }

/* Sub-panel headings ("Subsystem Dynkin", "E8 Coxeter plane", etc.) */
body .sub-panel h3 {
  color: var(--fg) !important;
  font-family: inherit !important;
  font-weight: 400 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  font-size: 0.85rem !important;
}
body .sub-panel h3 .lat-name { color: var(--accent-strong) !important; font-family: inherit !important; }

/* Range slider accent */
body input[type="range"] { accent-color: var(--accent-strong) !important; }

/* Canvases keep their dark internal palette (baked in JS pixels). Soften
   the border to match the surrounding panels. */
body .sub-svg canvas,
body .sub-svg svg {
  border-radius: 3px;
}
