/* finddommer — "matchday almanak" editorial UI.
   Warm paper · ink type · Fraunces display / Hanken Grotesk body / JetBrains Mono data.
   One signal colour — vermilion — reserved for an OBSERVED swap (the product's heartbeat). */

:root {
  --paper:        #f3efe4;
  --paper-raised: #fbf8f0;
  --panel:        #ebe3d2;
  --ink:          #1b1915;
  --ink-2:        #524b3e;
  --ink-3:        #8c8473;
  --line:         #ddd4c0;
  --line-strong:  #c6bca3;
  --vermilion:    #cf3a22;
  --vermilion-deep:#a62a16;
  --pitch:        #1f4d35;
  --gold:         #9a7b2e;

  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Hanken Grotesk", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", monospace;

  --wrap: 1080px;
  --r: 4px;
  --shadow: 0 1px 0 var(--line-strong), 0 18px 40px -28px rgba(40, 32, 18, .5);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(120% 80% at 12% -10%, #fbf7ec 0%, rgba(251, 247, 236, 0) 55%),
    radial-gradient(90% 70% at 100% 0%, #efe9da 0%, rgba(239, 233, 218, 0) 60%);
  background-attachment: fixed;
  line-height: 1.5;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--vermilion); color: #fff; }

a { color: inherit; text-decoration: none; }

/* paper grain */
.grain {
  position: fixed; inset: 0; z-index: 9999; pointer-events: none; opacity: .035;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---- masthead ------------------------------------------------------------- */
.masthead { position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(6px); }
.masthead__in {
  max-width: var(--wrap); margin: 0 auto; padding: 14px 24px 10px;
  display: flex; align-items: baseline; gap: 18px;
}
.nameplate {
  font-family: var(--display); font-weight: 900; font-size: 1.45rem;
  letter-spacing: -.02em; display: inline-flex; align-items: baseline; gap: .4ch;
}
.nameplate__mark { color: var(--vermilion); font-size: .6em; }
.masthead__meta {
  font-family: var(--mono); font-size: .66rem; letter-spacing: .18em;
  text-transform: uppercase; color: var(--ink-3); margin-right: auto;
}
.masthead__nav { display: flex; align-items: center; gap: 20px; }
.masthead__nav a {
  font-weight: 600; font-size: .86rem; color: var(--ink-2);
  padding-bottom: 2px; border-bottom: 2px solid transparent; transition: .18s;
}
.masthead__nav a:hover { color: var(--ink); border-color: var(--vermilion); }
.logout { margin: 0; }
.logout button {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase;
  background: none; border: 1px solid var(--line-strong); color: var(--ink-3);
  padding: 5px 10px; border-radius: var(--r); cursor: pointer; transition: .18s;
}
.logout button:hover { border-color: var(--ink); color: var(--ink); }

/* "Intelligens" disclosure menu — native <details>, no JS */
.navmenu { position: relative; }
.navmenu > summary { list-style: none; cursor: pointer; font-weight: 600; font-size: .86rem;
  color: var(--ink-2); padding-bottom: 2px; border-bottom: 2px solid transparent; transition: .18s; }
.navmenu > summary::-webkit-details-marker { display: none; }
.navmenu > summary::after { content: "▾"; font-size: .7em; margin-left: .4ch; color: var(--ink-3); }
.navmenu[open] > summary, .navmenu > summary:hover { color: var(--ink); border-color: var(--vermilion); }
.navmenu__panel { position: absolute; top: calc(100% + 10px); right: 0; z-index: 60;
  background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow); padding: 8px; display: grid; gap: 2px; min-width: 172px; }
.navmenu__panel a { display: block; padding: 7px 12px; border-radius: var(--r); border: none;
  font-size: .86rem; color: var(--ink-2); white-space: nowrap; }
.navmenu__panel a:hover { background: var(--panel); color: var(--ink); }
.masthead__rule { height: 0; border-bottom: 1px solid var(--line);
  box-shadow: 0 3px 0 -2px var(--line-strong); }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 40px 24px 80px;
  animation: rise .6s both; }

/* ---- shared atoms --------------------------------------------------------- */
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.display { font-family: var(--display); font-weight: 900; letter-spacing: -.025em;
  line-height: .98; margin: 0; }
.kicker { font-family: var(--mono); font-size: .72rem; letter-spacing: .2em;
  text-transform: uppercase; color: var(--vermilion); margin: 0 0 14px; }
.kicker a { color: var(--ink-3); text-decoration: none;
  border-bottom: 1px dashed var(--line-strong); transition: .18s; }
.kicker a:hover { color: var(--vermilion); border-color: var(--vermilion); }
.lede { color: var(--ink-2); max-width: 46ch; }
.back { font-family: var(--mono); font-size: .74rem; letter-spacing: .08em;
  color: var(--ink-3); display: inline-block; margin-bottom: 26px; transition: .18s; }
.back:hover { color: var(--ink); }

.section-h { font-family: var(--display); font-weight: 600; font-size: 1.5rem;
  letter-spacing: -.02em; margin: 0 0 18px; display: flex; align-items: center; gap: .5ch; }
.section-h__note { font-family: var(--mono); font-size: .6rem; font-weight: 400;
  letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3);
  border: 1px solid var(--line-strong); border-radius: 999px; padding: 2px 9px; }

