/* ============================================================
   dot.css — Dot-inspired Hub interface
   Step 1: static shell (gallery + chat) with the Dot aesthetic.
   ============================================================ */

:root {
  --bg-top: #2a1b3d;
  --bg-bottom: #050309;
  --glass: rgba(255, 255, 255, 0.07);
  --glass-strong: rgba(255, 255, 255, 0.11);
  --hairline: rgba(255, 255, 255, 0.12);
  --text: rgba(255, 255, 255, 0.95);
  --text-dim: rgba(255, 255, 255, 0.55);
  --text-faint: rgba(255, 255, 255, 0.32);
  --accent: #4a9eff;
  --radius: 22px;
  --radius-lg: 30px;
  --ease-spring: cubic-bezier(0.22, 1, 0.36, 1);
  --dot-bg:
    radial-gradient(120% 80% at 50% -10%, rgba(120, 80, 200, 0.45), transparent 60%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 70%);
  --font-display: ui-rounded, "SF Pro Rounded", "Hiragino Maru Gothic ProN",
    system-ui, -apple-system, sans-serif;
  --font-body: -apple-system, system-ui, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--dot-bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

#dot-root {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: var(--dot-bg);
  transition: background 0.6s var(--ease-spring);
}

/* Accent glow that shifts to the active agent's color */
#dot-root::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(90% 60% at 50% 8%, var(--accent), transparent 55%);
  opacity: var(--root-glow, 0.18);
  transition: opacity 0.6s var(--ease-spring), background 0.6s var(--ease-spring);
  pointer-events: none;
}

/* ---------- Views ---------- */
.view {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
}
/* The morph engine drives transform/opacity per-frame via inline styles,
   so these two must NOT carry CSS transitions (they would fight the rAF spring). */
#home-view, #gallery-view, #chat-view, #detail-view {
  transition: none;
  will-change: transform, opacity, filter;
}
#chat-view, #gallery-view, #detail-view {
  transform-origin: 0 0;   /* grow from the tile/card top-left during a zoom */
}
/* L2 visibility is a pure function of the authoritative nav state (data-l2),
   NOT the spring animation (which only drives the grow/shrink transform). This
   makes a stalled animation unable to leave a layer visible/clickable on top. */
#chat-view, #detail-view {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.28s var(--ease-spring),
    visibility 0s linear 0.28s;
}
#dot-root[data-l2="chat"] #chat-view,
#dot-root[data-l2="detail"] #detail-view {
  visibility: visible;
  transition-delay: 0s;
}
#dot-root[data-l2="chat"]   #chat-view   { opacity: 1; pointer-events: auto; }
#dot-root[data-l2="detail"] #detail-view { opacity: 1; pointer-events: auto; }
/* Parent space recedes while an L2 is open (also state-driven, not spring-driven). */
#space-pager { transition: opacity 0.28s var(--ease-spring), filter 0.28s var(--ease-spring); }
#dot-root[data-l2="chat"]   #space-pager,
#dot-root[data-l2="detail"] #space-pager { opacity: 0; filter: blur(10px); pointer-events: none; }
.view.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Status bar (faux 9:41 like the demo) */
.status-bar {
  position: relative;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 26px 4px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: var(--text);
  flex: 0 0 auto;
}
.pwa-status-heading {
  display: none;
}
html.pwa-standalone .status-bar,
html.ios-standalone .status-bar {
  justify-content: space-between;
  min-height: calc(max(env(safe-area-inset-top), 30px) + 74px);
  padding: calc(max(env(safe-area-inset-top), 30px) + 22px) 24px 12px;
  z-index: 80;
  pointer-events: none;
}
html.pwa-standalone .status-bar .clock,
html.ios-standalone .status-bar .clock {
  display: none;
}
html.pwa-standalone .status-right,
html.ios-standalone .status-right {
  position: relative;
  z-index: 2;
  margin-left: auto;
  pointer-events: auto;
}
html.pwa-standalone .pwa-status-heading,
html.ios-standalone .pwa-status-heading {
  min-width: 0;
  max-width: calc(100% - 124px);
  min-height: 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-right: 14px;
  pointer-events: none;
}
html.pwa-standalone .status-kicker,
html.ios-standalone .status-kicker {
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.2px;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
html.pwa-standalone .status-title,
html.ios-standalone .status-title {
  margin-top: 4px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 650;
  letter-spacing: 0;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
html.pwa-standalone .bell-btn,
html.ios-standalone .bell-btn {
  width: 48px;
  height: 48px;
  touch-action: manipulation;
}
html.pwa-standalone #home-view > .space-head,
html.pwa-standalone #gallery-view .space > .space-head,
html.ios-standalone #home-view > .space-head,
html.ios-standalone #gallery-view .space > .space-head {
  display: none;
}

/* ============================================================
   GALLERY VIEW  (zoomed-out: choose an agent)
   ============================================================ */
#gallery-view { padding-bottom: env(safe-area-inset-bottom); }

.gallery-head {
  padding: 8px 28px 18px;
  flex: 0 0 auto;
}
.gallery-kicker {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--text-faint);
}
.gallery-title {
  font-family: var(--font-display);
  font-size: 46px;
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.5px;
  margin-top: 4px;
  color: var(--text);
}

.agent-deck {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 4px 20px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scrollbar-width: none;
}
.agent-deck::-webkit-scrollbar { display: none; }

.agent-card {
  position: relative;
  border-radius: var(--radius-lg);
  padding: 22px 22px 20px;
  background: var(--glass);
  border: 1px solid var(--hairline);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.4s var(--ease-spring), background 0.3s ease;
  --card-accent: #4a9eff;
}
.agent-card:active { transform: scale(0.975); }
.agent-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(80% 120% at 0% 0%, var(--card-accent), transparent 60%);
  opacity: 0.22;
  pointer-events: none;
}

.agent-card-name {
  position: relative;
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: -0.6px;
}
.agent-card-role {
  position: relative;
  margin-top: 8px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.4px;
  color: var(--card-accent);
  filter: brightness(1.5);
}
.agent-card-summary {
  position: relative;
  margin-top: 10px;
  font-size: 15px;
  line-height: 1.4;
  color: var(--text-dim);
  max-width: 90%;
}
.agent-card-dot {
  position: absolute;
  top: 22px;
  right: 22px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--card-accent);
  box-shadow: 0 0 14px var(--card-accent);
}
/* pulsing dot while one of the agent's conversations is thinking */
@keyframes agent-thinking { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.55); opacity: 0.45; } }
.agent-card.thinking .agent-card-dot { animation: agent-thinking 1s ease-in-out infinite; }

/* ============================================================
   CHAT VIEW  (zoomed-in: talk to the agent)
   ============================================================ */
.chat-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 20px 10px;
  flex: 0 0 auto;
  z-index: 3;
}
.chat-head > div:not(.chat-head-spacer) {
  min-width: 0;
}
.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--hairline);
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: var(--text);
  font-size: 20px;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: 0 0 auto;
  transition: transform 0.2s var(--ease-spring), background 0.2s ease;
}
.icon-btn:active { transform: scale(0.9); }

/* ===== Desktop chrome (Slice 4) — only with a fine pointer; never on touch. ===== */
#desktop-chrome { display: none; }
.has-pointer #desktop-chrome {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 95;
  pointer-events: none;          /* overlay is transparent to gestures... */
}
.has-pointer #desktop-chrome > * { pointer-events: auto; }   /* ...controls re-enable it */

/* Level indicator (breadcrumb), top-center */
.dpad-crumbs {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 13px;
  color: var(--text);
  background: var(--glass);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 6px 14px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.dpad-crumbs:empty { display: none; }
.dpad-crumb { background: none; border: 0; color: inherit; font: inherit; padding: 0; cursor: default; opacity: 0.6; }
.dpad-crumb.link { opacity: 1; cursor: pointer; }
.dpad-crumb.link:hover { text-decoration: underline; }
.dpad-sep { opacity: 0.4; }

/* Edge arrows for switching spaces at L1 — shown only when at a space */
.dpad-arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid var(--hairline);
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: var(--text);
  font-size: 24px;
  display: none;
  place-items: center;
  cursor: pointer;
}
.dpad-prev { left: 18px; }
.dpad-next { right: 18px; }
#desktop-chrome.at-space .dpad-arrow { display: grid; }
.dpad-arrow:disabled { opacity: 0.25; cursor: default; }

/* Zoom +/- cluster, bottom-right */
.dpad-zoom {
  position: fixed;
  right: 18px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 22px);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dpad-zoom .icon-btn:disabled { opacity: 0.25; cursor: default; }
/* In a chat/reader (L2) the chat-back button + input bar own the bottom; hide the
   floating bottom cluster so it never overlaps the mic. */
#desktop-chrome.in-l2 .dpad-zoom,
#desktop-chrome.in-l2 .dpad-hint { display: none; }

/* One-time hint, bottom-center */
.dpad-hint {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 22px);
  display: flex;
  gap: 10px;
  align-items: center;
  background: var(--glass);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 8px 8px 8px 16px;
  font-size: 13px;
  color: var(--text);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.dpad-hint.hidden { display: none; }
.dpad-hint-x { background: none; border: 0; color: var(--text); cursor: pointer; font-size: 16px; line-height: 1; padding: 0 4px; }

