:root {
  --bg: #f5f7fa;
  --card: #ffffff;
  --ink: #121826;
  --ink-soft: #4c5765;
  --ink-faint: #6b7686;
  --line: #e4e9f0;
  --brand: #2f6df6;
  --brand-dark: #1f54cc;
  --brand-soft: #eaf0ff;
  --good: #157a52;
  --good-bg: #e8f7ef;
  --danger: #b93232;
  --danger-bg: #fdecec;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(16,24,40,.04), 0 10px 28px rgba(16,24,40,.07);
}

* { box-sizing: border-box; }
/* Elementer med display: grid/flex ville ellers overtrumfe [hidden]. */
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background:
    radial-gradient(1100px 520px at 85% -10%, #f7f4ef, transparent 60%),
    radial-gradient(900px 460px at -10% 0%, #eef2f8, transparent 55%),
    var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  display: flex; flex-direction: column;
}
main { flex: 1; }
a { color: var(--brand); }
h1, h2, h3 { letter-spacing: -.02em; }

/* ── Topbjælke ─────────────────────────────────────── */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: .8rem clamp(1rem, 4vw, 2.5rem);
  background: rgba(255,255,255,.85); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.wordmark {
  display: inline-flex; align-items: center; gap: .5rem;
  font-weight: 700; font-size: 1.08rem; color: var(--ink); text-decoration: none;
}
.topbar nav { display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; }
.topbar nav a, .btn-link {
  color: var(--ink-soft); text-decoration: none; font-size: .93rem; font-weight: 550;
  padding: .45rem .7rem; border-radius: 9px; background: none; border: none;
  font-family: inherit; cursor: pointer;
}
.topbar nav a:hover, .btn-link:hover { background: var(--brand-soft); color: var(--brand-dark); }

@media (max-width: 620px) {
  /* Menuen skal blive på én linje i stedet for at æde den halve skærm. */
  .topbar { flex-direction: column; align-items: stretch; gap: .5rem; padding: .7rem 1rem; }
  .topbar nav { flex-wrap: nowrap; overflow-x: auto; gap: .1rem; }
  .topbar nav a, .btn-link { white-space: nowrap; padding: .4rem .55rem; font-size: .88rem; }
  .footer { flex-direction: column; gap: .4rem; }
}

/* ── Kort og knapper ───────────────────────────────── */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.5rem;
}
button { font: inherit; cursor: pointer; border: none; border-radius: 11px; transition: background .15s, box-shadow .15s, opacity .15s; }
button:disabled { opacity: .6; cursor: not-allowed; }

.btn-primary {
  width: 100%; margin-top: 1.1rem; padding: .85rem 1rem;
  background: var(--brand); color: #fff; font-weight: 650; font-size: 1rem;
  box-shadow: 0 6px 16px rgba(47,109,246,.26);
}
.btn-primary:hover { background: var(--brand-dark); }
.btn-link-block { display: block; text-align: center; text-decoration: none; }

.btn-ghost {
  padding: .5rem .85rem; background: #fff; border: 1px solid var(--line);
  color: var(--ink); font-weight: 550; font-size: .92rem;
  display: inline-flex; align-items: center; gap: .5rem;
}
.btn-ghost:hover { background: var(--brand-soft); border-color: #cddafc; }
.btn-danger-ghost {
  padding: .5rem .85rem; background: #fff; border: 1px solid var(--line);
  color: var(--danger); font-weight: 550; font-size: .92rem;
}
.btn-danger-ghost:hover { background: var(--danger-bg); border-color: #f3cccc; }

/* ── Felter ────────────────────────────────────────── */
.field { display: block; margin-bottom: .2rem; }
.field label, .field > span { display: block; font-size: .88rem; font-weight: 600; margin-bottom: .4rem; color: var(--ink-soft); }
.field small { font-weight: 400; color: var(--ink-faint); }
input[type=email], textarea, select {
  width: 100%; padding: .8rem .9rem; font: inherit; font-size: 1rem;
  border: 1px solid var(--line); border-radius: 11px; background: #fff; color: var(--ink);
}
input[type=email]:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft);
}
.hint { display: block; margin-top: .35rem; color: var(--ink-faint); font-size: .85rem; }