.dot { width: .5em; height: .5em; border-radius: 50%; display: inline-block;
  background: var(--ink-3); }
.dot--swap { background: var(--vermilion); box-shadow: 0 0 0 3px color-mix(in srgb, var(--vermilion) 22%, transparent); }

.role-tag { font-family: var(--mono); font-size: .66rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--pitch); background: color-mix(in srgb, var(--pitch) 9%, transparent);
  padding: 2px 7px; border-radius: var(--r); white-space: nowrap; }

.badge { font-family: var(--mono); font-size: .6rem; letter-spacing: .1em;
  text-transform: uppercase; padding: 2px 8px; border-radius: 999px; }
.badge--observed { background: var(--vermilion); color: #fff; }
.badge--baseline { background: var(--panel); color: var(--ink-3); }
.badge--rebaseline { background: color-mix(in srgb, var(--gold) 18%, transparent); color: var(--gold); }
.badge--udgaaet { background: var(--vermilion-deep); color: #fff; }
.badge--flyttet { background: color-mix(in srgb, var(--gold) 16%, transparent); color: var(--gold);
  border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent); }
.badge--uafklaret { background: var(--panel); color: var(--ink-3); }

.wire__moved { margin: 2px 0 0; }
.wire__moved a { color: var(--ink-3); text-decoration: none; margin-right: 1.2ch;
  border-bottom: 1px dotted var(--line-strong); }
.wire__moved a:hover { color: var(--vermilion); border-color: var(--vermilion); }

.strike { text-decoration: line-through; text-decoration-color: var(--vermilion);
  text-decoration-thickness: 2px; color: var(--ink-2); }
.arrow { color: var(--ink-3); font-weight: 700; }
.vs { color: var(--ink-3); font-weight: 400; padding: 0 .15ch; }

.btn { display: inline-block; font-weight: 700; font-size: .92rem;
  background: var(--ink); color: var(--paper); padding: 11px 18px; border-radius: var(--r);
  border: none; cursor: pointer; transition: .18s; }
.btn:hover { background: var(--vermilion); transform: translateY(-1px); }

.alert { background: color-mix(in srgb, var(--vermilion) 12%, transparent);
  border-left: 3px solid var(--vermilion); color: var(--vermilion-deep);
  padding: 10px 14px; border-radius: var(--r); font-size: .9rem; }
.alert--ok { background: color-mix(in srgb, var(--pitch) 12%, transparent);
  border-left-color: var(--pitch); color: var(--pitch); }

.empty { background: var(--paper-raised); border: 1px dashed var(--line-strong);
  border-radius: var(--r); padding: 28px; color: var(--ink-2); }
.empty p { margin: 0 0 8px; }
.empty--page { text-align: center; padding: 80px 28px; border-style: solid; }

/* ---- login ---------------------------------------------------------------- */
.login { min-height: 56vh; display: grid; place-items: center; }
.login__card { width: 100%; max-width: 420px; background: var(--paper-raised);
  border: 1px solid var(--line); border-radius: 8px; padding: 36px; box-shadow: var(--shadow); }
/* Bestilling form is 50% wider than the login card so the longer form breathes. */
.login__card--wide { max-width: 630px; }
.login__card .display { font-size: 2.6rem; margin-bottom: 10px; }
.form { display: grid; gap: 16px; margin-top: 22px; }
.form--narrow { max-width: 32rem; }
.form--invite { margin: 1.5rem 0 2.75rem; max-width: 32rem; }
.invite-link { word-break: break-all; margin: .5rem 0; }
.field { display: grid; gap: 6px; }
.field span { font-family: var(--mono); font-size: .68rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-3); }
.field input, .field select, .field textarea { font-family: var(--sans); font-size: 1rem;
  padding: 11px 13px; border: 1px solid var(--line-strong); border-radius: var(--r);
  background: var(--paper); color: var(--ink); transition: .18s; }
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none;
  border-color: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 10%, transparent); }
/* Inline checkbox row (e.g. "Husk mig" on login) — horizontal, with a normal-cased label. */
.field--check { display: flex; align-items: center; gap: 8px; }
.field--check span { font-family: var(--sans); font-size: .9rem; letter-spacing: 0;
  text-transform: none; color: var(--ink-2); }
/* Spam honeypot: visually removed without inline styles (CSP forbids style attrs). */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---- hero + search -------------------------------------------------------- */
.hero { padding: 24px 0 44px; }
.hero--compact { padding-bottom: 20px; }
.hero__title { font-size: clamp(2.8rem, 7vw, 5.2rem); margin-bottom: 30px; }
.hero--compact .display { font-size: clamp(2.2rem, 5vw, 3.4rem); }

.search { position: relative; max-width: 620px; }
.search input {
  width: 100%; font-family: var(--display); font-size: clamp(1.2rem, 3vw, 1.7rem);
  font-weight: 400; color: var(--ink); background: transparent;
  border: none; border-bottom: 2.5px solid var(--ink); padding: 10px 36px 12px 2px;
  transition: border-color .2s;
}
.search input::placeholder { color: var(--ink-3); font-style: italic; }
.search input:focus { outline: none; border-color: var(--vermilion); }
.search__spin { position: absolute; right: 4px; top: 50%; width: 16px; height: 16px;
  margin-top: -10px; border: 2px solid var(--line-strong); border-top-color: var(--vermilion);
  border-radius: 50%; opacity: 0; transition: opacity .2s; }
