/* =====================================================================
   Window pages + window tabs (screen-pages track): #winStrip chips in the Screen toolbar, the edge bars on the PC view
   (drag dwell), the deck's tab strip (#deckTabs) and window tabs (.wp-tab, pages of the Lens area), the landscape
   #landWin switcher, the context key page and the window sheets (picker, window / tab menus, key pack editor).
   Tokens live in base.css. Nothing here uses backdrop-filter: these sit over (or next to) the live PC image.
   ===================================================================== */

/* ---------------------------------------------------------------- strip: the chips that fit + "+N" (winpages.js fit()) */
#winStrip.wp{gap:5px;padding-right:3px}
.wp-sc{flex:1;min-width:0;height:38px;display:flex;align-items:center;gap:5px;overflow:hidden;padding:0 1px}
.wp-chip[hidden]{display:none}

.wp-chip{flex:none;position:relative;height:34px;min-width:34px;min-height:0;padding:0;border-radius:11px;display:inline-flex;align-items:center;
  justify-content:center;gap:8px;background:var(--glass-1);border:1px solid var(--stroke);box-shadow:var(--hi);color:var(--text-1);
  font:600 13px/1 var(--font);-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;
  transition:transform var(--d-1) var(--ease-out),background-color var(--d-2),border-color var(--d-2)}
