/* PlanSide: Phone Plan Comparator */
:root {
  --blue-700: #1d4ed8;
  --blue-600: #2563eb;
  --blue-500: #3b82f6;
  --blue-100: #dbeafe;
  --blue-50: #eff6ff;
  --green-600: #16a34a;
  --green-50: #f0fdf4;
  --amber-600: #d97706;
  --amber-50: #fffbeb;
  --red-600: #dc2626;
  --gray-900: #111827;
  --gray-700: #374151;
  --gray-600: #4b5563;
  --gray-500: #6b7280;
  --gray-400: #9ca3af;
  --gray-200: #e5e7eb;
  --gray-100: #f3f4f6;
  --gray-50: #f9fafb;
  --white: #ffffff;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.06), 0 1px 3px rgba(0,0,0,.1);
  --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,.1), 0 4px 6px rgba(0,0,0,.05);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --max-width: 1200px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }
body { font-family: var(--font); color: var(--gray-900); background: var(--white); line-height: 1.6; }

a { color: var(--blue-600); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.container { width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.skip-link { position: absolute; top: -40px; left: 0; background: var(--blue-600); color: white; padding: 8px 16px; z-index: 100; font-weight: 600; }
.skip-link:focus { top: 0; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; border: none; border-radius: var(--radius-sm); font-family: var(--font); font-weight: 600; cursor: pointer; transition: all .15s; text-decoration: none; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--blue-600); color: white; }
.btn-primary:hover { background: var(--blue-700); }
.btn-ghost { background: transparent; color: var(--gray-600); }
.btn-ghost:hover { background: var(--gray-100); color: var(--gray-900); }
.btn-outline { background: transparent; color: var(--blue-600); border: 1.5px solid var(--blue-600); }
.btn-outline:hover, .btn-outline.active { background: var(--blue-600); color: white; }
.btn-sm { padding: 6px 14px; font-size: .85rem; }
.btn-lg { padding: 14px 28px; font-size: 1.05rem; }

/* Header */
.site-header { border-bottom: 1px solid var(--gray-200); background: white; position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.2rem; color: var(--gray-900); }
.logo:hover { text-decoration: none; }
.nav { display: flex; gap: 24px; }
.nav-link { font-weight: 500; color: var(--gray-600); padding: 4px 0; }
.nav-link:hover { color: var(--blue-600); text-decoration: none; }

/* Hero */
.hero { padding: 60px 0 40px; background: linear-gradient(180deg, var(--blue-50) 0%, white 100%); }
.hero-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.hero-text h1 { font-size: 2.4rem; line-height: 1.2; margin-bottom: 16px; }
.hero-sub { font-size: 1.15rem; color: var(--gray-600); margin-bottom: 28px; max-width: 500px; }
.hero-card { background: white; border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow-lg); border: 1px solid var(--gray-200); }
.hero-stat { margin-bottom: 12px; }
.stat-number { display: block; font-size: 2.6rem; font-weight: 800; color: var(--green-600); line-height: 1.1; }
.stat-label { display: block; color: var(--gray-600); font-size: .95rem; margin-top: 8px; }
.hero-note { font-size: .8rem; color: var(--gray-400); }

/* Section */
.section-title { font-size: 1.6rem; font-weight: 700; margin-bottom: 28px; text-align: center; }

/* Comparator */
.comparator { padding: 50px 0; }
.compare-layout { display: grid; grid-template-columns: 340px 1fr; gap: 32px; }

.input-panel { background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 24px; position: sticky; top: 80px; align-self: start; max-height: calc(100vh - 100px); overflow-y: auto; }
.panel-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.panel-header h3 { font-size: 1.1rem; }

.usage-fieldset { border: none; padding: 0; margin: 0; }
.field-group { margin-bottom: 20px; }
.field-label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; color: var(--gray-700); }
.field-help { font-size: .78rem; color: var(--gray-500); margin-top: 4px; display: block; }

input[type=range] { width: 100%; accent-color: var(--blue-600); }
.range-row { display: flex; align-items: baseline; gap: 4px; margin-top: 4px; }
range-output, .range-row output { font-weight: 700; font-size: .95rem; }
.range-unit { font-size: .85rem; color: var(--gray-500); }

