/* Detaljesiderne i /lab: /lab/ui/<navn>, /lab/templates/<navn> og /lab/ui/pro/<navn>.
   Forlægget er "Kontrolpulten" fra designrunden: tastehætter, brønde, en scene med lineal og skodder,
   og en låst kodevisning til Pro. Alt er afgrænset under .det, så resten af /lab er uberørt.
   Afvigelser fra lab.css (sagt i rapporten): .lab-kopier og .ui-stjerne får 44 px og ingen farveovergang her. */

.det {
    --det-well: #141416;
    --det-pit: #0b0b0c;
    --det-cap: #1b1b1e;
    --det-cap-2: #222226;
    --det-cap-3: #2a2a2f;
    --det-line: rgba(255, 255, 255, 0.07);
    --det-line-2: rgba(255, 255, 255, 0.14);
    --det-inv: #ecebe7;
    --det-inv-text: #141416;
    --det-ease: cubic-bezier(0.23, 1, 0.32, 1);
    --det-mono: ui-monospace, 'Cascadia Code', 'JetBrains Mono', Consolas, monospace;
    --det-serif: 'Lora', Georgia, 'Times New Roman', serif;
    --det-cap-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), inset 0 -2px 0 rgba(0, 0, 0, .38), 0 0 0 1px rgba(255, 255, 255, .07);
    --det-cap-shadow-up: inset 0 1px 0 rgba(255, 255, 255, .09), inset 0 -2px 0 rgba(0, 0, 0, .42), 0 0 0 1px rgba(255, 255, 255, .10);
    --det-cap-shadow-down: inset 0 1px 0 rgba(255, 255, 255, .04), inset 0 -1px 0 rgba(0, 0, 0, .38), 0 0 0 1px rgba(255, 255, 255, .07);
    --det-well-shadow: inset 0 1px 2px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(255, 255, 255, .05);
    --det-dots: radial-gradient(rgba(255, 255, 255, .075) 1px, transparent 1.3px);
    color: var(--text);
}
/* Indholdet måles på sin egen bredde (sidebjælken tager plads), ikke vinduets. Brødkrummen står udenfor,
   så søgefeltet i den kan lægge noget fast over siden. */
.det-c { container: det / inline-size; }
.det :is(button, a) { -webkit-tap-highlight-color: transparent; }
/* ⌘K-knappen (.s-knap) har sin egen stil i lab-soeg.css; :where holder specificiteten nede. */
.det button:where(:not(.s-knap)) { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

/* --- Tastehætte-tegn og mærker --------------------------------------------- */

.det-kbd {
    display: inline-grid;
    place-items: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 5px;
    background: var(--det-cap-2);
    font: 500 11px/1 var(--det-mono);
    color: var(--text-muted);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), inset 0 -1.5px 0 rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 255, 255, .08);
    flex: none;
}
@media (hover: none), (max-width: 720px) { .det-kbd.desk { display: none; } }
html.det-nokeys .det-kbd { display: none; }

.det-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.det-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 22px;
    padding: 0 8px;
    border-radius: 6px;
    font: 500 12px/1 'Inter', system-ui, sans-serif;
    white-space: nowrap;
    flex: none;
}
.det-badge.b-pro { background: var(--det-inv); color: var(--det-inv-text); box-shadow: inset 0 1px 0 #fff, inset 0 -1.5px 0 rgba(0, 0, 0, .2); }
.det-badge.b-free { color: var(--text-muted); box-shadow: inset 0 0 0 1px var(--det-line-2); }
.det-badge.b-new { background: var(--det-cap-2); color: var(--text); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), inset 0 -1.5px 0 rgba(0, 0, 0, .45), 0 0 0 1px rgba(255, 255, 255, .07); }
.det-badge.b-new::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--groen); }
.det-badge.b-cat { background: rgba(255, 255, 255, .05); color: var(--text-muted); font: 500 11.5px/1 var(--det-mono); padding: 0 7px; }

.det-silk { display: block; margin: 0 0 9px 2px; font: 500 12.5px/1.2 'Inter', system-ui, sans-serif; color: var(--text-faint); }

