/*
  Auto-generated fallback stylesheet.
  Source: src/styles/global.css
  Do not edit this file directly; run scripts/generate-fallback-css.mjs.
*/
/* ============================================================
   CUSTOM THEME — Rounding Solver
   ============================================================ */

:root {
/* Colors */
  --color-bg-primary: rgb(56, 55, 53);
  --color-bg-secondary: rgb(232, 227, 231);
  --color-bg-card: rgb(206, 207, 202);
  --color-bg-input: rgba(255, 255, 255, 0.6);

  --color-border: rgba(0, 0, 0, 0.2);
  --color-border-hover: rgba(99, 102, 241, 0.35);
  --color-border-focus: rgba(139, 92, 246, 0.6);

  --color-text-primary: #ffffff;
  --color-text-secondary: #ffffff;
  --color-text-muted: #f3f4f6;
  --color-text-accent: #818cf8;

  --color-accent-primary: #6366f1;
  --color-accent-secondary: #8b5cf6;
  --color-accent-tertiary: #a78bfa;

  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-error: #ef4444;

  /* Font families */
  --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* Custom breakpoint */
  --breakpoint-2xl: 1440px;
}


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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg-primary);
  color: var(--color-text-primary);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Background mesh */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% 20%, rgba(99,102,241,0.08) 0%, transparent 50%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(139,92,246,0.06) 0%, transparent 50%),
    radial-gradient(ellipse 40% 60% at 50% 50%, rgba(167,139,250,0.03) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

#root, main, .page-wrapper {
  position: relative;
  z-index: 1;
}

a {
  color: var(--color-text-accent);
  text-decoration: none;
  transition: color 150ms ease;
}
a:hover { color: var(--color-accent-secondary); }

::selection {
  background: rgba(99,102,241,0.3);
  color: var(--color-text-primary);
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--color-bg-secondary); }
::-webkit-scrollbar-thumb { background: rgba(99,102,241,0.3); border-radius: 9999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(99,102,241,0.5); }

/* ============================================================
   LAYOUT
   ============================================================ */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
.container-narrow { max-width: 900px; }

/* ============================================================
   HEADER
   ============================================================ */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(206, 207, 202, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--color-border);
  transition: box-shadow 250ms ease;
}
.header.scrolled { box-shadow: 0 10px 40px rgba(0,0,0,0.4); }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 800;
  font-size: 1.25rem;
  color: #000000 !important;
  text-decoration: none;
}

.logo-icon {
  width: 36px;
  height: 36px;
  display: block;
  flex: 0 0 36px;
  object-fit: contain;
}

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

.nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-link {
  padding: 0.5rem 1rem;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 700;
  color: #000000 !important;
  transition: all 150ms ease;
  text-decoration: none;
}
.nav-link:hover, .nav-link[aria-current="page"] {
  color: #000000 !important;
  background: rgba(0, 0, 0, 0.1);
}

/* Mobile menu */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 0.5rem;
  background: none;
  border: none;
  cursor: pointer;
}
.mobile-menu-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: #000000;
  border-radius: 2px;
  transition: all 150ms ease;
}

.mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(56, 55, 53, 0.98);
  backdrop-filter: blur(20px);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease;
}
.mobile-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.mobile-overlay .nav-link {
  font-size: 1.25rem;
  padding: 0.75rem 2rem;
}
.mobile-close-btn {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: var(--color-text-secondary);
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
}

@media (max-width: 768px) {
  .mobile-menu-btn { display: flex; }
  .nav.desktop-nav { display: none; }
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  padding: 3rem 0 1rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(99,102,241,0.1);
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: 9999px;
  font-size: 0.875rem;
  color: var(--color-text-accent);
  margin-bottom: 1.5rem;
  animation: fadeInDown 0.6s ease-out;
}

.hero-badge-dot {
  width: 6px; height: 6px;
  background: var(--color-success);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.hero h1 {
  font-size: clamp(2.25rem, 8vw, 3.75rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 1.5rem;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--color-text-secondary);
  max-width: 650px;
  margin: 0 auto 0.4rem;
  line-height: 1.6;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
}
.hero-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text-accent);
  font-family: var(--font-mono);
}
.hero-stat-label {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 0.25rem;
}

/* ============================================================
   SOLVER CARD
   ============================================================ */
.solver-card {
  background: var(--color-bg-card);
  border: 2px solid #000000;
  border-bottom-width: 6px;
  border-radius: 24px;
  padding: 1.5rem;
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 0 rgba(0,0,0,0.2), 0 20px 40px rgba(0,0,0,0.4);
  position: relative;
  overflow: hidden;
  color: #000000 !important;
  transform: translateY(-2px);
}
@media (min-width: 640px) {
  .solver-card { padding: 2rem; }
}
.solver-card * {
  color: #000000 !important;
}
.solver-card .btn-primary, 
.solver-card .btn-primary * {
  color: #ffffff !important;
}
.solver-card .btn-secondary,
.solver-card .btn-secondary * {
  color: #000000 !important;
}
.solver-card .custom-cursor {
  color: #000000 !important;
}
.solver-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(99,102,241,0.5), transparent);
}

.solver-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.solver-card-icon {
  width: 44px; height: 44px;
  background: rgba(99,102,241,0.12);
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}
.solver-card-title { font-size: 1.25rem; font-weight: 700; }
.solver-card-subtitle { font-size: 0.875rem; color: var(--color-text-muted); }

/* Form */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

.form-group { display: flex; flex-direction: column; gap: 0.5rem; }
.form-group.full-width { grid-column: 1 / -1; }

.form-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.label-hint { font-size: 0.75rem; color: var(--color-text-muted); font-weight: 400; }

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--color-bg-input);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  color: var(--color-text-primary);
  font-family: var(--font-mono);
  font-size: 1rem;
  transition: all 150ms ease;
  outline: none;
}
.form-input:hover, .form-select:hover { border-color: var(--color-border-hover); }
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--color-border-focus);
  box-shadow: 0 0 0 3px rgba(139,92,246,0.1);
}
.form-input::placeholder { 
  color: transparent !important;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.custom-cursor {
  position: absolute;
  left: 1rem;
  font-weight: 800;
  color: #000000;
  font-family: var(--font-mono);
  pointer-events: none;
  animation: blink 1s step-end infinite;
  display: none;
}

#number-input:placeholder-shown + .custom-cursor {
  display: block;
}

