/* ==========================================================================
   Army Height and Weight Calculator - Primary Style System
   Theme: Crisp Clean White & Modern Light Green / Olive Army Accents
   Fully Responsive, Accessible, and High-Performance
   ========================================================================== */

:root {
  /* Color Palette - White and Light Green Theme */
  --color-bg: #f8faf9;
  --color-bg-card: #ffffff;
  --color-bg-subtle: #f0f7f3;
  --color-bg-alt: #f4f8f5;
  --color-border: #e2ebe5;
  --color-border-focus: #10b981;

  /* Primary Light Green & Army Tones */
  --primary-50: #f0fdf4;
  --primary-100: #dcfce7;
  --primary-200: #bbf7d0;
  --primary-300: #86efac;
  --primary-400: #4ade80;
  --primary-500: #10b981;
  --primary-600: #059669;
  --primary-700: #047857;
  --primary-800: #065f46;
  --primary-900: #064e3b;

  /* Army Olive & Gold Accents */
  --army-olive: #2d5a3c;
  --army-olive-dark: #1b3a26;
  --army-olive-light: #417351;
  --army-gold: #d97706;
  --army-gold-light: #fef3c7;

  /* Neutrals & Text */
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-subtle: #64748b;
  --text-light: #94a3b8;
  --text-white: #ffffff;

  /* Feedback Colors */
  --color-pass-bg: #ecfdf5;
  --color-pass-border: #6ee7b7;
  --color-pass-text: #065f46;
  --color-fail-bg: #fef2f2;
  --color-fail-border: #fca5a5;
  --color-fail-text: #991b1b;
  --color-warn-bg: #fffbeb;
  --color-warn-border: #fcd34d;
  --color-warn-text: #92400e;

  /* Layout & Sizing */
  --container-max: 1200px;
  --container-narrow: 900px;
  --header-height: 72px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  /* Shadows */
  --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(16, 185, 129, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  --shadow-glow: 0 0 20px rgba(16, 185, 129, 0.25);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* Base Reset & Typography */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text-main);
  background-color: var(--color-bg);
  line-height: 1.6;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeSpeed;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

body.nav-open {
  overflow: hidden;
}

button, a, input, select, textarea {
  touch-action: manipulation;
}

img, svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  50% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleUp {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.animate-fade-in {
  animation: fadeIn var(--transition-normal) forwards;
}

/* Utility Containers */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

.container-narrow {
  width: 100%;
  max-width: var(--container-narrow);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

/* Header & Navbar */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
}

/* Logo Component */
.site-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--army-olive-dark);
  text-decoration: none;
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}

.site-logo:hover {
  transform: translateY(-1px);
}

.logo-badge {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--army-olive) 0%, var(--primary-600) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(5, 150, 105, 0.25);
}

.logo-badge svg {
  width: 24px;
  height: 24px;
}

.logo-text-full {
  display: inline-block;
}

.logo-text-short {
  display: none;
}

@media (max-width: 640px) {
  .logo-text-full { display: none; }
  .logo-text-short { display: inline-block; font-size: 1.05rem; }
}

/* Nav Menu */
.nav-menu {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  list-style: none;
}

.nav-link {
  font-size: 0.925rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.nav-link:hover, .nav-link.active {
  color: var(--primary-700);
  background-color: var(--primary-50);
}

/* Dropdown Menu */
.nav-dropdown {
  position: relative;
}

.dropdown-trigger {
  cursor: pointer;
  background: none;
  border: none;
}

.dropdown-trigger svg {
  width: 14px;
  height: 14px;
  transition: transform var(--transition-fast);
}

.nav-dropdown:hover .dropdown-trigger svg {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 260px;
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  padding: 0.6rem;
  list-style: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all var(--transition-fast);
  z-index: 100;
}

.nav-dropdown:hover .dropdown-menu,
.nav-dropdown:focus-within .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 0.85rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.dropdown-item:hover {
  color: var(--primary-700);
  background-color: var(--primary-50);
}

.dropdown-item-desc {
  display: block;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-subtle);
}

/* Mobile Nav Toggle */
.mobile-nav-toggle {
  display: none;
  background: none;
  border: none;
  padding: 0.5rem;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  min-width: 48px;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
}

.mobile-nav-toggle:focus-visible {
  outline: 2px solid var(--primary-500);
}

