/* 1Hustler — main stylesheet
   Editorial · light-mode primary · dark-mode optional · accessible · no framework
*/

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700;9..144,800&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500;700&display=swap');

:root {
  --bg: #faf7ef;
  --bg-card: #ffffff;
  --bg-sunken: #f1ebd9;
  --text: #1a1814;
  --text-soft: #4d4640;
  --text-dim: #8a8278;
  --border: #e7e0cc;
  --border-strong: #c9bda1;
  --accent: #0a6b3e;
  --accent-hover: #0d8a4f;
  --accent-soft: #e6f3ec;
  --accent-fg: #ffffff;
  --gold: #b8860b;
  --gold-soft: #faf3e0;
  --danger: #b03a2e;
  --success: #0a6b3e;

  --display: 'Fraunces', 'Iowan Old Style', 'Georgia', serif;
  --body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 16px;
  --r-xl: 24px;

  --shadow-sm: 0 1px 2px rgba(20, 17, 13, 0.05);
  --shadow-md: 0 8px 24px rgba(20, 17, 13, 0.08);
  --shadow-lg: 0 20px 50px rgba(20, 17, 13, 0.12);

  --max-w: 1140px;
  --read-w: 720px;
}

[data-theme="dark"] {
  --bg: #14110d;
  --bg-card: #1d1a14;
  --bg-sunken: #0a0907;
  --text: #faf7ef;
  --text-soft: #c9bda1;
  --text-dim: #6b655c;
  --border: #2a2520;
  --border-strong: #3a3530;
  --accent: #4ade80;
  --accent-hover: #6ee79c;
  --accent-soft: rgba(74, 222, 128, 0.12);
  --accent-fg: #14110d;
  --gold: #f4d35e;
  --gold-soft: rgba(244, 211, 94, 0.1);
  --danger: #ff6b6b;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.6);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14110d;
    --bg-card: #1d1a14;
    --bg-sunken: #0a0907;
    --text: #faf7ef;
    --text-soft: #c9bda1;
    --text-dim: #6b655c;
    --border: #2a2520;
    --border-strong: #3a3530;
    --accent: #4ade80;
    --accent-hover: #6ee79c;
    --accent-soft: rgba(74, 222, 128, 0.12);
    --accent-fg: #14110d;
    --gold: #f4d35e;
    --gold-soft: rgba(244, 211, 94, 0.1);
    --danger: #ff6b6b;
  }
}

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

html { scroll-behavior: smooth; }

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

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 3px; }

img, svg { max-width: 100%; height: auto; display: block; }

/* --- Layout primitives --- */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 1.5rem; width: 100%; }
.read { max-width: var(--read-w); margin: 0 auto; padding: 0 1.5rem; width: 100%; }

main { flex: 1; }

/* --- Header --- */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.site-header .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  max-width: var(--max-w);
  margin: 0 auto;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--text);
  letter-spacing: -0.01em;
}
.brand:hover { color: var(--text); text-decoration: none; }
.brand .mark {
  width: 32px;
  height: 32px;
  background: var(--accent);
  color: var(--accent-fg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.1rem;
  border-radius: 6px;
}
.brand .one { color: var(--accent); }

.nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}
.nav a {
  color: var(--text-soft);
  font-size: 0.95rem;
  font-weight: 500;
}
.nav a:hover { color: var(--text); text-decoration: none; }
.nav a.active { color: var(--text); }

.theme-toggle {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-soft);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.theme-toggle:hover { border-color: var(--border-strong); color: var(--text); }
.theme-toggle .sun { display: none; }
.theme-toggle .moon { display: block; }
[data-theme="dark"] .theme-toggle .sun { display: block; }
[data-theme="dark"] .theme-toggle .moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: none; }
}

.menu-toggle { display: none; }

@media (max-width: 720px) {
  .nav { display: none; }
  .nav.open {
    display: flex;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    gap: 0;
    padding: 1rem 1.5rem;
    align-items: flex-start;
  }
  .nav.open a { padding: 0.6rem 0; border-bottom: 1px solid var(--border); width: 100%; }
  .menu-toggle {
    display: flex;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
  }
}

