:root {
  --font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, "Noto Sans", "Noto Sans Thai", "Noto Sans Khmer", "Noto Sans Lao", "Noto Sans Myanmar", sans-serif;
  
  /* Light Mode Palette */
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-header: rgba(255, 255, 255, 0.92);
  --bg-tertiary: #f1f5f9;
  --bg-elevated: #ffffff;
  --bg-card: #ffffff;
  --bg-subtle: #f8fafc;
  --bg-overlay: rgba(15, 23, 42, 0.65);
  
  --border-subtle: #e2e8f0;
  --border-focus: #2563eb;
  --border-strong: #cbd5e1;

  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #526178;
  --text-inverse: #ffffff;

  --brand-primary: #1e3a8a;
  --brand-primary-hover: #172554;
  --brand-secondary: #1d4ed8;
  --brand-accent: #059669;
  --brand-accent-bg: #ecfdf5;
  --brand-accent-text: #065f46;

  --badge-bg: #eff6ff;
  --badge-text: #1d4ed8;

  --warning-bg: #fffbeb;
  --warning-border: #fde68a;
  --warning-text: #854d0e;

  --danger-bg: #fef2f2;
  --danger-border: #fecaca;
  --danger-text: #991b1b;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.04);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --max-w: 1200px;
  --header-height: 68px;
}

[data-theme="dark"] {
  /* Dark Mode Palette */
  --bg-primary: #0b1120;
  --bg-secondary: #111c33;
  --bg-header: rgba(17, 28, 51, 0.92);
  --bg-tertiary: #192744;
  --bg-elevated: #1a2642;
  --bg-card: #13223f;
  --bg-subtle: #0e172a;
  --bg-overlay: rgba(0, 0, 0, 0.82);

  --border-subtle: #253759;
  --border-focus: #3b82f6;
  --border-strong: #3b5078;

  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-inverse: #0b1120;

  --brand-primary: #3b82f6;
  --brand-primary-hover: #60a5fa;
  --brand-secondary: #60a5fa;
  --brand-accent: #34d399;
  --brand-accent-bg: rgba(16, 185, 129, 0.2);
  --brand-accent-text: #6ee7b7;

  --badge-bg: rgba(59, 130, 246, 0.22);
  --badge-text: #93c5fd;

  --warning-bg: rgba(245, 158, 11, 0.16);
  --warning-border: rgba(245, 158, 11, 0.45);
  --warning-text: #fde047;

  --danger-bg: rgba(239, 68, 68, 0.16);
  --danger-border: rgba(239, 68, 68, 0.45);
  --danger-text: #fca5a5;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.45);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.55);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  min-width: 0;
}

html {
  font-family: var(--font-family);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-color: var(--bg-primary);
  overflow-wrap: break-word;
  word-break: break-word;
}

a {
  color: var(--brand-secondary);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  text-decoration: underline;
}

img, svg {
  vertical-align: middle;
  max-width: 100%;
  height: auto;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
  max-width: 100%;
}

.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.page-container {
  padding-top: 2.5rem;
  padding-bottom: 4rem;
}

.page-container-sm {
  max-width: 820px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}

.page-container-404 {
  max-width: 640px;
  margin: 0 auto;
  padding: 5rem 1.25rem;
  text-align: center;
}

@media (max-width: 480px) {
  .container, .page-container-sm, .page-container-404 {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }
}

/* ==========================================================================
   HEADER & NAVIGATION (TWO-TIER: NAV BELOW LOGO)
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: var(--bg-header);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  transition: background-color 0.2s ease, border-color 0.2s ease;
  width: 100%;
}

/* Top Bar: Logo & Actions (Strictly Horizontal) */
.header-top-bar {
  padding: 0.65rem 0;
  width: 100%;
}

.header-top-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 0.75rem;
  min-height: 48px;
}

/* Brand Logo */
.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  flex-shrink: 0;
  white-space: nowrap;
  transition: transform 0.15s ease;
}

.brand-logo:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.brand-logo-img {
  height: 38px;
  width: auto;
  max-width: 190px;
  object-fit: contain;
  display: block;
  transition: opacity 0.2s ease;
}

