/* Overlays: the palette, the open item, the About dialog, the copy slip's resting look. No blur, no glass. */
.palette { position: fixed; inset: 0; z-index: 100; display: grid; place-items: start center; padding-top: min(12vh, 110px); }
.pal-scrim { position: absolute; inset: 0; background: var(--scrim); }
.pal-box { position: relative; width: min(640px, calc(100vw - 24px)); max-height: min(640px, 76vh); display: flex; flex-direction: column; background: var(--s2); border: 1px solid var(--line-2); border-radius: var(--r-card); box-shadow: var(--float); overflow: hidden; }
.pal-top { display: flex; align-items: center; gap: 10px; padding: 8px 20px; min-height: 60px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.pal-top > .ic { color: var(--t3); width: 18px; height: 18px; }
.pal-chips { display: contents; }
.pchip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 4px 0 12px; border-radius: var(--r-pill); font-size: var(--fs-13); font-weight: 500; background: var(--s3); max-width: 220px; }
.pchip .pk { font: 400 var(--fs-12)/1 var(--sans); color: var(--t3); }
.pchip button { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; color: var(--t3); }
.pchip button:hover { background: var(--line-2); color: var(--t1); }
.pchip .ic { width: 10px; height: 10px; }
#palIn { flex: 1; min-width: 160px; border: 0; background: none; outline: 0; font-size: var(--fs-16); height: 40px; }
#palIn::placeholder { color: var(--t3); }
.pal-list { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 8px 12px; scrollbar-width: thin; scrollbar-color: var(--s3) transparent; }
.pg { font: 500 var(--fs-12)/1 var(--sans); color: var(--t3); padding: 16px 12px 8px; }
.opt { display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 12px; border-radius: var(--r-ctl); font-size: var(--fs-14); cursor: pointer; }
.opt .gl { width: 24px; height: 24px; border-radius: 8px; background: var(--s3); display: grid; place-items: center; font: 500 var(--fs-12)/1 var(--sans); color: var(--t2); flex: none; }
.opt .gl .ic { width: 13px; height: 13px; }
.opt .sw { width: 16px; height: 16px; margin: 0 4px; }
.opt .ol { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-transform: none; }
.opt .ol em { font-style: normal; color: var(--t3); margin-left: 6px; }
.opt .pk { font: 400 var(--fs-13)/1 var(--sans); color: var(--t3); margin-right: 6px; }
.opt .on { font: 400 var(--fs-12)/1 var(--sans); color: var(--t3); flex: none; font-variant-numeric: tabular-nums; }
.opt mark { background: none; color: var(--t1); font-weight: 700; }
.opt.sel { background: var(--s3); }
.opt.sel .gl { background: var(--line-2); }
.opt.zero { color: var(--t3); }
.opt.none { cursor: default; color: var(--t2); height: auto; padding: 12px; }
.pal-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 12px 20px; border-top: 1px solid var(--line-2); min-height: 56px; }
.pal-prev { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; min-width: 0; }
.strip { display: flex; }
.strip i { width: 36px; height: 28px; margin-left: -6px; border-radius: 6px; border: 2px solid var(--s2); background: var(--c) center/cover no-repeat; }
.strip i:first-child { margin-left: 0; }
.pn { font-size: var(--fs-13); color: var(--t2); white-space: nowrap; }
.pn b { font-weight: 600; color: var(--t1); margin-right: 3px; }
.pal-keys { display: flex; gap: 16px; font-size: var(--fs-12); color: var(--t3); flex-wrap: wrap; }
.pal-keys kbd { margin-right: 4px; }
@media (max-width: 820px) { .palette { padding-top: 8px; } .pal-box { max-height: 92dvh; } .pal-keys { display: none; } }

