/* ==============================================
   Fatura Bölüşme Hesaplayıcı – Premium Design
   Senior Frontend Developer Level
   ============================================== */

/* --- Design Tokens --- */
:root {
  /* Palette */
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #eef2ff;
  --primary-50: #e0e7ff;
  --primary-100: #c7d2fe;
  --primary-600: #4f46e5;
  --primary-700: #4338ca;
  --primary-800: #3730a3;
  --secondary: #0d9488;
  --secondary-hover: #0f766e;
  --secondary-light: #ccfbf1;

  /* Neutrals */
  --bg: #f8fafc;
  --bg-alt: #f1f5f9;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --text: #0f172a;
  --text-secondary: #475569;
  --text-tertiary: #94a3b8;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --ring: rgba(79,70,229,.25);

  /* Status */
  --success: #16a34a;
  --success-light: #dcfce7;
  --warning: #d97706;
  --warning-light: #fef3c7;
  --danger: #dc2626;
  --danger-light: #fee2e2;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0,0,0,.05);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -2px rgba(0,0,0,.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -4px rgba(0,0,0,.04);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,.08), 0 8px 10px -6px rgba(0,0,0,.04);
  --shadow-glow: 0 0 0 3px var(--ring);

  /* Radii */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Transitions */
  --ease: cubic-bezier(.4,0,.2,1);
  --duration: .2s;

  /* Layout */
  --max-w: 1200px;
  --max-w-narrow: 780px;
  --header-h: 68px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", "Fira Code", monospace;

  /* Gradients */
  --gradient-hero: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #2563eb 100%);
  --gradient-card: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  --gradient-accent: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
}

/* --- Dark Mode --- */
[data-theme="dark"] {
  --primary: #818cf8;
  --primary-hover: #a5b4fc;
  --primary-light: #1e1b4b;
  --primary-50: #312e81;
  --primary-100: #3730a3;
  --secondary: #2dd4bf;
  --secondary-hover: #5eead4;
  --secondary-light: #042f2e;

  --bg: #0b0f1a;
  --bg-alt: #111827;
  --bg-elevated: #1e293b;
  --surface: #1e293b;
  --text: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-tertiary: #64748b;
  --border: #334155;
  --border-light: #1e293b;
  --ring: rgba(129,140,248,.3);

  --success: #4ade80;
  --success-light: #14532d;
  --warning: #fbbf24;
  --warning-light: #78350f;
  --danger: #f87171;
  --danger-light: #7f1d1d;

  --shadow-xs: 0 1px 2px rgba(0,0,0,.3);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.4);
  --shadow-md: 0 4px 6px rgba(0,0,0,.4);
  --shadow-lg: 0 10px 15px rgba(0,0,0,.5);
  --shadow-xl: 0 20px 25px rgba(0,0,0,.5);

  --gradient-hero: linear-gradient(135deg, #312e81 0%, #4c1d95 50%, #1e3a5f 100%);
  --gradient-card: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--primary); text-decoration: none; transition: color var(--duration) var(--ease); }
a:hover { color: var(--primary-hover); }
img { max-width: 100%; height: auto; display: block; }
button { font-family: var(--font); }

::selection { background: var(--primary-50); color: var(--primary-800); }
[data-theme="dark"] ::selection { background: var(--primary-50); color: var(--primary-hover); }

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-alt); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }

/* ============================
   HEADER
   ============================ */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(255,255,255,.85);
}
[data-theme="dark"] .site-header { background: rgba(30,41,59,.85); }

.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.site-logo {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: .6rem;
  letter-spacing: -.02em;
}
.site-logo:hover { color: var(--primary); text-decoration: none; }
.logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--gradient-accent);
  border-radius: var(--radius-sm);
  font-size: 1.1rem;
  color: #fff;
}

.nav-main { display: flex; align-items: center; gap: .25rem; }
.nav-main a {
  padding: .5rem .85rem;
  border-radius: var(--radius);
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--duration) var(--ease);
  white-space: nowrap;
}
.nav-main a:hover,
.nav-main a.active {
  background: var(--primary-light);
  color: var(--primary);
  text-decoration: none;
}

