/* retsbasen.dk — one stylesheet, no build step, no framework. */

:root {
  --bg: #fbfaf8;
  --flade: #ffffff;
  --tekst: #1b1a18;
  --daempet: #62605c;
  --streg: #e2ded7;
  --accent: #7a2226;      /* retsvæsen-rød, dæmpet */
  --accent-lys: #f3e7e6;
  --link: #1f4b7a;
  --mark: #fdf0a8;
  --radius: 6px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16151a;
    --flade: #1e1d23;
    --tekst: #e8e6e1;
    --daempet: #a19d96;
    --streg: #33313a;
    --accent: #d98a8d;
    --accent-lys: #2b2024;
    --link: #8fb6de;
    --mark: #5a4a12;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--tekst);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
}

a { color: var(--link); }

mark {
  background: var(--mark);
  color: inherit;
  padding: 0 1px;
  border-radius: 2px;
}

.visuelt-skjult {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ------------------------------------------------------------- header --- */

.top {
  background: var(--flade);
  border-bottom: 1px solid var(--streg);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 10;
}

.logo {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}
.logo span { color: var(--daempet); font-weight: 400; }

.soeg {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 420px;
  flex-wrap: wrap;
}

.soeg input[type=search] {
  flex: 1 1 260px;
  min-width: 0;
  padding: 9px 12px;
  font-size: 16px;
  color: var(--tekst);
  background: var(--bg);
  border: 1px solid var(--streg);
  border-radius: var(--radius);
}
.soeg input[type=search]:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}

.soeg button {
  padding: 9px 20px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
}
.soeg button:hover { filter: brightness(1.1); }

.frase {
  font-size: 14px;
  color: var(--daempet);
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  cursor: pointer;
}

/* --------------------------------------------------------------- main --- */

main { max-width: 1180px; margin: 0 auto; padding: 24px 20px 60px; }

.layout {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 36px;
  align-items: start;
}

@media (max-width: 800px) {
  .layout { grid-template-columns: 1fr; gap: 20px; }
}

/* ------------------------------------------------------------ facetter -- */

.facetter section { margin-bottom: 26px; }

.facetter h2 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--daempet);
  margin: 0 0 8px;
}

.facetter ul { list-style: none; margin: 0; padding: 0; }

.facetter li a {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 7px;
  border-radius: 4px;
  font-size: 14px;
  text-decoration: none;
  color: var(--tekst);
}
.facetter li a:hover { background: var(--accent-lys); }

.facetter li.valgt a { background: var(--accent-lys); font-weight: 600; }

.facetter .navn {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.facetter .antal {
  color: var(--daempet);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  flex-shrink: 0;
}

/* ------------------------------------------------------------- resume --- */

.resume {
  background: var(--flade);
  border: 1px solid var(--streg);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 26px;
}

.resume h2 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent);
  margin: 0 0 10px;
}

.resume p { margin: 0 0 10px; font-size: 15px; line-height: 1.6; }

/* Citation markers: [3] in the prose becomes a superscript link to the source. */
.resume .cite {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  vertical-align: super;
  padding: 2px 5px;
  margin: 0 1px;
  border-radius: 3px;
  background: var(--accent-lys);
  color: var(--accent);
  text-decoration: none;
}
.resume .cite:hover { background: var(--accent); color: #fff; }

.resume .kilder {
  margin: 12px 0 0;
  padding-left: 22px;
  font-size: 13.5px;
}
.resume .kilder li { margin-bottom: 5px; }
.resume .kilder .meta { color: var(--daempet); margin-left: 8px; font-size: 12.5px; }

.resume-note {
  margin: 12px 0 0 !important;
  font-size: 12px !important;
  color: var(--daempet);
  line-height: 1.5 !important;
}

/* The streaming preview. Same box as the finished summary, so the reader sees
   the answer arrive in place rather than the layout jumping when it lands. */
.resume .stream { white-space: pre-wrap; }

.resume .markoer {
  display: inline-block;
  width: 8px;
  height: 1em;
  vertical-align: -2px;
  background: var(--accent);
  animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* Before the first chunk arrives: a labelled, obviously-working box rather
   than one grey line that reads as stray text. */
.resume.venter .stream::before {
  content: 'Læser de 100 øverste resultater igennem …';
  color: var(--daempet);
  margin-right: 6px;
}

/* ---------------------------------------------------------- resultater -- */

.antal-traef {
  margin: 0 0 18px;
  color: var(--daempet);
  font-size: 14px;
}
.antal-traef strong { color: var(--tekst); }
.antal-traef .tid { opacity: 0.6; }

.traef {
  padding: 16px 0;
  border-bottom: 1px solid var(--streg);
}
.traef:first-of-type { padding-top: 0; }

.traef h3 {
  margin: 0 0 5px;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.35;
}
.traef h3 a { text-decoration: none; }
.traef h3 a:hover { text-decoration: underline; }

.traef .meta {
  margin: 0 0 7px;
  font-size: 13px;
  color: var(--daempet);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.traef .meta .sep { opacity: 0.45; }

.kilde {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 3px;
  background: var(--accent-lys);
  color: var(--accent);
}

.uddrag {
  margin: 0;
  font-size: 14.5px;
  color: var(--tekst);
  opacity: 0.9;
  /* Extracted text keeps its line breaks; without this a fragment can be
     three words wide and twenty lines tall. */
  white-space: normal;
}

.intet { color: var(--daempet); padding: 30px 0; }

/* --------------------------------------------------------------- mere --- */

.mere {
  margin: 26px 0 0;
  padding: 14px 16px;
  background: var(--flade);
  border: 1px solid var(--streg);
  border-radius: var(--radius);
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--daempet);
}
/* ----------------------------------------------------------- forside ---- */

.forside { max-width: 620px; margin: 40px auto; }

.forside .ingress {
  font-size: 20px;
  line-height: 1.45;
  margin: 0 0 26px;
}

.forside .tips {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--streg);
}
.forside .tips li {
  padding: 11px 0;
  border-bottom: 1px solid var(--streg);
  font-size: 14.5px;
  color: var(--daempet);
}
.forside .tips strong {
  color: var(--tekst);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13.5px;
  background: var(--flade);
  border: 1px solid var(--streg);
  border-radius: 4px;
  padding: 1px 6px;
  margin-right: 6px;
}

/* ------------------------------------------------------------ footer ---- */

footer {
  border-top: 1px solid var(--streg);
  padding: 22px 20px 40px;
  font-size: 13px;
  color: var(--daempet);
}
footer p { max-width: 1140px; margin: 0 auto 8px; }
footer .forbehold { line-height: 1.6; }