@keyframes blink {
  from, to { opacity: 0; }
  50% { opacity: 1; }
}

.form-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%236b6b8a' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}
.form-select option { background: var(--color-bg-card); color: var(--color-text-primary); }

.form-textarea {
  font-family: var(--font-sans);
  min-height: 120px;
  resize: vertical;
  line-height: 1.6;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 250ms ease;
  position: relative;
  overflow: hidden;
  text-decoration: none;
}
.btn-primary {
  background: var(--color-bg-primary);
  color: white !important;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}
.btn-primary:hover { 
  background: #2a2a2a;
  transform: translateY(-2px); 
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: rgba(99,102,241,0.1);
  border: 1px solid rgba(99,102,241,0.2);
  color: var(--color-text-accent);
}
.btn-secondary:hover { background: rgba(99,102,241,0.2); border-color: rgba(99,102,241,0.4); }

.btn-lg { padding: 1rem 2rem; font-size: 1.125rem; border-radius: 16px; }
.btn-full { width: 100%; }

.btn-group { display: flex; gap: 0.75rem; }
@media (max-width: 640px) { .btn-group { flex-direction: column; } }

/* ============================================================
   RESULT
   ============================================================ */
.result-container { margin-top: 1.5rem; animation: slideUp 0.4s ease-out; }

.result-box {
  background: linear-gradient(135deg, rgba(99,102,241,0.08), rgba(139,92,246,0.04));
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: 16px;
  padding: 1.5rem;
  position: relative;
}
.result-box::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6, #a78bfa);
  border-radius: 16px 16px 0 0;
}

.result-label {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}
.result-value {
  font-family: var(--font-mono);
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--color-text-accent);
  word-break: break-all;
}

/* Steps */
.step-item {
  display: flex;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid rgba(99,102,241,0.08);
  animation: fadeInUp 0.4s ease-out;
}
.step-item:last-child { border-bottom: none; }

.step-number {
  flex-shrink: 0;
  width: 32px; height: 32px;
  background: rgba(99,102,241,0.12);
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-accent);
  font-family: var(--font-mono);
}
.step-content h4 { font-size: 0.875rem; font-weight: 600; margin-bottom: 0.25rem; }
.step-content p { font-size: 0.875rem; color: var(--color-text-secondary); line-height: 1.6; }
.math {
  font-family: var(--font-mono);
  color: var(--color-text-accent);
  background: rgba(99,102,241,0.08);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.75rem;
}

/* Number line */
.number-line-container {
  margin: 1.5rem 0;
  padding: 1.5rem;
  background: rgba(0,0,0,0.3);
  border-radius: 16px;
  border: 1px solid var(--color-border);
}
.number-line { position: relative; height: 60px; margin: 1rem 0; }
.number-line-track {
  position: absolute;
  top: 50%; left: 5%; right: 5%;
  height: 3px;
  background: rgba(99,102,241,0.2);
  border-radius: 2px;
  transform: translateY(-50%);
}

/* Quick examples */
.quick-examples { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.quick-example-btn {
  padding: 0.5rem 0.75rem;
  background: rgba(99,102,241,0.08);
  border: 1px solid rgba(99,102,241,0.15);
  border-radius: 6px;
  color: #000000 !important;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 150ms ease;
}
.quick-example-btn:hover {
  background: rgba(99,102,241,0.15);
  border-color: rgba(99,102,241,0.3);
  color: var(--color-text-accent);
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0.25rem;
  padding: 0.25rem;
  background: rgba(0,0,0,0.3);
  border-radius: 10px;
  margin-bottom: 1.5rem;
}
.tab {
  flex: 1;
  padding: 0.75rem 0.5rem;
  background: none;
  border: none;
  border-radius: 6px;
  color: var(--color-text-muted);
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 150ms ease;
  white-space: nowrap;
}
@media (min-width: 480px) {
  .tab { font-size: 0.875rem; padding: 0.75rem 1rem; }
}
.tab:hover { color: var(--color-text-secondary); }
.tab.active { background: rgba(99,102,241,0.15); color: var(--color-text-accent); }

/* Copy button */
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.75rem;
  background: rgba(99,102,241,0.1);
  border: 1px solid rgba(99,102,241,0.15);
  border-radius: 6px;
  color: var(--color-text-muted);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 150ms ease;
  font-family: var(--font-sans);
}
.copy-btn:hover { background: rgba(99,102,241,0.2); color: var(--color-text-accent); }
.copy-btn.copied { color: var(--color-success); border-color: rgba(16,185,129,0.3); }

/* Batch */
.batch-result-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 0.75rem;
  background: rgba(0,0,0,0.2);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.875rem;
}

/* History */
.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: rgba(0,0,0,0.2);
  border-radius: 6px;
  cursor: pointer;
  transition: background 150ms ease;
}
.history-item:hover { background: rgba(99,102,241,0.08); }

/* ============================================================
   SECTION COMPONENTS
   ============================================================ */
.section { padding: 3rem 0; }
@media (min-width: 768px) {
  .section { padding: 5rem 0; }
}
.section-sm { padding: 2rem 0; }
@media (min-width: 768px) {
  .section-sm { padding: 3rem 0; }
}

/* Keep the calculator closer to the hero on the home page */
#solver.section-sm {
  padding-top: 0.25rem;
}
@media (min-width: 768px) {
  #solver.section-sm {
    padding-top: 0.5rem;
  }
}