.header-actions { display: flex; align-items: center; gap: .5rem; }

.btn-theme {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 1.05rem;
  color: var(--text-secondary);
  transition: all var(--duration) var(--ease);
  line-height: 1;
}
.btn-theme:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary-50); }

.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 1.15rem;
  color: var(--text-secondary);
  transition: all var(--duration) var(--ease);
}
.menu-toggle:hover { background: var(--primary-light); color: var(--primary); }

/* ============================
   HERO SECTION
   ============================ */
.hero {
  position: relative;
  background: var(--gradient-hero);
  padding: 4.5rem 1.5rem 3.5rem;
  text-align: center;
  overflow: hidden;
  color: #fff;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}
.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .35rem 1rem;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: var(--radius-full);
  font-size: .8rem;
  font-weight: 600;
  color: rgba(255,255,255,.9);
  margin-bottom: 1.25rem;
  backdrop-filter: blur(4px);
}
.hero h1 {
  font-size: clamp(1.75rem, 4.5vw, 2.75rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1rem;
  letter-spacing: -.03em;
}
.hero .subtitle {
  font-size: clamp(.95rem, 2vw, 1.15rem);
  color: rgba(255,255,255,.85);
  max-width: 560px;
  margin: 0 auto 1.75rem;
  line-height: 1.65;
}
.hero-cta {
  display: flex;
  gap: .75rem;
  justify-content: center;
  flex-wrap: wrap;
}
.hero-cta .btn {
  font-size: .95rem;
  padding: .75rem 1.75rem;
}
.hero-cta .btn-white {
  background: #fff;
  color: var(--primary-700);
}
.hero-cta .btn-white:hover { background: var(--primary-50); }
.hero-cta .btn-outline-white {
  background: rgba(255,255,255,.1);
  border: 1.5px solid rgba(255,255,255,.35);
  color: #fff;
}
.hero-cta .btn-outline-white:hover { background: rgba(255,255,255,.2); }

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255,255,255,.15);
}
.hero-stat { text-align: center; }
.hero-stat-value { font-size: 1.5rem; font-weight: 800; display: block; }
.hero-stat-label { font-size: .8rem; color: rgba(255,255,255,.7); margin-top: .15rem; }

/* ============================
   SECTION HEADING
   ============================ */
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: .75rem;
}
.section-heading h2 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -.02em;
}
.section-heading .section-link {
  font-size: .875rem;
  font-weight: 600;
  color: var(--primary);
}

/* ============================
   LAYOUT
   ============================ */
main { flex: 1; }
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

/* ============================
   CARDS
   ============================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--duration) var(--ease);
  position: relative;
  overflow: hidden;
}
.card:hover { box-shadow: var(--shadow-md); }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.link-card {
  display: flex;
  flex-direction: column;
  color: var(--text);
  cursor: pointer;
}
.link-card:hover {
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-100);
}
.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  font-size: 1.3rem;
  margin-bottom: .85rem;
  background: var(--primary-light);
}
.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: .5rem;
  letter-spacing: -.01em;
}
.card-desc {
  color: var(--text-secondary);
  font-size: .875rem;
  line-height: 1.6;
  flex: 1;
}
.card-arrow {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  color: var(--primary);
  font-weight: 600;
  font-size: .85rem;
  margin-top: 1rem;
  transition: gap var(--duration) var(--ease);
}
.link-card:hover .card-arrow { gap: .6rem; }

/* Feature Card (larger) */
.feature-card { padding: 2rem; }
.feature-card .card-icon {
  width: 56px;
  height: 56px;
  font-size: 1.6rem;
  margin-bottom: 1rem;
}
.feature-card .card-title { font-size: 1.15rem; }

