*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --brand: #3C3FDE; --brand-dark: #2a2db8; --brand-darker: #1e2090;
  --brand-mid: #6366ef; --brand-50: #f0f0fe; --brand-100: #d4d5fb; --brand-200: #a9abf7;
  --slate-50: #f8fafc; --slate-100: #f1f5f9; --slate-200: #e2e8f0;
  --slate-300: #cbd5e1; --slate-400: #94a3b8; --slate-500: #64748b;
  --slate-600: #475569; --slate-700: #334155; --slate-800: #1e293b; --slate-900: #0f172a;
  --white: #fff;
  --orange: #ea580c; --orange-bg: #fff7ed; --orange-light: #fed7aa;
  --green: #16a34a; --green-bg: #f0fdf4; --green-light: #bbf7d0;
  --red: #e11d48; --red-bg: #fff1f2; --red-light: #fecdd3;
  --yellow: #ca8a04; --yellow-bg: #fefce8; --yellow-light: #fef08a;
  --sky: #0284c7; --sky-bg: #f0f9ff; --sky-light: #bae6fd;
  --radius-sm: 8px; --radius-md: 12px; --radius-lg: 16px;
}
html { scroll-behavior: smooth; }
body { font-family: 'Poppins', sans-serif; background: var(--slate-50); color: var(--slate-800); line-height: 1.6; -webkit-font-smoothing: antialiased; }
h1,h2,h3,h4 { font-family: 'Space Grotesk', sans-serif; }

/* NAV */
nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.94); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--slate-200);
  padding: 0 2.5rem; height: 66px;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-logo { text-decoration: none; display: flex; align-items: center; gap: 10px; }