/* --- Footer --- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-sunken);
  padding: 3rem 0 2rem;
  margin-top: 6rem;
  font-size: 0.9rem;
  color: var(--text-soft);
}
.site-footer .inner {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 3rem;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem 2rem;
}
.site-footer h4 {
  font-family: var(--display);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text);
  margin-bottom: 0.85rem;
}
.site-footer ul { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.site-footer a { color: var(--text-soft); }
.site-footer a:hover { color: var(--accent); text-decoration: none; }
.site-footer .colophon {
  border-top: 1px solid var(--border);
  padding: 1.5rem 1.5rem 0;
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: var(--text-dim);
  gap: 1rem;
  flex-wrap: wrap;
}
.site-footer .brand-mini { display: flex; align-items: center; gap: 0.5rem; color: var(--text-dim); }
@media (max-width: 720px) {
  .site-footer .inner { grid-template-columns: 1fr 1fr; gap: 2rem; }
}

/* --- Hero --- */
.hero {
  padding: 5rem 0 4rem;
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.hero .grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--border) 1px, transparent 1px),
    linear-gradient(to bottom, var(--border) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 70%);
  opacity: 0.55;
  pointer-events: none;
}
.hero .inner { position: relative; max-width: var(--max-w); margin: 0 auto; padding: 0 1.5rem; }
.eyebrow {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.2rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.eyebrow::before {
  content: '';
  width: 28px;
  height: 1px;
  background: var(--accent);
}
h1.display {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.6rem, 7vw, 5.4rem);
  line-height: 1.02;
  letter-spacing: -0.025em;
  margin-bottom: 1.5rem;
  font-variation-settings: "opsz" 144;
  color: var(--text);
  max-width: 16ch;
}
h1.display .em {
  font-style: italic;
  color: var(--accent);
  font-weight: 600;
}
.hero .lede {
  font-size: 1.25rem;
  line-height: 1.55;
  color: var(--text-soft);
  max-width: 56ch;
  margin-bottom: 2.5rem;
}
.hero .actions { display: flex; gap: 0.85rem; flex-wrap: wrap; }

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.5rem;
  background: var(--accent);
  color: var(--accent-fg);
  border-radius: var(--r-md);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid var(--accent);
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-fg); text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn.secondary { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn.secondary:hover { background: var(--bg-card); border-color: var(--text); color: var(--text); }
.btn.lg { padding: 1rem 1.75rem; font-size: 1rem; }

/* --- Section --- */
.section { padding: 5rem 0; border-bottom: 1px solid var(--border); }
.section.sunken { background: var(--bg-sunken); }
.section:last-of-type { border-bottom: none; }
.section-head { margin-bottom: 3rem; max-width: 60ch; }
.section-head .eyebrow { margin-bottom: 0.75rem; }
h2.section-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2rem, 4vw, 2.75rem);
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text);
  font-variation-settings: "opsz" 72;
}
.section-head p {
  color: var(--text-soft);
  font-size: 1.1rem;
  margin-top: 1rem;
}

/* --- Cards --- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}
.card {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1.85rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  color: var(--text);
  transition: all 0.2s;
  height: 100%;
}
a.card:hover {
  border-color: var(--border-strong);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
  color: var(--text);
}
.card .kicker {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
}
.card h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.4rem;
  letter-spacing: -0.015em;
  line-height: 1.2;
  color: var(--text);
}
.card p {
  color: var(--text-soft);
  font-size: 0.95rem;
  line-height: 1.55;
  flex: 1;
}
.card .meta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 0.75rem;
}
.tag {
  font-size: 0.72rem;
  font-family: var(--mono);
  font-weight: 600;
  padding: 0.28rem 0.55rem;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.tag.gold { background: var(--gold-soft); color: var(--gold); }
.tag.dim { background: var(--bg-sunken); color: var(--text-dim); }

/* --- Stats strip --- */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--bg-card);
}
.stat {
  padding: 2rem 1.5rem;
  text-align: center;
  border-right: 1px solid var(--border);
}
.stat:last-child { border-right: none; }
.stat .n {
  font-family: var(--display);
  font-weight: 700;
  font-size: 3.2rem;
  line-height: 1;
  color: var(--accent);
  letter-spacing: -0.03em;
  font-variation-settings: "opsz" 144;
}
.stat .label {
  font-size: 0.88rem;
  color: var(--text-soft);
  margin-top: 0.6rem;
  line-height: 1.4;
}
.stat .src {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 0.45rem;
  letter-spacing: 0.05em;
}
.stat .src a { color: var(--text-dim); border-bottom: 1px dotted var(--text-dim); }
@media (max-width: 720px) {
  .stat { border-right: none; border-bottom: 1px solid var(--border); }
  .stat:last-child { border-bottom: none; }
}

