/* ============================================================
   CalculiX Pro — Main Stylesheet
   assets/css/style.css
   Light & Dark theme via CSS custom properties
   ============================================================ */

/* ── THEME VARIABLES ─────────────────────────────────────────── */
:root, [data-theme="light"] {
  --bg-page:        #F6F8FC;
  --bg-surface:     #FFFFFF;
  --bg-surface-2:   #F0F3F9;
  --bg-surface-3:   #E8EDF5;
  --border:         #DDE3EE;
  --border-focus:   #4F7BF7;
  --border-strong:  #C5CEDF;
  --text-h:         #0D1117;
  --text-body:      #374151;
  --text-muted:     #6B7280;
  --text-light:     #9CA3AF;
  --shadow-sm:      0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:      0 4px 16px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
  --shadow-lg:      0 12px 40px rgba(0,0,0,0.12), 0 4px 12px rgba(0,0,0,0.06);
  --shadow-panel:   0 -8px 60px rgba(0,0,0,0.15);
  --shadow-card:    0 8px 32px rgba(79,123,247,0.12), 0 2px 8px rgba(0,0,0,0.06);
  --accent:         #4F7BF7;
  --accent-hover:   #3B63DC;
  --accent-bg:      #EEF2FF;
  --accent-border:  rgba(79,123,247,0.2);
  --gold:           #C27B2C;
  --gold-bg:        #FEF3E2;
  --gold-border:    rgba(194,123,44,0.2);
  --emerald:        #059669;
  --emerald-bg:     #ECFDF5;
  --emerald-border: rgba(5,150,105,0.2);
  --ruby:           #DC2626;
  --ruby-bg:        #FEF2F2;
  --ruby-border:    rgba(220,38,38,0.2);
  --sapphire:       #0891B2;
  --sapphire-bg:    #ECFEFF;
  --violet:         #7C3AED;
  --violet-bg:      #F5F3FF;
  --violet-border:  rgba(124,58,237,0.2);
  --nav-bg:         rgba(255,255,255,0.92);
  --nav-border:     rgba(221,227,238,0.8);
}

[data-theme="dark"] {
  --bg-page:        #0C0E14;
  --bg-surface:     #13161E;
  --bg-surface-2:   #1A1E28;
  --bg-surface-3:   #222636;
  --border:         rgba(255,255,255,0.08);
  --border-focus:   #6B96FF;
  --border-strong:  rgba(255,255,255,0.15);
  --text-h:         #F1F3F9;
  --text-body:      #B8BFCC;
  --text-muted:     #7A8294;
  --text-light:     #4A5168;
  --shadow-sm:      0 1px 3px rgba(0,0,0,0.4);
  --shadow-md:      0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg:      0 12px 40px rgba(0,0,0,0.6);
  --shadow-panel:   0 -8px 60px rgba(0,0,0,0.6);
  --shadow-card:    0 8px 32px rgba(107,150,255,0.12);
  --accent:         #6B96FF;
  --accent-hover:   #8AABFF;
  --accent-bg:      rgba(107,150,255,0.12);
  --accent-border:  rgba(107,150,255,0.25);
  --gold:           #E8A83A;
  --gold-bg:        rgba(232,168,58,0.12);
  --gold-border:    rgba(232,168,58,0.25);
  --emerald:        #34D399;
  --emerald-bg:     rgba(52,211,153,0.1);
  --emerald-border: rgba(52,211,153,0.25);
  --ruby:           #F87171;
  --ruby-bg:        rgba(248,113,113,0.1);
  --ruby-border:    rgba(248,113,113,0.25);
  --sapphire:       #38BDF8;
  --sapphire-bg:    rgba(56,189,248,0.1);
  --violet:         #A78BFA;
  --violet-bg:      rgba(167,139,250,0.1);
  --violet-border:  rgba(167,139,250,0.25);
  --nav-bg:         rgba(19,22,30,0.95);
  --nav-border:     rgba(255,255,255,0.06);
}

