/* A photo becomes an entry (viz-scan.js) */
#viz-scan { position: relative; container-type: inline-size; display: flex; flex-direction: column; gap: 20px; margin: 0; padding: 24px 24px 20px; }
#viz-scan svg { width: 100%; height: auto; fill: none; stroke: none; }
.vs-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.vs-tag { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.vs-tag::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }
.vs-tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.vs-tab { min-height: 40px; padding: 8px 14px; border: 1px solid transparent; border-radius: 999px; background: none; color: var(--muted); font-size: 13px; line-height: 1.3; transition: color .2s ease-out, background-color .2s ease-out, border-color .2s ease-out; }
.vs-tab:hover { color: var(--ink); }
.vs-tab[aria-pressed="true"] { color: var(--ink); background: var(--sheet); border-color: var(--line); }

.vs-stage { display: contents; }
.vs-top { order: 0; } .vs-photo { order: 1; } .vs-bar { order: 2; } .vs-card { order: 3; } .vs-cap { order: 4; }
.vs-photo .vs-tilt { max-width: 270px; margin-inline: auto; }
@container (min-width: 500px) {
  .vs-stage { order: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: center; }
  .vs-bar { order: 3; }
  .vs-photo .vs-tilt { max-width: none; }
}

.vs-photo { justify-self: center; width: 100%; padding: 22px 20px; border-radius: 14px; background: var(--navy); cursor: pointer; overflow: hidden; }
.vs-tilt { position: relative; transition: transform .5s ease-out; box-shadow: 0 2px 3px color-mix(in srgb, var(--ink) 40%, transparent), 0 18px 30px -14px color-mix(in srgb, var(--ink) 70%, transparent); border-radius: 3px; }
.vs-doc { display: block; border-radius: 3px; }
.vs-scan { position: absolute; left: -6%; right: -6%; top: -28px; height: 28px; border-bottom: 2px solid var(--gold); background: linear-gradient(to bottom, transparent, color-mix(in srgb, var(--gold) 22%, transparent)); opacity: 0; pointer-events: none; }

