/* Panther Helpdesk - design tokens */
:root {
  --bg: #f7f6f3;
  --surface: #ffffff;
  --ink: #1c2126;
  --muted: #5c6570;
  --brand: #14343b;
  --brand-ink: #eef4f5;
  --brand-soft: #1d4a54;
  --accent: #e0a458;
  --accent-soft: #f6e3c5;
  --border: #e4e2dc;
  --shadow: 0 1px 2px rgba(28, 33, 38, 0.06), 0 4px 16px rgba(28, 33, 38, 0.05);
  --radius: 12px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171a;
    --surface: #1d2227;
    --ink: #e8e6e1;
    --muted: #9aa4ad;
    --brand: #10282e;
    --brand-ink: #dfe9ea;
    --brand-soft: #7fb7c4;
    --accent: #e0a458;
    --accent-soft: #4a3a22;
    --border: #2b3238;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.25);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  font-size: 1rem;
}

a { color: var(--brand-soft); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Header */
header {
  background: var(--brand);
  color: var(--brand-ink);
  padding: 0.9rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  align-items: center;
}

.brand {
  color: inherit;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.brand svg { display: block; }

.header-search {
  display: flex;
  flex: 1 1 260px;
  max-width: 420px;
  margin-left: auto;
}

/* Search form (header + hero share the input group) */
.search-group {
  display: flex;
  width: 100%;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
}

.search-group input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--ink);
  padding: 0.55rem 1.1rem;
  font-size: 0.95rem;
  font-family: inherit;
}

.search-group input:focus { outline: none; }

.search-group button {
  border: none;
  background: var(--accent);
  color: #2b2110;
  font-weight: 600;
  font-family: inherit;
  font-size: 0.95rem;
  padding: 0.55rem 1.25rem;
  cursor: pointer;
}

.search-group button:hover { filter: brightness(1.05); }

/* Hero (frontpage) */
.hero {
  background: var(--brand);
  color: var(--brand-ink);
  padding: 3rem 1.5rem 3.5rem;
  text-align: center;
}

.hero h1 {
  margin: 0 0 1.25rem;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.hero .search-group {
  max-width: 560px;
  margin: 0 auto;
  border: none;
  box-shadow: var(--shadow);
}

.hero .search-group input { padding: 0.85rem 1.3rem; font-size: 1.05rem; }
.hero .search-group button { padding: 0.85rem 1.5rem; font-size: 1rem; }

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

main.narrow { max-width: 760px; }

h1 { font-size: 1.6rem; letter-spacing: -0.01em; text-wrap: balance; }

/* Breadcrumb */
.breadcrumb {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 1rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--brand-soft); }

/* Category grid */
.section-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
  margin: 2.25rem 0 1rem;
}

.hero + main .section-label:first-child { margin-top: 0; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.card {
  display: flex;
  gap: 0.9rem;
  padding: 1.1rem 1.2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  transition: border-color 120ms ease, transform 120ms ease;
}

.card:hover { border-color: var(--brand-soft); }

.card-icon {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--brand-soft);
  display: grid;
  place-items: center;
}

.card-body h2 {
  margin: 0 0 0.2rem;
  font-size: 1rem;
  font-weight: 650;
  color: var(--ink);
}

.card-body p {
  margin: 0 0 0.4rem;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
}

.count {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* Article lists */
.article-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.75rem; }