[data-theme="dark"] .brand-logo-img {
  filter: brightness(1.2);
}

@media (max-width: 480px) {
  .brand-logo-img {
    height: 32px;
    max-width: 150px;
  }
}

/* Bottom Bar: Dedicated Nav Bar */
.header-nav-bar {
  display: none;
  border-top: 1px solid var(--border-subtle);
  background-color: var(--bg-subtle);
  padding: 0.35rem 0;
  width: 100%;
}

@media (min-width: 960px) {
  .header-nav-bar {
    display: block;
  }
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.nav-menu::-webkit-scrollbar {
  display: none;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-md);
  transition: all 0.15s ease;
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--brand-secondary);
  background-color: var(--bg-tertiary);
  text-decoration: none;
}

.nav-link.active {
  color: var(--brand-secondary);
  background-color: var(--badge-bg);
  text-decoration: none;
}

/* Header Actions (Strictly Horizontal on Same Line as Logo) */
.header-actions {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* Search Trigger Button */
.search-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.42rem 0.75rem;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.15s ease;
  height: 38px;
  flex-shrink: 0;
}

.search-trigger:hover {
  background-color: var(--bg-secondary);
  border-color: var(--border-focus);
  color: var(--text-primary);
}

.search-trigger-text {
  font-size: 0.85rem;
  display: none;
}

.search-kbd {
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 700;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  display: none;
}

@media (min-width: 1120px) {
  .search-trigger-text {
    display: inline;
  }
  .search-kbd {
    display: inline-block;
  }
}

/* Dropdowns in Header */
.header-select {
  width: auto;
  padding: 0.42rem 0.65rem;
  font-size: 0.85rem;
  font-weight: 500;
  max-width: 130px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
}

.header-select:hover {
  background-color: var(--bg-secondary);
  border-color: var(--border-strong);
}

@media (max-width: 768px) {
  .select-currency-wrap, .select-lang-wrap {
    display: none; /* Managed inside the mobile drawer */
  }
}

/* Theme Toggle Button */
.theme-toggle-btn {
  font-size: 1.1rem;
}

[data-theme="dark"] .theme-icon-moon { display: none; }
[data-theme="dark"] .theme-icon-sun { display: inline-block; }
:root:not([data-theme="dark"]) .theme-icon-sun { display: none; }
:root:not([data-theme="dark"]) .theme-icon-moon { display: inline-block; }

/* Mobile Menu Button */
.mobile-menu-btn {
  display: inline-flex;
}

@media (min-width: 1024px) {
  .mobile-menu-btn {
    display: none;
  }
}

/* ==========================================================================
   MOBILE DRAWER
   ========================================================================== */
.mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 85%;
  max-width: 320px;
  background-color: var(--bg-secondary);
  border-left: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-xl);
  z-index: 110;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  overflow-y: auto;
}

.mobile-drawer.open {
  transform: translateX(0);
}

.mobile-drawer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mobile-drawer-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.mobile-drawer-title {
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--text-primary);
}

.mobile-search-btn {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: left;
}

.mobile-search-btn:hover {
  background-color: var(--bg-secondary);
  border-color: var(--border-focus);
}

.mobile-drawer-divider {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: 0.25rem 0;
}

.mobile-drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.15s ease;
}

.mobile-nav-link:hover, .mobile-nav-link.active {
  background-color: var(--badge-bg);
  color: var(--brand-secondary);
  text-decoration: none;
}