.line-stepper { display: flex; align-items: center; gap: 8px; }
.line-stepper input { width: 50px; text-align: center; border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm); padding: 6px; font-size: 1rem; font-family: var(--font); }
.step-btn { width: 36px; height: 36px; border-radius: 50%; border: 1.5px solid var(--gray-200); background: white; font-size: 1.2rem; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--gray-700); }
.step-btn:hover { background: var(--gray-100); }

.presets { margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--gray-200); }
.presets-label { font-size: .82rem; color: var(--gray-500); display: block; margin-bottom: 8px; }
.preset-btns { display: flex; flex-wrap: wrap; gap: 6px; }

.custom-plan { margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--gray-200); }
.custom-plan h4 { font-size: .9rem; font-weight: 600; margin-bottom: 10px; color: var(--gray-700); }
.custom-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.custom-fields input { border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm); padding: 8px 10px; font-size: .85rem; font-family: var(--font); width: 100%; }
.custom-fields input:focus { outline: none; border-color: var(--blue-500); box-shadow: 0 0 0 3px var(--blue-100); }

.actions-row { display: flex; gap: 8px; flex-wrap: wrap; }
.save-notice { font-size: .8rem; color: var(--green-600); margin-top: 10px; min-height: 1.2em; }

/* Results */
.results-area { min-width: 0; }
.results-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; flex-wrap: wrap; gap: 8px; }
.results-header h3 { font-size: 1.1rem; }
.results-sub { font-size: .85rem; color: var(--gray-500); }

.table-wrap { overflow-x: auto; border: 1px solid var(--gray-200); border-radius: var(--radius); }
.compare-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.compare-table th { background: var(--gray-50); padding: 10px 12px; text-align: left; font-weight: 600; color: var(--gray-600); border-bottom: 1px solid var(--gray-200); white-space: nowrap; }
.compare-table td { padding: 10px 12px; border-bottom: 1px solid var(--gray-100); }
.compare-table tr:last-child td { border-bottom: none; }
.compare-table tr:hover td { background: var(--blue-50); }
.compare-table tr.best td { background: var(--green-50); }
.compare-table tr.expanded td { background: var(--gray-50); }
.compare-table td:nth-child(7) { font-weight: 700; color: var(--gray-900); }

