:root { color-scheme: dark; }
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif; background: #0b0b0f; color: #e9e9f2; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 16px; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.title .h1 { font-size: 22px; font-weight: 750; }
.title .sub { font-size: 13px; color: #b8b8c9; margin-top: 2px; }
.controls { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
button { background: #2a2adf; color: #fff; border: 0; border-radius: 10px; padding: 10px 12px; font-size: 14px; cursor: pointer; }
button:disabled { opacity: 0.55; cursor: not-allowed; }
button.ghost { background: #0f0f18; border: 1px solid #2b2b44; color: #e9e9f2; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 12px; }
@media (max-width: 980px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .grid { grid-template-columns: 1fr; } }
.card { background: #131320; border: 1px solid #24243a; border-radius: 12px; padding: 14px; }
label { display: block; font-size: 13px; color: #b8b8c9; margin-bottom: 8px; }
select, input[type="text"] { background: #0f0f18; color: #e9e9f2; border: 1px solid #2b2b44; border-radius: 10px; padding: 10px 12px; font-size: 14px; outline: none; width: 100%; }
#modelSearch { margin-bottom: 8px; }
.status { display: flex; flex-direction: column; gap: 10px; }
.statusText { font-size: 13px; color: #e9e9f2; padding: 8px 10px; background: #0f0f18; border: 1px solid #2b2b44; border-radius: 10px; }
.meter { height: 10px; width: 100%; background: #0f0f18; border: 1px solid #2b2b44; border-radius: 999px; overflow: hidden; }
.meterFill { height: 100%; width: 0%; background: linear-gradient(90deg, #22c55e, #f59e0b, #ef4444); transition: width 60ms linear; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.output { height: 56vh; overflow: auto; padding: 12px; background: #0f0f18; border: 1px solid #2b2b44; border-radius: 12px; }
.msg { padding: 10px 12px; border-radius: 12px; margin: 10px 0; line-height: 1.35; white-space: pre-wrap; }
.msg.user { background: #151a2c; border: 1px solid #2a3563; }
.msg.ai { background: #141423; border: 1px solid #2b2b44; }
.msg.sys { background: #111827; border: 1px solid #374151; color: #d1d5db; }
.inputRow { display: flex; gap: 10px; align-items: center; margin-top: 10px; }
.inputRow > *:first-child { flex: 1; }
