/*
 * Stiler for den offentlige siden (firmaside m.m.).
 * Filament-panelet har ikke eget Tailwind-tema, så komponentene her bruker egne klasser (ds-*).
 */
.ds {
    --ds-surface: #ffffff;
    --ds-sunk: #f2f2f5;
    --ds-fg: #18181b;
    --ds-muted: #5d5d68;
    --ds-line: #e3e3e8;
    --ds-accent: #e11d48;
    --ds-accent-soft: #fff1f3;
    --ds-ok: #15803d;
    --ds-ok-bg: #dcfce7;
    --ds-warn: #a16207;
    --ds-warn-bg: #fef3c7;
    --ds-bad: #dc2626;
    --ds-bad-bg: #fee2e2;
    --ds-unk: #71717a;
    --ds-unk-bg: #ececf0;
    --ds-na: #a1a1aa;
    --ds-heat: #0f766e;
    --ds-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    color: var(--ds-fg);
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 2.5rem;
    font-size: 0.9375rem;
    line-height: 1.5;
}

.dark .ds {
    --ds-surface: #1a1a1f;
    --ds-sunk: #24242b;
    --ds-fg: #ececf1;
    --ds-muted: #a3a3ae;
    --ds-line: #2e2e36;
    --ds-accent: #fb7185;
    --ds-accent-soft: #3a1620;
    --ds-ok: #4ade80;
    --ds-ok-bg: #12381f;
    --ds-warn: #fbbf24;
    --ds-warn-bg: #3a2a08;
    --ds-bad: #f87171;
    --ds-bad-bg: #401717;
    --ds-unk: #a1a1aa;
    --ds-unk-bg: #2a2a30;
    --ds-na: #6b6b75;
    --ds-heat: #2dd4bf;
}

.ds [x-cloak] { display: none !important; }
.ds > *, .ds-hero > * { min-width: 0; }
.ds a { color: inherit; }
.ds :focus-visible { outline: 2px solid var(--ds-accent); outline-offset: 2px; border-radius: 4px; }
.ds-muted { color: var(--ds-muted); }
.ds-small { font-size: 0.875rem; }
.ds-xs { font-size: 0.75rem; }
.ds-strong { font-weight: 600; }
.ds-mono { font-family: var(--ds-mono); font-size: 0.92em; }
.ds-num, .ds-score-big, .ds-cval, .ds-compare-label b { font-variant-numeric: tabular-nums; }

.ds-card {
    background: var(--ds-surface);
    border: 1px solid var(--ds-line);
    border-radius: 0.75rem;
}

.ds-h2 { font-size: 1.25rem; font-weight: 650; letter-spacing: -0.01em; margin: 0; }
.ds-h3 { font-size: 1rem; font-weight: 600; margin: 0; }
.ds-sub { color: var(--ds-muted); font-size: 0.875rem; margin: 0.25rem 0 1rem; }
.ds-eyebrow { font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ds-muted); font-weight: 600; margin: 0 0 0.375rem; }

/* Delte biter for de andre offentlige sidene */
.ds-h1 { font-size: 2rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; margin: 0; max-width: 24ch; text-wrap: balance; }
.ds-a { color: var(--ds-accent) !important; font-weight: 600; text-decoration: none; }
.ds-a:hover { text-decoration: underline; }
.ds-prose { display: grid; gap: 0.5rem; max-width: 68ch; }
.ds-prose p { margin: 0 0 0.75rem; }
.ds-prose .ds-h2 { margin-top: 0.75rem; }
.ds-list { overflow: hidden; }
.ds-list-row { display: grid; grid-template-columns: minmax(0, 1fr) 13rem; gap: 1rem; align-items: center; padding: 0.75rem 1rem; border-bottom: 1px solid var(--ds-line); text-decoration: none; }
.ds-list-row:last-child { border-bottom: 0; }
.ds-list-row:hover { background: var(--ds-sunk); }
.ds-list-row > span:first-child { display: flex; flex-wrap: wrap; gap: 0.25rem 0.5rem; align-items: baseline; min-width: 0; }
.ds-minibar { display: flex; align-items: center; gap: 0.5rem; }
.ds-minibar .ds-meter { flex: 1; }
.ds-minibar b { min-width: 2.75rem; text-align: right; font-size: 0.8125rem; font-variant-numeric: tabular-nums; }
.ds-det-card { padding: 1rem 1.25rem; }
.ds-det-foot { margin: 0.75rem 0 0; font-size: 0.8125rem; }
.ds-det-foot a { color: var(--ds-accent); font-weight: 600; text-decoration: none; }
.ds-fix { margin-top: 0.25rem; font-size: 0.8125rem; }
.ds-fix summary { cursor: pointer; color: var(--ds-accent); font-weight: 600; }
.ds-fix p { margin: 0.25rem 0 0; color: var(--ds-fg); }