/* ── RESET & BASE ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background: var(--bg-page);
  color: var(--text-body);
  line-height: 1.6;
  transition: background 0.25s ease, color 0.25s ease;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4, h5, h6 { color: var(--text-h); font-weight: 700; line-height: 1.25; }
a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; height: auto; display: block; }
main { flex: 1; }

/* ── LAYOUT ──────────────────────────────────────────────────── */
.container        { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 800px;  margin: 0 auto; padding: 0 24px; }

/* ── SCROLLBAR ───────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; }

/* ══════════════════════════════════════════════════════════════
   NAVBAR
   ══════════════════════════════════════════════════════════════ */
.navbar {
  position: sticky; top: 0; z-index: 200;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--nav-border);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  transition: background 0.25s, border-color 0.25s;
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; max-width: 1200px; margin: 0 auto;
  padding: 0 24px; gap: 20px;
}
.nav-logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; flex-shrink: 0;
}
.nav-logo-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--violet) 100%);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.nav-logo-text { font-size: 1.1rem; font-weight: 800; color: var(--text-h); letter-spacing: -0.02em; }
.nav-logo-text span { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 2px; flex: 1; justify-content: center; }
.nav-link {
  font-size: 0.875rem; font-weight: 500; color: var(--text-muted);
  padding: 6px 14px; border-radius: 8px;
  transition: all 0.2s; cursor: pointer; text-decoration: none;
  background: none; border: none; font-family: inherit;
  white-space: nowrap;
}
.nav-link:hover, .nav-link.active { color: var(--text-h); background: var(--bg-surface-2); }
.nav-link.active { color: var(--accent); }
.nav-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* Theme Toggle */
.theme-toggle {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-surface-2); border: 1px solid var(--border);
  border-radius: 99px; padding: 4px 12px 4px 8px;
  cursor: pointer; transition: all 0.2s;
  font-size: 0.78rem; font-weight: 600; color: var(--text-muted);
  font-family: inherit;
}
.theme-toggle:hover { border-color: var(--border-focus); color: var(--text-h); }
.toggle-track {
  width: 36px; height: 20px; border-radius: 99px;
  background: var(--bg-surface-3); border: 1px solid var(--border);
  position: relative; transition: background 0.25s; flex-shrink: 0;
}
[data-theme="dark"] .toggle-track { background: var(--accent); border-color: var(--accent); }
.toggle-thumb {
  position: absolute; width: 14px; height: 14px; border-radius: 50%;
  background: #fff; top: 2px; left: 2px;
  transition: transform 0.25s cubic-bezier(0.4,0,0.2,1);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
[data-theme="dark"] .toggle-thumb { transform: translateX(16px); }

/* Hamburger */
.hamburger {
  display: none; flex-direction: column; gap: 5px; cursor: pointer;
  padding: 6px; border-radius: 8px; border: 1px solid var(--border);
  background: none; transition: background 0.2s;
}
.hamburger:hover { background: var(--bg-surface-2); }
.hamburger span {
  display: block; width: 18px; height: 2px;
  background: var(--text-muted); border-radius: 2px; transition: all 0.3s;
}
.hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* Mobile Nav Drawer */
.nav-drawer {
  display: none; flex-direction: column; gap: 4px;
  padding: 12px 24px 16px;
  border-top: 1px solid var(--border);
  background: var(--nav-bg);
}
.nav-drawer.open { display: flex; }
.nav-drawer .nav-link { text-align: left; padding: 10px 14px; font-size: 0.95rem; }

/* ══════════════════════════════════════════════════════════════
   HERO SECTION (Homepage)
   ══════════════════════════════════════════════════════════════ */
.hero-section {
  padding: 72px 0 56px; text-align: center; position: relative; overflow: hidden;
}
.hero-section::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse 70% 60% at 50% 0%,
    rgba(79,123,247,0.08) 0%, transparent 70%);
  pointer-events: none;
}
[data-theme="dark"] .hero-section::before {
  background: radial-gradient(ellipse 70% 60% at 50% 0%,
    rgba(107,150,255,0.1) 0%, transparent 70%);
}
.hero-inner { position: relative; z-index: 1; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent-bg); border: 1px solid var(--accent-border);
  color: var(--accent); padding: 5px 14px; border-radius: 99px;
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.02em; margin-bottom: 20px;
}
.hero-section h1 {
  font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; letter-spacing: -0.03em;
  line-height: 1.15; margin-bottom: 16px;
}
.highlight {
  background: linear-gradient(135deg, var(--accent), var(--violet));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-desc {
  font-size: 1.05rem; color: var(--text-muted);
  max-width: 540px; margin: 0 auto 32px; line-height: 1.7;
}
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ══════════════════════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════════════════════ */
.btn-primary {
  background: var(--accent); color: #fff; border: none;
  padding: 11px 24px; border-radius: 10px;
  font-size: 0.9rem; font-weight: 600; cursor: pointer;
  transition: all 0.2s; box-shadow: 0 4px 14px rgba(79,123,247,0.3);
  display: inline-flex; align-items: center; gap: 8px;
  font-family: inherit; text-decoration: none;
}
.btn-primary:hover {
  background: var(--accent-hover); transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(79,123,247,0.4); color: #fff;
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--bg-surface); color: var(--text-h);
  border: 1px solid var(--border); padding: 11px 24px; border-radius: 10px;
  font-size: 0.9rem; font-weight: 600; cursor: pointer;
  transition: all 0.2s; display: inline-flex; align-items: center; gap: 8px;
  font-family: inherit; text-decoration: none; box-shadow: var(--shadow-sm);
}
.btn-secondary:hover {
  border-color: var(--border-focus); transform: translateY(-1px);
  box-shadow: var(--shadow-md); color: var(--text-h);
}