/* Keyboard focus ring on the top-level Home grid (desktop only) */
.has-pointer .space-tile:focus-visible {
  outline: 2px solid var(--accent, #9b8cff);
  outline-offset: 4px;
}

.chat-agent-name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-agent-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.chat-agent-status {
  font-size: 12px;
  color: var(--accent);
  filter: brightness(1.4);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-agent-status .status-activity,
.chat-agent-status .status-model {
  display: block;
  white-space: nowrap;
}
.chat-head-spacer { flex: 1 1 auto; }

/* Mode toggle: text / push-to-talk / conversation */
.mode-toggle {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--hairline);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.mode-btn {
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 600;
  padding: 7px 13px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.25s var(--ease-spring);
}
.mode-btn.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 16px -4px var(--accent);
}

/* Slideable content pane (horizontal agent swipe moves this) */
.chat-pane {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  will-change: transform, opacity;
}

/* Peeking neighbor labels at the screen edges during a horizontal swipe */
.peek-label {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -1px;
  color: var(--text);
  opacity: 0;
  pointer-events: none;
  z-index: 2;
  transition: opacity 0.15s linear;
}
.peek-left  { left: 18px; }
.peek-right { right: 18px; }

/* Giant watermark agent name behind transcript */
.chat-watermark {
  position: absolute;
  top: 64px;
  left: 22px;
  font-family: var(--font-display);
  font-size: 88px;
  font-weight: 700;
  line-height: 0.88;
  letter-spacing: -2px;
  color: var(--text);
  opacity: 0.06;
  pointer-events: none;
  z-index: 0;
}

.transcript {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 18px 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: none;
}
.transcript::-webkit-scrollbar { display: none; }

.transcript-hint {
  margin: auto;
  color: var(--text-faint);
  font-size: 15px;
  text-align: center;
  padding: 24px;
}
.bubble pre {
  margin: 8px 0 2px;
  padding: 10px 12px;
  background: rgba(0,0,0,0.28);
  border-radius: 12px;
  overflow-x: auto;
  font-size: 13px;
}
.bubble code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.92em; }
.bubble a { color: inherit; text-decoration: underline; }

.bubble {
  max-width: 82%;
  padding: 13px 17px;
  border-radius: 20px;
  font-size: 16px;
  line-height: 1.42;
  overflow-wrap: anywhere;   /* long URLs wrap inside the bubble */
  word-break: break-word;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--hairline);
  animation: bubble-in 0.4s var(--ease-spring) both;
}
.bubble.user {
  align-self: flex-end;
  background: var(--glass-strong);
  border-bottom-right-radius: 6px;
}
.bubble.agent {
  align-self: flex-start;
  background: rgba(120, 80, 200, 0.18);
  border-bottom-left-radius: 6px;
}
@keyframes bubble-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

/* Page dots (agent position indicator) */
.page-dots {
  display: flex;
  justify-content: center;
  gap: 7px;
  padding: 4px 0 8px;
  flex: 0 0 auto;
}
.page-dots .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-faint);
  transition: all 0.3s var(--ease-spring);
}
.page-dots .dot.active {
  width: 20px;
  border-radius: 3px;
  background: var(--text);
}
.page-dots .dot.edge { transform: scale(0.55); opacity: 0.5; }   /* hint there are more */

/* Pending prompt attachments. The tray is a separate flex row above the
   composer so image previews never squeeze the text input on narrow phones. */
.attachment-tray {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  padding: 2px 18px 6px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
  touch-action: pan-x;
  flex: 0 0 auto;
  z-index: 3;
}
.attachment-tray::-webkit-scrollbar { display: none; }
.attachment-tray.hidden { display: none; }
.attachment-chip {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  max-width: min(230px, 72vw);
  min-height: 48px;
  padding: 5px 32px 5px 6px;
  border: 1px solid var(--hairline);
  border-radius: 13px;
  background: var(--glass-strong);
  color: var(--text);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  flex: 0 0 auto;
}
.attachment-thumb {
  width: 44px;
  height: 44px;
  border-radius: 9px;
  object-fit: cover;
  flex: 0 0 auto;
}
.attachment-file {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--accent);
  font-size: 18px;
  flex: 0 0 auto;
}
.attachment-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  line-height: 1.2;
}
.attachment-remove {
  position: absolute;
  top: 50%;
  right: 5px;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.28);
  color: var(--text);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.attachment-remove:active { transform: translateY(-50%) scale(0.9); }

/* Bottom input bar (+ / paperclip / Chat… / mic) */
.input-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px calc(16px + env(safe-area-inset-bottom));
  flex: 0 0 auto;
  z-index: 3;
}
.input-pill {
  flex: 1 1 auto;
  min-width: 0;
  height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--hairline);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  outline: none;
}
.input-pill::placeholder { color: var(--text-dim); }
.input-pill:focus { border-color: var(--accent); }
.attachment-btn svg {
  width: 19px;
  height: 19px;
  pointer-events: none;
}
.mic-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: 0 0 auto;
  box-shadow: 0 6px 20px -6px var(--accent);
  transition: transform 0.2s var(--ease-spring);
  /* Press-and-hold must not trigger text selection / iOS callout / scrolling */
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.mic-btn:active { transform: scale(0.9); }
.mic-btn svg { width: 22px; height: 22px; pointer-events: none; }   /* events target the button */
.mic-btn.recording {
  background: #ff4b4b;
  box-shadow: 0 0 0 0 rgba(255, 75, 75, 0.55);
  animation: mic-pulse 1.2s ease-out infinite;
}
.mic-btn.pulsing { box-shadow: 0 0 18px -2px var(--accent); }
@keyframes mic-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(255, 75, 75, 0.55); }
  100% { box-shadow: 0 0 0 18px rgba(255, 75, 75, 0); }
}

/* Small "step 1 — static shell" build badge */
.build-badge {
  position: fixed;
  bottom: 6px;
  right: 10px;
  font-size: 10px;
  letter-spacing: 0.5px;
  color: var(--text-faint);
  z-index: 50;
  pointer-events: none;
}

/* ============================================================
   Notifications (step 6) — Dot-themed bell, panel, toasts
   ============================================================ */
.status-right { display: flex; align-items: center; gap: 12px; }

.bell-btn {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--hairline);
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.2s var(--ease-spring), background 0.2s ease;
}
.bell-btn:active { transform: scale(0.9); }
.bell-btn svg { width: 19px; height: 19px; }
.bell-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #ff3b6b;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
  box-shadow: 0 0 12px rgba(255, 59, 107, 0.7);
}
.bell-badge.hidden { display: none; }

/* Slide-in panel */
.notif-scrim {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease-spring);
}
.notif-scrim.open { opacity: 1; pointer-events: auto; }

.notif-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 61;
  width: min(92vw, 420px);
  display: flex;
  flex-direction: column;
  pointer-events: none;
  visibility: hidden;
  transform: translateX(102%);
  transition:
    transform 0.4s var(--ease-spring),
    visibility 0s linear 0.4s;
  background:
    radial-gradient(120% 50% at 100% 0%, rgba(120, 80, 200, 0.28), transparent 60%),
    linear-gradient(180deg, rgba(28, 20, 44, 0.96), rgba(8, 5, 16, 0.97));
  border-left: 1px solid var(--hairline);
  backdrop-filter: blur(30px) saturate(140%);
  -webkit-backdrop-filter: blur(30px) saturate(140%);
  padding-top: env(safe-area-inset-top);
}
.notif-panel.open {
  pointer-events: auto;
  visibility: visible;
  transform: translateX(0);
  transition-delay: 0s;
}

.notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 12px;
  flex: 0 0 auto;
}
.notif-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.4px;
}

.notif-enable {
  margin: 0 16px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  border-radius: 16px;
  border: 1px solid var(--hairline);
  background: var(--glass);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
}
.notif-enable .notif-enable-cta {
  font-weight: 700;
  color: #fff;
  background: linear-gradient(180deg, #9a7dff, #7e56d6);
  padding: 6px 14px;
  border-radius: 999px;
  box-shadow: 0 6px 18px -6px rgba(126, 86, 214, 0.8);
}
.notif-enable.hidden { display: none; }

.notif-list {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px 16px calc(24px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: none;
}
.notif-list::-webkit-scrollbar { display: none; }

.notif-card {
  position: relative;
  padding: 14px 16px 14px 18px;
  border-radius: 18px;
  background: var(--glass);
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--c, var(--accent));
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  animation: notif-in 0.35s var(--ease-spring) both;
  overflow-wrap: anywhere;
}
@keyframes notif-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.notif-card .nc-title { font-size: 15px; font-weight: 600; color: var(--text); }
.notif-card .nc-body  { margin-top: 4px; font-size: 14px; line-height: 1.4; color: var(--text-dim); }
.notif-card .nc-meta  { margin-top: 8px; font-size: 11.5px; letter-spacing: 0.3px; color: var(--text-faint); text-transform: uppercase; }
.notif-card .nc-dot   { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--c, var(--accent)); margin-right: 6px; vertical-align: middle; }

.notif-empty {
  margin: auto;
  text-align: center;
  color: var(--text-faint);
  font-size: 15px;
  padding: 40px 24px;
}

/* Live toasts */
.toast-stack {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 12px);
  left: 0;
  right: 0;
  z-index: 70;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  padding: 0 12px;
}
.toast {
  pointer-events: auto;
  width: min(92vw, 440px);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 16px;
  border-radius: 16px;
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--c, var(--accent));
  background:
    radial-gradient(120% 100% at 0% 0%, rgba(120, 80, 200, 0.18), transparent 60%),
    rgba(20, 14, 30, 0.86);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  box-shadow: 0 18px 50px -16px rgba(0, 0, 0, 0.7);
  cursor: pointer;
  transform: translateY(-22px);
  opacity: 0;
  transition: transform 0.4s var(--ease-spring), opacity 0.3s ease;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast .t-title { font-size: 14.5px; font-weight: 600; color: var(--text); }
