/* ===== FONT DISPLAY SWAP — override FA default (block) ===== */
@font-face { font-family: "Font Awesome 6 Free"; font-style: normal; font-weight: 400; font-display: swap; src: local("Font Awesome 6 Free Regular"); }
@font-face { font-family: "Font Awesome 6 Free"; font-style: normal; font-weight: 900; font-display: swap; src: local("Font Awesome 6 Free Solid"); }
@font-face { font-family: "Font Awesome 6 Brands"; font-style: normal; font-weight: 400; font-display: swap; src: local("Font Awesome 6 Brands Regular"); }

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ===== LIGHT PAGE THEME ===== */
:root {
  --bg:          #ffffff;
  --bg2:         #ffffff;
  --bg3:         #f5f5f5;
  --card:        #ffffff;
  --card-hover:  #fff7f5;
  --accent:      #FF4B00;
  --accent2:     #ff6b2b;
  --text:        #111827;
  --text-muted:  #374151;
  --border:      #dde3ec;
  --radius:      10px;
  --ease:        0.16s ease;
}

html { scroll-behavior: smooth; font-size: 17px; background: #ffffff; }
body { font-family: 'Noto Sans', 'Segoe UI', system-ui, sans-serif; background: #ffffff; color: var(--text); min-height: 100vh; overflow-x: hidden; display: flex; flex-direction: column; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { cursor: pointer; border: none; background: none; font: inherit; color: inherit; }
/* Global paragraph size — excludes interactive tool/calc widgets */
p { font-size: 1.05rem; line-height: 1.78; }
.calc-col p,
.frac-page p, .pct-page p, .uc-page p, .geo-page p,
.graph-page p, .prime-page p, .glcm-page p, .ratio-page p,
.stats-page p, .exp-page p, .roman-page p, .tt-page p,
.eq-page p, .tri-page p, .base-page p { font-size: inherit; line-height: inherit; }
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,75,0,0.25); border-radius: 4px; }

/* ===== CONTAINER ===== */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px;
}

/* ===== STICKY TOOLS BAR ===== */
.tools-bar {
  position: sticky; top: 52px; z-index: 10000;
  width: 100%; overflow-x: auto; overflow-y: hidden; margin: 0; padding: 0;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  transition: top 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
}
.tools-bar.bar-top {
  top: 0;
  box-shadow: 0 2px 16px rgba(0,0,0,0.10);
}
.tools-bar::-webkit-scrollbar { display: none; }
.tools-bar-inner {
  display: flex; align-items: stretch; width: max-content; min-width: 100%; margin: 0; padding: 0;
}
.tools-bar-item {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  flex: 1; padding: 13px 10px; font-size: 0.78rem; font-weight: 700;
  color: #fff; text-decoration: none; white-space: nowrap;
  transition: filter 0.15s; letter-spacing: 0.2px; min-width: 0;
}
.tools-bar-item:hover { filter: brightness(1.12); }
.tools-bar-item + .tools-bar-item { border-left: 1px solid rgba(255,255,255,0.15); }
.tools-bar-item i { font-size: 0.85rem; opacity: 0.9; flex-shrink: 0; }
@media (max-width: 768px) {
  .tools-bar-inner { width: max-content; min-width: unset; }
  .tools-bar-item { flex: none; min-width: 100px; padding: 11px 14px; font-size: 0.76rem; }
}

/* ===== HEADER ===== */
header {
  position: sticky; top: 0; z-index: 10001;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  width: 100%;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}
header.nav-hidden {
  transform: translateY(-100%);
}
.header-inner {
  width: 100%; max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px; height: 52px;
  display: flex; align-items: center; gap: 20px;
}
.logo {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 1.5rem; font-weight: 700;
  color: var(--text); letter-spacing: 0.4px; white-space: nowrap;
}
.logo-solve { color: var(--text); }
.logo-calc  { color: #FF4B00; }
.logo-img { width: 28px; height: 28px; object-fit: contain; display: block; }
.site-tagline { display: none; }
.header-nav { margin-left: auto; display: flex; gap: 2px; }
.header-nav a {
  padding: 6px 14px; border-radius: 8px;
  font-size: 0.75rem; font-weight: 700;
  color: var(--text-muted); transition: color var(--ease), background var(--ease);
  text-transform: uppercase; letter-spacing: 0.6px;
}
.header-nav a:hover { color: var(--accent); }
.header-nav a.active { color: var(--accent); background: none; font-weight: 800; }
.mob-menu-btn { display: none; align-items: center; justify-content: center; width: 36px; height: 36px; color: var(--text-muted); margin-left: auto; border-radius: 8px; transition: background .15s; }
.mob-menu-btn:hover { background: rgba(0,0,0,.05); }

/* ── Mobile drawer ── */
.mob-nav-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.38); backdrop-filter: blur(3px);
  z-index: 19998;
}
.mob-nav-overlay.open { display: block; }

.mob-nav {
  position: fixed; top: 0; right: -290px;
  width: 270px; height: 100dvh;
  background: #fff; z-index: 19999;
  display: flex; flex-direction: column;
  box-shadow: -6px 0 32px rgba(0,0,0,.13);
  transition: right .28s cubic-bezier(.4,0,.2,1);
  overflow-y: auto;
}
.mob-nav.open { right: 0; }

