/* calc-webapp — design system v2 (modern reference-grade).
 * System font stack (perf), refined light/dark tokens, gradient hero,
 * solid sticky header (NO backdrop-blur — it causes wheel jank on PC),
 * soft-elevation cards, tabular numerals for results. */
:root {
  --bg: #f6f8fb; --bg2: #eef2f7; --card: #ffffff;
  --ink: #0e1726; --ink2: #46556c; --ink3: #8b98ad;
  --line: #e4e9f0; --line2: #d3dbe6;
  --brand: #2563eb; --brand-ink: #1d4ed8; --brand-soft: #eaf1fe;
  --violet: #7c3aed; --accent: #0ea5e9; --amber: #f59e0b;
  --good: #16a34a; --warn: #d97706; --bad: #dc2626;
  --grad: linear-gradient(120deg, #2563eb 0%, #4f46e5 55%, #7c3aed 100%);
  --radius: 16px; --radius-sm: 11px;
  --shadow: 0 1px 2px rgba(14,23,38,.05), 0 10px 30px -12px rgba(14,23,38,.10);
  --shadow-lg: 0 2px 6px rgba(14,23,38,.06), 0 24px 48px -16px rgba(14,23,38,.16);
  --maxw: 780px;
}
/* dark tokens — applied when the user picks dark (data-theme) OR, with JS off,
 * when the system prefers dark and no explicit choice was set. */
:root[data-theme="dark"] {
  --bg: #0a101c; --bg2: #0d1524; --card: #121b2d;
  --ink: #eaf0f9; --ink2: #a6b3c9; --ink3: #64748f;
  --line: #223050; --line2: #2e3d61;
  --brand: #5b8cff; --brand-ink: #82a8ff; --brand-soft: #14213f;
  --grad: linear-gradient(120deg, #3b6fe8 0%, #5b54e6 55%, #8b5cf6 100%);
  --shadow: 0 1px 2px rgba(0,0,0,.5), 0 14px 34px -14px rgba(0,0,0,.55);
  --shadow-lg: 0 2px 8px rgba(0,0,0,.5), 0 28px 60px -18px rgba(0,0,0,.6);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #0a101c; --bg2: #0d1524; --card: #121b2d;
    --ink: #eaf0f9; --ink2: #a6b3c9; --ink3: #64748f;
    --line: #223050; --line2: #2e3d61;
    --brand: #5b8cff; --brand-ink: #82a8ff; --brand-soft: #14213f;
    --grad: linear-gradient(120deg, #3b6fe8 0%, #5b54e6 55%, #8b5cf6 100%);
    --shadow: 0 1px 2px rgba(0,0,0,.5), 0 14px 34px -14px rgba(0,0,0,.55);
    --shadow-lg: 0 2px 8px rgba(0,0,0,.5), 0 28px 60px -18px rgba(0,0,0,.6);
  }
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans KR",
    "Helvetica Neue", Arial, sans-serif;
  background: var(--bg); color: var(--ink); line-height: 1.65; font-size: 16px;
  overflow-x: hidden;
}
a { color: var(--brand-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 18px; }
::selection { background: var(--brand); color: #fff; }

/* ── header (solid sticky, no blur) ── */
.site-head {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--card) 92%, transparent);
  border-bottom: 1px solid var(--line);
}
.site-head .wrap { display: flex; align-items: center; gap: 12px; height: 58px; }
.site-head .brand {
  font-weight: 800; font-size: 16.5px; letter-spacing: -.4px; color: var(--ink);
  display: inline-flex; align-items: center; gap: 8px;
}
.site-head .brand:hover { text-decoration: none; opacity: .85; }
.brand-mark {
  width: 26px; height: 26px; border-radius: 8px; background: var(--grad);
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 14px; font-weight: 800; flex: none;
  box-shadow: 0 3px 8px rgba(37,99,235,.35);
}
.head-spacer { flex: 1; }
.lang-select {
  appearance: none; -webkit-appearance: none;
  border: 1px solid var(--line2); border-radius: 999px; background: var(--card);
  color: var(--ink2); font: 600 12.5px/1 inherit; font-family: inherit;
  padding: 8px 26px 8px 12px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%238b98ad' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.lang-select:hover { border-color: var(--brand); color: var(--brand-ink); }

/* ── breadcrumbs ── */
.crumbs { font-size: 12.5px; color: var(--ink3); padding: 16px 0 0; display: flex; flex-wrap: wrap; gap: 6px; letter-spacing: .1px; }
.crumbs a { color: var(--ink3); }
.crumbs a:hover { color: var(--brand-ink); }
.crumbs b { color: var(--ink2); font-weight: 600; }

/* ── page title ── */
.page-h1 { font-size: clamp(24px, 4.6vw, 31px); font-weight: 800; letter-spacing: -.9px; line-height: 1.22; margin: 14px 0 8px; }
.page-intro { color: var(--ink2); font-size: 15.5px; margin-bottom: 20px; max-width: 62ch; }

/* ── calculator card ── */
.calc-card {
  position: relative; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 22px;
  overflow: hidden;
}
.calc-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--grad);
}
.calc-grid { display: grid; grid-template-columns: 1fr; gap: 14px; margin-top: 6px; }
@media (min-width: 560px) { .calc-grid { grid-template-columns: 1fr 1fr; } .calc-grid .full { grid-column: 1 / -1; } }
.field label { display: block; font-size: 12.5px; font-weight: 700; letter-spacing: .2px; color: var(--ink2); margin-bottom: 7px; text-transform: none; }
.field .help { font-weight: 500; color: var(--ink3); font-size: 12px; }
.field .control {
  display: flex; align-items: stretch; border: 1.5px solid var(--line2);
  border-radius: var(--radius-sm); overflow: hidden; background: var(--bg2);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.field .control:focus-within { border-color: var(--brand); background: var(--card); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.field input, .field select {
  width: 100%; border: 0; background: transparent; color: var(--ink);
  font-size: 16px; font-weight: 500; padding: 12px 13px; font-family: inherit; outline: none; min-width: 0;
}
.field .unit { align-self: center; padding: 0 13px; color: var(--ink3); font-size: 13px; font-weight: 600; white-space: nowrap; border-left: 1px solid var(--line); }
.field select { appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%238b98ad' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 30px; }

/* ── actions ── */
.calc-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.btn {
  border: 1px solid var(--line2); background: var(--card); color: var(--ink2); font-family: inherit;
  font-size: 13.5px; font-weight: 650; padding: 9px 15px; border-radius: 999px; cursor: pointer;
  transition: all .15s; display: inline-flex; align-items: center; gap: 6px;
}
.btn:hover { border-color: var(--brand); color: var(--brand-ink); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-ink); color: #fff; }
.btn.ghost { border-style: dashed; }

/* ── outputs ── */
.calc-outputs { margin-top: 20px; display: grid; gap: 10px; }
.orow {
  display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
  padding: 13px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg2);
}
.orow .olabel { font-size: 13.5px; font-weight: 600; color: var(--ink2); }
.orow .oval { font-size: 18px; font-weight: 750; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -.3px; text-align: right; overflow-wrap: anywhere; }
.orow[data-primary] {
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 9%, var(--card)), color-mix(in srgb, var(--violet) 7%, var(--card)));
  border-color: color-mix(in srgb, var(--brand) 32%, var(--line));
}
.orow[data-primary] .oval { font-size: 25px; color: var(--brand-ink); letter-spacing: -.6px; }

/* ── content sections ── */
.section { margin: 34px 0; }
.section h2 { font-size: 19.5px; font-weight: 800; letter-spacing: -.5px; margin-bottom: 12px; display: flex; align-items: center; gap: 9px; }
.section h2::before { content: ""; width: 4px; height: 18px; border-radius: 4px; background: var(--grad); flex: none; }
.section p { color: var(--ink2); margin-bottom: 11px; font-size: 15.5px; }
.section ol, .section ul { color: var(--ink2); padding-left: 20px; margin-bottom: 10px; }
.section li { margin-bottom: 6px; }
.example {
  background: color-mix(in srgb, var(--accent) 7%, var(--card));
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  border-radius: var(--radius-sm); padding: 15px 17px; color: var(--ink2); font-size: 15px;
}

/* ── tables ── */
.conv-table { width: 100%; border-collapse: separate; border-spacing: 0; font-variant-numeric: tabular-nums; font-size: 14.5px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.conv-table th, .conv-table td { text-align: left; padding: 10px 15px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.conv-table thead th { background: var(--bg2); color: var(--ink2); font-size: 12px; font-weight: 750; letter-spacing: .4px; text-transform: uppercase; }
.conv-table tbody tr:last-child th, .conv-table tbody tr:last-child td { border-bottom: 0; }
.conv-table tbody tr:hover { background: var(--bg2); }
.conv-table th[scope="row"] { font-weight: 600; color: var(--ink); background: transparent; }
.section .conv-table { display: block; overflow-x: auto; }

/* ── unit defs / references ── */
.unit-list { list-style: none; padding: 0; display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 560px) { .unit-list { grid-template-columns: 1fr 1fr; } }
.unit-list li { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 14px; font-size: 13.5px; color: var(--ink2); }
.unit-list b { color: var(--ink); }
.unit-def { list-style: none; padding: 0; display: grid; gap: 8px; }
.unit-def li { background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 10px; padding: 11px 15px; font-size: 14.5px; color: var(--ink2); }
.unit-def b { color: var(--ink); }
.ref-list { list-style: none; padding: 0; display: grid; grid-template-columns: 1fr; gap: 9px; }
@media (min-width: 560px) { .ref-list { grid-template-columns: 1fr 1fr; } }
.ref-list li { display: flex; flex-direction: column; gap: 2px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 15px; transition: border-color .15s; }
.ref-list li:hover { border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
.ref-list .ref-v { font-weight: 750; color: var(--brand-ink); font-variant-numeric: tabular-nums; font-size: 15px; }
.ref-list .ref-l { font-size: 12.5px; color: var(--ink2); }

/* ── faq ── */
.faq details { border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 8px; background: var(--card); overflow: hidden; transition: border-color .15s; }
.faq details[open] { border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); }
.faq summary { padding: 14px 17px; font-weight: 650; cursor: pointer; list-style: none; font-size: 14.5px; color: var(--ink); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; float: right; color: var(--ink3); font-weight: 700; font-size: 16px; }
.faq details[open] summary::after { content: "–"; color: var(--brand-ink); }
.faq .fa { padding: 0 17px 15px; color: var(--ink2); font-size: 14.5px; }

/* ── cards / hub grid ── */
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
@media (min-width: 620px) { .cards { grid-template-columns: 1fr 1fr 1fr; } }
.ccard {
  display: block; background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 15px; color: var(--ink); transition: transform .16s, border-color .16s, box-shadow .16s;
}
.ccard:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); transform: translateY(-3px); text-decoration: none; box-shadow: var(--shadow-lg); }
.ccard .cc-emoji { font-size: 22px; }
.ccard .cc-name { font-weight: 700; font-size: 14px; margin-top: 8px; letter-spacing: -.2px; line-height: 1.35; }
.ccard .cc-cat { font-size: 11.5px; font-weight: 600; color: var(--ink3); margin-top: 3px; letter-spacing: .2px; }

/* ── hub hero ── */
.hub-hero { position: relative; text-align: center; padding: 40px 20px 34px; margin: 18px 0 6px;
  background: var(--grad); border-radius: 20px; color: #fff; overflow: hidden; box-shadow: var(--shadow-lg); }
.hub-hero::after { content: ""; position: absolute; width: 420px; height: 420px; border-radius: 50%;
  background: rgba(255,255,255,.10); top: -270px; right: -120px; }
.hub-hero h1 { font-size: clamp(24px, 5vw, 34px); font-weight: 800; letter-spacing: -1px; position: relative; z-index: 1; }
.hub-hero p { color: rgba(255,255,255,.85); margin-top: 9px; font-size: 15px; position: relative; z-index: 1; max-width: 56ch; margin-left: auto; margin-right: auto; }
.search-box { margin: 18px 0; }
.search-box input {
  width: 100%; font-size: 16px; padding: 15px 18px; border-radius: 14px;
  border: 1.5px solid var(--line2); background: var(--card); color: var(--ink); font-family: inherit;
  box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s;
}
.search-box input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.cat-title { font-size: 16px; font-weight: 800; letter-spacing: -.3px; margin: 26px 0 12px; display: flex; align-items: center; gap: 8px; }
.cat-title a { color: var(--ink); }
.cat-title .c-emoji { font-size: 17px; }
#hub-empty { text-align: center; color: var(--ink3); padding: 34px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; justify-content: center; }
.chip { font-size: 12.5px; font-weight: 650; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line2); background: var(--card); color: var(--ink2); transition: all .15s; }
.chip:hover { border-color: var(--brand); color: var(--brand-ink); text-decoration: none; transform: translateY(-1px); }

/* ── scientific calculator ── */
.sci { user-select: none; }
.sci-display {
  background: #0c1322; border-radius: 14px; padding: 14px 18px; margin-bottom: 14px;
  border: 1px solid #1e2b47; box-shadow: inset 0 2px 10px rgba(0,0,0,.4);
}
.sci-expr { min-height: 26px; color: #8fa3c8; font-size: 15px; text-align: right; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.sci-res { min-height: 40px; color: #f2f6ff; font-size: 31px; font-weight: 750; text-align: right; letter-spacing: -.5px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.sci-res.err { color: #fda4af; font-size: 22px; }
.sci-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.sci-mode { display: inline-flex; border: 1px solid var(--line2); border-radius: 999px; overflow: hidden; }
.sci-mode button { border: 0; background: var(--card); color: var(--ink3); font: 700 12px/1 inherit; font-family: inherit; padding: 8px 14px; cursor: pointer; }
.sci-mode button.on { background: var(--brand); color: #fff; }
.sci-hist { font-size: 12px; color: var(--ink3); cursor: pointer; background: none; border: none; font-family: inherit; font-weight: 650; }
.sci-hist:hover { color: var(--brand-ink); }
.sci-keys { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.sci-keys button {
  border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink);
  font: 600 16px/1 inherit; font-family: inherit; padding: 14px 4px; cursor: pointer;
  transition: transform .1s, background .12s, border-color .12s;
}
.sci-keys button:hover { border-color: var(--brand); }
.sci-keys button:active { transform: scale(.94); }
.sci-keys .k-fn { background: var(--bg2); color: var(--ink2); font-size: 13.5px; font-weight: 700; }
.sci-keys .k-op { background: var(--brand-soft); color: var(--brand-ink); font-weight: 800; }
.sci-keys .k-eq { background: linear-gradient(160deg, #fbbf24, #f59e0b); color: #fff; font-weight: 800; border: 0; grid-row: span 3; font-size: 22px; box-shadow: 0 6px 16px rgba(245,158,11,.35); }
.sci-keys .k-danger { color: var(--bad); font-weight: 800; }
.sci-history { margin-top: 12px; display: none; }
.sci-history.show { display: block; }
.sci-history button { display: block; width: 100%; text-align: right; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 13px; margin-bottom: 6px; font-family: inherit; font-size: 13.5px; color: var(--ink2); cursor: pointer; font-variant-numeric: tabular-nums; }
.sci-history button:hover { border-color: var(--brand); }
@media (max-width: 420px) { .sci-keys { gap: 6px; } .sci-keys button { padding: 12px 2px; font-size: 15px; } }

/* ── footer ── */
.disclaimer { font-size: 12px; color: var(--ink3); border-top: 1px dashed var(--line2); padding: 15px 0; margin-top: 26px; }
.site-foot { border-top: 1px solid var(--line); margin-top: 30px; padding: 26px 0 46px; color: var(--ink3); font-size: 13px; }
.site-foot .foot-inner { display: flex; flex-direction: column; gap: 12px; align-items: center; text-align: center; }
.site-foot a { color: var(--ink2); font-weight: 600; }
.lang-row { display: flex; flex-wrap: wrap; gap: 6px 4px; justify-content: center; }
.lang-row a { font-size: 11.5px; font-weight: 700; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink3); }
.lang-row a:hover { color: var(--brand-ink); border-color: var(--brand); text-decoration: none; }

/* ── toast ── */
#calc-toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 9999;
  display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.calc-toast { background: #0e1726; color: #fff; font-size: 13px; font-weight: 650; padding: 11px 18px;
  border-radius: 999px; opacity: 0; transform: translateY(10px); transition: opacity .25s, transform .25s; box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.calc-toast.show { opacity: 1; transform: translateY(0); }

/* ── embed mode ── */
html[data-embed="1"] .site-head,
html[data-embed="1"] .crumbs,
html[data-embed="1"] .section,
html[data-embed="1"] .related-wrap,
html[data-embed="1"] .site-foot,
html[data-embed="1"] .ad-slot { display: none !important; }
html[data-embed="1"] .page-h1 { font-size: 20px; margin-top: 10px; }
html[data-embed="1"] body { background: transparent; }

/* ── ad slot (wraps a responsive AdSense unit) ── */
.ad-slot { margin: 22px 0; min-height: 90px; text-align: center; overflow: hidden; }
.ad-slot ins { display: block; }

/* ── header icon buttons (theme / search / install) ── */
.head-btn { border: 1px solid var(--line2); background: var(--card); color: var(--ink2); font-family: inherit;
  height: 34px; min-width: 34px; padding: 0 10px; border-radius: 999px; cursor: pointer; font-size: 14px;
  display: inline-flex; align-items: center; gap: 6px; transition: all .15s; }
.head-btn:hover { border-color: var(--brand); color: var(--brand-ink); }
.head-btn .hb-t { font-size: 12.5px; font-weight: 650; }
#search-btn .hb-k { font-size: 10.5px; border: 1px solid var(--line2); border-radius: 5px; padding: 1px 5px; color: var(--ink3); }
@media (max-width: 560px) { #search-btn .hb-t, #search-btn .hb-k, #install-btn .hb-t { display: none; } }
#install-btn { border-color: color-mix(in srgb, var(--brand) 40%, var(--line2)); color: var(--brand-ink); }

/* ── skip link ── */
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 200; background: var(--brand); color: #fff;
  padding: 8px 14px; border-radius: 8px; font-weight: 650; font-size: 13px; }
.skip-link:focus { left: 12px; text-decoration: none; }

/* ── on-this-page TOC ── */
.toc { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 16px; margin: 6px 0 26px; }
.toc-t { font-size: 11.5px; font-weight: 750; letter-spacing: .5px; text-transform: uppercase; color: var(--ink3); margin-bottom: 8px; }
.toc-links { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.toc-links a { font-size: 13.5px; color: var(--ink2); font-weight: 600; }
.toc-links a:hover { color: var(--brand-ink); }

/* ── social share bar ── */
.share-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 16px 0 4px; }
.share-lbl { font-size: 13px; font-weight: 650; color: var(--ink2); margin-right: 2px; }
.share-net { width: 38px; height: 38px; border-radius: 50%; border: none; cursor: pointer; color: #fff;
  font-size: 15px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; transition: transform .12s, filter .12s; }
.share-net:hover { transform: translateY(-2px); filter: brightness(1.06); }
.share-net.sh-native { background: linear-gradient(135deg, #3b82f6, #2563eb); font-size: 17px; }
.share-net.sh-x { background: #000; }
.share-net.sh-fb { background: #1877f2; }
.share-net.sh-wa { background: #25d366; }
.share-net.sh-tg { background: #229ed9; }
.share-net.sh-line { background: #06c755; }
.share-net.sh-kakao { background: #fee500; color: #191600; }
.share-net.sh-band { background: #23c65a; }
.share-net.sh-naver { background: #03c75a; }
.share-net.sh-reddit { background: #ff4500; }
.share-net.sh-pin { background: #e60023; }
.share-net.sh-hatena { background: #00a4de; font-size: 13px; }
.share-net.sh-linked { background: #0a66c2; font-size: 13px; }
.share-net.sh-copy { background: var(--ink2); }

/* ── helpful feedback ── */
.helpful { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; justify-content: center;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; margin: 26px 0 0; }
.helpful .fb-q { font-size: 14.5px; font-weight: 650; color: var(--ink); }
.helpful .fb-thanks { font-size: 14.5px; font-weight: 650; color: var(--good); }
.fb-btn { border: 1px solid var(--line2); background: var(--bg2); color: var(--ink2); font-family: inherit;
  font-size: 13.5px; font-weight: 650; padding: 8px 15px; border-radius: 999px; cursor: pointer; transition: all .15s; }
.fb-btn:hover { border-color: var(--brand); color: var(--brand-ink); }

/* ── back to top FAB ── */
#to-top { position: fixed; right: 16px; bottom: 20px; z-index: 90; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--card); color: var(--brand-ink); font-size: 20px; font-weight: 800;
  cursor: pointer; box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(12px) scale(.9); pointer-events: none; transition: all .2s; }
#to-top.show { opacity: 1; transform: none; pointer-events: auto; }

/* ── recently used strip ── */
.recent-strip { margin: 4px 0 8px; }
.recent-head { display: flex; align-items: center; justify-content: space-between; margin: 22px 0 12px; }
.recent-head .cat-title { margin: 0; }
.recent-clear { background: none; border: none; color: var(--ink3); font-family: inherit; font-size: 12.5px; font-weight: 650; cursor: pointer; }
.recent-clear:hover { color: var(--brand-ink); }

/* ── global search overlay ── */
.search-ov { position: fixed; inset: 0; z-index: 300; background: rgba(9,14,26,.55); backdrop-filter: blur(2px);
  display: none; align-items: flex-start; justify-content: center; padding: 12vh 16px 16px; }
.search-ov.show { display: flex; }
.search-panel { width: 100%; max-width: 560px; background: var(--card); border: 1px solid var(--line2);
  border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden; }
.search-inp { width: 100%; border: none; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink);
  font-family: inherit; font-size: 17px; padding: 16px 18px; outline: none; }
.search-list { max-height: 56vh; overflow-y: auto; padding: 6px; }
.search-row { display: flex; align-items: center; gap: 11px; padding: 11px 12px; border-radius: 10px; color: var(--ink); }
.search-row:hover, .search-row.on { background: var(--brand-soft); text-decoration: none; }
.search-row .sr-e { font-size: 18px; flex: none; }
.search-row .sr-t { font-weight: 650; font-size: 14.5px; flex: 1; }
.search-row .sr-c { font-size: 11.5px; color: var(--ink3); font-weight: 600; }
.search-empty { padding: 22px; text-align: center; color: var(--ink3); font-size: 14px; }

/* ── deep-link section anchors ── */
.section > h2 { scroll-margin-top: 72px; }
.section > h2 > .anchor { opacity: 0; margin-left: 6px; color: var(--ink3); font-weight: 400; text-decoration: none; font-size: .8em; }
.section > h2:hover > .anchor { opacity: 1; }

/* ── footer nav mesh ── */
.foot-nav { display: flex; flex-wrap: wrap; gap: 6px 8px; justify-content: center; margin-top: 4px; }
.foot-nav a { font-size: 12.5px; color: var(--ink2); }
.foot-nav a:hover { color: var(--brand-ink); }
.foot-sep { color: var(--line2); }
.privacy-note { font-size: 12px; color: var(--ink3); max-width: 60ch; margin: 2px auto 0; text-align: center; }

/* ── language suggestion banner ── */
.lang-banner { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px 14px;
  padding: 9px 40px 9px 16px; position: relative; font-size: 13.5px;
  background: var(--brand-soft); color: var(--ink); border-bottom: 1px solid var(--line); }
.lang-banner .lb-msg { font-weight: 550; }
.lang-banner .lb-go { font-weight: 700; color: var(--brand-ink); text-decoration: underline; text-underline-offset: 3px; }
.lang-banner .lb-x { position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  border: 0; background: none; cursor: pointer; font-size: 14px; color: var(--ink3); padding: 6px 8px; border-radius: 8px; }
.lang-banner .lb-x:hover { background: var(--line2); color: var(--ink); }

/* ── print ── */
@media print {
  .site-head, .toc, .share-bar, .helpful, #to-top, .ad-slot, .site-foot, .related-wrap, #calc-toast, .lang-banner,
  .search-ov, .sci-keys, .sci-mode, .sci-hist, .calc-actions, .crumbs, .disclaimer, .faq { display: none !important; }
  body { background: #fff; color: #000; font-size: 12pt; }
  .calc-card { box-shadow: none; border: 1px solid #ccc; }
  .calc-outputs .orow[data-primary] { font-size: 14pt; font-weight: 700; }
  .calc-outputs .orow:not([hidden]) { display: flex !important; }
  a { color: #000; text-decoration: none; }
  .section, .calc-outputs { break-inside: avoid; }
  .page-h1::after { content: ' — ' attr(data-print-date); font-size: 10pt; font-weight: normal; }
}

:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } html { scroll-behavior: auto; } }
