/* ⌘K-søgningen på lab-siderne (server/lab-galleri.mjs: soegMarkup) og de fælles byggeklodser til galleriet:
   farver, tastetegn og mærker. Galleriet (lab-galleri.css) bygger på denne fil. Kun opacity, transform og filter
   bevæger sig; med reduceret bevægelse står alt i sin sluttilstand. */

.g-side, .s-felt, .s-knap, .s-pal {
  --well: #141416; --pit: #0b0b0c; --cap: #1b1b1e; --cap-2: #222226; --cap-3: #2a2a2f;
  --line: rgba(255, 255, 255, .07); --line-2: rgba(255, 255, 255, .14);
  --muted: #a8a8a8; --faint: #898989; --green: #00b67a;
  --inv: #ecebe7; --inv-text: #141416; --inv-muted: #56565b;
  --k-ease: cubic-bezier(0.23, 1, 0.32, 1);
  --serif: "Lora", Georgia, serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --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);
  --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);
  --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);
  --well-shadow: inset 0 1px 2px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(255, 255, 255, .05);
  --dots: radial-gradient(rgba(255, 255, 255, .075) 1px, transparent 1.3px);
}

/* --- Tastetegn og mærker ----------------------------------------------------- */
.s-kbd {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 5px;
  background: var(--cap-2, #222226); color: var(--muted, #a8a8a8); font: 500 11px/1 var(--mono, monospace);
  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);
}
.s-kbd.lg { min-width: 26px; height: 26px; border-radius: 7px; font-size: 12px; }
.s-keys { display: inline-flex; align-items: center; gap: 3px; }
/* Enkelte taster kan slås fra (WCAG 2.1.4): så forsvinder deres tegn også. */
html.lab-uden-genveje .s-ks { display: none !important; }
@media (hover: none), (max-width: 720px) { .s-desk { display: none !important; } }

