/* Skrivetolk – fælles stylesheet */

:root {
  --ink: #14213d;
  --ink-2: #263559;
  --ink-soft: #e8ecf5;
  --paper: #f4f6fa;
  --surface: #ffffff;
  --slate: #586176;
  --line: #d9dfea;
  --caption: #ffcb2e;
  --ok: #17845a;
  --ok-soft: #e3f4ec;
  --danger: #b3261e;
  --danger-soft: #fbe9e7;
  --focus: #2f6fed;
  --ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --r-ctl: 8px;
  --r-panel: 14px;

  /* Tekstvisning – sættes af common.js */
  --d-size: 32px;
  --d-lh: 1.45;
  --d-font: var(--ui);
  --d-fg: #ffffff;
  --d-bg: #000000;
  --d-weight: 400;
  --d-maxw: 58ch;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--ui);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { line-height: 1.2; margin: 0; letter-spacing: -0.01em; }
a { color: var(--ink); }
code { font-family: ui-monospace, Consolas, monospace; font-size: 0.92em; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.muted { color: var(--slate); }
.small { font-size: 0.86rem; }
.right { text-align: right; }

/* ---------- Knapper og felter ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4em;
  min-height: 40px; padding: 0 16px;
  font: 600 0.95rem/1 var(--ui);
  border-radius: var(--r-ctl); border: 1px solid transparent;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color .15s, border-color .15s;
}
.btn-sm { min-height: 32px; padding: 0 10px; font-size: 0.85rem; }
.btn-block { width: 100%; min-height: 48px; font-size: 1rem; }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--ink-2); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--ink-soft); }
.btn-danger { background: var(--surface); color: var(--danger); border-color: #e7b8b4; }
.btn-danger:hover { background: var(--danger-soft); }
.btn-accent { background: var(--caption); color: var(--ink); }
.btn-accent:hover { background: #ffd95e; }
.btn[disabled] { opacity: .55; cursor: default; }
kbd {
  font: 600 0.75em/1 ui-monospace, Consolas, monospace;
  padding: 2px 5px; border-radius: 4px;
  border: 1px solid currentColor; opacity: .75;
}

.field { display: grid; gap: 6px; }
.field > span:first-child { font-weight: 600; font-size: 0.9rem; }
.field input, .field select, .search, .inline-rename input {
  width: 100%; min-height: 46px; padding: 0 14px;
  font: 1rem var(--ui); color: var(--ink);
  background: var(--surface);
  border: 1px solid #c3cbd9; border-radius: var(--r-ctl);
}
.field input:focus, .field select:focus, .search:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px rgba(47, 111, 237, .22); }
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 70px; }
.pw-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  border: 0; background: transparent; color: var(--slate);
  font: 600 0.85rem var(--ui); padding: 8px 10px; cursor: pointer; border-radius: 6px;
}
.pw-toggle:hover { background: var(--ink-soft); color: var(--ink); }

.notice { padding: 12px 14px; border-radius: var(--r-ctl); font-size: 0.95rem; }
.notice-error { background: var(--danger-soft); color: #7d1b15; border: 1px solid #efc4bf; }
.notice-ok { background: var(--ok-soft); color: #0f5a3d; border: 1px solid #bfe3d2; }
.notice .secret { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.notice .secret code { font-size: 1.15rem; background: #fff; padding: 6px 10px; border-radius: 6px; letter-spacing: .04em; }

.check { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--ink); }

.segmented { display: inline-flex; border: 1px solid #c3cbd9; border-radius: var(--r-ctl); padding: 3px; background: var(--surface); }
.segmented-wide { display: flex; }
.segmented-wide label { flex: 1; }
.segmented label { position: relative; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: block; padding: 8px 14px; border-radius: 6px; font-weight: 600; font-size: 0.9rem; text-align: center; color: var(--slate); }
.segmented input:checked + span { background: var(--ink); color: #fff; }
.segmented input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 1px; }

/* ---------- Login ---------- */
.page-login { background: var(--surface); }
.login { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); min-height: 100vh; }

