/* ============================================================
   PrometheX Academy — editorial content platform
   ============================================================ */

:root {
  /* PrometheX palette (dark, brand purple) */
  --bg: #07060b;
  --bg-2: #0a0911;
  --panel: #110f1b;
  --card: #14121f;
  --card-2: #181527;
  --border: rgba(255,255,255,.08);
  --border-hover: rgba(255,255,255,.18);
  --text: #eceaf4;
  --muted: #9b97ad;
  --dim: #645f78;
  --primary: #8b5cf6;
  --primary-ink: #ffffff;
  --primary-soft: rgba(139,92,246,.12);
  --primary-line: rgba(139,92,246,.40);
  --accent-text: #c4b5fd;
  --good: #5cd992; --good-soft: rgba(92,217,146,.10);
  --bad: #ff6b6b;  --bad-soft: rgba(255,107,107,.10);
  --warn: #f5c462;
  --chart-grid: rgba(255,255,255,.06);

  /* Helvetica / Swiss-editorial system */
  --serif: "Helvetica Neue", Helvetica, Arial, "PingFang SC", "Noto Sans SC", sans-serif;
  --sans: "Helvetica Neue", Helvetica, Arial, "PingFang SC", "Noto Sans SC", sans-serif;
  --mono: "SF Mono", ui-monospace, "JetBrains Mono", Menlo, monospace;

  --maxw: 1200px;
  --read: 720px;
  --radius: 16px;
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 24px 60px -28px rgba(0,0,0,.7);
}

