:root {
  --bg: #05070C;
  --panel: #0A0E17;
  --panel2: #0D1320;
  --well: #060910;
  --line: #1A2335;
  --line2: #26324C;
  --text: #D6E1F5;
  --white: #F4F8FF;
  --dim: #7184A6;
  --mute: #47546F;
  --cyan: #5CF2FF;
  --mint: #2EE6A6;
  --amber: #FFB547;
  --coral: #FF6B4A;
  --red: #FF4D5E;
  --violet: #A594FF;
  --blue: #7D93FF;
  --mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
  --sans: "Nunito Sans", "PingFang HK", "Microsoft JhengHei", "Noto Sans CJK TC", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  overflow: hidden;
  color: var(--text);
  font: 12px/1.45 var(--mono);
  background:
    linear-gradient(rgba(92, 242, 255, .025) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, rgba(92, 242, 255, .025) 1px, transparent 1px) 0 0 / 24px 24px,
    radial-gradient(1200px 600px at 70% -10%, rgba(61, 90, 254, .12), transparent 60%),
    var(--bg);
}
button, select, input { font: inherit; }
a { color: inherit; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #1C2539; border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }
.dim { color: var(--dim); }

/* top bar */
.bar {
  display: flex; align-items: center; gap: 14px;
  height: 48px; padding: 0 12px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(#0B1019, #070A11);
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; flex: none; }
.brand img { width: 22px; height: 22px; }
.brand b { font-size: 12px; letter-spacing: .22em; color: var(--white); }
.brand span { font-size: 10px; letter-spacing: .2em; color: var(--cyan); border: 1px solid rgba(92, 242, 255, .4); border-radius: 3px; padding: 1px 5px; }
.pills { display: flex; gap: 6px; min-width: 0; overflow: hidden; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  border: 1px solid var(--line2); border-radius: 4px; padding: 3px 8px;
  font-size: 10px; letter-spacing: .08em; color: var(--dim);
}
.pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--mute); }
.pill b { color: var(--text); font-weight: 500; letter-spacing: 0; max-width: 170px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pill.on i { background: var(--mint); box-shadow: 0 0 8px var(--mint); }
.pill.busy i { background: var(--amber); box-shadow: 0 0 8px var(--amber); animation: blink 1s infinite; }
.pill.rec i { background: var(--red); box-shadow: 0 0 8px var(--red); animation: blink 1.2s infinite; }
.pill.err i { background: var(--red); }
.bar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; flex: none; }
.clock { color: var(--dim); font-size: 10.5px; min-width: 64px; text-align: right; }
.icon { width: 26px; height: 26px; border-radius: 4px; border: 1px solid var(--line2); background: transparent; color: var(--dim); cursor: pointer; }
.icon:hover { color: var(--cyan); border-color: var(--cyan); }

.seg { display: inline-flex; border: 1px solid var(--line2); border-radius: 4px; overflow: hidden; }
.seg button { background: transparent; color: var(--dim); border: 0; padding: 6px 10px; font-size: 10px; letter-spacing: .1em; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line2); }
.seg button:hover { color: var(--text); }
.seg button.on { background: rgba(92, 242, 255, .12); color: var(--cyan); box-shadow: inset 0 -2px 0 var(--cyan); }
.seg.mode button[data-mode="call"].on { background: rgba(255, 107, 74, .14); color: var(--coral); box-shadow: inset 0 -2px 0 var(--coral); }

.sel { display: inline-flex; align-items: center; border: 1px solid var(--line2); border-radius: 4px; min-width: 0; }
.sel span { padding: 0 6px; font-size: 9.5px; letter-spacing: .12em; color: var(--dim); border-right: 1px solid var(--line2); align-self: stretch; display: flex; align-items: center; }
.sel select { background: transparent; color: var(--text); border: 0; padding: 5px 6px; font-size: 11px; outline: none; max-width: 190px; cursor: pointer; }
.sel select option { background: var(--panel); }
.sel.mini span { font-size: 9px; }
.sel.mini select { font-size: 10.5px; padding: 4px; }
.sel.grow { flex: 1; }
.sel.grow select { width: 100%; max-width: none; }

