:root {
  --bg: #0f1115;
  --panel: #171a21;
  --panel-2: #1e222b;
  --text: #e6e8ee;
  --muted: #9aa3b2;
  --accent: #6ea8fe;
  --eva: #1e2a3a;
  --user: #26303e;
  --ok: #3fb950;
  --warn: #d29922;
  --err: #f85149;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-weight: 600;                /* bold, product-owner request */
}

body {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: var(--panel);
  border-bottom: 1px solid #262b35;
}

.brand { font-weight: 600; letter-spacing: 0.3px; }

.status { font-size: 12px; padding: 3px 10px; border-radius: 999px; }
.status--connecting { color: var(--warn); background: #2a2410; }
.status--ready { color: var(--ok); background: #10240f; }
.status--error { color: var(--err); background: #2a1010; }

main#log {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bubble {
  max-width: 760px;
  padding: 12px 14px;
  border-radius: var(--radius);
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* Centered empty state shown while the chat log has no messages. */
.welcome {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
  gap: 6px;
}
.welcome-badge {
  width: 64px;
  height: 64px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  background: rgba(110, 168, 254, 0.12);
  margin-bottom: 10px;
  overflow: hidden;
}
.welcome-badge img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.welcome-title { margin: 0; font-size: 20px; font-weight: 600; color: var(--text); }
.welcome-sub { margin: 0; max-width: 440px; font-size: 14px; color: var(--muted); line-height: 1.6; }

.bubble.user { background: var(--user); }
.bubble.eva { background: var(--eva); }
.bubble.sys {
  align-self: center;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-style: italic;
}
.bubble .who { font-size: 11px; color: var(--muted); margin-bottom: 4px; }

/* Small, muted send-time under each user/Eva bubble. Block so it sits on its
   own line beneath the body; aligned to the trailing edge (right in a user
   bubble, left in an Eva bubble) so it reads as a caption on the message.
   Scales with the user's font-size/zoom (em-based) and never blocks taps. */
.bubble .bubble-time {
  display: block;
  margin-top: 4px;
  font-size: 0.7em;
  line-height: 1;
  color: var(--muted);
  opacity: 0.75;
  user-select: none;
}
.bubble.user .bubble-time { text-align: right; }
.bubble.eva .bubble-time { text-align: left; }

/* A bubble row = avatar + bubble, laid out on the correct side. */
.bubble-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 760px;
}
.bubble-row.user { align-self: flex-end; flex-direction: row-reverse; }
.bubble-row.eva { align-self: flex-start; }
.bubble-row.sys { align-self: center; max-width: 100%; }
.bubble-row .bubble { max-width: 100%; }

/* Round avatar on each bubble; falls back to an initial on a tinted circle. */
.bubble-avatar {
  flex: 0 0 auto;
  width: 30px; height: 30px;
  border-radius: 50%;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; color: var(--text);
  background: #2b313c;
  user-select: none;
}
.bubble-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bubble-avatar--eva { background: rgba(110, 168, 254, 0.22); }
.bubble-avatar--user { background: rgba(255, 255, 255, 0.12); }

/* â”€â”€ Composer: one rounded "pill" (ðŸ“Ž attach Â· textarea Â· Send Â· ðŸŽ¤ mic) â”€â”€â”€
   The send button keeps its original rectangular blue look; the attach + mic
   are round icon buttons INSIDE the pill. Files dropped anywhere on the pill
   upload to the user's own Files store (chat.js â†’ POST /api/files). */
form#composer {
  padding: 14px 18px;
  background: var(--panel);
  border-top: 1px solid #262b35;
}

.composer-pill {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: var(--panel-2);
  border: 1px solid #2c3240;
  border-radius: 22px;
  padding: 6px 8px;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.composer-pill:focus-within { border-color: var(--accent); }
.composer-pill.dragover {
  border-color: var(--accent);
  border-style: dashed;
  box-shadow: 0 0 0 3px rgba(110, 168, 254, 0.18);
}

textarea#input {
  flex: 1;
  min-width: 0;
  resize: none;
  max-height: 150px;
  padding: 9px 4px;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  line-height: 1.4;
}

/* Round icon buttons (attach + mic) inside the pill. */
.cbtn {
  flex: 0 0 auto;
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.cbtn:hover { background: #262c37; color: var(--text); }
.cbtn:disabled { opacity: 0.45; cursor: not-allowed; }

/* â”€â”€ Push-to-talk mic â€” a big, CENTERED button above the input bar â”€â”€â”€â”€â”€â”€â”€â”€â”€
   Centered (not on the composer edges) so a phone's edge-swipe gestures don't
   fire while the user presses-and-holds. Hold to talk, release to send. */
.mic-dock {
  display: flex; flex-direction: column; align-items: center;
  gap: 8px; padding-bottom: 10px; position: relative;
}
.mic-big {
  width: 60px; height: 60px; border-radius: 50%; padding: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, rgba(110,168,254,0.28), rgba(110,168,254,0.10));
  border: 1px solid rgba(110,168,254,0.6); color: var(--accent);
  box-shadow: 0 6px 18px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.08);
  touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  transition: transform 0.1s ease, background 0.12s ease, box-shadow 0.12s ease, color 0.12s ease;
}
.mic-big svg { width: 28px; height: 28px; display: block; }
.mic-big:hover { background: linear-gradient(160deg, rgba(110,168,254,0.38), rgba(110,168,254,0.16)); }
.mic-big:active { transform: scale(0.94); }
.mic-big.recording {
  color: var(--err); border-color: rgba(248,81,73,0.7);
  background: linear-gradient(160deg, rgba(248,81,73,0.30), rgba(248,81,73,0.12));
  animation: micpulse 1.1s ease-in-out infinite;
}
@keyframes micpulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(248, 81, 73, 0.5); }
  50%      { box-shadow: 0 0 0 12px rgba(248, 81, 73, 0); }
}

/* "Press me to talk" hint â€” centered above the mic. */
.mic-hint {
  position: absolute; bottom: calc(100% - 2px); left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--accent); color: #08131f; font-size: 12.5px; font-weight: 700;
  padding: 7px 12px; border-radius: 10px; white-space: nowrap;
  box-shadow: 0 6px 18px rgba(0,0,0,0.4);
  opacity: 0; pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.mic-hint::after {
  content: ""; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  border: 6px solid transparent; border-top-color: var(--accent);
}
.mic-hint.show, .mic-dock:hover .mic-hint, .mic-big:focus-visible ~ .mic-hint {
  opacity: 1; transform: translateX(-50%) translateY(0);
}
.mic-hint.show { animation: hintbob 1.6s ease-in-out infinite; }
@keyframes hintbob {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(-3px); }
}

/* "Mute Me" hint â€” points at the top-bar speaker (TTS) toggle. */
.tts-wrap { position: relative; display: inline-flex; }
.tts-hint {
  position: absolute; top: calc(100% + 9px); right: 0;
  background: var(--accent); color: #08131f; font-size: 12px; font-weight: 700;
  padding: 5px 9px; border-radius: 9px; white-space: nowrap;
  box-shadow: 0 6px 18px rgba(0,0,0,0.4);
  opacity: 0; pointer-events: none; z-index: 5;
  transition: opacity 0.18s ease, transform 0.18s ease;
  transform: translateY(-4px);
}
.tts-hint::after {
  content: ""; position: absolute; bottom: 100%; right: 12px;
  border: 6px solid transparent; border-bottom-color: var(--accent);
}
.tts-hint.show, .tts-wrap:hover .tts-hint, .tts-toggle:focus-visible + .tts-hint {
  opacity: 1; transform: translateY(0);
}
.tts-hint.show { animation: hintbob-down 1.6s ease-in-out infinite; }
@keyframes hintbob-down {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(3px); }
}
@media (prefers-reduced-motion: reduce) {
  .mic-big.recording, .mic-hint.show, .tts-hint.show { animation: none; }
}

button#send {
  flex: 0 0 auto;
  height: 38px;
  padding: 0 18px;
  border: none;
  border-radius: 14px;
  background: var(--accent);
  color: #0b1220;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
button#send:disabled { opacity: 0.5; cursor: not-allowed; }

/* Attachment chips above the pill (removable). */
.composer-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 4px 8px; }
.composer-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--panel-3, #232833);
  border: 1px solid #262b35;
  border-radius: 999px;
  padding: 4px 6px 4px 10px;
  font-size: 12px; max-width: 240px;
}
.composer-chip .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.composer-chip .sz { color: var(--muted); font-size: 11px; }
.composer-chip .st { font-size: 11px; }
.composer-chip .st.pending { color: var(--warn); }
.composer-chip .st.ready { color: var(--ok); }
.composer-chip .st.error { color: var(--err); }
.composer-chip .x {
  border: none; background: transparent; color: var(--muted); cursor: pointer;
  font-size: 13px; width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.composer-chip .x:hover { background: #333a47; color: var(--text); }

/* Big drop hint shown while dragging files over the pill. */
.composer-drop {
  position: absolute; inset: 0; border-radius: 22px;
  background: rgba(15, 17, 21, 0.82);
  border: 2px dashed var(--accent);
  display: none; align-items: center; justify-content: center;
  color: #cfe0ff; font-size: 13px; pointer-events: none;
}
.composer-pill.dragover .composer-drop { display: flex; }

/* Small live line under the composer (mic status, upload progress). */
.composer-live { font-size: 12px; color: var(--muted); padding: 6px 6px 0; min-height: 16px; }
.composer-live b { color: var(--accent); }

/* â”€â”€ Chat header extras (landing / guest tag) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--warn);
  background: #2a2410;
  padding: 2px 8px;
  border-radius: 999px;
  vertical-align: middle;
  margin-left: 6px;
}

.header-right { display: flex; align-items: center; gap: 12px; }

.ghost-btn {
  background: transparent;
  border: 1px solid #2c3240;
  color: var(--muted);
  padding: 5px 12px;
  border-radius: 999px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.ghost-btn:hover { border-color: var(--accent); color: var(--text); }
/* Accent-tinted ghost button for a primary header action (e.g. guest Register). */
.ghost-btn--accent {
  background: rgba(110, 168, 254, 0.16);
  border-color: var(--accent);
  color: var(--accent);
}
.ghost-btn--accent:hover { background: rgba(110, 168, 254, 0.24); color: var(--text); }

/* Identity chip + logout in the authenticated header. */
.identity { font-size: 12px; color: var(--muted); }
.identity strong { color: var(--text); }
.role-tag {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--accent);
  background: #16203a;
  padding: 2px 7px;
  border-radius: 999px;
  margin-left: 6px;
}

/* â”€â”€ App shell (P7.0) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
/* The shell page lays out a fixed top bar, a body row (content + right nav),
   and overlays (history drawer + scrim). Scoped to .shell-body so it doesn't
   disturb the guest/auth pages that reuse this stylesheet. */
.shell-body { display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden; }

.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 7px 14px;               /* compact strip */
  background: var(--panel);
  border-bottom: 1px solid #262b35;
  flex: 0 0 auto;
}
.topbar-left { display: flex; gap: 6px; justify-self: start; }
.topbar-left .ghost-btn { display: inline-flex; align-items: center; gap: 5px; padding: 7px 11px; min-height: 36px; }
.btn-ico { line-height: 1; }
.topbar-center { display: flex; align-items: center; gap: 8px; justify-self: center; }
.topbar-right { display: flex; align-items: center; gap: 10px; justify-self: end; }
.brand-sep { color: var(--muted); }
.brand-nick { font-weight: 600; color: var(--accent); }
.brand-avatar {
  width: 24px; height: 24px; border-radius: 50%;
  object-fit: cover; border: 1px solid #2b313c; background: #11151c;
  flex: 0 0 auto;
}

.hamburger {
  background: transparent;
  border: 1px solid #2c3240;
  color: var(--text);
  font-size: 16px;
  line-height: 1;
  padding: 6px 10px;
  border-radius: 10px;
  cursor: pointer;
}
.hamburger:hover { border-color: var(--accent); }

/* Eva-speaks (text-to-speech) toggle in the top bar. On by default; muting
   flips it to the plain outline look. */
.tts-toggle {
  background: rgba(110, 168, 254, 0.16);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 15px;
  line-height: 1;
  padding: 6px 10px;
  border-radius: 10px;
  cursor: pointer;
}
.tts-toggle:hover { border-color: var(--accent); }
.tts-toggle[aria-pressed="false"] {
  background: transparent;
  border-color: #2c3240;
  color: var(--muted);
}
.tts-toggle:disabled { opacity: 0.45; cursor: not-allowed; }

/* Body row: main content grows, nav is a fixed-width column when open. */
.shell {
  flex: 1 1 auto;
  display: flex;
  min-height: 0;
  position: relative;
}

