/* ============================================================
   pon-ux.css  —  Template LIST + Drawer UX (v19)
   ============================================================ */

/* ---- HYBRID v52: the inline question flow IS the generator landing.
   The old card-list/drawer hide rules are disabled so the version-A
   inline UI (template + variant pickers, qText, mcqArea, action
   buttons, solution) shows directly on landing. The drawer/library
   is still available on demand via the "Browse all types" button. ---- */

/* template card list hidden everywhere; drawer opens on-demand only.
   !important because a later layout rule sets #ponListView to display:flex. */
#ponListView { display:none !important; }
/* bulletproof: never show the template list while the PYQ tab is active */
body.pyq-active #ponListView { display:none !important; }
/* lighter weight for PYQ question text (especially English) */
.q-card.pon-ux-pyq #qText { font-weight: 400; }

/* prevent background scroll while drawer open */
body.pon-drawer-locked { overflow:hidden; }

/* ============================================================
   TEMPLATE LIST
   ============================================================ */
#ponListView { margin-top:14px; display:flex; flex-direction:column; gap:10px; }
.pon-list-hint{ color:var(--muted); font-size:12px; margin:2px 2px 12px; }

.pon-li{
  display:flex; align-items:center; gap:12px;
  margin-bottom:8px;
  position:relative;
  padding:13px 14px; border-radius:12px;
  background:var(--glass); border:1px solid var(--stroke);
  cursor:pointer; transition:transform .18s var(--t), border-color .18s var(--t), background .18s var(--t);
}
.pon-li:hover{ transform:translateY(-2px); border-color:var(--glass-2); background:var(--glass-2); }
.pon-li:active{ transform:translateY(0) scale(.995); }

.pon-li-badge{
  flex:0 0 auto; font-weight:600; font-size:16px;
  color:var(--muted); letter-spacing:.2px;
}
.pon-li-main{ flex:1 1 auto; min-width:0; }
.pon-li-name{ font-weight:500; font-size:14px; color:var(--ink); line-height:1.25; padding-right:54px; }
.pon-li-meta{ margin-top:4px; display:flex; flex-wrap:wrap; gap:6px; }
.pon-chip{
  font-size:11px; font-weight:600; padding:2px 8px; border-radius:999px;
  background:rgba(255,255,255,.06); border:1px solid var(--stroke); color:var(--muted);
}
.pon-chip.att{ color:var(--gold); border-color:rgba(255,214,107,.4); background:rgba(255,214,107,.08); }
.pon-li-chev{ flex:0 0 auto; width:22px; height:22px; color:var(--muted); }
.pon-li-chev svg{ width:100%; height:100%; }
.pon-li-tier{
  position:absolute; top:0; right:0;
  font-size:10px; font-weight:700; letter-spacing:.3px;
  padding:3px 9px; border-radius:0 12px 0 8px; color:var(--p2);
  background:rgba(34,211,238,.1);
  border:1px solid rgba(34,211,238,.3);
  border-top-width:0; border-right-width:0; /* merge with card's top-right corner; only left+bottom stroke show */
}
.pon-li-tier.tier-10{ color:#22c55e; background:rgba(34,197,94,.12); border-color:rgba(34,197,94,.4); }
.pon-li-tier.tier-12{ color:#f59e0b; background:rgba(245,158,11,.12); border-color:rgba(245,158,11,.4); }
.pon-li-tier.tier-grad{ color:#ef4444; background:rgba(239,68,68,.12); border-color:rgba(239,68,68,.4); }

/* ============================================================
   DRAWER (full-screen overlay)
   ============================================================ */
/* dim backdrop behind the right-side drawer */
#ponBackdrop{
  position:fixed; inset:0; z-index:1290;
  background:rgba(4,6,16,.6); backdrop-filter:blur(2px);
  opacity:0; visibility:hidden;
  /* CLOSE: Material 3 emphasized-ACCELERATE -> quick fade-out */
  transition:opacity .26s cubic-bezier(.3,0,.8,.15), visibility .26s cubic-bezier(.3,0,.8,.15);
}
/* OPEN: Material 3 emphasized-DECELERATE -> soft fade-in (matches the drawer) */
#ponBackdrop.open{ opacity:1; visibility:visible; transition:opacity .42s cubic-bezier(.05,.7,.1,1), visibility .42s cubic-bezier(.05,.7,.1,1); }

/* right-side sliding drawer (mounted on <body>) */
#ponDrawer{
  position:fixed; top:0; right:0;
  height:100%; height:100dvh;
  width:min(460px, 94vw); z-index:1300;
  display:flex; flex-direction:column;
  background:linear-gradient(180deg,var(--bg),var(--bg2));
  border-left:1px solid var(--stroke);
  /* shadow only while open — otherwise the off-screen drawer's left-cast shadow
     leaks a faint dark gradient onto the right edge of the screen */
  box-shadow:none;
  transform:translateX(100%);
  /* CLOSE (exit): Material 3 emphasized-ACCELERATE -> quick, decisive slide out (~260ms) */
  transition:transform .26s cubic-bezier(.3,0,.8,.15);
  will-change:transform;
}
/* OPEN (enter): Material 3 emphasized-DECELERATE -> snappy take-off + very soft landing (~440ms).
   Research: M3 emphasized easing (snappy start, soft stop) is the desktop-class standard;
   Radix/iOS sheets use the same asymmetric model (slow-in on open, fast-out on close). */
#ponDrawer.open{ transform:translateX(0); box-shadow:-26px 0 70px -22px rgba(0,0,0,.75); transition:transform .44s cubic-bezier(.05,.7,.1,1); }

/* ===== desktop (>=1025px): drawer becomes a CENTERED POPUP / MODAL =====
   Width == the header/app container width; it ZOOMS in from small (scale) like a modal,
   pinned near the top. Mobile + iPad keep the right-side slide-in drawer above. */
@media (min-width:1025px){
  #ponBackdrop{ background:rgba(4,6,16,.74); backdrop-filter:blur(4px); }
  #ponDrawer{
    top:18px; bottom:auto; left:50%; right:auto;
    width:min(600px, calc(100vw - 36px));    /* == the MCQ content container width (.grid/header.top = 600px, centered) */
    height:auto; max-height:calc(100vh - 36px);
    border:1px solid var(--stroke);
    border-radius:22px;
    box-shadow:0 40px 120px -28px rgba(0,0,0,.82), 0 12px 48px -24px rgba(0,0,0,.6);
    overflow:hidden;                          /* clip rounded corners; .pon-db scrolls inside */
    transform-origin:50% 50%;
    transform:translateX(-50%) scale(.72);
    opacity:0;
    pointer-events:none;                      /* don't block the page while hidden */
    /* CLOSE (exit): quick zoom-out */
    transition:transform .2s cubic-bezier(.3,0,.8,.15), opacity .2s cubic-bezier(.3,0,.8,.15);
  }
  #ponDrawer.open{
    transform:translateX(-50%) scale(1);
    opacity:1;
    pointer-events:auto;
    /* OPEN (enter): emphasized-decelerate zoom-in (popup) */
    transition:transform .4s cubic-bezier(.05,.7,.1,1), opacity .4s cubic-bezier(.05,.7,.1,1);
  }
}

