Skip to content

armgit / kwant

Public Imported from GitHub
0

Your own team of AI bots in one self-hosted binary: spaces, every account you have, handoffs, approvals and routines. Open-source, self-hosted alternative to Grok Bot, Claude Duet and OpenAI dots. Rust + React.

58.4 KB
Raw Blame
@tailwind base;
@tailwind components;
@tailwind utilities;

/* Design tokens (UI refresh, 0.6.9). Surfaces get lighter as they rise; hairlines are white at low
   alpha so they work on every surface. Tailwind names for these: bg-surface-*, border-hairline,
   text-ok / warn / bad / info / muted, bg-accent-gradient, shadow-card / raised / glow. */
:root {
  --kw-surface-rail: #0a0719;
  --kw-surface-side: #0e0a21;
  --kw-surface-main: #120e26;
  --kw-surface-raised: #1a1538;
  --kw-surface-overlay: #231d4b;
  --kw-hairline: rgb(255 255 255 / 0.07);
  --kw-hairline-strong: rgb(255 255 255 / 0.14);
  --kw-ok: #5eead4;
  --kw-warn: #fcd34d;
  --kw-bad: #fda4af;
  --kw-info: #b8adff;
  --kw-muted: #a39dcc;
  --kw-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

@layer base {
  * {
    border-color: theme('colors.zinc.800');
  }

  body {
    background-color: var(--kw-surface-main);
    color: theme('colors.zinc.100');
    font-family: theme('fontFamily.sans');
  }
}

/* Sleek minimalist scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: theme('colors.zinc.800');
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background: theme('colors.zinc.700');
}

/* Subtle typing cursor */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.cursor-blink {
  animation: blink 0.9s infinite;
}

/* Markdown styling */
.prose pre {
  background-color: theme('colors.zinc.900') !important;
  border: 1px solid theme('colors.zinc.800') !important;
  border-radius: 0.5rem !important;
  padding: 0.85rem !important;
}

.prose code {
  color: theme('colors.sky.300') !important;
  font-family: theme('fontFamily.mono') !important;
}

/* Working kwant avatars: transform and opacity only, so it stays on the compositor. */
@keyframes kw-avatar-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-0.9px); }
}

@keyframes kw-avatar-ring {
  0%, 100% { opacity: 0.35; transform: scale(1); }
  50% { opacity: 0.95; transform: scale(1.07); }
}

.kw-avatar-working .kw-avatar-body {
  transform-box: fill-box;
  transform-origin: center bottom;
  animation: kw-avatar-bob 0.9s ease-in-out infinite;
}

.kw-avatar-ring {
  position: absolute;
  inset: -2px;
  border-radius: 30%;
  box-shadow: 0 0 0 1.5px #9d8fff, 0 0 8px 1px rgb(157 143 255 / 0.55);
  pointer-events: none;
  animation: kw-avatar-ring 1.4s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .kw-avatar-working .kw-avatar-body,
  .kw-avatar-ring {
    animation: none;
  }
  .kw-avatar-ring { opacity: 0.9; }
}

/* Toasts slide in; without motion they just appear. */
@keyframes kw-toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.kw-toast {
  animation: kw-toast-in 0.18s ease-out;
}

@media (prefers-reduced-motion: reduce) {
  .kw-toast { animation: none; }
}

/* A message reached from search glows briefly; without motion it is just outlined. */
@keyframes kw-flash {
  0%, 60% { box-shadow: 0 0 0 2px theme('colors.amber.400 / 70%'); background: theme('colors.amber.400 / 8%'); }
  100% { box-shadow: 0 0 0 2px transparent; background: transparent; }
}

.kw-flash {
  animation: kw-flash 2.4s ease-out;
}

@media (prefers-reduced-motion: reduce) {
  .kw-flash {
    animation: none;
    box-shadow: 0 0 0 2px theme('colors.amber.400 / 70%');
  }
}

/* Small buttons that still tap like 44px (the phone working strip): an invisible hit area 8px
   above and below a 28px button, and at least 44px wide, so the line itself stays 28px tall. */
.kws-hit {
  position: relative;
}
.kws-hit::before {
  content: '';
  position: absolute;
  inset: -8px 0;
  min-width: 44px;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
}

/* The phone strip's and desktop status line's working avatar: a softer, slower bob than in the stream. */
.kws-strip-phone .kw-avatar-working .kw-avatar-body,
.kws-strip-line .kw-avatar-working .kw-avatar-body {
  animation-duration: 1.6s;
}

/* Phones: every control is at least 44px to tap, and text fields are 16px so iOS doesn't zoom
   in on them. Only on touch screens below 768px, so desktop and narrow mouse windows keep the
   compact look. Toggle switches, checkboxes and links inside text keep their size; anything else
   that must stay small can opt out with data-compact. */
/* 19f: a phone reply's smart-result row (Show as text, Copy data, From this reply) sits under the ghost icons.
   It hides when no block put anything in it, and "From this reply" is quiet text there, not a chip that looks
   like a button it isn't. Desktop keeps evidenceClass as is. */
[data-smart-row]:has(> [data-smart-actions]:empty) {
  display: none;
}
@media (max-width: 767px) and (pointer: coarse) {
  [data-smart-row] [data-evidence] {
    border-color: transparent;
    background: transparent;
    padding-inline: 4px;
    min-height: 28px; /* when it wraps under Copy data it reads as a caption line, not a 36 px chip row */
    font-weight: 400;
    color: theme('colors.zinc.400'); /* zinc-400 */
  }
}

