/* ==========================================================
   Teleprompter Flow — Studio-dark aesthetic
   ========================================================== */
:root {
  --bg: #0a0a0c;
  --bg-2: #121216;
  --bg-3: #1a1a20;
  --line: rgba(242, 237, 228, 0.08);
  --line-2: rgba(242, 237, 228, 0.16);
  --ink: #f2ede4;
  --ink-2: rgba(242, 237, 228, 0.62);
  --ink-3: rgba(242, 237, 228, 0.38);
  --onair: #ff4a3d;
  --amber: #ffb547;
  --ok: #5fd68a;
  --display: Georgia, "Times New Roman", serif;
  --body: Arial, Helvetica, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --prompt-color: #f2ede4;
  --prompt-size: 56px;
  --prompt-lh: 1.5;
  --prompt-width: 80%;
  --readline: 35%;
  --radius: 10px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
body::before { /* film grain */
  content: "";
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { margin: 0; font-weight: 400; }
kbd {
  font-family: var(--mono); font-size: .8em;
  padding: .1em .45em; border: 1px solid var(--line-2); border-bottom-width: 2px;
  border-radius: 5px; background: var(--bg-3); color: var(--ink);
  white-space: nowrap;
}

/* ---------- Editor ---------- */
.editor {
  position: relative; z-index: 1;
  max-width: 1200px; margin: 0 auto; padding: 40px 28px 60px;
  animation: rise .6s cubic-bezier(.2,.7,.2,1) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(14px);} to { opacity: 1; transform: none;} }

.masthead { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 32px; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand-dot {
  width: 12px; height: 12px; border-radius: 50%; background: var(--onair);
  box-shadow: 0 0 0 4px rgba(255,74,61,.15), 0 0 18px rgba(255,74,61,.6);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(255,74,61,.08), 0 0 26px rgba(255,74,61,.9);} }
.brand h1 { font-family: var(--display); font-size: clamp(28px, 4vw, 40px); letter-spacing: -.01em; font-weight: 500; }
.brand h1 em { font-style: italic; font-weight: 300; color: var(--amber); }
.tagline { margin: 0; color: var(--ink-3); font-size: 14px; letter-spacing: .02em; }

.editor-grid {
  display: grid; grid-template-columns: 260px 1fr; gap: 18px;
}
@media (max-width: 820px) { .editor-grid { grid-template-columns: 1fr; } }

.library, .workspace {
  background: linear-gradient(180deg, var(--bg-2), var(--bg));
  border: 1px solid var(--line); border-radius: var(--radius);
}
.library { display: flex; flex-direction: column; min-height: 420px; }
.library-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.library-head h2 { font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-3); }
.script-list { list-style: none; margin: 0; padding: 8px; flex: 1; overflow: auto; }
.script-list li {
  padding: 10px 12px; border-radius: 7px; cursor: pointer;
  display: flex; flex-direction: column; gap: 2px;
  border: 1px solid transparent; transition: background .15s, border-color .15s;
}
.script-list li:hover { background: rgba(255,255,255,.03); }
.script-list li.active { background: rgba(255,181,71,.08); border-color: rgba(255,181,71,.25); }
.script-list li .t { font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.script-list li .m { font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.library-foot { display: flex; gap: 6px; padding: 10px; border-top: 1px solid var(--line); flex-wrap: wrap; }

.workspace { display: flex; flex-direction: column; min-height: 520px; }
.title-input {
  background: transparent; border: 0; border-bottom: 1px solid var(--line);
  padding: 18px 22px; font-family: var(--display); font-size: 24px; font-weight: 500; outline: none;
}
.title-input:focus { border-bottom-color: var(--amber); }
.text-input {
  flex: 1; background: transparent; border: 0; resize: vertical; min-height: 360px;
  padding: 22px; font-size: 18px; line-height: 1.7; outline: none; color: var(--ink);
}
.text-input::placeholder, .title-input::placeholder { color: var(--ink-3); }
.workspace-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 14px 22px; border-top: 1px solid var(--line);
}
.stats { font-family: var(--mono); font-size: 12px; color: var(--ink-3); display: flex; gap: 10px; }
.stats .saved { color: var(--ok); transition: color .3s; }
.stats .saved.dirty { color: var(--amber); }
.start-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.mode-pick { display: inline-flex; border: 1px solid var(--line-2); border-radius: 999px; padding: 3px; }
.mode-pick label { position: relative; }
.mode-pick input { position: absolute; opacity: 0; inset: 0; }
.mode-pick span {
  display: inline-block; padding: 6px 14px; border-radius: 999px; font-size: 13px; color: var(--ink-2);
  transition: background .15s, color .15s;
}
.mode-pick input:checked + span { background: var(--ink); color: var(--bg); font-weight: 500; }
.mode-pick input:focus-visible + span { outline: 2px solid var(--amber); }

.btn {
  border: 1px solid var(--line-2); background: transparent; border-radius: 8px;
  padding: 8px 14px; font-size: 13px; color: var(--ink-2);
  transition: background .15s, color .15s, border-color .15s, transform .1s;
}
.btn:hover { color: var(--ink); border-color: var(--ink-3); background: rgba(255,255,255,.03); }
.btn:active { transform: translateY(1px); }
.btn-danger:hover { color: var(--onair); border-color: var(--onair); }
.btn-primary {
  background: var(--ink); color: var(--bg); border-color: var(--ink); font-weight: 500; font-size: 15px;
  padding: 12px 22px; display: inline-flex; align-items: center; gap: 10px;
}
.btn-primary:hover { background: #fff; color: #000; }
.onair { width: 9px; height: 9px; border-radius: 50%; background: var(--onair); box-shadow: 0 0 10px var(--onair); }
.file-btn { display: inline-block; }

.hints { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin-top: 28px; }
.hint { padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,255,255,.015); }
.hint h3 { font-family: var(--display); font-size: 17px; margin-bottom: 6px; color: var(--amber); }
.hint p { margin: 0; font-size: 13px; color: var(--ink-2); line-height: 1.65; }
.hint.warn { border-color: rgba(255,74,61,.4); }
.hint.warn h3 { color: var(--onair); }
.foot { margin-top: 36px; text-align: center; font-size: 12px; color: var(--ink-3); }

/* ---------- Prompter ---------- */
.prompter {
  position: fixed; inset: 0; z-index: 10; background: #000; overflow: hidden;
  cursor: none;
}
.prompter.hud-visible { cursor: default; }
.prompter[hidden] { display: none; }

.stage-wrap { position: absolute; inset: 0; transform: scaleX(var(--mx, 1)) scaleY(var(--my, 1)); }
.stage {
  position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden;
  scrollbar-width: none; outline: none;
}
.stage::-webkit-scrollbar { display: none; }
.pad-top { height: var(--readline); }
.pad-bottom { height: 100vh; }
.script {
  width: var(--prompt-width); margin: 0 auto;
  font-size: var(--prompt-size); line-height: var(--prompt-lh);
  color: var(--prompt-color); font-weight: 400;
  text-align: left; padding: 0 12px;
}
.script p { margin: 0 0 .9em; }
.script .w { transition: opacity .35s, color .25s; border-radius: .12em; }
.prompter.dim-read .script .w.read { opacity: .32; }
.script .w.current { color: var(--amber); }
.prompter.mode-flow .script .w.current { text-shadow: 0 0 22px rgba(255,181,71,.35); }

.readline {
  position: absolute; left: 0; right: 0; top: var(--readline); height: 0; pointer-events: none;
  border-top: 1px solid rgba(255,74,61,.5);
}
.readline::before, .readline::after {
  content: ""; position: absolute; top: -7px; width: 0; height: 0;
  border-top: 7px solid transparent; border-bottom: 7px solid transparent;
}
.readline::before { left: 8px; border-left: 12px solid var(--onair); }
.readline::after { right: 8px; border-right: 12px solid var(--onair); }
.readline-tag {
  position: absolute; right: 28px; top: -18px; font-family: var(--mono); font-size: 10px; letter-spacing: .2em;
  color: rgba(255,74,61,.7);
}
.prompter.no-readline .readline { display: none; }
.vignette {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(0,0,0,.85) 0%, rgba(0,0,0,0) 18%, rgba(0,0,0,0) 78%, rgba(0,0,0,.85) 100%);
}

