/* ============================================================
   CalcuSwift — Main Stylesheet
   Color Palette:
     Primary Blue:   #1e40af
     Teal Accent:    #0891b2
     Amber Highlight:#f59e0b
     Light BG:       #f0f7ff
     Card BG:        #ffffff
     Dark Text:      #1e293b
     Muted Text:     #64748b
   ============================================================ */

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

:root {
  --primary:    #1e40af;
  --primary-dk: #1e3a8a;
  --teal:       #0891b2;
  --teal-lt:    #e0f2fe;
  --amber:      #f59e0b;
  --amber-lt:   #fef3c7;
  --bg:         #f0f7ff;
  --card:       #ffffff;
  --text:       #1e293b;
  --muted:      #64748b;
  --border:     #cbd5e1;
  --success:    #16a34a;
  --radius:     10px;
  --shadow:     0 2px 12px rgba(30,64,175,0.10);
  --shadow-lg:  0 6px 32px rgba(30,64,175,0.16);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
}

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

/* ── HEADER ─────────────────────────────────────────────── */
header {
  background: linear-gradient(135deg, var(--primary-dk) 0%, var(--primary) 60%, var(--teal) 100%);
  color: #fff;
  padding: 0;
  box-shadow: 0 3px 16px rgba(30,64,175,0.25);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  max-width: 1400px;
  margin: 0 auto;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
}

