/* noragro/horse – felles stil. Mål i rem; skjemaavstander etter ui-design-reglene. */

:root {
  --bg: #f6f4ee;
  --surface: #ffffff;
  --surface-2: #f1eee5;
  --border: #ddd6c6;
  --text: #24291f;
  --muted: #676b5f;
  --primary: #2f6b3a;
  --primary-ink: #ffffff;
  --primary-soft: #e3efe0;
  --accent: #b5762a;
  --danger: #b33a2e;
  --ok: #2f7d43;
  --ok-soft: #e1f1e3;
  --low: #b33a2e;
  --low-soft: #f8e3df;
  --high: #9a6a12;
  --high-soft: #f8edd4;
  --sun: #8a6400;
  --sun-soft: #fbe58a;
  --sun-border: #d9a80b;
  --info-soft: #e5edf6;
  --info: #2c5a8a;
  --focus: #2c6fd1;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(40, 35, 20, .06), 0 2px 8px rgba(40, 35, 20, .05);

  --s-need: #24291f;
  --s-now: #2f7d43;
  --s-plan: #c46f1b;
  --s-temp: #2c6fd1;
  --s-cold: #7a5bc7;
  --s-rain: #8fb3dd;
  --s-act: #3f8f8a;
  --s1: #6f9a3e; --s2: #c9a227; --s3: #8a5a35; --s4: #3f8f8a;
  --s5: #b5562e; --s6: #7a5bc7; --s7: #9aa04a; --s8: #5b7aa6;
  --band: rgba(120, 110, 80, .08);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171a15;
    --surface: #20241d;
    --surface-2: #282d24;
    --border: #3a4134;
    --text: #e9ebe2;
    --muted: #a3a898;
    --primary: #7cbf72;
    --primary-ink: #13200f;
    --primary-soft: #263a22;
    --accent: #e0a65a;
    --danger: #ef7d6f;
    --ok: #7fcf8b;
    --ok-soft: #1f3a24;
    --low: #f08a7c;
    --low-soft: #45231e;
    --high: #e8bf5f;
    --high-soft: #3d3218;
    --sun: #ffe08a;
    --sun-soft: #5a4508;
    --sun-border: #e0b222;
    --info-soft: #1d2c3d;
    --info: #9cc1ea;
    --focus: #7fb0ff;
    --shadow: none;
    --s-need: #e9ebe2;
    --s-now: #7fcf8b;
    --s-plan: #f0a050;
    --s-temp: #7fb0ff;
    --s-cold: #b39cf0;
    --s-rain: #4d6f96;
    --s-act: #5fb8b0;
    --s1: #93c25f; --s2: #e2c04a; --s3: #c08a5e; --s4: #5fc0b9;
    --s5: #e0805a; --s6: #b39cf0; --s7: #c6cc6e; --s8: #8fb0dd;
    --band: rgba(255, 255, 255, .05);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 100%; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--primary); }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { line-height: 1.25; margin: 0; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.0625rem; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.icon { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Ramme */
.topbar { background: var(--primary); color: var(--primary-ink); }
.topbar-inner {
  max-width: 1440px; margin: 0 auto; padding: 10px 16px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px;
}
.brand { display: inline-flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; font-weight: 700; font-size: 1.2rem; }
.brand img { display: block; border-radius: 7px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .35); }
.mainnav { display: flex; flex-wrap: wrap; gap: 4px; }
.mainnav a {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 8px;
  color: inherit; text-decoration: none; font-weight: 500;
}
.mainnav a:hover { background: rgba(255, 255, 255, .14); }
.mainnav a[aria-current="page"] { background: rgba(255, 255, 255, .22); }
.usernav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.usernav a, .usernav button {
  position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 8px 10px; border-radius: 8px;
  color: inherit; text-decoration: none; font: inherit; font-weight: 500; background: none; border: 0; cursor: pointer;
}
.usernav a:hover, .usernav button:hover { background: rgba(255, 255, 255, .14); }
.usernav a[aria-current="page"] { background: rgba(255, 255, 255, .22); }
.usernav form { display: contents; }
.usernav-name { max-width: 16ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-count {
  position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--sun-soft); color: var(--sun); font-size: .6875rem; font-weight: 700; line-height: 18px; text-align: center;
}

/* ---------- Innlogging og tilgang */
.auth { max-width: 420px; width: 100%; margin: 8vh auto 0; }
.auth h1 { margin-bottom: 4px; }
.perm-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.perm-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.perm-list li:last-child { border-bottom: 0; }
.perm-list .grow { flex: 1 1 200px; }
.event-list { list-style: none; margin: 0; padding: 0; }
.event-list li { display: flex; flex-wrap: wrap; gap: 2px 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.event-list li:last-child { border-bottom: 0; }
.event-list time { color: var(--muted); font-size: .875rem; font-variant-numeric: tabular-nums; min-width: 11ch; }
.event-list .event-text { flex: 1 1 280px; }
.event-list li.is-new .event-text { font-weight: 600; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.plain { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.card-head h2 { display: inline-flex; align-items: center; gap: 8px; }

.page {
  max-width: 1440px; margin: 0 auto; padding: 24px 16px 48px;
  display: flex; flex-direction: column; gap: 20px;
}
.footer { max-width: 1440px; margin: 0 auto; padding: 0 16px 32px; color: var(--muted); font-size: .875rem; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 16px; }
.page-head > div:first-child { display: flex; flex-direction: column; gap: 4px; }

/* ---------- Layout */
.stack { display: flex; flex-direction: column; gap: 18px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.grid { display: grid; gap: 18px 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.page > .grid { gap: 20px; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px;
  display: flex; flex-direction: column; gap: 14px; min-width: 0;
}
.card.narrow { max-width: 420px; margin: 40px auto; width: 100%; }
.card.empty { align-items: flex-start; }
.card-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 12px; }
.card-link { color: inherit; text-decoration: none; gap: 6px; }
.card-link:hover { border-color: var(--primary); }
.card-link h2, .site-head h2 a { display: inline-flex; align-items: center; gap: 8px; }
.card h3 { margin-top: 4px; }
.steps { margin: 0; padding-left: 1.25rem; display: flex; flex-direction: column; gap: 8px; }

/* ---------- Skjema */
label { display: flex; flex-direction: column; gap: 6px; font-weight: 500; font-size: .9375rem; min-width: 0; }
:where(div, section, fieldset, form):not(.grid, .stack, .row, .card, .search-row, .ration-row, .segmented) > label + label { margin-top: 18px; }
label.check, label:has(> input[type="checkbox"]) { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; }
.grid > label.check { align-self: end; min-height: 44px; }
.input {
  font: inherit; font-weight: 400; color: var(--text);
  background-color: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 9px 12px; min-height: 44px; width: 100%;
}
.input:focus { border-color: var(--focus); outline: 2px solid color-mix(in srgb, var(--focus) 35%, transparent); outline-offset: 0; }
.input:disabled { opacity: .6; }
textarea.input { resize: vertical; }
select, select.input {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23767b6c' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 12px 8px;
  padding-right: 36px;
}
select::-ms-expand { display: none; }
input[type="checkbox"], input[type="radio"] { width: 1.15rem; height: 1.15rem; accent-color: var(--primary); margin: 0; }
.hint { font-weight: 400; font-size: .8125rem; color: var(--muted); }
.segmented + .hint { display: block; margin-top: 6px; }
.error { font-weight: 500; font-size: .875rem; color: var(--danger); }
.unit { font-weight: 400; color: var(--muted); }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }

.segmented { display: flex; flex-wrap: wrap; gap: 8px; }
.segmented .seg { flex-direction: row; font-weight: 500; }
.segmented .seg input { position: absolute; opacity: 0; pointer-events: none; }
.segmented .seg span {
  display: inline-flex; align-items: center; min-height: 40px; padding: 8px 14px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface); cursor: pointer;
}
.segmented .seg input:checked + span { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.segmented .seg input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.estimate { font-size: 1.0625rem; font-weight: 600; color: var(--primary); }
.estimate:empty { display: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; line-height: 1.2; min-height: 44px; padding: 10px 16px;
  border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  text-decoration: none; cursor: pointer;
}
.btn:hover { border-color: var(--primary); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; }
.btn-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); background: transparent; }
.btn-danger:hover { border-color: var(--danger); }
.btn-sm { min-height: 36px; padding: 6px 10px; font-size: .875rem; }
.btn-icon { padding: 10px; }
.danger-zone { justify-content: flex-end; }

.search-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.search-row .grow { flex: 1 1 260px; }
.place-results { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.place-results:empty { display: none; }
.place-results button {
  width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px;
}
.place-results button:hover { border-color: var(--primary); }
.place-results li.msg { color: var(--muted); }

.map-pick {
  position: relative; height: clamp(260px, 45vh, 380px); overflow: hidden; touch-action: none; cursor: crosshair;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px;
  -webkit-user-select: none; user-select: none;
}
.map-pick:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.map-pick.is-dragging { cursor: grabbing; }
.map-tiles { position: absolute; inset: 0; }
.map-tiles img { position: absolute; width: 256px; height: 256px; max-width: none; pointer-events: none; }
.map-marker { position: absolute; left: 0; top: 0; color: var(--danger); pointer-events: none; }
.map-marker .icon { display: block; width: 36px; height: 36px; margin: -34px 0 0 -18px; fill: var(--surface); stroke-width: 2.2; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .35)); }
.map-zoom { position: absolute; top: 10px; right: 10px; display: flex; flex-direction: column; gap: 8px; }
.map-zoom .btn { box-shadow: var(--shadow); }
.map-credit {
  position: absolute; right: 0; bottom: 0; padding: 2px 6px; font-size: .75rem; color: #24291f;
  background: rgba(255, 255, 255, .8); border-top-left-radius: 6px;
}

/* ---------- Status */
.notice {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: var(--radius);
  background: var(--info-soft); color: var(--text); border: 1px solid color-mix(in srgb, var(--info) 25%, transparent);
}
.notice .icon { margin-top: 3px; }
.notice-ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.notice-warn { background: var(--high-soft); border-color: color-mix(in srgb, var(--high) 30%, transparent); }
.notice-alert { background: var(--low-soft); border-color: color-mix(in srgb, var(--low) 35%, transparent); }
.notice-alert > .icon { color: var(--low); }
.notice-warn > .icon { color: var(--high); }
.notice-text { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 0; }
.copy-field { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.copy-field .input { flex: 1 1 240px; min-width: 0; font-size: .875rem; }
.cal-suggest > div { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; }
.cal-suggest p { margin: 0; }
.badge {
  display: inline-block; font-size: .75rem; font-weight: 600; letter-spacing: .02em; padding: 2px 8px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); vertical-align: middle;
}
.badge-plan { background: var(--high-soft); color: var(--high); border-color: transparent; align-self: flex-start; }
.badge-warn { background: var(--high-soft); color: var(--high); border-color: transparent; }
.badge-alert { background: var(--low-soft); color: var(--low); border-color: transparent; }
a.badge { text-decoration: none; }
.badges { gap: 6px; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-weight: 600; font-size: .875rem; white-space: nowrap; background: var(--surface-2); }
.pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-lav { background: var(--low-soft); color: var(--low); }
.pill-hoy { background: var(--high-soft); color: var(--high); }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.kpi {
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow); min-width: 0;
}
.kpi-label { font-size: .8125rem; color: var(--muted); font-weight: 500; }
.kpi-value { font-size: 1.375rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi-sub { font-size: .8125rem; color: var(--muted); }
.kpi-ok { border-left-color: var(--ok); }
.kpi-lav { border-left-color: var(--low); }
.kpi-lav .kpi-value { color: var(--low); }
.kpi-hoy { border-left-color: var(--high); }
.kpi-hoy .kpi-value { color: var(--high); }

/* ---------- Tabeller */
/* relative: absolutt plasserte .sr-only i cellene holdes inne i rullefeltet, ellers blir siden bredere enn skjermen */
.table-wrap { position: relative; overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
.table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.table th, .table td { padding: 9px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.table thead th { font-size: .8125rem; font-weight: 600; color: var(--muted); white-space: nowrap; background: var(--surface-2); }
.table tbody th { font-weight: 500; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .actions { text-align: right; white-space: nowrap; }
.table tr.is-inactive td { color: var(--muted); }
.table tr.is-longrange td { background: var(--band); }
details > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: "▸"; color: var(--muted); }
details[open] > summary::before { content: "▾"; }
details[open] > summary { margin-bottom: 14px; }

/* ---------- Diagram */
.chart { position: relative; width: 100%; min-height: 120px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { fill: var(--muted); font-size: 12px; font-family: inherit; }
.chart .grid-line { stroke: var(--border); stroke-width: 1; }
.chart .zero-line { stroke: var(--muted); stroke-width: 1; }
.chart .guide { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .band { fill: var(--band); }
.chart-spark { min-height: 64px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; font-size: .875rem; color: var(--muted); }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { display: inline-block; width: 18px; height: 0; border-top: 3px solid; }
.chart-legend i.dash { border-top-style: dashed; }
.chart-legend i.bar { height: 10px; border: 0; border-radius: 2px; }
.chart-tip {
  position: absolute; pointer-events: none; z-index: 2; min-width: 160px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 4px 16px rgba(0, 0, 0, .12);
  padding: 8px 10px; font-size: .8125rem; display: flex; flex-direction: column; gap: 2px;
}
.chart-tip[hidden] { display: none; }
.chart-tip b { font-size: .875rem; margin-bottom: 2px; }
.chart-tip span { display: flex; justify-content: space-between; gap: 12px; }
.chart-tip em { font-style: normal; font-variant-numeric: tabular-nums; color: var(--text); font-weight: 600; }

/* ---------- Oversikt */
.site { gap: 14px; }
.site-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.site-head h2 a { color: inherit; text-decoration: none; }
.weather-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  background: var(--info-soft); color: var(--info); font-size: .875rem; font-weight: 500;
}
.weather-chip-cold { background: color-mix(in srgb, var(--s-cold) 15%, var(--surface)); color: var(--s-cold); }
.chip-alert { background: var(--low-soft); color: var(--low); text-decoration: none; }
.horse-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.horse-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px; display: flex; flex-direction: column; gap: 10px; color: inherit; text-decoration: none; min-width: 0;
}
.horse-card:hover { border-color: var(--primary); }
.horse-card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.horse-card-head strong { font-size: 1.0625rem; }
.facts { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
.facts div { display: flex; flex-direction: column; }
.facts dt { font-size: .75rem; color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- Fôrplan */
.plans { align-items: start; }
.plan-box { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; background: var(--surface-2); min-width: 0; container-type: inline-size; }
.plan-box .input { background-color: var(--surface); }
.ration-rows { display: flex; flex-direction: column; gap: 12px; }
.ration-row {
  display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 12px 10px; align-items: end; padding-bottom: 12px; border-bottom: 1px dashed var(--border);
}
.ration-row[hidden] { display: none; }
.ration-row .when-fast { grid-column: span 2; }
.ration-row .slider-row.when-fast { grid-column: 1 / -1; }
.ration-row.is-fri .when-fast, .ration-row:not(.is-fri) .when-fri { display: none; }
.ration-calc { grid-column: 1 / -1; font-size: .875rem; color: var(--muted); }
/* Smal fôrplanboks: fôret får egen linje. */
@container (max-width: 600px) {
  .ration-row { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr) auto; }
  .ration-row > label:first-child { grid-column: 1 / -1; }
  .ration-row label.when-fast { grid-column: span 2; }
}
@container (max-width: 340px) {
  .ration-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; }
  .ration-row > label.mode-field { grid-column: 1 / -1; }
  .ration-row label.when-fast { grid-column: span 2; }
}

/* ---------- Planlegger */
.planner { display: flex; flex-direction: column; gap: 20px; }
.planner-grid { display: grid; grid-template-columns: minmax(340px, 440px) minmax(0, 1fr); gap: 20px; align-items: start; }
.planner-inputs, .planner-results { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.planner-results { transition: opacity .15s; }
.planner-results.is-busy { opacity: .6; }
.planner .plan-box { background: var(--surface); padding: 20px; }
.planner .plan-box .input { background-color: var(--surface); }
.planner .card > label + label, .planner .card > label + .inline-field, .planner .card > .inline-field + label { margin-top: 0; }
.slider-row { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; }
.slider-row input[type="range"] { flex: 1; }
input[type="range"] { width: 100%; accent-color: var(--primary); min-height: 28px; margin: 0; }
output { font-weight: 700; color: var(--primary); font-variant-numeric: tabular-nums; }
.inline-field { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.inline-field label.compact { flex: 0 0 auto; }
.input-unit { display: inline-flex; align-items: center; gap: 6px; }
.input-unit .input { width: 5.5rem; }
.input-unit span { color: var(--muted); }

.savebar {
  position: sticky; bottom: 0; z-index: 5;
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px;
  padding: 12px 16px; margin: 0 -4px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 -4px 16px rgba(40, 35, 20, .10);
}
.savebar-status { font-weight: 600; color: var(--muted); }
.savebar-status.is-dirty { color: var(--high); }
.savebar-status.is-saved { color: var(--ok); }
.savebar-status.is-error { color: var(--danger); }
.savebar-figure { display: inline-flex; align-items: center; gap: 8px; font-size: .9375rem; color: var(--muted); }
.savebar-actions { margin-left: auto; display: flex; gap: 10px; }

/* ---------- Responsivt */
/* ---------- Aktivitet */
.activity-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 400px); gap: 20px; align-items: start; }
.activity-estimate { position: sticky; top: 16px; }
.activity-estimate > div { display: flex; flex-direction: column; gap: 12px; }
.kpis-compact { grid-template-columns: minmax(0, 1fr); }
.kpis-compact .kpi { box-shadow: none; }
.activity-table td { vertical-align: top; }
.nowrap { white-space: nowrap; }

@media (max-width: 1100px) {
  .planner-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .activity-grid { grid-template-columns: minmax(0, 1fr); }
  .activity-estimate { position: static; }
}
@media (max-width: 1200px) {
  .usernav-name { display: none; }
}
@media (max-width: 1000px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plans { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .card { padding: 16px; }
  h1 { font-size: 1.5rem; }
  .mainnav a { padding: 8px 10px; }
}
@media (max-width: 520px) {
  .journal-entry { grid-template-columns: auto minmax(0, 1fr); }
  .journal-actions { grid-column: 2; justify-content: flex-start; }
  .warn-list li { grid-template-columns: auto minmax(0, 1fr); }
  .warn-list li > form, .warn-list li > .btn { grid-column: 2; justify-self: start; }
  .warn-list li > .grow:first-child ~ .btn { grid-column: 1 / -1; }
  .mainnav span:not(.sr-only) { display: none; }
  .usernav { margin-left: 0; }
  .mainnav a { padding: 10px; }
  .mainnav { gap: 2px; }
  .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .facts { grid-template-columns: 1fr 1fr; }
  .savebar { gap: 6px 12px; padding: 10px 12px; }
  .savebar-status { flex-basis: 100%; font-size: .875rem; }
  .savebar-figure { font-size: .8125rem; gap: 4px; }
  .savebar .pill { font-size: .8125rem; }
  .savebar .btn { min-height: 40px; padding: 8px 12px; }
}

/* Stamtavle: én kolonne per generasjon, hver gren strekker seg over undertreet sitt. */
.segmented .seg-link {
  display: inline-flex; align-items: center; min-height: 40px; padding: 8px 14px; font-weight: 500;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); text-decoration: none;
}
.segmented .seg-link:hover { border-color: var(--primary); }
.segmented .seg-link[aria-current] { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.ped { --g: 4; container-type: inline-size; overflow-x: auto; }
.ped[data-gen="3"] { --g: 3; } .ped[data-gen="5"] { --g: 5; } .ped[data-gen="6"] { --g: 6; }
.ped-tree, .ped-kids { display: flex; flex-direction: column; gap: 4px; }
.ped-branch { display: flex; gap: 4px; }
.ped-kids { flex: 1 1 auto; }
.ped-cell {
  --cw: calc((100cqw - (var(--g) - 1) * 4px) / var(--g));
  flex: 0 0 max(var(--cw), 8.5rem); min-width: 0;
  display: flex; flex-direction: column; justify-content: center; gap: 2px;
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-2);
  font-size: .9375rem; line-height: 1.25;
}
.ped-cell[data-d="4"], .ped-cell[data-d="5"], .ped-cell[data-d="6"] { padding: 4px 8px; font-size: .8125rem; }
.ped-cell[data-d="5"] .ped-meta, .ped-cell[data-d="6"] .ped-meta { display: none; }
.ped[data-gen="6"] .ped-cell[data-d="4"] .ped-meta { display: none; }
.ped-name { font-weight: 600; overflow-wrap: anywhere; }
.ped-meta { color: var(--muted); font-size: .8125rem; }
.ped-cell.is-unknown { background: transparent; border-style: dashed; }
.ped-cell.is-unknown .ped-name { font-weight: 400; color: var(--muted); }
.ped-rep {
  display: inline-flex; align-items: center; justify-content: center; min-width: 1.25rem; height: 1.25rem; padding: 0 4px;
  margin-left: 4px; border-radius: 999px; background: var(--high-soft); color: var(--high);
  font-size: .75rem; font-weight: 700; vertical-align: 1px;
}
.ped-cell.is-repeat { background: color-mix(in srgb, var(--high-soft) 55%, var(--surface-2)); }
.ped-cell.is-lit, .ped-repeats li.is-lit { outline: 2px solid var(--high); outline-offset: -1px; }
.ped-repeats { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ped-repeats li { padding: 4px 6px; border-radius: 6px; cursor: default; }
.ped-repeats li .ped-rep { margin: 0 6px 0 0; }
.ped-source { justify-content: space-between; border-top: 1px solid var(--border); padding-top: 12px; }

/* Kalibrering av sted */
legend { font-weight: 600; margin-bottom: 6px; padding: 0; }
.segmented.months { gap: 6px; }
.segmented.months .seg span { min-height: 36px; padding: 6px 10px; }
.sun-months .seg span { color: var(--muted); }
.sun-months .seg input:checked + span { background: var(--sun-soft); border-color: var(--sun-border); color: var(--sun); font-weight: 600; }

/* ---------- Journal og helsevarsler */
.health-warnings-body { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.warn-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.warn-list li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 6px 10px; padding: 6px 0; }
.warn-list li + li { border-top: 1px solid color-mix(in srgb, currentColor 12%, transparent); }
.warn-list li > :first-child:last-child, .warn-list li > .grow:first-child { grid-column: 1 / 3; }
.warn-list .grow { min-width: 0; overflow-wrap: anywhere; }
.warn-kind { display: inline-flex; align-self: start; margin-top: 3px; color: var(--muted); }
.warn-line { display: flex; align-items: flex-start; gap: 8px; margin: 0; padding: 8px 10px; border-radius: 8px; background: var(--low-soft); font-size: .875rem; }
.warn-line .icon { color: var(--low); margin-top: 2px; }
.journal-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.journal-entry { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 14px; align-items: start; padding: 14px 0; border-bottom: 1px solid var(--border); }
.journal-entry:first-child { padding-top: 4px; }
.journal-entry:last-child { border-bottom: 0; padding-bottom: 0; }
.journal-icon {
  --k: var(--muted);
  display: inline-flex; align-items: center; justify-content: center; width: 2.5rem; height: 2.5rem; border-radius: 999px;
  color: var(--k); background: color-mix(in srgb, var(--k) 14%, var(--surface));
}
.journal-icon .icon { width: 1.25rem; height: 1.25rem; }
.journal-skoing .journal-icon { --k: var(--accent); }
.journal-veterinaer .journal-icon { --k: var(--info); }
.journal-parasitt .journal-icon { --k: var(--s-cold); }
.journal-notat .journal-icon { --k: var(--s-act); }
.journal-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.journal-body p { margin: 0; }
.journal-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.journal-head time { color: var(--muted); font-size: .875rem; font-variant-numeric: tabular-nums; }
.journal-notes { white-space: normal; overflow-wrap: anywhere; padding-left: 10px; border-left: 3px solid var(--border); }
.journal-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.journal-actions form { display: contents; }
#journal-form .segmented .seg span { gap: 6px; }

/* ---------- Fôrlapper og utskrift */
.sheet-title { display: none; }
.sheet { gap: 10px; }
.sheet-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.sheet-head h2 { margin: 0; }
.sheet-notes { margin: 0; padding: 6px 10px; border-left: 3px solid var(--border); }
.sheet-table th[scope="row"] { font-weight: 500; }
.sheet-table td, .sheet-table th { padding: 7px 8px; }
.sheet-weather th, .sheet-weather td { color: var(--muted); font-size: .8125rem; }
label.inline { flex-direction: row; align-items: center; gap: 8px; }

@page { size: A4; margin: 12mm; }
@media print {
  :root { color-scheme: light; }
  body { background: #fff; color: #000; font-size: 10pt; }
  .topbar, .footer, .no-print, .page > .notice { display: none !important; }
  .page { max-width: none; padding: 0; gap: 10px; }
  .sheet-title { display: block; }
  .sheet-title h1 { font-size: 15pt; margin: 0 0 2px; }
  .sheet-title p { margin: 0; color: #444; }
  .card { box-shadow: none; border: 1px solid #999; border-radius: 4px; padding: 8px 10px; background: #fff; }
  .sheet { break-inside: avoid; }
  .sheet-head h2 { font-size: 12pt; }
  .table-wrap { overflow: visible; margin: 0; padding: 0; }
  .table { font-size: 9.5pt; }
  .table thead th { background: #eee; color: #000; }
  .table th, .table td { border-bottom-color: #bbb; padding: 3px 5px; }
  .muted, .sheet-weather th, .sheet-weather td { color: #444; }
  a { color: inherit; text-decoration: none; }
}


/* ---------- Chat til superbrukerne (nede til høyre) */
.chat {
  position: fixed; right: 16px; bottom: calc(16px + var(--chat-lift, 0px)); z-index: 30;
  display: flex; flex-direction: column; align-items: flex-end; gap: 10px;
  pointer-events: none;
}
.chat > * { pointer-events: auto; }
.chat-fab {
  position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 10px 18px 10px 14px;
  font: inherit; font-weight: 600; color: var(--primary-ink); background: var(--primary);
  border: 0; border-radius: 999px; cursor: pointer; box-shadow: 0 4px 14px rgba(30, 40, 20, .25);
}
.chat-fab:hover { filter: brightness(1.08); }
.chat-fab .icon { width: 1.35em; height: 1.35em; }
.chat-fab .chat-count { top: -5px; right: -5px; }
.chat-fab.is-pulse { animation: chat-pulse 1s ease-out 2; }
.chat-count {
  position: absolute; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--sun-soft); color: var(--sun); border: 2px solid var(--surface);
  font-size: .6875rem; font-weight: 700; line-height: 16px; text-align: center;
}
.chat-panel {
  display: flex; flex-direction: column;
  width: min(380px, calc(100vw - 32px)); height: min(560px, calc(100vh - 120px - var(--chat-lift, 0px)));
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden;
  box-shadow: 0 12px 36px rgba(30, 40, 20, .22);
}
.chat-panel[hidden] { display: none; }
.chat-head {
  display: flex; align-items: center; gap: 6px; padding: 10px 8px 10px 16px;
  background: var(--primary); color: var(--primary-ink);
}
.chat-back:not([hidden]) + .chat-head-text { margin-left: -4px; }
.chat-head:has(.chat-back:not([hidden])) { padding-left: 8px; }
.chat-head-text { flex: 1; min-width: 0; }
.chat-head h2 { font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-sub { font-size: .8125rem; opacity: .85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-iconbtn {
  display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; flex: none;
  color: inherit; background: none; border: 0; border-radius: 8px; cursor: pointer;
}
.chat-iconbtn:hover { background: rgba(255, 255, 255, .16); }
.chat-body { flex: 1; overflow-y: auto; padding: 14px; background: var(--bg); overscroll-behavior: contain; }
.chat-body:focus { outline: none; }
.chat-log, .chat-threads { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.chat-log { gap: 12px; }
.chat-threads { gap: 8px; }
.chat-msg { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; max-width: 85%; }
.chat-msg.is-out { align-self: flex-end; align-items: flex-end; }
.chat-bubble {
  padding: 8px 12px; border-radius: 14px 14px 14px 4px; background: var(--surface); border: 1px solid var(--border);
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.chat-msg.is-out .chat-bubble { border-radius: 14px 14px 4px 14px; background: var(--primary-soft); border-color: transparent; }
.chat-meta { display: flex; flex-wrap: wrap; gap: 0 8px; padding: 0 4px; font-size: .75rem; color: var(--muted); }
.chat-empty { padding: 4px 2px; }
.chat-thread {
  display: flex; flex-direction: column; gap: 2px; width: 100%; padding: 10px 12px; text-align: left;
  font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; cursor: pointer;
}
.chat-thread:hover { border-color: var(--primary); }
.chat-thread-top { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.chat-thread-top strong { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-thread.is-unread .chat-thread-top strong { font-weight: 700; }
.chat-thread-count { padding: 0 7px; border-radius: 999px; background: var(--sun-soft); color: var(--sun); font-size: .75rem; font-weight: 700; white-space: nowrap; }
.chat-thread-at { margin-left: auto; color: var(--muted); font-size: .75rem; white-space: nowrap; }
.chat-thread-last { color: var(--muted); font-size: .875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-form {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 8px;
  padding: 10px; border-top: 1px solid var(--border); background: var(--surface);
}
.chat-form[hidden] { display: none; }
.chat-form textarea.input { resize: none; min-height: 44px; max-height: 140px; }
.chat-form .chat-error { grid-column: 1 / -1; }
.chat-toast {
  display: flex; align-items: flex-start; width: min(340px, calc(100vw - 32px));
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--primary); border-radius: 12px;
  box-shadow: 0 8px 28px rgba(30, 40, 20, .22); animation: chat-in .2s ease-out;
}
.chat-toast-open {
  flex: 1; min-width: 0; display: flex; align-items: flex-start; gap: 10px; padding: 12px 4px 12px 12px;
  font: inherit; color: inherit; text-align: left; background: none; border: 0; cursor: pointer;
}
.chat-toast-open > .icon { margin-top: 3px; color: var(--primary); }
.chat-toast-title { display: block; }
.chat-toast-text {
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  color: var(--muted); font-size: .875rem; white-space: pre-line; overflow-wrap: anywhere;
}
.chat-toast-close { display: inline-flex; padding: 10px; color: var(--muted); background: none; border: 0; border-radius: 8px; cursor: pointer; }
.chat-toast-close:hover { color: var(--text); }
@keyframes chat-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes chat-pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--primary) 55%, transparent); }
  100% { box-shadow: 0 0 0 14px transparent; }
}
@media (prefers-color-scheme: dark) {
  .chat-fab, .chat-panel, .chat-toast { box-shadow: 0 10px 32px rgba(0, 0, 0, .5); }
}
@media (prefers-reduced-motion: reduce) {
  .chat-toast, .chat-fab.is-pulse { animation: none; }
}
@media (max-width: 520px) {
  .chat { right: 12px; bottom: calc(12px + var(--chat-lift, 0px)); }
  .chat-fab { width: 52px; height: 52px; padding: 0; justify-content: center; }
  .chat-fab-label { display: none; }
  .chat-panel { width: calc(100vw - 24px); height: calc(100dvh - 88px - var(--chat-lift, 0px)); }
  .chat-toast { width: calc(100vw - 24px); }
}

/* ---------- Avl: hopper mot hingster */
.breed-pickers { gap: 12px 16px; }
.facts-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.facts-1 { grid-template-columns: 1fr; }
.facts dd .muted { display: block; font-weight: 400; }
.mare-card h3 { font-size: 1rem; margin: 0 0 6px; }
.mare-card .notice { padding: 10px 12px; }
.mare-card .card-head a[aria-current] { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.stud-status { padding-top: 12px; border-top: 1px solid var(--border); }
.stud-job .icon, .stud-status .icon, .mare-card p .icon { width: 1rem; height: 1rem; vertical-align: -3px; }

.breed-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: .875rem; color: var(--muted); }
.breed-legend li { display: inline-flex; align-items: center; gap: 8px; }

.fcell {
  display: inline-flex; align-items: center; justify-content: flex-end; gap: 4px; min-width: 4.75rem;
  padding: 3px 8px; border-radius: 6px; font-weight: 600; font-variant-numeric: tabular-nums;
  text-decoration: none; color: var(--text); background: var(--surface-2); border: 1px solid transparent;
}
a.fcell:hover { border-color: currentColor; }
.fcell-ok { background: var(--ok-soft); color: var(--ok); }
.fcell-hoy { background: var(--high-soft); color: var(--high); }
.fcell-lav { background: var(--low-soft); color: var(--low); border-color: var(--low); }
.fcell.is-calc { font-style: italic; font-weight: 500; }
.rel-flag { display: inline-flex; color: var(--low); }
.rel-flag .icon { width: 1rem; height: 1rem; }
.breed-legend .rel-flag { min-width: 0; }

.breed-wrap { max-height: 75vh; overflow: auto; }
.breed-table { font-size: .9375rem; }
.breed-table thead th { position: sticky; top: 0; z-index: 2; }
.breed-table .sticky-col { position: sticky; left: 0; z-index: 1; background: var(--surface); min-width: 11rem; }
.breed-table thead .sticky-col { z-index: 3; background: var(--surface-2); }
.breed-table th.sticky-col .muted, .breed-table th.sticky-col .badge { display: block; width: fit-content; margin-top: 2px; }
.breed-table th.is-over strong { color: var(--low); }
.breed-table .mare-col { white-space: normal; min-width: 6.5rem; vertical-align: bottom; }
.breed-table .mare-col a { color: inherit; }
.breed-table .mare-col[aria-sort] { color: var(--primary); }
.breed-table .mare-col[aria-sort] a::after { content: ' ▲'; font-size: .75rem; }
.breed-table td { padding: 6px 8px; }
.breed-table tr.is-inactive .fcell { opacity: .55; }
.breed-table th.sticky-col .meta-inline { display: none; }

.verdict-figure { font-size: 2.5rem; font-weight: 700; line-height: 1.1; margin: 0; font-variant-numeric: tabular-nums; }
.verdict-ok .verdict-figure { color: var(--ok); }
.verdict-hoy .verdict-figure { color: var(--high); }
.verdict-lav .verdict-figure { color: var(--low); }
.verdict-lav { border-color: var(--low); }
.check-col { width: 2.5rem; }
.stallion-tools h2 { display: flex; align-items: center; gap: 8px; }
.stallion-tools h2 .icon { width: 1.25rem; height: 1.25rem; }

@media (max-width: 760px) {
  .mating-grid { grid-template-columns: 1fr; }
  .breed-table .sticky-col { min-width: 8.5rem; max-width: 10rem; }
  .breed-table .col-meta { display: none; }
  .breed-table th.sticky-col .meta-inline { display: block; }
  .fcell { min-width: 4rem; padding: 3px 6px; }
}
.breed-pickers .seg-link { display: inline-flex; align-items: center; gap: 6px; }
.mare-card .plain li { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* ---------- Avl: flokken samlet og hingstebeiter */
.breed-sort { align-items: center; gap: 8px 12px; }
.breed-sort .segmented .seg-link { min-height: 36px; }
.breed-table .group-col { background: var(--surface-2); }
.breed-table .group-col a { color: inherit; }
.breed-table .group-col[aria-sort] { color: var(--primary); }
.breed-table .group-col[aria-sort] a::after { content: ' ▲'; font-size: .75rem; }
.breed-table tr.is-chosen th.sticky-col { box-shadow: inset 4px 0 0 var(--primary); }
.breed-table tr.is-chosen td, .breed-table tr.is-chosen th.sticky-col { background: var(--primary-soft); }
.badge-chosen { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); }
.pasture-chosen { border-color: var(--primary); }
.pasture-chosen h2 { display: flex; align-items: center; gap: 8px; }
.pasture-chosen h2 .icon { width: 1.25rem; height: 1.25rem; }
.pasture-chosen h3, .pasture-add h3 { font-size: 1rem; margin: 0; }
.pasture-facts { grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: 12px 16px; }
.pasture-facts dd .fcell { min-width: 0; }
.pasture-mares li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.pasture-mares li:last-child { border-bottom: 0; }
.pasture-mares .icon { width: 1rem; height: 1rem; vertical-align: -3px; }
.pasture-add h3 { display: flex; align-items: center; gap: 6px; }
.pasture-add h3 .icon { width: 1.1rem; height: 1.1rem; }
.pasture-pick { border: 0; margin: 0; padding: 0; gap: 10px; }
.pasture-pick .muted { font-weight: 400; }
.mare-card > form.row { margin-top: auto; }
.badge-locked { display: inline-flex; align-items: center; gap: 4px; background: var(--high-soft); color: var(--high); border-color: transparent; }
.badge-locked .icon { width: .875rem; height: .875rem; }
h1 .badge-locked { font-size: .875rem; vertical-align: 4px; }
.pasture-note h2 { display: flex; align-items: center; gap: 8px; }
.pasture-note h2 .icon { width: 1.25rem; height: 1.25rem; }
.pasture-note-text { white-space: normal; overflow-wrap: anywhere; line-height: 1.5; }
.pasture-add p .icon { width: 1rem; height: 1rem; vertical-align: -3px; }

/* ---------- Hingstefilter og katalogpoeng */
.stallion-filter { border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.stallion-filter > summary { display: flex; flex-wrap: wrap; align-items: center; row-gap: 6px; gap: 8px; padding: 12px 16px; cursor: pointer; font-weight: 600; min-height: 44px; }
.stallion-filter > summary .icon { width: 1.1rem; height: 1.1rem; }
.stallion-filter > summary > span:not(.badge) { flex: 1 1 0; min-width: 0; }
.stallion-filter > form { padding: 4px 16px 16px; }
.filter-group { border: 0; margin: 0; padding: 0; }
.filter-group > legend { font-weight: 600; padding: 0; margin-bottom: 6px; }
.filter-scores { grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr)); }
.score-facts { grid-template-columns: repeat(auto-fill, minmax(6rem, 1fr)); }
.score-facts .score-total dd { color: var(--primary); }
.judging { margin: 0; padding: 10px 14px; border-left: 3px solid var(--primary); background: var(--surface-2); border-radius: 0 8px 8px 0; line-height: 1.5; }