/* --- CTA banner --- */
.cta-banner {
  background: var(--text);
  color: var(--bg);
  border-radius: var(--r-xl);
  padding: 4rem 3rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
[data-theme="dark"] .cta-banner { background: var(--bg-card); border: 1px solid var(--border-strong); }
.cta-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(135deg, transparent 40%, rgba(74, 222, 128, 0.08) 100%);
  pointer-events: none;
}
.cta-banner .content { position: relative; max-width: 60ch; margin: 0 auto; }
.cta-banner h2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  color: var(--bg);
}
[data-theme="dark"] .cta-banner h2 { color: var(--text); }
.cta-banner p { color: rgba(250, 247, 239, 0.75); font-size: 1.1rem; margin-bottom: 2rem; }
[data-theme="dark"] .cta-banner p { color: var(--text-soft); }
.cta-banner .btn { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.cta-banner .btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.cta-banner .btn.secondary {
  background: transparent;
  color: var(--bg);
  border-color: rgba(250, 247, 239, 0.3);
}
.cta-banner .btn.secondary:hover { border-color: var(--bg); color: var(--bg); background: transparent; }
[data-theme="dark"] .cta-banner .btn.secondary { color: var(--text); border-color: var(--border-strong); }

/* --- Article (guide pages) --- */
.article-header { padding: 4rem 0 2rem; border-bottom: 1px solid var(--border); }
.article-header .read { max-width: var(--read-w); }
.crumbs {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}
.crumbs a { color: var(--text-soft); }
.crumbs a:hover { color: var(--accent); text-decoration: none; }
.crumbs .sep { margin: 0 0.6rem; color: var(--text-dim); }

h1.article-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
  color: var(--text);
  font-variation-settings: "opsz" 144;
  margin: 0.75rem 0 1.25rem;
}
.article-deck {
  font-family: var(--display);
  font-weight: 400;
  font-style: italic;
  font-size: 1.35rem;
  line-height: 1.45;
  color: var(--text-soft);
  margin-bottom: 2rem;
  font-variation-settings: "opsz" 72;
}
.byline {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  font-size: 0.9rem;
  color: var(--text-dim);
  flex-wrap: wrap;
  padding-bottom: 1rem;
}
.byline .by { color: var(--text-soft); font-weight: 500; }
.byline .sep { color: var(--border-strong); }

article.guide { padding: 3rem 0 4rem; }
article.guide .read { max-width: var(--read-w); }
article.guide h2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.85rem;
  letter-spacing: -0.015em;
  line-height: 1.2;
  margin: 3rem 0 1rem;
  color: var(--text);
  font-variation-settings: "opsz" 72;
  scroll-margin-top: 80px;
}
article.guide h2:first-of-type { margin-top: 1rem; }
article.guide h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
  line-height: 1.25;
  margin: 2rem 0 0.75rem;
  color: var(--text);
}
article.guide p, article.guide li {
  font-size: 1.08rem;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 1.2rem;
}
article.guide ul, article.guide ol {
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
}
article.guide li { margin-bottom: 0.6rem; }
article.guide strong { color: var(--text); font-weight: 700; }
article.guide a { border-bottom: 1px solid var(--accent-soft); }
article.guide a:hover { border-bottom-color: var(--accent); text-decoration: none; }

article.guide blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.5rem 0 0.5rem 1.5rem;
  margin: 2rem 0;
  font-family: var(--display);
  font-style: italic;
  font-size: 1.25rem;
  color: var(--text-soft);
  line-height: 1.5;
}

.tldr {
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: var(--r-md);
  padding: 1.5rem 1.75rem;
  margin: 2rem 0 2.5rem;
}
.tldr h3 {
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.75rem !important;
}
.tldr p { font-size: 1rem !important; margin-bottom: 0 !important; color: var(--text) !important; }

.callout {
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  background: var(--bg-card);
  border-radius: var(--r-md);
  padding: 1.1rem 1.4rem;
  margin: 1.75rem 0;
  font-size: 1rem;
}
.callout.warn { border-left-color: var(--danger); }
.callout.warn::before { content: '⚠  '; color: var(--danger); font-weight: 700; }
.callout.win { border-left-color: var(--success); }
.callout.win::before { content: '✓  '; color: var(--success); font-weight: 700; }
.callout p { margin: 0 !important; font-size: 1rem !important; }

article.guide table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.75rem 0;
  font-size: 0.95rem;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}
article.guide thead { background: var(--bg-sunken); }
article.guide th, article.guide td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
article.guide th {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-soft);
}
article.guide tbody tr:last-child td { border-bottom: none; }
article.guide tbody tr:hover { background: var(--bg-sunken); }