.logo-icon {
  width: 42px;
  height: 42px;
  background: var(--amber);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 900;
  color: var(--primary-dk);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.logo-text {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.logo-text span { color: var(--amber); }

.header-tagline {
  font-size: 0.8rem;
  opacity: 0.8;
  margin-top: -2px;
}

.header-search {
  display: flex;
  gap: 8px;
  align-items: center;
}

.header-search input {
  padding: 8px 16px;
  border-radius: 24px;
  border: none;
  width: 260px;
  font-size: 0.9rem;
  background: rgba(255,255,255,0.15);
  color: #fff;
  outline: none;
  transition: background 0.2s;
}

.header-search input::placeholder { color: rgba(255,255,255,0.6); }
.header-search input:focus { background: rgba(255,255,255,0.25); }

.header-search button {
  padding: 8px 18px;
  background: var(--amber);
  color: var(--primary-dk);
  border: none;
  border-radius: 24px;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.2s, transform 0.1s;
}

.header-search button:hover { background: #fbbf24; transform: scale(1.04); }

/* ── ADSENSE HEADER SLOT ─────────────────────────────────── */
.adsense-header {
  background: rgba(255,255,255,0.08);
  border-top: 1px solid rgba(255,255,255,0.1);
  text-align: center;
  padding: 6px 0;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.05em;
}

/* ── NAV ─────────────────────────────────────────────────── */
nav {
  background: var(--primary-dk);
  border-top: 1px solid rgba(255,255,255,0.1);
}

.nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-inner::-webkit-scrollbar { display: none; }

.nav-inner a {
  color: rgba(255,255,255,0.85);
  padding: 11px 18px;
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  display: block;
  border-bottom: 3px solid transparent;
  transition: color 0.2s, border-color 0.2s;
  text-decoration: none;
}

.nav-inner a:hover,
.nav-inner a.active {
  color: var(--amber);
  border-bottom-color: var(--amber);
  text-decoration: none;
}

/* ── PAGE WRAPPER (3-column: left ad | content | right ad) ── */
.page-wrapper {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 160px 1fr 160px;
  gap: 20px;
  padding: 24px 16px;
  align-items: start;
}

/* ── AD COLUMNS ──────────────────────────────────────────── */
.ad-col {
  position: sticky;
  top: 120px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ad-slot {
  background: #fff;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px 8px;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  min-height: 250px;
}

.ad-slot.leaderboard { min-height: 90px; min-width: 728px; }
.ad-slot.skyscraper  { min-height: 600px; }
.ad-slot.rectangle  { min-height: 250px; }

/* ── MAIN CONTENT ────────────────────────────────────────── */
.main-content { min-width: 0; }

/* ── HERO ────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--teal) 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 36px 32px;
  margin-bottom: 28px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.hero h1 {
  font-size: 2rem;
  font-weight: 900;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.hero p {
  font-size: 1.05rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto 20px;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.hero-stat {
  text-align: center;
}

.hero-stat strong {
  display: block;
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--amber);
}

.hero-stat span {
  font-size: 0.8rem;
  opacity: 0.8;
}

/* ── QUICK SEARCH ────────────────────────────────────────── */
.quick-search {
  display: flex;
  gap: 10px;
  max-width: 480px;
  margin: 0 auto;
}

.quick-search input {
  flex: 1;
  padding: 12px 18px;
  border-radius: 28px;
  border: none;
  font-size: 1rem;
  background: rgba(255,255,255,0.2);
  color: #fff;
  outline: none;
}

.quick-search input::placeholder { color: rgba(255,255,255,0.65); }
.quick-search input:focus { background: rgba(255,255,255,0.3); }

.quick-search button {
  padding: 12px 24px;
  background: var(--amber);
  color: var(--primary-dk);
  border: none;
  border-radius: 28px;
  font-weight: 800;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.2s;
}

.quick-search button:hover { background: #fbbf24; }

/* ── SECTION HEADERS ─────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 3px solid var(--primary);
}

.section-header h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary);
}

.section-icon {
  width: 36px;
  height: 36px;
  background: var(--primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.section-desc {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 16px;
  margin-top: -8px;
}

/* ── CATEGORY SECTION ────────────────────────────────────── */
.category-section {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

/* ── FEATURED CARDS (2-up) ───────────────────────────────── */
.featured-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.featured-card {
  background: linear-gradient(135deg, var(--teal-lt) 0%, #f0f9ff 100%);
  border: 1px solid #bae6fd;
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  transition: transform 0.15s, box-shadow 0.15s;
  text-decoration: none;
  color: var(--text);
}

.featured-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  text-decoration: none;
}

.featured-card-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.featured-card h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}

.featured-card p {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.4;
}

/* ── CALC GRID (link list) ───────────────────────────────── */
.calc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px 12px;
}

.calc-grid a {
  font-size: 0.85rem;
  color: var(--primary);
  padding: 4px 0;
  border-bottom: 1px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calc-grid a:hover {
  color: var(--teal);
  border-bottom-color: var(--teal-lt);
  text-decoration: none;
}

/* ── CONVERTER TOOL ──────────────────────────────────────── */
.converter-tool {
  background: var(--card);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  margin-bottom: 24px;
}

.converter-tool h1 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 6px;
}

.converter-tool .breadcrumb {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 20px;
}

.converter-tool .breadcrumb a { color: var(--teal); }

.converter-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: center;
  margin-bottom: 20px;
}

.converter-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.converter-field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.converter-field input {
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}

.converter-field input:focus { border-color: var(--teal); }

.converter-field select {
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  color: var(--text);
  background: #fff;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
  width: 100%;
}

.converter-field select:focus { border-color: var(--teal); }

.swap-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s;
  flex-shrink: 0;
  align-self: flex-end;
  margin-bottom: 2px;
}

.swap-btn:hover { background: var(--teal); transform: rotate(180deg); }

.result-box {
  background: linear-gradient(135deg, var(--primary) 0%, var(--teal) 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 20px 24px;
  text-align: center;
  margin-bottom: 20px;
}

.result-box .result-value {
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -0.5px;
}

.result-box .result-label {
  font-size: 0.9rem;
  opacity: 0.85;
  margin-top: 4px;
}

/* ── CONVERSION TABLE ────────────────────────────────────── */
.conversion-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin-top: 16px;
}

.conversion-table th {
  background: var(--primary);
  color: #fff;
  padding: 10px 14px;
  text-align: left;
  font-weight: 700;
}

.conversion-table td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
}

.conversion-table tr:nth-child(even) td { background: var(--bg); }
.conversion-table tr:hover td { background: var(--teal-lt); }

/* ── ARTICLE / SEO CONTENT ───────────────────────────────── */
.seo-content {
  background: var(--card);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  margin-bottom: 24px;
}

.seo-content h2 {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--teal-lt);
}

.seo-content h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--teal);
  margin: 16px 0 8px;
}

.seo-content p {
  color: var(--text);
  margin-bottom: 12px;
  line-height: 1.7;
}

.seo-content strong { color: var(--primary); }

/* ── ARTICLE CARDS ───────────────────────────────────────── */
.article-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.article-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s;
  text-decoration: none;
  color: var(--text);
  display: block;
}

.article-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  text-decoration: none;
}

.article-card-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--teal) 100%);
  padding: 18px;
  color: #fff;
}

.article-card-header .tag {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(255,255,255,0.2);
  padding: 3px 8px;
  border-radius: 12px;
  display: inline-block;
  margin-bottom: 8px;
}

.article-card-header h3 {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
}

.article-card-body {
  padding: 14px 18px;
}

.article-card-body p {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
}

.article-card-body .read-more {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--teal);
  margin-top: 10px;
  display: block;
}

/* ── ARTICLE PAGE ────────────────────────────────────────── */
.article-page {
  background: var(--card);
  border-radius: var(--radius);
  padding: 36px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  margin-bottom: 24px;
}

.article-page h1 {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--primary);
  margin-bottom: 8px;
  line-height: 1.25;
}

.article-meta {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.article-page h2 {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--primary);
  margin: 28px 0 12px;
}