.section-header { text-align: center; margin-bottom: 3rem; }
.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem;
  background: rgba(99,102,241,0.1);
  border: 1px solid rgba(99,102,241,0.15);
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
}
.section-header h2 {
  font-size: clamp(1.5rem, 3.5vw, 2.25rem);
  font-weight: 800;
  margin-bottom: 1rem;
  line-height: 1.2;
}
.section-header p {
  font-size: 1.125rem;
  color: var(--color-text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

.interactive-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin: -1rem 0 2rem;
}

.interactive-chip {
  border: 1px solid var(--color-border);
  background: var(--color-bg-card);
  color: #000000;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1;
  padding: 0.55rem 0.85rem;
  cursor: pointer;
  transition: all 150ms ease;
}

.interactive-chip:hover {
  border-color: rgba(99,102,241,0.35);
}

.interactive-chip.is-active {
  border-color: rgba(99,102,241,0.45);
  background: rgba(99,102,241,0.1);
  color: var(--color-text-accent);
}

/* Mode cards */
.modes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}
.mode-card {
  background: var(--color-bg-card);
  border: 2px solid #000000;
  border-bottom-width: 5px;
  border-radius: 16px;
  padding: 1.5rem;
  transition: all 200ms ease;
  color: #000000 !important;
  box-shadow: 0 6px 0 rgba(0,0,0,0.15), 0 10px 20px rgba(0,0,0,0.2);
  transform: translateY(-2px);
}
.mode-card * {
  color: #000000 !important;
}
.mode-card .mode-example {
  color: #000000 !important;
}
.mode-icon {
  width: 48px; height: 48px;
  background: rgba(99,102,241,0.1);
  border: 1px solid rgba(99,102,241,0.15);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}
.mode-card h3 { font-size: 1.125rem; font-weight: 600; margin-bottom: 0.5rem; }
.mode-card p { font-size: 0.875rem; color: var(--color-text-secondary); line-height: 1.6; }
.mode-example {
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: #000000 !important;
}

/* Feature cards */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}
.feature-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 2rem;
  transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
  color: #000000 !important;
  box-shadow: 0 4px 15px rgba(0,0,0,0.03);
  position: relative;
}
.feature-card * {
  color: #000000 !important;
}
.feature-card:hover {
  transform: translateY(-4px);
  border-color: rgba(99,102,241,0.4);
  box-shadow: 0 12px 30px rgba(0,0,0,0.1);
}
.feature-icon {
  width: 56px; height: 56px;
  background: rgba(99,102,241,0.1);
  border: 1px solid rgba(99,102,241,0.15);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1.25rem;
}
.feature-card h3 { font-size: 1.125rem; font-weight: 600; margin-bottom: 0.75rem; }
.feature-card p { font-size: 0.875rem; color: var(--color-text-secondary); line-height: 1.7; }

/* How-it-works */
.how-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}
.how-step {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 2.5rem 2rem;
  text-align: center;
  transition: all 300ms ease;
  color: #000000 !important;
  box-shadow: 0 4px 15px rgba(0,0,0,0.03);
  position: relative;
}
.how-step * {
  color: #000000 !important;
}
.how-step:hover {
  transform: translateY(-4px);
  border-color: rgba(99,102,241,0.4);
  box-shadow: 0 12px 30px rgba(0,0,0,0.1);
}
.how-step-number {
  width: 48px; height: 48px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
  color: white;
  margin: 0 auto 1rem;
}
.how-step h3 { font-size: 1.125rem; font-weight: 600; margin-bottom: 0.5rem; }
.how-step p { font-size: 0.875rem; color: var(--color-text-secondary); line-height: 1.6; }

.how-step-interactive {
  text-align: left;
}

.how-step-interactive .how-diagram-controls {
  margin: 1rem 0 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.how-diagram-btn {
  width: 36px;
  height: 36px;
  border-radius: 9999px;
  border: 1px solid var(--color-border);
  background: var(--color-bg-card);
  font-weight: 700;
  cursor: pointer;
  transition: all 150ms ease;
}

.how-diagram-btn.is-active {
  border-color: rgba(99,102,241,0.45);
  background: rgba(99,102,241,0.1);
  color: var(--color-text-accent);
}

.how-diagram-output {
  border: 1px dashed rgba(99,102,241,0.4);
  border-radius: 10px;
  background: rgba(99,102,241,0.06);
  padding: 0.8rem;
}

.how-diagram-output strong {
  display: block;
  margin-bottom: 0.35rem;
}

/* Content table */
.table-explorer-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 1rem;
}

.content-table-wrapper {
  overflow-y: auto;
  overflow-x: auto;
  max-height: 400px;
  margin: 1.5rem 0;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  background: var(--color-bg-card);
}
.content-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; position: relative; }
.content-table th {
  background: var(--color-bg-card);
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--color-text-primary);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,0.1);
}
.content-table th::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(99,102,241,0.1);
  z-index: -1;
}
.content-table td {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--color-border);
  color: #333333;
  font-family: var(--font-mono);
}
.content-table td, 
.content-table th {
  color: #000000 !important;
}

.content-table tbody tr:nth-child(even) td {
  background: rgba(0, 0, 0, 0.02);
}

.content-table tr:hover td { background: rgba(99,102,241,0.06); }

.content-table.highlight-col-2 th:nth-child(2),
.content-table.highlight-col-2 td:nth-child(2),
.content-table.highlight-col-3 th:nth-child(3),
.content-table.highlight-col-3 td:nth-child(3),
.content-table.highlight-col-4 th:nth-child(4),
.content-table.highlight-col-4 td:nth-child(4),
.content-table.highlight-col-5 th:nth-child(5),
.content-table.highlight-col-5 td:nth-child(5),
.content-table.highlight-col-6 th:nth-child(6),
.content-table.highlight-col-6 td:nth-child(6) {
  background: rgba(99,102,241,0.12) !important;
}