.mobile-nav-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.mobile-drawer-settings {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.mobile-setting-item {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.mobile-drawer-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

/* ==========================================================================
   BUTTONS & BADGES
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  text-decoration: none;
  line-height: 1.25;
  text-align: center;
  white-space: nowrap;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background-color: var(--brand-primary);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--brand-primary-hover);
  color: #ffffff;
}

.btn-secondary {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

.btn-secondary:hover {
  background-color: var(--border-subtle);
}

.btn-outline {
  background-color: transparent;
  color: var(--brand-secondary);
  border-color: var(--brand-secondary);
}

.btn-outline:hover {
  background-color: var(--badge-bg);
}

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
}

.btn-lg {
  padding: 0.85rem 1.5rem;
  font-size: 1.05rem;
}

.btn-full {
  width: 100%;
}

@media (max-width: 480px) {
  .btn-lg {
    width: 100%;
    padding: 0.75rem 1.25rem;
    font-size: 0.95rem;
  }
}

.btn-icon {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: var(--radius-md);
  background-color: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.btn-icon:hover {
  color: var(--text-primary);
  background-color: var(--border-subtle);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: var(--radius-full);
  background-color: var(--badge-bg);
  color: var(--badge-text);
  line-height: 1.2;
}

.badge-emerald {
  background-color: var(--brand-accent-bg);
  color: var(--brand-accent-text);
}

.badge-danger {
  background-color: var(--danger-bg);
  color: var(--danger-text);
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */
.hero-section {
  padding: 3.5rem 0 2.5rem;
  background: radial-gradient(circle at 50% 0%, var(--bg-secondary) 0%, var(--bg-primary) 100%);
  border-bottom: 1px solid var(--border-subtle);
  text-align: center;
}

.hero-inner {
  max-width: 860px;
  margin: 0 auto;
}

.hero-title {
  font-size: clamp(1.85rem, 5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin: 1.25rem 0 1rem;
  color: var(--text-primary);
  overflow-wrap: break-word;
  word-break: break-word;
}

.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.15rem);
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 2rem;
  overflow-wrap: break-word;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.hero-disclaimer-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  line-height: 1.4;
  max-width: 100%;
}

/* ==========================================================================
   SECTIONS & GRIDS
   ========================================================================== */
.section {
  padding: 3.5rem 0;
}

.section-secondary {
  background-color: var(--bg-secondary);
}

.section-safety {
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.section-header {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 2.5rem;
}

.section-header-left {
  text-align: left;
  max-width: 100%;
  margin-bottom: 2.5rem;
}

.section-title {
  font-size: clamp(1.65rem, 4vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0.75rem 0 0.5rem;
  color: var(--text-primary);
  overflow-wrap: break-word;
}

.section-subtitle {
  font-size: clamp(0.95rem, 2vw, 1.05rem);
  color: var(--text-secondary);
  line-height: 1.6;
}

.grid-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .grid-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .grid-cards {
    grid-template-columns: repeat(3, 1fr);
  }
  .grid-cards.grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-focus);
}

.card-safety {
  border-top: 3px solid var(--brand-secondary);
}

.card-badge-wrap {
  margin-bottom: 0.75rem;
}

.card-icon-box {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background-color: var(--badge-bg);
  color: var(--badge-text);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  flex-shrink: 0;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.65rem;
  line-height: 1.35;
  overflow-wrap: break-word;
}

.card-title-sm {
  font-size: 1.1rem;
}

.card-text {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 1.5rem;
  flex-grow: 1;
  overflow-wrap: break-word;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
  margin-top: auto;
}

.card-action-link {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--brand-secondary);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.card-read-time {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.center-btn-wrap {
  text-align: center;
  margin-top: 2.5rem;
}

.steps-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .steps-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.step-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2rem;
  position: relative;
  display: flex;
  flex-direction: column;
}

.step-num {
  font-size: 2.25rem;
  font-weight: 900;
  color: var(--brand-secondary);
  opacity: 0.5;
  margin-bottom: 0.75rem;
  line-height: 1;
}

.step-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.65rem;
  color: var(--text-primary);
  overflow-wrap: break-word;
}

.step-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.55;
  overflow-wrap: break-word;
}

/* ==========================================================================
   CALCULATOR LAYOUT & CONTROLS
   ========================================================================== */
.calc-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin: 2rem 0;
  align-items: start;
}

@media (min-width: 960px) {
  .calc-layout {
    grid-template-columns: 1.15fr 0.85fr;
  }
}

.calc-form-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
}

.calc-card-header {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.calc-privacy-badge {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text-muted);
}

.calc-results-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: sticky;
  top: 90px;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 480px) {
  .form-grid-2 {
    grid-template-columns: 1fr;
  }
}

.form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
  overflow-wrap: break-word;
}