html[data-theme="light"] {
  --bg: #f6f5fa;
  --bg-2: #f0eef7;
  --panel: #ffffff;
  --card: #ffffff;
  --card-2: #f4f1fc;
  --border: rgba(24,16,40,.12);
  --border-hover: rgba(24,16,40,.26);
  --text: #16121f;
  --muted: #564f6b;
  --dim: #7b7590;
  --primary: #7c3aed;
  --primary-ink: #ffffff;
  --primary-soft: rgba(124,58,237,.09);
  --primary-line: rgba(124,58,237,.4);
  --accent-text: #6d28d9;
  --good: #15803d; --good-soft: rgba(21,128,61,.10);
  --bad: #dc2626;  --bad-soft: rgba(220,38,38,.08);
  --warn: #b45309;
  --chart-grid: rgba(24,16,40,.08);
  --shadow: 0 1px 2px rgba(24,16,40,.04), 0 20px 50px -30px rgba(24,16,40,.25);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

/* atmospheric top glow */
body::before {
  content: "";
  position: fixed; inset: 0 0 auto 0; height: 520px;
  background: radial-gradient(120% 100% at 70% -20%, var(--primary-soft), transparent 60%);
  pointer-events: none; z-index: 0;
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
::selection { background: var(--primary); color: var(--primary-ink); }

.serif { font-family: var(--serif); }
.kicker {
  font-size: .72rem; font-weight: 700; letter-spacing: .18em;
  text-transform: uppercase; color: var(--accent-text);
}
.shell { max-width: var(--maxw); margin: 0 auto; padding: 0 32px; position: relative; z-index: 1; }

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(18px) saturate(1.2);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 32px;
  height: 68px; display: flex; align-items: center; gap: 28px;
}
.brand { display: flex; align-items: center; gap: 11px; font-weight: 800; cursor: pointer; letter-spacing: -.01em; }
.brand .mark { width: 30px; height: 30px; display: block; object-fit: contain; }
.brand .name { font-size: 1.02rem; white-space: nowrap; }
.brand .name b { font-weight: 800; }
.brand .name span { color: var(--muted); font-weight: 600; }
.nav-links { display: flex; gap: 4px; margin-left: 8px; }
.nav-link {
  font-size: .9rem; font-weight: 600; color: var(--muted); padding: 8px 14px;
  border-radius: 9px; cursor: pointer; transition: .15s; background: none; border: none; font-family: inherit;
}
.nav-link:hover { color: var(--text); background: var(--panel); }
.nav-link.active { color: var(--accent-text); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn.sq { width: 38px; padding: 0; justify-content: center; position: relative; }
.icon-btn.sq svg { width: 17px; height: 17px; }
.lang-menu { position: relative; }
.lang-pop {
  position: absolute; top: 44px; right: 0; min-width: 150px; z-index: 60;
  background: var(--panel); border: 1px solid var(--border-hover); border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0,0,0,.45); padding: 5px;
}
.lang-opt {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%;
  background: none; border: none; cursor: pointer; font-family: inherit;
  font-size: .84rem; font-weight: 600; color: var(--muted);
  padding: 9px 11px; border-radius: 8px; text-align: left; transition: .12s;
}
.lang-opt:hover { background: var(--primary-soft); color: var(--text); }
.lang-opt.active { color: var(--accent-text); }
.lang-opt.active::after { content: "✓"; font-size: .8rem; }
.nav-search { position: relative; display: flex; align-items: center; }
.nav-search .s-ico { position: absolute; left: 11px; width: 15px; height: 15px; color: var(--dim); pointer-events: none; }
.nav-search input {
  height: 38px; width: 210px; background: var(--panel); border: 1px solid var(--border);
  border-radius: 10px; color: var(--text); font-family: inherit; font-size: .82rem;
  padding: 0 54px 0 33px; outline: none; transition: .15s;
}
.nav-search input::placeholder { color: var(--dim); }
.nav-search input:focus { border-color: var(--primary-line); width: 280px; }
.nav-search .kbd {
  position: absolute; right: 9px; font-size: .68rem; color: var(--dim);
  border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px; pointer-events: none;
}
.search-pop {
  position: absolute; top: 44px; right: 0; width: 340px; max-height: 380px; overflow: auto;
  background: var(--panel); border: 1px solid var(--border-hover); border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0,0,0,.45); z-index: 60; padding: 6px;
}
.search-pop .sr {
  display: block; width: 100%; text-align: left; background: none; border: none; cursor: pointer;
  font-family: inherit; padding: 9px 11px; border-radius: 8px; color: var(--text);
}
.search-pop .sr:hover, .search-pop .sr.sel { background: var(--primary-soft); }
.search-pop .sr .st { font-size: .84rem; font-weight: 600; margin-bottom: 1px; }
.search-pop .sr .sx { font-size: .74rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.search-pop .sr .sk { font-size: .66rem; color: var(--dim); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 2px; }
.search-pop .s-empty { padding: 14px 12px; font-size: .8rem; color: var(--dim); }
.icon-btn {
  background: var(--panel); border: 1px solid var(--border); color: var(--muted);
  height: 38px; padding: 0 14px; border-radius: 10px; font-family: inherit;
  font-size: .82rem; font-weight: 600; cursor: pointer; transition: .15s; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 7px;
}
.icon-btn:hover { border-color: var(--border-hover); color: var(--text); }

/* ============================================================
   HOME — hero
   ============================================================ */
.home { padding: 0 0 100px; }
.hero {
  padding: 72px 0 56px;
  display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
  gap: 56px; align-items: center;
}
.hero-art image-slot {
  width: 100%; height: clamp(360px, 34vw, 480px);
  border-radius: var(--radius); border: 1px solid var(--border);
  box-shadow: var(--shadow); display: block;
}
.hero .kicker { margin-bottom: 22px; }
.hero h1 {
  font-family: var(--serif); font-weight: 700; letter-spacing: -.035em;
  font-size: clamp(40px, 4.4vw, 68px); line-height: .98; max-width: 17ch;
}
.hero h1 em { font-style: normal; color: var(--accent-text); }
.hero .lede {
  margin-top: 28px; max-width: 56ch; font-size: 1.22rem; line-height: 1.55; color: var(--muted);
}
.hero .meta-row { margin-top: 34px; display: flex; gap: 28px; flex-wrap: wrap; }
.hero .stat .n { font-family: var(--serif); font-size: 2rem; font-weight: 700; line-height: 1; letter-spacing: -.02em; }
.hero .stat .l { font-size: .8rem; color: var(--muted); margin-top: 6px; letter-spacing: .02em; }
.hero .stat .n .unit { font-size: 1rem; color: var(--muted); margin-left: 2px; }

/* ============================================================
   FEATURED
   ============================================================ */
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; margin: 56px 0 26px; padding-top: 30px; border-top: 1px solid var(--border);
}
.section-head h2 { font-family: var(--serif); font-weight: 700; font-size: 1.6rem; letter-spacing: -.025em; }
.section-head .hint { font-size: .85rem; color: var(--muted); }

