:root { --bg:#0b0b0d; --panel:#131317; --panel2:#1a1a20; --line:#272730; --ink:#f3f3f5; --muted:#9b9ba6; --accent:#ff6a00; --bot:#1d1d24; --grid:rgba(255,255,255,.045); --good:#3ddc84; --bad:#ff4d6d;
  --mono:ui-monospace,"JetBrains Mono",Menlo,Consolas,monospace; --sans:system-ui,-apple-system,"Segoe UI",Roboto,sans-serif; }
:root[data-theme="light"] { --bg:#f6f3ee; --panel:#fff; --panel2:#f0ece4; --line:#dcd6ca; --ink:#121214; --muted:#626068; --bot:#ece8df; --grid:rgba(0,0,0,.05); }
* { box-sizing:border-box; }
body { margin:0; min-height:100vh; background:var(--bg); color:var(--ink); font-family:var(--sans); line-height:1.5;
  background-image:linear-gradient(var(--grid) 1px,transparent 1px),linear-gradient(90deg,var(--grid) 1px,transparent 1px); background-size:56px 56px; }
button { font:inherit; color:inherit; cursor:pointer; }
button:focus-visible, input:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.ic { width:100%; height:100%; display:block; }
[data-icon] { display:inline-flex; width:18px; height:18px; flex:none; }

header { position:sticky; top:0; z-index:5; background:color-mix(in srgb,var(--bg) 88%,transparent); backdrop-filter:blur(10px); border-bottom:1px solid var(--line); }
.bar { max-width:1100px; margin:0 auto; padding:10px 20px; display:flex; align-items:center; gap:12px; }
.brand { display:flex; align-items:center; gap:10px; font-family:var(--mono); font-weight:800; letter-spacing:.05em; font-size:19px; }
.brand img { height:30px; width:auto; }
.grow { flex:1; }
#clock { font-family:var(--mono); font-weight:700; font-variant-numeric:tabular-nums; color:var(--muted); font-size:14px; }
.pill { display:inline-flex; align-items:center; gap:6px; height:36px; padding:0 12px; border:1px solid var(--line); background:var(--panel); border-radius:999px; font-family:var(--mono); font-size:13px; }
.pill:hover { border-color:var(--accent); }

main { max-width:1100px; margin:0 auto; padding:34px 20px 50px; }
h1 { margin:0 0 4px; font-family:var(--mono); font-size:clamp(40px,8vw,76px); letter-spacing:.06em; line-height:1; text-align:center; }
h1 span { color:var(--accent); }
.tag { text-align:center; color:var(--muted); margin:0 0 28px; font-size:18px; }
.console { display:grid; grid-template-columns:.9fr 1.1fr; gap:22px; align-items:start; }
@media (max-width:860px) { .console { grid-template-columns:1fr; } #clock { display:none; } }

.stage { display:flex; flex-direction:column; align-items:center; background:var(--panel); border:1px solid var(--line); border-radius:28px; padding:24px 18px 20px; }
.bubble { position:relative; background:#fff; color:#111; border:4px solid #111; border-radius:24px; padding:12px 18px; min-height:62px; width:100%; max-width:440px; display:flex; align-items:center; justify-content:center; text-align:center; font-weight:800; font-size:clamp(15px,2.2vw,19px); margin-bottom:32px; }
.bubble::before,.bubble::after { content:""; position:absolute; left:50%; transform:translateX(-50%); border:solid transparent; }
.bubble::before { bottom:-29px; border-width:29px 17px 0; border-top-color:#111; }
.bubble::after { bottom:-20px; border-width:23px 12px 0; border-top-color:#fff; }
#cat { height:min(44vh,380px); width:auto; max-width:100%; cursor:pointer; animation:idle 4.5s ease-in-out infinite; }
@keyframes idle { 50% { transform:translateY(-5px); } }
.hello { margin-top:14px; display:inline-flex; align-items:center; gap:8px; height:40px; padding:0 18px; border-radius:999px; border:0; background:var(--accent); color:#fff; font-weight:700; }

.chat { background:var(--panel); border:1px solid var(--line); border-radius:28px; display:flex; flex-direction:column; height:min(78vh,620px); overflow:hidden; }
.chat-head { padding:14px 20px; border-bottom:1px solid var(--line); font-weight:700; display:flex; justify-content:space-between; align-items:center; }
.chat-head small { color:var(--muted); font-family:var(--mono); font-weight:500; }
.live { display:inline-flex; align-items:center; gap:8px; }
.live::before { content:""; width:8px; height:8px; border-radius:50%; background:var(--good); box-shadow:0 0 0 4px rgba(61,220,132,.18); }
#log { flex:1; overflow-y:auto; padding:16px; display:flex; flex-direction:column; gap:10px; }
.msg { max-width:88%; padding:10px 14px; border-radius:18px; white-space:pre-wrap; overflow-wrap:anywhere; font-size:15px; }
.msg.bot { background:var(--bot); align-self:flex-start; border-bottom-left-radius:5px; }
.msg.user { background:var(--accent); color:#fff; align-self:flex-end; border-bottom-right-radius:5px; font-weight:600; }
.msg.typing { opacity:.55; }
.msg a { color:var(--accent); }
.swatch { display:block; height:36px; border-radius:10px; margin-top:8px; border:1px solid var(--line); }
.chips { display:flex; gap:8px; overflow-x:auto; padding:10px 14px; border-top:1px solid var(--line); scrollbar-width:thin; }
.chip { flex:none; border:1px solid var(--line); background:var(--panel2); border-radius:999px; padding:5px 13px; font-size:13px; font-family:var(--mono); }
.chip:hover { border-color:var(--accent); color:var(--accent); }
#form { display:flex; gap:8px; padding:12px 14px; border-top:1px solid var(--line); }
#input { flex:1; min-width:0; font:inherit; color:var(--ink); background:var(--bg); border:1px solid var(--line); border-radius:999px; padding:11px 18px; }
#input:focus { border-color:var(--accent); outline:none; }
.round { width:44px; height:44px; border-radius:50%; border:1px solid var(--line); background:var(--panel2); display:inline-flex; align-items:center; justify-content:center; }
.round[hidden] { display:none; }
.round [data-icon] { width:20px; height:20px; }
.round.go { background:var(--accent); border-color:var(--accent); color:#fff; }
.round.listening { background:var(--bad); border-color:var(--bad); color:#fff; }

.can { margin-top:30px; display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:10px; }
.can button { display:flex; align-items:center; gap:10px; background:var(--panel); border:1px solid var(--line); border-radius:16px; padding:12px 14px; text-align:left; font-size:14px; }
.can button:hover { border-color:var(--accent); }
.can [data-icon] { color:var(--accent); width:22px; height:22px; }
footer { text-align:center; color:var(--muted); font-size:13px; padding:0 20px 30px; }
@media (prefers-reduced-motion:reduce) { * { animation:none !important; } }

.pill .hide-s { }
@media (max-width:640px) { .hide-s { display:none; } }
.msg.np { display:flex; gap:12px; align-items:center; max-width:96%; white-space:normal; }
.msg.np img { border-radius:12px; flex:none; width:64px; height:64px; object-fit:cover; background:var(--panel2); }
.msg.np > div { display:flex; flex-direction:column; gap:4px; min-width:0; }
.msg.np span { color:var(--muted); font-size:13px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.msg.np audio { width:100%; max-width:260px; height:36px; }
.msg.np a { font-size:13px; }
dialog { width:min(520px,calc(100vw - 24px)); max-height:88vh; padding:0; border:1px solid var(--line); border-radius:24px; background:var(--panel); color:var(--ink); overflow:hidden; }
dialog::backdrop { background:rgba(0,0,0,.6); backdrop-filter:blur(3px); }
dialog[open] { display:flex; flex-direction:column; }
.dlg-head { display:flex; justify-content:space-between; align-items:center; padding:16px 20px; border-bottom:1px solid var(--line); }
.dlg-head h2 { margin:0; font-size:18px; }
.x { border:0; background:none; color:var(--muted); width:32px; height:32px; display:inline-flex; align-items:center; justify-content:center; border-radius:50%; }
.x:hover { color:var(--ink); background:var(--panel2); }
.dlg-body { padding:8px 20px 22px; overflow-y:auto; display:flex; flex-direction:column; gap:12px; }
.dlg-body h3 { display:flex; align-items:center; gap:8px; margin:14px 0 0; font-family:var(--mono); font-size:15px; }
.dlg-body h3 [data-icon] { color:var(--accent); }
.dlg-body label { display:flex; flex-direction:column; gap:6px; font-size:14px; color:var(--muted); }
.dlg-body label output { color:var(--accent); font-family:var(--mono); margin-left:6px; }
.dlg-body label.check { flex-direction:row; align-items:center; gap:10px; color:var(--ink); }
.dlg-body select, .dlg-body input[type=text], .dlg-body input[type=password] { font:inherit; color:var(--ink); background:var(--bg); border:1px solid var(--line); border-radius:12px; padding:9px 12px; width:100%; }
.dlg-body input[type=range] { width:100%; accent-color:var(--accent); }
.dlg-body input[type=checkbox] { accent-color:var(--accent); width:18px; height:18px; }
#aiCustom { display:flex; flex-direction:column; gap:12px; }
#aiCustom[hidden] { display:none; }
.presets { display:flex; gap:8px; flex-wrap:wrap; }
.hint { margin:0; font-size:13px; color:var(--muted); }
.dlg-body .hello { align-self:flex-start; margin-top:0; }
