/* CalcHub — Premium Calculator Site */
:root {
  --bg: #f4f6fb;
  --bg-card: #ffffff;
  --text: #0f172a;
  --text-muted: #64748b;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --accent: #0ea5e9;
  --border: #e2e8f0;
  --shadow: 0 8px 30px rgba(15, 23, 42, 0.06);
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.04);
  --radius: 14px;
  --nav-h: 68px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --success: #16a34a;
  --warning: #d97706;
  --cat-finance: #059669;
  --cat-health: #e11d48;
  --cat-math: #2563eb;
  --cat-construction: #d97706;
  --cat-education: #7c3aed;
  --cat-datetime: #0891b2;
  --cat-business: #4f46e5;
  --cat-auto: #0d9488;
  --cat-gaming: #db2777;
  --cat-science: #0284c7;
  --cat-realestate: #ca8a04;
  --cat-legal: #475569;
  --cat-lifestyle: #c026d3;
  --cat-units: #65a30d;
  --cat-cooking: #ea580c;
  --cat-other: #64748b;
}

[data-theme="dark"] {
  --bg: #0b1120;
  --bg-card: #151d2e;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --border: #1e293b;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
}

img, svg { max-width: 100%; height: auto; display: block; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Reading progress */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  width: 0%;
  z-index: 1001;
  transition: width 0.1s linear;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  height: var(--nav-h);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo:hover { text-decoration: none; }

.logo-img {
  height: 40px;
  width: auto;
  display: block;
}

.footer-logo {
  display: inline-block;
  margin-bottom: 0.75rem;
}

.footer-logo img {
  height: 36px;
  width: auto;
}

.page-infographic {
  margin: 1.75rem 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg);
}

.page-infographic img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 800;
}

.nav-main {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-main a {
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.nav-main a:hover,
.nav-main a.active {
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary);
  text-decoration: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.search-toggle,
.theme-toggle,
.menu-toggle {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 40px;
  height: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  font-size: 1.1rem;
  transition: background 0.2s;
}

.search-toggle:hover,
.theme-toggle:hover,
.menu-toggle:hover {
  background: rgba(37, 99, 235, 0.08);
}

.menu-toggle { display: none; }

/* Header search — Omni / Calculator.net style */
.header-search {
  flex: 1;
  max-width: 360px;
  margin: 0 0.5rem;
}
.header-search-input {
  width: 100%;
  padding: 0.55rem 1rem 0.55rem 2.25rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.9rem;
  background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85zm-5.242 1.156a5 5 0 1 1 0-10 5 5 0 0 1 0 10z'/%3E%3C/svg%3E") no-repeat 0.75rem center;
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.header-search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.header-search-input::placeholder { color: var(--text-muted); }

@media (max-width: 900px) {
  .header-search { display: none; }
}

/* Search overlay */
.search-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1100;
  align-items: flex-start;
  justify-content: center;
  padding-top: 100px;
}

.search-overlay.active { display: flex; }

.search-box {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.5rem;
  width: 90%;
  max-width: 560px;
  box-shadow: var(--shadow);
}

.search-box input {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  background: var(--bg);
  color: var(--text);
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary);
}

.search-live {
  list-style: none;
  margin: 1rem 0 0;
  max-height: 280px;
  overflow: auto;
  padding: 0;
}
.search-live li {
  margin: 0;
  border-bottom: 1px solid var(--border);
}
.search-live li:last-child { border-bottom: none; }
.search-live a {
  display: block;
  padding: 0.65rem 0.5rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}
.search-live a:hover {
  color: var(--primary);
  background: rgba(37, 99, 235, 0.05);
  text-decoration: none;
}
.search-live small {
  display: block;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 400;
}

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.page-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 2rem;
  padding: 2rem 0 4rem;
  align-items: start;
}

@media (max-width: 900px) {
  .page-layout { grid-template-columns: 1fr; }
  .sidebar { order: -1; }
  .nav-main { display: none; }
  .menu-toggle { display: flex; }
  .nav-main.mobile-open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 1rem;
    box-shadow: var(--shadow);
  }
}