.featured {
  display: grid; grid-template-columns: 1.05fr .95fr; gap: 0;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; cursor: pointer; transition: .2s; box-shadow: var(--shadow);
}
.featured:hover { border-color: var(--border-hover); transform: translateY(-2px); }
.featured .cover { min-height: 380px; position: relative; background: var(--card-2); }
.featured .cover image-slot { width: 100%; height: 100%; position: absolute; inset: 0; }
.featured .body { padding: 44px 46px; display: flex; flex-direction: column; }
.featured .tagline { display: flex; gap: 10px; align-items: center; margin-bottom: 18px; }
.featured h3 {
  font-family: var(--serif); font-weight: 700; font-size: clamp(27px, 2.9vw, 38px);
  line-height: 1.05; letter-spacing: -.03em; margin-bottom: 16px;
}
.featured .excerpt { color: var(--muted); font-size: 1.04rem; line-height: 1.6; margin-bottom: auto; }
.featured .foot { display: flex; align-items: center; gap: 16px; margin-top: 28px; font-size: .85rem; color: var(--muted); }
.featured .read-cta { color: var(--accent-text); font-weight: 700; display: inline-flex; align-items: center; gap: 7px; }

/* ============================================================
   TAGS / PILLS
   ============================================================ */
.tag {
  font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent-text); background: var(--primary-soft);
  border: 1px solid var(--primary-line); padding: 4px 10px; border-radius: 999px; white-space: nowrap;
}
.tag.plain { color: var(--muted); background: transparent; border-color: var(--border); }
.dotsep { width: 3px; height: 3px; border-radius: 50%; background: var(--dim); display: inline-block; flex: none; }

/* ============================================================
   LESSON GRID
   ============================================================ */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; cursor: pointer; display: flex; flex-direction: column;
  transition: .2s; box-shadow: var(--shadow);
}
.card:hover { border-color: var(--border-hover); transform: translateY(-3px); }
.card .cover { aspect-ratio: 16/10; position: relative; background: var(--card-2); border-bottom: 1px solid var(--border); }
.card .cover image-slot { position: absolute; inset: 0; width: 100%; height: 100%; }
.card .num {
  position: absolute; top: 14px; left: 14px; z-index: 2;
  font-family: var(--serif); font-size: 1rem; font-weight: 600;
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(8px);
  border: 1px solid var(--border); color: var(--text);
}
.card .tool-badge {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  background: var(--primary); color: var(--primary-ink); font-size: .66rem; font-weight: 800;
  letter-spacing: .08em; text-transform: uppercase; padding: 5px 10px; border-radius: 999px;
}
.card .body { padding: 22px 22px 24px; display: flex; flex-direction: column; flex: 1; }
.card .tagline { display: flex; align-items: center; gap: 9px; margin-bottom: 13px; }
.card h3 {
  font-family: var(--serif); font-weight: 700; font-size: 1.34rem; line-height: 1.14;
  letter-spacing: -.025em; margin-bottom: 11px;
}
.card .excerpt { color: var(--muted); font-size: .95rem; line-height: 1.55; margin-bottom: 18px; flex: 1; }
.card .foot { display: flex; align-items: center; gap: 10px; font-size: .8rem; color: var(--dim); }
.card .foot span, .featured .foot span { white-space: nowrap; }

/* ============================================================
   ARTICLE VIEW
   ============================================================ */
.article { display: none; padding: 0 0 120px; }
.read-progress {
  position: fixed; top: 0; left: 0; height: 3px; background: var(--primary);
  width: 0; z-index: 60; transition: width .1s linear;
}
.back-link {
  display: inline-flex; align-items: center; gap: 8px; margin: 36px 0 0;
  color: var(--muted); font-size: .88rem; font-weight: 600; cursor: pointer;
  background: none; border: none; font-family: inherit; transition: .15s; white-space: nowrap;
}
.back-link:hover { color: var(--text); gap: 11px; }