@media (max-width: 767px) and (pointer: coarse) {
  :is(button, [role='button'], [role='tab'], [role='menuitem'], [role='option'], select, summary):not([role='switch'], [data-compact], .prose *) {
    min-height: 44px;
  }
  /* A 44 px fold keeps its title in the middle of the row, not stuck to the top (plain block summaries;
     flex ones centre themselves with items-center) */
  summary {
    align-content: center;
  }
  /* Icon-only buttons get the width too, with the icon centred */
  button:not([role='switch'], [role='menuitem'], [data-compact], .hidden, .w-full, :has(> :not(svg, img, .sr-only, .hidden))):has(> svg, > img) {
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  /* Colour swatches and other empty buttons: a full square */
  button:empty:not([role='switch'], [data-compact]) {
    min-width: 44px;
  }
  textarea,
  input:not([type='checkbox'], [type='radio'], [type='range'], [type='color'], [type='file'], [type='hidden']) {
    min-height: 44px;
  }
  input:not([type='checkbox'], [type='radio'], [type='range'], [type='color'], [type='file']),
  textarea,
  select {
    /* !important: text-sm / text-xs utilities would otherwise win and iOS zooms on focus */
    font-size: 16px !important;
  }
}

/* Phone widths: sideways scrollers (chip rows, Space settings tabs) without a scrollbar, fading
   32px at each edge only while they can scroll further that way (ScrollRow sets data-at-start and
   data-at-end). 14c: the fade was 24px on the right only, too faint to read as "this scrolls". */
@media (max-width: 767px) {
  .kw-scroll-row {
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }
  .kw-scroll-row::-webkit-scrollbar {
    display: none;
  }
  .kw-scroll-row {
    --kw-fade-l: 0px;
    --kw-fade-r: 0px;
  }
  .kw-scroll-row[data-at-start='false'] {
    --kw-fade-l: 32px;
  }
  .kw-scroll-row[data-at-end='false'] {
    --kw-fade-r: 32px;
  }
  .kw-scroll-row:is([data-at-start='false'], [data-at-end='false']) {
    mask-image: linear-gradient(to right, transparent, #000 var(--kw-fade-l), #000 calc(100% - var(--kw-fade-r)), transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, #000 var(--kw-fade-l), #000 calc(100% - var(--kw-fade-r)), transparent);
  }
}

/* Phone-width chat: the header's action buttons as plain icons so they don't crowd the title. */
@media (max-width: 639px) {
  .kw-head-btn:not([aria-pressed='true']) {
    background-color: transparent;
    border-color: transparent;
    box-shadow: none;
  }
}

/* Pinned sidebar section titles on phones: the sidebar's own colour, so rows scroll under them */
.kw-sticky-head {
  background: linear-gradient(theme('colors.zinc.900 / 40%'), theme('colors.zinc.900 / 40%')), theme('colors.zinc.950');
}

/* Bottom sheets clear the home indicator */
.kw-sheet {
  padding-bottom: max(1.5rem, calc(env(safe-area-inset-bottom) + 0.75rem));
}

/* Phone-width dialogs: forms open as full-height pages that clear the notch and home indicator,
   and short confirms as bottom sheets. Desktop and tablets keep the centred card. */
@media (max-width: 639px) {
  .kw-dialog.kw-dialog {
    padding: 0;
    align-items: stretch;
    justify-content: stretch;
  }
  .kw-dialog > .kw-dialog-panel {
    width: 100%;
    max-width: none;
    height: var(--kwnt-app-height, 100dvh);
    max-height: none;
    border-width: 0;
    border-radius: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-top: calc(env(safe-area-inset-top) + 1rem);
    padding-bottom: calc(env(safe-area-inset-bottom) + 1rem);
  }
  .kw-dialog.kw-dialog-bottom {
    align-items: flex-end;
  }
  .kw-dialog-bottom > .kw-dialog-panel {
    height: auto;
    max-height: 90dvh;
    border-top-width: 1px;
    border-radius: 1rem 1rem 0 0;
    padding-top: 1rem;
  }
}

/* ------------------------------------------------------------------------------------------------
   Semantic classes (UI refresh). Use these rather than repeating long utility strings.
   .kw-card            a raised surface: hairline, 12px corners, soft shadow
   .kw-card-interactive  the same, tappable: lifts 1px and brightens its hairline on hover/focus
   .kw-chip            a pill label; add .kw-chip-ok / -warn / -bad / -info / -accent for a status colour
   .kw-btn-primary     the accent gradient button (one per view); .kw-btn-ghost a quiet button
   .kw-hover-deepen    the same hover for a hand-built bg-accent-gradient button with white text (never hover:brightness);
                       the deeper gradient fades in over 150ms from an ::after layer (opacity only)
   .kw-status-dot      a 8px dot; .kw-status-ok / -warn / -bad / -idle, .kw-pulse while something is live
   .kw-focus           the focus ring (2px accent, 2px offset); already on every .kw-card-interactive
   .kw-hit             a 44px tap area on phone for a small inline link, with no visual change
   .kw-fade-in         enters in 160ms (opacity + 6px slide); .kw-stagger delays children by --i * 40ms
   Motion is 120-200ms, transform and opacity only, and off under prefers-reduced-motion.
   ------------------------------------------------------------------------------------------------ */
@layer components {
  .kw-card {
    @apply rounded-2xl border border-hairline bg-surface-raised shadow-card;
  }
  .kw-card-interactive {
    @apply kw-card text-left cursor-pointer;
    transition: transform 160ms var(--kw-ease), border-color 160ms var(--kw-ease), background-color 160ms var(--kw-ease);
  }
  .kw-card-interactive:hover:not(:disabled) {
    transform: translateY(-1px);
    border-color: rgb(157 143 255 / 0.45);
    background-color: var(--kw-surface-overlay);
  }
  .kw-card-interactive:active:not(:disabled) {
    transform: translateY(0) scale(0.995);
  }
  .kw-card-interactive:disabled {
    @apply opacity-50 cursor-not-allowed;
  }
  /* .kw-hit: on phone, a small inline link gets a 44px tap area from an invisible ::before; nothing moves. */
  @media (max-width: 639.98px) {
    .kw-hit { position: relative; }
    .kw-hit::before {
      content: '';
      position: absolute;
      left: 50%;
      top: 50%;
      width: max(100%, 44px);
      height: max(100%, 44px);
      transform: translate(-50%, -50%);
    }
  }
  .kw-card-interactive,
  .kw-focus {
    @apply focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-sky-400;
  }

  .kw-chip {
    @apply inline-flex items-center gap-1 rounded-full border border-hairline-strong bg-white/[0.04] px-2.5 py-0.5 text-meta font-medium text-zinc-300;
  }
  .kw-chip-ok { @apply border-teal-400/30 bg-teal-400/10 text-ok; }
  /* Plain, never holo: needs you / Approvals off (amber), failed (rose). spec.md §1 "Rule". */
  .kw-chip-warn { @apply border-amber-300/35 text-warn; background-color: rgb(252 211 77 / 0.12); }
  .kw-chip-bad { @apply border-rose-300/35 text-bad; background-color: rgb(253 164 175 / 0.12); }
  .kw-chip-info { @apply border-sky-300/30 bg-sky-300/10 text-info; }
  .kw-chip-accent { @apply border-transparent bg-accent-soft text-sky-200; }

  .kw-btn-primary {
    @apply inline-flex items-center justify-center gap-1.5 rounded-xl bg-accent-gradient px-3.5 py-1.5 text-body font-semibold text-white shadow-card;
    transition: transform 140ms var(--kw-ease), filter 140ms var(--kw-ease), box-shadow 140ms var(--kw-ease);
  }
  /* Hover deepens the gradient (sky-600 to sky-700) instead of brightening it: brightness(1.12) put white text at
     3.66:1 on the light stop. Now 5.1:1 or more on hover (26g). */
  .kw-btn-primary:hover:not(:disabled) { background-image: linear-gradient(135deg, theme('colors.sky.600') 0%, theme('colors.sky.700') 100%); }
  /* A gradient can't interpolate, so .kw-hover-deepen fades the deeper gradient in from an ::after layer
     behind the label instead of swapping background-image (26g-2). btnApprove disables itself with aria-disabled. */
  .kw-hover-deepen { position: relative; isolation: isolate; }
  .kw-hover-deepen::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background-image: linear-gradient(135deg, theme('colors.sky.600') 0%, theme('colors.sky.700') 100%);
    opacity: 0;
    z-index: -1;
    pointer-events: none;
    transition: opacity 150ms var(--kw-ease);
  }
  .kw-hover-deepen:hover:not(:disabled):not([aria-disabled="true"])::after { opacity: 1; }
  .kw-btn-primary:hover:not(:disabled) { box-shadow: theme('boxShadow.glow'); }
  .kw-btn-primary:active:not(:disabled) { transform: scale(0.97); }
  .kw-btn-primary:disabled { @apply cursor-not-allowed; background-image: none; background-color: var(--kw-surface-overlay); color: theme('colors.zinc.400'); box-shadow: none; }
  .kw-btn-ghost {
    @apply inline-flex items-center justify-center gap-1.5 rounded-xl border border-hairline-strong bg-white/[0.03] px-3 py-1.5 text-meta font-medium text-zinc-200 transition-colors hover:bg-white/[0.08] hover:text-zinc-50;
  }
  .kw-btn-primary,
  .kw-btn-ghost {
    @apply focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-sky-400;
  }

  .kw-status-dot { @apply inline-block h-2 w-2 shrink-0 rounded-full; }
  .kw-status-ok { @apply bg-teal-300; }
  .kw-status-warn { @apply bg-amber-300; }
  .kw-status-bad { @apply bg-rose-300; }
  .kw-status-idle { @apply bg-zinc-500; }
}

@keyframes kw-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.8); }
}
.kw-pulse { animation: kw-pulse 1.4s ease-in-out infinite; }

@keyframes kw-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.kw-fade-in { animation: kw-fade-in 160ms var(--kw-ease) both; }
.kw-stagger > * { animation: kw-fade-in 180ms var(--kw-ease) both; animation-delay: calc(var(--i, 0) * 40ms); }

/* W1: the Watch globe appears and leaves in 150ms, opacity only; without motion it is just there or gone. */
@keyframes kw-opacity-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes kw-opacity-out { from { opacity: 1; } to { opacity: 0; } }
.kw-globe-in { animation: kw-opacity-in 150ms ease-out both; }
.kw-globe-out { animation: kw-opacity-out 150ms ease-in both; }
@media (prefers-reduced-motion: reduce) { .kw-globe-in, .kw-globe-out { animation: none; } }