.form-help {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  line-height: 1.4;
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
  background-color: var(--bg-secondary);
}

.result-hero-box {
  background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-subtle));
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: center;
  overflow: hidden;
}

.result-hero-label {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
}

.result-hero-value {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 800;
  color: var(--brand-secondary);
  line-height: 1.15;
  overflow-wrap: break-word;
  word-break: break-word;
}

.result-hero-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.result-grid-mini {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (max-width: 480px) {
  .result-grid-mini {
    grid-template-columns: 1fr;
  }
}

.result-mini-card {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  overflow: hidden;
}

.result-mini-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
  line-height: 1.3;
}

.result-mini-value {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  overflow-wrap: break-word;
  word-break: break-word;
}

.result-accent-value {
  color: var(--brand-accent);
}

.calc-summary-row {
  padding: 1rem;
  background-color: var(--bg-tertiary);
  border-radius: var(--radius-md);
}

.calc-summary-val {
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--text-primary);
  word-break: break-word;
}

.calc-obs-box {
  padding: 1rem;
  background-color: var(--bg-tertiary);
  border-radius: var(--radius-md);
}

.calc-obs-label {
  font-size: 0.85rem;
  font-weight: 700;
  display: block;
  margin-bottom: 0.25rem;
}

.calc-obs-text {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.calc-privacy-footer {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
  border-top: 1px solid var(--border-subtle);
  padding-top: 1rem;
}

.breakdown-bar {
  display: flex;
  height: 14px;
  border-radius: var(--radius-full);
  overflow: hidden;
  background-color: var(--border-subtle);
  margin: 0.75rem 0 0.5rem;
  width: 100%;
}

.breakdown-seg-principal { background-color: var(--brand-primary); width: 70%; transition: width 0.3s ease; }
.breakdown-seg-interest { background-color: #f59e0b; width: 25%; transition: width 0.3s ease; }
.breakdown-seg-fees { background-color: #ef4444; width: 5%; transition: width 0.3s ease; }

.breakdown-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-dot-principal { background-color: var(--brand-primary); }
.legend-dot-interest { background-color: #f59e0b; }
.legend-dot-fees { background-color: #ef4444; }

/* ==========================================================================
   RESPONSIVE DATA TABLE & AMORTIZATION
   ========================================================================== */
.table-section {
  margin-top: 3rem;
}

.table-header-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.table-title {
  font-size: 1.35rem;
  font-weight: 700;
}

.table-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.table-pagination-controls {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.table-page-indicator {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0 0.5rem;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  margin: 1rem 0;
  background-color: var(--bg-card);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  text-align: left;
}

.data-table th {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  font-weight: 600;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  white-space: nowrap;
}

.data-table tbody tr:hover {
  background-color: var(--bg-subtle);
}

.methodology-box {
  margin-top: 3.5rem;
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2rem;
}

.methodology-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.methodology-text {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1rem;
}

/* ==========================================================================
   ARTICLE & EDITORIAL STYLES
   ========================================================================== */
.article-container {
  max-width: 820px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}

@media (max-width: 480px) {
  .article-container {
    padding: 1.75rem 0.85rem 3rem;
  }
}

.article-header {
  margin-bottom: 2.5rem;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.article-title {
  font-size: clamp(1.75rem, 4.5vw, 2.35rem);
  font-weight: 800;
  line-height: 1.25;
  color: var(--text-primary);
  margin-bottom: 1rem;
  overflow-wrap: break-word;
  word-break: break-word;
}

.article-lead {
  font-size: clamp(1.05rem, 2vw, 1.15rem);
  line-height: 1.6;
  color: var(--text-secondary);
  overflow-wrap: break-word;
}

.article-takeaways {
  background-color: var(--badge-bg);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin: 2rem 0;
}

.takeaways-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--badge-text);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.takeaways-list {
  padding-left: 1.25rem;
  color: var(--text-primary);
  line-height: 1.6;
}

.takeaways-list li {
  margin-bottom: 0.4rem;
}

.article-body {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--text-secondary);
  overflow-wrap: break-word;
}

.article-body h2 {
  font-size: clamp(1.35rem, 3vw, 1.65rem);
  font-weight: 700;
  color: var(--text-primary);
  margin: 2.25rem 0 0.85rem;
  line-height: 1.3;
}

.article-body h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 1.75rem 0 0.65rem;
}

.article-body p { margin-bottom: 1.25rem; }
.article-body ul, .article-body ol { margin-bottom: 1.5rem; padding-left: 1.5rem; }
.article-body li { margin-bottom: 0.5rem; }

.article-cta-box {
  background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-subtle));
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin: 3rem 0;
}

.article-cta-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0.75rem 0 0.5rem;
  color: var(--text-primary);
}

.article-cta-text {
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
}

.math-block {
  background-color: var(--bg-tertiary);
  border-left: 4px solid var(--brand-secondary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  font-family: monospace;
  font-size: 0.95rem;
  color: var(--text-primary);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.disclaimer-box {
  background-color: var(--warning-bg);
  border: 1px solid var(--warning-border);
  color: var(--warning-text);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin: 2rem 0;
  font-size: 0.9rem;
  line-height: 1.55;
  overflow-wrap: break-word;
}

.disclaimer-box-danger {
  background-color: var(--danger-bg);
  border-color: var(--danger-border);
  color: var(--danger-text);
}

.disclaimer-title {
  font-weight: 700;
  font-size: 1.05rem;
}

.disclaimer-text {
  margin-top: 0.35rem;
}

.disclaimer-sub {
  margin-top: 0.35rem;
  font-size: 0.8rem;
  opacity: 0.9;
}

/* Filter Tabs */
.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

/* ==========================================================================
   FAQ ACCORDION
   ========================================================================== */
.faq-list {
  margin: 2rem 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.faq-item {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.faq-question {
  width: 100%;
  text-align: left;
  padding: 1.25rem 1.5rem;
  background: none;
  border: none;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
}

.faq-question:hover {
  background-color: var(--bg-subtle);
}

.faq-chevron {
  font-size: 1.25rem;
  transition: transform 0.2s ease;
}

.faq-answer {
  padding: 0 1.5rem 1.25rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
  margin-top: auto;
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  padding: 4rem 0 2rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  margin-bottom: 3rem;
}

@media (min-width: 640px) {
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
}

.footer-brand-logo {
  margin-bottom: 0.5rem;
}

.footer-brand p {
  line-height: 1.6;
  margin-top: 1rem;
  color: var(--text-muted);
}

.footer-col-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s ease;
  overflow-wrap: break-word;
}

.footer-links a:hover {
  color: var(--brand-secondary);
  text-decoration: underline;
}

.footer-disclaimer {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 2rem;
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.footer-disclaimer-title {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--text-primary);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ==========================================================================
   MODALS & SEARCH
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: var(--bg-overlay);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 580px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.95);
  transition: transform 0.2s ease;
}

.modal-overlay.active .modal-card { transform: scale(1); }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-title { font-size: 1.15rem; font-weight: 700; color: var(--text-primary); }
.modal-body { padding: 1.5rem; overflow-y: auto; }

.search-results-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.search-result-item {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-tertiary);
  transition: all 0.15s ease;
}

.search-result-item:hover {
  border-color: var(--border-focus);
  background-color: var(--bg-secondary);
}

.search-result-link {
  text-decoration: none;
  display: block;
}

.search-result-title { font-size: 0.95rem; font-weight: 600; color: var(--text-primary); }
.search-result-snippet { font-size: 0.82rem; color: var(--text-muted); margin-top: 0.2rem; }

.search-empty-state {
  color: var(--text-muted);
  padding: 1rem;
  text-align: center;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  line-height: 1.4;
}

.breadcrumbs a { color: var(--text-muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--brand-secondary); text-decoration: underline; }

.breadcrumb-current {
  color: var(--text-primary);
  font-weight: 600;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.contact-inquiry-footer {
  margin-top: 3rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.code-404 {
  font-size: 4rem;
  font-weight: 900;
  color: var(--brand-secondary);
  margin-bottom: 0.5rem;
  line-height: 1;
}

.hidden { display: none !important; }