.content {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* One panel per tab; the chat panel fills its space like the old layout. */
.tab-panel { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.tab-panel[hidden] { display: none; }

/* Chat panel keeps the original log + composer behavior. */
.tab-panel[data-tab="chat"] #log { flex: 1; overflow-y: auto; }

.placeholder { padding: 32px; color: var(--muted); overflow-y: auto; }
.placeholder h2 { color: var(--text); margin: 0 0 8px; }
.placeholder .muted { color: var(--muted); font-size: 13px; }

/* Right-side tab nav â€” a FIXED overlay (AIVault menu pattern). Hidden until the
   hamburger toggles it; it slides in above content with a backdrop. On wide
   screens the content is nudged left (margin) so the nav feels "pinned". */
.tabnav {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  height: 100%;
  width: 264px;
  max-width: 100%;
  background: var(--panel);
  border-left: 1px solid #262b35;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  z-index: 50;
  box-shadow: -2px 0 16px rgba(0, 0, 0, 0.35);
}
.tabnav:not(.open) { display: none; }
.tabnav-identity { padding: 4px 8px 12px; border-bottom: 1px solid #262b35; margin-bottom: 6px; }
.tabnav-spacer { flex: 1 1 auto; }

/* Backdrop behind the nav â€” a REAL sibling element (#nav-scrim in index.html),
   not a ::before pseudo-element. A pseudo-element isn't its own DOM node, so
   a tap on it bubbles up reporting #tabnav itself as the click target, which
   broke the "tap outside to close" handler (wireHamburger() in app.js) on
   phones/tablets/narrow desktop windows â€” the nav never closed because the
   tap always looked like it landed "inside" the nav. .scrim's base rules
   (position/inset/z-index) already exist for the history drawer; this only
   adds the nav-specific stacking (must sit below .tabnav's z-index: 50). */
.nav-scrim { z-index: 45; }
.nav-scrim[hidden] { display: none; }

/* Desktop: when the nav is open, push the content left so it reads as pinned,
   and skip the backdrop entirely (the nav is pinned, not an overlay, so
   nothing needs dimming â€” and there's no "outside tap" gesture to support
   here since the nav has its own visible column). */
@media (min-width: 1025px) {
  .shell.nav-open .content { margin-right: 264px; }
  .content { transition: margin-right 0.18s ease; }
  .nav-scrim { display: none !important; }
}

.navtab {
  text-align: left;
  padding: 10px 12px;
  min-height: 44px;
  display: flex;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}
.navtab:hover { background: var(--panel-2); }
.navtab--active { background: var(--panel-2); border-color: var(--accent); }
.navtab--muted { color: var(--muted); }
.navtab--danger { color: var(--err); }
/* Same cascade fix as .drawer/.scrim/.set-form/.danger-block: the author
   `display: flex` above beats the browser's default `[hidden]{display:none}`,
   so a `.navtab` toggled via the `hidden` ATTRIBUTE (e.g. #nav-aivdev, which
   ships hidden and is revealed ONLY for the aiv-dev role in app.js) would
   otherwise stay VISIBLE for every non-AIV-Dev user. This override makes the
   `hidden` attribute actually hide the button. (Server-side /api/aivdev/*
   403s remain the real gate; this fixes the UI leak.) */
.navtab[hidden] { display: none; }

/* â”€â”€ Nested/multi-level nav groups (Settings Â· My AI Agents Â· EvaVault
   Framework each expand into a sub-menu). The nav itself starts CLOSED like
   before; once opened it stays open across navigation â€” it only hides on an
   explicit close (hamburger toggle, tapping the visible main-screen backdrop,
   or Escape), never automatically after picking a section. */
.navgroup { display: flex; flex-direction: column; }
.navgroup-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}
.navgroup-btn:hover { background: var(--panel-2); }
.navgroup-btn .chev { color: var(--muted); transition: transform 0.15s ease; }
.navgroup.open > .navgroup-btn .chev { transform: rotate(90deg); }
.navgroup-children {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-left: 14px;
  border-left: 1px solid #262b35;
  margin: 2px 0 4px 18px;
}
.navgroup-children[hidden] { display: none; }
.navtab--sub {
  padding: 9px 10px;
  font-size: 13px;
  min-height: 44px;
}

/* Nested sub-group (e.g. Settings â€º Connectivity, folding Web Search + Local /
   External LLM together). Sits INSIDE a .navgroup-children list, so it's
   already indented by the parent; the button itself is styled a touch smaller
   than a top-level .navgroup-btn to read as one level deeper. */
.navgroup--nested { margin: 0; }
.navgroup-btn--sub {
  padding: 9px 10px;
  min-height: 44px;
  font-size: 13px;
}
.navgroup--nested .navgroup-children {
  margin: 2px 0 4px 14px;
}

@media (prefers-reduced-motion: reduce) {
  .navgroup-btn .chev { transition: none; }
}

@media (pointer: coarse) {
  .navgroup-btn { padding: 13px 12px; }
  .navtab--sub { padding: 12px 10px; }
}

/* History drawer â€” a FIXED overlay above everything (AIVault pattern), so it
   never sits in the layout flow and the âœ• / backdrop reliably dismiss it. */
.drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  height: 100%;
  width: 320px;
  max-width: 85vw;
  background: var(--panel);
  border-right: 1px solid #262b35;
  z-index: 50;
  display: flex;
  flex-direction: column;
  box-shadow: 2px 0 16px rgba(0, 0, 0, 0.35);
}
/* CSS cascade bug fixed here: `display: flex` above overrides the browser's
   default `[hidden] { display: none }` (an author rule always beats the
   user-agent stylesheet, regardless of order). Without this override, setting
   the `hidden` ATTRIBUTE in JS did nothing and the drawer never actually
   closed â€” the âœ•/backdrop/Escape handlers were firing correctly the whole
   time, this rule was just silently cancelling them. */
.drawer[hidden] { display: none; }
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid #262b35;
}
.drawer-title { font-weight: 600; }
.drawer-top { padding: 10px 12px; border-bottom: 1px solid #262b35; }
.drawer-list { flex: 1; overflow-y: auto; padding: 8px; }
.drawer-empty { color: var(--muted); font-size: 13px; padding: 16px; text-align: center; }
.drawer-foot {
  flex: 0 0 auto;
  padding: 10px 12px;
  border-top: 1px solid #262b35;
  padding-bottom: max(10px, env(safe-area-inset-bottom));
}

.ghost-btn--danger { color: var(--err); border-color: #3a1c1c; }
.ghost-btn--danger:hover { border-color: var(--err); color: var(--err); }

/* Inline delete-all confirm â€” sits in the drawer foot next to the button the
   user pressed, so no reaching for a top-of-viewport browser dialog. */
.drawer-confirm { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.drawer-confirm[hidden] { display: none; }
.drawer-confirm-msg { font-size: 13px; color: var(--err); }
.drawer-confirm-actions { display: flex; gap: 8px; }
.drawer-confirm-actions .ghost-btn { flex: 1 1 0; }
.ghost-btn--block,
.primary-btn--block {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
}

.history-row {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 4px;
  border-radius: 10px;
  margin-bottom: 4px;
}
.history-row:hover { background: var(--panel-2); }
.history-row--active { background: #16203a; }
.history-open {
  flex: 1;
  min-width: 0;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--text);
  font: inherit;
  padding: 10px 10px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.history-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}
.history-id {
  font-size: 10px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.85;
}
.history-when { font-size: 11px; color: var(--muted); }

/* Per-row â‹¯ actions menu (Copy Chat ID / Delete this chat). */
.history-menu { position: relative; flex: 0 0 auto; display: flex; align-items: stretch; }
.history-menu-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 18px;
  line-height: 1;
}
.history-menu-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.history-menu-list {
  display: none;
  position: absolute;
  top: 100%;
  right: 6px;
  z-index: 30;
  min-width: 172px;
  background: var(--panel-2);
  border: 1px solid #2c3240;
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
.history-menu.open .history-menu-list { display: flex; flex-direction: column; gap: 2px; }
.history-menu-item {
  text-align: left;
  background: transparent;
  border: none;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
}
.history-menu-item:hover { background: rgba(255, 255, 255, 0.06); }
.history-menu-item--danger { color: var(--err); }
.history-menu-item--danger:hover { background: #2a1010; }

.scrim {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 40;
}
.scrim[hidden] { display: none; }

/* â”€â”€ Responsive: phones & tablets â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€
   Goal (per product): usable for non-technical users on Android/iOS phones &
   tablets, iPad, and small windows, without clutter. All side panels are fixed
   overlays (never steal a column), the topbar compresses, touch targets grow. */

/* Phones and narrow windows. */
@media (max-width: 720px) {
  .topbar {
    grid-template-columns: auto 1fr auto;
    padding: 8px 10px;
    gap: 6px;
  }
  .topbar-center { gap: 5px; font-size: 14px; min-width: 0; }
  .brand { font-size: 15px; }
  .brand-sep { display: none; }
  .brand-nick { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 34vw; }

  .topbar-left { gap: 5px; }
  .topbar-left .ghost-btn { padding: 7px 9px; }
  /* Collapse the History / New Chat labels to icons on phones. */
  .topbar-left .btn-txt { display: none; }
  .topbar-left .btn-ico { font-size: 15px; }

  /* The live status pill is noise on a phone; the hamburger is enough. */
  #status { display: none; }
  .hamburger { padding: 8px 11px; font-size: 18px; }

  /* Comfortable reading width + touch targets in chat. */
  main#log { padding: 14px; gap: 10px; }
  .bubble { max-width: 88%; padding: 11px 13px; }
  form#composer { padding: 10px; padding-bottom: max(10px, env(safe-area-inset-bottom)); }
  button#send { padding: 0 14px; }

  /* Full-height, near-full-width history drawer feels native on a phone. */
  .drawer { width: 92vw; max-width: 92vw; }

  /* Section pages breathe less on small screens. */
  .fw, .ag, .settings { padding: 16px 14px; }
  .set-section { padding: 14px 15px; margin: 14px 0; }

  /* Menus stay on-screen: anchor to the right edge of the drawer. */
  .history-menu-list { right: 4px; min-width: 160px; }
}

/* Tiny phones. */
@media (max-width: 380px) {
  .brand-nick { max-width: 28vw; }
  .bubble { max-width: 92%; }
}

/* Touch-friendly hit areas (min 44px, per platform HIG). Applied everywhere so
   phones/tablets are comfortable regardless of the media query above. */
.topbar-left .ghost-btn,
.hamburger,
.navtab,
.history-open,
#history-close,
.primary-btn--block,
.ghost-btn--block { min-height: 44px; }
.history-menu-btn { min-height: 40px; min-width: 40px; }

@media (pointer: coarse) {
  .navtab { padding: 13px 12px; }
  .history-open { padding: 12px 10px; }
  .history-menu-btn { padding: 0 14px; }
  .ghost-btn { padding: 8px 12px; }
  /* Composer controls + TTS toggle stay comfortably tappable on touch. */
  .cbtn { width: 44px; height: 44px; }
  button#send { height: 44px; }
  .tts-toggle, .hamburger { min-height: 44px; }
  .mic-big { width: 64px; height: 64px; }   /* a touch bigger on phones */
  .mic-big svg { width: 30px; height: 30px; }
}

/* â”€â”€ EvaVault Framework tab (P7.4) â€” GROW viewer + Monitor rollup â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.fw { padding: 24px 28px; overflow-y: auto; flex: 1 1 auto; }
.fw-head { display: flex; align-items: center; justify-content: space-between; }
.fw-head h2 { margin: 0; color: var(--text); }
.fw-sub { margin: 4px 0 20px; font-size: 13px; }
.fw-sub em { color: var(--text); font-style: italic; }

/* AI-DLC placeholder board (framework-aidlc): one lane per lifecycle stage,
   Triage called out distinctly. Populated once agent stage-tracking exists
   (evavault-ui-ux.md); today each lane just shows an empty state. */
.fw-aidlc-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.fw-aidlc-lane {
  background: var(--panel);
  border: 1px solid #262b35;
  border-radius: var(--radius);
  padding: 12px 14px;
  min-height: 90px;
}
.fw-aidlc-lane h4 {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.fw-aidlc-lane--triage { border-color: #3a1c1c; }
.fw-aidlc-lane--triage h4 { color: var(--err); }

/* Cards within a lane â€” tappable, â‰¥44px tall, plain-language labels only. */
.fw-aidlc-cards { display: flex; flex-direction: column; gap: 8px; }
.fw-aidlc-card {
  display: block;
  width: 100%;
  text-align: left;
  background: #1a1e26;
  border: 1px solid #262b35;
  border-radius: 8px;
  padding: 10px 12px;
  min-height: 44px;
  color: var(--text);
  cursor: pointer;
  font: inherit;
}
.fw-aidlc-card:hover,
.fw-aidlc-card:focus-visible { border-color: var(--accent); }
.fw-aidlc-card-name { font-size: 13px; font-weight: 600; }
.fw-aidlc-card-kind { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* Card detail overlay â€” replaces the board in-place (not a separate modal,
   since it already lives inside the framework-aidlc panel/ViewModal). */
.fw-aidlc-detail { margin-top: 8px; }
.fw-aidlc-detail-head { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.fw-aidlc-detail-title { font-size: 16px; font-weight: 600; }
.fw-aidlc-detail-section {
  background: var(--panel);
  border: 1px solid #262b35;
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 14px;
}
.fw-aidlc-detail-section h3 { margin: 0 0 8px; font-size: 13px; }
.fw-aidlc-fields { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.fw-aidlc-field { display: flex; flex-direction: column; gap: 4px; }
.fw-aidlc-field label { font-size: 12px; color: var(--muted); }
.fw-aidlc-field input,
.fw-aidlc-field textarea {
  background: #1a1e26;
  border: 1px solid #262b35;
  border-radius: 6px;
  color: var(--text);
  padding: 8px 10px;
  font: inherit;
  min-height: 44px;
}
.fw-aidlc-field textarea { min-height: 72px; resize: vertical; }

.fw-section { margin-bottom: 26px; }
.fw-section h3 {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.fw-empty { color: var(--muted); font-size: 13px; padding: 14px; }

/* Monitor cards */
.fw-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.fw-card {
  background: var(--panel);
  border: 1px solid #262b35;
  border-radius: var(--radius);
  padding: 14px 16px;
}
.fw-card--ok { border-color: #1c3a1c; }
.fw-card--err { border-color: #3a1c1c; }
.fw-card-k { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; }
.fw-card-v { font-size: 22px; font-weight: 600; margin: 4px 0; }
.fw-card-note { font-size: 12px; color: var(--muted); }

/* GROW pillars */
.fw-grow { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.fw-pillar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--panel);
  border: 1px solid #262b35;
  border-radius: var(--radius);
  padding: 12px 14px;
}
.fw-pillar-letter {
  width: 40px; height: 40px;
  flex: 0 0 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 18px;
  color: #0f1115;
}
.fw-pillar--G .fw-pillar-letter { background: #6ea8fe; }
.fw-pillar--R .fw-pillar-letter { background: #d29922; }
.fw-pillar--O .fw-pillar-letter { background: #3fb950; }
.fw-pillar--W .fw-pillar-letter { background: #a371f7; }
.fw-pillar-name { font-size: 13px; }
.fw-pillar-count { font-size: 12px; color: var(--muted); }

/* Activity log */
.fw-log-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.fw-log-head h3 { margin: 0; }
.fw-filters { display: flex; gap: 4px; }
.fw-filter {
  min-width: 30px;
  padding: 5px 10px;
  border: 1px solid #262b35;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit; font-size: 12px;
  cursor: pointer;
}
.fw-filter:hover { background: var(--panel-2); }
.fw-filter--active { background: var(--panel-2); border-color: var(--accent); color: var(--text); }

.fw-events {
  background: var(--panel);
  border: 1px solid #262b35;
  border-radius: var(--radius);
  overflow: hidden;
}
.fw-ev {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-bottom: 1px solid #20242e;
  font-size: 13px;
}
.fw-ev:last-child { border-bottom: none; }
.fw-ev--err { background: #241414; }
.fw-ev-icon { flex: 0 0 auto; }
.fw-ev-grow {
  flex: 0 0 auto;
  width: 20px; height: 20px;
  border-radius: 5px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  color: #0f1115;
  background: #3a4150;
}
.fw-ev-grow--G { background: #6ea8fe; }
.fw-ev-grow--R { background: #d29922; }
.fw-ev-grow--O { background: #3fb950; }
.fw-ev-grow--W { background: #a371f7; }
.fw-ev-label { flex: 0 0 auto; font-weight: 500; }
.fw-ev-detail { flex: 1 1 auto; min-width: 0; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fw-ev-when { flex: 0 0 auto; font-size: 11px; color: var(--muted); }

/* â”€â”€ Settings tab (P7.1) â€” About Me + Danger Zone â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.settings { padding: 24px 28px; overflow-y: auto; flex: 1 1 auto; }
.settings-head { display: flex; align-items: center; justify-content: space-between; }
.settings-head h2 { margin: 0; color: var(--text); }

.set-section {
  background: var(--panel);
  border: 1px solid #262b35;
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 18px 0;
  max-width: 640px;
}
.set-section h3 { margin: 0 0 6px; color: var(--text); font-size: 16px; }
.set-section .muted { font-size: 13px; margin: 0 0 16px; }

.set-form { display: flex; flex-direction: column; gap: 14px; }
/* Same cascade fix as .drawer/.scrim/.danger-block: an author `display` rule
   always beats the browser's default `[hidden]{display:none}`, so any
   .set-form toggled via the `hidden` attribute (e.g. the AIV-Dev "external"
   LLM sub-fields) needs this explicit override to actually hide. */
.set-form[hidden] { display: none; }
.set-field { display: flex; flex-direction: column; gap: 6px; }
.set-label { font-size: 13px; color: var(--muted); }
.set-label em { font-style: italic; color: var(--muted); opacity: 0.8; }
.set-field input, .set-select {
  padding: 10px 12px;
  border: 1px solid #2b313c;
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}
.set-field input:focus, .set-select:focus { outline: none; border-color: var(--accent); }
.set-input-row { display: flex; gap: 8px; align-items: stretch; }
.set-input-row input { flex: 1 1 auto; }
.set-input-row .ghost-btn { flex: 0 0 auto; white-space: nowrap; }

/* Avatar: preview thumbnail + URL/upload controls side by side */
.set-avatar-row { display: flex; gap: 12px; align-items: flex-start; }
.set-avatar-fields { display: flex; flex-direction: column; gap: 8px; flex: 1 1 auto; }
.set-avatar-preview {
  width: 56px; height: 56px; border-radius: 50%;
  object-fit: cover; flex: 0 0 auto;
  border: 1px solid #2b313c; background: #11151c;
}
/* Fallback circle shown when no avatar image is set (Settings + AIV-Dev Eva). */
.set-avatar-fallback {
  width: 56px; height: 56px; border-radius: 50%; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; background: rgba(110, 168, 254, 0.12);
  border: 1px solid #2b313c;
}

/* Prominent identity block at the top of Settings â€º About Me. */
.set-identity { display: flex; align-items: center; gap: 12px; margin: 4px 0 14px; }
.set-identity-avatar {
  width: 64px; height: 64px; border-radius: 50%;
  object-fit: cover; border: 1px solid #2b313c; background: #11151c; flex: 0 0 auto;
}
.set-identity-fallback {
  width: 64px; height: 64px; border-radius: 50%; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; background: rgba(110, 168, 254, 0.12); border: 1px solid #2b313c;
}
.set-identity-name { font-size: 16px; font-weight: 600; color: var(--text); }

.set-file-input { flex: 1 1 auto; min-width: 0; font-size: 12px; color: var(--muted); }
.set-file-input::-webkit-file-upload-button,
.set-file-input::file-selector-button {
  font: inherit; margin-right: 10px; padding: 6px 10px;
  border: 1px solid #2b313c; border-radius: 8px;
  background: #1a1f27; color: var(--text); cursor: pointer;
}

.set-check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); }
.set-check input { width: 16px; height: 16px; }

/* Web-search provider sub-blocks (Tavily / SearXNG under the master switch) â€”
   indented + a subtle left rule so they read as "pick providers under the
   allow-web-search master toggle". Greyed via inline opacity when master off. */
.ws-provider {
  margin: 4px 0 4px 22px;
  padding: 10px 12px;
  border-left: 2px solid #2b313c;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: opacity 0.15s ease;
}

.set-readonly {
  display: grid;
  gap: 8px;
  padding: 12px 0 0;
  margin-top: 4px;
  border-top: 1px solid #262b35;
}
.set-readonly > div { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.set-ro-k { color: var(--muted); }
.set-ro-v { color: var(--text); }

.set-actions { display: flex; align-items: center; gap: 14px; margin-top: 4px; }
.primary-btn {
  padding: 10px 18px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #0b1220;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.primary-btn:hover { filter: brightness(1.05); }

.set-status { font-size: 13px; color: var(--muted); min-height: 18px; }
.set-status--ok { color: var(--ok); }
.set-status--err { color: var(--err); }

/* Google connection â€” the guided-setup launcher (Global Settings, session 51
   Phase 2). The full wizard runs in a separate popup window
   (static/google-setup-guide.html); this is just the launch button + status. */
.google-launch { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.google-status-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.google-pill {
  display: inline-flex; align-items: center; padding: 4px 12px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; border: 1px solid var(--border);
}
.google-pill--on { color: var(--ok); border-color: #1f5133; background: #0e2417; }
.google-pill--off { color: var(--muted); background: var(--panel-2); }
.google-launch .primary-btn { align-self: flex-start; min-height: 48px; }
/* The manual paste form, collapsed by default behind a <details>. */
.google-manual { margin-top: 8px; border-top: 1px dashed var(--border); padding-top: 12px; }
.google-manual > summary {
  cursor: pointer; font-size: 13px; color: var(--muted); list-style: none; padding: 4px 0;
}
.google-manual > summary:hover { color: var(--text); }
.google-manual[open] > summary { color: var(--text); margin-bottom: 10px; }

/* Memory (conversation search) results */
.set-hint { font-size: 12px; margin: -4px 0 6px; }
.memory-results { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.memory-row {
  border: 1px solid var(--border, #26314a);
  border-radius: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.02);
}
.memory-snippet { font-size: 13px; color: var(--text); line-height: 1.5; }
.memory-snippet :is(b, mark) { color: var(--accent); background: none; font-weight: 600; }
.memory-meta { font-size: 11px; color: var(--muted); margin-top: 6px; }

/* My Files (P7.6) â€” uploaded documents list */
.files-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.files-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--border, #26314a);
  border-radius: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.02);
}
.files-row-main { min-width: 0; flex: 1 1 auto; }
.files-row-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.files-row-meta { font-size: 11px; color: var(--muted); margin-top: 4px; }
.files-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.files-badge--ok { background: rgba(80, 200, 140, 0.15); color: var(--ok); }
.files-badge--off { background: rgba(255, 255, 255, 0.06); color: var(--muted); }
.files-badge--wait { background: rgba(255, 196, 90, 0.15); color: #ffc45a; }
.files-badge--upload { background: rgba(110, 168, 254, 0.15); color: var(--accent); }
.files-del { padding: 6px 10px; line-height: 1; flex: 0 0 auto; }

/* â”€â”€ My Files & Folders â€” document repo (scopes/folders/multi-select) â”€â”€â”€â”€â”€â”€â”€ */
/* Scope tabs (My Files / Wiki / AIV) */
.subtabs { display: flex; gap: 4px; border-bottom: 1px solid #262b35; margin: 6px 0 14px; flex-wrap: wrap; }
.subtab {
  background: transparent; border: none; border-bottom: 2px solid transparent;
  color: var(--muted); padding: 10px 16px; font: inherit; font-size: 14px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
}
.subtab:hover { color: var(--text); }
.subtab--active { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.subtab .badge { font-size: 11px; background: var(--panel-2); color: var(--muted); border-radius: 999px; padding: 1px 8px; }

/* Toolbar: breadcrumb + actions */
.repo-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.crumbs { display: flex; align-items: center; gap: 3px; flex-wrap: wrap; font-size: 14px; min-width: 0; }
.crumb { color: var(--accent); cursor: pointer; padding: 4px 6px; border-radius: 6px; }
.crumb:hover { background: var(--panel-2); }
.crumb--current { color: var(--text); font-weight: 600; cursor: default; }
.crumb--current:hover { background: transparent; }
.crumb-sep { color: var(--muted); }
.repo-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; position: relative; }
.sortsel {
  background: var(--bg); border: 1px solid #2b313c; color: var(--text);
  border-radius: 999px; padding: 7px 12px; font: inherit; font-size: 13px; min-height: 38px; cursor: pointer;
}

/* Scope banner (Wiki / AIV explanation) */
.scope-banner { display: flex; align-items: center; gap: 8px; border-radius: 10px; padding: 10px 12px; font-size: 12px; margin-bottom: 12px; }
.scope-banner b { color: var(--text); }
.scope-banner--wiki { background: rgba(110, 168, 254, 0.08); border: 1px solid #2b3a55; color: var(--muted); }
.scope-banner--aiv { background: rgba(163, 113, 247, 0.10); border: 1px solid #3d2f57; color: var(--muted); }

/* Selection action bar */
.selbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: var(--panel-2); border: 1px solid #2b3a55; border-radius: 10px; padding: 8px 12px; margin-bottom: 12px;
}
.selbar-count { color: var(--text); font-size: 13px; font-weight: 600; margin-right: 4px; }
.selbar-spacer { flex: 1; }
.clip-chip { font-size: 12px; color: var(--accent); background: rgba(110, 168, 254, 0.12); border-radius: 999px; padding: 4px 10px; }
.repo-selbar-del { width: auto; padding: 7px 13px; border-radius: 999px; }

/* Drag & drop zone */
.dropzone { border: 1.5px dashed #3a4256; border-radius: 12px; padding: 8px; margin-bottom: 12px; cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.dropzone:hover { border-color: var(--accent); }
.dropzone.drag { border-color: var(--accent); background: rgba(110, 168, 254, 0.10); }
.dz-inner { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--muted); font-size: 13px; padding: 14px; text-align: center; }
.dz-inner b { color: var(--accent); }

/* Repo list rows (folders + files) */
.repo-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.repo-row {
  display: grid; grid-template-columns: 22px 30px 1fr auto auto; align-items: center; gap: 12px;
  border: 1px solid var(--border, #26314a); background: var(--panel-2);
  border-radius: 10px; padding: 10px 12px; position: relative;
}
.repo-row--folder { cursor: pointer; }
.repo-row--folder:hover { border-color: var(--accent); }
.repo-row.dragover { border-color: var(--accent); background: rgba(110, 168, 254, 0.12); }
.repo-row.selected { border-color: var(--accent); background: rgba(110, 168, 254, 0.08); }
.repo-row[draggable="true"] { cursor: grab; }
.repo-check { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }
.repo-ic { font-size: 18px; text-align: center; }
.repo-main { min-width: 0; }
.repo-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 500; color: var(--text); }
.repo-name .link { color: var(--text); }
.repo-meta { font-size: 11px; color: var(--muted); margin-top: 3px; }
.repo-count { font-size: 12px; color: var(--muted); white-space: nowrap; }
.repo-rowacts { display: flex; gap: 4px; position: relative; }
.icon-btn {
  background: transparent; border: 1px solid #2c3240; color: var(--muted);
  border-radius: 8px; width: 34px; height: 34px; cursor: pointer; font-size: 13px;
}
.icon-btn:hover { border-color: var(--accent); color: var(--text); }
.icon-btn--danger:hover { border-color: var(--err); color: var(--err); }

/* Anchored inline popovers (delete confirm + folder picker + rename) */
.confirm-pop, .pick-pop {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 30;
  background: var(--panel); border-radius: 10px; padding: 12px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5); text-align: left;
}
.confirm-pop { width: 250px; border: 1px solid #3a1c1c; }
.pick-pop { width: 280px; border: 1px solid #2b3a55; }
.confirm-pop::before, .pick-pop::before {
  content: ""; position: absolute; top: -6px; right: 12px; width: 10px; height: 10px;
  background: var(--panel); transform: rotate(45deg);
}
.confirm-pop::before { border-left: 1px solid #3a1c1c; border-top: 1px solid #3a1c1c; }
.pick-pop::before { border-left: 1px solid #2b3a55; border-top: 1px solid #2b3a55; }
/* Left-opening variant (opens below the right edge of its anchor so it doesn't
   overflow the panel). Used by the New folder popover, anchored to .repo-actions. */
.pick-pop--left { right: 0; left: auto; }
.confirm-pop p { margin: 0 0 10px; font-size: 12.5px; color: var(--text); }
.pick-title { margin: 0 0 8px; font-size: 12.5px; color: var(--text); }
.pick-actions { display: flex; gap: 8px; justify-content: flex-end; }
.btn-danger { border: none; border-radius: 8px; background: var(--err); color: #1a0b0b; font: inherit; font-weight: 600; padding: 6px 12px; cursor: pointer; }
.btn-sm { padding: 6px 12px; min-height: 0; }
.rename-row { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.rename-input { flex: 1 1 auto; min-width: 0; padding: 8px 10px; border: 1px solid #2b313c; border-radius: 8px; background: var(--bg); color: var(--text); font: inherit; font-size: 13px; }
.rename-input:focus { outline: none; border-color: var(--accent); }
.rename-ext { color: var(--muted); font-size: 13px; white-space: nowrap; }
.pick-tree { max-height: 200px; overflow-y: auto; border: 1px solid #232833; border-radius: 8px; background: var(--bg); padding: 4px; margin-bottom: 10px; }
.pick-node { display: flex; align-items: center; gap: 6px; padding: 7px 8px; border-radius: 6px; cursor: pointer; font-size: 13px; color: var(--text); }
.pick-node:hover { background: var(--panel-2); }
.pick-node.sel { background: rgba(110, 168, 254, 0.15); border: 1px solid var(--accent); }
.pick-node.disabled { opacity: .4; cursor: not-allowed; }
.pick-node .ic { flex: 0 0 auto; }

@media (max-width: 560px) {
  .repo-row { grid-template-columns: 22px 26px 1fr auto; }
  .repo-count { display: none; }
}

/* GraphRAG view (P7.6) â€” per-document index breakdown */
.grag-docs { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.grag-doc {
  border: 1px solid var(--border, #26314a);
  border-radius: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.02);
}
.grag-doc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}
.grag-doc-title { color: var(--text); font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grag-doc-count { color: var(--muted); font-size: 11px; flex: 0 0 auto; }
.grag-bar { height: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); margin-top: 8px; overflow: hidden; }
.grag-bar > span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }

.set-danger { border-color: #3a1c1c; }
.set-danger h3 { color: var(--err); }
.danger-btn {
  padding: 10px 18px;
  border: 1px solid var(--err);
  border-radius: 10px;
  background: transparent;
  color: var(--err);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.danger-btn:hover { background: #2a1010; }

/* Delete-account modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  padding: 20px;
}
.modal[hidden] { display: none; }
.modal-card {
  width: 480px;
  max-width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid #262b35;
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid #262b35;
}
.modal-title { font-weight: 600; color: var(--text); }
.modal-body { padding: 18px; display: flex; flex-direction: column; gap: 16px; }
.modal-warn { font-size: 13px; color: var(--warn); margin: 0; }

.danger-block { display: flex; flex-direction: column; gap: 12px; }
.danger-block[hidden] { display: none; }
.danger-methods { display: flex; gap: 6px; }
.danger-method {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid #2b313c;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit; font-size: 13px;
  cursor: pointer;
}
.danger-method:hover { background: var(--panel-2); }
.danger-method--active { background: var(--panel-2); border-color: var(--accent); color: var(--text); }
.danger-verify { display: flex; flex-direction: column; gap: 12px; }
.danger-verify[hidden] { display: none; }

.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* â”€â”€ ViewModal (AIVault parity) â€” a dashboard view as a dismissible overlay â”€â”€ */
.viewmodal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: stretch;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  padding: 0;
}
.viewmodal[hidden] { display: none; }
.viewmodal-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 960px;
  max-height: 100%;
  background: var(--bg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}
.viewmodal-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #262b35;
  background: var(--panel);
}
.viewmodal-title { margin: 0; font-size: 16px; font-weight: 600; color: var(--text); }
.viewmodal-close { min-height: 40px; min-width: 40px; }
/* The body hosts the moved-in tab panel; it scrolls independently. */
.viewmodal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; }
/* A panel mounted inside the modal fills the body and scrolls within it. */
.viewmodal-body .tab-panel { flex: 1 1 auto; min-height: 0; }
.viewmodal-body .tab-panel[hidden] { display: flex; } /* force-visible while modal-mounted */

/* Tablet/desktop: float as a centered, rounded, inset card. */
@media (min-width: 640px) {
  .viewmodal { padding: 24px; }
  .viewmodal-card { max-height: calc(100% - 48px); border: 1px solid #262b35; border-radius: 16px; }
}

/* ── Timeline side-by-side with chat (spec: timeline-side-by-side-with-chat) ──
   The 🗓️ Timeline (and ONLY the Timeline) docks as a LEFT column while the
   always-mounted Eva chat (#content) stays visible + usable on the RIGHT. Keyed
   on the two classes app.js toggles ONLY for view==="timeline"
   (.viewmodal--docked on #view-modal, .shell.timeline-docked). Every other
   ViewModal sub-page never gets these classes, so its full-screen centered
   overlay above is unchanged. All rules here are additive + class-scoped. */
.viewmodal.viewmodal--docked {
  justify-content: flex-start;   /* left-anchor the card (not centered) */
  background: transparent;       /* no full-screen dim over the chat */
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  pointer-events: none;          /* the overlay layer doesn't eat clicks… */
}
.viewmodal.viewmodal--docked .viewmodal-card {
  pointer-events: auto;          /* …but the docked card itself is interactive */
  width: min(66vw, 1100px);      /* wider than chat; the left column */
  max-width: none;
}
/* Shrink #content (chat) into the RIGHT column so it sits beside the docked
   Timeline. Mirrors the .shell.nav-open .content { margin-right } precedent and
   composes with it (nav sets margin-right, this sets margin-left). Wide screens
   only — the same 1025px breakpoint the nav shift uses. */
@media (min-width: 1025px) {
  .shell.timeline-docked .content { margin-left: min(66vw, 1100px); }
  .shell.timeline-docked .content { transition: margin 0.18s ease; }
}
/* Narrow screen (<1025px): two usable columns don't fit, so neutralize the
   docked classes back to the current full-screen centered overlay + backdrop —
   the Timeline is single-column and chat is reached by closing it. */
@media (max-width: 1024px) {
  .viewmodal.viewmodal--docked {
    justify-content: center;
    background: rgba(0, 0, 0, .6);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    pointer-events: auto;
  }
  .viewmodal.viewmodal--docked .viewmodal-card { width: 100%; max-width: 960px; }
  .shell.timeline-docked .content { margin-left: 0; }
}

/* â”€â”€ My AI Agents tab (P7.5) â€” ROI + skills/tools/connections/scheduler â”€â”€â”€â”€â”€â”€ */
.ag { padding: 24px 28px; overflow-y: auto; flex: 1 1 auto; }
.ag-head { display: flex; align-items: center; justify-content: space-between; }
.ag-head h2 { margin: 0; color: var(--text); }
.ag-sub { margin: 4px 0 20px; font-size: 13px; }
.ag-sub em { color: var(--text); font-style: italic; }

.ag-section { margin-bottom: 26px; }
.ag-section h3 {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.ag-hint { margin: 0 0 12px; font-size: 12px; }
.ag-empty { color: var(--muted); font-size: 13px; padding: 14px; }

/* ROI cards (same visual language as the Framework Monitor cards) */
.ag-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.ag-card {
  background: var(--panel);
  border: 1px solid #262b35;
  border-radius: var(--radius);
  padding: 14px 16px;
}
.ag-card-k { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; }
.ag-card-v { font-size: 22px; font-weight: 600; margin: 4px 0; }
.ag-card-note { font-size: 12px; color: var(--muted); }

/* List rows shared by skills/tools/connections/scheduler */
.ag-list { display: flex; flex-direction: column; gap: 10px; }
.ag-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  background: var(--panel);
  border: 1px solid #262b35;
  border-radius: var(--radius);
  padding: 12px 16px;
  transition: border-color .15s ease, transform .12s ease, background .15s ease;
}
.ag-row:hover { border-color: #34405a; transform: translateY(-1px); background: #191d26; }
.ag-row--off { opacity: 0.6; }
/* Leading per-skill glyph tile (Skills page rows). */
.ag-row-ic {
  flex: 0 0 auto;
  width: 30px; height: 30px;
  border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 15px; line-height: 1;
  background: #10151d; border: 1px solid #262b35;
}
.ag-row-main { min-width: 0; flex: 1 1 auto; }
.ag-row-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.ag-row-desc { font-size: 12px; color: var(--muted); margin-top: 3px; }
/* Section divider inside a list (e.g. "Available to connect" in Connections). */
.ag-subhead {
  margin: 16px 0 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.ag-row-tools { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px; }
/* Personal-connection credential rows (name + value + remove). */
.conn-envrow { display: flex; gap: 6px; margin-bottom: 6px; align-items: center; }
.conn-envrow .conn-env-name { flex: 0 0 40%; }
.conn-envrow .conn-env-val { flex: 1 1 auto; }
.conn-envrow .conn-env-del { flex: 0 0 auto; min-height: 40px; }
/* Connections page section headers â€” a clear split between the Email Accounts
   block and the MCP/API Connection Settings block. */
.conn-section-head { margin: 4px 0 10px; }
.conn-section-head--mcp {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.conn-section-title { margin: 0; font-size: 15px; font-weight: 700; }
.conn-section-sub { margin: 3px 0 0; font-size: 13px; }

/* Internal-services (MCP sidecar health) rows on the Connections page. Read-
   only status with a colour dot + badge + Check/Revive. Reuses .ag-row. */
.conn-internal-row .ag-row-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.conn-internal-row .ag-row-actions { flex: 0 0 auto; display: flex; gap: 6px; align-items: center; }
.mcp-dot {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  flex: 0 0 auto; background: var(--muted);
}
.mcp-dot--ok { background: var(--ok); }
.mcp-dot--warn { background: var(--warn); }
.mcp-dot--err { background: var(--err); }
.mcp-dot--muted { background: var(--muted); }
.mcp-badge {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .03em; padding: 2px 7px; border-radius: 999px;
  border: 1px solid transparent;
}
.mcp-badge--ok { color: var(--ok); background: #10240f; }
.mcp-badge--warn { color: var(--warn); background: #2a2410; }
.mcp-badge--err { color: var(--err); background: #2a1010; }
.mcp-badge--muted { color: var(--muted); background: #1a1e27; }
.mcp-transport { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* Brief "look here" pulse when arriving at Connections from the mailbox use
   case's "Disconnect a mailboxâ€¦" button. Honors reduced-motion. */
.conn-highlight {
  border-radius: 10px;
  animation: conn-pulse 1.3s ease-out 2;
}
@keyframes conn-pulse {
  0% { box-shadow: 0 0 0 0 rgba(110, 168, 254, .55); }
  100% { box-shadow: 0 0 0 10px rgba(110, 168, 254, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .conn-highlight { animation: none; outline: 2px solid var(--accent); outline-offset: 3px; }
}

/* Post-connect "is this you?" confirmation banner (#ag-conn-status.conn-confirm).
   After an OAuth mailbox connect we NAME the account that was bound + offer a
   one-tap Disconnect, so a wrong account (the provider's consent page uses the
   browser's existing session) is noticed and trivially undone. */
.conn-confirm {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  background: rgba(74, 222, 128, 0.10);
  border: 1px solid rgba(74, 222, 128, 0.45);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px; color: var(--text);
}
.conn-confirm-ok { color: var(--ok, #4ade80); font-weight: 600; }
.conn-confirm-ok strong { color: var(--text); }
.conn-confirm-ask { color: var(--muted); }
.conn-confirm .conn-confirm-undo { min-height: 32px; }

/* Default-mailbox 1-liner on the Connections page (reuses the email-default
   route). A single compact row: label Â· select Â· Save Â· hint. */
.conn-default-mailbox {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 16px;
  margin: 0 0 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-2, #101826);
}
.conn-default-mailbox label { font-weight: 600; flex: 0 0 auto; }
.conn-default-mailbox .set-select { flex: 1 1 220px; min-width: 180px; min-height: 40px; }
.conn-default-mailbox .btn-primary { flex: 0 0 auto; min-height: 40px; }
.conn-default-hint { flex: 1 1 100%; font-size: 12px; }
@media (max-width: 640px) {
  .conn-default-mailbox .set-select { flex-basis: 100%; }
  .conn-default-mailbox .btn-primary { width: 100%; }
}

/* Google account connection card (Connections â€º Google, Use-Cases Â§D2). */
.conn-google {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 14px 16px;
  margin: 6px 0 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-2, #101826);
}
.conn-google-main { flex: 1 1 260px; min-width: 0; }
.conn-google-title { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.conn-google-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  color: #4285f4;
  font-weight: 700;
  font-family: Arial, sans-serif;
}
/* Microsoft variant of the shared connection-logo badge (#6). */
.conn-ms-logo { color: #0f6cbd; font-size: 16px; line-height: 1; }
/* IMAP/other-email variant of the shared connection-logo badge (#8). */
.conn-imap-logo { color: var(--accent, #6ea8fe); font-size: 16px; line-height: 1; }
.conn-google-desc { font-size: 13px; color: var(--muted); margin-top: 4px; }
.conn-google-side { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
/* When the card holds a CONNECTED account list (email + Disconnect + the DIY
   Remember control), the side must span the FULL card width and wrap BELOW the
   title/desc â€” otherwise the 2-line account block is crammed into the narrow
   right column meant for a single "Connect" button (the cramped, right-shifted
   look). The not-connected state (a lone Connect button) is untouched â€” it
   stays right-aligned. `:has()` targets only the connected case. */
/* When the card holds a CONNECTED account list, the side column must span the
   FULL card width + wrap below the title/desc â€” else the account block
   shrink-wraps + centers in the narrow right column (the "centered button"
   bug). Set explicitly by JS (side.classList.add('conn-side--full')) rather
   than CSS :has() (which wasn't applying in-browser). */
.conn-google-side.conn-side--full {
  flex: 1 1 100%;
  align-items: stretch;
  margin-top: 4px;
}
/* The account list itself always fills its container (belt-and-braces so the
   list never shrink-wraps + centers, in EITHER layout â€” OAuth puts it in the
   side, IMAP in the main column). */
.conn-acct-list { width: 100%; }
.conn-google-side .btn-primary { text-decoration: none; display: inline-flex; align-items: center; }
/* âš  The `display:inline-flex` above DEFEATS the `hidden` attribute (same class
   of bug as .navtab â€” an author `display` beats the browser's default
   `[hidden]{display:none}`). The IMAP header "Connect a mailbox" button is
   hidden via `.hidden = true` when accounts exist, so it MUST honor [hidden]
   or it renders alongside the bottom "+ Connect another mailbox" (the IMAP
   double-button bug). */
.conn-google-side .btn-primary[hidden] { display: none; }
.conn-google-ok { color: var(--ok, #4ade80); font-weight: 600; font-size: 13px; }
/* Option A multi-account: a column of connected-account rows + a "connect
   another" link under each provider card's side.
   âš  Each .conn-acct-row is a 2-LINE BLOCK (identity line + the DIY Remember
   control stacked UNDER it) â€” so the row is a full-width COLUMN, not a
   horizontal flex (the old `display:flex;align-items:center` put the Remember
   control BESIDE the email+Disconnect line and the list's `align-items:flex-end`
   crushed it rightward â€” the "nothing changed" bug). The "+ Connect another"
   link is the list's last child and self-aligns right. */
.conn-acct-list { display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
.conn-acct-row { display: flex; flex-direction: column; align-items: stretch; gap: 0; width: 100%; }
/* The "+ Connect another" primary button sits on its OWN full-width row at the
   bottom of the list, right-aligned. Wrapping it in .conn-add-row (a full-width
   flex that justifies right) is robust â€” it does NOT rely on a flex-item
   `align-self` fighting the list's `align-items:stretch` (which stretched the
   button full-width + centered its text â€” the "centered button" bug). Matches
   the header "Connect <X>" look (btn-primary), same for EVERY provider. */
.conn-add-row { display: flex; justify-content: flex-end; margin-top: 4px; }
.conn-add-btn { text-decoration: none; display: inline-flex; align-items: center; flex: 0 0 auto; }
.conn-acct-row .conn-google-ok { font-weight: 500; }
.conn-acct-list .ghost-btn { text-decoration: none; }
.conn-acct-disconnect { min-height: 32px; }
.ag-row-tools code,
.ag-row-desc code {
  font-size: 11px;
  background: #1a1e26;
  border: 1px solid #262b35;
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--muted);
}
.ag-row-side {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  max-width: 45%;
}
/* Per-row Retire (Agent Cards) â€” compact, stays quiet until armed. */
.ag-retire { min-height: 32px; padding: 4px 10px; font-size: 12px; }

/* Little tags + on/off pills */
.ag-tag {
  font-size: 11px;
  color: var(--muted);
  background: #1a1e26;
  border: 1px solid #262b35;
  border-radius: 999px;
  padding: 2px 9px;
  white-space: nowrap;
}
.ag-tag--ok { border-color: #1c3a1c; color: #7bd47b; }
/* Scheduler page: type tags telling the scheduled runtimes apart. */
.ag-tag--pa { border-color: #24324a; color: #8fb4e6; }
.ag-tag--mon { border-color: #3a2c1c; color: #d9b48c; }
.ag-tag--wf { border-color: #26324a; color: #9db8ff; }        /* scheduled routine (workflow) */
.ag-tag--maint { border-color: #33302a; color: #cbb98f; }     /* self-scheduled maintenance */
/* Scheduler section headers (A2: routines/monitors vs read-only Maintenance). */
.ag-sched-head { font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin: 18px 0 8px; border-bottom: 1px solid #1e2530; padding-bottom: 5px; }
.ag-sched-head:first-child { margin-top: 0; }
.ag-sched-head--maint { text-transform: none; letter-spacing: normal; }
.ag-sched-note { text-transform: none; letter-spacing: normal; font-weight: 400; color: var(--muted); opacity: .8; }
.ag-row-sub { font-size: 11px; color: var(--muted); opacity: .75; margin-top: 2px; font-family: ui-monospace, monospace; }
.ag-pill {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-radius: 999px;
  padding: 1px 8px;
}
.ag-pill--on { background: #12241a; color: #7bd47b; border: 1px solid #1c3a1c; }
.ag-pill--off { background: #241414; color: #d98c8c; border: 1px solid #3a1c1c; }

/* â”€â”€ Interactive chat content (evavault-ui-ux.md) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€
   Clickable links, option buttons the user taps instead of typing, and an
   inline answer box inside Eva's bubble. Sized for touch (â‰¥44px) and tuned to
   the existing dark palette. */

/* Clickable links in any bubble. Long URLs wrap instead of overflowing. */
.bubble a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.bubble a:hover { text-decoration: none; }
.bubble a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

/* Container for the option buttons + inline answer box under an Eva bubble. */
.eva-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}
.eva-actions.answered { opacity: 0.6; }

/* Tappable option chips: users pick instead of typing. Wrap on narrow screens. */
.eva-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.eva-option {
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid #33415a;
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}
.eva-option:hover { background: #26303e; border-color: var(--accent); }
.eva-option:active { transform: translateY(1px); }
.eva-option:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.eva-option:disabled { cursor: default; opacity: 0.55; }

/* Inline "Connect <provider>" button under an Eva bubble (Connections layer).
   A link-style button (full-page navigation to the OAuth authorize route), so
   it reads as a primary action, distinct from the neutral option chips. */
.eva-connect { display: flex; }
.eva-connect-btn {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 10px;
  border: none;
  background: var(--accent);
  color: #0a0f16;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.05s ease;
}
.eva-connect-btn:hover { filter: brightness(1.06); }
.eva-connect-btn:active { transform: translateY(1px); }
.eva-connect-btn:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

/* Inline "Approve" toggle under an Eva bubble (the enable-on-approval flow).
   Eva emits [[enable: websearch]] when a task needs a capability the user hasn't
   turned on; tapping Approve turns it on in-place (same-origin, no redirect) and
   tells Eva to proceed. A short note + a primary-style button, â‰¥44px, keyboard
   operable. */
.eva-enable {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}
.eva-enable-note { color: var(--muted); font-size: 0.92em; }
.eva-enable-btn {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 10px;
  border: none;
  background: var(--accent);
  color: #0a0f16;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.05s ease;
}
.eva-enable-btn:hover { filter: brightness(1.06); }
.eva-enable-btn:active { transform: translateY(1px); }
.eva-enable-btn:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.eva-enable.answered { opacity: 0.7; }
.eva-enable-btn:disabled { cursor: default; opacity: 0.55; }

/* "Remember my choice" toggle under the email account picker (unified email).
   A calm, secondary affordance beneath the mailbox buttons â€” a real, tappable
   label wrapping a checkbox, comfortably sized for touch. */
.eva-remember {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  min-height: 44px;
  padding: 4px 2px;
  font-size: 0.92em;
  color: var(--muted, #9fb0c3);
  cursor: pointer;
  user-select: none;
}
.eva-remember .eva-remember-cb {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--accent);
}
.eva-remember:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* Multi-select account chooser (Email Memory "remember which inboxes?"):
   a column of checkbox rows + an "All accounts" master row + a Confirm button.
   Nothing sends until Confirm, so the user picks several without typing. */
.eva-account-multi {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 420px;
}
.eva-account-multi .eva-multi-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;               /* â‰¥44px touch target */
  padding: 8px 12px;
  border: 1px solid var(--border, #33384a);
  border-radius: 10px;
  cursor: pointer;
  user-select: none;
}
.eva-account-multi .eva-multi-row:hover { background: rgba(110, 168, 254, 0.08); }
.eva-account-multi .eva-multi-all {
  font-weight: 600;
  border-style: dashed;           /* set it apart as the master toggle */
}
.eva-account-multi .eva-multi-cb {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--accent);
  flex: 0 0 auto;
}
.eva-account-multi .eva-multi-row:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.eva-account-multi .eva-multi-confirm { align-self: flex-start; margin-top: 4px; }

/* Inline answer box: reply right inside Eva's chat bubble. The input is a
   MULTI-LINE auto-growing textarea, so the Send button aligns to the BOTTOM
   (align-items:flex-end) and stays put as the box grows. */
.eva-ask {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.eva-ask-input {
  flex: 1;
  min-height: 44px;
  max-height: 220px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #33415a;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  line-height: 1.4;
  resize: none;          /* height is driven by JS auto-grow */
  overflow-y: auto;
  white-space: pre-wrap; /* preserve the user's line breaks */
}
.eva-ask-input:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(110, 168, 254, 0.35);
}
.eva-ask-send {
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 10px;
  border: none;
  background: var(--accent);
  color: #0b1220;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.eva-ask-send:hover { filter: brightness(1.06); }
.eva-ask-send:active { transform: translateY(1px); }
.eva-ask-send:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.eva-ask-send:disabled { cursor: default; opacity: 0.55; }
.eva-ask-input:disabled { opacity: 0.7; }

/* â”€â”€ In-chat location picker (PA item C) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€
   A timezone dropdown Eva offers when she doesn't know the person's location;
   picking one saves it so future turns carry the local-time block. A calm,
   inline control under her bubble â€” a labelled <select> + Save, â‰¥44px touch. */
.eva-loc-picker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}
.eva-loc-label {
  flex-basis: 100%;
  font-size: 13px;
  color: var(--muted, #94a3b8);
}
.eva-loc-select {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #33415a;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}
.eva-loc-select:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(110, 168, 254, 0.35);
}
.eva-loc-select:disabled { opacity: 0.7; }
.eva-loc-save {
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 10px;
  border: none;
  background: var(--accent);
  color: #0b1220;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.eva-loc-save:hover { filter: brightness(1.06); }
.eva-loc-save:active { transform: translateY(1px); }
.eva-loc-save:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.eva-loc-save:disabled { cursor: default; opacity: 0.55; }
.eva-loc-status { font-size: 13px; color: var(--muted, #94a3b8); }

/* Region picker (AWS SA workflow v2). Eva emits [[region-picker]] when she needs
   the AWS region and doesn't have it â€” never a silent us-east-1 default. Same
   calm inline control as the location picker (labelled <select> + button, â‰¥44px),
   but the pick is a per-task answer sent as the reply, not a stored setting. */
.eva-region-picker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}
.eva-region-label {
  flex-basis: 100%;
  font-size: 13px;
  color: var(--muted, #94a3b8);
}
.eva-region-select {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #33415a;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}
.eva-region-select:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(110, 168, 254, 0.35);
}
.eva-region-select:disabled { opacity: 0.7; }
.eva-region-use {
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 10px;
  border: none;
  background: var(--accent);
  color: #0b1220;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.eva-region-use:hover { filter: brightness(1.06); }
.eva-region-use:active { transform: translateY(1px); }
.eva-region-use:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.eva-region-use:disabled { cursor: default; opacity: 0.55; }

/* â”€â”€ Email-digest table (the Summarizer PA's eva-table output) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€
   Built by chat.js attachTable() from a safe, escaped, allowlisted structure.
   On wide screens it's a table in a horizontally-scrollable frame; on a phone
   the same markup restyles to stacked cards (below) so nothing overflows. */
.eva-digest {
  margin-top: 10px;
  overflow-x: auto;               /* horizontal scroll on desktop if it's wide */
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border, #262b35);
  border-radius: 12px;
}
.eva-digest-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12.5px;
  line-height: 1.45;
}
.eva-digest-table th,
.eva-digest-table td {
  border: 1px solid var(--border, #262b35);
  padding: 7px 9px;
  text-align: left;
  vertical-align: top;
}
.eva-digest-table th {
  background: var(--panel-3, #232833);
  color: var(--text, #cdd5e2);
  font-weight: 600;
  white-space: nowrap;
}
.eva-digest-table td { color: var(--text, #e6e8ee); }
.eva-digest-actcell { white-space: nowrap; }

/* Per-row action controls: a real link (deep-link) or an option-style button
   (hands Eva the next step). Both â‰¥ comfortable tap size; never auto-perform. */
.eva-rowact {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  min-height: 32px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  border: 1px solid;
}
.eva-rowact-link { background: rgba(110,168,254,.14); color: #8fc0ff; border-color: rgba(110,168,254,.45); }
.eva-rowact-link:hover { background: rgba(110,168,254,.22); }
.eva-rowact-chat { background: var(--panel-3, #232833); color: var(--text, #cdd5e2); border-color: var(--border, #262b35); }
.eva-rowact-chat:hover { border-color: var(--accent); }
.eva-rowact:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.eva-rowact-chat:disabled { opacity: .55; cursor: default; }

/* Phone: stacked cards. Each row becomes a card; each cell shows its column
   name (data-label) as a leading label, so 7 columns stay readable with no
   horizontal scroll (evavault-ui-ux.md: mobile = stacked cards, not scroll). */
@media (max-width: 640px) {
  .eva-digest { overflow-x: visible; border: none; }
  .eva-digest-table,
  .eva-digest-table thead,
  .eva-digest-table tbody,
  .eva-digest-table tr,
  .eva-digest-table th,
  .eva-digest-table td { display: block; width: 100%; }
  .eva-digest-table thead { display: none; }        /* labels come from data-label */
  .eva-digest-table tr {
    border: 1px solid var(--border, #262b35);
    border-radius: 12px;
    margin-bottom: 10px;
    padding: 4px 2px;
    background: var(--panel-2, #1e222b);
  }
  .eva-digest-table td {
    border: none;
    border-bottom: 1px solid rgba(255,255,255,.05);
    padding: 6px 12px;
    white-space: normal;
  }
  .eva-digest-table td:last-child { border-bottom: none; }
  .eva-digest-table td::before {
    content: attr(data-label);
    display: block;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted, #9aa3b2);
    margin-bottom: 2px;
  }
  /* An empty cell (no value) collapses so we don't show a bare label. */
  .eva-digest-table td:empty { display: none; }
}

/* â”€â”€ Digest "View summary" card + overlay (session 59, tap-to-view) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€
   Eva emits a [[digest: latest]] sentinel instead of pasting the big email
   table (which the model won't do reliably); chat.js renders it as this card,
   and on tap fetches the STRUCTURED digest and shows it in the overlay below.
   The overlay table reuses .eva-digest / .eva-digest-table (incl. the mobile
   stacked-cards rule above), so it's responsive for free. */
.eva-digest-card {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  padding: 12px;
  border: 1px solid rgba(110, 168, 254, 0.4);
  background: rgba(110, 168, 254, 0.08);
  border-radius: 12px;
}
.eva-digest-card-ic { font-size: 26px; flex: 0 0 auto; }
.eva-digest-card-meta { flex: 1; min-width: 0; }
.eva-digest-card-meta b { display: block; font-size: 14px; color: var(--text); }
.eva-digest-card-meta small { color: var(--muted); font-size: 12px; }
.eva-digest-view {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 9px 16px;
  border: none;
  border-radius: 9px;
  background: var(--accent);
  color: #08131f;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.eva-digest-view:hover { filter: brightness(1.06); }
.eva-digest-view:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* "Open workflow" card (the no-code builder â€” Workflow-Builder-Design.md). Eva
   drafts a personal workflow and emits [[workflow: <key>]]; chat.js renders this
   card, whose button opens the Flowgram canvas on the draft. Mirrors the digest
   card (accent-tinted, â‰¥44px button, keyboard/tap). */
.eva-wf-card {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  padding: 12px;
  border: 1px solid rgba(110, 168, 254, 0.4);
  background: rgba(110, 168, 254, 0.08);
  border-radius: 12px;
}
.eva-wf-card-ic { font-size: 26px; flex: 0 0 auto; }
.eva-wf-card-meta { flex: 1; min-width: 0; }
.eva-wf-card-meta b { display: block; font-size: 14px; color: var(--text); }
.eva-wf-card-meta small { color: var(--muted); font-size: 12px; }
.eva-wf-open {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 9px 16px;
  border: none;
  border-radius: 9px;
  background: var(--accent);
  color: #08131f;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.eva-wf-open:hover { filter: brightness(1.06); }
.eva-wf-open:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
@media (max-width: 640px) { .eva-wf-card { flex-wrap: wrap; } }

/* The overlay (a lightweight dismissible sheet built in chat.js â€” Esc /
   backdrop / âœ•). Sits above everything; mirrors the app's ViewModal look. */
.digest-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(6, 8, 12, 0.72);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 5vh 12px;
  overflow-y: auto;
}
.digest-overlay[hidden] { display: none; }
.digest-sheet {
  /* Responsive: use the width of bigger screens but stay readable. Grows from
     the mobile full-width up to ~1280px on a large desktop. */
  width: min(96vw, 1280px);
  max-width: 1280px;
  background: var(--panel);
  border: 1px solid var(--border, #262b35);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  max-height: 90vh;
  overflow: auto;
}
.digest-head {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  /* Accent-tinted header bar so the sheet doesn't read as a flat grey box. */
  background: linear-gradient(180deg, rgba(110,168,254,0.16), rgba(110,168,254,0.05)), var(--panel);
  border-bottom: 1px solid rgba(110,168,254,0.35);
}
.digest-head h3 { margin: 0; font-size: 15px; color: var(--text); }
.digest-x {
  width: 36px; height: 36px;
  border: 1px solid var(--border, #262b35);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  font-size: 16px;
  cursor: pointer;
}
.digest-x:hover { border-color: var(--accent); }
.digest-x:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.digest-body { padding: 14px; }
.digest-sub { color: var(--muted); font-size: 12.5px; margin: 0 0 10px; }
.digest-loading, .digest-empty { color: var(--muted); font-size: 13px; padding: 16px 4px; }
.digest-needs { margin-top: 12px; }
.digest-needs h4 { margin: 0 0 6px; font-size: 13px; color: var(--text); }
.digest-needs ul { margin: 0; padding-left: 18px; }
.digest-needs li { margin: 2px 0; }
.digest-hint { color: var(--muted); font-size: 11.5px; margin-top: 10px; }

/* Per-row Remark input (PA item D â€” hands Eva the next step, she validates). */
.digest-rmkcell { white-space: nowrap; }
.digest-rmk { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.digest-rmk-in {
  width: 140px;
  min-width: 0;
  padding: 6px 9px;
  border: 1px solid var(--border, #262b35);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 12px;
}
.digest-rmk-in:focus { outline: none; border-color: var(--accent); }
.digest-rmk-in:disabled { opacity: .55; }
.digest-rmk-go {
  min-height: 34px;
  padding: 6px 12px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #08131f;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.digest-rmk-go:disabled { opacity: .55; cursor: default; }
.digest-rmk-go:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.digest-rmk-sent { color: var(--ok); font-size: 11px; }

/* â”€â”€ Digest colour: pills + chips + zebra (session 59, brighten the overlay) â”€
   All escape-safe â€” chat.js sets these classes from a slug of the cell value
   and puts the text via textContent, never innerHTML. Tints reuse the app
   palette (--err/--warn/--muted/--accent/--ok) at low alpha so the dark theme
   stays calm but legible. */

/* Zebra rows in the overlay table (desktop only; the phone stacked-cards
   already have their own per-card background). */
.digest-body .eva-digest-table tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.022);
}

/* Importance pill: High = red, Medium/normal = amber, Low = muted grey. */
.digest-imp {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
  white-space: nowrap;
  border: 1px solid;
}
.digest-imp-high { color: #ff9b93; background: rgba(248,81,73,0.16); border-color: rgba(248,81,73,0.45); }
.digest-imp-medium,
.digest-imp-med,
.digest-imp-normal { color: #e3b341; background: rgba(210,153,34,0.16); border-color: rgba(210,153,34,0.45); }
.digest-imp-low { color: var(--muted, #9aa3b2); background: rgba(154,163,178,0.14); border-color: rgba(154,163,178,0.35); }

/* Provider + Category chips: a small rounded tag. Provider gets a few known
   brand-ish tints (kept to a small set); everything else falls back to the
   neutral chip below. Category is a calm accent-tinted tag. */
.digest-prov,
.digest-cat {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid var(--border, #262b35);
  background: var(--panel-3, #232833);
  color: var(--text, #cdd5e2);
}
/* Provider tints (small, deliberate set â€” Gmail/Google, Microsoft/Outlook,
   Facebook/Meta, Play/Android; others use the neutral base above). */
.digest-prov-gmail,
.digest-prov-google { color: #f28b82; background: rgba(234,67,53,0.14); border-color: rgba(234,67,53,0.40); }
.digest-prov-microsoft,
.digest-prov-outlook { color: #8fc0ff; background: rgba(110,168,254,0.14); border-color: rgba(110,168,254,0.42); }
.digest-prov-facebook,
.digest-prov-meta { color: #8ab4f8; background: rgba(66,103,178,0.18); border-color: rgba(66,103,178,0.45); }
.digest-prov-play,
.digest-prov-android { color: #7ee2a8; background: rgba(63,185,80,0.14); border-color: rgba(63,185,80,0.40); }
.digest-prov-yahoo { color: #c39bff; background: rgba(124,77,255,0.16); border-color: rgba(124,77,255,0.42); }
/* Category = calm accent tint (it's a model-inferred best-fit label). */
.digest-cat { color: #a9c6ff; background: rgba(110,168,254,0.10); border-color: rgba(110,168,254,0.28); }

@media (max-width: 640px) {
  .eva-digest-card { flex-wrap: wrap; }
  .digest-rmk-in { width: 60%; }
}

/* Honor reduced-motion preferences (evavault-ui-ux.md accessibility). */
@media (prefers-reduced-motion: reduce) {
  .eva-option, .eva-ask-send, .eva-loc-save, .eva-region-use, .eva-enable-btn { transition: none; }
  .eva-option:active, .eva-ask-send:active, .eva-loc-save:active, .eva-region-use:active, .eva-enable-btn:active { transform: none; }
}

/* Narrow phones: let the inline answer box stack so nothing overflows. */
@media (max-width: 380px) {
  .eva-ask { flex-direction: column; }
  .eva-ask-send { width: 100%; }
  .eva-loc-picker { flex-direction: column; align-items: stretch; }
  .eva-loc-save { width: 100%; }
  .eva-region-picker { flex-direction: column; align-items: stretch; }
  .eva-region-use { width: 100%; }
}

/* â”€â”€ "Eva is workingâ€¦" indicator + multi-bubble replies (evavault-ui-ux.md) â”€â”€
   Eva's answers are split into a sequence of bubbles; while she's working
   (before text arrives, and between tool rounds) an animated dots bubble shows
   on her side so the person knows she's on it. */

.bubble.thinking {
  padding: 14px 16px;
  min-height: 0;
}
.bubble.thinking .dots {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.bubble.thinking .dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  display: inline-block;
  animation: eva-dot 1.2s infinite ease-in-out both;
}
.bubble.thinking .dots i:nth-child(2) { animation-delay: 0.15s; }
.bubble.thinking .dots i:nth-child(3) { animation-delay: 0.3s; }

@keyframes eva-dot {
  0%, 80%, 100% { opacity: 0.25; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}

/* "Eva is working" cue (session 64): a rotating witty caption beside the dots,
   plus the avatar wiggling + pulsing. (A soft chime every 6s is done in JS via
   Web Audio.) Replaces the old TTS hum. */
.bubble.thinking .think-cap {
  margin-left: 8px;
  font-size: 13px;
  font-style: italic;
  color: var(--muted);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.bubble.thinking .think-cap.show { opacity: 1; }

/* The Eva avatar comes alive while she thinks. */
.bubble-avatar--eva.thinking-anim {
  animation: eva-think-wiggle 1.1s ease-in-out infinite, eva-think-pulse 1.4s ease-in-out infinite;
}
@keyframes eva-think-wiggle {
  0%, 100% { transform: rotate(0deg) scale(1); }
  25%      { transform: rotate(-8deg) scale(1.06); }
  75%      { transform: rotate(8deg) scale(1.06); }
}
@keyframes eva-think-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(110, 168, 254, 0.5); }
  50%      { box-shadow: 0 0 0 8px rgba(110, 168, 254, 0); }
}

/* Continuation bubbles in a split reply have no repeated avatar; this spacer
   keeps them aligned under the first bubble's avatar. Matches the 30px avatar
   width + its 8px row gap. */
.bubble-avatar-spacer {
  flex: 0 0 auto;
  width: 30px;
  height: 1px;
}

/* Tighten the vertical gap between bubbles that belong to the same Eva reply
   so a split answer reads as one grouped sequence, not scattered messages. */
main#log .bubble-row.eva + .bubble-row.eva { margin-top: -6px; }

@media (prefers-reduced-motion: reduce) {
  .bubble.thinking .dots i { animation: none; opacity: 0.6; }
  .bubble-avatar--eva.thinking-anim { animation: none; }
  .bubble.thinking .think-cap { transition: none; }
}

/* â”€â”€ Tasks tab (session 41): Task Menu tickets + chat + Agent Cards â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

/* AI-DLC board head actions + the "New card" form */
.fw-head-actions { display: flex; gap: 8px; align-items: center; }
.fw-aidlc-newform,
.tasks-newform {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0 4px;
  padding: 12px;
  border: 1px solid #262b35;
  border-radius: 10px;
  background: #14181f;
}
.fw-aidlc-newform textarea,
.tasks-newform textarea {
  width: 100%;
  min-height: 60px;
  resize: vertical;
  font: inherit;
  color: var(--text);
  background: var(--panel-2, #10141b);
  border: 1px solid #2c3240;
  border-radius: 8px;
  padding: 8px 10px;
}
.fw-aidlc-newform input[type="text"],
.tasks-newform input[type="text"] {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--panel-2, #10141b);
  border: 1px solid #2c3240;
  border-radius: 8px;
  padding: 10px;
  min-height: 44px;
}
.fw-newform-kind {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}
.fw-newform-kind select,
.tasks-newform select {
  min-height: 44px;
  font: inherit;
  color: var(--text);
  background: var(--panel-2, #10141b);
  border: 1px solid #2c3240;
  border-radius: 8px;
  padding: 8px 10px;
}

/* Ticket rows: reuse .ag-row; add status colouring + action layout */
.tk-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tk-act { min-height: 44px; }
.tk-act--danger { color: #d98c8c; border-color: #3a1c1c; }
.tk-status {
  font-size: 11px;
  font-weight: 600;
  border-radius: 999px;
  padding: 2px 9px;
  border: 1px solid #262b35;
}
.tk-status--submitted { background: #241f14; color: #d9c48c; border-color: #3a331c; }
.tk-status--in_progress { background: #14243a; color: #8cb8d9; border-color: #1c2f3a; }
.tk-status--resolved { background: #12241a; color: #7bd47b; border-color: #1c3a1c; }
.tk-status--dismissed { background: #201a1a; color: var(--muted); }
.ag-tag--warn { border-color: #3a331c; color: #d9c48c; }
.tk-result { white-space: pre-wrap; word-break: break-word; }

/* Two-party ticket chat */
.tasks-chat {
  margin-top: 14px;
  border: 1px solid #262b35;
  border-radius: 12px;
  background: #14181f;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.tasks-chat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid #262b35;
}
.tasks-chat-title { font-weight: 600; font-size: 14px; }
.tasks-chat-log {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  max-height: 46vh;
  overflow-y: auto;
}
.tk-msg { max-width: 82%; padding: 8px 12px; border-radius: 12px; }
.tk-msg-who { font-size: 11px; color: var(--muted); margin-bottom: 2px; }
.tk-msg-body { white-space: pre-wrap; word-break: break-word; }
.tk-msg--me { align-self: flex-end; background: #1d2a3a; border: 1px solid #26405a; }
.tk-msg--them { align-self: flex-start; background: #1a1e26; border: 1px solid #262b35; }
.tk-when { font-size: 10px; color: var(--muted); margin-top: 3px; }
.tk-note {
  align-self: center;
  font-size: 12px;
  color: var(--muted);
  background: #12161d;
  border: 1px dashed #2c3240;
  border-radius: 999px;
  padding: 4px 12px;
}
.tasks-chat-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 0 12px;
}
.tasks-chat-actions:not(:empty) { padding: 10px 12px; border-top: 1px solid #262b35; }
.tk-progress { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.tasks-chat-compose {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid #262b35;
}
.tasks-chat-compose textarea {
  flex: 1 1 auto;
  resize: vertical;
  font: inherit;
  color: var(--text);
  background: var(--panel-2, #10141b);
  border: 1px solid #2c3240;
  border-radius: 8px;
  padding: 8px 10px;
  min-height: 44px;
}
.tasks-chat-compose .primary-btn { align-self: flex-end; }

@media (max-width: 720px) {
  .tk-msg { max-width: 92%; }
  .tasks-chat-log { max-height: 40vh; }
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• Use Cases page (usecases.js) â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   A browsable "what Eva can do" gallery. Rendered inside the ViewModal (no
   own frame). Card grid + filter chips + a detail sheet overlay + a
   "Start this with Eva" chat handoff. Mirrors .Kiro/Promo/Use-Cases-Mockup.html
   with the app palette. Touch targets â‰¥44px; responsive down to ~360px. */
.uc-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 16px 0 6px;
}
.uc-search {
  flex: 1 1 240px;
  min-width: 200px;
  position: relative;
}
.uc-search input {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px 10px 38px;
  background: var(--panel-2);
  border: 1px solid #2b303b;
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
}
.uc-search input::placeholder { color: var(--muted); }
.uc-search input:focus {
  outline: 2px solid var(--accent);
  border-color: var(--accent);
}
.uc-search-ico {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
}
.uc-count { font-size: 12px; color: var(--muted); white-space: nowrap; }

.uc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0 2px;
}
.uc-chip {
  min-height: 34px;
  padding: 4px 12px;
  border-radius: 999px;
  cursor: pointer;
  background: var(--panel-2);
  border: 1px solid #2b303b;
  color: var(--muted);
  font: inherit;
  font-size: 12.5px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.uc-chip:hover { border-color: var(--accent); color: var(--text); }
.uc-chip.active { background: #12203a; border-color: #24406e; color: #cfe0ff; }
.uc-chip-n { color: var(--muted); font-size: 11px; }
.uc-chip.active .uc-chip-n { color: #9fb9ea; }

.uc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.uc-card {
  background: var(--panel-2);
  border: 1px solid #262b35;
  border-radius: 12px;
  padding: 14px 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  color: var(--text);
  font: inherit;
  transition: border-color .15s ease, transform .05s ease;
}
.uc-card:hover { border-color: var(--accent); }
.uc-card:active { transform: translateY(1px); }
.uc-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.uc-card-ic { font-size: 22px; }
.uc-card-title { font-size: 15px; font-weight: 600; }
.uc-card-goal { font-size: 12.5px; color: var(--muted); flex: 1; }
.uc-card-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

.uc-tag {
  font-size: 11px;
  border-radius: 999px;
  padding: 2px 9px;
  white-space: nowrap;
  border: 1px solid #2b303b;
  color: var(--muted);
}
.uc-tag--workflow { border-color: #3a331c; color: #d9c48c; }
.uc-tag--single { border-color: #1c3a1c; color: #7bd47b; }
.uc-tag--cat { border-color: #24406e; color: #9fb9ea; }
.uc-tag--conn { border-color: #3a1c1c; color: #d98c8c; }

/* â”€â”€ Activated / "Try Me!" sections â”€â”€ */
.uc-section { margin-top: 18px; }
.uc-section-head { display: flex; align-items: center; gap: 10px; padding: 0 2px 2px; }
.uc-section-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; background: #4a515f; }
.uc-section-head--on .uc-section-dot { background: var(--ok); box-shadow: 0 0 0 3px rgba(63,185,80,.15); }
.uc-section-head h3 { font-size: 14px; margin: 0; letter-spacing: .2px; }
.uc-section-head--on h3 { color: #cfe0ff; }
.uc-section-count { font-size: 12px; color: var(--muted); }
.uc-section-rule { flex: 1; height: 1px; background: #22262f; margin-left: 6px; }

/* Compact activated card (short â€” gives "Try Me!" the room) */
.uc-grid--compact { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.uc-card--mini {
  flex-direction: row; align-items: center; gap: 10px; padding: 10px 12px;
  border-color: #1f3a2a;
  background: linear-gradient(180deg, #17241c 0%, var(--panel-2) 60%);
}
.uc-card--mini:hover { border-color: #3fb950; }
.uc-card--mini .uc-card-ic { font-size: 20px; flex: 0 0 auto; }
.uc-mini-main { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; text-align: left; }
.uc-card--mini .uc-card-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.uc-on-badge {
  align-self: flex-start; font-size: 10.5px; font-weight: 700; letter-spacing: .3px;
  color: #7bd47b; border: 1px solid #1f3a2a; background: #12251a; border-radius: 999px; padding: 2px 9px;
}
.uc-usage { display: flex; flex-wrap: wrap; gap: 5px 10px; font-size: 11px; color: var(--muted); }
.uc-usage-i { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.uc-usage-v { color: #cbd3e1; font-weight: 600; }

/* My Workflows section (the user's own no-code workflows). */
.uc-section-head--mine .uc-section-dot { background: #6ea8fe; box-shadow: 0 0 0 3px rgba(110,168,254,.15); }
.uc-section-head--mine h3 { color: #cfe0ff; }
.uc-card--mine {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-color: #223046; background: linear-gradient(180deg, #16202f 0%, var(--panel-2) 60%);
}
.uc-card--mine:hover { border-color: var(--accent); }
.uc-card--mine .uc-card-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.uc-card-sub { font-size: 11.5px; }
.uc-on-badge--saved { color: #7bd47b; border-color: #1f3a2a; background: #12251a; }
.uc-on-badge--draft { color: var(--warn); border-color: rgba(210,153,34,.5); background: rgba(210,153,34,.10); }
.uc-mine-acts { display: flex; gap: 6px; flex: 0 0 auto; margin-left: auto; }
.uc-mine-btn { min-height: 40px; }

/* Detail sheet: status bar (activated) */
.uc-status { font-size: 12.5px; padding: 8px 12px; border-radius: 8px; margin-bottom: 14px; }
.uc-status--on { color: #9be7ad; background: #12251a; border: 1px solid #1f3a2a; }

/* Detail sheet: internal MCP-sidecar health strip (read-only; Check/Revive live
   on the Connections page). Reuses .mcp-dot/.mcp-badge from the Connections CSS. */
.uc-sidecar-health {
  margin: 0 0 14px; padding: 10px 12px;
  background: var(--panel-2); border: 1px solid #262b35; border-radius: 8px;
}
.uc-sc-head { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 8px; }
.uc-sc-row { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.uc-sc-name { flex: 1 1 auto; min-width: 0; font-size: 13px; }
.uc-sc-hint { font-size: 12px; margin-top: 6px; }

/* Detail sheet: PA-grouped view (one block per Persistent Agent) */
.uc-pa-summary { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.uc-pa-summary strong { color: #cbd3e1; }
.uc-pa-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.uc-pa-fn { color: #cfe0ff; background: #12203a; border: 1px solid #24406e; border-radius: 999px; padding: 2px 9px; }
.uc-pa-arrow { color: #6b7484; }
.uc-pa { border: 1px solid #262b35; border-radius: 10px; background: #14171e; margin-bottom: 10px; overflow: hidden; }
.uc-pa-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: #191d25; border-bottom: 1px solid #23282f; }
.uc-pa-num {
  width: 20px; height: 20px; border-radius: 50%; background: #12251a; color: #7bd47b; border: 1px solid #1f3a2a;
  font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.uc-pa-name { font-size: 13.5px; font-weight: 600; color: var(--text); }
.uc-pa-tag { margin-left: auto; font-size: 10px; color: #9fb9ea; border: 1px solid #24406e; border-radius: 999px; padding: 1px 8px; }
.uc-pa-body { padding: 10px 12px; }
.uc-pa-desc { font-size: 12.5px; color: var(--muted); margin-bottom: 9px; }
.uc-pa-mini { display: grid; grid-template-columns: 68px 1fr; gap: 4px 10px; align-items: start; }
.uc-pa-mk { font-size: 10.5px; text-transform: uppercase; letter-spacing: .4px; color: #6b7484; padding-top: 4px; }
.uc-pa-mv { display: flex; flex-wrap: wrap; gap: 5px; }
.uc-pill--conn.uc-paconn { border-color: #1f3a2a; color: #9be7ad; }
.uc-paconn--off { border-color: #3a1c1c; color: #d98c8c; }

/* Detail sheet â€” an overlay INSIDE the Use Cases panel (over the gallery). */
.uc-overlay {
  /* FIXED to the viewport (not absolute over the panel's full scroll height) so
     the detail sheet always appears where the user is looking â€” clicking a card
     far down the scrolled gallery used to render the sheet pinned to the top of
     the tall panel, i.e. off-screen above the viewport. Viewport-anchored +
     vertically centered keeps it in view at any scroll position. */
  position: fixed;
  inset: 0;
  background: rgba(6, 8, 12, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
  z-index: 30; /* above the viewmodal card (which frames the panel) */
}
.uc-overlay[hidden] { display: none; }
.uc {
  position: relative; /* anchor the absolute overlay to the panel */
}
.uc-sheet {
  max-width: 640px;
  width: 100%;
  /* Cap to the viewport and scroll INSIDE the sheet, so a tall detail sheet
     (Flowgram / Agent Knowledge) never overflows the fixed, centered overlay. */
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid #2b303b;
  border-radius: var(--radius);
}
.uc-sheet-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 18px;
  background: var(--panel-2);
  border-bottom: 1px solid #262b35;
}
.uc-sheet-ic { font-size: 26px; }
.uc-sheet-main { flex: 1; min-width: 0; }
.uc-sheet-title { font-size: 17px; font-weight: 600; }
.uc-sheet-goal { font-size: 13px; color: var(--muted); margin-top: 2px; }
.uc-sheet-x { flex: 0 0 auto; }
.uc-sheet-body { padding: 16px 18px 6px; }
.uc-row { margin-bottom: 14px; }
.uc-lbl {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--muted);
  margin-bottom: 5px;
}
.uc-team { display: flex; flex-direction: column; gap: 6px; }
.uc-step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  background: var(--panel-2);
  border: 1px solid #262b35;
  border-radius: 8px;
  padding: 7px 10px;
}
.uc-step-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #12203a;
  color: #9fb9ea;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.uc-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.uc-pill {
  font-size: 12px;
  border-radius: 999px;
  padding: 3px 10px;
  border: 1px solid #2b303b;
  color: var(--text);
  background: var(--panel-2);
}
.uc-pill--skill { border-color: #24406e; }
.uc-pill--tool { border-color: #2f3a1c; }
.uc-pill--conn { border-color: #3a1c1c; color: #e0b6b6; }
.uc-sheet-foot {
  padding: 12px 18px 18px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.uc-foot-note { font-size: 11.5px; color: #6b7484; }

/* â”€â”€ Detail-sheet TABS (Details / Flowgram / Agent Knowledge) â”€â”€ */
.uc-tabs {
  display: flex;
  gap: 4px;
  padding: 8px 14px 0;
  border-bottom: 1px solid #262b35;
  background: var(--panel);
  overflow-x: auto;
}
.uc-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  padding: 10px 14px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
  border-radius: 8px 8px 0 0;
  white-space: nowrap;
}
.uc-tab:hover { color: var(--text); background: var(--panel-2); }
.uc-tab.active { color: var(--text); border-bottom-color: var(--accent); }
.uc-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* â”€â”€ Flowgram tab (n8n-style trigger â†’ PA(s) â†’ Eva â†’ delivery) â”€â”€ */
.fg-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 11px; color: var(--muted); margin: 2px 0 14px; }
.fg-legend span { display: inline-flex; align-items: center; gap: 6px; }
.fg-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.fg-canvas { display: flex; align-items: stretch; overflow-x: auto; padding: 2px 0 12px; }
.fg-stage { display: flex; flex-direction: column; justify-content: center; min-width: 186px; }
.fg-conn { display: flex; align-items: center; justify-content: center; min-width: 34px; color: #3f4756; flex: 0 0 auto; }
.fg-conn svg { width: 34px; height: 20px; }
.fg-node { background: #14171e; border: 1.5px solid #262b35; border-radius: 11px; min-width: 180px; max-width: 200px; }
.fg-nhead { display: flex; align-items: center; gap: 8px; padding: 9px 11px; border-bottom: 1px solid #23282f; border-radius: 10px 10px 0 0; }
.fg-nic { width: 24px; height: 24px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; flex: 0 0 auto; background: var(--panel-2); }
.fg-ntitle { font-weight: 700; font-size: 13px; line-height: 1.15; }
.fg-nkind { font-size: 9.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.fg-nbody { padding: 9px 11px; font-size: 11.5px; color: #cdd6e0; }
.fg-nsub { color: var(--muted); font-size: 11px; margin-bottom: 7px; }
.fg-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.fg-tglbl { width: 100%; font-size: 9px; color: #6b7484; text-transform: uppercase; letter-spacing: .05em; margin: 5px 0 -1px; }
.fg-tg { font-size: 10px; font-weight: 600; border-radius: 6px; padding: 3px 6px; border: 1px solid #2c313c; background: var(--panel-2); white-space: nowrap; }
.fg-tg--skill { border-color: #1c3a1c; color: #7bd47b; }
.fg-tg--tool { border-color: #24406e; color: #9fd0ff; }
.fg-node--trigger { border-color: var(--warn); }
.fg-node--trigger .fg-nhead { background: rgba(210,153,34,.10); } .fg-node--trigger .fg-nic { background: rgba(210,153,34,.2); } .fg-node--trigger .fg-ntitle { color: var(--warn); }
.fg-node--pa { border-color: #56d4c4; }
.fg-node--pa .fg-nhead { background: rgba(86,212,196,.10); } .fg-node--pa .fg-nic { background: rgba(86,212,196,.2); } .fg-node--pa .fg-ntitle { color: #56d4c4; }
.fg-node--eva { border-color: #a371f7; }
.fg-node--eva .fg-nhead { background: rgba(163,113,247,.10); } .fg-node--eva .fg-nic { background: rgba(163,113,247,.2); } .fg-node--eva .fg-ntitle { color: #a371f7; }
.fg-deliver { display: flex; flex-direction: column; gap: 8px; min-width: 172px; justify-content: center; }
.fg-dhdr { display: flex; align-items: center; gap: 8px; padding: 7px 2px; color: var(--accent); font-weight: 700; font-size: 12.5px; }
.fg-nic--deliver { background: rgba(110,168,254,.2); }
.fg-gw { display: flex; align-items: center; gap: 9px; background: #14171e; border: 1.5px solid #262b35; border-radius: 10px; padding: 8px 10px; }
.fg-gwic { width: 24px; height: 24px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; flex: 0 0 auto; background: var(--panel-2); }
.fg-gwmain { min-width: 0; }
.fg-gwname { font-size: 12.5px; font-weight: 600; }
.fg-gwsub { font-size: 10px; color: var(--muted); }
.fg-gw--on { border-color: var(--accent); } .fg-gw--on .fg-gwic { background: rgba(110,168,254,.2); } .fg-gw--on .fg-gwname { color: var(--accent); }
.fg-gw--off { opacity: .42; filter: saturate(.4); border-style: dashed; } .fg-gw--off .fg-gwname { color: var(--muted); }
.fg-gwbadge { margin-left: auto; font-size: 9.5px; font-weight: 700; border-radius: 6px; padding: 2px 6px; white-space: nowrap; }
.fg-gw--on .fg-gwbadge { background: rgba(110,168,254,.18); color: #9fd0ff; border: 1px solid rgba(110,168,254,.4); }
.fg-gw--off .fg-gwbadge { background: var(--panel-2); color: var(--muted); border: 1px solid #2c313c; }
.fg-note { margin-top: 12px; font-size: 11.5px; color: var(--muted); border-top: 1px dashed #262b35; padding-top: 10px; }
.fg-hint { font-size: 12px; color: var(--muted); background: var(--panel-2); border: 1px dashed #2c313c; border-radius: 8px; padding: 9px 11px; margin: 0 0 12px; }

/* â”€â”€ Agent Knowledge tab (agent list + latest collected result) â”€â”€ */
.ak-intro { font-size: 12px; color: var(--muted); margin: 2px 0 12px; }
/* Instance selector (multi-instance use cases: one card, many keyed PAs) */
.ak-instrow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 14px; }
.ak-instlbl { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-right: 2px; }
.ak-inst { min-height: 34px; padding: 4px 12px; background: var(--panel-2); border: 1px solid #262b35; color: var(--muted); border-radius: 999px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.ak-inst:hover { border-color: var(--accent); color: var(--text); }
.ak-inst.active { background: #12211f; border-color: #56d4c4; color: #a7e8de; }
.ak-inst:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* "Stop watching <X>" â€” retire the selected instance's PA set (inline confirm).
   "Disconnect a mailboxâ€¦" (mailbox use case) reuses the same row + button size. */
.ak-retirerow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 14px 0 2px; padding-top: 12px; border-top: 1px solid #23282f; }
.ak-retire, .ak-disconnect { min-height: 34px; }
.ak-retirehint { font-size: 11px; color: var(--muted); }
.ak { display: grid; grid-template-columns: 230px 1fr; gap: 14px; align-items: start; }
.ak-list { display: flex; flex-direction: column; gap: 8px; position: sticky; top: 0; align-self: start; }
.ak-item { display: flex; align-items: center; gap: 9px; text-align: left; width: 100%; cursor: pointer; background: #14171e; border: 1px solid #262b35; border-radius: 10px; padding: 9px 11px; color: var(--text); font: inherit; min-height: 44px; }
.ak-item:hover { border-color: var(--accent); }
.ak-item.active { border-color: #56d4c4; background: #12211f; }
.ak-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ak-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; background: #4a515f; }
.ak-dot.ok { background: var(--ok); box-shadow: 0 0 0 3px rgba(63,185,80,.15); }
.ak-dot.err { background: var(--err); }
.ak-imain { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 1px; }
.ak-iname { display: block; font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ak-iwhen { display: block; font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ak-detail { background: #14171e; border: 1px solid #262b35; border-radius: 10px; overflow: hidden; min-height: 180px; }
.ak-dhead { display: flex; align-items: center; gap: 8px; padding: 11px 13px; background: #191d25; border-bottom: 1px solid #23282f; }
.ak-dtitle { font-size: 13.5px; font-weight: 700; min-width: 0; flex: 1 1 auto; overflow-wrap: anywhere; word-break: break-word; }
.ak-dtag { margin-left: auto; flex: 0 0 auto; white-space: nowrap; align-self: flex-start; font-size: 10px; color: #9fb9ea; border: 1px solid #24406e; border-radius: 999px; padding: 1px 8px; }
.ak-dmeta { display: flex; flex-wrap: wrap; gap: 5px 14px; padding: 9px 13px; font-size: 11px; color: var(--muted); border-bottom: 1px solid #23282f; }
.ak-dmeta b { color: #cbd3e1; font-weight: 600; }
.ak-ok { color: #7bd47b; }
.ak-err { color: #f2a2a2; }
.ak-dbody { padding: 12px 13px; }
.ak-dsummary { font-size: 12.5px; color: #cdd6e0; margin: 0 0 10px; }
.ak-dlbl { font-size: 10px; text-transform: uppercase; letter-spacing: .5px; color: #6b7484; margin-bottom: 5px; }
.ak-count { font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.ak-count b { color: #cbd3e1; font-weight: 600; }
.ak-result { background: #0b0e13; border: 1px solid #23282f; border-radius: 8px; padding: 11px 12px; font-size: 12px; color: #d6dde8; white-space: pre-wrap; line-height: 1.55; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.ak-empty { padding: 22px 14px; color: var(--muted); font-size: 12.5px; text-align: center; }
.ak-empty-ic { font-size: 26px; display: block; margin-bottom: 6px; opacity: .7; }
.ak-empty-sub { font-size: 11px; }

@media (max-width: 560px) {
  .uc-overlay { padding: 0; align-items: stretch; }
  .uc-sheet { border-radius: 0; min-height: 100vh; max-height: 100vh; }
  .ak { grid-template-columns: 1fr; }
  .ak-list { position: static; }
  .fg-canvas { flex-direction: column; align-items: stretch; }
  .fg-stage, .fg-node, .fg-deliver { min-width: 0; max-width: none; width: 100%; }
  .fg-conn { min-width: 0; height: 26px; }
  .fg-conn svg { transform: rotate(90deg); }
}

/* App-driven use-case setup view (2b â€” session 51). Rendered into #uc-sheet;
   deterministic step-by-step, real buttons, no model involvement. */
.uc-setup { display: flex; flex-direction: column; gap: 14px; }
.uc-setup-loading { color: var(--muted); }
.uc-setup-msg { line-height: 1.5; }
.uc-setup-note { font-size: 12.5px; color: var(--muted); }
.uc-setup-muted { font-size: 12.5px; color: var(--muted); }
.uc-setup-done { font-weight: 600; color: var(--ok, #4ade80); }
.uc-setup-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.uc-setup-steps li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-2, #101826);
}
.uc-setup-steps li.pending { opacity: 0.6; }
.uc-setup-steps li.done .uc-setup-steplabel { color: var(--muted); }
.uc-setup-steplabel { font-weight: 500; }
.uc-setup-tick { color: var(--ok, #4ade80); font-weight: 600; font-size: 13px; }
.uc-setup-steps .primary-btn,
.uc-setup-steps a.primary-btn { min-height: 40px; text-decoration: none; display: inline-flex; align-items: center; }
.uc-setup-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 4px; }
.uc-setup-status { font-size: 12.5px; color: var(--muted); min-height: 1em; }
.uc-setup-status--ok { color: var(--ok, #4ade80); }
.uc-daily { display: flex; flex-wrap: wrap; gap: 8px; }
.uc-daily-btn {
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel-2, #101826);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}
.uc-daily-btn:hover { border-color: var(--accent); }
.uc-daily-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Manage-my-Mailbox provider picker + service chooser (session 53 follow-up) */
.uc-backlink { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px;
  color: var(--accent, #6ea8fe); cursor: pointer; margin-bottom: 12px; background: none; border: none; }
.uc-prov-list { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 6px; }
.uc-prov { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 12px 14px; border: 1px solid var(--border, #262b35); border-radius: 11px;
  background: var(--panel-2, #101826); color: var(--text, #e6edf3); cursor: pointer; min-height: 44px; }
.uc-prov:hover { border-color: var(--accent, #6ea8fe); }
.uc-prov:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.uc-prov--disabled { opacity: 0.7; }
.uc-prov-logo { width: 34px; height: 34px; border-radius: 8px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; }
.uc-prov-logo--google { background: #fff; color: #4285f4; }
.uc-prov-logo--microsoft { background: #0f6cbd; color: #fff; }
.uc-prov-logo--yahoo { background: #6001d2; color: #fff; }
.uc-prov-logo--lark { background: #00d6b9; color: #04231f; }
.uc-prov-main { flex: 1; min-width: 0; }
.uc-prov-name { display: block; font-weight: 600; font-size: 14.5px; }
.uc-prov-sub { display: block; font-size: 12px; color: var(--muted); margin-top: 1px; }
.uc-prov-side { flex: 0 0 auto; }
.uc-prov-link { color: var(--accent, #6ea8fe); font-size: 12.5px; }
.uc-svc-list { display: flex; flex-direction: column; gap: 7px; margin: 4px 0 6px; }
.uc-svc { display: flex; align-items: center; gap: 10px; padding: 11px 13px;
  border: 1px solid var(--border, #262b35); border-radius: 10px;
  background: var(--panel-2, #101826); cursor: pointer; min-height: 44px; }
.uc-svc input { width: 18px; height: 18px; accent-color: var(--ok, #4ade80); flex: 0 0 auto; }
.uc-svc-name { font-weight: 600; font-size: 14px; }
.uc-svc-desc { font-size: 12px; color: var(--muted); }

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• Skills page (agents.js) â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   Category-grouped skills with a category master switch + per-skill switch,
   search, on/off segmented filter, and a live "always-loaded index" meter.
   Mirrors .Kiro/Promo/Skills-Page-Mockup.html with the app palette. Touch
   targets â‰¥44px; collapses to a column below 640px. */
.sk-notice {
  margin: 16px 0 6px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #12203a;
  border: 1px solid #24406e;
  color: #b9cdf0;
  font-size: 12.5px;
}
.sk-notice b { color: #dbe7ff; }

.sk-meter {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 4px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--panel-2);
  border: 1px solid #262b35;
}
.sk-meter-big { font-size: 20px; font-weight: 700; color: #7bd47b; }
.sk-meter-lbl { font-size: 12px; color: var(--muted); flex: 1; }
.sk-meter-tok { font-size: 12px; color: var(--muted); }
.sk-meter-tok b { color: var(--text); }

.sk-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 14px 0 8px;
}
.sk-search { flex: 1 1 240px; min-width: 180px; position: relative; }
.sk-search input {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px 10px 38px;
  background: var(--panel-2);
  border: 1px solid #2b303b;
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
}
.sk-search input::placeholder { color: var(--muted); }
.sk-search input:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
.sk-search-ico {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
}
.sk-count { font-size: 12px; color: var(--muted); white-space: nowrap; }
.sk-linkbtn {
  font-size: 12px;
  color: var(--accent);
  background: none;
  border: 0;
  cursor: pointer;
  padding: 6px;
  min-height: 36px;
}
.sk-segmented {
  display: inline-flex;
  border: 1px solid #2b303b;
  border-radius: 999px;
  overflow: hidden;
}
.sk-segmented button {
  background: transparent;
  border: 0;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  padding: 6px 12px;
  min-height: 36px;
  cursor: pointer;
}
.sk-segmented button.on { background: #12203a; color: #cfe0ff; }

.sk-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 2px; }
.sk-chip {
  min-height: 34px;
  padding: 4px 12px;
  border-radius: 999px;
  cursor: pointer;
  background: var(--panel-2);
  border: 1px solid #2b303b;
  color: var(--muted);
  font: inherit;
  font-size: 12.5px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.sk-chip:hover { border-color: var(--accent); color: var(--text); }
.sk-chip.active { background: #12203a; border-color: #24406e; color: #cfe0ff; }
.sk-chip-n { color: var(--muted); font-size: 11px; }
.sk-chip.active .sk-chip-n { color: #9fb9ea; }

.sk-cat {
  margin-top: 14px;
  border: 1px solid #232833;
  border-radius: 12px;
  background: var(--panel);
  overflow: hidden;
  position: relative;
  animation: sk-fade-in .3s ease both;
}
/* Category colour accent stripe (--cat-accent set inline per category). */
.sk-cat::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--cat-accent, #3a4557);
  opacity: 0.9;
}
.sk-cat.sk-cat-off { opacity: 0.82; }
.sk-cat.sk-cat-off::before { opacity: 0.4; }
.sk-cat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px 12px 16px;
  min-height: 52px;
  background: var(--panel-2);
}
/* Category icon tile, tinted by the category accent. */
.sk-cat-ic {
  flex: 0 0 auto;
  width: 30px; height: 30px;
  border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px; line-height: 1;
  background: color-mix(in srgb, var(--cat-accent, #3a4557) 18%, #10151d);
  border: 1px solid color-mix(in srgb, var(--cat-accent, #3a4557) 55%, #10151d);
}
.sk-disc {
  background: none;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  padding: 6px;
  display: inline-flex;
  align-items: center;
}
.sk-cat.collapsed .sk-disc .sk-chev { transform: rotate(-90deg); }
.sk-chev { transition: transform .15s ease; display: inline-block; }
.sk-cat-name { flex: 1; min-width: 0; }
.sk-cat-name .sk-nm { font-size: 14px; font-weight: 600; display: block; }
.sk-cat-desc { color: var(--muted); font-weight: 400; font-size: 12px; display: block; margin-top: 1px; }
.sk-cat-onct {
  font-size: 11px;
  color: var(--muted);
  background: #10151d;
  border: 1px solid #2b303b;
  border-radius: 999px;
  padding: 3px 9px;
  white-space: nowrap;
}
.sk-cat-onct.some { color: #cbd68a; border-color: #3b3a1e; }
.sk-cat-onct.allon { color: #7bd47b; border-color: #1c4a26; }
/* Animated expand/collapse via grid-template-rows (0fr <-> 1fr). The rows live
   in .sk-cat-body-inner so the padding doesn't fight the 0fr collapse. */
.sk-cat-body { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .25s ease; }
.sk-cat.collapsed .sk-cat-body { grid-template-rows: 0fr; }
.sk-cat-body-inner {
  overflow: hidden;
  min-height: 0;
  padding: 8px 12px 12px;
  display: flex; flex-direction: column; gap: 8px;
}
.sk-cat.collapsed .sk-cat-body-inner { padding-top: 0; padding-bottom: 0; }

/* Toggle switch (category master + per-skill). Padding gives a â‰¥44px hit. */
.sk-sw {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  padding: 8px 2px;
}
.sk-sw:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.sk-track {
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: #2b303b;
  border: 1px solid #363c48;
  position: relative;
  transition: background .15s ease, border-color .15s ease;
}
.sk-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #9aa3b2;
  transition: transform .15s ease, background .15s ease;
}
.sk-sw.on .sk-track { background: #12351f; border-color: #1c4a26; }
.sk-sw.on .sk-knob { transform: translateX(18px); background: #7bd47b; }
.sk-sw-lbl { font-size: 11px; color: var(--muted); min-width: 22px; }
.sk-sw.on .sk-sw-lbl { color: #7bd47b; }
.sk-cat-head .sk-sw .sk-sw-lbl { font-weight: 600; }

@media (max-width: 640px) {
  .sk-cat-head { flex-wrap: wrap; }
}

/* â”€â”€ AIV-Dev-only skill "Details" button + body overlay (session 47b) â”€â”€â”€â”€â”€â”€
   The skill catalog is AIV-Dev IP: only AIV-Dev sees a skill's full SKILL.md
   body. The button renders only for AIV-Dev; the server route also 403s. */
.sk-details-btn {
  min-height: 44px;
  padding: 6px 12px;
  border: 1px solid #24406e;
  border-radius: 8px;
  background: #12203a;
  color: #cfe0ff;
  font-size: 12px;
  cursor: pointer;
}
.sk-details-btn:hover { border-color: var(--accent); }
.sk-details-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sk-detail-ov {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}
.sk-detail-ov.open { display: flex; }
.sk-detail-sheet {
  background: var(--panel, #14181f);
  border: 1px solid #262b35;
  border-radius: 12px;
  width: min(820px, 100%);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sk-detail-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #262b35;
}
.sk-detail-title { flex: 1; font-weight: 700; color: var(--text); }
.sk-detail-x {
  min-width: 44px;
  min-height: 44px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  border-radius: 8px;
}
.sk-detail-x:hover { color: var(--text); background: #1b212b; }
.sk-detail-body {
  margin: 0;
  padding: 16px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12.5px;
  line-height: 1.5;
  color: #cfe0ff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* â”€â”€ AIV-Dev Community skill EDIT (the detail sheet's editable mode) â”€â”€â”€â”€â”€â”€â”€â”€
   The catalog is AIV-Dev IP; only AIV-Dev sees the Edit button + can save.
   Saving PUTs /api/aivdev/skills/community/{name}, which writes an override
   into the writable community dir (scanned before the read-only catalog). */
.sk-details-btn--edit { color: #cfe0ff; border-color: #24406e; background: #12203a; }
.sk-detail-mode {
  font-size: 11px; color: var(--muted);
  border: 1px solid #2b303b; border-radius: 999px; padding: 2px 9px;
}
.sk-detail-mode.edit { color: #cfe0ff; border-color: #24406e; background: #12203a; }
.sk-detail-editwrap { padding: 14px 16px; overflow: auto; }
.sk-edit-hint { margin: 0 0 10px; font-size: 12px; color: var(--warn, #d29922); }
.sk-detail-textarea {
  width: 100%; min-height: 340px; padding: 12px;
  border-radius: 10px; border: 1px solid #2b303b; background: #10151d; color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px;
  resize: vertical;
}
.sk-detail-textarea:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
.sk-detail-foot {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-top: 1px solid #262b35;
}
.sk-detail-foot-note { font-size: 12px; color: var(--muted); }
.sk-detail-foot-sp { flex: 1; }

/* Category-block entrance; disabled under reduced-motion (below). */
@keyframes sk-fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .sk-cat { animation: none; }
  .sk-cat-body { transition: none; }
  .ag-row { transition: none; }
  .sk-chev { transition: none; }
  .sk-track, .sk-knob { transition: none; }
}

/* â”€â”€ Skills page: Community / My Skills tabs + Creator-Repo editors â”€â”€â”€â”€â”€â”€â”€â”€â”€
   (agents.js; mockup .Kiro/Promo/Skills-Community-MySkills-Mockup.html). The
   Community tab reuses the existing .sk-* styles above; these add the top tab
   strip, the My Skills toolbar/rows, and the Create/Import/Share editors. */
.sk-maintabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid #262b35;
  margin: 8px 0 16px;
}
.sk-maintab {
  appearance: none;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
  padding: 12px 16px;
  min-height: 48px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sk-maintab:hover { color: var(--text); }
.sk-maintab.active { color: #cfe0ff; border-bottom-color: var(--accent); }
.sk-maintab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sk-maintab-cnt {
  font-size: 12px;
  color: var(--muted);
  background: var(--panel-2);
  border: 1px solid #262b35;
  border-radius: 999px;
  padding: 1px 8px;
}
.sk-maintab.active .sk-maintab-cnt { color: #9fb9ea; }

/* "Mine" tag on a My-Skills row. */
.ag-tag--mine { color: #cbb26b; border-color: #4a3f1c; }

/* My Skills toolbar + row action buttons. */
.mine-toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 14px; }
.btn-primary {
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid #24406e;
  background: #12203a;
  color: #cfe0ff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.btn-primary:hover { border-color: var(--accent); }
.btn-primary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sk-rowbtn {
  min-height: 40px;
  padding: 6px 12px;
  border: 1px solid #2b303b;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}
.sk-rowbtn:hover { border-color: var(--accent); color: var(--text); }
.sk-rowbtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Create / Import / Share editors. */
.sk-editor {
  margin: 12px 0;
  border: 1px solid #24406e;
  border-radius: 12px;
  background: var(--panel-2);
  padding: 16px;
}
.sk-editor h3 { margin: 0 0 12px; font-size: 15px; }
.sk-fld { margin-bottom: 12px; }
.sk-fld label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}
.sk-fld input,
.sk-fld select,
.sk-fld textarea {
  width: 100%;
  padding: 10px 12px;
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid #2b303b;
  background: var(--panel);
  color: var(--text);
  font-size: 14px;
}
.sk-fld input:disabled { opacity: .6; }
.sk-fld textarea {
  min-height: 220px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.5;
  resize: vertical;
}
.sk-hint { font-size: 12px; color: var(--muted); margin: 6px 0 0; }
.sk-editor-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* Import dropzone (agents.js, My Skills â€º Import a SKILL.md). A real <button>
   so it's keyboard/tap operable; also accepts a dragged .md file. */
.sk-dropzone {
  display: block;
  width: 100%;
  text-align: center;
  padding: 22px 16px;
  min-height: 44px;
  border: 2px dashed #2f5187;
  border-radius: 10px;
  background: #0f1b30;
  color: var(--fg, #e6ecf5);
  font-size: 14px;
  line-height: 1.5;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.sk-dropzone:hover,
.sk-dropzone:focus-visible { border-color: #3f6bb0; background: #12213a; }
.sk-dropzone.dragging { border-color: #5b8ee0; background: #16294a; }
.sk-dropzone .sk-hint { display: block; margin-top: 6px; }

/* â”€â”€ Scheduler run history (agents.js, Delegation â€º Scheduler) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€
   An expandable "last N runs" list per monitor, read from the CronStore
   mirror (cron_executions). source='builtin' shows as "scheduled"; a red
   status pill flags a failed run. */
.ag-pill--err { background: #241414; color: #f0a3a3; border: 1px solid #4a1c1c; }
.ag-runs-toggle { font-size: 12px; padding: 6px 10px; min-height: 36px; }
.ag-runs {
  margin-top: 10px;
  border-top: 1px solid #262b35;
  padding-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ag-runs-head {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--muted);
  margin-bottom: 2px;
}
.ag-run {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  background: var(--panel-2);
  border: 1px solid #262b35;
  border-radius: 8px;
  padding: 7px 10px;
}
.ag-run-main { min-width: 0; flex: 1 1 auto; }
.ag-run-when { font-size: 12.5px; color: var(--text); }
.ag-run-err {
  font-size: 11.5px;
  color: #d98c8c;
  margin-top: 3px;
  word-break: break-word;
}
.ag-run-side {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   Agent Performance (ROI) â€” flip-card overview + Active Agents + category grid.
   Ported from .Kiro/Promo/Agent-Performance-ROI-Mockup.html; uses the app's own
   design tokens. Eva's overview cards slide; the Active Agents (PA) cards do a
   teal 3D board-flip; both flip on independent timers (see agents.js).
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
.roi-b-meas { color: #9cb8ff; }
.roi-b-est  { color: #ffd36b; }
.roi-b-verd { color: #63e6b0; }

.roi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 4px 0 8px; }
@media (max-width: 900px) { .roi-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .roi-grid { grid-template-columns: 1fr; } }
.roi-grid--pa { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 520px) { .roi-grid--pa { grid-template-columns: 1fr; } }

/* card = a window over a 3-face horizontal track (slide flip) */
.roi-card { position: relative; height: 210px; border: 1px solid var(--panel-2);
  border-radius: var(--radius); background: var(--panel); overflow: hidden;
  cursor: pointer; outline: none; }
.roi-card:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
.roi-card:hover { border-color: #33436b; }
.roi-track { display: flex; width: 300%; height: calc(100% - 20px);
  transition: transform .55s cubic-bezier(.3,.8,.3,1); }
.roi-track[data-face="0"] { transform: translateX(0); }
.roi-track[data-face="1"] { transform: translateX(-33.3333%); }
.roi-track[data-face="2"] { transform: translateX(-66.6666%); }
.roi-face { width: 33.3333%; flex: 0 0 33.3333%; padding: 15px 16px 12px;
  display: flex; flex-direction: column; }

/* Active Agents = a real 3D board-flip (rotateX), not a slide */
.roi-card--flip { perspective: 900px; }
.roi-card--flip .roi-track { display: block; width: 100%; transform: none !important; transition: none; }
.roi-card--flip .roi-face { position: absolute; inset: 0; width: auto; height: calc(100% - 20px);
  transform-origin: center; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  transition: transform .6s cubic-bezier(.4,.15,.2,1), opacity .45s ease;
  transform: rotateX(90deg); opacity: 0; pointer-events: none; z-index: 1; }
.roi-card--flip .roi-track[data-face="0"] .roi-face:nth-child(1),
.roi-card--flip .roi-track[data-face="1"] .roi-face:nth-child(2),
.roi-card--flip .roi-track[data-face="2"] .roi-face:nth-child(3) {
  transform: rotateX(0deg); opacity: 1; pointer-events: auto; z-index: 2; }

.roi-badge { align-self: flex-start; font-size: 10px; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; padding: 3px 8px; border-radius: 999px; margin-bottom: 6px; }
.roi-badge.measured { background: rgba(110,168,254,.14); color: #9cb8ff; border: 1px solid #33436b; }
.roi-badge.est { background: rgba(255,211,107,.13); color: #ffd36b; border: 1px solid #6a5423; }
.roi-badge.verdict { background: rgba(52,211,153,.16); color: #63e6b0; border: 1px solid #2a5f4a; }
.roi-cap { display: flex; align-items: center; gap: 8px; font-size: 11px; letter-spacing: .07em;
  text-transform: uppercase; color: var(--muted); font-weight: 700; }
.roi-ico { width: 17px; height: 17px; flex: 0 0 auto; stroke: #9cb8ff; }
.roi-big { font-size: 30px; font-weight: 800; line-height: 1.05; margin: 8px 0 2px; color: var(--text); }
.roi-unit { font-size: 13px; color: var(--muted); font-weight: 600; }
.roi-sub2 { font-size: 13px; font-weight: 600; color: #9cb8ff; }
.roi-meta { font-size: 12px; color: var(--muted); margin-top: auto; line-height: 1.4; }
.roi-face .pulse { animation: roiPulse 3.2s ease-in-out infinite; }
@keyframes roiPulse { 0%,100%{opacity:1} 50%{opacity:.74} }

/* verdict face */
.roi-vs { display: flex; flex-direction: column; gap: 9px; margin-top: 8px; }
.roi-vsrow { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.roi-vsrow .lbl { width: 46px; flex: 0 0 auto; }
.roi-vsrow b { font-size: 14px; white-space: nowrap; }
.roi-bar { height: 9px; border-radius: 6px; overflow: hidden; flex: 1; background: #0c1220; border: 1px solid var(--panel-2); }
.roi-bar > i { display: block; height: 100%; border-radius: 6px; }
.roi-bar.eva > i { background: linear-gradient(90deg, var(--accent), #7c5cff); }
.roi-bar.human > i { background: #4a5675; width: 100%; }
.roi-save { font-size: 12px; color: #63e6b0; font-weight: 700; margin-top: 8px; }

/* face dots */
.roi-dots { position: absolute; bottom: 8px; left: 0; right: 0; display: flex; gap: 5px; justify-content: center; }
.roi-dots i { width: 6px; height: 6px; border-radius: 50%; background: #33406a; transition: .3s; }
.roi-dots i.on { background: var(--accent); width: 16px; border-radius: 6px; }

/* Active Agents (PA) teal scheme */
.roi-grid--pa .roi-card { background: linear-gradient(180deg,#12211f,#0f1a1a); border-color: #1f4b45; }
.roi-grid--pa .roi-card:hover { border-color: #2f7a6e; }
.roi-grid--pa .roi-badge.measured { background: rgba(45,212,191,.14); color: #7defcf; border: 1px solid #2a5f57; }
.roi-grid--pa .roi-badge.verdict { background: rgba(52,211,153,.16); color: #63e6b0; border: 1px solid #2a5f4a; }
.roi-grid--pa .roi-big { color: #eafffb; }
.roi-grid--pa .roi-cap { color: #6fb3a6; }
.roi-grid--pa .roi-ico { stroke: #5eead4; }
.roi-grid--pa .roi-sub2 { color: #7defcf; }
.roi-grid--pa .roi-bar.eva > i { background: linear-gradient(90deg, #2dd4bf, #22d3aa); }
.roi-grid--pa .roi-save { color: #5eead4; }
.roi-grid--pa .roi-dots i.on { background: #2dd4bf; }

/* section sub-titles inside the ROI page */
.roi-sec-title { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 800;
  margin: 30px 0 4px; letter-spacing: -.01em; color: var(--text); }
.roi-sec-ico { width: 20px; height: 20px; color: var(--accent); }
.roi-sec-title--pa .roi-sec-ico { color: #2dd4bf; }
.roi-sec-sub { margin: 0 0 14px; max-width: 760px; font-size: 13px; }

/* Activate to Save More â€” calm category tile grid */
.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 820px) { .cat-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .cat-grid { grid-template-columns: repeat(2, 1fr); } }
.cat { position: relative; border: 1px solid var(--panel-2); border-radius: 16px;
  background: linear-gradient(180deg,#141d31,#101827); padding: 16px 14px 15px;
  cursor: pointer; overflow: hidden; text-align: left; color: var(--text);
  display: flex; flex-direction: column; gap: 10px; min-height: 118px;
  transition: transform .3s cubic-bezier(.2,.8,.2,1), box-shadow .3s, border-color .3s;
  animation: catBreathe 6s ease-in-out infinite; will-change: transform; }
@keyframes catBreathe { 0%,100%{transform:translateY(0) scale(1)} 50%{transform:translateY(-3px) scale(1.012)} }
.cat::before { content:""; position:absolute; inset:-40% -30% auto auto; width:120px; height:120px;
  background: radial-gradient(circle, var(--glow) 0%, transparent 70%); opacity:.5;
  transition: opacity .3s; pointer-events: none; }
.cat:hover, .cat:focus-visible { transform: translateY(-6px) scale(1.03); border-color: var(--glow);
  box-shadow: 0 16px 40px rgba(0,0,0,.45), 0 0 0 1px var(--glow); outline: none;
  animation-play-state: paused; z-index: 3; }
.cat:hover::before, .cat:focus-visible::before { opacity: .9; }
.cat-ico { width: 42px; height: 42px; flex: 0 0 auto; border-radius: 12px; display: grid; place-items: center;
  font-size: 22px; background: var(--discBg); box-shadow: inset 0 1px 0 rgba(255,255,255,.18); }
.cat-name { font-weight: 700; font-size: 13.5px; line-height: 1.2; }
.cat-meta { font-size: 11.5px; color: var(--muted); margin-top: auto; }
.cat-go { position: absolute; right: 13px; bottom: 13px; font-size: 12px; font-weight: 700; color: var(--glow);
  opacity: 0; transform: translateX(-4px); transition: .3s; }
.cat:hover .cat-go, .cat:focus-visible .cat-go { opacity: 1; transform: translateX(0); }

.roi-legend { display: flex; gap: 16px; flex-wrap: wrap; margin: 18px 0 2px; font-size: 12px; }
.roi-legend span { display: inline-flex; align-items: center; gap: 6px; }
.roi-sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

@media (prefers-reduced-motion: reduce) {
  .cat { animation: none; }
  .roi-face .pulse { animation: none; }
  .roi-track, .roi-card--flip .roi-face { transition: none; }
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   Memory Diagram (memory.js) â€” a D3 force-directed BUBBLE GRAPH of what Eva has
   remembered from the user's email: Work / Personal hubs â†’ companies (by domain)
   â†’ people, + an "Everyone" cloud. Bubble size = message volume. Lives under
   Settings â€º Circle of Influence, opened as a ViewModal. Palette-only; â‰¥44px
   touch targets; keyboard focus; reduced-motion-safe. Mockup:
   .Kiro/Promo/Memory-Diagram-Mockup.html.
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
.mem-diagram { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.mem-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.mem-head h2 { margin: 0; font-size: 18px; display: flex; align-items: center; gap: 8px; }
.mem-sub-line { font-size: 12.5px; margin-top: 2px; }
.mem-head-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.mem-head-actions .ghost-btn { min-height: 40px; }
.mem-head-actions .ghost-btn.on { border-color: var(--accent); color: var(--accent); }

/* Breadcrumb trail (ðŸ§  Memory â€º Work â€º Company). Every ancestor tappable. */
.mem-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; margin-bottom: 8px; }
.mem-crumb {
  display: inline-flex; align-items: center; min-height: 32px;
  padding: 4px 12px; border-radius: 999px; border: 1px solid #262b35;
  background: var(--panel-2); color: var(--text); font: inherit; cursor: pointer;
}
.mem-crumb:hover, .mem-crumb:focus-visible { border-color: var(--accent); outline: none; }
.mem-crumb--current { color: var(--muted); cursor: default; background: transparent; border-color: transparent; padding-left: 0; }
.mem-crumb-sep { color: var(--muted); font-size: 12px; }

/* The graph canvas â€” fills the remaining panel height; SVG is the force graph. */
.mem-graph {
  position: relative; flex: 1 1 auto; min-height: 420px;
  border: 1px solid #262b35; border-radius: var(--radius);
  background: radial-gradient(circle at 50% 40%, #12161d 0%, var(--bg) 80%);
  overflow: hidden;
}
#mem-svg { width: 100%; height: 100%; display: block; cursor: grab; }
#mem-svg:active { cursor: grabbing; }

.mem-link { stroke: #2a3140; stroke-opacity: .5; }
.mem-node { cursor: pointer; }
.mem-node circle { transition: stroke .12s ease; }
.mem-node:hover circle, .mem-node:focus circle { stroke: #fff; stroke-width: 2px; outline: none; }
.mem-node text { fill: var(--text); pointer-events: none; text-anchor: middle; font-weight: 700; }
.mem-node .mem-sub { fill: var(--muted); font-weight: 600; }

/* Loading + empty states (honest â€” never fabricated), centered over the canvas */
.mem-loading, .mem-empty {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  text-align: center; color: var(--muted); font-size: 13.5px; padding: 24px; pointer-events: none;
}
.mem-empty { flex-direction: column; gap: 6px; }
.mem-empty p { margin: 0; max-width: 420px; }

/* Legend + hint (bottom), and the hover tooltip */
.mem-legend {
  position: absolute; left: 14px; bottom: 12px; right: 14px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px;
  font-size: 12px; color: var(--muted); pointer-events: none;
}
.mem-legend span { display: inline-flex; align-items: center; gap: 6px; }
.mem-sw { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.mem-hint { margin-left: auto; opacity: .8; }
.mem-tip {
  position: absolute; pointer-events: none; z-index: 5; opacity: 0;
  background: var(--panel-2); border: 1px solid #262b35; border-radius: 10px;
  padding: 8px 11px; font-size: 12.5px; max-width: 240px;
  transition: opacity .12s ease; box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
.mem-tip b { display: block; font-size: 13px; margin-bottom: 2px; }
.mem-tip .m { color: var(--muted); font-weight: 600; }

@media (max-width: 560px) {
  .mem-hint { display: none; }
  .mem-graph { min-height: 360px; }
}
@media (prefers-reduced-motion: reduce) {
  .mem-node circle { transition: none; }
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• No-code Workflow CANVAS (Flowgram builder) â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   Workflow-Builder-Design.md Â§8 + Promo/Workflow-Canvas-Mockup.html. Reuses the
   app palette (--accent/--panel/--panel-2/--muted/--ok/--warn/--err, #262b35
   borders). â‰¥44px targets, keyboard-operable, prefers-reduced-motion honored.
   .wf-dfnode / .drawflow_content_node theme Drawflow's node bodies. */
.wf-root { display: block; }

/* "âœŽ Build a copy" affordance on a Use Case's Flowgram tab. */
.fg-buildcopy { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 4px 0 10px; }
.fg-buildcopy .ghost-btn { min-height: 44px; }

/* â”€â”€ LIST view â”€â”€ */
.wf-list-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.wf-list-head h2 { margin: 0; }
.wf-build-btn { min-height: 44px; }
.wf-list { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.wf-card {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  background: var(--panel); border: 1px solid #262b35; border-radius: var(--radius); padding: 12px 14px;
}
.wf-card-meta { min-width: 0; flex: 1 1 200px; }
.wf-card-title { font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wf-card-sub { font-size: 12px; margin-top: 3px; }
.wf-badge { font-size: 10px; font-weight: 700; border-radius: 6px; padding: 2px 7px; text-transform: uppercase; letter-spacing: .04em; }
.wf-badge--draft { color: var(--warn); border: 1px solid rgba(210,153,34,.5); background: rgba(210,153,34,.08); }
.wf-badge--saved { color: var(--ok); border: 1px solid rgba(63,185,80,.5); background: rgba(63,185,80,.08); }
.wf-card-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wf-act { min-height: 44px; }
.wf-act--danger { color: var(--err); border-color: rgba(248,81,73,.5); }
.wf-act--armed { background: rgba(248,81,73,.14); color: var(--err); }

/* â”€â”€ CANVAS: top bar â”€â”€ */
.wf-top {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; flex-wrap: wrap;
  background: var(--panel-2); border: 1px solid #262b35; border-radius: var(--radius); margin-bottom: 12px;
}
.wf-back { min-height: 44px; }
.wf-name {
  flex: 1 1 160px; min-width: 140px; background: var(--bg); border: 1px solid #2b313c; color: var(--text);
  border-radius: 9px; padding: 10px 12px; font: inherit; font-weight: 600; min-height: 44px;
}
.wf-name:focus { outline: none; border-color: var(--accent); }
/* Flowgram v2: Name + Description stacked in the top bar; a bold numbered step
   guide above the canvas; the Save/Run bar BELOW the canvas. */
.wf-top-fields { flex: 1 1 260px; min-width: 200px; display: flex; flex-direction: column; gap: 6px; }
.wf-field { display: flex; align-items: center; gap: 8px; }
.wf-field .wf-name, .wf-field .wf-desc { flex: 1; }
.wf-desc {
  background: var(--bg); border: 1px solid #2b313c; color: var(--text); border-radius: 9px;
  padding: 8px 12px; font: inherit; min-height: 40px;
}
.wf-desc:focus { outline: none; border-color: var(--accent); }
.wf-field-lbl { font-size: 11px; color: var(--muted); min-width: 68px; }
.wf-step-badge {
  display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px;
  border-radius: 50%; background: var(--accent); color: #08131f; font-weight: 800; font-size: 12px; flex: 0 0 auto;
}
.wf-build { display: flex; flex-direction: column; min-width: 0; }
.wf-guide {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 8px 12px; margin-bottom: 10px;
  background: var(--panel-2); border: 1px solid #262b35; border-radius: var(--radius); font-size: 12.5px;
}
.wf-guide-step { display: inline-flex; align-items: center; gap: 5px; color: var(--text); }
.wf-guide-step small { color: var(--muted); font-weight: 400; }
/* The Save / Run bar sits BELOW the canvas (a sibling of .wf-main, not inside
   the scrolling canvas), so it must never shrink or be dragged wide by the
   canvas's horizontal scroll â€” .wf-main clips the wide surface, and this bar
   stays full-width, pinned under it. */
.wf-footer {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; padding: 12px 14px;
  background: var(--panel-2); border: 1px solid #262b35; border-radius: var(--radius);
}
.wf-footer-step { display: inline-flex; align-items: center; gap: 6px; color: var(--text); margin-right: auto; }
.wf-footer .wf-save, .wf-footer .wf-run { min-height: 44px; }
.wf-tag--trigger { border-color: rgba(210,153,34,.5); color: #e0af68; }
.wf-trigger { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.wf-trigger select {
  background: var(--bg); border: 1px solid #2b313c; color: var(--text); border-radius: 8px; padding: 8px 10px; min-height: 44px; font: inherit;
}
.wf-save, .wf-run { min-height: 44px; }
.wf-status { font-size: 12.5px; color: var(--muted); min-width: 0; }
.wf-status--ok { color: var(--ok); }
.wf-status--warn { color: var(--warn); }
.wf-status--err { color: var(--err); }

/* â”€â”€ CANVAS: palette + canvas layout â”€â”€ */
/* position:relative is LOAD-BEARING: the collapsed-rail reveal handle
   (.wf-rail-reveal) is position:absolute and must anchor to .wf-main, NOT escape
   to the modal card and overlap the "Flowgram" title / header (the strip that
   cut off the title). */
.wf-main { display: flex; position: relative; min-width: 0; border: 1px solid #262b35; border-radius: var(--radius); overflow: hidden; background: var(--panel); }
/* The palette rail scrolls internally so a tall rail can't push the canvas box
   shorter than the visible area (which left dead space below #wf-canvas where a
   drop silently missed). It is COLLAPSIBLE (auto-hides after a drop, pin to keep
   open). */
.wf-palette {
  width: 232px; flex: 0 0 232px; border-right: 1px solid #262b35; background: var(--panel-2);
  padding: 12px; overflow: auto; height: 56vh; min-height: 360px; position: relative;
  transition: width .28s cubic-bezier(.4,0,.2,1), flex-basis .28s cubic-bezier(.4,0,.2,1), padding .28s;
}
/* Sticky rail header (title + pin + collapse) â€” stays put while chips scroll. */
.wf-rail-head {
  display: flex; align-items: center; gap: 6px; position: sticky; top: 0; z-index: 3;
  background: var(--panel-2); margin: -2px -2px 8px; padding: 2px 2px 8px;
}
.wf-rail-title { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-right: auto; }
.wf-rail-btn {
  width: 30px; height: 30px; min-width: 30px; border: 1px solid #262b35; border-radius: 8px;
  background: #0e1930; color: var(--muted); font-size: 14px; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.wf-rail-btn:hover { border-color: var(--accent); color: var(--text); }
.wf-rail-btn.pinned { color: var(--accent); border-color: var(--accent); background: rgba(110,168,254,.12); }

/* Collapsed rail + the reveal handle. */
.wf-rail-reveal {
  position: absolute; left: 0; top: 0; bottom: 0; width: 34px; z-index: 4; display: none;
  flex-direction: column; align-items: center; gap: 8px; padding-top: 12px;
  background: var(--panel-2); border-right: 1px solid #262b35; cursor: pointer;
}
.wf-rail-reveal:hover { background: #14203180; }
.wf-rail-chev { font-size: 16px; color: var(--accent); }
.wf-rail-vtext { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.wf-main.wf-collapsed .wf-palette { width: 34px; flex-basis: 34px; padding: 0; overflow: hidden; }
.wf-main.wf-collapsed .wf-palette > * { opacity: 0; transition: opacity .12s; }
.wf-main.wf-collapsed .wf-rail-reveal { display: flex; }
/* Peek: briefly slide the rail out then back (Edit-from-Use-Case). */
@keyframes wfRailPeek { 0%{width:34px;flex-basis:34px} 18%{width:232px;flex-basis:232px} 70%{width:232px;flex-basis:232px} 100%{width:34px;flex-basis:34px} }
.wf-main.wf-peeking .wf-palette { animation: wfRailPeek 1.5s ease both; }
.wf-main.wf-peeking.wf-collapsed .wf-palette > * { opacity: 1; }
@keyframes wfHandleNudge { 0%,100%{transform:translateX(0)} 50%{transform:translateX(4px)} }
.wf-main.wf-hint .wf-rail-chev { animation: wfHandleNudge .8s ease 2; }
.wf-palette h3 { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 14px 0 6px; }
.wf-palette h3:first-child { margin-top: 0; }
.wf-chip {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; min-height: 44px;
  background: #0e1930; border: 1px solid #262b35; color: var(--text); border-radius: 10px; padding: 8px 10px; margin-bottom: 8px; cursor: grab; font: inherit;
}
.wf-chip:hover { border-color: var(--accent); }
.wf-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wf-chip-ic { font-size: 18px; flex: 0 0 auto; }
.wf-chip-lbl { font-weight: 600; font-size: 13px; min-width: 0; }
.wf-chip-lbl small { display: block; color: var(--muted); font-size: 11px; font-weight: 400; }
.wf-chip--write { border-color: rgba(210,153,34,.5); }
.wf-chip--write .wf-chip-tag { margin-left: auto; font-size: 10px; color: var(--warn); border: 1px solid rgba(210,153,34,.5); border-radius: 6px; padding: 1px 5px; }
.wf-chip--off { opacity: .5; cursor: not-allowed; }

/* The canvas wrapper fills the (flex) main height, and #wf-canvas fills the
   wrapper â€” so the ENTIRE visible dotted area is the real drop target. Before,
   #wf-canvas was a fixed 460px while a tall palette stretched .wf-main taller,
   leaving dead space below the canvas where a drop silently missed (the "only
   drops higher up work" bug). */
.wf-canvaswrap { flex: 1; position: relative; min-width: 0; display: flex; }
/* The canvas is a FIXED-HEIGHT box that scrolls INTERNALLY in BOTH directions
   (a wide chain scrolls leftâ†”right, a tall/stacked one scrolls down). Its height
   is BOUNDED to a slice of the viewport, so it never grows the .wf-build column
   past the modal â€” that's what stops the whole ViewModal from scrolling
   vertically (the giant page scrollbar bug) and keeps the guide on top + the
   Save / Run footer visible at the bottom without paging. The wide/tall Drawflow
   surface is CLIPPED to this box (.wf-main also has overflow:hidden), so the
   scrollbars live INSIDE the canvas and never widen the column â€” which keeps the
   footer (a sibling BELOW .wf-main) full-width + unaffected by the horizontal
   scroll. */
/* #wf-canvas is the SCROLL BOX: a fixed-height viewport with BOTH scrollbars.
   Drawflow is NOT initialized on this element â€” it's on the inner #wf-drawflow
   (a large fixed-size surface) â€” so the browser gives real horizontal +
   vertical scrollbars here to reach any node, instead of Drawflow clipping +
   panning (which gave no scrollbar at all). */
.wf-canvas {
  flex: 1; height: 56vh; min-height: 360px; position: relative; overflow: auto;
}
/* The Drawflow surface: a large, fixed canvas the outer box scrolls around.
   Bigger than the viewport in BOTH axes so there's always room to lay a wide
   chain out AND drag cards lower. Drawflow's own .parent-drawflow fills this and
   its nodes sit inside it; the dot grid lives here so it covers the whole
   scrollable area. */
.wf-drawflow {
  width: 2400px; height: 1600px; position: relative;
  background: radial-gradient(circle, rgba(138,160,189,.12) 1px, transparent 1px); background-size: 22px 22px;
}
.wf-drawflow .parent-drawflow, .wf-drawflow .drawflow { width: 100%; height: 100%; }
.wf-limit { position: absolute; left: 16px; bottom: 10px; font-size: 12px; color: var(--muted); pointer-events: none; }
.wf-limit b { color: var(--text); }
.wf-limit-tail { color: var(--muted); }

/* â”€â”€ Drawflow node theming â”€â”€
   âš  Drawflow's own CSS ships `.drawflow .drawflow-node { background:#0ff; color:#000 }`
   (a 2-class selector). Our theming MUST be at least as specific or the nodes
   render bright cyan. So scope every override under `.drawflow .drawflow-node`. */
.wf-dfnode .drawflow_content_node { padding: 0; }
.drawflow .drawflow-node.wf-dfnode {
  background: var(--panel); border: 2px solid var(--accent); border-radius: 12px;
  box-shadow: 0 6px 18px rgba(0,0,0,.3); color: var(--text); width: auto; min-width: 180px; padding: 0;
}
.drawflow .drawflow-node.wf-node--pa { border-color: var(--accent); }
.drawflow .drawflow-node.wf-node--delivery { border-color: var(--ok); }
.drawflow .drawflow-node.wf-node--invoke { border-color: #a371f7; }
.drawflow .drawflow-node.wf-node--trigger { border-color: var(--warn); }
.wf-node-inner { padding: 10px 12px; min-width: 160px; }
.wf-node-h { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; }
.wf-node-ic { font-size: 17px; }
.wf-node-t { font-weight: 700; font-size: 13px; }
.wf-node-k { font-size: 10px; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.wf-node-sub { font-size: 11px; color: var(--muted); }
.wf-node-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
/* Richer PA node body (grouped SKILLS / TOOLS / CONNECTIONS) â€” reads like the
   read-only Use Case Flowgram card. FIXED WIDTH so a long description WRAPS
   (taller, not wider) and the whole chain fits in one glance. */
.drawflow .drawflow-node.wf-node--pa,
.drawflow .drawflow-node.wf-node--trigger,
.drawflow .drawflow-node.wf-node--delivery,
.drawflow .drawflow-node.wf-node--invoke { width: 230px; align-items: stretch; }
.drawflow .drawflow-node.wf-dfnode .wf-node-inner { width: 100%; min-width: 0; }
.wf-node-t { white-space: normal; overflow-wrap: anywhere; }
.wf-node-body { margin-top: 2px; }
.wf-node-desc {
  font-size: 11.5px; color: var(--text); margin-bottom: 6px; line-height: 1.35;
  white-space: normal; overflow-wrap: anywhere;
}
.wf-node-glabel { font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 6px 0 3px; }
.wf-node-tags .wf-tag { white-space: normal; overflow-wrap: anywhere; }
.wf-tag { font-size: 10px; border-radius: 6px; padding: 1px 6px; border: 1px solid #262b35; color: var(--muted); }
.wf-tag--skill { border-color: rgba(110,168,254,.5); color: #9dc1ff; }
.wf-tag--tool { border-color: rgba(63,185,80,.4); color: #7ee787; }
.wf-tag--conn { border-color: rgba(163,113,247,.4); color: #c9adf7; }
.wf-tag--muted { color: var(--muted); }

/* â”€â”€ Inspector (compose a PA) â”€â”€ */
.wf-insp {
  position: absolute; top: 12px; right: 12px; width: 250px; max-height: calc(100% - 24px); overflow: auto;
  background: var(--panel-2); border: 1px solid var(--accent); border-radius: 12px; padding: 12px; box-shadow: 0 10px 28px rgba(0,0,0,.45);
}
.wf-insp h4 { margin: 0 0 8px; font-size: 13px; }
.wf-insp label { display: block; font-size: 11px; color: var(--muted); margin: 8px 0 3px; }
.wf-insp input[type="text"] { width: 100%; background: var(--bg); border: 1px solid #2b313c; color: var(--text); border-radius: 8px; padding: 8px; font: inherit; min-height: 40px; }
.wf-insp input:focus { outline: none; border-color: var(--accent); }
.wf-insp-close { position: absolute; top: 8px; right: 10px; background: none; border: none; color: var(--muted); font-size: 18px; cursor: pointer; min-width: 44px; min-height: 44px; }
.wf-check { display: flex; align-items: center; gap: 7px; min-height: 34px; font-size: 12px; color: var(--text); }
.wf-check input { width: auto; }
.wf-check-lbl { margin: 0; color: var(--text); font-size: 12px; }

/* â”€â”€ Coarse-pointer (phone/tablet) ordered-list editor â”€â”€ */
.wf-coarse { display: block; }
.wf-coarse-add { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 14px; }
.wf-coarse-add .wf-chip { width: auto; flex: 1 1 160px; margin-bottom: 0; cursor: pointer; }
.wf-coarse-list { display: flex; flex-direction: column; gap: 10px; }
.wf-coarse-row {
  display: flex; align-items: center; gap: 10px; background: var(--panel); border: 1px solid #262b35; border-left: 3px solid var(--accent);
  border-radius: 10px; padding: 10px 12px;
}
.wf-coarse-row--delivery { border-left-color: var(--ok); }
.wf-coarse-row--invoke { border-left-color: #a371f7; }
.wf-coarse-num { flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%; background: var(--panel-2); border: 1px solid #262b35; color: var(--muted); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.wf-coarse-body { flex: 1; min-width: 0; }
.wf-coarse-t { font-weight: 600; font-size: 13px; color: var(--text); }
.wf-coarse-subject { width: 100%; max-width: 220px; margin-top: 6px; background: var(--bg); border: 1px solid #2b313c; color: var(--text); border-radius: 8px; padding: 8px; font: inherit; min-height: 40px; }
.wf-coarse-acts { display: flex; gap: 4px; flex: 0 0 auto; }
.wf-coarse-acts .icon-btn { min-width: 44px; min-height: 44px; }
.wf-coarse-rm { color: var(--err); }

/* â•â• Flowgram v2 â€” palette accents, Ready-Workflows accordion, Empty-PA composer
      (Promo/Workflow-Canvas-Mockup-v2.html). Accent colours mirror the mockup:
      pa=--accent, delivery=--ok, invoke=#a371f7, ready=#e3a008. â•â• */
.wf-chip--pa { border-left: 3px solid var(--accent); }
.wf-chip--deliver { border-left: 3px solid var(--ok); }
.wf-chip--invoke { border-left: 3px solid #a371f7; }
.wf-chip--ready { border-left: 3px solid #e3a008; }
.wf-chip-tag { margin-left: auto; font-size: 10px; color: var(--muted); border: 1px solid #262b35; border-radius: 6px; padding: 1px 5px; }
.wf-chip-st { margin-left: auto; font-size: 10px; border-radius: 6px; padding: 1px 6px; }
.wf-chip-st--on { color: var(--ok); border: 1px solid rgba(63,185,80,.5); }
.wf-chip-st--off { color: var(--muted); border: 1px solid #262b35; }
/* A2: the "How often" interval picker under the Schedule trigger chip. */
.wf-sched-iv { margin: -2px 0 10px; padding: 8px 10px; background: #0b1424; border: 1px solid #262b35; border-radius: 10px; }
.wf-sched-iv[hidden] { display: none; }
.wf-sched-iv-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); }
.wf-sched-iv-sel { min-height: 36px; background: #0e1930; color: var(--text); border: 1px solid #37414f; border-radius: 8px; padding: 4px 8px; font: inherit; cursor: pointer; }
@media (pointer: coarse) { .wf-sched-iv-sel { min-height: 44px; } }
.wf-chip[data-wf-idx] { cursor: grab; touch-action: none; }
.wf-chip--dragging { opacity: .5; cursor: grabbing; }
/* The floating label that follows the cursor while a chip is dragged. */
.wf-drag-ghost {
  position: fixed; z-index: 80; pointer-events: none; padding: 6px 10px; border-radius: 8px;
  background: var(--accent); color: #08131f; font: inherit; font-weight: 700; font-size: 12px;
  box-shadow: 0 6px 18px rgba(0,0,0,.4); white-space: nowrap;
}

/* â‘£ Ready Workflows â€” collapsed accordion at the bottom of the palette. */
.wf-ready { margin-top: 16px; border-top: 1px dashed #262b35; padding-top: 12px; }
.wf-ready-btn {
  width: 100%; display: flex; align-items: center; gap: 8px; background: transparent; border: none;
  color: var(--muted); font: inherit; font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  cursor: pointer; padding: 4px 0; min-height: 40px;
}
.wf-ready-chev { margin-left: auto; transition: transform .15s; }
.wf-ready.open .wf-ready-chev { transform: rotate(90deg); }
.wf-ready-body { margin-top: 8px; }
.wf-ready-empty { font-size: 12px; padding: 4px 2px; }

/* Empty-PA COMPOSER sheet (numbered steps 1..6). */
.wf-comp-bg {
  position: fixed; inset: 0; background: rgba(4,8,16,.6); display: flex; align-items: center;
  justify-content: center; z-index: 60; padding: 16px;
}
.wf-comp-bg[hidden] { display: none; }
.wf-comp-sheet {
  width: min(96vw, 720px); max-height: 88vh; background: var(--panel);
  border: 1px solid #262b35; border-radius: 14px; box-shadow: 0 18px 48px rgba(0,0,0,.5);
  /* Flex column so the header + Name/Description + tabs stay FROZEN and ONLY the
     options list (.wf-comp-pane) scrolls. */
  display: flex; flex-direction: column; overflow: hidden;
}
.wf-comp-head {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid #262b35;
  background: linear-gradient(90deg, rgba(110,168,254,.16), rgba(110,168,254,.05));
  position: sticky; top: 0;
}
.wf-comp-hic { font-size: 20px; }
.wf-comp-head h3 { margin: 0; font-size: 15px; }
.wf-comp-x { margin-left: auto; background: transparent; border: none; color: var(--muted); font-size: 18px; cursor: pointer; min-width: 44px; min-height: 44px; }
/* Body = fields + tabs (frozen) + the scrolling pane. It flex-grows and does
   NOT scroll itself; the pane inside it is the scroll region. */
.wf-comp-body { padding: 14px 16px 0; display: flex; flex-direction: column; min-height: 0; flex: 1; }
.wf-comp-field { margin-bottom: 12px; }
.wf-comp-field label { display: flex; align-items: center; font-size: 12.5px; color: var(--text); font-weight: 600; margin-bottom: 5px; }
.wf-comp-field input {
  width: 100%; background: var(--bg); border: 1px solid #2b313c; color: var(--text);
  border-radius: 9px; padding: 10px 11px; font: inherit; min-height: 44px;
}
.wf-comp-field input:focus { outline: none; border-color: var(--accent); }
/* The bold numbered step badges (1..6) that guide the composer order. */
.wf-comp-stepno {
  display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px;
  border-radius: 50%; background: var(--accent); color: #08131f; font-weight: 800; font-size: 12px;
  margin-right: 6px; flex: 0 0 auto;
}
.wf-comp-stepno--on { background: #08131f; color: var(--accent); }
.wf-comp-tabs { display: flex; gap: 6px; border-bottom: 1px solid #262b35; margin-bottom: 10px; flex-wrap: wrap; }
.wf-comp-tab {
  background: transparent; border: none; border-bottom: 2px solid transparent; color: var(--muted);
  font: inherit; font-weight: 600; padding: 8px 10px; cursor: pointer; min-height: 44px; display: flex; align-items: center;
}
.wf-comp-tab .wf-comp-stepno { width: 18px; height: 18px; font-size: 11px; margin-right: 5px; }
.wf-comp-tab.active { color: var(--text); border-bottom-color: var(--accent); }
/* Only this pane scrolls (the frozen top part = header + Name/Description + tabs
   stays put). The search box stays pinned at the top of the scroll region. */
.wf-comp-pane { min-height: 120px; flex: 1; overflow: auto; padding-bottom: 14px; }
.wf-comp-search {
  position: sticky; top: 0; z-index: 1;
  width: 100%; background: var(--bg); border: 1px solid #2b313c; color: var(--text);
  border-radius: 9px; padding: 9px 11px; font: inherit; margin-bottom: 8px; min-height: 44px;
}
.wf-comp-subhd { font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin: 12px 0 6px; }
.wf-comp-opt {
  display: flex; align-items: center; gap: 9px; padding: 9px 10px; border: 1px solid #262b35;
  border-radius: 9px; margin-bottom: 6px; cursor: pointer; min-height: 44px;
}
.wf-comp-opt:hover { border-color: var(--accent); }
.wf-comp-opt input { width: 17px; height: 17px; flex: 0 0 auto; }
.wf-comp-ol { font-weight: 600; font-size: 13px; min-width: 0; }
.wf-comp-od { display: block; color: var(--muted); font-size: 11px; font-weight: 400; }
.wf-comp-badge { margin-left: auto; font-size: 10px; border-radius: 6px; padding: 1px 6px; border: 1px solid #262b35; color: var(--muted); flex: 0 0 auto; }
.wf-comp-badge--on { color: var(--ok); border-color: rgba(63,185,80,.5); }
.wf-comp-badge--mine { color: #c792ea; border-color: rgba(199,146,234,.5); }
.wf-comp-note { font-size: 11.5px; color: var(--muted); margin-top: 10px; }
.wf-comp-empty { font-size: 12px; padding: 6px 2px; }
.wf-comp-foot {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-top: 1px solid #262b35;
  background: var(--panel-2); position: sticky; bottom: 0; flex-wrap: wrap;
}
.wf-comp-picked { color: var(--muted); font-size: 12px; margin-right: auto; }
.wf-comp-picked b { color: var(--text); }
.wf-comp-foot .ghost-btn, .wf-comp-add { min-height: 44px; }
.wf-comp-add { display: inline-flex; align-items: center; }

/* Inspector: composed-agent "Edit in composer" affordance. */
.wf-insp-note { font-size: 11.5px; margin: 4px 0 8px; }
.wf-insp-edit { min-height: 44px; width: 100%; }

/* â”€â”€ Responsive: hide the drag palette on small screens (the coarse-pointer
     ordered-list editor is rendered instead when pointer:coarse). â”€â”€ */
@media (max-width: 720px) {
  .wf-palette { display: none; }
  .wf-insp { position: static; width: auto; max-height: none; margin-top: 12px; }
  .wf-main { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  .wf-chip, .wf-card, .wf-coarse-row, .wf-ready-chev { transition: none; }
}

/* â”€â”€ Timeline (Taskuary Phase 1 â€” the cross-source, multi-account feed) â”€â”€â”€â”€â”€â”€ */
.tl { padding: 24px; overflow-y: auto; }
.tl .ag-head h2 { margin: 0; color: var(--text); font-size: 20px; }
.tl .ag-sub { margin: 6px 0 16px; max-width: 560px; }

/* Morning Digest card (top of the Timeline). */
.tl-digest { margin-bottom: 18px; }
.tl-digest-empty {
  padding: 18px; border: 1px dashed #2c3240; border-radius: var(--radius);
  color: var(--muted); font-size: 14px; text-align: center;
}
.tl-digest-card {
  border: 1px solid #262b35; border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(110, 168, 254, 0.10), rgba(110, 168, 254, 0.03));
  overflow: hidden;
}
.tl-digest-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid rgba(110, 168, 254, 0.24);
  background: rgba(110, 168, 254, 0.06);
}
.tl-digest-title { font-weight: 600; color: var(--text); font-size: 15px; }
.tl-digest-counts { font-size: 12.5px; color: var(--muted); }
.tl-digest-section { padding: 10px 16px; border-top: 1px solid #21252f; }
.tl-digest-section:first-of-type { border-top: none; }
.tl-digest-sectitle {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.4px;
  color: var(--accent); margin-bottom: 6px;
}
.tl-digest-none { color: var(--muted); font-size: 13px; }
.tl-digest-items { list-style: none; margin: 0; padding: 0; }
.tl-digest-item {
  display: flex; gap: 10px; align-items: baseline; padding: 4px 0; font-size: 14px;
}
.tl-digest-when { flex: 0 0 auto; color: var(--muted); font-size: 12.5px; min-width: 88px; }
.tl-digest-what { flex: 1 1 auto; color: var(--text); overflow-wrap: anywhere; }
.tl-digest-acct { flex: 0 0 auto; color: var(--muted); font-size: 12px; }

/* Filter chip rows (by kind, then by account). */
.tl-filters, .tl-accounts { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.tl-accounts { margin-top: -4px; }
.tl-filter, .tl-acct {
  min-height: 34px; padding: 6px 12px; border-radius: 999px;
  border: 1px solid #2c3240; background: transparent; color: var(--muted);
  font: inherit; font-size: 13px; cursor: pointer;
}
.tl-filter:hover, .tl-acct:hover { border-color: var(--accent); color: var(--text); }
.tl-filter--on, .tl-acct--on {
  background: rgba(110, 168, 254, 0.16); border-color: var(--accent); color: var(--accent);
}

/* The day feed â€” one row per item. */
.tl-list { display: flex; flex-direction: column; gap: 2px; }
.tl-empty {
  padding: 28px 18px; color: var(--muted); font-size: 14px; text-align: center;
  border: 1px dashed #2c3240; border-radius: var(--radius);
}
.tl-row {
  display: grid; grid-template-columns: 128px 1fr auto; gap: 14px;
  align-items: start; padding: 12px 10px; border-bottom: 1px solid #1c2029;
}
.tl-row:hover { background: var(--panel-2); }
.tl-rail { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tl-time { color: var(--text); font-size: 13px; font-weight: 600; }
.tl-source {
  color: var(--muted); font-size: 12px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tl-body { min-width: 0; }
.tl-title { color: var(--text); font-size: 14px; overflow-wrap: anywhere; }
.tl-preview { color: var(--muted); font-size: 12.5px; margin-top: 2px; overflow-wrap: anywhere; }
.tl-seenin { color: var(--accent); font-size: 11.5px; margin-top: 3px; opacity: 0.85; }
.tl-link { font-size: 12.5px; margin-top: 3px; }
.tl-link a { color: var(--accent); }
.tl-chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.tl-chip {
  font-size: 11px; padding: 2px 9px; border-radius: 999px;
  border: 1px solid #2c3240; color: var(--muted); white-space: nowrap;
}
/* Kind chips â€” one calm accent tint (model/producer-inferred labels). */
.tl-chip--kind { color: var(--accent); border-color: rgba(110, 168, 254, 0.4); background: rgba(110, 168, 254, 0.10); }
.tl-chip--kind.tl-kind-meeting { color: var(--ok); border-color: rgba(63, 185, 80, 0.4); background: rgba(63, 185, 80, 0.10); }
/* Status chips â€” needs-you (warn) / in-flight (accent) / error (err) / done (muted). */
.tl-chip--status.tl-status-needs_you { color: var(--warn); border-color: rgba(210, 153, 34, 0.5); background: rgba(210, 153, 34, 0.10); }
.tl-chip--status.tl-status-in_flight { color: var(--accent); border-color: rgba(110, 168, 254, 0.5); background: rgba(110, 168, 254, 0.10); }
.tl-chip--status.tl-status-error { color: var(--err); border-color: rgba(248, 81, 73, 0.5); background: rgba(248, 81, 73, 0.10); }
.tl-chip--status.tl-status-done { color: var(--muted); }

/* Verdict chips (Taskuary Phase 2) â€” the AI's suggested road (fyi/reply/task),
   or a neutral "awaiting triage" when none is set. Kept visually distinct from
   the honest `kind` chip (it's an opinion, not the item's true kind). */
.tl-chip--verdict { color: var(--muted); border-color: #2c3240; border-style: dashed; }
.tl-chip--verdict.tl-verdict-reply { color: var(--warn); border-color: rgba(210, 153, 34, 0.5); background: rgba(210, 153, 34, 0.10); border-style: solid; }
.tl-chip--verdict.tl-verdict-task { color: var(--accent); border-color: rgba(110, 168, 254, 0.5); background: rgba(110, 168, 254, 0.10); border-style: solid; }
.tl-chip--verdict.tl-verdict-fyi { color: var(--muted); border-style: solid; }

/* Row actions: "Make a task" + tap-to-correct the road. */
.tl-actions {
  grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  margin-top: 6px; padding-top: 8px; border-top: 1px dashed #232833;
}
.tl-act, .tl-road {
  min-height: 32px; padding: 5px 12px; border-radius: 999px; font: inherit; font-size: 12.5px;
  border: 1px solid #2c3240; background: transparent; color: var(--muted); cursor: pointer;
}
.tl-act:hover, .tl-road:hover { border-color: var(--accent); color: var(--text); }
.tl-act--task { color: var(--accent); border-color: rgba(110, 168, 254, 0.4); }
.tl-act[disabled] { opacity: 0.7; cursor: default; }
.tl-correct { display: flex; align-items: center; gap: 6px; }
.tl-correct-label { font-size: 12px; color: var(--muted); }
.tl-road--on { background: rgba(110, 168, 254, 0.16); border-color: var(--accent); color: var(--accent); }

/* Unified Tasks type filter (Taskuary Phase 2): All / My tasks / Tickets. */
.tasks-typefilter { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px; }
.tasks-tf {
  min-height: 34px; padding: 6px 14px; border-radius: 999px; font: inherit; font-size: 13px;
  border: 1px solid #2c3240; background: transparent; color: var(--muted); cursor: pointer;
}
.tasks-tf:hover { border-color: var(--accent); color: var(--text); }
.tasks-tf--on { background: rgba(110, 168, 254, 0.16); border-color: var(--accent); color: var(--accent); }

/* Mobile: rows become stacked cards (like the digest table's @640px rule). */
@media (max-width: 640px) {
  .tl { padding: 16px; }
  .tl-row {
    grid-template-columns: 1fr; gap: 6px;
    border: 1px solid #262b35; border-radius: 12px; margin-bottom: 10px; padding: 12px;
  }
  .tl-rail { flex-direction: row; align-items: baseline; gap: 8px; justify-content: space-between; }
  .tl-chips { justify-content: flex-start; }
  .tl-digest-item { flex-wrap: wrap; }
  .tl-digest-when { min-width: 0; }
}

/* â”€â”€ Knowledge Hub (ðŸ“š Hub â€” Taskuary Phase 3a) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.hub-root { margin-top: 8px; }
.hub-empty {
  padding: 22px 18px; border: 1px dashed #2c3240; border-radius: var(--radius);
  color: var(--muted); font-size: 14px; text-align: center; line-height: 1.5;
}
.hub-topic { margin-bottom: 18px; }
.hub-topic-head {
  display: flex; align-items: baseline; gap: 10px;
  padding: 8px 0 8px; border-bottom: 1px solid rgba(110, 168, 254, 0.24);
}
.hub-topic-name {
  font-weight: 600; color: var(--text); font-size: 15px; overflow-wrap: anywhere;
}
.hub-topic-count {
  flex: 0 0 auto; font-size: 12px; color: var(--accent);
  background: rgba(110, 168, 254, 0.12); border-radius: 999px; padding: 1px 9px;
}
.hub-note-list { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.hub-note {
  border: 1px solid #262b35; border-radius: 12px; padding: 12px 14px;
  background: rgba(255, 255, 255, 0.015);
}
.hub-note-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.hub-note-title { font-weight: 600; color: var(--text); font-size: 14px; overflow-wrap: anywhere; flex: 1 1 auto; }
.hub-note-date { flex: 0 0 auto; color: var(--muted); font-size: 12px; }
.hub-note-badge {
  flex: 0 0 auto; font-size: 11.5px; color: var(--warn, #d8a657);
  border: 1px solid currentColor; border-radius: 999px; padding: 0 8px;
}
.hub-note-snippet {
  margin-top: 6px; color: var(--muted); font-size: 13px; line-height: 1.5;
  overflow-wrap: anywhere; white-space: pre-wrap;
}
.hub-note-snippet a { color: var(--accent); }
@media (max-width: 640px) {
  .hub { padding: 16px; }
}

/* â”€â”€ DIY "Remember this mailbox" control (Connections Â· Email Memory) â”€â”€â”€â”€â”€â”€â”€â”€ */
/* Per-account row becomes a 2-line block: identity row + the remember control. */
.conn-acct-row .acct-id {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.conn-ok { overflow: hidden; text-overflow: ellipsis; }
.acct-id-actions { display: flex; gap: 8px; flex: 0 0 auto; }
/* Each state (collapsed/form/on) owns its own top divider + spacing, so the
   container adds none (avoids a double gap). */
.rmb { margin-top: 0; }

/* State 1 â€” collapsed: a hint on the left, the Remember button pinned right.
   Every state shares the same top-divider + row rhythm so the three states line
   up identically across all mailbox cards regardless of text length. */
.rmb-collapsed {
  display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap;
  border-top: 1px dashed #2c3240; margin-top: 10px; padding-top: 12px;
}
.rmb-hint { font-size: 12.5px; color: var(--muted); flex: 1 1 200px; min-width: 0; }
.rmb-collapsed .rmb-open { margin-left: auto; flex: 0 0 auto; }

/* State 2 â€” the inline form. */
.rmb-form {
  border-top: 1px dashed #2c3240; margin-top: 10px; padding-top: 12px;
  display: flex; flex-direction: column; gap: 12px;
}
.rmb-fld { display: flex; flex-direction: column; gap: 6px; }
.rmb-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; }
.rmb-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.rmb-chip {
  background: transparent; border: 1px solid #2c3240; color: var(--muted);
  padding: 7px 14px; border-radius: 999px; font: inherit; font-size: 13.5px; cursor: pointer; min-height: 38px;
}
.rmb-chip:hover { border-color: var(--accent); color: var(--text); }
.rmb-chip.on { background: rgba(110, 168, 254, 0.16); border-color: var(--accent); color: var(--accent); }
.rmb-select {
  background: var(--panel-3, #232833); border: 1px solid #2c3240; color: var(--text);
  padding: 8px 12px; border-radius: 10px; font: inherit; font-size: 14px; min-height: 40px; max-width: 280px;
}
.rmb-custom { max-width: 200px; }
.rmb-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rmb-tell { font-size: 12px; color: var(--muted); }
.rmb-form-status { color: var(--warn); }

/* State 3 â€” "Remembering Â· <cat>" + its when-line on the LEFT (as one info
   group that wraps together), the Stop button pinned RIGHT. Using margin-left:
   auto on the button (not justify-content:space-between) keeps the badge+meta
   glued together and the button consistently right-aligned on EVERY card,
   regardless of how long the meta text is (the old space-between spread the
   three items unevenly per card + wrapped the button on the narrow IMAP card). */
.rmb-on {
  display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap;
  border-top: 1px dashed #2c3240; margin-top: 10px; padding-top: 12px;
}
.rmb-badge {
  display: inline-flex; align-items: center; gap: 7px; font-size: 13px;
  color: var(--accent); font-weight: 600; flex: 0 0 auto;
}
.rmb-brain { font-size: 15px; }
.rmb-meta { color: var(--muted); font-size: 12.5px; flex: 1 1 auto; min-width: 0; }
.rmb-running { color: var(--warn); }
.rmb-on .rmb-stop { margin-left: auto; flex: 0 0 auto; }

@media (max-width: 560px) {
  .conn-acct-row .acct-id { flex-direction: column; align-items: flex-start; }
  /* On a phone, let the Stop button drop to its own full line rather than
     squeeze beside the badge+meta. */
  .rmb-on .rmb-stop, .rmb-collapsed .rmb-open { margin-left: 0; }
}

/* â”€â”€ Preferences (Taskuary Phase 4 â€” editable "how I like to work" memory) â”€â”€ */
.pref-transparency h3 { margin: 0 0 8px; }
.pref-transp-list { margin: 0; padding-left: 18px; color: var(--muted); font-size: 13px; }
.pref-transp-list li { margin: 0 0 8px; line-height: 1.45; }
.pref-transp-list strong { color: var(--text); }

.pref-toggle-row {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 14px; cursor: default;
}
.pref-toggle-row > span:first-child { display: flex; flex-direction: column; gap: 4px; }
.pref-toggle-hint { display: block; font-size: 12.5px; line-height: 1.4; }
/* the switch */
.pref-toggle-row .toggle {
  flex: 0 0 auto; position: relative; width: 46px; height: 26px; min-width: 46px;
  border-radius: 999px; border: 1px solid #2c3240; background: #1c2029;
  cursor: pointer; transition: background .15s, border-color .15s; margin-top: 2px;
}
.pref-toggle-row .toggle::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px;
  border-radius: 50%; background: var(--muted); transition: transform .15s, background .15s;
}
.pref-toggle-row .toggle.on { background: rgba(110, 168, 254, 0.22); border-color: var(--accent); }
.pref-toggle-row .toggle.on::after { transform: translateX(20px); background: var(--accent); }

.pref-add-row { display: flex; gap: 8px; align-items: stretch; margin: 4px 0 14px; flex-wrap: wrap; }
.pref-add-cat { flex: 0 0 140px; }
.pref-add-text { flex: 1 1 220px; }
.pref-add-row .ghost-btn { flex: 0 0 auto; white-space: nowrap; }

.pref-list { display: flex; flex-direction: column; gap: 14px; }
.pref-empty { margin: 0; }
.pref-cat-name {
  font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); margin: 0 0 6px;
}
.pref-row {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 10px 12px; border: 1px solid #262b35; border-radius: 10px;
  background: var(--panel); margin-bottom: 8px;
}
.pref-row-main { flex: 1 1 auto; min-width: 0; }
.pref-text { color: var(--text); font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }
.pref-meta { display: flex; align-items: center; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.pref-tag { font-size: 12px; color: var(--muted); }
.pref-strength {
  display: inline-block; width: 60px; height: 6px; border-radius: 999px;
  background: #1c2029; overflow: hidden;
}
.pref-strength-fill { display: block; height: 100%; background: var(--accent); }
.pref-seen { font-size: 12px; }
.pref-row-actions { flex: 0 0 auto; display: flex; gap: 6px; }
.pref-mini { min-height: 34px; padding: 4px 10px; font-size: 12.5px; }
.pref-del-armed { color: var(--err); border-color: var(--err); }

@media (pointer: coarse) {
  .pref-toggle-row .toggle { width: 52px; height: 30px; min-width: 52px; }
  .pref-toggle-row .toggle::after { width: 24px; height: 24px; }
  .pref-toggle-row .toggle.on::after { transform: translateX(22px); }
  .pref-mini { min-height: 44px; }
}
@media (max-width: 640px) {
  .pref-row { flex-direction: column; }
  .pref-row-actions { align-self: flex-end; }
}
@media (prefers-reduced-motion: reduce) {
  .pref-toggle-row .toggle, .pref-toggle-row .toggle::after { transition: none; }
}