.match-badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: .75rem; font-weight: 600; }
.match-good { background: var(--green-50); color: var(--green-600); border: 1px solid #bbf7d0; }
.match-warn { background: var(--amber-50); color: var(--amber-600); border: 1px solid #fde68a; }
.match-bad { background: #fef2f2; color: var(--red-600); border: 1px solid #fecaca; }

.row-toggle { background: none; border: none; cursor: pointer; color: var(--blue-600); font-size: .8rem; font-weight: 600; padding: 4px 8px; border-radius: 4px; }
.row-toggle:hover { background: var(--blue-100); }

.fee-breakdown { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; padding: 12px 0; }
.fee-item { display: flex; justify-content: space-between; font-size: .82rem; background: white; border: 1px solid var(--gray-200); border-radius: 6px; padding: 8px 12px; }
.fee-item span:first-child { color: var(--gray-600); }
.fee-item span:last-child { font-weight: 600; }

.best-match { margin-top: 20px; background: linear-gradient(135deg, var(--green-50), var(--blue-50)); border: 1px solid #bbf7d0; border-radius: var(--radius); padding: 20px 24px; display: flex; align-items: center; gap: 20px; }
.best-badge { background: var(--green-600); color: white; padding: 6px 16px; border-radius: 20px; font-weight: 700; font-size: .85rem; white-space: nowrap; }
.best-info { display: flex; flex-direction: column; gap: 2px; }
.best-info strong { font-size: 1.15rem; }
.best-info span { font-size: .9rem; color: var(--gray-600); }

/* How it works */
.how-it-works { padding: 50px 0; background: var(--gray-50); }
.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.step-card { background: white; border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow-sm); border: 1px solid var(--gray-200); }
.step-num { width: 36px; height: 36px; border-radius: 50%; background: var(--blue-600); color: white; font-weight: 700; display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.step-card h3 { font-size: 1.05rem; margin-bottom: 8px; }
.step-card p { font-size: .9rem; color: var(--gray-600); }

/* Scenarios */
.scenarios { padding: 50px 0; }
.scenario-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.scenario-card { border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 24px; }
.scenario-card h3 { font-size: 1rem; margin-bottom: 8px; color: var(--blue-700); }
.scenario-card p { font-size: .88rem; color: var(--gray-600); line-height: 1.65; }
.scenario-card strong { color: var(--gray-700); }

/* Mistakes */
.mistakes { padding: 50px 0; background: var(--gray-50); }
.mistakes-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.mistake-item { background: white; border-radius: var(--radius); padding: 24px; border: 1px solid var(--gray-200); border-left: 4px solid var(--amber-600); }
.mistake-item h3 { font-size: 1rem; margin-bottom: 8px; }
.mistake-item p { font-size: .88rem; color: var(--gray-600); }

/* FAQ */
.faq { padding: 50px 0; }
.faq-list { max-width: 800px; margin: 0 auto; }
.faq-item { border-bottom: 1px solid var(--gray-200); padding: 16px 0; }
.faq-q { width: 100%; text-align: left; background: none; border: none; font-family: var(--font); font-size: 1rem; font-weight: 600; color: var(--gray-900); cursor: pointer; display: flex; justify-content: space-between; align-items: center; padding: 4px 0; }
.faq-q::after { content: '+'; font-size: 1.3rem; color: var(--blue-600); transition: transform .2s; flex-shrink: 0; margin-left: 12px; }
.faq-q[aria-expanded=true]::after { content: '−'; }
.faq-a { font-size: .9rem; color: var(--gray-600); padding-top: 10px; line-height: 1.65; }
.faq-a.hidden { display: none; }

/* Assumptions */
.assumptions { padding: 50px 0; background: var(--amber-50); }
.assumptions-list { max-width: 700px; margin: 0 auto; list-style: none; }
.assumptions-list li { padding: 10px 0 10px 28px; position: relative; font-size: .9rem; color: var(--gray-700); border-bottom: 1px solid #fde68a; }
.assumptions-list li:last-child { border-bottom: none; }
.assumptions-list li::before { content: '⚠'; position: absolute; left: 0; top: 10px; font-size: 1rem; }

/* Footer */
.site-footer { background: var(--gray-900); color: var(--gray-400); padding: 40px 0 24px; }
.footer-inner { display: flex; flex-direction: column; gap: 20px; }
.footer-brand .logo { color: white; }
.footer-tagline { font-size: .85rem; margin-top: 8px; }
.footer-nav { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-nav a { color: var(--gray-400); font-size: .88rem; }
.footer-nav a:hover { color: white; }
.footer-copy { font-size: .78rem; color: var(--gray-500); }

/* Print */
@media print {
  .site-header, .site-footer, .input-panel, .actions-row, .btn, .presets, .custom-plan { display: none !important; }
  .compare-layout { display: block; }
  .hero { padding: 0; background: none; }
  .hero-inner { display: block; }
  .hero-card { box-shadow: none; border: 1px solid #ccc; }
  .best-match { break-inside: avoid; }
  .table-wrap { overflow: visible; }
  .compare-table { font-size: .75rem; }
}

/* Responsive */
@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; }
  .compare-layout { grid-template-columns: 1fr; }
  .input-panel { position: static; max-height: none; }
  .steps-grid { grid-template-columns: 1fr; }
  .scenario-grid { grid-template-columns: 1fr; }
  .mistakes-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .hero-text h1 { font-size: 1.7rem; }
  .hero-sub { font-size: 1rem; }
  .stat-number { font-size: 2rem; }
  .section-title { font-size: 1.3rem; }
  .nav { gap: 14px; }
  .nav-link { font-size: .88rem; }
  .compare-table { font-size: .78rem; }
  .compare-table th, .compare-table td { padding: 8px 6px; }
  .custom-fields { grid-template-columns: 1fr; }
  .best-match { flex-direction: column; align-items: flex-start; gap: 10px; }
}

/* Focus styles */
*:focus-visible { outline: 2px solid var(--blue-500); outline-offset: 2px; }

input:focus-visible { outline: 2px solid var(--blue-500); outline-offset: 1px; border-color: var(--blue-500); }



/* Factory-injected deployment helpers. The AI owns the site design above this block. */
.ad-unit {
  width: min(100%, 720px);
  min-height: 120px;
  margin: 24px auto;
  display: block;
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 40px auto;
}

.factory-fallback-nav {
  width: min(900px, calc(100% - 32px));
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 0.95rem;
}

.factory-fallback-nav a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