.article-list li {
  padding: 1rem 1.2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.article-list a {
  color: var(--brand-soft);
  font-weight: 600;
  text-decoration: none;
  font-size: 1.02rem;
}

.article-list a:hover { text-decoration: underline; }

.article-list p { margin: 0.3rem 0 0; color: var(--muted); font-size: 0.9rem; }

.category-description { color: var(--muted); max-width: 65ch; }

/* Article page */
article {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem 2.25rem;
}

article > *:first-child { margin-top: 0; }

article h1 { margin: 0 0 1rem; }

article h2 {
  font-size: 1.2rem;
  margin: 2rem 0 0.6rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  letter-spacing: -0.005em;
}

article h3 { font-size: 1.02rem; margin: 1.4rem 0 0.4rem; }

article p, article li { max-width: 68ch; }

article code {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 0.08rem 0.35rem;
  border-radius: 5px;
  font-size: 0.88em;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

article pre {
  background: #12181d;
  color: #e6edf3;
  padding: 1rem 1.25rem;
  border-radius: 10px;
  overflow-x: auto;
  line-height: 1.55;
}

article pre code { background: none; border: none; color: inherit; padding: 0; font-size: 0.85rem; }

article table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.9rem;
  display: block;
  overflow-x: auto;
}

article th, article td {
  border: 1px solid var(--border);
  padding: 0.45rem 0.7rem;
  text-align: left;
}

article th { background: var(--bg); font-weight: 600; }

article figure {
  margin: 1.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-start;
}

article img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

article figcaption {
  font-size: 0.85rem;
  color: var(--muted);
}

article li figure { margin: 0.75rem 0; }

article li > p { margin: 0.25rem 0; }

article blockquote {
  margin: 1rem 0;
  padding: 0.5rem 1.1rem;
  border-left: 3px solid var(--accent);
  background: var(--bg);
  border-radius: 0 8px 8px 0;
  color: var(--muted);
}

mark { background: var(--accent-soft); color: inherit; padding: 0 0.15rem; border-radius: 3px; }

/* Related + meta */
.related { margin-top: 1.75rem; }
.related h2 { font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.09em; color: var(--muted); }
.related ul { list-style: none; padding: 0; margin: 0.5rem 0 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.related a {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  text-decoration: none;
  color: var(--brand-soft);
  font-size: 0.85rem;
  font-weight: 550;
}
.related a:hover { border-color: var(--brand-soft); }

.article-meta {
  margin-top: 1.25rem;
  font-size: 0.8rem;
  color: var(--muted);
  display: flex;
  gap: 1.25rem;
  font-variant-numeric: tabular-nums;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.25rem 1.5rem 2rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
}

.empty {
  padding: 2.5rem 1rem;
  text-align: center;
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* Login */
.login {
  max-width: 26rem;
  margin: 3rem auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
}
.login h1 { margin-top: 0; font-size: 1.4rem; }
.login form { display: flex; flex-direction: column; gap: 0.5rem; margin: 1.25rem 0; }
.login label { font-size: 0.85rem; color: var(--muted); font-weight: 600; }
.login input {
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
}
.login input:focus-visible { outline: 2px solid var(--brand-soft); outline-offset: 1px; }
.login button {
  margin-top: 0.5rem;
  padding: 0.65rem 1rem;
  border: 0;
  border-radius: 8px;
  background: var(--brand);
  color: var(--brand-ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.login-notice, .login-error {
  padding: 0.7rem 0.85rem;
  border-radius: 8px;
  font-size: 0.9rem;
  margin: 0;
}
.login-notice { background: var(--accent-soft); color: #5a3d13; }
.login-error { background: #fbe4e4; color: #7a2222; }
.login-help { font-size: 0.85rem; color: var(--muted); border-top: 1px solid var(--border); padding-top: 1rem; }

/* Passkeys */
.passkey-button {
  width: 100%;
  padding: 0.7rem 1rem;
  border: 1px solid var(--brand);
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  margin: 1rem 0 0;
}
.passkey-button:hover { background: var(--accent-soft); }
.passkey-button[disabled] { opacity: 0.6; cursor: progress; }
.passkey-list { list-style: none; padding: 0; margin: 1.25rem 0; display: flex; flex-direction: column; gap: 0.6rem; }
.passkey-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.passkey-list li > span { display: flex; flex-direction: column; gap: 0.15rem; }
.passkey-meta { font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.passkey-delete {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  border-radius: 6px;
  padding: 0.35rem 0.7rem;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}
.passkey-delete:hover { color: #7a2222; border-color: #7a2222; }

/* AI-chat */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.chat { display: flex; flex-direction: column; gap: 1rem; }
.chat-intro { color: var(--muted); margin: 0; }
.chat-log { display: flex; flex-direction: column; gap: 1.25rem; }
.chat-log:empty { display: none; }
.chat-turn { display: flex; flex-direction: column; gap: 0.3rem; }
.chat-who {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted);
}
.chat-bubble {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0.9rem 1.1rem; background: var(--surface);
}
.chat-user .chat-bubble { background: var(--bg); }
.chat-bubble > :first-child { margin-top: 0; }
.chat-bubble > :last-child { margin-bottom: 0; }
.chat-bubble ol, .chat-bubble ul { margin: 0.5rem 0; padding-left: 1.4rem; }
.chat-bubble li { margin: 0.25rem 0; }
.chat-ref {
  font-size: 0.78em; vertical-align: super; text-decoration: none;
  color: var(--brand-soft); font-weight: 700; padding: 0 0.1em;
}
.chat-ref:hover { text-decoration: underline; }
.chat-pending { color: var(--muted); font-style: italic; margin: 0; }
.chat-error { color: #7a2222; margin: 0; }
.chat-sources { margin-top: 0.9rem; padding-top: 0.75rem; border-top: 1px solid var(--border); }
.chat-sources-label {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted);
}
.chat-sources ul { list-style: none; padding: 0; margin: 0.4rem 0 0; }
.chat-sources li { margin: 0.2rem 0; font-size: 0.9rem; }
.chat-form { display: flex; gap: 0.6rem; align-items: flex-end; }
.chat-form textarea {
  flex: 1; padding: 0.7rem 0.85rem; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--ink); font: inherit; resize: vertical; min-height: 3rem;
}
.chat-form textarea:focus-visible { outline: 2px solid var(--brand-soft); outline-offset: 1px; }
.chat-form button {
  padding: 0.7rem 1.3rem; border: 0; border-radius: 8px;
  background: var(--brand); color: var(--brand-ink); font: inherit; font-weight: 600; cursor: pointer;
}
.chat-form textarea[disabled] { opacity: 0.6; }
.chat-disclaimer { font-size: 0.8rem; color: var(--muted); margin: 0; }
.hero-chat { margin: 1rem 0 0; }
.hero-chat a { color: var(--brand-ink); text-decoration: underline; text-underline-offset: 3px; font-weight: 600; }

/* Chat: agentens skridt undervejs */
.chat-status {
  display: flex; align-items: center; gap: 0.5rem;
  color: var(--muted); font-size: 0.9rem; font-style: italic; margin: 0;
}
.chat-status::before {
  content: ''; width: 0.55rem; height: 0.55rem; border-radius: 50%;
  background: var(--brand-soft); flex: none; animation: chat-puls 1.2s ease-in-out infinite;
}
@keyframes chat-puls { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }
.chat-tentative { color: var(--muted); margin: 0.5rem 0 0; white-space: pre-wrap; }
.chat-tentative:empty { display: none; }
@media (prefers-reduced-motion: reduce) {
  .chat-status::before { animation: none; opacity: 0.7; }
}

/* Chatmålinger */
.chatlog-tal { display: flex; flex-wrap: wrap; gap: 1.5rem; margin: 1.25rem 0 2rem; }
.chatlog-tal span { display: flex; flex-direction: column; font-size: 0.85rem; color: var(--muted); }
.chatlog-tal strong { font-size: 1.5rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.chatlog-hint { color: var(--muted); font-size: 0.88rem; margin: 0 0 0.75rem; }
.chatlog-antal { text-align: right; font-variant-numeric: tabular-nums; width: 4rem; }

/* Adgangstokens */
.token-nyt {
  border: 1px solid var(--brand-soft); border-left-width: 4px; border-radius: var(--radius);
  background: var(--surface); padding: 1rem 1.15rem; margin: 1.25rem 0;
}
.token-nyt p { margin: 0 0 0.6rem; }
.token-link {
  display: block; word-break: break-all; background: var(--bg); border: 1px solid var(--border);
  border-radius: 6px; padding: 0.6rem 0.7rem; font-size: 0.85rem; user-select: all;
}
.token-form {
  display: flex; flex-direction: column; gap: 0.4rem; margin: 1.5rem 0 2rem;
  border: 1px solid var(--border); border-radius: var(--radius); padding: 1.15rem; background: var(--surface);
}
.token-form label { font-size: 0.85rem; color: var(--muted); font-weight: 600; }
.token-form input, .token-form select {
  padding: 0.6rem 0.7rem; border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg); color: var(--ink); font: inherit; width: 100%;
}
.token-form-raekke { display: flex; gap: 1rem; margin-top: 0.75rem; }
.token-form-raekke > span { display: flex; flex-direction: column; gap: 0.4rem; flex: 1; }
.token-form button {
  margin-top: 1rem; align-self: flex-start; padding: 0.6rem 1.2rem; border: 0; border-radius: 8px;
  background: var(--brand); color: var(--brand-ink); font: inherit; font-weight: 600; cursor: pointer;
}
.token-tid { font-size: 0.82rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.token-tilstand { font-size: 0.8rem; font-weight: 600; white-space: nowrap; }
.token-klar { color: #1d6b34; }
.token-brugt { color: var(--muted); font-weight: 400; }
.token-død { color: #7a2222; }

/* Administration: link i headeren og kortene på /admin.
   Linket sidder efter søgefeltet, som har margin-left:auto, så de skubbes til højre sammen. */
.header-admin {
  color: var(--brand-ink);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.4rem 0.75rem;
  border: 1px solid rgba(238, 244, 245, 0.35);
  border-radius: 999px;
  white-space: nowrap;
}

.header-admin:hover,
.header-admin:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}

.admin-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.admin-card {
  display: block;
  padding: 1.1rem 1.2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  transition: border-color 120ms ease;
}

.admin-card:hover { border-color: var(--brand-soft); }

.admin-card h2 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
}

.admin-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

/* Spærret kort: synligt, så man ved at funktionen findes, men tydeligt ikke klikbart. */
.admin-card-locked {
  opacity: 0.72;
  box-shadow: none;
  border-style: dashed;
}

.admin-locked-note {
  margin-top: 0.6rem !important;
  font-weight: 600;
  color: var(--ink) !important;
}

.admin-notice {
  margin: 1rem 0 0;
  padding: 0.8rem 1rem;
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--ink);
}

/* Loginknap i headeren. Fyldt med accentfarven, hvor .header-admin kun er omridset —
   den skal skille sig ud, fordi den er handlingen man leder efter, når noget er spærret. */
.header-login {
  background: var(--accent);
  color: #2a1c07;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 0.42rem 0.9rem;
  border-radius: 999px;
  white-space: nowrap;
}

.header-login:hover,
.header-login:focus-visible {
  filter: brightness(1.08);
}

/* Et link der ser ud som en knap. Bruges på 403-siden, hvor handlingen er at logge ind. */
.knap {
  display: inline-block;
  background: var(--brand);
  color: var(--brand-ink);
  text-decoration: none;
  font-weight: 600;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
}

.knap:hover,
.knap:focus-visible { background: var(--brand-soft); }

/* Spærret kort er nu et link til login, så det skal reagere på mus som de øvrige kort. */
.admin-card-locked:hover { border-color: var(--accent); opacity: 1; }

/* ── Kundebase-specifikt ────────────────────────────────────────────────── */

/* Kundens navn i headeren. Skal altid være synligt: man må ikke et sekund være
   i tvivl om, hvis materiale man ser på. */
.header-kunde {
  color: var(--brand-ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  background: rgba(238, 244, 245, 0.14);
  white-space: nowrap;
}

.header-kunde:hover { background: rgba(238, 244, 245, 0.24); }

.kunde-liste {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
  list-style: none;
  padding: 0;
}

.kunde-liste a {
  display: block;
  padding: 1.1rem 1.2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  transition: border-color 120ms ease;
}

.kunde-liste a:hover { border-color: var(--brand-soft); }
.kunde-liste h2 { margin: 0 0 0.3rem; font-size: 1.05rem; }
.kunde-liste .tal { color: var(--muted); font-size: 0.9rem; }

.arkiveret-maerke {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: var(--border);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Dokumenter ─────────────────────────────────────────────────────────── */

.upload {
  display: grid;
  gap: 0.7rem;
  margin: 1.2rem 0 1.8rem;
}

.upload button { justify-self: start; }

/* Zonen er hovedhandlingen paa siden og skal vaere stor nok til at ramme med en fil i haanden.
   Uden JavaScript er den blot en ramme om et almindeligt filfelt. */
.dropzone {
  display: grid;
  justify-items: center;
  gap: 0.35rem;
  padding: 2.75rem 1.5rem;
  background: var(--surface);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: border-color 120ms ease, background 120ms ease;
}

.dropzone-ikon { color: var(--muted); }

.dropzone-titel {
  margin: 0.2rem 0 0;
  font-size: 1.15rem;
  font-weight: 700;
}

.dropzone-under {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.dropzone-label {
  margin-top: 0.7rem;
  padding: 0.5rem 1.1rem;
  background: var(--brand);
  color: var(--brand-ink);
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
}

.dropzone-label:hover { background: var(--brand-soft); }

/* Med JavaScript er hele feltet klikbart, og filfeltet skal ikke staa og rode.
   Det fjernes ikke fra DOM'en - saa ville formularen holde op med at virke uden JS. */
.dropzone-aktiv { cursor: pointer; }
.dropzone-aktiv input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.dropzone:not(.dropzone-aktiv) input[type="file"] { font: inherit; margin-top: 0.6rem; }

.dropzone-aktiv:hover { border-color: var(--brand-soft); }

/* Under traek. Tydelig nok til at man ved, at slippet rammer. */
.dropzone-over {
  border-color: var(--accent);
  border-style: solid;
  background: var(--accent-soft);
}

.dropzone-over .dropzone-ikon { color: var(--accent); }

/* Fremdrift tegnes som en bjaelke i bunden af zonen, saa en stor PDF ikke ser ud som en doed side */
.dropzone-arbejder { cursor: progress; }
.dropzone-arbejder::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 4px;
  width: var(--fremdrift, 0%);
  background: var(--accent);
  transition: width 120ms linear;
}

#upload-status { margin: 0; font-size: 0.92rem; }
#upload-status.ok { color: #1d5c31; font-weight: 600; }
#upload-status.fejl { color: #7a231d; font-weight: 600; }

.upload-resultat {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.3rem;
  font-size: 0.9rem;
}

.upload-resultat li { padding-left: 1.2rem; position: relative; }
.upload-resultat li::before { position: absolute; left: 0; }
.res-ok::before { content: "\2713"; color: #1d5c31; }
.res-delvis::before { content: "\25CB"; color: #8a6a2a; }
.res-dublet::before { content: "\003D"; color: var(--muted); }
.res-fejl::before { content: "\2715"; color: #7a231d; }
.res-link { margin-left: 0.4rem; }

@media (prefers-color-scheme: dark) {
  #upload-status.ok { color: #b9e2c6; }
  #upload-status.fejl { color: #f0c9c5; }
  .res-ok::before { color: #b9e2c6; }
  .res-fejl::before { color: #f0c9c5; }
  .res-delvis::before { color: var(--accent); }
}

.upload-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.dok-liste {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.9rem;
}

.dok-liste li {
  padding: 0.9rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.dok-titel { font-weight: 600; text-decoration: none; color: inherit; }
.dok-titel:hover { text-decoration: underline; }

.dok-meta {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
}

.dok-resume { margin: 0.5rem 0 0; line-height: 1.55; }
.dok-uddrag { margin: 0.5rem 0 0; color: var(--muted); line-height: 1.6; }

.dok-fejl {
  margin: 0.5rem 0 0;
  padding: 0.5rem 0.7rem;
  background: #fdeceb;
  color: #7a231d;
  border-radius: 6px;
  font-size: 0.88rem;
}

/* Status skal kunne læses uden at kende pipelinen */
.dok-status {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  vertical-align: middle;
}

.dok-klar { background: #dff0e4; color: #1d5c31; }
.dok-afventer { background: var(--accent-soft); color: #5a3d13; }
.dok-doed { background: #fdeceb; color: #7a231d; }

/* Udtrukket tekst. Skal kunne rulle vandret uden at siden gør det -
   pdftotext -layout laver lange linjer i tabeller. */
.dok-tekst {
  margin-top: 0.8rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  max-height: 40rem;
  overflow-y: auto;
  font-size: 0.85rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.dok-tags { margin: 0.6rem 0 0; }

.tag {
  display: inline-block;
  padding: 0.12rem 0.55rem;
  margin-right: 0.3rem;
  border-radius: 999px;
  background: var(--border);
  color: var(--ink);
  font-size: 0.78rem;
}

.genkoer { margin-top: 0.6rem; }

@media (prefers-color-scheme: dark) {
  .dok-fejl { background: #3a1f1d; color: #f0c9c5; }
  .dok-klar { background: #1f3a28; color: #b9e2c6; }
  .dok-doed { background: #3a1f1d; color: #f0c9c5; }
}