/* HUD */
.hud {
  position: absolute; left: 0; right: 0; z-index: 5;
  display: flex; align-items: center; gap: 14px; padding: 14px 18px;
  opacity: 0; transition: opacity .25s, transform .25s; pointer-events: none;
}
.hud-top { top: 0; justify-content: space-between; transform: translateY(-8px);
  background: linear-gradient(180deg, rgba(0,0,0,.75), transparent); }
.hud-bottom { bottom: 0; justify-content: center; transform: translateY(8px);
  background: linear-gradient(0deg, rgba(0,0,0,.75), transparent); }
.prompter.hud-visible .hud { opacity: 1; transform: none; pointer-events: auto; }
.hud-group { display: flex; align-items: center; gap: 8px; }
.hud-btn {
  background: rgba(20,20,24,.85); border: 1px solid var(--line-2); color: var(--ink-2);
  border-radius: 8px; padding: 7px 12px; font-size: 13px; backdrop-filter: blur(8px);
  transition: color .15s, border-color .15s, background .15s;
}
.hud-btn:hover { color: var(--ink); border-color: var(--ink-3); }
.hud-btn.active { background: var(--ink); color: var(--bg); border-color: var(--ink); font-weight: 500; }
.modes .mode-btn[data-mode="flow"].active { background: var(--onair); border-color: var(--onair); color: #fff; }
.hud-play { font-size: 18px; width: 46px; height: 46px; padding: 0; border-radius: 50%; }
.hud-slider {
  display: flex; flex-direction: column; gap: 4px; font-family: var(--mono); font-size: 11px; color: var(--ink-3);
  letter-spacing: .06em; text-transform: uppercase;
}
.hud-slider b { color: var(--ink); font-weight: 500; }
.hud-slider input { width: 160px; }
.hud-slider.disabled { opacity: .35; pointer-events: none; }
input[type="range"] { accent-color: var(--amber); }

.status { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12px; color: var(--ink-2); }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ink-3); }
.status.listening .status-dot { background: var(--onair); box-shadow: 0 0 10px var(--onair); animation: pulse 1.4s infinite; }
.status.running .status-dot { background: var(--ok); }
.status.error .status-dot { background: var(--amber); }
.clock { font-family: var(--mono); font-size: 13px; color: var(--ink-3); min-width: 48px; }