/* Mobile Nav Backdrop Overlay */
.nav-backdrop {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-normal), visibility var(--transition-normal);
  touch-action: none;
}

.nav-backdrop.is-active {
  opacity: 1;
  visibility: visible;
}

@media (max-width: 991px) {
  .nav-menu {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: #ffffff;
    flex-direction: column;
    align-items: stretch;
    padding: 1.25rem;
    gap: 0.4rem;
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-xl);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
    max-height: calc(100vh - var(--header-height));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    z-index: 999;
  }

  .nav-menu.is-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav-link {
    min-height: 48px;
    font-size: 1rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
  }

  .mobile-nav-toggle {
    display: flex;
  }

  .dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    box-shadow: none;
    border: none;
    padding: 0.25rem 0 0.5rem 0.5rem;
    transform: none;
    background-color: var(--color-bg-subtle);
    border-radius: var(--radius-md);
    margin-top: 0.25rem;
  }

  .dropdown-item {
    min-height: 44px;
    padding: 0.65rem 0.75rem;
  }
}

/* Badges & Pills */
.pill-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: var(--radius-full);
}

.badge-army {
  background-color: var(--primary-100);
  color: var(--primary-800);
  border: 1px solid var(--primary-200);
}

.badge-directive {
  background-color: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.badge-gold {
  background-color: var(--army-gold-light);
  color: var(--army-gold);
  border: 1px solid #fde68a;
}

/* Hero Section */
.hero-section {
  padding-top: 2.5rem;
  padding-bottom: 2rem;
  text-align: center;
  background: radial-gradient(circle at 50% 0%, #ecfdf5 0%, #f8faf9 70%);
  border-bottom: 1px solid var(--color-border);
}

.hero-title {
  font-size: 2.25rem;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-main);
  margin-bottom: 0.75rem;
}

@media (min-width: 768px) {
  .hero-title {
    font-size: 3.25rem;
  }
}

.hero-title span {
  color: var(--primary-600);
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto 0.75rem auto;
  line-height: 1.6;
}

.hero-meta {
  font-size: 0.8rem;
  color: var(--text-subtle);
}

/* Calculator Grid Layout */
.calculator-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-top: -1.5rem;
  margin-bottom: 3.5rem;
}

@media (min-width: 1024px) {
  .calculator-grid {
    grid-template-columns: 1.15fr 0.85fr;
    align-items: start;
  }
}

/* Calculator Card */
.calc-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  box-shadow: var(--shadow-lg);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

@media (min-width: 640px) {
  .calc-card {
    padding: 2.25rem;
  }
}

.calc-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 1.25rem;
  margin-bottom: 1.5rem;
}

.calc-card-title {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--army-olive-dark);
}

.calc-card-title svg {
  color: var(--primary-600);
}

.calc-card-subtitle {
  font-size: 0.85rem;
  color: var(--text-subtle);
  margin-top: 0.25rem;
}

/* Form Groups & Inputs */
.form-group {
  margin-bottom: 1.35rem;
}

.form-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.45rem;
}

.form-hint {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-subtle);
}

.toggle-unit-btn {
  background: none;
  border: none;
  color: var(--primary-600);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  padding: 0.2rem 0.4rem;
}

.toggle-unit-btn:hover {
  color: var(--primary-700);
}

.input-row {
  display: flex;
  gap: 0.75rem;
}

.input-field-wrapper {
  position: relative;
  flex: 1;
}

.form-input {
  width: 100%;
  height: 52px;
  padding: 0.75rem 2.75rem 0.75rem 1rem;
  background-color: var(--color-bg-subtle);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: max(16px, 1.02rem);
  font-weight: 600;
  color: var(--text-main);
  transition: all var(--transition-fast);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.form-input:focus {
  border-color: var(--color-border-focus);
  background-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.input-suffix {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-subtle);
  pointer-events: none;
}

.form-select {
  width: 100%;
  height: 52px;
  padding: 0.75rem 1rem;
  background-color: var(--color-bg-subtle);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: max(16px, 1rem);
  font-weight: 600;
  color: var(--text-main);
  outline: none;
  cursor: pointer;
}

.form-select:focus {
  border-color: var(--color-border-focus);
  background-color: #ffffff;
}

/* Radio Button Pill Toggle */
.radio-pill-group {
  display: flex;
  background-color: var(--color-bg-subtle);
  padding: 4px;
  border-radius: var(--radius-md);
  gap: 4px;
  border: 1px solid var(--color-border);
}

.radio-pill-btn {
  flex: 1;
  padding: 0.65rem 1rem;
  min-height: 44px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.radio-pill-btn.active {
  background-color: #ffffff;
  color: var(--primary-700);
  box-shadow: var(--shadow-sm);
}

/* Action Buttons */
.btn-group {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.95rem;
  min-height: 48px;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--transition-normal);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-700) 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-600) 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(5, 150, 105, 0.35);
}