/* Method Card colors */
.card-method-equal .card-icon { background: #dbeafe; }
.card-method-weight .card-icon { background: #fce7f3; }
.card-method-days .card-icon { background: #d1fae5; }
.card-method-rooms .card-icon { background: #fef3c7; }

/* ============================
   BUTTONS
   ============================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding: .6rem 1.25rem;
  border: 1.5px solid transparent;
  border-radius: var(--radius);
  font-size: .875rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  line-height: 1.4;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:focus-visible { outline: none; box-shadow: var(--shadow-glow); }

.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }

.btn-secondary { background: var(--bg-alt); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--border-light); border-color: var(--text-tertiary); }

.btn-success { background: var(--secondary); color: #fff; border-color: var(--secondary); }
.btn-success:hover { background: var(--secondary-hover); border-color: var(--secondary-hover); color: #fff; }

.btn-ghost { background: transparent; color: var(--primary); border-color: transparent; }
.btn-ghost:hover { background: var(--primary-light); }

.btn-sm { padding: .4rem .85rem; font-size: .8rem; }
.btn-lg { padding: .85rem 1.75rem; font-size: 1rem; }
.btn-block { width: 100%; }

.btn-group { display: flex; gap: .5rem; flex-wrap: wrap; }
.btn-group.mt { margin-top: 1.25rem; }

/* ============================
   TOOL / FORM
   ============================ */
.tool-section { max-width: 820px; margin: 0 auto; }

.form-group { margin-bottom: 1.25rem; }
.form-label {
  display: block;
  font-weight: 600;
  font-size: .85rem;
  margin-bottom: .4rem;
  color: var(--text-secondary);
  letter-spacing: .01em;
}

.form-control {
  width: 100%;
  padding: .7rem .9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: .925rem;
  font-family: var(--font);
  background: var(--surface);
  color: var(--text);
  transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--shadow-glow);
}
.form-control.error { border-color: var(--danger); }
.form-control.error:focus { box-shadow: 0 0 0 3px rgba(220,38,38,.2); }

.error-msg { color: var(--danger); font-size: .8rem; margin-top: .3rem; display: none; }
.form-control.error ~ .error-msg,
.form-control.error + .error-msg { display: block; }

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .85rem center;
  padding-right: 2.5rem;
}

.inline-row {
  display: flex;
  gap: .85rem;
  align-items: flex-end;
  flex-wrap: wrap;
}
.inline-row .form-group { flex: 1; min-width: 120px; margin-bottom: 0; }

/* ---- Item Rows ---- */
.items-list { margin-bottom: 1.25rem; }
.item-row {
  display: flex;
  gap: .5rem;
  align-items: center;
  margin-bottom: .5rem;
  animation: slideUp .25s var(--ease);
}
.item-row .form-control { flex: 1; }
.item-row .item-amount { max-width: 140px; }
.btn-remove-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  min-width: 36px;
  background: var(--danger-light);
  color: var(--danger);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: .95rem;
  transition: all var(--duration) var(--ease);
}
.btn-remove-item:hover { background: var(--danger); color: #fff; }

/* ---- Method Tabs ---- */
.method-tabs {
  display: flex;
  gap: .35rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  background: var(--bg-alt);
  padding: .3rem;
  border-radius: var(--radius);
}
.method-tab {
  flex: 1;
  padding: .6rem .75rem;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  font-family: var(--font);
  min-width: fit-content;
}
.method-tab:hover { color: var(--text); background: var(--surface); }
.method-tab.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.method-panel { display: none; }
.method-panel.active { display: block; }

/* ---- Person Rows ---- */
.person-rows { margin-bottom: 1rem; }
.person-row {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: .5rem;
  padding: .6rem .85rem;
  background: var(--bg-alt);
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
}
.person-row .person-label {
  font-weight: 700;
  min-width: 60px;
  font-size: .85rem;
  color: var(--text-secondary);
}
.person-row .form-control {
  max-width: 120px;
  padding: .5rem .7rem;
  font-size: .875rem;
}
.person-row .person-name { max-width: 140px; }

/* ---- Toggle / Checkbox ---- */
.toggle-group {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: .85rem;
}
.toggle-label { font-size: .875rem; color: var(--text-secondary); font-weight: 500; }
.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle .slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background var(--duration) var(--ease);
}
.toggle .slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--duration) var(--ease);
  box-shadow: var(--shadow-xs);
}
.toggle input:checked + .slider { background: var(--primary); }
.toggle input:checked + .slider::before { transform: translateX(20px); }
.toggle input:focus-visible + .slider { box-shadow: var(--shadow-glow); }