.vs-paper { fill: var(--bg); }
.vs-doc text { fill: var(--ink); font: 500 12.5px var(--sans); }
.vs-doc .vs-s { font-size: 12px; fill: var(--muted); }
.vs-doc .vs-b, .vs-doc .vs-b text { font-weight: 600; }
.vs-doc .vs-h { font: 600 23px var(--serif); letter-spacing: .04em; }
.vs-doc .vs-red { fill: var(--garnet); }
.vs-doc .vs-big { font: 600 19px var(--serif); }
.vs-doc .vs-hand { font: italic 600 17px var(--serif); fill: var(--sapphire); }
.vs-doc .vs-wt { font: 600 15px var(--sans); letter-spacing: .1em; }
.vs-doc .vs-lcd { fill: var(--ink); }
.vs-doc .vs-lcdt { font: 500 42px var(--sans); letter-spacing: .06em; fill: var(--gold-soft); }
.vs-doc .vs-lcds { font-size: 12px; letter-spacing: .1em; fill: var(--gold-soft); }
.vs-rule { stroke: var(--ink); stroke-opacity: .28; stroke-width: .8; }
.vs-dash { stroke-dasharray: 3 3; }
.vs-pad { stroke: var(--find); stroke-opacity: .22; stroke-width: .8; }
.vs-sig { stroke: var(--sapphire); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.vs-smudge { fill: var(--muted); opacity: .38; filter: url(#vs-blur); }
.vs-box { fill: var(--gold); fill-opacity: 0; stroke: var(--gold); stroke-width: 1.4; opacity: 0; transition: opacity .3s ease-out, fill-opacity .3s ease-out; }
.vs-box.on { opacity: 1; fill-opacity: .07; }
.vs-box.ask { fill: var(--hold); fill-opacity: .16; stroke: var(--hold); stroke-dasharray: 4 3; }

.vs-card { min-width: 0; padding: 16px 18px 6px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); box-shadow: 0 1px 2px color-mix(in srgb, var(--ink) 6%, transparent), 0 16px 32px -24px color-mix(in srgb, var(--ink) 35%, transparent); transition: border-color .4s ease-out; }
.vs-card-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.vs-card-t { font: 500 22px/1.2 var(--serif); color: var(--ink); }
.vs-state { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--quiet); }
#viz-scan .vs-state svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.vs-rows { margin: 0; padding: 0; list-style: none; }
.vs-rows li { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; min-height: 42px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; line-height: 1.4; }
.vs-rows li:last-child { border-bottom: 0; }
.vs-l { color: var(--quiet); }
.vs-v { justify-self: end; text-align: right; color: var(--ink); font-weight: 500; opacity: 0; transition: opacity .25s ease-out; }
.vs-v small { display: block; font-size: 12px; font-weight: 400; color: var(--quiet); }
.vs-rows li[data-f="total"] .vs-v, .vs-rows li[data-f="net"] .vs-v { font: 600 19px/1.2 var(--serif); }
.vs-ph { position: absolute; right: 0; top: 50%; width: 64px; height: 6px; margin-top: -3px; border-radius: 3px; background: var(--sheet); pointer-events: none; transition: opacity .2s ease-out; }
.vs-rows li.got .vs-v { opacity: 1; }
.vs-rows li.got .vs-ph { opacity: 0; }
.vs-rows li.ask .vs-l { color: var(--hold); }
.vs-askb { position: relative; min-height: 40px; margin: -4px 0; padding: 6px 12px; border: 1px dashed var(--hold) !important; border-radius: 8px; background: color-mix(in srgb, var(--hold) 9%, transparent); color: var(--hold); }
.vs-askb::after, .vs-go::after { content: ''; position: absolute; inset: -1px; border: 1px solid var(--gold); border-radius: inherit; opacity: 0; pointer-events: none; }
.vs-askb::after { border-color: var(--hold); }
.vs-askb[aria-expanded="false"]::after { animation: vs-pulse 2.2s ease-out infinite; }
.vs-rows li.fixed .vs-v { color: var(--ok); }
.vs-pick { grid-column: 1 / -1; padding: 6px 0 4px; }
.vs-pick p { font-size: 13px; line-height: 1.45; color: var(--muted); }
.vs-pick .vs-why { font-size: 12px; color: var(--quiet); }
.vs-opts { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.vs-opt { min-height: 40px; padding: 8px 14px; border: 1px solid var(--hold) !important; border-radius: 8px; background: var(--work); color: var(--ink); font-size: 13px; transition: background-color .2s ease-out; }
.vs-opt:hover { background: color-mix(in srgb, var(--hold) 10%, var(--work)); }
.vs-card.saved { border-color: var(--ok); }
.vs-card.saved .vs-state { color: var(--ok); }

.vs-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; }
.vs-hint { font-size: 14px; color: var(--muted); }
#viz-scan[data-state="check"] .vs-hint { color: var(--hold); }
#viz-scan[data-state="saved"] .vs-hint { color: var(--ok); font-weight: 500; }
.vs-go { position: relative; min-width: 136px; min-height: 46px; padding: 11px 24px; border-radius: 999px; background: var(--ink); color: var(--bg); font-size: 14px; font-weight: 500; transition: opacity .2s ease-out, background-color .2s ease-out; }
.vs-go[aria-disabled="true"] { opacity: .4; cursor: default; }
#viz-scan[data-state="idle"] .vs-go::after { animation: vs-pulse 2.2s ease-out infinite; }
#viz-scan[data-state="saved"] .vs-go { background: none; color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.vs-cap { font-size: 12px; line-height: 1.5; color: var(--quiet); }

.vs-chip { position: absolute; z-index: 3; padding: 3px 8px; margin-top: -4px; border: 1px solid var(--gold); border-radius: 6px; background: var(--work); color: var(--ink); font-size: 13px; font-weight: 500; line-height: 1.4; white-space: nowrap; pointer-events: none; box-shadow: 0 8px 18px -10px color-mix(in srgb, var(--ink) 45%, transparent); }

@keyframes vs-pulse { 0% { opacity: .8; transform: scale(1); } 70%, 100% { opacity: 0; transform: scale(1.12, 1.4); } }
@media (max-width: 600px) { #viz-scan { padding: 18px 16px 16px; gap: 16px; } .vs-photo { padding: 18px 16px; } .vs-tabs { gap: 0; } .vs-tab { padding: 8px 10px; } }
@media (prefers-reduced-motion: reduce) { #viz-scan *, #viz-scan *::after { animation: none !important; transition: none !important; } }