/* Design Table Global Styles */
.design-container {
  background-color: #e2e5dc;
  border-radius: 20px;
  padding: 2.5rem;
  color: #1a1a1a;
}
@media (max-width: 640px) {
  .design-container {
    padding: 1.5rem;
  }
}
.design-lead {
  margin-bottom: 2rem;
  font-size: 1.1rem;
  font-family: var(--font-sans);
}
.design-table-wrapper {
  border-radius: 12px;
  border: 1px solid #c0c4ba;
  overflow-x: auto;
}
.design-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: #1a1a1a;
  min-width: 600px;
}
.design-table th {
  background-color: #d1d4e0;
  text-align: left;
  padding: 1rem 1.25rem;
  font-weight: 600;
  font-family: var(--font-sans);
  border-bottom: 1px solid #c0c4ba;
  border-right: 1px solid #c0c4ba;
  color: #1a1a1a;
  white-space: nowrap;
}
.design-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #c0c4ba;
  border-right: 1px solid #c0c4ba;
  background-color: transparent;
  line-height: 1.5;
}
.design-table tr:hover td {
  background-color: rgba(0, 0, 0, 0.02);
}
.design-table th:last-child,
.design-table td:last-child {
  border-right: none;
}
.design-table tr:last-child td {
  border-bottom: none;
}

.content-table tr.is-active-row td {
  background: rgba(99,102,241,0.09);
}

.table-insight {
  margin-top: 0.9rem;
  border: 1px dashed rgba(99,102,241,0.4);
  border-radius: 10px;
  background: rgba(99,102,241,0.06);
  padding: 0.85rem 1rem;
  font-size: 0.9rem;
}

.feature-demo-card {
  margin-top: 1.5rem;
  background: var(--color-bg-card);
  border: 2px solid #000000;
  border-bottom-width: 5px;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 6px 0 rgba(0,0,0,0.15), 0 10px 20px rgba(0,0,0,0.2);
  color: #000000 !important;
}

.feature-demo-card h3 {
  margin-bottom: 0.4rem;
  color: #000000 !important;
}

.feature-demo-card > p {
  margin-bottom: 0.9rem;
  font-size: 0.9rem;
  color: #000000 !important;
}

.feature-demo-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
}

.feature-demo-panel {
  border: 1px dashed rgba(99,102,241,0.4);
  border-radius: 10px;
  background: rgba(99,102,241,0.06);
  padding: 0.8rem 0.9rem;
  color: #000000 !important;
}

.feature-demo-panel strong {
  display: block;
  margin-bottom: 0.35rem;
  color: #000000 !important;
}

.feature-demo-panel p {
  color: #000000 !important;
}

/* FAQ */
.faq-list { display: flex; flex-direction: column; gap: 1rem; }
.faq-item {
  background: var(--color-bg-card);
  border: 2px solid #000000;
  border-bottom-width: 5px;
  border-radius: 16px;
  overflow: hidden;
  transition: all 300ms ease;
  box-shadow: 0 6px 0 rgba(0,0,0,0.15), 0 10px 20px rgba(0,0,0,0.2);
  color: #000000 !important;
  margin-bottom: 1rem;
}
.faq-item * {
  color: #000000 !important;
}
.faq-item:hover {
  border-color: #000000;
  transform: translateY(-2px);
  box-shadow: 0 8px 0 rgba(0,0,0,0.15), 0 12px 25px rgba(0,0,0,0.2);
}

.faq-item summary {
  padding: 1.25rem 1.5rem;
  font-weight: 600;
  cursor: pointer;
  color: #000000 !important;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s ease;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  font-size: 1.5rem;
  font-weight: 300;
  color: #000000 !important;
  transition: transform 0.3s ease;
}
.faq-item[open] summary::after { 
  content: '−';
  transform: rotate(180deg); 
}
.faq-answer {
  padding: 0 1.5rem 1.5rem;
  color: #333333 !important;
  line-height: 1.8;
  font-size: 0.95rem;
  animation: fadeIn 0.4s ease-out;
}

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

.faq-item * {
  color: inherit;
}

.faq-search {
  margin-bottom: 1rem;
}

.faq-empty {
  margin-top: 0.9rem;
  color: var(--color-text-secondary);
  font-size: 0.9rem;
}

/* Content section (for about/terms/etc) */
.content-section {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  padding: 2.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  margin: 0 auto;
}
.content-section * {
  color: #000000 !important;
}
.content-section h2 {
  font-size: 1.5rem; font-weight: 700; margin-bottom: 1.5rem;
  display: flex; align-items: center; gap: 0.75rem;
}
.content-section h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 2rem 0 1rem;
  color: #000000 !important;
}
.content-section p { color: #000000 !important; margin-bottom: 1rem; line-height: 1.8; }
.content-section ul, .content-section ol {
  color: #000000 !important; margin-bottom: 1rem; padding-left: 1.5rem; line-height: 1.8;
}
.content-section li { margin-bottom: 0.5rem; }

/* Blog cards */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}
.blog-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  overflow: hidden;
  transition: all 250ms ease;
  text-decoration: none;
  color: inherit;
}
.blog-card:hover { border-color: var(--color-border-hover); transform: translateY(-4px); box-shadow: 0 0 30px rgba(99,102,241,0.15); }
.blog-card img { width: 100%; height: 200px; object-fit: cover; }
.blog-card-body { padding: 1.5rem; }
.blog-card-body h3 { font-size: 1.125rem; font-weight: 600; margin-bottom: 0.5rem; color: var(--color-text-primary); }
.blog-card-body p { font-size: 0.875rem; color: var(--color-text-secondary); line-height: 1.6; margin-bottom: 1rem; }
.blog-card-cta { font-size: 0.875rem; color: var(--color-text-accent); font-weight: 500; }

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 2rem;
}
.pagination a, .pagination span {
  padding: 0.5rem 1rem;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: all 150ms ease;
}
.pagination a:hover { border-color: var(--color-border-hover); color: var(--color-text-primary); }
.pagination .active { background: rgba(99,102,241,0.15); color: var(--color-text-accent); border-color: rgba(99,102,241,0.3); }
.pagination .disabled { opacity: 0.4; pointer-events: none; }

/* Footer */
.footer {
  background: var(--color-bg-card);
  border-top: 1px solid var(--color-border);
  padding: 3rem 0 2rem;
  margin-top: 4rem;
  color: #000000 !important;
}
.footer * {
  color: #000000 !important;
  font-weight: 600 !important;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}
@media (max-width: 768px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }

.footer-brand p { color: var(--color-text-secondary); font-size: 0.875rem; line-height: 1.7; margin-top: 1rem; max-width: 320px; }
.footer-brand-social { margin-top: 1rem; }
.footer-col h4 {
  font-size: 0.875rem; font-weight: 600; color: var(--color-text-primary);
  margin-bottom: 1rem; text-transform: uppercase; letter-spacing: 0.06em;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 0.5rem; }
.footer-col a { font-size: 0.875rem; color: var(--color-text-muted); transition: color 150ms ease; }
.footer-col a:hover { color: var(--color-text-accent); }

.footer-social {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.65rem;
  padding: 0.5rem;
  border-radius: 16px;
  background: linear-gradient(140deg, rgba(255,255,255,0.95), rgba(241,245,249,0.82));
  border: 1px solid rgba(15,23,42,0.1);
  box-shadow: 0 10px 28px rgba(15,23,42,0.08), inset 0 1px 0 rgba(255,255,255,0.9);
  backdrop-filter: blur(10px);
}
.footer-social a {
  --brand-rgb: 99,102,241;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(155deg, rgba(255,255,255,0.98), rgba(235,241,249,0.92));
  border: 1px solid rgba(15,23,42,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0f172a !important;
  line-height: 0;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(15,23,42,0.08), inset 0 1px 0 rgba(255,255,255,0.88);
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 220ms ease, background 220ms ease, border-color 220ms ease, color 180ms ease;
}
.footer-social a::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(255,255,255,0.68), transparent 62%);
  opacity: 0.92;
  transition: opacity 180ms ease;
  pointer-events: none;
}
.footer-social a::after {
  content: "";
  position: absolute;
  inset: -24%;
  background: radial-gradient(circle, rgba(var(--brand-rgb),0.35) 0%, rgba(var(--brand-rgb),0) 70%);
  opacity: 0;
  transform: scale(0.78);
  transition: opacity 220ms ease, transform 220ms ease;
  pointer-events: none;
}
.footer-social a svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  position: relative;
  z-index: 1;
}
.footer-social a[data-social="facebook"] { --brand-rgb: 24,119,242; }
.footer-social a[data-social="youtube"] { --brand-rgb: 255,0,0; }
.footer-social a[data-social="linkedin"] { --brand-rgb: 10,102,194; }
.footer-social a[data-social="bluesky"] { --brand-rgb: 0,133,255; }
.footer-social a[data-social="instagram"] { --brand-rgb: 225,48,108; }
.footer-social a[data-social="x"] { --brand-rgb: 17,24,39; }
.footer-social a:hover,
.footer-social a:focus-visible {
  transform: translateY(-3px) scale(1.03);
  border-color: rgba(var(--brand-rgb),0.58);
  background: linear-gradient(145deg, rgba(var(--brand-rgb),0.98), rgba(var(--brand-rgb),0.76));
  color: #ffffff !important;
  box-shadow: 0 12px 24px rgba(var(--brand-rgb),0.36), 0 4px 10px rgba(15,23,42,0.15);
  outline: none;
}
.footer-social a:hover::before,
.footer-social a:focus-visible::before { opacity: 0.14; }
.footer-social a:hover::after,
.footer-social a:focus-visible::after {
  opacity: 0.95;
  transform: scale(1);
}
.footer-social a:focus-visible {
  box-shadow: 0 12px 24px rgba(var(--brand-rgb),0.36), 0 0 0 3px rgba(255,255,255,0.92), 0 0 0 6px rgba(var(--brand-rgb),0.34);
}
@media (max-width: 480px) {
  .footer-social { gap: 0.65rem; padding: 0.45rem; }
  .footer-social a { width: 40px; height: 40px; border-radius: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  .footer-social a,
  .footer-social a::before,
  .footer-social a::after { transition: none; }
  .footer-social a:hover,
  .footer-social a:focus-visible { transform: none; }
}

.locale-switcher { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
.locale-switcher a {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  color: var(--color-text-muted);
  transition: all 150ms ease;
}
.locale-switcher a:hover, .locale-switcher a.current {
  border-color: rgba(99,102,241,0.3);
  color: var(--color-text-accent);
  background: rgba(99,102,241,0.08);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 2rem;
  border-top: 1px solid var(--color-border);
  font-size: 0.875rem;
  color: var(--color-text-muted);
}
@media (max-width: 640px) {
  .footer-bottom { flex-direction: column; gap: 1rem; text-align: center; }
}

/* Page hero (inner pages) */
.page-hero {
  padding: 3rem 0 2rem;
  text-align: center;
}
.page-hero h1 {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 800;
  margin-bottom: 0.75rem;
  color: #000000 !important;
}
.page-hero p {
  font-size: 1.125rem;
  color: #000000 !important;
  max-width: 600px;
  margin: 0 auto;
}

/* Blog single article */
.article-hero { padding: 3rem 0 2rem; text-align: center; }
.article-hero h1 { font-size: clamp(1.5rem, 4vw, 2.5rem); font-weight: 800; margin-bottom: 1rem; }
.article-hero p { font-size: 1.125rem; color: var(--color-text-secondary); max-width: 650px; margin: 0 auto 1.5rem; }
.article-hero img { width: 100%; max-height: 400px; object-fit: cover; border-radius: 16px;  border: 1px solid var(--color-border); }
.article-content { padding: 2rem 0 4rem; }
.article-content h2 { font-size: 1.5rem; font-weight: 700; margin: 2rem 0 1rem; }
.article-content h3 { font-size: 1.25rem; font-weight: 600; margin: 1.5rem 0 0.75rem; color: var(--color-text-accent); }
.article-content p { color: var(--color-text-secondary); margin-bottom: 1rem; line-height: 1.8; }
.article-content ul, .article-content ol { color: var(--color-text-secondary); margin-bottom: 1rem; padding-left: 1.5rem; }
.article-content li { margin-bottom: 0.5rem; }
.article-content code {
  font-family: var(--font-mono);
  background: rgba(99,102,241,0.1);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.9em;
  color: var(--color-text-accent);
}
.article-content pre {
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 1.5rem;
  overflow-x: auto;
  margin-bottom: 1rem;
}
.article-content pre code { background: none; padding: 0; }

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Contact form status */
.form-status {
  padding: 1rem;
  border-radius: 10px;
  font-size: 0.875rem;
  margin-top: 1rem;
}
.form-status.success { background: rgba(16,185,129,0.1); color: var(--color-success); border: 1px solid rgba(16,185,129,0.2); }
.form-status.error { background: rgba(239,68,68,0.1); color: var(--color-error); border: 1px solid rgba(239,68,68,0.2); }

/* Sitemap page */
.sitemap-section { margin-bottom: 2rem; }
.sitemap-section h2 { font-size: 1.25rem; font-weight: 600; margin-bottom: 1rem; color: var(--color-text-accent); }
.sitemap-section ul { list-style: none; padding: 0; }
.sitemap-section li { margin-bottom: 0.5rem; }
.sitemap-section a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(99,102,241,0.05);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 0.875rem;
  transition: all 150ms ease;
}
.sitemap-section a:hover {
  background: rgba(99,102,241,0.1);
  border-color: var(--color-border-hover);
}

/* ============================================================
   MOBILE OPTIMIZATION
   ============================================================ */
@media (max-width: 1024px) {
  .features-grid,
  .modes-grid,
  .blog-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  }
}

