/* Sorcerer TD — segment 1: tokens, base, shell, header, footer */
:root {
  color-scheme: dark;
  --bg: #0e0d1a;
  --surface: #1a1830;
  --surface-2: #141226;
  --line: #2a2646;
  --line-soft: #221f3b;
  --text: #f2eefc;
  --body: #d8d2ea;
  --muted: #9a93b8;
  --primary: #8b5cf6;
  --primary-strong: #7c3aed;
  --accent: #f5c451;
  --ok: #4ade80;
  --warn: #f08a4b;
  --danger: #ff6b8a;
  --r-common: #9a93b8;
  --r-uncommon: #4ade80;
  --r-rare: #60a5fa;
  --r-epic: #a78bfa;
  --r-legendary: #f08a4b;
  --r-mythic: #f5c451;
  --r-anniversary: #c084fc;
  --r-secret: #ff6b8a;
  --r-exclusive: #4fd1c5;
  --radius: 10px;
  --wrap: 1120px;
  --font-head: "Space Grotesk", "Avenir Next", system-ui, sans-serif;
  --font-body: "Inter", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.65;
  overflow-x: hidden;
}
body, button, input, select, textarea { font-family: var(--font-body); }
h1, h2, h3, h4, h5, h6 {
  margin: 0 0 .5em;
  font-family: var(--font-head);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -.02em;
}
p { margin: 0 0 1.05em; }
a { color: var(--text); text-decoration-color: var(--primary); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); text-decoration-color: var(--accent); }
img { max-width: 100%; height: auto; }
strong { font-weight: 600; color: var(--text); }
::selection { background: var(--primary); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wrap { width: min(var(--wrap), calc(100% - 40px)); margin-inline: auto; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; left: 12px; top: -60px; z-index: 100; padding: 10px 14px;
  background: var(--accent); color: #171426; border-radius: 8px; font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: 12px; color: #171426; }

/* header */
.site-head {
  position: sticky; top: 0; z-index: 30;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.head-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 62px; }
.brand {
  display: inline-flex; align-items: center; gap: 11px;
  color: var(--text); text-decoration: none; font-family: var(--font-head);
  font-weight: 700; font-size: 18px; letter-spacing: -.01em; line-height: 1;
  white-space: nowrap;
}
.brand:hover { color: var(--text); }
.brand em { font-style: normal; color: var(--accent); }
.sigil {
  width: 27px; height: 27px; display: inline-grid; place-items: center;
  border: 1px solid var(--line); background: var(--surface);
  transform: rotate(45deg); border-radius: 4px; transition: border-color .15s ease;
}
.sigil span { transform: rotate(-45deg); font: 700 14px/1 var(--font-head); color: var(--accent); }
.brand:hover .sigil { border-color: var(--primary); }
.site-nav { display: flex; align-items: center; gap: 22px; }
.site-nav a {
  color: var(--muted); text-decoration: none; font-size: 12px; font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase; line-height: 2;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); }
.site-nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--accent); }
.nav-toggle {
  display: none; width: 40px; height: 40px; padding: 0; border: 1px solid var(--line);
  background: var(--surface); border-radius: 8px; cursor: pointer; color: var(--text);
}
.nav-toggle-lines, .nav-toggle-lines::before, .nav-toggle-lines::after {
  display: block; width: 16px; height: 1.5px; background: var(--text); margin: 0 auto; content: "";
}
.nav-toggle-lines { position: relative; }
.nav-toggle-lines::before { position: absolute; top: -5px; left: 0; }
.nav-toggle-lines::after { position: absolute; top: 5px; left: 0; }
.site-head[data-open] .nav-toggle { border-color: var(--primary); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px; border-radius: var(--radius);
  border: 1px solid transparent; background: var(--primary); color: #fff;
  font-size: 13px; font-weight: 600; line-height: 1; text-decoration: none;
  cursor: pointer; transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.btn:hover { background: var(--primary-strong); color: #fff; text-decoration: none; }
.btn--ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn--ghost:hover { background: var(--surface); border-color: var(--primary); color: var(--text); }

/* footer */
.site-foot { margin-top: 20px; border-top: 1px solid var(--line); padding: 38px 0 30px; }
.foot-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(200px, .9fr) auto; gap: 34px; align-items: start; }
.brand--foot { font-size: 16px; margin-bottom: 12px; }
.foot-line { color: var(--body); font-size: 13px; max-width: 420px; margin-bottom: 8px; }
.foot-small { color: var(--muted); font-size: 11px; line-height: 1.5; max-width: 440px; margin: 0; }
.foot-links { display: grid; grid-template-columns: repeat(2, minmax(110px, 1fr)); gap: 7px 24px; align-content: start; }
.foot-links a { color: var(--muted); text-decoration: none; font-size: 12px; font-weight: 600; }
.foot-links a:hover { color: var(--accent); }
.foot-meta { color: var(--muted); font-size: 11px; text-align: right; font-variant-numeric: tabular-nums; }
.foot-meta p { margin-bottom: 6px; }
.foot-meta time { color: var(--body); }
/* Sorcerer TD — segment 2: hero, value table, home split, next cards */
.hero { padding: 30px 0 0; }
.eyebrow {
  margin: 0 0 9px; color: var(--accent); font-family: var(--font-body);
  font-size: 10px; font-weight: 700; letter-spacing: .17em; line-height: 1.3;
  text-transform: uppercase;
}
.hero h1 { margin: 0 0 10px; font-size: clamp(30px, 4.7vw, 45px); font-weight: 600; letter-spacing: -.035em; }
.lede { max-width: 760px; margin: 0 0 19px; color: var(--body); font-size: 16px; line-height: 1.55; }
.value-toolbar {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 18px;
  margin: 0 0 10px;
}
.search-box { display: flex; flex-direction: column; gap: 5px; width: min(350px, 100%); }
.search-label {
  color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .13em;
  line-height: 1; text-transform: uppercase;
}
.search-box input {
  width: 100%; height: 39px; padding: 0 12px; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--surface); color: var(--text);
  font-size: 14px; outline: none;
}
.search-box input::placeholder { color: #6f688c; }
.search-box input:focus { border-color: var(--primary); }
.data-stamp {
  margin: 0 0 2px; color: var(--muted); font-size: 11px; line-height: 1.5;
  font-variant-numeric: tabular-nums; text-align: right;
}
.data-stamp time { color: var(--body); }
.data-stamp strong { color: var(--text); font-weight: 600; }
.data-stamp .dot { color: var(--accent); padding: 0 3px; }
.table-shell {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden;
}
.value-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.value-table caption { text-align: left; }
.value-table thead th {
  padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line);
  color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .12em;
  line-height: 1.2; text-align: left; text-transform: uppercase; white-space: nowrap;
}
.value-table thead th.num { text-align: right; }
.sort-btn {
  padding: 0; border: 0; background: none; color: inherit; font: inherit;
  letter-spacing: inherit; text-transform: inherit; cursor: pointer;
}
.sort-btn:hover { color: var(--text); }
.sort-btn::after { content: "↕"; display: inline-block; margin-left: 5px; color: #6f688c; font-size: 10px; letter-spacing: 0; }
.value-table thead th[aria-sort="descending"] .sort-btn::after { content: "↓"; color: var(--accent); }
.value-table thead th[aria-sort="ascending"] .sort-btn::after { content: "↑"; color: var(--accent); }
.value-table tbody td { padding: 10px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.value-table tbody tr:last-child td { border-bottom: 0; }
.value-row { background: transparent; }
.value-row:hover { background: #201d3a; }
.value-row td:first-child { position: relative; padding-left: 18px; }
.value-row td:first-child::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--rarity, var(--primary));
}
.unit-name { color: var(--text); font-size: 15px; font-weight: 600; line-height: 1.3; }
.rarity-cell { color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .03em; }
.value-cell { text-align: right; white-space: nowrap; }
.value-number {
  color: var(--accent); font-size: 20px; font-weight: 700; line-height: 1;
  font-variant-numeric: tabular-nums; letter-spacing: -.02em;
}
.demand-cell { text-align: right; color: var(--body); white-space: nowrap; font-variant-numeric: tabular-nums; }
.demand-max { color: var(--muted); font-size: 10px; }
.rarity-common { --rarity: var(--r-common); }
.rarity-uncommon { --rarity: var(--r-uncommon); }
.rarity-rare { --rarity: var(--r-rare); }
.rarity-epic { --rarity: var(--r-epic); }
.rarity-legendary { --rarity: var(--r-legendary); }
.rarity-mythic { --rarity: var(--r-mythic); }
.rarity-anniversary { --rarity: var(--r-anniversary); }
.rarity-ascended { --rarity: #7dd3fc; }
.rarity-secret { --rarity: var(--r-secret); }
.rarity-exclusive { --rarity: var(--r-exclusive); }
.empty-row td { padding: 34px 18px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.empty-title { margin: 0 0 5px; color: var(--text); font-family: var(--font-head); font-size: 17px; font-weight: 600; }
.empty-row p:last-child { margin-bottom: 0; max-width: 720px; }
.table-actions { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 8px; }
.table-foot { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; max-width: 760px; }
.table-actions .btn { min-height: 32px; padding: 0 12px; font-size: 11px; }

.home-split {
  display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(245px, .8fr);
  gap: 36px; padding: 38px 0 6px;
}
.home-split h2 { margin: 0 0 12px; font-size: 26px; }
.home-split .split-main p { color: var(--body); font-size: 14px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 17px; }
.panel + .panel { margin-top: 12px; }
.panel h3 { margin: 0 0 10px; font-size: 14px; }
.panel p { color: var(--muted); font-size: 12px; line-height: 1.55; margin-bottom: 10px; }
.panel p:last-child { margin-bottom: 0; }
.panel--quiet { background: transparent; }
.stat-list { margin: 0 0 12px; }
.stat-list div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line-soft); }
.stat-list div:last-child { border-bottom: 0; }
.stat-list dt { color: var(--muted); font-size: 11px; line-height: 1.4; }
.stat-list dd { margin: 0; color: var(--text); font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-note { margin: 0 0 11px; padding-top: 8px; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: 11px; line-height: 1.45; }
.stat-note span { display: block; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }
.stat-note strong { display: block; margin-top: 2px; color: var(--text); font-size: 11px; font-weight: 600; line-height: 1.45; }
.text-link { color: var(--accent); font-size: 11px; font-weight: 700; text-decoration: none; }
.text-link:hover { text-decoration: underline; }
.section-head { margin-bottom: 10px; }
.section-head h2 { margin-bottom: 4px; }
.section-head p { color: var(--muted); font-size: 13px; margin: 0; }
.next-links { display: grid; grid-template-columns: 1.15fr .85fr; gap: 14px; padding: 36px 0 54px; }
.next-card {
  display: block; padding: 20px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); color: var(--text); text-decoration: none;
  transition: border-color .15s ease;
}
a.next-card:hover { border-color: var(--primary); color: var(--text); text-decoration: none; }
.next-card h2 { margin: 0 0 6px; font-size: 19px; }
.next-card p { margin: 0 0 13px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.next-card .btn { min-height: 34px; font-size: 12px; }
.next-card--quiet { background: transparent; }

.rarity-key { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 7px; }
.rarity-key li { display: flex; align-items: center; gap: 9px; color: var(--body); font-size: 12px; line-height: 1.2; }
.rarity-swatch { display: inline-block; width: 4px; height: 16px; border-radius: 1px; background: var(--rarity, var(--primary)); }
.rarity-note { color: var(--muted); font-size: 10px; line-height: 1.5; margin: 0; }

.unit-meta { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; font-weight: 500; line-height: 1.35; font-variant-numeric: tabular-nums; }
.table-foot a { color: var(--body); }
.source-details { margin: 9px 0 0; padding: 10px 0 0; border-top: 1px solid var(--line); }
.source-details summary { cursor: pointer; color: var(--muted); font-size: 11px; font-weight: 600; list-style: none; }
.source-details summary::-webkit-details-marker { display: none; }
.source-details summary::after { content: "+"; margin-left: 6px; color: var(--accent); }
.source-details[open] summary::after { content: "−"; }
.source-details ul { margin: 8px 0 0; padding-left: 18px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.source-details li { margin-bottom: 4px; }
.source-details a { color: var(--accent); }
/* Sorcerer TD — segment 3: page/article, tables, FAQ, comments, 404 */
.page { max-width: 920px; padding: 36px 0 52px; }
.page-head { padding-bottom: 17px; margin-bottom: 25px; border-bottom: 1px solid var(--line); }
.page-head h1 { margin-bottom: 10px; font-size: clamp(29px, 4.5vw, 43px); }
.page-head .lede { margin-bottom: 9px; }
.page-stamp { margin: 0; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.tool-page { max-width: 1040px; padding: 30px 0 52px; }
.page-head--tool { max-width: 780px; }
.page-body { color: var(--body); font-size: 15px; line-height: 1.7; }
.page-body > * { max-width: 850px; }
.page-body h2 { margin: 32px 0 11px; color: var(--text); font-size: 24px; }
.page-body h3 { margin: 23px 0 8px; color: var(--text); font-size: 18px; }
.page-body h4 { margin: 18px 0 6px; font-size: 15px; }
.page-body p { color: var(--body); }
.page-body ul, .page-body ol { margin: 0 0 1.15em; padding-left: 22px; }
.page-body li { margin-bottom: .35em; }
.page-body li::marker { color: var(--accent); }
.page-body a { color: var(--text); }
.page-body a:hover { color: var(--accent); }
.page-body blockquote {
  margin: 18px 0; padding: 2px 0 2px 16px; border-left: 3px solid var(--accent);
  color: var(--muted); font-size: 14px;
}
.page-body code {
  padding: 1px 5px; border: 1px solid var(--line); border-radius: 4px;
  background: var(--surface-2); color: var(--accent); font-size: 13px;
}
.page-body table {
  width: 100%; display: table; border-collapse: separate; border-spacing: 0;
  margin: 18px 0 24px; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; background: var(--surface); font-size: 13px; line-height: 1.5;
  table-layout: fixed;
}
.page-body thead th {
  padding: 9px 12px; background: var(--surface-2); border-bottom: 1px solid var(--line);
  color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .1em;
  text-align: left; text-transform: uppercase; white-space: normal;
}
.page-body tbody td { padding: 9px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.page-body th, .page-body td { overflow-wrap: anywhere; word-break: break-word; }
.page-body tbody tr:last-child td { border-bottom: 0; }
.page-body tbody tr:hover { background: #201d3a; }
.page-body table a { color: var(--accent); }
.page-body .num, .num { font-variant-numeric: tabular-nums; }
.callout {
  margin: 20px 0; padding: 13px 16px; border: 1px solid var(--line);
  border-left: 3px solid var(--accent); border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--surface); font-size: 13px; line-height: 1.6;
}
.callout p { margin: 0 0 7px; color: var(--body); }
.callout p:last-child { margin: 0; }
.callout--info { border-left-color: var(--primary); }
.callout--pending { border-left-color: var(--warn); }
.tag {
  display: inline-block; padding: 1px 6px; border: 1px solid var(--line);
  border-radius: 4px; color: var(--muted); font-size: 9px; font-weight: 700;
  letter-spacing: .08em; line-height: 1.6; text-transform: uppercase; vertical-align: 1px;
}
.tag--ok { border-color: #2c5a3d; color: var(--ok); }
.tag--warn { border-color: #5c4228; color: var(--warn); }
.source-note { color: var(--muted); font-size: 11px; line-height: 1.55; }
.source-note a { color: var(--body); }

/* FAQ */
.faq-section { max-width: none; padding: 6px 0 22px; }
.faq-section h2 { font-size: 25px; }
.faq-item { border-top: 1px solid var(--line); padding: 13px 0; }
.faq-item:last-of-type { border-bottom: 1px solid var(--line); }
.faq-item summary {
  position: relative; padding-right: 28px; cursor: pointer; list-style: none;
  color: var(--text); font-size: 14px; font-weight: 600; line-height: 1.45;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+"; position: absolute; right: 2px; top: -2px; color: var(--accent);
  font-family: var(--font-head); font-size: 19px; font-weight: 500;
}
.faq-item[open] summary::after { content: "−"; }
.faq-item p { margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.65; max-width: 800px; }

/* comments / correction thread */
.comments[data-gf-empty] { display: none; }
.comments { max-width: 850px; margin: 18px 0 26px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.comments-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.comments-head h2, .comments-head h3 { margin: 0; font-size: 17px; }
.comment-count { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.comment-list { display: flex; flex-direction: column; gap: 0; }
.comment { padding: 12px 0; border-top: 1px solid var(--line-soft); }
.comment:first-child { border-top: 0; }
.comment-head { display: flex; align-items: baseline; gap: 9px; margin-bottom: 3px; }
.comment-head strong { font-size: 12px; }
.comment-head time { color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.comment p { margin: 0; color: var(--body); font-size: 13px; line-height: 1.6; white-space: pre-wrap; }
.comment-owner { border-left: 2px solid var(--accent); padding-left: 10px; }
.comment-owner .comment-head strong::after { content: " site owner"; color: var(--accent); font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.comment-replies { margin: 8px 0 0 14px; padding-left: 10px; border-left: 1px solid var(--line); }
.comment-reply-btn { margin-top: 5px; padding: 0; border: 0; background: none; color: var(--muted); font-size: 10px; font-weight: 600; cursor: pointer; }
.comment-reply-btn:hover { color: var(--accent); }
.comment-form { display: grid; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.comment-form input, .comment-form textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg); color: var(--text); font-size: 13px; outline: none;
}
.comment-form textarea { min-height: 92px; resize: vertical; }
.comment-form input:focus, .comment-form textarea:focus { border-color: var(--primary); }
.comment-form button { justify-self: start; min-height: 34px; }
.comment-msg { margin: 0; color: var(--muted); font-size: 11px; }
.comments[data-gf-empty] + .comment-empty-note { display: block; }
.comment-empty-note { display: none; margin: 0 0 12px; color: var(--muted); font-size: 12px; }
.comments[data-gf-off] .comment-form { display: none; }

/* 404 */
.not-found { padding: 64px 0 70px; max-width: 900px; }
.not-found h1 { font-size: clamp(40px, 7vw, 64px); }
.not-found-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 24px 0 18px; }
.not-found-grid .next-card { padding: 16px; }
.not-found-grid .next-card h2 { font-size: 17px; }
.not-found-grid .next-card p { margin-bottom: 0; }
.not-found-foot { color: var(--muted); font-size: 12px; }

.table-intro { margin: -4px 0 12px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.code-table code { padding: 0; border: 0; background: none; color: var(--accent); font-size: 12px; word-break: break-all; }
.code-table td { vertical-align: top; }
.code-table th:nth-child(1) { width: 25%; }
.code-table th:nth-child(2) { width: 23%; }
.code-table th:nth-child(3) { width: 15%; }
.code-table th:nth-child(4) { width: 37%; }
/* Sorcerer TD — segment 4: calculator frame and responsive rules */
.calc-frame {
  max-width: 820px; margin: 0 0 30px; padding: 16px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
}
.calc-frame [data-gf-tool] { min-height: 180px; }
.calc-empty {
  padding: 26px 18px; border: 1px dashed var(--line); border-radius: 8px;
  background: var(--surface-2); color: var(--muted); font-size: 13px; line-height: 1.6;
}
.calc-empty strong { display: block; margin-bottom: 4px; color: var(--text); font-family: var(--font-head); font-size: 17px; }
@media (max-width: 1000px) {
  .home-split { gap: 26px; }
  .value-table tbody td { padding-inline: 11px; }
  .value-row td:first-child { padding-left: 15px; }
}
@media (max-width: 840px) {
  .nav-toggle { display: block; }
  .site-nav { display: none; }
  .site-head[data-open] .site-nav {
    display: flex; position: absolute; top: 62px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 6px 20px 12px; background: var(--bg); border-bottom: 1px solid var(--line);
  }
  .site-head[data-open] .site-nav a { padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
  .site-head[data-open] .site-nav a:last-child { border-bottom: 0; }
  .home-split { grid-template-columns: 1fr; padding-top: 30px; }
  .next-links { grid-template-columns: 1fr; padding-bottom: 44px; }
  .foot-grid { grid-template-columns: 1fr 1fr; gap: 26px; }
  .foot-meta { grid-column: 1 / -1; text-align: left; padding-top: 4px; border-top: 1px solid var(--line-soft); }
  .not-found-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .wrap { width: calc(100% - 28px); }
  .head-inner { min-height: 58px; }
  .site-head[data-open] .site-nav { top: 58px; }
  .brand { font-size: 16px; }
  .hero { padding-top: 8px; }
  .hero h1 { font-size: 30px; }
  .lede { font-size: 14px; margin-bottom: 15px; }
  .value-toolbar { flex-direction: column; align-items: stretch; gap: 6px; }
  .data-stamp { text-align: left; font-size: 10px; line-height: 1.45; }
  .value-table { font-size: 12px; }
  .value-table thead th { padding: 8px 9px; font-size: 9px; letter-spacing: .08em; }
  .value-table tbody td { padding: 9px 9px; }
  .value-row td:first-child { padding-left: 13px; }
  .value-row td:first-child::before { width: 3px; }
  .unit-name { font-size: 13px; }
  .unit-meta { font-size: 9px; }
  .rarity-cell { font-size: 10px; }
  .value-number { font-size: 17px; }
  .demand-cell { font-size: 11px; }
  .table-actions { flex-direction: column; align-items: flex-start; gap: 8px; }
  .table-foot { font-size: 10px; }
  .home-split h2, .faq-section h2 { font-size: 22px; }
  .page, .tool-page { padding-top: 24px; }
  .page-head { padding-bottom: 13px; margin-bottom: 19px; }
  .page-head h1 { font-size: clamp(27px, 8vw, 36px); }
  .page-body { font-size: 14px; }
  .page-body h2 { font-size: 21px; margin-top: 27px; }
  .page-body h3 { font-size: 16px; }
  .page-body table { font-size: 12px; }
  .page-body thead th { padding: 8px 9px; }
  .page-body tbody td { padding: 8px 9px; }
  .code-table { display: block; }
  .code-table thead { display: none; }
  .code-table tbody, .code-table tr, .code-table td { display: block; width: 100%; }
  .code-table tr { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); }
  .code-table tr:last-child { border-bottom: 0; }
  .code-table td { padding: 2px 0; border: 0; font-size: 12px; }
  .code-table td:first-child { margin-bottom: 2px; font-size: 14px; }
  .code-table td:nth-child(2)::before { content: "Reward: "; color: var(--muted); }
  .code-table td:nth-child(3)::before { content: "Status: "; color: var(--muted); }
  .code-table td:nth-child(4)::before { content: "Source: "; color: var(--muted); }
  .code-table code { white-space: nowrap; word-break: normal; font-size: 13px; }
  .faq-item summary { font-size: 13px; }
  .faq-item p { font-size: 12px; }
  .comments { padding: 13px; }
  .foot-grid { grid-template-columns: 1fr; gap: 22px; }
  .foot-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calc-frame { padding: 10px; }
  .not-found { padding: 44px 0 54px; }
}
.calc-app, .calc-fallback { --calc-line: var(--line, #2a2646); --calc-bg: var(--bg, #0e0d1a); --calc-surface: var(--surface-2, #141226); --calc-text: var(--text, #f2eefc); --calc-muted: var(--muted, #9a93b8); --calc-primary: var(--primary, #8b5cf6); --calc-accent: var(--accent, #f5c451); }
.calc-grid { display: grid; grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr); gap: 11px; align-items: stretch; }
.calc-side { display: flex; flex-direction: column; padding: 13px; border: 1px solid var(--calc-line); border-radius: 9px; background: var(--calc-surface); }
.calc-side-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.calc-side h2, .calc-side h3, .calc-side-title { margin: 0; color: var(--calc-text); font-family: var(--font-head, "Space Grotesk", sans-serif); font-size: 14px; font-weight: 600; line-height: 1.2; }
.calc-side-tag { color: var(--calc-muted); font-size: 9px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.calc-rows { display: flex; flex-direction: column; gap: 6px; }
.calc-row { display: grid; grid-template-columns: minmax(0, 1fr) 56px 27px; gap: 5px; align-items: center; }
.calc-row select, .calc-row input { width: 100%; height: 34px; min-width: 0; padding: 0 7px; border: 1px solid var(--calc-line); border-radius: 7px; background: var(--calc-bg); color: var(--calc-text); font: 500 12px/1 var(--font-body, "Inter", sans-serif); outline: none; }
.calc-row select { text-overflow: ellipsis; }
.calc-row select:focus, .calc-row input:focus { border-color: var(--calc-primary); }
.calc-remove { width: 27px; height: 34px; padding: 0; border: 1px solid var(--calc-line); border-radius: 7px; background: transparent; color: var(--calc-muted); font: 500 16px/1 var(--font-body, "Inter", sans-serif); cursor: pointer; }
.calc-remove:hover { border-color: var(--danger, #ff6b8a); color: var(--danger, #ff6b8a); }
.calc-add { align-self: flex-start; margin-top: 7px; padding: 0; border: 0; background: none; color: var(--calc-accent); font: 600 10px/1.4 var(--font-body, "Inter", sans-serif); letter-spacing: .02em; cursor: pointer; }
.calc-add:hover { text-decoration: underline; }
.calc-total { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: auto 0 0; padding-top: 12px; border-top: 1px solid var(--calc-line); color: var(--calc-muted); font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.calc-total strong { color: var(--calc-accent); font-size: 20px; font-weight: 700; letter-spacing: -.02em; text-transform: none; font-variant-numeric: tabular-nums; }
.calc-between { display: grid; place-items: center; color: var(--calc-muted); font-size: 9px; font-weight: 700; letter-spacing: .12em; }
.calc-result { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-top: 12px; padding: 13px 14px; border: 1px solid var(--calc-line); border-radius: 9px; background: var(--calc-surface); }
.calc-result-copy { min-width: 0; flex: 1; }
.calc-verdict { margin: 0 0 3px; color: var(--calc-text); font-family: var(--font-head, "Space Grotesk", sans-serif); font-size: 16px; font-weight: 600; line-height: 1.25; }
.calc-detail { margin: 0; color: var(--calc-muted); font-size: 11px; line-height: 1.5; }
.calc-bar { display: flex; gap: 2px; width: 100%; max-width: 300px; height: 4px; margin-top: 10px; border-radius: 2px; overflow: hidden; background: var(--calc-line); }
.calc-bar span { display: block; height: 100%; width: 50%; background: var(--calc-primary); }
.calc-bar span[data-bar="receive"] { background: var(--calc-accent); }
.calc-numbers { flex: 0 0 auto; text-align: right; }
.calc-label { margin: 0 0 1px; color: var(--calc-muted); font-size: 9px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.calc-diff { margin: 0; color: var(--calc-accent); font-size: 24px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.calc-diff[data-tone="bad"] { color: var(--danger, #ff6b8a); }
.calc-diff[data-tone="good"] { color: var(--ok, #4ade80); }
.calc-diff[data-tone="even"] { color: var(--calc-text); }
.calc-empty { padding: 22px 16px; border: 1px dashed var(--calc-line); border-radius: 8px; background: var(--calc-surface); color: var(--calc-muted); font-size: 12px; line-height: 1.6; }
.calc-empty strong { display: block; margin-bottom: 3px; color: var(--calc-text); font-family: var(--font-head, "Space Grotesk", sans-serif); font-size: 17px; font-weight: 600; }
.calc-empty p { margin: 0; }
.calc-empty a { color: var(--calc-accent); }
.calc-note { margin: 9px 0 0; color: var(--calc-muted); font-size: 10px; line-height: 1.5; }
@media (max-width: 700px) {
  .calc-grid { grid-template-columns: 1fr; }
  .calc-between { display: none; }
  .calc-result { flex-direction: column; gap: 8px; }
  .calc-numbers { text-align: left; }
  .calc-diff { font-size: 21px; }
  .calc-bar { max-width: none; }
  .calc-fallback .calc-row, .calc-fallback .calc-total { max-width: none; }
}
/* Server-rendered calculator fallback (used when the tool asset is unavailable in preview) */
.calc-fallback { max-width: 820px; margin: 0 0 30px; }
.calc-fallback .calc-side-head { justify-content: flex-start; gap: 8px; }
.calc-fallback .calc-row { max-width: 300px; grid-template-columns: minmax(0, 1fr) 64px; }
.calc-fallback .calc-total { max-width: 300px; }
.calc-fallback #fallback-bar-receive { background: var(--accent); }