.msg { margin-top: 1rem; padding: .8rem .9rem; border-radius: 11px; font-size: .93rem; display: none; }
.msg.show { display: block; }
.msg.ok { background: var(--good-bg); color: var(--good); border: 1px solid #c7ecd8; }
.msg.err { background: var(--danger-bg); color: var(--danger); border: 1px solid #f6d3d3; }
.msg a { color: inherit; font-weight: 600; }

/* ── Login ─────────────────────────────────────────── */
.center-wrap { display: grid; place-items: center; padding: clamp(1.5rem, 6vh, 5rem) 1.25rem; }
.auth-card { width: 100%; max-width: 440px; padding: 2.4rem 2.2rem; border-radius: 20px; }
.auth-card h1 { margin: 0 0 .5rem; font-size: 1.75rem; }
.lead { margin: 0 0 1.5rem; color: var(--ink-soft); }
.domains { margin-top: 1.6rem; font-size: .9rem; color: var(--ink-faint); }
.domains summary { cursor: pointer; font-weight: 600; color: var(--ink-soft); }
.domains ul { margin: .5rem 0 0; padding-left: 1.2rem; columns: 2; }

/* ── Layout ────────────────────────────────────────── */
.layout {
  display: grid; grid-template-columns: minmax(320px, 400px) 1fr;
  gap: 1.25rem; align-items: start;
  padding: 1.5rem clamp(1rem, 4vw, 2.5rem) 3rem;
  max-width: 1500px; margin: 0 auto;
}
.col-left { display: grid; gap: 1.25rem; }
@media (max-width: 950px) { .layout { grid-template-columns: 1fr; } }

.upload-card h1 { margin: 0 0 1.1rem; font-size: 1.35rem; }

/* ── Slipzone ──────────────────────────────────────── */
.dropzone {
  border: 2px dashed #cfd8e6; border-radius: 14px; background: #fafbfd;
  padding: 1.9rem 1.25rem; text-align: center; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone:focus-visible, .dropzone.over {
  border-color: var(--brand); background: var(--brand-soft); outline: none;
}
.dz-icon { font-size: 2rem; line-height: 1; }
.dz-title { margin: .6rem 0 .15rem; font-weight: 650; font-size: 1.05rem; }
.dz-sub { margin: 0; color: var(--ink-soft); font-size: .95rem; }
.linky { color: var(--brand); text-decoration: underline; }
.dz-hint { margin: .7rem 0 0; color: var(--ink-faint); font-size: .82rem; }

.record-row { display: flex; align-items: center; gap: .75rem; margin-top: .9rem; }
.record-row .btn-ghost { flex: 1; justify-content: center; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: #c33; flex: none; }
.recording .rec-dot { animation: pulse 1.1s infinite; }
@keyframes pulse { 50% { opacity: .25; } }
.rec-time { font-variant-numeric: tabular-nums; color: var(--ink-soft); font-weight: 600; }

.options { margin-top: 1.1rem; border-top: 1px solid var(--line); padding-top: .9rem; }
.options summary { cursor: pointer; font-weight: 600; font-size: .92rem; color: var(--ink-soft); }
.options > * + * { margin-top: .9rem; }
.check { display: flex; gap: .6rem; align-items: flex-start; font-size: .93rem; margin-top: .9rem; }
.check input { margin-top: .25rem; flex: none; width: 1rem; height: 1rem; accent-color: var(--brand); }
.check small { display: block; color: var(--ink-faint); font-size: .84rem; }

/* ── Liste ─────────────────────────────────────────── */
.list-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.list-card h2 { margin: 0; font-size: 1.1rem; }
.list-note { margin: .4rem 0 1rem; font-size: .85rem; color: var(--ink-faint); }
.tlist { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; max-height: 46vh; overflow-y: auto; }
.titem {
  width: 100%; text-align: left; background: #fff; border: 1px solid var(--line);
  border-radius: 11px; padding: .7rem .85rem; display: grid; gap: .15rem;
}
.titem:hover { background: #fafbfd; border-color: #cddafc; }
.titem.active { background: var(--brand-soft); border-color: var(--brand); }
.ti-name { font-weight: 600; font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ti-meta { font-size: .82rem; color: var(--ink-faint); }
.empty { margin: 0; color: var(--ink-faint); font-size: .92rem; }

/* ── Fremviser ─────────────────────────────────────── */
.viewer { min-height: 60vh; padding: 1.75rem; }
.viewer-empty { display: grid; place-items: center; text-align: center; min-height: 50vh; color: var(--ink-faint); gap: .5rem; }
.ve-icon { font-size: 2.5rem; opacity: .55; }
.viewer-head { display: flex; gap: 1rem; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; }
.viewer-title { margin: 0; font-size: 1.4rem; border-radius: 8px; padding: .1rem .3rem; margin-left: -.3rem; }
.viewer-title:hover { background: #f3f5f9; }
.viewer-title:focus { outline: none; background: #fff; box-shadow: 0 0 0 3px var(--brand-soft); }
.viewer-meta { margin: .25rem 0 0; color: var(--ink-faint); font-size: .9rem; }
.viewer-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

.menu { position: relative; }
.menu-pop {
  position: absolute; right: 0; top: calc(100% + .35rem); z-index: 10;
  background: #fff; border: 1px solid var(--line); border-radius: 11px;
  box-shadow: var(--shadow); padding: .3rem; display: grid; min-width: 230px;
}
.menu-pop button {
  text-align: left; padding: .55rem .7rem; background: none; font-size: .93rem; border-radius: 8px;
}
.menu-pop button:hover { background: var(--brand-soft); }

.viewtabs { display: flex; gap: .3rem; margin: 1.25rem 0 .5rem; border-bottom: 1px solid var(--line); }
.vt {
  background: none; padding: .55rem .8rem; font-size: .92rem; color: var(--ink-soft);
  border-radius: 9px 9px 0 0; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.vt.active { color: var(--brand-dark); font-weight: 650; border-bottom-color: var(--brand); }

.transcript { padding-top: .75rem; max-width: 72ch; font-size: 1.02rem; }
.flow-who { margin: 1.4rem 0 .2rem; font-weight: 700; font-size: .88rem; color: var(--brand-dark);
            text-transform: uppercase; letter-spacing: .06em; }
.flow-who:first-child { margin-top: 0; }
.flow-p { margin: 0 0 .85rem; }
.muted { color: var(--ink-faint); }
.seg { display: grid; grid-template-columns: 4.5rem 1fr; gap: .1rem .8rem; margin: 0 0 .7rem; }
.seg-time { font-variant-numeric: tabular-nums; color: var(--ink-faint); font-size: .85rem; padding-top: .15rem; }
.seg-who { grid-column: 2; font-size: .8rem; font-weight: 700; color: var(--brand-dark); text-transform: uppercase; letter-spacing: .05em; }
.seg-text { grid-column: 2; }

/* ── Statuskort ────────────────────────────────────── */
.progress-cards {
  position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 30;
  display: grid; gap: .6rem; width: min(340px, calc(100vw - 2.5rem));
}
.pcard { background: #fff; border: 1px solid var(--line); border-radius: 13px; box-shadow: var(--shadow); padding: .85rem 1rem; }
.pcard.failed { border-color: #f3cccc; background: #fffafa; }
.pc-top { display: flex; justify-content: space-between; gap: .75rem; align-items: baseline; }
.pc-name { font-weight: 600; font-size: .93rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-state { font-size: .82rem; color: var(--ink-faint); flex: none; }
.pc-bar { height: 4px; border-radius: 3px; background: #eef1f6; margin: .6rem 0 .45rem; overflow: hidden; }
.pc-fill { height: 100%; width: 35%; border-radius: 3px; background: var(--brand); animation: slide 1.6s ease-in-out infinite; }
.pcard.failed .pc-fill { animation: none; width: 100%; background: #e0b4b4; }
@keyframes slide { 0% { margin-left: -35%; } 100% { margin-left: 100%; } }
.pc-hint { margin: 0; font-size: .8rem; color: var(--ink-faint); }

/* ── Indhold og forbrug ────────────────────────────── */
.prose { max-width: 760px; margin: 2rem auto 4rem; padding: 0 1.25rem; }
.prose .card { padding: 2.2rem; }
.prose h1 { margin-top: 0; font-size: 1.75rem; }
.prose h2 { margin: 2rem 0 .5rem; font-size: 1.12rem; }
.prose p, .prose li { color: var(--ink-soft); }
.prose ul { padding-left: 1.2rem; }
.prose .lede { font-size: 1.05rem; color: var(--ink); }

.usage-wrap { max-width: 900px; margin: 2rem auto 4rem; padding: 0 1.25rem; display: grid; gap: 1.25rem; }
.meter { height: 12px; border-radius: 7px; background: #eef1f6; overflow: hidden; margin: .75rem 0 .4rem; }
.meter span { display: block; height: 100%; background: var(--brand); border-radius: 7px; }
.meter.over span { background: #c2410c; }
.big { font-size: 2rem; font-weight: 700; letter-spacing: -.02em; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: .65rem .5rem; border-bottom: 1px solid var(--line); }
th { font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-faint); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

.footer {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: 1.25rem clamp(1rem, 4vw, 2.5rem); border-top: 1px solid var(--line);
  font-size: .85rem; color: var(--ink-faint);
}
