/* v6 prototype: page chrome (sheet, live, experiments) plus the few screen parts
   tokens.css does not have yet (prefixed v6x-). Colors only via tokens.css vars. */
html, body { margin: 0; }
body { background: #2a2a30; color: var(--v6-text); font: 14px/1.5 var(--v6-body); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
body * { box-sizing: border-box; }
.hidden { display: none !important; }

/* ---------------------------------------------------------------- toolbar */
.tb { position: sticky; top: 0; z-index: 50; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 16px; background: rgba(13, 13, 16, 0.94); backdrop-filter: blur(10px); border-bottom: 1px solid var(--v6-line); }
.tb-brand { font: 700 16px/1.15 var(--v6-display); margin-right: auto; }
.tb-brand small { display: block; font: 400 12px var(--v6-body); color: var(--v6-text-3); }
.seg { display: inline-flex; border: 1px solid var(--v6-line-2); border-radius: 10px; overflow: hidden; }
.seg button, .tbtn { font: 500 13px/1 var(--v6-body); color: var(--v6-text); background: transparent; border: 0; padding: 9px 12px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; min-height: 36px; }
.seg button.on { background: var(--v6-violet); }
.tbtn { border: 1px solid var(--v6-line-2); border-radius: 10px; background: var(--v6-raised); }
.tbtn:hover, .seg button:hover { filter: brightness(1.15); }
.tgl { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; color: var(--v6-text-2); cursor: pointer; }
.tgl input { accent-color: var(--v6-violet); width: 16px; height: 16px; }
.tb select { font: 500 13px var(--v6-body); color: var(--v6-text); background: var(--v6-raised); border: 1px solid var(--v6-line-2); border-radius: 10px; padding: 8px 10px; min-height: 36px; max-width: 220px; }
.tb .v6-ic { width: 16px; height: 16px; }
body:not(.mode-live) .only-live { display: none; }

/* ---------------------------------------------------------------- sheet */
#sheet { padding: 24px 24px 120px; }
.intro { max-width: 1100px; background: var(--v6-surface); border: 1px solid var(--v6-line); border-radius: 16px; padding: 16px 20px; margin-bottom: 28px; color: var(--v6-text-2); }
.intro b { color: var(--v6-text); }
.intro ul { margin: 6px 0 0; padding-left: 18px; }
.sh-step { background: #222228; border: 1px solid var(--v6-line); border-radius: 20px; padding: 20px; margin-bottom: 32px; scroll-margin-top: 80px; }
.sh-head { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: baseline; }
.sh-head .num { font: 700 14px var(--v6-display); color: var(--v6-soft); }
.sh-head h2 { margin: 0; font: 700 22px var(--v6-display); }
.meta { font-size: 12px; color: var(--v6-text-3); }
.meta code, .sh-cta code { color: var(--v6-text-2); background: rgba(255, 255, 255, 0.06); padding: 1px 5px; border-radius: 5px; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.badge { display: inline-flex; gap: 6px; align-items: center; font-size: 12px; border: 1px solid var(--v6-line-2); border-radius: 999px; padding: 3px 10px; background: var(--v6-raised); cursor: pointer; color: var(--v6-text); }
.badge .st { font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--v6-text-3); }
.badge.running, .badge.live { border-color: rgba(52, 211, 153, 0.5); }
.badge.planned { border-color: rgba(245, 184, 61, 0.5); }
.sh-cta { font-size: 13px; color: var(--v6-text-2); margin: 4px 0 14px; max-width: 1200px; }
.sh-cta b { color: var(--v6-text); }
.sh-row { display: flex; gap: 28px; align-items: flex-start; overflow-x: auto; padding-bottom: 10px; }
.sh-fig { margin: 0; flex: none; }
.sh-fig figcaption { display: flex; gap: 8px; align-items: center; font: 600 11px var(--v6-body); letter-spacing: 0.08em; text-transform: uppercase; color: var(--v6-text-3); margin-bottom: 8px; }
.sh-fig figcaption .tag-new { color: var(--v6-lilac); }
.sh-fig img.cap { display: block; border-radius: 14px; border: 1px solid var(--v6-line-2); background: #000; }
.sh-fig.m img.cap { width: 300px; }
.sh-fig.d img.cap { width: 640px; }
.missing { width: 300px; height: 220px; border: 1px dashed var(--v6-line-2); border-radius: 14px; display: grid; place-items: center; color: var(--v6-text-3); font-size: 12px; }
.sh-fig.d .missing { width: 640px; }
.pw-board iframe { width: 100%; height: 1400px; border: 1px solid var(--v6-line-2); border-radius: 12px; background: #2a2a30; }

/* ---------------------------------------------------------------- live */
#live { padding: 12px 8px 40px; }
.lv-bar { display: flex; flex-wrap: nowrap; gap: 8px 12px; align-items: center; justify-content: center; margin-bottom: 10px; color: var(--v6-text-2); font-size: 13px; white-space: nowrap; overflow: hidden; }
.lv-bar > span { overflow: hidden; text-overflow: ellipsis; }
.lv-stage { display: flex; justify-content: center; }
.darea.lv-scroll { overflow-y: auto; overscroll-behavior: contain; }

/* ---------------------------------------------------------------- experiments */
#exp { padding: 24px; }
.panel { background: var(--v6-surface); border: 1px solid var(--v6-line); border-radius: 16px; padding: 16px; }
table.exp { width: 100%; border-collapse: collapse; font-size: 13px; }
table.exp th { text-align: left; font: 600 11px var(--v6-body); letter-spacing: 0.06em; text-transform: uppercase; color: var(--v6-text-3); padding: 8px; border-bottom: 1px solid var(--v6-line-2); }
table.exp td { vertical-align: top; padding: 8px; border-bottom: 1px solid var(--v6-line); }
.pill { display: inline-block; font-size: 11px; border-radius: 999px; padding: 1px 8px; border: 1px solid var(--v6-line-2); }
.pill.running, .pill.live { color: var(--v6-ok); border-color: rgba(52, 211, 153, 0.5); }
.pill.planned { color: #f5b83d; border-color: rgba(245, 184, 61, 0.5); }
.pill.stopped { color: var(--v6-text-3); }
.no { color: var(--v6-err); }

/* ---------------------------------------------------------------- frames */
/* ---------------------------------------------------------------- devices
   .dev = device body, .dscr = the CSS viewport, .darea = what the step gets (never scrolls in
   Sheet and harness; a step that does not fit is flagged red with "+N px"). */
.dz { position: relative; flex: none; }
.dz > .dz-in { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.dev { position: relative; box-sizing: border-box; }
.dev-m15 { border-radius: 68px; padding: 22px; background: linear-gradient(145deg, #3a3a42, #16161a); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), inset 0 0 0 2px #4a4a54, inset 0 0 0 5px #0c0c0f; }
.dev-se { border-radius: 56px; padding: 80px 20px; background: linear-gradient(145deg, #3a3a42, #16161a); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), inset 0 0 0 2px #4a4a54; }
.dev-se .dspk { position: absolute; left: 50%; top: 38px; width: 60px; height: 6px; margin-left: -30px; border-radius: 3px; background: #0c0c0f; }
.dev-se .dbtn { position: absolute; left: 50%; bottom: 13px; width: 54px; height: 54px; margin-left: -27px; border-radius: 50%; box-shadow: inset 0 0 0 2px #5a5a64; }
.dev-d { border: 1px solid var(--v6-line-2); border-radius: 12px; overflow: hidden; background: #1b1b21; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5); }
.dbar { display: flex; align-items: center; gap: 7px; height: 32px; padding: 0 14px; background: #1b1b21; border-bottom: 1px solid var(--v6-line); font: 500 12px var(--v6-body); color: var(--v6-text-3); }
.dbar i { width: 11px; height: 11px; border-radius: 50%; background: #3a3a42; }
.dbar span { margin-left: 16px; padding: 3px 14px; border-radius: 6px; background: #26262e; }
.dscr { position: relative; overflow: hidden; background: var(--v6-bg); }
.dscr-m15 { border-radius: 55px; }
.dsb { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: center; justify-content: space-between; color: #fff; font: 600 16px/1 var(--v6-body); pointer-events: none; z-index: 2; }
.dsb .ico { display: inline-flex; gap: 6px; align-items: center; }
.dscr-m15 .dsb { height: 54px; padding: 4px 30px 0 52px; }
.dscr-se .dsb { height: 20px; padding: 0 6px; font-size: 12px; }
.dscr-se .dsb svg { transform: scale(0.8); }
.disl { position: absolute; left: 50%; top: 11px; width: 125px; height: 37px; margin-left: -62.5px; border-radius: 20px; background: #000; z-index: 3; }
.dhi { position: absolute; left: 50%; bottom: 8px; width: 134px; height: 5px; margin-left: -67px; border-radius: 5px; background: #fff; opacity: 0.9; z-index: 3; }
.darea { position: absolute; left: 0; right: 0; overflow: hidden; }
.darea.is-over { box-shadow: inset 0 0 0 3px var(--v6-err); }
.darea.is-over::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--v6-err); z-index: 30; }
.dflag { position: absolute; z-index: 40; left: 50%; bottom: 44px; transform: translateX(-50%); padding: 6px 12px; border-radius: 999px; background: var(--v6-err); color: #fff; font: 700 13px/1 var(--v6-body); white-space: nowrap; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5); pointer-events: none; }
.dscr-d .dflag { bottom: 16px; font-size: 16px; }
.v6-measuring .v6-dock { position: static !important; }
.v6-fithost { position: fixed; left: -20000px; top: 0; visibility: hidden; pointer-events: none; }
.darea .pw-fr, .darea .pw-fr iframe { display: block; width: 100%; height: 100%; border: 0; background: var(--v6-bg); }
.fitb { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font: 600 12px/1.2 var(--v6-body); letter-spacing: 0; text-transform: none; border: 1px solid var(--v6-line-2); color: var(--v6-text-2); }
.fitb.ok { color: var(--v6-ok); border-color: rgba(52, 211, 153, 0.6); background: rgba(52, 211, 153, 0.1); }
.fitb.bad { color: #fff; border-color: var(--v6-err); background: rgba(248, 113, 113, 0.25); }
.fits { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
body.harness { background: var(--v6-bg); }
body.harness .tb, body.harness main:not(#hz) { display: none !important; }
#hz { position: absolute; left: 0; top: 0; }

/* ---------------------------------------------------------------- frames */
.fr-app { min-height: var(--fh, 844px); }
.fr-app > .v6-screen { min-height: var(--fh, 844px); }
.v6x-ed { outline: none; border-radius: 6px; }
.v6x-ed[contenteditable='true'] { cursor: text; }
.v6x-ed[contenteditable='true']:hover { box-shadow: 0 0 0 1px rgba(196, 181, 253, 0.45); }
.v6x-ed[contenteditable='true']:focus { box-shadow: 0 0 0 2px var(--v6-lilac); white-space: pre-wrap; }
.v6x-ed.is-edited { box-shadow: 0 0 0 1px rgba(245, 184, 61, 0.8); }
.v6-cta .v6x-ed { display: inline-block; min-width: 2ch; }
img[data-missing], video[data-missing] { visibility: hidden; }
.v6x-ph { background: linear-gradient(135deg, var(--v6-raised), var(--v6-raised-2)) !important; }
.v6x-mob { display: block; }
@container v6 (min-width: 900px) { .v6x-mob { display: none; } }
.v6x-hint { text-align: center; margin-top: -8px; }

/* ---------------------------------------------------------------- screen parts */
.v6x-eyerow { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
@container v6 (min-width: 900px) { .v6x-eyerow { justify-content: flex-start; } }
.v6x-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 12px; border-radius: var(--v6-r-full); border: 1px solid rgba(196, 181, 253, 0.4); background: var(--v6-tint); font: 600 12px/1 var(--v6-body); letter-spacing: 0.06em; text-transform: uppercase; color: var(--v6-lilac); }
.v6x-chip .v6-ic { width: 14px; height: 14px; }
.v6x-chip.is-pro { background: var(--v6-grad-cta); color: #fff; border-color: transparent; }
.v6x-chip.is-age { border-color: rgba(248, 113, 133, 0.6); background: rgba(248, 113, 133, 0.14); color: #ffc2cc; }
.v6x-opts4 > * { flex-basis: 120px; }
@container v6 (min-width: 900px) { .v6x-opts4 { grid-template-columns: repeat(4, 1fr); } }
.v6-opt img.v6x-top { object-position: 50% 12%; }

.v6x-group { display: grid; gap: 10px; }
.v6x-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.v6x-grid.c3 { grid-template-columns: repeat(3, 1fr); }
.v6x-tile { position: relative; display: grid; gap: 6px; padding: 0; text-align: center; font: 500 13px/1.2 var(--v6-body); color: var(--v6-text-2); }
.v6x-tile .im { position: relative; display: block; aspect-ratio: 1; border-radius: var(--v6-r-md); overflow: hidden; border: 1.5px solid var(--v6-line); background: var(--v6-surface); transition: border-color var(--v6-t-state) var(--v6-ease), box-shadow var(--v6-t-state) var(--v6-ease), transform var(--v6-t-micro) var(--v6-ease); }
.v6x-tile .im img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; filter: saturate(0.85) brightness(0.85); transition: filter var(--v6-t-state) var(--v6-ease); }
.v6x-tile:hover .im { border-color: var(--v6-line-2); transform: translateY(-2px); }
.v6x-tile:focus-visible { outline: none; }
.v6x-tile:focus-visible .im { outline: 2px solid var(--v6-lilac); outline-offset: 2px; }
.v6x-tile[aria-pressed='true'] { color: var(--v6-text); font-weight: 600; }
.v6x-tile[aria-pressed='true'] .im { border-color: var(--v6-lilac); box-shadow: 0 0 0 3px rgba(196, 181, 253, 0.18), 0 8px 24px rgba(124, 58, 237, 0.45); }
.v6x-tile[aria-pressed='true'] .im img { filter: none; }
.v6x-tile .ck { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: var(--v6-violet); opacity: 0; transition: opacity var(--v6-t-state) var(--v6-ease); }
.v6x-tile .ck .v6-ic { width: 13px; height: 13px; stroke-width: 3; }
.v6x-tile[aria-pressed='true'] .ck { opacity: 1; }
.v6x-tile.wide .im { aspect-ratio: 4 / 3; }

.v6x-feats { display: grid; gap: 10px; }
.v6x-feats .v6-card { background: rgba(255, 255, 255, 0.04); }

.v6x-lockchip { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 14px; border-radius: var(--v6-r-full); background: var(--v6-glass); border: 1px solid var(--v6-line-2); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); font: 700 14px/1 var(--v6-display); white-space: nowrap; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45); }
.v6x-lockchip .v6-ic { width: 15px; height: 15px; color: var(--v6-ok); }

.v6x-cap { text-align: center; }
@container v6 (min-width: 900px) { .v6x-cap { text-align: left; } }

.v6x-checks { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.v6x-checks li { display: inline-flex; gap: 8px; align-items: center; min-height: 40px; padding: 0 14px; border-radius: var(--v6-r-full); border: 1px solid var(--v6-line); background: rgba(255, 255, 255, 0.04); font: 600 14px/1 var(--v6-body); }
.v6x-checks .v6-ic { width: 15px; height: 15px; color: var(--v6-ok); }
@container v6 (min-width: 900px) { .v6x-checks { justify-content: flex-start; } }

.v6x-orb { width: 220px; height: 220px; }
.v6x-orb img { width: 190px; height: 190px; }
@container v6 (min-width: 900px) { .v6x-orb { width: 340px; height: 340px; margin: 40px auto; } .v6x-orb img { width: 300px; height: 300px; } }
.v6x-status { display: flex; gap: 8px; align-items: center; justify-content: center; font: 600 14px var(--v6-body); color: var(--v6-lilac); }
.v6x-status .v6-ic { width: 16px; height: 16px; animation: v6-rot 0.9s linear infinite; }
.v6x-status.is-done .v6-ic { animation: none; color: var(--v6-ok); }
@container v6 (min-width: 900px) { .v6x-status { justify-content: flex-start; } }
.v6x-skip { justify-self: center; }

.v6x-lock { position: relative; height: 320px; border-radius: 26px; overflow: hidden; border: 1px solid var(--v6-line-2); background: var(--v6-raised); width: 100%; margin: 0 auto; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55); }
.v6x-lock > img { width: 100%; height: 100%; object-fit: cover; }
.v6x-lock .pv { position: absolute; top: 12px; left: 12px; }
.v6x-lock .mid { position: absolute; inset: 0; display: grid; place-items: center; }
.v6x-lock .mid span { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--v6-glass); border: 1px solid var(--v6-line-2); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.v6x-lock .mid .v6-ic { width: 26px; height: 26px; }
.v6x-lock .nm { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); }
@container v6 (min-width: 900px) { .v6x-lock { height: 540px; max-width: 420px; } }

/* narrow: the toolbar is one compact row that scrolls sideways (max 52 px high) */
@media (max-width: 700px) {
  .tb { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 6px 8px; gap: 6px; max-height: 52px; }
  .tb::-webkit-scrollbar { display: none; }
  .tb > * { flex: none; }
  .tb-brand { display: none; }
  .seg button, .tbtn, .tb select { min-height: 32px; padding: 6px 9px; font-size: 12px; }
  .tb .tgl { font-size: 12px; white-space: nowrap; }
  #sheet { padding: 16px 12px 80px; }
  .sh-step { padding: 14px; }
}
@container v6 (min-width: 900px) { .v6-float.is-a { bottom: 120px; } .fr-app .v6-stage { height: min(560px, calc(var(--vh, 1vh) * 62)); } }
