/* ── Wivexx control room — same design language as wivexx.com ───────────── */
@font-face { font-family: "Space Grotesk"; src: url("fonts/SpaceGrotesk-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url("fonts/SpaceGrotesk-Bold.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/Inter-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/Inter-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Space Mono"; src: url("fonts/SpaceMono-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Space Mono"; src: url("fonts/SpaceMono-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  --ink: #0d0d0d;
  --graphite: #1c1c1a;
  --graphite-2: #262624;
  --volt: #c1f73a;
  --bone: #f2f0ea;
  --stone: #8a8a85;
  --line: rgba(242, 240, 234, 0.12);
  --line-2: rgba(242, 240, 234, 0.07);
  --ease: cubic-bezier(0.2, 0.6, 0.2, 1);
  --topbar-h: 44px;
  /* design tokens (v1.57 redesign) — shared radius / motion / elevation scale
     so every surface animates and rounds the same way */
  --radius-s: 8px;
  --radius-m: 12px;
  --radius-l: 18px;
  --dur-fast: 0.18s;
  --dur: 0.25s;
  --dur-slow: 0.32s;
  --elev-1: 0 10px 30px rgba(0, 0, 0, 0.35);
  --elev-2: 0 24px 80px rgba(0, 0, 0, 0.55);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100vh; overflow: hidden; }
body {
  background: var(--ink);
  color: var(--bone);
  font-family: "Inter", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  user-select: none;
}
::selection { background: var(--volt); color: var(--ink); }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(242,240,234,0.22); }
.mono { font-family: "Space Mono", monospace; font-size: 12px; letter-spacing: 0.08em; color: var(--stone); }
.mono.volt { color: var(--volt); }

/* ── custom title bar ─────────────────────────────────────────────────── */
/* NOTE: dragging is driven from JS (app.js → wireDrag → move_window bridge),
   NOT by -webkit-app-region or pywebview's `.pywebview-drag-region`. WebView2
   honours -webkit-app-region and swallows the events as a native title bar
   (which the frameless host never hooks up), and it also ignores pywebview's
   drag-region class — either way the window stays stuck. Keep both OFF. */
#topbar {
  height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 8px 0 18px;
  border-bottom: 1px solid var(--line);
  cursor: default;
}
.brand { display: flex; align-items: baseline; gap: 13px; }
.wordmark { font-family: "Space Grotesk", sans-serif; font-weight: 600; font-size: 19px; letter-spacing: -0.02em; }
.wordmark .dot { color: var(--volt); }
.brand-sub { font-size: 11px; }
/* live state next to the wordmark — the orb's mood, in words */
.topstate { display: inline-flex; align-items: center; gap: 7px; position: relative; top: -1px;
  font-family: "Space Mono", monospace; font-size: 11px; letter-spacing: 0.07em; color: var(--volt); }
.topstate .tpip { width: 6px; height: 6px; border-radius: 50%; background: var(--volt);
  box-shadow: 0 0 8px var(--volt); transition: background var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.topstate.idle { color: var(--stone); gap: 0; }
.topstate.idle .tpip { background: var(--stone); box-shadow: none; }
/* ONE status story (v1.57): when idle, the titlebar pip stays as a quiet heartbeat
   and its word collapses — the hero caption below already says "ready"; saying it
   twice was noise. The word slides back in for active states (listening/thinking…). */
#topstate-text { display: inline-block; max-width: 180px; overflow: hidden; white-space: nowrap;
  transition: max-width var(--dur-slow) var(--ease), opacity var(--dur-slow) var(--ease); }
.topstate.idle #topstate-text { max-width: 0; opacity: 0; }
.topright { display: flex; align-items: center; gap: 14px; position: relative; z-index: 60; }
.winbtns { display: flex; gap: 2px; position: relative; z-index: 60; }   /* above resize grips */
.winbtn {
  width: 34px; height: 30px; border: none; background: transparent;
  color: var(--stone); font-size: 14px; border-radius: 8px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; line-height: 1;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.winbtn:hover { background: var(--graphite-2); color: var(--bone); }
.winbtn.close:hover { background: #e0553a; color: var(--ink); }
/* 📊 perf HUD toggle — lit volt when the overlay is showing */
.winbtn#btn-perf.on { color: var(--volt); }
.winbtn#btn-perf.on svg rect { stroke: var(--volt); }

/* ── stage / centered column ──────────────────────────────────────────── */
#stage {
  height: calc(100vh - var(--topbar-h));
  max-width: 920px; margin: 0 auto;
  padding: 14px 24px 18px;
  display: flex; flex-direction: column; gap: 12px;
}

/* hero */
#hero {
  position: relative; flex: 0 0 auto;
  display: flex; flex-direction: column; align-items: center;
  padding-top: 10px;
}
/* a living light source, not a spotlight — brighter + softer, gently breathing */
.hero-halo {
  position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%);
  width: 340px; height: 300px; pointer-events: none;
  background: radial-gradient(ellipse 48% 44% at 50% 46%,
      rgba(193,247,58,0.12) 0%, rgba(193,247,58,0.05) 40%, transparent 70%);
  filter: blur(2px); animation: halo-breathe 4.6s var(--ease) infinite;
}
@keyframes halo-breathe { 0%, 100% { opacity: 0.8; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.06); } }
/* compact presence: orb demoted so the conversation leads; shrinks with the window */
.dot-wrap { position: relative; display: inline-block; line-height: 0; }
#dot { width: clamp(104px, 17vh, 156px); height: clamp(96px, 16vh, 142px);
  position: relative; z-index: 1; transition: width var(--dur) var(--ease), height var(--dur) var(--ease); }
/* accessory layer: canvas draws the SHARED items (mascot_items.js) over the orb */
#mascot-acc { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; }

/* ── mascot accessories / outfits (locked over the orb) ─────────────────────── */
.mascot-fx { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.acc { position: absolute; left: 50%; transform: translateX(-50%); opacity: 0;
  transition: opacity .35s var(--ease); will-change: opacity, transform, rotate, translate; }
.acc svg { display: block; width: 100%; height: auto; overflow: visible; }
/* tie → work mode: ink + volt, knotted at the LOWER part of the orb, hangs short,
   sits BEHIND the activity props (z-index), and swings with the gaze (--dot-lx) so
   it sways as the orb looks around — plus a gentle idle sway. */
.acc-tie {
  top: 62%; width: 17%; transform-origin: 50% 7%;
  transform: translateX(-50%)
    rotate(calc(var(--dot-lx, 0) * 13deg))
    translateY(calc(var(--dot-ly, 0) * 3px));
}
.mascot-fx.fx-tie .acc-tie { opacity: 1; animation: tie-sway 3.8s ease-in-out infinite; }
@keyframes tie-sway { 0%, 100% { rotate: -4deg; } 50% { rotate: 4deg; } }
/* sleepy cap + zzz → low power (droopy, muted) */
.acc-cap { top: -10%; width: 46%; transform-origin: 30% 100%; }
.mascot-fx.fx-cap .acc-cap { opacity: 1; animation: cap-nod 4.2s ease-in-out infinite; }
@keyframes cap-nod { 0%, 100% { rotate: -13deg; } 50% { rotate: -7deg; } }
.acc-zzz { top: -8%; left: 70%; transform: none; width: 26%; }
.mascot-fx.fx-cap .acc-zzz { animation: zzz-float 3s ease-in-out infinite; }
/* an active activity outfit (gaming/video/…) hides the sleepy low-power cap — you're
   not idle, so the orb shouldn't "nap" mid-game (the controller/etc. shows instead) */
.mascot-fx.has-activity .acc-cap,
.mascot-fx.has-activity .acc-zzz { opacity: 0 !important; animation: none !important; }
@keyframes zzz-float { 0% { opacity: 0; translate: 0 8px; } 35% { opacity: .8; } 100% { opacity: 0; translate: 0 -14px; } }
/* headphones → while music plays (worn on the head, so they track the gaze:
   shift + tilt with --dot-lx/--dot-ly so they move WITH the orb, not float static) */
.acc-hp {
  top: 0%; width: 86%; transform-origin: 50% 72%;
  transform: translateX(-50%)
    translate(calc(var(--dot-lx, 0) * 7px), calc(var(--dot-ly, 0) * -4px))
    rotate(calc(var(--dot-lx, 0) * 6deg));
}
.mascot-fx.show-hp .acc-hp { opacity: 1; }
/* …and the whole head bops to the beat (orb + headphones move together) */
.dot-wrap.bop { animation: head-bop .5s ease-in-out infinite; transform-origin: 50% 80%; }
@keyframes head-bop {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-4px) rotate(-2.5deg); }
  75% { transform: translateY(-2px) rotate(2.5deg); }
}
/* controller → while gaming (held in front, FACE toward the user: a gentle forward
   rotateX so you see the buttons/d-pad presented to you — NOT the back edge facing
   the orb; subtle button-mash wiggle + the head leans in, tense/focused) */
