/* ==========================================================================
   CalculatorsPoint stylesheet
   Design: precision-instrument. Cool neutrals, one confident blue for brand
   and actions, jade green reserved for the result readout (the "answer").
   System fonts for speed; tabular monospace for numbers.
   ========================================================================== */

:root {
  --bg: #fbfcfd;
  --surface: #ffffff;
  --surface-2: #f4f6f9;
  --border: #e6eaef;
  --border-strong: #d4dae2;
  --text: #0f1729;
  --muted: #5b6472;
  --primary: #2b59ff;
  --primary-dark: #1f44d6;
  --primary-tint: #eef2ff;
  --accent: #00a86b;
  --accent-tint: #e6f7f0;
  --danger: #d6453d;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(15,23,41,.04), 0 4px 16px rgba(15,23,41,.05);
  --shadow-lg: 0 8px 30px rgba(15,23,41,.10);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --maxw: 1120px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 18px; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(1.7rem, 4.5vw, 2.6rem); font-weight: 800; }
h2 { font-size: clamp(1.3rem, 3vw, 1.7rem); font-weight: 750; }
h3 { font-size: 1.05rem; font-weight: 700; }

p { margin: 0 0 1rem; }

.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--primary);
  color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0; z-index: 100;
}
.skip-link:focus { left: 0; }

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

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251,252,253,.9);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 62px; gap: 14px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; color: var(--text); letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: grid; place-items: center; width: 30px; height: 30px;
  background: var(--primary); color: #fff; border-radius: 8px;
  font-family: var(--mono); font-weight: 700; font-size: 1.1rem;
}
.brand-name { font-size: 1.12rem; }

.site-nav { display: none; gap: 4px; }
.site-nav a {
  color: var(--muted); font-weight: 600; font-size: .94rem;
  padding: 7px 11px; border-radius: 8px;
}
.site-nav a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }

.nav-toggle {
  display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
  width: 42px; height: 42px; padding: 0 9px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px; cursor: pointer;
}
.nav-toggle span { height: 2px; background: var(--text); border-radius: 2px; transition: .2s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (min-width: 860px) {
  .nav-toggle { display: none; }
  .site-nav { display: flex; }
}
/* mobile open state */
.site-nav.open {
  display: flex; flex-direction: column; position: absolute; top: 62px; left: 0; right: 0;
  background: var(--surface); border-bottom: 1px solid var(--border); padding: 8px 18px 14px;
  box-shadow: var(--shadow);
}
.site-nav.open a { padding: 11px 8px; border-bottom: 1px solid var(--border); }

/* ---------- Ads ---------- */
.ad-wrap { margin: 14px auto; }
.ad-slot { text-align: center; overflow: hidden; }
.ad-slot:empty { display: none; }
.calc-sidebar .ad-slot { margin-bottom: 18px; }

main { display: block; padding: 24px 0 40px; }

/* ---------- Hero + search ---------- */
.hero { text-align: center; padding: 30px 0 22px; }
.hero p.lede { color: var(--muted); font-size: 1.12rem; max-width: 620px; margin: 0 auto 22px; }
.search-box { position: relative; max-width: 540px; margin: 0 auto; }
.search-box input {
  width: 100%; font-size: 1.05rem; padding: 15px 18px 15px 46px;
  border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface);
  box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s;
}
.search-box input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-tint); }
.search-box svg { position: absolute; left: 17px; top: 50%; transform: translateY(-50%); color: var(--muted); }

.no-results { text-align: center; color: var(--muted); padding: 30px; display: none; }

/* ---------- Category sections + cards ---------- */
.cat-section { margin-top: 38px; }
.cat-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; gap: 10px; }
.cat-head h2 { margin: 0; }
.cat-head a { font-weight: 600; font-size: .9rem; white-space: nowrap; }

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

.calc-card {
  display: flex; align-items: center; gap: 13px; padding: 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); transition: transform .14s, box-shadow .14s, border-color .14s;
}
.calc-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--border-strong); text-decoration: none; }
.calc-card .ico {
  flex: 0 0 44px; height: 44px; display: grid; place-items: center;
  font-size: 1.35rem; background: var(--primary-tint); border-radius: 10px;
}
.calc-card .ico.txt { font-family: var(--mono); font-weight: 700; color: var(--primary); }
.calc-card .meta strong { display: block; color: var(--text); font-size: 1rem; }
.calc-card .meta span { color: var(--muted); font-size: .85rem; }

/* ---------- Calculator page layout ---------- */
.breadcrumbs { font-size: .85rem; color: var(--muted); margin: 4px 0 16px; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--text); }

.calc-layout { display: grid; grid-template-columns: 1fr; gap: 26px; }
@media (min-width: 1000px) { .calc-layout { grid-template-columns: minmax(0,1fr) 300px; align-items: start; } }
.calc-sidebar { display: none; }
@media (min-width: 1000px) { .calc-sidebar { display: block; position: sticky; top: 78px; } }

.calc-intro { color: var(--muted); max-width: 70ch; }

/* The interactive tool */
.calc-tool {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px; margin: 18px 0;
}
.field-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 520px) { .field-grid.two { grid-template-columns: 1fr 1fr; } }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 600; font-size: .9rem; color: var(--text); }
.field .hint { font-size: .78rem; color: var(--muted); font-weight: 400; }
.field input, .field select {
  font-size: 1rem; padding: 11px 13px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); background: var(--surface); color: var(--text);
  font-family: var(--font); width: 100%; transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-tint); }

.input-prefix { position: relative; }
.input-prefix span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-prefix input { padding-left: 28px; }

.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button {
  border: 0; background: transparent; padding: 7px 15px; border-radius: 999px;
  font-weight: 600; font-size: .88rem; color: var(--muted); cursor: pointer;
}
.seg button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 1rem; font-weight: 700; padding: 12px 20px; border-radius: var(--radius-sm);
  border: 1px solid transparent; cursor: pointer; transition: background .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); text-decoration: none; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

/* Result readout: the signature element */
.readout {
  margin-top: 18px; background: var(--accent-tint); border: 1px solid #bfe9d6;
  border-top: 3px solid var(--accent); border-radius: var(--radius-sm); padding: 18px 20px;
}
.readout .r-label { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: #0a7c50; font-weight: 700; }
.readout .r-value {
  font-family: var(--mono); font-size: clamp(1.9rem, 7vw, 2.6rem); font-weight: 700;
  color: var(--text); font-variant-numeric: tabular-nums; line-height: 1.1; margin-top: 2px;
}
.readout .r-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; margin-top: 14px; }
.readout .r-grid div { font-size: .9rem; color: var(--muted); }
.readout .r-grid b { display: block; font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 1.15rem; color: var(--text); font-weight: 700; }
.readout.updated { animation: pop .25s ease; }
@keyframes pop { 0% { transform: scale(.99); } 60% { transform: scale(1.004); } 100% { transform: scale(1); } }

/* Content sections */
.content-block { margin: 30px 0; max-width: 72ch; }
.content-block h2 { margin-top: 0; }
.content-block ul { padding-left: 20px; }
.content-block li { margin-bottom: 6px; }

/* FAQ */
.faq details {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); margin-bottom: 10px; box-shadow: var(--shadow);
}
.faq summary {
  cursor: pointer; padding: 15px 18px; font-weight: 650; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--mono); font-size: 1.3rem; color: var(--primary); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .faq-a { padding: 0 18px 16px; color: var(--muted); }

/* Related */
.related-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 560px) { .related-grid { grid-template-columns: repeat(3, 1fr); } }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); margin-top: 30px; }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 26px; padding: 38px 18px 22px; }
@media (min-width: 700px) { .footer-grid { grid-template-columns: 1.4fr repeat(3, 1fr); } }
.footer-about p { color: var(--muted); font-size: .92rem; margin-top: 12px; max-width: 32ch; }
.footer-col h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { color: var(--text); font-size: .92rem; }
.footer-bottom { border-top: 1px solid var(--border); padding: 16px 18px; }
.footer-bottom p { color: var(--muted); font-size: .82rem; margin: 0; }