/* ══════════════════════════════════════════════════════════════
   SECTION HEADERS
   ══════════════════════════════════════════════════════════════ */
.calcs-section { padding: 48px 0 0; }
.section-header { margin-bottom: 32px; }
.section-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 10px;
}
.section-header h2 {
  font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 800;
  letter-spacing: -0.02em; margin-bottom: 10px;
}
.section-header p { color: var(--text-muted); max-width: 520px; font-size: 0.95rem; }

/* ══════════════════════════════════════════════════════════════
   BENTO GRID
   ══════════════════════════════════════════════════════════════ */
.bento-grid {
  display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px;
  padding-bottom: 48px;
}
.col-3  { grid-column: span 3; }
.col-4  { grid-column: span 4; }
.col-6  { grid-column: span 6; }
.col-8  { grid-column: span 8; }
.col-12 { grid-column: span 12; }

/* Responsive grid breakpoints */
@media (max-width: 1100px) {
  .col-3 { grid-column: span 4; }
  .col-4 { grid-column: span 6; }
}
@media (max-width: 860px) {
  .col-3, .col-4, .col-6, .col-8 { grid-column: span 6; }
}
@media (max-width: 560px) {
  .bento-grid { gap: 12px; }
  .col-3, .col-4, .col-6, .col-8, .col-12 { grid-column: span 12; }
}

/* ══════════════════════════════════════════════════════════════
   CALCULATOR CARDS
   ══════════════════════════════════════════════════════════════ */
