/* Scanner-testlab (Watermonsters > Scantests): tegels, filters, fotokaarten en detailvenster. */

.stl {
    --stl-surface: #ffffff; --stl-surface-2: #f8fafc; --stl-line: #e2e8f0; --stl-text: #0f172a; --stl-muted: #64748b;
    --stl-ok: #16a34a; --stl-bad: #dc2626; --stl-warn: #d97706; --stl-device: #0ea5e9; --stl-ai: #8b5cf6; --stl-accent: #3b82f6;
    --stl-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .06);
    display: flex; flex-direction: column; gap: 14px; color: var(--stl-text);
}
[data-theme="dark"] .stl, [data-theme="dark"] .stl-modal {
    --stl-surface: #111827; --stl-surface-2: #0b1220; --stl-line: #1f2937; --stl-text: #e5e7eb; --stl-muted: #94a3b8;
    --stl-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
}
.stl-modal {
    --stl-surface: #ffffff; --stl-surface-2: #f8fafc; --stl-line: #e2e8f0; --stl-text: #0f172a; --stl-muted: #64748b;
    --stl-ok: #16a34a; --stl-bad: #dc2626; --stl-warn: #d97706; --stl-device: #0ea5e9; --stl-ai: #8b5cf6; --stl-accent: #3b82f6;
}
.stl svg.stl-ic, .stl-modal svg.stl-ic { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }

/* Kop */
.stl-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.stl-title { display: flex; align-items: center; gap: 12px; }
.stl-title h2 { margin: 0; font-size: 1.25rem; letter-spacing: -.01em; }
.stl-title small { color: var(--stl-muted); font-size: .8rem; }
.stl-livedot { width: 10px; height: 10px; border-radius: 50%; background: var(--stl-ok); animation: stl-live 2s ease-out infinite; }
.stl-livedot.is-stale { background: var(--stl-muted); animation: none; }
.stl-iconbtn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 36px; height: 36px; padding: 0 12px; border-radius: 10px;
               border: 1px solid var(--stl-line); background: var(--stl-surface); color: var(--stl-text); cursor: pointer; font: inherit; font-size: .9rem;
               box-shadow: var(--stl-shadow); transition: transform .15s, border-color .15s; }
.stl-iconbtn:hover:not(:disabled) { transform: translateY(-1px); border-color: var(--stl-accent); }
.stl-iconbtn:disabled { opacity: .4; cursor: default; }
.stl-iconbtn.is-spinning svg { animation: stl-spin .8s linear infinite; }

/* Uitleg */
.stl-howto { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stl-step { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: var(--stl-surface-2); border: 1px dashed var(--stl-line); font-size: .85rem; }
.stl-step b.stl-num { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--stl-accent); color: #fff; font-size: .8rem; flex: 0 0 auto; }
.stl-step span { color: var(--stl-muted); }
.stl-step strong { display: block; color: var(--stl-text); margin-bottom: 2px; }

/* Tegels */
.stl-tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.stl-tile { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--stl-surface);
            border: 1px solid var(--stl-line); box-shadow: var(--stl-shadow); text-align: left; font: inherit; color: inherit; overflow: hidden;
            cursor: pointer; transition: transform .15s, box-shadow .15s, background .2s; }
.stl-tile[tabindex="-1"] { cursor: default; }
.stl-tile::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--c); opacity: .9; }
.stl-tile:hover { transform: translateY(-2px); }
.stl-tile.is-active { background: color-mix(in srgb, var(--c) 10%, var(--stl-surface)); box-shadow: 0 0 0 2px var(--c), var(--stl-shadow); }
.stl-tile-ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); flex: 0 0 auto; }
.stl-tile-ic svg.stl-ic { width: 18px; height: 18px; }
.stl-tile strong { display: block; font-size: 1.5rem; line-height: 1; font-variant-numeric: tabular-nums; }
.stl-tile-label { display: block; font-size: .75rem; color: var(--stl-muted); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Filters */
.stl-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 12px; border-radius: 14px; background: var(--stl-surface); border: 1px solid var(--stl-line); box-shadow: var(--stl-shadow); }
.stl-filters label { display: flex; flex-direction: column; gap: 2px; font-size: .72rem; color: var(--stl-muted); }
.stl-filters select { height: 34px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--stl-line); background: var(--stl-surface-2); color: var(--stl-text); font: inherit; font-size: .85rem; min-width: 150px; }