/* sticky header */
.pon-dh{
  flex:0 0 auto;
  display:flex; align-items:center; gap:10px;
  padding:12px 12px; padding-top:max(12px,env(safe-area-inset-top));
  background:rgba(11,16,32,.92); backdrop-filter:blur(14px);
  border-bottom:1px solid var(--stroke);
}
.pon-dh-btn{
  flex:0 0 auto; height:38px; min-width:38px; padding:0 10px;
  display:inline-flex; align-items:center; gap:5px; justify-content:center;
  border-radius:12px; border:1px solid var(--stroke); background:var(--glass);
  color:var(--ink); font-weight:600; font-size:13px; cursor:pointer;
  transition:background .15s var(--t), transform .15s var(--t);
}
.pon-dh-btn svg{ width:18px; height:18px; }
.pon-dh-btn:hover{ background:var(--glass-2); }
.pon-dh-btn:active{ transform:scale(1.06); }
.pon-dh-btn[disabled]{ opacity:.35; pointer-events:none; }
.pon-dh-x{ }
.pon-dh-nav{ }
.pon-dh-title{ flex:1 1 auto; text-align:center; min-width:0; }
.pon-dh-title b{ display:block; font-size:12px; font-weight:500; color:var(--muted); }
.pon-dh-title span{ display:block; font-size:13px; font-weight:600; color:var(--ink); margin-top:1px;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.pon-dh-nav-label{ display:inline; }
@media (max-width:420px){ .pon-dh-nav-label{ display:none; } }

/* scrollable body — BLOCK layout so cards never shrink/clip */
.pon-db{
  flex:1 1 auto; min-height:0;
  overflow-y:auto; -webkit-overflow-scrolling:touch;
  padding:14px 12px calc(40px + env(safe-area-inset-bottom));
  display:block;
  /* mobile-first: keep scroll action but hide the scrollbar (users just swipe) */
  scrollbar-width:none;
  -ms-overflow-style:none;
}
.pon-db::-webkit-scrollbar{ width:0; height:0; display:none; }

/* spring on the toggle-type buttons too (drawer nav + solution expand/collapse) */
.pon-dh-btn, .vx-sol-x, .vx-btn, .pon-li-chev{
  transition: transform var(--spring-dur, .55s) var(--spring, cubic-bezier(.34,1.4,.5,1)) !important;
}

/* desktop (>800px): show a dark-blue themed scrollbar */
@media (min-width:801px){
  .pon-db{ scrollbar-width:thin; scrollbar-color:#3b56a8 rgba(20,28,56,.55); }
  .pon-db::-webkit-scrollbar{ width:10px; height:10px; display:block; }
  .pon-db::-webkit-scrollbar-track{ background:rgba(20,28,56,.55); border-radius:8px; }
  .pon-db::-webkit-scrollbar-thumb{
    background:linear-gradient(180deg,#3b56a8,#27407e);
    border-radius:8px; border:2px solid transparent; background-clip:padding-box;
  }
  .pon-db::-webkit-scrollbar-thumb:hover{ background:#4a66c0; }
}

/* ---- variant card ---- */
.vx{
  display:block; height:auto; min-height:0; max-height:none;  /* full natural height */
  margin:0 0 16px;
  border:1px solid var(--stroke); border-radius:16px;
  background:var(--glass); overflow:hidden;
}
.vx:last-child{ margin-bottom:0; }
/* head = small badge + muted type label, with a thin divider below before the question */
.vx-head{ display:flex; align-items:center; gap:7px; padding:12px 14px 9px; border-bottom:1px solid var(--stroke); }
.vx-badge{
  flex:0 0 auto; width:18px; height:18px; border-radius:5px;
  display:grid; place-items:center; font-weight:700; font-size:11px; color:#fff;
  background:linear-gradient(135deg,var(--p3),var(--p1));
}
/* type + variant name: muted, no accent colour — question is the hero */
.vx-type{ font-weight:600; font-size:12px; color:var(--muted); line-height:1.3; padding-top:0; }
.vx-type i{ color:var(--muted); font-style:normal; font-weight:600; }

.vx-q{ padding:11px 16px 10px; font-size:14px; font-weight:600; line-height:1.55; color:#ffffff; word-break:break-word; }
.vx-opts{ padding:4px 16px 12px; display:grid; grid-template-columns:1fr 1fr; gap:9px; }
@media (max-width:520px){ .vx-opts{ grid-template-columns:1fr; } }
.vx-opt{
  text-align:left; padding:10px 12px; border-radius:11px; cursor:pointer;
  border:1px solid var(--stroke); background:transparent;
  color:var(--ink); font-size:13px; line-height:1.4; transition:background .14s var(--t), border-color .14s var(--t), opacity .14s var(--t);
  display:flex; align-items:flex-start; gap:8px;
}
.vx-opt .v{ flex:1 1 auto; min-width:0; white-space:normal; word-break:break-word; }
.vx-opt .k{ flex:0 0 auto; font-weight:800; color:var(--muted); font-size:12px; line-height:1.5; }
.vx-opt:hover{ background:var(--glass-2); }
.vx-opt.correct{ border-color:var(--ok); background:rgba(34,197,94,.16); color:#bbf7d0; }
.vx-opt.wrong{ border-color:var(--bad); background:rgba(239,68,68,.16); color:#fecaca; }
.vx-opt.locked{ pointer-events:none; }
.vx-opt.dim{ opacity:.5; }

/* ---- buttons row (all three always fit) ---- */
.vx-btns{ display:flex; align-items:stretch; gap:8px; padding:6px 16px 16px; }
.vx-btn{
  height:42px; padding:0 10px; border-radius:12px; border:1px solid var(--stroke);
  background:var(--glass); color:var(--ink); font-weight:700; font-size:12px;
  cursor:pointer; display:inline-flex; align-items:center; justify-content:center; gap:6px;
  min-width:0; white-space:nowrap;
  transition:background .15s var(--t), transform .12s var(--t), border-color .15s var(--t);
}
.vx-btn span{ overflow:hidden; text-overflow:ellipsis; }
.vx-btn:hover{ background:var(--glass-2); }
.vx-btn:active{ transform:scale(1.05); }
.vx-btn svg{ flex:0 0 auto; width:16px; height:16px; }
.vx-hint-btn{ flex:1 1 0; }
.vx-sol-btn{ flex:1.5 1 0; background:linear-gradient(135deg,rgba(124,92,255,.22),rgba(34,211,238,.18)); border-color:rgba(124,92,255,.4); }
.vx-sol-btn .chev{ display:inline-flex; align-items:center; }

/* dice (middle) — simple 2D die, icon only */
.vx-dice{
  flex:0 0 52px; width:52px; padding:0;
  display:flex; align-items:center; justify-content:center;
  overflow:hidden;
}
.vx-dice .die{ width:26px; height:26px; display:block; }
.vx-dice.rolling .die{ animation:pon-dice-roll .42s ease; }
@keyframes pon-dice-roll{
  0%{ transform:rotate(0) scale(1); }
  50%{ transform:rotate(180deg) scale(1.12); }
  100%{ transform:rotate(360deg) scale(1); }
}

/* ---- hint inline ---- */
.vx-hintbox{
  margin:0 14px 12px; padding:10px 12px; border-radius:12px;
  background:rgba(255,214,107,.08); border:1px solid rgba(255,214,107,.32);
  color:var(--gold); font-size:13px; line-height:1.5;
}
.vx-hintbox b{ color:var(--gold); }
/* per-variant attempted indicator (drawer) */
.vx-attempt{ display:none; padding:0 16px 12px; margin-top:-4px; font-size:11px; font-style:italic; line-height:1.4; color:#ffd66b; }
.vx-attempt.vx-attempt-warn{ color:#fca5a5; }

/* ============================================================
   INLINE SOLUTION (within a variant) — animated height
   ============================================================ */
/* solution panel — dark navy-blue background, animated height */
.vx-solution{
  border-top:0; background:rgba(14,20,50,.97);
  max-height:0; overflow:hidden;
  transition:max-height .42s cubic-bezier(.34,1.3,.5,1); /* bounce on expand/collapse */
}
.vx-solution.expanded{ border-top:1px solid rgba(124,92,255,.28); /* divider only while open */ }

/* solution header (sticky) — NO question repeat, just the close button */
.vx-sol-head{
  position:sticky; top:0; z-index:6;
  background:rgba(14,20,50,.99); backdrop-filter:blur(12px);
  border-bottom:1px solid rgba(124,92,255,.2);
  padding:9px 12px; display:flex; align-items:center; justify-content:flex-end;
}
.vx-sol-x{
  flex:0 0 auto; width:30px; height:30px; border-radius:9px;
  border:1px solid var(--stroke); background:var(--glass); color:var(--ink);
  cursor:pointer; display:grid; place-items:center;
}
.vx-sol-x svg{ width:16px; height:16px; }
.vx-sol-x:active{ transform:scale(1.08); }

.vx-sol-body{ padding:14px 14px 16px; background:rgba(14,20,50,.97); }
.vx-sol-body .sol-step{ margin:0; padding:0; background:transparent; border-left:0; border-radius:0; white-space:normal; font-size:13px; line-height:1.7; color:var(--ink); }
.vx-sol-body .sol-step strong{ display:block; color:#a78bfa; margin-bottom:3px; font-size:13px; }
/* muted 'Step N:' prefix inside step bodies */
.vx-sol-body .sol-step-n{ color:var(--muted); opacity:.55; font-weight:600; }
.vx-sol-body .sol-formula{ background:rgba(124,92,255,.12); border-left:3px solid var(--p1); padding:8px 10px; border-radius:8px; margin:6px 0; }
.vx-sol-body .sol-calc{ background:rgba(34,211,238,.1); border-left:3px solid var(--p2); padding:8px 10px; border-radius:8px; margin:6px 0; font-variant-numeric:tabular-nums; }
.vx-sol-shortcut{
  margin-top:10px; padding:11px 13px; border-radius:12px;
  background:rgba(34,197,94,.1); border:1px solid rgba(34,197,94,.32);
  color:#bbf7d0; font-size:13px; line-height:1.55;
}
.vx-sol-shortcut b{ color:var(--ok); }

.vx-collapse{ overflow:hidden; }

/* subtle bounce-in for the variant solution body when it expands */
@keyframes solPop {
  0%   { opacity:0; transform:translateY(6px) scale(.99); }
  60%  { opacity:1; transform:translateY(0) scale(1.012); }
  100% { transform:translateY(0) scale(1); }
}
.vx-solution.expanded .vx-sol-body{ animation:solPop .42s cubic-bezier(.34,1.56,.64,1); }

/* ============================================================
   REQUEST 12 — mobile-first restructure
   ============================================================ */
/* Number Size slider: HIDDEN (kept in DOM + backend live, recall later) */
#numSizeControls { display:none !important; }

/* PYQ keeps the OLD UI: hide the generator template/variant pickers */
.q-card.pon-ux-pyq #tplPicker,
.q-card.pon-ux-pyq #varPicker { display:none !important; }

/* Horizontal divider above PYQ questions (PYQ mode only) */
.pyq-divider { display:none; }
.q-card.pon-ux-pyq .pyq-divider{
  display:block; height:0; border:0;
  border-top:1px solid var(--stroke);
  margin:0 0 14px;
}

/* REQUEST 12b: inline template number ('# 1.') on the same line as the name */
.pon-li-num{ color:var(--muted); font-weight:600; margin-right:2px; }








/* ===== HYBRID v64 — softer search-box focus border + even narrower battery on mobile ===== */

/* the tabs card (Question Setup / PYQ) keeps its own rectangle; remove the seam */
body:not(.pyq-active) #modeCard{ padding-bottom:0 !important; border-bottom-color:transparent !important; }
body:not(.pyq-active) .capsule-tabs{ margin-bottom:0 !important; }
/* 8px gap between tabs rectangle and the header pill (just the 8px flex gap, no extra padding) */
body:not(.pyq-active) .q-card{ padding-top:0 !important; }

/* ---- header: the whole template part is ONE big rounded-rectangle pill ---- */
.hyb-header{
  display:flex; flex-direction:column; align-items:stretch; gap:0;
  margin:0 0 12px; padding:0; border-bottom:none;
}
#hybNum{ display:none !important; }
/* the pill: [<]  (20px)  full-width clickable dropdown zone  (20px)  [>] -- fully round capsule */
.hyb-title-row{
  display:flex; align-items:center; justify-content:space-between; gap:20px;
  width:100%;
  background:rgba(255,255,255,.06); border:1px solid var(--stroke); border-radius:999px;
  padding:5px 6px;
}
.hyb-arrow{
  flex:none; display:inline-flex; align-items:center; justify-content:center;
  width:30px; height:30px; padding:0;
  background:transparent; border:none; color:var(--muted);
  border-radius:999px; cursor:pointer; transition:background .15s, color .15s, transform .08s;
}
.hyb-arrow:hover{ background:rgba(255,255,255,.10); color:var(--ink); }
.hyb-arrow:active{ transform:scale(.92); }
/* center is the large clickable dropdown area: clicking anywhere here opens the picker */
.hyb-center{ flex:1 1 auto; min-width:0; display:flex; justify-content:center; }
.hyb-center #tplPicker{ display:flex; width:100%; margin:0; max-width:100%; min-width:0; }
.hyb-center .tpl-picker-trigger{
  background:transparent !important; border-color:transparent !important;
  padding:4px 4px; color:var(--ink);
  width:100%; max-width:100%; min-width:0;
  display:flex; align-items:center; justify-content:center;
  cursor:pointer;
}
.hyb-center .tpl-picker-trigger:hover,
.hyb-center .tpl-picker-trigger.active{
  background:transparent !important; border-color:transparent !important; color:#fff;
}
.hyb-tplnum{ flex:none; font-size:12px; font-weight:600; color:var(--muted); margin-right:6px; }
.hyb-center #tplLabel{
  font-size:14px; font-weight:500; text-align:center;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; min-width:0;
}
.hyb-center .tpl-picker-trigger .tpl-chevron{ margin-left:6px !important; flex:none; }
.hyb-center .tpl-picker-trigger .tpl-chevron svg{ width:16px !important; height:16px !important; }

/* ---- variant line: italic + one weight lighter, tight gap to question ---- */
.hyb-varrow{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  margin:0 0 2px; padding:0;
}
#hybVarText{ font-size:13px; font-weight:500; font-style:italic; color:var(--muted); line-height:1.3; min-width:0; }
#hybVarText .hyb-type{ color:rgba(166,176,214,.55); font-weight:600; margin-right:2px; }
#hybVarText .hyb-vname{ color:rgba(166,176,214,.62); font-weight:400; }
.hyb-browse{
  flex:none; display:inline-flex; align-items:center; justify-content:center;
  width:32px; height:32px; padding:0;
  background:transparent; border:1px solid transparent; color:rgba(166,176,214,.62);
  border-radius:9px; cursor:pointer; transition:background .15s, color .15s;
}
.hyb-browse:hover{ background:rgba(255,255,255,.08); color:var(--ink); }
.hyb-browse:active{ transform:scale(.94); }

/* +6px breathing room between the question and the options */
body:not(.pyq-active) #qText{ margin-bottom:18px; }
#qText.attempted{ color:#a78bfa; }
/* template line in the question card (shown only when header collapsed; see light.css) */
.hyb-tplline{ display:none; font-size:10px; font-weight:400; font-style:italic; line-height:1.3; color:rgba(166,176,214,.52); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; margin:0; }
/* ── MOBILE ONLY (<=640px) collapsed-header: template name + variant name stack ──
   Desktop layout (variant shown in the header pill) is unaffected — these stacked
   lines only exist on mobile. Tweaks requested:
   - +4px gap between the template-name line and the variant-name line
   - both lines 10% less opaque (opacity 1 -> .9)
   - variant name 1px smaller (13px -> 12px) */
@media (max-width:640px){
  .hyb-tplline{ margin-bottom:4px; opacity:.9; }
  #hybVarText{ font-size:12px; opacity:.9; }
}
/* attempted hint line: appears under the question once attempted, above the options */
.q-attempted{ display:none; font-size:10px; font-style:italic; line-height:1.35; color:#ffd66b; margin:0 0 18px; }
#qText.attempted + .q-attempted{ display:block; }
body:not(.pyq-active) #qText.attempted{ margin-bottom:8px; }

/* ---- options: lighter inner fill (~50% less opacity than v60) ---- */
#mcqArea .opt{ background:rgba(0,0,0,.12); }
#mcqArea .opt:hover{ background:rgba(0,0,0,.07); }
#mcqArea .opt.correct{ background:rgba(34,197,94,.16); }
#mcqArea .opt.wrong{ background:rgba(239,68,68,.14); }
/* option keys (a)(b)(c)(d): not bright blue -- same as numbers (ink) but muted 30% */
#mcqArea .opt-label{ color:rgba(234,240,255,.7) !important; }

/* ---- nav row ---- */
.hyb-nav-row{
  display:grid; grid-template-columns:1fr auto 1fr; align-items:center;
  gap:8px; margin:16px 0 10px;
}
.hyb-nav-btn{ display:inline-flex; align-items:center; justify-content:center; gap:5px; padding:11px 14px; width:100%; }
.hyb-nav-btn svg{ width:18px; height:18px; }
#hybPrevBtn{ justify-self:stretch; }
#hybNextBtn{ justify-self:stretch; }
.hyb-dice{
  justify-self:center; flex:none;
  width:52px; height:46px; padding:0;
  display:flex; align-items:center; justify-content:center; overflow:hidden;
  background:var(--glass); border:1px solid var(--stroke);
  border-radius:14px; cursor:pointer; transition:background .15s, transform .08s;
}
.hyb-dice:hover{ background:var(--glass-2); }
.hyb-dice:active{ transform:scale(1.06); }
.hyb-dice .die{ width:28px; height:28px; display:block; }
.hyb-dice.rolling .die{ animation:pon-dice-roll .42s ease; }

body:not(.pyq-active) #challengeTopRow{ display:none !important; }
body.pyq-active #hybNav{ display:none !important; }
#varPicker{ display:none !important; }

.q-card.pon-ux-pyq .hyb-header,
.q-card.pon-ux-pyq .hyb-varrow,
.q-card.pon-ux-pyq .hyb-nav-row,
body.pyq-active .hyb-header,
body.pyq-active .hyb-varrow,
body.pyq-active .hyb-nav-row{ display:none !important; }

/* ---- template dropdown: wider, centred ---- */
.hyb-center #tplDropdown{
  width:600px; max-width:92vw; min-width:0;
  left:50%; right:auto; transform:translateX(-50%);
}

/* ---- tier SECTIONS: header band starts each tinted block; more top padding ---- */
.tpl-list .tpl-group-label{
  padding:12px 14px 8px; margin:0;
  border-top:1px solid var(--stroke);
  font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.5px;
  color:var(--muted); cursor:default;
}
.tpl-list .tpl-group-label:first-child{ border-top:none; }
.tpl-list .tpl-group-label.t-10, .tpl-list .tpl-item.tpl-row.t-10{ background:rgba(34,197,94,.07); }
.tpl-list .tpl-group-label.t-12, .tpl-list .tpl-item.tpl-row.t-12{ background:rgba(245,158,11,.07); }
.tpl-list .tpl-group-label.t-g,  .tpl-list .tpl-item.tpl-row.t-g{ background:rgba(239,68,68,.07); }

/* ---- flat rows: left name + right battery; light low-opacity divider between ALL rows ---- */
.tpl-list .tpl-item.tpl-row{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  margin:0; padding:9px 14px;
  border:none; border-bottom:1px solid rgba(255,255,255,.05); border-radius:0;
  transition:background .12s, box-shadow .12s;
}
.tpl-list .tpl-item.tpl-row:last-child{ border-bottom:none; }
.tpl-list .tpl-item.tpl-row.t-10:hover{ background:rgba(34,197,94,.14); }
.tpl-list .tpl-item.tpl-row.t-12:hover{ background:rgba(245,158,11,.14); }
.tpl-list .tpl-item.tpl-row.t-g:hover{ background:rgba(239,68,68,.14); }
.tpl-list .tpl-item.tpl-row.selected{ box-shadow:inset 3px 0 0 var(--p2); }
.tplr-name{ flex:1 1 auto; min-width:0; font-size:13px; font-weight:500; color:var(--ink); line-height:1.3; }
.tplr-meta{ flex:none; display:flex; align-items:center; justify-content:flex-end; }
.tplc-bat{
  position:relative; flex:none; width:61px; height:7px;
  border:1px solid var(--stroke); border-radius:4px;
  background:rgba(255,255,255,.05); overflow:hidden;
}
.tplc-bat-fill{ display:block; height:100%; width:0; border-radius:3px 0 0 3px; transition:width .25s ease; }
.tplc-bat.b-part .tplc-bat-fill{ background:var(--gold); }
.tplc-bat.b-full .tplc-bat-fill{ background:#22c55e; }

/* drawer attempted card dims its question */
.vx.answered .vx-q{ color:#a78bfa; }

/* search box: keep it subtle; on focus (incl. the auto-focus on open) only a faint blue, not bright cyan */
.tpl-search:focus{ border-color:rgba(34,211,238,.4) !important; box-shadow:none !important; }

/* mobile: even narrower variant battery (2px less than desktop) */
@media (max-width:820px){
  .tplc-bat{ width:59px; }
}

/* ============================================================
   DESIGN SYSTEM v65 — uniform type scale, uniform control radii,
   WCAG-audited contrast, refined surfaces. Structure/logic unchanged.
   ============================================================ */
:root{
  /* refined, "expensive" surfaces: softer borders, subtler fills */
  --stroke: rgba(255,255,255,.13);
  --glass: rgba(255,255,255,.06);
  --glass-2: rgba(255,255,255,.11);
  /* type scale (snapped, no half-steps) */
  --fs-2xs:10px; --fs-xs:11px; --fs-sm:12px; --fs-base:13px;
  --fs-md:14px; --fs-lg:16px; --fs-xl:20px; --fs-2xl:24px;
  /* radius scale */
  --r-xs:6px; --r-sm:8px; --r-md:10px; --r-lg:12px; --r-pill:999px;
  /* white-safe accent end (replaces bright cyan beneath white text) */
  --accent-blue:#4f7cf5;
}

/* ---- uniform roundness for rectangular action controls ---- */
.btn{ border-radius:var(--r-lg) !important; }
.opt{ border-radius:var(--r-lg) !important; }
.tpl-search{ border-radius:var(--r-md) !important; }
.hyb-dice{ border-radius:var(--r-lg) !important; }

/* ---- CONTRAST FIX: white text must never land on bright cyan ----
   white on #22d3ee ~1.5:1 (FAIL)  ->  white on #4f7cf5 ~3.8:1 (AA bold/large) */
.btn{
  background:linear-gradient(135deg, var(--p1), var(--accent-blue));
  box-shadow:0 8px 24px rgba(79,124,245,.40), inset 0 1px 0 rgba(255,255,255,.18);
}
.capsule-ind{
  background:linear-gradient(135deg, var(--p1) 0%, #5b8bff 55%, var(--accent-blue) 100%);
  box-shadow:0 8px 22px -8px rgba(79,124,245,.6), inset 0 1px 0 rgba(255,255,255,.25);
}
.tag.exam{ background:linear-gradient(135deg, var(--accent-blue), var(--p1)); }

/* ---- micro-label legibility (kept clearly muted, just readable: ~3.9:1) ---- */
#hybVarText .hyb-type{ color:rgba(166,176,214,.62) !important; }

/* ============================================================
   FOCUS FIX v66 - remove white focus outline/border on native
   dropdowns & controls (exam select, language select, pickers)
   ============================================================ */
.dd:focus, .dd:focus-visible,
.q-lang-select:focus, .q-lang-select:focus-visible,
.tpl-picker-trigger:focus, .tpl-picker-trigger:focus-visible,
select:focus, select:focus-visible{
  outline:none !important;
  box-shadow:none !important;
  border-color:var(--stroke) !important;
}

/* Divider between consecutive solution steps */
.sol-divider{ border:0; height:1px; background:rgba(255,255,255,0.10); margin:12px 0; }

/* Mobile: question text size 14px */
@media (max-width: 640px){
  #qText{ font-size: 14px !important; }
}

/* ============================================================
   MOBILE FULL-BLEED v67 — phone view becomes one edge-to-edge page:
   no outer padding, no card radius / side borders, with single
   divider lines between heading | tabs | question. The solution
   opens as a top-anchored drawer with a close button (no need to
   scroll to the bottom of the page to read it).
   ============================================================ */
@media (max-width: 640px){
  /* 1) remove the gap between the background and the containers */
  .app{ padding:0 0 56px !important; }
  .grid{ gap:0 !important; }

  /* 2) full-width edge-to-edge surfaces; no rounding, no side borders */
  header.top{
    margin-bottom:0 !important;
    border:0 !important; border-bottom:1px solid var(--stroke) !important;
    border-radius:0 !important; box-shadow:none !important;
  }
  #modeCard{
    border:0 !important; border-bottom:1px solid var(--stroke) !important;
    border-radius:0 !important; box-shadow:none !important;
  }
  .q-card{
    border:0 !important; border-radius:0 !important; box-shadow:none !important;
  }

  /* tighter side padding so the question wraps in fewer lines */
  .card, .q-card{ padding-left:14px !important; padding-right:14px !important; }

  /* decorative animated glow ring looks wrong on a full-bleed page */
  .q-card::before{ display:none !important; }

  /* the card's backdrop-filter creates a containing block that traps the
     position:fixed solution drawer inside the card (so it didn't cover the
     header). Removing it lets the drawer become truly full-screen. */
  .q-card{ -webkit-backdrop-filter:none !important; backdrop-filter:none !important; }

  /* checkbox container ends 12px below the tier checkboxes; the gap to the pill
     section collapses to 0 so the two surfaces meet (24px total: 12 + 0 + 12) */
  header.top{ padding-bottom:12px !important; margin-bottom:0 !important; }
  /* 16px space above the Question Setup / PYQ pill */
  #modeCard{ padding-top:16px !important; padding-bottom:22px !important; }
  /* PYQ tab: the year scroll should rest ~20px above the seam divider -- the
     same gap that sits between that divider and the exam tag below it */
  body.pyq-active #modeCard{ padding-bottom:20px !important; }
  /* +8px between the "Profit & Loss" heading and the checkbox row (both modes) */
  .bottom-row{ gap:18px !important; }

  /* uniform full-screen colour: the same flat tone follows all the way to the
     bottom (no "cut" where a card ends and the body gradient shows through) */
  body{ background:#0b1020 !important; }
  header.top, #modeCard, .q-card{ background:#0b1020 !important; }
}

/* ---- Solution as a RIGHT-SIDE mobile drawer (fixed ✕/Back header + scrollable body) ----
   Desktop: wrappers collapse (display:contents) so the inline solution is unchanged.
   The header (✕ + Back) and the question recap only appear in the mobile drawer. */
.sol-drawer{ display:contents; }
.sol-drawer-body{ display:contents; }
.sol-drawer-head{ display:none; }
.sol-qrecap{ display:none; }

@media (max-width: 640px){
  /* backdrop: dim the page so it stays faintly visible behind the drawer */
  .solution.show{
    position:fixed; inset:0; z-index:1000;
    margin:0 !important; border:0 !important; padding:0 !important;
    background:rgba(4,6,16,.55);
    -webkit-backdrop-filter:blur(2px); backdrop-filter:blur(2px);
    display:flex !important; justify-content:flex-end;
    animation:solBackdropIn .25s ease;
  }
  /* the panel slides in from the right and leaves a strip on the left */
  .sol-drawer{
    display:flex !important; flex-direction:column;
    width:calc(100% - 16px); max-width:none; height:100%;
    background:linear-gradient(180deg,#0b1020 0%,#0a0f25 100%);
    box-shadow:-14px 0 44px rgba(0,0,0,.55);
    border-left:1px solid var(--stroke);
    animation:solDrawerInRight .3s cubic-bezier(.34,1.1,.64,1);
  }
  /* fixed header block: ✕ + Back, with a divider line beneath it */
  .sol-drawer-head{
    display:flex !important; align-items:center; gap:10px; flex:none;
    padding:12px 14px;
    border-bottom:1px solid var(--stroke);
    background:rgba(255,255,255,.03);
  }
  .sol-back-text{ font-size:15px; font-weight:700; color:var(--ink); }
  .sol-close{
    display:flex !important; align-items:center; justify-content:center;
    position:static; width:34px; height:34px; padding:0; margin:0;
    border-radius:9px; border:1px solid var(--stroke);
    background:var(--glass-2); color:var(--ink);
    font-size:16px; line-height:1; cursor:pointer;
  }
  /* scrollable content beneath the fixed header (question recap + steps) */
  .sol-drawer-body{
    display:block !important; flex:1 1 auto; min-height:0;
    overflow-y:auto; -webkit-overflow-scrolling:touch;
    padding:16px 16px calc(28px + env(safe-area-inset-bottom));
  }
  /* "Step-by-step Solution" heading: smaller + accent colour (like the A,B,C,D markers) */
  #solTitle{ margin-top:0; font-size:14px !important; color:#a78bfa !important; }

  /* question + 4 read-only options recap at the top of the drawer */
  .sol-qrecap{ display:block !important; margin-bottom:6px; }
  .sol-qrecap .sol-q{
    font-size:15px; line-height:1.6; color:var(--ink); font-weight:600; margin-bottom:10px;
  }
  /* options on ONE wrapping line: "1. ₹1120,  2. ₹1300, ..." (read-only) */
  .sol-qrecap .sol-opts{
    font-size:14px; line-height:1.9; color:rgba(234,240,255,.82);
  }
  .sol-qrecap .sol-opt{ display:inline; white-space:nowrap; }
  .sol-qrecap .sol-opt-n{ color:#a78bfa; font-weight:700; margin-right:3px; }
  .sol-qrecap-divider{ border:0; height:1px; background:var(--stroke); margin:12px 0; }

  /* ---- Solution steps: dissolve the boxed background entirely ---- */
  /* no card background, no left stroke, no padding/radius — just plain text */
  .sol-drawer-body .sol-step{
    background:none !important; border:0 !important; border-left:0 !important;
    border-radius:0 !important; padding:0 !important; margin:0 !important;
    color:rgba(234,240,255,.85);
  }
  .sol-drawer-body #solutionSteps{ margin:16px 0 0 !important; }
  /* 16px gap below the "Step-by-step Solution" heading before Step 1 */
  .sol-drawer-body #solTitle{ margin-bottom:16px !important; }
  /* horizontal line between consecutive steps */
  .sol-drawer-body .sol-divider{ margin:16px 0 !important; background:var(--stroke) !important; }
  /* after all steps: gap + horizontal line, then the Shortcut block */
  .sol-drawer-body #shortcutTitle{
    margin-top:18px !important; padding-top:18px !important;
    border-top:1px solid var(--stroke) !important;
  }
}
@keyframes solBackdropIn{ from{ opacity:0; } to{ opacity:1; } }
@keyframes solDrawerInRight{ from{ transform:translateX(100%); } to{ transform:translateX(0); } }

/* feedback / hint / wrong-answer / solution-gate notifications: smaller text +
   toned-down weight (regular instead of bold). Both are style/size tweaks ->
   applies to BOTH themes. */
.feedback{ font-size:12px !important; font-weight:500 !important; }

/* ============================================================
   MOBILE v108 — STICKY HEADER CARD (chaitanya feedback)
   The whole top section (back + language + heading + tier chips) becomes a
   contained, rounded card pinned to the top. The Question Setup / PYQ section
   and the question scroll UP behind it (header has the highest z-index + an
   opaque background so nothing shows through).
   Structural (padding / border shape / sticky / 12px gap) -> BOTH modes.
   Colour (purple fill + stroke tone) -> light only (see light.css); dark keeps
   its original opaque page tone.
   ============================================================ */
@media (max-width:640px){
  header.top{
    position:sticky !important; top:8px !important; z-index:60 !important;
    margin:8px 10px 0 !important;           /* keep top + sides; no OUTER bottom gap (modeCard top padding spaces it) */
    padding:12px !important;                /* 12px inner padding on all 4 sides (incl. the gap below the chips) */
    border:1px solid var(--stroke) !important;
    border-bottom:1px solid var(--stroke) !important;
    border-radius:16px !important;
    box-shadow:0 10px 26px -16px rgba(0,0,0,.55) !important;
    background:#0b1020 !important;          /* dark: opaque page tone (unchanged) */
  }
}