.calc-card {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: 18px; padding: 26px; cursor: pointer;
  min-height: 190px; display: flex; flex-direction: column;
  justify-content: space-between;
  transition: transform 0.25s cubic-bezier(0.4,0,0.2,1),
              box-shadow 0.25s, border-color 0.25s;
  box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.calc-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  border-radius: 18px 18px 0 0; opacity: 0; transition: opacity 0.25s;
}
.calc-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-card); border-color: transparent; }
.calc-card:hover::before { opacity: 1; }
.calc-card:active { transform: translateY(-1px); }
.calc-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Accent border colors */
.accent-gold::before    { background: linear-gradient(90deg, var(--gold),    #F59E0B); }
.accent-green::before   { background: linear-gradient(90deg, var(--emerald), #10B981); }
.accent-blue::before    { background: linear-gradient(90deg, var(--accent),  var(--violet)); }
.accent-red::before     { background: linear-gradient(90deg, var(--ruby),    #F97316); }
.accent-violet::before  { background: linear-gradient(90deg, var(--violet),  #EC4899); }

/* Card icon */
.card-icon-wrap {
  width: 46px; height: 46px; border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 18px; flex-shrink: 0;
  transition: transform 0.25s;
}
.calc-card:hover .card-icon-wrap { transform: scale(1.08); }
.icon-gold    { background: var(--gold-bg);    color: var(--gold);    }
.icon-green   { background: var(--emerald-bg); color: var(--emerald); }
.icon-blue    { background: var(--accent-bg);  color: var(--accent);  }
.icon-red     { background: var(--ruby-bg);    color: var(--ruby);    }
.icon-violet  { background: var(--violet-bg);  color: var(--violet);  }

.card-title   { font-size: 1.05rem; font-weight: 700; color: var(--text-h); margin-bottom: 6px; line-height: 1.3; }
.card-desc    { font-size: 0.82rem; color: var(--text-muted); line-height: 1.55; flex: 1; }
.card-footer  { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.03em;
  padding: 3px 10px; border-radius: 99px; text-transform: uppercase;
}
.badge-gold    { background: var(--gold-bg);    color: var(--gold);    border: 1px solid var(--gold-border);    }
.badge-green   { background: var(--emerald-bg); color: var(--emerald); border: 1px solid var(--emerald-border); }
.badge-blue    { background: var(--accent-bg);  color: var(--accent);  border: 1px solid var(--accent-border);  }
.badge-red     { background: var(--ruby-bg);    color: var(--ruby);    border: 1px solid var(--ruby-border);    }
.badge-violet  { background: var(--violet-bg);  color: var(--violet);  border: 1px solid var(--violet-border);  }

.card-arrow { color: var(--text-light); transition: transform 0.25s, color 0.25s; flex-shrink: 0; }
.calc-card:hover .card-arrow { transform: translate(3px,-3px); color: var(--accent); }

/* ══════════════════════════════════════════════════════════════
   ADSENSE / AD SLOTS
   ══════════════════════════════════════════════════════════════ */
.ad-banner {
  background: var(--bg-surface); border: 1px dashed var(--border);
  border-radius: 12px; margin: 28px 0; min-height: 90px;
  display: flex; align-items: center; justify-content: center;
}
.ad-placeholder {
  text-align: center; padding: 20px;
}
.ad-placeholder span {
  font-size: 0.72rem; color: var(--text-light);
  letter-spacing: 0.08em; text-transform: uppercase;
}

/* ══════════════════════════════════════════════════════════════
   PANEL / DRAWER SYSTEM
   ══════════════════════════════════════════════════════════════ */
.overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(6px);
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s;
  display: flex; align-items: flex-end; justify-content: center;
}
.overlay.active { opacity: 1; pointer-events: all; }

.panel {
  width: 100%; max-width: 1140px; max-height: 91vh;
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: 24px 24px 0 0;
  box-shadow: var(--shadow-panel);
  overflow: hidden;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
  display: flex; flex-direction: column;
}
.overlay.active .panel { transform: translateY(0); }

.panel-drag {
  width: 40px; height: 4px; border-radius: 2px;
  background: var(--border-strong); margin: 12px auto 0; flex-shrink: 0;
}

.panel-hdr {
  padding: 16px 28px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0; gap: 16px; flex-wrap: wrap;
}
.panel-hdr-left  { display: flex; align-items: center; gap: 12px; }
.panel-hdr-icon  { width: 40px; height: 40px; border-radius: 11px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.panel-title     { font-size: 1.1rem; font-weight: 700; color: var(--text-h); }
.panel-subtitle  { font-size: 0.75rem; color: var(--text-muted); margin-top: 1px; }
.panel-actions   { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.panel-body {
  display: grid; grid-template-columns: 360px 1fr;
  flex: 1; overflow: hidden;
}
.panel-inputs {
  padding: 24px 28px;
  border-right: 1px solid var(--border);
  overflow-y: auto;
}
.panel-output {
  padding: 24px 28px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 14px;
  background: var(--bg-page);
}

@media (max-width: 820px) {
  .panel-body { grid-template-columns: 1fr; overflow-y: auto; }
  .panel-inputs { border-right: none; border-bottom: 1px solid var(--border); }
  .panel-output { background: var(--bg-surface); }
}

/* Panel buttons */
.btn-panel {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 8px;
  font-size: 0.8rem; font-weight: 600; cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-surface-2); color: var(--text-muted);
  transition: all 0.2s; font-family: inherit; white-space: nowrap;
}
.btn-panel:hover { border-color: var(--border-focus); color: var(--text-h); }
.btn-panel-primary {
  background: var(--accent); color: #fff; border-color: transparent;
  box-shadow: 0 2px 8px rgba(79,123,247,0.25);
}
.btn-panel-primary:hover { background: var(--accent-hover); color: #fff; }
.btn-icon {
  width: 36px; height: 36px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; border: 1px solid var(--border);
  background: var(--bg-surface-2); color: var(--text-muted);
  transition: all 0.2s;
}
.btn-icon:hover { border-color: var(--ruby-border); color: var(--ruby); background: var(--ruby-bg); }

/* Panel AdSense slot */
.panel-ad-slot {
  background: var(--bg-surface-2); border: 1px dashed var(--border);
  border-radius: 10px; padding: 14px; text-align: center;
  font-size: 0.7rem; color: var(--text-light); letter-spacing: 0.08em; text-transform: uppercase;
}

/* ══════════════════════════════════════════════════════════════
   FORM ELEMENTS
   ══════════════════════════════════════════════════════════════ */
.form-group { margin-bottom: 18px; }
.form-label {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.78rem; font-weight: 600; color: var(--text-muted);
  margin-bottom: 7px; letter-spacing: 0.01em;
}
.form-label-val {
  color: var(--accent);
  font-family: 'JetBrains Mono', monospace; font-weight: 500;
}
.form-input {
  width: 100%; padding: 10px 14px;
  background: var(--bg-surface-2); border: 1px solid var(--border);
  border-radius: 9px; color: var(--text-h);
  font-size: 0.95rem; font-family: inherit;
  transition: all 0.2s; outline: none;
}
.form-input:focus {
  border-color: var(--border-focus); background: var(--bg-surface);
  box-shadow: 0 0 0 3px rgba(79,123,247,0.1);
}
.form-input::placeholder { color: var(--text-light); }
textarea.form-input { resize: vertical; min-height: 100px; line-height: 1.6; }
.form-select {
  width: 100%; padding: 10px 14px;
  background: var(--bg-surface-2); border: 1px solid var(--border);
  border-radius: 9px; color: var(--text-h);
  font-size: 0.9rem; font-family: inherit;
  appearance: none; cursor: pointer; outline: none; transition: all 0.2s;
}
.form-select:focus { border-color: var(--border-focus); box-shadow: 0 0 0 3px rgba(79,123,247,0.1); }
.form-select option { background: var(--bg-surface); color: var(--text-h); }
.form-range {
  width: 100%; height: 5px; border-radius: 99px; cursor: pointer;
  accent-color: var(--accent); background: var(--bg-surface-3);
  appearance: none; outline: none; margin-top: 4px;
}
.form-range::-webkit-slider-thumb {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent); appearance: none;
  box-shadow: 0 0 0 3px rgba(79,123,247,0.2); cursor: pointer;
}

/* ══════════════════════════════════════════════════════════════
   RESULT CARDS (panel output)
   ══════════════════════════════════════════════════════════════ */
.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.result-card {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: 13px; padding: 16px 18px; transition: border-color 0.2s;
}
.result-label {
  font-size: 0.7rem; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 7px;
}
.result-val {
  font-size: 1.6rem; font-weight: 800; color: var(--text-h);
  line-height: 1; font-family: 'JetBrains Mono', monospace;
}
.result-val.accent  { color: var(--accent);  }
.result-val.gold    { color: var(--gold);    }
.result-val.green   { color: var(--emerald); }
.result-val.red     { color: var(--ruby);    }
.result-sub { font-size: 0.73rem; color: var(--text-muted); margin-top: 5px; line-height: 1.4; }
.result-full { grid-column: span 2; }

/* Chart box */
.chart-box {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: 13px; padding: 18px;
}
.chart-box-title {
  font-size: 0.78rem; font-weight: 700; color: var(--text-muted);
  margin-bottom: 14px; text-transform: uppercase; letter-spacing: 0.05em;
}
.chart-wrap { position: relative; height: 220px; }

/* Progress bar */
.prog-wrap  { height: 7px; background: var(--bg-surface-3); border-radius: 99px; overflow: hidden; }
.prog-fill  { height: 100%; border-radius: 99px; transition: width 0.5s cubic-bezier(0.4,0,0.2,1); }

/* Macro bars */
.macro-row  { margin-bottom: 16px; }
.macro-hdr  { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 0.82rem; }
.macro-lbl  { font-weight: 600; color: var(--text-h); }
.macro-meta { font-family: 'JetBrains Mono', monospace; color: var(--text-muted); font-size: 0.75rem; }

/* Milestone */
.milestone-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.milestone-row:last-child { border-bottom: none; }
.m-dot   { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.m-label { flex: 1; font-size: 0.83rem; color: var(--text-body); }
.m-val   { font-size: 0.82rem; font-weight: 700; font-family: 'JetBrains Mono', monospace; }

/* Dynamic rows (debt / subscription) */
.dynamic-row { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.add-row-btn {
  width: 100%; padding: 9px; border: 1px dashed var(--border);
  border-radius: 9px; background: none; color: var(--text-muted);
  font-size: 0.83rem; font-weight: 600; cursor: pointer;
  transition: all 0.2s; display: flex; align-items: center;
  justify-content: center; gap: 6px; font-family: inherit; margin-bottom: 16px;
}
.add-row-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-bg); }
.remove-btn {
  flex-shrink: 0; width: 32px; height: 32px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--bg-surface-2);
  color: var(--text-light); cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: all 0.2s;
}
.remove-btn:hover { border-color: var(--ruby-border); color: var(--ruby); background: var(--ruby-bg); }

/* Data table */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.78rem; }
.data-table th {
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--text-muted);
  padding: 10px 12px; border-bottom: 2px solid var(--border); text-align: left;
}
.data-table td {
  padding: 9px 12px; border-bottom: 1px solid var(--border);
  color: var(--text-body); font-family: 'JetBrains Mono', monospace; font-size: 0.78rem;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg-surface-2); }

/* ══════════════════════════════════════════════════════════════
   SEO ARTICLE
   ══════════════════════════════════════════════════════════════ */
.article-section { padding: 48px 0; }
.seo-article { max-width: 100%; }
.article-header { margin-bottom: 32px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.article-tag {
  display: inline-block; font-size: 0.72rem; font-weight: 700;
  color: var(--accent); text-transform: uppercase; letter-spacing: 0.08em;
  background: var(--accent-bg); padding: 4px 12px; border-radius: 99px;
  margin-bottom: 12px; border: 1px solid var(--accent-border);
}
.article-header h2 {
  font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 800;
  letter-spacing: -0.02em; margin-bottom: 10px; line-height: 1.2;
}
.article-meta {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 0.82rem; color: var(--text-muted);
}
.article-body { line-height: 1.78; }
.article-lead {
  font-size: 1.05rem; color: var(--text-body); line-height: 1.75;
  margin-bottom: 28px; font-weight: 500;
}
.article-body h3 {
  font-size: 1.15rem; font-weight: 700; color: var(--text-h);
  margin: 32px 0 12px; letter-spacing: -0.01em;
}
.article-body p { color: var(--text-body); margin-bottom: 16px; font-size: 0.96rem; }
.article-body strong { color: var(--text-h); font-weight: 700; }
.article-body a { color: var(--accent); }
.article-body a:hover { text-decoration: underline; }

/* FAQ */
.faq-section { margin-top: 40px; padding-top: 32px; border-top: 1px solid var(--border); }
.faq-section h3 { font-size: 1.2rem; font-weight: 800; margin-bottom: 20px; }
.faq-item { margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.faq-item:last-child { border-bottom: none; }
.faq-item h4 { font-size: 0.95rem; font-weight: 700; color: var(--text-h); margin-bottom: 8px; }
.faq-item p { font-size: 0.88rem; color: var(--text-muted); line-height: 1.7; }

/* ══════════════════════════════════════════════════════════════
   STATIC PAGES (About, Contact, Legal)
   ══════════════════════════════════════════════════════════════ */
.static-page { padding-bottom: 80px; }
.page-hero {
  padding: 56px 0 40px; border-bottom: 1px solid var(--border); margin-bottom: 40px;
}
.page-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--accent);
  background: var(--accent-bg); padding: 4px 12px; border-radius: 99px;
  border: 1px solid var(--accent-border); margin-bottom: 14px;
}
.page-hero h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 800; letter-spacing: -0.03em; margin-bottom: 10px; }
.page-hero p  { color: var(--text-muted); max-width: 520px; font-size: 0.95rem; }

/* Prose (legal pages) */
.prose h2 { font-size: 1.2rem; font-weight: 700; margin: 32px 0 10px; }
.prose h3 { font-size: 1.05rem; font-weight: 700; margin: 24px 0 8px; }
.prose p  { color: var(--text-body); line-height: 1.75; margin-bottom: 14px; font-size: 0.94rem; }
.prose a  { color: var(--accent); }

/* About page */
.about-mission-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; margin-bottom: 48px; }
.about-mission-grid h2 { font-size: 1.3rem; font-weight: 800; margin-bottom: 14px; }
.about-mission-grid p  { color: var(--text-muted); line-height: 1.7; margin-bottom: 12px; font-size: 0.94rem; }
.about-stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat-box {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 22px; text-align: center;
}
.stat-num { font-size: 2rem; font-weight: 800; color: var(--accent); font-family: 'JetBrains Mono', monospace; }
.stat-lbl { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 14px; margin-bottom: 32px; }
.feature-card { background: var(--bg-surface); border: 1px solid var(--border); border-radius: 14px; padding: 22px; }
.fc-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.feature-card h4 { font-size: 0.95rem; font-weight: 700; color: var(--text-h); margin-bottom: 6px; }
.feature-card p  { font-size: 0.82rem; color: var(--text-muted); line-height: 1.6; }

/* Contact page */
.contact-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 48px; align-items: start; }
.contact-info-item { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 22px; }
.ci-icon { width: 42px; height: 42px; border-radius: 11px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.contact-info-item strong { display: block; font-weight: 700; color: var(--text-h); margin-bottom: 3px; font-size: 0.9rem; }
.contact-info-item p { color: var(--text-muted); font-size: 0.85rem; }
.contact-info-item span { color: var(--text-light); font-size: 0.78rem; }
.privacy-note-box { background: var(--accent-bg); border: 1px solid var(--accent-border); border-radius: 12px; padding: 16px 18px; margin-top: 8px; }
.privacy-note-box strong { display: block; font-size: 0.82rem; color: var(--accent); margin-bottom: 5px; }
.privacy-note-box p { font-size: 0.82rem; color: var(--text-muted); line-height: 1.6; }
.contact-form-card { background: var(--bg-surface); border: 1px solid var(--border); border-radius: 16px; padding: 28px; box-shadow: var(--shadow-md); }
.success-box { background: var(--emerald-bg); border: 1px solid var(--emerald-border); border-radius: 8px; padding: 12px 16px; font-size: 0.85rem; color: var(--emerald); margin-bottom: 16px; font-weight: 600; }
.error-box   { background: var(--ruby-bg);    border: 1px solid var(--ruby-border);    border-radius: 8px; padding: 12px 16px; font-size: 0.85rem; color: var(--ruby);    margin-bottom: 16px; font-weight: 500; }

/* Calculator dedicated page hero */
.calc-hero-section { padding: 40px 0 32px; border-bottom: 1px solid var(--border); margin-bottom: 0; }
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 20px; flex-wrap: wrap; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span[aria-hidden] { color: var(--text-light); }
.calc-hero-inner { display: flex; align-items: flex-start; gap: 20px; }
.calc-hero-icon { width: 60px; height: 60px; border-radius: 16px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.calc-hero-inner h1 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 800; letter-spacing: -0.02em; margin-bottom: 8px; }
.calc-hero-inner p  { color: var(--text-muted); font-size: 0.95rem; max-width: 520px; line-height: 1.65; }

/* ══════════════════════════════════════════════════════════════
   FOOTER
   ══════════════════════════════════════════════════════════════ */
.site-footer {
  background: var(--bg-surface); border-top: 1px solid var(--border);
  padding: 52px 0 28px; margin-top: auto;
}
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1.2fr;
  gap: 40px; margin-bottom: 40px;
}
.footer-logo-wrap { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; text-decoration: none; }
.footer-logo-icon { width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, var(--accent), var(--violet)); display: flex; align-items: center; justify-content: center; }
.footer-logo-text { font-size: 1.05rem; font-weight: 800; color: var(--text-h); letter-spacing: -0.02em; }
.footer-brand p { font-size: 0.85rem; color: var(--text-muted); line-height: 1.65; max-width: 240px; margin-bottom: 12px; }
.footer-disclaimer { font-size: 0.73rem; color: var(--text-light); margin-top: 12px; line-height: 1.55; }
.footer-col h4 { font-size: 0.78rem; font-weight: 700; color: var(--text-h); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 14px; }
.footer-links { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.footer-links li a, .footer-links li button {
  font-size: 0.84rem; color: var(--text-muted);
  background: none; border: none; cursor: pointer;
  transition: color 0.2s; font-family: inherit; text-align: left;
  padding: 0; text-decoration: none;
}
.footer-links li a:hover, .footer-links li button:hover { color: var(--accent); }
.footer-social { display: flex; gap: 8px; }
.social-btn {
  width: 34px; height: 34px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--bg-surface-2);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); transition: all 0.2s; cursor: pointer; text-decoration: none;
}
.social-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-bg); }
.footer-privacy-badge {
  margin-top: 20px; padding: 14px; background: var(--accent-bg);
  border-radius: 10px; border: 1px solid var(--accent-border);
  display: flex; align-items: flex-start; gap: 10px;
}
.footer-privacy-badge svg { flex-shrink: 0; margin-top: 2px; color: var(--accent); }
.footer-privacy-badge strong { display: block; font-size: 0.75rem; color: var(--accent); font-weight: 700; margin-bottom: 3px; }
.footer-privacy-badge span { font-size: 0.74rem; color: var(--text-muted); line-height: 1.55; }
.footer-bottom {
  border-top: 1px solid var(--border); padding-top: 22px;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
}
.footer-bottom p { font-size: 0.78rem; color: var(--text-light); }