/* Raster met kaarten */
.stl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.stl-card { display: flex; flex-direction: column; padding: 0; border-radius: 16px; overflow: hidden; text-align: left; font: inherit; color: inherit; cursor: pointer;
            background: var(--stl-surface); border: 1px solid var(--stl-line); box-shadow: var(--stl-shadow); transition: transform .18s, box-shadow .18s, border-color .18s; }
.stl-card:hover, .stl-card:focus-visible { transform: translateY(-3px); border-color: var(--stl-accent); box-shadow: 0 12px 30px rgba(15, 23, 42, .14); outline: none; }
.stl-card.is-wrong { border-color: color-mix(in srgb, var(--stl-bad) 55%, var(--stl-line)); }
.stl-card.is-new { animation: stl-new 1.4s ease-out; }
.stl-thumb { position: relative; aspect-ratio: 4 / 3; background: #0b1220; overflow: hidden; }
.stl-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.stl-card:hover .stl-thumb img { transform: scale(1.04); }
.stl-thumb-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; width: 100%; height: 100%; min-height: 160px; color: #94a3b8; font-size: .8rem; }
.stl-thumb-empty svg.stl-ic { width: 28px; height: 28px; }
.stl-thumb-top { position: absolute; top: 8px; left: 8px; right: 8px; display: flex; justify-content: space-between; gap: 6px; }
.stl-card-body { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px 12px; }
.stl-card-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 1.05rem; font-weight: 700; letter-spacing: .02em; }
.stl-card-code.is-miss { color: var(--stl-muted); font-family: inherit; font-weight: 600; }
.stl-card-sub { font-size: .8rem; color: var(--stl-muted); min-height: 1.1em; }
.stl-card-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.stl-card-chips span { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; background: var(--stl-surface-2); border: 1px solid var(--stl-line); font-size: .74rem; font-variant-numeric: tabular-nums; }
.stl-card-chips span.is-off { color: var(--stl-warn); border-color: color-mix(in srgb, var(--stl-warn) 45%, var(--stl-line)); }
.stl-card-foot { display: flex; justify-content: space-between; gap: 8px; font-size: .76rem; color: var(--stl-muted); border-top: 1px solid var(--stl-line); padding-top: 8px; margin-top: 2px; }

.stl-badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: .72rem; font-weight: 600; line-height: 1.3;
             backdrop-filter: blur(6px); background: rgba(15, 23, 42, .72); color: #fff; white-space: nowrap; }