.toast .t-body { margin-top: 2px; font-size: 13px; line-height: 1.35; color: var(--text-dim);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.toast .t-dot { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; background: var(--c, var(--accent)); box-shadow: 0 0 10px var(--c, var(--accent)); }

/* ============================================================
   Multi-space pager (step 7) — Today / Agents / Library / Settings
   ============================================================ */
.space-tabs {
  display: flex;
  gap: 4px;
  margin: 4px 20px 6px;
  padding: 4px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--hairline);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  flex: 0 0 auto;
}
.space-tab {
  flex: 1 1 0;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 6px;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.2s, background 0.25s var(--ease-spring);
}
.space-tab.active { color: #fff; background: rgba(255, 255, 255, 0.14); }

.space-pager {
  flex: 1 1 auto;
  display: flex;
  overflow-x: hidden;        /* no user swipe between spaces — navigate via Home pinch */
  overflow-y: hidden;
  scrollbar-width: none;
  min-height: 0;
}
.space-pager::-webkit-scrollbar { display: none; }

.space {
  flex: 0 0 100%;
  width: 100%;
  scroll-snap-align: start;
  overflow-y: auto;
  scrollbar-width: none;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.space::-webkit-scrollbar { display: none; }

.space-head { padding: 6px 28px 16px; flex: 0 0 auto; }
.space-kicker {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--text-faint);
}
.space-title {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.5px;
  margin-top: 4px;
  color: var(--text);
}

/* agent deck inside a space: the space scrolls, not the deck */
.space .agent-deck { flex: 0 0 auto; overflow: visible; padding-top: 0; }

.space-body {
  padding: 0 20px calc(28px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Generic Dot card (today / library) */
.dot-card {
  position: relative;
  padding: 16px 18px 16px 18px;
  border-radius: var(--radius);
  background: var(--glass);
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--c, var(--accent));
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
}
.dot-card.tappable { cursor: pointer; transition: transform 0.2s var(--ease-spring), background 0.2s; }
.dot-card.tappable:active { transform: scale(0.985); }
.dot-card .dc-title { font-size: 16px; font-weight: 600; color: var(--text); }
.dot-card .dc-body { margin-top: 6px; font-size: 14px; line-height: 1.45; color: var(--text-dim); }
.dot-card .dc-meta { margin-top: 10px; font-size: 11.5px; letter-spacing: 0.3px; text-transform: uppercase; color: var(--text-faint); }
.dot-card .dc-tags { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.dot-card .dc-tag { font-size: 11px; padding: 3px 9px; border-radius: 999px; background: rgba(255,255,255,0.08); color: var(--text-dim); }

.bos-scope-switch {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.bos-scope-btn {
  min-width: 0;
  min-height: 58px;
  border: 1px solid var(--hairline);
  border-radius: 16px;
  padding: 10px 9px;
  background: rgba(255,255,255,0.055);
  color: var(--text-dim);
  font-family: var(--font-body);
  text-align: center;
  cursor: pointer;
}
.bos-scope-btn.active {
  background: rgba(255,255,255,0.14);
  color: var(--text);
  border-color: rgba(255,255,255,0.24);
}
.bos-scope-btn strong {
  display: block;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.2px;
  line-height: 1.1;
}
.bos-scope-btn span {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.15;
  color: var(--text-faint);
}
.bos-scope-btn.active span {
  color: var(--text-dim);
}

.bos-opi-voice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 10px 12px;
  border: 1px solid rgba(128, 255, 227, 0.24);
  border-radius: 14px;
  background: rgba(128, 255, 227, 0.08);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
}
.bos-opi-voice strong {
  display: block;
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
}
.bos-opi-voice span {
  display: block;
  margin-top: 2px;
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.3;
}
.bos-opi-voice-btn {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid rgba(128, 255, 227, 0.3);
  border-radius: 999px;
  background: rgba(128, 255, 227, 0.13);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}
.bos-opi-voice-btn.active {
  border-color: rgba(255, 107, 143, 0.38);
  background: rgba(255, 107, 143, 0.15);
}
.bos-opi-voice-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}
.bos-opi-inline {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid rgba(127, 255, 227, 0.24);
  border-radius: 15px;
  background: rgba(127, 255, 227, 0.07);
}
.bos-opi-inline.thinking {
  border-color: rgba(74, 158, 255, 0.34);
  background: rgba(74, 158, 255, 0.08);
}
.bos-opi-inline-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.bos-opi-inline-head strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 950;
}
.bos-opi-inline-head span {
  color: var(--text-faint);
  font-size: 11.5px;
  font-weight: 800;
}
.bos-opi-inline-body {
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.bos-opi-inline-body p,
.bos-opi-inline-body ul,
.bos-opi-inline-body ol {
  margin: 0 0 8px;
}
.bos-opi-inline-body :last-child {
  margin-bottom: 0;
}
.bos-opi-inline-body a {
  color: inherit;
  text-decoration: underline;
}

.bos-summary {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--hairline);
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
}
.bos-summary strong {
  display: block;
  color: var(--text);
  font-size: 17px;
  font-weight: 700;
}
.bos-summary span {
  display: block;
  margin-top: 4px;
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.35;
}
.bos-summary-counts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.bos-summary-counts span {
  margin: 0;
  min-height: 34px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: rgba(255,255,255,0.07);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.bos-kanban {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.bos-lane {
  min-width: 0;
  padding: 12px;
  border-radius: var(--radius);
  border: 1px solid var(--hairline);
  background: rgba(255,255,255,0.055);
}
.bos-lane-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 0 2px 10px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}
.bos-lane-head::before {
  flex: 0 0 auto;
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 5px;
  background: var(--c, var(--accent));
  box-shadow: 0 0 12px var(--c, var(--accent));
}
.bos-lane-head > div {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  gap: 3px;
}
.bos-lane-head > div > span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.bos-lane-head small {
  display: block;
  min-width: 0;
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0;
  text-transform: none;
}
.bos-lane-count {
  flex: 0 0 auto;
  min-width: 28px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255,255,255,0.09);
  color: var(--text-dim);
  font-size: 12px;
}
.bos-lane-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bos-lane-list .dot-card {
  border-radius: 18px;
  padding: 14px 15px;
}
.bos-lane-empty {
  min-height: 52px;
  display: grid;
  align-items: center;
  padding: 0 4px;
  color: var(--text-faint);
  font-size: 14px;
  line-height: 1.35;
}

@media (min-width: 760px) {
  .bos-summary-counts {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .bos-kanban {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.section-label {
  margin: 10px 4px 2px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-faint);
}
.space-empty { margin: 32px auto; color: var(--text-faint); font-size: 15px; text-align: center; }

/* Quick capture and asset grids for top-level mobile spaces */
.dot-quickadd {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
  padding: 10px;
  border-radius: var(--radius);
  background: var(--glass);
  border: 1px solid var(--hairline);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.dot-quickadd.collapsed {
  gap: 0;
}
.dot-collapse-trigger,
.bookmark-filter-toggle {
  width: 100%;
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--hairline);
  border-radius: 16px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.06);
  color: var(--text);
  font-family: var(--font-body);
  text-align: left;
  cursor: pointer;
}
.dot-collapse-trigger strong,
.bookmark-filter-toggle strong {
  display: block;
  font-size: 15px;
  font-weight: 800;
}
.dot-collapse-trigger small,
.bookmark-filter-toggle small {
  display: block;
  margin-top: 2px;
  color: var(--text-dim);
  font-size: 12.5px;
  line-height: 1.25;
}
.dot-collapse-cta,
.bookmark-filter-cta {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(255,255,255,0.1);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}
.dot-quick-row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.dot-quick-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.78fr);
  gap: 10px;
}
.dot-quick-input {
  min-width: 0;
  flex: 1 1 auto;
  height: 42px;
  border: none;
  outline: none;
  border-radius: 999px;
  padding: 0 14px;
  background: rgba(255,255,255,0.08);
  color: var(--text);
  font-size: 15px;
}
.dot-quick-input::placeholder { color: var(--text-dim); }
.dot-field {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dot-field span {
  padding-left: 2px;
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}
.dot-field input,
.dot-field select,
.dot-field textarea {
  min-width: 0;
  max-width: 100%;
  width: 100%;
  border: 1px solid var(--hairline);
  outline: none;
  border-radius: 14px;
  padding: 10px 11px;
  background: rgba(255,255,255,0.08);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
}
.dot-field input,
.dot-field select {
  height: 42px;
}
.dot-field textarea {
  min-height: 76px;
  resize: vertical;
  line-height: 1.4;
}
.dot-field textarea::placeholder { color: var(--text-faint); }
.dot-field input:focus,
.dot-field select:focus,
.dot-field textarea:focus { border-color: var(--accent); }
.dot-quick-btn {
  flex: 0 0 auto;
  height: 42px;
  border: none;
  border-radius: 999px;
  padding: 0 16px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 18px -8px var(--accent);
}
.dot-quick-btn:disabled { opacity: 0.55; cursor: default; }
.dot-form-error {
  padding: 9px 11px;
  border-radius: 12px;
  background: rgba(255, 75, 75, 0.12);
  border: 1px solid rgba(255, 75, 75, 0.22);
  color: #ffb3b3;
  font-size: 13px;
  line-height: 1.35;
}
.dot-form-error.hidden { display: none; }

.asset-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--hairline);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.asset-tab {
  flex: 1 1 0;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 700;
  padding: 9px 8px;
  border-radius: 999px;
  cursor: pointer;
}
.asset-tab.active { color: #fff; background: rgba(255,255,255,0.14); }
.asset-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.asset-card {
  min-width: 0;
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--c, var(--accent));
  border-radius: 18px;
  background: var(--glass);
  color: var(--text);
  padding: 10px;
  cursor: pointer;
  text-align: left;
  overflow: hidden;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transition: transform 0.2s var(--ease-spring), background 0.2s;
}
.asset-card:active { transform: scale(0.985); }
.asset-card-processing {
  cursor: progress;
  opacity: 0.78;
}
.asset-card-processing .video-thumb span { color: #ffd36b; }
.asset-status {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
  padding: 0 12px 12px;
}
.asset-thumb {
  width: 100%;
  aspect-ratio: 1;
  display: block;
  border-radius: 12px;
  object-fit: cover;
  background: rgba(255,255,255,0.06);
}
.video-thumb {
  display: grid;
  place-items: center;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.asset-video-poster {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
}
.asset-video-poster .asset-thumb {
  height: 100%;
  border-radius: 0;
}
.asset-video-poster.video-thumb-fallback::before {
  content: "Video";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.asset-video-play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(0,0,0,0.62);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 3px 14px rgba(0,0,0,0.35);
}
.asset-label {
  margin-top: 8px;
  font-size: 12.5px;
  line-height: 1.25;
  color: var(--text-dim);
  overflow-wrap: anywhere;
}

.bookmark-tools {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius);
  background: var(--glass);
  border: 1px solid var(--hairline);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.bookmark-filter-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bookmark-filter-panel.hidden {
  display: none;
}
.bookmark-search {
  display: flex;
  gap: 10px;
  align-items: center;
}
.bookmark-query {
  min-width: 0;
  flex: 1 1 auto;
  height: 42px;
  border: 1px solid var(--hairline);
  outline: none;
  border-radius: 999px;
  padding: 0 14px;
  background: rgba(255,255,255,0.08);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
}
.bookmark-query::placeholder { color: var(--text-faint); }
.bookmark-query:focus { border-color: var(--accent); }
.bookmark-submit,
.bookmark-clear {
  flex: 0 0 auto;
  height: 42px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 0 14px;
  background: rgba(255,255,255,0.08);
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.bookmark-submit {
  border-color: transparent;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 18px -10px var(--accent);
}
.bookmark-submit:not(.pending) {
  background: rgba(255,255,255,0.08);
  border-color: var(--hairline);
  color: var(--text-dim);
  box-shadow: none;
}
.bookmark-grid,
.bookmark-custom-dates {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.bookmark-custom-dates.hidden { display: none; }
.bookmark-field {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.bookmark-field span {
  padding-left: 2px;
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}
.bookmark-field select,
.bookmark-field input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--hairline);
  outline: none;
  border-radius: 14px;
  padding: 0 11px;
  background: rgba(255,255,255,0.08);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
}
.bookmark-field select:focus,
.bookmark-field input:focus { border-color: var(--accent); }
.bookmark-tags {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 1px;
  scrollbar-width: none;
}
.bookmark-tags::-webkit-scrollbar { display: none; }
.bookmark-tag {
  flex: 0 0 auto;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: var(--text-dim);
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.bookmark-tag.active {
  border-color: transparent;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 18px -10px var(--accent);
}
.bookmark-count {
  padding: 0 2px;
  color: var(--text-faint);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
}
.bookmark-results {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Settings rows */
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-radius: var(--radius);
  background: var(--glass);
  border: 1px solid var(--hairline);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.setting-row.tappable { cursor: pointer; transition: transform 0.2s var(--ease-spring), background 0.2s; }
.setting-row.tappable:active { transform: scale(0.985); background: rgba(255,255,255,0.1); }
.setting-row .sr-main { min-width: 0; }
.setting-row .sr-title { font-size: 16px; font-weight: 600; color: var(--text); }
.setting-row .sr-sub { margin-top: 3px; font-size: 13px; color: var(--text-dim); }
.setting-row .sr-cta { flex: 0 0 auto; font-size: 18px; color: var(--text-faint); }
.setting-row.danger .sr-title { color: #ff6b6b; }
.setting-row.danger .sr-cta { color: #ff6b6b; }
.setting-row.notification-setting {
  width: 100%;
  color: inherit;
  font: inherit;
  text-align: left;
  appearance: none;
  -webkit-appearance: none;
}
.setting-row.notification-setting:disabled {
  cursor: default;
  opacity: 1;
}
.settings-control {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 9px;
}
.settings-switch {
  position: relative;
  flex: 0 0 auto;
  --switch-x: 0px;
  width: 50px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.14);
  box-shadow: inset 0 1px 5px rgba(0,0,0,0.22);
  transition: background 0.22s var(--ease-spring), border-color 0.22s var(--ease-spring);
}
.settings-switch > span {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.28);
  transform: translateX(var(--switch-x));
  transition: transform 0.22s var(--ease-spring);
}
.settings-switch.on {
  --switch-x: 20px;
  border-color: rgba(80, 235, 184, 0.55);
  background: linear-gradient(180deg, #50ebb8, #1eaa87);
}
.settings-switch.busy > span {
  animation: settingsSwitchPulse 0.85s ease-in-out infinite alternate;
}
.settings-action-pill {
  flex: 0 0 auto;
  min-width: 62px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.1);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
}
.voice-settings-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.voice-agent-row {
  --voice-accent: var(--accent);
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius);
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--voice-accent);
  background: var(--glass);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.voice-agent-label {
  min-width: 0;
}
.voice-agent-label strong,
.voice-agent-label span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.voice-agent-label strong {
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
}
.voice-agent-label span {
  margin-top: 2px;
  color: var(--text-dim);
  font-size: 12.5px;
}
.voice-agent-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px 48px;
  gap: 8px;
  align-items: center;
}
.voice-select {
  min-width: 0;
  width: 100%;
  height: 44px;
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 0 34px 0 12px;
  background:
    linear-gradient(45deg, transparent 50%, var(--text-dim) 50%) right 16px center / 6px 6px no-repeat,
    linear-gradient(135deg, var(--text-dim) 50%, transparent 50%) right 10px center / 6px 6px no-repeat,
    rgba(255,255,255,0.08);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  appearance: none;
  -webkit-appearance: none;
}
.voice-select:focus {
  outline: none;
  border-color: var(--voice-accent);
}
.voice-preview-btn {
  width: 44px;
  height: 44px;
  border: 1px solid var(--hairline);
  border-radius: 14px;
  background: rgba(255,255,255,0.1);
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}
.voice-preview-btn:disabled {
  opacity: 0.55;
  cursor: default;
}
.voice-save-status {
  min-width: 48px;
  color: #50ebb8;
  font-size: 12px;
  font-weight: 800;
  opacity: 0;
  text-align: right;
  transition: opacity 0.18s;
}
.voice-save-status.visible { opacity: 1; }
.voice-save-status.error { color: #ff8d9a; }
@keyframes settingsSwitchPulse {
  from { opacity: 0.58; transform: translateX(var(--switch-x)) scale(0.96); }
  to { opacity: 1; transform: translateX(var(--switch-x)) scale(1); }
}

@media (max-width: 380px) {
  .settings-control { gap: 7px; }
  .settings-action-pill {
    min-width: 54px;
    padding-inline: 8px;
  }
  .voice-agent-controls {
    grid-template-columns: minmax(0, 1fr) 42px;
  }
  .voice-save-status {
    grid-column: 1 / -1;
    min-height: 15px;
    text-align: left;
  }
}

/* ============================================================
   Home (L0) — spaces as pinchable tiles (zoom-stack)
   ============================================================ */
#home-view { padding-bottom: env(safe-area-inset-bottom); }
.home-deck {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 4px 20px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scrollbar-width: none;
}
.home-deck::-webkit-scrollbar { display: none; }

.space-tile {
  position: relative;
  border-radius: var(--radius-lg);
  padding: 26px 24px;
  min-height: 116px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--glass);
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--c, var(--accent));
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.4s var(--ease-spring), background 0.3s ease;
}
.space-tile:active { transform: scale(0.975); }
.space-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(80% 120% at 0% 0%, var(--c, var(--accent)), transparent 60%);
  opacity: 0.18;
  pointer-events: none;
}
.space-tile .tile-name {
  position: relative;
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 600;
  letter-spacing: -0.5px;
}
.space-tile .tile-sub {
  position: relative;
  margin-top: 6px;
  font-size: 15px;
  line-height: 1.4;
  color: var(--text-dim);
}

/* Live host snapshot on the final Home card. */
.system-space-tile {
  min-height: 202px;
  gap: 2px;
}
.system-tile-heading {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.system-home-state {
  flex: 0 0 auto;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--c) 45%, var(--hairline));
  background: color-mix(in srgb, var(--c) 13%, transparent);
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.system-home-metrics {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}
.system-home-metric {
  min-width: 0;
}
.system-home-metric-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 6px;
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.system-home-metric-head strong {
  color: var(--system-color, var(--text-dim));
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}
.system-home-track {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
}
.system-home-track span {
  display: block;
  width: var(--system-value, 0%);
  height: 100%;
  border-radius: inherit;
  background: var(--system-color, var(--c));
  transition: width 0.5s ease, background 0.3s ease;
}
.system-home-meta {
  position: relative;
  margin-top: 10px;
  color: var(--text-faint);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.system-home-meta.error { color: #ff9aa6; }

/* ============================================================
   System space — Dot-native port of the legacy Monitor view
   ============================================================ */
.system-space-body {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  gap: 14px;
}
.system-monitor-loading,
.system-monitor-error {
  padding: 24px 20px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--glass);
  color: var(--text-dim);
  text-align: center;
}
.system-monitor-error strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
}
.system-retry-btn {
  margin-top: 14px;
  padding: 9px 14px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: var(--glass-strong);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}
.system-info-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.system-info-chip,
.system-freshness {
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: var(--glass);
  color: var(--text-faint);
  font-size: 11px;
  line-height: 1;
}
.system-info-chip:first-child {
  color: var(--text);
  border-color: color-mix(in srgb, #7fdcff 35%, var(--hairline));
}
.system-freshness { margin-left: auto; }
.system-rings {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 12px;
}
.system-ring-widget {
  position: relative;
  min-height: 142px;
  display: grid;
  place-items: center;
  padding: 14px 8px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(135%);
  -webkit-backdrop-filter: blur(20px) saturate(135%);
}
.system-ring {
  display: block;
  width: 108px;
  height: 108px;
}
.system-ring-fill {
  transition: stroke-dashoffset 0.55s ease, stroke 0.3s ease;
}
.system-ring-copy {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  text-align: center;
}
.system-ring-value {
  color: var(--system-color, var(--text));
  font-size: 21px;
  font-weight: 750;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.system-ring-label {
  margin-top: 4px;
  color: var(--text-dim);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.system-ring-sub {
  max-width: 92px;
  margin-top: 3px;
  overflow: hidden;
  color: var(--text-faint);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.system-section {
  padding: 16px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(135%);
  -webkit-backdrop-filter: blur(20px) saturate(135%);
}
.system-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.system-section-title {
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.system-section-note {
  color: var(--text-faint);
  font-size: 10px;
}
.system-cores-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.system-core-heading {
  margin-bottom: 7px;
  color: var(--text-faint);
  font-size: 11px;
}
.system-core-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 7px;
  min-height: 20px;
}
.system-core-label,
.system-core-pct {
  color: var(--text-faint);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}
.system-core-label { text-align: right; }
.system-core-pct { text-align: right; }
.system-core-track {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
}
.system-core-fill {
  height: 100%;
  border-radius: inherit;
  transition: width 0.45s ease, background 0.3s ease;
}
.system-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 10px;
}
.system-stat-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--hairline);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.045);
  text-align: center;
}
.system-stat-value {
  overflow: hidden;
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.system-stat-label {
  margin-top: 3px;
  color: var(--text-faint);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.system-io-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.system-io-card {
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--hairline);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.045);
}
.system-io-head {
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 700;
}
.system-io-rate {
  margin-top: 4px;
  color: var(--text);
  font-size: 17px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}
.system-io-total {
  margin-top: 4px;
  color: var(--text-faint);
  font-size: 9px;
}
.system-spark {
  display: block;
  width: 100%;
  height: 34px;
  margin-top: 6px;
}
.system-process-scroll {
  overflow-x: auto;
  scrollbar-width: thin;
}
.system-process-table {
  width: 100%;
  min-width: 480px;
  border-collapse: collapse;
  font-size: 11px;
}
.system-process-table th,
.system-process-table td {
  padding: 8px 7px;
  border-bottom: 1px solid var(--hairline);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.system-process-table th {
  color: var(--text-faint);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.system-process-table th:first-child,
.system-process-table td:first-child {
  max-width: 220px;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.system-process-table tr:last-child td { border-bottom: 0; }

@media (max-width: 680px) {
  .system-rings { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .system-cores-grid { grid-template-columns: 1fr; gap: 14px; }
  .system-freshness { width: 100%; margin-left: 0; }
}

@media (max-width: 520px) {
  .system-space-tile { min-height: 224px; }
  .system-home-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .system-io-grid { grid-template-columns: 1fr; }
  .system-section { padding: 14px; }
}

/* ============================================================
   Detail view (L2) — Today/Library reader
   ============================================================ */
.detail-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 8px 24px calc(28px + env(safe-area-inset-bottom));
  scrollbar-width: none;
  will-change: transform, opacity;
}
.detail-body::-webkit-scrollbar { display: none; }
#detail-title {
  max-width: calc(100vw - 112px);
}
.detail-display {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.5px;
  line-height: 1.06;
  margin: 6px 0 14px;
}
.detail-meta {
  font-size: 12px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 16px;
}
.detail-text {
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  white-space: normal;
  overflow-wrap: anywhere;
}
.detail-text a { color: inherit; text-decoration: underline; }
.detail-media {
  margin: 10px 0 18px;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--hairline);
}
.detail-media img,
.detail-media video {
  display: block;
  width: 100%;
  max-height: 58vh;
  object-fit: contain;
  background: rgba(0,0,0,0.22);
}
.detail-actions { margin-top: 22px; display: flex; flex-direction: column; gap: 10px; }
.detail-action {
  display: block;
  text-align: center;
  padding: 14px 18px;
  border-radius: 16px;
  border: 1px solid var(--hairline);
  background: var(--glass);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transition: transform 0.2s var(--ease-spring), background 0.2s;
}
.detail-action.primary { background: linear-gradient(180deg, #9a7dff, #7e56d6); border-color: transparent; box-shadow: 0 8px 24px -8px rgba(126,86,214,0.8); }
.detail-action:active { transform: scale(0.98); }
.detail-tags { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 6px; }
.detail-tags .dc-tag { font-size: 12px; padding: 4px 11px; border-radius: 999px; background: rgba(255,255,255,0.08); color: var(--text-dim); }

.bos-kiss-summary {
  margin-top: 10px;
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(74, 158, 255, 0.26);
  border-radius: 18px;
  background: rgba(74, 158, 255, 0.08);
}
.bos-blocking-decisions {
  margin-top: 10px;
  padding: 14px;
  border: 1px solid rgba(255, 209, 102, 0.48);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 209, 102, 0.13), rgba(255, 107, 145, 0.07));
}
.bos-blocking-head { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; }
.bos-blocking-head span { color: #ffd166; font-size: 10.5px; font-weight: 950; letter-spacing: 1px; }
.bos-blocking-head h2 { margin: 4px 0 0; color: var(--text); font-size: 20px; }
.bos-blocking-head > strong { color: #ffd166; font-size: 11px; text-align: right; }
.bos-blocking-list { display: grid; gap: 10px; margin-top: 12px; }
.bos-blocking-row { padding: 12px; border: 1px solid rgba(255,255,255,0.11); border-radius: 14px; background: rgba(4,7,14,0.42); }
.bos-blocking-row h3 { margin: 0 0 10px; color: var(--text); font-size: 15px; }
.bos-blocking-row-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.bos-blocking-row-head h3 { margin: 0 0 10px; }
.bos-blocking-row-head span { flex: 0 0 auto; padding: 5px 8px; border-radius: 999px; color: #ffd166; background: rgba(255,209,102,.12); font-size: 10px; font-weight: 950; }
.bos-blocking-row.approved { border-color: rgba(96, 230, 156, .32); background: rgba(36, 132, 91, .11); }
.bos-blocking-row.approved .bos-blocking-row-head span { color: #90ffb1; background: rgba(96,230,156,.12); }
.bos-blocking-row.reblocked { border-color: rgba(255, 150, 96, .42); background: rgba(160, 72, 36, .12); }
.bos-blocking-row.reblocked .bos-blocking-row-head span { color: #ffb17a; background: rgba(255,150,96,.13); }
.bos-blocking-row dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin: 0; }
.bos-blocking-row dl div { min-width: 0; }
.bos-blocking-row dt { color: var(--text-faint); font-size: 10px; font-weight: 950; letter-spacing: .7px; text-transform: uppercase; }
.bos-blocking-row dd { margin: 4px 0 0; color: var(--text); font-size: 12.5px; line-height: 1.4; white-space: pre-wrap; }
.bos-blocking-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.bos-blocking-action-help { display: block; margin-top: 8px; color: var(--text-dim); font-size: 11px; line-height: 1.4; }
@media (max-width: 720px) {
  .bos-blocking-head { display: grid; }
  .bos-blocking-head > strong { text-align: left; }
  .bos-blocking-row dl { grid-template-columns: 1fr; }
}
.bos-kiss-summary.blocked {
  border-color: rgba(255, 209, 102, 0.36);
  background: rgba(255, 209, 102, 0.09);
}
.bos-kiss-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.bos-kiss-topline span,
.bos-kiss-topline strong {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: var(--text);
  font-size: 11.5px;
  font-weight: 950;
  line-height: 1;
}
.bos-kiss-topline span {
  color: #ffd166;
}
.bos-kiss-summary.clear .bos-kiss-topline span {
  color: #90ffb1;
}
.bos-kiss-summary h2 {
  margin: 0;
  max-width: 980px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 650;
  letter-spacing: 0;
  line-height: 1.08;
}
.bos-kiss-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}
.bos-kiss-grid div {
  min-width: 0;
  display: grid;
  gap: 5px;
  padding: 11px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 13px;
  background: rgba(255,255,255,0.055);
}
.bos-kiss-grid span {
  color: var(--text-faint);
  font-size: 10.5px;
  font-weight: 950;
  letter-spacing: 0.7px;
  text-transform: uppercase;
}
.bos-kiss-grid strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 950;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.bos-kiss-grid strong a {
  color: inherit;
  text-decoration: none;
}
.bos-kiss-grid p {
  margin: 0;
  color: var(--text-dim);
  font-size: 12.5px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.bos-kiss-opi-status {
  padding: 9px 11px;
  border: 1px solid rgba(127, 219, 202, 0.22);
  border-radius: 12px;
  background: rgba(127, 219, 202, 0.08);
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}
.bos-kiss-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.bos-kiss-actions .detail-action {
  width: auto;
  min-height: 38px;
  padding: 10px 13px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 900;
}

.bos-pipeline {
  margin-top: 12px;
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(74, 158, 255, 0.24);
  border-radius: 16px;
  background: rgba(74, 158, 255, 0.075);
}
.bos-pipeline-head strong {
  display: block;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}
.bos-pipeline-head span {
  display: block;
  margin-top: 3px;
  color: #9fcaff;
  font-size: 12.5px;
  font-weight: 800;
  line-height: 1.35;
}
.bos-pipeline-current {
  display: grid;
  gap: 4px;
  padding: 11px 12px;
  border: 1px solid rgba(74, 255, 122, 0.24);
  border-radius: 14px;
  background: rgba(74, 255, 122, 0.08);
}
.bos-pipeline-current.blocked {
  border-color: rgba(255, 209, 102, 0.32);
  background: rgba(255, 209, 102, 0.1);
}
.bos-pipeline-current strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 950;
}
.bos-pipeline-current span {
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.3;
}
.bos-pipeline-current small {
  color: var(--text-dim);
  font-size: 12.5px;
  line-height: 1.35;
}
.bos-pipeline-now {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.bos-pipeline-now div {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  background: rgba(255,255,255,0.055);
}
.bos-pipeline-now span {
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.7px;
  text-transform: uppercase;
}
.bos-pipeline-now strong {
  min-width: 0;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 900;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.bos-pipeline-unblock {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(255, 209, 102, 0.34);
  border-radius: 14px;
  background: rgba(255, 209, 102, 0.1);
}
.bos-pipeline-unblock .bos-pipeline-unblock-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.bos-pipeline-unblock .detail-action {
  width: auto;
  min-height: 36px;
  padding: 9px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}
.bos-pipeline-unblock div {
  display: grid;
  gap: 2px;
}
.bos-pipeline-unblock span {
  color: #ffd166;
  font-size: 10.5px;
  font-weight: 950;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}
.bos-pipeline-unblock strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 950;
  line-height: 1.25;
}
.bos-pipeline-unblock p {
  margin: 0;
  color: var(--text-dim);
  font-size: 12.5px;
  line-height: 1.35;
}
.bos-pipeline-unblock dl {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 5px 10px;
  margin: 0;
}
.bos-pipeline-unblock dt {
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.7px;
  text-transform: uppercase;
}
.bos-pipeline-unblock dd {
  margin: 0;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 750;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.bos-pipeline-unblock a {
  width: fit-content;
  max-width: 100%;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border: 1px solid rgba(255, 209, 102, 0.38);
  border-radius: 999px;
  background: rgba(255, 209, 102, 0.16);
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.15;
  text-decoration: none;
}
.bos-pipeline-rail {
  display: grid;
  grid-template-columns: repeat(var(--pipeline-steps, 4), minmax(0, 1fr));
  gap: 6px;
}
.bos-pipeline-rail-dot {
  min-width: 0;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.07);
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 950;
}
.bos-pipeline-rail-dot.done {
  border-color: rgba(74, 255, 122, 0.34);
  background: rgba(74, 255, 122, 0.14);
  color: #90ffb1;
}
.bos-pipeline-rail-dot.active {
  border-color: rgba(74, 158, 255, 0.44);
  background: rgba(74, 158, 255, 0.2);
  color: #9fcaff;
}
.bos-pipeline-rail-dot.blocked,
.bos-pipeline-rail-dot.waiting {
  border-color: rgba(255, 209, 102, 0.36);
  background: rgba(255, 209, 102, 0.14);
  color: #ffd166;
}
.bos-pipeline-steps,
.bos-pipeline-timeline {
  display: grid;
  gap: 8px;
}
.bos-pipeline-disclosure {
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 13px;
  background: rgba(255,255,255,0.045);
  overflow: hidden;
}
.bos-pipeline-disclosure > summary {
  min-height: 38px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 10px 11px;
  cursor: pointer;
  list-style: none;
}
.bos-pipeline-disclosure > summary::-webkit-details-marker {
  display: none;
}
.bos-pipeline-disclosure > summary::after {
  content: "+";
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 800;
}
.bos-pipeline-disclosure[open] > summary::after {
  content: "-";
}
.bos-pipeline-disclosure > summary span {
  min-width: 0;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 900;
}
.bos-pipeline-disclosure > summary small {
  grid-column: 1 / 2;
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 700;
}
.bos-pipeline-disclosure > .bos-pipeline-steps,
.bos-pipeline-disclosure > .bos-pipeline-timeline,
.bos-pipeline-disclosure > .bos-pipeline-policies {
  padding: 0 10px 10px;
}
.bos-pipeline-child-work,
.bos-pipeline-execution-loops {
  display: grid;
  gap: 7px;
}
.bos-pipeline-evidence {
  border-color: rgba(111, 207, 151, 0.2);
}
.bos-pipeline-evidence > .bos-evidence-status,
.bos-pipeline-evidence > .bos-evidence-next,
.bos-pipeline-evidence > .bos-evidence-grid,
.bos-pipeline-evidence > .bos-evidence-list,
.bos-pipeline-evidence > .bos-evidence-artifacts {
  margin: 0 10px 10px;
}
.bos-evidence-status {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  background: rgba(255,255,255,0.055);
}
.bos-evidence-status.active {
  border-color: rgba(111, 207, 151, 0.34);
  background: rgba(111, 207, 151, 0.09);
}
.bos-evidence-status.waiting {
  border-color: rgba(244, 196, 93, 0.34);
  background: rgba(244, 196, 93, 0.08);
}
.bos-evidence-status.reconcile {
  border-color: rgba(255, 117, 168, 0.38);
  background: rgba(255, 117, 168, 0.1);
}
.bos-evidence-status strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 950;
}
.bos-evidence-status span,
.bos-evidence-status small {
  color: var(--text-dim);
  font-size: 11.5px;
  line-height: 1.35;
}
.bos-evidence-status small {
  color: var(--text-faint);
}
.bos-evidence-next {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 8px 10px;
  border-radius: 9px;
  background: rgba(255,255,255,0.045);
}
.bos-evidence-next strong {
  color: var(--text);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.7px;
  text-transform: uppercase;
}
.bos-evidence-next span {
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.35;
}
.bos-evidence-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}
.bos-evidence-grid > div {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 8px;
  border-radius: 9px;
  background: rgba(255,255,255,0.055);
}
.bos-evidence-grid span,
.bos-evidence-artifacts span {
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.7px;
  text-transform: uppercase;
}
.bos-evidence-grid strong {
  color: var(--text);
  font-size: 15px;
  font-weight: 950;
}
.bos-evidence-list {
  display: grid;
  gap: 6px;
}
.bos-evidence-row {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  border-left: 3px solid rgba(244, 196, 93, 0.75);
  border-radius: 8px;
  background: rgba(255,255,255,0.055);
}
.bos-evidence-row.active {
  border-left-color: rgba(111, 207, 151, 0.85);
}
.bos-evidence-row.reconcile {
  border-left-color: rgba(255, 117, 168, 0.9);
  background: rgba(255, 117, 168, 0.075);
}
.bos-evidence-row strong {
  color: var(--text);
  font-size: 12.5px;
  font-weight: 900;
  line-height: 1.25;
}
.bos-evidence-row span,
.bos-evidence-row small {
  color: var(--text-dim);
  font-size: 11.5px;
  line-height: 1.35;
}
.bos-evidence-row small {
  color: var(--text-faint);
}
.bos-evidence-artifacts {
  display: grid;
  gap: 5px;
}
.bos-evidence-artifacts > div {
  display: grid;
  grid-template-columns: minmax(90px, 0.8fr) minmax(70px, 0.5fr) minmax(0, 1.7fr);
  gap: 8px;
  align-items: center;
  padding: 7px 8px;
  border-radius: 8px;
  background: rgba(255,255,255,0.045);
}
.bos-evidence-artifacts strong {
  color: var(--text-dim);
  font-size: 11.5px;
}
.bos-evidence-artifacts code {
  min-width: 0;
  color: var(--text-faint);
  font-size: 10.5px;
  overflow-wrap: anywhere;
}
.bos-pipeline-child-work > .bos-pipeline-child,
.bos-pipeline-execution-loops > .bos-pipeline-loop {
  margin: 0 10px 8px;
}
.bos-pipeline-child-work > .bos-pipeline-child:first-of-type,
.bos-pipeline-execution-loops > .bos-pipeline-loop:first-of-type {
  margin-top: 0;
}
.bos-pipeline-child-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}
.bos-pipeline-child-head strong {
  color: var(--text);
  font-size: 12px;
}
.bos-pipeline-child,
.bos-pipeline-loop {
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  background: rgba(255,255,255,0.055);
  overflow: hidden;
}
.bos-pipeline-loop {
  border-color: rgba(74, 158, 255, 0.18);
  background: rgba(74, 158, 255, 0.06);
}
.bos-pipeline-child summary,
.bos-pipeline-loop summary {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  cursor: pointer;
  list-style: none;
}
.bos-pipeline-child summary::-webkit-details-marker,
.bos-pipeline-loop summary::-webkit-details-marker {
  display: none;
}
.bos-pipeline-child summary span,
.bos-pipeline-loop summary span {
  color: var(--text);
  font-size: 12.5px;
  font-weight: 900;
  line-height: 1.25;
}
.bos-pipeline-child summary small,
.bos-pipeline-loop summary small {
  color: var(--text-faint);
  font-size: 11px;
}
.bos-pipeline-child-body {
  display: grid;
  gap: 7px;
  padding: 0 10px 10px;
}
.bos-pipeline-child-body p,
.bos-pipeline-child-body li {
  margin: 0;
  color: var(--text-dim);
  font-size: 12.5px;
  line-height: 1.35;
}
.bos-pipeline-child-body ul {
  margin: 0;
  padding-left: 18px;
}
.bos-provider-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}
.bos-provider-strip span {
  width: fit-content;
  max-width: 100%;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  background: rgba(255,255,255,0.07);
  color: var(--text-dim);
  font-size: 10.5px;
  font-weight: 900;
  line-height: 1;
  padding: 5px 8px;
  overflow-wrap: anywhere;
}
.bos-provider-strip .open {
  border-color: rgba(74,158,255,0.28);
  background: rgba(74,158,255,0.12);
  color: #a8cbff;
}
.bos-provider-strip .closed {
  border-color: rgba(74,255,122,0.28);
  background: rgba(74,255,122,0.12);
  color: #a7f3d0;
}
.bos-provider-strip .local {
  color: var(--text);
}
.bos-pipeline-child-body small {
  color: var(--text-faint);
  font-size: 11px;
  line-height: 1.35;
}
.bos-pipeline-skill-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}
.bos-pipeline-skill-chips span {
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.7px;
  text-transform: uppercase;
}
.bos-pipeline-skill-chips em {
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  background: rgba(255,255,255,0.07);
  color: var(--text-dim);
  font-size: 10.5px;
  font-style: normal;
  font-weight: 850;
  line-height: 1;
  padding: 4px 7px;
  overflow-wrap: anywhere;
}
.bos-pipeline-child-body code {
  color: var(--text-faint);
  font-size: 11px;
  overflow-wrap: anywhere;
}
.bos-pipeline-step {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}
.bos-pipeline-dot {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.08);
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 900;
}
.bos-pipeline-step.done .bos-pipeline-dot {
  border-color: rgba(74, 255, 122, 0.34);
  background: rgba(74, 255, 122, 0.13);
  color: #90ffb1;
}
.bos-pipeline-step.active .bos-pipeline-dot {
  border-color: rgba(74, 158, 255, 0.42);
  background: rgba(74, 158, 255, 0.18);
  color: #9fcaff;
}
.bos-pipeline-step.waiting .bos-pipeline-dot {
  border-color: rgba(255, 209, 102, 0.34);
  background: rgba(255, 209, 102, 0.12);
  color: #ffd166;
}
.bos-pipeline-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.bos-pipeline-copy strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}
.bos-pipeline-copy span {
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.bos-pipeline-copy small {
  color: var(--text-faint);
  font-size: 11.5px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.bos-pipeline-policies {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.bos-pipeline-policies span,
.bos-pipeline-timeline-head {
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}
.bos-pipeline-policies em {
  max-width: 100%;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: var(--text-dim);
  font-size: 11.5px;
  font-style: normal;
  overflow-wrap: anywhere;
}
.bos-pipeline-event {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  border-left: 2px solid rgba(74, 158, 255, 0.55);
  border-radius: 0 12px 12px 0;
  background: rgba(255,255,255,0.055);
}
.bos-pipeline-event.blocked {
  border-left-color: #ffd166;
}
.bos-pipeline-event strong {
  color: var(--text);
  font-size: 12.5px;
  font-weight: 900;
}
.bos-pipeline-event span {
  color: var(--text-dim);
  font-size: 12.5px;
  line-height: 1.35;
}
.bos-pipeline-event small {
  color: var(--text-faint);
  font-size: 11px;
}

.bos-onion {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}
.bos-onion-head {
  padding: 0 2px 2px;
}
.bos-onion-head strong {
  display: block;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}
.bos-onion-head span {
  display: block;
  margin-top: 3px;
  color: var(--text-faint);
  font-size: 12px;
  line-height: 1.35;
}
.bos-onion-layer {
  border: 1px solid var(--hairline);
  border-radius: 14px;
  background: rgba(255,255,255,0.055);
  overflow: hidden;
}
.bos-onion-layer summary {
  min-height: 46px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  cursor: pointer;
  list-style: none;
}
.bos-onion-layer summary::-webkit-details-marker {
  display: none;
}
.bos-onion-layer summary::after {
  content: "+";
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: var(--text-dim);
  font-size: 15px;
  font-weight: 700;
}
.bos-onion-layer[open] summary::after {
  content: "-";
}
.bos-onion-layer summary span {
  min-width: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}
.bos-onion-layer summary small {
  grid-column: 1 / 2;
  min-width: 0;
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
}
.bos-onion-grid {
  display: grid;
  grid-template-columns: minmax(92px, 0.42fr) minmax(0, 1fr);
  gap: 8px 12px;
  padding: 0 13px 13px;
}
.bos-onion-grid span {
  min-width: 0;
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.bos-onion-grid strong {
  min-width: 0;
  color: var(--text-dim);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.38;
  overflow-wrap: anywhere;
}

.detail-review-controls,
.detail-task-controls {
  margin-top: 20px;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--glass);
  border: 1px solid var(--hairline);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.detail-review-head {
  display: grid;
  gap: 3px;
  margin-bottom: 12px;
}
.detail-review-head strong {
  color: var(--text);
  font-size: 15px;
  font-weight: 900;
}
.detail-review-head span {
  color: var(--text-dim);
  font-size: 12.5px;
  line-height: 1.35;
}
.detail-task-controls.collapsed {
  padding: 12px;
}
.detail-task-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.detail-task-summary-title {
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
}
.detail-task-summary-sub {
  margin-top: 3px;
  color: var(--text-dim);
  font-size: 12.5px;
  line-height: 1.3;
}
.detail-task-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.detail-task-editor-head span {
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
}
.detail-task-editor-head button {
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 7px 11px;
  background: rgba(255,255,255,0.08);
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.detail-review-label,
.detail-task-label {
  display: block;
  margin: 4px 2px 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-faint);
}
.detail-task-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.78fr);
  gap: 10px;
}
.detail-task-field {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}
.detail-task-field span {
  padding-left: 2px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-faint);
}
.detail-task-input,
.detail-task-field input,
.detail-task-field select,
.detail-task-field textarea {
  min-width: 0;
  max-width: 100%;
  width: 100%;
  border: 1px solid var(--hairline);
  border-radius: 16px;
  outline: none;
  padding: 12px 13px;
  background: rgba(0,0,0,0.18);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
}
.detail-task-input {
  height: 46px;
  margin-bottom: 12px;
}
.detail-task-field input,
.detail-task-field select {
  height: 46px;
}
.detail-task-field input[type="date"],
.detail-task-field input[type="time"],
.dot-field input[type="date"],
.dot-field input[type="time"] {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mobile-picker-shell {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 46px;
  display: flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--hairline);
  border-radius: 16px;
  padding: 0 13px;
  background: rgba(0,0,0,0.18);
  color: var(--text);
}
.dot-field .mobile-picker-shell {
  height: 42px;
  border-radius: 14px;
  background: rgba(255,255,255,0.08);
}
.mobile-picker-value {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1;
}
.mobile-picker-shell.empty .mobile-picker-value {
  color: var(--text-faint);
}
.mobile-picker-shell input[type="date"],
.mobile-picker-shell input[type="time"] {
  position: absolute;
  inset: 0;
  width: 100%;
  max-width: 100%;
  height: 100%;
  margin: 0;
  border: 0;
  border-radius: inherit;
  padding: 0;
  background: transparent;
  color: transparent;
  opacity: 0.01;
  appearance: auto;
  -webkit-appearance: auto;
  cursor: pointer;
}
.mobile-picker-shell:focus-within {
  border-color: var(--accent);
}
.detail-task-field textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.42;
}
.detail-task-field textarea::placeholder { color: var(--text-faint); }
.detail-task-input:focus,
.detail-task-field input:focus,
.detail-task-field select:focus,
.detail-task-field textarea:focus { border-color: var(--accent); }
.detail-review-content,
.detail-review-guidance {
  width: 100%;
  min-height: 96px;
  resize: vertical;
  border: 1px solid var(--hairline);
  border-radius: 16px;
  outline: none;
  padding: 12px 13px;
  background: rgba(0,0,0,0.18);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.42;
}
.detail-review-guidance {
  min-height: 78px;
  margin-bottom: 12px;
}
.detail-review-content:focus,
.detail-review-guidance:focus { border-color: var(--accent); }
.detail-review-guidance::placeholder { color: var(--text-faint); }
.detail-review-count {
  margin: 7px 2px 12px;
  text-align: right;
  font-size: 12px;
  color: var(--text-faint);
}
.detail-review-count.over { color: #ff6b6b; }
.workflow-transition-panel {
  display: grid;
  gap: 10px;
  margin: 0 0 14px;
  padding: 13px;
  border: 1px solid rgba(255, 209, 102, 0.24);
  border-radius: 16px;
  background: rgba(255, 209, 102, 0.08);
}
.workflow-transition-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.workflow-transition-head span {
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
  text-transform: capitalize;
}
.workflow-transition-head small {
  color: #ffd166;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}
.workflow-transition-panel p {
  margin: 0;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.35;
}

.bos-board-warning {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 209, 102, 0.22);
  border-radius: 14px;
  background: rgba(255, 209, 102, 0.08);
  color: var(--text-dim);
  font-size: 12.5px;
  line-height: 1.35;
}

.workflow-transition-grid {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 6px 10px;
  min-width: 0;
}
.workflow-transition-grid span,
.workflow-transition-list span,
.workflow-transition-actions span {
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}
.workflow-transition-grid strong {
  min-width: 0;
  color: var(--text);
  font-size: 12.5px;
  overflow-wrap: anywhere;
}
.workflow-transition-list,
.workflow-transition-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  min-width: 0;
}
.workflow-transition-list em,
.workflow-transition-actions em {
  max-width: 100%;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: var(--text-dim);
  font-size: 12px;
  font-style: normal;
  overflow-wrap: anywhere;
}
.review-artifact-panel {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid rgba(127, 255, 227, 0.22);
  border-radius: 16px;
  background: rgba(127, 255, 227, 0.07);
}
.review-artifact-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.review-artifact-head strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
}
.review-artifact-head span {
  color: #7fffe3;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}
.review-artifact-grid {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 6px 10px;
}
.review-artifact-grid span {
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}
.review-artifact-grid strong {
  min-width: 0;
  color: var(--text-dim);
  font-size: 12.5px;
  overflow-wrap: anywhere;
}
.review-artifact-list {
  display: grid;
  gap: 8px;
}
.review-artifact-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  background: rgba(0,0,0,0.16);
}
.review-artifact-row.ready {
  border-color: rgba(127, 255, 227, 0.22);
}
.review-artifact-row.missing {
  border-color: rgba(255, 138, 138, 0.22);
}
.review-artifact-row strong {
  display: block;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}
