.cost-header h1 { font-size: clamp(3rem, 6.4vw, 5.75rem); }
.cost-calculator { margin-top: 1.35rem; }
.cost-layout { display: grid; grid-template-columns: minmax(260px, 330px) minmax(0, 1fr); gap: clamp(20px, 3.5vw, 42px); align-items: start; }
.cost-form { padding: clamp(1rem, 2.5vw, 1.5rem); background: var(--wash); border: 1px solid #ded7f6; border-top: 3px solid var(--accent); border-radius: 5px; }
.cost-form-header, .cost-comparison-header { display: flex; justify-content: space-between; align-items: start; gap: 1rem; }
.cost-form-header { align-items: baseline; }
.cost-form h2, .cost-comparison h2, .cost-reference h2 { font-size: clamp(1.95rem, 3vw, 2.65rem); }
.cost-sample { padding: .22rem 0; border: 0; background: none; color: var(--accent); cursor: pointer; font-size: .86rem; font-weight: 700; text-decoration: underline; text-underline-offset: .18em; }
.cost-form fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.cost-form .cost-mode { margin-top: 1rem; }
.cost-mode legend, .cost-field label, .cost-provider label { display: block; margin-bottom: .35rem; color: var(--ink); font-size: .88rem; font-weight: 670; }
.cost-mode-options { display: grid; grid-template-columns: 1fr 1fr; gap: .35rem; }
.cost-mode-options label { position: relative; cursor: pointer; }
.cost-mode-options input { position: absolute; width: 1px; height: 1px; padding: 0; opacity: 0; }
.cost-mode-options span { display: grid; place-items: center; min-height: 42px; border: 1px solid #c7bde4; border-radius: 4px; background: #fff; color: var(--accent-dark); font-size: .88rem; font-weight: 670; }
.cost-mode-options input:checked + span { border-color: var(--accent); background: var(--accent); color: #fff; }
.cost-mode-options input:focus-visible + span { outline: 3px solid #5a4cc6; outline-offset: 2px; }
.cost-field { margin-top: 1rem; }
.cost-field input, .cost-field textarea, .cost-provider select { display: block; width: 100%; min-height: 44px; padding: .55rem .65rem; border: 1px solid #c7bedf; border-radius: 4px; background: #fff; color: var(--ink); font: inherit; }
.cost-field textarea { resize: vertical; }
.cost-field [aria-invalid="true"] { border-color: #a23652; }
.cost-note, .cost-comparison-header p, .cost-summary { color: var(--muted); font-size: .88rem; line-height: 1.45; }
.cost-note { margin-top: .35rem; }
.cost-token-count { margin-top: .48rem; color: var(--accent-dark); font-weight: 690; font-size: .9rem; }
.cost-error { margin-top: .8rem; color: #8b2345; font-size: .88rem; font-weight: 650; line-height: 1.45; }
.cost-advanced { margin-top: 1rem; padding-top: .75rem; border-top: 1px solid #d9d1ed; }
.cost-advanced summary { cursor: pointer; color: var(--accent-dark); font-size: .91rem; font-weight: 680; }
.cost-advanced .cost-field { margin-top: .65rem; }
.cost-comparison { min-width: 0; }
.cost-comparison-header p { margin-top: .25rem; }
.cost-provider { width: min(150px, 45%); flex: none; }
.cost-provider select { font-size: .92rem; }
.cost-summary { min-height: 1.5em; padding: .8rem 0 .55rem; border-bottom: 1px solid var(--ink); }
.cost-result-list { list-style: none; padding: 0; }
.cost-result-row { display: grid; grid-template-columns: minmax(150px, .85fr) minmax(0, 1.15fr); gap: .75rem 1rem; align-items: center; padding: .85rem 0; border-bottom: 1px solid var(--line); }
.cost-model { min-width: 0; }
.cost-provider-name { color: var(--accent-dark); font-size: .8rem; font-weight: 720; }
.cost-model h3 { margin-top: .08rem; font: 400 clamp(1.55rem, 2.5vw, 2.15rem)/1.02 var(--serif); letter-spacing: -.025em; }
.cost-breakdown, .cost-model-note { margin-top: .3rem; color: var(--muted); font-size: .81rem; line-height: 1.4; }
.cost-model-note { color: var(--accent-dark); }
.cost-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .55rem; margin: 0; }
.cost-metrics dt { color: var(--muted); font-size: .76rem; line-height: 1.3; }
.cost-metrics dd { margin: .13rem 0 0; font-size: .96rem; font-variant-numeric: tabular-nums; font-weight: 700; overflow-wrap: anywhere; }
.cost-metrics div:last-child dd { color: var(--accent-dark); }
.cost-reference { margin-top: clamp(2rem, 4vw, 3.25rem); padding-top: 1rem; border-top: 1px solid var(--ink); }
.cost-reference > p { margin-top: .48rem; max-width: 76ch; color: var(--muted); }
.cost-reference h3 { margin-top: 1.1rem; font: 400 1.6rem/1.12 var(--serif); }
.cost-example { margin-top: 1rem; padding: .95rem 1.15rem; background: var(--wash); border-left: 3px solid var(--accent); }
.cost-example h3 { margin: 0 0 .35rem; }
.cost-rate-scroll { margin-top: 1rem; overflow: auto; }
.cost-rate-table { width: 100%; min-width: 460px; border-collapse: collapse; text-align: left; font-size: .93rem; }
.cost-rate-table th, .cost-rate-table td { padding: .55rem .75rem; border-bottom: 1px solid var(--line); }
.cost-rate-table thead th { background: var(--wash); }
.cost-rate-table tbody th { font-weight: 680; }
.cost-rate-table small { display: block; color: var(--muted); font-weight: 400; }
.cost-rate-table td { font-variant-numeric: tabular-nums; }

@media (max-width: 850px) {
  .cost-layout { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .cost-result-row { grid-template-columns: 1fr; }
  .cost-comparison-header { gap: .65rem; }
  .cost-provider { width: 125px; }
}