/* Bot home: the avatar floats and the glow breathes. Transform and opacity only. */
@keyframes kw-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
@keyframes kw-glow-breathe {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50% { opacity: 0.9; transform: scale(1.08); }
}
@keyframes kw-home-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.kw-float { animation: kw-float 3.2s ease-in-out infinite; }
.kw-glow { animation: kw-glow-breathe 3.6s ease-in-out infinite; }
/* The home waits 220ms before it shows, so a chat whose messages are still loading never flashes it */
.kw-home { animation: kw-home-in 180ms var(--kw-ease) 220ms both; }

@media (prefers-reduced-motion: reduce) {
  .kw-pulse,
  .kw-float,
  .kw-glow { animation: none; }
  .kw-fade-in,
  .kw-stagger > * { animation: none; }
  .kw-home { animation: kw-home-fade 1ms linear 220ms both; }
  .kw-card-interactive,
  .kw-btn-primary,
  .kw-hover-deepen::after { transition: none; }
  .kw-card-interactive:hover:not(:disabled),
  .kw-card-interactive:active:not(:disabled),
  .kw-btn-primary:active:not(:disabled) { transform: none; }
}
@keyframes kw-home-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ---------------------------------------------------------------------------------------------
   Stickers (Mira's spec.md §1): a die-cut plate, 2px white edge, soft shadow, slight tilt. Pure CSS.
   tone "holo" is only for earned things (verified, picked, goal kept): a vivid foil sweep multiplied
   into the light plate plus a soft-light glint and grain, so ink text only gains contrast (worst 7.19:1).
   tone "ink" is the plain plate (e.g. "New"). Needs you, failed, Approvals off: plain chips, never this.
   --mx/--my are set by <Sticker> on pointer move and glide through @property.
   --------------------------------------------------------------------------------------------- */
@property --mx { syntax: '<percentage>'; inherits: true; initial-value: 30%; }
@property --my { syntax: '<percentage>'; inherits: true; initial-value: 20%; }
.kw-sticker {
  --mx: 30%;
  --my: 20%;
  --kw-tilt: 0deg;
  position: relative;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  max-width: 100%;
  padding: 0 10px;
  border: 2px solid #fff;
  border-radius: 11px 7px 11px 7px;
  background: #f4f1ff;
  color: #1b1033;
  font: 700 12px/16px theme('fontFamily.sans');
  letter-spacing: 0.01em;
  white-space: nowrap;
  vertical-align: middle;
  isolation: isolate;
  overflow: hidden;
  box-shadow: 0 1px 0 rgb(0 0 0 / 0.3), 0 5px 12px rgb(0 0 0 / 0.35);
  transform: rotate(var(--kw-tilt));
  transition: transform 160ms cubic-bezier(.2,.7,.2,1), box-shadow 160ms cubic-bezier(.2,.7,.2,1), --mx 120ms linear, --my 120ms linear;
}
.kw-sticker svg { width: 12px; height: 12px; flex-shrink: 0; }
.kw-sticker-sm {
  height: 18px;
  padding: 0 6px;
  gap: 3px;
  border-radius: 8px 5px 8px 5px;
  font: 700 11px/14px theme('fontFamily.sans');
  box-shadow: 0 1px 0 rgb(0 0 0 / 0.3), 0 3px 8px rgb(0 0 0 / 0.35);
}
.kw-sticker-sm svg { width: 10px; height: 10px; }
.kw-sticker > * { position: relative; z-index: 2; }
/* A clickable sticker is a span inside this button: a 44x44 target around an 18-24px sticker. */
.kw-sticker-hit {
  display: inline-grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 12px;
}
.kw-sticker-hit:focus { outline: none; }
.kw-sticker-hit:focus-visible > .kw-sticker,
a.kw-sticker:focus-visible { outline: 2px solid #b8adff; outline-offset: 3px; }
.kw-sticker-hit:hover > .kw-sticker,
a.kw-sticker:hover { transform: rotate(var(--kw-tilt)) scale(1.04); box-shadow: 0 1px 0 rgb(0 0 0 / 0.3), 0 8px 16px rgb(0 0 0 / 0.4); }
.kw-sticker-holo::before,
.kw-sticker-holo::after {
  content: '';
  position: absolute;
  pointer-events: none;
}
/* The foil (review-pr264 §2, v2): a 105deg two-cycle linear sweep, 200% wide, slid with transform only,
   so a flat pill always shows the full rainbow. --my is no longer read; the pointer code still sets it. */
.kw-sticker-holo::before {
  inset: 0 -50%;
  z-index: 0;
  background: linear-gradient(105deg,
    #ff6ec7 0%, #ffd36e 10%, #7dffb0 20%, #5ee0ff 30%, #9b7bff 40%,
    #ff6ec7 50%, #ffd36e 60%, #7dffb0 70%, #5ee0ff 80%, #9b7bff 90%, #ff6ec7 100%);
  mix-blend-mode: multiply;
  opacity: 0.8;
  transform: translateX(calc((50% - var(--mx)) / 4));
}
/* A glint band that follows --mx, plus a fine foil grain. Soft-light white only lightens. */
.kw-sticker-holo::after {
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(105deg, transparent calc(var(--mx) - 14%), rgb(255 255 255 / 0.7) var(--mx), transparent calc(var(--mx) + 14%)),
    repeating-linear-gradient(115deg, transparent 0 3px, rgb(255 255 255 / 0.22) 3px 4px);
  mix-blend-mode: soft-light;
}
.kw-sticker-ink { background: #e9e4ff; }
/* "New" leaving after first use: fade, then NewTag unmounts it. */
.kw-new-tag { transition: opacity 160ms linear; }
.kw-new-tag[data-leaving] { opacity: 0; }
@keyframes kw-sticker-drift {
  from { transform: translateX(calc((50% - var(--mx)) / 4 - 8%)); }
  to { transform: translateX(calc((50% - var(--mx)) / 4)); }
}
@keyframes kw-sticker-press {
  from { transform: rotate(var(--kw-tilt)) scale(1.08); }
  to { transform: rotate(var(--kw-tilt)) scale(1); }
}
/* S1: the Verified stamp presses in once when it appears. */
.kw-sticker-press { animation: kw-sticker-press 160ms cubic-bezier(.2,.7,.2,1) 1 both; }
/* No pointer on a phone: the sheen drifts once when the sticker appears. */
@media (pointer: coarse) {
  .kw-sticker-holo::before { animation: kw-sticker-drift 160ms cubic-bezier(.2,.7,.2,1) 1 both; }
}
@media (prefers-reduced-motion: reduce) {
  .kw-sticker { --mx: 30% !important; --my: 20% !important; transition: none; }
  .kw-sticker-holo::before,
  .kw-sticker-press { animation: none; }
  .kw-sticker-hit:hover > .kw-sticker,
  a.kw-sticker:hover { transform: rotate(var(--kw-tilt)); }
  .kw-new-tag { transition: none; }
}

/* ---------------------------------------------------------------------------------------------
   Avatar moods (AvatarMood / ModernAvatar). Opacity and transform only, 120-200ms or a slow loop;
   static under prefers-reduced-motion.
   --------------------------------------------------------------------------------------------- */
.kw-avatar-resting > svg:not(.kw-mood) { opacity: 0.55; filter: saturate(0.5); }
@keyframes kw-mood-dot { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }
.kw-mood-dot { animation: kw-mood-dot 1.2s ease-in-out infinite; }
.kw-mood-dot-1 { animation-delay: 0.2s; }
.kw-mood-dot-2 { animation-delay: 0.4s; }
@keyframes kw-mood-pop { from { opacity: 0; transform: scale(0.4); } to { opacity: 1; transform: scale(1); } }
.kw-mood-needs_you,
.kw-mood-failed { transform-origin: center; animation: kw-mood-pop 160ms var(--kw-ease) 1 both; }
/* Just finished: frames at 0 / 60 / 120 ms (steps), held to 3 s, then a 160 ms fade. */
@keyframes kw-mood-frame { from { opacity: 0; } to { opacity: 1; } }
@keyframes kw-mood-out { from { opacity: 1; } to { opacity: 0; } }
.kw-mood-f2 { animation: kw-mood-frame 1ms steps(1) 60ms 1 both; }
.kw-mood-f3 { animation: kw-mood-frame 1ms steps(1) 120ms 1 both; }
.kw-mood-finished { animation: kw-mood-out 160ms linear 2840ms 1 forwards; }
@keyframes kw-avatar-blink { from { opacity: 1; } to { opacity: 0; } }
.kw-avatar-blink { animation: kw-avatar-blink 1ms linear 160ms 1 both; opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .kw-mood-dot { animation: none; opacity: 0.8; }
  .kw-mood-finished, .kw-mood-needs_you, .kw-mood-failed,
  .kw-mood-f2, .kw-mood-f3 { animation: none; }
  .kw-avatar-blink { display: none; }
}

/* Browser takeover stage (Mira's spec §2, §4, §5): enters with a fade and a slight scale; nothing loops */
@keyframes kw-stage-in { from { opacity: 0; transform: scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes kw-scrim-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes kw-pop-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.kw-stage-in { animation: kw-stage-in 160ms cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.kw-scrim-in { animation: kw-scrim-in 160ms cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.kw-pop-in { animation: kw-pop-in 120ms cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.kw-veil-in { transition: opacity 120ms cubic-bezier(0.2, 0.7, 0.2, 1); }
@media (prefers-reduced-motion: reduce) {
  .kw-stage-in, .kw-scrim-in, .kw-pop-in { animation: none; }
  .kw-veil-in { transition: none; }
}

/* Reactions and Reply (react-reply design.md §1, §3). The pop is on the thumb's icon only, so the
   button never changes size; the down thumb dips the other way. The quote's flash is a violet ring. */
@keyframes kw-react-pop {
  0%   { transform: scale(1)    rotate(0deg); }
  45%  { transform: scale(1.32) rotate(var(--kw-react-tilt, -12deg)); }
  75%  { transform: scale(0.94) rotate(0deg); }
  100% { transform: scale(1)    rotate(0deg); }
}
.kw-react-pop > svg {
  transform-origin: 50% 70%;
  animation: kw-react-pop 200ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.kw-react-down { --kw-react-tilt: 12deg; }

@keyframes kw-flash-quote { 0%, 55% { opacity: 1; } 100% { opacity: 0; } }
.kw-flash-quote { position: relative; }
.kw-flash-quote::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 14px;
  pointer-events: none;
  box-shadow: 0 0 0 2px rgb(157 143 255 / 0.7);
  background: rgb(157 143 255 / 0.08);
  animation: kw-flash-quote 1.6s var(--kw-ease, ease-out) both;
}

@media (prefers-reduced-motion: reduce) {
  .kw-react-pop > svg { animation: none; }
  .kw-flash-quote::after { animation: none; }
}

/* Phone bottom sheet (the thread picker, spec A2): slides up in 180 ms, appears at once under reduced motion */
.kw-sheet {
  animation: kw-sheet-in 180ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
@keyframes kw-sheet-in {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}
@media (prefers-reduced-motion: reduce) {
  .kw-sheet {
    animation: none;
  }
}
/* ---- Dev mode (0.7): the switch, the </> badge, the hard hat and the blueprint grid. design.md §1–§2.
   Under reduced motion nothing animates. */
/* The switch v3 (explainer spec §3): the state word Off / On / Off? next to a 40×22 track and a 16 px
   knob. Off: a hollow node at the left. On: the knob at the right with a violet pip, a small lock in the
   track. Armed (press 1 of 2 to turn off): amber ring and open lock, no halo, no pulse. 32 px tall (44 on
   phones). Not colour alone: the word, the knob's side and the lock all change. */
.kw-dv {
  position: relative; display: inline-flex; align-items: center; justify-content: flex-end; gap: 6px;
  height: 32px; min-width: 44px; padding: 0 2px; border-radius: 10px; flex-shrink: 0; cursor: pointer; background: transparent;
}
.kw-dv.h-11 { height: 44px; } /* phone: a 44 px target */
.kw-dv:focus-visible { outline: 2px solid #9d8fff; outline-offset: 2px; }
.kw-dv[aria-disabled='true'], .kw-dv:disabled { opacity: 0.4; cursor: not-allowed; }
.kw-dv-hint, .kw-dv-lbl { display: none; } /* 0.7.1 parts, gone in v3 */
.kw-dv-val { font: 600 11px/16px Inter, ui-sans-serif, system-ui, sans-serif; min-width: 22px; text-align: right; color: theme('colors.zinc.400'); }
.kw-dv[data-on] .kw-dv-val { color: theme('colors.sky.300'); }
.kw-dv[data-armed] .kw-dv-val { color: var(--dv-armed); }
.kw-dv-track {
  position: relative; display: block; width: 40px; height: 22px; border-radius: 11px; flex-shrink: 0;
  background: #2c2552; box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.14); transition: background-color 160ms var(--kw-ease), box-shadow 160ms var(--kw-ease);
}
.kw-dv:not([aria-disabled='true']):hover .kw-dv-track { background: #3f3868; }
.kw-dv[data-on] .kw-dv-track { background: #6c58e0; box-shadow: none; }
.kw-dv[data-on]:not([aria-disabled='true']):hover .kw-dv-track { background: #8270f5; }
.kw-dv[data-armed] .kw-dv-track, .kw-dv[data-armed]:hover .kw-dv-track {
  background: color-mix(in srgb, var(--dv-armed) 12%, var(--kw-surface-side)); box-shadow: inset 0 0 0 2px var(--dv-armed);
}
.kw-dv-knob {
  position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--kw-surface-side); box-shadow: inset 0 0 0 2px theme('colors.zinc.300');
  transition: transform 160ms var(--kw-ease);
}
.kw-dv[data-knob='right'] .kw-dv-knob { transform: translateX(18px); }
.kw-dv[data-on] .kw-dv-knob { background: theme('colors.zinc.50'); box-shadow: none; }
.kw-dv[data-on] .kw-dv-knob::after { content: ''; position: absolute; left: 5px; top: 5px; width: 6px; height: 6px; border-radius: 50%; background: #6c58e0; }
.kw-dv[data-armed] .kw-dv-knob { background: color-mix(in srgb, var(--dv-armed) 25%, var(--kw-surface-side)); box-shadow: inset 0 0 0 2px var(--dv-armed); }
.kw-dv[data-armed] .kw-dv-knob::after { display: none; }
.kw-dv-lock { position: absolute; left: 6px; top: 6px; color: rgb(247 246 255 / 0.85); }
.kw-dv[data-armed] .kw-dv-lock { color: var(--dv-armed); }
/* Reduced motion: the same shapes, instant */
.kw-dv-rm, .kw-dv-rm * { transition: none !important; }
@keyframes kw-dv-hint { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }

/* The space controls block (explainer spec §1): two identical rows, Dev mode and Approvals. Full
   sidebar content width, so it lines up with the nav rows below. */
.kw-sc { margin-top: 6px; border: 1px solid rgb(255 255 255 / 0.07); border-radius: 12px; background: rgb(255 255 255 / 0.025); }
.kw-sc-row { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; column-gap: 10px; align-items: center; min-height: 40px; padding: 6px 6px 6px 10px; }
.kw-sc-row + .kw-sc-row { border-top: 1px solid rgb(255 255 255 / 0.07); }
.kw-sc-icon { display: block; }
.kw-sc-label { display: flex; align-items: center; gap: 4px; min-width: 0; font-size: 14px; line-height: 20px; font-weight: 500; color: theme('colors.zinc.100'); }
.kw-sc-help {
  position: relative; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 6px; flex-shrink: 0;
  color: theme('colors.zinc.500');
}
.kw-sc-help:hover { color: theme('colors.zinc.300'); }
.kw-sc-help[data-open] { color: theme('colors.sky.300'); background: rgb(157 143 255 / 0.14); }
.kw-sc-help:focus-visible { outline: 2px solid theme('colors.sky.400'); outline-offset: 1px; }
.kw-sc-sub {
  grid-column: 2 / 4; display: flex; align-items: center; gap: 6px; min-width: 0;
  font-size: 12px; line-height: 18px; color: theme('colors.zinc.400');
}
.kw-sc-sub[data-tone='warn'] { color: var(--dv-led-warn); }
.kw-sc-sub-text { display: flex; min-width: 0; overflow: hidden; white-space: nowrap; }
.kw-sc-repo { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: theme('colors.zinc.200'); font-weight: 400; }
.kw-sc-branch { flex-shrink: 0; color: theme('colors.sky.300'); font-weight: 500; }
.kw-sc-led[data-s='off'] { background: transparent; box-shadow: inset 0 0 0 1.5px theme('colors.zinc.500'); }
/* Answer 3: the Approvals row while loading. Same grid and height as the row, no text. */
.kw-sc-skel { display: block; border-radius: 9999px; background: rgb(255 255 255 / 0.06); animation: kw-sc-skel 1.4s ease-in-out infinite; }
.kw-sc-skel-icon { width: 16px; height: 16px; border-radius: 5px; }
.kw-sc-skel-line { width: 72px; height: 10px; }
.kw-sc-skel-chip { width: 56px; height: 24px; }
.kw-sc-skel-sub { width: 120px; height: 8px; margin-block: 5px; }
.kw-sc-phone .kw-sc-skel-chip { margin-block: 10px; }
@keyframes kw-sc-skel { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
.kw-sc-act {
  margin-left: auto; flex-shrink: 0; display: inline-flex; align-items: center; min-height: 24px; padding: 0 2px; border-radius: 6px;
  font-size: 12px; line-height: 18px; font-weight: 600; color: theme('colors.sky.300');
}
.kw-sc-act:hover { color: theme('colors.sky.200'); }
.kw-sc-act:focus-visible, .kw-sc-value:focus-visible { outline: 2px solid theme('colors.sky.400'); outline-offset: 2px; }
.kw-sc-value { display: inline-flex; align-items: center; gap: 2px; border-radius: 9999px; padding-left: 0; }
.kw-sc-chip {
  display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 9999px; font-size: 12px; line-height: 18px; font-weight: 500;
  background: rgb(255 255 255 / 0.04); box-shadow: inset 0 0 0 1px var(--kw-hairline-strong, rgb(255 255 255 / 0.14)); color: theme('colors.zinc.200');
}
.kw-sc-value:hover .kw-sc-chip { background: rgb(255 255 255 / 0.07); }
.kw-sc-chip[data-tone='warn'] { background: rgb(252 211 77 / 0.10); box-shadow: inset 0 0 0 1px rgb(252 211 77 / 0.30); color: #fcd34d; }
.kw-sc-phone .kw-sc-row { min-height: 52px; padding: 4px 4px 4px 12px; }
.kw-sc-phone .kw-sc-sub { margin-top: -6px; padding-bottom: 4px; }
.kw-sc-phone .kw-sc-help { margin: -10px; width: 44px; height: 44px; }
.kw-sc-phone .kw-sc-help[data-open] { background: none; }
.kw-sc-phone .kw-sc-act { min-height: 44px; padding: 0 4px; margin-block: -12px; }
.kw-sc-phone .kw-sc-value { min-height: 44px; }

/* The explainer (spec §4): a popover beside the sidebar on desktop, a bottom sheet on phones. */
.kw-dvx {
  background: #231d4b; border: 1px solid rgb(255 255 255 / 0.14); color: theme('colors.zinc.300');
  box-shadow: 0 18px 48px -12px rgb(6 3 20 / 0.85), inset 0 1px 0 rgb(255 255 255 / 0.05);
}
.kw-dvx-pop { position: fixed; z-index: 60; width: 368px; border-radius: 16px; padding: 16px 16px 14px; animation: kw-dvx-in 160ms var(--kw-ease) both; }
@keyframes kw-dvx-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.kw-dvx-arrow {
  position: absolute; left: -6px; width: 11px; height: 11px; background: #231d4b; transform: rotate(45deg);
  border-left: 1px solid rgb(255 255 255 / 0.14); border-bottom: 1px solid rgb(255 255 255 / 0.14);
}
.kw-dvx-kicker { font: 600 10.5px/16px 'JetBrains Mono', ui-monospace, monospace; letter-spacing: .08em; text-transform: uppercase; color: theme('colors.sky.300'); padding-right: 28px; }
.kw-dvx-title { margin-top: 4px; font-size: 17px; line-height: 24px; font-weight: 600; color: theme('colors.zinc.50'); padding-right: 20px; }
.kw-dvx-lead { margin-top: 8px; font-size: 14px; line-height: 22px; color: theme('colors.zinc.300'); }
.kw-dvx-list { margin-top: 12px; padding-top: 12px; border-top: 1px solid rgb(255 255 255 / 0.08); display: flex; flex-direction: column; gap: 8px; font-size: 12.5px; line-height: 18px; color: theme('colors.zinc.400'); }
.kw-dvx-list li { display: flex; gap: 10px; align-items: baseline; }
.kw-dvx-list strong { font-weight: 600; color: theme('colors.zinc.100'); }
.kw-dvx-n { font: 600 10.5px/18px 'JetBrains Mono', ui-monospace, monospace; color: theme('colors.sky.300'); flex-shrink: 0; }
.kw-dvx-trust { margin-top: 12px; display: flex; gap: 8px; padding: 8px 10px; border-radius: 10px; background: rgb(255 255 255 / 0.04); font-size: 12px; line-height: 18px; color: theme('colors.zinc.400'); }
.kw-dvx-trust strong { font-weight: 600; color: theme('colors.zinc.100'); }
.kw-dvx-actions { margin-top: 14px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.kw-dvx-primary {
  display: inline-flex; align-items: center; justify-content: center; height: 36px; padding: 0 14px; border-radius: 10px;
  background: linear-gradient(135deg, #745bef, #5b47d6); color: #fff; font-size: 14px; font-weight: 600;
}
/* Hover deepens like kw-btn-primary (26g): brightness(1.08) put white text near 3.9:1. The longhand beats the base
   rule's background shorthand by specificity (.kw-dvx-primary:hover is 0,2,0). */
.kw-dvx-primary:hover { background-image: linear-gradient(135deg, theme('colors.sky.600') 0%, theme('colors.sky.700') 100%); }
.kw-dvx-guide { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 600; color: theme('colors.sky.300'); border-radius: 6px; }
.kw-dvx-guide:hover { color: theme('colors.sky.200'); }
.kw-dvx-owner { font-size: 12px; line-height: 18px; color: theme('colors.zinc.400'); }
.kw-dvx-note { margin-top: 10px; font-size: 12px; line-height: 18px; color: theme('colors.zinc.500'); }
.kw-dvx-close {
  position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; color: theme('colors.zinc.400');
}
.kw-dvx-close:hover { color: theme('colors.zinc.100'); background: rgb(255 255 255 / 0.06); }
.kw-dvx-primary:focus-visible, .kw-dvx-guide:focus-visible, .kw-dvx-close:focus-visible { outline: 2px solid theme('colors.sky.400'); outline-offset: 2px; }
.kw-dvx-layer { position: fixed; inset: 0; z-index: 70; display: flex; flex-direction: column; justify-content: flex-end; }
.kw-dvx-scrim { position: absolute; inset: 0; background: rgb(6 3 20 / 0.6); animation: kw-dvx-fade 200ms var(--kw-ease) both; }
@keyframes kw-dvx-fade { from { opacity: 0; } to { opacity: 1; } }
.kw-dvx-sheet {
  position: relative; width: 100%; max-height: 88vh; overflow-y: auto; overscroll-behavior: contain; border-radius: 20px 20px 0 0; border-bottom: 0;
  padding: 12px 20px calc(20px + env(safe-area-inset-bottom)); animation: kw-dvx-up 200ms var(--kw-ease) both;
}
@keyframes kw-dvx-up { from { transform: translateY(100%); } to { transform: none; } }
/* Answer 1: the switch's knob turns into a small spinner only while its request is in flight. */
/* Answer 1: the knob carries a plain border spinner while the PUT is in flight (no gradient). */
.kw-dv[data-saving] .kw-dv-knob::after {
  content: ''; position: absolute; left: 2px; top: 2px; width: 12px; height: 12px; box-sizing: border-box; border-radius: 50%;
  background: none; border: 2px solid #6c58e0; border-top-color: transparent; animation: kw-dv-saving 800ms linear infinite;
}
@keyframes kw-dv-saving { to { rotate: 360deg; } }
/* Answer 4: closing mirrors the open, 150 ms down (none under reduced motion, below). */
.kw-dvx-sheet[data-closing] { animation: kw-dvx-down 150ms var(--kw-ease) both; }
.kw-dvx-scrim[data-closing] { animation: kw-dvx-fade-out 150ms var(--kw-ease) both; }
@keyframes kw-dvx-down { from { transform: none; } to { transform: translateY(100%); } }
@keyframes kw-dvx-fade-out { from { opacity: 1; } to { opacity: 0; } }
.kw-dvx-grab { display: block; width: 36px; height: 4px; border-radius: 2px; margin: 0 auto 12px; background: theme('colors.zinc.600'); }
.kw-dvx-sheet .kw-dvx-close { top: 6px; right: 6px; width: 44px; height: 44px; }
.kw-dvx-sheet .kw-dvx-actions { flex-direction: column; align-items: stretch; gap: 8px; }
.kw-dvx-sheet .kw-dvx-primary { height: 44px; width: 100%; }
.kw-dvx-sheet .kw-dvx-guide { justify-content: center; min-height: 44px; }
@media (prefers-reduced-motion: reduce) {
  .kw-dv-track, .kw-dv-knob { transition: none !important; }
  .kw-dvx-pop, .kw-dvx-sheet, .kw-dvx-scrim, .kw-dvx-sheet[data-closing], .kw-dvx-scrim[data-closing] { animation: none; }
  .kw-sc-skel { animation: none; }
  .kw-dv[data-saving] .kw-dv-knob::after { animation: none; }
}
/* The flip note under the space header: HEAD → dev / merged into main, one caret blink */
.kw-dv-note { animation: kw-dv-hint 150ms var(--kw-ease) both; }
.kw-dv-note .dv-caret { animation-iteration-count: 1; }

/* The </> badge on a space tile: bottom-right, mirroring the unread badge top-right */
.kw-dev-badge {
  position: absolute; right: -6px; bottom: -5px; height: 15px; padding: 0 3px; border-radius: 5px;
  display: inline-flex; align-items: center; gap: 1px; pointer-events: none;
  background: #1a1538; box-shadow: 0 0 0 1.5px var(--kw-dev-behind, #0a0719), inset 0 0 0 1px rgb(157 143 255 / 0.6);
  font: 700 10px/1 'JetBrains Mono', ui-monospace, monospace; color: #b8adff;
  animation: kw-dv-pop 160ms var(--kw-ease) both;
}
.kw-dev-caret { display: inline-block; width: 1.5px; height: 8px; background: currentColor; animation: kw-dv-caret 900ms steps(1) 4; }
@keyframes kw-dv-pop { from { opacity: 0; transform: scale(0.6); } to { opacity: 1; transform: none; } }
@keyframes kw-dv-caret { 0% { opacity: 1; } 50% { opacity: 0; } }

/* The AI model badge, bottom-left on a bot's avatar: the mirror of the status dot (model-badge brief). */
.kw-model-badge {
  position: absolute; left: -2px; bottom: -2px; z-index: 2; border-radius: 9999px;
  display: flex; align-items: center; justify-content: center;
}
.kw-mb-layer { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.kw-mb-spark { position: absolute; top: -3px; left: -6px; line-height: 1; text-shadow: 0 0 2px theme('colors.zinc.950'), 0 0 2px theme('colors.zinc.950'); }
.kw-mb-in { animation: kw-mb-in 150ms ease-out both; }
.kw-mb-out { animation: kw-mb-out 150ms ease-out both; }
@keyframes kw-mb-in { from { opacity: 0; } }
@keyframes kw-mb-out { to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .kw-mb-in { animation: none; }
  .kw-mb-out { display: none; }
}

/* The hard hat: top-left on avatars of 28 px and up, so it never covers the status dot */
.kw-dev-hat {
  position: absolute; left: -4px; top: -4px; width: 14px; height: 14px; border-radius: 9999px; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  background: #0a0719; box-shadow: 0 0 0 1.5px #0e0a21;
  animation: kw-dv-pop 160ms var(--kw-ease) both;
}

/* The blueprint grid: only the main pane, fading down it; cards stay opaque on top. The pane's own
   root background goes transparent so the grid sits between the surface and the content. */
.kw-blueprint { position: relative; isolation: isolate; background-color: var(--kw-surface-main); }
.kw-blueprint > * { background-color: transparent !important; }
.kw-blueprint::before {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(to right, rgb(157 143 255 / 0.085) 1px, transparent 1px),
    linear-gradient(to bottom, rgb(157 143 255 / 0.085) 1px, transparent 1px),
    linear-gradient(to right, rgb(157 143 255 / 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgb(157 143 255 / 0.045) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgb(0 0 0 / 0.25) 100%);
  mask-image: linear-gradient(180deg, #000 0%, rgb(0 0 0 / 0.25) 100%);
  animation: kw-dv-grid 200ms var(--kw-ease) both;
}
@keyframes kw-dv-grid { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .kw-dv, .kw-dv * { transition: none !important; }
  .kw-dv-note, .kw-dev-badge, .kw-dev-hat, .kw-blueprint::before { animation: none; }
  .kw-dev-caret { animation: none; }
}

/* Dev mode setup sheet: 180 ms entry (design §3). */
.kw-dv-sheet { animation: kw-dv-sheet-in 180ms var(--kw-ease) both; }
@keyframes kw-dv-sheet-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .kw-dv-sheet { animation: none; } }

/* =================================================================================================
   Dev mode style v2 (Mira, dev-mode/design/style-v2/tokens.css, dark only). Verbatim from tokens.css:
   the --t1..--t5 and --accent aliases the classes use, the new --dv-* tokens, and the .dv-* component classes.
   Shared by Pixel (PX-*) and Iris (IR-*); keep this block identical on every branch.
   ================================================================================================= */
:root {
  --t1: #f7f6ff; --t2: #ecebfa; --t3: #bcb7de; --t4: #9a94c4; --t5: #8d87b8;
  --accent: #b8adff;            /* sky-300: accent text */
  --accent-strong: #9d8fff;     /* sky-400: working / accent strokes */
  --accent-fill: #6c58e0;       /* sky-600: toggles on */
  --accent-gradient: linear-gradient(135deg, #745bef 0%, #5b47d6 100%);
  --accent-soft: linear-gradient(135deg, rgb(122 98 240 / .22) 0%, rgb(91 71 214 / .10) 100%);
  /* Pixel's names for the same shades (PX-* classes use --dv-t*, --dv-accent*) */
  --dv-t1: var(--t1); --dv-t2: var(--t2); --dv-t3: var(--t3); --dv-t4: var(--t4); --dv-t5: var(--t5);
  --dv-accent: var(--accent); --dv-accent-strong: var(--accent-strong);
  /* new Dev tokens (style v2) */
  --dv-code-bg: rgb(10 7 25 / .72);          /* command boxes, diff excerpts, sha chips */
  --dv-add: #5eead4;  --dv-add-bg: rgb(94 234 212 / .10);
  --dv-del: #fda4af;  --dv-del-bg: rgb(253 164 175 / .12);
  --dv-led-ok: #5eead4; --dv-led-run: #9d8fff; --dv-led-warn: #fcd34d; --dv-led-bad: #fda4af; --dv-led-off: #8d87b8;
  --dv-rail: rgb(157 143 255 / .38);         /* git rail line */
  --dv-hazard: #fbbf24;                      /* production floor edge only */
  --dv-stamp: #5eead4;                       /* LGTM ink */
  --dv-kbd-bg: #231d4b; --dv-kbd-bd: rgb(255 255 255 / .18);
  --dv-caret: #b8adff;
  --dv-armed: #fcd34d;                       /* the switch's armed state (amber = "press again") */
  --dv-warn-bd: rgb(252 211 77 / .35); --dv-warn-bg: rgb(252 211 77 / .10);
  --dv-bad-bd: rgb(253 164 175 / .35); --dv-bad-bg: rgb(253 164 175 / .10);
  --dv-ok-bd: rgb(94 234 212 / .30); --dv-ok-bg: rgb(94 234 212 / .08);
  --dv-floor-bd: rgb(245 158 11 / .30); --dv-floor-bg: rgb(69 26 3 / .20);
  --dv-allow: #d97706;
}

/* §2.1 LED: an 8 px dot with a crisp 2 px ring in its own colour at 28 %. Never a glow blob.
   off is hollow, so off vs on is shape as well as colour. Always next to words. */
.dv-led { position: relative; display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  background: var(--c); box-shadow: 0 0 0 2px color-mix(in srgb, var(--c) 28%, transparent); --c: var(--dv-led-off); }
.dv-led[data-s="ok"] { --c: var(--dv-led-ok); }
.dv-led[data-s="run"] { --c: var(--dv-led-run); }
.dv-led[data-s="warn"] { --c: var(--dv-led-warn); }
.dv-led[data-s="bad"] { --c: var(--dv-led-bad); }
.dv-led[data-s="off"] { background: transparent; box-shadow: inset 0 0 0 1.5px var(--c); }
/* run: a ring that grows and fades, 1.2 s, only while the thing is actually running */
.dv-led[data-s="run"]::after { content: ''; position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid var(--c);
  animation: dv-ping 1.2s var(--kw-ease) infinite; }
/* ping: one 200 ms pop when a check finishes (the "Checked 14:32" moment) */
.dv-led[data-ping]::after { content: ''; position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid var(--c); animation: dv-ping 200ms var(--kw-ease) 1 both; }
@keyframes dv-ping { from { transform: scale(1); opacity: .9; } to { transform: scale(2.4); opacity: 0; } }

/* 0.8.0 B3: the pre-push card's running LED is static (Mira b3 "no spinner, no pulse"), and
   "not installed" is a dashed hollow LED. */
.dv-led.dv-led-still::after { animation: none !important; opacity: .5; transform: scale(1.6); }
.dv-led.dv-led-dashed { box-shadow: none; border: 1.5px dashed var(--c); background: transparent; }
/* The fresh-eyes chip keeps its size; its hit area grows on touch (b3 §3). */
.fe-chip { position: relative; }
.fe-chip::after { content: ''; position: absolute; inset: -6px; }
/* 24 px chip + 2 x 10 px = 44 px tall on phone (Mira ui-check-458 Later 3). */
@media (max-width: 639px) { .fe-chip::after { inset: -10px -6px; } }
.fe-pop { animation: fe-in 150ms var(--kw-ease) both; }
@keyframes fe-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .fe-pop { animation: none; } }

/* §2.2 Diff stat: mono numbers plus a 32x4 split bar (add | del). Our own shape, not a block meter. */
.dv-stat { display: inline-flex; align-items: center; gap: 6px; font: 500 11.5px/1 'JetBrains Mono', monospace; white-space: nowrap; }
.dv-stat .a { color: var(--dv-add); } .dv-stat .d { color: var(--dv-del); }
.dv-bar { display: inline-flex; gap: 1px; width: 32px; height: 4px; border-radius: 2px; overflow: hidden; background: var(--kw-hairline-strong); }
.dv-bar i { display: block; height: 100%; }
.dv-bar i.a { background: var(--dv-add); } .dv-bar i.d { background: var(--dv-del); }

/* §2.3 Mono chips: sha, branch flow, path, login */
.dv-sha { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 6px; border-radius: 6px; border: 1px solid var(--kw-hairline); background: var(--dv-code-bg);
  font: 500 11px/1 'JetBrains Mono', monospace; color: var(--t3); white-space: nowrap; }
button.dv-sha { cursor: copy; } button.dv-sha:hover { color: var(--accent); border-color: var(--kw-hairline-strong); }
/* The "Pushed · … · branch" meta line keeps the branch whole, cut with … and the full name in title (22c). */
.dv-sha.dv-sha-whole { display: inline-block; max-width: 100%; height: auto; padding: 1px 5px; line-height: 18px; vertical-align: bottom;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* A branch inside a sentence wraps with the text (pre-push one-line cards, Mira ui-check-475 must-fix 1). */
.dv-sha.dv-sha-wrap { display: inline; height: auto; white-space: normal; overflow-wrap: anywhere;
  padding: 1px 5px; line-height: 20px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.dv-branch { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; height: 22px; padding: 0 7px; border-radius: 6px; border: 1px solid var(--kw-hairline); background: var(--dv-code-bg);
  font: 500 11px/1 'JetBrains Mono', monospace; color: var(--t3); min-width: 0; }
.dv-branch .h { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--t2); }
/* A long branch wraps instead of being cut off (pre-push card at 390 px, Ada review-458 Later 9). */
.dv-branch.dv-branch-wrap { height: auto; min-height: 22px; padding-top: 4px; padding-bottom: 4px; align-items: flex-start; line-height: 14px; }
.dv-branch.dv-branch-wrap svg.i { flex-shrink: 0; margin-top: 1.5px; }
.dv-branch.dv-branch-wrap .h { white-space: normal; overflow-wrap: anywhere; overflow: visible; min-width: 0; }
.dv-branch .arr { color: var(--t5); }
.dv-branch svg.i { width: 11px; height: 11px; color: var(--accent); }
.dv-code { font: 500 0.92em/1 'JetBrains Mono', monospace; color: var(--accent); }

/* §2.4 kbd */
.dv-kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 5px;
  background: var(--dv-kbd-bg); border: 1px solid var(--dv-kbd-bd); border-bottom-width: 2px; font: 600 10.5px/1 'JetBrains Mono', monospace; color: var(--t2); vertical-align: middle; }

/* §2.5 Caret: blinks 4 times (900 ms steps) then stays solid. Static under reduced motion. */
.dv-caret { display: inline-block; width: 7px; height: 14px; margin-left: 2px; vertical-align: -2px; background: var(--dv-caret); border-radius: 1px; animation: dv-blink 900ms steps(1) 4; }
@keyframes dv-blink { 50% { opacity: 0; } }

/* §3 Status line (S5) */
.dv-statusline { display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap; min-height: 40px; padding: 8px 24px; border-bottom: 1px solid var(--kw-hairline);
  background: color-mix(in srgb, var(--kw-surface-side) 70%, transparent); font-size: 12.5px; line-height: 18px; color: var(--t3); }
.dv-statusline .txt { flex: 1 1 260px; min-width: 0; display: flex; align-items: center; gap: 8px; }
.dv-statusline .txt > span { min-width: 0; }
.dv-statusline b { color: var(--t1); font-weight: 600; }
.dv-statusline .act { display: inline-flex; align-items: center; gap: 4px; min-height: 28px; padding: 0 8px; border-radius: 7px; color: var(--accent); font-weight: 500; border: 1px solid var(--kw-hairline-strong); background: transparent; font-size: 12px; cursor: pointer; }
.dv-statusline .checked { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--t5); font-variant-numeric: tabular-nums; }

/* §4 git rail: a line down the left of What landed, one node per card */
.dv-rail { position: relative; padding-left: 30px; }
.dv-rail::before { content: ''; position: absolute; left: 11px; top: 4px; bottom: 4px; width: 2px; border-radius: 1px; background: var(--dv-rail); }
.dv-node { position: absolute; left: -25px; top: 22px; width: 12px; height: 12px; border-radius: 50%; background: var(--kw-surface-main); box-shadow: inset 0 0 0 2px var(--c); --c: var(--dv-led-off); }
.dv-node[data-s="ok"] { --c: var(--dv-led-ok); background: var(--c); box-shadow: 0 0 0 3px var(--kw-surface-main); }
.dv-node[data-s="bad"] { --c: var(--dv-led-bad); background: var(--c); box-shadow: 0 0 0 3px var(--kw-surface-main); }
.dv-node[data-s="bad"]::after { content: ''; position: absolute; inset: 3px; background: var(--kw-surface-main); clip-path: polygon(20% 0,50% 30%,80% 0,100% 20%,70% 50%,100% 80%,80% 100%,50% 70%,20% 100%,0 80%,30% 50%,0 20%); }
.dv-node[data-s="run"] { --c: var(--dv-led-run); }
.dv-node[data-s="run"]::before { content: ''; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--c); animation: dv-ping 1.2s var(--kw-ease) infinite; }
/* merge arc: the PR's branch joining the line. Direct pushes have no arc. */
.dv-arc { position: absolute; left: -19px; top: 6px; width: 14px; height: 20px; border: 2px solid var(--dv-rail); border-left: 0; border-bottom: 0; border-top-right-radius: 12px; }
.dv-arc::after { content: ''; position: absolute; right: -5px; top: -5px; width: 8px; height: 8px; border-radius: 50%; background: var(--kw-surface-main); box-shadow: inset 0 0 0 2px var(--dv-rail); }

/* §5 LGTM stamp: ink, not foil. Teal, double rule, -6deg, one 180 ms stamp-in. Not a sticker. */
.dv-stamp { display: inline-flex; flex-direction: column; align-items: center; padding: 3px 9px 2px; border: 2px solid var(--dv-stamp); border-radius: 7px; color: var(--dv-stamp);
  transform: rotate(-6deg); outline: 1px solid var(--dv-stamp); outline-offset: -5px; line-height: 1; user-select: none;
  -webkit-mask-image: radial-gradient(circle at 30% 40%, #000 0 58%, rgb(0 0 0 / .82) 59% 61%, #000 62%), repeating-linear-gradient(115deg, #000 0 3px, rgb(0 0 0 / .86) 3px 4px);
  -webkit-mask-composite: source-in; mask-composite: intersect;
  animation: dv-stamp 180ms var(--kw-ease) 1 both; }
.dv-stamp b { font: 800 13px/1 'JetBrains Mono', monospace; letter-spacing: .14em; padding: 3px 0 1px; }
.dv-stamp small { font: 600 8.5px/1 'JetBrains Mono', monospace; letter-spacing: .06em; text-transform: uppercase; padding-bottom: 2px; opacity: .9; }
@keyframes dv-stamp { from { transform: rotate(-6deg) scale(1.3); opacity: 0; } to { transform: rotate(-6deg) scale(1); opacity: 1; } }

/* §6 terminal empty state */
.dv-term { border: 1px dashed var(--kw-hairline-strong); border-radius: 12px; padding: 18px 20px 20px; }
.dv-term pre { margin: 0 0 12px; font: 500 12px/20px 'JetBrains Mono', monospace; color: var(--t4); white-space: pre-wrap; overflow-wrap: anywhere; }
.dv-term .ps { color: var(--accent); }
.dv-term .out { color: var(--t3); }
.dv-term h4 { margin: 0; font-size: 14px; font-weight: 600; color: var(--t1); }
.dv-term p { margin: 2px 0 0; font-size: 12.5px; color: var(--t4); }

/* §7 production floor edge: 4 px hazard tape across the top of the floor card. Only on the floor. */
.dv-floor { position: relative; overflow: hidden; border: 1px solid var(--dv-floor-bd); background: var(--dv-floor-bg); border-radius: 10px; }
.dv-floor::before { content: ''; display: block; height: 4px; background: repeating-linear-gradient(-45deg, var(--dv-hazard) 0 6px, transparent 6px 12px); opacity: .8; }
.dv-cmd { border: 1px solid var(--kw-hairline); background: var(--dv-code-bg); border-radius: 8px; overflow: hidden; }
.dv-cmd .bar { display: flex; align-items: center; gap: 6px; padding: 5px 10px; border-bottom: 1px solid var(--kw-hairline); font: 500 11px/1 'JetBrains Mono', monospace; color: var(--t5); }
.dv-cmd pre { margin: 0; padding: 9px 10px; font: 500 12px/19px 'JetBrains Mono', monospace; color: var(--t1); white-space: pre-wrap; word-break: break-all; }
.dv-cmd pre .ps { color: var(--accent); user-select: none; }

@media (prefers-reduced-motion: reduce) {
  .kw-dict-spin, .kw-dict-pop { animation: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  .dv-led::after, .dv-led[data-ping]::after, .dv-node::before, .dv-caret, .dv-stamp { animation: none !important; }
  .dv-led[data-s="run"]::after { opacity: .5; transform: scale(1.6); }
}
/* §2.4 kbd chips are desktop only */
@media (max-width: 639px) { .dv-kbd { display: none; } }

/* 0.7.7 ready-made teams: the preview sheet rises 8 px (dialog) or 24 px (phone sheet). Opacity and transform only. */
@keyframes t-rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@keyframes t-sheet {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: none; }
}

/* What's new › All changes: the CHANGELOG section (Mira's design.md, All changes) */
[data-whats-new-all] .markdown-content { font-size: 13.5px; line-height: 21px; color: #bcb7de; }
[data-whats-new-all] h3 { margin: 18px 0 8px; font-size: 12px; line-height: 18px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em; color: #9a94c4; }
[data-whats-new-all] .markdown-content > h3:first-child { margin-top: 4px; }
[data-whats-new-all] ul { margin: 0; }
[data-whats-new-all] li { line-height: 21px; }
/* beats Tailwind's .space-y-1 > :not([hidden]) ~ :not([hidden]) (0,3,0) on the renderer's ul */
[data-whats-new-all] ul > li:not([hidden]) + li:not([hidden]) { margin-top: 8px; }
[data-whats-new-all] li::marker { color: #5a5383; }
[data-whats-new-all] strong { color: #ecebfa; }

/* 0.8.1 F3: the card a team chat's pointer line lands on gets a 1.2 s ring (opacity only), so the eye finds it. */
.kw-prepush-flash::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; display: none; }
@keyframes kw-prepush-flash { 0% { opacity: 0; } 13.3% { opacity: 1; } 86.7% { opacity: 1; } 100% { opacity: 0; } }
/* Off by default; on only when motion is allowed, so reduced motion never sees it. */
@media (prefers-reduced-motion: no-preference) {
  .kw-prepush-flash::after { display: block; box-shadow: 0 0 0 2px rgb(157 143 255 / 0.6); opacity: 0; animation: kw-prepush-flash 1.2s linear 1 both; }
}

/* H5: a row entering the pinned "Needs you" block (reordering inside it is not animated) */
@keyframes kw-pin-enter {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: no-preference) {
  .kw-pin-enter { animation: kw-pin-enter 160ms ease-out; }
}

/* Dictation (design.md §4, §6): the spinner turns in 0.9 s, the popover rises 4 px in 140 ms; both still under reduced motion. */
.kw-dict-spin { animation: kw-dict-spin 0.9s linear infinite; }
@keyframes kw-dict-spin { to { transform: rotate(360deg); } }
.kw-dict-pop { animation: kw-dict-pop 140ms ease-out both; }
@keyframes kw-dict-pop { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Fix it "Send to…" (#609, design §8): the picker's popover and phone sheet. Static under reduced motion. */
@keyframes kw-st-pop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes kw-st-sheet { from { transform: translateY(100%); } to { transform: none; } }
@media (prefers-reduced-motion: no-preference) {
  .kw-st-pop { animation: kw-st-pop 140ms ease-out both; }
  .kw-st-sheet { animation: kw-st-sheet 180ms ease-out both; }
}

/* 22i Needs-you strip (design.md §2 Motion): it leaves by fading 120 ms, and stepping between asks
   cross-fades the ask 120 ms (opacity only). Nothing moves under reduced motion. */
@keyframes kw-needs-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@media (prefers-reduced-motion: no-preference) {
  .kw-needs-fade { animation: kw-needs-fade 120ms var(--kw-ease, ease-out); }
  .kw-needs-leave { opacity: 0; transition: opacity 120ms var(--kw-ease, ease-out); }
}