:root {
  --bg: #000;
  --bg2: #0b0b0b;
  --panel: #151515;
  --line: #232323;
  --line2: #333;
  --text: #f2f2f2;
  --dim: #8b8b8b;
  --blue: #6aa8ff;
  --green: #3fb950;
  --amber: #e3b341;
  --danger: #ff6b6b;
  --side: 272px;
  --comp: 520px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
body { display: flex; overflow: hidden; height: 100dvh; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
.hidden { display: none !important; }
.dim { color: var(--dim); }
.logo { font-weight: 700; }
.logo.big { font-size: 40px; }

/* ---------- sidebar ---------- */
#sidebar { width: var(--side); flex: none; background: var(--bg2); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 12px 10px; padding-top: max(12px, env(safe-area-inset-top)); transition: transform .2s; z-index: 20; }
.side-top { display: flex; align-items: center; gap: 4px; }
.brand { flex: 1; font-size: 18px; font-weight: 650; padding: 6px 8px; }
.usage { display: block; width: 100%; text-align: left; margin: 6px 0 4px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 12px; font-size: 12px; color: var(--dim); }
.usage:hover { background: var(--panel); }
.usage .row { display: flex; justify-content: space-between; gap: 6px; }
.usage .bar { height: 4px; border-radius: 4px; background: #222; margin: 3px 0 6px; overflow: hidden; }
.usage .bar i { display: block; height: 100%; background: #e6e6e6; border-radius: 4px; }
.usage .bar i.warn { background: var(--amber); }
.usage .bar i.hot { background: var(--danger); }
.side-scroll { flex: 1; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.side-head { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--dim); padding: 14px 8px 4px; text-transform: uppercase; letter-spacing: .06em; }
.mini { width: 24px; height: 24px; border-radius: 8px; color: var(--dim); font-size: 15px; }
.mini:hover { background: var(--panel); color: #fff; }
.item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 7px 8px; border-radius: 12px; color: #d6d6d6; }
.item:hover { background: var(--panel); }
.item.active { background: #1c1c1c; color: #fff; }
.item .meta { flex: 1; min-width: 0; }
.item .meta b { display: block; font-weight: 550; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .meta small { display: block; font-size: 12px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.av { position: relative; width: 32px; height: 32px; flex: none; border-radius: 30%; display: grid; place-items: center; color: #fff; background: #1b1b1b; box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
.av svg { width: 58%; height: 58%; filter: drop-shadow(0 1px 2px rgba(0,0,0,.35)); }
.av img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.av.xs { width: 20px; height: 20px; }
.av.sm { width: 24px; height: 24px; }
.av.lg { width: 44px; height: 44px; }
.av.xl { width: 64px; height: 64px; }
.av-btn { padding: 0; border-radius: 30%; position: relative; }
.av-btn::after { content: '✎'; position: absolute; right: -4px; bottom: -4px; width: 20px; height: 20px; border-radius: 50%; background: #fff; color: #000; font-size: 11px; display: grid; place-items: center; opacity: 0; transition: opacity .15s; }
.av-btn:hover::after, .name-row .av-btn::after { opacity: 1; }
.name-row { display: flex; align-items: flex-end; gap: 14px; margin-top: 8px; }
.chip-av { display: inline-flex; align-items: center; gap: 6px; }
.avatar-pop { position: fixed; inset: 0; z-index: 95; background: rgba(0,0,0,.6); display: grid; place-items: center; padding: 16px; }
.ap-card { width: min(440px, 100%); background: #111; border: 1px solid var(--line2); border-radius: 22px; padding: 18px; }
.ap-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.ap-icons { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 6px; }
.ap-icons button { aspect-ratio: 1; border-radius: 12px; border: 1px solid var(--line); color: #ddd; display: grid; place-items: center; }
.ap-icons button svg { width: 22px; height: 22px; }
.ap-icons button.on, .ap-icons button:hover { background: #fff; color: #000; }
.ap-colors { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.ap-colors button { width: 28px; height: 28px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); }
.ap-colors button.on { outline: 2px solid #fff; outline-offset: 2px; }
.ap-foot { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.ap-foot label.btn { cursor: pointer; }
.av .st { position: absolute; right: -2px; bottom: -2px; width: 10px; height: 10px; border-radius: 50%; background: var(--green); border: 2px solid var(--bg2); animation: pulse 1.2s ease-in-out infinite; }
.stack { display: flex; }
.stack .av { margin-left: -8px; box-shadow: 0 0 0 2px var(--bg2); }
.stack .av:first-child { margin-left: 0; }
.badge { min-width: 18px; height: 18px; border-radius: 9px; background: var(--amber); color: #000; font-size: 11px; font-weight: 700; display: grid; place-items: center; padding: 0 5px; }
.side-nav { display: flex; flex-direction: column; gap: 1px; margin: 14px 0 6px; border-top: 1px solid var(--line); padding-top: 10px; }
.side-nav button { text-align: left; padding: 7px 10px; border-radius: 10px; color: #cfcfcf; font-size: 14px; }
.side-nav button:hover { background: var(--panel); }
.side-foot { font-size: 12px; color: var(--dim); padding: 8px 8px 0; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.dot { position: absolute; top: 7px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
#bell { position: relative; }

/* ---------- main ---------- */
main { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; }
.topbar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; padding-top: max(8px, env(safe-area-inset-top)); min-height: 56px; border-bottom: 1px solid var(--line); }
.thread-head { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; text-align: left; padding: 4px 6px; border-radius: 12px; }
.thread-head:hover { background: var(--panel); }
.thread-head .meta { min-width: 0; }
.thread-head b { display: block; font-size: 15px; }
.thread-head small { display: block; color: var(--dim); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-actions { display: flex; gap: 2px; }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; display: inline-grid; place-items: center; color: #cfcfcf; }
.icon-btn:hover { background: var(--panel); }
.icon-btn.on { background: #fff; color: #000; }
#openSide { display: none; }
.only-mobile { display: none; }

.thread { flex: 1; overflow-y: auto; padding: 18px 16px 24px; }
.empty { max-width: 560px; margin: 8vh auto 0; text-align: center; color: var(--dim); }
.empty .av { margin: 0 auto 14px; }
.empty .av.lg { width: 64px; height: 64px; }
.empty h2 { color: #fff; margin: 0 0 6px; font-size: 22px; font-weight: 600; }
.starters { display: flex; flex-direction: column; gap: 8px; margin-top: 22px; }
.starters button { text-align: left; padding: 10px 14px; border: 1px solid var(--line); border-radius: 14px; color: #d0d0d0; }
.starters button:hover { background: var(--panel); }

.msg { max-width: 800px; margin: 0 auto 20px; display: flex; gap: 12px; }
.msg.user { justify-content: flex-end; }
.msg.user .bubble { background: var(--panel); border: 1px solid var(--line); padding: 9px 15px; border-radius: 20px 20px 6px 20px; max-width: 85%; white-space: pre-wrap; word-wrap: break-word; }
.msg.user .att-row { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; margin-bottom: 6px; }
.msg.user .att-row img { max-width: 160px; max-height: 160px; border-radius: 14px; }
.msg.user .col { display: flex; flex-direction: column; align-items: flex-end; max-width: 85%; }
.msg.event { justify-content: center; color: var(--dim); font-size: 13px; }
.msg.bot .col { flex: 1; min-width: 0; }
.msg.bot .who { font-size: 13px; color: var(--dim); margin-bottom: 2px; }
.msg.bot .who b { color: #e6e6e6; font-weight: 600; margin-right: 6px; }
.body { word-wrap: break-word; }
.body p { margin: .5em 0; }
.body > :first-child { margin-top: 0; }
.body h1, .body h2, .body h3 { line-height: 1.3; margin: 1em 0 .4em; }
.body h1 { font-size: 1.4em; } .body h2 { font-size: 1.22em; } .body h3 { font-size: 1.06em; }
.body a { color: var(--blue); text-decoration: none; }
.body a:hover { text-decoration: underline; }
.body code:not(pre code) { background: #1d1d1d; padding: 1px 6px; border-radius: 6px; font-size: .9em; }
.body pre { position: relative; background: #0d0d0d; border: 1px solid var(--line); border-radius: 12px; padding: 12px; overflow-x: auto; font-size: 13px; }
.body pre .copy { position: absolute; top: 6px; right: 6px; font-size: 12px; padding: 3px 9px; border-radius: 8px; background: #222; color: #bbb; }
.body table { border-collapse: collapse; display: block; overflow-x: auto; font-size: 14px; margin: .7em 0; }
.body th, .body td { border: 1px solid var(--line2); padding: 6px 10px; text-align: left; }
.body th { background: #141414; }
.body blockquote { border-left: 3px solid var(--line2); margin: .6em 0; padding: 0 14px; color: #bbb; }
.body img { max-width: 100%; border-radius: 12px; }
.mention-tag { color: var(--blue); font-weight: 550; }
.err-box { color: var(--danger); font-size: 14px; border: 1px solid #4a2020; background: #160909; border-radius: 12px; padding: 8px 12px; margin-top: 6px; white-space: pre-wrap; }

.steps { margin-bottom: 8px; border: 1px solid var(--line); border-radius: 14px; background: #080808; font-size: 13.5px; }
.steps summary { list-style: none; cursor: pointer; padding: 8px 12px; color: #bdbdbd; display: flex; align-items: center; gap: 8px; }
.steps summary::-webkit-details-marker { display: none; }
.spin { width: 12px; height: 12px; flex: none; border-radius: 50%; border: 2px solid #555; border-top-color: #fff; animation: spin .8s linear infinite; }
.steps .list { padding: 0 12px 10px; max-height: 360px; overflow-y: auto; }
.steps .step { color: var(--dim); padding: 2px 0; display: flex; gap: 8px; }
.steps .step b { color: #ccc; font-weight: 500; flex: none; }
.steps .step span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.steps .step.sub { padding-left: 14px; }
.steps .thinking { white-space: pre-wrap; color: #8a8a8a; font-size: 13px; border-left: 2px solid var(--line2); padding-left: 10px; margin: 6px 0; max-height: 220px; overflow-y: auto; }
.shot { max-width: 100%; border-radius: 10px; border: 1px solid var(--line); margin: 4px 0; cursor: zoom-in; }
.actions { display: flex; gap: 2px; margin-top: 4px; }
.actions button { padding: 3px 8px; border-radius: 8px; font-size: 12.5px; color: var(--dim); }
.actions button:hover { background: var(--panel); color: #fff; }
.typing { color: var(--dim); }
.typing::after { content: '▍'; animation: blink 1s steps(2) infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes pulse { 50% { opacity: .45; } }

.req { max-width: 800px; margin: 0 auto 16px; border: 1px solid #5a4a1f; background: #15110a; border-radius: 16px; padding: 12px 14px; }
.req.takeover { border-color: #1f3d5a; background: #0a1218; }
.req h4 { margin: 0 0 6px; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.req pre { background: #0c0a05; border-radius: 10px; padding: 10px; font-size: 12.5px; white-space: pre-wrap; max-height: 220px; overflow: auto; margin: 0 0 10px; }
.req .row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn { padding: 7px 15px; border-radius: 99px; border: 1px solid var(--line2); font-size: 14px; }
.btn.primary { background: #fff; color: #000; border-color: #fff; }
.btn.danger { color: var(--danger); }
.btn:hover { filter: brightness(1.15); }
.err { color: var(--danger); font-size: 14px; }

/* ---------- composer ---------- */
.composer-wrap { position: relative; padding: 0 16px max(12px, env(safe-area-inset-bottom)); }
.composer { max-width: 800px; margin: 0 auto; background: var(--bg2); border: 1px solid var(--line2); border-radius: 24px; padding: 8px 8px 6px 14px; }
.composer:focus-within { border-color: #4a4a4a; }
.composer textarea { width: 100%; border: 0; outline: none; background: none; resize: none; max-height: 200px; padding: 6px 0; font-size: 16px; }
.composer-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.composer-row .left, .composer-row .right { display: flex; align-items: center; gap: 4px; min-width: 0; }
.working-note { font-size: 12.5px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-left: 4px; }
.pill { height: 32px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line2); color: #d0d0d0; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; font-size: 14px; cursor: pointer; }
.pill.icon { width: 32px; padding: 0; justify-content: center; }
.pill:hover { background: var(--panel); }
.pill.on { background: #fff; color: #000; border-color: #fff; }
.send { width: 36px; height: 36px; border-radius: 50%; background: #fff; color: #000; font-size: 18px; font-weight: 700; display: grid; place-items: center; }
.send.stop { font-size: 13px; }
.attachments { display: flex; gap: 6px; flex-wrap: wrap; }
.attachments:not(:empty) { padding: 4px 0 6px; }
.att { display: flex; align-items: center; gap: 6px; padding: 4px 8px; background: #1a1a1a; border-radius: 12px; font-size: 13px; }
.att img { width: 40px; height: 40px; object-fit: cover; border-radius: 8px; }
.att button { color: var(--dim); }
.mention { position: absolute; bottom: calc(100% + 4px); left: 30px; }

/* ---------- the computer ---------- */
.computer { width: var(--comp); flex: none; border-left: 1px solid var(--line); background: var(--bg2); display: flex; flex-direction: column; padding: 10px; padding-top: max(10px, env(safe-area-inset-top)); gap: 8px; z-index: 25; }
.comp-top { display: flex; align-items: center; gap: 8px; }
.comp-top b { font-size: 14px; }
.comp-top .dim { flex: 1; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.url-bar { display: flex; gap: 6px; }
.url-bar input { flex: 1; min-width: 0; background: #000; border: 1px solid var(--line2); border-radius: 10px; padding: 6px 10px; outline: none; font-size: 13px; }
.screen-wrap { position: relative; background: #000; border: 1px solid var(--line2); border-radius: 12px; overflow: hidden; aspect-ratio: 1280 / 800; }
.screen-wrap img { width: 100%; height: 100%; object-fit: contain; display: block; }
body.takeover .screen-wrap { outline: 2px solid var(--blue); cursor: crosshair; }
.screen-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--dim); font-size: 14px; }
.takeover { font-size: 13px; color: #cfcfcf; display: flex; flex-direction: column; gap: 6px; }
.tk { display: flex; gap: 8px; align-items: center; }
.type-form { display: flex; gap: 6px; }
.type-form input { flex: 1; min-width: 0; background: #000; border: 1px solid var(--line2); border-radius: 10px; padding: 6px 10px; outline: none; }
.mac-status { font-size: 12.5px; color: var(--dim); border-top: 1px solid var(--line); padding-top: 8px; }

/* ---------- menus & panels ---------- */
.menu { position: fixed; z-index: 50; background: #161616; border: 1px solid var(--line2); border-radius: 14px; padding: 6px; min-width: 200px; box-shadow: 0 16px 50px rgba(0,0,0,.6); max-height: 60vh; overflow-y: auto; }
.menu.mention { position: absolute; }
.menu button { display: flex; width: 100%; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; text-align: left; }
.menu button:hover, .menu button.sel { background: #222; }
.menu small { color: var(--dim); display: block; font-size: 12px; }
.panel { position: fixed; inset: 0; background: rgba(0,0,0,.65); z-index: 40; display: grid; place-items: center; padding: 16px; }
.panel-card { position: relative; width: min(760px, 100%); max-height: 90dvh; overflow-y: auto; background: #101010; border: 1px solid var(--line2); border-radius: 22px; padding: 22px; }
.panel-close { position: absolute; top: 14px; right: 14px; }
.panel h2 { margin: 0 0 4px; font-size: 20px; padding-right: 40px; }
.panel .sub { color: var(--dim); margin: 0 0 16px; font-size: 14px; }
.panel label { display: block; font-size: 13px; color: var(--dim); margin: 12px 0 4px; }
.panel input[type=text], .panel input[type=password], .panel input[type=time], .panel input[type=number], .panel textarea, .panel select { width: 100%; background: #070707; border: 1px solid var(--line2); border-radius: 12px; padding: 9px 12px; outline: none; }
.panel textarea { min-height: 90px; resize: vertical; }
.panel .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.panel .three { display: grid; grid-template-columns: 70px 90px 1fr; gap: 10px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.card { border: 1px solid var(--line); border-radius: 16px; padding: 14px; background: #090909; display: flex; flex-direction: column; gap: 6px; text-align: left; }
button.card:hover { border-color: #444; }
.card .head { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.card .head .ic { font-size: 20px; }
.card p { margin: 0; color: var(--dim); font-size: 13px; flex: 1; }
.card .foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 4px; }
.tag { font-size: 11px; padding: 2px 8px; border-radius: 99px; background: #1e1e1e; color: var(--dim); }
.tag.ok { color: var(--green); }
.switch { width: 40px; height: 24px; border-radius: 99px; background: #333; position: relative; flex: none; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #999; transition: .15s; }
.switch.on { background: #fff; }
.switch.on::after { left: 19px; background: #000; }
.row-list { display: flex; flex-direction: column; gap: 8px; }
.row-item { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.row-item .grow { flex: 1; min-width: 0; }
.row-item .grow small { color: var(--dim); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips button { padding: 5px 11px; border-radius: 99px; border: 1px solid var(--line2); font-size: 13px; }
.chips button.on { background: #fff; color: #000; border-color: #fff; }
section.block { margin-top: 22px; }
section.block h3 { font-size: 15px; margin: 0 0 8px; }
code.inline { background: #1d1d1d; padding: 2px 6px; border-radius: 6px; font-size: 12.5px; word-break: break-all; }
.seg { display: inline-flex; border: 1px solid var(--line2); border-radius: 99px; padding: 2px; }
.seg button { padding: 5px 12px; border-radius: 99px; font-size: 13px; color: #cfcfcf; }
.seg button.on { background: #fff; color: #000; }
.toasts { position: fixed; right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); z-index: 70; display: flex; flex-direction: column; gap: 8px; max-width: min(360px, calc(100vw - 32px)); }
.toast { background: #181818; border: 1px solid var(--line2); border-radius: 14px; padding: 10px 14px; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.5); cursor: pointer; }
.toast b { display: block; }
.toast small { color: var(--dim); }

/* ---------- setup ---------- */
.setup { position: fixed; inset: 0; z-index: 90; background: radial-gradient(circle at 50% 0%, #161616, #000 60%); overflow-y: auto; padding: max(28px, env(safe-area-inset-top)) 16px max(28px, env(safe-area-inset-bottom)); }
.setup-card { max-width: 760px; margin: 0 auto; }
.setup h1 { margin: 8px 0 6px; font-size: 30px; letter-spacing: -.01em; }
.setup p { margin: 0 0 18px; max-width: 620px; }
.setup-label { display: block; font-size: 13px; color: var(--dim); margin: 18px 0 6px; text-transform: uppercase; letter-spacing: .06em; }
.setup-input { width: 100%; max-width: 320px; background: #0b0b0b; border: 1px solid var(--line2); border-radius: 12px; padding: 10px 14px; outline: none; font-size: 16px; }
.setup-bots { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.pick { border: 1px solid var(--line); border-radius: 16px; padding: 12px; background: #090909; display: flex; flex-direction: column; gap: 8px; cursor: pointer; transition: border-color .15s; }
.pick.on { border-color: #fff; background: #111; }
.pick .top { display: flex; align-items: center; gap: 10px; }
.pick .check { margin-left: auto; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line2); display: grid; place-items: center; font-size: 12px; flex: none; }
.pick.on .check { background: #fff; color: #000; border-color: #fff; }
.pick input { flex: 1; min-width: 0; background: transparent; border: 1px solid transparent; border-radius: 8px; padding: 3px 6px; font-weight: 600; font-size: 15px; outline: none; }
.pick input:hover, .pick input:focus { border-color: var(--line2); background: #000; }
.pick .job { font-size: 12px; color: var(--dim); }
.pick p { margin: 0; font-size: 13px; color: var(--dim); }
.setup-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 22px; position: sticky; bottom: 0; padding: 12px 0; background: linear-gradient(transparent, #000 40%); }
.setup-foot .btn { padding: 10px 22px; font-weight: 600; }

/* ---------- login ---------- */
.login { position: fixed; inset: 0; z-index: 100; background: #000; display: grid; place-items: center; padding: 16px; }
.login form { width: min(360px, 100%); text-align: center; display: flex; flex-direction: column; gap: 10px; }
.login h1 { margin: 0; }
.login p { color: var(--dim); margin: 0 0 8px; }
.login input { padding: 12px 16px; border-radius: 14px; border: 1px solid var(--line2); background: #0d0d0d; outline: none; text-align: center; font-size: 18px; letter-spacing: .1em; }
.login button { padding: 12px; border-radius: 14px; background: #fff; color: #000; font-weight: 600; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .computer { position: fixed; inset: 0 0 0 auto; width: min(var(--comp), 100vw); box-shadow: -20px 0 60px rgba(0,0,0,.6); }
}
@media (max-width: 860px) {
  #sidebar { position: fixed; inset: 0 auto 0 0; transform: translateX(-100%); width: min(86vw, 320px); box-shadow: 20px 0 60px rgba(0,0,0,.6); }
  body.side-open #sidebar { transform: none; }
  #openSide { display: inline-grid; }
  .only-mobile { display: inline-grid; }
  .thread { padding: 12px 12px 16px; }
  .composer-wrap { padding: 0 10px max(10px, env(safe-area-inset-bottom)); }
  .msg { gap: 8px; }
  .msg.bot > .av { display: none; }
  .panel { padding: 0; align-items: end; }
  .panel-card { border-radius: 22px 22px 0 0; max-height: 92dvh; padding-bottom: max(22px, env(safe-area-inset-bottom)); }
  .panel .two { grid-template-columns: 1fr; }
  .computer { width: 100vw; }
}

/* ---------- bot-to-bot texts ---------- */
.xchg { margin: 0 0 8px; border: 1px solid var(--line); border-radius: 14px; background: #0a0a0f; font-size: 13.5px; }
.xchg summary { list-style: none; cursor: pointer; padding: 8px 12px; display: flex; align-items: center; gap: 8px; color: #cfcfcf; }
.xchg summary::-webkit-details-marker { display: none; }
.xchg summary b { color: #fff; font-weight: 600; }
.xchg summary .chev { margin-left: auto; color: var(--dim); transition: transform .15s; }
.xchg[open] summary .chev { transform: rotate(90deg); }
.x-body { padding: 0 12px 10px; display: flex; flex-direction: column; gap: 10px; }
.x-line { display: flex; gap: 8px; }
.x-line small { color: var(--dim); font-size: 12px; }
.x-line p { margin: 2px 0 0; white-space: pre-wrap; }
.x-line .body { font-size: 14px; }
.x-open { align-self: flex-start; font-size: 12.5px; color: var(--blue); padding: 0 0 0 28px; }
.msg.texted .who { font-size: 13px; }
.text-bubble { display: inline-block; background: #12121c; border: 1px solid #262640; padding: 8px 14px; border-radius: 6px 18px 18px 18px; white-space: pre-wrap; max-width: 100%; }

/* ---------- calls ---------- */
.call { position: fixed; inset: 0; z-index: 80; background: radial-gradient(circle at 50% 30%, var(--call-tint, #1a1a2e) 0%, #000 65%); display: flex; flex-direction: column; padding: max(18px, env(safe-area-inset-top)) 20px max(26px, env(safe-area-inset-bottom)); text-align: center; }
.call-top { height: 24px; font-variant-numeric: tabular-nums; }
.call-center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 0; }
.call-orb { position: relative; width: 148px; height: 148px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 10px; }
.call-orb .av { width: 148px; height: 148px; border-radius: 50%; z-index: 1; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.call-orb .ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--call-color, #8b8bff); opacity: 0; }
.call.speaking .ring.r1 { animation: ring 1.6s ease-out infinite; }
.call.speaking .ring.r2 { animation: ring 1.6s ease-out .8s infinite; }
.call.listening .call-orb .av { animation: breathe 2.4s ease-in-out infinite; }
.call.thinking .call-orb .av { animation: pulse 1s ease-in-out infinite; }
@keyframes ring { from { transform: scale(1); opacity: .7; } to { transform: scale(1.55); opacity: 0; } }
@keyframes breathe { 50% { transform: scale(1.04); } }
.call h2 { margin: 0; font-size: 28px; font-weight: 600; }
.call-state { color: #bbb; font-size: 15px; min-height: 22px; }
.call-heard { color: #fff; font-size: 19px; max-width: 620px; min-height: 28px; }
.call-said { color: #9a9a9a; font-size: 15px; max-width: 620px; max-height: 26vh; overflow-y: auto; }
.call-type { width: min(520px, 100%); }
.call-type input { width: 100%; background: #0d0d0d; border: 1px solid var(--line2); border-radius: 14px; padding: 12px 14px; outline: none; font-size: 16px; }
.call-controls { display: flex; justify-content: center; gap: 28px; }
.cbtn { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; color: #ccc; }
.cbtn svg { width: 64px; height: 64px; padding: 19px; border-radius: 50%; background: rgba(255,255,255,.12); backdrop-filter: blur(10px); }
.cbtn.on svg { background: #fff; color: #000; }
.cbtn.end svg { background: #ff3b30; color: #fff; }
.voice-list { max-height: 52vh; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; margin: 10px 0; }
.voice-list button { display: flex; align-items: center; gap: 10px; text-align: left; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--line); }
.voice-list button.on { border-color: #fff; background: #1a1a1a; }
.voice-list button small { color: var(--dim); margin-left: auto; font-size: 12px; }
.voice-list h4 { margin: 10px 2px 4px; font-size: 12px; color: var(--dim); text-transform: uppercase; letter-spacing: .06em; font-weight: 500; }

/* ---------- computer: cursor & full screen ---------- */
.cursor { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 2; transition: left .12s linear, top .12s linear; filter: drop-shadow(0 2px 3px rgba(0,0,0,.5)); }
.cursor svg { display: block; transform: translate(-4px, -2px); }
.cursor::after { content: ''; position: absolute; left: -14px; top: -14px; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--blue); opacity: 0; }
.cursor.click::after { animation: click-ripple .5s ease-out; }
@keyframes click-ripple { from { transform: scale(.3); opacity: 1; } to { transform: scale(1.4); opacity: 0; } }
#compFull .shr { display: none; }
body.comp-full #compFull .exp { display: none; }
body.comp-full #compFull .shr { display: inline; }
body.comp-full .computer { position: fixed; inset: 0; width: 100vw; height: 100dvh; z-index: 85; padding: max(10px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)); background: #000; box-shadow: none; border: 0; }
body.comp-full .screen-wrap { width: min(100%, calc((100dvh - 150px) * 1.6)); margin: 0 auto; flex: none; }
body.comp-full .mac-status { display: none; }
body.comp-full .takeover { width: min(100%, calc((100dvh - 150px) * 1.6)); margin: 0 auto; }

.actions .tok { margin-left: auto; align-self: center; font-size: 11.5px; color: #5f5f5f; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- apps ---------- */
.apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.app { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 8px 10px; border: 1px solid var(--line); border-radius: 16px; background: #090909; text-align: center; }
.app:hover { border-color: #444; }
.app img, .app .app-ph { width: 36px; height: 36px; border-radius: 9px; object-fit: contain; background: #fff; padding: 4px; }
.app .app-ph { display: grid; place-items: center; color: #000; font-weight: 700; }
.app b { font-size: 12.5px; font-weight: 550; line-height: 1.2; }
.app small { font-size: 11.5px; color: var(--dim); }
.app.on { border-color: #1f5136; background: #08130d; }
.app.on small { color: var(--green); }

.req.savelogin { border-color: #1f4d3a; background: #08130e; }
.login-fields { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; max-width: 420px; }
.login-fields input { background: #000; border: 1px solid var(--line2); border-radius: 10px; padding: 8px 11px; outline: none; font-size: 15px; }