/* Breadcrumb */
.breadcrumb {
  padding: 1rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span { margin: 0 0.35rem; }

/* Hero */
.hero {
  background: linear-gradient(145deg, #1e3a8a 0%, var(--primary) 45%, #0ea5e9 100%);
  color: #fff;
  padding: 3rem 0;
  margin-bottom: 0;
}

.hero-modern {
  padding: 3.5rem 0 3rem;
  text-align: center;
}
.hero-modern-inner { max-width: 720px; }
.hero-eyebrow {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.85;
  margin-bottom: 0.75rem;
}
.hero-modern h1 {
  font-size: clamp(1.85rem, 5vw, 2.75rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 0.65rem;
  letter-spacing: -0.02em;
}
.hero-lead {
  font-size: 1.05rem;
  opacity: 0.9;
  margin: 0 auto 1.75rem;
  max-width: 520px;
}
.hero-search-form {
  display: flex;
  align-items: stretch;
  max-width: 560px;
  margin: 0 auto 1rem;
  background: #fff;
  border-radius: 999px;
  padding: 0.35rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
  position: relative;
}
.hero-search-icon {
  position: absolute;
  left: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  opacity: 0.5;
  pointer-events: none;
}
.hero-search-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0.85rem 1rem 0.85rem 2.5rem;
  font-size: 1rem;
  color: var(--text);
  border-radius: 999px;
}
.hero-search-input:focus { outline: none; }
.hero-search-btn {
  border: none;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.95rem;
  white-space: nowrap;
  transition: background 0.2s;
}
.hero-search-btn:hover { background: var(--primary-dark); }
.hero-quick {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.35rem 0.65rem;
  font-size: 0.88rem;
  margin-bottom: 2rem;
  opacity: 0.92;
}
.hero-quick span { opacity: 0.8; }
.hero-quick a {
  color: #fff;
  text-decoration: none;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.15);
  font-weight: 500;
  transition: background 0.15s;
}
.hero-quick a:hover {
  background: rgba(255,255,255,0.28);
  text-decoration: none;
}
.hero-modern .hero-stats {
  margin-top: 0;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

.hero p {
  font-size: 1.1rem;
  opacity: 0.92;
  max-width: 640px;
}

.hero-compact {
  padding: 2rem 0;
}

/* Omni-style category heroes */
.hero-calc, .hero-cat {
  color: #fff;
  padding: 2.25rem 0 2rem;
  text-align: left;
}
.hero-calc-inner, .hero-cat-inner {
  position: relative;
  max-width: 720px;
}
.hero-cat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  font-size: 1.5rem;
  background: rgba(255,255,255,0.18);
  border-radius: 12px;
  margin-bottom: 0.85rem;
}
.hero-cat-label {
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
  opacity: 0.9;
}
.hero-cat-label a {
  color: #fff;
  text-decoration: none;
}
.hero-cat-label a:hover { text-decoration: underline; }
.hero-calc h1, .hero-cat h1 {
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}
.hero-calc p, .hero-cat p {
  font-size: 1rem;
  opacity: 0.92;
  max-width: 560px;
  margin: 0;
}
.hero-cat-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
}
.hero-cat-badges span {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.16);
}

