/* SnapLab -- Kopf, Fuß und Grundfarben wie bei den anderen Labs (PythonLab, StateLab). Hell/dunkel nach
   Systemeinstellung. Keine externen Ressourcen. */

:root {
  --bg: #f4f5f7;
  --panel: #ffffff;
  --ink: #1d2433;
  --muted: #5f6b7f;
  --line: #d5dae2;
  --accent: #2563eb;
  --hi: #f59e0b;
  --ok: #15803d;
  --ok-bg: #e8f6ec;
  --logo: #2a2068;
  --radius: 12px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12161f;
    --panel: #1b212d;
    --ink: #e6e9ef;
    --muted: #9aa5b7;
    --line: #2f3747;
    --accent: #5b8cff;
    --hi: #fbbf24;
    --ok: #4ade80;
    --ok-bg: #173323;
    --logo: #c9c3f2;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font-size: 16px; line-height: 1.4; -webkit-text-size-adjust: 100%;
       display: flex; flex-direction: column; min-height: 100vh; }
body.ide-mode { height: 100vh; height: 100dvh; }
button { font: inherit; color: inherit; }
a { color: var(--accent); }
.loading { color: var(--muted); padding: 2rem 0; }

/* ---------------------------------------------------------------- Kopf und Fuß */

.site-header {
  display: flex; align-items: center; gap: 12px; flex: none;
  padding: max(8px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 8px
           max(16px, env(safe-area-inset-left));
  background: var(--panel); border-bottom: 1px solid var(--line);
}
.site-brand { display: flex; align-items: center; gap: 10px; color: var(--ink); width: 100%; }
.hs-logo { height: 30px; width: auto; color: var(--logo); flex: none; }
.site-org { font-weight: 600; color: var(--logo); }
.site-name { font-weight: 800; padding-left: 10px; border-left: 2px solid var(--line); }
.site-brand a { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.site-brand .hs-link:hover .site-org { text-decoration: underline; }
.site-footer { flex: none; text-align: center; font-size: .75rem; color: var(--muted);
               padding: 6px 16px max(6px, env(safe-area-inset-bottom)); }
.site-footer a { color: inherit; }
@media (max-width: 500px) {
  .site-org { display: none; }
  .site-name { padding-left: 0; border-left: 0; }
}

#app { flex: 1; width: 100%; max-width: 820px; margin: 0 auto; padding: 16px; }
body.ide-mode #app { max-width: none; min-height: 0; display: flex; flex-direction: column; gap: 8px; padding: 10px 16px; }

/* ---------------------------------------------------------------- Übersicht */

.lead { color: var(--muted); margin-top: 0; }
.group h2 { font-size: 1.05rem; margin: 22px 0 8px; }
.group h2 small { color: var(--muted); font-weight: 400; }
.tasks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tasks a {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px; min-height: 48px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--ink); text-decoration: none;
}
.tasks a:hover { border-color: var(--accent); }
.tasks .nr { width: 26px; height: 26px; flex: none; display: grid; place-items: center; border-radius: 50%;
             background: var(--bg); color: var(--muted); font-size: .85rem; font-weight: 600; }
.tasks .done .nr { background: var(--ok); color: var(--panel); }
.privacy { color: var(--muted); font-size: .85rem; margin-top: 24px; }

/* ---------------------------------------------------------------- Aufgabe */

.task-head { flex: none; }
.task-head .back { font-size: .9rem; text-decoration: none; }
.task-head h1 { font-size: 1.2rem; margin: 2px 0 4px; }
.task-head p { margin: 0 0 6px; max-width: 75em; }
.hints { margin: 0; padding-left: 1.2em; color: var(--ink); }
.hints li { margin: 2px 0; }

.toolbar { flex: none; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar button {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px;
  border-radius: 10px; border: 1px solid var(--line); background: var(--panel); cursor: pointer;
  font-weight: 600; touch-action: manipulation;
}
.toolbar button:disabled { opacity: .45; cursor: default; }
.toolbar button.soft { background: color-mix(in srgb, var(--hi) 16%, var(--panel)); border-color: var(--hi); }
.toolbar button.warn { background: var(--hi); border-color: var(--hi); color: #1d2433; }
.toolbar button.on { background: var(--ok-bg); border-color: var(--ok); color: var(--ok); }
.toolbar button[hidden] { display: none; }
.status { color: var(--muted); font-size: .9rem; }
.status.loesung { color: var(--hi); font-weight: 600; }
.spacer { flex: 1; }

.stage { flex: 1; min-height: 360px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
         background: var(--panel); }
.stage iframe { width: 100%; height: 100%; border: 0; display: block; }
