/* DOV-portalen (SBM-1612). Samme identitet som Nexus: lyst, sort blekk, gult kirurgisk. */
:root {
  --bg: #ffffff;
  --rail: #f6f6f4;
  --raised: #ffffff;
  --ink: #1a1a18;
  --ink-soft: #4a4a45;
  --muted: #8d8c82;
  --line: #e6e5df;
  --line-strong: #cfcec6;
  --accent: #ffc600;
  --accent-weak: #fff4cc;
  --accent-line: #f0d466;
  --bad: #b3261e;
  --ok: #2f6b3a;
  --radius: 12px;
  --font: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
}
button, input, textarea { font: inherit; color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }

/* ── Topp ─────────────────────────────────────────────────────────────── */
.topp {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem max(16px, env(safe-area-inset-left));
  border-bottom: 1px solid var(--line);
  background: var(--raised);
  position: sticky;
  top: 0;
  z-index: 5;
}
.merke { display: flex; flex-direction: column; text-decoration: none; line-height: 1.1; }
.merke-ord {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  padding-bottom: 0.2rem;
  border-bottom: 3px solid var(--accent);
  align-self: flex-start;
}
.merke-sub { font-size: 0.75rem; color: var(--muted); margin-top: 0.2rem; }
.topp-bruker { display: flex; align-items: center; gap: 0.8rem; font-size: 0.9rem; color: var(--ink-soft); }

.innhold { max-width: 920px; margin: 0 auto; padding: 1.5rem 16px 4rem; }

/* ── Byggesteiner ─────────────────────────────────────────────────────── */
h1 { font-size: 1.6rem; line-height: 1.2; margin: 0 0 0.5rem; letter-spacing: -0.02em; }
h2 { font-size: 0.95rem; margin: 0 0 0.6rem; }
.eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin: 0 0 0.35rem;
}
.muted { color: var(--muted); }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.panel {
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
}
.felt { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.85rem; font-weight: 600; color: var(--ink-soft); margin-bottom: 0.8rem; }
.felt input, .felt textarea {
  font-weight: 400;
  font-size: 1rem;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--raised);
  width: 100%;
}
.felt input:focus, .felt textarea:focus { outline: 2px solid var(--ink); outline-offset: -1px; }
.rutenett { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 0.8rem; }
.bred { grid-column: 1 / -1; }

.knapp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.6rem 1.1rem;
  border-radius: 10px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--bg);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.knapp:disabled { opacity: 0.5; cursor: default; }