.review-artifact-row span {
  display: block;
  margin-top: 3px;
  color: var(--text-faint);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.review-artifact-row button {
  min-width: 68px;
  height: 36px;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: rgba(255,255,255,0.08);
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}
.review-artifact-row button:disabled {
  color: var(--text-faint);
  cursor: default;
  opacity: 0.65;
}
.review-artifact-viewer-shell {
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  background: rgba(0,0,0,0.28);
}
.review-artifact-viewer-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  background: rgba(20, 16, 32, 0.96);
}
.review-artifact-viewer-head strong {
  min-width: 0;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.review-artifact-hide {
  min-width: 56px;
  height: 32px;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  background: rgba(255,255,255,0.08);
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}
.review-artifact-viewer {
  max-height: min(360px, 38vh);
  overflow: auto;
  margin: 0;
  padding: 12px;
  color: var(--text-dim);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 11.5px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.detail-review-actions,
.detail-task-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}
.detail-review-btn,
.detail-task-btn {
  min-width: 0;
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--hairline);
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.2s var(--ease-spring), opacity 0.2s;
}
.detail-review-btn.primary,
.detail-task-btn.primary {
  border-color: transparent;
  background: var(--accent);
  box-shadow: 0 8px 22px -10px var(--accent);
}
.detail-review-btn.warn { color: #ffd166; }
.detail-review-btn.danger,
.detail-task-btn.danger { color: #ff8a8a; }
.detail-review-btn:active,
.detail-task-btn:active { transform: scale(0.97); }
.detail-review-btn:disabled,
.detail-task-btn:disabled { opacity: 0.55; cursor: default; transform: none; }
.detail-review-error,
.detail-task-error {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 75, 75, 0.12);
  border: 1px solid rgba(255, 75, 75, 0.22);
  color: #ffb3b3;
  font-size: 13px;
  line-height: 1.35;
}

@media (max-width: 480px) {
  #chat-view .chat-head {
    gap: 8px;
  }
  #chat-view .chat-agent-meta {
    display: grid;
    grid-template-columns: max-content minmax(76px, 1fr);
    align-items: center;
    column-gap: 9px;
    flex: 1 1 auto;
  }
  #chat-view .chat-agent-name {
    max-width: 82px;
  }
  #chat-view .chat-agent-status {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    font-size: 11px;
    line-height: 1.18;
  }
  #chat-view .chat-head-spacer {
    display: none;
  }
  #chat-view .mode-toggle {
    flex: 0 0 auto;
    gap: 2px;
    padding: 3px;
  }
  #chat-view .mode-btn {
    padding: 7px 9px;
    font-size: 11px;
  }
  .dot-quick-grid,
  .detail-task-grid {
    grid-template-columns: 1fr;
  }
  .review-artifact-panel {
    gap: 10px;
    margin-top: 12px;
    padding: 11px;
    border-radius: 14px;
  }
  .review-artifact-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }
  .review-artifact-grid {
    grid-template-columns: 1fr;
    gap: 3px;
  }
  .review-artifact-grid strong {
    margin-bottom: 5px;
  }
  .review-artifact-row {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 9px;
  }
  .review-artifact-row button {
    width: 100%;
    min-height: 40px;
  }
  .review-artifact-viewer {
    max-height: 220px;
    padding: 10px;
    font-size: 10.8px;
  }
  .bos-pipeline {
    gap: 10px;
    margin-top: 12px;
    padding: 11px;
    border-radius: 14px;
  }
  .bos-kiss-summary {
    gap: 10px;
    padding: 11px;
    border-radius: 15px;
  }
  .bos-kiss-topline {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }
  .bos-kiss-topline span,
  .bos-kiss-topline strong {
    max-width: 100%;
    white-space: normal;
    line-height: 1.15;
  }
  .bos-kiss-summary h2 {
    font-size: 18px;
    line-height: 1.12;
  }
  .bos-kiss-grid {
    grid-template-columns: 1fr;
    gap: 7px;
  }
  .bos-kiss-grid div {
    padding: 9px;
  }
  .bos-kiss-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
  .bos-kiss-actions .detail-action {
    width: 100%;
  }
  .bos-opi-voice {
    align-items: stretch;
    flex-direction: column;
    gap: 9px;
    padding: 10px;
  }
  .bos-opi-voice-btn {
    width: 100%;
  }
  .bos-opi-inline {
    padding: 10px;
  }
  .bos-opi-inline-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }
  .bos-pipeline-head strong {
    font-size: 14px;
  }
  .bos-pipeline-head span {
    font-size: 12px;
  }
  .bos-pipeline-current {
    padding: 10px;
  }
  .bos-pipeline-current span {
    font-size: 13px;
  }
  .bos-pipeline-current small {
    font-size: 12px;
  }
  .bos-pipeline-now {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .bos-pipeline-now div {
    grid-template-columns: 72px minmax(0, 1fr);
    align-items: center;
    padding: 8px 9px;
  }
  .bos-pipeline-now strong {
    font-size: 12px;
  }
  .bos-evidence-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .bos-evidence-artifacts > div {
    grid-template-columns: 1fr;
    gap: 3px;
  }
  .bos-evidence-next {
    grid-template-columns: 1fr;
    gap: 3px;
  }
  .bos-evidence-row,
  .bos-evidence-status {
    padding: 9px;
  }
  .bos-pipeline-unblock {
    padding: 10px;
  }
  .bos-pipeline-unblock dl {
    grid-template-columns: 1fr;
    gap: 3px;
  }
  .bos-pipeline-unblock dd {
    font-size: 12px;
  }
  .bos-pipeline-unblock a {
    width: 100%;
  }
  .bos-pipeline-rail {
    gap: 4px;
  }
  .bos-pipeline-rail-dot {
    height: 22px;
    font-size: 10px;
  }
  .bos-pipeline-steps {
    gap: 6px;
  }
  .bos-pipeline-step {
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 8px;
  }
  .bos-pipeline-step:not(.active):not(.blocked) .bos-pipeline-copy small {
    display: none;
  }
  .bos-pipeline-dot {
    width: 24px;
    height: 24px;
    font-size: 11px;
  }
  .bos-pipeline-policies em {
    max-width: 100%;
  }
  .bos-pipeline-event {
    padding: 8px 9px;
  }
  .bos-pipeline-disclosure > summary {
    min-height: 40px;
    padding: 9px;
  }
  .bos-onion-layer summary {
    min-height: 40px;
    padding: 9px 10px;
  }
  .bos-onion-grid {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 0 10px 10px;
  }
}