.checkbox-group { display: flex; align-items: center; gap: .45rem; margin-bottom: .5rem; }
.checkbox-group input[type="checkbox"] { accent-color: var(--primary); width: 16px; height: 16px; }
.checkbox-group label { font-size: .85rem; color: var(--text-secondary); cursor: pointer; font-weight: 500; }

/* ============================
   RESULTS
   ============================ */
.results-section {
  margin-top: 1.75rem;
  animation: slideUp .35s var(--ease);
}
.results-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
}
.results-table th,
.results-table td {
  padding: .75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
  font-size: .9rem;
}
.results-table th {
  background: var(--bg-alt);
  font-weight: 700;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-tertiary);
}
.results-table tr:last-child td { border-bottom: none; }
.results-table .amount {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: var(--text);
}
.results-table .total-row {
  background: var(--primary-light);
  font-weight: 700;
}
.results-table .total-row td { border-bottom: none; }

.breakdown-toggle {
  font-size: .85rem;
  color: var(--primary);
  cursor: pointer;
  border: none;
  background: none;
  font-family: var(--font);
  font-weight: 600;
  padding: .35rem 0;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  transition: color var(--duration);
}
.breakdown-toggle:hover { color: var(--primary-hover); }
.breakdown-content { display: none; padding: .5rem 0; }
.breakdown-content.open { display: block; }

.summary-box {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  font-size: .9rem;
  font-family: var(--font-mono);
  white-space: pre-line;
  margin-bottom: 1.25rem;
  line-height: 1.8;
}

/* ============================
   DISCLAIMER
   ============================ */
.disclaimer {
  background: var(--warning-light);
  border-left: 4px solid var(--warning);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: .85rem 1.15rem;
  font-size: .85rem;
  color: var(--text);
  margin: 2rem 0;
  line-height: 1.6;
}
.disclaimer strong { color: var(--warning); }

/* ============================
   TOAST
   ============================ */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--text);
  color: var(--bg);
  padding: .8rem 1.5rem;
  border-radius: var(--radius);
  font-size: .875rem;
  font-weight: 600;
  box-shadow: var(--shadow-xl);
  transform: translateY(120px);
  opacity: 0;
  transition: all .35s var(--ease);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.toast.show { transform: translateY(0); opacity: 1; }

/* ============================
   ACCORDION (FAQ)
   ============================ */
.accordion { margin-bottom: .6rem; }
.accordion-header {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  text-align: left;
  font-size: .925rem;
  font-weight: 600;
  font-family: var(--font);
  color: var(--text);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  transition: all var(--duration) var(--ease);
}
.accordion-header:hover { background: var(--bg-alt); border-color: var(--primary-100); }
.accordion-header .icon {
  transition: transform .3s var(--ease);
  font-size: .9rem;
  color: var(--text-tertiary);
  flex-shrink: 0;
}
.accordion.open .accordion-header {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  background: var(--bg-alt);
  color: var(--primary);
}
.accordion.open .accordion-header .icon { transform: rotate(180deg); color: var(--primary); }
.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height .4s var(--ease);
  border: 1px solid transparent;
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
}
.accordion.open .accordion-body {
  max-height: 2000px;
  border-color: var(--border);
}
.accordion-content {
  padding: 1.15rem 1.25rem;
  color: var(--text-secondary);
  font-size: .9rem;
  line-height: 1.75;
}