@media (max-width: 768px) {
  .container { padding: 0 1rem; }

  .header-inner { height: 64px; }
  .logo { gap: 0.55rem; font-size: 1.05rem; }
  .logo-icon {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
  }

  .hero { padding: 2rem 0 0.75rem; }
  .hero-subtitle { margin-bottom: 0; }
  .section { padding: 2.5rem 0; }
  .section-sm { padding: 1.5rem 0; }

  .section-header { margin-bottom: 1.75rem; }
  .section-header p { font-size: 1rem; }

  .solver-card {
    padding: 1.1rem;
    border-radius: 18px;
    border-bottom-width: 5px;
  }
  .solver-card-header {
    gap: 0.6rem;
    margin-bottom: 1rem;
  }
  .solver-card-title { font-size: 1.05rem; }
  .solver-card-subtitle {
    font-size: 0.82rem;
    line-height: 1.4;
  }

  .form-grid { grid-template-columns: 1fr; }
  .btn-group { flex-direction: column; }
  .btn-group .btn { width: 100%; }

  .tabs {
    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }
  .tabs::-webkit-scrollbar { height: 0; }
  .tab {
    flex: 0 0 auto;
    min-width: 7.5rem;
    padding: 0.7rem 0.85rem;
    scroll-snap-align: start;
  }

  .btn,
  .copy-btn,
  .quick-example-btn,
  .interactive-chip,
  .how-diagram-btn {
    min-height: 42px;
  }

  .result-value { font-size: clamp(1.5rem, 9vw, 2rem); }
  .result-header-row { gap: 0.75rem; }
  .result-original-row {
    flex-wrap: wrap;
    row-gap: 0.25rem;
  }
  .result-delta {
    width: 100%;
    margin-left: 0 !important;
  }
  .result-header-row {
    flex-direction: column;
    align-items: stretch !important;
  }
  .result-header-row .copy-btn {
    width: 100%;
    justify-content: center;
    margin-top: 0.65rem;
  }
  .result-original-row span,
  .batch-result-row span,
  .history-item-left span {
    word-break: break-word;
  }

  .number-line-container {
    margin: 1.1rem 0;
    padding: 1rem;
  }
  .number-line { height: 76px; }
  .number-line-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }
  .number-line-legend {
    flex-wrap: wrap;
    gap: 0.55rem !important;
  }
  .number-line-tick-label { font-size: 0.6rem !important; }

  .steps-header {
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: flex-start !important;
  }
  .steps-title { font-size: 1rem !important; }
  .steps-toggle-btn { padding: 0.2rem 0; }

  .batch-result-row {
    flex-wrap: wrap;
    gap: 0.35rem 0.55rem;
    align-items: baseline;
  }
  .batch-result-arrow { margin: 0 !important; }

  .history-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }
  .history-item-left {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
  }

  .quick-examples-card { padding: 1rem !important; }
  .quick-examples {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
  }
  .quick-example-btn {
    width: 100%;
    text-align: center;
    line-height: 1.3;
    padding: 0.6rem 0.65rem;
  }

  .interactive-toolbar,
  .table-explorer-controls,
  .feature-demo-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.25rem;
  }
  .interactive-toolbar::-webkit-scrollbar,
  .table-explorer-controls::-webkit-scrollbar,
  .feature-demo-tabs::-webkit-scrollbar {
    height: 0;
  }

  .modes-grid,
  .features-grid,
  .how-steps,
  .blog-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .feature-card,
  .mode-card,
  .how-step,
  .feature-demo-card,
  .content-section {
    padding: 1.15rem;
    border-radius: 14px;
  }

  .mode-icon,
  .feature-icon {
    width: 46px;
    height: 46px;
    margin-bottom: 0.8rem;
  }
  .how-step-number {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  .content-table-wrapper { margin: 1rem 0; }
  .content-table {
    min-width: 620px;
    font-size: 0.8125rem;
  }
  .content-table th,
  .content-table td {
    padding: 0.65rem 0.8rem;
  }

  .faq-item summary { padding: 1rem; }
  .faq-answer { padding: 0 1rem 1rem; }

  .footer {
    margin-top: 2.5rem;
    padding: 2rem 0 1.5rem;
  }
}

@media (max-width: 480px) {
  .container { padding: 0 0.85rem; }

  .logo { font-size: 0.96rem; }
  .logo-icon {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
  }
  .mobile-overlay .nav-link {
    width: min(90vw, 320px);
    text-align: center;
  }

  .hero h1 { font-size: clamp(1.6rem, 10vw, 2.1rem); }
  .hero-subtitle { font-size: 0.95rem; }
  .tabs { padding: 0.2rem; }
  .tab {
    min-width: 6.85rem;
    font-size: 0.78rem;
    padding: 0.62rem 0.7rem;
  }

  .quick-examples { grid-template-columns: 1fr; }
  .result-value { word-break: break-word; }
  .number-line {
    margin-bottom: 1.5rem;
    height: 88px;
  }
  .number-line-tick-label { display: none !important; }

  .article-hero,
  .page-hero { padding-top: 2rem; }
}