/* ---------- the open item ---------- */
.viewer { position: fixed; inset: 0; z-index: 90; }
.v-scrim { position: absolute; inset: 0; background: var(--bg); }
.v-scroll { position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain; outline: 0; scrollbar-width: thin; scrollbar-color: var(--s3) transparent; }
.v-bar { position: sticky; top: 0; z-index: 4; display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 64px; padding: 0 24px 0 40px; background: linear-gradient(var(--bg) 70%, transparent); }
.v-count { font-size: var(--fs-13); color: var(--t3); font-variant-numeric: tabular-nums; }
.v-count b { font-weight: 500; color: var(--t1); }
.v-arrows { display: inline-flex; gap: 4px; margin-left: 12px; vertical-align: middle; }
.v-bar-r { display: flex; gap: 8px; }
.v-stage { position: relative; min-height: calc(100vh - 64px - 96px); display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 40px; align-items: center; padding: 8px 104px 24px; max-width: 1600px; margin: 0 auto; }
.print { margin: 0; justify-self: center; border-radius: var(--r-media); position: relative; }   /* no standing will-change: the open and close animations promote it while they run */
.print-media { position: relative; overflow: hidden; background: var(--s1); border-radius: var(--r-media); max-width: 100%; }
.print-media.vector { background: #fff; }
.print-media img, .print-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; cursor: crosshair; }
.print-media.vector img { padding: 6%; }
.print-media img.full { opacity: 0; transition: opacity var(--dur-base) var(--ease-out); }
.print-media img.full.in { opacity: 1; }
.print-media video { object-fit: contain; background: #000; }
.v-nav { position: absolute; top: 50%; margin-top: -24px; width: 48px; height: 48px; border-radius: 50%; background: var(--s2); display: grid; place-items: center; z-index: 3; transition: background var(--dur-quick), opacity var(--dur-quick); }
.v-nav:hover:not(:disabled) { background: var(--s3); }
.v-nav:disabled { opacity: .3; }
.v-nav.prev { left: 32px; } .v-nav.next { right: 32px; }
.card { position: relative; width: 360px; background: var(--s1); border-radius: var(--r-card); padding: 24px; }
.c-id { font: 400 var(--fs-12)/1.4 var(--mono); color: var(--t3); display: inline-flex; gap: 8px; border-radius: 4px; text-align: left; overflow-wrap: anywhere; }
.c-id:hover { color: var(--t1); }
.c-id-ok { color: var(--t1); }
.card h2 { font: 600 var(--fs-28)/1.15 var(--sans); letter-spacing: -.02em; margin: 12px 0 4px; }
.c-brand { text-decoration: none; border-radius: 4px; }
.c-brand:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; }
.c-where { font-size: var(--fs-14); color: var(--t2); }
.c-note { margin: 16px 0 24px; font-size: var(--fs-14); line-height: 1.55; color: var(--t2); text-wrap: pretty; }
.card dl { display: grid; grid-template-columns: 72px 1fr; gap: 16px 12px; font-size: var(--fs-13); align-items: start; padding-bottom: 24px; }
.card dt { font-size: var(--fs-12); color: var(--t3); line-height: 26px; }
.card dd { min-height: 26px; }
.card dd { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; align-items: center; }
.card dd .muted { margin-left: 4px; }
.card a { text-underline-offset: 3px; text-decoration-color: var(--t3); overflow-wrap: anywhere; border-radius: 4px; }
.card a:hover { text-decoration-color: var(--t1); }
.card dd a .ic { display: inline-block; width: 11px; height: 11px; margin-left: 4px; vertical-align: -1px; }
.card .chip { height: 26px; padding: 0 10px; font-size: var(--fs-12); background: var(--s2); }
.card .chip:hover { background: var(--s3); }
.tierstamp { font-size: var(--fs-13); font-weight: 500; color: var(--t1); background: var(--s2); border-radius: 6px; padding: 4px 8px; line-height: 1; }
.sws { gap: 8px; }
.swatch { position: relative; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.swatch i { width: 24px; height: 24px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(128, 128, 128, .35); }
.swatch .hx { position: absolute; left: 50%; bottom: calc(100% + 8px); translate: -50% 0; padding: 5px 8px; border-radius: 8px; background: var(--s3); color: var(--t1); font: 400 var(--fs-12)/1 var(--mono); white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity var(--dur-quick); z-index: 2; }
.swatch:hover .hx, .swatch:focus-visible .hx, .swatch.did .hx { opacity: 1; }
.swatch:hover i { box-shadow: 0 0 0 2px var(--s1), 0 0 0 3px var(--t3); }
.c-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.c-actions .btn-s { height: 40px; padding: 0 18px; font-size: var(--fs-13); flex: 1 1 auto; }
.c-actions .btn-s.primary { flex-basis: 100%; }
.c-actions .btn-s.primary { background: var(--t1); color: var(--on-t1); border-color: var(--t1); }
.c-actions .btn-s.primary:hover { background: color-mix(in srgb, var(--t1) 86%, var(--s1)); }
.c-hint { margin-top: 20px; font-size: var(--fs-12); color: var(--t3); display: flex; gap: 8px; align-items: flex-start; line-height: 1.5; }
.c-hint .ic { width: 14px; height: 14px; margin-top: 2px; }

.filmstrip { display: flex; gap: 8px; justify-content: center; align-items: center; height: 96px; padding: 12px 40px 0; overflow-x: auto; scrollbar-width: none; }
.film-t { flex: none; height: 48px; aspect-ratio: calc(1 / var(--r)); border-radius: 8px; background: var(--s1); overflow: hidden; opacity: .55; transition: opacity var(--dur-quick); }
.film-t img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.film-t:hover { opacity: 1; }
.film-t.on { opacity: 1; box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--t1); }
.v-rows { max-width: 1600px; margin: 0 auto; padding: 24px 104px 120px; }
.v-row { padding-top: 32px; }
.v-row + .v-row, .v-rows > section + section .v-row { padding-top: 40px; }
.row-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.row-head h3, .row-head h2 { font: 600 var(--fs-16)/1.3 var(--sans); letter-spacing: -.01em; }
.row-head .bp-h { display: flex; align-items: baseline; gap: 10px; }
.row-head h3 em { font-style: normal; }
.row-all { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 8px 0 12px; border-radius: var(--r-ctl); color: var(--t2); font-size: var(--fs-13); font-weight: 500; text-decoration: none; transition: background var(--dur-quick), color var(--dur-quick); }
.row-all:hover { background: var(--s2); color: var(--t1); }
.row-all .ic { width: 14px; height: 14px; }
.row-strip { display: flex; gap: 16px; overflow-x: auto; padding: 4px 4px 20px; margin: -4px -4px 0; align-items: flex-start; scrollbar-width: thin; scrollbar-color: var(--s3) transparent; }
.row-t { flex: none; display: block; height: 168px; aspect-ratio: calc(1 / var(--r)); background: var(--s1); border-radius: var(--r-media); overflow: hidden; transition: box-shadow var(--dur-quick) var(--ease-out); }
.row-t img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.row-t:hover { box-shadow: 0 0 0 1px var(--hover-ring); }
.v-keys { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); display: flex; gap: 16px; font-size: var(--fs-12); color: var(--t3); pointer-events: none; }
.v-keys kbd { margin-right: 4px; }
.viewer.is-tall .v-stage { align-items: start; }
.viewer.is-tall .card { position: sticky; top: 80px; }
.viewer.not-found .v-nav, .viewer.not-found .filmstrip, .viewer.not-found .c-actions, .viewer.not-found .c-hint { display: none; }
.viewer.not-found .print-media { display: grid; place-items: center; background: var(--s1); }
.viewer.not-found .print-media svg { width: 80%; color: var(--t2); }

