/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #1565c0;
  --primary-dark: #0d47a1;
  --primary-light: #1976d2;
  --accent: #f57c00;
  --bg: #f5f5f5;
  --card-bg: #ffffff;
  --text: #212121;
  --text-muted: #616161;
  --border: #e0e0e0;
  --hover-bg: #e3f2fd;
  --link: #1565c0;
  --success: #2e7d32;
  --header-height: 60px;
  --shadow: 0 2px 6px rgba(0,0,0,0.10);
  --shadow-hover: 0 4px 14px rgba(0,0,0,0.15);
  --radius: 6px;
  --font: 'Segoe UI', Arial, sans-serif;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
}

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

/* ===== HEADER ===== */
header {
  background: var(--primary);
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.logo-icon {
  width: 36px;
  height: 36px;
  background: #fff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.logo-text {
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.logo-text span { color: #ffd54f; }

header nav {
  margin-left: auto;
  display: flex;
  gap: 6px;
}

header nav a {
  color: rgba(255,255,255,0.9);
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 4px;
  transition: background 0.2s;
}

header nav a:hover {
  background: rgba(255,255,255,0.2);
  text-decoration: none;
}

/* ===== BREADCRUMB ===== */
.breadcrumb {
  background: #e3f2fd;
  padding: 8px 20px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}

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

/* ===== WRAPPER ===== */
.wrapper {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ===== HERO / EXPRESS CONVERTER ===== */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  padding: 36px 20px 40px;
  text-align: center;
}

.hero h1 {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 6px;
}

.hero p {
  font-size: 15px;
  opacity: 0.88;
  margin-bottom: 24px;
}

/* Express Converter Box */
.express-box {
  background: #fff;
  border-radius: 10px;
  padding: 24px;
  max-width: 680px;
  margin: 0 auto;
  box-shadow: 0 4px 20px rgba(0,0,0,0.18);
}

.express-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 18px;
}

.express-tabs button {
  background: #f0f4ff;
  border: 1.5px solid #c5cae9;
  color: var(--primary);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.express-tabs button.active,
.express-tabs button:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.express-inputs {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: end;
}

.express-field label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
  font-weight: 600;
  text-align: left;
}

.express-field input {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s;
}

.express-field input:focus { border-color: var(--primary); }

.express-field select {
  width: 100%;
  padding: 8px 10px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  background: #fafafa;
  cursor: pointer;
  outline: none;
  margin-top: 4px;
}

.switch-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s;
  margin-bottom: 4px;
  align-self: center;
}

.switch-btn:hover { background: var(--primary-dark); transform: rotate(180deg); }

.express-result {
  margin-top: 16px;
  padding: 12px 16px;
  background: #e8f5e9;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 700;
  color: var(--success);
  text-align: center;
  min-height: 46px;
}

/* ===== SECTION TITLES ===== */
.section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-dark);
  margin: 28px 0 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title .icon { font-size: 20px; }

/* ===== MAIN LAYOUT ===== */
.main-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 20px;
  margin: 24px auto;
  max-width: 1080px;
  padding: 0 16px;
}

/* ===== COMMON CONVERSIONS ===== */
.common-conversions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 20px;
}

.conv-link {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text);
  transition: all 0.2s;
  gap: 8px;
}

.conv-link:hover {
  background: var(--hover-bg);
  border-color: var(--primary);
  color: var(--primary);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.conv-link .arrow { color: var(--accent); font-weight: 700; }

/* ===== CATEGORY CARDS ===== */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.cat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s, transform 0.2s;
}