.s-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;
}
.s-badge.b-pro { background: var(--inv); color: var(--inv-text); box-shadow: inset 0 1px 0 #fff, inset 0 -1.5px 0 rgba(0, 0, 0, .2); }
.s-badge.b-free { color: var(--muted); box-shadow: inset 0 0 0 1px var(--line-2); }
.s-badge.b-new { background: var(--cap-2); color: var(--text, #f4f4f4); }
.s-badge.b-new::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.s-badge.b-cat { padding: 0 7px; background: rgba(255, 255, 255, .05); color: var(--muted); font: 11.5px/1 var(--mono); }

/* --- Udløserne ----------------------------------------------------------------- */
@media (scripting: none) { .s-felt, .s-knap { display: none !important; } }

.s-felt {
  display: flex; align-items: center; gap: 16px; height: 72px; padding: 0 14px 0 24px; border-radius: 16px;
  background: var(--pit); color: var(--muted); cursor: text;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, .6), inset 0 0 0 1px rgba(255, 255, 255, .06);
  transition: opacity .15s var(--k-ease);
}
.s-felt svg { flex: none; }
.s-felt input {
  flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; outline: 0; background: none; color: var(--text, #f4f4f4);
  font: inherit; font-size: 21px; letter-spacing: -.012em; text-overflow: ellipsis; cursor: text;
}
.s-felt input::placeholder { color: #858589; opacity: 1; }
.s-felt input::-webkit-search-cancel-button { display: none; }
.s-felt:has(input:focus-visible) { box-shadow: inset 0 2px 8px rgba(0, 0, 0, .6), inset 0 0 0 1px rgba(255, 255, 255, .06), 0 0 0 2px var(--accent, #4d8dff); }
.s-felt-keys { display: flex; align-items: center; gap: 10px; flex: none; font-size: 13px; color: var(--faint); }
.s-felt.lifted { opacity: 0; transition: none; }
@media (max-width: 720px) {
  .s-felt { height: 60px; gap: 12px; padding: 0 12px 0 18px; }
  .s-felt input { font-size: 17px; }
  .s-felt-keys { display: none; }
}

.s-knap {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 10px 0 14px; border: 0; border-radius: 10px;
  background: var(--cap-2); color: var(--text, #f4f4f4); font: 500 14px/1 Inter, system-ui, sans-serif; cursor: pointer;
  box-shadow: var(--cap-shadow-up); transition: transform 90ms var(--k-ease);
}
.s-knap svg { width: 18px; height: 18px; color: var(--muted); }
.s-knap:active { transform: translateY(1px); box-shadow: var(--cap-shadow-down); }
.s-knap:focus-visible { outline: 2px solid var(--accent, #4d8dff); outline-offset: 3px; }

/* --- Dialogen -------------------------------------------------------------------- */
.s-pal {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0;
  border: 0; background: transparent; color: var(--text, #f4f4f4); overflow: hidden;
  font: 400 15px/1.5 Inter, system-ui, sans-serif;
}
.s-pal:not([open]) { display: none; }
.s-pal::backdrop { background: transparent; }
.s-pal [hidden] { display: none !important; }
html:has(dialog.s-pal[open]) { overflow: hidden; }
.s-scrim { position: absolute; inset: 0; background: rgba(6, 6, 7, .8); }
.s-box {
  position: absolute; left: 0; right: 0; top: min(12vh, 120px); width: min(920px, calc(100vw - 96px)); margin-inline: auto;
  display: flex; flex-direction: column; transform-origin: 0 0;
}
.s-input {
  position: relative; z-index: 1; display: flex; align-items: center; gap: 14px; height: 68px; padding: 0 12px 0 22px;
  border-radius: 20px 20px 0 0; background: #171719; color: var(--muted); transform-origin: 0 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 0 0 1px var(--line-2);
}
.s-input svg { flex: none; }
.s-input input {
  flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; outline: 0; background: none; color: var(--text, #f4f4f4);
  font: inherit; font-size: 19px; letter-spacing: -.01em;
}
.s-input input::placeholder { color: #858589; opacity: 1; }
.s-input:has(input:focus-visible) { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 0 0 1px var(--line-2), inset 0 -2px 0 var(--accent, #4d8dff); }
.s-x { flex: none; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 10px; background: none; color: inherit; cursor: pointer; }
.s-x:focus-visible { outline: 2px solid var(--accent, #4d8dff); outline-offset: -2px; }
.s-sheet { border-radius: 0 0 20px 20px; background: #141416; box-shadow: 0 0 0 1px var(--line-2), 0 24px 64px rgba(0, 0, 0, .45); overflow: hidden; }
.s-body { display: grid; grid-template-columns: minmax(0, 1fr) 340px; height: min(460px, 62vh); border-top: 1px solid var(--line); }
.s-body.none, .s-body.laster { grid-template-columns: minmax(0, 1fr); }
.s-liste { min-height: 0; padding: 8px; overflow-y: auto; overscroll-behavior: contain; }
.s-pg + .s-pg { margin-top: 4px; }
.s-pg-h { display: flex; justify-content: space-between; gap: 12px; padding: 12px 12px 8px; font-size: 13px; color: var(--faint); font-variant-numeric: tabular-nums; }
.s-pg-h b { color: var(--muted); font-weight: 500; }
.s-opt {
  position: relative; display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 14px;
  min-height: 52px; padding: 6px 10px 6px 12px; border-radius: 12px; scroll-margin: 8px; cursor: pointer;
}
.s-opt[aria-selected="true"] { background: var(--cap-2); box-shadow: var(--cap-shadow-up); }
.s-opt[aria-selected="true"]::before { content: ""; position: absolute; left: 3px; top: 12px; bottom: 12px; width: 2px; border-radius: 2px; background: var(--accent, #4d8dff); }
.s-thumb { display: grid; place-items: center; width: 48px; height: 30px; border-radius: 6px; overflow: hidden; background: var(--well); }
.s-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.s-thumb.fb { background: #121214 var(--dots); background-size: 6px 6px; color: var(--faint); font: 500 11px/1 var(--mono); }
.s-opt-txt { display: grid; gap: 2px; min-width: 0; }
.s-opt-title, .s-opt-slug { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.s-opt-title { font-size: 15px; line-height: 1.3; color: var(--text, #f4f4f4); }
.s-opt-slug { font: 12px/1.3 var(--mono); color: var(--faint); }
.s-opt mark { background: none; color: inherit; text-decoration: underline; text-decoration-color: rgba(255, 255, 255, .35); text-underline-offset: 3px; }
.s-opt-b { display: flex; gap: 6px; }
@media (forced-colors: active) { .s-opt[aria-selected="true"] { outline: 2px solid CanvasText; } }

.s-prev { display: flex; flex-direction: column; gap: 14px; min-height: 0; padding: 16px; border-left: 1px solid var(--line); overflow-y: auto; }
.s-pv { display: flex; flex-direction: column; gap: 14px; }
.s-pv-poster { position: relative; aspect-ratio: 16 / 10; border-radius: 12px; overflow: hidden; background: var(--well); }
.s-pv-poster img { display: block; width: 100%; height: 100%; object-fit: cover; }
.s-pv-poster::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1); }
.s-pv-poster.fb { display: grid; place-items: center; padding: 12px; background: #121214 var(--dots); background-size: 12px 12px; color: #dcdcdc; font: 500 22px/1.05 var(--mono); letter-spacing: -.03em; text-align: center; overflow-wrap: anywhere; }
.s-pv-title { margin: 0; font: 400 24px/1.1 var(--serif); letter-spacing: -.01em; color: var(--text, #f4f4f4); }
.s-pv-desc { margin: 8px 0 0; font-size: 14px; line-height: 1.5; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.s-pv-b { display: flex; flex-wrap: wrap; gap: 6px; }
.s-pv-cmd { margin-top: auto; display: flex; align-items: flex-start; gap: 8px; padding: 10px 8px 10px 12px; border-radius: 10px; background: var(--pit); box-shadow: var(--well-shadow); }
.s-pv-cmd code { flex: 1; min-width: 0; padding-top: 12px; font: 11.5px/1.5 var(--mono); color: var(--muted); overflow-wrap: anywhere; background: none; }
.s-pv-cmd .p { color: var(--faint); }
.s-pv-cmd .lab-kopier { flex: none; min-height: 44px; }

.s-foot { display: flex; align-items: center; gap: 20px; height: 48px; padding: 0 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--faint); }
.s-foot > span { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.s-foot .r { margin-left: auto; font-variant-numeric: tabular-nums; }
.s-body.none + .s-foot > span:nth-child(-n+3) { opacity: .38; }

.s-ingen, .s-tilstand { display: grid; place-content: center; justify-items: center; gap: 10px; padding: 48px 24px; text-align: center; }
.s-ingen-h { margin: 0; font: 400 24px/1.15 var(--serif); color: var(--text, #f4f4f4); }
.s-ingen-h q { quotes: "»" "«"; }
.s-ingen-h q:lang(en) { quotes: "\201C" "\201D"; }
.s-ingen-t { max-width: 46ch; margin: 0; font-size: 15px; color: var(--muted); }
.s-forslag { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 6px; }
.s-tilstand { color: var(--muted); }
.s-tilstand-t { margin: 0; }

.s-chip, .s-btn {
  display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 0 14px; border: 0; border-radius: 9px;
  background: var(--cap); color: var(--muted); box-shadow: var(--cap-shadow); cursor: pointer;
  font: 500 12.5px/1 var(--mono); transition: transform 90ms var(--k-ease);
}
.s-btn { border-radius: 10px; font: 500 14.5px/1 Inter, system-ui, sans-serif; color: var(--text, #f4f4f4); background: var(--cap-2); box-shadow: var(--cap-shadow-up); }
.s-chip .n { color: var(--faint); }
.s-chip:active, .s-btn:active { transform: translateY(1px); box-shadow: var(--cap-shadow-down); }
.s-chip:focus-visible, .s-btn:focus-visible { outline: 2px solid var(--accent, #4d8dff); outline-offset: 2px; }

.s-toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 2; display: flex; align-items: center; gap: 10px; max-width: calc(100vw - 32px);
  padding: 10px 14px; border-radius: 12px; background: #1d1d20; box-shadow: var(--cap-shadow-up); color: var(--text, #f4f4f4); font-size: 14px;
  opacity: 0; transform: translate(-50%, 10px); pointer-events: none; transition: opacity .2s var(--k-ease), transform .2s var(--k-ease);
}
.s-toast:empty { display: none; }
.s-toast.show { opacity: 1; transform: translate(-50%, 0); }
.s-toast svg { flex: none; color: var(--green); }
.s-toast code { font: 12.5px var(--mono); background: none; }

@media (hover: hover) and (pointer: fine) {
  .s-x:hover { background: rgba(255, 255, 255, .05); }
  .s-chip:hover { color: var(--text, #f4f4f4); }
  .s-knap:hover { background: var(--cap-3); }
}
@media (max-width: 820px) { .s-body { grid-template-columns: minmax(0, 1fr) 240px; } }
@media (max-width: 640px) { .s-body { grid-template-columns: minmax(0, 1fr); } .s-prev { display: none !important; } }
@media (max-width: 720px) {
  .s-box { top: 0; width: 100%; height: 100%; height: 100dvh; }
  .s-input { height: 64px; border-radius: 0; }
  .s-input input { font-size: 17px; }
  .s-sheet { flex: 1; display: flex; flex-direction: column; min-height: 0; border-radius: 0; }
  .s-body { flex: 1; height: auto; min-height: 0; }
  .s-foot { display: none; }
  .s-opt { min-height: 56px; }
}
@media (prefers-reduced-motion: reduce) {
  .s-felt, .s-knap, .s-chip, .s-btn, .s-toast { transition-duration: 0s !important; }
  .s-toast { transform: translate(-50%, 0); }
}
