/* MINI control panel — "mission control" in the mascot's colours: deep charcoal glass, cream type, orange plume accent, cyan earcups.
   Layout is an app shell (header / scrolling main / nav) so chat and the remote desktop can fill the screen with fixed controls. */
:root {
  --bg: #0b0e13; --bg-2: #121722; --surface: rgb(255 255 255 / .045); --surface-2: rgb(255 255 255 / .08); --surface-solid: #151b26;
  --line: rgb(255 255 255 / .09); --line-strong: rgb(255 255 255 / .16);
  --ink: #f6efe3; --muted: #aab3c0; --accent: #ff9a4d; --accent-2: #ffc08a; --accent-ink: #2a1503;
  --cyan: #52d3ee; --danger: #ff8a7a; --ok: #7be0a3; --fur: #f6ecdc;
  --radius: 22px; --radius-sm: 14px; --shadow: 0 18px 50px -24px rgb(0 0 0 / .7), inset 0 1px 0 rgb(255 255 255 / .06);
  --font: "Sora", ui-rounded, "SF Pro Rounded", "Segoe UI Variable Display", "Trebuchet MS", system-ui, sans-serif;
  --nav-h: 68px; --rail-w: 220px;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme=dark]) {
    --bg: #f5ecdc; --bg-2: #efe2cb; --surface: rgb(255 255 255 / .62); --surface-2: rgb(255 255 255 / .9); --surface-solid: #fffaf0;
    --line: rgb(40 30 10 / .12); --line-strong: rgb(40 30 10 / .22); --ink: #25303b; --muted: #56616e;
    --accent: #c45f16; --accent-2: #e58a3d; --accent-ink: #fff; --cyan: #0a7a96; --danger: #b3261e; --ok: #1d7a43;
    --shadow: 0 16px 40px -26px rgb(70 40 0 / .5), inset 0 1px 0 rgb(255 255 255 / .8);
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
html { color-scheme: dark light; }
body {
  margin: 0; color: var(--ink); font: 400 15.5px/1.5 var(--font); overflow: hidden; overscroll-behavior: none;
  background: radial-gradient(900px 500px at 85% -10%, rgb(255 154 77 / .16), transparent 60%), radial-gradient(700px 500px at -10% 110%, rgb(82 211 238 / .12), transparent 60%), var(--bg);
}
.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--accent-ink); padding: 10px 14px; z-index: 50; border-radius: 0 0 10px 0; }
.skip:focus { left: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.ic { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ic.xl { width: 44px; height: 44px; stroke-width: 1.4; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; border-radius: 8px; }

/* ---------- shell */
.app { height: 100dvh; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; grid-template-columns: minmax(0, 1fr); max-width: 100vw; }
.top { display: flex; align-items: center; gap: 12px; padding: calc(10px + env(safe-area-inset-top)) 18px 8px; max-width: 1100px; width: 100%; margin: 0 auto; }
.title { flex: 1; min-width: 0; }
.title h1 { margin: 0; font-size: 1.25rem; font-weight: 700; letter-spacing: .14em; line-height: 1.1; }
.title p { margin: 2px 0 0; color: var(--muted); font-size: .82rem; display: flex; align-items: center; gap: 7px; overflow: hidden; }
.title p span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
[data-conn=on] .dot { background: var(--ok); box-shadow: 0 0 0 0 rgb(123 224 163 / .6); animation: ping 2.4s infinite; }
[data-conn=busy] .dot { background: var(--accent); animation: ping 1s infinite; }
@keyframes ping { 70% { box-shadow: 0 0 0 7px rgb(123 224 163 / 0); } 100% { box-shadow: 0 0 0 0 rgb(123 224 163 / 0); } }
.chip { border-radius: 999px; padding: 4px 12px; font-size: .8rem; font-weight: 600; border: 1px solid var(--line-strong); }
.chip-danger { color: var(--danger); border-color: var(--danger); background: rgb(255 138 122 / .1); }
main { min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; padding: 4px 18px 22px; width: 100%; max-width: 1100px; margin: 0 auto; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
main:focus { outline: none; }
.view[hidden] { display: none; }
.view.chat:not([hidden]), .view.desk:not([hidden]) { display: flex; flex-direction: column; height: 100%; min-height: 0; }
body[data-view=chat] main, body[data-view=desk] main { overflow: hidden; padding-bottom: 10px; }
body[data-view=login] .top { visibility: hidden; }

.bar { display: grid; grid-template-columns: repeat(5, 1fr); background: color-mix(in srgb, var(--bg-2) 88%, transparent); backdrop-filter: blur(18px) saturate(1.4); border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); min-height: var(--nav-h); }
.bar[hidden] { display: none; }
.bar .brand { display: none; }
.bar button { position: relative; border: none; background: none; color: var(--muted); border-radius: 16px; min-height: 54px; display: grid; justify-items: center; align-content: center; gap: 3px; font: 600 .72rem var(--font); cursor: pointer; }
.bar button[aria-current=page] { color: var(--accent); background: var(--surface); }
.bar button[aria-current=page]::before { content: ""; position: absolute; top: 3px; width: 22px; height: 3px; border-radius: 3px; background: var(--accent); }

@media (min-width: 900px) {
  .app { grid-template-columns: var(--rail-w) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .bar { grid-row: 1 / 3; grid-column: 1; grid-template-columns: 1fr; align-content: start; gap: 6px; padding: 22px 14px; border-top: none; border-right: 1px solid var(--line); order: -1; }
  .top { grid-column: 2; max-width: none; padding-left: 28px; padding-right: 28px; }
  main { grid-column: 2; max-width: none; padding: 4px 28px 28px; }
  .bar .brand { display: block; font-weight: 700; font-size: 1.15rem; letter-spacing: .3em; padding: 4px 14px 22px; color: var(--accent); }
  .bar button { grid-template-columns: 24px 1fr; justify-items: start; gap: 14px; min-height: 48px; padding: 0 16px; font-size: .95rem; text-align: left; }
  .bar button[aria-current=page]::before { top: 14px; left: 0; width: 3px; height: 20px; }
  body[data-view=login] .bar { display: none; }
}
@media (min-width: 900px) { .app:has(.bar[hidden]) { grid-template-columns: minmax(0, 1fr); } .app:has(.bar[hidden]) .top, .app:has(.bar[hidden]) main { grid-column: 1; } }

/* ---------- type, cards, controls */
h2 { font-size: 1.2rem; margin: 6px 0 10px; font-weight: 700; }
h3 { font-size: .72rem; color: var(--muted); margin: 0 0 10px; text-transform: uppercase; letter-spacing: .14em; font-weight: 700; }
h3.section { margin: 26px 0 12px; }
.hint { color: var(--muted); margin: 4px 0 12px; font-size: .9rem; }
.eyebrow { margin: 0; color: var(--accent); font-size: .78rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.big { font-size: 1.15rem; font-weight: 600; margin: 2px 0 12px; overflow-wrap: anywhere; }
.card { background: linear-gradient(160deg, var(--surface-2), var(--surface)); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; min-width: 0; box-shadow: var(--shadow); }
.grid { display: grid; gap: 14px; grid-template-columns: 1fr; margin-top: 14px; }
@media (min-width: 760px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
label { display: block; font-weight: 600; margin: 14px 0 6px; font-size: .9rem; }
input, textarea, select { width: 100%; font: inherit; color: var(--ink); background: color-mix(in srgb, var(--bg) 70%, transparent); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 12px 14px; min-height: 48px; transition: border-color .15s, box-shadow .15s; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 21px, calc(100% - 14px) 21px; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 36px; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgb(255 154 77 / .2); outline: none; }
textarea { resize: none; }
input[type=checkbox] { width: 20px; height: 20px; min-height: 0; accent-color: var(--accent); padding: 0; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 500; margin: 8px 0 0; font-size: .85rem; color: var(--muted); }
button { font: 600 .92rem var(--font); min-height: 46px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: transform .12s, background .15s, border-color .15s, opacity .15s; }
button:hover:not(:disabled) { border-color: var(--accent); }
button:active:not(:disabled) { transform: scale(.97); }
button:disabled { opacity: .45; cursor: not-allowed; }
button[aria-pressed=true] { background: rgb(255 154 77 / .18); border-color: var(--accent); color: var(--accent-2); }
.primary { background: linear-gradient(135deg, var(--accent-2), var(--accent)); color: var(--accent-ink); border-color: transparent; box-shadow: 0 10px 26px -12px var(--accent); }
.primary:hover:not(:disabled) { border-color: transparent; filter: brightness(1.06); }
.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 60%, transparent); background: rgb(255 138 122 / .08); }
.link { background: none; border: none; color: var(--cyan); text-decoration: underline; margin-top: 10px; min-height: 40px; padding: 0; }
.wide { width: 100%; margin-top: 10px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0; }
.row > button { flex: 1 1 140px; }

.list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 10px; }
.list > li { padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.task-title { font-weight: 600; overflow-wrap: anywhere; }
.task-meta { color: var(--muted); font-size: .85rem; margin-top: 3px; overflow-wrap: anywhere; }
.badge { display: inline-block; border-radius: 999px; padding: 1px 10px; font-size: .72rem; font-weight: 700; margin-right: 8px; border: 1px solid currentColor; text-transform: capitalize; }
.s-completed { color: var(--ok); } .s-failed, .s-cancelled { color: var(--danger); } .s-awaiting_approval { color: var(--accent); }
.s-executing, .s-planning, .s-verifying, .s-routing, .s-queued { color: var(--cyan); }
.item-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.item-actions button { min-height: 40px; flex: 1 1 110px; font-size: .85rem; }
.plain { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.plain li { display: flex; justify-content: space-between; gap: 10px; overflow-wrap: anywhere; font-size: .92rem; }
.plain strong { font-variant-numeric: tabular-nums; color: var(--accent-2); }
.reply { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius-sm); padding: 12px 14px; overflow-wrap: anywhere; white-space: pre-wrap; }
.scopes { display: grid; gap: 12px; } .scope { display: grid; gap: 2px; overflow-wrap: anywhere; } .scope span { color: var(--muted); font-size: .85rem; }
.about { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; } .about dt { color: var(--muted); } .about dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- login */
.login:not([hidden]) { min-height: 100%; display: grid; place-items: center; padding: 20px 0; }
.login-card { width: min(100%, 400px); padding: 30px 26px; background: linear-gradient(160deg, var(--surface-2), var(--surface)); border: 1px solid var(--line); border-radius: 28px; box-shadow: var(--shadow); text-align: center; }
.login-card h2 { margin: 12px 0 2px; font-size: 1.5rem; } .login-card form { text-align: left; }
.login-face { width: 84px; height: 84px; } .login-face .head, .login-face .ear { fill: var(--fur); } .login-face .ear { stroke: var(--cyan); stroke-width: 2; } .login-face .eye { fill: #0b1016; } .login-face .glint { fill: #fff; } .login-face .nose { fill: #e55a46; } .login-face .antenna { fill: var(--accent); }

/* ---------- avatar */
.avatar { width: 46px; height: 46px; flex: none; filter: drop-shadow(0 6px 14px rgb(255 154 77 / .25)); }
.avatar .head, .avatar .ear { fill: var(--fur); } .avatar .ear { stroke: var(--cyan); stroke-width: 2; }
.avatar .eye { fill: #0b1016; } .avatar .glint { fill: #fff; } .avatar .nose { fill: #e55a46; } .avatar .antenna { fill: var(--accent); } .avatar .shield { fill: var(--cyan); opacity: 0; }
.avatar.idle .eyes { transform-origin: 32px 34px; animation: blink 5s infinite; } .avatar.busy .eyes { animation: look 1.6s ease-in-out infinite; }
.avatar.locked .shield { opacity: .95; } .avatar.locked .eyes { opacity: .6; } .avatar.off { filter: grayscale(.9); opacity: .7; }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes look { 0%, 100% { transform: translateX(-2px); } 50% { transform: translateX(2px); } }

/* ---------- home */
.hero { display: grid; gap: 16px; align-items: center; padding: 22px; background: radial-gradient(500px 220px at 100% 0, rgb(255 154 77 / .22), transparent 70%), linear-gradient(160deg, var(--surface-2), var(--surface)); }
.hero-title { font-size: clamp(1.4rem, 4.5vw, 2rem); margin: 4px 0 2px; line-height: 1.2; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
@media (min-width: 760px) { .hero { grid-template-columns: 1fr auto; } }
.gauges { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 14px; }
@media (min-width: 760px) { .gauges { grid-template-columns: repeat(4, 1fr); } }
.gauge { background: linear-gradient(160deg, var(--surface-2), var(--surface)); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 10px 12px; display: grid; justify-items: center; gap: 6px; box-shadow: var(--shadow); }
.ring { position: relative; width: 92px; height: 92px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .track { fill: none; stroke: var(--line); stroke-width: 9; } .ring .arc { fill: none; stroke: var(--cyan); stroke-width: 9; stroke-linecap: round; transition: stroke-dashoffset .6s ease, stroke .3s; }
.ring .arc.warm { stroke: var(--accent); } .ring .arc.hot { stroke: var(--danger); }
.ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.gauge span { font-size: .8rem; color: var(--muted); text-align: center; } .gauge strong { font-size: .8rem; font-weight: 600; text-align: center; }
.meters { display: grid; gap: 12px; } .meter-head { display: flex; justify-content: space-between; gap: 10px; font-size: .85rem; margin-bottom: 5px; color: var(--muted); } .meter-head strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.bar-track { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; } .bar-fill { height: 100%; background: linear-gradient(90deg, var(--cyan), #86e6f7); border-radius: 999px; transition: width .5s; }
.bar-fill.warm { background: linear-gradient(90deg, var(--accent), var(--accent-2)); } .bar-fill.hot { background: var(--danger); }
.quick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 760px) { .quick { grid-template-columns: repeat(4, 1fr); } }
.quick button { flex-direction: column; min-height: 84px; border-radius: var(--radius); gap: 8px; font-size: .82rem; text-align: center; padding: 10px; }
.quick .ic { color: var(--accent); width: 26px; height: 26px; }

/* ---------- chat: the thread scrolls inside its own box; suggestions + message box stay fixed under it */
.chat .recent { flex: none; margin-bottom: 6px; } .chat .recent summary { cursor: pointer; color: var(--muted); font-weight: 600; font-size: .85rem; min-height: 34px; display: flex; align-items: center; }
.chat .recent[open] .list { max-height: 30dvh; overflow-y: auto; }
.thread { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; list-style: none; margin: 0; padding: 6px 2px 12px; display: flex; flex-direction: column; gap: 10px; scroll-behavior: smooth; scrollbar-width: thin; }
.thread:empty::before { content: "Say hi, or ask MINI to check this PC, open an app, or take a screenshot."; color: var(--muted); margin: auto; text-align: center; max-width: 28ch; }
.bubble { max-width: min(86%, 560px); padding: 11px 15px; border-radius: 20px; overflow-wrap: anywhere; white-space: pre-wrap; border: 1px solid var(--line); animation: rise .25s ease; }
.bubble.you { align-self: flex-end; background: linear-gradient(135deg, var(--accent-2), var(--accent)); color: var(--accent-ink); border-color: transparent; border-bottom-right-radius: 6px; }
.bubble.mini { align-self: flex-start; background: linear-gradient(160deg, var(--surface-2), var(--surface)); border-bottom-left-radius: 6px; }
.bubble .who { display: block; font-size: .68rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; opacity: .7; margin-bottom: 2px; }
.bubble .live { display: inline-flex; gap: 4px; vertical-align: middle; margin-right: 8px; } .bubble .live i { width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); animation: dot 1.2s infinite; } .bubble .live i:nth-child(2) { animation-delay: .2s; } .bubble .live i:nth-child(3) { animation-delay: .4s; }
.bubble.failed { border-color: var(--danger); } .bubble .shot { display: block; width: 100%; height: auto; border-radius: 12px; margin-top: 8px; border: 1px solid var(--line); }
@keyframes dot { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } } @keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.suggest { flex: none; display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 8px; scrollbar-width: none; }
.suggest::-webkit-scrollbar { display: none; }
.suggest button { flex: none; min-height: 36px; font-size: .8rem; padding: 0 14px; background: var(--surface); }
.composer { flex: none; padding: 10px 12px; background: color-mix(in srgb, var(--surface-solid) 85%, transparent); border: 1px solid var(--line-strong); border-radius: 26px; box-shadow: var(--shadow); }
.compose-row { display: flex; gap: 8px; align-items: flex-end; }
.compose-row textarea { flex: 1; min-height: 46px; max-height: 140px; border: none; background: transparent; padding: 11px 6px; box-shadow: none !important; }
.compose-row .send { flex: none; width: 46px; height: 46px; padding: 0; border-radius: 50%; }
.composer .check { margin: 2px 0 0 6px; }

/* ---------- remote desktop */
.desk { gap: 10px; }
.stage { position: relative; flex: 1 1 auto; min-height: 0; background: #05070b; border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; display: grid; place-items: center; box-shadow: var(--shadow); touch-action: none; user-select: none; -webkit-user-select: none; outline-offset: -3px; }
.stage img { width: 100%; height: 100%; object-fit: contain; display: block; touch-action: none; -webkit-touch-callout: none; }
.stage img[hidden], .stage [hidden] { display: none !important; }
.stage.control { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); cursor: crosshair; }
.desk-empty { text-align: center; padding: 24px; display: grid; justify-items: center; gap: 6px; color: var(--muted); max-width: 32ch; }
.desk-empty .ic { color: var(--accent); } .desk-empty h3 { margin: 6px 0 0; color: var(--ink); font-size: 1.1rem; letter-spacing: .02em; text-transform: none; }
.desk-empty p { margin: 0 0 12px; font-size: .9rem; }
.hud { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; flex-wrap: wrap; pointer-events: none; }
.pill { background: rgb(8 10 15 / .72); backdrop-filter: blur(8px); border: 1px solid var(--line-strong); color: #f1e9db; border-radius: 999px; padding: 3px 11px; font-size: .74rem; font-weight: 600; }
.pill.live::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #ff5a5a; margin-right: 6px; animation: ping 1.6s infinite; box-shadow: 0 0 0 0 rgb(255 90 90 / .6); }
.pill.paused::before { background: var(--accent); animation: none; } .pill.ctl { color: var(--accent-2); border-color: var(--accent); }
.desk-note { position: absolute; left: 12px; right: 12px; bottom: 12px; text-align: center; background: rgb(8 10 15 / .8); color: #f1e9db; border-radius: 14px; padding: 10px 14px; font-size: .85rem; }
.desk-bar { flex: none; display: flex; gap: 8px; overflow-x: auto; padding: 2px 0; scrollbar-width: none; }
.desk-bar::-webkit-scrollbar { display: none; }
.desk-bar button, .desk-bar select { flex: 1 0 auto; min-width: 74px; min-height: 44px; font-size: .82rem; padding: 0 12px; }
.desk-bar select { flex: 0 0 auto; width: auto; border-radius: 999px; padding-right: 30px; background-position: calc(100% - 16px) 19px, calc(100% - 10px) 19px; }
.desk-bar .ic { width: 18px; height: 18px; }
.keys { flex: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: grid; gap: 8px; }
.type-row { display: flex; gap: 8px; } .type-row input { flex: 1; } .type-row button { flex: none; }
.keyrow { display: flex; flex-wrap: wrap; gap: 6px; } .keyrow button { min-height: 40px; min-width: 44px; padding: 0 12px; font-size: .8rem; flex: 1 0 auto; }
.stage:fullscreen, .stage.fs { position: fixed; inset: 0; z-index: 40; border-radius: 0; border: none; }
.stage.fs { height: 100dvh; width: 100vw; }
@media (min-width: 900px) and (min-height: 760px) { .keys { padding: 14px; } }

/* ---------- files */
.drop { display: grid; justify-items: center; gap: 4px; text-align: center; padding: 26px 16px; border: 2px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface); cursor: pointer; margin: 0; color: var(--muted); transition: border-color .15s, background .15s; }
.drop:hover, .drop:focus-within, .drop.over { border-color: var(--accent); background: rgb(255 154 77 / .08); }
.drop input { position: absolute; opacity: 0; width: 1px; height: 1px; } .drop .ic { color: var(--accent); } .drop strong { color: var(--ink); }

/* ---------- dialog + toast */
dialog { background: var(--surface-solid); color: var(--ink); border: 1px solid var(--line-strong); border-radius: 24px; padding: 20px; width: min(92vw, 420px); box-shadow: 0 30px 80px -20px #000; }
dialog::backdrop { background: rgb(0 0 0 / .62); backdrop-filter: blur(4px); }
#toast { position: fixed; left: 16px; right: 16px; bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); background: var(--ink); color: var(--bg); border-radius: 16px; padding: 12px 16px; font-weight: 600; transform: translateY(16px); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: 520px; margin: 0 auto; z-index: 60; text-align: center; }
#toast.show { opacity: 1; transform: none; }
@media (min-width: 900px) { #toast { bottom: 24px; left: calc(var(--rail-w) + 16px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

.keys { max-height: 42dvh; overflow-y: auto; }

/* remote desktop view options */
.view-bar { align-items: center; }
.seg { flex: 0 0 auto; display: inline-flex; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button { min-height: 38px; min-width: 52px; padding: 0 14px; border: none; background: transparent; font-size: .82rem; flex: none; }
.seg button[aria-pressed=true] { background: linear-gradient(135deg, var(--accent-2), var(--accent)); color: var(--accent-ink); }
.seg button:disabled { opacity: .35; }
.view-bar select { flex: 0 0 auto; width: auto; min-height: 44px; border-radius: 999px; font-size: .82rem; padding: 0 30px 0 14px; background-position: calc(100% - 16px) 19px, calc(100% - 10px) 19px; }
.stage img { transform-origin: 0 0; will-change: transform; }
.stage.zoomed { cursor: grab; }

.cursor-dot { position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; border: 2px solid #fff; background: rgb(255 154 77 / .55); box-shadow: 0 0 0 2px rgb(0 0 0 / .5); pointer-events: none; z-index: 3; }

.keys[hidden], .dot[hidden], .cursor-dot[hidden] { display: none; }

.stage.control { cursor: default; }
.cursor-dot { display: none !important; }

/* voice */
.chat-tools { flex: none; display: flex; gap: 8px; overflow-x: auto; padding: 0 0 8px; scrollbar-width: none; }
.chat-tools::-webkit-scrollbar { display: none; }
.chat-tools button, .chat-tools select { flex: none; min-height: 38px; font-size: .8rem; padding: 0 14px; width: auto; }
.chat-tools select { padding-right: 30px; background-position: calc(100% - 16px) 17px, calc(100% - 10px) 17px; border-radius: 999px; }
.chat-tools .ic { width: 17px; height: 17px; }
.mic { flex: none; width: 46px; height: 46px; padding: 0; border-radius: 50%; }
.mic[hidden], .chat-tools [hidden] { display: none; }
.mic[aria-pressed=true] { background: #ff5a5a; border-color: #ff5a5a; color: #fff; animation: pulse 1.2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgb(255 90 90 / .5); } 100% { box-shadow: 0 0 0 14px rgb(255 90 90 / 0); } }