.btn-secondary {
  background-color: #ffffff;
  color: var(--text-muted);
  border: 1.5px solid var(--color-border);
}

.btn-secondary:hover {
  background-color: var(--color-bg-subtle);
  color: var(--text-main);
}

.btn-sm {
  min-height: 38px;
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

/* Results Display Panel */
.result-card {
  background: #ffffff;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
  transition: all var(--transition-normal);
}

.result-card.is-pass {
  border-color: var(--color-pass-border);
  background: linear-gradient(180deg, #ffffff 0%, var(--color-pass-bg) 100%);
}

.result-card.is-fail {
  border-color: var(--color-fail-border);
  background: linear-gradient(180deg, #ffffff 0%, var(--color-fail-bg) 100%);
}

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.result-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.875rem;
  font-weight: 800;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-full);
}

.result-badge.pass {
  background-color: var(--color-pass-bg);
  color: var(--color-pass-text);
  border: 1px solid var(--color-pass-border);
}

.result-badge.fail {
  background-color: var(--color-fail-bg);
  color: var(--color-fail-text);
  border: 1px solid var(--color-fail-border);
}

.result-score-block {
  text-align: center;
  padding: 1.5rem 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 1.5rem;
}

.result-score-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.result-score-val {
  font-size: 3.5rem;
  font-weight: 900;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  line-height: 1;
  color: var(--army-olive-dark);
}

.result-target-info {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* Visual Progress Dial / Gauge */
.gauge-wrapper {
  margin: 1.25rem 0;
}

.gauge-bar-track {
  height: 12px;
  background: linear-gradient(to right, #10b981 0%, #34d399 50%, #fbbf24 75%, #f87171 100%);
  border-radius: var(--radius-full);
  position: relative;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}

.gauge-marker {
  position: absolute;
  top: -4px;
  width: 20px;
  height: 20px;
  background-color: #ffffff;
  border: 3px solid var(--army-olive-dark);
  border-radius: 50%;
  transform: translateX(-50%);
  box-shadow: 0 2px 5px rgba(0,0,0,0.25);
  transition: left var(--transition-slow);
}

.gauge-scale-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 0.4rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-subtle);
  font-family: monospace;
}

.gauge-threshold-line {
  position: absolute;
  top: -8px;
  bottom: -8px;
  width: 2px;
  background-color: #991b1b;
  transform: translateX(-50%);
}

.gauge-threshold-tag {
  position: absolute;
  top: -22px;
  transform: translateX(-50%);
  font-size: 0.65rem;
  font-weight: 800;
  background: #991b1b;
  color: #fff;
  padding: 1px 4px;
  border-radius: 3px;
}

/* Result Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.metric-item {
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  text-align: center;
}

.metric-label {
  font-size: 0.75rem;
  color: var(--text-subtle);
  font-weight: 600;
  margin-bottom: 0.15rem;
}

.metric-val {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
}

/* Result Advice Note */
.result-advice {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-muted);
  background-color: #ffffff;
  border: 1px dashed var(--color-border);
  padding: 0.85rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
}

.result-advice strong {
  color: var(--text-main);
}

/* Feature & Benefit Cards */
.feature-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin: 2.5rem 0;
}

@media (min-width: 768px) {
  .feature-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.feature-card {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
}

.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-300);
}

.feature-icon {
  font-size: 1.75rem;
  margin-bottom: 0.75rem;
}

.feature-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.feature-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Cross-Branch Alert Banner */
.cross-branch-banner {
  background: linear-gradient(135deg, #f0fdf4 0%, #e0f2fe 100%);
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-xl);
  padding: 1.5rem 2rem;
  margin: 2.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
}

