/* PipAtlas theme layer v1 (v18.22.0) — light + dark on top of the Toolkit brand layer.
   Loaded after pa-brand.css by paThemeLayer(); off switch: env PA_THEME=off.
   Light keeps the Toolkit look. Dark uses the same emerald brand on a deep navy base.
   pa-theme.js maps any colour a page hard-codes; this file covers the shared structures. */

:root{
  --t-bg:#ffffff; --t-bg2:#f8fafc; --t-card:#ffffff; --t-elev:#ffffff;
  --t-line:#e2e8f0; --t-line2:#eef0f3;
  --t-text:#0f172a; --t-text2:#334155; --t-muted:#64748b;
  --t-acc:#047857; --t-acc-hi:#065f46; --t-acc-bg:#ecfdf5; --t-acc-line:#a7f3d0;
  --t-focus:#047857;
  --t-shadow:0 1px 2px rgba(15,23,42,.06),0 4px 14px rgba(15,23,42,.05);
  --t-radius:12px;
  color-scheme:light;
}
html[data-theme="dark"]{
  --t-bg:#0b1220; --t-bg2:#0f1729; --t-card:#121c2e; --t-elev:#172338;
  --t-line:#253349; --t-line2:#1c283c;
  --t-text:#e7edf5; --t-text2:#b6c2d2; --t-muted:#8b99ae;
  --t-acc:#34d399; --t-acc-hi:#6ee7b7; --t-acc-bg:rgba(16,185,129,.13); --t-acc-line:rgba(52,211,153,.35);
  --t-focus:#34d399;
  --t-shadow:0 1px 2px rgba(0,0,0,.35),0 6px 18px rgba(0,0,0,.25);
  /* keep the brand layer's own variables in step */
  --pa-ink:#e7edf5; --pa-slate:#b6c2d2; --pa-mint:#0f2a24; --pa-mist:#0f1729; --pa-line:#253349;
  --primary-accent:#34d399; --ink:#e7edf5; --line:#253349; --border-color:#253349;
  --pc-ink:#e7edf5; --pc-text:#b6c2d2; --pc-mut:#8b99ae; --pc-line:#253349; --pc-card:#121c2e;
  --pc-soft:#0f1729; --pc-chip:#172338; --pc-acc:#34d399; --pc-acc-bg:rgba(16,185,129,.13);
  --pc-field:#0f1729; --pc-hero:#0f1729; --pc-hero-line:#253349;
  color-scheme:dark;
}

