:root {
  color-scheme: light;
  --ink: #122236;
  --ink-soft: #526377;
  --ink-faint: #758397;
  --paper: #f4f7f9;
  --white: #ffffff;
  --line: #dce4e9;
  --line-strong: #c9d5dc;
  --navy: #0b1e32;
  --navy-soft: #142c43;
  --mint: #8ff5ce;
  --mint-strong: #27c993;
  --cyan: #6fd7ef;
  --violet: #a99cf5;
  --amber: #f6c66f;
  --shadow: 0 18px 48px rgba(15, 35, 54, 0.09);
  --radius: 20px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 10% -10%, rgba(111, 215, 239, 0.13), transparent 34rem),
    radial-gradient(circle at 95% 8%, rgba(143, 245, 206, 0.14), transparent 30rem),
    var(--paper);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

a {
  color: inherit;
}

.site-header {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: var(--navy);
  color: var(--mint);
  box-shadow: 0 7px 18px rgba(11, 30, 50, 0.2);
}

.brand-mark svg {
  width: 20px;
  height: 20px;
}

.header-note {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 650;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--mint-strong);
  box-shadow: 0 0 0 4px rgba(39, 201, 147, 0.12);
}

main {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 42px 0 70px;
}

.intro {
  max-width: 820px;
  margin-bottom: 30px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  color: #177b62;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 2px;
  background: var(--mint-strong);
}

h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(2.35rem, 6vw, 4.9rem);
  line-height: 0.98;
  letter-spacing: -0.065em;
  font-weight: 820;
}

.intro p {
  max-width: 700px;
  margin: 22px 0 0;
  color: var(--ink-soft);
  font-size: clamp(1rem, 1.8vw, 1.18rem);
  line-height: 1.65;
}

