/* Shared prototype UI: dialogs, results, utility. Themed by each design's custom properties:
   --bg --fg --muted --surface --line --accent --accent-fg --ok --bad --radius --font-body --font-head --focus */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }
body { margin: 0; overflow-x: hidden; }
img, svg { max-width: 100%; }
[id] { scroll-margin-top: 88px; }
:focus-visible { outline: 3px solid var(--focus, #1a5fd0); outline-offset: 2px; }
.qs-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.qs-skip { position: absolute; left: 8px; top: -60px; z-index: 100; padding: 10px 14px; background: var(--fg); color: var(--bg); border-radius: 6px; font-weight: 700; }
.qs-skip:focus { top: 8px; }
.qs-ico { width: 1.25em; height: 1.25em; flex: none; vertical-align: -0.25em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.qs-proto { margin: 0; padding: 6px 16px; font: 600 12.5px/1.4 system-ui, "Segoe UI", sans-serif; text-align: center; background: #fff4c2; color: #4a3800; border-bottom: 1px solid #e8d58a; }
.qs-sample { display: inline-block; font: 600 10.5px/1.3 system-ui, "Segoe UI", sans-serif; letter-spacing: .04em; text-transform: uppercase; padding: 2px 6px; border-radius: 4px; background: #fff4c2; color: #4a3800; border: 1px solid #e3cf7c; vertical-align: middle; }

/* dialogs */
.qs-dialog { width: min(520px, calc(100vw - 24px)); max-height: calc(100vh - 32px); overflow: auto; padding: 24px; border: 1px solid var(--line, #ccc); border-radius: var(--radius, 12px); background: var(--surface, #fff); color: var(--fg, #111); font-family: var(--font-body, system-ui); box-shadow: 0 24px 60px rgba(0,0,0,.28); }
.qs-dialog::backdrop { background: rgba(10, 12, 20, .55); }
.qs-dialog h2 { margin: 0 32px 16px 0; font-family: var(--font-head, inherit); font-size: 1.35rem; }
.qs-dialog label { display: block; font-weight: 600; margin: 14px 0 6px; }
.qs-dialog input:not([type=radio]):not([type=checkbox]), .qs-dialog select { width: 100%; min-height: 44px; padding: 8px 12px; font: inherit; color: var(--fg); background: var(--bg, #fff); border: 1.5px solid var(--muted, #666); border-radius: calc(var(--radius, 12px) / 2); }
.qs-dialog fieldset { border: 0; padding: 0; margin: 0; }
.qs-dialog legend { font-weight: 600; margin-bottom: 6px; }
.qs-radios { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 6px; }
.qs-dialog .qs-radio, .qs-dialog .qs-check { display: flex; gap: 8px; align-items: center; font-weight: 500; margin: 0; padding: 8px 10px; border: 1px solid var(--line, #ccc); border-radius: 8px; cursor: pointer; }
.qs-dialog .qs-check { border: 0; padding: 8px 0; align-items: flex-start; }
.qs-radio input, .qs-check input { width: 18px; height: 18px; accent-color: var(--accent); }
.qs-x { position: absolute; right: 10px; top: 10px; }
.qs-x button { width: 40px; height: 40px; border: 0; background: transparent; color: var(--fg); font-size: 26px; line-height: 1; cursor: pointer; border-radius: 50%; }
.qs-x button:hover { background: var(--line, #eee); }
.qs-inline { display: flex; gap: 8px; }
.qs-inline input { flex: 1; min-width: 0; }
.qs-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 8px 16px; font: 700 15px/1.2 var(--font-body, system-ui); color: var(--accent-fg, #fff); background: var(--accent, #1a5fd0); border: 0; border-radius: calc(var(--radius, 12px) / 2); cursor: pointer; text-decoration: none; white-space: nowrap; }
.qs-btn:hover { filter: brightness(1.08); }
.qs-sm { min-height: 40px; padding: 6px 12px; font-size: 14px; }
.qs-wide { width: 100%; margin-top: 16px; }
.qs-link { background: none; border: 0; padding: 4px 0; margin-top: 10px; font: inherit; font-weight: 600; color: inherit; text-decoration: underline; cursor: pointer; }
.qs-note { font-size: 13.5px; color: var(--muted, #555); margin: 10px 0 0; }
.qs-result:not(:empty) { margin-top: 14px; padding: 12px 14px; border-radius: 8px; background: var(--bg, #f6f6f6); border: 1px solid var(--line, #ddd); }
.qs-result p { margin: 0 0 8px; }
.qs-ok { color: var(--ok, #136c2e); font-weight: 600; }
.qs-bad { color: var(--bad, #a3261b); font-weight: 600; }
.qs-warn { color: var(--bad, #a3261b); }
.qs-callback label:first-of-type { margin-top: 8px; }
.qs-callback .qs-btn { margin-top: 8px; }
.qs-status { margin: 8px 0 0; font-weight: 600; }

/* result lists */
[data-results] { margin-top: 10px; text-align: left; }
[data-results]:empty { display: none; }
.qs-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.qs-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--line, #ddd); border-radius: calc(var(--radius, 12px) / 1.5); background: var(--surface, #fff); color: var(--fg); }
.qs-item span { min-width: 0; flex: 1; }
.qs-thumb { width: 64px; height: 64px; flex: none; object-fit: cover; border-radius: 10px; background: var(--line, #ddd); }
/* Shared photo utility: real photos fill their frame */
.ph { display: block; width: 100%; height: 100%; object-fit: cover; }
.qs-item strong { display: block; }
.qs-item small { display: block; color: var(--muted); margin-top: 2px; }
.qs-off { opacity: .92; border-style: dashed; }
.qs-empty { margin: 0; padding: 12px 14px; border-radius: 8px; background: var(--surface, #fff); color: var(--fg); border: 1px dashed var(--line, #ccc); }
.qs-empty .qs-link { margin: 0; }
@media (max-width: 480px) { .qs-item { flex-direction: column; align-items: stretch; } .qs-inline { flex-direction: column; } }