.next-up {
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 2.5rem;
  margin: 3rem 0;
  text-align: center;
}
.next-up .eyebrow { margin-bottom: 0.75rem; }
.next-up h3 {
  font-family: var(--display);
  font-size: 1.6rem;
  margin-bottom: 0.75rem !important;
  color: var(--text);
}
.next-up p { color: var(--text-soft); margin-bottom: 1.5rem !important; font-size: 1rem !important; }

.related {
  border-top: 1px solid var(--border);
  padding: 3rem 0 4rem;
  background: var(--bg-sunken);
}
.related h3 {
  font-family: var(--display);
  font-size: 1.6rem;
  margin-bottom: 1.5rem;
  color: var(--text);
}

/* --- TOC --- */
.toc {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 1.2rem 1.4rem;
  margin: 1.5rem 0 2rem;
  font-size: 0.95rem;
}
.toc summary {
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-soft);
  user-select: none;
}
.toc ol {
  margin: 1rem 0 0 1.2rem;
  padding: 0;
  list-style-position: outside;
}
.toc li { margin-bottom: 0.4rem; font-size: 0.95rem !important; }
.toc a { color: var(--text-soft); }
.toc a:hover { color: var(--accent); text-decoration: none; }

/* --- Calculator --- */
.calc-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin: 2rem 0;
}
@media (min-width: 880px) { .calc-grid { grid-template-columns: 1fr 1.1fr; } }
.calc-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 2rem;
}
.calc-panel h3 {
  font-family: var(--display);
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  color: var(--text);
}
.field { margin-bottom: 1.1rem; }
.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-soft);
  margin-bottom: 0.4rem;
  letter-spacing: 0.02em;
}
.field label .hint { font-weight: 400; color: var(--text-dim); margin-left: 0.4rem; font-size: 0.8rem; }
.field input, .field select {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  font: inherit;
  font-size: 1rem;
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.15s;
}
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field .with-prefix { position: relative; }
.field .with-prefix .prefix {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 0.95rem;
}
.field .with-prefix input { padding-left: 1.85rem; }
.field .with-suffix { position: relative; }
.field .with-suffix .suffix {
  position: absolute;
  right: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 0.9rem;
}
.field .with-suffix input { padding-right: 2.5rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.85rem; }
@media (max-width: 480px) { .field-row { grid-template-columns: 1fr; } }

.result-panel {
  background: var(--text);
  color: var(--bg);
  border-radius: var(--r-lg);
  padding: 2rem;
  border: 1px solid var(--text);
  position: relative;
  overflow: hidden;
}
[data-theme="dark"] .result-panel { background: var(--bg-sunken); color: var(--text); border-color: var(--border-strong); }
.result-panel .kicker {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.6rem;
  font-weight: 700;
}
.result-panel .big-n {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.5rem, 6vw, 4rem);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--accent);
  font-variation-settings: "opsz" 144;
  margin-bottom: 0.5rem;
}
[data-theme="dark"] .result-panel .big-n { color: var(--accent); }
.result-panel .result-sub { color: rgba(250, 247, 239, 0.7); font-size: 1rem; margin-bottom: 1.5rem; }
[data-theme="dark"] .result-panel .result-sub { color: var(--text-soft); }

.result-rows { display: flex; flex-direction: column; border-top: 1px solid rgba(250, 247, 239, 0.12); }
[data-theme="dark"] .result-rows { border-top-color: var(--border); }
.result-rows .row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(250, 247, 239, 0.08);
  font-size: 0.95rem;
}
[data-theme="dark"] .result-rows .row { border-bottom-color: var(--border); }
.result-rows .row:last-child { border-bottom: none; }
.result-rows .row .k { color: rgba(250, 247, 239, 0.6); }
[data-theme="dark"] .result-rows .row .k { color: var(--text-dim); }
.result-rows .row .v { font-family: var(--mono); font-weight: 600; }

.calc-help {
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  font-size: 0.92rem;
  color: var(--text-soft);
  line-height: 1.55;
}
.calc-help strong { color: var(--text); }

/* --- Misc --- */
.divider {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 4rem 0;
}
.kbd {
  font-family: var(--mono);
  font-size: 0.78rem;
  padding: 0.15rem 0.4rem;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-soft);
}

.error-page {
  text-align: center;
  padding: 6rem 1.5rem 4rem;
}
.error-page .code {
  font-family: var(--display);
  font-size: 8rem;
  color: var(--accent);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  font-variation-settings: "opsz" 144;
}
.error-page h1 { font-family: var(--display); font-size: 2.5rem; margin: 1rem 0; }
.error-page p { color: var(--text-soft); margin-bottom: 2rem; }
