:root {
  --bg: #0a0a0a;
  --ink: #ededed;
  --ink-2: rgba(237, 237, 237, .64);
  --mute: rgba(237, 237, 237, .4);
  --faint: rgba(237, 237, 237, .2);
  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .13);
  --red: #ff5a4e;
  --sans: 'Manrope', 'Segoe UI Variable Text', 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', 'Cascadia Mono', Consolas, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.4, .64, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body { background: var(--bg); color: var(--ink); font: 400 13px/1.55 var(--sans); -webkit-font-smoothing: antialiased; user-select: none; cursor: default; }
button, input, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
.mono { font-family: var(--mono); }
svg { display: block; }

#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#app { position: relative; z-index: 2; height: 100%; display: flex; flex-direction: column; }

/* ── заголовок ── */
.titlebar { height: 46px; flex: 0 0 auto; display: flex; align-items: center; padding-left: 10px; }
.power { position: relative; display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 12px 0 7px; border-radius: 16px; transition: background .25s; }
.power:hover { background: rgba(255, 255, 255, .05); }
.power .logo {
  width: 18px; height: 18px; border-radius: 50%; flex: 0 0 18px;
  background: radial-gradient(ellipse 34% 16% at 50% 20%, rgba(255, 255, 255, .85), transparent 70%),
              radial-gradient(circle at 50% 55%, #1a1a1a 0, #050505 62%, #000 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14);
  transition: box-shadow .5s;
}
body.on .power .logo { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .4), 0 0 12px rgba(255, 255, 255, .28); animation: breathe 3.2s ease-in-out infinite; }
@keyframes breathe { 50% { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22), 0 0 4px rgba(255, 255, 255, .12); } }
.power .word { font: 600 11px/1 var(--sans); letter-spacing: .3em; color: var(--ink-2); transition: color .4s; }
body.on .power .word { color: var(--ink); }
.power .state { font: 500 10.5px/1 var(--sans); color: var(--faint); padding: 4px 8px; border-radius: 9px; background: rgba(255, 255, 255, .04); transition: color .4s, background .4s; }
body.on .power .state { color: var(--ink-2); background: rgba(255, 255, 255, .08); }
.spacer { flex: 1; align-self: stretch; }
.tools { display: flex; gap: 2px; padding: 3px; border-radius: 12px; background: rgba(255, 255, 255, .035); border: 1px solid var(--line); }
.ib { position: relative; width: 30px; height: 28px; border-radius: 9px; display: grid; place-items: center; color: var(--mute); transition: color .2s, background .2s; }
.ib svg { width: 16px; height: 16px; }
.ib:hover { color: var(--ink); background: rgba(255, 255, 255, .08); }
[data-tip]:hover::after {
  content: attr(data-tip); position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%); z-index: 50; white-space: nowrap;
  font: 500 11px/1 var(--sans); color: var(--ink); background: #1b1b1b; border: 1px solid var(--line-2); padding: 6px 9px; border-radius: 8px;
  pointer-events: none; animation: tip .18s var(--ease) .35s both;
}
@keyframes tip { from { opacity: 0; transform: translate(-50%, -3px); } to { opacity: 1; transform: translate(-50%, 0); } }
.power[data-tip]:hover::after { left: 12px; transform: none; animation-name: tipL; }
@keyframes tipL { from { opacity: 0; } to { opacity: 1; } }
.caption { display: flex; align-self: stretch; margin-left: 10px; }
.cb { width: 46px; height: 100%; display: grid; place-items: center; font: 10px/1 'Segoe Fluent Icons', 'Segoe MDL2 Assets'; color: var(--ink-2); transition: background .12s, color .12s; }
.cb:hover { background: rgba(255, 255, 255, .08); color: var(--ink); }
.cb:active { background: rgba(255, 255, 255, .05); }
.cb.close:hover { background: #c42b1c; color: #fff; }
.cb.close:active { background: #c7473a; }

/* ── сцена ── */
.stage { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; }
#coreHit { width: min(74vw, 36vh, 330px); aspect-ratio: 1; border-radius: 50%; cursor: pointer; margin-top: 6px; }
.readout { text-align: center; padding: 0 24px; min-height: 96px; margin-top: 4px; }
.status { font: 300 30px/1.15 var(--sans); letter-spacing: -.02em; color: var(--ink); min-height: 35px; }
.status .ch { display: inline-block; opacity: 0; filter: blur(6px); animation: chIn .6s var(--ease) forwards; white-space: pre; }
@keyframes chIn { to { opacity: 1; filter: blur(0); } }
.hint { margin-top: 6px; font-size: 12px; color: var(--mute); }
.hint kbd { font: 500 10px/1 var(--mono); color: var(--ink-2); padding: 0 1px; }
.activity { margin-top: 10px; font-size: 10.5px; color: var(--faint); min-height: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }


/* ── чат (как в Claude: пузыри пользователя справа, ответы текстом слева, действия свёрнуты) ── */
.dock { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; padding: 4px 18px 16px; }
.chathead { display: flex; align-items: center; justify-content: space-between; height: 34px; padding: 0 2px 0 6px; }
.chathead .ct { font: 500 9.5px/1 var(--mono); letter-spacing: .28em; text-transform: uppercase; color: var(--faint); }
.feed {
  flex: 1 1 auto; min-height: 40px; overflow-y: auto; padding: 10px 4px 14px; display: flex; flex-direction: column; gap: 18px;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 22px, #000 100%); mask-image: linear-gradient(180deg, transparent 0, #000 22px, #000 100%);
  scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .08) transparent;
}
.msg { animation: msgIn .45s var(--ease) both; user-select: text; max-width: 100%; position: relative; }
@keyframes msgIn { from { opacity: 0; transform: translateY(6px); } }
.msg.user { align-self: flex-end; max-width: 86%; }
.msg.user .bubble { background: #202020; border: 1px solid rgba(255, 255, 255, .06); color: var(--ink); padding: 9px 14px; border-radius: 18px 18px 6px 18px; font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.msg.turn { align-self: stretch; display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; }
.msg.turn .av { width: 22px; height: 22px; border-radius: 50%; margin-top: 1px;
  background: radial-gradient(ellipse 34% 16% at 50% 22%, rgba(255, 255, 255, .8), transparent 70%), radial-gradient(circle at 50% 55%, #1c1c1c 0, #050505 65%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18); }
.msg.turn.live .av { animation: breathe 1.6s ease-in-out infinite; }
.msg.turn .content { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.msg.turn .body { color: var(--ink); font-size: 14px; line-height: 1.62; word-break: break-word; }
.msg.turn .body .w { opacity: 0; animation: wIn .35s var(--ease) forwards; }
@keyframes wIn { to { opacity: 1; } }
.msg.turn .body.err { color: var(--red); font-size: 12.5px; }
.msg .copy { position: absolute; right: 0; bottom: -20px; width: 24px; height: 22px; border-radius: 6px; display: grid; place-items: center; color: var(--faint); opacity: 0; transition: opacity .2s, color .2s; }
.msg .copy svg { width: 14px; height: 14px; }
.msg:hover .copy { opacity: 1; }
.msg .copy:hover { color: var(--ink); background: rgba(255, 255, 255, .06); }
.steps { border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, .02); overflow: hidden; align-self: flex-start; max-width: 100%; }
.steps summary { list-style: none; display: flex; align-items: center; gap: 8px; padding: 6px 11px; font-size: 11.5px; color: var(--mute); cursor: pointer; }
.steps summary::-webkit-details-marker { display: none; }
.steps summary svg { width: 12px; height: 12px; transition: transform .3s var(--ease); }
.steps[open] summary svg { transform: rotate(90deg); }
.steps summary:hover { color: var(--ink-2); }
.steps .spin { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .15); border-top-color: var(--ink-2); animation: spin .8s linear infinite; }
.steps.done .spin { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.steps .list { padding: 2px 11px 8px 31px; display: flex; flex-direction: column; gap: 3px; }
.steps .a { font: 400 10.5px/1.5 var(--mono); color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg.info { align-self: center; text-align: center; font-size: 11px; color: var(--faint); }
.empty { margin: auto 0; text-align: center; padding: 10px 0; }
.empty h2 { font: 300 22px/1.2 var(--sans); color: var(--ink); letter-spacing: -.01em; }
.empty p { color: var(--faint); font-size: 11.5px; margin-top: 8px; line-height: 1.7; }
.empty p b { color: var(--mute); font-weight: 500; }
.sugg { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 16px; }
.sugg button { height: 30px; padding: 0 13px; border-radius: 15px; border: 1px solid var(--line-2); font-size: 11.5px; color: var(--mute); transition: all .2s; }
.sugg button:hover { color: var(--ink); border-color: rgba(255, 255, 255, .26); background: rgba(255, 255, 255, .03); }

.interrupt { position: relative; height: 0; display: flex; justify-content: center; z-index: 3; }
.interrupt kbd { font: 500 9.5px/1 var(--mono); color: var(--faint); margin-left: 6px; }
.interrupt button { position: absolute; bottom: 6px; font-size: 11px; color: var(--ink-2); padding: 5px 12px; border-radius: 14px; background: #181818; border: 1px solid var(--line-2); opacity: 0; transform: translateY(4px); pointer-events: none; transition: opacity .3s, transform .4s var(--ease), color .2s; }
.interrupt button:hover { color: var(--ink); }
body.busy .interrupt button { opacity: 1; transform: none; pointer-events: auto; }

.quick { display: flex; gap: 6px; padding: 6px 2px 8px; }
.tile { height: 26px; padding: 0 11px; border-radius: 13px; font-size: 11px; color: var(--mute); border: 1px solid var(--line); transition: color .2s, border-color .2s, background .2s; }
.tile:hover { color: var(--ink); border-color: var(--line-2); }
.tile.fire { animation: fire .8s var(--ease); }
@keyframes fire { 0% { background: rgba(255, 255, 255, .14); color: #fff; } }
.tile.active { color: var(--red); border-color: rgba(255, 90, 78, .35); }

.composer { display: flex; flex-direction: column; border-radius: 20px; background: #161616; border: 1px solid var(--line-2); padding: 10px 10px 8px 14px; transition: border-color .3s, box-shadow .3s; }
.composer:focus-within { border-color: rgba(255, 255, 255, .26); box-shadow: 0 0 0 4px rgba(255, 255, 255, .025); }
#input { resize: none; border: 0; background: none; outline: none; font: 400 13.5px/1.5 var(--sans); color: var(--ink); user-select: text; max-height: 140px; min-height: 22px; padding: 2px 0; scrollbar-width: thin; }
#input::placeholder { color: var(--faint); }
.crow { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.chint { flex: 1; font-size: 10.5px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chint kbd { font: 500 9.5px/1 var(--mono); color: var(--mute); }
.ptt { flex: 0 0 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: var(--mute); border: 1px solid var(--line-2); transition: color .2s, background .2s, transform .3s var(--spring); --lv: 0; position: relative; }
.ptt svg { width: 16px; height: 16px; }
.ptt:hover { color: var(--ink); background: rgba(255, 255, 255, .05); }
.ptt.on { color: #0a0a0a; background: #ededed; transform: scale(1.06); box-shadow: 0 0 0 calc(2px + var(--lv) * 8px) rgba(255, 255, 255, .12); }
.send { flex: 0 0 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .08); color: var(--faint); transition: background .25s, color .25s, transform .3s var(--spring); pointer-events: none; }
.send svg { width: 15px; height: 15px; }
.send.ready { background: #ededed; color: #0a0a0a; pointer-events: auto; }
.send.ready:active { transform: scale(.92); }

/* ── лист настроек ── */
.scrim { position: fixed; inset: 0; z-index: 20; background: rgba(0, 0, 0, .6); backdrop-filter: blur(14px); opacity: 0; pointer-events: none; transition: opacity .4s var(--ease); }
.scrim.show { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; z-index: 21; left: 10px; right: 10px; top: 50px; bottom: 10px; border-radius: 26px; display: flex; flex-direction: column; overflow: hidden;
  background: #050505; border: 1px solid var(--line); box-shadow: 0 30px 80px rgba(0, 0, 0, .7);
  transform: translateY(16px); opacity: 0; pointer-events: none; transition: transform .5s var(--ease), opacity .3s var(--ease);
}
.sheet.show { transform: none; opacity: 1; pointer-events: auto; }

/* ── настройки в стиле One UI: большой заголовок, скруглённые группы, цветные значки, страницы вглубь ── */
.pages { position: relative; flex: 1; overflow: hidden; }
.pg { position: absolute; inset: 0; display: flex; flex-direction: column; background: #050505; transition: transform .42s var(--ease), opacity .32s var(--ease); }
.pg.in { transform: translateX(44px); opacity: 0; }
.pg.under { transform: translateX(-28px); opacity: 0; pointer-events: none; }
.pbar { flex: 0 0 52px; display: flex; align-items: center; gap: 4px; padding: 0 8px; position: relative; z-index: 2; transition: background .3s, box-shadow .3s; }
.pg.scrolled .pbar { background: rgba(5, 5, 5, .94); box-shadow: 0 1px 0 var(--line); }
.pbar .ptitle { flex: 1; font: 600 15px/1 var(--sans); color: var(--ink); opacity: 0; transform: translateY(4px); transition: opacity .3s, transform .3s var(--ease); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pg.scrolled .ptitle { opacity: 1; transform: none; }
.pbar .rb { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-2); transition: background .2s; }
.pbar .rb:hover { background: rgba(255, 255, 255, .07); }
.pbar .rb svg { width: 20px; height: 20px; }
.pbar .rb.hidden { visibility: hidden; }
.pscroll { flex: 1; overflow-y: auto; padding: 0 14px 30px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .1) transparent; }
.hero { padding: 34px 12px 28px; }
.hero h1 { font: 300 32px/1.1 var(--sans); letter-spacing: -.02em; color: var(--ink); }
.hero p { margin-top: 8px; font-size: 12px; color: var(--mute); line-height: 1.5; }
.gl { font: 600 11.5px/1 var(--sans); color: var(--mute); padding: 16px 18px 9px; }
.cg { background: #141414; border-radius: 24px; padding: 2px 0; margin-bottom: 12px; }
.li { position: relative; display: flex; align-items: center; gap: 14px; width: 100%; min-height: 58px; padding: 11px 18px; text-align: left; transition: background .15s; }
.cg > .li:first-child { border-radius: 24px 24px 0 0; }
.cg > .li:last-child { border-radius: 0 0 24px 24px; }
.cg > .li:only-child { border-radius: 24px; }
.li + .li::before { content: ''; position: absolute; top: 0; left: 18px; right: 18px; height: 1px; background: rgba(255, 255, 255, .06); }
.li.has-ico + .li.has-ico::before { left: 68px; }
button.li:hover, label.li:hover { background: rgba(255, 255, 255, .035); }
button.li:active, label.li:active { background: rgba(255, 255, 255, .06); }
label.li { cursor: pointer; }
.li .ico { flex: 0 0 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--c); color: #fff; }
.li .ico svg { width: 19px; height: 19px; }
.li .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.li .tx b { font-weight: 500; font-size: 14px; color: var(--ink); }
.li .tx small { font-size: 11.5px; color: var(--mute); line-height: 1.4; }
.li .tx small.acc { color: #7fb2ff; }
.li .chev { width: 16px; height: 16px; color: var(--faint); flex: 0 0 16px; }
.li.col { flex-direction: column; align-items: stretch; gap: 10px; }
.li.col .tx { flex: none; }
.li.danger .tx b { color: #ff6b5e; }
.li.off { opacity: .45; }
.sw { position: relative; flex: 0 0 42px; height: 24px; }
.sw input { position: absolute; opacity: 0; pointer-events: none; }
.sw i { position: absolute; inset: 0; border-radius: 12px; background: #3a3a3a; transition: background .3s; }
.sw i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #d8d8d8; transition: transform .35s var(--spring), background .3s; }
.sw input:checked + i { background: #3e91ff; }
.sw input:checked + i::after { transform: translateX(18px); background: #fff; }
.seg2 { display: flex; background: #0b0b0b; border-radius: 20px; padding: 3px; gap: 2px; }
.seg2 button { flex: 1; height: 34px; border-radius: 17px; font-size: 12.5px; color: var(--mute); transition: background .25s, color .25s; white-space: nowrap; padding: 0 8px; overflow: hidden; text-overflow: ellipsis; }
.seg2 button.on { background: #2b2b2b; color: var(--ink); }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pills button { height: 32px; padding: 0 14px; border-radius: 16px; background: #0b0b0b; border: 1px solid rgba(255, 255, 255, .08); font-size: 12px; color: var(--ink-2); transition: all .2s; }
.pills button:hover { border-color: rgba(255, 255, 255, .2); }
.pills button.on { background: #3e91ff; border-color: #3e91ff; color: #fff; }
.slider { display: flex; align-items: center; gap: 12px; }
.slider input { flex: 1; accent-color: #3e91ff; height: 20px; }
.slider output { font: 500 12px var(--mono); color: var(--ink-2); min-width: 44px; text-align: right; }
.fld { width: 100%; height: 42px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, .08); background: #0b0b0b; padding: 0 14px; outline: none; font-size: 13px; color: var(--ink); user-select: text; transition: border-color .2s; }
.fld:focus { border-color: #3e91ff; }
.fld::placeholder { color: var(--faint); }
select.fld { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23888' fill='none' stroke-width='1.3'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 34px; }
select.fld option { background: #151515; }
.chipsed { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chipsed .chip { display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 6px 0 12px; border-radius: 15px; background: #232323; font-size: 12px; color: var(--ink); }
.chipsed .chip button { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; color: var(--mute); }
.chipsed .chip button:hover { color: #ff6b5e; background: rgba(255, 255, 255, .06); }
.chipsed .chip button svg { width: 12px; height: 12px; }
.chipsed input { flex: 1 1 120px; min-width: 120px; height: 30px; border: 0; background: none; outline: none; font-size: 12.5px; color: var(--ink); user-select: text; padding: 0 4px; }
.chipsed input::placeholder { color: var(--faint); }
.linkbtn { color: #7fb2ff; font-size: 12.5px; font-weight: 500; padding: 2px 0; align-self: flex-start; }
.linkbtn:hover { color: #a9caff; }
.addbtn { width: 100%; height: 50px; border-radius: 24px; background: #141414; color: #7fb2ff; font-weight: 500; font-size: 13.5px; display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 12px; transition: background .2s; }
.addbtn:hover { background: #1a1a1a; }
.addbtn svg { width: 18px; height: 18px; }
.steprow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) 34px; gap: 8px; align-items: center; }
.steprow .rm { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: var(--mute); }
.steprow .rm:hover { color: #ff6b5e; background: rgba(255, 255, 255, .05); }
.steprow .rm svg { width: 16px; height: 16px; }
.picker { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 4px; }
.picker button { height: 30px; padding: 0 12px; border-radius: 15px; border: 1px dashed rgba(255, 255, 255, .18); font-size: 11.5px; color: var(--ink-2); }
.picker button:hover { border-color: #3e91ff; color: var(--ink); }
.note2 { font-size: 11.5px; color: var(--mute); padding: 0 18px 14px; line-height: 1.5; }
.skill { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; }
.skill .tt { font-size: 13px; color: var(--ink); }
.skill .dd { font: 400 10.5px/1.5 var(--mono); color: var(--faint); margin-top: 3px; word-break: break-word; }
.skill.fail .tt { color: #ff8c80; }
.skill .x { width: 30px; height: 30px; border-radius: 50%; color: var(--faint); display: grid; place-items: center; }
.skill .x:hover { color: #ff6b5e; background: rgba(255, 255, 255, .05); }
.skill .x svg { width: 15px; height: 15px; }
.ver { text-align: center; font-size: 11px; color: var(--faint); padding: 10px 0 0; }

.toast { position: fixed; z-index: 40; left: 50%; bottom: 84px; transform: translate(-50%, 8px); opacity: 0; pointer-events: none; padding: 8px 16px; border-radius: 18px; background: #ededed; color: #0a0a0a; font-size: 12px; font-weight: 500; transition: opacity .3s, transform .4s var(--spring); max-width: calc(100% - 40px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.grip { position: fixed; z-index: 30; right: 0; bottom: 0; width: 14px; height: 14px; cursor: nwse-resize; }

body.booting .titlebar, body.booting .readout, body.booting .dock { opacity: 0; }
.titlebar, .readout, .dock { transition: opacity 1.2s var(--ease); }
.readout { transition-delay: .6s; } .dock { transition-delay: .85s; }
@media (max-height: 760px) { .status { font-size: 26px; } }

/* окно скрыто (режим сферы): анимации на паузе, 3D-холст не рисуется */
.jv-hidden *, .jv-hidden *::before, .jv-hidden *::after { animation-play-state: paused !important; transition: none !important; }
.jv-hidden canvas { visibility: hidden !important; }

/* ── боковая панель: плавные графики нагрузки ── */
.side { display: none; }
.side .card { padding: 16px 18px; border-bottom: 1px solid var(--line); }
.side .card:last-child { border-bottom: 0; }
.side h3 { font: 500 9.5px/1 var(--mono); letter-spacing: .28em; text-transform: uppercase; color: var(--faint); margin-bottom: 12px; }
.charts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.chart { position: relative; border-radius: 16px; background: rgba(255, 255, 255, .03); border: 1px solid var(--line); padding: 10px 12px 9px; overflow: hidden; }
.ch-top { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.chart .lb { font-size: 11px; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chart .v { font: 500 15px/1.2 var(--mono); color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.chart canvas { display: block; width: 100%; height: 38px; margin: 6px 0 2px; }
.chart .sub { display: block; font: 400 9.5px/1.4 var(--mono); color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 13px; }
.chart.hot .v { color: var(--red); }
.net { font-size: 10.5px; color: var(--faint); display: flex; justify-content: space-between; margin-top: 10px; }
.music .np { display: flex; gap: 12px; align-items: center; }
.music .art { flex: 0 0 52px; height: 52px; border-radius: 10px; background: #161616 center / cover no-repeat; box-shadow: inset 0 0 0 1px var(--line); }
.music .tt { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.music .tt b { font-weight: 600; font-size: 12.5px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.music .tt span { font-size: 11.5px; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.music .bar { display: block; height: 2px; margin: 12px 0 8px; background: rgba(255, 255, 255, .07); border-radius: 1px; overflow: hidden; }
.music .bar b { display: block; height: 100%; width: 0; background: var(--ink-2); transition: width 1s linear; }
.music .ctl { display: flex; justify-content: center; gap: 14px; }
.music .ctl button { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-2); transition: color .2s, background .2s, transform .3s var(--spring); }
.music .ctl button svg { width: 14px; height: 14px; }
.music .ctl button:hover { color: var(--ink); background: rgba(255, 255, 255, .07); }
.music .ctl button:active { transform: scale(.92); }
.music .ctl .pp { background: #ededed; color: #0a0a0a; }
.music .ctl .pp:hover { background: #fff; color: #0a0a0a; }
.music.empty .np, .music.empty .bar, .music.empty .ctl { opacity: .35; }

/* сфера ВСЕГДА по центру окна: узкое — сфера сверху; среднее — сфера сверху, под ней чат и панель;
   широкое — три колонки (чат | сфера | система), сфера ровно посередине */
@media (min-width: 680px) {
  #app { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: 46px auto minmax(0, 1fr); }
  .titlebar { grid-column: 1 / -1; }
  .stage { grid-column: 1 / -1; grid-row: 2; justify-content: center; padding-bottom: 6px; }
  .dock { grid-column: 1; grid-row: 3; padding: 4px 16px 16px; border-top: 1px solid var(--line); border-right: 1px solid var(--line); background: rgba(10, 10, 10, .6); }
  .side { display: flex; flex-direction: column; grid-column: 2; grid-row: 3; overflow-y: auto; border-top: 1px solid var(--line); background: rgba(10, 10, 10, .7); scrollbar-width: none; }
  #coreHit { width: min(40vw, 34vh, 300px); }
  .readout { min-height: 80px; }
  .sheet { left: auto; width: min(520px, calc(100% - 20px)); }
}
@media (min-width: 1020px) {
  #app { grid-template-columns: minmax(0, 1fr) minmax(320px, 36%) minmax(0, 1fr); grid-template-rows: 46px minmax(0, 1fr); }
  .stage { grid-column: 2; grid-row: 2; padding-bottom: 40px; }
  .dock { grid-column: 1; grid-row: 2; border-top: 0; }
  .side { grid-column: 3; grid-row: 2; border-top: 0; border-left: 1px solid var(--line); }
  #coreHit { width: min(32vw, 56vh, 420px); }
  .readout { min-height: 96px; }
}

#bk, #pm { position: fixed; z-index: 1; pointer-events: none; display: block; }

/* демо в браузере (сайт): кнопок окна Windows нет */
body.demo .caption, body.demo #btnPet, body.demo .grip { display: none; }
