/* Die Seite um die Fenster der App (Web-Version). Farben wie tokens.css. */
:root {
  --bg: #1c1c1e;
  --raised: #2c2c2e;
  --ink: #f5f5f7;
  --ink2: #c7c7cc;
  --ink3: #98989d;
  --line: rgba(255, 255, 255, 0.1);
  --accent: #0a84ff;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-thema="dunkel"]) {
    --bg: #f5f5f7;
    --raised: #ffffff;
    --ink: #1d1d1f;
    --ink2: #3a3a3c;
    --ink3: #6c6c71;
    --line: rgba(0, 0, 0, 0.1);
    --accent: #007aff;
    color-scheme: light;
  }
}
:root[data-thema="hell"] {
  --bg: #f5f5f7;
  --raised: #ffffff;
  --ink: #1d1d1f;
  --ink2: #3a3a3c;
  --ink3: #6c6c71;
  --line: rgba(0, 0, 0, 0.1);
  --accent: #007aff;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.4 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}

#fenster { position: fixed; inset: 0; }
iframe.fenster {
  position: absolute;
  border: 0;
  background: transparent;
}
iframe.fenster.seite { inset: 0; }

#menue-knopf {
  position: fixed;
  top: 10px;
  right: 12px;
  z-index: 300000;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--raised);
  color: var(--ink2);
  cursor: pointer;
}
#menue-knopf[hidden] { display: none; }
#menue-knopf:hover { color: var(--ink); }
#menue-knopf:focus-visible, #menue button:focus-visible, .fokus-dialog button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

#menue {
  position: fixed;
  z-index: 300001;
  min-width: 240px;
  max-height: calc(100vh - 16px);
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--raised);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}
#menue button {
  display: block;
  width: 100%;
  padding: 7px 10px;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
#menue button:hover:not(:disabled) { background: var(--accent); color: #fff; }
#menue button:disabled { color: var(--ink3); cursor: default; }
#menue button[aria-checked="true"]::before { content: "✓ "; }
#menue .trenner { height: 1px; margin: 5px 6px; background: var(--line); }

#lade {
  position: fixed;
  inset: 0;
  z-index: 400000;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  padding: 24px;
  background: var(--bg);
  text-align: center;
}
.lade-ring {
  width: 34px;
  height: 34px;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: drehen 0.9s linear infinite;
}
#lade.fertig .lade-ring { display: none; }
.lade-text { font-size: 16px; font-weight: 600; }
.lade-detail { max-width: 420px; color: var(--ink3); }
@keyframes drehen { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .lade-ring { animation-duration: 3s; } }

.fokus-dialog {
  position: fixed;
  inset: 0;
  z-index: 350000;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.35);
}
.fokus-dialog-kasten {
  width: min(420px, 100%);
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--raised);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}
.fokus-dialog-titel { margin-bottom: 6px; color: var(--ink3); font-size: 12px; }
.fokus-dialog-text { font-size: 15px; font-weight: 600; }
.fokus-dialog-detail { margin-top: 6px; color: var(--ink2); }
.fokus-dialog-knoepfe { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.fokus-dialog button {
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: none;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
.fokus-dialog button.haupt { border-color: transparent; background: var(--accent); color: #fff; }