.nav-logo-mark {
  width: 34px; height: 34px; background: var(--brand);
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
}
.nav-logo-mark svg { width: 18px; height: 18px; stroke: #fff; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.nav-logo-text { font-family: 'Space Grotesk', sans-serif; font-size: 1rem; font-weight: 700; color: var(--slate-900); letter-spacing: -.02em; }
.nav-links { display: flex; align-items: center; gap: 2rem; list-style: none; }
.nav-links a { font-size: .875rem; font-weight: 500; color: var(--slate-600); text-decoration: none; transition: color .2s; }
.nav-links a:hover { color: var(--brand); }
.nav-cta { background: var(--brand) !important; color: #fff !important; padding: 9px 22px; border-radius: var(--radius-sm); font-weight: 600 !important; }
.nav-cta:hover { background: var(--brand-dark) !important; }

/* HERO */
.tool-hero {
  background: linear-gradient(135deg, var(--brand-darker) 0%, var(--brand) 55%, var(--brand-mid) 100%);
  padding: 52px 2rem 48px; text-align: center; position: relative; overflow: hidden;
}
.tool-hero::before {
  content: ''; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,0.04) 1px,transparent 1px), linear-gradient(90deg,rgba(255,255,255,0.04) 1px,transparent 1px);
  background-size: 40px 40px; pointer-events: none;
}
.tool-hero-inner { position: relative; }
.breadcrumb { display: flex; align-items: center; justify-content: center; gap: 6px; margin-bottom: 18px; }
.breadcrumb a { font-size: .75rem; color: rgba(255,255,255,.6); text-decoration: none; }
.breadcrumb a:hover { color: rgba(255,255,255,.9); }
.breadcrumb span { font-size: .75rem; color: rgba(255,255,255,.4); }
.tool-hero h1 { font-size: clamp(1.7rem,4vw,2.5rem); font-weight: 700; color: #fff; letter-spacing: -.03em; line-height: 1.12; margin-bottom: 12px; }
.tool-hero h1 em { font-style: normal; color: #a5b4fc; }
.tool-hero p { font-size: .95rem; color: rgba(255,255,255,.7); max-width: 520px; margin: 0 auto 24px; line-height: 1.7; }
.hero-badges { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.hero-badge { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); color: rgba(255,255,255,.85); font-size: .72rem; font-weight: 500; padding: 5px 12px; border-radius: 100px; }
.hero-badge svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* MAIN LAYOUT */
.calculator-wrap {
  max-width: 1200px; margin: 0 auto; padding: 48px 2.5rem;
  display: grid; grid-template-columns: 1fr 360px; gap: 28px; align-items: start;
}

/* STEP CARD */
.step-card {
  background: var(--white); border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-lg); margin-bottom: 20px; overflow: hidden;
}
.step-header {
  display: flex; align-items: center; gap: 14px; padding: 20px 24px;
  cursor: pointer; transition: background .2s; user-select: none;
}
.step-header:hover { background: var(--slate-50); }
.step-num {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--brand-50); border: 2px solid var(--brand-200);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  font-family: 'Space Grotesk', sans-serif; font-size: .8rem; font-weight: 700; color: var(--brand);
}
.step-num.done { background: var(--brand); border-color: var(--brand); color: #fff; }
.step-title-wrap { flex: 1; }
.step-title { font-size: .95rem; font-weight: 600; color: var(--slate-900); letter-spacing: -.01em; }
.step-sub { font-size: .78rem; color: var(--slate-400); margin-top: 1px; }
.step-chevron { width: 18px; height: 18px; stroke: var(--slate-400); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; flex-shrink: 0; }
.step-chevron.open { transform: rotate(180deg); }
.step-body { padding: 0 24px 24px; border-top: 1px solid var(--slate-100); display: none; }
.step-body.open { display: block; padding-top: 20px; }

/* FORM ELEMENTS */
.field-group { margin-bottom: 18px; }
.field-label { font-size: .8rem; font-weight: 600; color: var(--slate-700); margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.field-label .tip { font-size: .72rem; font-weight: 400; color: var(--slate-400); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
input[type="number"], select {
  font-family: 'Poppins', sans-serif; font-size: .875rem;
  width: 100%; padding: 10px 12px;
  background: var(--slate-50); border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-sm); color: var(--slate-800); outline: none;
  transition: border-color .2s, box-shadow .2s;
}
input[type="number"]:focus, select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(60,63,222,.08); background: var(--white); }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 32px; cursor: pointer; }
.input-prefix-wrap { position: relative; }
.input-prefix { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: .8rem; color: var(--slate-400); pointer-events: none; }
.input-prefix-wrap input { padding-left: 26px; }
.input-suffix-wrap { position: relative; }
.input-suffix { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: .8rem; color: var(--slate-400); pointer-events: none; }
.input-suffix-wrap input { padding-right: 52px; }

/* SLIDER */
.slider-wrap { margin-top: 6px; }
input[type="range"] { width: 100%; height: 6px; appearance: none; background: var(--slate-200); border-radius: 3px; outline: none; cursor: pointer; }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--brand); border: 2px solid #fff; box-shadow: 0 2px 6px rgba(60,63,222,.3); cursor: pointer; }
.slider-labels { display: flex; justify-content: space-between; font-size: .72rem; color: var(--slate-400); margin-top: 4px; }
.slider-value-display { font-family: 'Space Grotesk', sans-serif; font-size: .85rem; font-weight: 700; color: var(--brand); background: var(--brand-50); border: 1px solid var(--brand-100); border-radius: 6px; padding: 2px 10px; display: inline-block; margin-bottom: 6px; }