.acc-controller {
  bottom: -2%; width: 60%; transform-origin: 50% 100%;
  transform: translateX(-50%) perspective(420px) rotateX(22deg);
}
.mascot-fx.show-controller .acc-controller { opacity: 1; animation: ctrl-mash 0.55s ease-in-out infinite; }
@keyframes ctrl-mash { 0%, 100% { rotate: -2.5deg; } 50% { rotate: 2.5deg; } }
.dot-wrap.game-focus { animation: game-focus 2.4s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes game-focus {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  20% { transform: translateY(2px) rotate(-1.2deg); }
  60% { transform: translateY(2px) rotate(1.2deg); }
}
/* popcorn → while watching video (gently floats) */
.acc-popcorn { bottom: -2%; left: 24%; width: 30%; transform: none; }
.mascot-fx.show-popcorn .acc-popcorn { opacity: 1; animation: pop-float 2.8s ease-in-out infinite; }
@keyframes pop-float { 0%, 100% { translate: 0 0; rotate: -2deg; } 50% { translate: 0 -5px; rotate: 2deg; } }
/* glasses → while coding (frames the eye, and tilts/shifts with the gaze so it
   tracks where the orb is looking — published as --dot-lx / --dot-ly by dot.js) */
.acc-glasses {
  top: 30%; width: 66%;
  transform: translateX(-50%)
    translate(calc(var(--dot-lx, 0) * 9px), calc(var(--dot-ly, 0) * -6px))
    rotate(calc(var(--dot-lx, 0) * 9deg));
}
.mascot-fx.show-glasses .acc-glasses { opacity: 1; }
/* headset → on a call (sits like the headphones; head gives a soft talking nod —
   and like the headphones it now tracks the gaze so it moves WITH the orb's look) */
.acc-headset {
  top: -2%; width: 88%; transform-origin: 50% 72%;
  transform: translateX(-50%)
    translate(calc(var(--dot-lx, 0) * 7px), calc(var(--dot-ly, 0) * -4px))
    rotate(calc(var(--dot-lx, 0) * 6deg));
}
.mascot-fx.show-headset .acc-headset { opacity: 1; }
.dot-wrap.call-nod { animation: call-nod 3.2s ease-in-out infinite; transform-origin: 50% 80%; }
@keyframes call-nod {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  30% { transform: translateY(1px) rotate(2deg); }
  70% { transform: translateY(1px) rotate(-2deg); }
}
/* paintbrush → creative apps (held low-front, dabbing in a gentle sweep) */
.acc-brush {
  bottom: -8%; left: 40%; width: 22%; transform-origin: 50% 100%;
  transform: translateX(-50%) rotate(-16deg);
}
.mascot-fx.show-brush .acc-brush { opacity: 1; animation: brush-paint 1.6s ease-in-out infinite; }
@keyframes brush-paint {
  0%, 100% { rotate: -9deg; translate: 0 0; }
  50% { rotate: 8deg; translate: 0 -3px; }
}
/* shopping bag → shopping sites (hangs at the front, swings gently) */
.acc-bag { bottom: -4%; left: 62%; width: 30%; transform: none; transform-origin: 46% 4%; }
.mascot-fx.show-bag .acc-bag { opacity: 1; animation: bag-swing 2.6s ease-in-out infinite; }
@keyframes bag-swing { 0%, 100% { rotate: -6deg; } 50% { rotate: 6deg; } }
.caption {
  font-family: "Space Grotesk", sans-serif; font-weight: 500; font-size: 22px;
  letter-spacing: -0.01em; margin-top: 2px; min-height: 28px;
  transition: color var(--dur-slow) var(--ease);
}
.status { margin-top: 2px; min-height: 16px; }

/* drag-and-drop: drop an audio/video file anywhere on the control room to
   transcribe it (the path + transcription are handled natively by pywebview) */
body.dropping::after {
  content: "Drop a file to attach";
  position: fixed; inset: 8px; z-index: 9999; pointer-events: none;
  display: flex; align-items: center; justify-content: center; text-align: center;
  background: rgba(13, 13, 13, 0.86); color: var(--volt);
  font-family: "Space Grotesk", sans-serif; font-size: 19px; letter-spacing: 0.01em;
  border: 2px dashed var(--volt); border-radius: 16px;
  box-shadow: inset 0 0 60px rgba(193, 247, 58, 0.12);
}

/* conversation — min-height:0 lets it fully collapse under pressure so the
   input row + tools always stay on screen (they come after it in the column) */
#convo-wrap { flex: 1 1 auto; min-height: 0; display: flex; }
.convo {
  flex: 1; overflow-y: auto;
  background: var(--graphite); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px; display: flex; flex-direction: column; gap: 10px;
  /* new turns glide into view (the reduced-motion media query flips this to auto) */
  scroll-behavior: smooth;
}
.empty {
  margin: auto; text-align: center; font-size: 13px; line-height: 1.9;
  color: var(--stone); max-width: 460px;
}
/* starter chips: clickable examples in the empty state — the visible text IS the
   command that gets sent, so i18n translations keep working automatically */
.starter-chips { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.schip {
  font-family: "Space Mono", monospace; font-size: 11.5px; letter-spacing: 0.04em;
  color: var(--bone); background: var(--graphite-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 7px 14px; cursor: pointer; line-height: 1.4;
  transition: border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease),
              background var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.schip:hover { border-color: var(--volt); color: var(--volt); transform: translateY(-1px); }
.schip:focus-visible { outline: 2px solid var(--volt); outline-offset: 2px; }
.bubble {
  position: relative;
  max-width: 86%; padding: 10px 14px; border-radius: 12px;
  font-size: 14.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word;
  user-select: text; animation: rise var(--dur-slow) var(--ease) both;
}
/* hover timestamp — a tiny mono time tucked under the bubble (in the 10px row gap),
   invisible until you hover; system rows don't get one */
.bubble::after {
  content: attr(data-t); position: absolute; bottom: -15px; right: 6px;
  font-family: "Space Mono", monospace; font-size: 9.5px; letter-spacing: 0.06em;
  color: var(--stone); opacity: 0; white-space: nowrap; pointer-events: none;
  transition: opacity var(--dur-fast) var(--ease);
}
.bubble.assistant::after { right: auto; left: 6px; }
.bubble.system::after { display: none; }
.bubble:hover::after { opacity: 0.9; }
/* user — quiet neutral, right-aligned, no accent */
.bubble.user { align-self: flex-end; background: var(--graphite-2); border: 1px solid var(--line);
  color: var(--bone); border-radius: 13px 13px 3px 13px; }
/* assistant — the AI's voice gets the brand accent: a volt edge, a faint volt wash,
   and a mini-orb avatar so you instantly know who's speaking */
.bubble.assistant { align-self: flex-start; position: relative; margin-left: 38px;
  background: rgba(193,247,58,0.06); border-left: 2px solid var(--volt);
  border-radius: 3px 13px 13px 3px; color: var(--bone); }
.bubble.assistant::before {
  content: ""; position: absolute; left: -38px; top: 1px; width: 27px; height: 27px; border-radius: 50%;
  background: radial-gradient(circle at 50% 38%, #eaffb0, #c1f73a 48%, #5f8f1c 100%);
  box-shadow: 0 0 12px rgba(193, 247, 58, 0.45);
}
/* system / background actions — clearly NOT a message: centered, dim, mono */
.bubble.system { align-self: center; background: transparent; color: var(--stone);
  font-family: "Space Mono", monospace; font-size: 11.5px; letter-spacing: 0.04em; padding: 2px 8px; }
.bubble .atts { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.att-thumb { max-width: 200px; max-height: 200px; border-radius: 10px; border: 1px solid var(--line);
  display: block; object-fit: cover; cursor: zoom-in; }
.att-file { font-size: 12px; color: var(--stone); font-family: "Space Mono", monospace;
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px; }
.thinking-row { align-self: flex-start; color: var(--stone); font-family: "Space Mono", monospace; font-size: 12px; padding: 2px 4px; display: none; }
.thinking-row.on { display: flex; gap: 4px; align-items: center; }
.thinking-row .d { width: 4px; height: 4px; border-radius: 50%; background: var(--volt); animation: blink 1.1s infinite; }
.thinking-row .d:nth-child(2){ animation-delay: .18s } .thinking-row .d:nth-child(3){ animation-delay: .36s }
@keyframes blink { 0%,60%,100%{opacity:.25} 30%{opacity:1} }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* lightbox: full-size view of an attached image */
.lightbox {
  position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center;
  background: rgba(13, 13, 13, 0.86); backdrop-filter: blur(6px); cursor: zoom-out;
  animation: fade var(--dur-fast) var(--ease) both;
}
.lightbox.hidden { display: none; }
.lightbox img { max-width: 92vw; max-height: 86vh; border-radius: 12px;
  border: 1px solid var(--line); box-shadow: 0 24px 80px rgba(0,0,0,0.6); }
.lb-x { position: absolute; top: 16px; right: 16px; width: 34px; height: 34px; border-radius: 9px;
  background: rgba(34,34,32,0.82); border: 1px solid var(--line); color: var(--bone); cursor: pointer;
  display: grid; place-items: center; font-size: 14px; transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease); }
.lb-x:hover { background: var(--graphite-2); border-color: var(--bone); }
.lb-cap { position: absolute; bottom: 18px; left: 0; right: 0; text-align: center;
  font-family: "Space Mono", monospace; font-size: 11px; letter-spacing: 0.05em; color: var(--stone); pointer-events: none; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ── first-run welcome tour (one-time, skippable, 3 steps) ─────────────────── */
.welcome {
  position: fixed; inset: 0; z-index: 70;
  display: flex; align-items: center; justify-content: center;
  background: rgba(13, 13, 13, 0.72); backdrop-filter: blur(7px);
  animation: fade 0.28s var(--ease) both;
}
.welcome.hidden { display: none; }
.wl-card {
  position: relative; width: min(430px, calc(100vw - 48px));
  background: var(--graphite); border: 1px solid var(--line); border-radius: 18px;
  padding: 30px 30px 22px; overflow: hidden;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  animation: wl-pop 0.42s var(--ease) both;
}
@keyframes wl-pop { from { opacity: 0; transform: translateY(14px) scale(0.97); }
  to { opacity: 1; transform: none; } }
/* a soft volt light spills in from the top — same "living light" as the hero */
.wl-glow {
  position: absolute; left: 50%; top: -70px; transform: translateX(-50%);
  width: 300px; height: 150px; pointer-events: none;
  background: radial-gradient(ellipse 50% 50% at 50% 50%,
      rgba(193,247,58,0.16) 0%, transparent 70%);
}
.wl-step { display: none; min-height: 116px; }
.wl-step.on { display: block; animation: rise var(--dur-slow) var(--ease) both; }
.wl-title { font-family: "Space Grotesk", sans-serif; font-weight: 600;
  font-size: 22px; letter-spacing: -0.02em; margin-bottom: 8px; }
.wl-volt { color: var(--volt); }
.wl-text { font-size: 14px; line-height: 1.65; color: var(--stone); }
.wl-foot { display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-top: 18px; }
.wl-skip { background: transparent; border: none; color: var(--stone);
  cursor: pointer; padding: 8px 4px; transition: color var(--dur-fast) var(--ease); }
.wl-skip:hover { color: var(--bone); }
.wl-skip:focus-visible { outline: 2px solid var(--volt); outline-offset: 2px; border-radius: 6px; }
.wl-dots { display: flex; gap: 6px; }
.wl-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--line);
  transition: background var(--dur) var(--ease), transform var(--dur) var(--ease); }
.wl-dot.on { background: var(--volt); transform: scale(1.25); }
.wl-next {
  font-family: "Space Grotesk", sans-serif; font-weight: 600; font-size: 14px;
  color: var(--ink); background: var(--volt); border: none; border-radius: 10px;
  padding: 9px 18px; cursor: pointer;
  transition: filter var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.wl-next:hover { filter: brightness(1.08); transform: translateY(-1px); }
.wl-next:focus-visible { outline: 2px solid var(--bone); outline-offset: 2px; }

/* pending attachment chip (preview + remove, before sending) */
.attach-row { flex: 0 0 auto; margin-bottom: 8px; }
.attach-row.hidden { display: none; }
.attach-chip {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--graphite); border: 1px solid var(--line); border-radius: 12px;
  padding: 6px 6px 6px 6px; max-width: 100%; animation: rise 0.28s var(--ease) both;
}
.ac-thumb { width: 38px; height: 38px; border-radius: 8px; object-fit: cover; display: block; flex: 0 0 auto; }
.ac-glyph { width: 38px; height: 38px; border-radius: 8px; background: var(--graphite-2);
  display: flex; align-items: center; justify-content: center; font-size: 17px; flex: 0 0 auto; }
.ac-name { font-family: "Space Mono", monospace; font-size: 12px; color: var(--bone);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; padding-left: 2px; }
.ac-x { flex: 0 0 auto; width: 26px; height: 26px; border: none; border-radius: 8px;
  background: transparent; color: var(--stone); cursor: pointer; font-size: 12px;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); }
.ac-x:hover { background: var(--ink); color: #e0533a; }

/* media tool chips on the attachment (palette / convert / resize / compress) */
.attach-actions { margin-top: 8px; }
.ma-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ma-chip { font-family: "Space Mono", monospace; font-size: 11px; letter-spacing: 0.04em;
  color: var(--stone); background: var(--graphite); border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 12px; cursor: pointer; transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease); }
.ma-chip:hover { color: var(--bone); border-color: var(--bone); }
.ma-panel:not(:empty) { margin-top: 9px; }
.ma-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ma-sel, .ma-inp { height: 32px; background: var(--ink); color: var(--bone); border: 1px solid var(--line);
  border-radius: 8px; padding: 0 10px; font-family: "Space Mono", monospace; font-size: 12px; }
.ma-inp { flex: 1; min-width: 140px; }
.ma-inp:focus, .ma-sel:focus { border-color: var(--volt); outline: none; }
.ma-go { height: 32px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--volt);
  background: transparent; color: var(--volt); font-family: "Space Mono", monospace; font-size: 11px;
  letter-spacing: 0.04em; cursor: pointer; transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); }
.ma-go:hover { background: var(--volt); color: var(--ink); }
.ma-hint { font-family: "Space Mono", monospace; font-size: 10px; color: var(--stone); margin-top: 7px; }
.swatches { display: flex; flex-wrap: wrap; gap: 7px; }
.swatch { width: 64px; height: 44px; border-radius: 9px; border: 1px solid var(--line); cursor: pointer;
  position: relative; overflow: hidden; transition: transform .12s var(--ease); }
.swatch:hover { transform: translateY(-2px); }
.swatch span { position: absolute; left: 0; right: 0; bottom: 0; font-family: "Space Mono", monospace;
  font-size: 9px; text-align: center; color: var(--bone); background: rgba(13,13,13,0.6); padding: 1px 0; }

/* ── captions editor ─────────────────────────────────────────────────────── */
#panel.cap-wide { width: min(680px, 96vw); max-width: 96vw; }
/* vertical (portrait) video → two columns: tall preview left, controls right */
#panel.cap-wide.cap-vert { width: min(940px, 97vw); }
.cap-cols { display: flex; gap: 18px; align-items: flex-start; }
.cap-col-l { flex: 0 0 auto; width: 270px; position: sticky; top: 0; align-self: flex-start; }
.cap-col-r { flex: 1 1 auto; min-width: 0; }
.cap-load { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 50px 20px; text-align: center; }
.cap-spin { width: 30px; height: 30px; border: 2px solid var(--line); border-top-color: var(--volt);
  border-radius: 50%; animation: cap-spin 0.8s linear infinite; }
@keyframes cap-spin { to { transform: rotate(360deg); } }
.cap-prevwrap { position: relative; background: #000; border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden; aspect-ratio: 16/9; display: flex; align-items: center; justify-content: center; }
.cap-vert .cap-prevwrap { max-height: 64vh; }
.cap-prev { width: 100%; height: 100%; object-fit: contain; transition: opacity var(--dur-fast) var(--ease); }
.cap-prev.loading { opacity: 0.5; }
.cap-prevwarn { position: absolute; left: 0; right: 0; bottom: 6px; display: flex; align-items: center;
  justify-content: center; text-align: center; padding: 4px 16px; font-size: 10px; color: var(--stone); pointer-events: none; }
/* live HTML caption overlay drawn over the <video> (approximates the burned export) */
/* horizontal padding = the burn's marginL/R (≈6% width); the TOP/BOTTOM offset is set
   in px by _capRenderOverlay (= 7% of HEIGHT) to match libass marginV — CSS % padding
   is width-relative, so it can't express a height-% offset for a vertical preview.
   max-width:100% so the line wraps at the same width the burn does. */
.cap-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end;
  align-items: center; padding: 0 6%; pointer-events: none; }
.cap-ovline { max-width: 100%; text-align: center; font-weight: 800; line-height: 1.18; letter-spacing: .2px;
  text-shadow: 0 0 4px #000, 0 2px 5px rgba(0,0,0,.85), 0 0 2px #000; }
.cap-ovline span { white-space: pre-wrap; }
/* play bar (play/pause + seek) */
.cap-playbar { display: flex; align-items: center; gap: 10px; margin: 9px 2px 4px; }
.cap-playbar input[type=range] { flex: 1; accent-color: var(--volt); }
.cap-playbar .mono { font-size: 11px; min-width: 36px; text-align: right; }
.cap-playbtn { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--graphite); color: var(--volt); font-size: 12px;
  display: flex; align-items: center; justify-content: center; transition: border-color var(--dur-fast) var(--ease); }
.cap-playbtn:hover { border-color: var(--volt); }
/* in-preview play/pause — click anywhere on the video preview to watch it */
.cap-playover { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: transparent; border: 0; padding: 0; cursor: pointer; z-index: 3; }
.cap-povicon { width: 56px; height: 56px; border-radius: 999px; display: flex; align-items: center;
  justify-content: center; font-size: 20px; color: #fff; background: rgba(0,0,0,.46);
  border: 1px solid rgba(255,255,255,.28); box-shadow: 0 2px 12px rgba(0,0,0,.4);
  transition: opacity var(--dur) var(--ease), transform .12s var(--ease); }