/* layout */
.grid {
  display: grid;
  grid-template-columns: minmax(300px, 340px) minmax(0, 1fr) minmax(330px, 410px);
  gap: 8px; padding: 8px;
  height: calc(100vh - 48px);
}
.col { display: flex; flex-direction: column; gap: 8px; min-height: 0; min-width: 0; }
.panel { position: relative; display: flex; flex-direction: column; min-height: 0; min-width: 0; overflow: hidden; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; }
.panel > header {
  display: flex; align-items: center; gap: 8px; flex: none;
  height: 32px; padding: 0 10px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel2), var(--panel));
}
.panel > header em { font-style: normal; color: var(--mute); font-size: 10px; }
.panel > header h2 { margin: 0; font-size: 10.5px; letter-spacing: .18em; color: #AFC0E0; font-weight: 700; }
.panel > header .meta { color: var(--dim); font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.panel > header .tools { margin-left: auto; display: flex; gap: 6px; flex: none; }
.led { width: 7px; height: 7px; border-radius: 50%; background: var(--mute); flex: none; }
.led.on { background: var(--mint); box-shadow: 0 0 8px var(--mint); }
.led.busy { background: var(--amber); box-shadow: 0 0 8px var(--amber); animation: blink 1s infinite; }
.led.rec { background: var(--red); box-shadow: 0 0 8px var(--red); animation: blink 1.2s infinite; }

.btn {
  font-size: 10.5px; font-weight: 500; letter-spacing: .08em; white-space: nowrap;
  color: var(--text); background: #111827;
  border: 1px solid var(--line2); border-radius: 4px; padding: 5px 9px; cursor: pointer;
}
.btn:hover { border-color: var(--cyan); color: var(--cyan); }
.btn.hot { background: rgba(92, 242, 255, .14); border-color: rgba(92, 242, 255, .55); color: var(--cyan); }
.btn.ghost { background: transparent; }
.btn.on { background: rgba(46, 230, 166, .14); border-color: var(--mint); color: var(--mint); }
.btn:disabled { opacity: .4; cursor: not-allowed; }

/* vision */
.left .vision { flex: none; }
.screen { position: relative; margin: 8px; aspect-ratio: 4 / 3; overflow: hidden; background: #020306; border: 1px solid var(--line2); border-radius: 4px; }
.screen-video { position: absolute; inset: 0; }
.screen video { display: block; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.hud { position: absolute; inset: 0; pointer-events: none; color: var(--cyan); font-size: 10px; text-shadow: 0 0 6px rgba(0, 0, 0, .9); }
.hud::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .16) 0 1px, transparent 1px 3px); }
.corner { position: absolute; width: 16px; height: 16px; border: 2px solid var(--cyan); opacity: .85; }
.corner.tl { top: 8px; left: 8px; border-right: 0; border-bottom: 0; }
.corner.tr { top: 8px; right: 8px; border-left: 0; border-bottom: 0; }
.corner.bl { bottom: 8px; left: 8px; border-right: 0; border-top: 0; }
.corner.br { bottom: 8px; right: 8px; border-left: 0; border-top: 0; }
.hud-live { position: absolute; top: 10px; left: 30px; color: var(--red); animation: blink 1.4s infinite; font-weight: 700; }
.hud-clock { position: absolute; top: 10px; right: 30px; }
.hud-res { position: absolute; bottom: 10px; left: 30px; }
.hud-motion { position: absolute; right: 30px; bottom: 9px; display: grid; grid-template-columns: auto 54px; gap: 2px 6px; align-items: center; font-size: 8.5px; letter-spacing: .1em; }
.hud-motion i { display: block; height: 4px; background: rgba(92, 242, 255, .16); }
.hud-motion b { display: block; height: 100%; width: 0; background: var(--cyan); transition: width .2s; }
.hud-caption {
  position: absolute; left: 8%; right: 8%; bottom: 30px;
  text-align: center; font: 600 13px/1.35 var(--sans); color: #fff;
  background: rgba(5, 7, 12, .78); border-radius: 4px; padding: 4px 8px;
  opacity: 0; transition: opacity .3s;
}
.hud-caption.show { opacity: 1; }
.hud-flash { position: absolute; inset: 0; background: #fff; opacity: 0; }
.hud-flash.go { animation: shot .45s ease-out; }
.hud-flash::after {
  content: attr(data-label); position: absolute; left: 50%; top: 42%; transform: translateX(-50%);
  color: #05070C; background: var(--cyan); padding: 3px 8px; border-radius: 3px; font: 700 10px var(--mono); letter-spacing: .12em; white-space: nowrap; text-shadow: none;
}
.screen-off {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  padding: 18px; text-align: center; color: var(--dim);
  background: repeating-linear-gradient(0deg, rgba(92, 242, 255, .03) 0 2px, transparent 2px 4px), #04060A;
}
.screen-off b { color: var(--text); letter-spacing: .24em; font-size: 11px; }
.screen-off span { font: 12.5px/1.45 var(--sans); max-width: 240px; }
.screen.on .screen-off { display: none; }
.screen:not(.on) .hud { display: none; }
.row { display: flex; gap: 6px; padding: 0 8px 8px; flex-wrap: wrap; align-items: center; }
.lastframe { display: flex; gap: 8px; align-items: center; min-height: 52px; margin: 0 8px 8px; padding: 6px; border: 1px dashed var(--line2); border-radius: 4px; font-size: 10.5px; color: var(--dim); }
.lastframe img { width: 72px; border-radius: 3px; border: 1px solid var(--line2); flex: none; }
.lastframe b { color: var(--text); font-weight: 500; }

/* body */
.left .body { flex: 1 1 0; }
.body-scroll { flex: 1; min-height: 0; overflow: auto; padding: 8px 10px 10px; }
.bodywrap { display: grid; grid-template-columns: 110px 1fr; gap: 10px; align-items: center; }
.vbot { width: 110px; height: 138px; }
.vbot svg { width: 100%; height: 100%; overflow: visible; }
.bstate { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; font-size: 10.5px; }
.bstate dt { color: var(--dim); letter-spacing: .08em; }
.bstate dd { margin: 0; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctl { margin-top: 8px; }
.ctl h3 { margin: 0 0 4px; font-size: 9.5px; font-weight: 500; letter-spacing: .16em; color: var(--dim); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chips button { font-size: 10.5px; color: var(--text); background: #0F1522; border: 1px solid var(--line2); border-radius: 3px; padding: 3px 7px; cursor: pointer; }
.chips button:hover { border-color: var(--cyan); color: var(--cyan); }
.chips button.on { border-color: var(--cyan); color: var(--cyan); background: rgba(92, 242, 255, .1); }
.chips button.stop { border-color: rgba(255, 107, 74, .6); color: var(--coral); }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.swatches button { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line2); cursor: pointer; padding: 0; }
.swatches button.on { box-shadow: 0 0 0 2px var(--cyan); }
.blelog { height: 112px; margin: 10px 0 0; padding: 6px 8px; overflow: auto; background: var(--well); border: 1px solid var(--line); border-radius: 4px; font-size: 10.5px; color: var(--dim); white-space: pre-wrap; }
.blelog .o { color: var(--cyan); }
.blelog .i { color: var(--mint); }
.blelog .v { color: var(--violet); }

/* conversation */
.convo { min-width: 0; }
.feed { flex: 1; min-height: 0; overflow: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 12px; }
.msg { display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 2px 10px; animation: rise .25s ease-out; }
.msg .ts { color: var(--mute); font-size: 10px; padding-top: 1px; }
.msg .head { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; font-size: 10px; color: var(--dim); }
.msg .who { font-weight: 700; letter-spacing: .16em; }
.msg.user .who { color: var(--amber); }
.msg.bot .who { color: var(--cyan); }
.msg.watch .who { color: var(--violet); }
.msg .text { grid-column: 2; font: 15px/1.55 var(--sans); color: #E8EEFB; word-break: break-word; }
.msg .text .s { border-radius: 3px; padding: 0 1px; transition: background .2s, color .2s; }
.msg .text .s.now { background: rgba(92, 242, 255, .16); color: #fff; box-shadow: 0 0 0 1px rgba(92, 242, 255, .35); }
.msg .text .s.cut { opacity: .45; text-decoration: line-through; }
.msg .text .s.skip { opacity: .6; }
.msg .extra { grid-column: 2; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.msg .thumb { grid-column: 2; width: 120px; margin-top: 4px; border-radius: 4px; border: 1px solid var(--line2); }
.lt { display: inline-block; font: 700 9px/1.6 var(--mono); letter-spacing: .04em; color: #05070C; background: hsl(var(--h, 186) 90% 66%); border-radius: 3px; padding: 0 4px; margin: 0 4px 0 1px; vertical-align: 2px; }
.a { font-size: 10px; border: 1px solid rgba(165, 148, 255, .5); color: var(--violet); border-radius: 3px; padding: 0 5px; }
.a.no { border-color: rgba(255, 107, 74, .6); color: var(--coral); }
.a.tool { border-color: rgba(46, 230, 166, .5); color: var(--mint); }
.a.warn { border-color: rgba(255, 181, 71, .6); color: var(--amber); }
.note { padding-left: 72px; font-size: 10.5px; color: var(--dim); }
.note b { color: var(--text); font-weight: 500; }
.products { grid-column: 2; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 6px; margin-top: 4px; }
.prod { display: flex; gap: 6px; padding: 5px; color: var(--text); text-decoration: none; background: #0F1522; border: 1px solid var(--line2); border-radius: 4px; font: 11px/1.3 var(--sans); }
.prod:hover { border-color: var(--cyan); }
.prod .im { width: 42px; height: 42px; flex: none; border-radius: 3px; background: #fff center / contain no-repeat; }
.prod b { display: block; color: var(--amber); font-family: var(--mono); }
.prod span { color: var(--dim); display: block; font-size: 10px; }
.prod-src { grid-column: 1 / -1; font-size: 10px; color: var(--dim); }

.dock { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px 10px; border-top: 1px solid var(--line); background: #090D15; }
.live { display: flex; align-items: center; gap: 8px; min-height: 24px; font: 14px/1.4 var(--sans); color: var(--dim); }
.live-lang { flex: none; font: 700 9.5px var(--mono); color: #05070C; background: var(--amber); border-radius: 3px; padding: 2px 5px; }
.live-text { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.live.on .live-text { color: #fff; }
.live.echo .live-text { color: var(--mute); text-decoration: line-through; }
.phase { position: relative; display: flex; gap: 4px; }
.phase span { flex: 1; text-align: center; font-size: 9.5px; letter-spacing: .16em; padding: 4px 0; color: var(--mute); border: 1px solid var(--line); border-radius: 3px; transition: all .15s; }
.phase span.on[data-p="idle"] { color: var(--text); border-color: var(--line2); }
.phase span.on[data-p="listening"] { color: #05070C; background: var(--mint); border-color: var(--mint); box-shadow: 0 0 12px rgba(46, 230, 166, .35); }
.phase span.on[data-p="thinking"] { color: #05070C; background: var(--amber); border-color: var(--amber); box-shadow: 0 0 12px rgba(255, 181, 71, .35); }
.phase span.on[data-p="speaking"] { color: #05070C; background: var(--cyan); border-color: var(--cyan); box-shadow: 0 0 12px rgba(92, 242, 255, .35); }
.phase-flash { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; border-radius: 3px; background: var(--coral); color: #fff; font-size: 10px; letter-spacing: .2em; opacity: 0; pointer-events: none; }
.phase-flash.go { animation: flashOut 1.1s ease-out; }
.meter { display: flex; align-items: center; gap: 8px; }
.vad { font-size: 9px; letter-spacing: .14em; padding: 2px 5px; color: var(--mute); border: 1px solid var(--line2); border-radius: 3px; }
.vad.on { color: #05070C; background: var(--mint); border-color: var(--mint); }
.vu { flex: 1; display: grid; grid-template-columns: repeat(48, 1fr); gap: 2px; height: 10px; }
.vu i { background: #121A2A; border-radius: 1px; }
.vu i.on { background: var(--mint); }
.vu i.on.w { background: var(--amber); }
.vu i.on.r { background: var(--red); }
.vu i.floor { box-shadow: inset 0 0 0 1px var(--violet); }
.db { width: 58px; text-align: right; font-size: 10px; color: var(--dim); }
.quick { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: 9.5px; color: var(--dim); letter-spacing: .1em; }
.quick button { font-size: 10px; letter-spacing: 0; color: var(--dim); background: transparent; border: 1px solid var(--line2); border-radius: 3px; padding: 2px 6px; cursor: pointer; }
.quick button:hover { color: var(--text); }
.quick button.on { color: var(--amber); border-color: var(--amber); }
.composer { display: flex; gap: 6px; }
.talk {
  display: flex; align-items: center; justify-content: center; gap: 6px; min-width: 132px; padding: 0 14px;
  font-size: 11px; font-weight: 700; letter-spacing: .1em; color: #05070C;
  background: var(--mint); border: 0; border-radius: 4px; cursor: pointer;
}
.talk svg { width: 16px; height: 16px; }
.talk.on { background: var(--amber); animation: glow 1.1s ease-in-out infinite; }
.talk.call { background: var(--coral); color: #fff; }
.talk.call.on { background: var(--red); animation: glowRed 1.4s ease-in-out infinite; }
.talk:disabled { opacity: .45; cursor: not-allowed; }
#textIn { flex: 1; min-width: 0; padding: 9px 10px; color: #fff; font: 14px var(--sans); background: var(--well); border: 1px solid var(--line2); border-radius: 4px; outline: none; }
#textIn:focus { border-color: var(--cyan); }
.speaking { display: flex; align-items: center; gap: 8px; min-height: 24px; font-size: 10.5px; color: var(--dim); }
.sp-tag { font-size: 9px; letter-spacing: .14em; border: 1px solid var(--line2); border-radius: 3px; padding: 2px 5px; }
.speaking.on .sp-tag { color: #05070C; background: var(--cyan); border-color: var(--cyan); }
.sp-now { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--text); }
.sp-q { flex: none; }

/* latency */
.right .latency { flex: none; }
.wf { padding: 8px 10px 2px; font-size: 10.5px; }
.wf .wh { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 6px; color: var(--dim); }
.wf .big { font-size: 22px; font-weight: 700; color: var(--white); line-height: 1; }
.wf .big small { font-size: 10px; font-weight: 400; color: var(--dim); margin-left: 6px; }
.wrow { display: grid; grid-template-columns: 96px 1fr 50px; gap: 6px; align-items: center; height: 16px; }
.wrow > span:first-child { color: var(--dim); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.track { position: relative; height: 8px; border-radius: 2px; background: rgba(255, 255, 255, .03); }
.track b { position: absolute; top: 0; bottom: 0; min-width: 2px; border-radius: 2px; background: var(--cyan); }
.wrow.hear b { background: var(--amber); }
.wrow.model b { background: var(--blue); }
.wrow.tool b { background: var(--mint); }
.wrow.say b { background: var(--cyan); }
.wrow.voice b { background: var(--coral); }
.wrow.speak b { background: rgba(92, 242, 255, .35); }
.wrow .ms { text-align: right; color: var(--text); }
.axis { display: grid; grid-template-columns: 96px 1fr 50px; gap: 6px; color: var(--mute); font-size: 9px; margin-top: 2px; }
.axis div { display: flex; justify-content: space-between; }
.wtags { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 2px; }
.spark-wrap { padding: 4px 10px 0; }
.spark { display: block; width: 100%; height: 50px; }
.spark-key { display: flex; justify-content: flex-end; gap: 12px; font-size: 9px; color: var(--dim); }
.spark-key span::before { content: ""; display: inline-block; width: 10px; height: 2px; margin-right: 4px; vertical-align: 3px; }
.spark-key .k1::before { background: var(--cyan); }
.spark-key .k2::before { background: var(--blue); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin-top: 6px; background: var(--line); border-top: 1px solid var(--line); }
.stats div { background: var(--panel); padding: 5px 8px; }
.stats b { display: block; color: var(--white); font-size: 13px; font-weight: 500; }
.stats span { color: var(--dim); font-size: 9px; letter-spacing: .1em; }

/* router */
.right .router { flex: none; max-height: 36%; }
.pins { display: flex; gap: 6px; padding: 8px 10px 4px; }
.rtable { overflow: auto; padding: 0 10px 8px; font-size: 10.5px; }
.rrow { display: grid; grid-template-columns: 8px minmax(0, 1fr) 18px 54px 54px 30px 44px; gap: 6px; align-items: center; padding: 4px 0; border-bottom: 1px solid #121A2A; }
.rrow.h { color: var(--mute); font-size: 9px; letter-spacing: .08em; }
.rrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--mute); }
.rrow .dot.ok { background: var(--mint); }
.rrow .dot.slow { background: var(--amber); }
.rrow .dot.bad { background: var(--red); }
.rrow .nm { min-width: 0; }
.rrow .nm b { display: block; color: var(--text); font-weight: 500; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.rrow .nm small { display: block; color: var(--mute); font-size: 9px; }
.rrow.pinned .nm b { color: var(--amber); }
.rrow .eye { color: var(--cyan); text-align: center; }
.rrow .n { text-align: right; }
.rrow button { font-size: 9.5px; padding: 2px 5px; }

/* events */
.right .events { flex: 1 1 0; }
.tabs { margin-left: auto; display: flex; gap: 2px; }
.tabs button { background: transparent; color: var(--dim); border: 0; border-bottom: 2px solid transparent; padding: 4px 6px; font-size: 9.5px; letter-spacing: .1em; cursor: pointer; }
.tabs button.on { color: var(--cyan); border-bottom-color: var(--cyan); }
.tab { display: none; flex: 1; min-height: 0; flex-direction: column; }
.tab.on { display: flex; }
.logbar { display: flex; gap: 4px; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.logbar select { flex: 1; min-width: 0; background: var(--well); color: var(--text); border: 1px solid var(--line2); border-radius: 3px; font-size: 10.5px; }
.log { flex: 1; min-height: 0; overflow: auto; padding: 4px 8px; font-size: 10.5px; line-height: 1.55; }
.log div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.log div:hover { white-space: normal; word-break: break-all; background: var(--panel2); }
.log .t { color: var(--mute); }
.log .k { display: inline-block; width: 74px; font-weight: 700; color: var(--dim); }
.log .j { color: #9FB0CF; }
.log .turn { color: var(--mute); border-top: 1px dashed var(--line2); margin-top: 3px; padding-top: 2px; }
.k-say, .k-lang { color: var(--cyan) !important; }
.k-model, .k-usage, .k-timing { color: var(--blue) !important; }
.k-tool, .k-products, .k-memory { color: var(--mint) !important; }
.k-act, .k-ble { color: var(--violet) !important; }
.k-blocked, .k-redacted, .k-interrupt { color: var(--coral) !important; }
.k-error { color: var(--red) !important; }
.k-hear, .k-frame, .k-watch { color: var(--amber) !important; }
.vset { display: grid; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--line); font-size: 10.5px; color: var(--dim); }
.vset label { display: flex; align-items: center; gap: 8px; }
.vset input[type="range"] { flex: 1; accent-color: var(--cyan); }
.vset input[type="checkbox"] { accent-color: var(--cyan); }
.vset b { width: 34px; color: var(--text); font-weight: 500; text-align: right; }
.vtable { flex: 1; min-height: 0; overflow: auto; padding: 4px 10px 10px; font-size: 10.5px; }
.vrow { display: grid; grid-template-columns: 54px minmax(0, 1fr) 40px; gap: 6px; align-items: center; padding: 3px 0; border-bottom: 1px solid #121A2A; }
.vrow .code { color: var(--cyan); }
.vrow.near .code { color: var(--amber); }
.vrow.none .code { color: var(--coral); }
.vrow select { width: 100%; min-width: 0; background: var(--well); color: var(--text); border: 1px solid var(--line2); border-radius: 3px; font-size: 10.5px; }
.vrow button { font-size: 9.5px; padding: 2px 5px; }
.memlist { margin: 0; padding: 4px 10px 8px 28px; font: 13px/1.6 var(--sans); color: var(--text); }
.pad { padding: 8px 10px; margin: 0; }
p.pad { font: 12px/1.5 var(--sans); }
.json { flex: 1; margin: 0; padding: 10px; overflow: auto; font-size: 10.5px; color: #9FB0CF; }

/* help */
.help { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(2, 3, 6, .72); backdrop-filter: blur(4px); }
.help[hidden] { display: none; }
.help-card { width: min(540px, 92vw); max-height: 90vh; overflow: auto; padding: 18px 20px; background: var(--panel); border: 1px solid var(--line2); border-radius: 8px; font-size: 11.5px; }
.help-card h2 { margin: 0 0 12px; font-size: 11px; letter-spacing: .2em; color: var(--cyan); }
.help-card dl { display: grid; grid-template-columns: 80px 1fr; gap: 6px 10px; margin: 0 0 12px; }
.help-card dd { margin: 0; color: var(--text); }
.help-card p { color: var(--dim); font: 12.5px/1.6 var(--sans); }
kbd { font: 10.5px var(--mono); color: var(--text); background: #0F1522; border: 1px solid var(--line2); border-bottom-width: 2px; border-radius: 3px; padding: 1px 5px; }

/* virtual robot */
.r-eye { transform-box: fill-box; transform-origin: center; animation: eyeBlink 4.5s infinite; }
.r-ant { animation: glowAnt 2.2s ease-in-out infinite; }
.vb-head { transform-origin: 100px 128px; transition: transform .28s ease; }
.vb-arm { transform-origin: 147px 146px; transition: transform .2s ease; }
.vb-led { transition: fill .3s; }
.vb-mouth-talk { transform-box: fill-box; transform-origin: center; animation: talk .18s ease-in-out infinite alternate; }
.vb-bars rect { transform-box: fill-box; transform-origin: bottom; animation: bars .5s ease-in-out infinite alternate; }
.vb-bars rect:nth-child(2) { animation-delay: .1s; }
.vb-bars rect:nth-child(3) { animation-delay: .2s; }
.vb-bars rect:nth-child(4) { animation-delay: .3s; }
.vb-dots circle { animation: blink 1s infinite; }
.vb-dots circle:nth-child(2) { animation-delay: .2s; }
.vb-dots circle:nth-child(3) { animation-delay: .4s; }

@keyframes blink { 50% { opacity: .3; } }
@keyframes eyeBlink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes glowAnt { 50% { opacity: .55; } }
@keyframes talk { from { transform: scaleY(.25); } to { transform: scaleY(1); } }
@keyframes bars { from { transform: scaleY(.3); } to { transform: scaleY(1); } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
@keyframes shot { 0% { opacity: .85; } 100% { opacity: 0; } }
@keyframes flashOut { 0%, 55% { opacity: 1; } 100% { opacity: 0; } }
@keyframes glow { 50% { box-shadow: 0 0 0 4px rgba(255, 181, 71, .25); } }
@keyframes glowRed { 50% { box-shadow: 0 0 0 5px rgba(255, 77, 94, .3); } }

@media (max-width: 1180px) {
  body { overflow: auto; height: auto; }
  .bar { flex-wrap: wrap; height: auto; padding: 8px 12px; row-gap: 8px; }
  .pills { order: 3; width: 100%; overflow-x: auto; }
  .grid { grid-template-columns: 1fr 1fr; height: auto; }
  .convo { grid-column: 1 / -1; order: -1; height: 80vh; }
  .left .body, .right .events { flex: none; height: 460px; }
  .right .router { max-height: none; }
}
@media (max-width: 760px) {
  .grid { grid-template-columns: 1fr; }
  .bar-right { flex-wrap: wrap; margin-left: 0; }
  .sel select { max-width: 130px; }
  .clock { display: none; }
}

/* simple view */
body.pro .ebar, body.pro .easy, body.pro .esheet { display: none !important; }
body.simple .bar, body.simple .grid { display: none !important; }
body.simple {
  --e-bg: #F7F6F2; --e-paper: #FFFFFF; --e-ink: #14172B; --e-ink2: #2B2F4A; --e-soft: #5A5F7A; --e-muted: #8E93AA; --e-line: #E4E2DA;
  --e-blue: #3D5AFE; --e-blue-pale: #ECEFFF; --e-coral: #FF6B4A; --e-coral-pale: #FFEDE8; --e-mint: #18A999; --e-yellow: #FFC93C; --e-yellow-pale: #FFF6DB;
  --e-font: "Avenir Next", "Nunito Sans", "Segoe UI", "PingFang HK", "Microsoft JhengHei", system-ui, sans-serif;
  --e-shadow: 0 18px 50px -24px rgba(20, 23, 43, .35);
  height: 100%; overflow: hidden;
  color: var(--e-ink); font: 15px/1.5 var(--e-font); background: var(--e-bg);
}
body.simple button, body.simple select, body.simple input { font-family: var(--e-font); }

.ebar { display: flex; align-items: center; gap: 14px; height: 64px; padding: 0 22px; }
.ebrand { display: flex; align-items: center; gap: 9px; color: var(--e-ink); text-decoration: none; }
.ebrand img { width: 30px; height: 30px; }
.ebrand b { font-size: 19px; font-weight: 800; letter-spacing: -.01em; }
.estate { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px; border: 1px solid var(--e-line); border-radius: 99px; background: var(--e-paper); color: var(--e-soft); font-size: 13px; font-weight: 600; }
.estate i { width: 8px; height: 8px; border-radius: 50%; background: var(--e-mint); }
.estate.listening i { background: var(--e-coral); animation: blink 1.1s infinite; }
.estate.thinking i { background: var(--e-yellow); animation: blink .8s infinite; }
.estate.speaking i { background: var(--e-blue); animation: blink .6s infinite; }
.eright { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.elink { padding: 8px 10px; border: 0; border-radius: 10px; background: none; color: var(--e-soft); font-size: 14px; font-weight: 600; cursor: pointer; }
.elink:hover { background: rgba(20, 23, 43, .05); color: var(--e-ink); }
.eview, .emode { display: inline-flex; padding: 3px; border-radius: 99px; background: rgba(20, 23, 43, .06); }
.eview button, .emode button { padding: 7px 14px; border: 0; border-radius: 99px; background: none; color: var(--e-soft); font-size: 13.5px; font-weight: 700; cursor: pointer; }
.eview button.on, .emode button.on { background: var(--e-paper); color: var(--e-ink); box-shadow: 0 2px 8px -3px rgba(20, 23, 43, .3); }

.easy { display: grid; grid-template-columns: minmax(300px, 420px) minmax(0, 1fr); gap: 18px; height: calc(100% - 64px); padding: 0 18px 18px; }
.stage { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; min-height: 0; padding: 24px; overflow: hidden; border-radius: 30px; background: radial-gradient(120% 80% at 50% 0%, #FFFFFF 0%, var(--e-blue-pale) 55%, #E3E8FF 100%); }
.ebot-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.ebot { width: 210px; height: 266px; filter: drop-shadow(0 18px 24px rgba(42, 57, 144, .25)); }
.ebot svg { width: 100%; height: 100%; overflow: visible; }
.ebubble { position: relative; max-width: 330px; min-height: 48px; padding: 12px 18px; border-radius: 20px; background: var(--e-paper); box-shadow: var(--e-shadow); color: var(--e-ink); font-size: 17px; line-height: 1.45; text-align: center; }
.ebubble::before { content: ""; position: absolute; top: -7px; left: 50%; width: 16px; height: 16px; border-radius: 3px; background: var(--e-paper); transform: translateX(-50%) rotate(45deg); }
.ebubble.dim { color: var(--e-soft); }
.ecam { display: none; width: 100%; max-width: 360px; }
.ecam.on { display: block; }
.ecam-view { position: relative; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 20px; background: #0E1020; box-shadow: var(--e-shadow); }
.ecam-view video { display: block; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.ecam-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; color: var(--e-soft); font-size: 13px; }
.ecam-bar i { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: var(--e-coral); animation: blink 1.4s infinite; }
.ecam-bar button { padding: 7px 13px; border: 0; border-radius: 99px; background: var(--e-paper); color: var(--e-blue); font-size: 13px; font-weight: 700; cursor: pointer; box-shadow: 0 2px 10px -4px rgba(20, 23, 43, .35); }

.echat { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; border: 1px solid var(--e-line); border-radius: 30px; background: var(--e-paper); }
.efeed { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 10px; padding: 24px 24px 10px; }
.em { max-width: min(78%, 620px); padding: 11px 16px; border-radius: 22px; font-size: 16.5px; line-height: 1.5; word-break: break-word; animation: rise .25s ease-out; }
.em.user { align-self: flex-end; border-bottom-right-radius: 7px; background: var(--e-blue); color: #fff; }
.em.bot { align-self: flex-start; border-bottom-left-radius: 7px; background: #F3F2EE; color: var(--e-ink); }
.em.bot.watch { background: var(--e-yellow-pale); }
.em .s { border-radius: 6px; transition: background .2s; }
.em .s.now { background: #FFE58F; }
.em .s.cut { opacity: .45; }
.em img { display: block; width: 120px; height: 90px; margin-top: 8px; border-radius: 12px; object-fit: cover; }
.em .when { display: block; margin-top: 3px; color: var(--e-muted); font-size: 12px; }
.em.user .when { color: rgba(255, 255, 255, .75); }
.em .prods { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 8px; }
.em .prods a { display: flex; gap: 8px; padding: 6px; border-radius: 14px; background: var(--e-paper); color: var(--e-ink); font-size: 12.5px; line-height: 1.3; text-decoration: none; }
.em .prods .im { width: 44px; height: 44px; flex: none; border-radius: 10px; background: #fff center / contain no-repeat; }
.em .prods b { display: block; color: var(--e-coral); }
.em .prods small { grid-column: 1 / -1; color: var(--e-muted); font-size: 12px; }
.enote { align-self: center; max-width: 86%; padding: 5px 14px; border-radius: 99px; background: var(--e-bg); color: var(--e-soft); font-size: 13px; text-align: center; }
.enote.warn { background: var(--e-coral-pale); color: #B33A1E; }
.ewelcome { margin: auto; max-width: 440px; color: var(--e-soft); text-align: center; }
.ewelcome h1 { margin: 0 0 6px; color: var(--e-ink); font-size: 24px; }
.ewelcome p { margin: 0; }
.ewelcome .try { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 14px; }
.ewelcome .try button { padding: 8px 14px; border: 1px solid var(--e-line); border-radius: 99px; background: var(--e-paper); color: var(--e-ink2); font-size: 14px; cursor: pointer; }
.ewelcome .try button:hover { border-color: var(--e-blue); color: var(--e-blue); }

.edock { display: flex; flex-direction: column; gap: 12px; padding: 12px 20px 18px; border-top: 1px solid var(--e-line); }
.elive { min-height: 26px; color: var(--e-ink); font-size: 17px; text-align: center; }
.elive.hint { color: var(--e-muted); font-size: 14.5px; }
.erow { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.elangs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.elangs .lab { margin-right: 2px; color: var(--e-muted); font-size: 13px; }
.elangs button { padding: 6px 13px; border: 1px solid var(--e-line); border-radius: 99px; background: var(--e-paper); color: var(--e-ink2); font-size: 14px; font-weight: 600; cursor: pointer; }
.elangs button.on { border-color: var(--e-ink); background: var(--e-ink); color: #fff; }
.elangs select { max-width: 120px; padding: 6px 10px; border: 1px solid var(--e-line); border-radius: 99px; background: var(--e-paper); color: var(--e-soft); font-size: 14px; cursor: pointer; }
.ecore { display: flex; align-items: flex-start; justify-content: center; gap: 28px; }
.eround { display: flex; flex-direction: column; align-items: center; gap: 5px; width: 64px; padding: 12px 0 0; border: 0; background: none; color: var(--e-soft); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.eround svg { width: 50px; height: 50px; padding: 13px; border-radius: 50%; background: var(--e-bg); color: var(--e-ink2); transition: background .2s, color .2s; }
.eround:hover svg { background: #ECEAE3; }
.eround.on svg { background: var(--e-ink); color: #fff; }
.eround:disabled { opacity: .35; cursor: default; }
.eround:disabled:hover svg { background: var(--e-bg); }
.emic-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.emic { position: relative; display: grid; place-items: center; width: 82px; height: 82px; border: 0; border-radius: 50%; background: var(--e-blue); color: #fff; cursor: pointer; box-shadow: 0 14px 30px -12px rgba(61, 90, 254, .7); transition: transform .15s, background .2s; }
.emic:hover { transform: scale(1.04); }
.emic svg { width: 34px; height: 34px; }
.emic .i-end { display: none; }
.emic.listen { background: var(--e-coral); box-shadow: 0 14px 30px -12px rgba(255, 107, 74, .8); }
.emic.call { background: #E5484D; box-shadow: 0 14px 30px -12px rgba(229, 72, 77, .8); }
.emic.listen::after, .emic.call::after { content: ""; position: absolute; inset: -6px; border: 3px solid var(--e-coral); border-radius: 50%; opacity: 0; animation: ring 1.6s ease-out infinite; }
.emic.call .i-mic { display: none; }
.emic.call .i-end { display: block; }
.emic-label { color: var(--e-ink2); font-size: 13.5px; font-weight: 700; white-space: nowrap; }
.ecompose { display: flex; gap: 8px; }
.ecompose input { flex: 1; min-width: 0; padding: 12px 18px; border: 1px solid var(--e-line); border-radius: 99px; outline: none; background: var(--e-bg); color: var(--e-ink); font-size: 15.5px; }
.ecompose input:focus { border-color: var(--e-blue); background: var(--e-paper); }
.ecompose button { display: grid; place-items: center; width: 46px; height: 46px; flex: none; border: 0; border-radius: 50%; background: var(--e-ink); color: #fff; cursor: pointer; }
.ecompose button svg { width: 20px; height: 20px; }

.esheet { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(20, 23, 43, .35); backdrop-filter: blur(3px); }
.esheet[hidden] { display: none; }
.esheet-card { display: grid; gap: 14px; width: min(480px, 92vw); max-height: 90vh; overflow: auto; padding: 24px; border-radius: 26px; background: var(--e-paper); box-shadow: var(--e-shadow); font-size: 15px; }
.esheet-card h2 { margin: 0; font-size: 20px; }
.eline { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.eline select { max-width: 230px; padding: 8px 10px; border: 1px solid var(--e-line); border-radius: 12px; background: var(--e-bg); color: var(--e-ink); }
.eline input[type="range"] { width: 200px; accent-color: var(--e-blue); }
.echeck { display: flex; align-items: flex-start; gap: 10px; }
.echeck input { margin-top: 4px; accent-color: var(--e-blue); }
.esheet-card p { margin: 0; color: var(--e-soft); font-size: 13px; }
.ebtn { justify-self: end; padding: 10px 22px; border: 0; border-radius: 99px; background: var(--e-blue); color: #fff; font-size: 15px; font-weight: 700; cursor: pointer; }

@keyframes ring { 0% { opacity: .55; transform: scale(.92); } 100% { opacity: 0; transform: scale(1.35); } }

@media (max-width: 900px) {
  .ebar { height: 56px; padding: 0 14px; }
  .estate { display: none; }
  .easy { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); gap: 10px; height: calc(100% - 56px); padding: 0 10px 10px; }
  .stage { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 12px 14px; border-radius: 22px; }
  .ebot-wrap { flex-direction: row; align-items: center; gap: 12px; min-width: 0; }
  .ebot { width: 72px; height: 92px; flex: none; }
  .ebubble { padding: 10px 14px; font-size: 15px; text-align: left; }
  .ebubble::before { top: 50%; left: -7px; transform: translateY(-50%) rotate(45deg); }
  .ecam { flex: none; max-width: 120px; margin-left: auto; }
  .ecam-bar span { display: none; }
  .ecam-bar button { padding: 6px 9px; font-size: 12px; }
  .echat { border-radius: 22px; }
  .efeed { padding: 14px 14px 8px; }
  .em { font-size: 15.5px; }
  .edock { gap: 9px; padding: 10px 12px 12px; }
  .ecore { gap: 18px; }
  .erow { justify-content: center; gap: 8px; }
  .elangs { flex-wrap: nowrap; gap: 5px; }
  .elangs .lab { font-size: 12px; }
  .elangs button { padding: 5px 10px; font-size: 13px; }
  .elangs select { max-width: 86px; padding: 5px 8px; font-size: 13px; }
}
