/* Echoes the Quarto dashboard it replaces: bootswatch "journal" colours,
   sidebar + figure layout, Futura in the figures. */
:root {
  --accent: #eb6864;
  --ink: #222;
  --muted: #666;
  --rule: #e2e2e2;
  --panel: #f7f7f7;
  --orange: #ee7600;
  --blue: #4169e1;
  --violet: #9400d3;
  --plot-font: Futura, "Futura PT", "Century Gothic", "Trebuchet MS", sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: #c94a46; }
code { font-size: 0.92em; background: var(--panel); padding: 0 0.25em; border-radius: 3px; }

.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 1.5rem;
  padding: 0.5rem 1rem;
  background: var(--accent); color: #fff;
}
.brand { display: flex; align-items: baseline; gap: 0.75rem; flex-wrap: wrap; }
#app-title { font-family: var(--plot-font); font-size: 1.35rem; font-weight: 600; }
.author { color: #fff; opacity: 0.85; font-size: 0.85rem; text-decoration: none; }
.author:hover { opacity: 1; text-decoration: underline; }
#tabs { display: flex; flex-wrap: wrap; gap: 0.15rem; }
#tabs button {
  appearance: none; border: 0; background: transparent; color: #fff;
  font: inherit; font-size: 0.95rem; padding: 0.3rem 0.65rem; border-radius: 4px; cursor: pointer; opacity: 0.85;
}
#tabs button:hover { opacity: 1; background: rgba(255, 255, 255, 0.15); }
#tabs button[aria-selected="true"] { opacity: 1; background: rgba(255, 255, 255, 0.25); font-weight: 600; }

.panel { display: none; grid-template-columns: 290px minmax(0, 1fr); gap: 1.5rem; padding: 1.25rem 1rem 2rem; max-width: 1200px; margin: 0 auto; }
.panel.active { display: grid; }
.panel.single { grid-template-columns: minmax(0, 1fr); max-width: 820px; }
.welcome { grid-column: 1 / -1; margin: 0; padding: 0.75rem 1rem; background: var(--panel); border-left: 4px solid var(--accent); border-radius: 4px; }

.sidebar { background: var(--panel); border-radius: 6px; padding: 1rem; align-self: start; }
.sidebar h5 { margin: 0.25rem 0 0.75rem; font-size: 1rem; }
.sidebar h5:not(:first-child) { margin-top: 1.25rem; }
.control { margin-bottom: 0.9rem; }
.control label, .control .label { display: flex; justify-content: space-between; gap: 0.5rem; font-size: 0.9rem; margin-bottom: 0.2rem; }
.control output { font-variant-numeric: tabular-nums; font-weight: 600; color: #c94a46; }
.control input[type="range"] { width: 100%; accent-color: var(--accent); }
.control.disabled { opacity: 0.4; }
.checks label, .radios label { display: flex; justify-content: flex-start; align-items: center; gap: 0.45rem; font-size: 0.9rem; margin: 0.2rem 0; cursor: pointer; }
.checks input, .radios input { accent-color: var(--accent); }
.row { display: flex; gap: 0.5rem; align-items: center; }
.btn {
  appearance: none; border: 1px solid var(--accent); background: #fff; color: #c94a46;
  font: inherit; font-size: 0.85rem; padding: 0.2rem 0.7rem; border-radius: 4px; cursor: pointer;
}
.btn:hover { background: var(--accent); color: #fff; }
.formula { font-family: "Times New Roman", serif; font-style: italic; font-size: 1.15rem; text-align: center; margin: 0.25rem 0; }
.readout {
  font: 0.88rem/1.4 ui-monospace, Menlo, Consolas, monospace;
  background: #fff; border: 1px solid var(--rule); border-radius: 4px; padding: 0.35rem 0.55rem; margin: 0.3rem 0;
}
.note { font-size: 0.85rem; color: var(--muted); margin: 0.5rem 0 0; }

.main { min-width: 0; }
.figure { width: 100%; max-width: 820px; min-height: 200px; position: relative; }
.figure svg { display: block; overflow: visible; }
.plot-title { text-align: center; font-family: var(--plot-font); font-size: 1.15rem; margin: 0 0 0.1rem; }
.plot-subtitle { text-align: center; font-family: var(--plot-font); font-size: 1rem; margin: 0 0 0.25rem; color: #333; }
.empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 0.95rem; pointer-events: none; }
.text { max-width: 820px; text-align: justify; hyphens: auto; }
.text p { margin: 0.75rem 0; }

.subtabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--rule); margin-top: 1rem; }
.subtabs button { appearance: none; border: 1px solid transparent; border-bottom: 0; background: none; font: inherit; font-size: 0.9rem; padding: 0.3rem 0.8rem; cursor: pointer; border-radius: 4px 4px 0 0; color: var(--muted); }
.subtabs button[aria-selected="true"] { border-color: var(--rule); background: #fff; color: var(--ink); margin-bottom: -1px; }
table.stat { border-collapse: collapse; font: 0.88rem/1.4 ui-monospace, Menlo, Consolas, monospace; margin: 0.75rem 0; }
table.stat th, table.stat td { padding: 0.2rem 0.75rem; text-align: right; border-bottom: 1px solid var(--rule); white-space: nowrap; }
table.stat th:first-child, table.stat td:first-child { text-align: left; }
table.stat thead th { font-weight: 600; border-bottom: 1.5px solid #999; }
.table-wrap { overflow-x: auto; }

pre.cite { background: var(--panel); border-radius: 6px; padding: 1rem; overflow-x: auto; font-size: 0.88rem; }
.noscript { padding: 2rem; text-align: center; }

@media (max-width: 820px) {
  .panel, .panel.active { grid-template-columns: minmax(0, 1fr); padding: 1rem 16px 2rem; }
  .topbar { position: static; }
}