.ds-home-hero { padding: 2.25rem 1.75rem; display: grid; gap: 0.875rem; }
.ds-home-hero p { margin: 0; max-width: 62ch; }
.ds-bigsearch { display: flex; max-width: 560px; border: 2px solid var(--ds-fg); border-radius: 0.75rem; overflow: hidden; background: var(--ds-surface); }
.ds-bigsearch input { flex: 1; min-width: 0; border: 0; padding: 0.75rem 0.875rem; font-size: 1rem; background: transparent; color: var(--ds-fg); }
.ds-bigsearch input:focus { outline: none; box-shadow: none; }
.ds-bigsearch:focus-within { outline: 2px solid var(--ds-accent); outline-offset: 2px; }
.ds-bigsearch button { border: 0; background: var(--ds-fg); color: var(--ds-surface); padding: 0 1.125rem; font-weight: 600; cursor: pointer; }
.ds-eg { display: flex; flex-wrap: wrap; gap: 0.375rem; align-items: center; font-size: 0.8125rem; color: var(--ds-muted); }
.ds-eg a { border: 1px solid var(--ds-line); border-radius: 999px; padding: 0.125rem 0.625rem; text-decoration: none; color: var(--ds-fg); }
.ds-eg a:hover { background: var(--ds-sunk); }
.ds-scroll { overflow-x: auto; }
.ds-heat { border-collapse: collapse; width: 100%; font-size: 0.8125rem; }
.ds-heat th { font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ds-muted); font-weight: 600; padding: 0.75rem 0.25rem 0.5rem; text-align: center; white-space: nowrap; border-bottom: 1px solid var(--ds-line); }
.ds-heat th a { text-decoration: none; }
.ds-heat th a:hover { text-decoration: underline; }
.ds-heat td { text-align: center; padding: 0; border-bottom: 1px solid var(--ds-line); font-variant-numeric: tabular-nums; }
.ds-heat tr:last-child td { border-bottom: 0; }
.ds-heat td > div { margin: 2px; padding: 0.4375rem 0.25rem; border-radius: 0.3125rem; min-width: 2.5rem; }
.ds-heat .ds-l { text-align: left; padding: 0.5rem 1rem; white-space: nowrap; font-size: 0.875rem; }
.ds-heat th.ds-l { font-size: 0.6875rem; }
.ds-heat td.ds-l a { text-decoration: none; font-weight: 500; }
.ds-heat td.ds-l a:hover { text-decoration: underline; }
.ds-heat .ds-avg { font-weight: 700; padding: 0 0.5rem; white-space: nowrap; }

