/* graphigo experiment: shared by index.html and index.de.html.
   Page chrome follows the palette the renderer was mounted with
   (body[data-palette]); the canvas colours come from presetTheme(name).
   Self-contained: no external request, no fonts from outside. */
:root {
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
body, body[data-palette="petrol"] {
  --bg: #0b1416; --raised: #0f1b1e; --line: #1c2e31; --line-strong: #2a4247;
  --ink: #e6f0ee; --muted: #93a8a4; --faint: #5e7370;
  --mark: #46c7b2; --accent: #f08a63; --code-bg: #0a1113;
}
body[data-palette="noir"] {
  --bg: #080808; --raised: #121212; --line: #222222; --line-strong: #333333;
  --ink: #ecece6; --muted: #9a9a94; --faint: #5e5e5a;
  --mark: #e8e34a; --accent: #f4f4ee; --code-bg: #050505;
}
body[data-palette="paper"] {
  --bg: #efeae0; --raised: #faf7f0; --line: #d9d2c4; --line-strong: #c9c0ae;
  --ink: #22211e; --muted: #6b6b66; --faint: #9a958a;
  --mark: #0f766e; --accent: #d9480f; --code-bg: #faf7f0;
}
* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--sans);
  display: flex; flex-direction: column; overflow: hidden;
}
/* Palettenwechsel: die Seite blendet so lange über wie der Canvas (0,6 s). */
body, header, .controls, .controls button, #code, #code .bar, footer, #tip {
  transition: background-color .6s ease, color .6s ease, border-color .6s ease;
}
@media (prefers-reduced-motion: reduce) {
  body, header, .controls, .controls button, #code, #code .bar, footer, #tip { transition: none; }
}
header {
  display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap;
  padding: 10px 16px; border-bottom: 1px solid var(--line); flex: none;
}
header a.mark { color: var(--ink); text-decoration: none; font-family: var(--mono); font-weight: 600; }
header a.mark span { color: var(--mark); }
.hint { color: var(--faint); font-size: 13px; }
.lang { margin-left: auto; font-family: var(--mono); font-size: 12.5px; }
.lang a { color: var(--muted); text-decoration: none; }
.lang a:hover { color: var(--ink); }

/* ── Controls ─────────────────────────────────────────────────────────── */
.controls {
  display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center;
  padding: 8px 16px; border-bottom: 1px solid var(--line); flex: none;
  font-family: var(--mono); font-size: 12.5px;
}
.controls .group { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.controls .label { color: var(--faint); margin-right: 3px; }
.controls button {
  font: inherit; color: var(--muted); background: none; cursor: pointer;
  border: 1px solid var(--line-strong); border-radius: 999px; padding: 2px 10px;
}
.controls button:hover:not(:disabled) { color: var(--ink); }
.controls button[aria-current="true"],
.controls button[aria-pressed="true"] {
  color: var(--bg); background: var(--mark); border-color: var(--mark);
}
.controls button:disabled { color: var(--faint); border-style: dashed; cursor: help; opacity: 0.8; }
.controls .code-toggle { margin-left: auto; border-color: var(--accent); color: var(--accent); }

/* ── Stage ────────────────────────────────────────────────────────────── */
#graphigo-breadcrumbs { font-family: var(--mono); font-size: 12.5px; padding: 6px 16px; flex: none; min-height: 28px; }
main { flex: 1 1 auto; min-height: 0; display: flex; position: relative; }
#graph-host { flex: 1 1 auto; min-width: 0; position: relative; }
#code {
  flex: none; width: min(420px, 42vw); border-left: 1px solid var(--line);
  background: var(--code-bg); display: flex; flex-direction: column; min-height: 0;
}
#code[hidden] { display: none; }
#code .bar {
  display: flex; align-items: baseline; gap: 8px; padding: 8px 12px;
  border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 12px; color: var(--muted);
}
#code .bar button {
  margin-left: auto; font: inherit; color: var(--accent); background: none;
  border: 1px solid var(--accent); border-radius: 999px; padding: 1px 10px; cursor: pointer;
}
#code pre {
  flex: 1 1 auto; overflow: auto; padding: 12px; margin: 0;
  font-family: var(--mono); font-size: 12px; line-height: 1.55; color: var(--ink);
  white-space: pre;
}
#code pre .c { color: var(--faint); }
#code pre .s { color: var(--mark); }
@media (max-width: 760px) {
  #code { position: absolute; inset: 0; width: auto; z-index: 5; border-left: none; }
}

footer {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 8px 16px; border-top: 1px solid var(--line); flex: none;
  font-family: var(--mono); font-size: 12.5px; color: var(--muted);
}
#facts { color: var(--accent); }
#sentence { color: var(--ink); }
#attrib a { color: var(--muted); }
#tip {
  position: fixed; z-index: 10; pointer-events: none;
  background: var(--raised); border: 1px solid var(--line); border-radius: 6px;
  padding: 4px 8px; font-family: var(--mono); font-size: 12px; color: var(--ink);
}
#loading {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: var(--bg); z-index: 10; flex-direction: column; gap: 12px;
}
#loading .mark { font-family: var(--mono); font-size: 22px; font-weight: 600; }
#loading .mark span { color: var(--mark); }
#loading .note { color: var(--faint); font-size: 13px; max-width: 34em; text-align: center; }