.knapp-sekundaer { background: var(--raised); color: var(--ink); border-color: var(--line-strong); }
.knapp-sekundaer.is-valgt { background: var(--accent-weak); border-color: var(--accent-line); }
.knapp-lenke { background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; color: var(--ink-soft); }
.knapperad { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
.feil { color: var(--bad); margin: 0.6rem 0; }
.ok { color: var(--ok); margin: 0.6rem 0; }

.status {
  display: inline-block;
  padding: 0.1rem 0.6rem;
  border-radius: 999px;
  background: var(--rail);
  border: 1px solid var(--line);
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}
.status.is-din-tur { background: var(--accent-weak); border-color: var(--accent-line); }

/* ── Innlogging ───────────────────────────────────────────────────────── */
.innlogging { max-width: 380px; margin: 3rem auto 0; }
.innlogging .felt input { font-size: 1.15rem; letter-spacing: 0.02em; }
.kode input { font-family: var(--mono); letter-spacing: 0.3em; text-align: center; }

/* ── Liste ────────────────────────────────────────────────────────────── */
.liste-topp { display: flex; align-items: flex-end; justify-content: space-between; gap: 0.8rem; flex-wrap: wrap; margin-bottom: 1rem; }
.segment { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--rail); border: 1px solid var(--line); margin-bottom: 1rem; }
.segment button { border: 0; background: none; padding: 0.35rem 0.9rem; border-radius: 999px; cursor: pointer; color: var(--ink-soft); }
.segment button[aria-selected="true"] { background: var(--raised); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgb(0 0 0 / 0.08); }
.saker { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.sak-kort {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.2rem 0.8rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  background: var(--raised);
}
.sak-kort:hover { border-color: var(--line-strong); }
.sak-kort:focus-visible { outline: 2px solid var(--ink); }
.sak-tittel { font-weight: 600; }
.sak-meta { grid-column: 1 / -1; font-size: 0.82rem; color: var(--muted); }
.tom { padding: 2rem 1rem; text-align: center; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: var(--radius); }

/* ── Forløp ───────────────────────────────────────────────────────────── */
.forlop { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0.2rem; margin: 0.2rem 0 0; padding: 0; list-style: none; }
.forlop li { text-align: center; font-size: 0.75rem; color: var(--muted); position: relative; padding-top: 1.1rem; }
.forlop li::before {
  content: "";
  position: absolute;
  top: 0.2rem;
  left: 50%;
  width: 0.7rem;
  height: 0.7rem;
  margin-left: -0.35rem;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  background: var(--raised);
}
.forlop li.passert { color: var(--ink-soft); }
.forlop li.passert::before { background: var(--ink); border-color: var(--ink); }
.forlop li.naa { color: var(--ink); font-weight: 600; }
.forlop li.naa::before { background: var(--accent); border-color: var(--ink); }
.forlop li.stoppet::before { background: var(--bad); border-color: var(--bad); }
.forlop .dato { display: block; font-family: var(--mono); font-size: 0.7rem; color: var(--muted); font-weight: 400; }
.mini-forlop { display: flex; gap: 3px; margin-top: 0.35rem; }
.mini-forlop span { width: 18px; height: 4px; border-radius: 2px; background: var(--line); }
.mini-forlop .passert { background: var(--ink); }
.mini-forlop .naa { background: var(--accent); }
.mini-forlop .stoppet { background: var(--bad); }

/* ── Saken ────────────────────────────────────────────────────────────── */
.tilbake { display: inline-block; margin-bottom: 1rem; color: var(--ink-soft); text-decoration: none; }
.spec { margin: 0; }
.spec div { display: flex; justify-content: space-between; gap: 1rem; padding: 0.35rem 0; border-bottom: 1px solid var(--line); }
.spec div:last-child { border-bottom: 0; }
.spec dt { color: var(--muted); }
.spec dd { margin: 0; text-align: right; }
.beskrivelse { white-space: pre-wrap; margin: 0; }
.steg-valg { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.6rem; }
.forslag { background: none; border: 0; padding: 0; margin: -0.4rem 0 0.6rem; color: var(--ink-soft); text-decoration: underline; cursor: pointer; font-size: 0.85rem; }

.historikk { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.hendelse { max-width: 85%; padding: 0.6rem 0.8rem; border-radius: var(--radius); border: 1px solid var(--line); background: var(--rail); }
.hendelse.sbm { align-self: flex-end; background: var(--accent-weak); border-color: var(--accent-line); }
.hendelse-topp { display: flex; flex-wrap: wrap; gap: 0.2rem 0.6rem; font-size: 0.82rem; }
.hendelse-part { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.7rem; color: var(--muted); font-weight: 600; }
.hendelse-tid { color: var(--muted); font-family: var(--mono); font-size: 0.75rem; }
.hendelse-tekst { margin: 0.35rem 0 0; white-space: pre-wrap; }
.hendelse-fot { font-size: 0.75rem; color: var(--muted); margin-top: 0.35rem; }

.to-kol { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 1rem; align-items: start; }

@media (max-width: 700px) {
  .to-kol { grid-template-columns: 1fr; }
  .hendelse { max-width: 100%; }
  .forlop li { font-size: 0.65rem; }
  .topp-bruker #bruker-navn { display: none; }
}