/* Settings panel */
.settings {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(360px, 92vw); z-index: 6;
  background: rgba(14,14,18,.96); border-left: 1px solid var(--line-2);
  padding: 18px 20px 30px; overflow: auto; backdrop-filter: blur(12px);
  animation: slidein .25s cubic-bezier(.2,.7,.2,1);
}
.settings[hidden] { display: none; }
@keyframes slidein { from { transform: translateX(30px); opacity: 0; } }
.settings-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.settings-head h2 { font-family: var(--display); font-size: 20px; }
.set { display: flex; flex-direction: column; gap: 6px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--ink-2); }
.set b { color: var(--ink); font-weight: 500; font-family: var(--mono); }
.set select {
  background: var(--bg-3); border: 1px solid var(--line-2); border-radius: 6px; padding: 7px 10px; color: var(--ink);
}
.set-check { flex-direction: row; align-items: center; gap: 10px; cursor: pointer; }
.set-check input { accent-color: var(--amber); width: 16px; height: 16px; }
.swatches { display: flex; gap: 8px; }
.swatches button {
  width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; background: var(--c);
  transition: transform .15s, border-color .15s;
}
.swatches button:hover { transform: scale(1.1); }
.swatches button.active { border-color: var(--amber); }

/* Erkennungsanzeige */
.heard {
  position: absolute; left: 18px; bottom: 18px; z-index: 4; max-width: min(46vw, 520px);
  display: flex; align-items: baseline; gap: 10px;
  font-family: var(--mono); font-size: 13px; color: var(--ink-2);
  background: rgba(10,10,12,.7); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px;
  white-space: nowrap; overflow: hidden; pointer-events: none;
}
.heard[hidden] { display: none; }
.heard-label { font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: rgba(255,74,61,.8); flex: none; }
.heard .interim { color: var(--ink-3); font-style: italic; }
.prompter.hud-visible .heard { bottom: 96px; }
.set small { color: var(--ink-3); font-size: 11px; line-height: 1.4; }
.script .w { cursor: pointer; }

