:root {
  --ink: #17232f;
  --muted: #657382;
  --line: #dfe5e9;
  --paper: #f6f7f4;
  --white: #ffffff;
  --navy: #102b3f;
  --teal: #17a398;
  --teal-dark: #0b7d75;
  --coral: #ff6b55;
  --soft-teal: #eaf7f5;
  --shadow: 0 18px 50px rgba(15, 42, 58, .10);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 85% -10%, rgba(23,163,152,.16), transparent 30rem),
    var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

.topbar {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1240px;
  margin: auto;
  padding: 0 28px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--navy); font-weight: 760; text-decoration: none; letter-spacing: -.02em; }
.brand-mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; color: white; background: var(--navy); font-family: Georgia, serif; }
.trust { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 650; }
.pulse { width: 8px; height: 8px; border-radius: 99px; background: var(--teal); box-shadow: 0 0 0 4px rgba(23,163,152,.13); }

main { width: min(1184px, calc(100% - 40px)); margin: 0 auto 70px; }
.tool-shell { background: var(--white); border: 1px solid rgba(16,43,63,.09); border-radius: 24px; box-shadow: var(--shadow); overflow: hidden; }
.title-row { display: flex; justify-content: space-between; gap: 20px; align-items: end; padding: 34px 38px 26px; border-bottom: 1px solid var(--line); }
.eyebrow { margin: 0 0 8px; color: var(--teal-dark); font-size: 11px; font-weight: 800; letter-spacing: .16em; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 5px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(38px, 5vw, 62px); font-weight: 500; line-height: .95; letter-spacing: -.045em; color: var(--navy); }
h2 { margin-bottom: 6px; color: var(--navy); font-size: 22px; letter-spacing: -.025em; }
.subhead { margin: 0; color: var(--muted); font-size: 16px; }
.verified-pill { flex: none; padding: 9px 13px; color: var(--teal-dark); background: var(--soft-teal); border: 1px solid #cdeae6; border-radius: 999px; font-size: 12px; }

.workspace { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(330px, .88fr); min-height: 570px; }
.input-panel, .model-panel { min-width: 0; padding: 28px 38px 34px; }
.model-panel { background: #fbfcfb; border-left: 1px solid var(--line); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; min-height: 34px; margin-bottom: 15px; }
.panel-heading h2 { margin: 0; }
.model-heading p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.text-button { border: 0; padding: 7px 2px; color: var(--teal-dark); background: transparent; font-size: 13px; font-weight: 750; }
.text-button:hover { color: var(--navy); }
textarea {
  width: 100%; min-height: 245px; resize: vertical; padding: 18px;
  color: var(--ink); background: #fcfdfc; border: 1px solid #cad3d9; border-radius: 14px; outline: none;
}
textarea:focus, input:focus, select:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(23,163,152,.12); }
textarea::placeholder { color: #95a0a9; }
.live-stats { display: grid; grid-template-columns: repeat(3, 1fr); margin: 14px 0 22px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.live-stats div { padding: 12px 14px; border-right: 1px solid var(--line); }
.live-stats div:last-child { border: 0; }
.live-stats span { display: block; color: var(--navy); font-size: 20px; font-weight: 770; letter-spacing: -.03em; }
.live-stats small { color: var(--muted); font-size: 11px; }
.live-stats .accent-stat { background: var(--soft-teal); }
.field-grid, .volume-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-grid { margin-bottom: 14px; }
label > span { display: block; margin-bottom: 6px; color: var(--navy); font-size: 12px; font-weight: 750; }
label small { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; }
input, select { width: 100%; min-height: 44px; padding: 10px 12px; color: var(--ink); background: white; border: 1px solid #cad3d9; border-radius: 10px; outline: 0; }
.formula-note { margin: 16px 0 0; color: var(--muted); font-size: 11px; }

.search-wrap { position: relative; display: block; }
.search-wrap svg { position: absolute; left: 12px; top: 13px; width: 18px; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; }
.search-wrap input { padding-left: 38px; }
.provider-filters { display: flex; gap: 7px; margin: 12px 0; overflow-x: auto; scrollbar-width: none; }
.provider-filters::-webkit-scrollbar { display: none; }
.filter-chip { flex: none; padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: white; font-size: 11px; font-weight: 700; }
.filter-chip.active { color: white; border-color: var(--navy); background: var(--navy); }
.model-list { height: 370px; overflow-y: auto; padding-right: 5px; }
.model-option { display: flex; align-items: center; gap: 11px; padding: 10px 7px; border-bottom: 1px solid #e9edef; cursor: pointer; }
.model-option:hover { background: var(--soft-teal); }
.model-option input { appearance: none; width: 18px; height: 18px; min-height: 18px; padding: 0; border: 1.5px solid #aab6be; border-radius: 5px; }
.model-option input:checked { border-color: var(--teal); background: var(--teal); box-shadow: inset 0 0 0 4px white; }
.model-name { display: block; color: var(--ink); font-size: 13px; font-weight: 700; }
.model-meta { display: block; color: var(--muted); font-size: 10px; }

.results-section { margin-top: 24px; padding: 28px 30px 16px; background: var(--navy); border-radius: 20px; color: white; box-shadow: var(--shadow); }
.results-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.results-heading h2 { color: white; font-family: Georgia, serif; font-size: 30px; font-weight: 500; }
.results-heading p { margin-bottom: 0; color: #a9bdca; font-size: 12px; }
.results-heading .eyebrow { color: #5ed5ca; }
.copy-button { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 15px; color: white; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.2); border-radius: 10px; font-size: 12px; font-weight: 750; }
.copy-button:hover { background: rgba(255,255,255,.15); }
.copy-button svg { width: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.results-table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th { padding: 10px 12px; color: #8fa8b6; border-bottom: 1px solid rgba(255,255,255,.15); text-align: right; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }
th:first-child, td:first-child { text-align: left; }
td { padding: 14px 12px; border-bottom: 1px solid rgba(255,255,255,.09); text-align: right; font-variant-numeric: tabular-nums; font-size: 12px; }
td strong { display: block; font-size: 13px; }
td small { color: #91a7b4; }
.cost-main { color: #72e0d5; font-size: 15px; font-weight: 800; }
.source-link { color: #9fb5c1; text-decoration: underline; text-underline-offset: 3px; }
.empty-state { padding: 35px; color: #a9bdca; text-align: center; }

.content-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 34px; }
.content-grid article, .sources, .faq { padding: 30px; background: white; border: 1px solid var(--line); border-radius: 16px; }
.content-grid p { color: var(--muted); font-size: 14px; }
.content-grid code { display: block; padding: 14px; color: var(--navy); background: var(--soft-teal); border-radius: 10px; font-size: 12px; line-height: 1.8; }
.provider-strip { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }
.provider-strip span { padding: 5px 9px; background: var(--paper); border-radius: 6px; color: var(--navy); font-size: 10px; font-weight: 750; }
.sources, .faq { margin-top: 16px; }
.sources > p:not(.eyebrow) { color: var(--muted); font-size: 13px; }
.source-links { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 18px; }
.source-links a { padding: 11px 12px; color: var(--navy); background: var(--paper); border: 1px solid var(--line); border-radius: 9px; text-decoration: none; font-size: 12px; font-weight: 750; }
.source-links a:hover { border-color: var(--teal); }
.faq details { border-top: 1px solid var(--line); }
.faq summary { padding: 17px 4px; cursor: pointer; color: var(--navy); font-weight: 720; }
.faq details p { padding: 0 4px 16px; color: var(--muted); font-size: 13px; }
footer { display: flex; justify-content: space-between; width: min(1184px, calc(100% - 40px)); margin: 0 auto; padding: 24px 0 40px; color: var(--muted); font-size: 11px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 14px; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--teal-dark); }
.legal-page { width: min(760px, calc(100% - 40px)); margin: 34px auto 80px; padding: 42px; background: white; border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
.legal-page h1 { margin-bottom: 24px; font-size: clamp(38px, 7vw, 58px); }
.legal-page h2 { margin-top: 32px; }
.legal-page p, .legal-page li { color: var(--muted); font-size: 15px; }
.legal-page a { color: var(--teal-dark); }
#toast { position: fixed; left: 50%; bottom: 28px; translate: -50% 20px; padding: 10px 15px; color: white; background: var(--ink); border-radius: 9px; opacity: 0; pointer-events: none; transition: .2s ease; font-size: 12px; }
#toast.show { opacity: 1; translate: -50% 0; }

@media (max-width: 780px) {
  main { width: min(100% - 20px, 620px); }
  .topbar { height: 58px; padding: 0 15px; }
  .trust { font-size: 0; }
  .trust::after { content: "Local only"; font-size: 11px; }
  .title-row { display: block; padding: 24px 20px 19px; }
  .verified-pill { display: inline-block; margin-top: 14px; }
  .workspace { grid-template-columns: 1fr; }
  .workspace > * { min-width: 0; }
  .input-panel, .model-panel { padding: 22px 20px 26px; }
  .model-panel { border-left: 0; border-top: 1px solid var(--line); }
  textarea { min-height: 190px; }
  .model-list { height: 310px; }
  .results-section { padding: 23px 18px 10px; border-radius: 16px; }
  .results-heading { align-items: end; }
  .copy-button { padding: 0 12px; }
  .copy-button svg { display: none; }
  .content-grid { grid-template-columns: 1fr; }
  .content-grid article, .sources, .faq { padding: 24px 20px; }
  .source-links { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 430px) {
  h1 { font-size: 42px; }
  .subhead { font-size: 14px; }
  .field-grid, .volume-row { grid-template-columns: 1fr; gap: 10px; }
  .live-stats div { padding: 10px 8px; }
  .live-stats span { font-size: 17px; }
  .live-stats small { font-size: 9px; }
  .results-heading h2 { font-size: 25px; }
  .source-links { grid-template-columns: 1fr; }
  .legal-page { width: calc(100% - 20px); margin-top: 10px; padding: 28px 20px; }
}

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