/* --- Brødkrumme og hoved ------------------------------------------------------ */

.det-sti-raekke {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 44px;
    margin-bottom: 14px;
}
.det-sti ol { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0; padding: 0; list-style: none; font: 500 12.5px/1.4 var(--det-mono); color: var(--text-faint); }
.det-sti li { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.det-sti li + li::before { content: "/" / ""; color: var(--text-faint); }
.det-sti a { display: inline-flex; align-items: center; min-height: 32px; color: var(--text-faint); text-decoration: none; }
.det-sti [aria-current] { color: var(--text-muted); overflow-wrap: anywhere; }
.det-sti-plads:empty { display: none; }

.det-hoved { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px 40px; margin-bottom: 26px; }
.det-titel { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; }
.det-h1 { margin: 0; font: 400 clamp(30px, 3.4vw, 48px)/1.04 var(--det-serif); letter-spacing: -.025em; color: var(--text); text-wrap: balance; overflow-wrap: break-word; }
.det-desc { margin: 12px 0 0; max-width: 68ch; font-size: 16px; line-height: 1.6; color: var(--text-muted); text-wrap: pretty; }
.det-desc code, .det-tbl td:last-child code, .det-a11y code { font: 400 .86em/1 var(--det-mono); color: var(--text); }
.det-kredit { margin: 10px 0 0; max-width: 68ch; font-size: 13px; line-height: 1.5; color: var(--text-faint); }
.det-kredit a { color: var(--text-muted); }
.det-act { display: flex; flex-direction: column; align-items: flex-end; justify-content: flex-end; gap: 10px; min-width: 0; max-width: 460px; transition: opacity 160ms var(--det-ease); }
.det-act.is-quiet { opacity: 0; }
.det-note { margin: 0; max-width: 36ch; font-size: 13px; line-height: 1.4; color: var(--text-faint); text-align: right; }
.det .det-koeb { width: auto; min-width: 220px; }

/* Stjernen: 44 px og uden hop (lab.css giver 32 px og et fjedrende hop). */
.det .ui-stjerne.det-stjerne { width: 44px; height: 44px; border-radius: 12px; transition: transform 90ms var(--det-ease); }
.det .ui-stjerne.det-stjerne[aria-pressed="true"] svg { animation: none; }
.det .ui-stjerne.det-stjerne:active { transform: translateY(1px); }

/* Kommandolinje i en brønd. */
.det-cmd {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    max-width: 100%;
    padding: 4px 4px 4px 14px;
    border-radius: 12px;
    background: var(--det-pit);
    box-shadow: var(--det-well-shadow);
}
.det-cmd code { flex: 1; min-width: 0; font: 400 12.5px/1.4 var(--det-mono); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.det-cmd .p { color: var(--text-faint); user-select: none; }

/* Kopiknappen som tastehætte: 44 px høj, kun et lille tryk (lab.css har 7/10 px og farveovergange). */
.det .lab-kopier {
    min-height: 44px;
    padding: 0 12px 0 10px;
    gap: 8px;
    border: 0;
    border-radius: 9px;
    background: var(--det-cap-2);
    box-shadow: var(--det-cap-shadow-up);
    font: 500 12.5px/1 'Inter', system-ui, sans-serif;
    color: var(--text);
    transition: transform 90ms var(--det-ease);
}
.det .lab-kopier[hidden] { display: none; }
.det .lab-kopier:active { transform: translateY(1px); box-shadow: var(--det-cap-shadow-down); }
.det .lab-kopier[data-kopieret] { color: var(--groen); }
.det .lab-kode-ramme .lab-kopier { top: 6px; right: 6px; }

/* installLinje (lab.css .lab-install) som samme brønd. */
.det .lab-install { margin-top: 0; padding: 4px 4px 4px 14px; border: 0; border-radius: 12px; background: var(--det-pit); box-shadow: var(--det-well-shadow); }
.det .lab-install code { font: 400 12.5px/1.5 var(--det-mono); color: var(--text); }
.det .lab-install + .lab-install, .det .ui-lille + .lab-install { margin-top: 8px; }
.det .lab-knap { min-height: 44px; transition: transform 90ms var(--det-ease); }
.det .lab-knap:active { transform: translateY(1px); }

/* --- Linjen med faner og styring ----------------------------------------------- */

.det-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px 24px; padding-bottom: 18px; margin-bottom: 24px; border-bottom: 1px solid var(--det-line); }

.det-seg { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 4px; border-radius: 14px; background: var(--det-pit); box-shadow: var(--det-well-shadow); isolation: isolate; }
.det-seg-ind { position: absolute; z-index: -1; top: 4px; bottom: 4px; left: 4px; width: calc((100% - 8px) / var(--n, 4)); border-radius: 10px; background: var(--det-cap-2); box-shadow: var(--det-cap-shadow-up); transform: translateX(calc(var(--i, 0) * 100%)); transition: transform 280ms var(--det-ease); }
.det-led { position: absolute; top: 7px; right: 8px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.det .det-seg-item { position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 10px; color: var(--text-muted); font-size: 14px; white-space: nowrap; user-select: none; transition: transform 90ms var(--det-ease); }
.det .det-seg-item[aria-selected="true"], .det .det-seg-item[aria-checked="true"] { color: var(--text); }
.det .det-seg-item:active { transform: translateY(1px); }
.det .det-seg-item:focus-visible { outline-offset: -2px; border-radius: 10px; }
.det-faner { min-width: 430px; }

.det-ctl { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 20px; }
.det-ctl[hidden] { display: none; }
.det-grp { display: flex; align-items: center; gap: 10px; }
.det-grp > .det-silk { margin: 0; }
.det-sw3 { min-width: 216px; }
.det .det-sw3 .det-seg-item { padding: 0 10px; font: 500 13px/1 var(--det-mono); }

/* Farver: et prik pr. farve, ring om den valgte. */
.det-farver { display: flex; padding: 0 2px; border-radius: 14px; background: var(--det-pit); box-shadow: var(--det-well-shadow); }
.det .det-farve { display: grid; place-items: center; width: 40px; height: 44px; border-radius: 10px; }
.det-farve i { width: 16px; height: 16px; border-radius: 50%; background: var(--f); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18); transition: transform 160ms var(--det-ease); }
.det-farve[aria-checked="true"] i { box-shadow: 0 0 0 2px var(--det-pit), 0 0 0 3.5px var(--text); }
.det .det-farve:focus-visible { outline-offset: -3px; }

/* Lys/mørk som en fysisk kontakt. */
.det .det-tog { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 4px; font-size: 13px; line-height: 1; color: var(--text-faint); }
.det-tog .on { color: var(--text); }
.det-tog-track { position: relative; width: 52px; height: 28px; border-radius: 999px; background: var(--det-pit); box-shadow: var(--det-well-shadow); }
.det-tog-knob { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 999px; background: var(--det-cap-3); box-shadow: var(--det-cap-shadow-up); transition: transform 260ms var(--det-ease); }
.det-tog[aria-checked="true"] .det-tog-knob { transform: translateX(24px); background: #e9e8e4; box-shadow: inset 0 1px 0 #fff, inset 0 -2px 0 rgba(0, 0, 0, .2); }

.det-runde { gap: 8px; }
.det .det-rund { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--det-cap-2); box-shadow: var(--det-cap-shadow-up); color: var(--text-muted); transition: transform 90ms var(--det-ease); }
.det .det-rund:active { transform: translateY(1px); box-shadow: var(--det-cap-shadow-down); }
.det-rund svg { width: 16px; height: 16px; }

/* --- Paneler ------------------------------------------------------------------- */

.det-panel { min-width: 0; }
.det-panel:focus-visible { outline-offset: 6px; border-radius: 12px; }
.det-panel[hidden] { display: none; }
.det-stak { display: grid; gap: 32px; }
.det-blok { min-width: 0; }
.det-blok .ui-lille { margin: 10px 0 0 2px; }
.det-blok .det-codecard { margin-top: 12px; }
.det-blok > .det-silk:first-child + .det-codecard { margin-top: 0; }
.det-tekst { margin: 0 0 12px 2px; max-width: 68ch; color: var(--text-muted); font-size: 15px; line-height: 1.55; }
.det-vars-h { margin-top: 24px; }
.det-hent-valg { color: rgba(15, 15, 15, .62); }

/* --- PreviewStage: lineal, vindue med kæber og to skodder ----------------------- */

.det-stage { --f: 1; overflow: hidden; padding: 10px; border-radius: 20px; background: var(--det-well); box-shadow: var(--det-well-shadow); color: var(--text); }
.det-ruler { position: relative; height: 44px; margin: 0 2px 8px; }
.det-ticks { position: absolute; left: 0; right: 0; bottom: 0; height: 14px; background-image: repeating-linear-gradient(90deg, rgba(255, 255, 255, .28) 0 1px, transparent 1px calc(100% / 36)), repeating-linear-gradient(90deg, rgba(255, 255, 255, .5) 0 1px, transparent 1px calc(100% / 9)); background-size: 100% 6px, 100% 14px; background-repeat: no-repeat; background-position: 0 100%, 0 100%; }
.det-ticks::after { content: ""; position: absolute; right: 0; bottom: 0; width: 1px; height: 14px; background: rgba(255, 255, 255, .5); }
.det-rail { position: absolute; inset: 0; pointer-events: none; transition: transform 300ms var(--det-ease); }
.det-rail-l { transform: translateX(calc(var(--f) * -50%)); }
.det-rail-r { transform: translateX(calc(var(--f) * 50%)); }
.det-jaw { position: absolute; left: 50%; bottom: 0; width: 2px; height: 26px; margin-left: -1px; border-radius: 1px; background: var(--text); }
.det-jaw::before { content: ""; position: absolute; top: -1px; left: -4px; width: 10px; height: 2px; border-radius: 1px; background: var(--text); }
.det-readout { position: absolute; left: 50%; top: 2px; display: flex; align-items: baseline; gap: 6px; padding: 4px 10px; border-radius: 8px; background: var(--det-pit); box-shadow: var(--det-well-shadow); transform: translateX(-50%); }
.det-odo { display: inline-flex; font: 500 17px/1 var(--det-mono); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.det-readout .u { font: 500 11.5px/1 var(--det-mono); color: var(--text-faint); }
.det-odo-d { display: inline-block; height: 1em; overflow: hidden; line-height: 1; }
.det-odo-d.blank { opacity: 0; width: 0; }
.det-odo-col { display: flex; flex-direction: column; transform: translateY(calc(var(--v, 0) * -10%)); transition: transform 300ms var(--det-ease); }
.det-odo-col span { display: block; height: 1em; line-height: 1; }

.det-win { position: relative; height: clamp(300px, 48vh, 540px); overflow: hidden; border-radius: 12px; background: #141416; isolation: isolate; }
.det-win::after { content: ""; position: absolute; inset: 0; z-index: 3; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1); pointer-events: none; }
.det-win-inner { position: absolute; top: 0; left: 50%; width: 100%; height: 100%; transform: translateX(-50%); transform-origin: 50% 0; transition: opacity 200ms var(--det-ease); }
.det-win-inner iframe { display: block; width: 100%; height: 100%; border: 0; color-scheme: dark; }
.det-stage[data-theme="light"] .det-win-inner iframe { color-scheme: light; }
/* Første indlæsning: rammen vises først, når demoen er klar. Ved genindlæsning bliver den gamle stående, indtil
   dækket (efter 300 ms) lægger sig over. */
.det-win.det-ny[data-state="loading"] .det-win-inner { opacity: 0; }
.det-win[data-state="error"] .det-win-inner { visibility: hidden; }

.det-shutter { position: absolute; top: 0; bottom: 0; z-index: 2; width: 50%; background-color: #0d0d0e; background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, .045) 0 1px, transparent 1px 8px); transition: transform 300ms var(--det-ease); }
.det-sh-l { left: 0; transform: translateX(calc(var(--f) * -100%)); box-shadow: inset -1px 0 0 rgba(255, 255, 255, .22); }
.det-sh-r { right: 0; transform: translateX(calc(var(--f) * 100%)); box-shadow: inset 1px 0 0 rgba(255, 255, 255, .22); }
.det-sh-l::after, .det-sh-r::after { content: ""; position: absolute; top: 50%; width: 4px; height: 34px; margin-top: -17px; border-radius: 2px; background: rgba(255, 255, 255, .28); }
.det-sh-l::after { right: 6px; }
.det-sh-r::after { left: 6px; }

.det-win-load, .det-win-err { position: absolute; inset: 0; z-index: 1; display: none; place-items: center; align-content: center; gap: 14px; padding: 24px; background-color: #141416; background-image: var(--det-dots); background-size: 16px 16px; font-size: 14px; color: var(--text-muted); text-align: center; }
.det-win-load { opacity: 0; }
.det-win-load i { position: relative; display: block; width: 160px; height: 2px; overflow: hidden; border-radius: 2px; background: rgba(255, 255, 255, .12); }
.det-win-load i::before { content: ""; position: absolute; inset: 0; width: 30%; background: var(--text-muted); animation: det-indet 1.2s var(--det-ease) infinite; }
@keyframes det-indet { from { transform: translateX(-100%); } to { transform: translateX(340%); } }
@keyframes det-appear { to { opacity: 1; } }
.det-win[data-state="loading"] .det-win-load { display: grid; animation: det-appear 150ms var(--det-ease) 300ms forwards; }
.det-win[data-state="error"] .det-win-err { display: grid; }
.det .det-try { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px; border-radius: 10px; background: var(--det-cap); box-shadow: var(--det-cap-shadow); font-size: 14px; color: var(--text); white-space: nowrap; transition: transform 90ms var(--det-ease); }
.det .det-try:active { transform: translateY(1px); box-shadow: var(--det-cap-shadow-down); }
.det-try svg { width: 14px; height: 14px; }

.det-stage-note { display: flex; justify-content: space-between; gap: 16px; margin: 12px 4px 2px; font-size: 13px; line-height: 1.5; color: var(--text-faint); }
.det-stage-note span:last-child { text-align: right; }

/* Lys scene: rammen vender, demoen styrer sit eget tema. */
.det-stage[data-theme="light"] { background: #e7e6e1; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .18), inset 0 0 0 1px rgba(0, 0, 0, .08); color: #141416; }
.det-stage[data-theme="light"] .det-ticks { background-image: repeating-linear-gradient(90deg, rgba(0, 0, 0, .3) 0 1px, transparent 1px calc(100% / 36)), repeating-linear-gradient(90deg, rgba(0, 0, 0, .55) 0 1px, transparent 1px calc(100% / 9)); }
.det-stage[data-theme="light"] .det-ticks::after { background: rgba(0, 0, 0, .55); }
.det-stage[data-theme="light"] .det-jaw, .det-stage[data-theme="light"] .det-jaw::before { background: #141416; }
.det-stage[data-theme="light"] .det-readout { background: #f6f5f2; box-shadow: inset 0 1px 1px rgba(0, 0, 0, .12), inset 0 0 0 1px rgba(0, 0, 0, .08); }
.det-stage[data-theme="light"] .det-readout .u { color: #5c5c61; }
.det-stage[data-theme="light"] .det-win { background: #f6f5f2; }
.det-stage[data-theme="light"] .det-win::after { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }
.det-stage[data-theme="light"] .det-shutter { background-color: #d9d8d2; background-image: repeating-linear-gradient(135deg, rgba(0, 0, 0, .06) 0 1px, transparent 1px 8px); }
.det-stage[data-theme="light"] .det-sh-l { box-shadow: inset -1px 0 0 rgba(0, 0, 0, .25); }
.det-stage[data-theme="light"] .det-sh-r { box-shadow: inset 1px 0 0 rgba(0, 0, 0, .25); }
.det-stage[data-theme="light"] .det-sh-l::after, .det-stage[data-theme="light"] .det-sh-r::after { background: rgba(0, 0, 0, .3); }
.det-stage[data-theme="light"] .det-stage-note { color: #5c5c61; }
.det-stage[data-theme="light"] :is(.det-win-load, .det-win-err) { color: #4a4a4f; background-color: #f6f5f2; background-image: radial-gradient(rgba(0, 0, 0, .12) 1px, transparent 1.3px); }
.det-stage[data-theme="light"] .det-win-load i { background: rgba(0, 0, 0, .12); }
.det-stage[data-theme="light"] .det-win-load i::before { background: #4a4a4f; }

/* --- Kode: kodekort, Shiki-blokke og den låste visning --------------------------- */

.det-codecard { overflow: hidden; border-radius: 18px; background: #0e0e10; box-shadow: inset 0 0 0 1px var(--det-line-2); }
.det-codecard .ui-kode-top { min-height: 48px; padding: 2px 6px 2px 16px; border-bottom-color: var(--det-line); font: 500 12.5px/1 var(--det-mono); color: var(--text); }
.det-codecard .ui-kode pre { background: transparent; }
.det-codecard .ui-kode + .ui-kode { border-top-color: var(--det-line-2); }
.det .lab-kode-ramme pre.lab-kode { margin: 0; border: 0; border-radius: 14px; background: var(--det-pit); box-shadow: var(--det-well-shadow); padding-right: 120px; }

.det-code-h { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 8px 0 16px; border-bottom: 1px solid var(--det-line); font: 500 12.5px/1 var(--det-mono); color: var(--text-muted); }
.det-code-h svg { width: 14px; height: 14px; flex: none; }
.det-code-h .file { color: var(--text); }
.det-code { margin: 0; padding: 16px 0; font: 400 13px/24px var(--det-mono); color: #c9c9c9; counter-reset: l; tab-size: 2; }
.det-code .ln { display: block; min-height: 24px; padding: 0 20px 0 0; white-space: pre; }
.det-code .ln::before { counter-increment: l; content: counter(l); display: inline-block; width: 52px; padding-right: 18px; text-align: right; color: #6e6e73; user-select: none; }
.det-code .k { color: #f4f4f4; }
.det-code .s { color: #d6bd8e; }
.det-code .c { color: #7e7e83; font-style: italic; }
.det-code .t { color: #8fd1b3; }
.det-code .g { color: #a8a8a8; }

.det-lc-body { position: relative; }
.det-lc-body .det-code { position: absolute; inset: 0; overflow: hidden; filter: blur(5px); opacity: .4; user-select: none; pointer-events: none; -webkit-mask-image: linear-gradient(#000 45%, transparent 100%); mask-image: linear-gradient(#000 45%, transparent 100%); }
.det-lock { position: relative; padding: 26px 24px 24px; text-align: center; }
.det-slot { position: relative; width: 132px; height: 20px; margin: 0 auto 16px; border-radius: 10px; background: var(--det-pit); box-shadow: inset 0 2px 4px rgba(0, 0, 0, .7), inset 0 0 0 1px rgba(255, 255, 255, .08); }
.det-slot::before, .det-slot i { content: ""; position: absolute; left: 18px; right: 18px; top: 9px; height: 2px; border-radius: 2px; background: #000; box-shadow: 0 1px 0 rgba(255, 255, 255, .06); }
.det-slot i { background: var(--accent); box-shadow: none; opacity: 0; transition: opacity 160ms var(--det-ease); }
.det-slot::after { content: ""; position: absolute; right: -26px; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--det-pit); box-shadow: inset 0 1px 3px rgba(0, 0, 0, .7), inset 0 0 0 1px rgba(255, 255, 255, .08); }
.det-lock:has(a.det-koeb:focus-visible) .det-slot i { opacity: 1; }
.det-lock h3 { margin: 0; font: 400 30px/1.1 var(--det-serif); letter-spacing: -.02em; color: var(--text); }
.det-lock > p { margin: 8px auto 0; max-width: 52ch; font-size: 16px; line-height: 1.55; color: var(--text-muted); text-wrap: pretty; }
.det-lock .det-koeb { margin-top: 18px; }
.det-lock .det-price-note { margin-top: 10px; max-width: none; font-size: 14px; color: var(--text-faint); }
.det-lock .det-price-note b { color: var(--text-muted); font-weight: 500; }
.det-slotfacts { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 0; margin: 14px auto 0; padding: 0; list-style: none; font-size: 14px; color: var(--text-muted); }
.det-slotfacts li { padding: 0 12px; border-left: 1px solid var(--det-line-2); }
.det-slotfacts li:first-child { border-left: 0; }

.det-lc-alt { display: grid; grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); align-items: center; gap: 12px 32px; padding: 14px 20px; border-top: 1px solid var(--det-line); background: #121214; }
.det-lc-alt p { margin: 0; font-size: 15px; line-height: 1.45; color: var(--text-muted); }
.det-lc-alt p b { color: var(--text); font-weight: 500; }
.det-lc-alt .sub { margin-top: 6px; font-size: 13px; line-height: 1.5; color: var(--text-faint); }
.det-lc-alt .sub code { font: 400 12px/1 var(--det-mono); color: var(--text-muted); }
.det-lc-alt .sub a { color: var(--text-muted); text-decoration: underline; text-decoration-color: rgba(255, 255, 255, .3); text-underline-offset: 3px; }
.det-lc-cmds { display: grid; gap: 8px; min-width: 0; }
.det-lc-cmds .det-cmd { width: 100%; max-width: none; }
.det-cmd-l, .det-cmd .cmd-l { flex: none; min-width: 28px; font: 500 11px/1 var(--det-mono); color: var(--text-faint); }
.det-cmd code.wrap { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; padding: 5px 0; }

/* --- Props og A11y ------------------------------------------------------------- */

.det-props-navn { margin-bottom: 12px; }
.det-props-navn code { font: 500 12.5px/1 var(--det-mono); color: var(--text-muted); }
.det-tbl-wrap { overflow-x: auto; border-radius: 16px; box-shadow: inset 0 0 0 1px var(--det-line-2); }
.det-tbl-wrap:focus-visible { outline-offset: -3px; }
.det-tbl { width: 100%; min-width: 620px; border-collapse: collapse; font-size: 14px; }
.det-tbl th { padding: 14px 16px; border-bottom: 1px solid var(--det-line); text-align: left; font: 500 12.5px/1 'Inter', system-ui, sans-serif; color: var(--text-faint); white-space: nowrap; }
.det-tbl td { padding: 12px 16px; border-bottom: 1px solid var(--det-line); vertical-align: top; line-height: 1.5; color: var(--text-muted); }
.det-tbl tr:last-child td { border-bottom: 0; }
.det-tbl td:first-child { font: 500 13px/1.5 var(--det-mono); color: var(--text); white-space: nowrap; }
.det-tbl td:nth-child(2), .det-tbl td:nth-child(3) { font: 400 12.5px/1.5 var(--det-mono); color: #cfcfcf; }
.det-tbl td:nth-child(2) { min-width: 160px; overflow-wrap: anywhere; }
.det-tbl td:nth-child(-n+3) code { font: inherit; color: inherit; background: none; padding: 0; }
.det-tbl td:last-child { min-width: 240px; }
.det-tbl td p, .det-tbl td ul { margin: 0; }
.det-tbl td ul { margin-top: 6px; padding-left: 18px; }
.det-req { margin-left: 6px; font: 400 11px/1 'Inter', system-ui, sans-serif; color: var(--text-faint); }
.det-ingen { color: var(--text-faint); }
.det-arver { margin: 12px 0 0 2px; font-size: 14px; color: var(--text-muted); }
.det-arver code { font: 400 12.5px/1 var(--det-mono); color: var(--text); }
.det-kit { margin: 0 0 20px; font-size: 15px; color: var(--text-muted); }
.det-props-del + .det-props-del { margin-top: 32px; }

.det-a11y { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.det-a11y > div { padding: 20px; border-radius: 16px; background: var(--det-cap); box-shadow: var(--det-cap-shadow); }
.det-a11y h3 { margin: 0 0 8px; font: 500 15px/1.3 'Inter', system-ui, sans-serif; color: var(--text); }
.det-a11y p { margin: 0; font-size: 15px; line-height: 1.55; color: var(--text-muted); text-wrap: pretty; }
@container det (max-width: 900px) { .det-a11y { grid-template-columns: 1fr; } }

/* Tom tilstand: siger ærligt, hvad der mangler, og hvor man kan se i stedet. */
.det-tom { padding: 28px 24px; border-radius: 16px; background-image: var(--det-dots); background-size: 16px 16px; box-shadow: inset 0 0 0 1px var(--det-line-2); }
.det-tom p { margin: 8px 0 0; max-width: 60ch; font-size: 15px; line-height: 1.55; color: var(--text-muted); }
.det-tom .det-tom-h { margin: 0; font-weight: 500; color: var(--text); }
.det-tom a { color: var(--text-muted); text-decoration: underline; text-decoration-color: rgba(255, 255, 255, .3); text-underline-offset: 3px; }
.det-tom-scene { display: grid; place-items: center; align-content: center; min-height: 240px; text-align: center; }

.det-detaljer { margin-top: clamp(40px, 5vw, 56px); }

/* --- Pro-fliserne på /lab/ui/pro: hele flisen er et link til detaljesiden --------- */

.pro-flise { position: relative; }
.pro-flise-link { display: block; color: inherit; text-decoration: none; }
.pro-flise-link::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.pro-flise-link:focus-visible { outline: none; }
.pro-flise:has(.pro-flise-link:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.pro-flise-link code { color: var(--text-muted); }

/* --- Smalle flader (indholdets bredde, ikke vinduets) ---------------------------- */

@container det (max-width: 860px) {
    .det-hoved { grid-template-columns: minmax(0, 1fr); gap: 16px; }
    .det-act { align-items: flex-start; }
    .det-note { text-align: left; }
}
@container det (max-width: 720px) {
    .det-act { align-items: stretch; max-width: none; }
    .det-act.is-quiet { display: none; }
    .det-cmd { max-width: none; }
    .det .det-koeb { width: 100%; min-width: 0; }
    .det-faner { min-width: 0; width: 100%; }
    .det .det-faner .det-seg-item { padding: 0 6px; gap: 6px; }
    .det-ctl { width: 100%; gap: 12px; }
    .det-grp > .det-silk { display: none; }
    .det-grp:first-child { flex: 1; }
    .det-sw3 { min-width: 0; flex: 1; }
    .det-win { height: 300px; }
    .det-stage-note { flex-direction: column; gap: 4px; }
    .det-stage-note span:last-child { text-align: left; }
    .det-lock { padding: 22px 16px; }
    .det-slotfacts { flex-direction: column; gap: 6px; }
    .det-slotfacts li { padding: 0; border-left: 0; }
    .det-lc-alt { grid-template-columns: minmax(0, 1fr); padding: 14px 16px; }
    .det-lc-cmds .det-cmd code { white-space: normal; overflow-wrap: anywhere; padding: 5px 0; }
    .det .lab-kode-ramme pre.lab-kode { padding-right: 16px; padding-top: 56px; }
}

/* --- Hover kun med en rigtig mus; tastatur er øjeblikkeligt; mindre bevægelse ------ */

@media (hover: hover) and (pointer: fine) {
    .det .det-seg-item:hover, .det .det-tog:hover, .det .det-rund:hover, .det-sti a:hover { color: var(--text); }
    .det .det-rund:hover, .det .lab-kopier:hover, .det .det-try:hover { background: var(--det-cap-3); }
    .det-lock:has(a.det-koeb:hover) .det-slot i { opacity: 1; }
    .det-farve:hover i { transform: scale(1.12); }
    .pro-flise:has(.pro-flise-link:hover) { border-color: var(--border-strong); }
    .pro-flise:has(.pro-flise-link:hover) code { color: var(--text); }
}
html.det-instant .det * { transition: none !important; }
@media (prefers-reduced-motion: reduce) {
    .det *, .det *::before, .det *::after { transition-duration: 0s !important; }
    .det-win[data-state="loading"] .det-win-load { animation-duration: 0s; }
    .det-win-load i::before { animation: none; transform: none; width: 100%; opacity: .5; }
}

/* Shiki-temaet (vesper) farver kommentarer #8B8B8B med 58 % alfa; det giver for lav kontrast på kodekortet.
   Her får de samme grå uden gennemsigtighed (5,6:1 på #0e0e10). */
.det .shiki span[style*="8B8B8B94" i] { color: #8b8b8b !important; }