.calculator-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(390px, 0.92fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.inputs-panel {
  padding: 30px;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}

.step-label {
  display: block;
  margin-bottom: 5px;
  color: #25876d;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

h2,
h3,
p {
  margin-top: 0;
}

.panel-heading h2 {
  margin-bottom: 0;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
}

.quiet-button,
.share-button {
  border: 0;
  border-radius: 10px;
  transition: transform 150ms ease, background 150ms ease;
}

.quiet-button {
  padding: 9px 11px;
  background: #edf2f4;
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 750;
}

.quiet-button:hover {
  background: #e1e9ed;
}

.quiet-button:active,
.share-button:active {
  transform: translateY(1px);
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.field {
  min-width: 0;
}

.field-wide {
  grid-column: 1 / -1;
}

.field label,
.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 7px;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 750;
}

.field-hint {
  color: var(--ink-faint);
  font-size: 0.7rem;
  font-weight: 650;
}

input,
select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  outline: none;
  background: #fbfcfd;
  color: var(--ink);
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

input {
  padding: 10px 12px;
  font-variant-numeric: tabular-nums;
}

select {
  appearance: none;
  padding: 10px 42px 10px 12px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%),
    linear-gradient(135deg, var(--ink-soft) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 20px,
    calc(100% - 13px) 20px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

input:focus,
select:focus {
  border-color: #46c9a5;
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(39, 201, 147, 0.12);
}

.mode-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  border-radius: 13px;
  background: #edf2f4;
}

.mode-toggle button {
  min-height: 40px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 0.84rem;
  font-weight: 780;
}

.mode-toggle button.is-active {
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(17, 35, 54, 0.09);
}

.input-explainer {
  display: flex;
  gap: 10px;
  margin: 22px 0 0;
  padding: 13px 14px;
  border: 1px solid #dcebe6;
  border-radius: 12px;
  background: #f4fbf8;
  color: #42655c;
  font-size: 0.78rem;
  line-height: 1.5;
}

.input-explainer svg {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  margin-top: 1px;
}

.results-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 30px;
  background:
    radial-gradient(circle at 90% 8%, rgba(111, 215, 239, 0.12), transparent 18rem),
    radial-gradient(circle at 0% 100%, rgba(143, 245, 206, 0.11), transparent 21rem),
    var(--navy);
  color: #f5fafc;
}

.results-panel .step-label {
  color: var(--mint);
}

.model-summary {
  margin-bottom: 24px;
}

.model-summary h2 {
  margin-bottom: 7px;
  font-size: 1.32rem;
  letter-spacing: -0.03em;
}

.model-summary p {
  margin-bottom: 0;
  color: #aabccd;
  font-size: 0.78rem;
  line-height: 1.5;
}

.hero-result {
  padding: 22px 0 25px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-result > span {
  display: block;
  color: #aabccd;
  font-size: 0.8rem;
  font-weight: 720;
}

.hero-result strong {
  display: block;
  margin: 7px 0 6px;
  color: var(--mint);
  font-size: clamp(2.4rem, 5vw, 4.3rem);
  line-height: 1;
  letter-spacing: -0.06em;
  font-variant-numeric: tabular-nums;
}

.hero-result small {
  color: #93a9bb;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  margin: 22px 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.1);
}

.result-item {
  padding: 15px;
  background: rgba(12, 32, 51, 0.88);
}

.result-item span {
  display: block;
  margin-bottom: 5px;
  color: #8fa6b9;
  font-size: 0.72rem;
}

.result-item strong {
  color: #f6fbfd;
  font-size: 1.08rem;
  font-variant-numeric: tabular-nums;
}

.cost-mix {
  margin-top: auto;
}

.cost-mix h3 {
  margin-bottom: 12px;
  font-size: 0.8rem;
  font-weight: 750;
}

.mix-bar {
  display: flex;
  width: 100%;
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.mix-segment {
  width: 0;
  transition: width 250ms ease;
}

.mix-input {
  background: var(--cyan);
}

.mix-output {
  background: var(--violet);
}

.mix-extra {
  background: var(--amber);
}

.mix-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin-top: 10px;
  color: #9fb1c0;
  font-size: 0.7rem;
}

.mix-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-swatch {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.mode-note {
  margin: 17px 0 0;
  color: #8fa6b9;
  font-size: 0.73rem;
  line-height: 1.5;
}

.actions-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: 18px;
}

.share-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  background: var(--mint);
  color: #0c3529;
  font-size: 0.82rem;
  font-weight: 800;
}

.share-button:hover {
  background: #a5f8da;
}

.share-button svg {
  width: 16px;
  height: 16px;
}

.section {
  margin-top: 32px;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 8px 30px rgba(15, 35, 54, 0.05);
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 26px;
  margin-bottom: 22px;
}

.section-header h2 {
  margin-bottom: 6px;
  font-size: clamp(1.5rem, 3vw, 2rem);
  letter-spacing: -0.045em;
}

.section-header p {
  max-width: 580px;
  margin-bottom: 0;
  color: var(--ink-soft);
  font-size: 0.87rem;
  line-height: 1.55;
}

.comparison-insight {
  max-width: 360px;
  padding: 13px 15px;
  border-radius: 12px;
  background: #eef8f5;
  color: #41645b;
  font-size: 0.77rem;
  line-height: 1.45;
}

.comparison-insight strong {
  color: #1f5c4c;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

th {
  padding: 12px 14px;
  background: #f1f5f7;
  color: var(--ink-faint);
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

td {
  padding: 13px 14px;
  border-top: 1px solid var(--line);
  color: #364a5f;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

tbody tr {
  transition: background 150ms ease;
}

tbody tr:hover {
  background: #f8fbfc;
}

tbody tr.is-selected {
  background: #edfaf5;
}

.rank {
  display: inline-grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 8px;
  background: #e9eff2;
  color: var(--ink-soft);
  font-size: 0.7rem;
  font-weight: 800;
}

.is-selected .rank {
  background: var(--mint);
  color: #164b3d;
}

.model-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.model-cell strong,
.model-cell small {
  display: block;
}

.model-cell strong {
  color: var(--ink);
  font-size: 0.84rem;
}

.model-cell small {
  margin-top: 2px;
  color: var(--ink-faint);
  font-size: 0.68rem;
}

.provider-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ink-faint);
}

.provider-openai {
  background: #20a37f;
}

.provider-anthropic {
  background: #d37b55;
}

.provider-google {
  background: #5488e8;
}

.positive-delta {
  color: #158162;
  font-weight: 750;
}

.negative-delta {
  color: #a65f39;
}

.method-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.method-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fbfcfd;
}

.method-number {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  margin-bottom: 17px;
  border-radius: 10px;
  background: var(--navy);
  color: var(--mint);
  font-size: 0.78rem;
  font-weight: 800;
}

.method-card h3 {
  margin-bottom: 8px;
  font-size: 0.96rem;
}

.method-card p {
  margin-bottom: 0;
  color: var(--ink-soft);
  font-size: 0.79rem;
  line-height: 1.6;
}

.privacy-note {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  margin-top: 20px;
  padding: 15px 17px;
  border-radius: 13px;
  background: #eef4f6;
  color: var(--ink-soft);
  font-size: 0.78rem;
  line-height: 1.55;
}

.privacy-note svg {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  color: #25876d;
}

.sources {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.source-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  color: var(--ink-soft);
  font-size: 0.74rem;
  font-weight: 750;
  text-decoration: none;
  transition: border-color 150ms ease, color 150ms ease;
}

.source-link:hover {
  border-color: #8dcfbd;
  color: #186951;
}

.source-link svg {
  width: 13px;
  height: 13px;
}

.site-footer {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 24px 0 38px;
  border-top: 1px solid var(--line);
  color: var(--ink-faint);
  font-size: 0.72rem;
  line-height: 1.55;
}

.footer-row {
  display: flex;
  justify-content: space-between;
  gap: 30px;
}

.footer-row p {
  max-width: 770px;
  margin-bottom: 0;
}

.footer-domain {
  color: var(--ink-soft);
  font-weight: 800;
  white-space: nowrap;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  padding: 12px 15px;
  border-radius: 12px;
  background: var(--navy);
  color: var(--white);
  box-shadow: 0 12px 30px rgba(11, 30, 50, 0.24);
  font-size: 0.8rem;
  font-weight: 750;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.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;
}

@media (max-width: 900px) {
  main {
    padding-top: 30px;
  }

  .calculator-shell {
    grid-template-columns: 1fr;
  }

  .results-panel {
    min-height: 610px;
  }

  .section-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .comparison-insight {
    max-width: none;
  }
}

@media (max-width: 680px) {
  .site-header,
  main,
  .site-footer {
    width: min(100% - 24px, 1180px);
  }

  .site-header {
    min-height: 64px;
  }

  .header-note {
    display: none;
  }

  main {
    padding: 24px 0 50px;
  }

  .intro {
    margin-bottom: 22px;
  }

  .intro p {
    margin-top: 16px;
  }

  .inputs-panel,
  .results-panel,
  .section {
    padding: 22px 18px;
  }

  .calculator-shell {
    border-radius: 20px;
  }

  .field-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .field-wide {
    grid-column: auto;
  }

  .results-panel {
    min-height: 570px;
  }

  .result-item {
    padding: 13px 11px;
  }

  .method-grid {
    grid-template-columns: 1fr;
  }

  .table-wrap {
    border: 0;
    overflow: visible;
  }

  table,
  tbody {
    display: block;
  }

  thead {
    display: none;
  }

  tbody {
    display: grid;
    gap: 10px;
  }

  tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 12px;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--white);
  }

  td {
    display: flex;
    flex-direction: column;
    padding: 0;
    border: 0;
    white-space: normal;
  }

  td::before {
    content: attr(data-label);
    margin-bottom: 3px;
    color: var(--ink-faint);
    font-size: 0.61rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  td:first-child {
    display: none;
  }

  td:nth-child(2) {
    grid-column: 1 / -1;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
  }

  .footer-row {
    flex-direction: column;
    gap: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