@media (min-width: 768px) {
  .cross-branch-banner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.cross-branch-text {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.cross-branch-text strong {
  color: var(--text-main);
}

.cross-branch-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Tables Styling */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin: 1.5rem 0;
}

.table-custom {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  text-align: left;
}

.table-custom th {
  background-color: var(--color-bg-subtle);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.85rem 1.25rem;
  border-bottom: 1.5px solid var(--color-border);
}

.table-custom td {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  color: var(--text-main);
}

.table-custom tr:last-child td {
  border-bottom: none;
}

.table-custom tr:hover td {
  background-color: #fcfdfd;
}

.table-custom .target-waist {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 700;
  color: var(--primary-700);
}

/* Accordion Component */
.accordion {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: #ffffff;
  overflow: hidden;
  margin: 1.5rem 0;
}

.accordion-item {
  border-bottom: 1px solid var(--color-border);
}

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

.accordion-header {
  width: 100%;
  padding: 1.15rem 1.5rem;
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.accordion-header:hover {
  background-color: var(--color-bg-subtle);
}

.accordion-icon {
  width: 20px;
  height: 20px;
  transition: transform var(--transition-normal);
  color: var(--primary-600);
  flex-shrink: 0;
}

.accordion-item.is-open .accordion-icon {
  transform: rotate(180deg);
}

.accordion-content {
  padding: 0 1.5rem;
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-normal), padding var(--transition-normal);
  color: var(--text-muted);
  font-size: 0.925rem;
  line-height: 1.6;
}

.accordion-item.is-open .accordion-content {
  padding-bottom: 1.25rem;
  max-height: 800px;
}

/* SEO Content & Article Section */
.seo-article {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  box-shadow: var(--shadow-sm);
  margin: 3.5rem 0;
}

@media (max-width: 640px) {
  .seo-article {
    padding: 1.5rem;
  }
}

.seo-article h2 {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.seo-article h3 {
  font-size: 1.35rem;
  font-weight: 750;
  color: var(--army-olive-dark);
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.seo-article p {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 1.25rem;
}

.seo-article ul, .seo-article ol {
  margin-left: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--text-muted);
}

.seo-article li {
  margin-bottom: 0.5rem;
}

.seo-callout {
  background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 100%);
  border-left: 4px solid var(--primary-500);
  padding: 1.25rem 1.5rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: 1.75rem 0;
}

.seo-callout h4 {
  font-size: 1.1rem;
  font-weight: 750;
  color: var(--primary-900);
  margin-bottom: 0.4rem;
}

.seo-callout p {
  color: var(--primary-800);
  margin-bottom: 0;
}

/* Recommended Gear Spotlight */
.gear-spotlight-card {
  background: #ffffff;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
  margin: 2rem 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

@media (min-width: 640px) {
  .gear-spotlight-card {
    flex-direction: row;
    align-items: center;
  }
}

.gear-icon-box {
  width: 72px;
  height: 72px;
  background-color: var(--primary-50);
  border: 1px solid var(--primary-200);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-700);
  flex-shrink: 0;
}

.gear-content {
  flex: 1;
}

.gear-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.gear-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Footer Section */
.site-footer {
  background-color: #0f172a;
  color: #94a3b8;
  padding-top: 4rem;
  padding-bottom: 2rem;
  margin-top: auto;
  border-top: 1px solid #1e293b;
}

.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: 1.5fr 1fr 1fr 1fr;
  }
}

.footer-brand-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #ffffff;
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 1rem;
}

.footer-brand-desc {
  font-size: 0.875rem;
  line-height: 1.6;
  color: #94a3b8;
  margin-bottom: 1.25rem;
}

.footer-col-title {
  font-size: 0.9rem;
  font-weight: 750;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1.25rem;
}

.footer-links-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.footer-link {
  font-size: 0.875rem;
  color: #94a3b8;
  transition: color var(--transition-fast);
}

.footer-link:hover {
  color: #ffffff;
}

.footer-disclaimer-box {
  border-top: 1px solid #1e293b;
  padding-top: 2rem;
  margin-top: 2rem;
  text-align: center;
}

.footer-disclaimer-text {
  font-size: 0.75rem;
  color: #64748b;
  max-width: 820px;
  margin: 0 auto 1.5rem auto;
  line-height: 1.6;
}

.footer-bottom-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  border-top: 1px solid #1e293b;
  padding-top: 1.5rem;
  font-size: 0.8rem;
  color: #64748b;
}

@media (min-width: 640px) {
  .footer-bottom-bar {
    flex-direction: row;
    justify-content: space-between;
  }
}