.wp-chip::after{content:"";position:absolute;inset:-3px -2px}                 /* 40px touch target (the toolbar's height) */
.wp-chip:active,.wp-chip.wp-down{transform:scale(.94)}
.wp-chip.on{background:var(--on-bg);border-color:var(--on-stroke);color:#fff}
.wp-svg{width:20px;height:20px;flex:none;fill:none;stroke:currentColor;stroke-width:1.75;stroke-linecap:round;stroke-linejoin:round}
.wp-desk,.wp-plus,.wp-ico{width:34px}
.wp-desk{color:var(--text-2)}
.wp-desk.on{color:#fff}
.wp-plus{flex:none;color:var(--accent-text)}
.wp-plus .wp-svg{width:20px;height:20px;stroke-width:1.9}
.wp-n{position:absolute;top:-4px;right:-5px;min-width:17px;height:16px;padding:0 4px;border-radius:9px;display:grid;place-items:center;
  background:var(--violet);color:#fff;font:700 10.5px/1 var(--font);font-style:normal;font-variant-numeric:tabular-nums;
  box-shadow:0 0 0 2px var(--bg,#070716);pointer-events:none}
.wp-n:empty{display:none}

/* icons: real Windows icons, or a tinted letter tile when the PC has none */
.wp-ic{width:22px;height:22px;flex:none;border-radius:6px;object-fit:contain;-webkit-user-drag:none}
.wp-ltr{display:inline-grid;place-items:center;font:700 12px/1 var(--font);color:#fff;letter-spacing:0;
  background:hsl(var(--h,250) 52% 40%);box-shadow:inset 0 0 0 1px rgba(255,255,255,.14)}
.wp-ico.min .wp-ic{opacity:.45}
.wp-ico.min::before{content:"";position:absolute;left:50%;bottom:3px;width:10px;height:2px;margin-left:-5px;border-radius:1px;background:var(--text-3)}

/* the active window: icon + title + app, never wider than the strip shows without scrolling */
.wp-act{max-width:min(176px,calc(100% - 42px));padding:0 11px 0 7px;gap:7px;justify-content:flex-start}
.wp-tx{display:flex;flex-direction:column;justify-content:center;gap:1px;min-width:0;text-align:left}
.wp-tx b{font:600 13px/1.15 var(--font);color:var(--text-1);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;letter-spacing:-.01em}
.wp-tx small{font:500 10.5px/1.15 var(--font);color:var(--text-2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.wp-act.pop{animation:wpPop var(--d-2) var(--ease-out)}
@keyframes wpPop{from{opacity:.35;transform:scale(.94)}}

/* ---------------------------------------------------------------- PC view overlay: edge bars (drag dwell = zoom out) */
.wp-ov{position:absolute;inset:0;z-index:8;pointer-events:none;border-radius:8px;overflow:hidden}
#v-screen:is(.land,.full) .wp-ov,#app.typing .wp-ov{display:none}
.wp-edge{position:absolute;top:50%;width:4px;height:46px;margin-top:-23px;border-radius:2px;background:var(--cyan);opacity:0;
  box-shadow:0 0 0 1px rgba(0,0,0,.45);transition:opacity var(--d-3) var(--ease-out)}
.wp-edge.l{left:3px}
.wp-edge.r{right:3px}
.wp-edge.dwell{animation:wpDwell 350ms linear forwards}
.wp-edge.tick{animation:wpTick .42s var(--ease-out) forwards}
@keyframes wpDwell{from{opacity:.35;transform:scaleY(.7)}to{opacity:1;transform:scaleY(3.6)}}
@keyframes wpTick{from{opacity:1;transform:scaleY(4.4)}to{opacity:0;transform:scaleY(1)}}
.wp-pic{width:16px;height:16px;flex:none;border-radius:4px;object-fit:contain}
.wp-pic.wp-ltr{font-size:9px}

/* ---------------------------------------------------------------- Screen 2's header line (#deckTabs, renderBar)
   [icon name ˅ ............ ○ • ━ • •]: one slim line right above Screen 2, the same on every page. The name opens the
   list of pages (hold on a window = its menu), a dot jumps there, a sideways swipe on the line pages. */
.dtabs{flex:none;position:relative;z-index:4;height:24px;display:flex;align-items:center;gap:6px;padding:0 1px 0 0;min-width:0;
  touch-action:none;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
.dtabs:empty{visibility:hidden}
.wp-tbtitle,.wp-tbdot{min-height:0;padding:0;border:0;background:none;box-shadow:none;color:var(--text-2);-webkit-tap-highlight-color:transparent}
.wp-tbtitle{flex:0 1 auto;min-width:0;max-width:calc(100% - 20px);height:24px;padding:0 6px 0 3px;border-radius:7px;display:inline-flex;align-items:center;gap:7px;position:relative;
  color:var(--text-1);font:600 12.5px/1 var(--font);letter-spacing:-.005em;transition:background-color var(--d-2)}
.wp-tbtitle::after{content:"";position:absolute;left:0;right:0;top:-6px;bottom:-4px}   /* 34px target, clear of the screens */
.wp-tbtitle b{min-width:0;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.wp-tbtitle.wp-down,.wp-tbtitle:active{background:var(--glass-2);transform:none}
.wp-tbtitle.wp-z b{color:var(--text-1)}
.wp-tbic{width:16px;height:16px;flex:none;border-radius:4px;object-fit:contain}
.wp-tbic.wp-ltr{font-size:9px}
.wp-tbtitle .wp-svg.wp-tbic{stroke-width:2.1;color:var(--accent-text)}
.wp-tbchev{width:14px;height:14px;flex:none;margin-left:-3px;color:var(--text-3);stroke-width:2.2}
.wp-tbzoom{flex:none;position:relative;min-height:0;height:24px;padding:0 9px 0 7px;border:0;border-radius:12px;display:inline-flex;align-items:center;gap:5px;
  background:var(--glass-2);box-shadow:inset 0 0 0 1px rgba(185,174,255,.22);color:var(--accent-text);font:600 12px/1 var(--font);-webkit-tap-highlight-color:transparent}
.wp-tbzoom::after{content:"";position:absolute;left:-3px;right:-3px;top:-6px;bottom:-4px}   /* 34px target, clear of the screens */
.wp-tbzoom .wp-svg{width:14px;height:14px;stroke-width:2.3}
.wp-tbzoom.wp-down,.wp-tbzoom:active{background:var(--glass-3);transform:none}
.wp-tbdots{margin-left:auto;flex:none;height:24px;display:flex;align-items:center;gap:0}
.wp-tbdot{flex:none;position:relative;width:15px;height:24px;display:grid;place-items:center}
.wp-tbdot::after{content:"";position:absolute;left:-1px;right:-1px;top:-6px;bottom:-4px}   /* bigger target, still clear of its neighbours */
.wp-tbdot i{width:6px;height:6px;border-radius:50%;background:rgba(255,255,255,.28);transition:transform var(--d-1) var(--ease-out),background-color var(--d-2)}
.wp-tbdot.wp-z i{width:7px;height:7px;background:none;box-shadow:inset 0 0 0 1.6px rgba(255,255,255,.42)}
.wp-tbdot.wp-down i,.wp-tbdot:active i{transform:scale(1.5);background:var(--accent-text)}
.wp-tbon{flex:none;width:16px;height:6px;margin:0 2px;border-radius:3px;background:var(--accent-text);box-shadow:0 0 8px rgba(185,174,255,.35)}
.wp-tbon.wp-z{width:14px}
.wp-tbcount{padding:0 6px;font:600 11.5px/1 var(--font);color:var(--text-3);font-variant-numeric:tabular-nums;white-space:nowrap}
/* the list of Screen 2's pages (pagesSheet) */
.wp-plist .wp-prow{min-height:56px}
.wp-prow .wp-htx{flex:1}
.wp-prow .wp-htx b{font:600 15px/1.25 var(--font);letter-spacing:-.01em}
.wp-prow .wp-htx small{font-size:12px}
.wp-pic2{width:28px;height:28px;flex:none;border-radius:7px;object-fit:contain}
.wp-pic2.wp-ltr{font-size:13px;border-radius:8px}
.wp-svg.wp-pic2{width:24px;height:24px;margin:0 2px;color:var(--accent-text)}
.wp-prow.on{background:var(--on-bg)!important}
.wp-pchk{width:20px!important;height:20px!important;flex:none;color:var(--accent-text)}

/* ---------------------------------------------------------------- Screen 2's window pages: pages 1.. of the Lens area
   .wp-tab is laid over the Lens (#lensPage is page 0); the pager slides both sideways inside Screen 2. The picture is a
   canvas (cropped from the PC view's canvas, or the live preview while the window is covered), with the true-size cursor. */
.wp-tab{position:absolute;inset:0;z-index:2;background:var(--scr2-bg,#0d0d13);touch-action:none;-webkit-user-select:none;user-select:none;
  -webkit-touch-callout:none;overflow:hidden}
.wp-tab[hidden]{display:none}
/* Screen 2's picture: its own css px size (winpages.js drawSlot), centred, so it never stretches while the screens glide */
.wp-tabcv{position:absolute;inset:0;margin:auto;width:100%;height:100%;display:block;pointer-events:none}
.wp-tab .pcur{z-index:4}
.wp-tab .locring{z-index:5}   /* the cursor's locator ring, while the cursor is on Screen 2 (main.js extended display) */
.wp-prev{position:absolute;right:10px;top:10px;z-index:6;height:22px;padding:0 9px 0 8px;border-radius:999px;display:inline-flex;align-items:center;gap:5px;
  background:var(--ink);border:1px solid var(--stroke-2);color:var(--text-2);font:600 11px/1 var(--font);letter-spacing:.01em;pointer-events:none}
.wp-prev i{width:6px;height:6px;border-radius:50%;background:var(--warn);box-shadow:0 0 6px rgba(251,191,36,.6)}
.wp-prev[hidden]{display:none}
.wp-tabph{position:absolute;inset:0;z-index:3;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;padding:16px;
  text-align:center;pointer-events:none;background:radial-gradient(70% 60% at 50% 45%,rgba(139,92,246,.10),transparent 70%)}
.wp-tabph[hidden]{display:none}
.wp-tabph b{max-width:100%;font:600 15px/1.25 var(--font);color:var(--text-1);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.wp-tabph small{font:500 12.5px/1.3 var(--font);color:var(--text-3)}
.wp-phic{width:40px;height:40px;border-radius:10px;object-fit:contain;margin-bottom:2px}
.wp-phic.wp-ltr{font-size:18px;border-radius:12px}
.wp-phic.wp-svg{width:30px;height:30px;color:var(--text-3)}
/* a window picture is not a magnifier: a plain frame instead of the Lens vignette; accent while a drag is over it */
#v-screen .lens.tabbed::after{box-shadow:inset 0 0 0 1px rgba(255,255,255,.10)}
#v-screen .lens:is(.wp-grab,.wp-drop)::after{box-shadow:inset 0 0 0 2px var(--accent-ring)}
#screenWrap.wp-drop::after{box-shadow:inset 0 0 0 2px var(--accent-ring)}
.wp-tabloupe{z-index:31}
#app.typing .wp-tabloupe,#v-screen:is(.land,.full) .wp-tabloupe{display:none}

/* ---------------------------------------------------------------- landscape pillar switcher (#landWin) */
.landwin .wp-lb2{width:40px;height:40px;min-width:0;border-radius:50%;background:rgba(255,255,255,.08);border-color:rgba(255,255,255,.11)}
.landwin .wp-lb2.on{background:var(--on-bg);border-color:var(--on-stroke)}
.landwin .wp-lb2.sw{color:var(--text-2)}
.landwin .wp-lb2 .wp-ic{width:22px;height:22px}

/* ---------------------------------------------------------------- context key page (the slim row's 3rd page) */
#v-screen .kpage .k.wp-ck{flex-direction:column;justify-content:center;gap:3px;padding:0 3px;overflow:hidden}
.wp-ck small{display:block;max-width:100%;font:600 9.5px/1.1 var(--font);color:var(--text-3);letter-spacing:0;white-space:nowrap;overflow:hidden;text-overflow:clip}
.wp-ck b{display:block;max-width:100%;font:600 11.5px/1.15 var(--font);color:var(--text-1);letter-spacing:-.01em;white-space:nowrap;overflow:hidden;text-overflow:clip}
.kpage.wp-pack.swap .wp-ck{animation:wpSwap var(--d-3) var(--ease-out)}
@keyframes wpSwap{from{opacity:0}}
#keysDots.wp-ctx i:nth-child(3):not(.on){background:var(--cyan);opacity:.6}

/* ---------------------------------------------------------------- sheets */
.wp-sheet{display:flex;flex-direction:column;gap:12px;min-width:0}
.wp-sheet .wp-svg{color:var(--accent-text)}
.wp-head{display:flex;align-items:center;gap:12px;min-width:0;margin-top:-2px}
.wp-hic{width:40px;height:40px;flex:none;border-radius:10px;object-fit:contain}
.wp-hic.wp-ltr{font-size:18px;border-radius:12px}
.wp-htx{display:flex;flex-direction:column;gap:2px;min-width:0;flex:1}
.wp-htx b{font:700 17px/1.25 var(--font-display);letter-spacing:-.015em;color:var(--text-1);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.wp-htx small{font:500 13px/1.3 var(--font);color:var(--text-3);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.wp-sheet .acts>button .wp-svg{width:21px;height:21px}
.wp-sheet .acts>button.danger{color:var(--bad-text)}
.wp-sheet .acts>button.danger .wp-svg{color:var(--bad-text)}
.wp-sheet .acts>button span{min-width:0;overflow:hidden;text-overflow:ellipsis}
.wp-grid2{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
.wp-tiles{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.wp-row.tile{min-height:74px;height:auto;padding:10px 4px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;
  border-radius:16px;background:var(--glass-1);border:1px solid var(--stroke);box-shadow:var(--hi);color:var(--text-1);
  font:600 12px/1.2 var(--font);text-align:center;white-space:normal;min-width:0}
.wp-row.tile .wp-svg{width:22px;height:22px}
.wp-row.tile:active{transform:scale(.96);background:var(--glass-2)}
.wp-row.tile.on{background:var(--on-bg);border-color:var(--on-stroke);color:#fff}
.wp-row.tile span{min-width:0;overflow-wrap:anywhere}
.wp-row[hidden]{display:none}
.wp-pseg button{font-size:14px}

/* picker */
.wp-hint{margin:0;color:var(--text-3);font:500 13px/1.4 var(--font)}
.wp-hint.on{color:var(--text-2)}
.wp-cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;min-width:0}
.wp-card{display:flex;flex-direction:column;height:auto;min-height:0;min-width:0;padding:0;border-radius:16px;overflow:hidden;text-align:left;
  background:var(--glass-1);border:1px solid var(--stroke);box-shadow:var(--hi);color:var(--text-1);transition:transform var(--d-1) var(--ease-out),border-color var(--d-2)}
.wp-card:active,.wp-card.wp-down{transform:scale(.97)}
.wp-card.cur{border-color:var(--on-stroke)}
.wp-card.picked{border-color:var(--accent-ring);box-shadow:0 0 0 1px var(--accent-ring)}
.wp-shot{position:relative;aspect-ratio:16/10;background:var(--bg-video);display:grid;place-items:center;overflow:hidden}
.wp-thumb{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;opacity:0;transition:opacity var(--d-2) var(--ease-out)}
.wp-shot.ok .wp-thumb{opacity:1}
.wp-shot.ok .wp-bigic{opacity:0}
.wp-bigic{width:40px;height:40px;border-radius:10px;object-fit:contain;transition:opacity var(--d-2)}
.wp-bigic.wp-ltr{font-size:18px}
.wp-minb,.wp-badge{position:absolute;height:22px;padding:0 9px;border-radius:999px;display:inline-flex;align-items:center;font:600 11px/1 var(--font)}
.wp-minb{left:8px;bottom:8px;background:var(--ink);border:1px solid var(--stroke-2);color:var(--text-2)}
.wp-badge{left:8px;top:8px;background:var(--violet);color:#fff;box-shadow:0 2px 8px rgba(0,0,0,.4)}
.wp-badge:empty{display:none}
.wp-cap{display:flex;align-items:center;gap:8px;padding:9px 10px 10px;min-width:0}
.wp-cic{width:18px;height:18px;flex:none;border-radius:5px;object-fit:contain}
.wp-cic.wp-ltr{font-size:10px}
.wp-cap .wp-htx b{font:600 13.5px/1.25 var(--font);letter-spacing:-.01em}
.wp-cap .wp-htx small{font-size:11.5px}
.wp-empty{grid-column:1/-1;margin:0;padding:22px 8px;text-align:center;color:var(--text-3);font-size:14px}

/* key pack editor */
.wp-pk{display:flex;flex-direction:column;border-radius:var(--r-lg);overflow:hidden;background:var(--glass-1);border:1px solid var(--stroke);box-shadow:var(--hi)}
.wp-pkrow{position:relative;display:flex;align-items:center;gap:12px;min-height:52px;padding:0 4px 0 14px;min-width:0}
.wp-pkrow+.wp-pkrow::before{content:"";position:absolute;top:0;left:14px;right:0;height:1px;background:var(--hairline)}
.wp-kc{flex:none;min-width:66px;height:30px;padding:0 9px;border-radius:9px;display:inline-grid;place-items:center;background:var(--glass-2);
  border:1px solid var(--stroke);box-shadow:var(--key-shadow);font:600 12.5px/1 var(--font);color:var(--text-1);white-space:nowrap}
.wp-pkl{flex:1;min-width:0;font:500 16px/1.25 var(--font);color:var(--text-1);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.wp-x{flex:none;width:44px;height:44px;min-height:0;padding:0;border:0;background:none;box-shadow:none;display:grid;place-items:center}
.wp-x .wp-svg{width:18px;height:18px;color:var(--text-3)}
.wp-pkbtns .btn .wp-svg{width:19px;height:19px}

.wp-ghost{position:fixed;left:-99px;top:0;width:1px;height:1px;opacity:0;pointer-events:none;overflow:hidden}

/* short phones (SE, 667pt): Screen 2's header line gets a little slimmer */
@media (max-height:700px) and (orientation:portrait){
  .dtabs,.wp-tbtitle,.wp-tbdots,.wp-tbdot,.wp-tbzoom{height:22px}
}
@media (prefers-reduced-motion:reduce){
  .wp-act.pop,.wp-edge.dwell,.wp-edge.tick,.kpage.wp-pack.swap .wp-ck{animation:none}
  .wp-edge,.wp-thumb,.wp-tbdot i,.wp-tbtitle{transition:none}
}