.cat-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.cat-card-header {
  background: var(--primary);
  color: #fff;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cat-card-header .cat-icon { font-size: 16px; }

.cat-card ul {
  list-style: none;
  padding: 8px 0;
}

.cat-card ul li a {
  display: block;
  padding: 6px 14px;
  color: var(--text);
  font-size: 13px;
  transition: all 0.15s;
}

.cat-card ul li a:hover {
  background: var(--hover-bg);
  color: var(--primary);
  padding-left: 20px;
  text-decoration: none;
}

/* Category header colors */
.cat-card[data-cat="common"] .cat-card-header { background: #1565c0; }
.cat-card[data-cat="engineering"] .cat-card-header { background: #2e7d32; }
.cat-card[data-cat="heat"] .cat-card-header { background: #c62828; }
.cat-card[data-cat="fluids"] .cat-card-header { background: #00695c; }
.cat-card[data-cat="light"] .cat-card-header { background: #e65100; }
.cat-card[data-cat="electricity"] .cat-card-header { background: #6a1b9a; }
.cat-card[data-cat="magnetism"] .cat-card-header { background: #4527a0; }
.cat-card[data-cat="radiology"] .cat-card-header { background: #880e4f; }
.cat-card[data-cat="other"] .cat-card-header { background: #37474f; }

/* ===== SIDEBAR ===== */
.sidebar {}

.sidebar-widget {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.sidebar-widget-title {
  background: var(--primary);
  color: #fff;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 700;
}

.sidebar-widget ul {
  list-style: none;
  padding: 6px 0;
}

.sidebar-widget ul li a {
  display: block;
  padding: 7px 14px;
  font-size: 13px;
  color: var(--text);
  border-bottom: 1px solid #f5f5f5;
  transition: all 0.15s;
}

.sidebar-widget ul li:last-child a { border-bottom: none; }

.sidebar-widget ul li a:hover {
  background: var(--hover-bg);
  color: var(--primary);
  text-decoration: none;
}

.sidebar-widget .info-box {
  padding: 14px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ===== CONVERTER PAGE ===== */
.converter-page { max-width: 1080px; margin: 0 auto; padding: 20px 16px; }

.converter-main {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 20px;
}

.converter-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.converter-card h2 {
  font-size: 20px;
  color: var(--primary-dark);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--primary);
}

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

.conv-field {}

.conv-field label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.conv-field input {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: 6px;
  font-size: 18px;
  font-weight: 600;
  outline: none;
  transition: border-color 0.2s;
  color: var(--primary-dark);
}

.conv-field input:focus { border-color: var(--primary); }

.conv-field select {
  width: 100%;
  padding: 9px 10px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  margin-top: 6px;
  background: #fafafa;
  cursor: pointer;
  outline: none;
}

.conv-switch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.conv-switch button {
  background: var(--primary);
  color: #fff;
  border: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.2s;
}

.conv-switch button:hover { background: var(--primary-dark); transform: rotate(180deg); }

.conv-result-box {
  background: #e8f5e9;
  border: 1px solid #a5d6a7;
  border-radius: 6px;
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 600;
  color: #1b5e20;
  margin-top: 12px;
}

/* Conversion Table */
.conv-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  font-size: 13px;
}

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

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

.conv-table tr:nth-child(even) td { background: #f9f9f9; }
.conv-table tr:hover td { background: var(--hover-bg); }

/* Description Box */
.desc-box {
  background: #fffde7;
  border: 1px solid #fff9c4;
  border-left: 4px solid var(--accent);
  border-radius: 4px;
  padding: 14px 16px;
  font-size: 13px;
  color: var(--text);
  line-height: 1.7;
  margin-top: 20px;
}

/* ===== ABOUT / INFO TEXT ===== */
.about-text {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.75;
  margin-bottom: 20px;
}

.about-text h3 { color: var(--text); font-size: 15px; margin-bottom: 8px; }

/* ===== FOOTER ===== */
footer {
  background: #263238;
  color: rgba(255,255,255,0.8);
  padding: 24px 20px;
  margin-top: 40px;
  text-align: center;
  font-size: 13px;
}

footer .footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

footer .footer-links a {
  color: rgba(255,255,255,0.75);
  transition: color 0.2s;
}

footer .footer-links a:hover { color: #fff; text-decoration: none; }

footer .copyright { color: rgba(255,255,255,0.5); font-size: 12px; }

/* ===== AD SLOTS ===== */
.ad-slot {
  width: 100%;
  margin: 16px 0;
  text-align: center;
  overflow: hidden;
  border-radius: var(--radius);
}

.ad-leaderboard {
  background: #f9f9f9;
  border: 1px solid var(--border);
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-placeholder {
  width: 100%;
  background: #f5f5f5;
  border: 1px dashed #ccc;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #9e9e9e;
  font-size: 12px;
  padding: 12px;
  min-height: 70px;
}

.ad-label {
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #bdbdbd;
  margin-bottom: 4px;
}

.ad-sidebar-box .ad-placeholder {
  min-height: 250px;
  max-width: 300px;
  margin: 0 auto;
}

.ad-inline .ad-placeholder {
  min-height: 90px;
}

.ad-top-bar {
  background: var(--bg);
  padding: 8px 20px;
  border-bottom: 1px solid var(--border);
}

/* ===== FORMULA TABLE ===== */
.formula-table code {
  background: #e3f2fd;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 13px;
  color: var(--primary-dark);
  font-family: 'Courier New', monospace;
}
.formula-table .example-col { color: var(--success); font-weight: 600; }

/* ===== FAQ ===== */
.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 0;
}
.faq-item:last-child { border-bottom: none; }
.faq-q {
  padding: 12px 14px;
  cursor: pointer;
  font-weight: 600;
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 0.15s;
  user-select: none;
}
.faq-q:hover { background: var(--hover-bg); }
.faq-arrow { color: var(--primary); font-size: 11px; width: 14px; }
.faq-a {
  padding: 10px 14px 14px 38px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.7;
  background: #fafafa;
}

/* ===== FACTS LIST ===== */
.facts-list {
  list-style: none;
  padding: 0;
}
.facts-list li {
  padding: 8px 14px 8px 30px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text);
  line-height: 1.6;
  position: relative;
}
.facts-list li::before {
  content: '✓';
  position: absolute;
  left: 10px;
  color: var(--success);
  font-weight: 700;
}
.facts-list li:last-child { border-bottom: none; }

/* ===== LIVE CLOCK ===== */
.live-clock-box {
  background: #e8f5e9;
  border: 1px solid #a5d6a7;
  border-radius: 6px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #1b5e20;
  margin: 10px 0;
  text-align: center;
}

/* ===== CATEGORY NAV IN SIDEBAR ===== */
.cat-group-label {
  background: var(--bg);
  padding: 6px 14px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-top: 1px solid var(--border);
}

/* ===== LEGAL PAGES ===== */
.legal-content {
  max-width: 860px;
  margin: 30px auto;
  padding: 0 20px;
}
.legal-content h1 { font-size: 26px; color: var(--primary-dark); margin-bottom: 8px; }
.legal-content .last-updated { font-size: 13px; color: var(--text-muted); margin-bottom: 24px; }
.legal-content h2 { font-size: 17px; color: var(--primary-dark); margin: 24px 0 8px; }
.legal-content p, .legal-content li { font-size: 14px; color: var(--text); line-height: 1.8; margin-bottom: 10px; }
.legal-content ul { padding-left: 20px; }
.legal-content ul li { list-style: disc; }

/* ===== INTRO TEXT on converter pages ===== */
.intro-text p { font-size: 14px; color: var(--text); line-height: 1.8; margin-bottom: 10px; }
.intro-text strong { color: var(--primary-dark); }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .main-grid { grid-template-columns: 1fr; }
  .categories-grid { grid-template-columns: 1fr 1fr; }
  .common-conversions { grid-template-columns: 1fr; }
  .converter-main { grid-template-columns: 1fr; }
  .converter-row { grid-template-columns: 1fr; }
  .conv-switch { flex-direction: row; }
  .express-inputs { grid-template-columns: 1fr; }
  .switch-btn { margin: 0 auto; }
  .ad-sidebar-box { display: none; }
}

@media (max-width: 480px) {
  .categories-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 20px; }
  .logo-text { font-size: 16px; }
}

/* ===== SEARCH BAR ===== */
.search-bar {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.15);
  border: 1.5px solid rgba(255,255,255,0.35);
  border-radius: 24px;
  overflow: hidden;
  margin-left: 20px;
  flex: 1;
  max-width: 260px;
}

.search-bar input {
  flex: 1;
  background: transparent;
  border: none;
  color: #fff;
  padding: 7px 14px;
  font-size: 13px;
  outline: none;
}

.search-bar input::placeholder { color: rgba(255,255,255,0.6); }

.search-bar button {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.8);
  padding: 7px 12px;
  cursor: pointer;
  font-size: 15px;
}

/* ===== POPULAR CONVERTERS BADGE ===== */
.popular-badge {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: 700;
  margin-left: 6px;
  vertical-align: middle;
  letter-spacing: 0.3px;
}

/* ===== UNIT TABLE ON CONVERTER PAGE ===== */
.full-table-wrapper {
  overflow-x: auto;
  margin-top: 20px;
}

/* ===== TABS ===== */
.tab-buttons {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--primary);
  margin-bottom: 16px;
}

.tab-btn {
  padding: 8px 18px;
  background: #f5f5f5;
  border: 1px solid var(--border);
  border-bottom: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: 4px 4px 0 0;
  margin-right: 2px;
  transition: all 0.2s;
}

.tab-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ===== LOGO SVG (replaces emoji icon) ===== */
.logo-icon {
  width: 36px;
  height: 36px;
  background: transparent;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.logo-svg {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: block;
}

/* ===== CONVERTER FIELD ORDER FIX ===== */
/* Unit selector appears ABOVE the number input */
.conv-field { display: flex; flex-direction: column; }
.conv-field label  { order: 1; margin-bottom: 4px; }
.conv-field select { order: 2; margin-top: 0; margin-bottom: 6px; }
.conv-field input  { order: 3; margin-top: 0; }

/* Same fix for homepage quick converter */
.express-field { display: flex; flex-direction: column; }
.express-field label  { order: 1; }
.express-field select { order: 2; margin-top: 5px; }
.express-field input  { order: 3; margin-top: 5px; }

/* ===== CALCULATOR PAGES LAYOUT ===== */
.calc-page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 20px 16px;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 20px;
  align-items: start;
}
.calc-main { min-width: 0; }

.calc-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}
.calc-card h1 {
  font-size: 22px;
  color: var(--primary-dark);
  margin-bottom: 6px;
  font-weight: 700;
}
.calc-card h2 {
  font-size: 17px;
  color: var(--primary-dark);
  margin: 20px 0 10px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary);
}
.calc-card h3 { font-size: 15px; color: var(--text); margin: 14px 0 6px; font-weight: 700; }
.calc-subtitle { color: var(--text-muted); font-size: 14px; margin-bottom: 20px; }
.calc-intro { font-size: 14px; color: var(--text); line-height: 1.8; margin-bottom: 16px; }

.calc-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.calc-input-group { display: flex; flex-direction: column; gap: 4px; }
.calc-input-group label { font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px; }
.calc-input-group input,
.calc-input-group select {
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
  background: #fff;
}
.calc-input-group input:focus,
.calc-input-group select:focus { border-color: var(--primary); }
.calc-input-group.full-width { grid-column: 1 / -1; }

.calc-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 12px 28px;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 6px;
}
.calc-btn:hover { background: var(--primary-dark); }

.calc-unit-toggle {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
}
.calc-unit-btn {
  padding: 6px 16px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  background: #f5f5f5;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.calc-unit-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.calc-result {
  background: linear-gradient(135deg, #e3f2fd 0%, #e8f5e9 100%);
  border: 1px solid #90caf9;
  border-radius: 8px;
  padding: 20px;
  margin-top: 18px;
  text-align: center;
}
.calc-result-value {
  font-size: 36px;
  font-weight: 800;
  color: var(--primary-dark);
  line-height: 1.1;
}
.calc-result-label { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.calc-result-category {
  display: inline-block;
  margin-top: 10px;
  padding: 4px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 700;
}
.cat-underweight { background: #e3f2fd; color: #1565c0; }
.cat-normal      { background: #e8f5e9; color: #2e7d32; }
.cat-overweight  { background: #fff8e1; color: #e65100; }
.cat-obese       { background: #fce4ec; color: #c62828; }

.bmi-bar {
  width: 100%;
  height: 20px;
  border-radius: 10px;
  background: linear-gradient(to right, #2196f3 0%, #4caf50 25%, #ff9800 60%, #f44336 100%);
  position: relative;
  margin: 14px 0 6px;
  overflow: visible;
}
.bmi-marker {
  position: absolute;
  top: -6px;
  width: 12px;
  height: 32px;
  background: #212121;
  border-radius: 3px;
  transform: translateX(-50%);
  transition: left 0.4s;
}
.bmi-bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.calc-breakdown {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.breakdown-item {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px;
  text-align: center;
}
.breakdown-val { font-size: 20px; font-weight: 700; color: var(--primary-dark); }
.breakdown-lbl { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.amort-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 12px; }
.amort-table th { background: var(--primary); color: #fff; padding: 8px 10px; text-align: right; }
.amort-table td { padding: 7px 10px; border-bottom: 1px solid var(--border); text-align: right; }
.amort-table tr:nth-child(even) td { background: #f9f9f9; }

.how-to-list { list-style: none; padding: 0; counter-reset: step; }
.how-to-list li {
  counter-increment: step;
  padding: 8px 12px 8px 44px;
  position: relative;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  line-height: 1.7;
}
.how-to-list li:last-child { border-bottom: none; }
.how-to-list li::before {
  content: counter(step);
  position: absolute;
  left: 10px;
  top: 8px;
  background: var(--primary);
  color: #fff;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.ref-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ref-table th { background: var(--primary); color: #fff; padding: 9px 12px; text-align: left; }
.ref-table td { padding: 8px 12px; border-bottom: 1px solid var(--border); }
.ref-table tr:nth-child(even) td { background: #f9f9f9; }
.ref-table tr:hover td { background: var(--hover-bg); }

.country-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.country-tab {
  padding: 6px 14px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  background: #f5f5f5;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.country-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ===== MOBILE IMPROVEMENTS ===== */
@media (max-width: 900px) {
  .calc-page { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  header { padding: 0 12px; flex-wrap: nowrap; gap: 6px; }
  header nav { display: none; }
  .search-bar { margin-left: 8px; max-width: none; flex: 1; }
  .calc-inputs { grid-template-columns: 1fr; }
  .calc-breakdown { grid-template-columns: 1fr 1fr; }
  .conv-field input { font-size: 16px; padding: 10px 12px; }
  .amort-table { font-size: 12px; }
  .amort-table th, .amort-table td { padding: 6px 7px; }
}
@media (max-width: 480px) {
  .logo-text { font-size: 15px; }
  .calc-result-value { font-size: 28px; }
  .calc-breakdown { grid-template-columns: 1fr 1fr; }
  .country-tabs { gap: 4px; }
  .country-tab { font-size: 12px; padding: 5px 10px; }
}