/* Countdown + toast */
.countdown {
  position: absolute; inset: 0; z-index: 8; display: grid; place-items: center;
  background: rgba(0,0,0,.6); backdrop-filter: blur(4px);
}
.countdown[hidden] { display: none; }
.countdown span {
  font-family: var(--display); font-size: clamp(120px, 30vw, 300px); font-weight: 300; font-style: italic; color: var(--amber);
  animation: tick 1s ease-out infinite;
}
@keyframes tick { from { transform: scale(1.15); opacity: 0; } 20% { opacity: 1; } to { transform: scale(.95); opacity: .6; } }
.toast {
  position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 9;
  background: rgba(20,20,24,.95); border: 1px solid var(--line-2); border-left: 3px solid var(--amber);
  padding: 10px 16px; border-radius: 8px; font-size: 14px; max-width: 80vw;
  animation: rise .25s ease-out;
}
.toast[hidden] { display: none; }
.toast.error { border-left-color: var(--onair); }

@media (max-width: 700px) {
  .hud-slider input { width: 110px; }
  .hud { gap: 8px; padding: 10px; flex-wrap: wrap; }
  .clock { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* Vorbereitung und verlässliche Rückmeldungen */
[hidden] { display: none !important; }
.workspace, .library, .prep-controls { min-width: 0; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
.text-input:focus-visible { outline-offset: -3px; }
button:disabled, input:disabled + span { opacity: .45; cursor: not-allowed; }
.stats { flex-wrap: wrap; row-gap: 4px; }
.writing-tools { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px 16px; border-bottom: 1px solid var(--line); }
.writing-tools .btn { border-color: transparent; padding: 5px 9px; font-size: 12px; }
.writing-tools #btnHistory { margin-left: auto; }
.save-notice { padding: 14px 22px; background: rgba(255,74,61,.1); color: var(--ink); border-top: 1px solid var(--onair); font-size: 13px; }
.preparation { border-top: 1px solid var(--line); padding: 18px 22px; }
.preparation summary { cursor: pointer; font-size: 16px; font-weight: 400; color: var(--ink); }
.preparation summary span { display: inline-block; margin-left: 8px; color: var(--ink-2); font-size: 12px; font-weight: 300; }
.preparation-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(200px, .8fr); gap: 22px; margin-top: 18px; }
.preview { position: relative; height: 244px; overflow: hidden; background: #000; border: 1px solid var(--line-2); border-radius: 8px; }
.preview::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(transparent 60%, #000); }
#previewText { height: 100%; overflow: hidden; padding: 24px 20px; line-height: var(--prompt-lh); color: var(--prompt-color); font-weight: 400; }
#previewText p { margin: 0 0 .7em; white-space: pre-wrap; overflow-wrap: anywhere; }
.preview-label { position: absolute; bottom: 12px; left: 14px; z-index: 1; color: var(--amber); font: 10px var(--mono); letter-spacing: .16em; }
.prep-controls { display: flex; flex-direction: column; gap: 11px; font-size: 12px; color: var(--ink-2); }
.prep-controls label { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.prep-controls input[type="range"] { width: 100%; margin: 0; }
.prep-controls select, .section-picker select { min-width: 0; max-width: 100%; background: var(--bg-3); border: 1px solid var(--line-2); border-radius: 6px; padding: 7px 9px; color: var(--ink); }
.prep-controls .prep-check { justify-content: flex-start; flex-wrap: nowrap; }
.prep-check input { flex: none; accent-color: var(--amber); }
.mic-check { display: flex; align-items: center; gap: 14px; margin-top: 18px; }
.mic-check .btn { flex: none; }
.mic-check p { font-size: 12px; color: var(--ink-2); margin: 0; }
.prep-note { margin: 12px 0 0; font-size: 11px; color: var(--ink-2); }
.script p { white-space: pre-wrap; overflow-wrap: anywhere; }
.script strong, #previewText strong { font-weight: 600; text-decoration: underline; text-decoration-color: var(--amber); text-underline-offset: .15em; }
.cue { display: inline; font-size: .55em; font-weight: 400; color: var(--amber); background: rgba(255,181,71,.1); border-radius: 5px; padding: .15em .35em; vertical-align: middle; }
.history-dialog { width: min(620px, calc(100vw - 32px)); max-height: 80vh; background: var(--bg-2); color: var(--ink); border: 1px solid var(--line-2); border-radius: 12px; padding: 24px; }
.history-dialog::backdrop { background: rgba(0,0,0,.75); }
.history-dialog > p, .history-dialog article p { color: var(--ink-2); font-size: 13px; overflow-wrap: anywhere; white-space: pre-wrap; }
.history-dialog article { padding: 16px 0; border-top: 1px solid var(--line-2); }
.history-dialog article h3 { font-size: 14px; }
.library-toggle { display: none; }
.session-info { position: absolute; bottom: 12px; right: 18px; display: flex; align-items: center; gap: 10px; color: var(--ink-2); font: 11px var(--mono); pointer-events: none; }
.session-info progress { width: 60px; height: 3px; accent-color: var(--amber); }
.hud-bottom { bottom: 26px; }
.section-picker { display: flex; flex-direction: column; gap: 3px; min-width: 0; max-width: 180px; font: 10px var(--mono); color: var(--ink-2); }
.section-picker select { font-size: 12px; width: 100%; }
.heard { bottom: 40px; }
.prompter.hud-visible .heard { bottom: 122px; }
.countdown-content { display: flex; flex-direction: column; align-items: center; }
.countdown-content > span { line-height: 1.2; }
.countdown-content .btn { background: var(--bg-2); color: var(--ink); }
@media (max-width: 820px) {
  .library { min-height: 0; }
  .library-toggle { display: inline-block; margin-left: auto; }
  .library-head { gap: 8px; }
  .library:not(.expanded) .script-list, .library:not(.expanded) .library-foot { display: none; }
  .library.expanded .script-list { max-height: 220px; }
}
@media (max-width: 600px) {
  .editor { padding: 24px 14px 36px; }
  .masthead { gap: 8px; margin-bottom: 20px; }
  .brand { gap: 10px; }
  .tagline { font-size: 12px; color: var(--ink-2); }
  .title-input { padding: 16px; width: 100%; }
  .text-input { padding: 16px; font-size: 16px; }
  .workspace-foot, .preparation { padding: 16px; }
  .start-row { width: 100%; }
  .btn-start { width: 100%; justify-content: center; }
  .stats { font-size: 10px; gap: 7px; }
  .preparation summary span { display: block; margin: 3px 0 0 16px; }
  .preparation-grid { grid-template-columns: 1fr; gap: 16px; }
  .preview { height: 180px; }
  .mic-check { align-items: flex-start; flex-direction: column; gap: 9px; }
  .hud-top { justify-content: flex-start; row-gap: 6px; }
  .hud-top .hud-group:last-child { width: 100%; justify-content: space-between; }
  .hud-btn { min-height: 38px; padding: 6px 10px; }
  .hud-top .modes { margin-left: auto; }
  .hud-bottom { gap: 10px; }
  .hud-slider input { width: 88px; }
  .section-picker { max-width: none; width: 100%; flex-direction: row; align-items: center; gap: 10px; }
  .section-picker select { width: min(75vw, 320px); }
  .session-info { right: 10px; bottom: 10px; font-size: 10px; }
  .prompter.hud-visible .heard { bottom: 160px; }
  .heard { max-width: calc(100vw - 28px); left: 14px; }
  .toast { bottom: 175px; }
  .hud-top { padding-top: max(10px, env(safe-area-inset-top)); }
}
.prompter.flow-searching .hud-top { opacity: 1; transform: none; pointer-events: auto; }
.library { align-self: start; width: 100%; }
@media (max-width: 600px) {
  .hud-bottom { background: linear-gradient(transparent, rgba(0,0,0,.94) 20%); }
}

/* Ein Konto, mehrere Bildschirme */
.masthead { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 12px; row-gap: 8px; }
.masthead .tagline { grid-column: 1 / -1; }
.account-menu-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 12px; }
.account-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); }
.signed-in .account-dot { background: var(--ok); }
.account-panel { max-height: calc(100dvh - 32px); overscroll-behavior: contain; }
.account-panel .settings-head { gap: 12px; align-items: flex-start; }
.account-panel h2 { text-wrap: balance; }
.account-panel p { text-wrap: pretty; }
.account-panel .settings-head .btn { flex: none; min-height: 44px; }
.account-summary { overflow-wrap: anywhere; }
body:has(#accountPanel[open]) { overflow: hidden; }
.account-intro, .account-note, #accountMessage, #syncStatus, .account-dialog p { font-size: 13px; color: var(--ink-2); line-height: 1.6; }
.account-note { font-size: 11px; }
.account-form { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-items: end; gap: 14px; }
.account-form label, .connection-controls label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--ink-2); }
.account-form input, .connection-controls input { width: 100%; min-width: 0; padding: 10px 12px; background: var(--bg); border: 1px solid var(--line-2); border-radius: 7px; color: var(--ink); }
.account-form small { font-size: 11px; }
#setupKeyLabel { grid-column: 1 / -1; }
.account-form button { justify-self: start; }
.account-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.account-toolbar strong { margin-right: auto; font-weight: 500; }
.connection-controls { display: flex; align-items: end; flex-wrap: wrap; gap: 10px; }
.device-list { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; font-size: 12px; }
.device-list li { background: rgba(95,214,138,.07); border: 1px solid rgba(95,214,138,.2); border-radius: 6px; padding: 6px 10px; }
#userList article { padding: 12px 0; border-top: 1px solid var(--line); }
#userList article button { margin-right: 8px; }
.sync-badge { position: absolute; z-index: 7; top: 68px; right: 18px; display: flex; align-items: center; gap: 10px; max-width: calc(100% - 36px); padding: 6px 10px; border: 1px solid rgba(95,214,138,.3); border-radius: 8px; background: rgba(10,10,12,.95); color: var(--ok); font: 11px var(--mono); }
.sync-badge.warning { border-color: var(--amber); color: var(--amber); }
.remote-title { position: absolute; left: 18px; top: 76px; color: var(--ink-2); font-size: 12px; max-width: 35%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.following .modes, .following #btnPlay, .following #speedWrap, .following #btnTop, .following .section-picker, .following #btnCancelCountdown { display: none; }
.following .stage { pointer-events: none; }
.following .settings #lang, .following .settings #lead, .following .settings #countdown { pointer-events: none; opacity: .45; }
.sync-warning .hud-top { opacity: 1; pointer-events: auto; transform: none; }
@media (max-width: 600px) {
  .masthead .brand h1 { font-size: clamp(22px, 5.6vw, 28px); }
  .account-menu-button { gap: 6px; padding: 10px; }
  .account-menu-button .account-dot { display: none; }
  .account-panel { width: calc(100% - 16px); max-height: calc(100dvh - 16px); padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
  .account-panel input { font-size: 16px; }
  .account-panel .btn { min-height: 44px; }
  .account-form { grid-template-columns: 1fr; }
  .account-toolbar strong { width: 100%; }
  .connection-controls { align-items: stretch; }
  .connection-controls label, .connection-controls button { width: 100%; }
  .sync-badge { top: 106px; right: 10px; max-width: calc(100% - 20px); font-size: 10px; }
  .remote-title { top: 164px; left: 14px; max-width: calc(100% - 28px); }
}

/* Private Arbeitsbereiche bleiben bis zur bestätigten Anmeldung geschlossen. */
.auth-gate { max-width: 560px; margin: 56px auto; padding: 28px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--bg-2); }
.auth-gate h2 { font-family: var(--display); font-size: 26px; text-wrap: balance; }
.auth-gate p { color: var(--ink-2); text-wrap: pretty; }
.auth-gate .btn { min-height: 44px; }
@media (max-width: 600px) { .auth-gate { margin: 28px 0; padding: 22px; } }

.auth-locked #prompter { visibility: hidden; pointer-events: none; }

.auth-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.auth-gate .guest-note { font-size: 12px; }
.guest-notice { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; color: var(--ink-2); font-size: 13px; }
.guest-notice .btn { min-height: 44px; }