/* ══════════════════════════════════════════════════════════════
   TOAST NOTIFICATION
   ══════════════════════════════════════════════════════════════ */
.toast {
  position: fixed; bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: var(--bg-surface); border: 1px solid var(--border);
  padding: 12px 20px; border-radius: 12px; box-shadow: var(--shadow-lg);
  font-size: 0.85rem; color: var(--text-h); font-weight: 500;
  display: flex; align-items: center; gap: 10px;
  opacity: 0; pointer-events: none;
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
  z-index: 999; white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE MEDIA QUERIES
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .about-mission-grid { grid-template-columns: 1fr; gap: 32px; }
  .contact-grid { grid-template-columns: 1fr; gap: 32px; }
}
@media (max-width: 768px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .hero-section { padding: 48px 0 40px; }
  .panel-hdr { padding: 14px 20px; }
  .panel-inputs { padding: 20px; }
  .panel-output { padding: 20px; }
}
@media (max-width: 480px) {
  .nav-logo-text { display: none; }
  .theme-toggle span:not(.toggle-track):not(.toggle-thumb) { display: none; }
  .theme-toggle { padding: 4px 8px; }
  .result-grid { grid-template-columns: 1fr; }
  .result-full { grid-column: span 1; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .hero-section h1 { font-size: 1.8rem; }
  .panel-actions { gap: 6px; }
  .btn-panel span { display: none; }
}
