:root {
  --bg: #0d0b0a; --ink: #f6efe9; --muted: #a99d93; --accent: #ff7a1a; --accent-2: #ffb36b;
  --glass: rgba(255, 255, 255, 0.055); --line: rgba(255, 255, 255, 0.12); --ok: #46d39a; --bad: #ff5d5d; --nano: #b18cff;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body {
  margin: 0; color: var(--ink); font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: radial-gradient(1200px 600px at 85% -10%, rgba(255, 122, 26, 0.28), transparent 60%),
              radial-gradient(900px 500px at -10% 30%, rgba(177, 140, 255, 0.14), transparent 60%), var(--bg);
  min-height: 100vh;
}
header { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 28px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; letter-spacing: 0.04em; }
.brand em { font-style: normal; color: var(--accent); font-weight: 600; }
.status { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { font-size: 13px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--glass); color: var(--muted); }
.pill[data-state="available"] { color: var(--ok); border-color: rgba(70, 211, 154, 0.4); }
.pill[data-state="unavailable"] { color: var(--bad); border-color: rgba(255, 93, 93, 0.4); }
.pill[data-state="downloadable"], .pill[data-state="downloading"] { color: var(--accent-2); }
.pill[data-src="in_cloud"] { color: var(--accent-2); border-color: rgba(255, 179, 107, 0.45); }
.pill[data-src="on_device"] { color: var(--nano); border-color: rgba(177, 140, 255, 0.45); }
main { max-width: 980px; margin: 0 auto; padding: 8px 20px 40px; }
.hero h1 { font-size: clamp(30px, 5vw, 48px); line-height: 1.1; margin: 18px 0 10px; letter-spacing: -0.02em; }
.hero p { color: var(--muted); max-width: 720px; margin: 0 0 22px; }
.panel { background: var(--glass); border: 1px solid var(--line); border-radius: 18px; padding: 20px; margin: 16px 0; backdrop-filter: blur(14px); }
.head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.head h2 { margin: 0; font-size: 19px; }
.head small { color: var(--muted); font-weight: 400; margin-left: 6px; font-size: 14px; }
.head .pill { margin-left: auto; }
.n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #1a0d03; font-weight: 800; }
textarea, input[type="text"], select {
  width: 100%; background: rgba(0, 0, 0, 0.35); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font: inherit;
}
textarea { resize: vertical; min-height: 200px; }
select, input[type="text"] { width: auto; flex: 1 1 200px; }
.row { display: flex; gap: 10px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
button { font: inherit; cursor: pointer; border-radius: 12px; border: 1px solid var(--line); background: var(--glass); color: var(--ink); padding: 10px 16px; }
button.primary { background: var(--accent); color: #1a0d03; border: none; font-weight: 700; }
button:disabled { opacity: 0.45; cursor: not-allowed; }
button.busy { position: relative; color: transparent; }
button.busy::after { content: ""; position: absolute; inset: 0; margin: auto; width: 18px; height: 18px; border-radius: 50%; border: 2px solid #1a0d03; border-right-color: transparent; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.samples { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
button.ghost { padding: 6px 12px; font-size: 14px; color: var(--muted); }
button.ghost:hover { color: var(--ink); border-color: var(--accent); }
.stats { display: flex; gap: 8px; flex-wrap: wrap; }
.stats span { font-size: 13px; padding: 4px 10px; border-radius: 8px; background: rgba(0, 0, 0, 0.3); }
.stats span:first-child { color: var(--ok); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.chip { font-size: 13px; padding: 5px 10px; border-radius: 10px; }
.chip b { color: var(--accent-2); font-weight: 600; margin-right: 4px; }
.chip i { font-style: normal; font-size: 11px; color: var(--muted); margin-left: 4px; text-transform: uppercase; letter-spacing: 0.04em; }
.chip.by-nano { border-color: rgba(177, 140, 255, 0.5); }
.chip.by-nano i { color: var(--nano); }
.chip.off { opacity: 0.5; text-decoration: line-through; }
.out { white-space: pre-wrap; word-break: break-word; background: rgba(0, 0, 0, 0.35); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin: 0; font: 14px/1.6 ui-monospace, "Cascadia Code", Consolas, monospace; }
mark.ph { background: rgba(255, 122, 26, 0.18); color: var(--accent-2); border-radius: 4px; padding: 0 2px; }
mark.real { background: rgba(70, 211, 154, 0.16); color: var(--ok); border-radius: 4px; padding: 0 2px; }
.gate { font-size: 14px; margin: 10px 0 0; }
.gate[data-ok="true"] { color: var(--ok); }
.gate[data-ok="false"] { color: var(--bad); font-weight: 700; }
.switch { display: flex; gap: 6px; align-items: center; font-size: 14px; color: var(--muted); }
.answer { background: rgba(0, 0, 0, 0.3); border-radius: 12px; padding: 16px; min-height: 60px; border: 1px solid var(--line); }
.receipt { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; margin: 12px 0; font-size: 13px; color: var(--muted); }
.receipt b { display: block; color: var(--ink); font-weight: 600; }
details summary { cursor: pointer; color: var(--muted); margin-bottom: 8px; }
.muted { color: var(--muted); font-size: 14px; }
.error { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: #3a1414; border: 1px solid var(--bad); color: #ffd6d6; padding: 10px 16px; border-radius: 12px; max-width: 90vw; }
footer { max-width: 980px; margin: 0 auto; padding: 0 20px 40px; color: var(--muted); font-size: 13px; }
code { font-family: ui-monospace, Consolas, monospace; color: var(--accent-2); }
@media (max-width: 600px) { header { padding: 14px 16px; } .panel { padding: 16px; } }