.search__spin.htmx-request { opacity: 1; animation: spin .7s linear infinite; }

.results { margin-top: 22px; }
.results__count { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-3); margin: 0 0 10px; }
.results__empty { color: var(--ink-3); font-style: italic; }
.hits { list-style: none; margin: 0; padding: 0; }
.hit { border-bottom: 1px solid var(--line); }
.hit a { display: grid; grid-template-columns: 1fr auto auto; align-items: baseline;
  gap: 16px; padding: 14px 6px; transition: .16s; }
.hit a:hover { background: var(--paper-raised); padding-left: 14px; }
.hit__name { font-family: var(--display); font-size: 1.25rem; font-weight: 500; }
.hit a:hover .hit__name { color: var(--vermilion); }
.hit__meta { font-size: .76rem; color: var(--ink-3); }
.hit__go { color: var(--ink-3); transition: transform .16s; }
.hit a:hover .hit__go { transform: translateX(4px); color: var(--vermilion); }

/* ---- stats strip ---------------------------------------------------------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1.5px solid var(--ink); border-bottom: 1px solid var(--line);
  margin: 8px 0 52px; }
.stat { padding: 18px 8px 16px; border-left: 1px solid var(--line); }
.stat:first-child { border-left: none; }
.stat__n { display: block; font-size: 2.1rem; font-weight: 600; letter-spacing: -.02em; }
.stat__l { font-family: var(--mono); font-size: .64rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-3); }
.stat--accent .stat__n { color: var(--vermilion); }

/* ---- two columns ---------------------------------------------------------- */
.cols { display: grid; grid-template-columns: 1.25fr 1fr; gap: 48px; }

/* swaps "wire" */
.wire { list-style: none; margin: 0; padding: 0; }
.wire__item { padding: 16px 0 16px 16px; border-left: 2px solid var(--vermilion);
  margin-bottom: 6px; }
.wire__match { font-weight: 700; font-size: 1.02rem; }
.wire__match:hover { color: var(--vermilion); }
.wire__change { margin: 6px 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.wire__change strong { font-weight: 700; }
.stamp { font-size: .68rem; color: var(--ink-3); letter-spacing: .02em; margin: 4px 0 0; }

/* recent matches */
.matchlist { list-style: none; margin: 0; padding: 0; }
.matchrow { border-bottom: 1px solid var(--line); }
.matchrow a { display: grid; grid-template-columns: auto 1fr auto; gap: 14px;
  align-items: baseline; padding: 11px 6px; transition: .16s; }
.matchrow a:hover { background: var(--paper-raised); padding-left: 12px; }
.matchrow__date { font-size: .72rem; color: var(--ink-3); white-space: nowrap; }
.matchrow__main { display: grid; gap: 1px; }
.matchrow__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px;
  font-size: .56rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.matchrow__raekke { color: var(--ink-2); font-weight: 600; }
.matchrow__tag { color: var(--ink-3); }
.matchrow__tag::before { content: "·"; margin-right: 8px; color: var(--ink-3); }
.matchrow__teams { font-weight: 600; font-size: .94rem; }
.matchrow__score { font-size: .8rem; color: var(--ink-2); }

.section-h__more { margin-left: auto; font-family: var(--mono); font-size: .66rem;
  font-weight: 400; letter-spacing: .08em; color: var(--ink-3); transition: .18s; }
.section-h__more:hover { color: var(--vermilion); }

/* ---- match browse (/kampe) filters ---------------------------------------- */
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px 20px;
  position: relative; max-width: 100%; }
.filters .field { gap: 6px; }
.filters select, .filters input[type="search"], .filters input[name="raekke"] {
  font-family: var(--sans); font-size: .95rem; padding: 9px 12px;
  border: 1px solid var(--line-strong); border-radius: var(--r);
  background: var(--paper); color: var(--ink); min-width: 190px; transition: .18s; }
.filters select:focus, .filters input[type="search"]:focus, .filters input[name="raekke"]:focus {
  outline: none; border-color: var(--ink);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 10%, transparent); }
.field--grow { flex: 1 1 200px; }
.field--grow input[type="search"], .field--grow input[name="raekke"] { width: 100%; min-width: 0; }

.seg { display: inline-flex; border: 1px solid var(--line-strong);
  border-radius: var(--r); overflow: hidden; }
.seg__opt { font-family: var(--mono); font-size: .72rem; letter-spacing: .03em;
  padding: 9px 14px; cursor: pointer; color: var(--ink-2); white-space: nowrap;
  border-left: 1px solid var(--line); transition: .15s; user-select: none; }