.art-header { max-width: var(--read); margin: 0 auto; padding: 40px 0 0; text-align: center; }
.art-header .tagline { display: flex; justify-content: center; align-items: center; gap: 11px; margin-bottom: 26px; }
.art-header h1 {
  font-family: var(--serif); font-weight: 700; letter-spacing: -.035em;
  font-size: clamp(38px, 5vw, 58px); line-height: 1.0; text-wrap: balance;
}
.art-header .standfirst {
  margin-top: 24px; font-size: 1.24rem; line-height: 1.5; color: var(--muted);
  font-family: var(--sans); font-style: normal; font-weight: 400; text-wrap: pretty;
}
.byline {
  margin-top: 30px; display: flex; justify-content: center; align-items: center;
  gap: 13px; font-size: .86rem; color: var(--muted); white-space: nowrap;
}
.byline .who { color: var(--text); font-weight: 600; }
.byline .av { width: 34px; height: 34px; border-radius: 50%; background: var(--card-2); border: 1px solid var(--border); display: grid; place-items: center; font-family: var(--serif); font-weight: 600; color: var(--accent-text); }

.art-hero { margin: 44px 0 0; }
.art-hero image-slot {
  width: 100%; height: clamp(280px, 42vw, 540px); border-radius: var(--radius);
  border: 1px solid var(--border);
}

.art-layout {
  display: grid; grid-template-columns: 240px minmax(0, var(--read)) 1fr;
  gap: 48px; margin-top: 64px; align-items: start;
}
.art-rail { position: sticky; top: 96px; }
.rail-title { font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); margin-bottom: 16px; }
.rail-list { display: flex; flex-direction: column; gap: 2px; border-left: 1px solid var(--border); }
.rail-item {
  text-align: left; background: none; border: none; font-family: inherit; cursor: pointer;
  color: var(--muted); font-size: .88rem; line-height: 1.35; padding: 9px 14px;
  border-left: 2px solid transparent; margin-left: -1px; transition: .15s; display: flex; gap: 9px;
}
.rail-item:hover { color: var(--text); }
.rail-item.active { color: var(--accent-text); border-left-color: var(--primary); font-weight: 600; }
.rail-item .ix { font-family: var(--serif); opacity: .6; font-size: .82rem; }

/* article body typography */
.prose { font-size: 1.16rem; line-height: 1.72; color: color-mix(in srgb, var(--text) 88%, var(--muted)); }
.prose > p, .prose > ul, .prose > ol, .prose > table, .prose > h2, .prose > h3, .prose > .pullquote, .prose > .callout { max-width: var(--read); }
.prose .lede-p:first-letter {
  font-family: var(--serif); float: left; font-size: 4.2rem; line-height: .8;
  padding: 8px 14px 0 0; color: var(--accent-text); font-weight: 700;
}
.prose p { margin: 0 0 1.4em; text-wrap: pretty; }
.prose strong { color: var(--text); font-weight: 700; }
.prose em { font-style: italic; }
.prose h2 {
  font-family: var(--serif); font-weight: 700; font-size: 1.85rem; line-height: 1.12;
  letter-spacing: -.03em; margin: 2.4em 0 .7em; color: var(--text); scroll-margin-top: 96px;
}
.prose h2 .secnum { color: var(--accent-text); font-size: 1.1rem; vertical-align: middle; margin-right: 14px; font-weight: 700; }
.prose h3 { font-family: var(--sans); font-weight: 700; font-size: 1.16rem; margin: 1.8em 0 .5em; color: var(--text); }
.prose ul, .prose ol { margin: 0 0 1.5em; padding-left: 1.4em; }
.prose li { margin-bottom: .85em; padding-left: .3em; }
.prose li::marker { color: var(--primary); }
.prose ol { counter-reset: li; list-style: none; padding-left: 0; }
.prose ol > li { counter-increment: li; position: relative; padding-left: 3em; }
.prose ol > li::before {
  content: counter(li); position: absolute; left: 0; top: -.05em;
  font-family: var(--serif); font-size: 1.05rem; font-weight: 700; color: var(--accent-text);
  width: 2em; text-align: left; border-bottom: 2px solid var(--primary-line); padding-bottom: 1px;
}