/* ============================
   BREADCRUMB
   ============================ */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  list-style: none;
  font-size: .82rem;
  color: var(--text-tertiary);
  margin-bottom: 1.5rem;
}
.breadcrumb li { display: flex; align-items: center; }
.breadcrumb li::after { content: '›'; margin-left: .45rem; font-weight: 700; }
.breadcrumb li:last-child::after { content: ''; }
.breadcrumb li:last-child { color: var(--text-secondary); font-weight: 500; }
.breadcrumb a { color: var(--text-tertiary); }
.breadcrumb a:hover { color: var(--primary); }

/* ============================
   ARTICLE
   ============================ */
.article-content { max-width: var(--max-w-narrow); margin: 0 auto; }
.article-content h1 {
  font-size: clamp(1.5rem, 3.5vw, 2.1rem);
  margin-bottom: 1rem;
  line-height: 1.25;
  letter-spacing: -.03em;
  font-weight: 800;
}
.article-content h2 {
  font-size: 1.3rem;
  margin: 2.5rem 0 .85rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
  font-weight: 700;
  letter-spacing: -.02em;
}
.article-content h3 { font-size: 1.1rem; margin: 1.75rem 0 .6rem; font-weight: 700; }
.article-content p { margin-bottom: 1.1rem; color: var(--text-secondary); line-height: 1.8; }
.article-content ul, .article-content ol { margin: .75rem 0 1.25rem 1.5rem; color: var(--text-secondary); line-height: 1.8; }
.article-content li { margin-bottom: .4rem; }
.article-content strong { color: var(--text); }
.article-content blockquote {
  border-left: 4px solid var(--primary);
  padding: .85rem 1.15rem;
  margin: 1.25rem 0;
  background: var(--primary-light);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-secondary);
  font-style: italic;
}
.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}
.article-content th, .article-content td { padding: .6rem .85rem; font-size: .9rem; }
.article-content th { background: var(--bg-alt); font-weight: 700; text-align: left; }
.article-content td { border-top: 1px solid var(--border-light); }

.article-meta {
  color: var(--text-tertiary);
  font-size: .82rem;
  margin-bottom: 1.75rem;
  display: flex;
  align-items: center;
  gap: .4rem;
}

/* ============================
   SEARCH
   ============================ */
.search-box { position: relative; max-width: 640px; margin: 0 auto 1.5rem; }
.search-box input {
  width: 100%;
  padding: .85rem 1.15rem .85rem 3rem;
  font-size: 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--duration), box-shadow var(--duration);
}
.search-box input:focus { outline: none; border-color: var(--primary); box-shadow: var(--shadow-glow); }
.search-box .search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  color: var(--text-tertiary);
}
.search-results { max-width: 640px; margin: 0 auto; }
.search-result-item {
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--border-light);
}
.search-result-item:first-child { padding-top: 0; }
.search-result-item h3 { font-size: .95rem; font-weight: 600; margin-bottom: .25rem; }
.search-result-item h3 a { color: var(--text); }
.search-result-item h3 a:hover { color: var(--primary); }
.search-result-item p { font-size: .85rem; color: var(--text-secondary); margin: 0; line-height: 1.6; }
.search-result-item mark { background: var(--primary-50); color: var(--primary); border-radius: 2px; padding: 0 2px; }

.filter-chips { display: flex; gap: .4rem; flex-wrap: wrap; max-width: 640px; margin: 0 auto 1.5rem; }
.filter-chip {
  padding: .4rem .9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--surface);
  color: var(--text-secondary);
  transition: all var(--duration) var(--ease);
  font-family: var(--font);
}
.filter-chip:hover { border-color: var(--primary); color: var(--primary); }
.filter-chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ============================
   AD SLOTS
   ============================ */
.ad-slot {
  margin: 2rem auto;
  text-align: center;
  min-height: 90px;
  overflow: hidden;
  max-width: var(--max-w-narrow);
}

/* ============================
   PRESET LINKS
   ============================ */
.preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: .65rem;
  margin: 1rem 0;
}
.preset-link {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .7rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: .85rem;
  font-weight: 500;
  transition: all var(--duration) var(--ease);
}
.preset-link:hover {
  border-color: var(--primary-100);
  color: var(--primary);
  text-decoration: none;
  background: var(--primary-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.preset-link::before {
  content: '→';
  color: var(--primary);
  font-weight: 700;
  font-size: .75rem;
  flex-shrink: 0;
}

/* ============================
   RELATED LINKS
   ============================ */
.related-links { margin-top: 2.5rem; }
.related-links h2,
.related-links h3 {
  font-size: 1.1rem;
  margin-bottom: .85rem;
  font-weight: 700;
}
.link-list { list-style: none; }
.link-list li {
  margin-bottom: .5rem;
  padding-left: 1.25rem;
  position: relative;
}
.link-list li::before {
  content: '›';
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: 700;
}
.link-list a { font-size: .9rem; font-weight: 500; }

/* ============================
   FOOTER
   ============================ */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  margin-top: 4rem;
}
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 3rem 1.5rem 1.5rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}
.footer-col h4 {
  font-size: .8rem;
  font-weight: 700;
  margin-bottom: .85rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-tertiary);
}
.footer-col a {
  display: block;
  color: var(--text-secondary);
  font-size: .875rem;
  padding: .25rem 0;
  font-weight: 500;
}
.footer-col a:hover { color: var(--primary); text-decoration: none; }
.footer-bottom {
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: .8rem;
  color: var(--text-tertiary);
}

/* ============================
   UTILITY
   ============================ */
.text-center { text-align: center; }
.text-muted { color: var(--text-tertiary); }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

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

/* ============================
   RESPONSIVE
   ============================ */
@media (max-width: 768px) {
  .nav-main { display: none; }
  .nav-main.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: .75rem;
    box-shadow: var(--shadow-lg);
    z-index: 99;
    animation: slideUp .2s var(--ease);
  }
  .menu-toggle { display: flex; }
  .hero { padding: 3rem 1.25rem 2.5rem; }
  .hero h1 { font-size: 1.6rem; }
  .hero-stats { gap: 1.5rem; flex-wrap: wrap; }
  .card-grid { grid-template-columns: 1fr; }
  .inline-row { flex-direction: column; }
  .inline-row .form-group { min-width: auto; }
  .method-tabs { flex-direction: column; }
  .method-tab { text-align: center; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 1.5rem; }
  .preset-grid { grid-template-columns: 1fr; }
  .item-row { flex-wrap: wrap; }
  .item-row .item-amount { max-width: none; }
  .container { padding: 1.75rem 1.15rem; }
}

@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
  .person-row { flex-wrap: wrap; }
  .person-row .form-control { max-width: none; }
  .hero-cta { flex-direction: column; align-items: center; }
  .hero-cta .btn { width: 100%; max-width: 280px; }
}

/* ============================
   HOW IT WORKS
   ============================ */
.how-it-works {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}
.step-card {
  display: flex;
  gap: 1rem;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: all var(--duration) var(--ease);
}
.step-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  min-width: 48px;
  background: var(--gradient-accent);
  color: #fff;
  font-size: 1.25rem;
  font-weight: 800;
  border-radius: var(--radius);
}
.step-content h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: .35rem;
  letter-spacing: -.01em;
}
.step-content p {
  font-size: .875rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

/* ============================
   FAQ HOME
   ============================ */
.faq-home {
  margin-bottom: 2rem;
}
.faq-home .accordion {
  margin-bottom: .5rem;
}

/* ============================
   PRINT
   ============================ */
@media print {
  .site-header, .site-footer, .ad-slot, .btn-group, .method-tabs,
  .btn-theme, .menu-toggle, .toast, .hero::before { display: none !important; }
  body { background: #fff; color: #000; }
  .hero { background: #f0f0f0; color: #000; }
  .card { box-shadow: none; border: 1px solid #ccc; }
  .results-table th { background: #eee; }
}