/* DEVICE TOGGLES */
.device-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 4px; }
.device-toggle {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  border: 1.5px solid var(--slate-200); border-radius: var(--radius-sm);
  background: var(--white); cursor: pointer; transition: all .2s;
  font-family: 'Poppins', sans-serif;
}
.device-toggle:hover { border-color: var(--brand-200); }
.device-toggle.active { background: var(--brand-50); border-color: var(--brand); }
.device-icon { width: 36px; height: 36px; border-radius: 8px; background: var(--slate-100); display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: background .2s; }
.device-toggle.active .device-icon { background: var(--brand-100); }
.device-icon svg { width: 18px; height: 18px; stroke: var(--slate-500); fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; transition: stroke .2s; }
.device-toggle.active .device-icon svg { stroke: var(--brand); }
.device-info { flex: 1; }
.device-name { font-size: .8rem; font-weight: 600; color: var(--slate-700); transition: color .2s; }
.device-toggle.active .device-name { color: var(--brand); }
.device-mbps { font-size: .7rem; color: var(--slate-400); }
.device-count-wrap { display: flex; align-items: center; gap: 6px; }
.device-count-btn { width: 24px; height: 24px; border-radius: 6px; border: 1.5px solid var(--slate-200); background: var(--white); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: .85rem; color: var(--slate-600); transition: all .15s; font-family: 'Space Grotesk', sans-serif; font-weight: 700; flex-shrink: 0; }
.device-count-btn:hover { border-color: var(--brand); color: var(--brand); }
.device-count-num { font-family: 'Space Grotesk', sans-serif; font-size: .85rem; font-weight: 700; color: var(--slate-800); min-width: 20px; text-align: center; }