.hero-cat.cat-finance, .hero-calc.cat-finance { background: linear-gradient(135deg, #065f46, #059669, #34d399); }
.hero-cat.cat-health, .hero-calc.cat-health { background: linear-gradient(135deg, #9f1239, #e11d48, #fb7185); }
.hero-cat.cat-math, .hero-calc.cat-math { background: linear-gradient(135deg, #1e3a8a, #2563eb, #60a5fa); }
.hero-cat.cat-construction, .hero-calc.cat-construction { background: linear-gradient(135deg, #92400e, #d97706, #fbbf24); }
.hero-cat.cat-education, .hero-calc.cat-education { background: linear-gradient(135deg, #5b21b6, #7c3aed, #a78bfa); }
.hero-cat.cat-datetime, .hero-calc.cat-datetime { background: linear-gradient(135deg, #155e75, #0891b2, #22d3ee); }
.hero-cat.cat-business, .hero-calc.cat-business { background: linear-gradient(135deg, #3730a3, #4f46e5, #818cf8); }
.hero-cat.cat-auto, .hero-calc.cat-auto { background: linear-gradient(135deg, #115e59, #0d9488, #2dd4bf); }
.hero-cat.cat-gaming, .hero-calc.cat-gaming { background: linear-gradient(135deg, #9d174d, #db2777, #f472b6); }
.hero-cat.cat-science, .hero-calc.cat-science { background: linear-gradient(135deg, #075985, #0284c7, #38bdf8); }
.hero-cat.cat-realestate, .hero-calc.cat-realestate { background: linear-gradient(135deg, #854d0e, #ca8a04, #facc15); }
.hero-cat.cat-legal, .hero-calc.cat-legal { background: linear-gradient(135deg, #334155, #475569, #94a3b8); }
.hero-cat.cat-lifestyle, .hero-calc.cat-lifestyle { background: linear-gradient(135deg, #86198f, #c026d3, #e879f9); }
.hero-cat.cat-units, .hero-calc.cat-units { background: linear-gradient(135deg, #3f6212, #65a30d, #a3e635); }
.hero-cat.cat-cooking, .hero-calc.cat-cooking { background: linear-gradient(135deg, #9a3412, #ea580c, #fb923c); }
.hero-cat.cat-other, .hero-calc.cat-other { background: linear-gradient(135deg, #1e3a8a, #2563eb, #0ea5e9); }

/* Calc tiles — category hub + related */
.calc-tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
  margin: 0.75rem 0 1.5rem;
}
.calc-tile {
  display: flex;
  align-items: center;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  border-left: 4px solid var(--cat-other);
  background: var(--bg-card);
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s, box-shadow 0.15s;
}
.calc-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  text-decoration: none;
}
.calc-tile-title {
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.35;
}
.calc-tile-sm { padding: 0.65rem 0.85rem; }
.calc-tile-sm .calc-tile-title { font-size: 0.86rem; font-weight: 500; }
.calc-tile.cat-finance { border-left-color: var(--cat-finance); }
.calc-tile.cat-health { border-left-color: var(--cat-health); }
.calc-tile.cat-math { border-left-color: var(--cat-math); }
.calc-tile.cat-construction { border-left-color: var(--cat-construction); }
.calc-tile.cat-education { border-left-color: var(--cat-education); }
.calc-tile.cat-datetime { border-left-color: var(--cat-datetime); }
.calc-tile.cat-business { border-left-color: var(--cat-business); }
.calc-tile.cat-auto { border-left-color: var(--cat-auto); }
.calc-tile.cat-gaming { border-left-color: var(--cat-gaming); }
.calc-tile.cat-science { border-left-color: var(--cat-science); }
.calc-tile.cat-realestate { border-left-color: var(--cat-realestate); }
.calc-tile.cat-legal { border-left-color: var(--cat-legal); }
.calc-tile.cat-lifestyle { border-left-color: var(--cat-lifestyle); }
.calc-tile.cat-units { border-left-color: var(--cat-units); }
.calc-tile.cat-cooking { border-left-color: var(--cat-cooking); }
.calc-tile.cat-other { border-left-color: var(--cat-other); }
.calc-tile-badge {
  display: inline-block; margin-top: 0.35rem; font-size: 0.65rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em; color: #15803d; background: #dcfce7;
  padding: 0.15rem 0.4rem; border-radius: 4px;
}
.home-more-link { margin-top: 1rem; text-align: center; }
.home-more-link a { font-weight: 600; color: var(--primary); }

/* Category-accent calculator widget */
.calc-widget.cat-accent.cat-finance { border-top-color: var(--cat-finance); }
.calc-widget.cat-accent.cat-finance h2 { color: var(--cat-finance); }
.calc-widget.cat-accent.cat-health { border-top-color: var(--cat-health); }
.calc-widget.cat-accent.cat-health h2 { color: var(--cat-health); }
.calc-widget.cat-accent.cat-math { border-top-color: var(--cat-math); }
.calc-widget.cat-accent.cat-math h2 { color: var(--cat-math); }
.calc-widget.cat-accent.cat-construction { border-top-color: var(--cat-construction); }
.calc-widget.cat-accent.cat-construction h2 { color: var(--cat-construction); }
.calc-widget.cat-accent.cat-education { border-top-color: var(--cat-education); }
.calc-widget.cat-accent.cat-education h2 { color: var(--cat-education); }
.calc-widget.cat-accent.cat-datetime { border-top-color: var(--cat-datetime); }
.calc-widget.cat-accent.cat-datetime h2 { color: var(--cat-datetime); }
.calc-widget.cat-accent.cat-business { border-top-color: var(--cat-business); }
.calc-widget.cat-accent.cat-business h2 { color: var(--cat-business); }
.calc-widget.cat-accent.cat-auto { border-top-color: var(--cat-auto); }
.calc-widget.cat-accent.cat-auto h2 { color: var(--cat-auto); }
.calc-widget.cat-accent.cat-gaming { border-top-color: var(--cat-gaming); }
.calc-widget.cat-accent.cat-gaming h2 { color: var(--cat-gaming); }
.calc-widget.cat-accent.cat-science { border-top-color: var(--cat-science); }
.calc-widget.cat-accent.cat-science h2 { color: var(--cat-science); }
.calc-widget.cat-accent.cat-realestate { border-top-color: var(--cat-realestate); }
.calc-widget.cat-accent.cat-realestate h2 { color: var(--cat-realestate); }
.calc-widget.cat-accent.cat-legal { border-top-color: var(--cat-legal); }
.calc-widget.cat-accent.cat-legal h2 { color: var(--cat-legal); }
.calc-widget.cat-accent.cat-lifestyle { border-top-color: var(--cat-lifestyle); }
.calc-widget.cat-accent.cat-lifestyle h2 { color: var(--cat-lifestyle); }
.calc-widget.cat-accent.cat-units { border-top-color: var(--cat-units); }
.calc-widget.cat-accent.cat-units h2 { color: var(--cat-units); }
.calc-widget.cat-accent.cat-cooking { border-top-color: var(--cat-cooking); }
.calc-widget.cat-accent.cat-cooking h2 { color: var(--cat-cooking); }
.calc-widget.cat-accent.cat-other { border-top-color: var(--cat-other); }
.calc-widget.cat-accent.cat-other h2 { color: var(--cat-other); }
.calc-widget.cat-accent .btn-calc { background: var(--primary); }
.calc-widget.cat-accent.cat-finance .btn-calc { background: var(--cat-finance); }
.calc-widget.cat-accent.cat-health .btn-calc { background: var(--cat-health); }
.calc-widget.cat-accent.cat-math .btn-calc { background: var(--cat-math); }
.calc-widget.cat-accent.cat-construction .btn-calc { background: var(--cat-construction); }
.calc-widget.cat-accent.cat-education .btn-calc { background: var(--cat-education); }
.calc-widget.cat-accent.cat-datetime .btn-calc { background: var(--cat-datetime); }

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}

.card h2 {
  font-size: 1.35rem;
  margin-bottom: 1rem;
  color: var(--text);
  line-height: 1.3;
}

.card h3 {
  font-size: 1.1rem;
  margin: 1.25rem 0 0.5rem;
  color: var(--text);
}

.card p {
  margin-bottom: 0.85rem;
  color: var(--text);
  font-size: 1rem;
}

/* Calculator widget */
.calc-widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: 3px solid var(--primary);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 1.5rem 0;
  box-shadow: var(--shadow);
}

.calc-widget h2 {
  font-size: 1.2rem;
  margin-bottom: 1.25rem;
  color: var(--primary);
}

.calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.basic-calc-ui { max-width: 320px; margin: 0 auto 1rem; }
.calc-display-wrap { margin-bottom: 0.75rem; }
.calc-display-wrap .sc-display {
  width: 100%;
  font-size: 1.75rem;
  font-weight: 600;
  text-align: right;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
}
.calc-keypad {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}
.calc-key {
  padding: 0.85rem 0.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s;
}
.calc-key:hover { background: rgba(37, 99, 235, 0.1); }
.calc-key[data-action="eq"] {
  grid-row: span 2;
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.calc-key[data-key="0"] { grid-column: span 2; }

.calc-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--text-muted);
}

.calc-field input,
.calc-field select {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  background: var(--bg);
  color: var(--text);
}

.calc-field input:focus,
.calc-field select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.calc-field .unit-row {
  display: flex;
  gap: 0.5rem;
}

.calc-field .unit-row input { flex: 1; }
.calc-field .unit-row select { width: 110px; }

.btn-calc {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 0.85rem 1.75rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  width: 100%;
  margin-top: 0.5rem;
}

.btn-calc:hover { background: var(--primary-dark); }
.btn-calc:active { transform: scale(0.98); }

.calc-results {
  margin-top: 1.25rem;
  padding: 1.25rem;
  background: rgba(37, 99, 235, 0.06);
  border-radius: 8px;
  border-left: 4px solid var(--primary);
  display: none;
}

.calc-results.visible { display: block; }

.calc-results h3 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
  color: var(--primary);
}

.result-row {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}

.result-row:last-child { border-bottom: none; }
.result-row strong { color: var(--text); }

/* Pro calculator UI */
.calc-pro-widget { position: relative; border: 1px solid var(--border); box-shadow: var(--shadow); }
.calc-pro-toolbar {
  display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center;
  margin-top: 1rem; padding-top: 0.75rem; border-top: 1px solid var(--border);
}
.calc-pro-badge {
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  color: #fff; font-size: 0.7rem; font-weight: 700;
  padding: 0.2rem 0.5rem; border-radius: 4px; letter-spacing: 0.05em;
  margin-right: auto;
}
.btn-pro-copy, .btn-pro-print, .btn-pro-save, .btn-pro-reset,
.btn-pro-export-txt, .btn-pro-export-csv, .btn-pro-export-json,
.btn-pro-share, .btn-pro-history, .btn-pro-fav,
.btn-pro-compare, .btn-pro-embed, .btn-pro-steps {
  padding: 0.35rem 0.7rem; border-radius: 6px; border: 1px solid var(--border);
  background: var(--bg); font-size: 0.8rem; font-weight: 600; cursor: pointer;
}
.btn-pro-copy:hover, .btn-pro-print:hover, .btn-pro-save:hover, .btn-pro-reset:hover,
.btn-pro-export-txt:hover, .btn-pro-export-csv:hover, .btn-pro-export-json:hover,
.btn-pro-share:hover, .btn-pro-history:hover, .btn-pro-fav:hover,
.btn-pro-compare:hover, .btn-pro-embed:hover, .btn-pro-steps:hover {
  border-color: var(--primary); color: var(--primary);
}
.btn-pro-fav.active { background: #fef3c7; border-color: #f59e0b; color: #b45309; }
.calc-pro-history-panel {
  margin-top: 0.75rem; padding: 0.75rem; border: 1px solid var(--border);
  border-radius: 8px; background: var(--bg); font-size: 0.85rem;
}
.calc-pro-history-panel h4 { margin: 0 0 0.5rem; font-size: 0.9rem; color: var(--primary); }
.calc-history-item { padding: 0.5rem 0; border-bottom: 1px solid var(--border); }
.calc-history-item:last-child { border-bottom: none; }
.calc-history-item time { color: var(--text-muted); font-size: 0.75rem; }
.calc-history-item p { margin: 0.25rem 0 0; line-height: 1.4; }
.calc-history-empty { color: var(--text-muted); margin: 0; }

.calc-pro-compare-panel, .calc-pro-steps-panel, .calc-pro-embed-panel {
  margin-top: 0.75rem; padding: 0.75rem; border: 1px solid var(--border);
  border-radius: 8px; background: var(--bg); font-size: 0.85rem;
}
.calc-pro-compare-panel h4, .calc-pro-steps-panel h4, .calc-pro-embed-panel h4 {
  margin: 0 0 0.5rem; font-size: 0.9rem; color: var(--primary);
}
.calc-compare-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.calc-compare-table th, .calc-compare-table td { padding: 0.35rem 0.5rem; border-bottom: 1px solid var(--border); text-align: left; }
.calc-compare-table tr.cmp-changed td { background: #fef9c3; }
.calc-compare-meta { color: var(--text-muted); font-size: 0.75rem; margin: 0 0 0.5rem; }
.calc-steps-list { margin: 0; padding-left: 1.25rem; line-height: 1.6; }
.calc-steps-list li { margin-bottom: 0.35rem; }
.calc-embed-code {
  width: 100%; font-family: ui-monospace, monospace; font-size: 0.75rem;
  padding: 0.5rem; border: 1px solid var(--border); border-radius: 6px; resize: vertical;
}
.calc-embed-note { color: var(--text-muted); font-size: 0.8rem; margin: 0 0 0.5rem; }
.calc-embed-actions { display: flex; gap: 0.5rem; margin-top: 0.5rem; }
.btn-pro-copy-embed, .btn-pro-preview-embed {
  padding: 0.35rem 0.75rem; border-radius: 6px; border: 1px solid var(--border);
  background: var(--bg); font-size: 0.8rem; font-weight: 600; cursor: pointer; text-decoration: none; color: inherit;
}
.btn-pro-copy-embed:hover, .btn-pro-preview-embed:hover { border-color: var(--primary); color: var(--primary); }
.calc-chart-wrap { margin-top: 1rem; }
.calc-chart-wrap h4 { font-size: 0.9rem; color: var(--primary); margin: 0 0 0.5rem; }
.calc-chart-wrap canvas { width: 100%; max-width: 100%; display: block; }
.calc-error-msg {
  margin: 0.75rem 0; padding: 0.6rem 0.85rem; border-radius: 8px;
  background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; font-size: 0.85rem;
}
.calc-input-error { border-color: #ef4444 !important; box-shadow: 0 0 0 2px rgba(239,68,68,0.15); }
.calc-toast {
  position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%) translateY(120%);
  background: #1e293b; color: #fff; padding: 0.65rem 1.2rem; border-radius: 999px;
  font-size: 0.85rem; font-weight: 600; z-index: 9999; opacity: 0;
  transition: transform 0.25s, opacity 0.25s; pointer-events: none; max-width: 90vw; text-align: center;
}
.calc-toast.visible { transform: translateX(-50%) translateY(0); opacity: 1; }
.calc-toast-warn { background: #b45309; }
.calc-toast-info { background: #2563eb; }
@media (max-width: 640px) {
  .calc-pro-toolbar { gap: 0.3rem; }
  .calc-pro-toolbar button { font-size: 0.72rem; padding: 0.3rem 0.5rem; }
  .calc-pro-badge { font-size: 0.65rem; }
}
.calc-mode-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}
.calc-mode-tab {
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.calc-mode-tab.active, .calc-mode-tab:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.calc-pro-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}
.btn-pro-copy, .btn-pro-reset {
  padding: 0.5rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.btn-pro-copy:hover, .btn-pro-reset:hover { border-color: var(--primary); color: var(--primary); }
.calc-breakdown, .calc-amort {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin-top: 0.5rem;
}
.calc-breakdown th, .calc-amort th,
.calc-breakdown td, .calc-amort td {
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.calc-breakdown th, .calc-amort th { color: var(--text-muted); font-weight: 600; }
.calc-breakdown-wrap h4, .calc-amort-wrap h4, .calc-chart-wrap h4 {
  font-size: 0.9rem;
  margin: 1rem 0 0.5rem;
  color: var(--primary);
}
.calc-subhead { font-size: 0.95rem; margin: 0.75rem 0 0.25rem; color: var(--text-muted); }
.calc-chart-wrap { margin-top: 1rem; }
.calc-chart-wrap canvas {
  width: 100%;
  max-width: 100%;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
}
.calc-presets { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.75rem; align-items: center; }
.calc-preset-label { font-size: 0.8rem; color: var(--text-muted); margin-right: 0.25rem; }
.tire-preset, .calc-preset {
  padding: 0.25rem 0.55rem; border-radius: 999px; border: 1px solid var(--border);
  background: var(--bg-card); font-size: 0.75rem; cursor: pointer;
}
.tire-preset:hover { border-color: var(--primary); color: var(--primary); }
.calc-sci-advanced { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-bottom: 0.5rem; }
.scientific-calc-ui .calc-keypad { grid-template-columns: repeat(4, 1fr); }
.sc-mem-indicator { font-size: 0.75rem; color: var(--text-muted); margin-left: 0.5rem; }
.calc-scenario-note { font-size: 0.8rem; color: var(--success); margin-top: 0.5rem; }
/* Homepage — simple layout */
.hero-home { padding: 3rem 0 2.5rem; }
.hero-home h1 { font-size: clamp(1.75rem, 4vw, 2.25rem); margin-bottom: 0.5rem; }
.hero-home p { font-size: 1.05rem; opacity: 0.92; max-width: 32rem; margin: 0 auto 1.5rem; }
.hero-search {
  display: flex; max-width: 28rem; margin: 0 auto; gap: 0.5rem;
}
.hero-search input {
  flex: 1; padding: 0.75rem 1rem; border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.3); background: rgba(255,255,255,0.95);
  font-size: 1rem; color: var(--text);
}
.hero-search button {
  padding: 0.75rem 1.25rem; border-radius: var(--radius);
  border: none; background: #fff; color: var(--primary);
  font-weight: 600; cursor: pointer;
}
.hero-search button:hover { background: #f0f4ff; }
.home-simple { padding: 2rem 0 3rem; }
.home-block { margin-bottom: 2.5rem; }
.home-block h2 {
  font-size: 1.1rem; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.04em;
  margin-bottom: 1rem;
}
.category-pills {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
}
.category-pills a {
  padding: 0.5rem 1rem; border-radius: 999px;
  border: 1px solid var(--border); background: var(--bg-card);
  color: var(--text); text-decoration: none; font-size: 0.95rem;
  transition: border-color 0.15s, color 0.15s;
}
.category-pills a:hover {
  border-color: var(--primary); color: var(--primary); text-decoration: none;
}
.home-links {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.35rem 1.5rem;
}
.home-links a {
  color: var(--primary); text-decoration: none; font-size: 1rem; padding: 0.35rem 0;
  display: block;
}
.home-links a:hover { text-decoration: underline; }

/* Homepage UX */
.home-page { padding-bottom: 3rem; }
.home-section { margin-bottom: 2.5rem; }
.section-head { margin-bottom: 1.5rem; }
.section-head h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.35rem;
  color: var(--text);
}
.section-head p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 0;
}
.trust-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem 1.75rem;
  padding: 1.25rem 0 2rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}
.trust-strip span { white-space: nowrap; }
.card-flat {
  border: none;
  box-shadow: none;
  background: transparent;
  padding: 0;
}
.card-flat .section-head { padding-top: 0.5rem; }

.hero-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem; margin-top: 2rem;
}
.hero-stat {
  background: rgba(255,255,255,0.12); border-radius: var(--radius);
  padding: 1rem; text-align: center; backdrop-filter: blur(4px);
}
.hero-stat strong { display: block; font-size: 1.5rem; }
.hero-stat span { font-size: 0.85rem; opacity: 0.9; }
.trust-badges { display: flex; flex-wrap: wrap; gap: 1rem; margin: 1.5rem 0; }
.trust-badge {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 0.75rem; border-radius: 8px;
  background: var(--bg-card); border: 1px solid var(--border); font-size: 0.85rem;
}
.featured-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.featured-card {
  display: flex;
  flex-direction: column;
  padding: 1.15rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
}
.featured-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: rgba(37, 99, 235, 0.35);
  text-decoration: none;
}
.featured-card h4 { margin: 0 0 0.35rem; color: var(--text); font-size: 1rem; font-weight: 600; }
.featured-card span:not(.tag) { font-size: 0.82rem; color: var(--text-muted); line-height: 1.4; }
.featured-card .tag {
  display: inline-block;
  margin-top: auto;
  padding-top: 0.65rem;
  font-size: 0.68rem;
  background: rgba(37,99,235,0.08);
  color: var(--primary);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-weight: 700;
  width: fit-content;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.calc-tip-presets { display: flex; gap: 0.4rem; margin-bottom: 0.75rem; flex-wrap: wrap; }
.tip-preset {
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
}
.tip-preset:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.bmi-badge {
  margin-top: 0.75rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-weight: 700;
  text-align: center;
  font-size: 0.9rem;
}
.bmi-badge.cat-under { background: #dbeafe; color: #1d4ed8; }
.bmi-badge.cat-normal { background: #dcfce7; color: #15803d; }
.bmi-badge.cat-over { background: #fef3c7; color: #b45309; }
.bmi-badge.cat-obese { background: #fee2e2; color: #b91c1c; }
.calc-sci-keys { display: flex; gap: 0.4rem; margin-bottom: 0.5rem; }
.calc-sci-keys .calc-key { flex: 1; }

/* TOC sidebar */
.toc {
  position: sticky;
  top: calc(var(--nav-h) + 1rem);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.toc h3 {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.toc ul { list-style: none; }
.toc li { margin-bottom: 0.35rem; }

.toc a {
  font-size: 0.88rem;
  color: var(--text-muted);
  display: block;
  padding: 0.3rem 0;
  border-left: 2px solid transparent;
  padding-left: 0.75rem;
  text-decoration: none;
  transition: color 0.2s, border-color 0.2s;
}

.toc a:hover,
.toc a.active {
  color: var(--primary);
  border-left-color: var(--primary);
}

/* Lists & tables */
ul.content-list, ol.content-list {
  margin: 0.75rem 0 1rem 1.25rem;
}

ul.content-list li, ol.content-list li {
  margin-bottom: 0.4rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.9rem;
  overflow-x: auto;
  display: block;
}

.data-table th,
.data-table td {
  border: 1px solid var(--border);
  padding: 0.65rem 0.85rem;
  text-align: left;
}

.data-table th {
  background: rgba(37, 99, 235, 0.08);
  font-weight: 600;
}

.tip-box, .warning-box, .note-box {
  padding: 1rem 1.15rem;
  border-radius: 8px;
  margin: 1rem 0;
  font-size: 0.95rem;
}

.tip-box {
  background: rgba(22, 163, 74, 0.1);
  border-left: 4px solid var(--success);
}

.warning-box {
  background: rgba(217, 119, 6, 0.1);
  border-left: 4px solid var(--warning);
}

.note-box {
  background: rgba(37, 99, 235, 0.08);
  border-left: 4px solid var(--primary);
}

/* FAQ accordion */
.faq-list { margin-top: 0.5rem; }

.faq-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 0.65rem;
  overflow: hidden;
}

.faq-question {
  width: 100%;
  background: var(--bg-card);
  border: none;
  padding: 1rem 1.15rem;
  text-align: left;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.faq-question:hover { background: rgba(37, 99, 235, 0.05); }

.faq-question::after {
  content: "+";
  font-size: 1.25rem;
  color: var(--primary);
  flex-shrink: 0;
}

.faq-item.open .faq-question::after { content: "−"; }

.faq-answer {
  display: none;
  padding: 0 1.15rem 1rem;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.6;
}

.faq-item.open .faq-answer { display: block; }

/* Related */
.related-section {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.related-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  transition: border-color 0.2s, transform 0.2s;
}

.related-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  text-decoration: none;
}

.related-card h4 {
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.related-card span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Author & meta */
.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.author-note {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.disclaimer {
  font-size: 0.82rem;
  color: var(--text-muted);
  background: var(--bg);
  padding: 1rem;
  border-radius: 8px;
  margin-top: 1.5rem;
}

/* Category grid homepage — Omni-style colored tiles */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  padding: 0;
}

.category-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.25rem 1.25rem 1.1rem;
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--cat-other);
  position: relative;
  overflow: hidden;
}

.category-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  opacity: 0.06;
  background: currentColor;
  transform: translate(30%, -30%);
}

.category-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  text-decoration: none;
}

.cat-icon {
  font-size: 1.5rem;
  line-height: 1;
  margin-bottom: 0.35rem;
}

.category-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.15rem;
  color: var(--text);
}

.category-card p {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
  line-height: 1.45;
}

.category-card .count {
  font-size: 0.78rem;
  font-weight: 600;
  margin-top: auto;
}

/* Category accent — cards only (not heroes) */
.category-card.cat-finance { border-left-color: var(--cat-finance); color: var(--cat-finance); }
.category-card.cat-finance .count { color: var(--cat-finance); }
.category-card.cat-health { border-left-color: var(--cat-health); color: var(--cat-health); }
.category-card.cat-health .count { color: var(--cat-health); }
.category-card.cat-math { border-left-color: var(--cat-math); color: var(--cat-math); }
.category-card.cat-math .count { color: var(--cat-math); }
.category-card.cat-construction { border-left-color: var(--cat-construction); color: var(--cat-construction); }
.category-card.cat-construction .count { color: var(--cat-construction); }
.category-card.cat-education { border-left-color: var(--cat-education); color: var(--cat-education); }
.category-card.cat-education .count { color: var(--cat-education); }
.category-card.cat-datetime { border-left-color: var(--cat-datetime); color: var(--cat-datetime); }
.category-card.cat-datetime .count { color: var(--cat-datetime); }
.category-card.cat-business { border-left-color: var(--cat-business); color: var(--cat-business); }
.category-card.cat-business .count { color: var(--cat-business); }
.category-card.cat-auto { border-left-color: var(--cat-auto); color: var(--cat-auto); }
.category-card.cat-auto .count { color: var(--cat-auto); }
.category-card.cat-gaming { border-left-color: var(--cat-gaming); color: var(--cat-gaming); }
.category-card.cat-gaming .count { color: var(--cat-gaming); }
.category-card.cat-science { border-left-color: var(--cat-science); color: var(--cat-science); }
.category-card.cat-science .count { color: var(--cat-science); }
.category-card.cat-realestate { border-left-color: var(--cat-realestate); color: var(--cat-realestate); }
.category-card.cat-realestate .count { color: var(--cat-realestate); }
.category-card.cat-legal { border-left-color: var(--cat-legal); color: var(--cat-legal); }
.category-card.cat-legal .count { color: var(--cat-legal); }
.category-card.cat-lifestyle { border-left-color: var(--cat-lifestyle); color: var(--cat-lifestyle); }
.category-card.cat-lifestyle .count { color: var(--cat-lifestyle); }
.category-card.cat-units { border-left-color: var(--cat-units); color: var(--cat-units); }
.category-card.cat-units .count { color: var(--cat-units); }
.category-card.cat-cooking { border-left-color: var(--cat-cooking); color: var(--cat-cooking); }
.category-card.cat-cooking .count { color: var(--cat-cooking); }
.category-card.cat-other { border-left-color: var(--cat-other); color: var(--cat-other); }
.category-card.cat-other .count { color: var(--cat-other); }

/* Hero text always white — fix contrast on colored gradients */
.hero-cat, .hero-calc,
.hero-cat h1, .hero-calc h1,
.hero-cat p, .hero-calc p,
.hero-cat .hero-cat-label,
.hero-cat .hero-cat-label a,
.hero-calc .hero-cat-label a {
  color: #fff;
}
.hero-cat-badges span {
  color: #fff;
  background: rgba(0, 0, 0, 0.22);
}

@media (max-width: 640px) {
  .hero-search-form { flex-direction: column; border-radius: var(--radius); padding: 0.5rem; }
  .hero-search-btn { width: 100%; border-radius: 8px; }
  .hero-search-icon { top: 1.1rem; transform: none; }
  .hero-search-input { padding-left: 2.25rem; }
  .btn-calc {
    position: sticky;
    bottom: 0.75rem;
    z-index: 10;
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.35);
  }
}

/* Footer */
.site-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 2.5rem 0 1.5rem;
  margin-top: 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-grid h4 {
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.footer-grid ul { list-style: none; }
.footer-grid li { margin-bottom: 0.4rem; }
.footer-grid a {
  font-size: 0.88rem;
  color: var(--text-muted);
  text-decoration: none;
}
.footer-grid a:hover { color: var(--primary); }

.footer-bottom {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

/* Back to top */
.back-to-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 44px;
  height: 44px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  z-index: 999;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover { background: var(--primary-dark); }

/* Ad placeholder */
.ad-placeholder {
  background: var(--bg);
  border: 2px dashed var(--border);
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 1.5rem 0;
}

/* 404 */
.error-page {
  text-align: center;
  padding: 4rem 1rem;
}

.error-page h1 { font-size: 4rem; color: var(--primary); }
.error-page p { color: var(--text-muted); margin: 1rem 0 2rem; }

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.card, .calc-widget { animation: fadeIn 0.4s ease; }

/* Accessibility */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}