@media (max-width: 1180px) {
  .v-stage { grid-template-columns: minmax(0, 1fr) 320px; padding: 8px 80px 24px; gap: 32px; }
  .card { width: 320px; padding: 20px; }
  .v-rows { padding: 24px 80px 120px; }
  .v-nav.prev { left: 16px; } .v-nav.next { right: 16px; }
}
@media (max-width: 820px) {
  .v-bar { padding: 0 8px 0 16px; }
  .v-bar-r .btn-s:not(#vClose) { display: none; }
  .v-stage { display: flex; flex-direction: column; align-items: center; gap: 24px; padding: 4px 16px 24px; min-height: 0; }
  .card { width: 100%; max-width: 480px; }
  .v-nav { display: none; }
  .filmstrip { height: 72px; justify-content: flex-start; padding: 8px 16px 0; }
  .film-t { height: 44px; }
  .v-rows { padding: 8px 16px 96px; }
  .row-t { height: 132px; }
  .v-keys { display: none; }
  .viewer.is-tall .card { position: relative; top: 0; }
}
.v-stage { touch-action: pan-y; }

/* ---------- About ---------- */
.about { width: min(440px, calc(100vw - 32px)); padding: 32px; border: 1px solid var(--line-2); border-radius: var(--r-card); background: var(--s2); color: var(--t2); box-shadow: var(--float); margin: auto; }
.about::backdrop { background: var(--scrim); }
.about h2 { font: 600 var(--fs-20)/1.25 var(--sans); letter-spacing: -.01em; color: var(--t1); margin-bottom: 12px; }
.about p { font-size: var(--fs-14); line-height: 1.6; text-wrap: pretty; }
.about a { color: var(--t1); text-underline-offset: 3px; text-decoration-color: var(--t3); }
.about a:hover { text-decoration-color: var(--t1); }
.about .about-mail { margin-top: 12px; }
.about form { margin-top: 24px; display: flex; justify-content: flex-end; }

/* ---------- the copy slip: resting look (id selectors so they hold over css/cursor.css, which the animator restyles) ---------- */
#slip { position: fixed; left: 50%; bottom: 32px; z-index: 270; display: flex; align-items: center; gap: 10px; max-width: calc(100vw - 32px); padding: 10px 18px 10px 14px; border-radius: var(--r-pill); background: var(--s2); color: var(--t1); border: 1px solid var(--line-2); box-shadow: var(--float); font-size: var(--fs-13); line-height: 1.35; transform: translate(-50%, 0); transition: none; }
#slip .ok { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--t1); color: var(--on-t1); flex: none; }
#slip .ok .tick { width: 12px; height: 12px; stroke-width: 2.4; }
#slip.err .ok { background: transparent; color: var(--t1); }
#slip.err .ok .ic { width: 16px; height: 16px; }
#slip b { font: 600 var(--fs-14)/1.2 var(--sans); margin-right: 4px; color: var(--t1); }
#slip .txt { color: var(--t2); }
@media (max-width: 820px) { #slip { bottom: 88px; } }
@media (max-width: 820px) { .c-id { min-height: 24px; align-items: center; } #viewer dd a { display: inline-flex; align-items: center; min-height: 24px; } }