/* Topp */
.ds-hero { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1.5rem; align-items: start; }
.ds-meta { display: flex; flex-wrap: wrap; gap: 0.375rem 1rem; font-size: 0.875rem; color: var(--ds-muted); align-items: center; }
.ds-meta a { text-decoration: none; }
.ds-meta a:hover { text-decoration: underline; }
.ds-chip { font-size: 0.75rem; font-weight: 600; padding: 0.125rem 0.625rem; border-radius: 999px; background: var(--ds-accent-soft); color: var(--ds-accent) !important; }
.ds-verdict { font-size: 1.0625rem; max-width: 62ch; margin: 1rem 0 0; }
.ds-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.125rem; }
.ds-btn {
    display: inline-flex; align-items: center; gap: 0.375rem;
    border: 1px solid var(--ds-line); background: var(--ds-surface); color: var(--ds-fg);
    border-radius: 0.5rem; padding: 0.4375rem 0.875rem; font-size: 0.875rem; cursor: pointer; text-decoration: none;
}
.ds-btn:hover { background: var(--ds-sunk); }
.ds-btn-primary { background: var(--ds-accent); border-color: var(--ds-accent); color: #fff !important; }
.ds-btn-primary:hover { background: var(--ds-accent); filter: brightness(1.08); }

.ds-score { padding: 1.25rem; }
.ds-score-row { display: flex; align-items: center; gap: 1rem; }
.ds-score svg { flex: none; }
.ds-ring-bg { stroke: var(--ds-sunk); }
.ds-ring { stroke: var(--ds-ok); }
.ds-score-big { font-size: 2.5rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.ds-compare { display: grid; gap: 0.5rem; margin-top: 1rem; font-size: 0.8125rem; }
.ds-compare-label { display: flex; justify-content: space-between; gap: 0.5rem; }
.ds-meter { height: 0.5rem; border-radius: 0.25rem; background: var(--ds-sunk); overflow: hidden; }
.ds-meter span { display: block; height: 100%; border-radius: 0.25rem; }
.ds-meter-self { background: var(--ds-ok); }
.ds-meter-cat { background: var(--ds-muted); }
.ds-footnote { font-size: 0.75rem; color: var(--ds-muted); margin: 0.75rem 0 0; }

/* Prioriteringer */
.ds-prio { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0.75rem; }
.ds-prio-card { padding: 1rem; display: flex; flex-direction: column; gap: 0.5rem; }
.ds-prio-card p { margin: 0; }
.ds-prio-top { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.ds-sev { font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; padding: 0.125rem 0.5rem; border-radius: 0.25rem; }
.ds-sev-high { background: var(--ds-bad-bg); color: var(--ds-bad); }
.ds-sev-medium { background: var(--ds-warn-bg); color: var(--ds-warn); }
.ds-sev-low { background: var(--ds-unk-bg); color: var(--ds-unk); }
.ds-link { margin-top: auto; align-self: flex-start; background: none; border: 0; padding: 0.25rem 0; color: var(--ds-accent); font-weight: 600; font-size: 0.875rem; cursor: pointer; }

/* Resultat per sjekk */
.ds-checks { padding: 0.375rem 1.125rem; }
.ds-group { padding: 0.625rem 0; }
.ds-group + .ds-group { border-top: 1px solid var(--ds-line); }
.ds-crow { display: grid; grid-template-columns: 120px minmax(0, 1fr) 120px; gap: 0.875rem; align-items: center; padding: 0.4375rem 0; }
.ds-cname { font-weight: 600; font-size: 0.875rem; text-decoration: none; border-bottom: 1px dotted var(--ds-muted); justify-self: start; }
.ds-stack { position: relative; display: flex; height: 0.875rem; border-radius: 0.25rem; background: var(--ds-sunk); }
.ds-stack > span:not(.ds-tick) { height: 100%; }
.ds-stack > span:first-child { border-top-left-radius: 0.25rem; border-bottom-left-radius: 0.25rem; }
.ds-tick { position: absolute; top: -0.25rem; bottom: -0.25rem; width: 2px; background: var(--ds-fg); border-radius: 1px; }
.ds-cval { font-size: 0.8125rem; text-align: right; display: flex; flex-direction: column; line-height: 1.3; }
.ds-legend { display: flex; flex-wrap: wrap; gap: 0.375rem 1rem; font-size: 0.75rem; color: var(--ds-muted); padding: 0.625rem 0 0.5rem; border-top: 1px solid var(--ds-line); }
.ds-legend i { display: inline-block; width: 0.625rem; height: 0.625rem; border-radius: 2px; margin-right: 0.3rem; vertical-align: -1px; }
.ds-legend .ds-tick-legend { width: 2px; height: 0.75rem; background: var(--ds-fg); }
.ds-legend a { margin-left: auto; color: var(--ds-accent); font-weight: 600; text-decoration: none; }
.ds-bg-s { background: var(--ds-ok); }
.ds-bg-w { background: var(--ds-warn); }
.ds-bg-f { background: var(--ds-bad); }
.ds-bg-u { background: var(--ds-unk); }

/* Domenematrise */
.ds-toolbar { display: flex; flex-wrap: wrap; gap: 0.625rem; align-items: center; margin-bottom: 0.75rem; }
.ds-seg { display: flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: 0.5625rem; background: var(--ds-sunk); }
.ds-seg button { border: 0; background: none; padding: 0.3125rem 0.6875rem; border-radius: 0.4375rem; font-size: 0.8125rem; cursor: pointer; color: var(--ds-muted); }
.ds-seg button[aria-pressed="true"] { background: var(--ds-surface); color: var(--ds-fg); font-weight: 600; box-shadow: 0 1px 2px rgb(0 0 0 / 0.08); }
.ds-input { border: 1px solid var(--ds-line); background: var(--ds-surface); color: var(--ds-fg); border-radius: 0.5rem; padding: 0.375rem 0.625rem; font-size: 0.8125rem; }
.ds-toolbar select.ds-input { padding-right: 2rem; min-width: 12rem; }
.ds-toolbar input.ds-input { flex: 1; min-width: 150px; max-width: 260px; }

.ds-matrix { overflow: hidden; }
.ds-grid { display: grid; grid-template-columns: minmax(0, 1fr) repeat(var(--ds-cols, 8), 4rem); align-items: center; }
.ds-head { font-size: 0.75rem; font-weight: 600; color: var(--ds-muted); text-align: center; border-bottom: 1px solid var(--ds-line); }
.ds-head > span { padding: 0.375rem 0.25rem; }
.ds-head .ds-l { text-align: left; padding-left: 1rem; }
.ds-head-groups { font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.08em; border-bottom: 0; }
.ds-head-groups > span { padding-top: 0.75rem; }
.ds-gsep { border-left: 2px solid var(--ds-line); }

.ds-row { border-bottom: 1px solid var(--ds-line); }
.ds-row:last-child { border-bottom: 0; }
.ds-row > summary { list-style: none; cursor: pointer; }
.ds-row > summary::-webkit-details-marker { display: none; }
.ds-row > summary:hover { background: var(--ds-sunk); }
.ds-dn { padding: 0.5rem 1rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.375rem; min-width: 0; overflow-wrap: anywhere; }
.ds-caret { display: inline-block; width: 0.75rem; color: var(--ds-muted); transition: transform 0.15s; }
.ds-row[open] .ds-caret { transform: rotate(90deg); }
.ds-badge { font-size: 0.6875rem; font-weight: 600; padding: 0 0.375rem; border-radius: 0.25rem; background: var(--ds-sunk); color: var(--ds-muted); }
.ds-badge-main { background: var(--ds-accent-soft); color: var(--ds-accent); }
.ds-cell { display: grid; place-items: center; height: 2.375rem; }
.ds-cl { display: none; }

.ds-st {
    display: inline-grid; place-items: center; flex: none;
    width: 1.5rem; height: 1.5rem; border-radius: 0.375rem;
    font-size: 0.8125rem; font-weight: 700; line-height: 1;
}
.ds-st.ds-s { background: var(--ds-ok-bg); color: var(--ds-ok); }
.ds-st.ds-w { background: var(--ds-warn-bg); color: var(--ds-warn); }
.ds-st.ds-f { background: var(--ds-bad-bg); color: var(--ds-bad); }
.ds-st.ds-u { background: var(--ds-unk-bg); color: var(--ds-unk); }
.ds-st.ds-n { color: var(--ds-na); border: 1px dashed var(--ds-line); }

.ds-det { background: var(--ds-sunk); padding: 0.875rem 1rem 1rem; }
.ds-det-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.ds-item { display: flex; gap: 0.625rem; align-items: flex-start; padding: 0.375rem 0; font-size: 0.875rem; }
.ds-item > div { min-width: 0; overflow-wrap: anywhere; }
.ds-item a { text-decoration: none; }
.ds-item a:hover { text-decoration: underline; }
.ds-empty { padding: 1.75rem; text-align: center; color: var(--ds-muted); margin: 0; }

.ds-owner { padding: 1.25rem; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem; align-items: center; }
.ds-owner p { margin: 0.375rem 0 0; max-width: 60ch; }
.ds-owner .ds-actions { margin: 0; }

@media (max-width: 1100px) {
    .ds-grid { grid-template-columns: minmax(0, 1fr) repeat(var(--ds-cols, 8), 3.25rem); }
}

@media (max-width: 820px) {
    .ds-hero { grid-template-columns: 1fr; }
    .ds-det-grid { grid-template-columns: 1fr; }
    .ds-owner { grid-template-columns: 1fr; }
}

/* Mobil: hver rad blir et kort med merker i stedet for kolonner. */
@media (max-width: 720px) {
    .ds-head { display: none; }
    .ds-row > summary.ds-grid { display: flex; flex-wrap: wrap; gap: 0.25rem; padding: 0.625rem 0.75rem; }
    .ds-dn { flex-basis: 100%; padding: 0 0 0.25rem; }
    .ds-cell { display: inline-flex; align-items: center; gap: 0.25rem; height: 1.5rem; padding: 0 0.5rem 0 0.375rem; border: 0; border-radius: 0.375rem; font-size: 0.6875rem; font-weight: 600; }
    .ds-cell .ds-st { width: auto; height: auto; background: none !important; border: 0; font-size: 0.75rem; color: inherit !important; }
    .ds-cl { display: inline; }
    .ds-c-s { background: var(--ds-ok-bg); color: var(--ds-ok); }
    .ds-c-w { background: var(--ds-warn-bg); color: var(--ds-warn); }
    .ds-c-f { background: var(--ds-bad-bg); color: var(--ds-bad); }
    .ds-c-u { background: var(--ds-unk-bg); color: var(--ds-unk); }
    .ds-c-n { color: var(--ds-na); border: 1px dashed var(--ds-line); }
    .ds-crow { grid-template-columns: 88px minmax(0, 1fr) 76px; gap: 0.625rem; }
    .ds-legend a { margin-left: 0; }
    .ds-list-row { grid-template-columns: minmax(0, 1fr) 8.5rem; }
    .ds-home-hero { padding: 1.5rem 1rem; }
    .ds-h1 { font-size: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
    .ds-caret { transition: none; }
}