/* USAGE PILLS */
.usage-pills { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.usage-pill {
  padding: 7px 14px; border-radius: 100px;
  border: 1.5px solid var(--slate-200); background: var(--white);
  font-family: 'Poppins', sans-serif; font-size: .78rem; font-weight: 500;
  color: var(--slate-600); cursor: pointer; transition: all .2s;
}
.usage-pill:hover { border-color: var(--brand-200); color: var(--brand); }
.usage-pill.active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* CALC BUTTON */
.calc-btn {
  width: 100%; padding: 14px;
  background: var(--brand); color: #fff;
  font-family: 'Space Grotesk', sans-serif; font-size: .95rem; font-weight: 700;
  border: none; border-radius: var(--radius-md); cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: background .2s, transform .15s, box-shadow .15s;
  letter-spacing: -.01em; margin-top: 8px;
}
.calc-btn:hover { background: var(--brand-dark); transform: translateY(-1px); box-shadow: 0 8px 24px rgba(60,63,222,.3); }
.calc-btn svg { width: 18px; height: 18px; stroke: #fff; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.reset-btn {
  width: 100%; padding: 10px; margin-top: 10px;
  background: transparent; color: var(--slate-500);
  font-family: 'Poppins', sans-serif; font-size: .82rem; font-weight: 500;
  border: 1.5px solid var(--slate-200); border-radius: var(--radius-sm); cursor: pointer;
  transition: border-color .2s, color .2s;
}
.reset-btn:hover { border-color: var(--slate-300); color: var(--slate-700); }

/* RESULTS PANEL */
.results-panel { position: sticky; top: 82px; }
.results-card {
  background: var(--white); border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-lg); overflow: hidden;
}
.results-header {
  background: linear-gradient(135deg, var(--brand-darker), var(--brand));
  padding: 24px;
}
.results-header-label { font-size: .72rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.65); margin-bottom: 6px; }
.verdict-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 14px; border-radius: 100px; margin-bottom: 10px;
  font-family: 'Space Grotesk', sans-serif; font-size: .75rem; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase;
}
.verdict-badge.good { background: rgba(74,222,128,.2); color: #4ade80; border: 1px solid rgba(74,222,128,.3); }
.verdict-badge.warn { background: rgba(251,191,36,.2); color: #fbbf24; border: 1px solid rgba(251,191,36,.3); }
.verdict-badge.bad { background: rgba(248,113,113,.2); color: #f87171; border: 1px solid rgba(248,113,113,.3); }
.verdict-badge.neutral { background: rgba(255,255,255,.15); color: rgba(255,255,255,.8); border: 1px solid rgba(255,255,255,.2); }
.verdict-badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.results-main-score {
  font-family: 'Space Grotesk', sans-serif; font-size: 2.6rem; font-weight: 700;
  color: #fff; letter-spacing: -.04em; line-height: 1;
}
.results-main-score span { font-size: 1rem; font-weight: 400; color: rgba(255,255,255,.65); }
.results-subtext { font-size: .78rem; color: rgba(255,255,255,.6); margin-top: 5px; }

.results-body { padding: 20px 24px; }
.result-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 0; border-bottom: 1px solid var(--slate-100);
}
.result-row:last-child { border-bottom: none; }
.result-row-left { display: flex; align-items: center; gap: 10px; }
.result-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.result-name { font-size: .83rem; color: var(--slate-600); }
.result-val { font-family: 'Space Grotesk', sans-serif; font-size: .88rem; font-weight: 700; color: var(--slate-800); }
.result-val.good { color: var(--green); }
.result-val.warn { color: var(--yellow); }
.result-val.bad { color: var(--red); }

/* EMPTY STATE */
.results-empty {
  text-align: center; padding: 36px 20px; color: var(--slate-400);
  font-size: .85rem; line-height: 1.65;
}
.results-empty svg { width: 40px; height: 40px; stroke: var(--slate-300); fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; margin: 0 auto 14px; display: block; }

/* SPEED METER VISUAL */
.speed-meter-wrap { padding: 20px 24px 4px; border-top: 1px solid var(--slate-100); }
.speed-meter-label { font-size: .78rem; font-weight: 600; color: var(--slate-500); margin-bottom: 10px; text-transform: uppercase; letter-spacing: .06em; }
.meter-bar-track { height: 12px; background: var(--slate-100); border-radius: 100px; overflow: hidden; position: relative; }
.meter-bar-fill { height: 100%; border-radius: 100px; transition: width .7s cubic-bezier(.4,0,.2,1); }
.meter-labels { display: flex; justify-content: space-between; font-size: .68rem; color: var(--slate-400); margin-top: 5px; }

/* SAVINGS CARD */
.savings-card {
  background: var(--green-bg); border: 1.5px solid var(--green-light);
  border-radius: var(--radius-lg); padding: 20px; margin-top: 16px;
}
.savings-title { font-family: 'Space Grotesk', sans-serif; font-size: .85rem; font-weight: 700; color: var(--green); margin-bottom: 12px; display: flex; align-items: center; gap: 6px; }
.savings-title svg { width: 16px; height: 16px; stroke: var(--green); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.saving-item { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 10px; font-size: .78rem; color: #166534; line-height: 1.5; }
.saving-item:last-child { margin-bottom: 0; }
.saving-item::before { content: '→'; font-weight: 700; flex-shrink: 0; }

/* WARNING CARD */
.warning-card {
  background: var(--orange-bg); border: 1.5px solid var(--orange-light);
  border-radius: var(--radius-lg); padding: 20px; margin-top: 16px;
}
.warning-title { font-family: 'Space Grotesk', sans-serif; font-size: .85rem; font-weight: 700; color: var(--orange); margin-bottom: 12px; display: flex; align-items: center; gap: 6px; }
.warning-title svg { width: 16px; height: 16px; stroke: var(--orange); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.warning-item { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 10px; font-size: .78rem; color: #9a3412; line-height: 1.5; }
.warning-item:last-child { margin-bottom: 0; }
.warning-item::before { content: '⚠'; flex-shrink: 0; }

/* RECOMMENDED PLAN CARD */
.rec-plan-card {
  background: var(--brand-50); border: 1.5px solid var(--brand-100);
  border-radius: var(--radius-lg); padding: 20px; margin-top: 16px;
}
.rec-plan-title { font-family: 'Space Grotesk', sans-serif; font-size: .85rem; font-weight: 700; color: var(--brand); margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.rec-plan-title svg { width: 16px; height: 16px; stroke: var(--brand); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.rec-plan-speed { font-family: 'Space Grotesk', sans-serif; font-size: 1.8rem; font-weight: 700; color: var(--brand); letter-spacing: -.03em; }
.rec-plan-speed span { font-size: .85rem; font-weight: 400; color: var(--brand-dark); }
.rec-plan-note { font-size: .76rem; color: var(--slate-600); margin-top: 4px; line-height: 1.5; }

/* COMPARISON SECTION */
.comparison-section {
  background: var(--white); border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-lg); padding: 28px 24px; margin-top: 20px;
}
.comparison-title { font-size: .95rem; font-weight: 700; color: var(--slate-900); margin-bottom: 4px; letter-spacing: -.01em; }
.comparison-sub { font-size: .8rem; color: var(--slate-500); margin-bottom: 20px; }
.compare-row { margin-bottom: 16px; }
.compare-label { font-size: .78rem; font-weight: 500; color: var(--slate-600); margin-bottom: 5px; display: flex; justify-content: space-between; }
.compare-bar-track { height: 10px; background: var(--slate-100); border-radius: 100px; overflow: hidden; }
.compare-bar-fill { height: 100%; border-radius: 100px; transition: width .7s ease; }

/* INFO BOX */
.info-box {
  background: var(--slate-50); border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm); padding: 10px 14px; margin-top: 8px;
  font-size: .76rem; color: var(--slate-600); display: flex; align-items: flex-start; gap: 8px; line-height: 1.5;
}
.info-box svg { width: 14px; height: 14px; stroke: var(--slate-400); fill: none; stroke-width: 2; flex-shrink: 0; margin-top: 1px; }

/* FAQ */
.faq-section { max-width: 1200px; margin: 0 auto; padding: 0 2.5rem 64px; }
.faq-title { font-size: clamp(1.2rem,2.5vw,1.55rem); font-weight: 700; color: var(--slate-900); letter-spacing: -.025em; margin-bottom: 24px; }
.faq-item { background: var(--white); border: 1.5px solid var(--slate-200); border-radius: var(--radius-md); margin-bottom: 10px; overflow: hidden; }
.faq-q { padding: 18px 20px; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 14px; font-size: .875rem; font-weight: 600; color: var(--slate-800); transition: background .2s; user-select: none; }
.faq-q:hover { background: var(--slate-50); }
.faq-q svg { width: 16px; height: 16px; stroke: var(--slate-400); fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; flex-shrink: 0; }
.faq-q.open svg { transform: rotate(180deg); }
.faq-a { padding: 0 20px; max-height: 0; overflow: hidden; transition: max-height .3s ease, padding .3s; }
.faq-a.open { padding: 4px 20px 18px; max-height: 300px; }
.faq-a p { font-size: .84rem; color: var(--slate-600); line-height: 1.7; }

/* FOOTER */
footer { background: var(--slate-900); border-top: 1px solid rgba(255,255,255,.06); padding: 40px 2.5rem; }
.footer-inner { max-width: 1140px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 20px; }
.footer-logo-text { font-family: 'Space Grotesk', sans-serif; font-size: 1rem; font-weight: 700; color: rgba(255,255,255,.85); letter-spacing: -.02em; }
.footer-links { display: flex; gap: 1.75rem; list-style: none; flex-wrap: wrap; }
.footer-links a { font-size: .84rem; color: rgba(255,255,255,.42); text-decoration: none; transition: color .2s; }
.footer-links a:hover { color: rgba(255,255,255,.8); }
.footer-bottom { max-width: 1140px; margin: 24px auto 0; padding-top: 24px; border-top: 1px solid rgba(255,255,255,.06); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.footer-copy { font-size: .78rem; color: rgba(255,255,255,.28); }
.footer-tagline { font-size: .78rem; color: rgba(255,255,255,.28); }

/* RESPONSIVE */
@media (max-width: 900px) {
  .calculator-wrap { grid-template-columns: 1fr; }
  .results-panel { position: static; }
  .device-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  nav { padding: 0 1.25rem; }
  .nav-links { display: none; }
  .tool-hero { padding: 44px 1.25rem 40px; }
  .calculator-wrap { padding: 32px 1.25rem; }
  .field-row { grid-template-columns: 1fr; }
  .field-row-3 { grid-template-columns: 1fr 1fr; }
  .faq-section { padding: 0 1.25rem 48px; }
  footer { padding: 36px 1.25rem; }
}