.mob-nav-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 16px; border-bottom: 1px solid #f0f0f4; flex-shrink: 0;
}
.mob-nav-logo {
  display: flex; align-items: center; gap: 8px;
  font-size: 1rem; font-weight: 700; color: #1a1a2e; text-decoration: none;
}
.mob-nav-logo strong { color: #FF4B00; }
.mob-nav-close {
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  background: #f4f4f7; border: none; border-radius: 8px;
  cursor: pointer; color: #555; transition: background .15s;
}
.mob-nav-close:hover { background: #ebebef; }

.mob-nav-links {
  display: flex; flex-direction: column; padding: 10px 10px 20px; gap: 2px;
}
.mob-nav-links a {
  display: flex; align-items: center; gap: 13px;
  padding: 12px 14px; border-radius: 10px;
  font-size: 0.92rem; font-weight: 600; color: #333;
  text-decoration: none; transition: background .15s, color .15s;
}
.mob-nav-links a i { width: 16px; font-size: 0.85rem; color: #FF4B00; flex-shrink: 0; }
.mob-nav-links a:hover { background: rgba(255,75,0,.07); color: #FF4B00; }
.mob-nav-links a.active { background: rgba(255,75,0,.1); color: #FF4B00; }

/* ===== PAGE WRAP ===== */
.page-wrap { width: 100%; flex: 1; background: transparent; }
body.page-home .page-wrap { padding-top: 0; }
/* non-home pages keep a centered content column */
body:not(.page-home) .page-wrap { max-width: 1200px; margin: 0 auto; padding: 44px 40px 52px; }

/* ===== HOME HERO (legacy — unused on home) ===== */
.home-hero { text-align: center; padding: 0 0 40px; max-width: 860px; margin: 0 auto; }
.home-hero-title { font-size: 1.75rem; font-weight: 800; color: var(--text); line-height: 1.25; letter-spacing: -0.4px; margin-bottom: 14px; }
.home-hero-desc { font-size: 1.05rem; color: var(--text-muted); line-height: 1.75; font-weight: 400; max-width: 100%; margin: 0 auto; }

/* ===== HERO SLIDER ===== */
/* ══ HERO ══ */
.hero {
  position: relative;
  height: 55vh;
  min-height: 340px;
  max-height: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: url('/assets/img/bg-hero.webp') center center / cover no-repeat;
}
.hero-inner {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 0 24px;
  max-width: 740px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.hero-h1 {
  font-size: 2.8rem;
  font-weight: 700;
  color: #111;
  line-height: 1.15;
  letter-spacing: -0.5px;
  margin: 0;
}
.hero-sub {
  font-size: 1.05rem;
  color: #444;
  line-height: 1.65;
  max-width: 520px;
  margin: 0;
}
.hero-btns {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}
@media (max-width: 768px) {
  .hero-btns { flex-wrap: nowrap; gap: 8px; }
  .hero-btn-primary, .hero-btn-secondary, .hero-btn-ghost {
    font-size: 0.72rem;
    padding: 8px 12px;
    gap: 0;
    white-space: nowrap;
  }
  .hero-btn-primary i, .hero-btn-secondary i, .hero-btn-ghost i { display: none; }
}
@media (max-width: 420px) {
  .hero-btns { gap: 6px; }
  .hero-btn-primary, .hero-btn-secondary, .hero-btn-ghost {
    font-size: 0.68rem;
    padding: 7px 10px;
  }
}
.hero-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #FF4B00;
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 13px 28px;
  border-radius: 10px;
  text-decoration: none;
  box-shadow: 0 5px 0 #b83500, inset 0 1px 0 rgba(255,255,255,0.18);
  transition: background 0.12s, transform 0.1s, box-shadow 0.1s;
  position: relative;
  top: 0;
}
.hero-btn-primary:hover { background: #e04000; color: #fff; }
.hero-btn-primary:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 #b83500, inset 0 1px 0 rgba(255,255,255,0.12);
  top: 0;
}
.hero-btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(0,0,0,0.06);
  border: 1.5px solid rgba(0,0,0,0.18);
  color: #111;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 13px 28px;
  border-radius: 10px;
  text-decoration: none;
  transition: background 0.18s, transform 0.18s;
}
.hero-btn-ghost:hover { background: rgba(0,0,0,0.12); transform: translateY(-2px); color: #111; }
.hero-btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #6b7280;
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 13px 28px;
  border-radius: 10px;
  text-decoration: none;
  box-shadow: 0 5px 0 #4b5563, inset 0 1px 0 rgba(255,255,255,0.15);
  transition: background 0.12s, transform 0.1s, box-shadow 0.1s;
  position: relative;
  top: 0;
}
.hero-btn-secondary:hover { background: #4b5563; color: #fff; }
.hero-btn-secondary:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 #374151, inset 0 1px 0 rgba(255,255,255,0.1);
  top: 0;
}
.hero-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 4px;
}
.hero-badges span {
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255,255,255,0.6);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  padding: 4px 12px;
  border-radius: 999px;
}

/* Card colour variants (used outside hero) */
.hc-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: #fff;
  flex-shrink: 0;
}
.hc-name { font-size: 0.95rem; font-weight: 700; color: var(--text); line-height: 1.3; }
.hc-meta { font-size: 0.78rem; color: var(--text-muted); line-height: 1.5; }
.hc-indigo  { background: rgba(99,102,241,0.07); }
.hc-indigo  .hc-icon { background: #6366f1; }
.hc-purple  { background: rgba(168,85,247,0.08); }
.hc-purple  .hc-icon { background: #a855f7; }
.hc-teal    { background: rgba(20,184,166,0.08); }
.hc-teal    .hc-icon { background: #14b8a6; }
.hc-green   { background: rgba(34,197,94,0.08); }
.hc-green   .hc-icon { background: #22c55e; }
.hc-orange  { background: rgba(245,166,35,0.09); }
.hc-orange  .hc-icon { background: #f5a623; }
.hc-blue    { background: rgba(0,122,255,0.07); }
.hc-blue    .hc-icon { background: #007aff; }

/* Clickable hero cards (used outside hero) */
a.hero-card {
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.18s, box-shadow 0.18s;
}
a.hero-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(0,0,0,0.11);
}
a.hero-card .hc-name { transition: color 0.18s; }
a.hero-card:hover .hc-name { color: var(--accent); }

/* ===== HOME LAYOUT — centered ===== */
.home-layout { display: flex; flex-direction: column; width: 100%; }
.calc-section-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 24px 48px;
  gap: 48px;
}
.calc-col { width: 100%; max-width: 420px; }
.content-col { width: 100%; max-width: 740px; }

/* ===== CRT CALCULATOR ===== */
.calc-widget {
  background: linear-gradient(160deg, #2c2c2c 0%, #1a1a1a 60%, #141414 100%);
  border-radius: 20px;
  padding: 24px;
  border-top: 1px solid #3a3a3a;
  border-left: 1px solid #303030;
  border-right: 1px solid #0d0d0d;
  border-bottom: 1px solid #0a0a0a;
  box-shadow: 0 8px 0 #0a0a0a, 0 10px 14px rgba(0,0,0,0.55);
  display: flex; flex-direction: column; gap: 16px;
}

/* CRT display */
.calc-display-wrap {
  background: #0a1a0a;
  border-radius: 6px;
  padding: 14px 18px;
  box-shadow:
    inset 0 0 30px rgba(0,0,0,0.8),
    inset 0 0 8px rgba(57,255,100,0.05),
    0 0 0 3px #1a1a1a, 0 0 0 5px #0d0d0d;
  border: 2px solid #0d2b0d;
  min-height: 80px;
  display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
}
.calc-display-wrap::after {
  content: "";
  position: absolute; inset: 0;
  background: repeating-linear-gradient(to bottom, transparent 0px, transparent 3px, rgba(0,0,0,0.18) 3px, rgba(0,0,0,0.18) 4px);
  pointer-events: none; border-radius: 4px;
}
.calc-expr {
  color: #2a7a2a; font-size: 11px; min-height: 16px;
  letter-spacing: 1px; font-family: 'Courier New', monospace;
  text-shadow: 0 0 6px #39ff6488;
}
.calc-display {
  color: #39ff64; font-size: 2.6rem; font-weight: 400;
  letter-spacing: 2px; font-family: 'Courier New', monospace;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right;
  text-shadow: 0 0 8px #39ff64, 0 0 20px #39ff6466, 0 0 40px #39ff6422;
}
.calc-display.shake { animation: shake 0.4s ease; }
@keyframes shake {
  0%,100% { transform: translateX(0); }
  25%     { transform: translateX(-5px); }
  75%     { transform: translateX(5px); }
}

/* Code Mode toggle row */
.calc-header {
  display: flex; align-items: center; justify-content: flex-end;
  min-height: 0; background: transparent;
}

/* Sci row + main grid */
.calc-sci-row {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px;
}
.calc-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
}

/* ── Keycap base ── */
.cbtn {
  position: relative;
  display: inline-flex; align-items: flex-start; justify-content: flex-start;
  border-radius: 10px;
  background: linear-gradient(180deg, #282828, #202020);
  box-shadow:
    inset -8px 0 8px rgba(0,0,0,0.15),
    inset 0 -8px 8px rgba(0,0,0,0.25),
    0 0 0 2px rgba(0,0,0,0.75),
    10px 20px 25px rgba(0,0,0,0.4);
  overflow: hidden;
  transition: transform 0.1s ease-in-out, box-shadow 0.1s ease-in;
  user-select: none; -webkit-tap-highlight-color: transparent;
  cursor: pointer; border: none; outline: none;
  aspect-ratio: 1/1;
  font-size: 0; /* hide direct text — use .letter span */
}
.cbtn::before {
  content: "";
  position: absolute; top: 3px; left: 4px; bottom: 14px; right: 12px;
  background: linear-gradient(90deg, #232323, #4a4a4a);
  border-radius: 10px;
  box-shadow:
    -10px -10px 10px rgba(255,255,255,0.25),
    10px 5px 10px rgba(0,0,0,0.15);
  border-left: 1px solid #0004; border-bottom: 1px solid #0004; border-top: 1px solid #0009;
  transition: all 0.1s ease-in-out;
}
.cbtn .letter {
  position: absolute; left: 10px; top: 10px;
  color: #e9e9e9; font-size: 14px; font-family: inherit;
  transition: transform 0.1s ease-in-out; pointer-events: none; line-height: 1;
}
.cbtn:active, .cbtn.pressed {
  transform: translateY(2px);
  box-shadow:
    inset -4px 0 4px rgba(0,0,0,0.1),
    inset 0 -4px 4px rgba(0,0,0,0.15),
    0 0 0 2px rgba(0,0,0,0.5),
    5px 10px 15px rgba(0,0,0,0.3);
}
.cbtn:active::before, .cbtn.pressed::before {
  top: 5px; left: 5px; bottom: 11px; right: 11px;
  box-shadow: -5px -5px 5px rgba(255,255,255,0.15), 5px 3px 5px rgba(0,0,0,0.1);
}
.cbtn:active .letter, .cbtn.pressed .letter { transform: translateY(1px); }

/* Sci keys — purple tint */
.cbtn-fn::before  { background: linear-gradient(90deg, #1e1a2e, #362a5e); }
.cbtn-fn .letter  { color: #c4b5fd; font-size: 11px; }

/* AC/⌫ — red tint */
.cbtn-cl::before  { background: linear-gradient(90deg, #2e1a1a, #5a2a2a); }
.cbtn-cl .letter  { color: #f87171; }

/* Operators — blue tint */
.cbtn-op::before  { background: linear-gradient(90deg, #1a2a3a, #2a4a6a); }
.cbtn-op .letter  { color: #7ab8f5; font-size: 16px; }

/* Numbers — default dark */
.cbtn-num .letter { color: #e9e9e9; font-size: 16px; }

/* Equals — green tint */
.cbtn-eq::before  { background: linear-gradient(90deg, #1a2e1a, #2a5a2a); }
.cbtn-eq .letter  { color: #39ff64; font-size: 18px; }

/* Wide 0 key */
.cbtn-wide2 {
  aspect-ratio: unset; grid-column: span 2;
  height: auto; min-height: 58px;
}
.cbtn-wide2 .letter { font-size: 16px; }

/* Paren key — smaller text */
.cbtn-paren .letter { font-size: 12px; }

/* ===== CODE MODE TOGGLE (in calc header) ===== */
.code-toggle-wrap {
  display: inline-flex; align-items: center; gap: 6px;
  cursor: pointer; user-select: none;
}
.code-toggle-input { position: absolute; opacity: 0; width: 0; height: 0; }
.code-toggle-track {
  display: inline-block; width: 30px; height: 17px;
  background: #3a3a3c; border-radius: 999px; position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}
.code-toggle-thumb {
  position: absolute; top: 2px; left: 2px;
  width: 13px; height: 13px;
  background: #8e8e93; border-radius: 50%;
  transition: transform 0.2s, background 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
.code-toggle-input:checked + .code-toggle-track { background: #636366; }
.code-toggle-input:checked + .code-toggle-track .code-toggle-thumb {
  transform: translateX(13px); background: #fff;
}
.code-toggle-label {
  font-size: 0.65rem; font-weight: 600; color: rgba(255,255,255,0.4);
  text-transform: uppercase; letter-spacing: 0.7px;
}
.code-toggle-input:checked ~ .code-toggle-label { color: rgba(255,255,255,0.75); }

/* ===== RELATED ARTICLES ===== */
.about-topics-block {
  background: transparent;
  padding: 0;
  margin-bottom: 1.5rem;
}
.about-topics-block-inner {
  max-width: 740px;
  margin: 0 auto;
}
.about-topics-block .intro { text-align: left; margin-bottom: 0; }

.home-section-wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 40px;
}
/* 50/50 split: mascot (sticky) + tools grid */
.tools-split-layout {
  display: flex;
  gap: 2.5rem;
  align-items: flex-start;
}
.tools-mascot-col {
  flex: 0 0 46%;
  position: sticky;
  top: 72px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.tools-mascot-img {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  object-position: bottom center;
}
.tools-grid-col {
  flex: 1 1 0;
  min-width: 0;
}
.tools-grid-col .home-tools-grid {
  grid-template-columns: repeat(2, 1fr);
}
/* Desktop shows desktop image, hides mobile image */
.tools-mascot-mobile { display: none; }
.tools-mascot-desktop { display: block; }

@media (max-width: 768px) {
  .tools-split-layout { flex-direction: column; }
  .tools-mascot-col { flex: none; position: static; width: 100%; max-width: 280px; margin: 0 auto; }
  .tools-grid-col .home-tools-grid { grid-template-columns: repeat(2, 1fr); }
  /* Swap images on mobile */
  .tools-mascot-desktop { display: none; }
  .tools-mascot-mobile { display: block; }
}
.about-topics-block h1 { text-align: left; margin-bottom: .5rem; }
.related-articles { margin-top: 36px; margin-bottom: 8px; }
.ra-title {
  font-size: 0.72rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 1.2px; color: var(--text-muted); margin-bottom: 12px;
}
.ra-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ra-card {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; border-radius: 12px;
  font-size: 0.82rem; font-weight: 700; color: #fff;
  line-height: 1.25; text-decoration: none;
  position: relative; overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  box-shadow: 0 3px 10px rgba(0,0,0,0.12);
}
.ra-card::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.14) 0%, transparent 60%);
  pointer-events: none;
}
.ra-card::after {
  content: '→';
  margin-left: auto;
  font-size: 0.9rem;
  opacity: 0.7;
  transition: transform 0.18s ease;
  flex-shrink: 0;
}
.ra-card:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(0,0,0,0.18); }
.ra-card:hover::after { transform: translateX(3px); opacity: 1; }
.ra-card:nth-child(1) { background: linear-gradient(135deg, #f97316, #fb923c); }
.ra-card:nth-child(2) { background: linear-gradient(135deg, #10b981, #34d399); }
.ra-card:nth-child(3) { background: linear-gradient(135deg, #d97706, #f59e0b); }
.ra-card:nth-child(4) { background: linear-gradient(135deg, #ef4444, #f87171); }
.ra-card:nth-child(5) { background: linear-gradient(135deg, #6366f1, #818cf8); }
.ra-card:nth-child(6) { background: linear-gradient(135deg, #0d9488, #14b8a6); }
.ra-card-icon { display: none; }

/* ===== ACCESSIBILITY WIDGET ===== */
.a11y-wrap { position: relative; }
.a11y-toggle-btn {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.a11y-toggle-btn:hover { background: var(--card-hover); color: var(--text); border-color: var(--accent); }
.a11y-t-icon {
  font-family: 'Noto Sans', sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.5px;
}
.a11y-panel {
  display: none;
  position: absolute; top: calc(100% + 10px); right: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  min-width: 210px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.13);
  z-index: 999;
  flex-direction: column; gap: 14px;
}
.a11y-panel.a11y-panel-open { display: flex; }
.a11y-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.a11y-label { font-size: 0.8rem; font-weight: 700; color: var(--text-muted); white-space: nowrap; }
.a11y-size-btns { display: flex; gap: 5px; }
.a11y-sz-btn {
  width: 32px; height: 32px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: transparent; color: var(--text);
  font-size: 0.8rem; font-weight: 700;
  cursor: pointer; transition: background .15s, border-color .15s;
}
.a11y-sz-btn:hover { background: var(--card-hover); border-color: var(--accent); }
.a11y-sz-reset { font-size: 0.95rem; }
/* ===== HOME ARTICLE ===== */
.home-article h1 { font-size: 1.75rem; font-weight: 800; color: var(--text); line-height: 1.25; letter-spacing: -0.4px; margin-bottom: 12px; text-align: center; }
.home-article .intro { font-size: 1rem; color: var(--text-muted); line-height: 1.8; margin-bottom: 28px; text-align: center; }
.home-article h2 { font-size: 1.2rem; font-weight: 700; color: var(--text); margin: 40px 0 14px; }
.home-article p { font-size: 1.05rem; color: var(--text-muted); line-height: 1.85; margin-bottom: 16px; }
.home-article ul { padding-left: 20px; color: var(--text-muted); font-size: 1rem; line-height: 1.85; margin-bottom: 22px; }
.home-article li { margin-bottom: 8px; }
.home-article strong { color: var(--text); font-weight: 600; }
.home-article code { font-family: 'JetBrains Mono', monospace; background: #eef1f7; padding: 1px 7px; border-radius: 4px; font-size: 0.9em; color: var(--accent); }

.use-cases { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 20px 0 32px; }
.use-case {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  transition: box-shadow var(--ease), transform var(--ease);
}
.use-case:hover { box-shadow: 0 4px 14px rgba(255,75,0,0.1); transform: translateY(-1px); }
.use-case strong { display: block; font-size: 0.95rem; font-weight: 800; color: var(--text); margin-bottom: 6px; }
.use-case p { font-size: 0.88rem; color: var(--text-muted); line-height: 1.7; margin: 0; }

/* ===== ARTICLE PAGES ===== */
.inner-page { max-width: 780px; margin: 0 auto; padding-top: 8px; width: 100%; box-sizing: border-box; overflow-wrap: break-word; }
.inner-page h1 { font-size: 2rem; font-weight: 700; color: var(--text); line-height: 1.2; letter-spacing: -0.4px; margin-bottom: 14px; }
.inner-page h2 { font-size: 1.25rem; font-weight: 700; color: var(--text); margin: 28px 0 10px; }
.inner-page p { font-size: 1rem; color: var(--text-muted); line-height: 1.85; margin-bottom: 16px; }
.inner-page ul { padding-left: 22px; margin-bottom: 16px; max-width: 100%; box-sizing: border-box; }
.inner-page li { font-size: 1rem; color: var(--text-muted); line-height: 1.85; margin-bottom: 6px; }
.article-page { max-width: 780px; margin: 0 auto; padding-top: 8px; }
/* Tool pages — wider than article but still centered */
.tool-page-layout { max-width: 900px; margin: 0 auto; }

/* ── Prev / Next tool navigation ── */
.tool-nav-row {
  display: flex;
  gap: .85rem;
  margin: 1.2rem 0;
}
.tool-nav-placeholder { flex: 1; }
.tool-nav-card {
  flex: 1;
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .8rem 1rem;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--card);
  text-decoration: none;
  color: var(--text);
  transition: border-color .18s, box-shadow .18s, transform .18s;
  min-width: 0;
}
.tool-nav-card:hover {
  border-color: var(--tnc-color, var(--accent));
  box-shadow: 0 4px 14px rgba(0,0,0,.09);
  transform: translateY(-2px);
}
.tool-nav-card.tool-nav-next { flex-direction: row-reverse; text-align: right; }
.tool-nav-icon {
  width: 36px; height: 36px; flex-shrink: 0;
  border-radius: 9px;
  background: color-mix(in srgb, var(--tnc-color, var(--accent)) 14%, transparent);
  color: var(--tnc-color, var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-size: .95rem;
}
.tool-nav-dir {
  font-size: .7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-muted); margin-bottom: 2px;
}
/* Arrow chevron button on right side of prev, left side of next */
.tool-nav-card .tool-nav-arrow {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; flex-shrink: 0;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  color: var(--tnc-color, var(--accent));
  font-size: .7rem;
  margin-left: auto;
  transition: background .15s, border-color .15s;
}
.tool-nav-card.tool-nav-next .tool-nav-arrow { margin-left: 0; margin-right: auto; }
.tool-nav-card:hover .tool-nav-arrow {
  background: color-mix(in srgb, var(--tnc-color, var(--accent)) 12%, transparent);
  border-color: var(--tnc-color, var(--accent));
}
.tool-nav-name {
  font-size: .88rem; font-weight: 700;
  color: var(--text); line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  min-width: 0;
}
.tool-nav-text {
  min-width: 0; overflow: hidden; flex: 1;
}
@media (max-width: 640px) {
  .tool-nav-row { gap: .45rem; }
  .tool-nav-card { padding: .6rem .7rem; gap: .4rem; }
  .tool-nav-icon { width: 28px; height: 28px; font-size: .75rem; flex-shrink: 0; }
  .tool-nav-arrow { width: 22px; height: 22px; font-size: .6rem; flex-shrink: 0; }
  .tool-nav-dir { font-size: .6rem; }
  .tool-nav-name { font-size: .75rem; }
}
.article-breadcrumb { display: flex; gap: 6px; align-items: center; margin-bottom: 18px; font-size: 0.85rem; color: var(--text-muted); font-weight: 600; }
.article-breadcrumb a:hover { color: var(--accent); }
.article-breadcrumb span { opacity: 0.4; }
.article-cat-badge { display: inline-block; padding: 3px 11px; border-radius: 999px; background: rgba(255,75,0,0.08); border: 1px solid rgba(255,75,0,0.15); font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.7px; color: var(--accent); margin-bottom: 12px; }
.article-page h1 { font-size: 2rem; font-weight: 700; color: var(--text); line-height: 1.2; letter-spacing: -0.4px; margin-bottom: 14px; }
.article-meta { font-size: 0.84rem; color: var(--text-muted); font-weight: 500; margin-bottom: 24px; border-bottom: 1px solid var(--border); padding-bottom: 20px; }
.article-intro { font-size: 1.05rem; color: var(--text-muted); line-height: 1.85; margin-bottom: 30px; }
.article-body { font-size: 1rem; color: var(--text-muted); line-height: 1.9; }
.article-body h2 { font-size: 1.45rem; font-weight: 700; color: var(--text); margin: 34px 0 12px; letter-spacing: -0.3px; }
.article-body h3 { font-size: 1.1rem; font-weight: 600; color: var(--text); margin: 22px 0 8px; }
.article-body p { margin-bottom: 16px; }
.article-body ul, .article-body ol { padding-left: 22px; margin-bottom: 16px; }
.article-body li { margin-bottom: 6px; }
.article-body strong { color: var(--text); font-weight: 700; }
.article-body a { color: var(--accent); }
.article-body a:hover { text-decoration: underline; }
.article-body .math-box {
  background: #f8f9fc; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 20px; margin: 20px 0;
  font-family: 'JetBrains Mono', monospace; font-size: 0.92rem;
  color: var(--text); overflow-x: auto; line-height: 1.8;
}
.article-body table { width: 100%; border-collapse: collapse; margin: 20px 0; font-size: 0.95rem; border-radius: var(--radius); overflow: hidden; }
.article-body th { background: #f1f4fa; padding: 10px 14px; text-align: left; font-weight: 800; color: var(--text); border-bottom: 2px solid var(--border); }
.article-body td { padding: 9px 14px; border-bottom: 1px solid var(--border); color: var(--text-muted); }
.article-body tr:last-child td { border-bottom: none; }
.article-body tr:hover td { background: #f8f9fc; }
.article-related { margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--border); }
.article-related h3 { font-size: 1.05rem; font-weight: 900; color: var(--text); margin-bottom: 14px; }
.article-related-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.article-related-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px; display: flex; align-items: center; gap: 10px;
  font-size: 0.88rem; font-weight: 700; color: var(--text-muted); transition: color var(--ease), background var(--ease), border-color var(--ease);
}
.article-related-card::before {
  font-family: 'Font Awesome 6 Free'; font-weight: 900;
  content: '\f002';
  font-size: .8rem; flex-shrink: 0; opacity: .65;
}
.article-related-card:hover { border-color: var(--accent); color: var(--accent); background: rgba(255,75,0,0.04); }
.article-related-card:hover::before { opacity: 1; }

/* ===== CATEGORY LANDING PAGES ===== */
.cat-landing { max-width: 780px; margin: 0 auto; }
.cat-hero {
  display: flex; align-items: flex-start; gap: 20px;
  background: linear-gradient(135deg, #FF4B00, #7c3aed);
  border-radius: 20px; padding: 32px 28px;
  margin-bottom: 32px; color: #fff;
}
.cat-hero-icon {
  font-size: 2.5rem; background: rgba(255,255,255,0.15);
  border-radius: 16px; width: 72px; height: 72px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; color: #fff;
}
.cat-hero h1 { font-size: 2rem; font-weight: 900; margin-bottom: 8px; color: #fff; }
.cat-hero p { font-size: 1rem; line-height: 1.75; color: rgba(255,255,255,0.82); }

.topic-grid { display: flex; flex-direction: column; gap: 10px; margin-bottom: 36px; }
.topic-card {
  display: flex; align-items: center; gap: 18px;
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: 18px 20px; color: var(--text);
  transition: border-color var(--ease), box-shadow var(--ease), transform var(--ease);
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.topic-card:hover { border-color: var(--accent); box-shadow: 0 4px 16px rgba(255,75,0,0.1); transform: translateX(3px); }
.topic-icon {
  width: 48px; height: 48px; border-radius: 12px;
  background: rgba(255,75,0,0.1); display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; color: var(--accent); flex-shrink: 0;
}
.topic-body { flex: 1; min-width: 0; }
.topic-body strong { display: block; font-size: 1rem; font-weight: 800; color: var(--text); margin-bottom: 4px; }
.topic-body p { font-size: 0.88rem; color: var(--text-muted); line-height: 1.6; margin: 0; }
.topic-arrow { color: var(--text-muted); font-size: 0.9rem; flex-shrink: 0; transition: transform var(--ease); }
.topic-card:hover .topic-arrow { transform: translateX(4px); color: var(--accent); }

.cat-about h2 { font-size: 1.3rem; font-weight: 800; color: var(--text); margin: 28px 0 10px; }
.cat-about p { font-size: 1rem; color: var(--text-muted); line-height: 1.85; margin-bottom: 14px; }
.cat-about a { color: var(--accent); }
.cat-about a:hover { text-decoration: underline; }

/* ===== INNER PAGES ===== */
.inner-page { max-width: 780px; margin: 0 auto; padding-top: 8px; }
.inner-page h1 { font-size: 2rem; font-weight: 700; color: var(--text); margin-bottom: 14px; }
.inner-page p { font-size: 1rem; color: var(--text-muted); line-height: 1.85; margin-bottom: 14px; }
.inner-page h2 { font-size: 1.2rem; font-weight: 700; color: var(--text); margin: 28px 0 10px; }
.inner-page a { color: var(--accent); }
.inner-page a:hover { text-decoration: underline; }
.inner-page .article-breadcrumb { margin-bottom: 20px; }

/* ===== 404 ===== */
.not-found { text-align: center; padding: 60px 20px; max-width: 520px; margin: 0 auto; }
.not-found-code { font-size: 7rem; font-weight: 900; line-height: 1; color: var(--border); letter-spacing: -4px; margin-bottom: 8px; }
.not-found-title { font-size: 1.8rem; font-weight: 700; color: var(--text); margin-bottom: 14px; }
.not-found-desc { font-size: 1rem; color: var(--text-muted); line-height: 1.8; margin-bottom: 32px; }
.not-found-btn { display: inline-flex; }
.not-found-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 32px; }
.not-found-links a { padding: 8px 16px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--border); font-size: 0.88rem; font-weight: 600; color: var(--text-muted); transition: border-color var(--ease), color var(--ease); }
.not-found-links a:hover { border-color: var(--accent); color: var(--accent); }

.contact-form { display: flex; flex-direction: column; gap: 18px; max-width: 520px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 0.9rem; font-weight: 800; color: var(--text); }
.form-group input, .form-group textarea {
  background: #fff; border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 10px 14px; color: var(--text); font-size: 1rem; font-family: inherit;
  outline: none; transition: border-color var(--ease);
}
.form-group input:focus, .form-group textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255,75,0,0.1); }
.form-group textarea { resize: vertical; min-height: 130px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 28px; border-radius: 999px;
  background: #FF4B00; color: #fff; font-size: 0.95rem; font-weight: 800;
  cursor: pointer; border: none;
  box-shadow: 0 4px 0 #b83500;
  transition: transform 0.08s, box-shadow 0.08s, background 0.15s;
}
.btn:hover { background: #e04200; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #b83500; }
a.btn, a.btn:visited { background: #FF4B00; color: #fff; }
a.btn:hover { background: #e04200; }

/* ===== FOOTER ===== */
/* ===== CSP FOOTER ===== */
.csp-footer {
  width: 100%; margin-top: 32px;
  background: #1f2023; border-top: none;
}
.csp-footer-card {
  max-width: 1200px; margin: 0 auto;
  padding: 28px 40px;
}
.csp-footer-top {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px;
}
.csp-footer-brand {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 1.5rem; font-weight: 700; color: #f1f1f1;
  letter-spacing: 0.4px; text-decoration: none; white-space: nowrap;
}
.csp-footer-brand img { height: 28px; width: 28px; object-fit: contain; border-radius: 5px; }
.csp-footer-links {
  display: flex; flex-wrap: wrap; align-items: center;
  list-style: none; margin: 0; padding: 0; gap: 6px;
}
.csp-footer-links li a {
  display: inline-block;
  font-size: 0.82rem; font-weight: 600; color: #b0b3b8;
  padding: 6px 14px;
  border: 1.5px solid #3a3d42;
  border-radius: 999px;
  background: #2a2d31;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  text-decoration: none;
}
.csp-footer-links li a:hover {
  background: #FF4B00;
  border-color: #FF4B00;
  color: #fff;
  text-decoration: none;
}
.csp-footer-hr {
  border: none; border-top: 1px solid #2e3135;
  margin: 24px -40px 24px;
}
.csp-footer-copy {
  display: block; font-size: 0.8rem; color: #6b7280; text-align: center;
}
.csp-footer-copy a { color: #9ca3af; font-weight: 600; }
.csp-footer-copy a:hover { color: #fff; text-decoration: underline; }

/* Footer social strip (sits above the dark footer) */
.csp-footer-social {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; padding: 20px 16px 14px;
  background: #fff; border-top: 1px solid #e5e7eb;
}
.csp-social-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 8px;
  color: #fff; font-size: 1.05rem; border: none;
  transition: transform 0.15s, filter 0.15s;
  text-decoration: none; flex-shrink: 0;
}
.csp-social-btn:hover { transform: translateY(-2px); filter: brightness(1.12); }
.csp-social-x  { background: #000; }
.csp-social-ig { background: linear-gradient(135deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%); }
.csp-social-yt { background: #ff0000; }
.csp-social-tt { background: #000; }

/* Scroll to top button */
.scroll-top-btn {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  width: 40px; height: 40px; border-radius: 8px;
  background: transparent; color: #FF4B00;
  border: 2px solid #FF4B00; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.95rem;
  box-shadow: none;
  opacity: 0; pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.15s, color 0.15s;
}
.scroll-top-btn.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.scroll-top-btn:hover { background: #FF4B00; color: #fff; }
.scroll-top-btn:active { transform: translateY(2px); }
@media (max-width: 768px) {
  .scroll-top-btn { display: none !important; }
}

/* ===== POSTS LISTING ===== */
.posts-intro { font-size: 1rem; color: var(--text-muted); margin: 0 0 36px; max-width: 680px; line-height: 1.65; }

.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
@media (max-width: 900px) { .posts-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .posts-grid { grid-template-columns: 1fr; } }

.post-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.18s, transform 0.18s;
}
.post-card:hover {
  box-shadow: 0 6px 24px rgba(255,75,0,0.11);
  transform: translateY(-2px);
}

.post-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 18px 20px 16px;
}

.post-card-cat {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #FF4B00;
  background: rgba(255,75,0,0.08);
  border-radius: 20px;
  padding: 3px 10px;
  width: fit-content;
}

.post-card-title {
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  line-height: 1.35;
}

.post-card-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.58;
  flex: 1;
}

.post-card-link {
  font-size: 0.83rem;
  font-weight: 600;
  color: #FF4B00;
  margin-top: 2px;
}


/* ===== VAULT OVERLAY ===== */
.vault-overlay {
  display: none; position: fixed; inset: 0;
  background: #080c18;
  background-image:
    radial-gradient(ellipse at 15% 50%, rgba(99,102,241,0.12) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 20%, rgba(255,75,0,0.08) 0%, transparent 45%),
    radial-gradient(ellipse at 60% 80%, rgba(79,70,229,0.09) 0%, transparent 50%);
  z-index: 99999;
  flex-direction: column;
  animation: vault-in 0.2s ease;
}
.vault-overlay .vault-topbar       { background: rgba(4,6,18,0.7); border-bottom-color: rgba(99,102,241,0.15); }
.vault-overlay .vault-cat-sidebar  { background: rgba(4,6,18,0.6); border-right-color: rgba(255,255,255,0.06); }
.vault-overlay .vault-main-area    { background: transparent; }
.vault-overlay .vault-frame-header { background: rgba(4,6,18,0.7); border-bottom-color: rgba(99,102,241,0.15); }
.vault-overlay .vault-side-left    { background: rgba(4,6,18,0.5); border-right-color: rgba(255,255,255,0.06); }
.vault-overlay .vault-side-right   { background: rgba(4,6,18,0.5); border-left-color: rgba(255,255,255,0.06); }
.vault-overlay .vault-req-panel,
.vault-overlay .vault-codes-panel  { background: transparent; }
.vault-overlay.open { display: flex; }
@keyframes vault-in { from { opacity: 0; transform: scale(0.99); } to { opacity: 1; transform: scale(1); } }

/* Top bar */
.vault-topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 0 16px; height: 50px; flex-shrink: 0;
  background: #0b0f20; border-bottom: 1px solid rgba(99,102,241,0.2);
  position: relative;
}
.vault-esc-hint { display: none; }
.vault-esc-close {
  display: inline-flex; align-items: center; justify-content: center;
  width: 14px; height: 14px; margin-left: 5px;
  font-size: 0.6rem; color: #4b5470; background: none; border: none;
  cursor: pointer; padding: 0; border-radius: 50%;
  transition: color 0.15s;
}
.vault-esc-close:hover { color: #94a3b8; }
.vault-esc-hint kbd {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: inherit; font-size: 0.7rem; font-weight: 700; color: #94a3b8;
  background: #131829; border: 1px solid #2a3050;
  border-bottom: 2px solid #2a3050;
  border-radius: 4px; padding: 1px 6px; letter-spacing: 0.02em;
  box-shadow: 0 1px 0 #040610;
}
.vault-topbar-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 13px; border-radius: 8px;
  background: rgba(99,102,241,0.08); border: 1px solid rgba(99,102,241,0.18);
  color: #8b95c9; font-size: 0.85rem; font-weight: 600;
  cursor: pointer; transition: color 0.18s, background 0.18s, border-color 0.18s; white-space: nowrap; flex-shrink: 0;
}
.vault-topbar-btn:hover { color: #e2e8ff; background: rgba(99,102,241,0.18); border-color: rgba(99,102,241,0.4); }
.vault-top-games { display: none; }
#vault-theme-btn { margin-left: auto; }
#vault-close-btn { background: #FF4B00; color: #fff; border-color: #FF4B00; display: flex; align-items: center; gap: 5px; border-radius: 8px; }
#vault-close-btn:hover { background: #e04300; color: #fff; border-color: #e04300; }
.vault-close-label { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.3px; }
@media (max-width: 600px) { .vault-close-label { display: none; } }
.vault-top-games .vtg-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid #2a1e10; flex-shrink: 0;
  background: #2a1e10; cursor: pointer;
  transition: transform 0.15s; position: relative;
}
.vtg-label { font-size: 0.85rem; font-weight: 600; color: #a89880; white-space: nowrap; margin-right: 12px; }
.vault-top-games .vtg-avatar + .vtg-avatar { margin-left: -10px; }
.vault-top-games .vtg-avatar:hover { transform: translateY(-3px) scale(1.12); z-index: 5; }
.vault-top-games .vtg-avatar img {
  width: 100%; height: 100%; object-fit: cover;
  border-radius: 50%; display: block;
  transform: scale(1.25);
}
.vault-top-games .vtg-avatar.vtg-first { z-index: 4; }
.vault-top-games .vtg-avatar.vtg-first::before,
.vault-top-games .vtg-avatar.vtg-first::after {
  content: '';
  position: absolute; inset: 0; border-radius: 50%;
  border: 1.5px solid rgba(194,65,12,0.85);
  animation: vtg-signal 2.2s ease-out infinite;
  pointer-events: none;
}
.vault-top-games .vtg-avatar.vtg-first::after { animation-delay: 0.8s; }
@keyframes vtg-signal {
  0%   { transform: scale(1);    opacity: 1; }
  100% { transform: scale(2.6);  opacity: 0; }
}
.vault-topbar-center {
  position: absolute; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; justify-content: center; gap: 0;
  width: 60%; max-width: 620px; min-width: 280px;
  pointer-events: none;
}
.vault-topbar-center > * { pointer-events: auto; }
.vault-logo-text { font-size: 1.1rem; font-weight: 800; color: #f1ece6; white-space: nowrap; letter-spacing: -0.3px; }
.vault-search-wrap { position: relative; width: 100%; max-width: 340px; min-width: 200px; flex: 1; }
.vault-search-icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: #4b5a8a; pointer-events: none; }
.vault-search {
  width: 100%; background: rgba(99,102,241,0.07); border: 1.5px solid rgba(99,102,241,0.2);
  border-radius: 10px; padding: 7px 32px 7px 36px; color: #e2e8ff;
  font-size: 0.88rem; font-family: inherit; outline: none; transition: border-color 0.18s, background 0.18s;
}
.vault-search:focus { border-color: rgba(99,102,241,0.5); background: rgba(99,102,241,0.12); }
.vault-search::placeholder { color: #3d4a70; }
.vault-search-clear {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: #a89880; font-size: 0.75rem;
  cursor: pointer; padding: 0; line-height: 1; width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
}
.vault-search-clear:hover { color: #f1ece6; background: rgba(255,255,255,0.08); }

/* Body layout: sidebar + main */
.vault-body { display: flex; flex: 1; overflow: hidden; }

/* Sidebar toggle button (desktop only) */
.vault-sidebar-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 6px; flex-shrink: 0;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
  color: #a89880; font-size: 0.85rem; cursor: pointer;
  transition: color 0.18s, background 0.18s, border-color 0.18s;
}
.vault-sidebar-toggle:hover { color: #f1ece6; background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.2); }

/* Category sidebar */
.vault-cat-sidebar {
  width: 162px; flex-shrink: 0;
  background: #0b0f20; border-right: 1px solid rgba(99,102,241,0.12);
  overflow-y: auto; padding: 10px 8px;
  display: flex; flex-direction: column; gap: 2px;
  transition: width 0.22s ease, opacity 0.18s ease;
}
.vault-cat-sidebar.sidebar-collapsed {
  width: 0; overflow: hidden; opacity: 0; padding: 0; border-right: none;
}
.vault-cat-link {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 10px; border-radius: 8px;
  font-size: 0.84rem; font-weight: 600; color: #6b7aa8;
  border-left: none;
  border-bottom: none;
  cursor: pointer; transition: color 0.18s, background 0.18s;
  white-space: nowrap;
}
.vault-cat-link i { width: 16px; text-align: center; flex-shrink: 0; font-size: 0.95rem; transition: opacity 0.18s; }
/* Colorful category icons */
.vault-cat-link[data-cat=""]         i { color: #a78bfa; }
.vault-cat-link[data-cat="action"]   i { color: #f59e0b; }
.vault-cat-link[data-cat="adventure"]i { color: #34d399; }
.vault-cat-link[data-cat="arcade"]   i { color: #f472b6; }
.vault-cat-link[data-cat="casual"]   i { color: #60a5fa; }
.vault-cat-link[data-cat="horror"]   i { color: #a3e635; }
.vault-cat-link[data-cat="idle"]     i { color: #94a3b8; }
.vault-cat-link[data-cat="io"]       i { color: #22d3ee; }
.vault-cat-link[data-cat="platformer"]i{ color: #fb923c; }
.vault-cat-link[data-cat="puzzle"]   i { color: #c084fc; }
.vault-cat-link[data-cat="racing"]   i { color: #f43f5e; }
.vault-cat-link[data-cat="shooter"]  i { color: #ef4444; }
.vault-cat-link[data-cat="sports"]   i { color: #4ade80; }
.vault-cat-link[data-cat="strategy"]   i { color: #e2c87a; }
.vault-cat-link[data-cat="open-world"] i { color: #ff6b2b; }
.vault-cat-link[data-cat="multiplayer"]i { color: #f87171; }
.vault-cat-exit-btn i { color: #fff; }
.vault-cat-link + .vault-cat-link { border-top: none; }
.vault-cat-link:hover { color: #c7d0f5; background: rgba(99,102,241,0.1); }
.v-cat-badge { margin-left: auto; font-size: 0.6rem; font-weight: 700; padding: 1px 5px; border-radius: 4px; letter-spacing: 0.03em; flex-shrink: 0; }
.v-cat-badge-hot { background: rgba(239,68,68,0.18); color: #f87171; }
.v-cat-badge-top { background: rgba(168,85,247,0.18); color: #c084fc; }
.v-cat-badge-new { background: rgba(34,197,94,0.18); color: #4ade80; }
.vault-cat-link.active { color: #e2e8ff; font-weight: 700; background: rgba(99,102,241,0.15); border-left: none; outline: 1px solid rgba(99,102,241,0.25); }

/* Main grid area */
.vault-main-area { flex: 1; overflow-y: auto; padding: 10px 14px 14px; }
.vault-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  grid-auto-rows: auto;
  grid-auto-flow: dense;
  gap: 12px;
}
.vault-grid-sentinel { grid-column: 1 / -1; height: 1px; }

/* ── Vault ad cards ── */
.v-card-ad {
  background: #0d1228;
  border: 1px solid rgba(99,102,241,0.12);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.v-card-ad::after {
  content: 'Ad';
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 9px;
  color: #5a4a35;
  letter-spacing: 0.5px;
  pointer-events: none;
  z-index: 1;
}
.v-card-ad-300x250 { grid-column: span 2; grid-row: span 2; }
.v-card-ad-160x300 { grid-column: span 1; grid-row: span 3; }
.v-card-ad-native  { grid-column: 1 / -1; min-height: 100px; overflow: visible; }

/* Card */
.v-card {
  background: #0f1428; border: 1px solid rgba(99,102,241,0.14);
  border-radius: 12px; overflow: hidden; cursor: pointer;
  display: block; transition: border-color 0.18s, transform 0.15s, box-shadow 0.18s;
  height: auto;
}
.v-card-featured { grid-column: span 2; grid-row: span 2; }

/* Diagonal shine sweep on featured cards */
.v-shine {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden;
  border-radius: 8px; z-index: 2;
}
.v-shine::after {
  content: '';
  position: absolute;
  top: -80%; left: 0;
  width: 40%; height: 260%;
  background: linear-gradient(
    105deg,
    transparent 30%,
    rgba(255,255,255,0.13) 48%,
    rgba(255,255,255,0.22) 52%,
    transparent 70%
  );
  animation: v-shine-sweep 5s ease-in-out infinite;
  animation-delay: var(--shine-delay, 0s);
}
@keyframes v-shine-sweep {
  0%   { transform: translateX(-150%) skewX(-15deg); opacity: 0; }
  8%   { transform: translateX(-150%) skewX(-15deg); opacity: 1; }
  40%  { transform: translateX(325%) skewX(-15deg); opacity: 1; }
  41%  { transform: translateX(325%) skewX(-15deg); opacity: 0; }
  100% { transform: translateX(325%) skewX(-15deg); opacity: 0; }
}
/* Stagger shine timing per card position */
.v-card-featured:nth-child(2)  .v-shine { --shine-delay: 0s; }
.v-card-featured:nth-child(11) .v-shine { --shine-delay: 0.7s; }
.v-card-featured:nth-child(20) .v-shine { --shine-delay: 1.4s; }
.v-card-featured:nth-child(29) .v-shine { --shine-delay: 2.1s; }
.v-card-featured:nth-child(38) .v-shine { --shine-delay: 2.8s; }
.v-card-featured:nth-child(n)  .v-shine { --shine-delay: 1s; }

.v-card:hover { border-color: rgba(99,102,241,0.5) !important; transform: translateY(-3px); box-shadow: 0 8px 24px rgba(99,102,241,0.15); }
.v-thumb {
  position: relative; overflow: hidden;
  background: #1e1509;
  height: auto; aspect-ratio: 1 / 1;
}
/* Shimmer loading */
.v-thumb::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.04), transparent);
  background-size: 200% 100%; animation: vshimmer 1.4s infinite;
}
.v-thumb.loaded::before { display: none; }
@keyframes vshimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
.v-thumb img {
  width: 100%; height: 100%; display: block;
  object-fit: cover; position: absolute; inset: 0;
  opacity: 0; transition: opacity 0.3s ease;
}
.v-thumb img.loaded { opacity: 1; }

/* ── Favourite heart button ── */
.v-fav-btn {
  position: absolute; top: 6px; right: 6px; z-index: 4;
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(0,0,0,0.45); backdrop-filter: blur(4px);
  border: none; cursor: pointer; padding: 0;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.7); font-size: .8rem;
  opacity: 0; transform: scale(0.8);
  transition: opacity .18s, transform .18s, color .15s, background .15s;
}
.v-card:hover .v-fav-btn { opacity: 1; transform: scale(1); }
.v-fav-btn.active { opacity: 1; transform: scale(1); color: #f43f5e; background: rgba(0,0,0,0.55); }
.v-fav-btn:hover { background: rgba(0,0,0,0.7); color: #f43f5e; }
.v-fav-btn.active:hover { color: #fb7185; }

/* ── New game badge ── */
.v-new-badge {
  position: absolute; top: 6px; left: 6px; z-index: 5;
  background: #22c55e; color: #fff;
  font-size: 0.58rem; font-weight: 800;
  padding: 2px 7px; border-radius: 4px;
  letter-spacing: 0.6px; text-transform: uppercase;
  pointer-events: none; line-height: 1.4;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
@keyframes fav-pop { 0% { transform: scale(1); } 40% { transform: scale(1.45); } 70% { transform: scale(0.9); } 100% { transform: scale(1); } }
.v-fav-btn.pop { animation: fav-pop 0.35s ease; }

/* Topbar favourites button */
.vault-fav-topbar-btn { position: relative; color: #f43f5e; transition: box-shadow .18s; }
.vault-fav-topbar-btn i { font-size: .9rem; }
.vault-fav-topbar-btn.active { box-shadow: 0 0 0 3px rgba(244,63,94,0.25); border-radius: 6px; }
.vault-fav-count {
  position: absolute; top: -5px; right: -5px;
  min-width: 16px; height: 16px; padding: 0 3px;
  background: #f43f5e; color: #fff; font-size: .65rem; font-weight: 700;
  border-radius: 8px; display: inline-flex; align-items: center; justify-content: center;
  pointer-events: none;
}

/* Sidebar favourites link */
.vault-fav-link { position: relative; }
.vault-fav-count-side {
  margin-left: auto; min-width: 18px; height: 18px; padding: 0 4px;
  background: #f43f5e; color: #fff; font-size: .65rem; font-weight: 700;
  border-radius: 9px; display: inline-flex; align-items: center; justify-content: center;
}

/* Hover overlay */
.v-card-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.38);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.2s ease;
}
.v-card:hover .v-card-overlay { opacity: 1; }
.v-play-btn {
  width: 48px; height: 48px; border-radius: 50%;
  background: #c2410c; color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 6px rgba(194,65,12,0.25);
}
.v-play-btn svg { width: 18px; height: 18px; margin-left: 3px; }
/* Vignette title */
.v-card-info {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 28px 9px 9px;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 55%, transparent 100%);
  pointer-events: none;
}
.v-card-name {
  display: block; font-size: 0.78rem; font-weight: 700; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-shadow: 0 1px 4px rgba(0,0,0,0.7); margin: 0;
}
.v-card-empty { text-align: center; color: #6b5a46; font-size: 0.9rem; padding: 60px 20px; grid-column: 1/-1; }

/* ── Vault skeleton loading ── */
@keyframes vault-shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position:  400px 0; }
}
.v-card-skeleton { pointer-events: none; cursor: default; }
.v-card-skeleton .v-thumb {
  background: linear-gradient(90deg, #281d0e 25%, #3a2a12 50%, #281d0e 75%);
  background-size: 800px 100%;
  animation: vault-shimmer 1.4s infinite linear;
}
.vault-overlay.vault-light .v-card-skeleton .v-thumb {
  background: linear-gradient(90deg, #ebebeb 25%, #d8d8d8 50%, #ebebeb 75%);
  background-size: 800px 100%;
}

/* Play view */
.vault-play-view { flex: 1; overflow: hidden; display: flex; flex-direction: column; min-height: 0; }
.vault-split { display: flex; flex: 1; min-height: 0; }
.vault-side-left, .vault-side-right {
  width: 180px; flex-shrink: 0; background: #130f09;
  overflow-y: auto; padding: 10px 8px;
}
.vault-side-left { border-right: 1px solid #2a1e10; }
.vault-side-right { border-left: 1px solid #2a1e10; }
.vault-side-label { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: #6b5a46; padding: 4px 8px 10px; }
.vault-side-card { display: block; border-radius: 6px; overflow: hidden; background: #1c1208; margin-bottom: 8px; cursor: pointer; border: 1px solid #2a1e10; transition: border-color 0.15s; }
.vault-side-card:hover { border-color: #c2410c; }
.vault-side-thumb { width: 100%; aspect-ratio: 16/10; background-size: cover; background-position: center; background-color: #1e1509; }
.vault-side-info { padding: 5px 8px 6px; }
.vault-side-title { font-size: 0.68rem; font-weight: 600; color: #c9b99a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.vault-main-frame { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-height: 0; }
.vault-frame-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; background: #130f09; border-bottom: 1px solid #2a1e10; flex-shrink: 0; position: relative; }
.vault-frame-left { display: flex; align-items: center; gap: 6px; }
.vault-frame-center { position: absolute; left: 50%; transform: translateX(-50%); display: flex; align-items: center; pointer-events: none; }
.vault-frame-center > * { pointer-events: auto; }
.vault-play-title { font-size: 1rem; font-weight: 700; color: #f1ece6; white-space: nowrap; }
.vault-fs-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 6px; background: #1e1509; border: 1px solid #2a1e10; color: #a89880; cursor: pointer; transition: color 0.15s, border-color 0.15s; }
.vault-fs-btn:hover { color: #f1ece6; border-color: #c2410c; }
.vault-frame-btns { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
#vault-loader-bar { position: absolute; bottom: -1px; left: 0; right: 0; height: 3px; background: transparent; pointer-events: none; transition: opacity 0.3s; }
#vault-loader-fill { height: 100%; width: 0%; background: linear-gradient(90deg, #ff6b35, #ff3f6c); border-radius: 0 2px 2px 0; }
.vault-overlay.vault-light #vault-loader-fill { background: linear-gradient(90deg, #4f8ef7, #7c3aed); }
.vault-play-fav-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 6px; background: #1e1509; border: 1px solid #2a1e10; color: #a89880; font-size: 0.95rem; cursor: pointer; transition: color 0.15s, border-color 0.15s, background 0.15s; -webkit-tap-highlight-color: transparent; }
.vault-play-fav-btn:hover { color: #f43f5e; border-color: #f43f5e; }
.vault-play-fav-btn.active { color: #f43f5e; border-color: #f43f5e; background: rgba(244,63,94,0.1); }
.vault-play-fav-btn.pop { animation: v-fav-pop 0.28s ease; }
@keyframes v-fav-pop { 0%{transform:scale(1)} 40%{transform:scale(1.35)} 100%{transform:scale(1)} }
.vault-overlay.vault-light .vault-play-fav-btn { background: #f0f0f0; border-color: #d0d0d0; color: #888; }
.vault-overlay.vault-light .vault-play-fav-btn:hover { color: #f43f5e; border-color: #f43f5e; }
.vault-overlay.vault-light .vault-play-fav-btn.active { color: #f43f5e; border-color: #f43f5e; background: rgba(244,63,94,0.08); }
#vault-iframe { width: 100%; height: 100%; border: none; flex: 1; }

/* ===== REQUEST GAME PANEL ===== */
.vault-codes-link i { color: #facc15 !important; }
.vault-codes-link { border-bottom: none; color: #ca8a04 !important; font-weight: 600; }
.vault-codes-link.active { color: #facc15 !important; border-left-color: #facc15; }
.vault-codes-panel { flex-direction: column; padding: 20px 16px; overflow-y: auto; height: 100%; box-sizing: border-box; }
.codes-header { margin-bottom: 16px; }
.codes-title { font-size: 1.1rem; font-weight: 800; color: #f1ece6; margin-bottom: 10px; }
.codes-search { width: 100%; box-sizing: border-box; padding: 7px 12px; border-radius: 999px; border: 1.5px solid rgba(255,255,255,0.12); background: rgba(255,255,255,0.07); color: #f1ece6; font-size: 0.85rem; font-family: inherit; outline: none; transition: border-color 0.18s, background 0.18s; }
.codes-search::placeholder { color: rgba(255,255,255,0.35); }
.codes-search:focus { border-color: rgba(255,255,255,0.3); background: rgba(255,255,255,0.1); }
.vault-overlay.vault-light .codes-search { background: #fff; border-color: #d4d4d4; color: #111; }
.vault-overlay.vault-light .codes-search::placeholder { color: #aaa; }
.vault-overlay.vault-light .codes-search:focus { border-color: #666; background: #fff; }
.codes-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; padding: 0 10px; }
.codes-row { display: flex; align-items: center; justify-content: space-between; padding: 7px 10px; border-radius: 7px; cursor: pointer; transition: background 0.15s; }
.codes-row:hover { background: rgba(0,0,0,0.35); }
.codes-thumb { width: 28px; height: 28px; border-radius: 5px; object-fit: cover; flex-shrink: 0; margin-right: 8px; background: #1a130a; }
.codes-name { font-size: 0.82rem; color: #e8e0d8; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-right: 10px; }
.codes-code { font-family: 'JetBrains Mono', monospace; font-size: 0.85rem; font-weight: 700; color: #facc15; background: rgba(250,204,21,0.12); padding: 2px 8px; border-radius: 5px; flex-shrink: 0; letter-spacing: 2px; }
.vault-overlay.vault-light .codes-title { color: #111; }
.vault-overlay.vault-light .codes-name { color: #222; }
.vault-overlay.vault-light .codes-code { color: #dc2626; background: rgba(220,38,38,0.1); }
.vault-overlay.vault-light .codes-row:hover { background: rgba(0,0,0,0.08); }
.codes-empty { color: var(--text-muted); font-size: 0.85rem; padding: 16px 0; text-align: center; }
.vault-cat-exit-btn {
  display: flex; align-items: center; gap: 9px;
  margin-top: auto;
  padding: 11px 14px;
  font-size: 0.85rem; font-weight: 700;
  color: #fff;
  background: #ef4444;
  border: none;
  border-radius: 0;
  cursor: pointer; transition: background 0.18s;
  white-space: nowrap; text-align: left;
  width: 100%; flex-shrink: 0;
}
.vault-cat-exit-btn:hover { background: #dc2626; }
.vault-req-panel { padding: 24px 20px; overflow-y: auto; height: 100%; box-sizing: border-box; }
.req-header { margin-bottom: 22px; }
.req-title { font-size: 1.15rem; font-weight: 800; color: #f1ece6; margin-bottom: 4px; }
.req-sub { font-size: 0.82rem; color: #a89880; }
.req-loading { color: #6b5a46; font-size: 0.88rem; padding: 8px 0; }

/* ── Poll options grid (Instagram-style) ── */
.req-poll-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 24px; }
.req-poll-option {
  position: relative; overflow: hidden;
  border: 1.5px solid #3a2510; border-radius: 10px;
  padding: 10px 12px; cursor: pointer;
  background: #1c1208;
  transition: border-color 0.2s, transform 0.12s;
  min-height: 52px; display: flex; flex-direction: column; justify-content: center;
  user-select: none;
}
.req-poll-option:hover:not(.req-revealed) { border-color: #c2410c; transform: translateY(-1px); }
.req-poll-fill {
  position: absolute; top: 0; left: 0; height: 100%; width: 0%;
  background: rgba(194,65,12,0.22); border-radius: 10px;
  transition: width 0.7s cubic-bezier(0.4,0,0.2,1);
  pointer-events: none;
}
.req-poll-option.req-my-vote .req-poll-fill { background: rgba(234,88,12,0.32); }
.req-poll-option.req-my-vote { border-color: #c2410c; }
.req-poll-label {
  position: relative; font-size: 0.82rem; font-weight: 700;
  color: #f1ece6; line-height: 1.3; margin-bottom: 3px;
}
.req-poll-bottom {
  position: relative; display: flex; align-items: center; justify-content: space-between;
}
.req-poll-pct {
  font-size: 0.75rem; font-weight: 700; color: #ea580c;
  opacity: 0; transition: opacity 0.4s;
}
.req-poll-check {
  font-size: 0.7rem; color: #ea580c; font-weight: 700;
  opacity: 0; transition: opacity 0.3s;
}
.req-poll-option.req-revealed .req-poll-pct { opacity: 1; }
.req-poll-option.req-revealed.req-my-vote .req-poll-check { opacity: 1; }
.req-poll-option.req-revealed { cursor: default; }

/* ── Poll skeleton ── */
.req-poll-option.req-skeleton { cursor: default; pointer-events: none; }
.req-skel-line {
  height: 11px; width: 70%; border-radius: 4px;
  background: linear-gradient(90deg, #2a1e10 25%, #3a2a15 50%, #2a1e10 75%);
  background-size: 200% 100%; animation: req-shimmer 1.4s infinite;
}
.req-skel-pct {
  display: inline-block; height: 9px; width: 28px; border-radius: 3px;
  background: linear-gradient(90deg, #2a1e10 25%, #3a2a15 50%, #2a1e10 75%);
  background-size: 200% 100%; animation: req-shimmer 1.4s infinite;
}
@keyframes req-shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* ── Custom suggest section ── */
.req-divider { border: none; border-top: 1px solid #2a1e10; margin: 20px 0; }
.req-custom-label { font-size: 0.82rem; color: #a89880; margin-bottom: 10px; }
.req-custom-row { display: flex; gap: 8px; }
.req-custom-input {
  flex: 1; background: #1e1509; border: 1.5px solid #2a1e10; border-radius: 10px;
  padding: 10px 14px; color: #f1ece6; font-size: 0.88rem; outline: none; font-family: inherit;
}
.req-custom-input:focus { border-color: #c2410c; }
.req-submit-btn {
  background: #c2410c; color: #fff; border: none; border-radius: 10px;
  padding: 10px 18px; font-size: 0.85rem; font-weight: 700; cursor: pointer; white-space: nowrap;
  transition: background 0.15s;
}
.req-submit-btn:hover { background: #ea580c; }
.req-msg { font-size: 0.82rem; margin-top: 10px; min-height: 18px; }
.req-msg.ok  { color: #22c55e; }
.req-msg.err { color: #ef4444; }

/* ===== VAULT LIGHT THEME ===== */
.vault-overlay.vault-light { background: #f5f6f7; }
.vault-overlay.vault-light .vault-topbar { background: #f5f6f7; border-bottom-color: transparent; }
.vault-overlay.vault-light .vault-topbar-btn { background: #f0f0f0; border-color: #d0d0d0; color: #555; }
.vault-overlay.vault-light .vault-topbar-btn:hover { color: #111; border-color: #888; }
.vault-overlay.vault-light .vault-sidebar-toggle { background: #f0f0f0; border-color: #d0d0d0; color: #555; }
.vault-overlay.vault-light .vault-sidebar-toggle:hover { color: #111; border-color: #888; }
.vault-overlay.vault-light .vault-search { background: #fff; border-color: #d4d4d4; color: #111; }
.vault-overlay.vault-light .vault-search:focus { border-color: #666; background: #fff; }
.vault-overlay.vault-light .vault-search::placeholder { color: #aaa; }
.vault-overlay.vault-light .vault-search-icon { color: #aaa; }
.vault-overlay.vault-light .vault-search-clear { color: #aaa; }
.vault-overlay.vault-light .vault-search-clear:hover { color: #333; background: rgba(0,0,0,0.06); }
.vault-overlay.vault-light .vault-cat-sidebar { background: #f5f6f7; border-right-color: transparent; }
.vault-overlay.vault-light .vault-cat-link { color: #666; }
.vault-overlay.vault-light .vault-cat-link:hover { color: #111; background: #f0f0f0; border-left-color: #555; }
.vault-overlay.vault-light .vault-cat-link.active { color: #111; font-weight: 700; background: linear-gradient(90deg, #ebebeb, transparent); border-left-color: #444; }
.vault-overlay.vault-light .v-card { background: #fff; border-color: #e0e0e0; }
.vault-overlay.vault-light .v-card:hover { border-color: transparent; }
.vault-overlay.vault-light .v-thumb { background: #e8e8e8; }
.vault-overlay.vault-light .v-thumb::before { background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent); background-size: 200% 100%; }
.vault-overlay.vault-light .v-card-empty { color: #aaa; }
.vault-overlay.vault-light .v-play-btn { background: #444; box-shadow: 0 0 0 6px rgba(68,68,68,0.2); }
.vault-overlay.vault-light .vault-side-left, .vault-overlay.vault-light .vault-side-right { background: #f5f6f7; }
.vault-overlay.vault-light .vault-side-left { border-right-color: transparent; }
.vault-overlay.vault-light .vault-side-right { border-left-color: transparent; }
.vault-overlay.vault-light .vault-side-label { color: #aaa; }
.vault-overlay.vault-light .vault-side-card { background: #fff; border-color: #e0e0e0; }
.vault-overlay.vault-light .vault-side-card:hover { border-color: #555; }
.vault-overlay.vault-light .vault-side-thumb { background-color: #e8e8e8; }
.vault-overlay.vault-light .vault-side-title { color: #555; }
.vault-overlay.vault-light .vault-frame-header { background: #f5f6f7; border-bottom-color: transparent; }
.vault-overlay.vault-light .vault-play-title { color: #111; }
.vault-overlay.vault-light .vault-fs-btn { background: #f0f0f0; border-color: #d0d0d0; color: #666; }
.vault-overlay.vault-light .vault-fs-btn:hover { color: #111; border-color: #555; }
.vault-overlay.vault-light .vault-cat-link + .vault-cat-link { border-top-color: #e0e0e0; }
.vault-overlay.vault-light .vault-cat-exit-btn { background: #ef4444; color: #fff; }
.vault-overlay.vault-light .vault-cat-exit-btn:hover { background: #dc2626; }
.vault-overlay.vault-light .req-title { color: #111; }
.vault-overlay.vault-light .req-sub { color: #666; }
.vault-overlay.vault-light .req-loading { color: #aaa; }
.vault-overlay.vault-light .req-poll-option { background: #fff; border-color: #ddd; }
.vault-overlay.vault-light .req-poll-option:hover:not(.req-revealed) { border-color: #555; }
.vault-overlay.vault-light .req-poll-fill { background: rgba(80,80,80,0.12); }
.vault-overlay.vault-light .req-poll-option.req-my-vote .req-poll-fill { background: rgba(80,80,80,0.22); }
.vault-overlay.vault-light .req-poll-option.req-my-vote { border-color: #555; }
.vault-overlay.vault-light .req-poll-label { color: #111; }
.vault-overlay.vault-light .req-poll-pct { color: #444; }
.vault-overlay.vault-light .req-poll-check { color: #444; }
.vault-overlay.vault-light .req-skel-line { background: linear-gradient(90deg, #e8e8e8 25%, #f4f4f4 50%, #e8e8e8 75%); background-size: 200% 100%; }
.vault-overlay.vault-light .req-skel-pct { background: linear-gradient(90deg, #e8e8e8 25%, #f4f4f4 50%, #e8e8e8 75%); background-size: 200% 100%; }
.vault-overlay.vault-light .req-divider { border-top-color: #e0e0e0; }
.vault-overlay.vault-light .req-custom-label { color: #666; }
.vault-overlay.vault-light .req-custom-input { background: #fff; border-color: #d4d4d4; color: #111; }
.vault-overlay.vault-light .req-custom-input:focus { border-color: #555; }
.vault-overlay.vault-light .req-submit-btn { background: #444; }
.vault-overlay.vault-light .req-submit-btn:hover { background: #222; }

/* ===== 1366×768 LAPTOP OPTIMISATION ===== */
@media (max-width: 1400px) and (min-width: 769px) {
  body:not(.page-home) .page-wrap { padding: 36px 32px 48px; }
  .home-section-wrap { padding: 0 32px; }
  .about-topics-block { padding: 1.4rem 2rem 1.2rem; }
}

/* Hero responsive */
@media (max-width: 768px) {
  .hero { height: auto; min-height: 0; padding: 56px 0 44px; max-height: none; }
  .hero-h1 { font-size: 1.9rem; letter-spacing: -0.5px; }
  .hero-sub { font-size: 0.92rem; }
  .hero-badges { display: none; }
}
@media (min-width: 769px) and (max-width: 1024px) {
  .hero-h1 { font-size: 2.2rem; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) { .vault-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); } }
@media (max-width: 900px) { .vault-cat-sidebar { display: none; } .vault-side-right { display: none; } }

/* ===== TABLET (769px–1024px) ===== */
@media (min-width: 769px) and (max-width: 1024px) {
  /* Header — hide tagline, tighten spacing */
  .site-tagline { display: none; }
  .header-nav a { font-size: 0.82rem; padding: 6px 8px; }
  .a11y-wrap { display: none; }

  /* Page */
  body:not(.page-home) .page-wrap { padding: 28px 24px 40px; }
  .home-section-wrap { padding: 0 24px; }
  .home-layout { gap: 0; }

  /* Tools split: stack earlier on tablet */
  .tools-split-layout { flex-direction: column; }
  .tools-mascot-col { flex: none; position: static; width: 100%; max-width: 280px; margin: 0 auto; }
  .tools-mascot-desktop { display: none; }
  .tools-mascot-mobile { display: block; }
  .tools-grid-col .home-tools-grid { grid-template-columns: repeat(3, 1fr); }

  /* Vault — hide side panels in grid/play view */
  .vault-side-left { display: none; }
  .vault-side-right { display: none; }
  .vault-sidebar-toggle { display: none; }

  /* Vault grid — tighter cards */
  .vault-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); grid-auto-rows: auto; }

  /* Vault topbar — prevent overlap */
  .vault-topbar-center { position: static; transform: none; flex: 1; min-width: 0; }
  #vault-theme-btn { margin-left: 0; }
  .vault-top-games { display: none; }
  .vault-esc-hint { display: none; }

  /* Play view */
  .vault-in-play .vault-topbar-center { flex: 1; min-width: 0; }
  .vault-in-play .vault-search-wrap { min-width: 0; max-width: none; }
}

@media (max-width: 768px) {
  /* Header */
  .header-nav, .site-tagline { display: none; }
  .mob-menu-btn { display: flex; }
  .a11y-wrap { display: none; }
  .header-inner { height: 54px; padding: 0 16px; }
  .logo { font-size: 1.15rem; }
  .logo-img { width: 22px; height: 22px; }

  /* Footer */
  .csp-footer-card { padding: 20px 16px; }
  .csp-footer-hr { margin-left: -16px; margin-right: -16px; }
  .csp-footer-top { flex-direction: column; align-items: center; gap: 10px; }
  .csp-footer-brand { justify-content: center; width: 100%; }
  .csp-footer-links { gap: 6px; justify-content: center; width: 100%; flex-wrap: wrap; margin-top: 10px; }

  /* Layout */
  body:not(.page-home) .page-wrap { padding: 22px 16px 36px; }
  .home-section-wrap { padding: 0 16px; }
  .calc-section-wrap { padding: 36px 16px 40px; }
  .home-hero-title { font-size: 1.7rem; }
  .home-article h1 { font-size: 1.4rem; }
  .home-hero { padding: 0 0 28px; }
  .home-hero-desc { font-size: 0.92rem; max-width: 100%; }

  /* Vault topbar — revert search to normal flow on mobile */
  .vault-topbar { position: static; }
  .vault-topbar-center { position: static; transform: none; width: auto; flex: 1; min-width: 0; }
  #vault-theme-btn { margin-left: 0; }
  .vault-top-games { display: none; }
  .vault-esc-hint { display: none; }

  /* Vault play view on mobile — let search fill available space, cancel auto-margin */
  .vault-in-play .vault-topbar-center { flex: 1; min-width: 0; }
  .vault-in-play .vault-search-wrap { min-width: 0; max-width: none; }
  .vault-in-play #vault-theme-btn { margin-left: 0; }

  /* Hide frame back button on mobile — use topbar back button instead */
  #vault-frame-back-btn { display: none !important; }


  /* Vault — mobile: plain 3-col 1:1 grid, no featured cards */
  .vault-grid { grid-template-columns: repeat(3, 1fr); grid-auto-rows: auto; grid-auto-flow: row; }
  .v-card-featured { grid-column: span 1; grid-row: span 1; }
  .v-card { height: auto; }
  .v-thumb { height: auto; aspect-ratio: 1 / 1; }
  .vault-side-left { display: none; }
  .vault-cat-sidebar { display: none; }
  .vault-side-right { display: none; }
  .vault-sidebar-toggle { display: none; }

  /* Other */
  .article-related-grid { grid-template-columns: 1fr 1fr; }
  .use-cases { grid-template-columns: 1fr; }
  .cat-hero { flex-direction: column; gap: 14px; }

  /* Article pages */
  .article-page h1 { font-size: 1.6rem; }

  /* Body text */
  .article-body, .inner-page p, .article-intro, .home-article p,
  .cat-about p, .article-body p { font-size: 0.92rem; }
}
@media (max-width: 480px) {
  .vault-grid { grid-template-columns: repeat(3, 1fr); grid-auto-rows: auto; }
  .article-related-grid { grid-template-columns: 1fr; }
  .ra-grid { grid-template-columns: 1fr; }
  .article-page h1, .cat-hero h1 { font-size: 1.4rem; }
  .calc-section-wrap { padding: 36px 16px 48px; gap: 32px; }
  .calc-col { max-width: 100%; }
  .home-hero-title { font-size: 1.35rem; }
  .logo { font-size: 1.05rem; }
}

/* ===== CALCULATOR THEME SWITCHER ===== */
.calc-theme-row {
  display: flex; gap: 5px; justify-content: center; flex-wrap: nowrap;
  margin-bottom: 20px;
  width: max-content;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
}
.calc-theme-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 12px; border-radius: 999px;
  border: 2px solid var(--border);
  background: var(--card);
  font-size: 0.75rem; font-weight: 500; letter-spacing: 0.3px;
  color: var(--text-muted); cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  outline: none;
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.calc-theme-btn:focus { outline: none; }
.calc-clear-all-btn:focus { outline: none; }
.calc-theme-btn:hover { border-color: var(--accent); color: var(--text); }
.calc-theme-btn.active { border-color: var(--accent); color: var(--accent); background: rgba(255,75,0,0.06); }
.calc-theme-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.calc-theme-btn[data-theme="ios"]     .calc-theme-dot { background: #ff9f0a; }
.calc-theme-btn[data-theme="classic"] .calc-theme-dot { background: #f5a623; }
.calc-theme-btn[data-theme="android"] .calc-theme-dot { background: #4ecdc4; }
.calc-theme-btn[data-theme="minimal"] .calc-theme-dot { background: #6366f1; }
.calc-theme-btn[data-theme="pastel"]  .calc-theme-dot { background: #f08080; }
.calc-theme-btn[data-theme="teal"]    .calc-theme-dot { background: #26d0b2; }
.calc-clear-all-btn {
  display: inline-flex; align-items: center;
  padding: 6px 12px; border-radius: 999px;
  border: 2px solid #e2a0a0;
  background: #fff5f5;
  font-size: 0.75rem; font-weight: 500; letter-spacing: 0.3px;
  color: #c0392b; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  outline: none;
  transition: background 0.18s ease, border-color 0.18s ease;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.calc-clear-all-btn:hover { background: #ffe0e0; border-color: #c0392b; }

@media (max-width: 480px) {
  .calc-theme-row { flex-wrap: wrap; width: 100%; left: 0; transform: none; justify-content: center; gap: 5px; }
  .calc-theme-btn { padding: 6px 12px; font-size: 0.72rem; gap: 4px; }
  .calc-theme-dot { width: 7px; height: 7px; }
  .calc-clear-all-btn { padding: 6px 12px; font-size: 0.72rem; }
}
@media (max-width: 420px) {
  .calc-theme-row { gap: 4px; }
  .calc-theme-btn { padding: 4px 8px; font-size: 0.62rem; gap: 3px; }
  .calc-theme-dot { width: 6px; height: 6px; }
  .calc-clear-all-btn { padding: 4px 8px; font-size: 0.62rem; }
}

/* ===== CLASSIC DARK THEME ===== */
.calc-col[data-calc-theme="classic"] .device-frame {
  background: #1a2038;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.06), 0 18px 48px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,255,255,0.04);
}
.calc-col[data-calc-theme="classic"] .calc-widget {
  background: #1e2644;
  border-radius: 12px;
  padding: 16px 14px 14px;
}
.calc-col[data-calc-theme="classic"] .cbtn {
  border-radius: 14px;
  background: #2c3560;
  color: #c8d4f0;
  box-shadow: 0 4px 0 rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.08);
}
.calc-col[data-calc-theme="classic"] .cbtn:hover { filter: brightness(1.12); }
.calc-col[data-calc-theme="classic"] .cbtn:active {
  transform: scale(0.95) translateY(2px);
  box-shadow: 0 1px 0 rgba(0,0,0,0.35);
}
.calc-col[data-calc-theme="classic"] .cbtn-fn {
  background: #232b4e;
  color: #8899cc;
  font-size: 0.7rem;
  box-shadow: 0 4px 0 rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.05);
}
.calc-col[data-calc-theme="classic"] .cbtn-cl {
  background: #e84848;
  color: #fff;
  font-size: 1.1rem;
  box-shadow: 0 4px 0 rgba(140,30,30,0.45), inset 0 1px 0 rgba(255,255,255,0.12);
}
.calc-col[data-calc-theme="classic"] .cbtn-op {
  background: #f5a623;
  color: #fff;
  box-shadow: 0 4px 0 rgba(170,100,10,0.45), inset 0 1px 0 rgba(255,255,255,0.15);
}
.calc-col[data-calc-theme="classic"] .cbtn-num {
  background: #2c3560;
  color: #fff;
  font-size: 1.2rem;
  box-shadow: 0 4px 0 rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.08);
}
.calc-col[data-calc-theme="classic"] .cbtn-eq {
  background: #f5a623;
  color: #fff;
  border-radius: 999px;
  box-shadow: 0 4px 0 rgba(170,100,10,0.45), inset 0 1px 0 rgba(255,255,255,0.15);
}
.calc-col[data-calc-theme="classic"] .cbtn-wide2 {
  border-radius: 999px;
  background: #2c3560;
  box-shadow: 0 4px 0 rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.08);
}
.calc-col[data-calc-theme="classic"] .calc-display-wrap {
  background: rgba(0,0,0,0.3);
  border-radius: 10px;
  margin-bottom: 12px;
  padding: 8px 14px 20px;
  border: 1px solid rgba(255,255,255,0.06);
}
.calc-col[data-calc-theme="classic"] .calc-display {
  color: #fff;
  font-size: 3rem;
  letter-spacing: -2px;
}
.calc-col[data-calc-theme="classic"] .calc-expr { color: rgba(200,212,240,0.4); }
.calc-col[data-calc-theme="classic"] .code-toggle-label { color: rgba(200,212,240,0.45); }
.calc-col[data-calc-theme="classic"] .code-toggle-track { background: #2c3560; }

/* ===== ANDROID MINIMAL THEME ===== */
.calc-col[data-calc-theme="android"] .device-frame {
  background: #14141c;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.04), 0 18px 48px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.03);
}
.calc-col[data-calc-theme="android"] .calc-widget {
  background: #14141c;
  border-radius: 12px;
  padding: 18px 14px 16px;
}
.calc-col[data-calc-theme="android"] .cbtn {
  border-radius: 16px;
  background: rgba(255,255,255,0.07);
  color: #dde0f0;
  border: 1px solid rgba(255,255,255,0.06);
}
.calc-col[data-calc-theme="android"] .cbtn:hover { filter: brightness(1.3); }
.calc-col[data-calc-theme="android"] .cbtn:active { transform: scale(0.93); filter: brightness(0.8); }
.calc-col[data-calc-theme="android"] .cbtn-fn {
  background: rgba(78,205,196,0.08);
  color: #4ecdc4;
  font-size: 0.68rem;
  border: 1px solid rgba(78,205,196,0.15);
}
.calc-col[data-calc-theme="android"] .cbtn-cl {
  background: rgba(78,205,196,0.08);
  color: #4ecdc4;
  font-size: 1rem;
  border: 1px solid rgba(78,205,196,0.15);
}
.calc-col[data-calc-theme="android"] .cbtn-op {
  background: rgba(255,82,82,0.1);
  color: #ff5252;
  font-size: 1.3rem;
  border: 1px solid rgba(255,82,82,0.18);
}
.calc-col[data-calc-theme="android"] .cbtn-num {
  background: rgba(255,255,255,0.07);
  color: #fff;
  font-size: 1.2rem;
}
.calc-col[data-calc-theme="android"] .cbtn-eq {
  background: #ff5252;
  color: #fff;
  border-radius: 999px;
  border: none;
  box-shadow: 0 4px 16px rgba(255,82,82,0.3);
}
.calc-col[data-calc-theme="android"] .cbtn-wide2 {
  border-radius: 999px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.06);
}
.calc-col[data-calc-theme="android"] .calc-display-wrap { padding: 8px 14px 20px; }
.calc-col[data-calc-theme="android"] .calc-display {
  color: #fff;
  font-size: 3rem;
  font-weight: 300;
  letter-spacing: -2px;
}
.calc-col[data-calc-theme="android"] .calc-expr { color: rgba(255,255,255,0.3); }
.calc-col[data-calc-theme="android"] .code-toggle-label { color: rgba(221,224,240,0.35); }
.calc-col[data-calc-theme="android"] .code-toggle-track { background: #2c2c38; }

/* ===== MINIMAL LIGHT THEME ===== */
.calc-col[data-calc-theme="minimal"] .device-frame {
  background: #d4dae6;
  box-shadow:
    6px 6px 20px rgba(0,0,0,0.12),
    -3px -3px 12px rgba(255,255,255,0.85),
    0 0 0 1px rgba(0,0,0,0.04);
}
.calc-col[data-calc-theme="minimal"] .calc-widget {
  background: #e4e9f2;
  border-radius: 12px;
  padding: 16px 14px 14px;
}
.calc-col[data-calc-theme="minimal"] .cbtn {
  border-radius: 14px;
  background: #dce2ec;
  color: #1a1a2e;
  box-shadow: 4px 4px 8px rgba(0,0,0,0.13), -3px -3px 7px rgba(255,255,255,0.78);
}
.calc-col[data-calc-theme="minimal"] .cbtn:hover { filter: brightness(1.04); }
.calc-col[data-calc-theme="minimal"] .cbtn:active {
  box-shadow: inset 3px 3px 6px rgba(0,0,0,0.1), inset -1px -1px 4px rgba(255,255,255,0.6);
  transform: scale(0.96);
  filter: none;
}
.calc-col[data-calc-theme="minimal"] .cbtn-fn {
  background: #dce2ec;
  color: #6366f1;
  font-size: 0.68rem;
  box-shadow: 4px 4px 8px rgba(0,0,0,0.1), -2px -2px 6px rgba(255,255,255,0.78);
}
.calc-col[data-calc-theme="minimal"] .cbtn-cl {
  background: #dce2ec;
  color: #f97316;
  font-size: 1rem;
  box-shadow: 4px 4px 8px rgba(0,0,0,0.1), -2px -2px 6px rgba(255,255,255,0.78);
}
.calc-col[data-calc-theme="minimal"] .cbtn-op {
  background: #6366f1;
  color: #fff;
  box-shadow: 4px 4px 10px rgba(255,75,0,0.32), -2px -2px 5px rgba(255,255,255,0.08);
}
.calc-col[data-calc-theme="minimal"] .cbtn-num {
  background: #dce2ec;
  color: #111827;
  font-size: 1.2rem;
  box-shadow: 4px 4px 8px rgba(0,0,0,0.1), -2px -2px 6px rgba(255,255,255,0.78);
}
.calc-col[data-calc-theme="minimal"] .cbtn-eq {
  background: #6366f1;
  color: #fff;
  border-radius: 999px;
  box-shadow: 4px 4px 12px rgba(255,75,0,0.35);
}
.calc-col[data-calc-theme="minimal"] .cbtn-wide2 {
  border-radius: 999px;
  background: #dce2ec;
  box-shadow: 4px 4px 8px rgba(0,0,0,0.1), -2px -2px 6px rgba(255,255,255,0.78);
}
.calc-col[data-calc-theme="minimal"] .calc-display-wrap {
  background: rgba(0,0,0,0.04);
  border-radius: 12px;
  margin-bottom: 12px;
  padding: 8px 14px 20px;
  border: 1px solid rgba(0,0,0,0.05);
  box-shadow: inset 2px 2px 8px rgba(0,0,0,0.07);
}
.calc-col[data-calc-theme="minimal"] .calc-display {
  color: #111827;
  font-size: 3rem;
  font-weight: 300;
  letter-spacing: -2px;
}
.calc-col[data-calc-theme="minimal"] .calc-expr { color: rgba(17,24,39,0.35); }
.calc-col[data-calc-theme="minimal"] .code-toggle-label { color: rgba(17,24,39,0.45); }
.calc-col[data-calc-theme="minimal"] .code-toggle-track { background: #c8d0de; }
.calc-col[data-calc-theme="minimal"] .code-toggle-thumb { background: #9aa5b8; }
.calc-col[data-calc-theme="minimal"] .code-toggle-input:checked + .code-toggle-track { background: #6366f1; }
.calc-col[data-calc-theme="minimal"] .code-toggle-input:checked + .code-toggle-track .code-toggle-thumb { background: #fff; }

/* ===== PASTEL / CANDY THEME ===== */
.calc-col[data-calc-theme="pastel"] .device-frame {
  background: #3a2c24;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.07), 0 18px 48px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.06);
}
.calc-col[data-calc-theme="pastel"] .calc-widget {
  background: #2e2420;
  border-radius: 12px;
  padding: 14px 12px 12px;
}
/* LCD display — warm amber-green like real calculators */
.calc-col[data-calc-theme="pastel"] .calc-display-wrap {
  background: #d4c9a0;
  border-radius: 8px;
  margin-bottom: 14px;
  padding: 14px 14px 12px;
  min-height: 80px;
  border: 2px solid #b8a870;
  box-shadow: inset 0 3px 10px rgba(0,0,0,0.18), 0 2px 4px rgba(0,0,0,0.2);
}
.calc-col[data-calc-theme="pastel"] .calc-display {
  font-family: 'Courier New', 'JetBrains Mono', monospace;
  color: #2c1e08;
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: 3px;
}
.calc-col[data-calc-theme="pastel"] .calc-expr { color: rgba(44,30,8,0.55); font-size: 0.75rem; }
/* Base button */
.calc-col[data-calc-theme="pastel"] .cbtn {
  border-radius: 10px;
  background: #3d302a;
  color: #e8d8cc;
  box-shadow: 0 4px 0 rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.08);
  border: none;
}
.calc-col[data-calc-theme="pastel"] .cbtn:hover { filter: brightness(1.18); }
.calc-col[data-calc-theme="pastel"] .cbtn:active {
  transform: scale(0.95) translateY(2px);
  box-shadow: 0 1px 0 rgba(0,0,0,0.4);
}
/* Function keys — terracotta accent */
.calc-col[data-calc-theme="pastel"] .cbtn-fn {
  background: #5c3d30;
  color: #f4b89a;
  font-size: 0.68rem;
  box-shadow: 0 4px 0 rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.06);
}
/* Control keys — rose */
.calc-col[data-calc-theme="pastel"] .cbtn-cl {
  background: #c0474a;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  box-shadow: 0 4px 0 rgba(130,30,32,0.5), inset 0 1px 0 rgba(255,255,255,0.12);
}
/* Operator keys — warm amber */
.calc-col[data-calc-theme="pastel"] .cbtn-op {
  background: #d4873a;
  color: #fff;
  font-size: 1.2rem;
  font-weight: 600;
  box-shadow: 0 4px 0 rgba(150,80,20,0.45), inset 0 1px 0 rgba(255,255,255,0.15);
}
/* Number keys — dark warm brown */
.calc-col[data-calc-theme="pastel"] .cbtn-num {
  background: #3d302a;
  color: #f0e0d4;
  font-size: 1.15rem;
  font-weight: 500;
}
/* Equals — deep coral */
.calc-col[data-calc-theme="pastel"] .cbtn-eq {
  background: #c0474a;
  color: #fff;
  border-radius: 999px;
  border: none;
  box-shadow: 0 4px 0 rgba(130,30,32,0.5), inset 0 1px 0 rgba(255,255,255,0.12);
}
.calc-col[data-calc-theme="pastel"] .cbtn-wide2 {
  border-radius: 999px;
  background: #3d302a;
  color: #f0e0d4;
}
.calc-col[data-calc-theme="pastel"] .code-toggle-label { color: rgba(240,224,212,0.45); }
.calc-col[data-calc-theme="pastel"] .code-toggle-track { background: #5c3d30; }
.calc-col[data-calc-theme="pastel"] .code-toggle-thumb { background: #d4873a; }
.calc-col[data-calc-theme="pastel"] .code-toggle-input:checked + .code-toggle-track { background: #c0474a; }
.calc-col[data-calc-theme="pastel"] .code-toggle-input:checked + .code-toggle-track .code-toggle-thumb { background: #fff; }

/* ===== TEAL FLAT THEME ===== */
.calc-col[data-calc-theme="teal"] .device-frame {
  background: #0a0a0a;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.04), 0 18px 48px rgba(0,0,0,0.7), inset 0 1px 0 rgba(255,255,255,0.03);
}
.calc-col[data-calc-theme="teal"] .calc-widget {
  background: #0d0d0d;
  border-radius: 12px;
  padding: 0 2px 2px;
  overflow: hidden;
}
.calc-col[data-calc-theme="teal"] .calc-header {
  background: #0d0d0d;
  padding: 14px 20px 10px;
  min-height: 46px;
}
.calc-col[data-calc-theme="teal"] .calc-display-wrap {
  background: #0d0d0d;
  padding: 6px 20px 22px;
  min-height: 108px;
  border-bottom: 1px solid rgba(38,208,178,0.12);
}
.calc-col[data-calc-theme="teal"] .calc-display {
  color: #fff;
  font-size: 3.2rem;
  font-weight: 700;
  letter-spacing: -2px;
}
.calc-col[data-calc-theme="teal"] .calc-expr {
  color: #26d0b2;
  font-size: 0.88rem;
  font-family: inherit;
}
.calc-col[data-calc-theme="teal"] .calc-grid {
  gap: 1px;
  background: rgba(38,208,178,0.08);
  padding: 0;
}
.calc-col[data-calc-theme="teal"] .cbtn {
  border-radius: 0;
  aspect-ratio: unset;
  height: 58px;
  background: #111919;
  color: #d0eeea;
  font-size: 1.1rem;
  border: none;
}
.calc-col[data-calc-theme="teal"] .cbtn:hover { background: #162322; filter: none; }
.calc-col[data-calc-theme="teal"] .cbtn:active { background: #0d1717; transform: none; filter: none; }
.calc-col[data-calc-theme="teal"] .cbtn-fn {
  background: #0d1717;
  color: #26d0b2;
  font-size: 0.68rem;
}
.calc-col[data-calc-theme="teal"] .cbtn-cl {
  background: #0d1717;
  color: #26d0b2;
  font-size: 1rem;
}
.calc-col[data-calc-theme="teal"] .cbtn-op {
  background: #143330;
  color: #26d0b2;
  font-size: 1.25rem;
}
.calc-col[data-calc-theme="teal"] .cbtn-num {
  background: #111919;
  color: #e8f4f2;
  font-size: 1.2rem;
}
.calc-col[data-calc-theme="teal"] .cbtn-eq {
  background: #26d0b2;
  color: #fff;
  border-radius: 0 0 12px 12px;
  font-size: 1.5rem;
  font-weight: 400;
}
.calc-col[data-calc-theme="teal"] .cbtn-wide2 {
  border-radius: 0;
  aspect-ratio: unset;
  height: 58px;
  background: #111919;
  color: #e8f4f2;
  justify-content: center;
  padding: 0;
}
.calc-col[data-calc-theme="teal"] .cbtn-wide5 {
  border-radius: 0 0 12px 12px;
  height: 58px;
}
.calc-col[data-calc-theme="teal"] .code-toggle-label { color: rgba(208,238,234,0.35); }
.calc-col[data-calc-theme="teal"] .code-toggle-track { background: #143330; }
.calc-col[data-calc-theme="teal"] .code-toggle-thumb { background: #26d0b2; }
.calc-col[data-calc-theme="teal"] .code-toggle-input:checked + .code-toggle-track { background: #26d0b2; }
.calc-col[data-calc-theme="teal"] .code-toggle-input:checked + .code-toggle-track .code-toggle-thumb { background: #fff; }

/* ===== FEATURED IMAGE ===== */
.home-featured-img-wrap {
  width: 100%;
  max-width: 740px;
  margin: 0 auto;
  padding: 0;
  box-sizing: border-box;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.home-featured-img {
  width: 100%;
  height: auto;
  border-radius: 20px;
  display: block;
  box-shadow: 0 8px 40px rgba(0,0,0,0.10);
  transition: transform 0.1s ease-in-out, box-shadow 0.1s ease-in;
  will-change: transform;
}
.home-featured-img-wrap:active .home-featured-img,
.home-featured-img-wrap.img-pressed .home-featured-img {
  transform: translateY(3px) scale(0.985);
  box-shadow:
    0 2px 10px rgba(0,0,0,0.18),
    inset 0 2px 8px rgba(0,0,0,0.08);
}
@media (max-width: 768px) {
  .home-featured-img-wrap { padding: 0 16px; }
  .home-featured-img { border-radius: 14px; }
}

/* ===== HOME SECTIONS (Tools grid + Topic cards) ===== */
.home-section {
  width: 100%;
  padding: 56px 0;
}
.home-section-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 1.1rem;
  letter-spacing: -.01em;
}
.home-section-title .sec-icon {
  vertical-align: middle;
  margin-right: 8px;
  position: relative;
  top: -2px;
}
/* Article sub-heading rows with icon */
.home-article h2 {
  display: flex;
  align-items: center;
  gap: 10px;
}
.home-story-inner h2 {
  display: flex;
  align-items: center;
  gap: 10px;
}
/* Circular icon badge before article sub-headings */
.sec-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(26,115,232,0.10);
  color: #1a73e8;
  font-size: 0.78rem;
  flex-shrink: 0;
}

/* ── Home Tools Mini-Grid ── */
.home-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: .9rem;
}
.ht-card {
  display: flex;
  flex-direction: column;
  gap: .45rem;
  background: var(--hc, #6366f1);
  border-radius: 16px;
  padding: 1.15rem 1.1rem 1rem;
  text-decoration: none;
  color: #fff;
  transition: transform .18s, box-shadow .18s, filter .18s;
  position: relative;
  overflow: hidden;
}
.ht-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.18) 0%, transparent 60%);
  pointer-events: none;
}
.ht-card:hover {
  transform: translateY(-4px);
  filter: brightness(1.08);
  box-shadow: 0 10px 28px rgba(0,0,0,.18);
}
.ht-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .95rem;
  background: #fff;
  flex-shrink: 0;
  color: var(--hc, #6366f1);
}
.ht-name {
  font-size: .88rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.3;
}
.ht-desc {
  font-size: .76rem;
  color: rgba(255,255,255,.82);
  line-height: 1.45;
}

/* ── Browse by Topic ── */
.htopic-inner {
  max-width: 760px;
  margin: 0 auto;
}

/* Full-width dark section */
.home-section--topics {
  background: linear-gradient(135deg, #0f172a 0%, #1a2540 100%);
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
  width: 100vw;
  padding: 0;
}
.home-section--topics .home-section-wrap {
  padding-top: 56px;
  padding-bottom: 80px;
}
.topics-title {
  color: #f1f5f9 !important;
  margin-bottom: 6px !important;
}
.topics-icon {
  background: rgba(255,75,0,0.18) !important;
  color: #FF4B00 !important;
}
.topics-subtitle {
  font-size: 1rem; color: #94a3b8;
  margin: 0 0 32px; line-height: 1.6;
}

/* Browse by Topic — grid */
.htopic-simple-grid {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
}
.htopic-group {
  flex: 1 1 0;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 14px;
  padding: 24px 22px;
}
.htopic-group-title {
  font-size: 1rem; font-weight: 800;
  color: #f1f5f9; margin: 0 0 14px;
  padding: 5px 12px;
  display: inline-block;
  border: 2px solid rgba(255,75,0,0.45);
  border-radius: 6px;
  white-space: nowrap;
}
.htopic-group-links {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 8px;
}
.htopic-group-links li a {
  font-size: 0.95rem; color: rgba(147, 197, 253, 0.7);
  font-weight: 400;
  text-decoration: none;
  transition: color .12s;
}
.htopic-group-links li a:hover {
  text-decoration: underline;
  color: #FF4B00;
}
@media (max-width: 680px) {
  .htopic-simple-grid { flex-direction: column; gap: 16px; }
  .htopic-group { width: 100%; }
}

@media (max-width: 768px) {
  /* Math Tools section — slight contained card on mobile */
  .home-section:has(.home-tools-grid) .home-section-wrap {
    background: #f5f6ff;
    border-radius: 16px;
    padding: 20px 16px;
  }
}
@media (max-width: 600px) {
  .home-tools-grid { grid-template-columns: repeat(2, 1fr); gap: .75rem; }
  .home-topics-grid { grid-template-columns: 1fr; }
}

/* ── Benefits Image ── */
.csp-benefits-img-wrap {
  width: 300px; height: 300px;
  margin: 32px auto 4px;
  border-radius: 14px;
  border: 3px solid #FF4B00;
  overflow: hidden;
  display: block;
}
.csp-benefits-img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.18);
  transform-origin: center;
  display: block;
}

/* ── Benefits Prose ── */
.csp-benefits-prose ul {
  list-style: disc;
  padding-left: 1.4rem;
  margin: 20px 0 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.csp-benefits-prose li {
  font-size: 1.05rem;
  line-height: 1.85;
  color: #555;
}
.csp-benefits-prose li strong {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(0,0,0,0.25);
}
.csp-benefits-prose code {
  background: #f3f4f6; border-radius: 4px; padding: 1px 5px;
  font-size: 0.88em; color: #374151;
}

/* ── Story Section ── */
.home-story-section { }
.home-story-inner {
  margin: 0 auto;
  background: transparent;
  padding: 0;
}
.home-story-inner h2 { font-size: 1.35rem; font-weight: 700; color: var(--text); margin: 0 0 18px; }
.home-story-inner p { color: var(--text-muted); font-size: 1.05rem; line-height: 1.85; margin: 0 0 16px; }
.home-story-inner p:last-child { margin-bottom: 0; }
@media (max-width: 600px) {
  .home-story-inner { padding: 0; }
}

/* ── FAQ Section ── */
.home-faq-section { }
.home-faq-list { display: flex; flex-direction: column; gap: 10px; max-width: 860px; margin: 0 auto; }
.home-faq-item {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  background: transparent;
}
.home-faq-q {
  display: block;
  padding: 16px 20px;
  font-weight: 600;
  font-size: 1.05rem;
  cursor: pointer;
  list-style: none;
  color: var(--text);
  user-select: none;
}
.home-faq-q::-webkit-details-marker { display: none; }
.home-faq-q::after {
  content: '+';
  float: right;
  font-size: 1.2rem;
  color: var(--accent);
  font-weight: 400;
}
.home-faq-item[open] .home-faq-q::after { content: '−'; }
.home-faq-a {
  padding: 0 20px 16px;
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.65;
  letter-spacing: -0.01em;
}

/* ===== PERFORMANCE: disable expensive backdrop-filter on mobile ===== */
@media (max-width: 768px) {
  header { backdrop-filter: none; background: rgba(255,255,255,0.98); }
}

/* ── Homepage AdsTerra ad placements ── */
.home-native-ad {
  width: 100%; overflow: hidden;
  margin: 0 0 20px;
  min-height: 60px;
}
.home-native-ad-below {
  width: 100%; overflow: hidden;
  margin: 20px 0 0;
  min-height: 60px;
}
.home-banner-300x250 {
  display: flex; align-items: center; justify-content: center;
  margin: 20px auto 0;
  min-height: 250px; width: 300px;
}
.home-banner-160x300 {
  display: flex; align-items: center; justify-content: center;
  margin: 24px auto;
  min-height: 300px; width: 160px;
}
@media (max-width: 600px) {
  .home-banner-300x250 { width: 100%; }
  .home-banner-160x300 { width: 100%; }
}