.cap-playover:hover .cap-povicon { transform: scale(1.07); }
.cap-playover.playing .cap-povicon { opacity: 0; }            /* hide while playing… */
.cap-playover.playing:hover .cap-povicon { opacity: 1; }      /* …reveal on hover to pause */
/* segmentation tools */
.cap-segtools { margin: 4px 0 10px; }
.cap-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.cap-preset.on { border-color: var(--volt); color: var(--volt); }
.cap-looks { display: flex; flex-wrap: wrap; gap: 6px; }
.cap-checks { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin-top: 10px; }
.cap-checks .cap-check { margin-top: 0; }
.cap-checks .cap-check.sm input[type=color] { width: 34px; height: 24px; padding: 2px; margin-left: 6px;
  border: 1px solid var(--line); border-radius: 6px; background: var(--ink); cursor: pointer; vertical-align: middle; }
/* B / I / U weight toggles + free-position note */
.cap-typorow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.cap-tg { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--ink); color: var(--bone); cursor: pointer; font-size: 13px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; transition: border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); }
.cap-tg:hover { border-color: var(--volt); }
.cap-tg.on { border-color: var(--volt); color: var(--volt); background: rgba(193,247,58,.08); }
.cap-posnote { font-size: 10.5px; margin-left: 4px; }
/* preview caption animation wrapper + preset keyframes (mirror the burned \t/\move/\fad) */
.cap-ovanim { display: inline-block; transform-origin: center; }
@keyframes cap-anim-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes cap-anim-pop { from { transform: scale(.72); } to { transform: scale(1); } }
@keyframes cap-anim-bounce { 0% { transform: scale(.35); } 60% { transform: scale(1.16); } 100% { transform: scale(1); } }
@keyframes cap-anim-zoom { from { transform: scale(.1); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes cap-anim-slide-up { from { transform: translateY(1.1em); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes cap-anim-slide-down { from { transform: translateY(-1.1em); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes cap-anim-slide-left { from { transform: translateX(1.4em); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes cap-anim-slide-right { from { transform: translateX(-1.4em); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes cap-anim-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
/* motion keyframe editor */
.cap-seg.sel { outline: 1px solid var(--volt); outline-offset: -1px; border-radius: 6px; }
.cap-kfcap { font-size: 11px; margin: 2px 0 6px; }
.cap-kftrack { position: relative; height: 26px; background: var(--ink); border: 1px solid var(--line);
  border-radius: 7px; margin-bottom: 8px; }
.cap-kfempty { position: absolute; left: 10px; top: 6px; font-size: 10.5px; color: var(--stone); }
.cap-kfdot { position: absolute; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; padding: 0;
  border-radius: 50%; border: 1px solid var(--bone); background: var(--graphite); cursor: pointer; transition: transform .1s var(--ease); }
.cap-kfdot:hover { transform: scale(1.2); }
.cap-kfdot.on { background: var(--volt); border-color: var(--volt); }
.cap-kfbtns { display: flex; gap: 6px; margin-bottom: 8px; }
.cap-kfedit { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px;
  border: 1px solid var(--line); border-radius: 8px; }
.cap-kfedit label { display: inline-flex; align-items: center; gap: 6px;
  font-family: "Space Mono", monospace; font-size: 11px; color: var(--stone); }
.cap-kfedit input, .cap-kfedit select { height: 28px; width: 64px; background: var(--ink); color: var(--bone);
  border: 1px solid var(--line); border-radius: 7px; padding: 0 6px; font-size: 12px; }
.cap-kfedit select { width: auto; }
/* reel timeline (Phase 3) */
.tl-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.tl-clip { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--graphite);
  border: 1px solid var(--line); border-left: 2px solid var(--volt); border-radius: 8px; }
.tl-idx { width: 16px; text-align: center; color: var(--stone); font-size: 11px; }
.tl-glyph { font-size: 16px; }
.tl-meta { flex: 1; min-width: 0; }
.tl-name { font-size: 12.5px; color: var(--bone); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-trim { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 4px; }
.tl-trim label { display: inline-flex; align-items: center; gap: 4px; font-family: "Space Mono", monospace; font-size: 10.5px; color: var(--stone); }
.tl-trim input { width: 52px; height: 26px; background: var(--ink); color: var(--bone); border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; font-size: 11px; }
.tl-spd input, .tl-trim .tl-spd { width: 46px; }
.tl-mute { width: 28px; height: 26px; border-radius: 6px; border: 1px solid var(--line); background: var(--ink); cursor: pointer; font-size: 12px; line-height: 1; }
.tl-mute.on { border-color: var(--volt); }
.tl-motion { height: 26px; background: var(--ink); color: var(--bone); border: 1px solid var(--line); border-radius: 6px; font-size: 11px; padding: 0 4px; }
.tl-dur { font-size: 10px; }
.tl-ctl { display: flex; align-items: center; gap: 3px; }
.tl-mv, .tl-del { width: 26px; height: 26px; border-radius: 6px; border: 1px solid var(--line); background: var(--ink);
  color: var(--bone); cursor: pointer; font-size: 11px; display: inline-flex; align-items: center; justify-content: center; }
.tl-mv:hover, .tl-del:hover { border-color: var(--volt); color: var(--volt); }
.tl-mv:disabled { opacity: .3; cursor: default; }
.tl-del:hover { border-color: var(--danger, #e0533a); color: var(--danger, #e0533a); }
.tl-progress { height: 6px; background: var(--ink); border: 1px solid var(--line); border-radius: 99px; overflow: hidden; margin-top: 12px; }
.tl-bar { height: 100%; width: 0; background: var(--volt); transition: width var(--dur) var(--ease); }
/* saved projects bar */
.tl-projbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 12px;
  padding-bottom: 12px; border-bottom: 1px solid var(--line-2, var(--line)); }
.tl-projbar select, .tl-projbar input { height: 30px; background: var(--ink); color: var(--bone);
  border: 1px solid var(--line); border-radius: 7px; padding: 0 8px; font-size: 12px; }
.tl-projbar #tl-projsel { flex: 1 1 130px; min-width: 0; }
.tl-projbar #tl-projname { flex: 1 1 120px; min-width: 0; }
.tl-projbar .tl-projdel:hover { border-color: var(--danger, #e0533a); color: var(--danger, #e0533a); }
/* visual multi-track canvas */
.tl-canvas { position: relative; background: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 8px 8px 6px; margin-bottom: 14px; }
/* playhead-preview monitor */
.tl-montop { display: flex; align-items: center; gap: 10px; margin: 0 0 8px 30px; }
.tl-monitor { position: relative; height: 120px; background: #000; border: 1px solid var(--line);
  border-radius: 7px; overflow: hidden; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; }
.tl-monimg { width: 100%; height: 100%; object-fit: contain; transition: opacity .12s var(--ease); }
.tl-monimg.loading { opacity: .5; }
.tl-monempty { position: absolute; font-size: 10px; }
.tl-moninfo { display: flex; flex-direction: column; gap: 2px; }
.tl-montime { font-size: 13px; color: var(--bone); }
.tl-ruler { position: relative; height: 14px; margin: 0 0 4px 30px; cursor: ew-resize; }
.tl-ruler:hover { background: rgba(193,247,58,.04); }
/* scrub playhead line */
.tl-playhead { position: absolute; width: 0; border-left: 1.5px solid #ff4d4d; pointer-events: none; z-index: 5; }
.tl-playhead::before { content: ""; position: absolute; top: -3px; left: -4px; border: 4px solid transparent;
  border-top-color: #ff4d4d; border-bottom: 0; }
.tl-tick { position: absolute; top: 0; transform: translateX(-1px); font-family: "Space Mono", monospace;
  font-size: 9px; color: var(--stone); border-left: 1px solid var(--line); padding-left: 2px; white-space: nowrap; }
.tl-lane { display: flex; align-items: stretch; gap: 6px; margin-bottom: 4px; }
.tl-lanelbl { flex: 0 0 24px; display: flex; align-items: center; justify-content: center;
  font-family: "Space Mono", monospace; font-size: 10px; color: var(--stone); }
.tl-track { position: relative; flex: 1 1 auto; height: 30px; background: var(--graphite);
  border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.tl-blk { position: absolute; top: 2px; bottom: 2px; min-width: 8px; border-radius: 5px; cursor: grab;
  display: flex; align-items: center; padding: 0 5px; box-sizing: border-box; overflow: hidden;
  border: 1px solid rgba(0,0,0,.3); }
.tl-blk:active { cursor: grabbing; }
.tl-blk.dragging { opacity: .7; }
.tl-blk-lbl { font-size: 10px; color: #07120a; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-blk-clip { background: var(--volt); }
.tl-blk-ov { background: #6AA0FF; }
.tl-blk-ov .tl-blk-lbl { color: #06122a; }
.tl-blk-mus { background: #A78BFA; cursor: default; }
.tl-blk-mus .tl-blk-lbl { color: #16092e; }
.tl-blk-vo { background: #5BD6A6; cursor: default; }
.tl-blk-vo .tl-blk-lbl { color: #06281b; }
.tl-blk-mus .tl-blk-lbl, .tl-blk-vo .tl-blk-lbl { text-shadow: 0 1px 2px rgba(255,255,255,.4); }
.tl-blk-aud { background: #A78BFA; cursor: grab; }
.tl-blk-aud:active { cursor: grabbing; }
.tl-blk-aud .tl-blk-lbl { color: #16092e; text-shadow: 0 1px 2px rgba(255,255,255,.4); }
/* magnet / cut toggles: lit when active; cut mode turns the lanes into a cut cursor */
.tl-zoombtn.on { background: var(--volt); color: #07120a; border-color: var(--volt); }
.tl-canvas.cutmode .tl-track, .tl-canvas.cutmode .tl-blk { cursor: crosshair; }
/* a clip shows its own audio as a waveform strip along its bottom (Premiere-style) */
.tl-blk-wave { position: absolute; left: 0; right: 0; bottom: 0; height: 46%; background-size: 100% 100%;
  background-repeat: no-repeat; opacity: .55; pointer-events: none; mix-blend-mode: multiply; }
.tl-blk-clip.has-wave .tl-blk-lbl { align-self: flex-start; margin-top: 2px; }
/* per-track height resize handle (drag a track's bottom edge) */
.tl-lane-resize { position: absolute; left: 0; right: 0; bottom: 0; height: 6px; cursor: ns-resize; z-index: 6; }
.tl-lane-resize:hover { background: rgba(193,247,58,.45); }
/* audio-track rows in the inspector Audio tab */
.tl-audlist { margin-bottom: 8px; }
.tl-aud { background: var(--graphite); border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; margin-bottom: 7px; }
.tl-aud-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
/* horizontal scroll + zoom */
.tl-scroll { overflow-x: auto; overflow-y: hidden; }
.tl-zoomwrap { position: relative; min-width: 100%; }
.tl-zoomctl { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; }
.tl-zoombtn { width: 22px; height: 22px; border-radius: 5px; border: 1px solid var(--line); background: var(--ink);
  color: var(--bone); cursor: pointer; font-size: 13px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
.tl-zoombtn:hover { border-color: var(--volt); color: var(--volt); }
.tl-zoomlbl { font-size: 11px; min-width: 26px; text-align: center; color: var(--stone); }
.tl-blk.sel { outline: 2px solid var(--bone); outline-offset: -1px; box-shadow: 0 0 0 2px rgba(0,0,0,.4); }
.tl-resize { position: absolute; right: 0; top: 0; bottom: 0; width: 8px; cursor: ew-resize; z-index: 1; }
.tl-resize::after { content: ""; position: absolute; right: 2px; top: 28%; bottom: 28%; width: 2px;
  background: rgba(0,0,0,.5); border-radius: 2px; }
.tl-resize-l { right: auto; left: 0; }
.tl-resize-l::after { right: auto; left: 2px; }
.tl-blk-mus .tl-resize { display: none; }
.tl-empty { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); font-size: 10px; color: var(--stone); }
.tl-canvashint { font-size: 10px; margin: 4px 0 0 30px; }
.tl-clip.sel, .tl-ov.sel { box-shadow: 0 0 0 1px var(--volt); }
.tl-drag { cursor: grab; color: var(--stone); font-size: 13px; user-select: none; touch-action: none; }
.tl-drag:active { cursor: grabbing; }
.tl-clip.tl-dragging { opacity: .5; }
.tl-clip.tl-drop { box-shadow: inset 0 2px 0 var(--volt); }
.tl-split { width: 26px; height: 26px; border-radius: 6px; border: 1px solid var(--line); background: var(--ink);
  color: var(--bone); cursor: pointer; font-size: 11px; display: inline-flex; align-items: center; justify-content: center; }
.tl-split:hover { border-color: var(--volt); color: var(--volt); }
.tl-ovlist { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.tl-ov { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--graphite);
  border: 1px solid var(--line); border-radius: 8px; }
.tl-ovgrid { display: flex; flex-wrap: wrap; gap: 4px 8px; margin-top: 4px; }
.tl-ovgrid label { display: inline-flex; align-items: center; gap: 3px; font-family: "Space Mono", monospace; font-size: 10px; color: var(--stone); }
.tl-ovgrid input { width: 46px; height: 24px; background: var(--ink); color: var(--bone); border: 1px solid var(--line); border-radius: 6px; padding: 0 5px; font-size: 11px; }
.tl-music { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px;
  padding: 8px 10px; background: var(--graphite); border: 1px solid var(--line); border-radius: 8px; }
.tl-musicctl { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 8px; }
.tl-musicctl label { display: inline-flex; align-items: center; gap: 8px; font-family: "Space Mono", monospace; font-size: 11px; color: var(--stone); }
.tl-musicctl input[type=range] { width: 130px; accent-color: var(--volt); }
.cap-seground { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.cap-seground label { display: inline-flex; align-items: center; gap: 6px;
  font-family: "Space Mono", monospace; font-size: 11px; color: var(--stone); }
.cap-seground input[type=number] { width: 58px; height: 30px; background: var(--ink); color: var(--bone);
  border: 1px solid var(--line); border-radius: 8px; padding: 0 8px; font-size: 12px; }
.cap-check.sm { margin-top: 0; font-size: 11px; }
.cap-slider { display: flex; align-items: center; gap: 10px; margin: 9px 2px 4px; }
.cap-slider input[type=range] { flex: 1; accent-color: var(--volt); }
.cap-slider .mono { font-size: 11px; min-width: 36px; text-align: right; }
.cap-translate { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.pbtn.sm { padding: 5px 11px; font-size: 11px; }
.cap-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px 12px; }
.cap-grid label { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-family: "Space Mono", monospace; font-size: 11px; color: var(--stone); }
.cap-grid select, .cap-grid input { height: 32px; background: var(--ink); color: var(--bone);
  border: 1px solid var(--line); border-radius: 8px; padding: 0 8px; font-size: 12px; max-width: 130px; }
.cap-grid input[type=number] { width: 70px; }
.cap-grid input[type=color] { width: 40px; padding: 2px; cursor: pointer; }
.cap-check { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px;
  font-family: "Space Mono", monospace; font-size: 11.5px; color: var(--bone); cursor: pointer; }
.cap-check input { accent-color: var(--volt); }
#cap-spklist { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.cap-spkrow { display: flex; align-items: center; gap: 8px; }
.cap-spkcol { width: 34px; height: 30px; padding: 2px; border: 1px solid var(--line); border-radius: 7px; background: var(--ink); cursor: pointer; }
.cap-spkname { flex: 1; height: 30px; background: var(--ink); color: var(--bone); border: 1px solid var(--line);
  border-radius: 8px; padding: 0 10px; font-size: 13px; }
.cap-spkdel { width: 30px; height: 30px; border: 1px solid var(--line); background: transparent; color: var(--stone);
  border-radius: 8px; cursor: pointer; }
.cap-spkdel:hover { color: #e0533a; border-color: #e0533a; }
.cap-seglist { display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow-y: auto; padding-right: 2px; }
.cap-seg { display: flex; align-items: center; gap: 8px; }
.cap-t { flex: 0 0 auto; width: 40px; font-size: 10px; color: var(--stone); background: none; border: none;
  padding: 3px 0; cursor: pointer; text-align: left; font-family: "Space Mono", monospace;
  transition: color .12s var(--ease); }
.cap-t:hover { color: var(--volt); text-decoration: underline; }
/* segment list grouped by source clip (multi-clip reels) */
.cap-cliphdr { display: flex; align-items: center; gap: 8px; margin: 13px 0 5px; padding-bottom: 4px;
  border-bottom: 1px solid var(--line); }
.cap-cliphdr:first-child { margin-top: 2px; }
.cap-clipnum { flex: 0 0 auto; width: 18px; height: 18px; border-radius: 5px; background: var(--volt);
  color: var(--ink); font-size: 10px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.cap-clipname { font-size: 11.5px; color: var(--bone); font-weight: 600; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; flex: 1 1 auto; min-width: 0; }
.cap-clipcount { flex: 0 0 auto; font-size: 10px; }
.cap-clipnone { flex: 0 0 auto; font-size: 10px; font-style: italic; }
.cap-text { flex: 1; min-width: 0; height: 32px; background: var(--graphite-2); color: var(--bone);
  border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; font-size: 13px; }
.cap-text:focus { border-color: var(--volt); outline: none; }
.cap-spk { flex: 0 0 auto; height: 32px; background: var(--ink); color: var(--bone); border: 1px solid var(--line);
  border-radius: 8px; padding: 0 6px; font-size: 11px; max-width: 96px; }
.cap-del { flex: 0 0 auto; width: 30px; height: 30px; border: none; background: transparent; color: var(--stone);
  border-radius: 8px; cursor: pointer; }
.cap-del:hover { color: #e0533a; background: var(--ink); }

/* input */
#inputbar { flex: 0 0 auto; display: flex; gap: 8px; align-items: center; }
.iconbtn {
  flex: 0 0 auto; width: 44px; height: 44px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--graphite); color: var(--stone);
  font-size: 17px; cursor: pointer; transition: border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.iconbtn:hover { border-color: var(--bone); color: var(--bone); }
#text {
  flex: 1; height: 44px; background: var(--graphite); color: var(--bone);
  border: 1px solid var(--line); border-radius: 999px; padding: 0 20px;
  font-family: "Inter", sans-serif; font-size: 15px; outline: none;
  transition: border-color var(--dur-fast) var(--ease);
}
#text::placeholder { color: var(--stone); }
#text:focus { border-color: var(--volt); }
.sendbtn {
  flex: 0 0 auto; height: 44px; padding: 0 22px; border-radius: 999px;
  border: 1px solid var(--volt); background: transparent; color: var(--volt);
  font-size: 13px; cursor: pointer; transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.sendbtn:hover { background: var(--volt); color: var(--ink); }
.sendbtn:disabled { opacity: .5; cursor: default; }

/* ── unified bottom dock: composer + tools + modes on ONE surface ───────────── */
#dock {
  flex: 0 0 auto; position: relative; background: var(--graphite); border: 1px solid var(--line);
  border-radius: 18px; padding: 10px 12px; transition: border-color var(--dur-fast) var(--ease);
}
/* "/" command palette — floats above the composer */
.cmdpalette {
  position: absolute; left: 0; right: 0; bottom: calc(100% + 8px);
  background: var(--ink); border: 1px solid var(--line); border-radius: 14px;
  padding: 6px; max-height: 320px; overflow-y: auto; z-index: 30;
  box-shadow: 0 -14px 40px rgba(0, 0, 0, 0.55); animation: rise 0var(--dur-fast) var(--ease) both;
}
.cmdpalette.hidden { display: none; }
.cmd-hint { font-family: "Space Mono", monospace; font-size: 10px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--stone); padding: 6px 10px 5px; }
.cmd-item { display: flex; align-items: baseline; gap: 10px; padding: 9px 11px;
  border-radius: 9px; cursor: pointer; }
.cmd-item .cl { font-size: 14px; color: var(--bone); }
.cmd-item .ch { margin-left: auto; font-family: "Space Mono", monospace; font-size: 10.5px; color: var(--stone); }
.cmd-item.active, .cmd-item:hover { background: var(--graphite-2); }
.cmd-item.active .cl { color: var(--volt); }
.cmd-empty { padding: 12px 11px; color: var(--stone); font-family: "Space Mono", monospace; font-size: 12px; }
#dock:focus-within { border-color: rgba(193, 247, 58, 0.5); }
#dock #inputbar { gap: 10px; }
/* composer reads as part of the dock: borderless field + ghost attach button */
#dock #text { background: transparent; border: none; border-radius: 0; height: 40px; padding: 0 2px; }
#dock #text:focus { border: none; }
#dock .iconbtn { background: transparent; border: none; color: var(--stone); width: 38px; height: 38px; }
#dock .iconbtn:hover { color: var(--bone); }
#dock .sendbtn { height: 38px; }
.dock-sep { height: 1px; background: var(--line-2); margin: 10px 2px; }
.dock-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; }

/* tool bar — now the left group of the dock's second row */
#tools { flex: 0 0 auto; display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-start; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: "Space Mono", monospace; font-size: 12px; letter-spacing: 0.06em;
  color: var(--stone); background: transparent; border: 1px solid var(--line);
  border-radius: 999px; padding: 7px 15px; cursor: pointer;
  transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.chip svg { flex: 0 0 auto; display: block; opacity: 0.75; transition: opacity var(--dur-fast) var(--ease); }
.chip:hover svg { opacity: 1; }
.chip:hover { color: var(--bone); border-color: var(--bone); }
.chip.on { color: var(--volt); border-color: var(--volt); }

/* behavior controls — backgroundless, dissolve into the black canvas. Each is a
   node-colored status dot + label (hollow/dim off → filled+glowing on). ─────── */
.behaviors { flex: 0 0 auto; display: flex; flex-wrap: wrap; gap: 4px 18px; justify-content: center; align-items: center; padding: 2px 0; }
.behaviors:empty { display: none; }
/* in the dock, modes sit on the RIGHT of the tools row */
.dock-row #behaviors { margin-left: auto; }
.bctl {
  --bcat: var(--volt);
  display: inline-flex; align-items: center; gap: 9px;
  background: none; border: none; padding: 5px 2px; cursor: pointer;
  font-family: "Space Mono", monospace; font-size: 11.5px; letter-spacing: 0.07em;
  color: var(--stone); transition: color var(--dur-fast) var(--ease);
}
.bctl:hover { color: var(--bone); }
.bctl:hover .bdot { opacity: 1; }
.bdot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  background: transparent; border: 1.5px solid var(--bcat); opacity: 0.55;
  transition: background var(--dur) var(--ease), box-shadow var(--dur) var(--ease), opacity var(--dur) var(--ease);
}
.bctl.on { color: var(--bone); }
.bctl.on .bdot { background: var(--bcat); border-color: var(--bcat); opacity: 1; box-shadow: 0 0 9px var(--bcat); }
.bctl.busy { opacity: 0.5; pointer-events: none; }
/* keep pill + mode labels on one line in ANY language — the flex rows above use
   flex-wrap, so a longer translation wraps the whole chip instead of breaking it */
.chip, .bctl, .blabel { white-space: nowrap; }
.bell-ic { display: block; }

/* settings menu (slide-over) — a list of config entries */
.set-list { display: flex; flex-direction: column; gap: 2px; }
.set-row {
  display: flex; align-items: center; gap: 13px; width: 100%; text-align: left;
  background: none; border: none; border-radius: 0; border-bottom: 1px solid var(--line-2);
  padding: 13px 4px; cursor: pointer; color: var(--bone);
  transition: color var(--dur-fast) var(--ease);
}
.set-row:last-child { border-bottom: none; }
/* bordered-row rhythm (not floating-card soup) — hover brightens the row, no fill */
.set-row:hover .set-name { color: #fff; }
.set-row:hover .set-arrow { color: var(--bone); }
.set-ic { width: 30px; height: 30px; flex-shrink: 0; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 9px; color: var(--volt); font-size: 15px; }
.set-main { flex: 1 1 auto; min-width: 0; }
.set-name { display: block; font-size: 14px; color: var(--bone); }
.set-desc { display: block; font-family: "Space Mono", monospace; font-size: 10.5px; color: var(--stone); margin-top: 2px; }
.set-arrow { color: var(--stone); font-size: 15px; flex-shrink: 0; }
.set-sec { font-family: "Space Mono", monospace; font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--stone); margin: 14px 4px 6px; }

/* settings → microphone picker */
.set-mic-wrap { padding: 0 4px; }
.set-mic {
  width: 100%; appearance: none; -webkit-appearance: none;
  background: rgba(255,255,255,0.04); color: var(--bone);
  border: 1px solid rgba(255,255,255,0.12); border-radius: 8px;
  padding: 10px 30px 10px 12px; font: inherit; font-size: 13px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23c1f73a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.set-mic:hover { border-color: rgba(193,247,58,0.5); }
.set-mic:focus { outline: none; border-color: var(--volt); }
.set-mic option { background: var(--ink); color: var(--bone); }

/* settings — grouped preference rows (toggle switch + volume slider) */
.cfg-list { display: flex; flex-direction: column; gap: 0; padding: 0 4px; }
.cfg-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: none; border: none; border-bottom: 1px solid var(--line-2); padding: 12px 2px; color: var(--bone); }
.cfg-row:last-child { border-bottom: none; }
.cfg-row .set-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cfg-toggle { cursor: pointer; }
.cfg-toggle:hover .set-name { color: #fff; }
.cfg-sw { flex: 0 0 auto; width: 38px; height: 22px; border-radius: 999px; background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.14); position: relative;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease); }
.cfg-knob { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--stone); transition: transform var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease); }
.cfg-toggle.on .cfg-sw { background: rgba(193,247,58,0.22); border-color: var(--volt); }
.cfg-toggle.on .cfg-knob { transform: translateX(16px); background: var(--volt); box-shadow: 0 0 8px rgba(193,247,58,0.6); }
.cfg-sliderwrap { flex: 0 0 auto; display: flex; align-items: center; gap: 9px; }
.cfg-slider { -webkit-appearance: none; appearance: none; width: 108px; height: 4px; border-radius: 99px;
  background: rgba(255,255,255,0.14); outline: none; cursor: pointer; }
.cfg-slider::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 15px; height: 15px;
  border-radius: 50%; background: var(--volt); cursor: pointer; box-shadow: 0 0 6px rgba(193,247,58,0.5); }
.cfg-val { font-family: "Space Mono", monospace; font-size: 11px; color: var(--stone); min-width: 34px; text-align: right; }

/* indicators — compact live status, tucked into the top strip's right cluster */
#indicators {
  flex: 0 0 auto; display: flex; align-items: center; gap: 14px; max-width: 46vw; overflow: hidden;
  font-family: "Space Mono", monospace; font-size: 10.5px; letter-spacing: 0.05em; color: var(--stone);
}
.ind { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
/* exception-based status (v1.57): indicators only speak when something's OFF-nominal.
   "full power" said nothing useful — the power chip now hides unless power is LOW. */
.ind.quiet { display: none; }
.ind .led { width: 7px; height: 7px; border-radius: 50%; background: var(--stone); transition: background var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.ind.on .led { background: var(--volt); box-shadow: 0 0 7px rgba(193,247,58,0.7); }
.ind.warn .led { background: #e0a030; box-shadow: 0 0 7px rgba(224,160,48,0.6); }
#ind-integrations { gap: 11px; }
#ind-integrations:empty { display: none; }
#ind-integrations .it { color: var(--stone); }
#ind-integrations .it.on { color: var(--bone); }

/* ── slide-over panel (v1.57: the ONE skeleton every panel inherits) ────── */
#scrim {
  position: fixed; top: var(--topbar-h); left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.45); backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none;
  transition: opacity var(--dur) var(--ease); z-index: 40;
}
#scrim.on { opacity: 1; pointer-events: auto; }
#panel {
  position: fixed; top: var(--topbar-h); right: 0; height: calc(100% - var(--topbar-h));
  width: min(440px, 86vw);
  background: var(--graphite); border-left: 1px solid var(--line);
  box-shadow: var(--elev-2);
  transform: translateX(100%); transition: transform var(--dur-slow) var(--ease); z-index: 50;
  display: flex; flex-direction: column;
}
#panel.on { transform: none; }
/* fully remove the panel after it slides out so WebView2 can't leave a ghost
   of its content painted over the composer (the "text box collapse" glitch) */
#panel.gone { display: none; }
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 14px 14px 22px; border-bottom: 1px solid var(--line);
}
.panel-head h2 { display: inline-flex; align-items: center; gap: 11px;
  font-family: "Space Grotesk", sans-serif; font-weight: 500; font-size: 17px; letter-spacing: -0.01em; }
/* brand tick — a small volt bar before every panel title (echoes the wordmark dot) */
.panel-head h2::before { content: ""; flex: 0 0 auto; width: 3px; height: 15px;
  background: var(--volt); border-radius: 2px; }
.panel-body { flex: 1; overflow-y: auto; padding: 18px 22px; user-select: text; }
/* content settles in just after the slide — replays on each open (display:none reset) */
#panel.on .panel-body { animation: rise var(--dur-slow) var(--ease) both; }
.panel-body .row { padding: 11px 0; border-bottom: 1px solid var(--line-2); }
.panel-body .row:last-child { border-bottom: none; }
.panel-body .k { font-family: "Space Mono", monospace; font-size: 12px; color: var(--volt); letter-spacing: 0.05em; }
.panel-body .v { color: var(--bone); font-size: 14px; margin-top: 3px; }
.panel-body .muted { color: var(--stone); font-size: 13px; }
.panel-body .cmd {
  font-family: "Space Mono", monospace; font-size: 12.5px; color: var(--bone);
  background: var(--ink); border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 12px; margin: 6px 0; cursor: pointer; transition: border-color var(--dur-fast) var(--ease);
}
.panel-body .cmd:hover { border-color: var(--volt); }
.panel-body h3 { font-family: "Space Grotesk", sans-serif; font-weight: 500; font-size: 14px; color: var(--stone); margin: 16px 0 6px; letter-spacing: 0.02em; }
.panel-body h3:first-child { margin-top: 0; }
.panel-body .toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.panel-body .toggle-row .label .v { font-size: 14.5px; }
.panel-body .toggle-row .label .muted { font-size: 12.5px; margin-top: 2px; }
.switch {
  flex: 0 0 auto; width: 46px; height: 26px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--ink); cursor: pointer;
  position: relative; transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px;
  border-radius: 50%; background: var(--stone);
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease);
}
.switch.on { background: var(--volt); border-color: var(--volt); }
.switch.on::after { transform: translateX(20px); background: var(--ink); }
.switch.busy { opacity: .55; cursor: default; }

/* ── config editor panels (commands / goals) ───────────────────────────── */
.seg { display:flex; gap:6px; flex-wrap:wrap; margin-bottom:18px; }
.seg button {
  font-family:"Space Mono", monospace; font-size:11.5px; letter-spacing:0.06em;
  color:var(--stone); background:transparent; border:1px solid var(--line);
  border-radius:999px; padding:6px 13px; cursor:pointer;
  transition:color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.seg button:hover { color:var(--bone); border-color:var(--bone); }
.seg button.on { color:var(--volt); border-color:var(--volt); }

.sectlabel { font-family:"Space Mono", monospace; font-size:11px; letter-spacing:0.08em;
  color:var(--stone); text-transform:uppercase; margin:0 0 9px; }

.field { margin:0 0 13px; }
.field > label { display:block; font-family:"Space Mono", monospace; font-size:11px;
  letter-spacing:0.04em; color:var(--stone); margin-bottom:5px; }
.field input, .field textarea, .field select {
  width:100%; background:var(--ink); color:var(--bone);
  border:1px solid var(--line); border-radius:8px; padding:10px 12px;
  font-family:"Inter", sans-serif; font-size:14px; outline:none;
  transition:border-color var(--dur-fast) var(--ease);
}
.field select { cursor:pointer; }
.field textarea { resize:vertical; min-height:80px;
  font-family:"Space Mono", monospace; font-size:12.5px; line-height:1.5; }
.field input:focus, .field textarea:focus, .field select:focus { border-color:var(--volt); }
.field .with-btn { display:flex; gap:8px; }
.field .with-btn input, .field .with-btn select { flex:1; }
.fieldrow { display:flex; gap:10px; }
.fieldrow .field { flex:1; min-width:0; }

.pbtn {
  font-family:"Space Mono", monospace; font-size:12px; letter-spacing:0.04em;
  color:var(--bone); background:transparent; border:1px solid var(--line);
  border-radius:999px; padding:9px 16px; cursor:pointer; white-space:nowrap;
  transition:background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.pbtn:hover { border-color:var(--bone); }
.pbtn.primary { border-color:var(--volt); color:var(--volt); }
.pbtn.primary:hover { background:var(--volt); color:var(--ink); }
.pbtn.danger:hover { border-color:#e0553a; color:#e0553a; }
.btnrow { display:flex; gap:8px; flex-wrap:wrap; margin-top:6px; }

.formcard { background:var(--graphite-2); border:1px solid var(--line);
  border-radius:12px; padding:16px; margin-top:6px; }
.savednote { color:var(--volt); font-family:"Space Mono", monospace; font-size:11.5px;
  margin-top:10px; min-height:14px; }
.savednote.err { color:#e0553a; }

/* studios (captions / deliver) + device-manager badge */
.with-btn { display:flex; gap:8px; }
.with-btn input, .with-btn select { flex:1; min-width:0; }
.field2 { display:flex; gap:10px; }
.field2 .field { flex:1; min-width:0; margin-bottom:0; }
.chk { display:flex; align-items:center; gap:8px; font-family:"Space Mono", monospace;
  font-size:12px; color:var(--bone); margin:8px 0 0; cursor:pointer; }
.chk input { accent-color:var(--volt); width:15px; height:15px; flex:0 0 auto; }

/* autoclicker & key inputs */
.ai-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(108px, 1fr));
  gap:10px; margin-bottom:6px; }
.ai-grid .field { margin-bottom:0; }
.ai-input { margin-top:10px; border-left:2px solid var(--volt); }
.ai-row1 { display:flex; align-items:center; gap:10px; margin-bottom:12px; }
.ai-row1 .ai-name { flex:1; min-width:0; background:var(--ink); color:var(--bone);
  border:1px solid var(--line); border-radius:8px; padding:9px 12px;
  font-family:"Inter", sans-serif; font-size:14px; outline:none; }
.ai-row1 .ai-name:focus { border-color:var(--volt); }
.ai-row1 .chk { margin:0; flex:0 0 auto; }
.ai-hk { flex:1; min-width:0; display:flex; align-items:center;
  font-family:"Space Mono", monospace; font-size:12.5px; color:var(--volt);
  background:var(--ink); border:1px solid var(--line); border-radius:8px;
  padding:9px 12px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

.media-pick { display:flex; flex-direction:column; gap:10px; }
.media-info { display:flex; align-items:center; flex-wrap:wrap; gap:10px; min-height:24px; }
/* caption studio — carousel thumbnail strip */
.cap-strip { flex:0 0 100%; display:flex; flex-wrap:wrap; gap:8px; }
.cap-chip { position:relative; width:56px; height:56px; border-radius:8px; overflow:hidden;
  background:var(--graphite, #1c1c1a); border:1px solid var(--line); flex:0 0 auto; }
.cap-chip img { width:100%; height:100%; object-fit:cover; display:block; }
.cap-glyph { display:flex; align-items:center; justify-content:center; width:100%; height:100%; font-size:22px; }
.cap-chipx { position:absolute; top:2px; right:2px; width:18px; height:18px; padding:0; border:none;
  border-radius:50%; background:rgba(0,0,0,.62); color:#fff; font-size:11px; line-height:1; cursor:pointer; }
.cap-chipx:hover { background:rgba(0,0,0,.85); }
.cap-striplabel { flex:0 0 100%; font-size:12px; }
.cap-pack { background:var(--ink); border:1px solid var(--line); border-radius:10px;
  padding:12px 14px; margin:8px 0 4px; max-height:320px; overflow:auto;
  white-space:pre-wrap; word-break:break-word; font-family:"Space Mono", monospace;
  font-size:12.5px; line-height:1.55; color:var(--bone); }
.cap-hdr { color:var(--volt); font-weight:700; }
.it-name .imp { font-family:"Space Mono", monospace; font-size:10.5px;
  border:1px solid var(--line); border-radius:6px; padding:1px 6px; margin-left:6px;
  vertical-align:middle; color:var(--stone); }

/* wake words (voice triggers in the shortcuts panel) */
.wake-list { display:flex; flex-wrap:wrap; gap:7px; align-items:center; }
.wake-chip { display:inline-flex; align-items:center; gap:5px; background:var(--ink);
  border:1px solid var(--line); border-radius:999px; padding:5px 6px 5px 12px;
  font-family:"Space Mono", monospace; font-size:12px; color:var(--bone); }
.wake-chip.ro { padding:4px 11px; color:var(--stone); }
.wc-x { width:20px; height:20px; border:none; border-radius:50%; background:transparent;
  color:var(--stone); cursor:pointer; font-size:10px; line-height:1;
  transition:background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); }
.wc-x:hover { background:var(--graphite); color:#e0553a; }
.wake-defs { margin-top:14px; }
.wake-defs summary { font-family:"Space Mono", monospace; font-size:11px; color:var(--stone);
  cursor:pointer; letter-spacing:0.04em; list-style:none; }
.wake-defs summary::-webkit-details-marker { display:none; }
.wake-defs summary::before { content:"▸ "; }
.wake-defs[open] summary::before { content:"▾ "; }
.wake-defs summary:hover { color:var(--bone); }
.wake-defs .wake-list { margin-top:10px; }

.itemlist { display:flex; flex-direction:column; gap:6px; margin:0 0 18px; }
.item { display:flex; align-items:center; justify-content:space-between; gap:10px;
  background:var(--ink); border:1px solid var(--line); border-radius:10px;
  padding:10px 13px; cursor:pointer; transition:border-color var(--dur-fast) var(--ease); }
.item:hover { border-color:var(--stone); }
.item.sel { border-color:var(--volt); }
.item .it-main { min-width:0; }
.item .it-name { color:var(--bone); font-size:14px; }
.item .it-sub { color:var(--stone); font-size:12px; font-family:"Space Mono", monospace;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:230px; margin-top:2px; }
.item .it-actions { display:flex; gap:6px; align-items:center; flex:0 0 auto; }
.item .it-actions .imp { font-family:"Space Mono", monospace; font-size:11px; color:var(--volt);
  border:1px solid var(--line); border-radius:6px; padding:2px 7px; }
.iconbtn-sm { width:30px; height:30px; border-radius:8px; border:1px solid var(--line);
  background:transparent; color:var(--stone); cursor:pointer; font-size:13px;
  transition:color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease); }
.iconbtn-sm:hover { color:var(--bone); border-color:var(--bone); }
.iconbtn-sm.danger:hover { color:#e0553a; border-color:#e0553a; }

/* goals */
.statsbar { display:flex; gap:22px; margin-bottom:16px; }
.statsbar .stat { display:flex; flex-direction:column; gap:2px; }
.statsbar .stat .n { font-family:"Space Grotesk", sans-serif; font-weight:600;
  font-size:24px; line-height:1; color:var(--bone); }
.statsbar .stat .n.volt { color:var(--volt); }
.statsbar .stat .l { font-family:"Space Mono", monospace; font-size:10px;
  letter-spacing:0.06em; color:var(--stone); text-transform:uppercase; }

.goal { display:flex; align-items:flex-start; gap:11px; background:var(--ink);
  border:1px solid var(--line); border-radius:10px; padding:11px 13px; }
.goal .check { width:18px; height:18px; border-radius:50%; border:1.5px solid var(--stone);
  flex:0 0 auto; margin-top:1px; cursor:pointer; position:relative;
  transition:background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease); }
.goal .check:hover { border-color:var(--volt); }
.goal.done .check { background:var(--volt); border-color:var(--volt); }
.goal.done .check::after { content:"\2713"; position:absolute; inset:0; color:var(--ink);
  font-size:11px; line-height:15px; text-align:center; }
.goal .g-main { flex:1; min-width:0; }
.goal .g-title { color:var(--bone); font-size:14.5px; word-break:break-word; }
.goal.done .g-title { color:var(--stone); text-decoration:line-through; }
.goal .g-meta { font-family:"Space Mono", monospace; font-size:11px; color:var(--stone); margin-top:3px; }
.goal .g-meta .over { color:#e0553a; }
.goal .g-meta .today { color:var(--volt); }
.goal .g-meta .hi { color:var(--volt); }
.goal .g-actions { display:flex; gap:6px; flex:0 0 auto; }
.toggle-done { font-family:"Space Mono", monospace; font-size:11px; color:var(--stone);
  letter-spacing:0.05em; cursor:pointer; margin:14px 0 8px; display:inline-block; }
.toggle-done:hover { color:var(--bone); }

/* ── capabilities catalog ───────────────────────────────────────────────── */
.cap-group { margin-bottom: 22px; }
.cap-head { display:flex; align-items:center; gap:9px; font-family:"Space Grotesk", sans-serif;
  font-weight:500; font-size:15px; color:var(--bone); margin-bottom:10px;
  padding-bottom:7px; border-bottom:1px solid var(--line-2); }
.cap-icon { font-size:15px; }
.cap-item { margin:0 0 12px; padding-left:2px; }
.cap-name { color:var(--bone); font-size:14px; }
.cap-desc { color:var(--stone); font-size:12.5px; line-height:1.5; margin-top:2px; }
.cap-says { display:flex; flex-wrap:wrap; gap:6px; margin-top:7px; }
.say-chip { font-family:"Space Mono", monospace; font-size:11px; color:var(--volt);
  background:var(--ink); border:1px solid var(--line); border-radius:999px;
  padding:4px 11px; cursor:pointer; transition:background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); }
.say-chip:hover { background:var(--volt); color:var(--ink); }

/* toast */
#toast {
  position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 16px);
  background: var(--graphite-2); border: 1px solid var(--line); color: var(--bone);
  font-family: "Space Mono", monospace; font-size: 12px; letter-spacing: 0.04em;
  padding: 10px 18px; border-radius: 999px; opacity: 0; pointer-events: none;
  box-shadow: var(--elev-1);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease); z-index: 60;
}
#toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ── accessibility: keyboard focus + reduced motion ─────────────────────── */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--volt);
  outline-offset: 2px;
  border-radius: 6px;
}
#text:focus-visible { outline: none; }   /* the input already shows a volt border */

/* press feedback (v1.57) — one subtle uniform dip on every primary control */
.winbtn:active, .chip:active, .pbtn:active, .sendbtn:active, .iconbtn:active,
.hub-tab:active, .schip:active, .bctl:active, .tc-btn:active, .ma-chip:active,
.say-chip:active, .wl-next:active { transform: scale(0.96); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
/* the in-app Settings → "Reduce animations" toggle applies the SAME calm to the
   whole UI (not just the orb) — toggled as a body class by setReduceMotion */
body.reduce-motion *, body.reduce-motion *::before, body.reduce-motion *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
  scroll-behavior: auto !important;
}

/* responsive: clean from a phone-narrow window up to fullscreen on a 4K panel */
@media (max-width: 720px) { #stage { max-width: none; } }
@media (max-width: 680px) { #indicators { display: none; } }   /* keep the strip uncrowded */
@media (max-width: 560px) {
  #stage { padding: 10px 14px 14px; gap: 10px; }
  .caption { font-size: 18px; }
  .topstate { display: none; }
  #tools { gap: 6px; }
  .chip { padding: 6px 10px; }
}
@media (max-width: 420px) {
  .winbtn { width: 30px; }
  .caption { font-size: 16px; }
}
/* short windows: collapse the hero hard so the composer + tools never clip */
@media (max-height: 620px) { #hero { padding-top: 2px; } .caption { font-size: 18px; } }
@media (max-height: 520px) {
  .hero-halo { display: none; }
  #dot { width: clamp(84px, 14vh, 120px); height: clamp(78px, 13vh, 110px); }
  .caption { font-size: 16px; margin-top: 0; }
  .status { display: none; }
  #stage { gap: 8px; padding-top: 8px; }
}
@media (max-height: 420px) {
  #indicators { display: none; }
  .caption { display: none; }
}
/* very large windows: a touch more breathing room, content stays centered */
@media (min-width: 1500px) { #stage { max-width: 1040px; } }

/* ── transfer card (import / deliver progress) ──────────────────────────── */
.transfer-card {
  background: var(--graphite);
  border: 1px solid var(--line);
  border-left: 2px solid var(--volt);     /* same accent as an AI message → "Wivexx is doing this" */
  border-radius: 3px 14px 14px 3px;
  padding: 13px 15px 14px;
  margin: 0 0 12px;
  animation: tc-in 0.35s var(--ease);
}
.transfer-card.hidden { display: none; }
@keyframes tc-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.tc-head { display: flex; align-items: center; gap: 10px; }
.tc-title {
  display: flex; align-items: center; gap: 8px;
  font-family: "Space Mono", monospace; font-size: 10.5px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--stone);
}
.tc-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--volt);
  box-shadow: 0 0 9px var(--volt); animation: tc-pulse 1var(--dur-slow) var(--ease) infinite; }
.tc-dot.paused { background: var(--stone); box-shadow: none; animation: none; }
.tc-dot.done { background: var(--volt); animation: none; }
@keyframes tc-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }
.tc-drive {
  flex: 1; min-width: 0; font-family: "Space Grotesk", sans-serif; font-weight: 500; font-size: 15px;
  color: var(--bone); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tc-x { width: 24px; height: 24px; border: none; background: transparent; color: var(--stone);
  border-radius: 6px; cursor: pointer; font-size: 12px; flex: none; }
.tc-x:hover { background: var(--graphite-2); color: var(--bone); }
.tc-track { height: 8px; border-radius: 999px; background: var(--graphite-2);
  margin: 12px 0 7px; overflow: hidden; }
.tc-fill { height: 100%; width: 0%; border-radius: 999px; background: var(--volt);
  transition: width 0.35s var(--ease); box-shadow: 0 0 10px rgba(193,247,58,0.45); }
.tc-fill.indet { width: 35% !important; animation: tc-slide 1.1s var(--ease) infinite; box-shadow: none; }
@keyframes tc-slide { 0% { margin-left: -35%; } 100% { margin-left: 100%; } }
.tc-meta { display: flex; justify-content: space-between; gap: 10px;
  font-family: "Space Mono", monospace; font-size: 11px; color: var(--stone); }
.tc-meta .tc-pct { color: var(--volt); }
.tc-file { font-family: "Space Mono", monospace; font-size: 10.5px; color: var(--stone);
  margin-top: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  min-height: 14px; opacity: 0.85; }
.tc-btns { display: flex; gap: 8px; margin-top: 13px; }
.tc-btn { flex: 1; padding: 8px 0; border: 1px solid var(--line); background: transparent;
  color: var(--bone); border-radius: 9px; cursor: pointer; font-family: "Space Mono", monospace;
  font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease); }
.tc-btn:hover { background: var(--graphite-2); }
.tc-btn.primary { border-color: rgba(193,247,58,0.5); color: var(--volt); }
.tc-btn.primary:hover { background: var(--volt); color: var(--ink); }
.tc-btn.danger:hover { border-color: #e0533a; color: #e0533a; background: transparent; }

/* ── window controls: activity bell, separator, fullscreen ──────────────── */
.winsep { width: 1px; height: 18px; background: var(--line); margin: 0 5px; align-self: center; flex: none; }
.winbtn.bell { position: relative; font-size: 15px; }
.winbtn.bell.has-unread { color: var(--volt); }
.bell-badge {
  position: absolute; top: 1px; right: 0; min-width: 15px; height: 15px; padding: 0 4px;
  border-radius: 999px; background: var(--volt); color: var(--ink);
  font-family: "Space Mono", monospace; font-size: 9px; font-weight: 700; line-height: 15px;
  text-align: center; box-shadow: 0 0 0 2px var(--ink); pointer-events: none;
}
.bell-badge.hidden { display: none; }

/* ── frameless resize handles (invisible strips on the 8 edges) ─────────── */
/* z below the slide-over panel (50)/scrim (40) so an open panel isn't blocked
   at its edges, but above the main content so the grips always work */
.rz { position: fixed; z-index: 35; }
.rz-t  { top: 0; left: 10px; right: 10px; height: 5px; cursor: ns-resize; }
.rz-b  { bottom: 0; left: 10px; right: 10px; height: 5px; cursor: ns-resize; }
.rz-l  { left: 0; top: 10px; bottom: 10px; width: 5px; cursor: ew-resize; }
.rz-r  { right: 0; top: 10px; bottom: 10px; width: 5px; cursor: ew-resize; }
.rz-tl { top: 0; left: 0; width: 13px; height: 13px; cursor: nwse-resize; }
.rz-tr { top: 0; right: 0; width: 13px; height: 13px; cursor: nesw-resize; }
.rz-bl { bottom: 0; left: 0; width: 13px; height: 13px; cursor: nesw-resize; }
.rz-br { bottom: 0; right: 0; width: 13px; height: 13px; cursor: nwse-resize; }
body.is-fullscreen .rz { display: none; }     /* no edge-grab while fullscreen */

/* ── activity / notifications panel ─────────────────────────────────────── */
.act-empty { color: var(--stone); font-size: 13px; text-align: center; padding: 28px 0;
  font-family: "Space Mono", monospace; }
.act-sec { font-family: "Space Mono", monospace; font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--stone); margin: 16px 0 8px; }
.act-sec:first-child { margin-top: 0; }
.act-item {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--graphite); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 13px; margin-bottom: 9px;
}
.act-item.done { border-color: rgba(193,247,58,0.32); }
.act-item.failed { border-color: rgba(224,83,58,0.5); }
.act-ic { flex: none; width: 30px; height: 30px; border-radius: 9px; display: flex;
  align-items: center; justify-content: center; font-size: 15px; background: var(--graphite-2); }
.act-item.done .act-ic { background: rgba(193,247,58,0.14); }
.act-item.failed .act-ic { background: rgba(224,83,58,0.16); }
.act-main { flex: 1; min-width: 0; }
.act-title { font-family: "Space Grotesk", sans-serif; font-size: 14.5px; color: var(--bone);
  display: flex; align-items: center; gap: 8px; }
.act-tag { font-family: "Space Mono", monospace; font-size: 9.5px; letter-spacing: 0.08em;
  text-transform: uppercase; padding: 2px 7px; border-radius: 999px; border: 1px solid var(--line);
  color: var(--stone); flex: none; }
.act-tag.live { color: var(--volt); border-color: rgba(193,247,58,0.45); }
.act-tag.done { color: var(--volt); border-color: rgba(193,247,58,0.45); }
.act-tag.failed { color: #e0735a; border-color: rgba(224,83,58,0.5); }
/* DANGER — the system-shutdown countdown (something important, hard to miss) */
.act-item.danger { border-color: rgba(224,83,58,0.75); background: rgba(224,83,58,0.08);
  box-shadow: inset 3px 0 0 #e0553a; }
.act-item.danger .act-ic { background: rgba(224,83,58,0.22); }
.act-tag.danger { color: #fff; background: #c0392b; border-color: #c0392b; }
.act-item.danger .act-time { color: #ff7a63; font-weight: 600; }
.act-item.danger .act-btn.danger { background: #c0392b; color: #fff; border-color: #c0392b; }
.act-item.danger .act-btn.danger:hover { background: #d6442f; border-color: #d6442f; }
@keyframes act-danger-pulse { 0%, 100% { box-shadow: inset 3px 0 0 #e0553a; } 50% { box-shadow: inset 3px 0 0 #ff7a63, 0 0 0 1px rgba(224,83,58,0.4); } }
.act-item.danger { animation: act-danger-pulse 2.4s ease-in-out infinite; }
.act-sub { font-family: "Space Mono", monospace; font-size: 11.5px; color: var(--stone);
  margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.act-track { height: 6px; border-radius: 999px; background: var(--graphite-2); margin: 9px 0 4px; overflow: hidden; }
.act-track .fill { height: 100%; width: 0%; border-radius: 999px; background: var(--volt);
  transition: width 0.35s var(--ease); box-shadow: 0 0 8px rgba(193,247,58,0.4); }
.act-track .fill.indet { width: 35% !important; animation: tc-slide 1.1s var(--ease) infinite; box-shadow: none; }
.act-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.act-btn { padding: 6px 13px; border: 1px solid var(--line); background: transparent; color: var(--bone);
  border-radius: 8px; cursor: pointer; font-family: "Space Mono", monospace; font-size: 11px;
  letter-spacing: 0.04em; transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease); }
.act-btn:hover { border-color: var(--bone); }
.act-btn.primary { border-color: rgba(193,247,58,0.5); color: var(--volt); }
.act-btn.primary:hover { background: var(--volt); color: var(--ink); }
.act-btn.danger:hover { border-color: #e0533a; color: #e0735a; }
.act-link { font-family: "Space Mono", monospace; font-size: 11px; color: var(--volt);
  background: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 7px 11px;
  margin-top: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 100%; display: block; }
.act-head-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.act-clear { font-family: "Space Mono", monospace; font-size: 11px; color: var(--stone);
  background: transparent; border: none; cursor: pointer; padding: 4px 8px; border-radius: 7px; }
.act-clear:hover { color: #e0735a; background: var(--graphite); }

/* ── drive cleanup tab ─────────────────────────────────────────────────────── */
.dr-head { position: sticky; top: 0; z-index: 2; background: var(--graphite);
  padding-bottom: 10px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.dr-sum { font-size: 15px; color: var(--bone); }
.dr-sum strong { color: var(--volt); }
.dr-meta { font-family: "Space Mono", monospace; font-size: 10.5px; color: var(--stone);
  letter-spacing: 0.04em; margin-top: 4px; }
.dr-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.dr-allwrap { margin: 0; }
.dr-hint { font-family: "Space Mono", monospace; font-size: 10px; color: var(--stone); margin-top: 7px; }
.dr-list { margin-top: 10px; display: flex; flex-direction: column; gap: 7px; }
.dr-row { display: flex; align-items: center; gap: 11px; padding: 10px 12px;
  background: var(--graphite-2); border: 1px solid var(--line); border-radius: 12px; }
.dr-row:hover { border-color: rgba(242,240,234,0.22); }
.dr-chkwrap { display: flex; align-items: center; margin: 0; }
.dr-chkwrap input { width: 16px; height: 16px; accent-color: var(--volt); cursor: pointer; }
.dr-info { flex: 1; min-width: 0; }
.dr-name { font-size: 13.5px; color: var(--bone); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dr-path { font-family: "Space Mono", monospace; font-size: 10.5px; color: var(--stone);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.dr-size { text-align: right; font-family: "Space Mono", monospace; font-size: 12px;
  color: var(--bone); flex-shrink: 0; }
.dr-last { display: block; font-size: 9.5px; color: var(--stone); margin-top: 2px; }
.dr-acts { display: flex; gap: 6px; flex-shrink: 0; }
.dr-acts .act-btn { padding: 6px 10px; }

/* ── hub tab bar (social = captions/deliver/tracking · actions = autoclicker/recorder) ── */
.hub-tabs { display: flex; gap: 4px; padding: 8px 14px 0; border-bottom: 1px solid var(--line);
  background: var(--graphite); flex: 0 0 auto; }
.hub-tab { font-family: "Space Mono", monospace; font-size: 12px; letter-spacing: 0.03em;
  color: var(--stone); background: transparent; border: none; border-bottom: 2px solid transparent;
  padding: 8px 12px 9px; cursor: pointer;
  transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease); }
/* hover previews the underline (faint) so the tab affordance is obvious to new users */
.hub-tab:hover { color: var(--bone); border-bottom-color: var(--line); }
.hub-tab.active { color: var(--volt); border-bottom-color: var(--volt); }

/* ── social tracking cards ── */
.soc-card { background: var(--graphite-2); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; margin-bottom: 12px; }
.soc-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.soc-handle { font-family: "Space Grotesk", sans-serif; font-size: 15px; color: var(--bone); }
.soc-plat { font-family: "Space Mono", monospace; font-size: 10px; color: var(--stone);
  text-transform: uppercase; letter-spacing: 0.06em; margin-left: 8px; }
.soc-acts { display: flex; gap: 6px; flex-shrink: 0; }
.soc-big { display: flex; align-items: baseline; gap: 8px; background: transparent; border: none;
  cursor: pointer; padding: 8px 0 4px; text-align: left; }
.soc-num { font-family: "Space Grotesk", sans-serif; font-weight: 600; font-size: 30px;
  color: var(--bone); line-height: 1; }
.soc-big:hover .soc-num { color: var(--volt); }
.soc-lbl { font-family: "Space Mono", monospace; font-size: 12px; color: var(--stone); }
.soc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.soc-chip { font-family: "Space Mono", monospace; font-size: 11.5px; color: var(--stone);
  background: var(--ink); border: 1px solid var(--line); border-radius: 999px; padding: 5px 11px;
  cursor: pointer; transition: border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); }
.soc-chip b { color: var(--bone); }
.soc-chip:not(.ro):hover { border-color: var(--volt); color: var(--bone); }
.soc-chip.ro { cursor: default; }
.soc-chip.up b, .soc-gstats b.up { color: #6fcf97; }
.soc-chip.up, .soc-gstats b.up { color: #6fcf97; }
.soc-chip.dn, .soc-gstats b.dn { color: #e0553a; }
.soc-checked { font-family: "Space Mono", monospace; font-size: 10px; color: var(--stone); margin-top: 9px; }
.soc-back { margin-bottom: 4px; }
.soc-graphwrap { margin: 6px 0 14px; }
.soc-chart { width: 100%; height: 130px; display: block; }
.soc-xaxis { display: flex; justify-content: space-between; font-family: "Space Mono", monospace;
  font-size: 10px; color: var(--stone); margin-top: 4px; }
.soc-gstats { display: flex; flex-wrap: wrap; gap: 18px; }
.soc-gstats > div { display: flex; flex-direction: column; gap: 2px; }
.soc-gstats span { font-family: "Space Mono", monospace; font-size: 10px; color: var(--stone);
  text-transform: uppercase; letter-spacing: 0.05em; }
.soc-gstats b { font-family: "Space Grotesk", sans-serif; font-size: 17px; color: var(--bone); }

/* ── action recorder ── */
.pbtn.big { padding: 12px 22px; font-size: 13px; }
.rec-live { border-left: 2px solid var(--volt); }
.rec-live.recording { border-left-color: #e0553a; }
.rec-status { display: flex; align-items: center; gap: 8px; font-family: "Space Mono", monospace;
  font-size: 13px; color: var(--bone); }
.rec-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.rec-dot.rec { background: #e0553a; animation: recblink 1s steps(2) infinite; }
.rec-dot.play { background: var(--volt); }
@keyframes recblink { 50% { opacity: 0.25; } }
.rec-list { display: flex; flex-direction: column; gap: 8px; }
.rec-item { display: flex; align-items: center; gap: 10px; background: var(--graphite-2);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.rec-main { flex: 1; min-width: 0; }
.rec-rname { font-size: 13.5px; color: var(--bone); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rec-meta { font-family: "Space Mono", monospace; font-size: 10.5px; color: var(--stone); margin-top: 2px; }
.rec-ctrls { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.rec-loops { width: 52px; background: var(--ink); color: var(--bone); border: 1px solid var(--line);
  border-radius: 8px; padding: 7px 8px; font-family: "Space Mono", monospace; font-size: 12px; text-align: center; }
.rec-loops:disabled { opacity: 0.4; }
.rec-forever { display: inline-flex; align-items: center; gap: 4px; font-size: 15px; color: var(--bone);
  cursor: pointer; user-select: none; line-height: 1; }
.rec-forever input { accent-color: var(--volt); cursor: pointer; margin: 0; }
.rec-ctrls .pbtn { padding: 7px 12px; }
.rec-modetag { font-family: "Space Mono", monospace; font-size: 10px; color: var(--ink);
  background: var(--volt); border-radius: 4px; padding: 1px 6px; text-transform: uppercase;
  letter-spacing: 0.05em; }

/* ── activity: recurring-notifications toolbar + toggle switches ── */
.act-toolbar { display: flex; justify-content: flex-end; margin-bottom: 14px; }
.act-notifybtn { padding: 8px 14px; }
.np-list { display: flex; flex-direction: column; gap: 4px; }
.np-row { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line-2); }
.np-row:last-child { border-bottom: none; }
.np-main { flex: 1; min-width: 0; }
.np-name { font-size: 14.5px; color: var(--bone); }
.np-desc { font-family: "Space Mono", monospace; font-size: 11.5px; color: var(--stone); margin-top: 3px; }
.np-tag { color: var(--volt); opacity: 0.8; }
.np-switch { flex: 0 0 auto; width: 46px; height: 26px; border-radius: 999px; cursor: pointer;
  background: var(--ink); border: 1px solid var(--line); padding: 0; position: relative;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease); }
.np-switch .np-knob { position: absolute; top: 50%; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--stone); transform: translateY(-50%); transition: left var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease); }
.np-switch.on { background: color-mix(in srgb, var(--volt) 22%, var(--ink)); border-color: var(--volt); }
.np-switch.on .np-knob { left: 25px; background: var(--volt); }

/* ── mascot GADGET poses (app-state, layered over the orb, separate from outfits):
      recording camcorder · clicker mouse · key-playback keyboard. These rules come
      AFTER the activity body-language rules so the gadget motion wins on .dot-wrap. ── */
.acc-camera { top: 2%; left: 70%; width: 52%; transform-origin: 28% 60%;
  transform: translateX(-50%) rotate(-7deg); }
.mascot-fx.show-camera .acc-camera { opacity: 1; animation: cam-seek 3.6s ease-in-out infinite; }
/* the camcorder pans left↔right (filming both sides), in sync with the body sweep */
@keyframes cam-seek {
  0%, 100% { rotate: -9deg; translate: -5px 0; }
  50%      { rotate:  3deg; translate:  5px -2px; } }

.acc-clicker { bottom: 2%; left: 74%; width: 44%; transform: translateX(-50%); }
.mascot-fx.show-clicker .acc-clicker { opacity: 1; }

.acc-keys { bottom: -4%; left: 50%; width: 72%; transform: translateX(-50%); }
.mascot-fx.show-keys .acc-keys { opacity: 1; animation: keys-float 2.6s ease-in-out infinite; }
@keyframes keys-float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -3px; } }

/* while a gadget is active, hide the activity outfits so the pose reads clearly */
.mascot-fx.has-gadget .acc:not(.acc-camera):not(.acc-clicker):not(.acc-keys) { opacity: 0 !important; }

.dot-wrap.gad-rec { animation: gad-rec 3.6s ease-in-out infinite; transform-origin: 50% 80%; }
/* the orb sweeps left↔right as if filming a panorama, in sync with the camcorder */
@keyframes gad-rec { 0%, 100% { transform: translateX(-7px) rotate(-2.5deg); } 50% { transform: translateX(7px) rotate(2.5deg); } }
.dot-wrap.gad-click { animation: gad-click 0.16s steps(2) infinite; transform-origin: 50% 90%; }
@keyframes gad-click { 0% { transform: translate(-2px, 0) rotate(-1.5deg); } 50% { transform: translate(2px, 1px) rotate(1.5deg); } 100% { transform: translate(-1px, 0) rotate(-1deg); } }
.dot-wrap.gad-play { animation: gad-play 0.5s ease-in-out infinite; transform-origin: 50% 85%; }
@keyframes gad-play { 0%, 100% { transform: translateY(0) rotate(0deg); } 30% { transform: translateY(-2px) rotate(-1.5deg); } 70% { transform: translateY(-1px) rotate(1.5deg); } }

/* ═══ reel maker — LAUNCHER (projects gallery) ═══════════════════════════════ */
.rl-wrap { max-width: 560px; }
.rl-new { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  background: var(--ink); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px;
  cursor: pointer; color: var(--bone); transition: border-color var(--dur-fast) var(--ease); margin-bottom: 18px; }
.rl-new:hover { border-color: var(--volt); }
.rl-new-plus { font-size: 24px; line-height: 1; color: var(--volt); width: 40px; height: 40px; flex: 0 0 40px;
  display: flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 10px; }
.rl-new-txt { display: flex; flex-direction: column; gap: 2px; }
.rl-new-txt b { font-size: 14px; }
.rl-new-txt small { color: var(--stone); font-size: 11.5px; }
.rl-sec { font-family: "Space Mono", monospace; font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--stone); margin: 6px 0 8px; }
.rl-sechead { display: flex; align-items: center; justify-content: space-between; margin: 6px 0 8px; }
.rl-sechead .rl-sec { margin: 0; }
.rl-sort { height: 28px; background: var(--ink); color: var(--bone); border: 1px solid var(--line);
  border-radius: 7px; font-size: 11px; padding: 0 8px; cursor: pointer; }
.rl-card { display: flex; align-items: center; gap: 10px; background: var(--ink); border: 1px solid var(--line);
  border-radius: 10px; padding: 11px 14px; margin-bottom: 8px; cursor: pointer; transition: border-color var(--dur-fast) var(--ease); }
.rl-card:hover { border-color: var(--volt); }
.rl-card-main { flex: 1 1 auto; min-width: 0; }
.rl-card-t { font-size: 13.5px; color: var(--bone); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rl-card-s { font-size: 11px; margin-top: 2px; }
.rl-open { color: var(--volt); font-size: 12px; flex: 0 0 auto; opacity: 0; transition: opacity var(--dur-fast) var(--ease); }
.rl-card:hover .rl-open { opacity: 1; }
.rl-del { flex: 0 0 auto; background: none; border: none; cursor: pointer; font-size: 13px; opacity: .55; }
.rl-del:hover { opacity: 1; }
.rl-draft { border-style: dashed; }

/* ═══ reel maker — full-screen STUDIO (monitor · inspector · timeline) ═══════ */
#panel.studio { width: 100vw; max-width: 100vw; border-left: none; }
#panel.studio .panel-body { padding: 0; display: flex; flex-direction: column; min-height: 0; }
.st-bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; flex: 0 0 auto;
  border-bottom: 1px solid var(--line); }
.st-back { background: var(--ink); border: 1px solid var(--line); color: var(--bone); border-radius: 8px;
  padding: 6px 12px; cursor: pointer; font-size: 12px; }
.st-back:hover { border-color: var(--volt); color: var(--volt); }
.st-name { flex: 0 1 220px; min-width: 120px; height: 30px; background: var(--ink); color: var(--bone);
  border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; font-size: 13px; }
.st-bar-sp { flex: 1 1 auto; }
.st-total { font-size: 11px; }
.st-grid { flex: 1 1 auto; min-height: 0; position: relative; display: grid;
  grid-template-columns: var(--st-binw, 208px) minmax(0, 1fr) var(--st-inspw, 320px);
  grid-template-rows: minmax(0, 1fr) var(--st-tlh, 30vh); }
/* draggable splitters — drag to build your own workspace (bin width · inspector width · timeline height) */
.st-split { position: absolute; z-index: 6; transition: background .12s var(--ease); }
.st-split:hover, .st-split:active { background: rgba(193,247,58,.28); }
.st-split-insp { top: 0; bottom: 0; right: var(--st-inspw, 320px); width: 7px; margin-right: -3px; cursor: col-resize; }
.st-split-bin  { top: 0; bottom: var(--st-tlh, 30vh); left: var(--st-binw, 208px); width: 7px; margin-left: -3px; cursor: col-resize; }
.st-split-tl   { left: 0; right: var(--st-inspw, 320px); bottom: var(--st-tlh, 30vh); height: 7px; margin-bottom: -3px; cursor: row-resize; }
.st-bin { grid-column: 1; grid-row: 1; min-height: 0; display: flex; flex-direction: column;
  border-right: 1px solid var(--line); padding: 12px 12px 10px; background: var(--ink); }
.st-stage { grid-column: 2; grid-row: 1; min-height: 0; display: flex; align-items: center;
  justify-content: center; background: #070707; padding: 14px; }
.st-side { grid-column: 3; grid-row: 1 / span 2; min-height: 0; overflow-y: auto; padding: 14px 16px;
  border-left: 1px solid var(--line); }
.st-side .sectlabel:first-child { margin-top: 0; }
.st-tl { grid-column: 1 / 3; grid-row: 2; min-height: 0; overflow-y: auto;
  padding: 10px 14px; background: var(--graphite); border-top: 1px solid var(--line); }
/* media bin */
.st-bin-head { font-family: "Space Mono", monospace; font-size: 11px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--stone); margin-bottom: 8px; }
.bin-import { width: 100%; margin-bottom: 8px; }
/* media bin — a grid of square thumbnail tiles (name on hover via title + a bottom strip) */
.bin-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: grid;
  grid-template-columns: repeat(2, 1fr); gap: 7px; align-content: start; }
.bin-empty { grid-column: 1 / -1; font-size: 11px; text-align: center; padding: 22px 8px;
  border: 1px dashed var(--line); border-radius: 9px; line-height: 1.5; }
.bin-card { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; cursor: pointer;
  background: #000; border: 1px solid var(--line); transition: border-color .14s var(--ease); }
.bin-card:hover { border-color: var(--volt); }
.bin-thumb { position: absolute; inset: 0; background: #000 center/cover no-repeat;
  display: flex; align-items: center; justify-content: center; }
.bin-glyph { font-size: 24px; opacity: .65; }
.bin-name { position: absolute; left: 0; right: 0; bottom: 0; padding: 8px 5px 3px; font-size: 9.5px;
  color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.82)); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.bin-dur { position: absolute; top: 3px; left: 3px; font-size: 8.5px; font-family: "Space Mono", monospace;
  background: rgba(0,0,0,.62); color: #fff; padding: 0 3px; border-radius: 3px; }
.bin-used { position: absolute; bottom: 3px; right: 3px; background: var(--volt); color: var(--ink);
  font-size: 8.5px; font-weight: 700; padding: 0 3px; border-radius: 3px; }
.bin-del { position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; line-height: 1;
  background: rgba(0,0,0,.6); border: none; color: #fff; cursor: pointer; font-size: 11px; border-radius: 4px;
  opacity: 0; transition: opacity .14s var(--ease); }
.bin-card:hover .bin-del { opacity: 1; }
.bin-del:hover { color: #ff7a63; }
/* auto-edit: selection badge on each card + the run bar/settings */
.bin-sel { position: absolute; top: 4px; left: 4px; width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid #fff; background: rgba(0,0,0,.45); color: #fff; font-size: 11px; font-weight: 700;
  cursor: pointer; z-index: 3; display: flex; align-items: center; justify-content: center; padding: 0; }
.bin-sel.on { background: var(--volt); border-color: var(--volt); color: #07120a; }
.bin-card.selected { outline: 2px solid var(--volt); outline-offset: -2px; }
.bin-ae { display: flex; gap: 6px; align-items: center; margin: 6px 0; }
.bin-ae-go { flex: 1; }
.bin-ae-go:disabled { opacity: .5; cursor: default; }
.bin-ae-cog, .bin-ae-clear { width: 28px; height: 28px; flex: 0 0 auto; border: 1px solid var(--line);
  background: var(--graphite); color: #cfcfcf; border-radius: 7px; cursor: pointer; }
.bin-ae-cog.on { background: var(--volt); color: #07120a; border-color: var(--volt); }
.bin-ae-set { background: rgba(255,255,255,.03); border: 1px solid var(--line); border-radius: 8px; padding: 8px; margin-bottom: 6px; }
.bin-ae-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.bin-ae-row label { display: flex; flex-direction: column; font-size: 10px; color: #9aa; gap: 2px; }
.bin-ae-row input { width: 100%; }
/* ── MASCOT STUDIO: preview-first stage + chips ── */
.ms-studio { display: flex; flex-direction: column; gap: 14px; }
.ms-stage { position: relative; width: 100%; max-width: 380px; aspect-ratio: 1; margin: 0 auto;
  border-radius: 16px; overflow: hidden; background: #15161a; border: 1px solid var(--line); }
.ms-stage #ms-preview { width: 100%; height: 100%; display: block; }
.ms-stage-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #888; font-size: 12px; background: #15161a; }
.ms-bd { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); display: flex; gap: 4px; }
.ms-bd-btn { width: 26px; height: 22px; font-size: 12px; border-radius: 6px; border: 1px solid var(--line);
  background: rgba(0,0,0,.55); color: #cfcfcf; cursor: pointer; padding: 0; }
.ms-bd-btn.on { background: var(--volt); color: #07120a; border-color: var(--volt); }
.ms-sec { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: #888; margin: 6px 0 2px; }
.ms-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ms-chip { font-size: 12px; padding: 6px 11px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--graphite); color: #ddd; cursor: pointer; transition: background .12s var(--ease); }
.ms-chip:hover { border-color: var(--volt); }
.ms-chip.on { background: var(--volt); color: #07120a; border-color: var(--volt); font-weight: 600; }
.ms-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 10px; }
.ms-row.ms-fmt { gap: 12px; }
.ms-dur input { width: 52px; margin: 0 2px; }
.ms-seq { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-height: 28px;
  padding: 6px; border: 1px dashed var(--line); border-radius: 8px; background: rgba(255,255,255,.02); }
.ms-beat { font-size: 11px; padding: 4px 9px; border-radius: 7px; border: 1px solid var(--volt);
  background: rgba(193,247,58,.12); color: #dff7a0; cursor: pointer; }
.ms-beat:hover { background: rgba(255,120,90,.18); border-color: #ff7a5a; color: #ffd; }
.ms-arrow { color: #666; font-size: 11px; }
.ms-export { margin-top: 12px; width: 100%; }
.ms-status { font-size: 11px; margin-top: 8px; min-height: 14px; }
/* folder chips */
.bin-folders { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.bin-fchip { background: var(--ink); border: 1px solid var(--line); color: var(--stone); border-radius: 999px;
  padding: 3px 9px; font-size: 10.5px; cursor: pointer; transition: border-color .14s var(--ease); }
.bin-fchip:hover { border-color: var(--volt); color: var(--bone); }
.bin-fchip.on { border-color: var(--volt); color: var(--volt); background: rgba(193,247,58,.08); }
.bin-fchip.bin-fdrop { border-color: var(--volt); background: rgba(193,247,58,.18); }
.bin-hint { font-size: 9.5px; line-height: 1.45; margin-top: 8px; }
.st-bin.bin-dropping { outline: 2px dashed var(--volt); outline-offset: -4px; }
/* Add → Edit → Export spine */
.st-steps { display: flex; align-items: center; gap: 8px; padding: 7px 14px; flex: 0 0 auto;
  border-bottom: 1px solid var(--line); }
.st-step { display: inline-flex; align-items: center; gap: 6px; background: none; border: none;
  color: var(--stone); font-size: 12px; cursor: pointer; padding: 3px 4px; }
.st-step:hover { color: var(--bone); }
.st-step .st-stepn { width: 17px; height: 17px; border-radius: 50%; border: 1px solid var(--line);
  display: inline-flex; align-items: center; justify-content: center; font-size: 10px; }
.st-step.active { color: var(--bone); }
.st-step.active .st-stepn { border-color: var(--volt); color: var(--volt); }
.st-step.done .st-stepn { background: var(--volt); border-color: var(--volt); color: var(--ink); }
.st-stepsep { color: var(--stone); font-size: 13px; }
/* contextual tabbed inspector */
.insp-tabs { display: flex; gap: 2px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.insp-tab { background: none; border: none; border-bottom: 2px solid transparent; color: var(--stone);
  font-size: 12px; cursor: pointer; padding: 6px 9px 8px; margin-bottom: -1px; }
.insp-tab:hover { color: var(--bone); }
.insp-tab.on { color: var(--volt); border-bottom-color: var(--volt); }
.insp-body .sectlabel:first-child { margin-top: 0; }
.insp-card { background: var(--graphite); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; }
.insp-title { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.insp-title .insp-name { font-size: 12.5px; color: var(--bone); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.insp-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.insp-actions .danger:hover { border-color: #e0553a; color: #e0553a; }
/* the action buttons reuse .tl-mute/.tl-split/.tl-del (wiring) but must NOT inherit
   their 26px icon-button width here — they're full text pills in the inspector */
.insp-actions .tl-mute, .insp-actions .tl-split, .insp-actions .tl-del {
  width: auto; height: auto; padding: 5px 11px; font-size: 11px; }
.insp-empty { text-align: center; padding: 32px 16px; color: var(--stone); }
.insp-empty-ic { font-size: 26px; display: block; margin-bottom: 8px; opacity: .65; }
.insp-empty p { font-size: 12px; margin: 4px 0; line-height: 1.5; }
/* inspector: single-column grids + tidy inputs so nothing clips in the narrow column
   (the Output tab's 2-up grid used to push fps / resolution / framing off the edge) */
.st-side { overflow-x: hidden; }
.st-side .cap-grid { grid-template-columns: 1fr; gap: 9px 12px; }
.st-side .cap-grid label { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 12px; color: var(--stone); }
.st-side .cap-grid input, .st-side .cap-grid select { height: 30px; min-width: 0; background: var(--ink);
  color: var(--bone); border: 1px solid var(--line); border-radius: 7px; padding: 0 8px; font-size: 12px; }
.st-side .cap-grid input[type=number] { flex: 0 0 auto; width: 92px; text-align: right; }
.st-side .cap-grid select { flex: 1 1 auto; max-width: 62%; cursor: pointer; }
.st-side .cap-grid input:focus, .st-side .cap-grid select:focus { border-color: var(--volt); outline: none;
  box-shadow: 0 0 0 2px rgba(193,247,58,.16); }
.st-side .cap-check { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--stone); }
.st-side .tl-musicctl { display: flex; flex-direction: column; gap: 8px; }
.st-side .tl-musicctl label { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.st-side .tl-musicctl input[type=range] { flex: 1 1 auto; }
/* drag a media-bin card onto the V track */
.tl-track-drop { outline: 2px dashed var(--volt); outline-offset: -2px; background: rgba(193,247,58,.07); }
.st-tl .tl-canvas { background: transparent; border: none; padding: 0; margin: 0; }
/* studio monitor — JS (_tlSizeMonitor) sets explicit px W/H to fill the stage at the
   target aspect (an empty <img> gives a pure-CSS aspect box no size → it collapsed) */
.st-stage .tl-montop { flex-direction: column; align-items: center; justify-content: center;
  margin: 0; gap: 8px; width: 100%; height: 100%; min-height: 0; }
.st-stage .tl-monitor { flex: 0 0 auto; box-shadow: 0 6px 26px rgba(0,0,0,.5); }
.st-stage .tl-moninfo { flex: 0 0 auto; flex-direction: row; align-items: center; gap: 12px; width: 100%;
  justify-content: center; }
/* timeline header (lives above the lanes, holds the zoom control) */
.tl-tlhead { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; }
.tl-tlhead-lbl { font-family: "Space Mono", monospace; font-size: 11px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--stone); }
.tl-tlhead-hint { font-size: 10px; }
@media (max-width: 1100px) { .tl-tlhead-hint { display: none; } }
.tl-zoombtn.tl-extend { width: auto; padding: 0 7px; font-size: 10px; font-family: "Space Mono", monospace; }
.tl-zoombtn.tl-razor { color: var(--volt); }

/* play button + export platform presets */
.tl-playbtn { width: 30px; height: 30px; border-radius: 7px; border: 1px solid var(--line); background: var(--ink);
  color: var(--volt); cursor: pointer; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; }
.tl-playbtn:hover { border-color: var(--volt); }
.tl-monspring { flex: 1 1 auto; }
.tl-platforms { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.tl-pchip { background: var(--ink); border: 1px solid var(--line); color: var(--bone); border-radius: 999px;
  padding: 6px 11px; font-size: 11px; cursor: pointer; transition: border-color var(--dur-fast) var(--ease); }
.tl-pchip:hover { border-color: var(--volt); }
.tl-pchip.on { border-color: var(--volt); color: var(--volt); background: rgba(193,247,58,.08); }