.content-section p {
  max-width: none;
  line-height: 1.8;
  margin-bottom: 1.5rem;
}
.content-section h3 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 1rem;
}
.content-section h3:first-child {
  margin-top: 0;
}


/* New Cards */
.example-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 1.5rem;
  transition: all 300ms ease;
  box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}
.example-card:hover {
  transform: translateY(-4px);
  border-color: rgba(99,102,241,0.4);
  box-shadow: 0 12px 30px rgba(0,0,0,0.1);
}
.example-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px dashed var(--color-border);
}
.example-card-original { font-size: 1.25rem; font-weight: 700; }
.example-card-method { font-size: 0.85rem; color: var(--color-text-accent); font-weight: 600; padding: 0.25rem 0.75rem; background: rgba(99,102,241,0.1); border-radius: 9999px; }
.example-card-result { font-family: var(--font-mono); font-size: 1.5rem; font-weight: 700; color: var(--color-text-accent); margin-bottom: 0.5rem; }
.example-card-explanation { font-size: 0.9rem; color: #444; line-height: 1.6; }

.example-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.method-card {
  background: var(--color-bg-card);
  border: 2px solid #000000;
  border-bottom-width: 5px;
  border-radius: 16px;
  padding: 1.5rem;
  transition: all 300ms ease;
  box-shadow: 0 6px 0 rgba(0,0,0,0.15), 0 10px 20px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
  height: 100%;
  color: #000000 !important;
}
.method-card * {
  color: #000000 !important;
}
.method-card:hover {
  transform: translateY(-4px);
  border-color: #000000;
  box-shadow: 0 10px 0 rgba(0,0,0,0.15), 0 16px 30px rgba(0,0,0,0.2);
}
.method-card h3 { font-size: 1.125rem; font-weight: 700; margin-bottom: 0.75rem; }
.method-card p { font-size: 0.95rem; line-height: 1.6; margin-bottom: 1.5rem; flex-grow: 1; }
.method-card .mode-example { margin-top: auto; margin-bottom: 0; background: rgba(255,255,255,0.6); border: 1px solid rgba(0,0,0,0.15); color: #000000 !important; }
.method-card .btn { width: 100%; }

.method-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}


/* Final Tweaks */
.content-section { max-width: 900px; }
.content-table-wrapper { border-radius: 16px; box-shadow: 0 4px 20px rgba(0,0,0,0.05); border: 1px solid var(--color-border); }


/* Final Tweaks 2 */
.content-table th, .content-table td { border: 1px solid var(--color-border); }

/* --------------------------------- */
/* 10-Section Layout Additions       */
/* --------------------------------- */

/* How It Works Steps */
.how-steps {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .how-steps {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 1rem;
  }
}

.how-step {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1.5rem;
  position: relative;
  flex: 1;
  text-align: center;
  box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}

.how-step-number {
  width: 32px;
  height: 32px;
  background: var(--color-primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  margin: 0 auto 1rem;
  font-size: 1.2rem;
}

.how-step h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.how-step p {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
}

/* Method Card Extras */
.mode-example {
  background: var(--color-background);
  border-radius: 6px;
  padding: 0.75rem;
  margin: 1rem 0;
  font-family: monospace;
  font-size: 0.9rem;
  text-align: center;
  border: 1px solid var(--color-border);
  color: var(--color-text);
}

/* FAQ Accordion */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.faq-item {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}

.faq-item:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.faq-item summary {
  padding: 1.5rem;
  font-weight: 600;
  font-size: 1.1rem;
  cursor: pointer;
  list-style: none;
  position: relative;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: '+';
  position: absolute;
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.5rem;
  color: var(--color-primary);
}

.faq-item[open] summary::after {
  content: '-';
}

.faq-answer {
  padding: 0 1.5rem 1.5rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
}

/* ── Rounding Methods Reference Table ── */
.rounding-table-section {
  padding-top: 4rem;
  padding-bottom: 4rem;
}

.rounding-table-subtitle {
  font-size: 1.1rem;
  color: var(--color-text-secondary);
  max-width: 640px;
  margin: 0 auto;
}

/* Outer beige card container */
.rounding-table-card {
  background-color: #d5d8ce;
  border-radius: 20px;
  padding: 2.5rem;
  color: #1a1a1a;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

/* Description text inside the card */
.rounding-table-desc {
  margin-bottom: 2rem;
  font-size: 1.1rem;
  font-family: var(--font-sans);
  color: #1a1a1a;
}

/* Inner wrapper for table border and overflow */
.rounding-table-inner {
  border-radius: 12px;
  border: 1px solid #b4b9af;
  overflow-x: auto;
}

/* The table itself */
.rounding-ref-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: #1a1a1a;
  min-width: 600px;
}

/* Lavender header */
.rounding-ref-table thead tr {
  background-color: #c5c9d6;
}

.rounding-ref-table th {
  text-align: left;
  padding: 1rem 1.25rem;
  font-weight: 600;
  font-family: var(--font-sans);
  border-bottom: 1px solid #b4b9af;
  border-right: 1px solid #b4b9af;
  color: #1a1a1a;
  white-space: nowrap;
}

.rounding-ref-table th:last-child {
  border-right: none;
}

.rounding-ref-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #b4b9af;
  border-right: 1px solid #b4b9af;
  line-height: 1.5;
}

.rounding-ref-table td:last-child {
  border-right: none;
}

.rounding-ref-table tbody tr:last-child td {
  border-bottom: none;
}

.rounding-ref-table tbody tr {
  transition: background-color 0.2s ease;
}

.rounding-ref-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.2);
}

.rounding-ref-table .example-value {
  font-family: var(--font-mono);
}

@media (max-width: 768px) {
  .rounding-table-card {
    padding: 1.5rem;
  }
}

