.calc { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
.calc-input, .calc-cost { min-width: 0; padding: clamp(16px, 2.4vw, 28px); }
.calc-input { border-right: 1px solid var(--rule); }
.calc-cost { background: #22221e; }
.calc label { display: block; font-size: 13px; font-weight: 670; }
.calc button { border: 0; color: inherit; background: transparent; }
.calc-switch { display: inline-flex; flex-wrap: wrap; gap: 3px; padding: 4px; border: 1px solid var(--rule); border-radius: 8px; background: #1f1f1b; }
.calc-switch button { padding: 6px 11px; border-radius: 5px; color: #dcd5c6; font: 600 12px/1.35 var(--mono); min-height: 34px; }
.calc-switch button[aria-pressed="true"] { background: var(--amber); color: #242014; }
.calc-switch button:hover:not([aria-pressed="true"]) { background: #35332a; }
.editor-head, .cost-heading, .cost-result > div { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.editor-head { margin-top: 15px; }
.editor-actions { display: flex; gap: 4px; }
.editor-actions button { min-height: 35px; padding: 3px 7px; font-size: 12px; color: var(--amber); }
.editor-actions button:hover { text-decoration: underline; }
.calc textarea, .calc input, .calc select {
  width: 100%; min-width: 0; color: var(--paper); background: #191916; border: 1px solid #57564b;
  border-radius: 6px; padding: 8px 10px; color-scheme: dark;
}
.calc textarea { min-height: 140px; display: block; resize: vertical; font: 14px/1.65 var(--mono); }
.calc textarea::placeholder { color: #aaa598; }
.token-facts { display: grid; grid-template-columns: 1.13fr 1fr 1fr; margin-top: 13px; border-block: 1px solid var(--rule); }
.token-facts > div { display: grid; padding: 9px 10px; min-width: 0; border-right: 1px solid var(--rule); }
.token-facts > div:first-child { padding-left: 0; }
.token-facts > div:last-child { border-right: 0; }
.token-facts strong { font: 650 clamp(1.05rem, 2.6vw, 2.12rem)/1.2 var(--mono); letter-spacing: -.075em; overflow-wrap: anywhere; }
.token-facts > div:first-child strong { color: var(--amber); }
.token-facts span, .cost-heading > span { color: var(--muted); font: 11px/1.35 var(--mono); }
.small { margin: 10px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.small code { font-family: var(--mono); }
.token-ids { margin-top: 12px; }
.token-ids summary { width: fit-content; color: var(--amber); font: 12px/1.6 var(--mono); cursor: pointer; }
.token-list { display: flex; flex-wrap: wrap; gap: 5px; padding-top: 9px; }
.token-list span { padding: 3px 6px; background: #3a3428; color: #ffe2a5; border-radius: 3px; font: 11px/1.5 var(--mono); }
.token-list span:nth-child(3n+2) { background: #333a2d; color: #e1edcc; }
.token-list span:nth-child(3n) { background: #40322f; color: #ffdbd2; }
.manual-panel { margin-top: 20px; }
.manual-panel input { display: block; max-width: 270px; margin-top: 6px; }
.cost-heading { padding-bottom: 12px; border-bottom: 1px solid var(--rule); }
.cost-heading h2 { margin: 0; font-size: 18px; letter-spacing: -.045em; }
.cost-controls, .custom-rates { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.cost-controls { margin-top: 12px; }
.cost-controls input, .cost-controls select { margin-top: 3px; font-size: 14px; min-height: 42px; }
.cost-controls .full { grid-column: 1 / -1; }
.cost-result { margin-top: 16px; padding: 10px 13px; background: var(--amber); color: #271f13; border-radius: 7px; }
.cost-result span { font-size: 12px; font-weight: 700; }
.cost-result output { font: 700 16px/1.25 var(--mono); text-align: right; overflow-wrap: anywhere; min-width: 0; }
.cost-result .monthly output { font-size: clamp(1.22rem, 2.5vw, 1.75rem); letter-spacing: -.07em; }
.cost-result .per-request { margin-top: 4px; border-top: 1px solid #b49447; padding-top: 4px; }
.no-script { padding: 0 18px; }
@media (max-width: 760px) {
  .calc { grid-template-columns: minmax(0,1fr); }
  .calc-input { border-right: 0; border-bottom: 1px solid var(--rule); }
}
.calc-switch button:disabled { opacity: .55; cursor: not-allowed; }
.calc label + .small { margin-top: 5px; }
.unit-mode .calc { grid-template-columns: minmax(0, 1fr); }
.unit-mode .calc-input { display: none; }
.unit-mode .calc-cost { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 22px; }
.unit-mode .cost-heading, .unit-mode .calc-cost > p { grid-column: 1 / -1; }
.unit-mode .cost-result output { font-size: 15px; }
.unit-result > div + div { margin-top: 4px; }
.catalog { padding: 19px clamp(16px, 2.4vw, 28px) 24px; border-top: 1px solid var(--rule); }
.catalog h2 { margin: 0; font-size: 20px; letter-spacing: -.04em; }
.catalog p { margin: 3px 0 12px; color: var(--muted); font-size: 13px; }
.catalog .catalog-note { margin: 10px 0 0; }
.rate-table { width: 100%; border-collapse: collapse; text-align: left; table-layout: fixed; }
.rate-table th, .rate-table td { padding: 8px 9px; border-bottom: 1px solid var(--rule); }
.rate-table thead th { color: var(--muted); font: 12px var(--mono); }
.rate-table thead th:first-child { width: 58%; }
.rate-table tbody th { font-weight: 600; font-size: 14px; }
.rate-table tbody td { font: 13px var(--mono); font-variant-numeric: tabular-nums; }
.rate-table a { text-decoration: none; }
.rate-table a:hover { color: var(--amber); text-decoration: underline; }
.rate-table small { display: block; font-size: 11px; color: var(--muted); font-weight: 400; }
.rate-table tbody tr:nth-child(odd) { background: #22221e; }
@media (max-width: 670px) {
  .unit-mode .calc-cost { grid-template-columns: minmax(0,1fr); }
}
.bulk-mode .calc-switch { display: none; }
.bulk-mode .manual-panel { margin-top: 0; }
