/* V³ showcase: chooser + fullscreen viewers. Same tokens as styles.css, works in both themes. */
html.show-open, html.show-open body { overflow: hidden; }
html.show-open .op { z-index: 98; }

/* ================= CHOOSER ================= */
.show-menu { position: fixed; inset: 0; z-index: 85; display: grid; place-items: center; padding: 16px; }
.show-menu-veil { position: absolute; inset: 0; background: rgba(0,0,0,.62); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); opacity: 0; transition: opacity .4s ease; }
.show-menu.on .show-menu-veil { opacity: 1; }
.show-menu-card { position: relative; width: min(980px, 100%); max-height: calc(100svh - 32px); overflow: auto; display: grid; gap: 12px; padding: clamp(24px, 4vw, 44px); border-radius: 28px; background: var(--surface); border: 1px solid var(--line-strong); box-shadow: var(--shadow); opacity: 0; transform: translateY(26px) scale(.97); transition: opacity .45s ease, transform .7s var(--spring); }
.show-menu.on .show-menu-card { opacity: 1; transform: none; }
.show-menu-x { position: absolute; top: 16px; right: 16px; background: var(--surface); }
.show-menu-card h3 { font-size: var(--text-xl); font-weight: 300; letter-spacing: -.04em; line-height: 1; padding-right: 50px; }
.show-menu-lead { color: var(--muted); max-width: 56ch; }
.show-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 12px; margin-top: 10px; }
.show-tile { position: relative; display: grid; align-content: start; gap: 8px; min-height: 150px; padding: 20px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg); text-align: left; opacity: 0; transform: translateY(14px); transition: border-color .35s, transform .5s var(--spring), background .35s; }
.show-menu.on .show-tile { animation: tileIn .6s var(--spring) both; animation-delay: calc(.08s + var(--k) * .05s); }
@keyframes tileIn { to { opacity: 1; transform: none; } }
.show-tile:hover, .show-tile:focus-visible { border-color: var(--text); transform: translateY(-3px); }
.show-tile:active { transform: scale(.98); }
.show-tile-ico { width: 38px; height: 38px; margin-bottom: 8px; }
.show-tile-ico svg { width: 100%; height: 100%; }
.show-tile-t { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: var(--text-lg); font-weight: 500; line-height: 1.25; }
.show-tile-t .badge { font-size: .56rem; padding: 3px 8px; color: var(--text); }
.show-tile-x { color: var(--muted); font-size: var(--text-sm); line-height: 1.45; }
.show-tile-go { position: absolute; top: 18px; right: 18px; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-strong); display: grid; place-items: center; transition: transform .45s var(--spring), background .3s, color .3s; }
.show-tile:hover .show-tile-go { transform: rotate(45deg); background: var(--solid-bg); color: var(--solid-text); }