.article-page h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--teal);
  margin: 20px 0 8px;
}

.article-page p {
  margin-bottom: 14px;
  line-height: 1.75;
  color: var(--text);
}

.article-page ul, .article-page ol {
  margin: 0 0 14px 24px;
  line-height: 1.75;
}

/* ── BACKLINK CLUSTER ────────────────────────────────────── */
.backlink-cluster {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  margin-bottom: 24px;
  text-align: center;
}

.backlink-cluster h3 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 14px;
}

.backlink-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.backlink-pills a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--teal) 100%);
  color: #fff;
  border-radius: 24px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 2px 8px rgba(30,64,175,0.2);
}

.backlink-pills a:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(30,64,175,0.3);
  text-decoration: none;
}

/* ── FOOTER ──────────────────────────────────────────────── */
footer {
  background: var(--primary-dk);
  color: rgba(255,255,255,0.8);
  padding: 32px 24px 20px;
  margin-top: 16px;
}

.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-brand .logo-text {
  font-size: 1.3rem;
  margin-bottom: 8px;
  display: block;
}

.footer-brand p {
  font-size: 0.85rem;
  line-height: 1.6;
  opacity: 0.75;
}

.footer-col h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--amber);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.footer-col a {
  display: block;
  color: rgba(255,255,255,0.7);
  font-size: 0.85rem;
  margin-bottom: 6px;
  text-decoration: none;
  transition: color 0.15s;
}

.footer-col a:hover { color: var(--amber); text-decoration: none; }

.footer-bottom {
  max-width: 1400px;
  margin: 16px auto 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  opacity: 0.6;
  flex-wrap: wrap;
  gap: 8px;
}

/* ── PRIVACY / ABOUT ─────────────────────────────────────── */
.policy-page {
  background: var(--card);
  border-radius: var(--radius);
  padding: 36px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  margin-bottom: 24px;
}

.policy-page h1 {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--primary);
  margin-bottom: 6px;
}

.policy-page .last-updated {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 24px;
}

.policy-callout {
  background: linear-gradient(135deg, #dcfce7 0%, #f0fdf4 100%);
  border-left: 4px solid var(--success);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 16px 20px;
  margin-bottom: 24px;
}

.policy-callout strong { color: var(--success); }

.policy-page h2 {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--primary);
  margin: 28px 0 10px;
}

.policy-page p, .policy-page li {
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--text);
  margin-bottom: 10px;
}

.policy-page ul { margin-left: 20px; }

/* ── SEARCH RESULTS ──────────────────────────────────────── */
.search-results {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  margin-bottom: 24px;
}

.search-result-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.search-result-item:last-child { border-bottom: none; }

.search-result-item a {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
}

.search-result-item p {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 3px;
}

/* ── BREADCRUMB ──────────────────────────────────────────── */
.breadcrumb {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 16px;
}

.breadcrumb a { color: var(--teal); }
.breadcrumb span { margin: 0 6px; }

/* ── RESPONSIVE ──────────────────────────────────────────── */

/* Tablet: hide side ad columns, shrink nav */
@media (max-width: 1100px) {
  .page-wrapper { grid-template-columns: 100px 1fr 100px; gap: 12px; }
  .ad-slot.skyscraper { min-height: 400px; }
}

/* Small tablet / large phone landscape */
@media (max-width: 900px) {
  .page-wrapper { grid-template-columns: 1fr; padding: 16px 12px; }
  .ad-col { display: none; }
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 24px; }
  .featured-cards { grid-template-columns: 1fr; }
  .calc-grid { grid-template-columns: repeat(2, 1fr); }
  .article-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .hero { padding: 28px 20px; }
  .hero h1 { font-size: 1.7rem; }
  .hero-stats { gap: 20px; }
  .category-section { padding: 18px; }
  .converter-tool { padding: 20px; }
  .article-page { padding: 24px; }
  .policy-page { padding: 24px; }
}