.seg__opt:first-child { border-left: none; }
.seg__opt input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.seg__opt:hover:has(input:not(:checked)) { background: var(--paper-raised); }
.seg__opt:has(input:checked) { background: var(--ink); color: var(--paper); }
/* anchor-based segmented control (e.g. the udvikler filter on /makkere) */
.seg__opt.is-on { background: var(--ink); color: var(--paper); }
a.seg__opt:hover:not(.is-on) { background: var(--paper-raised); }
.seg--inline { margin: -2px 0 18px; }

#kampe-results { margin-top: 28px; }

/* ---- referee subject ------------------------------------------------------ */
.subject { margin-bottom: 34px; }
.subject__name { font-size: clamp(2.4rem, 6vw, 4rem); }
.subject__meta { margin-top: 12px; font-size: .78rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-3); }
.assignments { list-style: none; margin: 0; padding: 0; }
.assign { border-bottom: 1px solid var(--line); }
.assign a { display: grid; grid-template-columns: 130px 1fr auto; gap: 6px 16px;
  align-items: baseline; padding: 15px 6px; transition: .16s; }
.assign a:hover { background: var(--paper-raised); padding-left: 14px; }
.assign__main { display: grid; gap: 3px; }
.assign__raekke { font-size: .62rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--pitch); }
.assign__teams { font-family: var(--display); font-size: 1.15rem; font-weight: 500; }
.assign a:hover .assign__teams { color: var(--vermilion); }
.assign__date { font-size: .74rem; color: var(--ink-3); }
.assign__venue { grid-column: 2 / -1; font-size: .8rem; color: var(--ink-3); }

/* referee detail: assignments + crew sidebar */
.subject-cols { display: grid; grid-template-columns: 1.5fr 1fr; gap: 48px; }
.subject-cols__side { min-width: 0; }
.section-h--mt { margin-top: 34px; }

/* ---- crews (ofte sammen) -------------------------------------------------- */
.toggle { margin: -6px 0 16px; font-size: .72rem; }
.toggle a { color: var(--ink-3); border-bottom: 1px dashed var(--line-strong); transition: .16s; }
.toggle a:hover { color: var(--vermilion); border-color: var(--vermilion); }

.crewlist { list-style: none; margin: 0; padding: 0; counter-reset: crew; }
.crew { display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
  padding: 12px 6px; border-bottom: 1px solid var(--line); }
.crew:hover { background: var(--paper-raised); }
.crew__pair { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px;
  font-weight: 600; font-size: .98rem; }
.crew__pair a:hover { color: var(--vermilion); }
.amp { color: var(--ink-3); font-weight: 400; }
.crew__main { font-family: var(--display); font-size: 1.1rem; font-weight: 600; }
.crew--trio .crew__pair { flex-direction: column; gap: 2px; }
.crew__asst { font-size: .9rem; font-weight: 500; color: var(--ink-2); }
.crew__n { font-size: .82rem; color: var(--ink-3); white-space: nowrap; }
.crew__n::before { content: ""; }
/* First-timer rows stack the (often long) debut/række/count meta UNDER the name, so it wraps
   inside the column instead of overflowing into the neighbouring board. */
.crew--firsttimer { flex-direction: column; align-items: stretch; gap: 3px; }
.crew__meta { font-size: .82rem; color: var(--ink-3); line-height: 1.35; }
.crew__meta .vs { margin: 0 2px; }
.crewlist--side .crew { padding: 9px 4px; }
.crewlist--side .crew__pair { font-size: .9rem; font-weight: 500; }
.sublabel { margin-top: 14px; }

/* shared season + level scope bar (Intelligens pages) */
.scopebar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px;
  padding: 14px 16px; margin: 4px 0 26px; background: var(--paper-raised);
  border: 1px solid var(--line); border-radius: var(--r); }
.scopebar .field { gap: 5px; }
.scopebar__years { display: flex; align-items: flex-end; gap: 12px 16px; }
.scopebar__years[hidden] { display: none; }
.scopebar select { font-family: var(--sans); font-size: .88rem; padding: 7px 10px;
  border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--paper);
  color: var(--ink); }
.scopebar .btn { align-self: flex-end; }
.scopebar__reset { align-self: flex-end; color: var(--ink-3); padding-bottom: 8px;
  border-bottom: 1px dashed var(--line-strong); transition: .16s; }
.scopebar__reset:hover { color: var(--vermilion); border-color: var(--vermilion); }

/* referee journey + crew DNA */
.journey { margin-bottom: 30px; }
.journey__strip { display: flex; flex-wrap: wrap; gap: 0; border-top: 1.5px solid var(--ink);
  border-bottom: 1px solid var(--line); }
.journey__stat { padding: 12px 18px 10px; border-left: 1px solid var(--line); }
.journey__stat:first-child { border-left: none; padding-left: 2px; }
.journey__n { display: block; font-size: 1.05rem; font-weight: 600; }
.journey__l { font-family: var(--mono); font-size: .58rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-3); }
.journey__mix { margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.dna__label { font-size: .6rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-3); margin: 14px 0 4px; }

/* live board + per-referee swap history */
.board-risk { margin-top: 44px; }
.wire__item--out { border-left-color: var(--line-strong); }

/* freshness badge (trust layer) */
.freshness { display: inline-block; font-size: .64rem; letter-spacing: .08em; text-transform: uppercase;
  padding: 3px 10px; border-radius: 999px; margin: 0 0 18px; }
