:root {
  --ink: #25233f;
  --muted: #706e87;
  --purple: #6446dc;
  --purple-dark: #5032c4;
  --pink: #ff5c8a;
  --mint: #00a98f;
  --paper: #ffffff;
  --line: #e5e3f0;
  --wash: #f6f5fc;
  font-family: Inter, ui-rounded, "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--wash);
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: radial-gradient(circle at 85% 5%, #eee9ff 0, transparent 29rem), var(--wash); }
button, input { font: inherit; }
button { cursor: pointer; }
.topbar { height: 66px; display: flex; align-items: center; justify-content: space-between; padding: 0 max(22px, calc((100vw - 1180px) / 2)); background: rgba(255,255,255,.88); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-size: 20px; letter-spacing: -.4px; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; color: white; font-weight: 900; background: var(--purple); border-radius: 11px; transform: rotate(-3deg); }
.free-pill { color: #3d277f; background: #eee9ff; padding: 7px 12px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.page-shell { width: min(1180px, calc(100% - 36px)); margin: 0 auto; }
.intro { padding: 52px 0 34px; max-width: 760px; }
.eyebrow { margin: 0 0 10px; color: var(--purple); font-size: 12px; font-weight: 900; letter-spacing: 1.7px; }
.intro h1 { margin: 0; font-size: clamp(36px, 5vw, 62px); line-height: 1.02; letter-spacing: -2.7px; }
.intro h1 span { color: var(--purple); }
.intro > p:last-child { margin: 18px 0 0; color: var(--muted); font-size: 18px; }
.workspace { display: block; }
.main-column { display: grid; gap: 22px; min-width: 0; }
.result-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; align-items: start; }
.card, .options-card { background: var(--paper); border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 12px 36px rgba(51, 42, 103, .07); }
.card { padding: 25px; }
.card-heading, .result-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.card-heading > div, .result-heading > div { display: flex; align-items: center; gap: 11px; }
h2 { margin: 0; font-size: 20px; letter-spacing: -.5px; }
.step { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: #eee9ff; color: var(--purple); font-size: 12px; font-weight: 900; }
.hint { margin: 14px 0 17px; color: var(--muted); font-size: 13px; }
.small-button { border: 0; border-radius: 9px; background: #f0edff; color: var(--purple-dark); padding: 9px 12px; font-size: 12px; font-weight: 800; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 13px; }
table { width: 100%; border-collapse: collapse; min-width: 470px; }
th { padding: 10px 12px; text-align: left; color: var(--muted); background: #faf9fe; font-size: 11px; text-transform: uppercase; letter-spacing: .7px; }
td { border-top: 1px solid var(--line); padding: 0; }
td input { width: 100%; min-width: 80px; padding: 11px 12px; color: var(--ink); background: transparent; border: 0; outline: none; }
td input:focus { background: #f5f2ff; box-shadow: inset 0 0 0 2px #a998f1; }
td:last-child { width: 42px; text-align: center; }
.delete-row { width: 28px; height: 28px; padding: 0; border: 0; border-radius: 8px; color: #9a97ad; background: transparent; font-size: 17px; }
.delete-row:hover { color: #d22f5c; background: #fff0f4; }
.field-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 12px; margin-top: 18px; }
.field-grid label { color: var(--muted); font-size: 11px; font-weight: 800; }
.field-grid input { display: block; width: 100%; margin-top: 6px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); outline: none; }
.field-grid input:focus { border-color: #9b89ea; box-shadow: 0 0 0 3px #eee9ff; }
.primary-button { display: flex; justify-content: center; gap: 11px; width: 100%; margin-top: 19px; padding: 13px 18px; color: white; border: 0; border-radius: 12px; background: linear-gradient(110deg, var(--purple), #7d5ef0); font-weight: 850; box-shadow: 0 8px 20px rgba(100,70,220,.2); }
.primary-button:hover { background: var(--purple-dark); transform: translateY(-1px); }
.primary-button:disabled { opacity: .62; cursor: wait; transform: none; }
.error { margin-top: 13px; padding: 11px 13px; border-radius: 10px; color: #a01d44; background: #fff0f4; font-size: 13px; }
.result-card { min-height: 420px; }
.status { padding: 6px 10px; color: #087b69; background: #e8fbf6; border-radius: 999px; font-size: 11px; font-weight: 800; }
.graph-placeholder { display: grid; place-items: center; align-content: center; gap: 7px; min-height: 340px; margin-top: 19px; border: 2px dashed #dedbef; border-radius: 15px; color: var(--muted); background: #fbfaff; }
.placeholder-icon { color: #a797ea; font-size: 52px; line-height: 1; }
.graph-placeholder small { font-size: 12px; }
.graph { margin-top: 15px; overflow: hidden; border-radius: 13px; }
.graph svg { display: block; width: 100%; height: auto; }
.metrics { grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 13px; }
.metrics > div { padding: 11px 13px; background: #f8f7fd; border-radius: 10px; }
.metrics span, .downloads > span { display: block; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; }
.metrics strong { display: block; margin-top: 4px; color: var(--purple-dark); font-size: 15px; }
.downloads { align-items: center; gap: 8px; margin-top: 16px; padding-top: 15px; border-top: 1px solid var(--line); }
.downloads > span { margin-right: auto; }
.downloads button { padding: 9px 11px; color: var(--purple-dark); background: white; border: 1px solid #cfc7f2; border-radius: 9px; font-size: 11px; font-weight: 850; }
.downloads button:hover { color: white; background: var(--purple); border-color: var(--purple); }
.options-card { position: sticky; top: 85px; display: none; overflow: hidden; padding: 22px; }
.result-layout.has-result .options-card,
.result-layout:has(.graph:not([hidden])) .options-card { display: block; }
.options-heading { display: flex; align-items: center; gap: 12px; padding-bottom: 17px; }
.options-heading > span { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; color: white; background: var(--pink); }
.options-heading small { color: var(--pink); font-size: 9px; font-weight: 900; letter-spacing: 1.2px; }
.options-heading h2 { margin-top: 2px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 15px 0; border-top: 1px solid var(--line); cursor: pointer; }
.switch-row span { display: grid; gap: 3px; }
.switch-row strong { font-size: 13px; }
.switch-row small { color: var(--muted); font-size: 10px; }
.switch-row input { position: absolute; opacity: 0; pointer-events: none; }
.switch-row i { position: relative; width: 41px; height: 23px; flex: 0 0 auto; border-radius: 99px; background: #ccc9d8; transition: .18s; }
.switch-row i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: white; box-shadow: 0 2px 5px #7775; transition: .18s; }
.switch-row input:checked + i { background: var(--purple); }
.switch-row input:checked + i::after { transform: translateX(18px); }
.switch-row input:focus-visible + i { outline: 3px solid #cabff7; outline-offset: 2px; }
.quality-note { display: flex; gap: 10px; margin-top: 17px; padding: 12px; border-radius: 12px; color: #37675e; background: #eafaf6; }
.quality-note > span { align-self: flex-start; padding: 4px 6px; border-radius: 6px; color: white; background: var(--mint); font-size: 10px; font-weight: 900; }
.quality-note p { margin: 0; font-size: 10px; line-height: 1.55; }
footer { padding: 40px 20px 28px; text-align: center; color: #89869b; font-size: 11px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
[hidden] { display: none !important; }

@media (max-width: 850px) {
  .result-layout { grid-template-columns: 1fr; }
  .options-card { position: static; grid-row: 2; }
  .field-grid { grid-template-columns: 1fr; }
  .intro { padding-top: 38px; }
}
@media (max-width: 520px) {
  .page-shell { width: min(100% - 22px, 1180px); }
  .card, .options-card { padding: 17px; border-radius: 17px; }
  .free-pill { font-size: 10px; }
  .card-heading { align-items: flex-start; }
  .metrics { grid-template-columns: 1fr; }
  .downloads { flex-wrap: wrap; }
  .downloads > span { width: 100%; margin-bottom: 4px; }
}