/* ================= VIEWER SHELL ================= */
.show { position: fixed; inset: 0; z-index: 94; display: flex; flex-direction: column; background: var(--bg); color: var(--text); padding-top: env(safe-area-inset-top, 0px); opacity: 0; transform: scale(1.02); transition: opacity .45s ease, transform .6s var(--ease); }
.show.on { opacity: 1; transform: none; }
.show-top { flex: 0 0 auto; display: flex; align-items: center; gap: 12px; padding: 12px clamp(12px, 3vw, 28px); border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.show-title { flex: 1; min-width: 0; text-align: center; font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.show-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; min-width: 40px; padding: 8px 16px; border-radius: var(--pill); border: 1px solid var(--line-strong); font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: .1em; text-transform: uppercase; transition: border-color .3s, background .3s, color .3s; }
.show-btn:hover { border-color: var(--text); }
.show-x { padding: 8px; width: 40px; }
.show-stage { position: relative; flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: clamp(16px, 3vw, 36px) clamp(12px, 3vw, 36px) 120px; }
.show-order { position: fixed; right: clamp(14px, 3vw, 32px); bottom: calc(clamp(14px, 3vw, 28px) + env(safe-area-inset-bottom, 0px)); z-index: 5; min-height: 56px; padding: 14px 34px; box-shadow: var(--shadow); }
.studio-extra .show-order { position: absolute; z-index: 6; }

/* ================= SITES ================= */
.sites { display: grid; gap: 22px; max-width: 1180px; margin: 0 auto; }
.sites-track { display: grid; }
.site-slide { grid-area: 1 / 1; margin: 0; display: grid; gap: 18px; opacity: 0; visibility: hidden; transform: translateX(30px); transition: opacity .5s ease, transform .7s var(--ease), visibility 0s .5s; }
.site-slide.on { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.site-stage { position: relative; padding-right: clamp(40px, 12%, 150px); }
.site-browser { border-radius: 16px; border: 1px solid var(--line-strong); overflow: hidden; background: #000; box-shadow: 0 50px 120px -40px rgba(0,0,0,.85); }
.site-bar { display: flex; align-items: center; gap: 6px; padding: 9px 12px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.site-bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-strong); }
.site-bar span { margin-left: 10px; flex: 1; max-width: 340px; padding: 3px 12px; border-radius: 999px; background: var(--bg); font-family: var(--font-mono); font-size: .66rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.site-screen { position: relative; aspect-ratio: 16 / 9; background: #000; overflow: hidden; }
.site-screen video { width: 100%; height: 100%; object-fit: cover; display: block; }
.site-phone { position: absolute; right: 0; bottom: -6%; width: clamp(90px, 20%, 230px); border-radius: 26px; border: 6px solid #111; outline: 1px solid var(--line-strong); overflow: hidden; background: #000; box-shadow: 0 40px 80px -30px rgba(0,0,0,.9); }
.site-phone .site-screen { aspect-ratio: 9 / 19; }
.site-phone .device-ui { padding: 10px; }
.site-slide figcaption { display: grid; gap: 6px; max-width: 64ch; }
.site-slide figcaption b { font-size: var(--text-xl); font-weight: 300; letter-spacing: -.04em; line-height: 1.05; }
.site-slide figcaption span:last-child { color: var(--muted); }
.show-nav { display: flex; align-items: center; justify-content: center; gap: 16px; }
.show-dots { display: inline-flex; gap: 8px; }
.show-dots i { width: 28px; height: 3px; border-radius: 2px; background: var(--line-strong); cursor: pointer; transition: background .3s, width .4s var(--ease); }
.show-dots i.on { background: var(--text); width: 44px; }
.sites-inc { display: grid; gap: 12px; padding: 20px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.sites-inc ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.sites-inc li { display: flex; align-items: center; gap: 10px; }
.sites-inc .ck { width: 16px; flex: 0 0 16px; }
.sites-note { color: var(--muted); font-size: var(--text-sm); }

/* ================= GALLERY + LIGHTBOX ================= */
.gal { max-width: 1280px; margin: 0 auto; display: grid; gap: 16px; }
.gal-lead { color: var(--muted); }
.gal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 12px; }
.gal-item { position: relative; aspect-ratio: 4 / 5; border-radius: 18px; overflow: hidden; border: 1px solid var(--line); background: #000; opacity: 0; animation: tileIn .6s var(--spring) both; animation-delay: calc(var(--k) * .04s); transform: translateY(14px); }
.show[data-mode="gallery"] .gal-item img { object-position: top; }
.gal-item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .8s var(--ease), filter .5s; }
.gal-item:hover img { transform: scale(1.05); filter: brightness(1.08); }
.gal-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; padding-left: 4px; background: rgba(12,12,12,.55); color: #f6f6f4; border: 1px solid rgba(255,255,255,.5); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); font-size: 1rem; }
.gal-cap { position: absolute; inset: auto 0 0 0; padding: 14px; display: grid; gap: 2px; color: #f6f6f4; text-align: left; background: linear-gradient(transparent, rgba(0,0,0,.72)); }
.gal-cap .eyebrow { color: rgba(246,246,244,.75); font-size: .6rem; }
.gal-cap b { font-weight: 400; font-size: 1.05rem; line-height: 1.2; }
.lb { position: fixed; inset: 0; z-index: 7; display: grid; grid-template-rows: 1fr auto; background: rgba(0,0,0,.94); color: #f3f3f1; opacity: 0; transition: opacity .35s ease; }
.lb.on { opacity: 1; }
.lb-media { min-height: 0; display: grid; place-items: center; padding: 64px clamp(12px, 8vw, 90px) 8px; touch-action: pan-y; }
.lb-media img, .lb-media video { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 12px; animation: rise .45s var(--spring); }
.lb-cap { display: grid; gap: 4px; justify-items: center; text-align: center; padding: 12px 16px calc(96px + env(safe-area-inset-bottom, 0px)); }
.lb-cap .eyebrow { color: #9a9a95; }
.lb-title { font-size: var(--text-lg); font-weight: 500; }
.lb-text { color: #b4b4ae; font-size: var(--text-sm); max-width: 60ch; }
.lb-count { font-family: var(--font-mono); font-size: .64rem; letter-spacing: .12em; color: #9a9a95; }
.lb .show-btn { position: absolute; color: #f3f3f1; border-color: rgba(243,243,241,.45); background: rgba(12,12,12,.5); }
.lb-prev, .lb-next { top: 50%; transform: translateY(-50%); width: 48px; height: 48px; padding: 0; }
.lb-prev { left: clamp(8px, 2vw, 24px); } .lb-next { right: clamp(8px, 2vw, 24px); }
.lb-x { top: 14px; right: 14px; width: 44px; height: 44px; padding: 0; }
@media (max-width: 640px) { .lb-prev, .lb-next { top: auto; bottom: calc(100px + env(safe-area-inset-bottom, 0px)); transform: none; } }

/* ================= ASSISTANT: client vs owner ================= */
.ai { max-width: 1180px; margin: 0 auto; display: grid; gap: 18px; }
.ai-tabs { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.ai-split { display: grid; gap: 16px; align-items: start; }
@media (min-width: 900px) { .ai-split { grid-template-columns: 1.15fr 1fr; } }
.ai-side { display: grid; gap: 10px; min-width: 0; }
.ai-chat .chat-body { height: min(52vh, 460px); }
.ai-card { display: grid; gap: 14px; padding: 20px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.ai-card-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.ai-client { font-size: var(--text-lg); font-weight: 500; }
.ai-src { font-family: var(--font-mono); font-size: .64rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.ai-fields { margin: 0; display: grid; gap: 8px; }
.ai-fields div { padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); transition: border-color .4s; }
.ai-fields dt { font-family: var(--font-mono); font-size: .58rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.ai-fields dd { margin: 2px 0 0; color: var(--faint); font-size: var(--text-sm); transition: color .4s; }
.ai-fields div.on { border-color: var(--line-strong); animation: fieldIn .7s var(--spring); }
.ai-fields div.on dd { color: var(--text); }
@keyframes fieldIn { 0% { transform: scale(.97); background: color-mix(in srgb, var(--text) 10%, var(--bg)); } 100% { transform: none; } }
.ai-meter { display: flex; align-items: baseline; gap: 10px; padding-top: 6px; border-top: 1px solid var(--line); }
.ai-meter span { font-size: var(--text-xl); font-weight: 300; letter-spacing: -.04em; line-height: 1; }
.ai-meter small { color: var(--muted); font-size: var(--text-sm); }
.ai-explain { color: var(--muted); font-size: var(--text-sm); }

/* ================= FULL CRM ================= */
.xcrm { position: relative; max-width: 1280px; margin: 0 auto; display: grid; gap: 14px; }
@media (min-width: 900px) { .xcrm { grid-template-columns: 190px 1fr; } }
.xcrm-nav { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; align-content: start; }
@media (min-width: 900px) { .xcrm-nav { flex-direction: column; } }
.xcrm-nav button { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 14px; border: 1px solid transparent; color: var(--muted); font-size: var(--text-sm); transition: background .3s, color .3s, border-color .3s; }
.xcrm-nav button svg { width: 20px; height: 20px; }
.xcrm-nav button[aria-pressed="true"] { background: var(--surface); border-color: var(--line); color: var(--text); }
.xcrm-main { display: grid; gap: 14px; min-width: 0; }
.xcrm-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
@media (max-width: 640px) { .xcrm-kpis { grid-template-columns: repeat(2, 1fr); } }
.xcrm-kpis > div { padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); display: grid; gap: 2px; min-width: 0; }
.xcrm-kpis small { font-size: .7rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xcrm-kpis b { font-size: clamp(1.1rem, .9rem + 1vw, 1.6rem); font-weight: 400; font-variant-numeric: tabular-nums; }
.xcrm-hint { color: var(--muted); font-size: var(--text-sm); margin: 0 0 10px; }
.xboard { display: grid; grid-template-columns: repeat(4, minmax(170px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.xcol { display: grid; align-content: start; gap: 8px; min-height: 340px; padding: 10px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); transition: border-color .25s, background .25s; }
.xcol.over { border-color: var(--text); background: color-mix(in srgb, var(--text) 6%, var(--surface)); }
.xcol-h { display: flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: .62rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.xcol-h em { margin-left: auto; font-style: normal; color: var(--text); }
.xcol-sum { font-family: var(--font-mono); font-size: .66rem; color: var(--faint); }
.xcol-cards { display: grid; gap: 8px; }
.xdeal { display: grid; gap: 6px; width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); text-align: left; cursor: grab; touch-action: none; user-select: none; transition: border-color .3s, opacity .3s, transform .4s var(--spring); }
.xdeal:hover { border-color: var(--text); }
.xdeal.paid { border-color: var(--line-strong); }
.xdeal.lifted { opacity: .3; }
.xdeal.flash { animation: dealFlash 1.2s var(--spring); border-color: var(--text); }
@keyframes dealFlash { 0% { transform: scale(.9); opacity: 0; } 40% { transform: scale(1.03); opacity: 1; } 100% { transform: none; } }
.xdeal.ghost { position: fixed; left: 0; top: 0; z-index: 10; pointer-events: none; cursor: grabbing; box-shadow: var(--shadow); border-color: var(--text); }
.xdeal-top, .xdeal-bot { display: flex; justify-content: space-between; align-items: center; gap: 6px; min-width: 0; }
.xdeal-top b { font-size: .82rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xsrc, .xwho { font-family: var(--font-mono); font-size: .58rem; letter-spacing: .06em; color: var(--muted); white-space: nowrap; }
.xwho { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--bg); border: 1px solid var(--line); }
.xdeal-bot small { font-family: var(--font-mono); font-size: .68rem; color: var(--muted); }
.xcrm-drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 8; width: min(400px, 100%); overflow: auto; display: grid; align-content: start; gap: 14px; padding: calc(20px + env(safe-area-inset-top, 0px)) 22px 120px; background: var(--surface); border-left: 1px solid var(--line-strong); box-shadow: var(--shadow); transform: translateX(100%); transition: transform .55s var(--ease); }
.xcrm-drawer.on { transform: none; }
.xdr-h { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.xdr-h b { display: block; font-size: var(--text-lg); font-weight: 500; }
.xdr-h small { color: var(--muted); }
.xdr-f { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.xdr-f div { padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); }
.xdr-f dt { font-family: var(--font-mono); font-size: .58rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.xdr-f dd { margin: 2px 0 0; }
.xdr-act { display: flex; flex-wrap: wrap; gap: 8px; }
.xtable { display: grid; grid-template-columns: 1.4fr 1fr .9fr .9fr 1fr; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; font-size: var(--text-sm); }
.xtable > span { padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--surface); }
.xtable > span[role="columnheader"] { font-family: var(--font-mono); font-size: .6rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); background: var(--bg); }
@media (max-width: 640px) { .xtable { grid-template-columns: 1.4fr 1fr 1fr; } .xtable > span:nth-child(5n+2), .xtable > span:nth-child(5n+3) { display: none; } }
.xtasks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.xtasks li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); }
.xtasks li small { margin-left: auto; font-family: var(--font-mono); font-size: .64rem; color: var(--muted); white-space: nowrap; }
.xtasks button { width: 24px; height: 24px; flex: 0 0 24px; border-radius: 50%; border: 1px solid var(--line-strong); display: grid; place-items: center; }
.xtasks button .ck { width: 14px; opacity: 0; transition: opacity .3s; }
.xtasks li.done span { text-decoration: line-through; color: var(--muted); }
.xtasks li.done button { background: var(--solid-bg); color: var(--solid-text); border-color: var(--solid-bg); }
.xtasks li.done button .ck { opacity: 1; }
.xstats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.xcard { display: grid; gap: 10px; padding: 18px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); }
.xbar { display: grid; grid-template-columns: 110px 1fr 44px; align-items: center; gap: 10px; font-size: var(--text-sm); }
.xbar span { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xbar i { height: 10px; border-radius: 0 4px 4px 0; background: var(--text); width: calc(var(--w) * 100%); min-width: 2px; transform-origin: left; animation: barIn .8s var(--ease) both; }
.xbar b { font-family: var(--font-mono); font-size: .72rem; font-weight: 400; text-align: right; }
@keyframes barIn { from { transform: scaleX(0); } }
.xcrm-ping { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom, 0px)); z-index: 9; transform: translate(-50%, 12px); opacity: 0; padding: 10px 18px; border-radius: var(--pill); background: var(--solid-bg); color: var(--solid-text); font-size: var(--text-sm); white-space: nowrap; max-width: calc(100% - 32px); overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.xcrm-ping.on { animation: pingIn 3s var(--spring) both; }
@keyframes pingIn { 0% { opacity: 0; transform: translate(-50%, 12px); } 12%, 82% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; transform: translate(-50%, -6px); } }
.xcrm-tour { position: fixed; inset: auto 0 0 0; z-index: 9; display: grid; place-items: center; padding: 0 16px calc(100px + env(safe-area-inset-bottom, 0px)); pointer-events: none; }
.xcrm-tour-card { pointer-events: auto; width: min(460px, 100%); display: grid; gap: 14px; padding: 18px 20px; border-radius: 20px; background: var(--solid-bg); color: var(--solid-text); box-shadow: var(--shadow); animation: rise .5s var(--spring); }
.xcrm-tour-t { margin: 0; line-height: 1.45; }
.xcrm-tour-card > div { display: flex; justify-content: flex-end; align-items: center; gap: 16px; }
.xcrm-tour-card .link { color: inherit; opacity: .7; }
.xcrm-tour-card .pill-solid { background: var(--solid-text); color: var(--solid-bg); border-color: var(--solid-text); min-height: 40px; }
.tour-on { position: relative; z-index: 2; outline: 2px solid var(--text); outline-offset: 4px; border-radius: 16px; animation: tourPulse 1.6s ease-in-out infinite; }
@keyframes tourPulse { 50% { outline-offset: 8px; } }

@media (prefers-reduced-motion: reduce) {
  .show, .show-menu-card, .show-tile, .gal-item, .site-slide { transition: none; animation: none; opacity: 1; transform: none; }
  .tour-on, .xbar i, .xdeal.flash { animation: none; }
}