/* Mobile portrait — primary smartphone breakpoint */
@media (max-width: 640px) {
  /* Header */
  .header-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
  }
  .header-search { width: 100%; }
  .header-search input { width: 100%; flex: 1; }
  .header-search button { white-space: nowrap; }
  .logo-text { font-size: 1.3rem; }
  .header-tagline { font-size: 0.72rem; }
  .adsense-header { min-height: 50px; font-size: 0.7rem; padding: 4px 0; }

  /* Nav — horizontal scroll on mobile */
  .nav-inner { padding: 0 4px; }
  .nav-inner a { padding: 10px 12px; font-size: 0.8rem; }

  /* Page wrapper */
  .page-wrapper { padding: 12px 10px; gap: 14px; }

  /* Hero */
  .hero { padding: 22px 16px; border-radius: 8px; }
  .hero h1 { font-size: 1.4rem; letter-spacing: -0.3px; }
  .hero p { font-size: 0.95rem; }
  .hero-stats { gap: 16px; }
  .hero-stat strong { font-size: 1.2rem; }
  .quick-search { flex-direction: column; gap: 8px; }
  .quick-search input, .quick-search button { width: 100%; border-radius: 10px; }

  /* Category sections */
  .category-section { padding: 14px 12px; border-radius: 8px; }
  .section-header h2 { font-size: 1.05rem; }
  .section-icon { width: 30px; height: 30px; font-size: 15px; }

  /* Featured cards — stack vertically */
  .featured-cards { grid-template-columns: 1fr; gap: 10px; }
  .featured-card { padding: 14px; }
  .featured-card-icon { font-size: 1.6rem; }
  .featured-card h3 { font-size: 0.95rem; }

  /* Calc link grid — 2 columns on mobile */
  .calc-grid { grid-template-columns: 1fr 1fr; gap: 4px 10px; }
  .calc-grid a { font-size: 0.82rem; }

  /* Converter tool */
  .converter-tool { padding: 16px 12px; }
  .converter-tool h1 { font-size: 1.3rem; }
  .converter-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .swap-btn {
    width: 100%;
    border-radius: var(--radius);
    height: 42px;
    order: 2;
  }
  .converter-field:last-child { order: 3; }
  .converter-field input { font-size: 1.05rem; padding: 12px 14px; }
  .result-box { padding: 16px; }
  .result-box .result-value { font-size: 1.6rem; }
  .conversion-table { font-size: 0.82rem; }
  .conversion-table th, .conversion-table td { padding: 8px 10px; }

  /* Articles */
  .article-grid { grid-template-columns: 1fr; gap: 12px; }
  .article-page { padding: 16px 14px; }
  .article-page h1 { font-size: 1.4rem; }
  .article-page h2 { font-size: 1.1rem; }
  .seo-content { padding: 16px 14px; }

  /* Privacy / Policy pages */
  .policy-page { padding: 16px 14px; }
  .policy-page h1 { font-size: 1.4rem; }
  .privacy-hero { padding: 28px 16px !important; }
  .privacy-hero h1 { font-size: 1.6rem !important; }
  .zero-data-banner { flex-direction: column; gap: 10px; padding: 16px; }
  .law-table { font-size: 0.78rem; }
  .law-table th, .law-table td { padding: 7px 8px; }

  /* Footer */
  .footer-inner { grid-template-columns: 1fr; gap: 20px; padding-bottom: 20px; }
  .footer-bottom { flex-direction: column; text-align: center; gap: 6px; }
  footer { padding: 24px 16px 16px; }

  /* Backlink cluster */
  .backlink-cluster { padding: 16px; }
  .backlink-pills a { font-size: 0.8rem; padding: 6px 12px; }

  /* Scroll to top button — move left of screen edge on mobile */
  #scrollTop { bottom: 16px; right: 16px; width: 40px; height: 40px; font-size: 1rem; }

  /* Loan / mortgage calculator tables */
  .amort-table { font-size: 0.78rem; }
  .amort-table th, .amort-table td { padding: 6px 8px; }

  /* Percentage calculator grid */
  .calc-cards-grid { grid-template-columns: 1fr !important; }
}

/* Extra small phones (iPhone SE, Galaxy A series) */
@media (max-width: 380px) {
  .logo-text { font-size: 1.1rem; }
  .hero h1 { font-size: 1.2rem; }
  .calc-grid { grid-template-columns: 1fr; }
  .nav-inner a { padding: 9px 10px; font-size: 0.75rem; }
  .featured-card { flex-direction: column; }
}

/* ── UTILITY ─────────────────────────────────────────────── */
.text-center { text-align: center; }
.mb-0 { margin-bottom: 0 !important; }
.mt-16 { margin-top: 16px; }
.tag-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.tag-badge.blue { background: var(--teal-lt); color: var(--teal); }
.tag-badge.amber { background: var(--amber-lt); color: #92400e; }
.tag-badge.green { background: #dcfce7; color: #166534; }

/* ── SCROLL TO TOP ───────────────────────────────────────── */
#scrollTop {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 1.2rem;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  z-index: 999;
  transition: background 0.2s;
}

#scrollTop:hover { background: var(--teal); }
#scrollTop.visible { display: flex; }

/* =====================================================
   GLOBAL BUTTON HOVER FIX
   Ensures all calculate/action buttons turn dark green
   on hover — never white or invisible
   ===================================================== */
.calc-btn:hover,
.calc-btn-sm:hover,
button[class*="calc"]:hover,
button[id*="calc"]:hover,
button[id*="Calc"]:hover {
  background: #15803d !important;
  color: #fff !important;
}