/* ---------- 404 ---------- */
.notfound { text-align: center; padding: 60px 0; }
.notfound .code { font-family: var(--mono); font-size: 4rem; font-weight: 700; color: var(--primary); }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ==========================================================================
   On-screen calculator widget (Standard + Scientific)
   ========================================================================== */
.calc-screen {
  max-width: 480px; margin: 0 auto; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px;
}
.calc-screen.wide { max-width: 520px; }
.cs-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.cs-top .seg button { font-size: .82rem; padding: 6px 12px; }

.cs-display {
  background: #0f1729; border-radius: var(--radius-sm); padding: 16px 18px;
  text-align: right; margin-bottom: 14px; overflow: hidden;
}
.cs-expr {
  font-family: var(--mono); font-variant-numeric: tabular-nums;
  font-size: clamp(1.7rem, 6vw, 2.3rem); color: #fff; line-height: 1.2;
  white-space: nowrap; overflow: hidden; min-height: 1.2em; font-weight: 600;
}
.cs-prev {
  font-family: var(--mono); font-variant-numeric: tabular-nums;
  font-size: 1rem; color: #34d399; min-height: 1.2em; margin-top: 4px; white-space: nowrap; overflow: hidden;
}

.cs-sci, .cs-pad { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.cs-sci { margin-bottom: 8px; }

.cs-btn {
  -webkit-appearance: none; appearance: none; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 1.2rem; font-weight: 600; min-height: 50px;
  display: grid; place-items: center; cursor: pointer; user-select: none;
  transition: background .12s, transform .04s, border-color .12s;
}
.cs-btn:hover { background: var(--surface-2); }
.cs-btn:active { transform: translateY(1px); }
.cs-btn.op { background: var(--primary-tint); color: var(--primary); font-weight: 700; border-color: #d7e0ff; }
.cs-btn.op:hover { background: #e2e9ff; }
.cs-btn.eq { background: var(--primary); color: #fff; border-color: var(--primary); }
.cs-btn.eq:hover { background: var(--primary-dark); }
.cs-btn.act { background: var(--surface-2); color: var(--muted); font-size: 1.05rem; }
.cs-btn.act:hover { background: #e9edf3; }
.cs-btn.fn { background: #f0f3f8; color: var(--text); font-size: .98rem; }
.cs-btn.fn:hover { background: #e6ebf2; }

@media (max-width: 420px) {
  .cs-sci, .cs-pad { gap: 6px; }
  .cs-btn { min-height: 46px; font-size: 1.1rem; }
}

/* Homepage calculator block */
.hp-calc-wrap { margin: 8px 0 26px; }
.hp-calc-wrap .hp-calc-head { text-align: center; margin-bottom: 14px; }
.hp-calc-wrap .hp-calc-head h2 { margin: 0 0 4px; }
.hp-calc-wrap .hp-calc-head p { color: var(--muted); margin: 0; font-size: .95rem; }

/* ==========================================================================
   HOMEPAGE v2 (hero, explore, trust), DARK MODE, FAVORITES
   ========================================================================== */

/* ---- Header actions (theme toggle + favorites) ---- */
.header-inner { justify-content: flex-start; }
.site-nav { margin: 0 auto 0 14px; }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; cursor: pointer; color: var(--text); padding: 0; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn .sun { display: none; }
[data-theme="dark"] .icon-btn .sun { display: block; }
[data-theme="dark"] .icon-btn .moon { display: none; }
.fav-btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; background: var(--primary); color: #fff; border: 0; border-radius: 10px; font-weight: 700; font-size: .9rem; cursor: pointer; text-decoration: none; white-space: nowrap; }
.fav-btn:hover { background: var(--primary-dark); text-decoration: none; }
.fav-btn.on { background: var(--accent); }
@media (max-width: 600px) { .fav-btn .lbl { display: none; } .fav-btn { padding: 9px 11px; } }

/* ---- Hero panel ---- */
.hero-wrap { background: linear-gradient(135deg, #eaf1ff 0%, #f6f9ff 60%, #eef4ff 100%); border: 1px solid var(--border); border-radius: 20px; padding: 26px; margin: 14px 0 8px; position: relative; overflow: hidden; }
.hero2 { display: grid; gap: 26px; align-items: center; position: relative; z-index: 1; }
@media (min-width: 940px) { .hero2 { grid-template-columns: minmax(0, 430px) 1fr; gap: 42px; } }
.hero2-content { position: relative; z-index: 1; }
.hero-badge { display: inline-flex; align-items: center; gap: 7px; font-size: .82rem; font-weight: 700; color: var(--primary); background: rgba(43,89,255,.1); padding: 6px 13px; border-radius: 999px; margin-bottom: 16px; }
.hero-title { font-size: clamp(2.1rem, 5.6vw, 3.4rem); line-height: 1.04; letter-spacing: -.03em; margin: 0 0 16px; font-weight: 800; }
.hero-title .accent { color: var(--primary); display: block; }
.hero-sub { color: var(--muted); font-size: clamp(1rem, 2.2vw, 1.16rem); max-width: 48ch; margin: 0 0 20px; }
.hero2 .search-box { max-width: none; margin: 0 0 18px; }
.popular { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 22px; }
.popular .plabel { font-weight: 700; font-size: .86rem; color: var(--text); margin-right: 2px; }
.tag { font-size: .82rem; font-weight: 600; padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--muted); }
.tag:hover { color: var(--primary); border-color: var(--primary); text-decoration: none; }
.stat-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 560px) { .stat-tiles { grid-template-columns: repeat(4, 1fr); } }
.stile { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 10px; text-align: center; box-shadow: var(--shadow); }
.stile .ic { width: 38px; height: 38px; margin: 0 auto 8px; display: grid; place-items: center; border-radius: 10px; background: var(--primary-tint); color: var(--primary); }
.stile .big { font-size: 1.2rem; font-weight: 800; font-family: var(--mono); line-height: 1.1; }
.stile .lab { font-size: .74rem; color: var(--muted); font-weight: 600; margin-top: 2px; }

.hero-illu { position: absolute; right: -20px; top: 50%; transform: translateY(-50%); width: 240px; opacity: .92; pointer-events: none; z-index: 0; display: none; }
@media (min-width: 1180px) { .hero-illu { display: block; } }

/* ---- Section + Explore ---- */
.section { padding: 32px 0; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 22px; }
.section-head h2 { margin: 0 0 8px; }
.section-head p { color: var(--muted); margin: 0; }
.explore-cards { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 560px) { .explore-cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .explore-cards { grid-template-columns: repeat(4, 1fr); } }
.cat-card { display: flex; align-items: center; gap: 14px; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); transition: transform .14s, box-shadow .14s; }
.cat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); text-decoration: none; }
.cat-card .ic { flex: 0 0 48px; height: 48px; display: grid; place-items: center; font-size: 1.45rem; border-radius: 12px; }
.cat-card .nm strong { display: block; color: var(--text); font-size: 1.02rem; }
.cat-card .nm span { color: var(--muted); font-size: .84rem; }
.browse-all { text-align: center; margin-top: 22px; }

/* ---- Trust bar ---- */
.trust { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); display: grid; grid-template-columns: 1fr; gap: 20px; padding: 24px; }
@media (min-width: 560px) { .trust { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .trust { grid-template-columns: repeat(4, 1fr); } }
.trust-item { display: flex; gap: 13px; align-items: flex-start; }
.trust-item .ic { flex: 0 0 42px; height: 42px; display: grid; place-items: center; border-radius: 10px; background: var(--accent-tint); color: var(--accent); }
.trust-item h3 { margin: 0 0 3px; font-size: .98rem; }
.trust-item p { margin: 0; color: var(--muted); font-size: .85rem; }

/* ---- Favorites stars on cards ---- */
.calc-card { position: relative; }
.fav-star { position: absolute; top: 9px; right: 9px; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 7px; color: #c4ccda; cursor: pointer; font-size: 1rem; line-height: 1; z-index: 2; user-select: none; }
.fav-star:hover { color: #f5b301; background: var(--surface-2); }
.fav-star.on { color: #f5b301; }
.fav-empty { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 30px; }

/* ---- Dark theme ---- */
[data-theme="dark"] {
  --bg: #0e1626; --surface: #16203a; --surface-2: #1e2a44; --border: #28344e; --border-strong: #3a4a6e;
  --text: #e7edf7; --muted: #9aa7c0; --primary: #6088ff; --primary-dark: #4a73ff; --primary-tint: rgba(96,136,255,.16);
  --accent: #1fcf8a; --accent-tint: rgba(31,207,138,.15);
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.35); --shadow-lg: 0 10px 34px rgba(0,0,0,.5);
}
[data-theme="dark"] body { background: var(--bg); }
[data-theme="dark"] .site-header { background: rgba(14,22,38,.85); }
[data-theme="dark"] .hero-wrap { background: linear-gradient(135deg, #14223f 0%, #0f1830 70%); }
[data-theme="dark"] .hero-badge { background: rgba(96,136,255,.16); }
[data-theme="dark"] .tag { background: var(--surface-2); }
[data-theme="dark"] .cs-display { background: #0a1020; border: 1px solid var(--border); }
[data-theme="dark"] .cs-btn.fn { background: #1e2a44; }
[data-theme="dark"] .cs-btn.act { background: #1e2a44; }
[data-theme="dark"] .readout { border-color: rgba(31,207,138,.32); }
[data-theme="dark"] .readout .r-label { color: #34d399; }
[data-theme="dark"] .readout .r-grid b, [data-theme="dark"] .readout .r-value { color: var(--text); }
[data-theme="dark"] .search-box input,
[data-theme="dark"] .field input, [data-theme="dark"] .field select,
[data-theme="dark"] .seg, [data-theme="dark"] textarea,
[data-theme="dark"] input[type=text], [data-theme="dark"] input[type=date], [data-theme="dark"] input[type=time], [data-theme="dark"] input[type=range] { background: #0f1830; color: var(--text); }
[data-theme="dark"] .seg button.active { background: #28344e; }
[data-theme="dark"] .faq summary::after { color: var(--primary); }

/* ============ Add-to-Home-Screen banner (PWA) ============ */
.a2hs {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 9999;
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 16px;
  padding: 12px 14px; box-shadow: var(--shadow-lg);
  transform: translateY(160%); transition: transform .38s cubic-bezier(.2, .8, .2, 1);
}
.a2hs.show { transform: translateY(0); }
.a2hs img { width: 44px; height: 44px; border-radius: 11px; flex: 0 0 auto; }
.a2hs .a2hs-txt { flex: 1 1 auto; font-size: .88rem; line-height: 1.35; color: var(--muted); }
.a2hs .a2hs-txt b { display: block; color: var(--text); font-size: .95rem; margin-bottom: 2px; }
.a2hs .a2hs-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.a2hs button {
  appearance: none; -webkit-appearance: none; border: 0; border-radius: 10px;
  padding: 9px 14px; font-weight: 700; font-size: .85rem; cursor: pointer; font-family: var(--font);
}
.a2hs .a2hs-add { background: var(--primary); color: #fff; }
.a2hs .a2hs-no { background: transparent; color: var(--muted); }
.a2hs .a2hs-no:hover { color: var(--text); }
@media (min-width: 560px) { .a2hs { left: auto; right: 20px; max-width: 430px; } }
@media (min-width: 992px) { .a2hs { display: none !important; } } /* mobile only */

/* ============ Header: keep brand + menu on one line ============ */
.brand-name { white-space: nowrap; }
.brand-logo { height: 30px; width: auto; max-width: 190px; display: block; border-radius: 7px; }
.site-nav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; }
.site-nav::-webkit-scrollbar { display: none; }
.site-nav a { white-space: nowrap; }
@media (min-width: 900px) { .site-nav a { padding: 7px 9px; } }
.site-nav.open { flex-wrap: wrap; overflow: visible; }

/* ============ Dashboard: traffic chart + embedded Google report ============ */
.tchart { width: 100%; height: auto; display: block; margin: 6px 0 4px; }
.trend { font-weight: 700; font-size: .9rem; }
.trend.up { color: #0a7c50; }
.trend.down { color: var(--danger); }
.trend.flat { color: var(--muted); }
.embed-wrap { position: relative; width: 100%; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); }
.embed-wrap iframe { width: 100%; height: 2400px; border: 0; display: block; }
.embed-empty { padding: 22px; border: 1px dashed var(--border-strong); border-radius: 12px; background: var(--surface); color: var(--muted); font-size: .92rem; line-height: 1.5; }
.embed-empty ol { margin: 10px 0 0; padding-left: 20px; }
.embed-empty li { margin: 5px 0; }

/* ============ Branding uploader ============ */
.brand-upload { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
.brand-box { border: 1px solid var(--border); border-radius: 12px; padding: 14px; background: var(--surface); }
.brand-box h4 { margin: 0 0 4px; font-size: .95rem; }
.brand-box .hint { display: block; margin-bottom: 10px; }
.brand-prev { height: 64px; display: flex; align-items: center; justify-content: center; background: repeating-conic-gradient(#eef1f6 0% 25%, #fff 0% 50%) 50% / 16px 16px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 10px; overflow: hidden; }
.brand-prev img { max-height: 56px; max-width: 90%; }
.brand-prev.empty { color: var(--muted); font-size: .82rem; }
[data-theme="dark"] .brand-prev { background: #1a2130; }
.sitemap-copy { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sitemap-copy code { background: var(--surface-2, var(--surface)); border: 1px solid var(--border); border-radius: 7px; padding: 7px 10px; font-size: .85rem; word-break: break-all; }

/* ============ Full-width category bar (second header row) ============ */
.site-header { position: relative; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.category-bar { border-top: 1px solid var(--border); }
.category-bar .site-nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; padding: 5px 0; }
.category-bar .site-nav::-webkit-scrollbar { display: none; }
.category-bar .site-nav a { white-space: nowrap; padding: 8px 13px; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: .92rem; }
.category-bar .site-nav a:hover { color: var(--text); background: var(--bg); }
@media (min-width: 900px) { .nav-toggle { display: none; } }
@media (max-width: 899px) {
  .category-bar { display: none; border-top: 0; }
  .category-bar.nav-open { display: block; position: absolute; left: 0; right: 0; top: 100%; background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: var(--shadow-lg); z-index: 60; }
  .category-bar.nav-open .site-nav { flex-direction: column; overflow: visible; padding: 8px 0; }
  .category-bar.nav-open .site-nav a { padding: 11px 4px; border-radius: 0; }
}

/* ============ Simple footer ============ */
.footer-simple { display: flex; align-items: center; justify-content: space-between; gap: 18px 24px; flex-wrap: wrap; padding: 26px 0 14px; }
.footer-cats { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.footer-cats a { color: var(--muted); font-weight: 600; font-size: .9rem; }
.footer-cats a:hover { color: var(--text); }
.footer-bottom { padding: 14px 0 30px; border-top: 1px solid var(--border); }
.footer-bottom p { color: var(--muted); font-size: .85rem; margin: 0; }

/* ============ Per-calculator "Add to Home Screen" button ============ */
.a2hs-inline { margin: 14px 0 2px; }
.a2hs-inline-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--primary-tint, #eef2ff); color: var(--primary);
  border: 1px solid var(--primary); border-radius: 10px;
  padding: 10px 16px; font-weight: 700; font-size: .92rem; cursor: pointer;
  font-family: var(--font); transition: background .15s, color .15s;
}
.a2hs-inline-btn:hover { background: var(--primary); color: #fff; }
.a2hs-inline-btn span[aria-hidden] { font-size: 1.05rem; }

/* ============ Calculator export buttons ============ */
.calc-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 2px; }
.calc-export-btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: 10px;
  padding: 9px 15px; font-weight: 600; font-size: .9rem; cursor: pointer; font-family: var(--font);
  transition: border-color .15s, background .15s;
}
.calc-export-btn:hover { border-color: var(--primary); color: var(--primary); }
.calc-export-btn:disabled { opacity: .55; cursor: progress; }
#calc-capture { background: var(--surface); }

/* ============ Centered menu ============ */
.category-bar .site-nav { justify-content: center; }

/* ============ Header search ============ */
.header-inner { gap: 14px; }
.header-search { position: relative; flex: 1 1 auto; max-width: 480px; min-width: 0; margin: 0 6px; }
.header-search #site-search {
  width: 100%; box-sizing: border-box; padding: 10px 14px;
  border: 1px solid var(--border-strong); border-radius: 999px;
  background: var(--bg); color: var(--text); font-size: .92rem; font-family: var(--font);
}
.header-search #site-search:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(43,89,255,.14); background: var(--surface); }
.search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 80;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 12px;
  box-shadow: var(--shadow-lg); overflow: hidden; max-height: 60vh; overflow-y: auto;
}
.search-hit { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; color: var(--text); border-bottom: 1px solid var(--border); }
.search-hit:last-child { border-bottom: 0; }
.search-hit small { color: var(--muted); font-size: .78rem; flex: 0 0 auto; }
.search-hit.active, .search-hit:hover { background: var(--bg); color: var(--primary); }
@media (max-width: 760px) {
  .header-search { order: 3; flex-basis: 100%; max-width: none; margin: 8px 0 2px; }
  .header-inner { flex-wrap: wrap; }
}

/* ============ Footer: more breathing room ============ */
.site-footer { padding: 30px 0 18px; margin-top: 56px; }
.footer-simple { padding: 32px 0 22px; gap: 22px 30px; }
.footer-bottom { padding: 22px 0 40px; }
.footer-cats { gap: 10px 22px; }

/* ============ Nicer export buttons ============ */
.calc-actions { gap: 12px; margin: 20px 0 4px; }
.calc-export-btn {
  padding: 11px 20px; border-radius: 12px; font-weight: 700; font-size: .95rem;
  border: 0; color: #fff; box-shadow: 0 4px 14px rgba(43,89,255,.28);
  background: linear-gradient(135deg, #2b59ff 0%, #5b8cff 100%);
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
.calc-export-btn:hover { transform: translateY(-1px); filter: brightness(1.05); box-shadow: 0 7px 20px rgba(43,89,255,.34); color: #fff; }
.calc-export-btn:active { transform: translateY(0); }
.calc-export-btn[data-export="png"] { background: linear-gradient(135deg, #00a86b 0%, #34d39c 100%); box-shadow: 0 4px 14px rgba(0,168,107,.28); }
.calc-export-btn[data-export="png"]:hover { box-shadow: 0 7px 20px rgba(0,168,107,.34); }
.calc-export-btn span[aria-hidden] { font-size: 1.1rem; }

/* ============ Blog ============ */
.blog-wrap, .blog-post { padding-top: 30px; padding-bottom: 20px; }
.blog-head { margin-bottom: 26px; }
.blog-head h1 { margin: 0 0 6px; }
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; }
.blog-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; transition: transform .14s ease, box-shadow .14s ease, border-color .14s; }
.blog-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--primary); }
.blog-card-img { display: block; height: 168px; background-size: cover; background-position: center; background-color: var(--bg); }
.blog-card-noimg { display: flex; align-items: center; justify-content: center; font-size: 2.4rem; font-weight: 800; color: var(--primary); background: linear-gradient(135deg, rgba(43,89,255,.10), rgba(0,168,107,.10)); }
.blog-card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 7px; }
.blog-card-body strong { font-size: 1.08rem; line-height: 1.3; color: var(--text); }
.blog-card-excerpt { color: var(--muted); font-size: .9rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.blog-card-date { color: var(--muted); font-size: .8rem; margin-top: 2px; }
.blog-post { max-width: 760px; }
.blog-post h1 { margin: 8px 0 6px; }
.blog-meta { color: var(--muted); font-size: .88rem; margin-bottom: 18px; }
.blog-hero { width: 100%; border-radius: 14px; margin: 6px 0 22px; }
.blog-content { font-size: 1.05rem; line-height: 1.75; color: var(--text); }
.blog-content h2 { margin: 30px 0 10px; font-size: 1.5rem; }
.blog-content h3 { margin: 24px 0 8px; font-size: 1.2rem; }
.blog-content p { margin: 0 0 16px; }
.blog-content img { max-width: 100%; border-radius: 10px; }
.blog-content ul, .blog-content ol { margin: 0 0 16px; padding-left: 22px; }
.blog-content a { color: var(--primary); }
.blog-ad { margin: 24px 0; }
.blog-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.blog-tags span { background: var(--bg); border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px; font-size: .82rem; color: var(--muted); }
.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: 4px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--primary); }
.btn.sm { padding: 6px 12px; font-size: .85rem; }
.btn.danger { background: var(--danger); color: #fff; border: 0; }

/* ============ Math sub-categories + step-by-step calculators ============ */
.subcat-head { margin: 36px 0 6px; font-size: 1.35rem; }
.subcat-head:first-of-type { margin-top: 20px; }
.subcat-note { color: var(--muted); font-size: .9rem; margin: 0 0 14px; }
.calc-steps { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; margin-top: 16px; }
.calc-steps h4 { margin: 0 0 8px; font-size: .9rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.calc-steps .step { padding: 7px 0; border-bottom: 1px dashed var(--border); font-size: .93rem; line-height: 1.5; }
.calc-steps .step:last-child { border-bottom: 0; }
.calc-steps .step b { color: var(--primary); }
.calc-eq { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface); border-left: 3px solid var(--primary); padding: 8px 12px; margin: 8px 0; border-radius: 0 6px 6px 0; overflow-x: auto; white-space: nowrap; }
.rule-used { background: rgba(43,89,255,.06); border: 1px solid rgba(43,89,255,.18); border-radius: 8px; padding: 10px 12px; margin-top: 12px; font-size: .9rem; }
.rule-used b { display: block; margin-bottom: 4px; color: var(--primary); }
.rule-used ul { margin: 4px 0 0; padding-left: 18px; }
.input-help { margin-top: 16px; font-size: .86rem; color: var(--muted); background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; }
.input-help h4 { margin: 0 0 8px; font-size: .95rem; color: var(--text); }
.input-help code { background: var(--surface); border: 1px solid var(--border); padding: 1px 6px; border-radius: 4px; font-size: .85em; }
.input-help table { width: 100%; border-collapse: collapse; margin-top: 6px; }
.input-help td { padding: 4px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.input-help td:first-child { white-space: nowrap; color: var(--text); }

/* ============ Sticky footer (footer sits at bottom on short pages) ============ */
html, body { height: 100%; }
body { display: flex; flex-direction: column; min-height: 100vh; }
#main { flex: 1 0 auto; }
.site-footer { flex-shrink: 0; }

/* ============ Blog button in header ============ */
.blog-btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 999px; font-weight: 600; font-size: .9rem; border: 1px solid var(--border-strong); color: var(--text); background: var(--surface); }
.blog-btn:hover { border-color: var(--primary); color: var(--primary); }
@media (max-width: 620px) { .blog-btn .lbl { display: none; } .blog-btn::before { content: "\270E"; } }

/* ============ Footer social icons ============ */
.footer-social { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 18px; }
.footer-social a { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: var(--bg); border: 1px solid var(--border); color: var(--muted); transition: transform .12s ease, color .12s, border-color .12s; }
.footer-social a:hover { color: var(--primary); border-color: var(--primary); transform: translateY(-2px); }

/* ============ Donation page ============ */
.donate-wrap { max-width: 640px; padding: 30px 0 24px; }
.donate-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 22px 24px; margin-top: 18px; }
.donate-card h2 { margin: 0 0 12px; font-size: 1.15rem; }
.donate-crypto { display: flex; flex-direction: column; gap: 10px; }
.donate-coin { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.donate-coin .lab { font-weight: 700; font-size: .9rem; margin-bottom: 4px; }
.donate-coin .addr { display: flex; gap: 8px; align-items: center; }
.donate-coin code { flex: 1; font-size: .82rem; word-break: break-all; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 6px 8px; }
.donate-bank { white-space: pre-wrap; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; font-size: .92rem; line-height: 1.6; }
.donate-qr { text-align: center; margin-top: 8px; }
.donate-qr img { max-width: 240px; border-radius: 12px; border: 1px solid var(--border); }

/* ============ Blog pill button (matches Favorites shape) ============ */
.blog-pill { background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); }
.blog-pill:hover { border-color: var(--primary); color: var(--primary); background: var(--surface); }
.blog-pill span[aria-hidden] { font-size: .95em; }
/* header no longer has a search box; keep brand left, actions right */
.header-inner { justify-content: space-between; }

/* ============ Donation strip under calculators ============ */
.donate-strip { display: flex; align-items: center; gap: 12px; margin: 22px 0 4px; padding: 14px 18px; border-radius: 14px; border: 1px solid var(--border); background: linear-gradient(135deg, rgba(43,89,255,.05), rgba(0,168,107,.05)); color: var(--text); transition: border-color .14s, transform .14s; }
.donate-strip:hover { border-color: var(--primary); transform: translateY(-1px); }
.donate-strip-ico { font-size: 1.3rem; color: #e0245e; flex: 0 0 auto; }
.donate-strip-txt { flex: 1; font-size: .92rem; color: var(--muted); }
.donate-strip-txt b { color: var(--text); }
.donate-strip-btn { flex: 0 0 auto; background: var(--primary); color: #fff; padding: 8px 18px; border-radius: 999px; font-weight: 700; font-size: .88rem; }

/* ============ Header fixes: centered desktop menu + Blog in menu ============ */
/* The Blog pill is removed from the header; Blog is now a normal menu item. */
.blog-pill { display: none !important; }
.nav-blog { display: inline-flex; }

/* Center the category menu like a real topbar.
   Method: the bar centers inline content, and the nav is an inline-flex box that
   shrink-wraps to its items. This does not rely on justify-content or fit-content,
   so it centers even with the nav's overflow-x:auto. */
@media (min-width: 860px) {
  .category-bar { text-align: center; }
  .category-bar .site-nav.container {
    display: inline-flex !important;
    width: auto !important;
    max-width: 100%;
    margin: 0 auto !important;
    float: none !important;
    overflow-x: visible;
    vertical-align: top;
  }
}
/* Mobile: smaller brand so the header does not feel cramped */
@media (max-width: 600px) {
  .brand-name { font-size: .95rem; }
  .brand-logo { width: 30px; height: 30px; }
}

/* ============ Language selector + auto-detect bar ============ */
.footer-lang { display: flex; align-items: center; gap: 8px; margin: 10px 0; font-size: .85rem; color: var(--muted); }
.footer-lang label { font-weight: 600; }
.footer-lang select { padding: 6px 10px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-size: .85rem; cursor: pointer; }
.lang-autobar { display: flex; align-items: center; gap: 12px; justify-content: center; flex-wrap: wrap; background: linear-gradient(135deg, rgba(43,89,255,.08), rgba(0,168,107,.08)); border-bottom: 1px solid var(--border); padding: 8px 14px; font-size: .88rem; color: var(--text); }
.lang-autobar a { color: var(--primary); font-weight: 700; text-decoration: none; }
.lang-autobar a:hover { text-decoration: underline; }
.lang-autobar-x { background: none; border: 0; color: var(--muted); font-size: 1.2rem; line-height: 1; cursor: pointer; padding: 0 4px; }

/* ============ Right-to-left languages (Arabic, Urdu, Farsi) ============ */
[dir="rtl"] body, [dir="rtl"] .container { text-align: right; }
[dir="rtl"] .breadcrumb, [dir="rtl"] .calc-actions, [dir="rtl"] .header-actions, [dir="rtl"] .footer-lang { flex-direction: row-reverse; }
[dir="rtl"] .calc-intro, [dir="rtl"] .content-block, [dir="rtl"] p, [dir="rtl"] h1, [dir="rtl"] h2 { text-align: right; }
[dir="rtl"] .card-grid strong, [dir="rtl"] .lang-autobar { direction: rtl; }
[dir="rtl"] ul, [dir="rtl"] ol { padding-right: 20px; padding-left: 0; }

/* ============ Cookie consent banner ============ */
#cp-cookie-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 9998; background: var(--surface); border-top: 1px solid var(--border-strong); box-shadow: 0 -4px 20px rgba(0,0,0,.08); padding: 14px 18px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: center; font-size: .88rem; color: var(--text); }
#cp-cookie-bar .cp-cookie-txt { flex: 1; min-width: 220px; }
#cp-cookie-bar .cp-cookie-txt a { color: var(--primary); font-weight: 600; }
#cp-cookie-bar .cp-cookie-btns { display: flex; gap: 10px; flex: 0 0 auto; }
#cp-cookie-bar button { padding: 9px 18px; border-radius: 8px; font-weight: 700; font-size: .85rem; cursor: pointer; border: 1px solid var(--border-strong); }
#cp-cookie-decline { background: var(--surface); color: var(--text); }
#cp-cookie-accept { background: var(--primary); color: #fff; border-color: var(--primary); }
.sitepage-body h2 { margin-top: 1.4em; }
.sitepage-body p { line-height: 1.7; }

/* ============ 3D Contact page ============ */
.contact3d-wrap { max-width: 640px; margin: 24px auto; perspective: 1400px; }
.contact3d-card { background: var(--surface); border-radius: 22px; padding: 0 0 30px; overflow: hidden; border: 1px solid var(--border); box-shadow: 0 30px 60px -18px rgba(43,89,255,.35), 0 12px 24px -12px rgba(0,0,0,.18); transform: rotateX(3deg); transform-origin: top center; transition: transform .4s ease, box-shadow .4s ease; }
.contact3d-card:hover { transform: rotateX(0deg) translateY(-3px); box-shadow: 0 40px 80px -20px rgba(43,89,255,.42), 0 16px 30px -14px rgba(0,0,0,.22); }
.contact3d-head { background: linear-gradient(135deg, #2b59ff 0%, #5b7cff 45%, #00a86b 130%); color: #fff; padding: 34px 30px 28px; text-align: center; position: relative; }
.contact3d-head::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 30px; background: var(--surface); border-radius: 50% 50% 0 0 / 100% 100% 0 0; }
.contact3d-badge { width: 62px; height: 62px; margin: 0 auto 12px; border-radius: 18px; background: rgba(255,255,255,.18); display: flex; align-items: center; justify-content: center; font-size: 30px; box-shadow: inset 0 2px 6px rgba(255,255,255,.35), 0 8px 18px rgba(0,0,0,.18); transform: translateZ(30px); }
.contact3d-head h1 { margin: 0 0 6px; font-size: 1.7rem; color: #fff; }
.contact3d-head p { margin: 0 auto; max-width: 420px; color: rgba(255,255,255,.9); font-size: .95rem; }
.contact3d-email { display: inline-flex; gap: 6px; align-items: center; margin-top: 14px; background: rgba(255,255,255,.16); color: #fff; padding: 7px 16px; border-radius: 999px; font-weight: 600; font-size: .9rem; text-decoration: none; }
.contact3d-form { padding: 8px 30px 0; }
.contact3d-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .contact3d-grid { grid-template-columns: 1fr; } }
.contact3d-field { margin-bottom: 15px; }
.contact3d-field label { display: block; font-weight: 600; font-size: .85rem; margin-bottom: 6px; color: var(--text); }
.contact3d-field input, .contact3d-field textarea { width: 100%; padding: 13px 15px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--bg); color: var(--text); font-size: .95rem; box-shadow: inset 0 2px 5px rgba(0,0,0,.06); transition: box-shadow .2s, border-color .2s, transform .2s; }
.contact3d-field input:focus, .contact3d-field textarea:focus { outline: none; border-color: var(--primary); box-shadow: inset 0 2px 5px rgba(0,0,0,.05), 0 0 0 4px rgba(43,89,255,.15); transform: translateY(-1px); }
.contact3d-btn { width: 100%; margin-top: 6px; padding: 15px; border: 0; border-radius: 14px; background: linear-gradient(135deg, #2b59ff, #5b7cff); color: #fff; font-weight: 800; font-size: 1rem; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px; box-shadow: 0 10px 22px -6px rgba(43,89,255,.55), inset 0 1px 0 rgba(255,255,255,.3); transition: transform .15s, box-shadow .15s; }
.contact3d-btn:hover { transform: translateY(-2px); box-shadow: 0 16px 30px -8px rgba(43,89,255,.6), inset 0 1px 0 rgba(255,255,255,.3); }
.contact3d-btn:active { transform: translateY(1px); box-shadow: 0 6px 14px -6px rgba(43,89,255,.5); }
.contact3d-note { margin: 18px 30px 0; padding: 12px 16px; border-radius: 12px; font-weight: 600; font-size: .9rem; }
.contact3d-note.ok { background: rgba(0,168,107,.1); border: 1px solid #00a86b; color: #0a7a52; }
.contact3d-note.err { background: rgba(239,68,68,.08); border: 1px solid #ef4444; color: #b91c1c; }

/* ============ Attractive About page ============ */
.about-hero { text-align: center; background: linear-gradient(135deg, rgba(43,89,255,.08), rgba(0,168,107,.08)); border: 1px solid var(--border); border-radius: 20px; padding: 34px 26px; margin-bottom: 22px; }
.about-hero-badge { width: 66px; height: 66px; margin: 0 auto 14px; border-radius: 18px; background: linear-gradient(135deg, #2b59ff, #00a86b); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 32px; box-shadow: 0 12px 26px -8px rgba(43,89,255,.5); }
.about-hero h2 { margin: 0 0 8px; font-size: 1.7rem; }
.about-hero p { max-width: 620px; margin: 0 auto; color: var(--muted); line-height: 1.7; }
.about-features { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 22px 0; }
@media (max-width: 560px) { .about-features { grid-template-columns: 1fr; } }
.about-feat { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 20px; box-shadow: 0 8px 20px -12px rgba(0,0,0,.18); transition: transform .2s, box-shadow .2s; }
.about-feat:hover { transform: translateY(-3px); box-shadow: 0 16px 30px -14px rgba(43,89,255,.3); }
.about-feat-ic { width: 44px; height: 44px; border-radius: 12px; background: rgba(43,89,255,.1); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 22px; margin-bottom: 12px; }
.about-feat h3 { margin: 0 0 6px; font-size: 1.05rem; }
.about-feat p { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.6; }

/* ============ Footer rebuilt to match the design ============ */
.site-footer { background: #0a1a3a; color: #cdd6ea; margin-top: 40px; }
.site-footer a { color: #cdd6ea; text-decoration: none; }
.footer-main { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.3fr; gap: 40px; padding: 48px 18px 36px; }
@media (max-width: 980px) { .footer-main { grid-template-columns: 1fr 1fr; gap: 32px; } }
@media (max-width: 560px) { .footer-main { grid-template-columns: 1fr; } }
.footer-brand { display: flex; align-items: center; gap: 12px; }
.footer-logo { width: 48px; height: 48px; border-radius: 12px; object-fit: cover; }
.footer-logo-mark { width: 48px; height: 48px; border-radius: 12px; background: linear-gradient(135deg,#2b59ff,#00a86b); color:#fff; display:flex; align-items:center; justify-content:center; font-weight:800; font-size:22px; }
.footer-brand-text { display: flex; flex-direction: column; }
.footer-brand-name { font-size: 1.25rem; font-weight: 800; color: #fff; line-height: 1.1; }
.footer-brand-tag { font-size: .8rem; color: #4f7cff; }
.footer-desc { font-size: .88rem; line-height: 1.7; color: #9fb0d0; margin: 16px 0; max-width: 320px; }
.footer-social { display: flex; gap: 12px; margin-top: 4px; }
.footer-social a { width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.06); display: flex; align-items: center; justify-content: center; color: #cdd6ea; transition: background .18s, color .18s, transform .18s; }
.footer-social a:hover { background: #2b59ff; color: #fff; transform: translateY(-2px); }
.fcol-title { color: #fff; font-size: 1.05rem; font-weight: 700; margin: 0 0 20px; padding-bottom: 10px; position: relative; }
.fcol-title::after { content: ""; position: absolute; left: 0; bottom: 0; width: 34px; height: 3px; border-radius: 3px; background: #2b59ff; }
.footer-list { list-style: none; margin: 0; padding: 0; }
.footer-list li { margin-bottom: 4px; }
.footer-list li a { display: flex; align-items: center; gap: 12px; padding: 7px 0; font-size: .92rem; transition: color .16s, transform .16s; }
.footer-list li a .fc-ic { color: #4f7cff; flex: 0 0 auto; }
.footer-list li a span { flex: 1; }
.footer-list li a .fc-chev { color: #5a6b8c; opacity: .6; transition: transform .16s, opacity .16s; }
.footer-list li a:hover { color: #fff; transform: translateX(3px); }
.footer-list li a:hover .fc-chev { opacity: 1; transform: translateX(2px); color: #4f7cff; }
.footer-usp { margin-top: 18px; display: flex; flex-direction: column; gap: 18px; }
.footer-usp .usp { display: flex; gap: 14px; align-items: flex-start; }
.footer-usp .usp svg { color: #4f7cff; flex: 0 0 auto; margin-top: 2px; }
.footer-usp .usp b { display: block; color: #fff; font-size: .95rem; margin-bottom: 3px; }
.footer-usp .usp span { display: block; font-size: .84rem; color: #9fb0d0; line-height: 1.5; }
/* subscribe bar */
.footer-subscribe { background: #0c1f45; border-top: 1px solid rgba(255,255,255,.06); padding: 28px 0; }
.footer-sub-inner { display: flex; align-items: center; justify-content: space-between; gap: 30px; flex-wrap: wrap; }
.footer-sub-left { display: flex; align-items: center; gap: 16px; }
.footer-sub-ic { width: 58px; height: 58px; border-radius: 50%; border: 2px solid #2b59ff; color: #4f7cff; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.footer-sub-left b { color: #fff; font-size: 1.15rem; display: block; }
.footer-sub-left p { margin: 4px 0 0; font-size: .86rem; color: #9fb0d0; max-width: 340px; }
.footer-sub-form { display: flex; background: #0a1a3a; border: 1px solid rgba(255,255,255,.12); border-radius: 12px; overflow: hidden; flex: 1; min-width: 300px; max-width: 520px; }
.footer-sub-form input { flex: 1; background: transparent; border: 0; padding: 15px 18px; color: #fff; font-size: .95rem; outline: none; }
.footer-sub-form input::placeholder { color: #6b7ca0; }
.footer-sub-form button { display: flex; align-items: center; gap: 8px; background: #2b59ff; color: #fff; border: 0; padding: 0 26px; font-weight: 700; font-size: .95rem; cursor: pointer; transition: background .16s; }
.footer-sub-form button:hover { background: #1e46e0; }
.footer-sub-msg { margin-top: 12px; padding: 10px 14px; border-radius: 8px; font-size: .88rem; font-weight: 600; }
.footer-sub-msg.ok { background: rgba(0,168,107,.15); color: #56e0a6; }
.footer-sub-msg.err { background: rgba(239,68,68,.15); color: #ff9a9a; }
/* bottom bar */
.footer-bottom { border-top: 1px solid rgba(255,255,255,.06); padding: 22px 0; }
.footer-bottom-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.footer-bottom .footer-lang { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.footer-bottom .footer-lang label { display: flex; align-items: center; gap: 6px; font-size: .8rem; color: #9fb0d0; font-weight: 600; }
.footer-bottom .footer-lang select { background: #0c1f45; border: 1px solid rgba(255,255,255,.14); color: #fff; padding: 9px 14px; border-radius: 8px; min-width: 150px; }
.footer-copy { flex: 1; text-align: center; font-size: .84rem; color: #9fb0d0; line-height: 1.6; min-width: 260px; }
.footer-copy a { color: #4f7cff; }
.footer-legal { display: flex; align-items: center; gap: 12px; font-size: .84rem; flex-wrap: wrap; }
.footer-legal a:hover { color: #fff; }
.footer-legal .sep { color: #3a4b6e; }
@media (max-width: 760px) { .footer-bottom-inner { flex-direction: column; text-align: center; } .footer-copy { order: 3; } }

/* ============ Lead-capture CTA block + last-updated line ============ */
.calc-updated { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--muted); margin: 6px 0 0; }
.calc-updated svg { color: #00a86b; }
.cta-block { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin: 22px 0 4px; padding: 20px 24px; border-radius: 16px; background: linear-gradient(135deg, #2b59ff, #4f7cff); color: #fff; box-shadow: 0 14px 30px -12px rgba(43,89,255,.5); }
.cta-block .cta-text b { display: block; font-size: 1.15rem; margin-bottom: 3px; }
.cta-block .cta-text span { font-size: .92rem; color: rgba(255,255,255,.9); }
.cta-block .cta-btn { flex: 0 0 auto; background: #fff; color: #2b59ff; font-weight: 800; padding: 12px 24px; border-radius: 999px; text-decoration: none; white-space: nowrap; box-shadow: 0 6px 14px rgba(0,0,0,.15); transition: transform .15s; }
.cta-block .cta-btn:hover { transform: translateY(-2px); }

/* ============ Google Website Translate: hide banner, keep layout clean ============ */
.goog-te-banner-frame, .goog-te-balloon-frame { display: none !important; }
.goog-te-gadget { height: 0; overflow: hidden; }
body { top: 0 !important; }
#goog-gt-tt, .goog-tooltip, .goog-tooltip:hover { display: none !important; }
.goog-text-highlight { background: none !important; box-shadow: none !important; }
.skiptranslate iframe { display: none !important; visibility: hidden !important; }
#google_translate_element { display: none !important; }

/* ============================================================
   GROWTH FEATURES
   Sponsor line, affiliate slot, calc tools (email result / embed),
   scenarios, comparison pages, glossary, roadmap.
   ============================================================ */

/* Sponsor line under the calculator title */
.sponsor-line { margin: -4px 0 10px; font-size: .82rem; color: var(--muted); }
.sponsor-line a { font-weight: 700; }

/* Affiliate slot */
.affiliate-slot { margin: 18px 0; padding: 16px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface-2); position: relative; }
.affiliate-tag { position: absolute; top: -9px; left: 14px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 99px; padding: 1px 10px; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }

/* Calc tools (email result / embed) */
.calc-tools { margin: 14px 0; display: grid; gap: 10px; }
.tool-box { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); padding: 0; }
.tool-box > summary { cursor: pointer; font-weight: 700; font-size: .9rem; padding: 12px 16px; list-style: none; }
.tool-box > summary::-webkit-details-marker { display: none; }
.tool-box[open] > summary { border-bottom: 1px solid var(--border); }
.tool-box > *:not(summary) { margin: 12px 16px; }
.tool-hint { color: var(--muted); font-size: .82rem; }
.tool-note { padding: 9px 12px; border-radius: 8px; font-weight: 600; font-size: .85rem; }
.tool-note.ok { background: #e6f7f0; color: #0a7c50; border: 1px solid #bfe9d6; }
.tool-note.err { background: #fdecea; color: #a3271f; border: 1px solid #f4c3bd; }
.er-row { display: flex; gap: 8px; }
.er-row input[type=email] { flex: 1; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 8px; font: inherit; background: var(--surface); color: var(--text); }
.er-sub { display: flex; gap: 7px; align-items: center; font-size: .8rem; color: var(--muted); margin-top: 8px !important; cursor: pointer; }
.embed-code { width: 100%; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .74rem; padding: 10px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface-2); color: var(--text); resize: vertical; }
.btn.sm { padding: 7px 13px; font-size: .82rem; }

/* Scenarios */
.scenario-panel { margin: 12px 0; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.scen-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.scen-close { border: 0; background: none; font-size: 1.3rem; cursor: pointer; color: var(--muted); line-height: 1; }
.scen-grid { display: grid; gap: 12px; padding: 14px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.scen-card { border: 1px solid var(--border); border-radius: 10px; padding: 12px; background: var(--surface); display: flex; flex-direction: column; }
.scen-title { font-weight: 800; font-size: .85rem; margin-bottom: 8px; }
.scen-title span { display: block; color: var(--muted); font-weight: 400; font-size: .72rem; }
.scen-summary { flex: 1; white-space: pre-wrap; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .74rem; line-height: 1.55; background: var(--surface-2); border-radius: 8px; padding: 10px; margin: 0 0 10px; overflow: auto; max-height: 190px; color: var(--text); }
.scen-actions { display: flex; gap: 8px; }
.scen-del { color: #d6453d; }

/* Comparison pages */
.compare-heads { display: grid; gap: 14px; margin: 18px 0; }
@media (min-width: 640px) { .compare-heads { grid-template-columns: 1fr 1fr; } }
.compare-head { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; background: var(--surface); }
.compare-head h2 { margin: 0 0 6px; font-size: 1.05rem; }
.compare-head p { margin: 0; color: var(--muted); font-size: .9rem; }
.compare-table-wrap { overflow-x: auto; margin: 8px 0 4px; }
.compare-table { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 520px; }
.compare-table th, .compare-table td { padding: 11px 14px; border: 1px solid var(--border); text-align: left; vertical-align: top; }
.compare-table thead th { background: var(--surface-2); font-size: .82rem; text-transform: uppercase; letter-spacing: .03em; }
.compare-table tbody th { background: var(--surface-2); font-weight: 700; width: 24%; }
.compare-more { padding-left: 20px; }
.compare-more li { margin: 6px 0; }

/* Glossary */
.glossary { margin: 22px 0 0; }
.glossary-item { border-bottom: 1px solid var(--border); padding: 16px 0; }
.glossary-item dt { font-weight: 800; font-size: 1rem; margin-bottom: 6px; }
.glossary-item dd { margin: 0; color: var(--text); font-size: .92rem; line-height: 1.65; }
.glossary-calc { display: inline-block; margin-left: 6px; font-weight: 700; font-size: .85rem; white-space: nowrap; }

/* Roadmap */
.roadmap-list { margin-top: 20px; display: grid; gap: 10px; max-width: 720px; }
.roadmap-item { display: flex; gap: 14px; align-items: flex-start; border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; background: var(--surface); }
.roadmap-item.done { opacity: .65; }
.rm-vote-form { margin: 0; flex: 0 0 auto; }
.rm-vote { display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 48px; padding: 8px 6px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); cursor: pointer; font: inherit; color: var(--text); }
.rm-vote:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.rm-vote.voted { background: var(--primary); border-color: var(--primary); color: #fff; }
.rm-vote:disabled { cursor: default; }
.rm-arrow { font-size: .7rem; line-height: 1; }
.rm-count { font-weight: 800; font-size: .95rem; }
.rm-body { flex: 1; }
.rm-body strong { font-size: .95rem; }
.rm-body p { margin: 4px 0 0; color: var(--muted); font-size: .85rem; }
.rm-status { flex: 0 0 auto; font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; padding: 4px 10px; border-radius: 99px; background: var(--surface-2); color: var(--muted); }
.rm-status.building { background: #fff4e6; color: #b45309; }
.rm-status.done { background: #e6f7f0; color: #0a7c50; }

/* ============================================================
   STATE TAX PAGES + E-E-A-T (sources & methodology)
   ============================================================ */
.state-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); margin-top: 20px; }
.state-card { display: flex; flex-direction: column; gap: 3px; border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; background: var(--surface); text-decoration: none; color: var(--text); transition: border-color .15s, transform .15s; }
.state-card:hover { border-color: var(--primary); transform: translateY(-1px); text-decoration: none; }
.state-card strong { font-size: .92rem; }
.state-card span { font-size: .76rem; color: var(--muted); }
.state-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.state-chip { display: inline-block; padding: 6px 11px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface); font-size: .78rem; font-weight: 700; text-decoration: none; color: var(--text); }
.state-chip:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }

.sources-box { margin: 26px 0 0; border: 1px solid var(--border-strong); border-left: 4px solid var(--primary); border-radius: 10px; padding: 14px 18px; background: var(--surface-2); }
.sources-head { font-weight: 800; font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.sources-note { font-size: .82rem; color: var(--muted); margin: 0 0 8px; }
.sources-list { margin: 0; padding-left: 18px; font-size: .84rem; line-height: 1.7; }
.method-line { font-size: .8rem; color: var(--muted); margin: 0 0 8px; }

/* ==========================================================================
   BLOG 2026 — archive, tag chips, search, featured card, article furniture
   Uses the existing token set, so it inherits light/dark automatically.
   ========================================================================== */

/* ---- Cards now hold a real <img> (was a background-image span) so that
        width/height can reserve space and kill layout shift. ---- */
.blog-card-img { position: relative; height: 168px; overflow: hidden; background: var(--surface-2); }
.blog-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.blog-grid-sm { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.blog-grid-sm .blog-card-img { height: 132px; }

/* ---- Archive search ---- */
.blog-search { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 999px; padding: 6px 6px 6px 16px; margin: 0 0 18px; max-width: 560px; }
.blog-search svg { color: var(--muted); flex: none; }
.blog-search input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text); font: inherit; font-size: .95rem; padding: 8px 0; outline: none; }
.blog-search input::placeholder { color: var(--muted); }
.blog-search .btn { padding: 9px 18px; border-radius: 999px; font-size: .9rem; }
.blog-resultline { color: var(--muted); font-size: .9rem; margin: 0 0 18px; }

/* ---- Tag chips ---- */
.blog-tagbar { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 26px; }
.blog-tagchip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--muted); font-size: .85rem; font-weight: 600; }
.blog-tagchip span { font-size: .74rem; opacity: .7; font-variant-numeric: tabular-nums; }
.blog-tagchip:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.blog-tagchip.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.blog-tagchip.on span { opacity: .85; }

/* ---- Featured (newest) post ---- */
.blog-featured { display: grid; gap: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; margin: 0 0 26px; transition: box-shadow .16s ease, border-color .16s ease; }
.blog-featured:hover { box-shadow: var(--shadow-lg); border-color: var(--primary); text-decoration: none; }
@media (min-width: 780px) { .blog-featured { grid-template-columns: 1.15fr 1fr; } }
.blog-featured-img { display: block; background: var(--surface-2); }
.blog-featured-img img { width: 100%; height: 100%; min-height: 220px; object-fit: cover; display: block; }
.blog-featured-body { padding: 24px 26px 26px; display: flex; flex-direction: column; gap: 10px; justify-content: center; }
.blog-featured-body strong { font-size: clamp(1.25rem, 2.4vw, 1.6rem); line-height: 1.25; letter-spacing: -.02em; color: var(--text); }
.blog-featured-ex { color: var(--muted); font-size: .95rem; }
.blog-badge { align-self: flex-start; background: var(--accent-tint); color: var(--accent); font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; }

/* ---- Pagination ---- */
.blog-pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 34px 0 10px; flex-wrap: wrap; }
.blog-pager-num { color: var(--muted); font-size: .88rem; font-variant-numeric: tabular-nums; }

/* ---- Article page ---- */
.blog-post-wrap { padding-top: 30px; }
.blog-post-head { margin-bottom: 4px; }
.blog-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; color: var(--muted); font-size: .88rem; margin-bottom: 16px; }
.blog-meta-author { color: var(--text); font-weight: 700; }
.blog-meta > span + span { position: relative; }
.blog-meta > span + span::before { content: "·"; position: absolute; left: -9px; }
.blog-updated { color: var(--accent); font-weight: 600; }

/* Reading progress */
.blog-progress { position: sticky; top: 0; height: 3px; background: var(--border); border-radius: 999px; overflow: hidden; z-index: 20; margin: 0 0 18px; }
.blog-progress span { display: block; height: 100%; width: 0; background: var(--primary); transition: width .1s linear; }

/* Table of contents */
.blog-toc { background: var(--surface-2); border: 1px solid var(--border); border-left: 3px solid var(--primary); border-radius: 10px; padding: 18px 22px; margin: 0 0 28px; }
.blog-toc h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 10px; font-weight: 800; }
.blog-toc ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.blog-toc li { font-size: .94rem; }
.blog-toc li.lvl3 { margin-left: 14px; font-size: .88rem; list-style-type: circle; color: var(--muted); }
.blog-toc a { color: var(--text); }
.blog-toc a:hover { color: var(--primary); }

.blog-content h2 { scroll-margin-top: 24px; }
.blog-content h3 { scroll-margin-top: 24px; }
.blog-content blockquote { margin: 22px 0; padding: 4px 20px; border-left: 3px solid var(--primary); color: var(--muted); font-style: italic; }
.blog-content table { width: 100%; border-collapse: collapse; margin: 0 0 20px; font-size: .95rem; }
.blog-content th, .blog-content td { border: 1px solid var(--border); padding: 9px 12px; text-align: left; }
.blog-content th { background: var(--surface-2); font-weight: 700; }
.blog-content code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; font-family: var(--mono); font-size: .9em; }

/* Tags on the article (links now, not inert spans) */
.blog-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 28px; }
.blog-tags-label { color: var(--muted); font-size: .84rem; font-weight: 700; }
.blog-tags a { background: var(--surface); border: 1px solid var(--border-strong); border-radius: 999px; padding: 5px 13px; font-size: .82rem; color: var(--muted); }
.blog-tags a:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }

/* Share row */
.blog-share { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin: 26px 0 0; padding: 16px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.blog-share > span { color: var(--muted); font-size: .85rem; font-weight: 700; margin-right: 4px; }
.blog-share a, .blog-copy { display: inline-flex; align-items: center; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-size: .84rem; font-weight: 600; cursor: pointer; font-family: inherit; }
.blog-share a:hover, .blog-copy:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }

/* Author box */
.blog-author { display: flex; gap: 16px; align-items: flex-start; background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 20px 22px; margin: 26px 0 0; }
.blog-author-ava { flex: none; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-size: 1.3rem; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--primary), var(--accent)); }
.blog-author strong { display: block; margin-bottom: 4px; }
.blog-author p { margin: 0; color: var(--muted); font-size: .9rem; }

/* Prev / next */
.blog-neighbours { display: grid; gap: 14px; margin: 28px 0 0; }
@media (min-width: 700px) { .blog-neighbours { grid-template-columns: 1fr 1fr; } }
.blog-neighbours .bn { display: flex; flex-direction: column; gap: 5px; padding: 16px 18px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.blog-neighbours .bn:hover { border-color: var(--primary); text-decoration: none; }
.blog-neighbours .bn span { color: var(--muted); font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.blog-neighbours .bn strong { color: var(--text); font-size: .98rem; line-height: 1.35; }
.blog-neighbours .bn.next { text-align: right; align-items: flex-end; }

@media (max-width: 560px) {
  .blog-featured-body { padding: 20px; }
  .blog-search { flex-wrap: nowrap; }
  .blog-share > span { width: 100%; margin-bottom: 4px; }
}