.freshness--frisk { background: color-mix(in srgb, var(--pitch) 12%, transparent); color: var(--pitch); }
.freshness--gammel { background: color-mix(in srgb, var(--gold) 18%, transparent); color: var(--gold); }
.freshness--mangler { background: var(--panel); color: var(--ink-3); }

/* radar: chips, risk watchlist, anomalies */
.chip { display: inline-block; font-family: var(--mono); font-size: .6rem; letter-spacing: .06em;
  padding: 2px 8px; border-radius: 999px; background: var(--panel); color: var(--ink-2);
  margin: 0 4px 4px 0; white-space: nowrap; }
.chip--missing { background: color-mix(in srgb, var(--vermilion) 14%, transparent); color: var(--vermilion-deep); }
.risk-missing { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; max-width: 320px; }

.risklist { list-style: none; margin: 0; padding: 0; }
.riskrow { border-bottom: 1px solid var(--line); padding: 12px 0; }
.riskrow__match { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: baseline; }
.riskrow__score { font-size: 1.5rem; font-weight: 700; color: var(--vermilion);
  min-width: 2.4ch; text-align: right; }
.riskrow__main { display: grid; gap: 1px; }
.riskrow__date { font-size: .72rem; color: var(--ink-3); }
.riskrow:hover .matchrow__teams { color: var(--vermilion); }
.riskrow__comps { margin: 6px 0 0 calc(2.4ch + 16px); }

.anomlist { list-style: none; margin: 0; padding: 0; }
.anom { padding: 9px 0 9px 12px; border-left: 2px solid var(--line-strong); margin-bottom: 6px; }
.anom--sev3 { border-left-color: var(--vermilion); }
.anom--sev2 { border-left-color: var(--gold); }
.anom__tag { font-family: var(--mono); font-size: .6rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-3); margin-right: 8px; }

/* mønstre: heatmap + bars; factlist on profile */
.heatmap { overflow-x: auto; margin-bottom: 26px; font-size: .62rem; }
.heatmap__hours, .heatmap__row { display: grid; grid-template-columns: 34px repeat(24, 1fr); gap: 2px; align-items: center; }
.heatmap__row { margin-top: 2px; }
.heatmap__h { color: var(--ink-3); text-align: center; }
.heatmap__day { color: var(--ink-3); text-transform: uppercase; letter-spacing: .08em; }
/* Heatmap tint: a vermilion (#cf3a22) overlay over the panel base, in 10 fixed steps.
   Bucketed into .hm-N classes (not an inline --i) because the CSP (style-src 'self', no
   'unsafe-inline') blocks inline style attributes. .hm-0 = panel only; .hm-10 = solid. */
.heatmap__cell { height: 16px; border-radius: 2px; background-color: var(--panel); }
.heatmap__cell.hm-1  { background-image: linear-gradient(rgba(207, 58, 34, .10), rgba(207, 58, 34, .10)); }
.heatmap__cell.hm-2  { background-image: linear-gradient(rgba(207, 58, 34, .20), rgba(207, 58, 34, .20)); }
.heatmap__cell.hm-3  { background-image: linear-gradient(rgba(207, 58, 34, .30), rgba(207, 58, 34, .30)); }
.heatmap__cell.hm-4  { background-image: linear-gradient(rgba(207, 58, 34, .40), rgba(207, 58, 34, .40)); }
.heatmap__cell.hm-5  { background-image: linear-gradient(rgba(207, 58, 34, .50), rgba(207, 58, 34, .50)); }
.heatmap__cell.hm-6  { background-image: linear-gradient(rgba(207, 58, 34, .60), rgba(207, 58, 34, .60)); }
.heatmap__cell.hm-7  { background-image: linear-gradient(rgba(207, 58, 34, .70), rgba(207, 58, 34, .70)); }
.heatmap__cell.hm-8  { background-image: linear-gradient(rgba(207, 58, 34, .80), rgba(207, 58, 34, .80)); }
.heatmap__cell.hm-9  { background-image: linear-gradient(rgba(207, 58, 34, .90), rgba(207, 58, 34, .90)); }
.heatmap__cell.hm-10 { background-image: linear-gradient(rgba(207, 58, 34, 1),   rgba(207, 58, 34, 1)); }

.bars { list-style: none; margin: 0; padding: 0; }
.bars--inset { margin-top: .6rem; }
.bar { display: grid; grid-template-columns: 120px 1fr 40px; gap: 12px; align-items: center; padding: 4px 0; }
.bar__label { font-size: .72rem; color: var(--ink-2); }
.bar__track { background: var(--panel); border-radius: 999px; height: 10px; overflow: hidden; }
.bar__fill { display: block; height: 100%; background: var(--vermilion); width: 0; }
.bar__n { font-size: .72rem; color: var(--ink-3); text-align: right; }
/* Data-driven bar-fill widths as classes (CSP forbids inline style attrs); 5% buckets. */
.w-0{width:0}.w-5{width:5%}.w-10{width:10%}.w-15{width:15%}.w-20{width:20%}.w-25{width:25%}
.w-30{width:30%}.w-35{width:35%}.w-40{width:40%}.w-45{width:45%}.w-50{width:50%}.w-55{width:55%}
.w-60{width:60%}.w-65{width:65%}.w-70{width:70%}.w-75{width:75%}.w-80{width:80%}.w-85{width:85%}
.w-90{width:90%}.w-95{width:95%}.w-100{width:100%}