/* ============================================================
   NUMBER LINE VISUALIZER
   ============================================================ */
.number-lines-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}
.nl-card {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: 0.75rem;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}
.nl-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  font-weight: 600;
}
.nl-input {
  color: var(--color-text-secondary);
}
.nl-output {
  color: var(--color-text-accent);
}
.nl-track {
  position: relative;
  height: 60px;
  margin-bottom: 1rem;
}
.nl-line {
  position: absolute;
  top: 30px;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--color-border);
  border-radius: 2px;
}
.nl-marker {
  position: absolute;
  transform: translateX(-50%);
}
.nl-tick {
  top: 20px;
  width: 2px;
  height: 24px;
  background: var(--color-text-secondary);
}
.nl-tick span {
  position: absolute;
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.85rem;
  color: var(--color-text-muted);
  font-weight: 500;
}
.nl-point {
  top: 15px;
  width: 14px;
  height: 14px;
  background: var(--color-text-accent);
  border-radius: 50%;
  border: 2px solid var(--color-bg-card);
  box-shadow: 0 0 0 2px var(--color-text-accent);
  z-index: 2;
}
.nl-point span {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.85rem;
  color: var(--color-text-accent);
  font-weight: 700;
  background: var(--color-bg-card);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--color-text-accent);
  white-space: nowrap;
}
.nl-target {
  top: 10px;
  width: 24px;
  height: 24px;
  border: 3px solid var(--color-text-primary);
  border-radius: 50%;
  z-index: 1;
}
.nl-desc {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.5;
  text-align: center;
}

/* ============================================================
   FAQ CALLOUT & STYLED LIST
   ============================================================ */
.faq-callout {
  background: transparent;
  padding: 0;
  border: none;
  margin-top: 2rem;
}
.faq-callout-title {
  color: #ffffff;
  margin-bottom: 2rem;
  text-align: center;
  font-size: 1.75rem;
  font-weight: 800;
}
.faq-callout-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
@media (min-width: 768px) {
  .faq-callout-grid {
    grid-template-columns: 1fr 1fr;
  }
}
.faq-callout-item {
  background: var(--color-bg-card);
  border: 2px solid #000000;
  border-bottom-width: 5px;
  border-radius: 16px;
  padding: 1.5rem;
  transition: all 300ms ease;
  box-shadow: 0 6px 0 rgba(0,0,0,0.15), 0 10px 20px rgba(0,0,0,0.2);
  color: #000000 !important;
}
.faq-callout-item * {
  color: #000000 !important;
}
.faq-callout-item:hover {
  transform: translateY(-4px);
  border-color: #000000;
  box-shadow: 0 10px 0 rgba(0,0,0,0.15), 0 16px 30px rgba(0,0,0,0.2);
}
.faq-callout-item strong {
  display: block;
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}
.faq-callout-item p {
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 0;
}
.styled-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.styled-list li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.75rem;
  color: var(--color-text-primary);
}
.styled-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--color-text-accent);
  font-weight: bold;
}

/* ============================================================
   NEAREST WHOLE CONTENT MISSING STYLES
   ============================================================ */
.mt-4 { margin-top: 2rem; }

.info-card {
  background: rgba(99,102,241,0.1);
  border: 1px solid rgba(99,102,241,0.2);
  padding: 1.5rem;
  border-radius: 0.75rem;
  margin: 2rem 0;
}
.info-card-title {
  color: var(--color-text-primary);
  margin-bottom: 1rem;
}

.rule-header {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.5rem;
}
.rule-header strong {
  color: var(--color-text-primary);
  font-size: 1.1rem;
}
.rule-example {
  background: rgba(0,0,0,0.05);
  padding: 0.75rem;
  border-radius: 0.25rem;
  font-size: 0.95rem;
  color: #000000 !important;
}

.mistake-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(0,0,0,0.15);
  padding: 1rem;
  border-radius: 8px;
  margin-top: 1rem;
}
.mistake-body p {
  margin: 0;
}
.mistake {
  color: var(--color-error);
}
.correction {
  color: var(--color-success);
}

/* ============================================================
   CONTENT COMPONENT STYLES
   ============================================================ */
.styled-list {
  list-style-type: disc;
  list-style-position: inside;
  margin-bottom: 1.5rem;
  color: var(--color-text-secondary);
  font-size: 1.1rem;
  line-height: 1.8;
  text-align: left;
  display: inline-block;
}
.styled-list li { margin-bottom: 0.5rem; }
.how-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; }
.how-step {
  background: var(--color-bg-card);
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid var(--color-border);
  position: relative;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}
.how-step-number {
  position: absolute;
  top: -15px; left: -15px;
  width: 40px; height: 40px;
  background: var(--color-accent-primary);
  color: white !important;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1.2rem;
  border: 3px solid var(--color-bg-primary);
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.how-step h3 { margin-top: 0.5rem; margin-bottom: 0.5rem; font-size: 1.1rem; }
.how-step p { font-size: 1rem; margin-bottom: 0; }
.rounding-ref-table { width: 100%; border-collapse: collapse; margin-bottom: 1rem; }
.rounding-ref-table th, .rounding-ref-table td {
  padding: 1rem; text-align: left; border-bottom: 1px solid var(--color-border);
}
.rounding-ref-table th { background: var(--color-bg-secondary); font-weight: 600; color: #000000; }
.rounding-ref-table td { color: #000000; }
.rule-example {
  background: var(--color-bg-secondary);
  padding: 1.5rem; border-radius: 8px;
  border-left: 4px solid var(--color-accent-primary);
  font-family: var(--font-mono); font-size: 1.1rem; line-height: 1.8;
  color: #000000;
}
.method-card {
  background: var(--color-bg-secondary);
  padding: 1.5rem; border-radius: 12px;
  border: 1px solid var(--color-border);
  margin-bottom: 1.5rem; box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.method-card h3 { font-size: 1.25rem; margin-bottom: 0.5rem; color: #000000; }
.method-card p { font-size: 1rem; margin-bottom: 0; color: #000000; }
