/* InPlayWise — WC beta, DARK Glassnode-style design system.
   Dark tokens from the Figma "on dark" variable set (bg #131216, card #1D1C21,
   tertiary #333237, text #FFF/#8E8D90) + the shared risk palette. Clean, dense,
   calm cards with hairline borders and restrained spectrum accents.
   Fonts: TT Firs Neue across the platform. */
@font-face{font-family:'TT Firs Neue';src:url('Fonts/TT-Firs-Neue/TT Firs Neue Regular.ttf') format('truetype');font-weight:400;font-style:normal;font-display:swap}
@font-face{font-family:'TT Firs Neue';src:url('Fonts/TT-Firs-Neue/TT Firs Neue Medium.ttf') format('truetype');font-weight:500;font-style:normal;font-display:swap}
@font-face{font-family:'TT Firs Neue';src:url('Fonts/TT-Firs-Neue/TT Firs Neue DemiBold.ttf') format('truetype');font-weight:600;font-style:normal;font-display:swap}
@font-face{font-family:'TT Firs Neue';src:url('Fonts/TT-Firs-Neue/TT Firs Neue Bold.ttf') format('truetype');font-weight:700;font-style:normal;font-display:swap}

:root{
  /* surfaces (dark) */
  --white:#FFFFFF; --page:#0e0e16; --card:#16161f; --card-2:#1e1e2a; --elev:#2a2a3a;
  --line:rgba(255,255,255,.07); --line2:rgba(255,255,255,.12); --line3:rgba(255,255,255,.18);
  /* text */
  --ink:#FFFFFF; --muted:#8f97b0; --icon:#8f97b0;   /* T-200: #828aa3 measured 4.41:1 on the lightest dark card (#23243a) - just under the 4.5 bar, and it is the single most-used text token, so 10 of the lab's 12 remaining failures were this one value */ --invert:#0e0e16; --dim:rgba(255,255,255,.26);
  /* brand accent (indigo, brightened for dark) */
  --purple:#7C80EE; --purple-12:rgba(124,128,238,.22); --purple-08:rgba(124,128,238,.13);
  --purple-05:rgba(124,128,238,.08);
  /* accent by ROLE (see the light-mode block for why): in dark the tint is already readable both
     as ink and behind white text, so all three roles share one value here. */
  --accent-ink:var(--purple); --accent-fill:var(--purple);
  /* risk palette: solid fills + soft text-on-dark */
  --green:#50956C; --green-tx:#B1E7C7; --orange:#EB6847; --orange-tx:#F6B6A4;
  --blue:#4D5BDB; --blue-tx:#BCE3FB; --red:#FF5A57; --red-tx:#FF8E8B; --yellow:#ECDEC2;
  --amber:#E8B84B; --amber-tx:#F3D88B;
  --green-soft:#B1E7C7; --blue-soft:#BCE3FB;
  --green-bg:rgba(80,149,108,.20); --orange-bg:rgba(235,104,71,.22); --red-bg:rgba(255,90,87,.20);
  --amber-bg:rgba(232,184,75,.22); --blue-bg:rgba(77,91,219,.20);
  /* Variant-E tokens (ported from layout-lab lab.css :root so the E card composes without new palette) */
  --hi:#aab0f4; --hi-strong:#cdd0f8; --hi-soft:rgba(124,128,238,.14); --slate:#5358c8;
  --text:#eef0fe; --text-2:#bec4d7; --muted-2:#565d73;
  --good:#5fcf94; --warn:#d6a657; --loss:#e06a6a;
  --border:rgba(140,144,225,.16); --border-hi:rgba(152,156,238,.34); --inset:rgba(8,9,13,.55);
  --mono:'JetBrains Mono',ui-monospace,monospace;
  /* glassy card surfaces (no hard outline) */
  --glass:rgba(124,128,238,.10); --glass-2:rgba(124,128,238,.13); --glass-3:rgba(124,128,238,.17);
  /* per-state card tints (Matt: set upcoming / live / ended distinctly). up tracks the accent; live
     is green; ended is neutral. rgba is the fallback for engines without color-mix. */
  --card-up:rgba(124,128,238,.12); --card-up:color-mix(in srgb,var(--purple) 12%,transparent);
  --card-live:rgba(95,207,148,.12); --card-fin:rgba(130,138,163,.08);
  --glass-hi:inset 0 1px 0 rgba(255,255,255,.06); --glass-sh:0 10px 30px -16px rgba(0,0,0,.7);
  /* spectrum accent gradient */
  --spectrum:linear-gradient(90deg,#4D5BDB,#50956C,#7C80EE,#EB6847);
  /* effects */
  --shadow:0 1px 0 0 rgba(255,255,255,.02), 0 10px 28px -16px rgba(0,0,0,.7);
  --shadow-lg:0 28px 64px -20px rgba(0,0,0,.8), 0 0 0 1px rgba(255,255,255,.06);
  /* fonts */
  --head:'TT Firs Neue',system-ui,sans-serif;
  --body:'TT Firs Neue',system-ui,sans-serif;
  /* radius — squared to match the Market Finder (pills/avatars keep their own round) */
  --r:0; --r-sm:0; --r-lg:0; --r-xl:2px;
}
*{box-sizing:border-box;margin:0;padding:0}
/* RB10: clamp horizontal overflow at the root so mobile Safari never renders wider than the
   device (which forced a zoom-out). `clip` (not `hidden`) does NOT establish a scroll container,
   so position:sticky descendants keep working. */
html{overflow-x:clip;max-width:100%}
body{
  background:
    radial-gradient(1300px 900px at 50% -24%, rgba(96,100,210,.55), rgba(96,100,210,.18) 34%, transparent 58%),
    radial-gradient(620px 500px at 50% -8%, rgba(124,128,238,.22), transparent 60%),
    radial-gradient(760px 1300px at -10% 42%, rgba(96,100,210,.26), transparent 60%),
    radial-gradient(760px 1300px at 110% 58%, rgba(110,114,225,.22), transparent 60%),
    linear-gradient(180deg,#10131c 0%,#0a0c12 50%,#07080b 100%);
  background-attachment:fixed;
  color:var(--ink);font-family:var(--body);font-size:12px;line-height:1.4;-webkit-font-smoothing:antialiased}
a{color:inherit;text-decoration:none}
img{max-width:100%;display:block}

/* ── RB64: ONE canonical custom scrollbar (thin hover-reveal glass) ──────────
   Loaded by BOTH pages (index.html + market-finder.html both link theme.css),
   so the match page finally gets the same bars as the dashboard. Any scroll
   container that adds `ipw-scroll` (or is listed in the beta.css grouped rule)
   gets the identical transparent-until-hover white thumb — never the chunky
   native Windows bar. background-clip:content-box + the transparent border are
   what make the thumb thin/inset — don't drop them. */
.ipw-scroll{scrollbar-width:thin;scrollbar-color:transparent transparent}
.ipw-scroll:hover{scrollbar-color:rgba(255,255,255,.24) transparent}
.ipw-scroll::-webkit-scrollbar{width:8px;height:8px}
.ipw-scroll::-webkit-scrollbar-track{background:transparent}
.ipw-scroll::-webkit-scrollbar-thumb{background:transparent;border-radius:8px;border:2px solid transparent;background-clip:content-box}
.ipw-scroll:hover::-webkit-scrollbar-thumb{background:rgba(255,255,255,.18);background-clip:content-box}
.ipw-scroll::-webkit-scrollbar-thumb:hover{background:rgba(255,255,255,.34);background-clip:content-box}
/* light mode: the white thumb would vanish on light surfaces → use ink */
html[data-theme="light"] .ipw-scroll:hover{scrollbar-color:rgba(22,24,45,.28) transparent}
html[data-theme="light"] .ipw-scroll:hover::-webkit-scrollbar-thumb{background:rgba(22,24,45,.22);background-clip:content-box}
html[data-theme="light"] .ipw-scroll::-webkit-scrollbar-thumb:hover{background:rgba(22,24,45,.4);background-clip:content-box}

/* type scale */
.h1{font-family:var(--head);font-size:24px;line-height:28px;font-weight:700;letter-spacing:-.015em}
.h2{font-family:var(--head);font-size:14px;line-height:16px;font-weight:600;letter-spacing:-.01em}
.h3{font-family:var(--head);font-size:12px;line-height:14px;font-weight:600}
.body-m{font-size:12px;line-height:16px}
.body-s{font-size:12.5px;line-height:1.45}
.caption{font-size:12.5px;line-height:1.45;font-weight:500}
.muted{color:var(--muted)}

/* card — subtle glassy surface, no hard outline */
.card{background:var(--glass);border:1px solid rgba(124,128,238,.08);border-radius:var(--r);box-shadow:var(--glass-sh),var(--glass-hi),inset 0 0 44px rgba(124,128,238,.03);backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px)}

/* buttons */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;border:0;cursor:pointer;font-family:var(--body);font-weight:600;font-size:13px;padding:11px 20px;border-radius:var(--r);background:var(--purple);color:#fff;transition:filter .15s}
.btn:hover{filter:brightness(1.1)}
.btn.ghost{background:transparent;border:1px solid var(--line2);color:var(--ink)}
.btn.ghost:hover{background:rgba(255,255,255,.04)}
.btn.sm{padding:8px 14px;font-size:12px}

/* risk pills (Safe / Watch / Risky) — soft text on tinted fill (on dark) */
.pill{display:inline-flex;align-items:center;padding:3px 9px;border-radius:999px;font-size:10px;font-weight:600;line-height:1}
.pill.safe{background:var(--green-bg);color:var(--green-tx)}
.pill.risky{background:var(--orange-bg);color:var(--orange-tx)}
.pill.red{background:var(--red-bg);color:var(--red-tx)}

/* "available in full version" locked overlay */
.locked{position:relative}
.locked > .lk-content{filter:blur(5px);opacity:.6;pointer-events:none;user-select:none}
.lk-tag{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;text-align:center;z-index:2}
.lk-tag span{background:rgba(29,28,33,.82);border:1px solid var(--line2);box-shadow:var(--shadow);border-radius:999px;padding:8px 16px;font-size:11px;font-weight:600;color:var(--purple)}

/* modal / pop-up (glass card) */
.scrim{position:absolute;inset:0;background:rgba(5,6,10,.54);backdrop-filter:blur(10px) saturate(130%);-webkit-backdrop-filter:blur(10px) saturate(130%);display:flex;align-items:center;justify-content:center;z-index:50;padding:24px}
.modal{background:linear-gradient(155deg,rgba(25,27,42,.78),rgba(14,15,24,.58));border:0;border-radius:var(--r-xl);box-shadow:0 34px 90px -28px rgba(0,0,0,.92),inset 0 1px 0 rgba(255,255,255,.08),inset 0 -28px 70px rgba(124,128,238,.045);backdrop-filter:blur(28px) saturate(155%);-webkit-backdrop-filter:blur(28px) saturate(155%);width:100%;max-width:460px;padding:28px;text-align:center;position:relative}
.modal h3{font-family:var(--head);font-size:22px;font-weight:400;color:var(--ink)}
.modal .sub{color:var(--muted);font-size:12px;margin:6px 0 18px}
.modal .x{position:absolute;top:16px;right:16px;color:var(--muted);font-size:18px;cursor:pointer;background:none;border:0}
.modal-sym{display:block;margin:0 auto 14px;width:54px;height:31px;font-size:38px}
.modal-sym.sec-sym{margin-right:auto}
.field{width:100%;padding:12px 14px;background:rgba(255,255,255,.04);border:1px solid var(--line2);border-radius:var(--r);font-family:var(--body);font-size:13px;margin-bottom:10px;color:var(--ink)}
.field::placeholder{color:var(--muted)}
.google-signin{display:flex;justify-content:center;width:100%;min-height:44px;margin:14px 0 10px}
.google-signin>div{max-width:100%}
.google-fallback{width:100%;background:rgba(255,255,255,.08);color:var(--text-2)}
.auth-or{display:flex;align-items:center;gap:10px;margin:8px 0 12px;color:var(--muted);font:500 11px var(--body);text-transform:uppercase;letter-spacing:.08em}
.auth-or::before,.auth-or::after{content:"";height:1px;background:var(--line);flex:1}

/* beta tag */
.beta{display:inline-flex;align-items:center;gap:6px;background:var(--purple-08);color:var(--purple);border:1px solid var(--purple-12);border-radius:999px;padding:3px 10px;font-size:10px;font-weight:600;letter-spacing:.04em;text-transform:uppercase}

/* number with the TT Firs Neue ss03 alt figures */
.figure{font-family:var(--head);font-feature-settings:"ss03";font-weight:400}

/* ── GLOBAL GLASS NAV (shared contract — identical on every page) ───── */
/* RB67: ONE glass nav on both pages — full-bleed (direct <body> child so it spans the
   whole viewport, logo hard-left / controls hard-right), 64px, blurred glass. The match
   page previously overrode this inline + lived inside .wrap (which made it look inset) —
   that override is removed and its <header> moved out of .wrap so both bars are identical. */
.ipw-nav{position:sticky;top:0;z-index:46;display:flex;align-items:center;gap:14px;height:64px;padding:0 24px;
  background:rgba(17,18,26,.86);backdrop-filter:blur(20px) saturate(150%);-webkit-backdrop-filter:blur(20px) saturate(150%);
  border-bottom:1px solid rgba(255,255,255,.12);box-shadow:0 10px 34px rgba(0,0,0,.34)}
.ipw-brand{display:flex;align-items:center;gap:10px;text-decoration:none;color:inherit}
.ipw-logo-img{height:20px;width:auto;display:block}
/* B7-1: one logo per theme/hover state. Dark (default) = white wordmark; light = purple wordmark;
   hovering the logo in DARK mode swaps to the bright-purple version (light mode stays purple). */
.ipw-brand .logo-light,.ipw-brand .logo-hover{display:none}
html[data-theme="light"] .ipw-brand .logo-dark{display:none}
html[data-theme="light"] .ipw-brand .logo-light{display:block}
.ipw-brand:hover .logo-dark{display:none}
.ipw-brand:hover .logo-hover{display:block}
html[data-theme="light"] .ipw-brand:hover .logo-hover{display:none}
html[data-theme="light"] .ipw-brand:hover .logo-light{display:block}
.ipw-mark{width:30px;height:30px;display:grid;place-items:center;background:linear-gradient(150deg,#aab0f4,#5358c8);box-shadow:0 5px 14px rgba(124,128,238,.45)}
.ipw-mark svg{width:17px;height:17px}
.ipw-word{font-family:var(--head);font-weight:700;font-size:15px;letter-spacing:.05em}
.ipw-grow{flex:1}
/* RB7: in-nav section links — base layout only; the Variant-E block below re-styles these
   into the signed-off centred flat-column cluster with the neon active underline. */
.ipw-navlinks{display:flex;align-items:center;gap:2px}
.ipw-navlinks a{font-size:12.5px;font-weight:600;color:var(--muted,#8E8D90);text-decoration:none;white-space:nowrap}
.ipw-acct{display:flex;align-items:center;gap:9px;border:1px solid rgba(255,255,255,.12);background:rgba(255,255,255,.04);padding:5px 13px 5px 6px;border-radius:999px;cursor:pointer;color:inherit;font-family:inherit;transition:.15s}
.ipw-acct:hover{border-color:rgba(124,128,238,.4);background:rgba(124,128,238,.1)}
.ipw-acct-name{font-size:12.5px;font-weight:600}
.ipw-acct.guest-login{padding:7px 13px;border-color:var(--purple-12);background:var(--purple-08);color:var(--ink)}
.ipw-acct.guest-login:hover{border-color:rgba(124,128,238,.5);background:var(--purple-12)}
.ipw-acct.guest-login .ipw-av,.ipw-acct.guest-login .ipw-acct-bal,.ipw-acct.guest-login .ipw-lux{display:none}
.ipw-acct.guest-login .ipw-acct-name{display:inline;font-weight:700}
/* RB20: play-money balance in the chip — accent + tabular; stays visible on mobile (avatar + amount) */
.ipw-acct-bal{font-size:12.5px;font-weight:800;color:#aab0f4;font-variant-numeric:tabular-nums;white-space:nowrap}
.ipw-acct-bal:empty{display:none}
.ipw-acct.lux .ipw-acct-bal{color:#f0d99a}
.ipw-av{width:30px;height:30px;border-radius:50%;display:grid;place-items:center;font-size:12px;font-weight:700;color:#fff;background:linear-gradient(150deg,#7C80EE,#5358c8)}
/* RB7: luxury treatment for the top tier (WC Pass) — gold crown + shimmer */
.ipw-lux{display:none;align-items:center;color:#e8c66a}
.ipw-lux svg{width:15px;height:15px}
.ipw-acct.lux{border-color:rgba(232,198,106,.55);background:linear-gradient(120deg,rgba(232,198,106,.10),rgba(124,128,238,.06))}
.ipw-acct.lux .ipw-lux{display:inline-flex;animation:luxShimmer 2.6s ease-in-out infinite}
.ipw-acct.lux .ipw-av{background:linear-gradient(150deg,#e8c66a,#b8902f);color:#161a26;box-shadow:0 0 0 1px rgba(232,198,106,.5),0 4px 12px rgba(232,198,106,.35)}
.ipw-acct.lux .ipw-acct-name{color:#f0d99a}
@keyframes luxShimmer{0%,100%{opacity:1;transform:translateY(0) rotate(0)}50%{opacity:.7;transform:translateY(-1px) rotate(-6deg)}}
@media (prefers-reduced-motion:reduce){.ipw-acct.lux .ipw-lux{animation:none}}
/* on narrow screens the floating dock provides section navigation — hide the in-nav links to avoid overflow */
@media (max-width:760px){
  /* .ipw-nav prefix matches the E block's specificity so the centred links still hide on mobile */
  .ipw-nav .ipw-navlinks,.ipw-navlinks{display:none}
  /* RB21: shrink the wordmark on mobile + show just the profile icon (the £balance is added with RB20) */
  .ipw-logo-img{height:13px}
  .ipw-acct .ipw-acct-name{display:none}
  .ipw-acct{padding:4px}
  /* RB67: slightly shorter glass nav on mobile so it doesn't eat the viewport */
  .ipw-nav{height:56px;padding:0 14px;gap:8px}
}

/* ── VARIANT-E NAV SIGN-OFF ─────────────────────────────────────────────
   Keeps the nav's current 64px height, sticky position and full-bleed width.
   Adds: a tier lockup (logo → faint gradient divider → "World Cup 26 /
   Exclusive Access" gold chip) beside the brand; a centred link cluster with
   a neon glowing-purple underline on the active item (KEEPS the existing
   hover-tint animation, inverted in light mode); a welcome-back label +
   avatar; a flat, aligned bookmaker/theme/account control cluster. */
.ipw-nav .nav-lockup{display:flex;align-items:center;gap:12px;flex:0 0 auto}
.ipw-nav .brand-div{width:1px;height:26px;flex:0 0 auto;
  background:linear-gradient(180deg,transparent,rgba(255,255,255,.18) 22%,rgba(255,255,255,.18) 78%,transparent)}
/* Matt B7-review #17: centre both lines ("World Cup 26" / "Exclusive Access") within the chip. */
.ipw-nav .tier-chip{display:flex;flex-direction:column;justify-content:center;align-items:center;padding:2px 12px;
  border:1px solid rgba(232,198,106,.4);background:rgba(232,184,75,.10);border-radius:var(--r);
  font:700 10px/1.2 var(--head);letter-spacing:.04em;color:#e8c66a;text-align:center;white-space:nowrap;
  text-shadow:0 0 10px rgba(232,184,75,.28)}
.ipw-nav .tier-chip .l2{font-weight:600;font-size:8.5px;letter-spacing:.09em;text-transform:uppercase;color:#d8b768}
/* CENTRED link cluster (matches the signed-off lab E): absolutely centred in the bar,
   full-height flat column links (no rounded tint pill) with a NEON glowing-purple
   underline on the active item. Overrides the base RB7 inline/tinted .ipw-navlinks. */
.ipw-nav .ipw-navlinks{position:absolute;left:50%;transform:translateX(-50%);
  display:flex;align-items:stretch;gap:8px;height:100%}
.ipw-nav .ipw-navlinks a{display:flex;flex-direction:column;justify-content:center;position:relative;
  padding:0 12px;font:600 12.5px var(--body);color:var(--muted);background:transparent;border-radius:0}
.ipw-nav .ipw-navlinks a:hover{color:var(--ink);background:transparent}
.ipw-nav .ipw-navlinks a.on{color:var(--ink);background:transparent}
/* B7-41 item 14: the active-nav underline colour matches the "Discovery" text in "Opportunity
   Discovery" — that <b> is .panel-title b {color:var(--purple)}, so use the same token here. */
.ipw-nav .ipw-navlinks a.on::after{content:"";position:absolute;left:8px;right:8px;bottom:0;height:2px;
  background:var(--purple);
  box-shadow:0 0 8px rgba(124,128,238,.9),0 0 16px rgba(124,128,238,.55)}
/* flat right-side control cluster — one aligned baseline (32px controls, matches lab E) */
.ipw-nav .nav-cluster{display:flex;align-items:center;gap:10px;flex:0 0 auto}
.ipw-nav .nav-div{width:1px;height:24px;background:var(--line2);flex:0 0 auto}
.ipw-nav .nav-welcome{font:400 12px var(--body);color:var(--muted);white-space:nowrap}
.ipw-nav .nav-welcome b{font-weight:700;color:var(--text-2)}
@media (max-width:900px){.ipw-nav .nav-welcome,.ipw-nav .brand-div,.ipw-nav .tier-chip{display:none}}
@media (max-width:760px){.ipw-nav .nav-div{display:none}}

/* ── Matt B7-review #13: mobile hamburger + slide-in drawer ─────────────────
   Desktop nav unchanged. ≤760px: hide the centred link cluster (it overlapped the
   control cluster), show the burger; the drawer holds the links + theme/bookmaker/account. */
.ipw-burger{display:none;width:38px;height:34px;flex:0 0 auto;align-items:center;justify-content:center;
  border:1px solid var(--line2);background:transparent;border-radius:var(--r);color:var(--text-2);cursor:pointer;padding:0;margin-left:6px}
.ipw-burger:hover{border-color:rgba(124,128,238,.4);color:var(--ink)}
.ipw-burger-lines{display:flex;flex-direction:column;gap:4px;width:18px}
.ipw-burger-lines i{display:block;height:2px;width:100%;background:currentColor;border-radius:1px;transition:transform .2s,opacity .2s}
.ipw-burger.on .ipw-burger-lines i:nth-child(1){transform:translateY(6px) rotate(45deg)}
.ipw-burger.on .ipw-burger-lines i:nth-child(2){opacity:0}
.ipw-burger.on .ipw-burger-lines i:nth-child(3){transform:translateY(-6px) rotate(-45deg)}
@media(prefers-reduced-motion:reduce){.ipw-burger-lines i{transition:none}}

.ipw-navdrawer-scrim{position:fixed;inset:0;z-index:1090;background:transparent;
  opacity:0;transition:opacity .2s;backdrop-filter:none;-webkit-backdrop-filter:none}
.ipw-navdrawer-scrim.on{opacity:1}
.ipw-navdrawer{position:fixed;top:58px;right:10px;bottom:auto;z-index:1091;width:min(230px,calc(100vw - 20px));
  display:flex;flex-direction:column;gap:4px;padding:8px;
  background:rgba(17,18,26,.94);border:1px solid var(--line2);border-radius:var(--r-xl);
  box-shadow:0 18px 42px -18px rgba(0,0,0,.76);
  transform:translateY(-8px);opacity:0;pointer-events:none;transition:opacity .18s,transform .18s}
.ipw-navdrawer.on{transform:none;opacity:1;pointer-events:auto}
@media(prefers-reduced-motion:reduce){.ipw-navdrawer{transition:none}}
.ipw-navdrawer-links{display:flex;flex-direction:column;gap:2px}
.ipw-navdrawer-links a{display:flex;align-items:center;padding:10px 11px;border-radius:var(--r);
  font:500 13px var(--body);color:var(--text-2);text-decoration:none;border:1px solid transparent}
.ipw-navdrawer-links a:hover{color:var(--ink);background:var(--glass-2)}
.ipw-navdrawer-links a.on{color:var(--ink);border-color:var(--border-hi);background:var(--glass-2)}
.ipw-navdrawer-controls{display:none}
/* controls moved into the drawer sit full-width and readable (they carry their own handlers) */
.ipw-navdrawer-controls .ipw-acct{width:100%;justify-content:flex-start}
.ipw-navdrawer-controls .ipw-theme-toggle,
.ipw-navdrawer-controls .ipw-bookbtn{align-self:flex-start}
@media (max-width:760px){
  .ipw-nav .ipw-navlinks{display:none}
  .ipw-burger{display:inline-flex}
}
@media (min-width:761px){
  /* safety: never show the drawer/burger on desktop even if state lingers */
  .ipw-burger{display:none}
  .ipw-navdrawer,.ipw-navdrawer-scrim{display:none}
}
/* light-mode inversions (existing dashboard toggles data-theme=light on <html>) */
html[data-theme="light"] .ipw-nav .brand-div{background:linear-gradient(180deg,transparent,rgba(22,24,45,.20) 22%,rgba(22,24,45,.20) 78%,transparent)}
html[data-theme="light"] .ipw-nav .tier-chip{color:#a9811f;border-color:rgba(169,129,31,.4);background:rgba(232,184,75,.12);text-shadow:none}
html[data-theme="light"] .ipw-nav .tier-chip .l2{color:#b8902a}
html[data-theme="light"] .ipw-nav .nav-welcome{color:#4c5064}
html[data-theme="light"] .ipw-nav .nav-welcome b{color:#2a2e45}
html[data-theme="light"] .ipw-navdrawer{background:rgba(255,255,255,.96);box-shadow:0 18px 42px -18px rgba(70,78,150,.42)}
/* B7-41 item 14: match the "Discovery" text colour (var(--purple)) in light mode too. */
html[data-theme="light"] .ipw-navlinks a.on::after{background:var(--purple);box-shadow:0 0 8px rgba(91,33,182,.45),0 0 16px rgba(91,33,182,.22)}
/* KEEP the existing hover tint (inverted for light already handled by var-driven bg); active item drops the
   filled bg in favour of the neon underline for both themes. */

/* Matt R7/R8: subtle animated light/dark switch. R8 rework — the R7 version transitioned EVERY element
   (thousands of style recalcs = terrible on slower machines). Now it is ONE cheap composited animation:
   the page fades in from ~55% opacity over 380ms after the flip. Single property, single layer, no
   per-element work. Reduced-motion = instant switch. */
@media not (prefers-reduced-motion: reduce){
  html.theme-anim body{animation:themeXfade .38s ease}
}
@keyframes themeXfade{from{opacity:.55}to{opacity:1}}

/* tooltip — light-ink chip on dark (inverted for contrast on dark UI) */
/* Matt R7: tooltip sizing +30% globally (10/14 -> 13/18, padding + width up to match). */
.ipw-tip{position:absolute;z-index:1000;max-width:312px;background:#2A2930;color:#fff;border:1px solid var(--line2);border-radius:8px;padding:10px 13px;font-family:var(--body);font-size:13px;line-height:18px;box-shadow:0 14px 32px -10px rgba(0,0,0,.7);pointer-events:none;animation:tipin .12s ease}
@keyframes tipin{from{opacity:0;transform:translateY(2px)}to{opacity:1;transform:none}}
.ipw-tip-t{font-weight:400}
.ipw-tip-meter{display:flex;align-items:center;gap:2px;margin-top:6px}
.ipw-tip-state{border:1px solid rgba(255,255,255,.3);border-radius:16px;padding:4px 10px;font-size:10.5px;font-weight:500;text-transform:uppercase;margin-right:2px;white-space:nowrap}
.ipw-tip-meter i{width:18px;height:1px;border-radius:2px;background:rgba(255,255,255,.25)}
.ipw-tip-meter i.on{background:var(--green-soft)}
.info{display:inline-flex;align-items:center;justify-content:center;width:12px;height:12px;border-radius:50%;border:1px solid currentColor;font-size:8px;font-style:normal;line-height:1;opacity:.6;cursor:help;vertical-align:middle}
/* section-heading info affordance — larger, tappable target for the custom tooltip (hover + tap) */
.ipw-tiptrigger{cursor:help}
.ipw-tiptrigger .info{width:15px;height:15px;font-size:9px;opacity:.5;transition:opacity .15s,color .15s}
.ipw-tiptrigger:hover .info,.ipw-tiptrigger .info:hover{opacity:1;color:var(--purple)}

/* ── Market Finder cohesion — squarer cards + lit indigo edges ──────── */
.panel,.opp-match,.stat-card,.acca-card,.acca-build{
  border:1px solid rgba(124,128,238,.10);
  box-shadow:var(--glass-sh),var(--glass-hi),inset 0 0 46px rgba(124,128,238,.035);
}
.stat-card:hover,.opp-match:hover{
  border-color:rgba(124,128,238,.28);
  box-shadow:var(--glass-sh),var(--glass-hi),0 0 22px rgba(124,128,238,.12);
}
/* indigo accent rail on panel headers (echoes the match page's lit edges) */
.panel-h{position:relative}
.panel-h::before{content:"";position:absolute;left:0;top:15px;bottom:13px;width:2px;background:linear-gradient(180deg,var(--purple),transparent);opacity:.65}
.opp-risk span.on{box-shadow:0 0 13px rgba(124,128,238,.22)}
/* live status keeps the warm flash; upcoming gets the indigo tint */
.stat-card.live{box-shadow:var(--glass-sh),var(--glass-hi),inset 0 0 46px rgba(255,90,87,.05)}
/* headings in line with the Market Finder: Sora, bolder, tighter */
.panel-title{font-weight:700;letter-spacing:-.015em}
.modal h3{font-family:var(--head);font-weight:700;letter-spacing:-.01em}

/* ── T9: theme toggle button (nav) — moon in dark, sun in light ─────────── */
.ipw-theme-toggle{display:inline-grid;place-items:center;width:34px;height:34px;border-radius:999px;border:1px solid var(--line2);background:transparent;color:var(--muted);cursor:pointer;transition:.15s;flex:0 0 auto;margin-right:2px}
.ipw-theme-toggle:hover{color:var(--ink);border-color:rgba(124,128,238,.4);background:rgba(124,128,238,.08)}
.ipw-theme-toggle svg{width:17px;height:17px}
.ipw-theme-toggle .ico-sun{display:none}
html[data-theme="light"] .ipw-theme-toggle .ico-moon{display:none}
html[data-theme="light"] .ipw-theme-toggle .ico-sun{display:block}

/* ── T9: LIGHT MODE (opt-in via the nav toggle; default stays dark) ─────── */
html[data-theme="light"]{
  --page:#eef0f8; --card:#ffffff; --card-2:#f3f4fb; --elev:#e6e8f4;
  --purple:#a1d4e8; --purple-12:rgba(161,212,232,.22); --purple-08:rgba(161,212,232,.13); --purple-05:rgba(161,212,232,.08);   /* Matt's final light palette (picked in the studio) */
  /* T-197 (Matt 2026-07-30) — ONE token was behind every light-mode readability complaint.
     #a1d4e8 is a pale TINT: correct behind cards and borders, unreadable the moment it is used as
     text on white ("Discovery", "Dial") or as a fill under white text ("Generate accumulator", the
     SCANNING/WATCHING pills). The accent had three jobs and only one safe value, so the roles are
     now separate tokens. --purple keeps Matt's chosen tint for decoration; text and fills use the
     deep same-hue variant, which clears 4.5:1 both as ink on white and behind white text.
     Dark mode sets both to --purple, where it was always readable. */
  --accent-ink:#10627e; --accent-fill:#10627e;
  /* RB69: stronger hairlines + darker text/dim so light mode isn't washed-out */
  --line:rgba(22,24,45,.12); --line2:rgba(22,24,45,.18); --line3:rgba(22,24,45,.26);
  --ink:#12141f; --muted:#4c5064; --icon:#4c5064; --invert:#ffffff; --dim:rgba(22,24,45,.52);
  /* card tint DERIVES from --purple (color-mix) so changing the accent recolours the cards; the
     rgba line before each is the static fallback for engines without color-mix (Matt). */
  --glass:rgba(91,33,182,.12); --glass:color-mix(in srgb,var(--purple) 12%,transparent);
  --glass-2:rgba(91,33,182,.16); --glass-2:color-mix(in srgb,var(--purple) 16%,transparent);
  --glass-3:rgba(91,33,182,.20); --glass-3:color-mix(in srgb,var(--purple) 20%,transparent);
  /* per-state card tints (Matt) — more distinct in light mode; up tracks the accent, live green, ended neutral */
  --card-up:color-mix(in srgb,#a5e9ee 15%,transparent);          /* Matt's final: cyan upcoming */
  --card-live:color-mix(in srgb,#f56200 14%,transparent);        /* Matt's final: orange live */
  --card-fin:rgba(106,112,137,.11);
  --glass-hi:inset 0 1px 0 rgba(255,255,255,.9); --glass-sh:0 12px 30px -16px rgba(70,78,150,.28);
  --shadow:0 1px 0 0 rgba(22,24,45,.03),0 12px 28px -16px rgba(70,78,150,.28);
  --shadow-lg:0 28px 64px -20px rgba(70,78,150,.4),0 0 0 1px rgba(22,24,45,.07);
  --green-tx:#1f8a54; --red-tx:#d64545; --orange-tx:#c8501f; --amber-tx:#ae5b5b; --blue-tx:#2f5bd0;   /* Matt's final: extreme tone */
  --green-soft:#1f8a54; --blue-soft:#2f5bd0;
  /* Variant-E tokens re-toned for light mode (readable on white surfaces) */
  --hi:#5400db; --hi-strong:#3d0a9e; --hi-soft:rgba(84,0,219,.14); --slate:#3d0a9e;   /* Matt's final highlight */
  --text:#1a1c2b; --text-2:#3a3f57; --muted-2:#6a7089;
  --good:#1f8a54; --warn:#a9811f; --loss:#d64545;
  --border:rgba(91,33,182,.20); --border:color-mix(in srgb,var(--purple) 20%,transparent);
  --border-hi:rgba(91,33,182,.38); --border-hi:color-mix(in srgb,var(--purple) 38%,transparent);
  --inset:rgba(91,33,182,.05); --inset:color-mix(in srgb,var(--purple) 5%,transparent);
}
html[data-theme="light"] body{background:
  radial-gradient(1200px 800px at 50% -20%, rgba(124,128,238,.20), transparent 52%),
  radial-gradient(700px 1100px at -8% 40%, rgba(124,128,238,.10), transparent 60%),
  linear-gradient(180deg,#f7f8fd 0%,#eef0f8 55%,#e7e9f5 100%);background-attachment:fixed}
html[data-theme="light"] .ipw-nav{background:rgba(255,255,255,.82);backdrop-filter:blur(20px) saturate(140%);-webkit-backdrop-filter:blur(20px) saturate(140%);border-bottom:1px solid rgba(22,24,45,.14);box-shadow:0 10px 30px rgba(70,78,150,.12)}
html[data-theme="light"] .ipw-word{color:#161826}
html[data-theme="light"] .ipw-acct{border-color:rgba(22,24,45,.14);background:rgba(22,24,45,.03)}
html[data-theme="light"] .ipw-acct:hover{border-color:rgba(91,33,182,.4);background:rgba(91,33,182,.08)}
html[data-theme="light"] .field{background:rgba(22,24,45,.04)}
html[data-theme="light"] .btn.ghost{color:#161826}
html[data-theme="light"] .btn.ghost:hover{background:rgba(22,24,45,.05)}
html[data-theme="light"] .modal{background:linear-gradient(155deg,rgba(255,255,255,.86),rgba(247,248,255,.66));border:0;box-shadow:0 34px 90px -30px rgba(83,88,200,.34),inset 0 1px 0 rgba(255,255,255,.9)}
html[data-theme="light"] .lk-tag span{background:rgba(255,255,255,.9)}