.factlist { margin: 0; padding-left: 1.1em; font-size: .82rem; color: var(--ink-2); }
.factlist li { margin: 3px 0; }

/* admin crawl coverage cards */
.coverage { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px;
  margin: 8px 0 14px; }
.covcard { background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--r);
  padding: 16px 18px; }
.covcard--accent { border-color: var(--vermilion); box-shadow: var(--shadow); }
.covcard__head { font-size: .6rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); margin: 0; }
.covcard__n { font-size: 1.9rem; letter-spacing: -.02em; margin: 6px 0 0; color: var(--ink-2); }
.covcard__n strong { color: var(--ink); }
.covcard--accent .covcard__n strong { color: var(--vermilion); }
.covcard__l { font-size: .8rem; color: var(--ink-2); margin: 0 0 10px; }
.covcard .bar__track { display: block; height: 8px; }
.covcard__sub { font-size: .66rem; color: var(--ink-3); margin: 8px 0 0; }

/* per-role grouped match ledger */
.ledger-group { margin-bottom: 26px; }
.ledger-group__head { font-family: var(--mono); font-size: .68rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-3); margin: 0 0 8px;
  border-bottom: 1px solid var(--line); padding-bottom: 6px; }

/* ---- sene skift (late changes) -------------------------------------------- */
.cols--feed { margin-bottom: 40px; }
.boards { display: grid; grid-template-columns: repeat(auto-fit, minmax(258px, 1fr)); gap: 28px 40px; }
.board { min-width: 0; }

/* Intelligens overview — one card per analytics page. */
.intel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(258px, 1fr));
  gap: 16px; margin-top: 28px; }
.intel-card { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px;
  background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow); transition: .18s; }
.intel-card:hover { border-color: var(--ink); transform: translateY(-2px); }
.intel-card__title { font-family: var(--display); font-weight: 600; font-size: 1.2rem;
  color: var(--ink); }
.intel-card__purpose { color: var(--ink-2); font-size: .9rem; line-height: 1.45; }
.lead { color: var(--vermilion); font-size: .68rem; letter-spacing: .02em; }
.crew__pair .lead { display: block; font-weight: 400; margin-top: 1px; }

/* referee network graph */
.graph-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 26px;
  margin-top: 16px; font-size: .74rem; color: var(--ink-3); }
.graph-controls .back { margin: 0; }
.graph-controls__group a { margin-left: 8px; color: var(--ink-3);
  border-bottom: 1px dashed var(--line-strong); transition: .16s; }
.graph-controls__group a:hover { color: var(--vermilion); border-color: var(--vermilion); }
.graph-controls__group a.is-on { color: var(--ink); font-weight: 600; border-bottom-color: var(--ink); }
#graph { height: 70vh; min-height: 420px; margin-top: 8px;
  background: var(--paper-raised); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.graph-legend { margin: 10px 2px 0; font-size: .66rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-3); }

/* ---- kort (match map) ----------------------------------------------------- */
#map { height: 70vh; min-height: 440px; margin-top: 8px;
  background: var(--paper-raised); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; z-index: 0; }
/* Day-of-week checkboxes — a compact inline row matching the .seg toggle feel. */
.weekdays { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.weekdays__opt { display: inline-flex; align-items: center; gap: 4px; font-family: var(--mono);
  font-size: .74rem; padding: 6px 8px; border: 1px solid var(--line-strong);
  border-radius: 8px; cursor: pointer; user-select: none; }
.weekdays__opt input { accent-color: var(--vermilion); margin: 0; }
.map-popup { font-family: var(--sans); font-size: .9rem; line-height: 1.5; }
.map-popup a { color: var(--vermilion); }
#kort-status { margin-top: 12px; }

/* The matches-on-the-map list below the map. */
.kort-table { width: 100%; border-collapse: collapse; margin-top: 24px; font-size: .9rem; }
.kort-table thead th { text-align: left; font-family: var(--mono); font-size: .64rem;
  letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3);
  padding: 0 12px 8px; border-bottom: 1px solid var(--line-strong); }
.kort-table th.is-sortable { cursor: pointer; user-select: none; }
.kort-table th.is-sortable:hover { color: var(--ink); }
.kort-table th.sort-asc::after { content: " ↑"; color: var(--vermilion); }
.kort-table th.sort-desc::after { content: " ↓"; color: var(--vermilion); }
.kort-table td { padding: 10px 12px; border-bottom: 1px solid var(--line);
  vertical-align: baseline; }
.kort-table td.mono { white-space: nowrap; color: var(--ink-2); }
.kort-table tbody tr { cursor: pointer; transition: background .12s; }
.kort-table tbody tr:hover { background: var(--paper-raised); }
.kort-table tbody tr:hover td a { color: var(--vermilion); }
.kort-table__empty td { color: var(--ink-3); cursor: default; }
.kort-table__empty:hover { background: none; }