/* Back to Top Floating Button */
.back-to-top-btn {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 99;
  background-color: var(--primary-600);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-full);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 700;
  box-shadow: var(--shadow-xl);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: all var(--transition-normal);
}

.back-to-top-btn.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top-btn:hover {
  background-color: var(--primary-700);
  transform: translateY(-2px);
}

/* Toast Notification */
.toast-notice {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background-color: #0f172a;
  color: #ffffff;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: var(--shadow-xl);
  z-index: 1000;
  opacity: 0;
  transition: all var(--transition-normal);
}

.toast-notice.is-show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Print Styles */
@media print {
  .site-header, .site-footer, .btn-group, .cross-branch-banner, .back-to-top-btn {
    display: none !important;
  }
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  .calc-card, .result-card {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
  }
}

/* ==========================================================================
   High-Performance Rendering & Advanced Mobile Responsive System
   ========================================================================== */

/* Defer offscreen rendering to accelerate FCP and LCP (Instant Loading) */
.seo-article,
.seo-callout,
.site-footer,
.feature-grid,
.accordion,
.cross-branch-banner {
  content-visibility: auto;
  contain-intrinsic-size: 1px 600px;
}

/* Custom Smooth Scrollbar for Mobile Tables */
.table-responsive::-webkit-scrollbar {
  height: 6px;
}

.table-responsive::-webkit-scrollbar-track {
  background: var(--color-bg-subtle);
  border-radius: var(--radius-full);
}

.table-responsive::-webkit-scrollbar-thumb {
  background: var(--primary-300);
  border-radius: var(--radius-full);
}

.table-responsive::-webkit-scrollbar-thumb:hover {
  background: var(--primary-500);
}

/* Horizontal swipe hint */
.table-scroll-hint {
  display: none;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-subtle);
  margin-bottom: 0.5rem;
  align-items: center;
  gap: 0.4rem;
}

/* Enhanced Mobile Responsive Queries */
@media (max-width: 768px) {
  .hero-section {
    padding-top: 2.25rem;
    padding-bottom: 2.25rem;
  }

  .hero-title {
    font-size: 2rem;
    line-height: 1.25;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .calculator-grid {
    margin-top: -1rem;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
  }

  .table-scroll-hint {
    display: flex;
  }
}

@media (max-width: 640px) {
  .calc-card, .result-card {
    padding: 1.25rem 1rem;
    border-radius: var(--radius-lg);
  }

  .calc-card-title {
    font-size: 1.15rem;
  }

  .calc-card-header {
    margin-bottom: 1rem;
    padding-bottom: 0.85rem;
  }

  /* Stack and enlarge buttons on mobile for easy thumb tapping */
  .btn-group {
    flex-direction: column;
    gap: 0.75rem;
  }

  .btn-group .btn {
    width: 100%;
    min-height: 50px;
  }

  /* Wrap pill buttons neatly */
  .radio-pill-group {
    flex-wrap: wrap;
    gap: 4px;
    padding: 4px;
  }

  .radio-pill-btn {
    flex: 1 1 calc(50% - 4px);
    min-height: 46px;
    padding: 0.5rem 0.5rem;
    font-size: 0.825rem;
    text-align: center;
    white-space: normal;
  }

  /* Responsive result card */
  .result-score-val {
    font-size: 2.75rem;
  }

  .result-score-block {
    padding: 1.25rem 0;
    margin-bottom: 1.25rem;
  }

  .table-custom th,
  .table-custom td {
    padding: 0.65rem 0.75rem;
    font-size: 0.825rem;
  }

  .back-to-top-btn {
    bottom: 1rem;
    right: 1rem;
    padding: 0.65rem 0.85rem;
    font-size: 0.75rem;
  }

  .seo-article {
    padding: 1.5rem 1.15rem;
    margin: 2rem 0;
  }

  .seo-article h2 {
    font-size: 1.5rem;
  }

  .seo-article h3 {
    font-size: 1.2rem;
  }
}

@media (max-width: 400px) {
  .hero-title {
    font-size: 1.7rem;
  }

  .radio-pill-btn {
    flex: 1 1 100%;
  }

  .input-row {
    flex-direction: column;
    gap: 0.75rem;
  }

  .result-score-val {
    font-size: 2.25rem;
  }

  .container, .container-narrow {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }
}