/* pull quote */
.pullquote {
  margin: 2.2em 0; padding: 4px 0 4px 28px; border-left: 3px solid var(--primary);
  font-family: var(--serif); font-style: normal; font-weight: 600; font-size: 1.6rem; line-height: 1.28;
  color: var(--text); letter-spacing: -.025em; text-wrap: balance;
}
/* callout */
.callout {
  margin: 2em 0; background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 22px 26px; font-size: 1rem; line-height: 1.6;
}
.callout .clabel { font-size: .7rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-text); display: block; margin-bottom: 8px; }
.callout p:last-child { margin-bottom: 0; }

/* tables */
.prose table { width: 100%; border-collapse: collapse; margin: 1.8em 0; font-size: .98rem; font-family: var(--sans); }
.prose thead th { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-text); text-align: left; padding: 0 14px 12px; border-bottom: 1px solid var(--border-hover); }
.prose tbody td { padding: 13px 14px; border-bottom: 1px solid var(--border); color: var(--muted); vertical-align: top; }
.prose tbody tr:hover td { background: var(--card); }
.prose tbody td:first-child { color: var(--text); font-weight: 600; white-space: nowrap; }

.art-aside { } /* right gutter reserved for breathing room / future notes */

/* prev-next */
.art-nav {
  max-width: var(--read); margin: 80px auto 0; display: grid; grid-template-columns: 1fr 1fr; gap: 18px;
}
.art-nav .pn {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 22px 24px;
  color: var(--text); font-family: inherit;
  cursor: pointer; transition: .18s; min-height: 96px; display: flex; flex-direction: column; justify-content: center;
}
.art-nav .pn:hover { border-color: var(--border-hover); transform: translateY(-2px); }
.art-nav .pn.next { text-align: right; }
.art-nav .pn .dir { font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); margin-bottom: 7px; }
.art-nav .pn .ptitle { font-family: var(--serif); font-size: 1.16rem; font-weight: 700; line-height: 1.15; letter-spacing: -.02em; }
.art-nav .pn.empty { visibility: hidden; }

/* ============================================================
   CALCULATOR LESSON
   ============================================================ */
.calc-view { display: none; padding: 40px 0 120px; }
.calc-intro { max-width: var(--read); margin: 0 auto 12px; text-align: center; }
.calc-intro .tagline { display: flex; justify-content: center; gap: 11px; margin-bottom: 22px; align-items: center; }
.calc-intro h1 { font-family: var(--serif); font-weight: 700; font-size: clamp(36px, 4.6vw, 54px); line-height: 1.0; letter-spacing: -.035em; }
.calc-intro p { margin-top: 20px; font-size: 1.18rem; color: var(--muted); line-height: 1.5; font-family: var(--sans); font-style: normal; }

.chips { display: flex; gap: 8px; margin: 44px 0 22px; flex-wrap: wrap; justify-content: center; }
.chip {
  background: var(--panel); border: 1px solid var(--border); color: var(--muted);
  border-radius: 999px; padding: 9px 20px; font-size: .9rem; cursor: pointer;
  transition: .15s; font-weight: 600; font-family: inherit;
}
.chip:hover { border-color: var(--border-hover); color: var(--text); }
.chip.active { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }

.calc-hero {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px 30px; margin-bottom: 22px; display: flex; align-items: center; gap: 30px; flex-wrap: wrap;
  box-shadow: var(--shadow);
}
.calc-hero .roi .k { font-size: .85rem; color: var(--muted); }
.calc-hero .roi .v { font-family: var(--serif); font-size: 3rem; font-weight: 700; line-height: 1.1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.calc-hero .roi .v.good { color: var(--good); } .calc-hero .roi .v.bad { color: var(--bad); } .calc-hero .roi .v.warn { color: var(--warn); }
.calc-hero .pill { border-radius: 999px; padding: 7px 16px; font-size: .8rem; font-weight: 700; border: 1px solid; min-width: 100px; text-align: center; }
.calc-hero .pill.good { color: var(--good); border-color: var(--good); background: var(--good-soft); }
.calc-hero .pill.bad { color: var(--bad); border-color: var(--bad); background: var(--bad-soft); }
.calc-hero .pill.warn { color: var(--warn); border-color: var(--warn); background: rgba(245,196,98,.12); }
.calc-hero .why { font-size: .92rem; color: var(--muted); flex: 1 1 280px; line-height: 1.55; }

.calc-grid { display: grid; grid-template-columns: 380px 1fr; gap: 22px; }
.panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.panel h2 { font-family: var(--serif); font-size: 1.16rem; font-weight: 700; letter-spacing: -.02em; color: var(--text); margin-bottom: 18px; }
.mb18 { margin-bottom: 22px; }

.field { margin-bottom: 20px; }
.field label { display: flex; justify-content: space-between; font-size: .92rem; margin-bottom: 8px; gap: 8px; }
.field label .val { color: var(--text); font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.help {
  background: none; font-family: inherit; padding: 0;
  display: inline-flex; width: 16px; height: 16px; border-radius: 50%;
  border: 1px solid var(--border-hover); color: var(--muted); font-size: .68rem;
  align-items: center; justify-content: center; cursor: help; position: relative;
  margin-left: 6px; vertical-align: 1px; user-select: none;
}
.help:hover { color: var(--text); border-color: var(--primary); }
.help:hover::after, .help.open::after {
  content: attr(data-tip); position: absolute; bottom: 140%; left: 50%; transform: translateX(-50%);
  background: var(--panel); border: 1px solid var(--border-hover); color: var(--text);
  padding: 10px 13px; border-radius: 10px; width: 240px; font-size: .76rem; line-height: 1.45;
  font-weight: 400; z-index: 10; box-shadow: var(--shadow);
}
input[type=range] { width: 100%; accent-color: var(--primary); cursor: pointer; }

.quick { display: flex; gap: 6px; margin-top: 9px; flex-wrap: wrap; }
.qbtn {
  background: var(--panel); border: 1px solid var(--border); color: var(--muted);
  border-radius: 8px; padding: 4px 11px; font-size: .78rem; cursor: pointer;
  font-family: inherit; font-variant-numeric: tabular-nums; transition: .12s;
}
.qbtn:hover { border-color: var(--primary); color: var(--text); }
.qbtn.on { background: var(--primary-soft); border-color: var(--primary); color: var(--accent-text); font-weight: 700; }

details.adv { border-top: 1px solid var(--border); padding-top: 14px; margin-top: 6px; }
details.adv summary { cursor: pointer; font-size: .85rem; color: var(--muted); font-weight: 700; list-style: none; user-select: none; margin-bottom: 14px; }
details.adv summary::-webkit-details-marker { display: none; }
details.adv summary::before { content: "▸ "; color: var(--primary); }
details.adv[open] summary::before { content: "▾ "; }

.kv .row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.kv .row:last-child { border-bottom: none; }
.kv .k { font-size: .92rem; color: var(--muted); }
.kv .v { font-size: 1.02rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.kv .row.major .k { color: var(--text); }
.kv .row.major .v { font-family: var(--serif); font-size: 1.7rem; font-weight: 700; letter-spacing: -.01em; }
.kv .v.good { color: var(--good); } .kv .v.bad { color: var(--bad); } .kv .v.warn { color: var(--warn); }
.legend { display: flex; gap: 20px; font-size: .8rem; color: var(--muted); margin-top: 10px; flex-wrap: wrap; }
.legend span::before { content: ""; display: inline-block; width: 14px; height: 3px; border-radius: 2px; margin-right: 7px; vertical-align: middle; }
.legend .l-net::before { background: var(--primary); }
.legend .l-loss::before { background: var(--bad); }
.legend .l-fee::before { background: var(--good); }
.note { font-size: .85rem; color: var(--muted); margin-top: 16px; line-height: 1.55; }
.calc-svg { width: 100%; height: auto; display: block; }

:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ============================================================
   GLOSSARY
   ============================================================ */
.gloss-view { display: none; padding: 40px 0 120px; }
.gl-head { max-width: var(--read); margin: 0 auto; text-align: center; }
.gl-head .tagline { display: flex; justify-content: center; gap: 11px; margin-bottom: 22px; align-items: center; }
.gl-head h1 { font-family: var(--serif); font-weight: 700; font-size: clamp(36px, 4.6vw, 54px); line-height: 1.0; letter-spacing: -.035em; }
.gl-head p { margin-top: 18px; font-size: 1.14rem; color: var(--muted); line-height: 1.5; }

.gl-search-wrap { max-width: 640px; margin: 42px auto 28px; }
.gl-search {
  width: 100%; background: var(--panel); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 20px; color: var(--text);
  font-family: inherit; font-size: .98rem; transition: .15s;
}
.gl-search::placeholder { color: var(--dim); }
.gl-search:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }

.gl-index { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; max-width: 820px; margin: 0 auto 44px; }
.gl-index button {
  width: 36px; height: 36px; border-radius: 9px; border: none; background: none;
  font-family: inherit; font-size: .88rem; font-weight: 700; color: var(--accent-text);
  cursor: pointer; transition: .12s;
}
.gl-index button:hover { background: var(--primary-soft); }
.gl-index button.off { color: var(--dim); opacity: .35; pointer-events: none; }

.gl-group {
  display: grid; grid-template-columns: 130px 1fr; gap: 36px;
  max-width: 1000px; margin: 0 auto; padding: 40px 0;
  border-top: 1px solid var(--border); scroll-margin-top: 92px;
}
.gl-letter {
  font-family: var(--serif); font-weight: 700; font-size: 3.6rem;
  line-height: .85; letter-spacing: -.03em; color: var(--accent-text);
}
.gl-terms { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px 40px; }
.g-term h3 { font-size: 1.06rem; font-weight: 700; margin-bottom: 7px; letter-spacing: -.01em; }
.g-term p { color: var(--muted); font-size: .94rem; line-height: 1.62; }
.gl-empty { text-align: center; color: var(--muted); padding: 60px 0 20px; font-size: 1rem; }

@media (max-width: 860px) {
  .nav-search input { width: 38px; padding: 0; opacity: 0; position: absolute; right: 0; }
  .nav-search input:focus { width: 220px; padding: 0 12px 0 33px; opacity: 1; background: var(--panel); z-index: 61; }
  .nav-search .kbd { display: none; }
}
@media (max-width: 760px) {
  .gl-group { grid-template-columns: 1fr; gap: 18px; }
  .gl-terms { grid-template-columns: 1fr; }
  .gl-letter { font-size: 2.6rem; }
}

/* ============================================================
   FOOTER
   ============================================================ */
.foot {
  border-top: 1px solid var(--border); margin-top: 30px;
  padding: 48px 0 64px; color: var(--muted); font-size: .9rem;
}
.foot-inner { max-width: var(--maxw); margin: 0 auto; padding: 0 32px; display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; align-items: center; }
.foot .brand .name { font-size: .95rem; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1080px) {
  .art-layout { grid-template-columns: minmax(0,1fr); }
  .art-rail { display: none; }
  .prose { margin: 0 auto; }
  .prose > * { margin-left: auto; margin-right: auto; }
}
@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .hero { grid-template-columns: 1fr; gap: 36px; }
  .hero-art image-slot { height: 300px; }
  .featured { grid-template-columns: 1fr; }
  .featured .cover { min-height: 240px; }
  .calc-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .shell, .nav-inner, .foot-inner { padding-left: 20px; padding-right: 20px; }
  .nav-links { display: none; }
  .grid { grid-template-columns: 1fr; }
  .hero { padding: 56px 0 40px; }
  .art-nav { grid-template-columns: 1fr; }
  .featured .body { padding: 30px 26px; }
}

[hidden] { display: none !important; }