/* ---- match detail --------------------------------------------------------- */
.kamp { padding-bottom: 30px; border-bottom: 1px solid var(--line); margin-bottom: 36px; }
.scoreline { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  gap: 18px; margin: 18px 0 26px; }
.scoreline__team { font-family: var(--display); font-weight: 600;
  font-size: clamp(1.5rem, 4vw, 2.6rem); letter-spacing: -.02em; }
.scoreline__team--home { text-align: right; }
.scoreline__team--away { text-align: left; }
.scoreline__mid { text-align: center; }
.scoreline__score { display: inline-block; font-size: 1.4rem; font-weight: 600;
  background: var(--ink); color: var(--paper); padding: 6px 14px; border-radius: var(--r); }
.scoreline__vs { font-family: var(--mono); font-size: .7rem; letter-spacing: .2em;
  text-transform: uppercase; color: var(--ink-3); }
.kampmeta { display: flex; flex-wrap: wrap; gap: 14px 40px; margin: 0; }
.kampmeta div { display: grid; gap: 3px; }
.kampmeta dt { font-family: var(--mono); font-size: .62rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-3); }
.kampmeta dd { margin: 0; font-weight: 500; }

.officials { margin-bottom: 48px; }
.officials__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1px; background: var(--line); border: 1px solid var(--line);
  border-radius: var(--r); overflow: hidden; }
.official { background: var(--paper-raised); padding: 16px 18px; display: grid; gap: 6px; }
.official__role { font-family: var(--mono); font-size: .62rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-3); }
.official__name { font-family: var(--display); font-size: 1.15rem; font-weight: 500;
  color: var(--pitch); transition: .16s; }
a.official__name:hover { color: var(--vermilion); text-decoration: underline;
  text-underline-offset: 3px; }
.official__name--empty { color: var(--ink-3); font-style: italic; font-weight: 400; }

/* the swap-history ledger */
.ledger { list-style: none; margin: 0; padding: 0 0 0 26px;
  border-left: 2px solid var(--line); }
.ledger__row { position: relative; padding: 4px 0 26px; }
.ledger__row:last-child { padding-bottom: 2px; }
.ledger__node { position: absolute; left: -33px; top: 7px; width: 11px; height: 11px;
  border-radius: 50%; background: var(--paper); border: 2px solid var(--ink-3); }
.ledger__row.is-observed .ledger__node { background: var(--vermilion);
  border-color: var(--vermilion); box-shadow: 0 0 0 4px color-mix(in srgb, var(--vermilion) 18%, transparent); }
.ledger__row.is-observed { margin-left: -26px; padding-left: 26px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--vermilion) 6%, transparent), transparent 70%); }
.ledger__head { display: flex; align-items: center; gap: 10px; margin: 0 0 7px; }
.ledger__change { margin: 0 0 6px; display: flex; flex-wrap: wrap; align-items: center;
  gap: 9px; font-size: 1.05rem; }
.ledger__change strong { font-weight: 700; }

/* ---- legal / privacy notice ----------------------------------------------- */
.legal { max-width: 64ch; }
.legal .display { font-size: clamp(2rem, 5vw, 3.2rem); margin-bottom: 18px; }
.legal .section-h { font-size: 1.15rem; margin-top: 34px; }
.legal p { color: var(--ink-2); }
.legal a { color: var(--pitch); text-decoration: underline; text-underline-offset: 2px; }
.legal a:hover { color: var(--vermilion); }
.legal__back { margin-top: 36px; }

/* ---- admin jobs dashboard -------------------------------------------------- */
.note { max-width: 70ch; background: var(--paper-raised); border: 1px solid var(--line);
  border-left: 3px solid var(--pitch); border-radius: var(--r); padding: 14px 16px;
  font-size: .88rem; color: var(--ink-2); margin: 4px 0 30px; }
.job-head { display: flex; align-items: baseline; gap: .6ch; flex-wrap: wrap; }
.job-desc { font-size: .82rem; color: var(--ink-3); margin-top: 4px; max-width: 60ch; }
.job-freq { font-size: .64rem; letter-spacing: .04em; color: var(--pitch); margin-top: 3px; }
.step-tag { font-size: .58rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--pitch); background: color-mix(in srgb, var(--pitch) 12%, transparent);
  padding: 2px 7px; border-radius: 999px; white-space: nowrap; }
.step-tag--free { color: var(--ink-3); background: var(--panel); }
/* admin notifications feed (in-app, admin-only) */
.notifs { margin: 8px 0 40px; }
.notifs__bar { display: flex; align-items: center; gap: 1ch; }
.notifs__bar .section-h { margin-bottom: 14px; }
.notifs__mark { margin-left: auto; }
.notif-badge { font-family: var(--mono); font-size: .62rem; font-weight: 600;
  line-height: 1; color: #fff; background: var(--vermilion); border-radius: 999px;
  padding: 4px 8px; }
.notif-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.notif { background: var(--paper-raised); border: 1px solid var(--line);
  border-left: 3px solid var(--line); border-radius: var(--r); padding: 12px 15px; }
.notif--unread { border-left-color: var(--vermilion); }
.notif__head { display: flex; align-items: baseline; gap: .8ch; flex-wrap: wrap;
  justify-content: space-between; }