@media (max-width: 380px) {
  .bookmark-search {
    flex-wrap: wrap;
  }
  .bookmark-query {
    flex-basis: 100%;
  }
  .bookmark-submit,
  .bookmark-clear {
    flex: 1 1 0;
  }
}

/* Disable the browser's own pinch-zoom (iOS Safari) on all touch surfaces so
   our pinch drives the zoom-stack; pan/scroll still works. (mic-btn keeps none) */
.view, .agent-deck, .home-deck, .space, .space-pager, .chat-pane, .transcript,
.detail-body, .agent-card, .space-tile, .dot-card, .asset-card, .asset-grid,
.dot-quickadd, .bookmark-tools, .bookmark-tags, .detail-review-controls,
.detail-task-controls, .notif-panel, .notif-list {
  touch-action: pan-x pan-y;
}

/* (L2 pointer-events/visibility now handled by the data-l2 gate above.) */

@media (max-width: 380px), (max-height: 740px) {
  .status-bar {
    padding: 10px 18px 2px;
  }

  .status-right {
    gap: 8px;
  }

  .bell-btn {
    width: 36px;
    height: 36px;
  }

  .space-head {
    padding: 4px 22px 12px;
  }

  .space-title {
    font-size: 34px;
    line-height: 1.04;
  }

  .home-deck,
  .agent-deck {
    padding: 2px 16px 22px;
    gap: 12px;
  }

  .space-tile {
    min-height: 102px;
    padding: 20px 20px;
  }

  .space-tile .tile-name,
  .agent-card-name {
    font-size: 31px;
  }

  .space-tile .tile-sub,
  .agent-card-summary {
    font-size: 14px;
  }

  .agent-card {
    padding: 18px 18px 16px;
    border-radius: 26px;
  }

  .chat-head {
    gap: 8px;
    padding: 4px 14px 8px;
  }

  .chat-agent-name {
    max-width: 88px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mode-toggle {
    gap: 2px;
    padding: 3px;
  }

  .mode-btn {
    padding: 7px 9px;
    font-size: 11px;
  }

  .transcript {
    padding: 14px 16px 10px;
  }

  .bubble {
    max-width: 88%;
    padding: 12px 15px;
    font-size: 15px;
  }

  .input-bar {
    gap: 8px;
    padding: 7px 14px calc(12px + env(safe-area-inset-bottom));
  }

  .attachment-tray {
    gap: 7px;
    padding: 1px 14px 5px;
  }

  .attachment-chip {
    max-width: min(205px, 70vw);
    min-height: 46px;
  }

  .input-pill {
    height: 46px;
    padding: 0 15px;
  }

  .mic-btn {
    width: 46px;
    height: 46px;
  }

  .notif-panel {
    width: min(96vw, 420px);
  }

  .notif-header {
    padding: 16px 16px 10px;
  }

  .notif-list {
    padding-inline: 12px;
  }
}

@media (display-mode: standalone) {
  .status-bar {
    justify-content: space-between;
    min-height: calc(max(env(safe-area-inset-top), 30px) + 74px);
    padding: calc(max(env(safe-area-inset-top), 30px) + 22px) 24px 12px;
    z-index: 80;
    pointer-events: none;
  }

  .status-bar .clock {
    display: none;
  }

  .status-right {
    position: relative;
    z-index: 2;
    margin-left: auto;
    pointer-events: auto;
  }

  .pwa-status-heading {
    min-width: 0;
    max-width: calc(100% - 124px);
    min-height: 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-right: 14px;
    pointer-events: none;
  }

  .status-kicker {
    color: var(--text-faint);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.2px;
    line-height: 1;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .status-title {
    margin-top: 4px;
    color: var(--text);
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 650;
    letter-spacing: 0;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .bell-btn {
    width: 48px;
    height: 48px;
    touch-action: manipulation;
  }

  #home-view > .space-head,
  #gallery-view .space > .space-head {
    display: none;
  }
}