.stage {
  background: var(--ink);
  color: #fff;
  display: flex; flex-direction: column;
  padding: 40px clamp(28px, 5vw, 72px);
  position: relative; overflow: hidden;
}
.stage::after {
  /* svage tekstlinjer i baggrunden – som en skærm med undertekster */
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(180deg, transparent 0 46px, rgba(255, 255, 255, .035) 46px 47px);
  pointer-events: none;
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.05rem; text-decoration: none; color: var(--ink); letter-spacing: -0.01em; }
.brand-light { color: #fff; }
.brand-mark { width: 30px; height: 30px; flex: none; }
.stage-screen { flex: 1; display: flex; align-items: center; position: relative; z-index: 1; }
.stage-text {
  margin: 0;
  font-size: clamp(30px, 3.6vw, 54px);
  line-height: 1.22; font-weight: 600; letter-spacing: -0.015em;
  max-width: 17ch; min-height: 3.7em;
}
.stage-note { position: relative; z-index: 1; margin: 0; max-width: 42ch; color: #b9c3d8; font-size: 0.98rem; }

.caret {
  display: inline-block; width: 0.12em; min-width: 3px; height: 0.95em;
  margin-left: 0.06em; vertical-align: -0.1em;
  background: var(--caption);
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .caret { animation: none; } }

.login-panel { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.login-form { width: 100%; max-width: 400px; display: grid; gap: 18px; }
.login-form h1 { font-size: 2rem; }
.login-form h1 + .muted { margin: -10px 0 0; }

.role-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.role-option { position: relative; cursor: pointer; }
.role-option input { position: absolute; opacity: 0; pointer-events: none; }
.role-body {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px;
  align-items: center;
  padding: 14px 14px; border: 1.5px solid var(--line); border-radius: 12px;
  background: var(--surface); transition: border-color .15s, background-color .15s;
}
.role-body svg { grid-row: 1 / 3; width: 30px; height: 30px; color: var(--slate); }
.role-body strong { font-size: 1.05rem; }
.role-body small { color: var(--slate); font-size: 0.85rem; }
.role-option:hover .role-body { border-color: #aeb8ca; }
.role-option input:checked + .role-body { border-color: var(--ink); background: var(--ink-soft); box-shadow: inset 0 0 0 1px var(--ink); }
.role-option input:checked + .role-body svg { color: var(--ink); }
.role-option input:focus-visible + .role-body { outline: 3px solid var(--focus); outline-offset: 2px; }

.secure-note { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 0; color: var(--slate); font-size: 0.86rem; }
.secure-note svg { width: 18px; height: 18px; flex: none; margin-top: 1px; color: var(--ok); }

@media (max-width: 860px) {
  .login { grid-template-columns: 1fr; grid-template-rows: auto 1fr; min-height: 100vh; }
  .stage { padding: 22px 20px 24px; }
  .stage-screen { margin: 22px 0 10px; }
  .stage-text { font-size: 26px; min-height: 2.5em; max-width: 24ch; }
  .stage-note { display: none; }
  .login-panel { align-items: flex-start; padding: 28px 20px 40px; }
}

/* ---------- App-ramme ---------- */
.page-app { background: var(--paper); }
.appbar {
  display: flex; align-items: center; gap: 16px;
  padding: 10px clamp(16px, 3vw, 32px); min-height: 60px;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.appbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.appbar-actions form { margin: 0; }
.whoami { color: var(--slate); font-size: 0.92rem; margin-right: 6px; }
.container { max-width: 1080px; margin: 0 auto; padding: 32px clamp(16px, 3vw, 32px) 64px; display: grid; gap: 24px; }
.page-head { display: flex; align-items: center; gap: 16px; justify-content: space-between; flex-wrap: wrap; }
.page-head h1 { font-size: 1.8rem; }
.search { max-width: 280px; }

.user-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.user-row form { margin: 0; }
.user-btn {
  width: 100%; display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 16px;
  padding: 14px 18px; text-align: left; cursor: pointer;
  font: inherit; color: inherit;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel);
}
.user-btn:hover { border-color: var(--ink); }
.avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--ink-soft); color: var(--ink); font-weight: 700; font-size: 1.1rem; }
.user-meta { display: grid; }
.user-meta strong { font-size: 1.08rem; }
.user-meta small { color: var(--slate); }
.presence { font-size: 0.85rem; color: var(--slate); display: inline-flex; align-items: center; gap: 6px; }
.presence::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #b7bfcd; }
.presence.is-on { color: var(--ok); }
.presence.is-on::before { background: var(--ok); }
.user-cta { font-weight: 600; padding: 9px 14px; border-radius: var(--r-ctl); background: var(--ink); color: #fff; font-size: 0.9rem; }
.empty { padding: 40px; text-align: center; background: var(--surface); border: 1px dashed #c3cbd9; border-radius: var(--r-panel); }

@media (max-width: 640px) {
  .user-btn { grid-template-columns: auto 1fr; }
  .presence, .user-cta { grid-column: 2; justify-self: start; }
  .whoami { display: none; }
}

/* ---------- Administration ---------- */
.admin-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 22px; display: grid; gap: 16px; }
.panel h2 { font-size: 1.15rem; }
.stack { display: grid; gap: 14px; }
.plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.plain-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.plain-list li > div { display: grid; }
.plain-list form { margin: 0; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.table th { text-align: left; font-size: 0.82rem; color: var(--slate); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table .actions { white-space: nowrap; }
.table .actions form { display: inline-block; margin: 0 0 0 4px; }
.inline-rename { display: flex; gap: 6px; margin: 0; }
.inline-rename input { min-height: 34px; padding: 0 8px; min-width: 150px; border-color: transparent; background: transparent; font-weight: 600; }
.inline-rename input:hover, .inline-rename input:focus { border-color: #c3cbd9; background: #fff; }
.inline-rename button { visibility: hidden; }
.inline-rename:focus-within button { visibility: visible; }
.tag { display: inline-block; font-size: 0.78rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; margin-right: 4px; }
.tag-tolk { background: var(--ink-soft); color: var(--ink); }
.tag-bruger { background: #fff4cc; color: #6b5200; }
.tag-admin { background: var(--ink); color: #fff; }
.tag-locked { background: var(--danger-soft); color: var(--danger); }
@media (max-width: 860px) { .admin-grid { grid-template-columns: 1fr; } }

/* ---------- Installation ---------- */
.plain-wrap { max-width: 560px; margin: 0 auto; padding: 48px 20px; display: grid; gap: 18px; }
.plain-title { font-size: 2rem; }
.lead { font-size: 1.05rem; margin: 0; }
.fieldset { border: 1px solid var(--line); border-radius: var(--r-panel); padding: 18px; display: grid; gap: 14px; background: var(--surface); margin: 0; }
.fieldset legend { font-weight: 700; padding: 0 6px; }
.codebox { background: var(--ink); color: #fff; padding: 14px; border-radius: var(--r-ctl); overflow-x: auto; font-size: 0.85rem; }

/* ---------- Tekstvisning (fælles for tolk og bruger) ---------- */
.display {
  font-family: var(--d-font);
  font-size: var(--d-size);
  line-height: var(--d-lh);
  font-weight: var(--d-weight);
  color: var(--d-fg);
  background: var(--d-bg);
}
.display-inner { max-width: var(--d-maxw); margin: 0 auto; }
.line { margin: 0 0 0.55em; white-space: pre-wrap; overflow-wrap: anywhere; }
.empty-hint { opacity: .55; font-size: max(16px, 0.6em); margin: 0; }
.divider { font-size: max(14px, 0.42em); opacity: .6; margin: 0.4em 0 1.2em; padding-top: 0.4em; border-top: 1px dashed currentColor; }
.archive .line { opacity: .72; }

/* ---------- Tolkens vindue ---------- */
.page-work { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 100vh; height: 100dvh; overflow: hidden; }
.appbar-work { gap: 14px; flex-wrap: wrap; }
.brand-compact { color: var(--ink); }
.work-title { display: grid; line-height: 1.2; }
.work-title strong { font-size: 1.1rem; }
.status-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); font-size: 0.84rem; color: var(--slate); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #b7bfcd; display: inline-block; flex: none; }
.chip.is-on { color: var(--ok); border-color: #bfe3d2; background: var(--ok-soft); }
.chip.is-on .dot { background: var(--ok); }
.chip-net { color: var(--danger); border-color: #efc4bf; background: var(--danger-soft); }
.chip-net .dot { background: var(--danger); }

.work { display: grid; grid-template-columns: minmax(0, 1fr) 280px; min-height: 0; }
.transcript-wrap { min-height: 0; display: flex; padding: 16px 0 0 clamp(16px, 3vw, 32px); }
.transcript { flex: 1; overflow-y: auto; padding: 22px 28px; border: 1px solid var(--line); border-radius: var(--r-panel) var(--r-panel) 0 0; border-bottom: 0; }
.transcript .who { display: block; font-family: var(--ui); font-size: 12px; font-weight: 700; letter-spacing: .02em; opacity: .6; margin-bottom: 2px; }
.transcript .line { padding-left: 12px; border-left: 3px solid transparent; }
.transcript .w0 { border-left-color: #4a78d9; }
.transcript .w1 { border-left-color: #e0912a; }
.transcript .w2 { border-left-color: #2d9b6f; }
.transcript .w3 { border-left-color: #a95cc8; }
.transcript .pending { opacity: .6; }
.transcript .draft { opacity: .85; }

.side { padding: 16px clamp(16px, 3vw, 32px) 0 16px; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
.side-title { font-size: 0.95rem; }
.msg-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; overflow-y: auto; align-content: start; }
.msg-list li:not(.muted) { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; font-weight: 600; display: grid; gap: 2px; }
.msg-list time { font-size: 0.78rem; font-weight: 400; color: var(--slate); }
.msg-list li.is-new { border-color: var(--caption); box-shadow: inset 3px 0 0 var(--caption); }

.composer { background: var(--surface); border-top: 1px solid var(--line); padding: 10px clamp(16px, 3vw, 32px) 12px; display: grid; gap: 8px; }
.composer-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; }
.writer-state { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.badge { font-size: 0.8rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.badge-live { background: var(--caption); color: var(--ink); }
.badge-idle { background: var(--ink-soft); color: var(--ink); }
.badge-off { background: var(--danger-soft); color: var(--danger); }
.editor {
  width: 100%; resize: vertical; min-height: 3.2em; max-height: 40vh;
  padding: 12px 16px; border: 2px solid var(--ink); border-radius: var(--r-ctl);
  font-size: min(var(--d-size), 40px);
}
.editor:focus { outline: none; box-shadow: 0 0 0 4px rgba(255, 203, 46, .55); }
.composer.is-locked .editor { border-style: dashed; border-color: #9aa5b8; opacity: .6; cursor: not-allowed; }
.hints { margin: 0; font-size: 0.8rem; color: var(--slate); }

@media (max-width: 900px) {
  .work { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; }
  .side { padding: 8px clamp(16px, 3vw, 32px); max-height: 120px; }
  .transcript-wrap { padding-right: clamp(16px, 3vw, 32px); }
  .hints { display: none; }
}

/* Menuer */
.menu { position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-list {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 240px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 6px;
  box-shadow: 0 12px 32px rgba(20, 33, 61, .18); display: grid;
}
.menu-list button { text-align: left; border: 0; background: none; font: 500 0.95rem var(--ui); color: inherit; padding: 10px 12px; border-radius: 6px; cursor: pointer; }
.menu-list button:hover { background: var(--ink-soft); }

/* Beskeder (toasts) */
.toasts { position: fixed; right: 16px; top: 72px; z-index: 50; display: grid; gap: 8px; width: min(380px, calc(100vw - 32px)); }
.toast {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px 12px 12px 16px;
  background: var(--ink); color: #fff; border-radius: 10px; font-size: 0.95rem;
  box-shadow: 0 10px 28px rgba(20, 33, 61, .28);
}
.toast span { flex: 1; }
.toast-msg { background: var(--caption); color: var(--ink); font-weight: 700; font-size: 1.05rem; }
.toast-warn { background: var(--danger); }
.toast-close { border: 0; background: transparent; color: inherit; font-size: 1.3rem; line-height: 1; cursor: pointer; padding: 0 4px; opacity: .8; }

/* ---------- Brugerens vindue ---------- */
.page-viewer { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 100vh; height: 100dvh; overflow: hidden; background: var(--d-bg); color: var(--d-fg); }
.viewer-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 8px clamp(12px, 2.5vw, 28px);
  font-family: var(--ui); font-size: 15px;
  border-bottom: 1px solid rgba(128, 128, 128, .35);
}
.viewer-status { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.viewer-status.is-on .dot { background: #29b26f; box-shadow: 0 0 0 3px rgba(41, 178, 111, .25); }
.viewer-status.is-wait .dot { background: #e0a21a; }
.viewer-status.is-off .dot { background: #e0483d; }
.viewer-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.viewer-actions form { margin: 0; }
.vbtn, .qbtn {
  min-height: 38px; padding: 0 12px; cursor: pointer;
  font: 600 0.92rem var(--ui); color: inherit; background: transparent;
  border: 1px solid rgba(128, 128, 128, .5); border-radius: var(--r-ctl);
  list-style: none; display: inline-flex; align-items: center;
}
.vbtn:hover, .qbtn:hover { background: rgba(128, 128, 128, .18); }
.vbtn-lg { font-size: 1.1rem; }
.menu-viewer > summary::-webkit-details-marker { display: none; }

.viewer { overflow-y: auto; padding: clamp(16px, 4vh, 48px) clamp(16px, 4vw, 64px); scroll-behavior: smooth; }
.viewer .line.switch { border-top: 2px solid currentColor; border-top-color: rgba(128, 128, 128, .5); padding-top: 0.35em; }
.viewer .draft.is-empty { min-height: 1em; }

.jump {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 84px; z-index: 30;
  font: 700 1rem var(--ui); padding: 12px 20px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--caption); color: var(--ink); box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
}
.ended-banner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
  margin: 0; padding: 12px clamp(12px, 2.5vw, 28px);
  background: var(--caption); color: var(--ink); font-family: var(--ui); font-size: 0.95rem;
  position: fixed; left: 0; right: 0; top: 56px; z-index: 25;
}
.ended-actions { margin-left: auto; display: flex; gap: 6px; }
.ended-banner .vbtn { border-color: rgba(20, 33, 61, .4); }

.quickbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px clamp(12px, 2.5vw, 28px);
  font-family: var(--ui);
  border-top: 1px solid rgba(128, 128, 128, .35);
}
.quickbar-label { font-size: 0.9rem; font-weight: 600; opacity: .8; }
.quick-list { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.qbtn[disabled] { opacity: .45; }
.qbtn-toggle { margin-left: auto; opacity: .8; }
.quickbar.is-collapsed .quick-list, .quickbar.is-collapsed .quickbar-label { display: none; }

/* ---------- Dialog: tekstvisning ---------- */
.dialog { border: 0; padding: 0; border-radius: 16px; width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 24px); color: var(--ink); background: var(--surface); box-shadow: 0 24px 64px rgba(0, 0, 0, .35); font-family: var(--ui); font-size: 16px; line-height: 1.5; }
.dialog::backdrop { background: rgba(10, 16, 30, .55); }
.dialog-body { padding: 22px; display: grid; gap: 18px; margin: 0; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; }
.dialog-head h2 { font-size: 1.3rem; }
.dialog-foot { display: flex; justify-content: flex-end; gap: 8px; }
.dialog p { margin: 0; }
.icon-btn { border: 0; background: transparent; width: 38px; height: 38px; border-radius: 8px; cursor: pointer; color: var(--slate); display: grid; place-items: center; }
.icon-btn:hover { background: var(--ink-soft); color: var(--ink); }
.icon-btn svg { width: 22px; height: 22px; }
.preview { border-radius: 10px; padding: 14px 18px; max-height: 140px; overflow: hidden; border: 1px solid var(--line); }
.preview p { margin: 0; }
.setting { border: 0; padding: 0; margin: 0; display: grid; gap: 10px; }
.setting legend { font-weight: 700; padding: 0; margin-bottom: 10px; display: flex; gap: 8px; }
.setting output, .field output { font-weight: 400; color: var(--slate); }
.swatches { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.swatch { height: 48px; border-radius: 10px; border: 2px solid var(--line); font: 700 1.15rem Georgia, serif; cursor: pointer; }
.swatch[aria-pressed="true"] { border-color: var(--focus); box-shadow: 0 0 0 2px var(--focus); }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.color-field { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 0.9rem; cursor: pointer; }
.color-field input { width: 44px; height: 36px; border: 1px solid var(--line); border-radius: 8px; padding: 2px; background: #fff; cursor: pointer; }
.range-row { display: flex; align-items: center; gap: 10px; }
.range-row input { flex: 1; accent-color: var(--ink); }
.field input[type="range"] { min-height: 46px; padding: 0; border: 0; background: none; accent-color: var(--ink); }
.step-btn { width: 44px; height: 40px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font: 700 0.9rem var(--ui); cursor: pointer; color: var(--ink); }
.step-btn-lg { font-size: 1.15rem; }
.checks { display: grid; gap: 10px; }
@media (max-width: 520px) { .swatches { grid-template-columns: repeat(3, 1fr); } .row-2 { grid-template-columns: 1fr; } }

/* ---------- Udskrift / PDF ---------- */
.print-head { display: none; }
@media print {
  @page { margin: 18mm; }
  body, .page-viewer, .page-work { display: block !important; height: auto !important; overflow: visible !important; background: #fff !important; color: #000 !important; }
  .appbar, .side, .composer, .viewer-bar, .quickbar, .toasts, .jump, .ended-banner, .dialog, .empty-hint, .caret, .who { display: none !important; }
  .print-head { display: flex !important; justify-content: space-between; font: 10pt var(--ui); border-bottom: 1px solid #000; padding-bottom: 6px; margin-bottom: 14px; }
  .work, .transcript-wrap { display: block !important; padding: 0 !important; }
  .display, .transcript, .viewer { overflow: visible !important; height: auto !important; padding: 0 !important; border: 0 !important; background: #fff !important; color: #000 !important; font: 12pt/1.5 Georgia, "Times New Roman", serif !important; }
  .display-inner { max-width: none !important; }
  .line { padding: 0 !important; border: 0 !important; opacity: 1 !important; margin: 0 0 8pt !important; page-break-inside: avoid; }
  .divider { font-size: 9pt; }
}

/* Smalle skærme: læsevindue */
@media (max-width: 640px) {
  .viewer-bar { gap: 8px; }
  .viewer-actions { margin-left: 0; width: 100%; }
  .vbtn { min-height: 36px; padding: 0 10px; font-size: 0.85rem; }
  .quickbar { flex-wrap: nowrap; gap: 6px; }
  .quickbar-label { display: none; }
  .quick-list { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .quick-list .qbtn { flex: none; white-space: nowrap; }
  .qbtn-toggle { flex: none; }
  .ended-banner { top: auto; bottom: 64px; }
}
.page-viewer, .page-work { grid-template-columns: minmax(0, 1fr); }
.quick-list { min-width: 0; }