.stl-badge.is-device { background: color-mix(in srgb, var(--stl-device) 88%, #000); }
.stl-badge.is-ai { background: color-mix(in srgb, var(--stl-ai) 88%, #000); }
.stl-badge.is-ok { background: var(--stl-ok); }
.stl-badge.is-bad { background: var(--stl-bad); }
.stl-badge.is-open { background: rgba(15, 23, 42, .6); }
.stl-badge.is-warn { background: var(--stl-warn); }
.stl-warn { color: var(--stl-warn); font-weight: 600; }
.stl-muted { color: var(--stl-muted); }

.stl-empty { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 48px 20px; text-align: center; color: var(--stl-muted);
             border: 1px dashed var(--stl-line); border-radius: 16px; background: var(--stl-surface); }
.stl-empty svg.stl-ic { width: 34px; height: 34px; color: var(--stl-accent); }
.stl-empty strong { color: var(--stl-text); font-size: 1.05rem; }
.stl-empty span { max-width: 520px; }

/* Detailvenster */
.stl-modal { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 18px; background: rgba(2, 6, 23, .66);
             backdrop-filter: blur(3px); animation: stl-fade .18s ease-out; }
.stl-dialog { display: flex; flex-direction: column; width: min(1180px, 100%); max-height: calc(100vh - 36px); background: var(--stl-surface); color: var(--stl-text);
              border: 1px solid var(--stl-line); border-radius: 18px; box-shadow: 0 24px 60px rgba(0, 0, 0, .4); overflow: hidden; animation: stl-pop .22s ease-out; }
.stl-dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--stl-line); }
.stl-dialog-head small { display: block; color: var(--stl-muted); font-size: .8rem; }
.stl-dialog-nav { display: flex; align-items: center; gap: 8px; }
.stl-dialog-body { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, 1fr); min-height: 0; flex: 1; }
.stl-photo { background: #000; display: flex; align-items: center; justify-content: center; min-height: 300px; }
.stl-photo a { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; cursor: zoom-in; }
.stl-photo img { max-width: 100%; max-height: calc(100vh - 110px); object-fit: contain; }
.stl-detail { overflow: auto; padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 14px; }
.stl-detail section h4 { display: flex; align-items: center; gap: 6px; margin: 0 0 6px; font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: var(--stl-muted); }
.stl-detail dl { display: grid; grid-template-columns: max-content 1fr; gap: 5px 14px; margin: 0; font-size: .88rem; }
.stl-detail dt { color: var(--stl-muted); }
.stl-detail dd { margin: 0; overflow-wrap: anywhere; }
.stl-detail dd a { display: inline-flex; align-items: center; gap: 4px; color: var(--stl-accent); }
.stl-detail code { padding: 1px 6px; border-radius: 6px; background: var(--stl-surface-2); border: 1px solid var(--stl-line); font-size: .85em; }
.stl-result { padding: 14px; border-radius: 14px; border: 1px solid var(--stl-line); background: var(--stl-surface-2); }
.stl-result.is-hit { border-color: color-mix(in srgb, var(--stl-ok) 45%, var(--stl-line)); background: color-mix(in srgb, var(--stl-ok) 7%, var(--stl-surface)); }
.stl-result.is-miss { border-color: color-mix(in srgb, var(--stl-warn) 45%, var(--stl-line)); background: color-mix(in srgb, var(--stl-warn) 7%, var(--stl-surface)); }
.stl-result > span { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--stl-muted); }
.stl-result strong { display: block; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 1.6rem; letter-spacing: .02em; margin: 2px 0; }
.stl-result small { color: var(--stl-muted); }
.stl-result p { margin: 8px 0 0; font-size: .86rem; }
.stl-result-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.stl-review textarea { width: 100%; box-sizing: border-box; margin-top: 8px; padding: 9px 11px; border-radius: 10px; border: 1px solid var(--stl-line); background: var(--stl-surface-2);
                       color: var(--stl-text); font: inherit; font-size: .88rem; resize: vertical; }
.stl-verdict { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stl-vbtn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; border-radius: 11px; font: inherit; font-weight: 600; cursor: pointer;
            border: 1.5px solid var(--stl-line); background: var(--stl-surface); color: var(--stl-text); transition: transform .12s, background .15s, border-color .15s; }
.stl-vbtn:hover { transform: translateY(-1px); }
.stl-vbtn.is-ok:hover, .stl-vbtn.is-ok.is-on { border-color: var(--stl-ok); }
.stl-vbtn.is-bad:hover, .stl-vbtn.is-bad.is-on { border-color: var(--stl-bad); }
.stl-vbtn.is-ok.is-on { background: var(--stl-ok); color: #fff; }
.stl-vbtn.is-bad.is-on { background: var(--stl-bad); color: #fff; }
.stl-review-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.stl-savebtn { height: 36px; padding: 0 16px; border-radius: 10px; border: none; background: var(--stl-accent); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.stl-linkbtn { background: none; border: none; padding: 0; font: inherit; font-size: .85rem; cursor: pointer; color: var(--stl-muted); text-decoration: underline; }
.stl-linkbtn.is-danger:hover { color: var(--stl-bad); }

@keyframes stl-live { 0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, .55); } 70% { box-shadow: 0 0 0 9px rgba(22, 163, 74, 0); } 100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); } }
@keyframes stl-spin { to { transform: rotate(360deg); } }
@keyframes stl-new { 0% { box-shadow: 0 0 0 0 rgba(59, 130, 246, .7); transform: translateY(-6px) scale(1.02); } 100% { box-shadow: var(--stl-shadow); transform: none; } }
@keyframes stl-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes stl-pop { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }

@media (max-width: 1100px) {
    .stl-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .stl-dialog-body { grid-template-columns: 1fr; overflow: auto; }
    .stl-photo img { max-height: 55vh; }
    .stl-detail { overflow: visible; }
}
@media (max-width: 700px) {
    .stl-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stl-howto { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    .stl *, .stl-modal * { animation: none !important; transition: none !important; }
}