/* ---- page ---- */
html[data-theme="dark"],html[data-theme="dark"] body{background:var(--t-bg)!important;color:var(--t-text)!important;}
html[data-theme="dark"] ::selection{background:rgba(52,211,153,.3);color:#fff;}
html[data-theme="dark"] hr{border-color:var(--t-line)!important;}
html[data-theme="dark"] img:not([src$=".svg"]){filter:brightness(.92);}

/* hide page content for a moment while dark colours are mapped (failsafe: the head script clears it) */
html.pa-tp[data-theme="dark"] body > *:not(nav):not(.pa-ub):not(script){opacity:0!important;}

/* ---- header ---- */
html[data-theme="dark"] nav{background:rgba(11,18,32,.96)!important;border-bottom:1px solid var(--t-line2)!important;box-shadow:none!important;}
html[data-theme="dark"] nav .logo,html[data-theme="dark"] nav .logo .wm span{color:var(--t-text)!important;}
html[data-theme="dark"] nav .logo svg > rect:first-child,html[data-theme="dark"] .pa-ft-logo svg > rect:first-child{fill:#17263d;}
html[data-theme="dark"] nav .logo .wm span:last-child{color:var(--t-acc)!important;}
html[data-theme="dark"] nav .navlinks a{color:var(--t-text2)!important;}
html[data-theme="dark"] nav .navlinks a:hover,html[data-theme="dark"] nav .navlinks a[aria-current="page"]{color:var(--t-acc)!important;background:var(--t-acc-bg)!important;}
html[data-theme="dark"] nav .pa-qsearch{background:var(--t-bg2)!important;border-color:var(--t-line)!important;color:var(--t-text)!important;}
html[data-theme="dark"] nav .authlink.primary{background:var(--t-acc)!important;color:#05261c!important;border-color:var(--t-acc)!important;}
html[data-theme="dark"] nav .authlink.ghost,html[data-theme="dark"] nav .authlink:not(.primary){color:var(--t-text)!important;border-color:var(--t-line)!important;background:transparent!important;}
html[data-theme="dark"] .pa-ub{background:#070d18!important;}

/* ---- footer ---- */
html[data-theme="dark"] footer.pa-ft{background:#070d18!important;border-top:1px solid var(--t-line2)!important;}

/* ---- forms ---- */
html[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
html[data-theme="dark"] select,html[data-theme="dark"] textarea{
  background-color:var(--t-bg2)!important;color:var(--t-text)!important;border-color:var(--t-line)!important;}
html[data-theme="dark"] input::placeholder,html[data-theme="dark"] textarea::placeholder{color:var(--t-muted)!important;opacity:1;}
html[data-theme="dark"] input[type="checkbox"],html[data-theme="dark"] input[type="radio"],html[data-theme="dark"] input[type="range"]{accent-color:var(--t-acc);}
html[data-theme="dark"] option{background:var(--t-card);color:var(--t-text);}

/* ---- tables, code ---- */
html[data-theme="dark"] th,html[data-theme="dark"] td{border-color:var(--t-line)!important;}
html[data-theme="dark"] code,html[data-theme="dark"] pre,html[data-theme="dark"] kbd{background:var(--t-bg2)!important;color:var(--t-text)!important;border-color:var(--t-line)!important;}
html[data-theme="dark"] details summary{color:var(--t-text);}

/* ---- focus (both themes) ---- */
:focus-visible{outline:2px solid var(--t-focus)!important;outline-offset:2px!important;}

/* ---- theme switch ---- */
.pa-theme-btn{display:inline-flex;align-items:center;justify-content:center;width:38px;height:38px;flex:0 0 38px;
  border-radius:10px;border:1px solid var(--t-line);background:var(--t-bg);color:var(--t-text2);cursor:pointer;padding:0;
  transition:background-color .15s,color .15s,border-color .15s;}
.pa-theme-btn:hover{color:var(--t-acc);border-color:var(--t-acc-line);background:var(--t-acc-bg);}
.pa-theme-btn svg{width:18px;height:18px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;}
.pa-theme-btn .pa-i-sun{display:none;}
html[data-theme="dark"] .pa-theme-btn .pa-i-sun{display:block;}
html[data-theme="dark"] .pa-theme-btn .pa-i-moon{display:none;}
html[data-theme="dark"] .pa-theme-btn{background:var(--t-bg2);}

/* the switch itself is instant: page transitions pause for that moment so colours are read final */
html.pa-theme-switching *,html.pa-theme-switching *::before,html.pa-theme-switching *::after{transition:none!important;}

/* =====================================================================
   Stage 2 (v18.23.0): Toolkit polish — shared components, both themes.
   Appearance only: no layout, routes or behaviour change.
   ===================================================================== */
:root{ --r-sm:8px; --r-md:12px; --r-lg:16px; --t-ease:cubic-bezier(.2,.7,.2,1); }

/* ---- icons (pa-icons.js swaps interface emoji for these) ---- */
.pa-ico{width:1.05em;height:1.05em;flex:0 0 auto;vertical-align:-.16em;margin-right:.38em;
  stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;}
.pa-ico.pa-ico-solo{margin-right:0;}
.ico > .pa-ico,.icon > .pa-ico{width:22px;height:22px;margin:0;color:var(--t-acc);}
.pa-quickbar .pa-ico{width:15px;height:15px;margin-right:.3em;vertical-align:-.2em;}
.pa-quickbar .pa-ico-solo{width:17px;height:17px;margin:0;vertical-align:middle;}
.trustrow .pa-ico,.proofstrip .pa-ico{color:var(--t-acc);}
.sess-head .t .pa-ico{color:var(--t-acc);}

/* ---- one radius scale for cards and boxes (was 10/12/13/14/16/18/22 px) ---- */
a.card,.author,.pv-card,.box,.cta,.fx-card,.tbox,.lcard,.icard,.panel,.post.op-card,.post.composer-sec,.pa-ccard{border-radius:var(--r-lg)!important;}

/* ---- link cards: quiet, consistent hover ---- */
a.card,a.lcard,.fx-card a,a.extcard{transition:border-color .15s var(--t-ease),box-shadow .15s var(--t-ease),transform .15s var(--t-ease);}
a.card:hover,a.lcard:hover,a.extcard:hover{border-color:var(--t-acc-line)!important;box-shadow:var(--t-shadow)!important;transform:translateY(-2px);}
@media (prefers-reduced-motion:reduce){a.card:hover,a.lcard:hover,a.extcard:hover{transform:none;}}

/* ---- buttons and download links ---- */
a.ic-dl,a.pa-lc-dl,button.ic-share{border-radius:var(--r-md)!important;}
a.ic-dl,a.pa-lc-dl{transition:filter .15s var(--t-ease),transform .15s var(--t-ease);}
a.ic-dl:hover,a.pa-lc-dl:hover{filter:brightness(1.06);transform:translateY(-1px);}
button:disabled,input:disabled,select:disabled{cursor:not-allowed;opacity:.6;}

/* ---- form fields: same corners and a visible focus glow everywhere ---- */
:where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]):not(.pa-qsearch),select,textarea){border-radius:var(--r-md);}
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):focus-visible,select:focus-visible,textarea:focus-visible{
  outline:2px solid var(--t-focus)!important;outline-offset:1px!important;box-shadow:0 0 0 4px rgba(16,185,129,.18)!important;}
input[type="checkbox"],input[type="radio"],input[type="range"]{accent-color:var(--t-acc);}

/* ---- numbers line up in results and tables ---- */
:where(td,th,.result,.res,.out,output,.stat,.big,.mprice,.price,.pv-card,input[type="number"]){font-variant-numeric:tabular-nums;}

/* ---- tables: clearer header row ---- */
:where(th){font-weight:700;letter-spacing:.01em;}
:where(thead th){background:var(--t-bg2);color:var(--t-text2);border-bottom:1px solid var(--t-line);}
:where(tbody tr){transition:background-color .12s;}
:where(tbody tr:hover){background:rgba(16,185,129,.05);}

/* ---- links in running text: steadier underline ---- */
:where(p a,li a,td a){text-underline-offset:.18em;text-decoration-thickness:1px;}

/* ---- header: a little more air, sticky shadow only after scrolling ---- */
nav .navlinks a{transition:color .15s,background-color .15s;}
html.pa-scrolled nav{box-shadow:0 1px 0 var(--t-line2),0 6px 16px rgba(15,23,42,.06)!important;}
html[data-theme="dark"].pa-scrolled nav{box-shadow:0 1px 0 var(--t-line2),0 6px 16px rgba(0,0,0,.35)!important;}

/* =====================================================================
   Stage 3 (v18.24.0): page-type consistency. A 209-page measurement found the
   page types already consistent (Sora everywhere, 780/960/1080 px containers,
   off-palette colours only where they carry data: calendar impact, heat-map,
   price up/down). These are the outliers it found.
   ===================================================================== */
/* form controls take the site font (browsers default buttons to Arial: /charts symbol buttons) */
:where(button,input,select,textarea){font-family:inherit;}
/* forum action buttons and chips set the system font explicitly */
.pa-actbtn,.pa-hchip{font-family:inherit!important;}
/* forum "Official" badge: brand emerald instead of the one off-brand blue */
.badge-official{background:#ecfdf5!important;color:#065f46!important;box-shadow:inset 0 0 0 1px #a7f3d0;}

/* =====================================================================
   Stage 4 (v18.25.0): final QA fixes (light-mode contrast found by the 4-way audit).
   ===================================================================== */
/* footer version tag: grey on navy was 3.4:1 at 10 px */
#pa-footver{color:#94a3b8!important;}
/* home hero search button: dark ink on emerald was 3.2:1 */
.search.pa-hs > button{color:#ffffff!important;}

/* =====================================================================
   v18.26.0: header v2 (owner's reference) + theme-aware footer, every page.
   The thin top bar's links (About, Contact, Newsletter, Editorial policy) all live in the footer,
   so the header is one row as in the reference.
   ===================================================================== */
body:has(nav.pa-hdr2) .pa-ub{display:none!important;}
html body nav.pa-hdr2{background:color-mix(in srgb,var(--t-bg) 92%,transparent)!important;backdrop-filter:saturate(1.4) blur(12px);border-bottom:1px solid var(--t-line2)!important;}
html body nav.pa-hdr2 .navin{display:flex!important;flex-wrap:nowrap!important;align-items:center!important;gap:8px!important;max-width:1280px!important;min-height:66px;padding:8px 24px!important;margin:0 auto!important;}
nav.pa-hdr2 .logo{order:0;flex:0 0 auto;margin-right:6px!important;}
nav.pa-hdr2 .pa-nav2{order:1;flex:1 1 auto;display:flex;align-items:center;gap:2px;min-width:0;}
nav.pa-hdr2 .pa-qwrap{order:2;margin:0 0 0 auto!important;flex:0 0 auto!important;max-width:none!important;}
nav.pa-hdr2 .pa-theme-btn{order:3;}
nav.pa-hdr2 .nav-auth{order:4;flex:0 0 auto;}
nav.pa-hdr2 .pa-burger{order:5;}
.pa-nav2 svg,.pa-burger svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;}
.pa-nav2 .pa-nl,.pa-nav2 .pa-nh{display:inline-flex;align-items:center;height:40px;padding:0 7px;border-radius:10px;font-size:13.5px;font-weight:600;color:var(--t-text2)!important;text-decoration:none!important;white-space:nowrap;position:relative;transition:color .15s,background-color .15s;}
.pa-nav2 .pa-nh{width:42px;justify-content:center;padding:0;}
.pa-nav2 .pa-nh-t{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);}
.pa-nav2 .pa-nl:hover,.pa-nav2 .pa-nh:hover{color:var(--t-acc)!important;background:var(--t-acc-bg);}
.pa-nav2 [aria-current="page"]{color:var(--t-acc)!important;}
.pa-nav2 .pa-nh[aria-current="page"]{background:var(--t-acc-bg);}
.pa-nav2 [aria-current="page"]::after{content:"";position:absolute;left:10px;right:10px;bottom:-13px;height:2px;border-radius:2px;background:var(--t-acc);}
.pa-dd{position:relative;display:flex;align-items:center;}
.pa-dd .pa-nl{padding-right:2px;}
.pa-ddb{display:inline-grid;place-items:center;width:18px;height:30px;border:0;background:transparent;color:var(--t-muted);border-radius:7px;cursor:pointer;padding:0;}
.pa-ddb svg{width:14px;height:14px;transition:transform .15s;}
.pa-ddb:hover{color:var(--t-acc);}
.pa-ddm{position:absolute;top:calc(100% + 8px);left:-6px;min-width:250px;display:none;grid-template-columns:1fr;padding:8px;border-radius:14px;background:var(--t-card);border:1px solid var(--t-line);box-shadow:0 18px 40px rgba(15,23,42,.14);z-index:90;}
html[data-theme="dark"] .pa-ddm{box-shadow:0 18px 40px rgba(0,0,0,.5);}
.pa-ddm::before{content:"";position:absolute;left:0;right:0;top:-10px;height:10px;}
.pa-ddm a{display:block;padding:9px 12px;border-radius:9px;font-size:13.5px;font-weight:600;color:var(--t-text2)!important;text-decoration:none!important;white-space:nowrap;}
.pa-ddm a:hover,.pa-ddm a:focus-visible{background:var(--t-acc-bg);color:var(--t-acc)!important;}
.pa-dd.open .pa-ddm{display:grid;}
.pa-dd.open .pa-ddb svg{transform:rotate(180deg);}
@media (hover:hover) and (min-width:1241px){.pa-dd:hover .pa-ddm{display:grid;}.pa-dd:hover .pa-ddb svg{transform:rotate(180deg);}}
@media (min-width:1241px){
  html body nav.pa-hdr2 .pa-qsearch{width:42px!important;min-width:42px!important;padding-left:12px!important;padding-right:30px!important;color:transparent!important;cursor:pointer;transition:width .2s ease,color .2s;border-radius:12px!important;}
  html body nav.pa-hdr2 .pa-qsearch::placeholder{color:transparent!important;}
  html body nav.pa-hdr2 .pa-qsearch:focus{width:260px!important;color:var(--t-text)!important;cursor:text;}
  html body nav.pa-hdr2 .pa-qsearch:focus::placeholder{color:var(--t-muted)!important;}
}
nav.pa-hdr2 .pa-theme-btn{width:auto;height:40px;flex:0 0 auto;padding:4px;gap:2px;border-radius:999px;display:inline-flex;}
nav.pa-hdr2 .pa-theme-btn svg{display:block!important;width:30px;height:30px;padding:6px;border-radius:50%;box-sizing:border-box;}
nav.pa-hdr2 .pa-theme-btn .pa-i-sun{order:0;} nav.pa-hdr2 .pa-theme-btn .pa-i-moon{order:1;}
html:not([data-theme="dark"]) nav.pa-hdr2 .pa-theme-btn .pa-i-sun{background:var(--t-acc);color:#fff;}
html[data-theme="dark"] nav.pa-hdr2 .pa-theme-btn .pa-i-moon{background:var(--t-acc);color:#04241a;}
.pa-burger{display:none;width:42px;height:42px;border-radius:12px;border:1px solid var(--t-line);background:var(--t-bg);color:var(--t-text);place-items:center;cursor:pointer;padding:0;}
@media (max-width:1240px){
  html body nav.pa-hdr2 .navin{flex-wrap:wrap!important;}
  .pa-burger{display:inline-grid;}
  nav.pa-hdr2 .pa-nav2{display:none;order:9;flex:1 1 100%;flex-direction:column;align-items:stretch;gap:2px;padding:10px 0 14px;border-top:1px solid var(--t-line2);max-height:calc(100vh - 80px);overflow:auto;}
  html.pa-menu-open nav.pa-hdr2 .pa-nav2{display:flex;}
  .pa-nav2 .pa-nh{width:auto;justify-content:flex-start;padding:0 12px;gap:10px;}
  .pa-nav2 .pa-nh-t{position:static;width:auto;height:auto;clip:auto;}
  .pa-nav2 [aria-current="page"]::after{display:none;}
  .pa-dd{flex-wrap:wrap;}
  .pa-dd .pa-nl{flex:1;}
  .pa-ddb{width:42px;height:40px;}
  .pa-ddm{position:static;min-width:0;box-shadow:none!important;border:0;background:transparent;padding:0 0 6px 12px;flex:1 1 100%;}
}
@media (max-width:560px){
  html body nav.pa-hdr2 .navin{padding:8px 14px!important;gap:8px!important;}
  nav.pa-hdr2 .pa-qwrap{order:8;flex:1 1 100%!important;margin:0!important;}
  nav.pa-hdr2 .nav-auth .authlink{padding:7px 10px!important;font-size:12px!important;}
}

/* footer: follows the theme (light in light mode, as in the reference) */
html body footer.pa-ft{background:#eef3f8!important;color:#334155!important;border-top:1px solid #e2e8f0!important;}
html body footer.pa-ft a{color:#334155!important;}
html body footer.pa-ft a:hover{color:var(--t-acc)!important;}
html body footer.pa-ft h2,html body footer.pa-ft h3,html body footer.pa-ft h4,html body footer.pa-ft b,html body footer.pa-ft strong,html body footer.pa-ft .pa-ft-logo{color:#0f172a!important;}
html body footer.pa-ft .pa-ft-logo i{color:var(--t-acc)!important;}
html body footer.pa-ft p,html body footer.pa-ft small,html body footer.pa-ft .pa-legal{color:#64748b!important;}
html[data-theme="dark"] body footer.pa-ft{background:#050b15!important;color:#c3cfdd!important;border-top:1px solid var(--t-line2)!important;}
html[data-theme="dark"] body footer.pa-ft a{color:#c3cfdd!important;}
html[data-theme="dark"] body footer.pa-ft a:hover{color:var(--t-acc)!important;}
html[data-theme="dark"] body footer.pa-ft h2,html[data-theme="dark"] body footer.pa-ft h3,html[data-theme="dark"] body footer.pa-ft h4,html[data-theme="dark"] body footer.pa-ft b,html[data-theme="dark"] body footer.pa-ft strong,html[data-theme="dark"] body footer.pa-ft .pa-ft-logo{color:#f1f5f9!important;}
html[data-theme="dark"] body footer.pa-ft p,html[data-theme="dark"] body footer.pa-ft small,html[data-theme="dark"] body footer.pa-ft .pa-legal{color:#8b9bb0!important;}
html body footer.pa-ft #pa-footver{color:inherit!important;opacity:.85;}
.pa-ft-theme{display:inline-flex;align-items:center;gap:10px;margin-top:6px;cursor:pointer;font-size:13px;font-weight:600;user-select:none;position:relative;}
.pa-ft-theme input{position:absolute;opacity:0;width:1px;height:1px;}
.pa-ft-track{position:relative;width:44px;height:24px;border-radius:999px;background:#cbd5e1;transition:background-color .15s;}
.pa-ft-track::after{content:"";position:absolute;top:3px;left:3px;width:18px;height:18px;border-radius:50%;background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.25);transition:transform .15s;}
.pa-ft-theme input:checked + .pa-ft-track{background:var(--t-acc);}
.pa-ft-theme input:checked + .pa-ft-track::after{transform:translateX(20px);}
.pa-ft-theme input:focus-visible + .pa-ft-track{outline:2px solid var(--t-focus);outline-offset:2px;}
html body nav.pa-hdr2 .pa-qwrap{width:auto!important;min-width:0!important;}
/* footer legal row + risk warning: older rules outweigh the generic footer colours, so these are explicit */
html body footer.pa-ft.pa-ft .disc,html body footer.pa-ft.pa-ft .disc *{color:#475569!important;}
html body footer.pa-ft.pa-ft .pa-legal a,html body footer.pa-ft.pa-ft .pa-legal{color:#334155!important;}
html[data-theme="dark"] body footer.pa-ft.pa-ft .disc,html[data-theme="dark"] body footer.pa-ft.pa-ft .disc *{color:#9fb0c4!important;}
html[data-theme="dark"] body footer.pa-ft.pa-ft .pa-legal a,html[data-theme="dark"] body footer.pa-ft.pa-ft .pa-legal{color:#c3cfdd!important;}
html body footer.pa-ft.pa-ft .disc a,html body footer.pa-ft.pa-ft .pa-legal a:hover{color:var(--t-acc)!important;}

/* pa-soc-brand (18 Nov 2026, owner request): footer social icons in their own brand colours, white logo. Fixes the dark-grey-on-slate icons (footer link colour rule was overriding them). Site-wide. */
html body footer.pa-ft .pa-ft-social a{color:#fff!important;border:1px solid transparent;transition:transform .15s ease,filter .15s ease,box-shadow .15s ease}
html body footer.pa-ft .pa-ft-social a svg{width:18px;height:18px}
html body footer.pa-ft .pa-ft-social a:hover,html body footer.pa-ft .pa-ft-social a:focus-visible{transform:translateY(-2px);filter:brightness(1.08);box-shadow:0 6px 14px rgba(15,23,42,.18)}
html body footer.pa-ft .pa-ft-social a[href*="x.com"]{background:#000!important;border-color:rgba(255,255,255,.18)}
html body footer.pa-ft .pa-ft-social a[href*="youtube.com"]{background:#FF0000!important}
html body footer.pa-ft .pa-ft-social a[href*="reddit.com"]{background:#FF4500!important}
html body footer.pa-ft .pa-ft-social a[href*="facebook.com"]{background:#1877F2!important}
html body footer.pa-ft .pa-ft-social a[href*="discord"]{background:#5865F2!important}
@media (prefers-reduced-motion:reduce){html body footer.pa-ft .pa-ft-social a{transition:none}html body footer.pa-ft .pa-ft-social a:hover{transform:none}}
