:root {
  --bg: #f6f7fb; --card: #ffffff; --text: #16181d; --muted: #646b7a; --line: #e3e6ee; --accent: #4f46e5; --accent-soft: #eef0ff;
  --ok: #16a34a; --warn: #d97706; --bad: #dc2626; --chip: #eef0f5;
  --anthropic: #c96a3a; --openai: #10a37f; --xai: #111827; --venice: #b91c6b; --deepinfra: #2563eb;
  --radius: 12px; --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0f1116; --card: #171a21; --text: #e8eaf0; --muted: #9aa3b5; --line: #2a2f3b; --accent: #8b85ff; --accent-soft: #23234a;
  --chip: #232835; --xai: #cbd5e1; --shadow: 0 1px 2px rgba(0,0,0,.4);
} }
:root[data-theme="dark"] { --bg: #0f1116; --card: #171a21; --text: #e8eaf0; --muted: #9aa3b5; --line: #2a2f3b; --accent: #8b85ff; --accent-soft: #23234a; --chip: #232835; --xai: #cbd5e1; --shadow: 0 1px 2px rgba(0,0,0,.4); }
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif; }
a { color: var(--accent); text-decoration: none; } a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 4px; } h2 { font-size: 17px; margin: 22px 0 10px; } h3 { font-size: 15px; margin: 14px 0 6px; }
p { margin: 6px 0; } .muted { color: var(--muted); } .small { font-size: 13px; } .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.center { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.topbar { position: sticky; top: 0; z-index: 5; background: var(--card); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 14px; padding: 10px 16px; }
.topbar .brand { font-weight: 700; display: flex; align-items: center; gap: 8px; color: var(--text); }
.topbar .brand svg { width: 24px; height: 24px; }
.topbar nav { display: flex; gap: 2px; flex-wrap: wrap; }
.topbar nav a { padding: 6px 10px; border-radius: 8px; color: var(--muted); font-weight: 500; }
.topbar nav a.active, .topbar nav a:hover { background: var(--accent-soft); color: var(--accent); text-decoration: none; }
.topbar .spacer { flex: 1; }
main.page { max-width: 1100px; margin: 0 auto; padding: 18px 16px 60px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin: 12px 0; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.btn { appearance: none; border: 1px solid var(--line); background: var(--card); color: var(--text); padding: 7px 12px; border-radius: 9px; font: inherit; font-weight: 500; cursor: pointer; }
.btn:hover { border-color: var(--accent); } .btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; } .btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--bad); border-color: var(--bad); } .btn.small { padding: 4px 9px; font-size: 13px; } .btn.ghost { border-color: transparent; color: var(--accent); }
input, select, textarea { font: inherit; color: var(--text); background: var(--card); border: 1px solid var(--line); border-radius: 9px; padding: 7px 10px; width: 100%; }
textarea { min-height: 90px; resize: vertical; }
label.field { display: block; font-size: 13px; color: var(--muted); } label.field > span { display: block; margin-bottom: 4px; }
label.check { display: flex; gap: 8px; align-items: center; font-size: 14px; } label.check input { width: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; } th, td { text-align: left; padding: 8px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; } td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.clickable { cursor: pointer; } tr.clickable:hover td { background: var(--accent-soft); }
.chip { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; background: var(--chip); color: var(--muted); margin: 1px 3px 1px 0; }
.chip.ok { background: #dcfce7; color: #166534; } .chip.warn { background: #fef3c7; color: #92400e; } .chip.bad { background: #fee2e2; color: #991b1b; } .chip.adult { background: #fce7f3; color: #9d174d; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chip.ok { background: #14532d; color: #bbf7d0; } :root:not([data-theme="light"]) .chip.warn { background: #78350f; color: #fde68a; } :root:not([data-theme="light"]) .chip.bad { background: #7f1d1d; color: #fecaca; } :root:not([data-theme="light"]) .chip.adult { background: #831843; color: #fbcfe8; } }
.co { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.co.anthropic { background: var(--anthropic); } .co.openai { background: var(--openai); } .co.xai { background: var(--xai); } .co.venice { background: var(--venice); } .co.deepinfra { background: var(--deepinfra); }
.bar { height: 8px; background: var(--chip); border-radius: 999px; overflow: hidden; margin: 6px 0; } .bar > i { display: block; height: 100%; background: var(--ok); }
.bar > i.warn { background: var(--warn); } .bar > i.bad { background: var(--bad); }
.big { font-size: 26px; font-weight: 700; } .error { color: var(--bad); } .ok { color: var(--ok); }
.notice { border-left: 4px solid var(--warn); padding: 8px 12px; background: var(--accent-soft); border-radius: 6px; margin: 8px 0; }
.notice.bad { border-color: var(--bad); }
.signin-card { width: min(440px, 100%); }
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: grid; place-items: center; z-index: 20; padding: 16px; }
.modal { background: var(--card); border-radius: var(--radius); padding: 18px; width: min(680px, 100%); max-height: 90vh; overflow: auto; box-shadow: var(--shadow); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; font-size: 14px; } .kv > b { color: var(--muted); font-weight: 500; }
.compare td { max-width: 380px; white-space: pre-wrap; word-break: break-word; font-size: 13px; }
pre.answer { white-space: pre-wrap; word-break: break-word; background: var(--chip); padding: 8px; border-radius: 8px; max-height: 260px; overflow: auto; font-size: 13px; margin: 4px 0; }
.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; z-index: 30; box-shadow: var(--shadow); max-width: 90vw; }
@media (max-width: 640px) { .topbar { padding: 8px 10px; } th, td { padding: 6px 5px; } main.page { padding: 12px 12px 60px; } .hide-sm { display: none; } }
