/* AUREX mobile companion: tokens and look ported from the desktop frontend (css/theme.css, stage.css). */
@font-face { font-family: "AurexDisplay"; src: url("../fonts/Cinzel.ttf") format("truetype"); font-weight: 400 900; font-display: swap; }
@font-face { font-family: "AurexHud"; src: url("../fonts/Barlow-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "AurexHud"; src: url("../fonts/Barlow-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "AurexHud"; src: url("../fonts/Barlow-SemiBold.ttf") format("truetype"); font-weight: 600; font-display: swap; }

:root {
  --obsidian: #070605; --obsidian-2: #0d0b09; --obsidian-3: #16120d;
  --gold-deep: #6e5422; --gold: #b8913f; --gold-champagne: #d9bd7d; --gold-light: #f1dca6; --white-gold: #fff4d6;
  --gold-line: rgba(217,189,125,.55); --gold-line-dim: rgba(217,189,125,.22);
  --text: #ece0c2; --text-dim: #9a8a66; --text-faint: #6c6048; --hudtext: #c8d2d4;
  --ok: #3fb59e; --warn: #d6a54a; --err: #d0503f;
  --font-display: "AurexDisplay", "Times New Roman", serif;
  --hud: "AurexHud", -apple-system, system-ui, sans-serif;
  --gold-border: linear-gradient(160deg, #f6e4b4 0%, #8a6a2c 18%, #d9bd7d 40%, #5a431b 62%, #c9a65c 82%, #f1dca6 100%);
  --glass: linear-gradient(180deg, rgba(14,12,9,.93), rgba(6,5,4,.95));
  /* safe areas (Dynamic Island / home indicator); overridable for tests */
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px);
  --app-h: 100dvh;
  --hero-h: clamp(200px, 31dvh, 360px);
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; background: #050403; overflow: hidden; overscroll-behavior: none; }
body { font-family: var(--hud); color: var(--text); font-size: 15px; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
svg { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
svg .fill { fill: currentColor; stroke: none; }
[hidden] { display: none !important; }

#edge { position: fixed; inset: -40px; z-index: 0; background: #050403 url("../img/plate/edge.jpg") center / cover no-repeat; filter: blur(18px) brightness(.55); }

#app { position: fixed; left: 0; right: 0; top: 0; height: var(--app-h); z-index: 1; display: flex; flex-direction: column;
  padding-left: var(--sal); padding-right: var(--sar); }
body.booting #app > :not(#hero) { opacity: 0; }
#app > * { transition: opacity .5s; }

/* ---------- header (below the Dynamic Island) ---------- */
#top { flex: none; display: flex; align-items: center; gap: 10px; padding: calc(var(--sat) + 4px) 14px 6px;
  background: linear-gradient(180deg, rgba(5,4,3,.92), rgba(5,4,3,.55)); position: relative; z-index: 3; }
.brand { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.badge { width: 28px; height: 28px; }
.word { font-family: var(--font-display); font-size: 21px; letter-spacing: 5px; color: var(--gold-light); text-shadow: 0 0 8px rgba(255,214,130,.25); }
.conn { display: flex; align-items: center; gap: 6px; font-size: 10.5px; letter-spacing: 1.6px; font-weight: 600; color: var(--text-dim);
  border: 1px solid var(--gold-line-dim); border-radius: 20px; padding: 3px 9px 3px 7px; }
.conn i { width: 7px; height: 7px; border-radius: 50%; background: var(--err); box-shadow: 0 0 6px currentColor; }
.conn.live i { background: var(--ok); } .conn.live { color: #9fd9c9; }
.conn.poll i { background: var(--warn); } .conn.poll { color: #e8c98a; }
.clock { font-size: 15px; font-weight: 500; color: #f5e6a1; font-variant-numeric: tabular-nums; text-shadow: 0 0 6px rgba(255,214,130,.35); }
.iconbtn { width: 38px; height: 38px; display: grid; place-items: center; color: var(--gold-light); border-radius: 10px; }
.iconbtn svg { width: 22px; height: 22px; }
.iconbtn:active { background: rgba(217,189,125,.15); }

/* ---------- hero: reactor sprites cut from the desktop plate ---------- */
#hero { flex: none; position: relative; height: var(--hero-h); overflow: hidden; transition: height .35s ease; margin-top: -2px; }
body[data-tab="system"] #hero, body[data-tab="log"] #hero { --hero-h: clamp(170px, 24dvh, 280px); }
body.kb #hero { --hero-h: 0px; }
#rxStage { position: absolute; left: 0; top: 0; width: 936px; height: 780px; transform-origin: 0 0;
  background: #080706 url("../img/plate/hero.jpg") 0 0 / 936px 780px no-repeat; transition: filter .6s ease; contain: layout paint; }
#rxStage .rl { position: absolute; display: block; will-change: transform; }
#rxOut { left: 219px; top: 96px; width: 496px; height: 496px; }
#rxIn { left: 261px; top: 138px; width: 412px; height: 412px; }
#rxCore { left: 317px; top: 194px; width: 300px; height: 300px; }
#rxOrbit { left: 141px; top: 57px; width: 645px; height: 676px; }
#rxGlow { position: absolute; left: 307px; top: 184px; width: 320px; height: 320px; border-radius: 50%; mix-blend-mode: screen; opacity: 0; will-change: opacity;
  background: radial-gradient(circle, rgba(255,236,190,.95) 0%, rgba(255,205,120,.55) 18%, rgba(240,170,70,.22) 42%, rgba(200,130,40,0) 70%); }
#rxSpark { position: absolute; left: 0; top: 0; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; opacity: 0; mix-blend-mode: screen;
  background: radial-gradient(circle, #fffaf0 0%, rgba(255,226,160,.85) 25%, rgba(255,200,110,0) 70%); will-change: transform, opacity; }
#rxStage[data-state="listening"] { filter: brightness(1.06) saturate(1.05); }
#rxStage[data-state="speaking"] { filter: brightness(1.1); }
#rxStage[data-state="executing"] { filter: brightness(1.1) saturate(1.12); }
#rxStage[data-state="error"] { filter: hue-rotate(-38deg) saturate(1.45) brightness(.9); }
.heroFade { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(5,4,3,.92), rgba(5,4,3,.35) 12%, transparent 24%, transparent 76%, rgba(5,4,3,.35) 88%, rgba(5,4,3,.92)),
              linear-gradient(180deg, rgba(5,4,3,.35), transparent 18%, transparent 58%, rgba(5,4,3,.92)); }
#miniMetrics { position: absolute; left: 12px; top: 8px; display: flex; flex-direction: column; gap: 3px; font-size: 10.5px; letter-spacing: 1.3px; }
#miniMetrics span { display: flex; gap: 6px; align-items: baseline; }
#miniMetrics b { color: var(--text-dim); font-weight: 600; width: 28px; }
#miniMetrics em { font-style: normal; color: #f5e6a1; font-weight: 600; font-variant-numeric: tabular-nums; }
#stateBox { position: absolute; left: 0; right: 0; bottom: 4px; text-align: center; }
#stateLine { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 15px; letter-spacing: 4px; font-weight: 600; color: #f5e6a1; text-shadow: 0 0 10px rgba(255,214,130,.4); }
.stateIcon { width: 15px; height: 15px; color: var(--gold-light); }
body[data-state="thinking"] .stateIcon, body[data-state="executing"] .stateIcon { animation: spin 1.4s linear infinite; }
body[data-state="error"] #stateLabel, body[data-state="error"] .stateIcon { color: #e07a6c; }
body.reduced .stateIcon { animation: none !important; }
@keyframes spin { to { transform: rotate(360deg); } }
#stateSub { font-size: 12px; color: var(--text-dim); letter-spacing: .4px; margin-top: 1px; min-height: 15px; padding: 0 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#stateSub.warn { color: var(--warn); } #stateSub.err { color: #e07a6c; }
#wave { display: block; width: min(86vw, 380px); height: auto; aspect-ratio: 524 / 56; margin: 0 auto; }

/* ---------- tabs ---------- */
#tabs { flex: none; display: flex; gap: 6px; padding: 6px 12px 6px; position: relative; z-index: 2; }
#tabs button { flex: 1; height: 36px; display: flex; align-items: center; justify-content: center; gap: 7px; font-size: 12px; font-weight: 600; letter-spacing: 2.4px; color: var(--text-dim);
  border: 1px solid var(--gold-line-dim); border-radius: 9px; background: rgba(8,7,5,.7); }
#tabs button svg { width: 17px; height: 17px; }
#tabs button.on { color: var(--white-gold); border-color: var(--gold-champagne); background: linear-gradient(180deg, rgba(150,112,48,.45), rgba(70,52,22,.45)); box-shadow: inset 0 1px 0 rgba(255,240,200,.25); }

/* ---------- views ---------- */
#views { flex: 1; min-height: 0; position: relative; margin: 0 10px; border: 1px solid transparent; border-radius: 14px;
  background: var(--glass) padding-box, var(--gold-border) border-box; box-shadow: 0 0 18px rgba(0,0,0,.7); }
.view { position: absolute; inset: 0; display: flex; flex-direction: column; }
.scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 12px 12px 16px; }
.sect { font-size: 11.5px; letter-spacing: 3px; font-weight: 600; color: var(--gold-light); display: flex; align-items: center; gap: 8px; margin: 2px 2px 10px; }
.sect::before { content: ""; width: 7px; height: 7px; border-radius: 50%; border: 1px solid var(--gold-champagne); box-shadow: inset 0 0 0 1.5px #0b0906, inset 0 0 0 4px var(--gold-light); }
.age { margin-left: auto; font-size: 10px; letter-spacing: 1px; color: var(--text-faint); font-weight: 500; }
.mini { margin-left: auto; width: 28px; height: 28px; display: grid; place-items: center; color: var(--gold-light); border-radius: 7px; }
.mini svg { width: 17px; height: 17px; }

/* chat */
#chatScroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 8px 10px 12px; user-select: text; -webkit-user-select: text; }
#histTop { text-align: center; font-size: 11px; letter-spacing: 1px; color: var(--text-faint); padding: 6px 0 10px; min-height: 28px; }
#msgs { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 86%; display: flex; flex-direction: column; gap: 4px; }
.msg.user { align-self: flex-end; align-items: flex-end; }
.msg.assistant { align-self: flex-start; }
.bub { padding: 9px 12px; border-radius: 13px; font-size: 15px; line-height: 1.4; white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere; }
.msg.user .bub { color: #1b1408; background: linear-gradient(180deg, #f1dca6, #d2b06a); border-bottom-right-radius: 4px; box-shadow: 0 0 10px rgba(217,189,125,.18); }
.msg.assistant .bub { color: var(--text); background: rgba(22,18,13,.92); border: 1px solid var(--gold-line-dim); border-bottom-left-radius: 4px; }
.msg.pending .bub:empty::after, .msg.pending .bub.dots::after { content: "● ● ●"; letter-spacing: 3px; color: var(--gold-champagne); animation: blink 1.2s infinite; }
.msg.failed .bub { border-color: rgba(208,80,63,.6); color: #e9b3aa; }
@keyframes blink { 50% { opacity: .3; } }
.meta { display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--text-faint); letter-spacing: .5px; padding: 0 3px; }
.src { display: inline-flex; align-items: center; gap: 3px; padding: 1px 6px 1px 4px; border-radius: 8px; border: 1px solid var(--gold-line-dim); color: var(--gold-champagne); font-size: 9.5px; font-weight: 600; letter-spacing: 1.2px; }
.src svg { width: 11px; height: 11px; }
.src.voice { color: #9fd9c9; border-color: rgba(63,181,158,.35); }
.src.phone { color: var(--white-gold); }
.daysep { align-self: center; font-size: 10px; letter-spacing: 2px; color: var(--text-faint); padding: 4px 0; }
.empty { text-align: center; color: var(--text-dim); font-size: 13px; padding: 24px 16px; line-height: 1.5; }
#jumpBtn { position: absolute; right: 12px; bottom: 10px; padding: 6px 12px; font-size: 11px; letter-spacing: 1.5px; font-weight: 600; color: var(--white-gold); border: 1px solid var(--gold-champagne); border-radius: 14px; background: rgba(20,16,10,.95); }

/* metrics cards */
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.card { border: 1px solid var(--gold-line-dim); border-radius: 11px; padding: 10px 11px 9px; background: rgba(0,0,0,.45); }
.card.wide { grid-column: 1 / -1; }
.ct { font-size: 11px; letter-spacing: 2.5px; font-weight: 600; color: var(--hudtext); }
.cv { margin: 3px 0 6px; }
.pct { font-size: 26px; font-weight: 500; color: #f5e6a1; font-variant-numeric: tabular-nums; text-shadow: 0 0 8px rgba(255,214,130,.3); }
.pct small { font-size: 14px; color: var(--text-dim); margin-left: 1px; }
.bar { height: 4px; border-radius: 2px; background: rgba(217,189,125,.14); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #b8913f, #f6dc9c); box-shadow: 0 0 6px rgba(255,214,130,.5); transition: width .6s ease; }
.card.hot .bar i { background: linear-gradient(90deg, #d6a54a, #d0503f); }
.cs { margin-top: 6px; font-size: 11.5px; color: var(--text-dim); font-variant-numeric: tabular-nums; min-height: 15px; }
.netrow { display: flex; gap: 24px; margin-top: 6px; font-size: 14px; color: var(--text-dim); }
.netrow b { color: #f5e6a1; font-weight: 500; font-variant-numeric: tabular-nums; font-size: 17px; }
#cards.stale .pct, #cards.stale .netrow b { opacity: .45; }
.qa { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-top: 4px; }
.qbtn { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px 10px; font-size: 12px; letter-spacing: .6px; color: var(--text);
  border: 1px solid var(--gold-line); border-radius: 11px; background: linear-gradient(180deg, rgba(40,31,17,.75), rgba(8,7,5,.85)); }
.qbtn svg { width: 28px; height: 28px; color: var(--gold-light); }
.qbtn:active, .qbtn.busy { box-shadow: 0 0 0 1px var(--gold-light), 0 0 16px rgba(255,200,110,.35); }
.qbtn.busy { animation: recpulse 1.1s ease-in-out infinite; }
.qamsg { min-height: 20px; font-size: 13px; color: var(--text-dim); margin: 10px 2px 4px; }
.qamsg.ok { color: #9fd9c9; } .qamsg.err { color: #e9b3aa; }
.info { font-size: 12px; line-height: 1.55; color: var(--text-dim); border: 1px solid var(--gold-line-dim); border-radius: 10px; padding: 9px 11px; margin-top: 12px; user-select: text; -webkit-user-select: text; }
.info code { color: var(--gold-light); font-family: ui-monospace, Menlo, monospace; font-size: 11px; word-break: break-all; }
.mock { color: #ff9f7a !important; font-weight: 600; }

/* log */
#logList { list-style: none; display: flex; flex-direction: column; }
#logList li { display: grid; grid-template-columns: 54px 1fr; gap: 8px; padding: 8px 2px; border-bottom: 1px solid rgba(217,189,125,.1); font-size: 13px; line-height: 1.35; }
#logList li time { color: var(--text-faint); font-variant-numeric: tabular-nums; font-size: 11.5px; padding-top: 1px; }
#logList li .k { display: inline-block; font-size: 9.5px; letter-spacing: 1.2px; font-weight: 600; color: var(--gold-champagne); margin-right: 6px; text-transform: uppercase; }
#logList li.lvl-warn .k, #logList li.lvl-warning .k { color: var(--warn); } #logList li.lvl-error .k { color: #e07a6c; } #logList li.lvl-ok .k, #logList li.lvl-success .k { color: var(--ok); }
#logList li.new { animation: fadein .6s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(-4px); } }

/* ---------- dock ---------- */
#dock { flex: none; padding: 8px 10px calc(max(var(--sab), 8px) + 2px); display: flex; flex-direction: column; gap: 8px; }
body.kb #dock { padding-bottom: 8px; }
body:not([data-tab="chat"]) #cmdForm { display: none; }
#cmdForm { display: flex; gap: 8px; }
#cmd { flex: 1; min-width: 0; height: 44px; font: inherit; font-size: 16px; /* >=16px: no iOS zoom */ color: var(--text); padding: 0 14px;
  background: rgba(0,0,0,.65); border: 1px solid var(--gold-line); border-radius: 11px; outline: none; user-select: text; -webkit-user-select: text; }
#cmd::placeholder { color: var(--text-faint); }
#cmd:focus { border-color: var(--gold-light); box-shadow: 0 0 0 1px rgba(241,220,166,.25); }
.sendBtn, .sq { width: 44px; height: 44px; flex: none; display: grid; place-items: center; color: var(--gold-light); border: 1px solid var(--gold-line); border-radius: 11px; background: rgba(0,0,0,.6); }
.sendBtn svg, .sq svg { width: 22px; height: 22px; }
.sq[aria-pressed="false"] { color: var(--text-faint); }
.sq.int:active, .sq.int.armed { border-color: var(--err); color: #ffb3a6; }
.dockRow { display: flex; gap: 8px; }
.voice { flex: 1; height: 50px; display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 14px; letter-spacing: 3.5px; font-weight: 600; color: var(--white-gold);
  border: 1px solid var(--gold-champagne); border-radius: 12px; touch-action: none; -webkit-touch-callout: none;
  background: linear-gradient(180deg, rgba(150,112,48,.6), rgba(70,52,22,.6) 55%, rgba(110,84,34,.55)); box-shadow: inset 0 1px 0 rgba(255,240,200,.3), 0 0 14px rgba(217,189,125,.18); }
.voice svg { width: 22px; height: 22px; }
.voice.rec { background: radial-gradient(closest-side, rgba(255,214,130,.38), rgba(120,88,36,.6)); box-shadow: 0 0 0 1px rgba(255,220,150,.75), 0 0 22px rgba(255,200,110,.5); animation: recpulse 1.1s ease-in-out infinite; }
.voice.unsupported { opacity: .55; }
@keyframes recpulse { 50% { box-shadow: 0 0 0 1px rgba(255,220,150,.95), 0 0 30px rgba(255,200,110,.7); } }
body.reduced .voice.rec, body.reduced .qbtn.busy { animation: none; }

/* ---------- modals ---------- */
.modal { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; background: rgba(0,0,0,.6); padding: calc(var(--sat) + 10px) 14px calc(var(--sab) + 10px); }
.modal.full { background: #050403 url("../img/plate/hero.jpg") 50% 30% / cover no-repeat; overflow-y: auto; }
.modal.full::before { content: ""; position: fixed; inset: 0; background: linear-gradient(180deg, rgba(5,4,3,.55), rgba(5,4,3,.88) 45%, rgba(5,4,3,.97)); }
.panel { position: relative; width: 100%; max-width: 420px; border: 1px solid transparent; border-radius: 16px; background: var(--glass) padding-box, var(--gold-border) border-box; box-shadow: 0 0 30px rgba(0,0,0,.85); }
.pairSheet { padding: 22px 20px 18px; display: flex; flex-direction: column; gap: 13px; }
.pairIcon { width: 72px; height: 72px; border-radius: 18px; align-self: center; box-shadow: 0 0 24px rgba(255,200,110,.35); }
.pairSheet h1 { font-family: var(--font-display); font-weight: 500; text-align: center; letter-spacing: 9px; font-size: 28px; color: var(--gold-light); margin-top: -2px; }
.lead { text-align: center; color: var(--text); font-size: 14.5px; }
.steps { padding-left: 20px; font-size: 13px; color: var(--text-dim); line-height: 1.5; }
.steps b { color: var(--gold-light); font-weight: 600; }
.pairSheet label, .sheet label { display: flex; flex-direction: column; gap: 6px; font-size: 11.5px; letter-spacing: 1.8px; font-weight: 600; color: var(--gold-champagne); }
.pairSheet small { font-size: 11px; letter-spacing: .3px; font-weight: 400; color: var(--text-faint); }
.pairSheet input { height: 46px; font: inherit; font-size: 16px; letter-spacing: .3px; font-weight: 400; color: var(--text); padding: 0 13px; background: rgba(0,0,0,.65); border: 1px solid var(--gold-line); border-radius: 10px; outline: none; user-select: text; -webkit-user-select: text; }
.pairSheet input:focus { border-color: var(--gold-light); }
.pairSheet .voice { flex: none; margin-top: 2px; }
.err { font-size: 13px; color: #f0b2a6; background: rgba(208,80,63,.12); border: 1px solid rgba(208,80,63,.45); border-radius: 9px; padding: 8px 11px; line-height: 1.4; }
.fine { font-size: 11px; color: var(--text-faint); text-align: center; line-height: 1.45; }
.sheet { padding: 16px 16px 16px; display: flex; flex-direction: column; gap: 14px; }
.sheet h2 { display: flex; align-items: center; gap: 9px; font-size: 13px; letter-spacing: 3.5px; font-weight: 600; color: var(--gold-light); }
.sheet .x { margin-left: auto; width: 32px; height: 32px; }
.hicon { width: 18px; height: 18px; color: var(--gold-champagne); }
.sheet label.tog { flex-direction: row; align-items: center; gap: 11px; font-size: 14px; letter-spacing: .2px; font-weight: 400; color: var(--text); }
.sheet input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--gold); flex: none; }
.sheet .info { margin-top: 0; }
.row2 { display: flex; gap: 9px; }
.ghost { flex: 1; height: 44px; font-size: 11.5px; letter-spacing: 2px; font-weight: 600; color: var(--text); border: 1px solid var(--gold-line); border-radius: 10px; background: rgba(0,0,0,.5); }
.ghost.danger { border-color: rgba(208,80,63,.6); color: #f0b2a6; }
#toast { position: fixed; z-index: 20; left: 50%; top: calc(var(--sat) + 52px); transform: translateX(-50%); max-width: calc(100vw - 32px); padding: 9px 16px; font-size: 13.5px; color: var(--text);
  background: rgba(8,7,5,.96); border: 1px solid var(--gold-line); border-radius: 10px; box-shadow: 0 4px 18px rgba(0,0,0,.6); text-align: center; }
@media (prefers-reduced-motion: reduce) { #hero { transition: none; } }

/* cloud sign-in */
.pairSheet details.adv{margin:4px 0 2px;font-size:13px;color:var(--dim,#8fb3c9)}
.pairSheet details.adv summary{cursor:pointer;letter-spacing:.08em;padding:4px 0}
.pairSheet .altLogin{margin-top:10px}
.pairSheet .altLogin button{font-size:11px;opacity:.55}

/* ---------- v0.2 agent: tasks, approvals, sources, inbox, integrations, memory ---------- */
#tabs button { letter-spacing: 1.4px; gap: 5px; font-size: 11.5px; position: relative; }
#tabs button[data-badge]:not([data-badge=""])::after { content: attr(data-badge); position: absolute; top: -6px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--err); color: #fff; font-size: 11px; letter-spacing: 0; line-height: 18px; text-align: center; }
body[data-tab="tasks"] #hero { --hero-h: clamp(120px, 17dvh, 200px); }
.sq.agent.on { color: var(--white-gold); border-color: var(--gold-champagne); background: linear-gradient(180deg, rgba(150,112,48,.5), rgba(70,52,22,.5)); }
.estop { width: 100%; height: 46px; margin: 4px 0 10px; border-radius: 10px; font-weight: 700; letter-spacing: 2px; font-size: 13px; color: #ffd9d2;
  border: 1px solid rgba(208,80,63,.7); background: linear-gradient(180deg, rgba(120,30,20,.55), rgba(60,14,10,.6)); }
.estop.on { background: var(--err); color: #fff; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 18px rgba(208,80,63,.8); } }
.counts { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 8px; }
.chip { font-size: 10.5px; letter-spacing: 1.2px; font-weight: 600; padding: 2px 8px; border-radius: 10px; border: 1px solid var(--gold-line-dim); color: var(--text-dim); white-space: nowrap; }
.chip.st-running, .chip.st-waiting { color: #9fd9c9; border-color: rgba(63,181,158,.6); }
.chip.st-needs_approval { color: #fff; background: rgba(214,165,74,.35); border-color: var(--warn); }
.chip.st-done { color: #bfe8c9; border-color: rgba(63,181,158,.45); }
.chip.st-failed, .chip.st-cancelled { color: #f0a497; border-color: rgba(208,80,63,.6); }
.chip.st-paused, .chip.st-queued { color: #e8c98a; }
.tlist, .inbox, .integ, .slist, .mlist, .srcs, .unf { list-style: none; margin: 0; padding: 0; user-select: text; -webkit-user-select: text; }
.tlist .sub { font-size: 10.5px; letter-spacing: 2px; color: var(--text-faint); margin: 10px 2px 4px; }
.tcard { border: 1px solid var(--gold-line-dim); border-radius: 10px; padding: 10px 12px; margin-bottom: 7px; background: rgba(10,8,6,.75); }
.tcard.st-needs_approval { border-color: var(--warn); } .tcard.st-running { border-color: rgba(63,181,158,.5); }
.tcard .tt { font-size: 14px; color: var(--text); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tm { display: flex; gap: 8px; align-items: center; font-size: 11.5px; color: var(--text-dim); margin-top: 5px; flex-wrap: wrap; } .tm .r { margin-left: auto; }
.tp { font-size: 12px; color: var(--text-faint); margin-top: 4px; }
.inbox li { border-bottom: 1px solid var(--gold-line-dim); padding: 8px 2px; display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; font-size: 13px; }
.inbox li b { font-weight: 600; } .inbox li span { grid-column: 1; color: var(--text-dim); font-size: 12px; } .inbox li time { grid-row: 1; grid-column: 2; color: var(--text-faint); font-size: 11px; }
.inbox li.unread b::before { content: "● "; color: var(--gold-champagne); }
.mini.txt { width: auto; padding: 0 8px; font-size: 10.5px; letter-spacing: 1.4px; }
.tsheet { max-height: 88dvh; overflow-y: auto; -webkit-overflow-scrolling: touch; user-select: text; -webkit-user-select: text; }
.tsheet h4 { font-size: 11px; letter-spacing: 2px; color: var(--gold-champagne); margin: 14px 0 6px; } .tsheet h4 small { color: var(--text-faint); letter-spacing: .5px; font-weight: 400; }
.tsheet .obj { font-size: 15px; margin: 8px 0; } .dim { color: var(--text-dim); font-size: 12px; } .err { color: #f0a497; }
.answer { font-size: 14px; line-height: 1.5; background: rgba(20,16,11,.8); border: 1px solid var(--gold-line-dim); border-radius: 10px; padding: 10px 12px; overflow-wrap: anywhere; }
.answer a, .srcs a { color: var(--gold-light); } .answer .h { display: block; color: var(--gold-champagne); margin-top: 8px; }
.srcs li { padding: 6px 0; border-bottom: 1px solid rgba(217,189,125,.1); font-size: 13px; overflow-wrap: anywhere; } .srcs li span { display: block; font-size: 11.5px; color: var(--text-faint); }
.unf li { font-size: 13px; color: #f0c59a; padding: 3px 0; } .unf li::before { content: "✕ "; color: var(--err); }
.appr { border: 1px solid var(--warn); border-radius: 10px; padding: 10px; margin: 10px 0; background: rgba(214,165,74,.08); }
.appr pre { white-space: pre-wrap; font-size: 12px; background: rgba(0,0,0,.4); padding: 8px; border-radius: 6px; overflow-wrap: anywhere; }
.voice.ok { background: linear-gradient(180deg, #2f8f7c, #1d5c50); }
.acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; } .voice.act { height: 42px; padding: 0 16px; width: auto; }
.mini2 { height: 30px; padding: 0 10px; font-size: 11px; letter-spacing: 1.2px; width: auto; }
.warnbox { border: 1px dashed var(--warn); color: #e8c98a; padding: 6px 10px; border-radius: 8px; font-size: 12px; }
.steps summary { font-size: 11px; letter-spacing: 2px; color: var(--text-dim); margin-top: 12px; }
.steps ol { list-style: none; padding: 0; margin: 6px 0; font-size: 12px; } .steps li { padding: 4px 0; border-bottom: 1px solid rgba(217,189,125,.08); color: var(--text-dim); overflow-wrap: anywhere; }
.steps li time { color: var(--text-faint); margin-right: 6px; } .steps li b { color: var(--text); font-weight: 600; }
.steps li.ss-error b, .steps li.ss-forbidden b, .steps li.ss-blocked b, .steps li.ss-denied b { color: #f0a497; } .steps li.ss-pending b { color: #e8c98a; }
.integ li { border: 1px solid var(--gold-line-dim); border-left-width: 3px; border-radius: 8px; padding: 8px 10px; margin-bottom: 6px; font-size: 13px; }
.integ li.ok { border-left-color: var(--ok); } .integ li.bad { border-left-color: var(--err); } .integ li.off { border-left-color: var(--text-faint); }
.integ li > div:first-child { display: flex; justify-content: space-between; gap: 8px; } .integ .where { font-size: 10.5px; color: var(--text-faint); letter-spacing: 1px; text-transform: uppercase; }
.integ .fix { font-size: 12px; color: #e8c98a; margin-top: 3px; }
.slist li, .mlist li { border-bottom: 1px solid var(--gold-line-dim); padding: 8px 2px; font-size: 13px; }
.row3 { display: flex; gap: 8px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.sform, .memq { display: grid; gap: 6px; margin: 8px 0; } .sform input, .memq, #scTok textarea { width: 100%; background: rgba(0,0,0,.4); color: var(--text); border: 1px solid var(--gold-line-dim); border-radius: 8px; padding: 9px 10px; font: inherit; font-size: 14px; user-select: text; -webkit-user-select: text; }
.taskLink { display: block; margin: 6px 0 0 auto; font-size: 10.5px; letter-spacing: 1.6px; color: var(--gold-champagne); border: 1px solid var(--gold-line-dim); border-radius: 8px; padding: 4px 9px; }
body.estop #stateSub::before { content: "EMERGENCY STOP ON · "; color: var(--err); font-weight: 700; }

/* v0.3: model chip, link labels, checked action buttons, time zone select */
.mchip{display:inline-block;margin-left:6px;padding:0 6px;border:1px solid rgba(120,200,255,.35);border-radius:8px;font-size:10px;letter-spacing:.04em;opacity:.85;white-space:nowrap}
.mchip.fb{border-color:rgba(255,190,80,.6);color:#ffcf7a}
h4 .mchip{vertical-align:middle;font-weight:400}
.bub a.lnk,.answer a.lnk{color:#8fd8ff;text-decoration:underline;text-underline-offset:2px;word-break:break-word}
.bub b.h{display:block;margin:6px 0 2px;letter-spacing:.05em}
.actw{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:6px 0}
.actw .chk{flex-basis:100%;opacity:.8;font-size:12px}
.actw.bad .chk{color:#ffb070;opacity:1}
label.sel{display:flex;justify-content:space-between;align-items:center;gap:10px;margin:10px 0;font-size:14px}
label.sel select{background:rgba(255,255,255,.06);color:inherit;border:1px solid rgba(255,255,255,.2);border-radius:8px;padding:6px 8px;font:inherit;max-width:60%}
