/* The building demo's own pieces, over ../style.css (the bridge demo's look) */

/* the photographed sheets are landscape phone photos, not letter pages */
.scan-page.sheet { aspect-ratio: 4 / 3; height: auto; width: min(78%, 680px); background: #2a2622; }
.scan-page.sheet img { object-fit: contain; }
.sheet-look img { aspect-ratio: auto; width: min(900px, 100%); height: auto; background: #2a2622; cursor: zoom-out; } /* a click closes it */

/* what the build reads on a sheet: each box pops in after its delay, and stays hidden until then */
.scan-page.sheet .scan-boxes span { animation-fill-mode: both; }

/* callouts: what the step found, at the bottom left of the viewer */
.callout { position: absolute; left: 16px; bottom: 16px; z-index: 7; max-width: min(420px, calc(100% - 32px)); padding: 12px 14px; border-radius: 14px;
  background: var(--glass); backdrop-filter: blur(10px); border: 1px solid var(--border); box-shadow: var(--shadow-elevated); animation: pop .35s ease-out; }
.callout-k { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--primary-strong); }
.callout-t { margin-top: 4px; font-size: 13.5px; line-height: 1.45; }
.callout-t b { font-weight: 600; }
.thumbs-row { display: flex; gap: 5px; margin-top: 8px; }
.thumbs-row:empty { display: none; }
.callout-credit { margin-top: 6px; font-size: 10.5px; color: var(--muted-foreground); }
.callout-credit:empty { display: none; }
.thumbs-row img { width: 54px; height: 40px; object-fit: cover; border-radius: 3px; animation: pop .3s ease-out both; }
.caption:not([hidden]) ~ .callout, .callout:has(~ .caption:not([hidden])) { bottom: 64px; }

/* the evidence key, at the bottom left once the model is coloured by what it rests on */
.ev-keys { position: absolute; left: 16px; bottom: 16px; z-index: 6; }

/* the hovered part */
.tip { position: absolute; z-index: 9; pointer-events: none; padding: 6px 10px; border-radius: 8px; font-size: 12px; line-height: 1.35; max-width: 280px;
  background: var(--card); border: 1px solid var(--border); box-shadow: var(--shadow-elevated); transform: translate(12px, 12px); }
.tip span { display: block; font: 11px var(--mono); color: var(--muted-foreground); }

/* the files tree: a photographed sheet's icon */
.file .ico.sheet { background: linear-gradient(160deg, #efe8d6, #d9cfb6); }
.file .ico.sheet::after { content: "JPG"; background: #6b5b3e; }
.file .ico.set::after { content: "JPG"; background: #3b4f5c; }
.file .ico.set { background: linear-gradient(160deg, #6f8a6b, #3b4f5c); }

@media (max-width: 900px) {
  .callout, .ev-keys { left: 10px; bottom: 10px; }
}

/* the evidence key and a callout at once: the callout rises above the key (and above the caption when it shows) */
.callout:has(~ .ev-keys:not([hidden])) { bottom: 60px; }
.callout:has(~ .caption:not([hidden])):has(~ .ev-keys:not([hidden])) { bottom: 108px; }
.ev-keys:has(~ .caption:not([hidden])) { bottom: 64px; }

/* view.html: the finished building in one mode, filling its iframe */
.view .stage { position: fixed; inset: 0; height: auto; min-height: 0; }
.view .loading { left: 50%; top: 50%; right: auto; transform: translate(-50%, -50%); }
.evidence .three { right: 360px; }
.floors { position: absolute; left: 16px; top: 16px; z-index: 6; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; max-width: calc(100% - 32px); }
.evidence .floors { max-width: calc(100% - 392px); }
.floors .seg button { padding: 6px 12px; }
.plan-cap { position: absolute; left: 16px; bottom: 16px; z-index: 6; max-width: min(520px, calc(100% - 32px)); padding: 10px 14px; border-radius: 14px; font-size: 12.5px; line-height: 1.45;
  background: var(--glass); backdrop-filter: blur(10px); border: 1px solid var(--border); box-shadow: var(--shadow-elevated); }
.plan-cap b { font-weight: 600; }
.evidence .ev-keys { bottom: 16px; }

/* the part panel: its name, what it rests on, one line per record */
.side-hint { margin: 0; padding: 14px 18px; border-bottom: 1px solid var(--border); font-size: 12.5px; color: var(--muted-foreground); }
.side-body { padding: 18px 18px 24px; }
.side .rest { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-soft); }
.side .rest i { width: 10px; height: 10px; border-radius: 2px; flex: none; }
.side .why { margin: 14px 0 0; padding: 10px 12px; border-radius: 10px; font-size: 13px; line-height: 1.5;
  background: color-mix(in oklab, #e9a23b 14%, var(--card)); border: 1px solid color-mix(in oklab, #e9a23b 40%, transparent); }
.side .why.note { background: var(--muted); border-color: var(--border); }
.side .srcs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.side .srcs li { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; line-height: 1.4; }
.side .srcs b { font-weight: 600; }
.side .srcs span { display: block; font-size: 12.5px; color: var(--muted-foreground); }
.side .srcs .found { color: var(--primary-strong); }
.side .srcs .src-ico { flex: none; width: 18px; height: 18px; margin-top: 1px; border-radius: 4px; background: var(--muted) center / 12px no-repeat; border: 1px solid var(--border); }
.side .srcs .src-ico.ico-drawing { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%23555' stroke-width='1.2'%3E%3Crect x='1.5' y='1.5' width='9' height='9'/%3E%3Cpath d='M1.5 6h5V1.5M6.5 6v4.5'/%3E%3C/svg%3E"); }
.side .srcs .src-ico.ico-photo { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%23555' stroke-width='1.2'%3E%3Crect x='1' y='2.5' width='10' height='7.5' rx='1'/%3E%3Ccircle cx='6' cy='6.25' r='2'/%3E%3C/svg%3E"); }
.side .srcs .src-ico.ico-data { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%23555' stroke-width='1.2'%3E%3Cpath d='M1 3.5l3.3-1.5 3.4 1.5L11 2v6.5L7.7 10 4.3 8.5 1 10z'/%3E%3Cpath d='M4.3 2v6.5M7.7 3.5V10'/%3E%3C/svg%3E"); }
.side .prec { margin: 18px 0 0; font-size: 13px; color: var(--ink-soft); }

@media (max-width: 720px) {
  .evidence .three { right: 0; bottom: 50%; }
  .evidence .floors { max-width: calc(100% - 32px); }
  .side { top: 50%; left: 0; width: auto; border-left: 0; border-top: 1px solid var(--border); }
  .evidence .ev-keys { bottom: calc(50% + 10px); }
}

/* ?bare: the model alone */
.bare .floors, .bare .ev-keys, .bare .side, .bare .plan-cap, .bare .tip { display: none !important; }
.bare.evidence .three { right: 0; }