.notif__body { font-family: var(--mono); font-size: .76rem; color: var(--ink-2);
  white-space: pre-wrap; margin: 8px 0 0; }
.jobs { margin: 8px 0 44px; }
.jtable { width: 100%; border-collapse: collapse; font-size: .92rem; }
.jtable th { text-align: left; font-family: var(--mono); font-size: .62rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-3); font-weight: 500; padding: 8px 10px;
  border-bottom: 1.5px solid var(--ink); }
.jtable td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.jtable--runs td { font-size: .82rem; }
/* users overview: roomier rows + top-aligned cells (the actions column stacks buttons) */
.jtable--users td { padding-top: 15px; padding-bottom: 15px; vertical-align: top; }
/* whole-row click via a stretched link (CSP-safe: a class + ::after, no inline JS/style) */
.jtable tbody tr.is-link { position: relative; }
.jtable tbody tr.is-link:hover { background: var(--paper-raised); }
.jtable a.rowlink { color: inherit; }
.jtable a.rowlink::after { content: ""; position: absolute; inset: 0; }
.jtable tbody tr.is-link:hover .rowlink { color: var(--vermilion); }
.jtable .chip { position: relative; z-index: 1; }  /* keep chips above the stretched link */

/* prev/next pager (server-rendered links, scope params preserved) */
.pager { display: flex; align-items: center; gap: 20px; margin: 20px 0 0; font-size: .78rem; }
.pager__status { color: var(--ink-3); font-family: var(--mono); }
.pager__link { color: var(--ink-3); border-bottom: 1px dashed var(--line-strong); transition: .16s; }
.pager__link:hover { color: var(--vermilion); border-color: var(--vermilion); }
.pager__link.is-disabled { opacity: .4; pointer-events: none; border-color: transparent; }
.inline-form { margin: 0; }
.btn--sm { font-size: .78rem; padding: 6px 11px; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; }
.actions form { margin: 0; }
/* destructive two-step confirm (CSP-safe, no JS): summary is the trigger, the form is revealed */
.confirm { margin: 0; }
.confirm > summary { list-style: none; cursor: pointer; display: inline-block; }
.confirm > summary::-webkit-details-marker { display: none; }
.confirm > summary::marker { content: ""; }
.confirm[open] > summary { margin-bottom: 6px; }
.btn--stop { background: var(--vermilion); }
.btn--stop:hover { background: var(--vermilion-deep); }

.jbadge { font-family: var(--mono); font-size: .6rem; letter-spacing: .08em;
  text-transform: uppercase; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.jbadge--queued    { background: var(--panel); color: var(--ink-2); }
.jbadge--running   { background: color-mix(in srgb, var(--gold) 20%, transparent); color: var(--gold); }
.jbadge--success   { background: color-mix(in srgb, var(--pitch) 14%, transparent); color: var(--pitch); }
.jbadge--failed    { background: var(--vermilion); color: #fff; }
.jbadge--timeout   { background: var(--vermilion); color: #fff; }
.jbadge--cancelled { background: var(--panel); color: var(--ink-3); }

/* ---- footer --------------------------------------------------------------- */
.foot { max-width: var(--wrap); margin: 0 auto; padding: 30px 24px 50px;
  border-top: 1px solid var(--line); color: var(--ink-3); font-size: .8rem; }
.foot .mono { color: var(--ink-2); }
.foot em { color: var(--ink-2); font-style: italic; }
.foot a { color: var(--pitch); text-decoration: underline; text-underline-offset: 2px; }
.foot a:hover { color: var(--vermilion); }

/* Logged-out pages (public landing + login/privacy): sticky footer — short pages, so pin the
   footer to the bottom of the viewport. Scoped to these body classes so the authed app is
   unaffected. .grain is fixed/out of flow, so it isn't a flex item. */
body.landing, body.public { display: flex; flex-direction: column; min-height: 100vh; }
/* width:100% so the flex item fills to its max-width (auto-margins alone would shrink-to-fit,
   which would collapse the .boards auto-fit grid from 3 columns to 2). */
body.landing .wrap, body.public .wrap { flex: 1 0 auto; width: 100%; }
body.landing .foot, body.public .foot { flex-shrink: 0; }

/* ---- motion --------------------------------------------------------------- */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
.hero, .stats, .cols, .kamp, .officials, .ledger-wrap, .subject, .assignments {
  animation: rise .55s both; }
.stats { animation-delay: .05s; } .cols { animation-delay: .1s; }
.officials { animation-delay: .05s; } .ledger-wrap { animation-delay: .1s; }

/* ---- responsive ----------------------------------------------------------- */
@media (max-width: 820px) {
  .cols { grid-template-columns: 1fr; gap: 36px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(3) { border-left: none; }
  .masthead__meta { display: none; }
  .scoreline { grid-template-columns: 1fr; text-align: center; gap: 8px; }
  .scoreline__team--home, .scoreline__team--away { text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, .wrap, .hero, .stats, .cols, .kamp, .officials, .ledger-wrap, .subject, .assignments {
    animation: none !important; }
  .search__spin.htmx-request { animation: spin .7s linear infinite; }
}
