/* ============================================================
   pages.css — Standalone Calculator Pages
   Dark Purple Theme — matches mechanical.html / electrical.html
   AI Calculator — aionlinecalculator.com
   ============================================================ */

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

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #0a0a1a;
  color: #e2e8f0;
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #0f0f2a; }
::-webkit-scrollbar-thumb { background: #6366f1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #a78bfa; }

::selection { background: rgba(99,102,241,.35); color: #fff; }

/* ── TOP NAVIGATION ─────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 64px;
  background: rgba(10,10,26,.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(99,102,241,.2);
}

.nav-logo {
  font-size: 1.25rem;
  font-weight: 800;
  color: #e2e8f0;
  text-decoration: none;
  letter-spacing: -.5px;
}

.nav-logo span {
  background: linear-gradient(135deg,#6366f1,#a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: linear-gradient(135deg,#6366f1,#a855f7);
  color: #fff;
  text-decoration: none;
  font-size: .85rem;
  font-weight: 600;
  border-radius: 8px;
  transition: opacity .2s, transform .2s;
  white-space: nowrap;
}

.nav-cta:hover { opacity: .88; transform: translateY(-1px); }

/* ── HERO SECTION ────────────────────────────────────────────── */
.hero {
  background: linear-gradient(160deg,#0f0f2e 0%,#1a0a2e 40%,#0a0a1a 100%);
  padding: 60px 24px 52px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(ellipse at center,rgba(99,102,241,.15) 0%,transparent 70%);
  pointer-events: none;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: .8rem;
  color: #94a3b8;
  margin-bottom: 18px;
  position: relative;
  z-index: 1;
}

.breadcrumb a { color: #94a3b8; text-decoration: none; transition: color .2s; }
.breadcrumb a:hover { color: #a78bfa; }
.breadcrumb span { color: #475569; }

/* Badge */
.badge {
  display: inline-block;
  padding: 5px 14px;
  background: rgba(99,102,241,.18);
  border: 1px solid rgba(99,102,241,.35);
  border-radius: 20px;
  font-size: .78rem;
  font-weight: 600;
  color: #a78bfa;
  letter-spacing: .5px;
  text-transform: uppercase;
  margin-bottom: 18px;
  position: relative;
  z-index: 1;
}

/* Hero heading */
.hero h1 {
  font-size: clamp(2rem,5vw,3.2rem);
  font-weight: 800;
  line-height: 1.15;
  color: #f1f5f9;
  letter-spacing: -1px;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}

.hero h1 span {
  background: linear-gradient(135deg,#6366f1 0%,#a78bfa 50%,#ec4899 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero > p {
  font-size: 1.1rem;
  color: #94a3b8;
  max-width: 640px;
  margin: 0 auto 24px;
  position: relative;
  z-index: 1;
}

/* Hero tags */
.hero-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 28px;
  position: relative;
  z-index: 1;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  background: rgba(99,102,241,.12);
  border: 1px solid rgba(99,102,241,.25);
  border-radius: 6px;
  font-size: .8rem;
  color: #c4b5fd;
  font-weight: 500;
}

.hero-tag span { color: #6366f1; font-weight: 700; }

/* Hero buttons */
.hero-btns {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 4px;
  position: relative;
  z-index: 1;
}

/* ── BUTTONS ─────────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 24px;
  background: linear-gradient(135deg,#6366f1,#a855f7);
  color: #fff !important;
  text-decoration: none;
  font-size: .9rem;
  font-weight: 600;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
  box-shadow: 0 4px 16px rgba(99,102,241,.4);
  min-height: 48px;
  font-family: inherit;
  white-space: nowrap;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99,102,241,.5);
}

.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 24px;
  background: rgba(255,255,255,.06);
  color: #c4b5fd !important;
  text-decoration: none;
  font-size: .9rem;
  font-weight: 600;
  border-radius: 10px;
  border: 1px solid rgba(99,102,241,.3);
  cursor: pointer;
  transition: background .2s, border-color .2s, transform .2s;
  min-height: 48px;
  font-family: inherit;
  white-space: nowrap;
}

.btn-secondary:hover {
  background: rgba(99,102,241,.15);
  border-color: rgba(99,102,241,.5);
  transform: translateY(-2px);
}

/* ── STATS BAR ───────────────────────────────────────────────── */
.stats {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  background: rgba(255,255,255,.03);
  border-top: 1px solid rgba(99,102,241,.15);
  border-bottom: 1px solid rgba(99,102,241,.15);
}

.stat {
  flex: 1;
  min-width: 100px;
  padding: 16px 20px;
  text-align: center;
  border-right: 1px solid rgba(99,102,241,.1);
}

.stat:last-child { border-right: none; }

.stat-num {
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(135deg,#6366f1,#a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.stat-lbl {
  font-size: .72rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-top: 2px;
}

/* ── MAIN CONTAINER ──────────────────────────────────────────── */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 24px;
}

/* ── CALCULATOR WIDGET ───────────────────────────────────────── */
.calc-widget {
  background: rgba(25,25,64,.6);
  border: 1px solid rgba(99,102,241,.25);
  border-radius: 16px;
  padding: 32px;
  margin-bottom: 36px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.calc-widget h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 8px;
}

.calc-widget > p {
  font-size: .95rem;
  color: #94a3b8;
  margin-bottom: 24px;
}

/* Input grid */
.calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(200px,1fr));
  gap: 16px;
  margin-bottom: 20px;
}

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

.field label {
  font-size: .82rem;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: .4px;
}

.field input,
.field select {
  width: 100%;
  padding: 11px 14px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(99,102,241,.25);
  border-radius: 8px;
  color: #f1f5f9;
  font-size: 1rem;
  font-family: 'JetBrains Mono','Courier New',monospace;
  transition: border-color .2s, background .2s;
  -webkit-appearance: none;
  appearance: none;
  min-height: 44px;
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: #6366f1;
  background: rgba(99,102,241,.12);
  box-shadow: 0 0 0 3px rgba(99,102,241,.2);
}

.field input::placeholder { color: #475569; }
.field select option { background: #1a1a2e; color: #e2e8f0; }

/* Result area */
.calc-result {
  display: none;
  margin-top: 24px;
  animation: fadeInUp .3s ease;
}

.calc-result.show { display: block; }

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(160px,1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.result-card {
  background: rgba(99,102,241,.1);
  border: 1px solid rgba(99,102,241,.2);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
}

.rlabel {
  font-size: .75rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 6px;
}

.rvalue {
  font-size: 1.3rem;
  font-weight: 700;
  font-family: 'JetBrains Mono',monospace;
  color: #f1f5f9;
}

.rvalue.ok    { color: #a78bfa; }
.rvalue.warn  { color: #f59e0b; }
.rvalue.danger{ color: #ef4444; }

.calc-note { font-size: .85rem; color: #94a3b8; margin: 8px 0; }

.calc-actions { margin-top: 16px; text-align: center; }

/* ── ACCENT / CTA LINKS ──────────────────────────────────────── */
.cable-accent-link {
  color: #a78bfa;
  text-decoration: none;
  font-weight: 600;
  transition: color .2s;
}
.cable-accent-link:hover { color: #c4b5fd; text-decoration: underline; }

.cable-calc-btn {
  width: 100%;
  padding: 14px;
  font-size: 1rem;
  margin-top: 4px;
  border-radius: 10px;
}

.cable-cta-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 24px;
  background: linear-gradient(135deg,#6366f1,#a855f7);
  color: #fff !important;
  text-decoration: none;
  font-weight: 600;
  font-size: .9rem;
  border-radius: 10px;
  transition: transform .2s, box-shadow .2s;
  box-shadow: 0 4px 16px rgba(99,102,241,.4);
}

.cable-cta-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99,102,241,.5);
}

/* ── ARTICLE / CONTENT ───────────────────────────────────────── */
article { color: #cbd5e1; }

.section {
  margin-bottom: 32px;
  padding: 32px;
  background: rgba(25,25,64,.4);
  border: 1px solid rgba(99,102,241,.15);
  border-radius: 14px;
}

.section h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(99,102,241,.2);
}

.section h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #c4b5fd;
  margin: 20px 0 10px;
}

.section p {
  color: #94a3b8;
  margin-bottom: 14px;
  line-height: 1.75;
}

.section p:last-child { margin-bottom: 0; }

.section a { color: #a78bfa; text-decoration: none; }
.section a:hover { color: #c4b5fd; text-decoration: underline; }

/* Formula box */
.formula {
  background: rgba(99,102,241,.1);
  border: 1px solid rgba(99,102,241,.3);
  border-left: 4px solid #6366f1;
  border-radius: 8px;
  padding: 16px 20px;
  font-family: 'JetBrains Mono','Courier New',monospace;
  font-size: 1.05rem;
  color: #c4b5fd;
  margin: 16px 0;
  overflow-x: auto;
}

.f-label {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui,sans-serif;
  font-size: .72rem;
  font-weight: 700;
  color: #6366f1;
  text-transform: uppercase;
  letter-spacing: .6px;
  margin-bottom: 6px;
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  margin: 16px 0;
  border-radius: 10px;
  border: 1px solid rgba(99,102,241,.2);
}

table { width: 100%; border-collapse: collapse; font-size: .88rem; }

table thead tr { background: rgba(99,102,241,.2); }

table th {
  padding: 12px 14px;
  text-align: left;
  color: #c4b5fd;
  font-weight: 600;
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .4px;
  white-space: nowrap;
}

table td {
  padding: 10px 14px;
  color: #94a3b8;
  border-top: 1px solid rgba(99,102,241,.1);
}

table tbody tr:hover { background: rgba(99,102,241,.06); }
table strong { color: #c4b5fd; }

/* Lists */
.cable-criteria-list,
.section ul,
.section ol {
  padding-left: 20px;
  margin: 12px 0;
  color: #94a3b8;
}

.cable-criteria-list li,
.section ul li,
.section ol li { margin-bottom: 6px; line-height: 1.65; }

.cable-criteria-list strong,
.section ul li strong,
.section ol li strong { color: #c4b5fd; }

.cable-footnote { font-size: .8rem; color: #64748b; }

/* ── FAQ SECTION ─────────────────────────────────────────────── */
.faq { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }

.faq-item {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(99,102,241,.2);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color .2s;
}

.faq-item:hover { border-color: rgba(99,102,241,.45); }
.faq-item.open  { border-color: rgba(99,102,241,.5); }

.faq-q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  cursor: pointer;
  font-weight: 600;
  color: #e2e8f0;
  gap: 12px;
  user-select: none;
  -webkit-user-select: none;
  min-height: 56px;
}

.faq-q:hover { color: #a78bfa; }
.faq-item.open .faq-q { color: #a78bfa; }
.faq-q span:first-child { flex: 1; font-size: .95rem; }

.arrow {
  font-size: 1.2rem;
  color: #6366f1;
  transition: transform .3s;
  flex-shrink: 0;
  line-height: 1;
}

.faq-item.open .arrow { transform: rotate(180deg); }

.faq-a { display: none; padding: 0 20px 16px; }
.faq-item.open .faq-a { display: block; animation: fadeInUp .25s ease; }

.faq-a p { color: #94a3b8; font-size: .92rem; line-height: 1.7; margin: 0; }

/* ── CTA WIDGET ──────────────────────────────────────────────── */
.cable-cta-widget {
  text-align: center;
  background: linear-gradient(135deg,rgba(99,102,241,.15),rgba(168,85,247,.1));
  border: 1px solid rgba(99,102,241,.3);
  border-radius: 16px;
  padding: 40px 32px;
  margin: 40px 0;
}

.cable-cta-widget h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 10px;
}

.cable-cta-widget p { color: #94a3b8; margin-bottom: 22px; font-size: .95rem; }

.cable-cta-note {
  font-size: .8rem !important;
  color: #64748b !important;
  margin-top: 14px !important;
  margin-bottom: 0 !important;
}

/* ── SEO LINKS SECTION ───────────────────────────────────────── */
.seo-links {
  margin: 32px 0;
  padding: 28px 32px;
  background: rgba(25,25,64,.4);
  border: 1px solid rgba(99,102,241,.15);
  border-radius: 14px;
}

.seo-links h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 16px;
}

.seo-links ul {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill,minmax(200px,1fr));
  gap: 6px 16px;
}

.seo-links li a {
  color: #a78bfa;
  text-decoration: none;
  font-size: .88rem;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  transition: color .2s;
}

.seo-links li a::before { content: '→'; color: #6366f1; font-size: .8rem; }
.seo-links li a:hover { color: #c4b5fd; }

/* ── FOOTER ──────────────────────────────────────────────────── */
footer {
  background: rgba(10,10,26,.95);
  border-top: 1px solid rgba(99,102,241,.2);
  padding: 32px 24px;
  text-align: center;
  color: #475569;
  font-size: .82rem;
  line-height: 1.8;
}

.cable-footer-links { margin-bottom: 8px; }

.cable-footer-links a { color: #64748b; text-decoration: none; transition: color .2s; }
.cable-footer-links a:hover { color: #a78bfa; }

.cable-footer-disclaimer { font-size: .78rem; color: #374151; margin-top: 8px; }

/* ── PAGE-NAV (used in main app pages) ───────────────────────── */
.page-nav{display:flex;align-items:center;gap:4px;padding:4px;background:rgba(25,25,64,.6);border-radius:12px;border:1px solid rgba(99,102,241,.15);overflow-x:auto;max-width:100%;scrollbar-width:none;-ms-overflow-style:none}
.page-nav::-webkit-scrollbar{display:none}
.page-nav-link{display:flex;align-items:center;gap:6px;padding:8px 14px;border-radius:8px;font-size:.82rem;font-weight:500;color:rgba(255,255,255,.5);text-decoration:none;white-space:nowrap;transition:all .25s ease}
.page-nav-link:hover{color:#fff;background:rgba(99,102,241,.1)}
.page-nav-link.active{color:#fff;background:linear-gradient(135deg,#6366f1,#a855f7);box-shadow:0 2px 12px rgba(99,102,241,.35);font-weight:600}
.page-hero{padding:40px 24px 32px;text-align:center}
.page-hero-content{max-width:680px;margin:0 auto}
.page-hero .eng-hero-badge{display:inline-flex;align-items:center;gap:8px;padding:8px 18px;background:rgba(99,102,241,.12);border:1px solid rgba(99,102,241,.25);border-radius:100px;font-size:.85rem;font-weight:600;color:#a5b4fc;margin-bottom:16px}
.page-hero .eng-hero-title{font-size:clamp(1.8rem,4vw,2.6rem);font-weight:800;line-height:1.15;margin-bottom:12px;color:#fff}
.page-hero .eng-hero-accent{background:linear-gradient(135deg,#6366f1,#a855f7,#ec4899);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}
.page-hero .eng-hero-subtitle{font-size:1rem;line-height:1.6;color:rgba(255,255,255,.6);max-width:600px;margin:0 auto}
a.logo{text-decoration:none;color:inherit}
.eng-calc-detail,#converter-detail,#fin-detail,#health-detail,#prog-detail{display:none}
#converter-categories,#fin-tabs{display:none}

/* ── RESPONSIVE: TABLET (≤ 900px) ───────────────────────────── */
@media (max-width:900px) {
  .container { padding: 28px 20px; }
  .hero { padding: 48px 20px 40px; }
  .hero h1 { font-size: 2rem; }
  .calc-widget { padding: 24px 20px; }
  .section { padding: 24px 20px; }
  .cable-cta-widget { padding: 30px 20px; }
  .calc-grid { grid-template-columns: 1fr 1fr; }
  .result-grid { grid-template-columns: 1fr 1fr; }
  .stat { padding: 12px 16px; }
  .page-nav { max-width: calc(100vw - 280px); }
  .header-center { order: 3; flex-basis: 100%; margin-top: 8px; }
  .page-nav { max-width: 100%; justify-content: flex-start; }
  .page-nav-link { padding: 6px 10px; font-size: .75rem; }
}

/* ── RESPONSIVE: MOBILE (≤ 600px) ───────────────────────────── */
@media (max-width:600px) {
  body { font-size: 15px; }

  .nav { padding: 0 16px; height: 56px; }
  .nav-logo { font-size: 1.1rem; }
  .nav-cta { padding: 7px 13px; font-size: .8rem; }

  .hero { padding: 36px 16px 32px; }
  .hero h1 { font-size: 1.65rem; letter-spacing: -.5px; }
  .hero > p { font-size: .95rem; }
  .hero-btns { flex-direction: column; align-items: stretch; gap: 10px; }
  .hero-btns .btn-primary,
  .hero-btns .btn-secondary { text-align: center; justify-content: center; }
  .hero-tags { gap: 6px; }
  .hero-tag { font-size: .75rem; padding: 4px 10px; }

  .container { padding: 20px 16px; }

  .calc-widget { padding: 20px 16px; border-radius: 12px; }
  .calc-widget h2 { font-size: 1.15rem; }
  .calc-grid { grid-template-columns: 1fr; }
  .result-grid { grid-template-columns: 1fr 1fr; }

  .field input,
  .field select { font-size: 16px; } /* prevent iOS zoom */

  .section { padding: 20px 16px; border-radius: 10px; }
  .section h2 { font-size: 1.15rem; }

  .formula { font-size: .92rem; padding: 13px 14px; }

  table th, table td { padding: 9px 10px; font-size: .82rem; }

  .cable-cta-widget { padding: 24px 16px; }
  .cable-cta-widget h2 { font-size: 1.2rem; }

  .seo-links { padding: 20px 16px; }
  .seo-links ul { grid-template-columns: 1fr 1fr; }

  .stats { flex-wrap: wrap; }
  .stat { min-width: 50%; border-right: none; border-bottom: 1px solid rgba(99,102,241,.1); }
  .stat:last-child { border-bottom: none; }

  footer { padding: 24px 16px; }

  .faq-q { padding: 14px 16px; min-height: 52px; }
  .faq-a { padding: 0 16px 14px; }

  .btn-primary,
  .btn-secondary { font-size: .85rem; padding: 12px 20px; min-height: 48px; }

  .page-hero { padding: 24px 16px 20px; }
  .page-hero .eng-hero-title { font-size: 1.6rem; }
  .page-hero .eng-hero-subtitle { font-size: .9rem; }
  .page-nav-link { padding: 5px 8px; font-size: .72rem; }
}

/* ── LANDSCAPE MOBILE ────────────────────────────────────────── */
@media (max-width:900px) and (orientation:landscape) {
  .hero { padding: 32px 24px 28px; }
  .hero h1 { font-size: 1.75rem; }
  .calc-grid { grid-template-columns: 1fr 1fr; }
}

/* ── ACCESSIBILITY ───────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid #6366f1;
  outline-offset: 3px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ── PRINT ───────────────────────────────────────────────────── */
@media print {
  .nav, .hero-btns, .calc-actions, .cable-cta-widget { display: none; }
  body { background: #fff; color: #000; }
  .section { border: 1px solid #ccc; }
  .calc-widget { border: 1px solid #ccc; background: #f9f9f9; }
}

/* ── SIDEBAR LAYOUT ──────────────────────────────────────────── */
.page-layout {
  max-width: 1180px;
  margin: 0 auto;
  padding: 40px 24px;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 28px;
  align-items: start;
}

.page-main { min-width: 0; }

/* Override .container padding when inside .page-layout */
.page-layout .container {
  max-width: 100%;
  padding: 0;
}

/* Popular Calculators Sidebar */
.popular-sidebar {
  position: sticky;
  top: 80px;
  background: rgba(25,25,64,.6);
  border: 1px solid rgba(99,102,241,.25);
  border-radius: 14px;
  padding: 20px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.popular-sidebar h3 {
  font-size: .9rem;
  font-weight: 700;
  color: #f1f5f9;
  text-transform: uppercase;
  letter-spacing: .6px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(99,102,241,.25);
  display: flex;
  align-items: center;
  gap: 7px;
}

.popular-sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.popular-sidebar ul li a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  color: #94a3b8;
  text-decoration: none;
  font-size: .83rem;
  font-weight: 500;
  transition: background .2s, color .2s;
  line-height: 1.3;
}

.popular-sidebar ul li a:hover {
  background: rgba(99,102,241,.12);
  color: #c4b5fd;
}

.popular-sidebar ul li a.active {
  background: rgba(99,102,241,.18);
  color: #a78bfa;
  font-weight: 600;
}

.popular-sidebar ul li a .calc-icon {
  font-size: 1rem;
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}

.popular-sidebar .sidebar-footer {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(99,102,241,.2);
  font-size: .76rem;
  color: #475569;
  line-height: 1.6;
}

.popular-sidebar .sidebar-footer a {
  color: #6366f1;
  text-decoration: none;
}

.popular-sidebar .sidebar-footer a:hover { color: #a78bfa; }

/* ── SIDEBAR RESPONSIVE ──────────────────────────────────────── */
@media (max-width: 900px) {
  .page-layout {
    grid-template-columns: 1fr;
    padding: 20px 16px;
    gap: 20px;
  }

  .popular-sidebar {
    position: static;
    order: 2; /* sidebar goes below content on mobile */
  }

  .popular-sidebar ul {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
  }
}

@media (max-width: 500px) {
  .popular-sidebar ul { grid-template-columns: 1fr; }
}
