/* Prime AI — iOS 26 dark. Minimal top bar + bottom floating nav (Feed · Work chats · Metrics · Settings · Profile).
 * Top-right is the stories/notifications bell. Pure black, thin type, translucent glass, iMessage bubbles, IG feed. */

:root {
  --bg: #000000;
  --blue: #0a84ff;
  --blue-2: #409cff;
  --green: #30d158;
  --amber: #ff9f0a;
  --red: #ff453a;
  --purple: #bf5af2;

  --label: #ffffff;
  --label-2: rgba(235, 235, 245, 0.6);
  --label-3: rgba(235, 235, 245, 0.3);

  --glass: rgba(28, 28, 30, 0.6);
  --glass-strong: rgba(30, 30, 32, 0.82);
  --card: rgba(118, 118, 128, 0.14);
  --hair: rgba(255, 255, 255, 0.09);
  --hair-soft: rgba(255, 255, 255, 0.055);

  --bubble-in: rgba(118, 118, 128, 0.26);
  --bubble-out: #0a84ff;

  /* Bottom floating nav: a glass pill bar. Scroll views + the composer key their bottom padding off
   * --bottom-space, which now includes the bar's height so nothing hides behind it. */
  --nav-h: 58px;
  --bottom-space: calc(env(safe-area-inset-bottom, 0px) + var(--nav-h) + 18px);
  --top-space: calc(env(safe-area-inset-top, 0px) + 74px);
  --pill-h: 46px;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "Segoe UI", system-ui, Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--label);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
  display: flex;
  justify-content: center;
  letter-spacing: -0.01em;
  /* no double-tap zoom, no rubber-band page movement */
  touch-action: manipulation;
  overscroll-behavior: none;
}
.hidden { display: none !important; }

/* ============ App shell ============ */
.app {
  position: relative;
  width: 100%; max-width: 620px; height: 100dvh;
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--bg);
}
@media (min-width: 640px) { .app { border-left: 1px solid var(--hair-soft); border-right: 1px solid var(--hair-soft); } }

.stage { position: relative; flex: 1; min-height: 0; }
.view { position: absolute; inset: 0; display: flex; flex-direction: column; min-height: 0; }
.subpane { position: absolute; inset: 0; display: flex; flex-direction: column; min-height: 0; }
.scroll::-webkit-scrollbar, .messages::-webkit-scrollbar { width: 0; }
/* Lock to vertical only — no horizontal drag, no rubber-band leaking to the page */
.messages, .feed, .conv-list, .settings, .scroll {
  overflow-x: hidden; overscroll-behavior: contain; touch-action: pan-y;
}

/* ============ Minimal top bar ============ */
.topbar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 14px 22px;
  /* Scrim: feed/content scrolling under the floating top pills fades into black instead of cluttering
     behind them. The container stays pointer-events:none (only the pills below are tappable). */
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg) 40%, rgba(0,0,0,0.5) 72%, transparent 100%);
  pointer-events: none;
}
.brand, .top-right { pointer-events: auto; }
/* The title is now plain floating text (no pill) — it reads over the topbar scrim. */
.brand {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  height: var(--pill-h); padding: 0; background: none; border: none; box-shadow: none;
}
/* Right cluster: the play/pause glowing dot + the stories/notifications bell. */
.top-right { display: flex; align-items: center; gap: 12px; }
.pause-dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; background: none; border: none; padding: 0; -webkit-tap-highlight-color: transparent; }
.pause-dot::before { content: ''; width: 13px; height: 13px; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px 2px rgba(48,209,88,0.85); animation: pulseGlow 1.9s ease-in-out infinite; }
.pause-dot.paused::before { background: var(--amber); box-shadow: 0 0 12px 2px rgba(255,159,10,0.85); animation: none; }
.pause-dot:active { transform: scale(0.88); }
@keyframes pulseGlow { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }
.brand-spark { width: 17px; height: 17px; flex: none; fill: var(--blue-2); }
.brand-name { font-size: 20px; font-weight: 400; letter-spacing: 0.01em; color: var(--label); }
.brand-demo { font-size: 13px; font-weight: 600; color: var(--label-3); letter-spacing: 0; }
.workflows {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  font-size: 12px; font-weight: 600; color: var(--label-2);
  background: none; border: none; padding: 0;
}
.workflows::before { content: ""; width: 1px; height: 13px; background: var(--hair); margin-right: 3px; }
.wf-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px rgba(48,209,88,0.7); animation: blink 1.8s ease-in-out infinite; }
.workflows.paused .wf-dot { background: var(--amber); box-shadow: 0 0 8px rgba(255,159,10,0.6); animation: none; }
@keyframes blink { 0%,100% { opacity: 0.45; } 50% { opacity: 1; } }

/* Top-right STORIES / NOTIFICATIONS bell — a floating glass circle that replaces the old .topnav.
 * (pointer-events:auto comes from the `.brand, .bell-btn` rule on the transparent topbar.) */
.bell-btn {
  position: relative; display: grid; place-items: center; width: var(--pill-h); height: var(--pill-h);
  border-radius: 50%; background: var(--glass-strong); border: 1px solid var(--hair); cursor: pointer;
  color: var(--label); -webkit-backdrop-filter: blur(32px) saturate(200%); backdrop-filter: blur(32px) saturate(200%);
  box-shadow: 0 8px 28px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.08);
  transition: transform 0.1s ease, color 0.18s ease;
}
.bell-btn svg { width: 22px; height: 22px; fill: none; }
.bell-btn:active { transform: scale(0.92); }
.bell-btn.has-activity { color: var(--blue-2); }
.bell-badge {
  position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px; padding: 0 5px;
  display: grid; place-items: center; border-radius: 999px; background: var(--blue); color: #fff;
  font-size: 11px; font-weight: 700; border: 2px solid #000; box-shadow: 0 2px 8px rgba(10,132,255,0.6);
}

/* ============ Bottom floating nav (Feed · Work chats · Metrics · Settings · Profile) ============ */
.bottomnav {
  position: absolute; z-index: 31; left: 12px; right: 12px;
  bottom: max(0px, calc(env(safe-area-inset-bottom, 0px) - 16px)); /* sit as low as the safe area allows */
  height: var(--nav-h); display: flex; align-items: stretch; justify-content: space-around; gap: 2px;
  padding: 6px 6px; border-radius: 26px;
  /* A true floating glass bar: more transparent so the feed shows THROUGH it (no heavy black band). */
  background: rgba(18, 18, 20, 0.5);
  -webkit-backdrop-filter: blur(34px) saturate(200%); backdrop-filter: blur(34px) saturate(200%);
  border: 1px solid var(--hair); box-shadow: 0 10px 34px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.08);
}
.tab {
  position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 3px; background: transparent; border: none; cursor: pointer;
  color: var(--label-2); border-radius: 18px; padding: 4px 2px;
  transition: color 0.18s ease, background 0.18s ease, transform 0.1s ease;
}
.tab-ic { width: 23px; height: 23px; }
.tab-lbl { font-size: 10px; font-weight: 600; letter-spacing: 0.01em; line-height: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.tab:active { transform: scale(0.92); }
.tab.active { color: var(--blue); }
.tab.active .tab-lbl { color: var(--blue); }
/* The Profile tab carries the owner's avatar instead of a glyph; it rings blue when active. */
.tab-av {
  position: relative; overflow: hidden; display: grid; place-items: center; width: 24px; height: 24px;
  border-radius: 50%; font-size: 10px; font-weight: 700; color: #fff;
  background: linear-gradient(145deg, #0a84ff, #0060df); border: 1px solid var(--hair);
}
.tab.active .tab-av { box-shadow: 0 0 0 2px var(--blue); }
.tab-av .avatar-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* unseen-activity dot + blink, shared by the bottom tabs and the top-right bell */
.tab.has-activity::after {
  content: ''; position: absolute; top: 4px; right: 22%; width: 7px; height: 7px; border-radius: 50%;
  background: var(--blue); box-shadow: 0 0 6px rgba(10,132,255,0.9);
}
.tab.pulse, .bell-btn.pulse { animation: navpulse 0.9s ease; }
@keyframes navpulse {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.18); color: var(--blue); filter: drop-shadow(0 0 6px rgba(10,132,255,0.8)); }
  100% { transform: scale(1); }
}

/* ============ Growth strip (scarcity invites + progressive unlock) ============ */
/* Floating glass pill under the topbar; when visible, body.has-growth bumps --top-space so
 * every view clears it (all scroll paddings key off that variable). */
.growth-strip {
  position: absolute; z-index: 29; left: 14px; right: 14px;
  top: calc(env(safe-area-inset-top, 0px) + 64px);
  display: flex; align-items: center; gap: 9px;
  height: 38px; padding: 0 7px 0 7px; border-radius: 999px;
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(32px) saturate(200%); backdrop-filter: blur(32px) saturate(200%);
  border: 1px solid var(--hair);
  box-shadow: 0 8px 28px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.08);
  font-size: 12px;
}
body.has-growth .app { --top-space: calc(env(safe-area-inset-top, 0px) + 118px); }
.gs-pill {
  flex: none; font-size: 10.5px; font-weight: 700; letter-spacing: 0.03em; text-transform: lowercase;
  padding: 4px 9px; border-radius: 999px; color: var(--amber); background: rgba(255,159,10,0.14);
}
.gs-pill.live { color: var(--green); background: rgba(48,209,88,0.14); }
.gs-text {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--label-2); cursor: pointer;
}
.gs-dots { flex: none; display: inline-flex; gap: 4px; }
.gs-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--card); border: 1px solid var(--hair); }
.gs-dot.on { background: var(--blue); border-color: transparent; box-shadow: 0 0 7px rgba(10,132,255,0.8); }
.gs-btn {
  flex: none; height: 26px; padding: 0 12px; border-radius: 999px; border: none; cursor: pointer;
  font-size: 12px; font-weight: 600; color: #fff; background: var(--blue);
}
.gs-btn:disabled { opacity: 0.45; cursor: default; }
.gs-btn:not(:disabled):active { transform: scale(0.96); }
.ob-invites-left { margin: -4px 0 12px; font-size: 12.5px; color: var(--label-2); text-align: center; }
.ob-invites-left.empty { color: var(--amber); }
.net-invite-btn.locked { opacity: 0.55; }

/* ============ Avatars (image + initials fallback) ============ */
.avatar {
  flex: none; position: relative; overflow: hidden; display: grid; place-items: center; border-radius: 50%;
  font-weight: 700; color: #fff; letter-spacing: -0.02em;
  background: linear-gradient(145deg, #3a3a3c, #1c1c1e); border: 1px solid var(--hair);
}
.avatar.sm { width: 32px; height: 32px; font-size: 12px; }
.avatar.md { width: 40px; height: 40px; font-size: 14px; }
.avatar.lg { width: 48px; height: 48px; font-size: 16px; }
.avatar.xl { width: 84px; height: 84px; font-size: 28px; }
.avatar.is-hub { background: linear-gradient(145deg, #0a84ff, #0060df); border-color: rgba(64,156,255,0.6); }
.avatar-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.avatar-ini { position: relative; z-index: 0; }

/* ============ Messages / iMessage bubbles ============ */
.messages {
  flex: 1; min-height: 0; overflow-y: auto; padding: 12px 14px 6px;
  display: flex; flex-direction: column; gap: 3px; scroll-behavior: smooth;
}
#prime-messages { padding-top: var(--top-space); } /* clear the floating top pills */
/* Anchor the conversation to the bottom: the last bubble sits just above the composer (WhatsApp/Telegram style) */
.messages::before { content: ''; flex: 1 1 0; min-height: 0; }
.msg-sep { text-align: center; margin: 14px 0 8px; }
.msg-sep span { font-size: 11px; font-weight: 600; color: var(--label-3); background: var(--card); padding: 4px 10px; border-radius: 999px; }
/* "New messages" divider — Telegram-style read line before the first unseen message */
.msg-unread { display: flex; align-items: center; gap: 10px; margin: 16px 2px 8px; }
.msg-unread::before, .msg-unread::after { content: ''; flex: 1; height: 1px; background: rgba(10,132,255,0.30); }
.msg-unread span { font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--blue-2); }
/* Floating "new messages" pill — shown only while the reader is scrolled up; click jumps to bottom */
.new-pill {
  position: sticky; bottom: 10px; align-self: center; z-index: 6; display: none;
  background: var(--blue); color: #fff; border: none; cursor: pointer;
  font-size: 12.5px; font-weight: 600; padding: 7px 15px; border-radius: 999px;
  box-shadow: 0 4px 16px rgba(10,132,255,0.5);
}
.new-pill.show { display: inline-flex; }
.row { display: flex; align-items: flex-end; gap: 7px; margin-top: 2px; }
.row.in { animation: pop 0.26s cubic-bezier(0.22,1,0.36,1); } /* only freshly-appended rows animate; full re-renders are instant */
.row.right { justify-content: flex-end; }
.row.left { justify-content: flex-start; }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(0.98); } to { opacity: 1; transform: none; } }
.bubble { max-width: 78%; padding: 8px 13px; border-radius: 20px; font-size: 15.5px; line-height: 1.35; word-wrap: break-word; white-space: pre-wrap; }
.row.left .bubble { background: var(--bubble-in); color: var(--label); border-bottom-left-radius: 7px; }
.row.right .bubble { background: var(--bubble-out); color: #fff; border-bottom-right-radius: 7px; box-shadow: 0 1px 10px rgba(10,132,255,0.28); }
.bubble.has-img { padding: 5px; max-width: 80%; }
.bubble-img { display: block; width: 100%; max-width: 320px; border-radius: 15px; }
.bubble-cap { padding: 6px 8px 2px; font-size: 14px; line-height: 1.3; }
/* Attachment chip — a hairline rounded card that sits at home inside a bubble */
.file-chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--hair); border-radius: 14px; color: var(--label); text-decoration: none; max-width: 100%; transition: background 0.16s ease; }
.file-chip:hover { background: rgba(255,255,255,0.06); }
.row.right .file-chip { border-color: rgba(255,255,255,0.3); color: #fff; }
.row.right .file-chip:hover { background: rgba(255,255,255,0.12); }
.file-chip .file-ic { flex: none; width: 18px; height: 18px; opacity: 0.85; }
.file-name { font-weight: 500; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-kind { flex: none; font-size: 11px; color: var(--label-3); text-transform: uppercase; letter-spacing: 0.04em; }
.row.right .file-kind { color: rgba(255,255,255,0.6); }
.bubble-sender { font-size: 11.5px; font-weight: 700; color: var(--blue-2); margin-bottom: 2px; }
.row.right .bubble-sender { color: rgba(255,255,255,0.85); }
.bubble-meta { display: block; font-size: 10px; margin-top: 3px; opacity: 0.55; text-align: right; }
/* Prime chat: full-width bubbles (assistant style) */
#prime-messages .row { width: 100%; }
#prime-messages .bubble { max-width: 100%; width: 100%; }
.empty { margin: auto; text-align: center; color: var(--label-3); padding: 40px 24px; font-size: 14px; }
.empty-ico { font-size: 30px; margin-bottom: 10px; opacity: 0.7; }
/* "Prime is setting up your environment" loader — shown in the empty feed right after the goal is set */
.setup-spin { width: 34px; height: 34px; margin: 0 auto 16px; border-radius: 50%; border: 3px solid rgba(255,255,255,0.12); border-top-color: var(--blue); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.setup-title { font-size: 16px; font-weight: 600; color: var(--label); margin-bottom: 6px; }
.setup-sub { font-size: 13px; color: var(--label-2); line-height: 1.5; max-width: 30ch; margin: 0 auto; }

/* ============ Question bubble (PRIME) ============ */
.q-bubble {
  align-self: flex-start; max-width: 88%; margin: 8px 0 4px;
  background: var(--glass-strong); -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(64,156,255,0.4); border-radius: 20px; padding: 13px 14px; box-shadow: 0 6px 28px rgba(0,0,0,0.4);
}
.q-tag { font-size: 11px; font-weight: 700; color: var(--blue-2); letter-spacing: 0.04em; margin-bottom: 6px; }
.q-prompt { font-size: 15px; line-height: 1.4; margin-bottom: 10px; white-space: pre-wrap; }
.q-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 8px; }
.q-chip { font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; padding: 7px 13px; border-radius: 999px; color: var(--blue); background: rgba(10,132,255,0.14); border: 1px solid rgba(10,132,255,0.32); transition: transform 0.1s ease, background 0.2s ease; }
.q-chip:hover { background: rgba(10,132,255,0.24); }
.q-chip:active { transform: scale(0.95); }
.q-free { display: flex; gap: 7px; }
.q-free input { flex: 1; font: inherit; font-size: 14px; color: var(--label); background: rgba(118,118,128,0.18); border: 1px solid var(--hair); border-radius: 999px; padding: 9px 14px; outline: none; }
.q-free input::placeholder { color: var(--label-3); }
.q-free button { font: inherit; font-weight: 600; font-size: 14px; color: #fff; cursor: pointer; background: var(--blue); border: none; border-radius: 999px; padding: 9px 16px; }
.q-answered { font-size: 12.5px; color: var(--green); margin-top: 4px; }

/* ============ Composer ============ */
.composer { flex: none; display: flex; align-items: center; gap: 8px; padding: 8px 14px var(--bottom-space); }
.composer-form { flex: 1; display: flex; align-items: center; background: var(--glass-strong); -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%); border: 1px solid var(--hair); border-radius: 999px; padding: 4px 6px; }
.composer-input { flex: 1; font: inherit; font-size: 15.5px; color: var(--label); background: transparent; border: none; outline: none; padding: 9px 12px; }
.composer-input::placeholder { color: var(--label-3); }
.send-pill { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--blue); border: none; color: #fff; cursor: pointer; transition: transform 0.12s ease; box-shadow: 0 6px 22px rgba(10,132,255,0.4); }
.send-pill:active { transform: scale(0.9); }
.send-pill .ic { width: 20px; height: 20px; fill: currentColor; }
/* secondary sibling to .send-pill: same footprint, muted + transparent, hover/active to blue */
.attach-btn { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: transparent; border: none; color: var(--label-2); cursor: pointer; transition: color 0.16s ease, transform 0.12s ease; }
.attach-btn:hover { color: var(--blue); }
.attach-btn:active { transform: scale(0.9); }
.attach-btn:disabled { opacity: 0.4; cursor: default; }
.attach-btn .ic { width: 22px; height: 22px; fill: none; }
.ic { width: 19px; height: 19px; fill: currentColor; }
.glass-btn { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--glass-strong); border: 1px solid var(--hair); color: var(--label); cursor: pointer; }
.glass-btn:active { transform: scale(0.92); }

/* ============ Agents — list ============ */
/* Workflow list pane = a search + filter bar on top, then the scrolling conversation list. */
#agents-list-pane { display: flex; flex-direction: column; }
.wf-top { flex: none; display: flex; flex-direction: column; gap: 9px; padding: var(--top-space) 12px 9px; }
.wf-search { display: flex; align-items: center; gap: 9px; background: var(--card); border: 1px solid var(--hair); border-radius: 14px; padding: 0 12px; height: 42px; }
.wf-search-ic { width: 19px; height: 19px; flex: none; color: var(--label-3); fill: none; }
#wf-search { flex: 1; min-width: 0; font: inherit; font-size: 15px; color: var(--label); background: none; border: none; outline: none; }
#wf-search::placeholder { color: var(--label-3); }
#wf-search::-webkit-search-cancel-button { -webkit-appearance: none; }
.wf-filters { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.wf-filters::-webkit-scrollbar { display: none; }
.wf-pill { flex: none; font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; padding: 7px 15px; border-radius: 999px; color: var(--label-2); background: var(--card); border: 1px solid var(--hair); white-space: nowrap; transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease; }
.wf-pill.on { color: #fff; background: rgba(10,132,255,0.92); border-color: transparent; }
.wf-pill:not(.on):active { background: rgba(118,118,128,0.22); }
.conv-list { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 10px var(--bottom-space); }
.conv { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 18px; cursor: pointer; transition: background 0.18s ease, transform 0.1s ease; }
.conv:hover { background: rgba(255,255,255,0.04); }
.conv:active { transform: scale(0.99); }
.conv.pinned { background: rgba(10,132,255,0.08); border: 1px solid rgba(10,132,255,0.22); margin-bottom: 4px; }
.conv-main { flex: 1; min-width: 0; }
.conv-toprow { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.conv-name { font-size: 15.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-time { font-size: 11.5px; color: var(--label-3); flex: none; }
.conv-botrow { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 2px; }
.conv-preview { font-size: 13.5px; color: var(--label-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.conv-right { display: flex; align-items: center; gap: 6px; flex: none; }
/* Colored ring around the conversation avatar — replaces the old trust/tier text chips. */
.conv .cring { border-radius: 50%; }
.conv .cring.cring-team { box-shadow: 0 0 0 2.5px rgba(10,132,255,0.95); }
.conv .cring.cring-partner { box-shadow: 0 0 0 2.5px rgba(255,159,10,0.95); }
.conv .cring.cring-ext { box-shadow: 0 0 0 2.5px rgba(142,142,147,0.8); }
/* Teammate membership label (demo vs real invite). */
.conv-team { font-size: 11px; font-weight: 700; letter-spacing: 0.01em; color: var(--label-3); white-space: nowrap; }
.conv-team.real { color: var(--green); }
.unread-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 8px rgba(10,132,255,0.8); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px rgba(48,209,88,0.85); animation: blink 1.1s ease-in-out infinite; }
@keyframes convflash { 0% { background: rgba(10,132,255,0.26); } 100% { background: transparent; } }
.conv.flash { animation: convflash 1.4s ease-out; }

/* ============ Agents — observation chat ============ */
.chat-header { display: flex; align-items: center; gap: 10px; padding: var(--top-space) 16px 10px; background: var(--glass); -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%); border-bottom: 1px solid var(--hair-soft); flex: none; }
.chat-id { flex: 1; min-width: 0; }
.chat-name { font-size: 15.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-purpose { font-size: 11.5px; color: var(--label-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.observation { flex: none; text-align: center; font-size: 12px; color: var(--label-3); padding: 12px; padding-bottom: var(--bottom-space); display: flex; align-items: center; justify-content: center; gap: 8px; }
.obs-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); animation: blink 2s ease-in-out infinite; }

/* tier badges */
.tier { font-size: 10.5px; font-weight: 700; letter-spacing: 0.02em; padding: 3px 8px; border-radius: 999px; text-transform: lowercase; }
.tier-team { color: var(--green); background: rgba(48,209,88,0.14); }
.tier-biz { color: var(--amber); background: rgba(255,159,10,0.14); }
.tier-ext { color: var(--red); background: rgba(255,69,58,0.14); }

/* ============ Profile (Instagram-style owner page + relocated connectors) ============ */
/* Reuses the .settings scroll container; the header is the only bespoke chrome — the connector rows,
 * Prime Network card and invite card are the SAME components moved here from Settings. */
/* Settings gear — a topbar flex item (sits in .top-right beside the bell), surfaced only on Profile.
   Previously absolute-positioned inside the profile view, where the floating topbar (z-index 30) covered it. */
.profile-menu {
  display: grid; place-items: center; width: var(--pill-h); height: var(--pill-h); padding: 0;
  border-radius: 50%; background: var(--glass-strong); border: 1px solid var(--hair); color: var(--label); cursor: pointer;
  -webkit-backdrop-filter: blur(32px) saturate(200%); backdrop-filter: blur(32px) saturate(200%);
  box-shadow: 0 8px 28px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.08); transition: transform 0.1s ease;
}
.profile-menu svg { width: 21px; height: 21px; fill: none; }
.profile-menu:active { transform: scale(0.92); }
.pf-head { display: flex; align-items: center; gap: 22px; padding: 6px 4px 14px; }
.pf-stats { flex: 1; display: flex; align-items: center; justify-content: space-around; gap: 6px; }
.pf-stat { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.pf-stat-n { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.pf-stat-l { font-size: 12px; color: var(--label-2); margin-top: 2px; }
.pf-id { padding: 0 4px 16px; }
.pf-namerow { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pf-name { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
/* Settings gear on the name line (moved here from the topbar). */
.pf-gear { flex: none; display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border-radius: 50%; background: var(--card); border: 1px solid var(--hair); color: var(--label); cursor: pointer; }
.pf-gear svg { width: 19px; height: 19px; fill: none; }
.pf-gear:active { transform: scale(0.92); }
.pf-handle { font-size: 13.5px; color: var(--blue-2); margin-top: 1px; }
.pf-bio { font-size: 13.5px; color: var(--label-2); margin-top: 8px; line-height: 1.45; }

/* ============ Stories / notifications panel (top-right bell) ============ */
.stories-panel {
  position: fixed; inset: 0; z-index: 52; display: flex; align-items: flex-start; justify-content: center;
  background: rgba(0,0,0,0.55); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  opacity: 0; transition: opacity 0.24s ease;
}
.stories-panel.show { opacity: 1; }
.stories-sheet {
  width: 100%; max-width: 620px; max-height: 86dvh; display: flex; flex-direction: column;
  margin-top: calc(env(safe-area-inset-top, 0px) + 64px);
  background: var(--glass-strong); -webkit-backdrop-filter: blur(34px) saturate(200%); backdrop-filter: blur(34px) saturate(200%);
  border: 1px solid var(--hair); border-radius: 24px;
  box-shadow: 0 18px 50px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.08);
  padding: 12px 14px calc(env(safe-area-inset-bottom, 0px) + 14px);
  transform: translateY(-14px); transition: transform 0.26s cubic-bezier(0.22,1,0.36,1);
}
.stories-panel.show .stories-sheet { transform: none; }
.stories-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 2px 2px 12px; flex: none; }
.stories-title { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.stories-body { overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; display: flex; flex-direction: column; gap: 8px; }
.stories-body::-webkit-scrollbar { width: 0; }
.story-row {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; font: inherit; cursor: pointer;
  background: rgba(118,118,128,0.10); border: 1px solid var(--hair-soft); border-radius: 16px; padding: 12px 14px;
  transition: background 0.16s ease, transform 0.1s ease; animation: pop 0.26s cubic-bezier(0.22,1,0.36,1);
}
.story-row:hover { background: rgba(255,255,255,0.05); }
.story-row:active { transform: scale(0.99); }
.story-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 8px rgba(10,132,255,0.8); }
.story-mid { flex: 1; min-width: 0; }
.story-tag { font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em; color: var(--blue-2); margin-bottom: 3px; }
.story-prompt { font-size: 14px; line-height: 1.35; color: var(--label); }
.story-time { flex: none; font-size: 11.5px; color: var(--label-3); }
/* Section headers + the answered-decisions history in the bell panel */
.story-sec { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--label-3); margin: 14px 4px 8px; }
.story-sec:first-child { margin-top: 2px; }
.story-empty { font-size: 13px; color: var(--label-3); padding: 6px 4px 2px; }
.story-row.taken { cursor: default; background: rgba(118,118,128,0.06); animation: none; }
.story-row.taken:hover { background: rgba(118,118,128,0.06); }
.story-row.taken:active { transform: none; }
.story-answer { font-size: 12.5px; color: var(--green); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============ FEED — the addictive Instagram rich-card stream (UI-2) ===========================
 * Full-bleed cards whose BODY varies by card kind (accomplishment / metric / chart / image / article /
 * update / poll), each with a source chip + an action bar (Like · Comment · Loop · Share). Extends the
 * iOS-dark language: pure black, single blue accent, glass, hairlines, gradient washes per card kind. */
.feed { flex: 1; min-height: 0; overflow-y: auto; padding-top: var(--top-space); padding-bottom: var(--bottom-space); }

/* ---- Stories rail (UI-3) — Instagram-style round bubbles with gradient rings: the drop-pad first,
 * then each pending DECISION question. Horizontal scroll, edge-to-edge, hairline under it. ---- */
.feed-stories:not(:empty) { padding: 8px 0 10px; border-bottom: 1px solid var(--hair-soft); }
.fs-track { display: flex; gap: 14px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; padding: 2px 14px; -webkit-overflow-scrolling: touch; }
.fs-track::-webkit-scrollbar { height: 0; }
.fs-bubble { flex: none; width: 70px; display: flex; flex-direction: column; align-items: center; gap: 6px; background: none; border: none; padding: 0; cursor: pointer; font: inherit; scroll-snap-align: start; }
.fs-bubble:active { transform: scale(0.95); }
.fs-bubble { transition: transform 0.1s ease; }
/* the gradient ring: a conic Instagram-style halo with a black gap, an avatar inside */
.fs-ring { position: relative; width: 64px; height: 64px; border-radius: 50%; padding: 3px; background: conic-gradient(from 210deg, #ffd60a, #ff375f, #bf5af2, #0a84ff, #ffd60a); animation: fsspin 0.01s; }
.fs-inner { position: relative; display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; background: var(--bg); padding: 2px; overflow: hidden; }
.fs-inner .avatar { width: 100%; height: 100%; font-size: 18px; }
/* seen state — the ring goes muted/grey (still tappable to re-read) */
.fs-bubble.seen .fs-ring { background: rgba(118,118,128,0.45); }
.fs-name { font-size: 11px; font-weight: 600; color: var(--label-2); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fs-bubble.seen .fs-name { color: var(--label-3); }
@keyframes fsspin { to { transform: none; } }
/* the drop-pad bubble — a dashed "+" ring, the always-first call to action */
.fs-drop .fs-ring { background: none; padding: 0; }
.fs-drop-inner { background: rgba(118,118,128,0.14); border: 2px dashed var(--hair); color: var(--blue-2); padding: 0; }
.fs-drop:active .fs-drop-inner { border-color: var(--blue); }
.fs-plus { width: 26px; height: 26px; fill: none; }
.fs-drop .fs-name { color: var(--blue-2); }

.sc { position: relative; border-bottom: 1px solid var(--hair-soft); padding-bottom: 6px; }
/* Staggered entrance — each card lifts + fades in, offset by --d so a fresh paint cascades. */
.sc.enter { animation: scin 0.42s cubic-bezier(0.22,1,0.36,1) both; animation-delay: var(--d, 0s); }
@keyframes scin { from { opacity: 0; transform: translateY(14px) scale(0.985); } to { opacity: 1; transform: none; } }
/* Per-kind accent COLOR — drawn as a ring around the post's avatar (no left rail). */
.sc.tint-win     { --sc-ring: #ff9f0a; }
.sc.tint-metric  { --sc-ring: #30d158; }
.sc.tint-image   { --sc-ring: #bf5af2; }
.sc.tint-article { --sc-ring: #5e8bff; }
.sc.tint-update  { --sc-ring: #0a84ff; }
.sc.tint-poll    { --sc-ring: #ff375f; }
/* The post's profile image wears the kind colour as a ring (a thin bg gap, then the colour). */
.sc-head .avatar { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--sc-ring, var(--blue)); }

/* header: avatar · name + kind chip · time */
.sc-head { display: flex; align-items: center; gap: 10px; padding: 11px 12px 9px; }
.sc-hmid { flex: 1; min-width: 0; }
.sc-namerow { display: flex; align-items: center; gap: 7px; min-width: 0; }
.sc-name { font-size: 14.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-kind { flex: none; font-size: 10px; font-weight: 700; letter-spacing: 0.03em; text-transform: lowercase; padding: 2px 7px; border-radius: 999px; }
.sc-kind-prime   { color: var(--blue-2); background: rgba(10,132,255,0.16); text-transform: none; }
.sc-kind-team    { color: var(--green); background: rgba(48,209,88,0.15); }
.sc-kind-partner { color: var(--amber); background: rgba(255,159,10,0.15); }
.sc-kind-agent   { color: var(--purple); background: rgba(191,90,242,0.16); }
.sc-time { font-size: 11.5px; color: var(--label-3); margin-top: 2px; }

/* ---- card bodies ---- */
/* media-style cards (accomplishment / metric / chart) — a gradient panel, the content is the hero */
.sc-media { position: relative; margin: 0 6px; border-radius: 14px; overflow: hidden; padding: 26px 22px; min-height: 188px; display: flex; flex-direction: column; justify-content: center; box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 8px 28px rgba(0,0,0,0.32); }
.sc-media::after { content: ''; position: absolute; inset: 0; background: radial-gradient(120% 80% at 50% -10%, rgba(255,255,255,0.20), transparent 62%); pointer-events: none; }
.sc-badge { position: absolute; z-index: 2; top: 12px; left: 12px; font-size: 10px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: #fff; background: rgba(0,0,0,0.30); padding: 4px 10px; border-radius: 999px; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }

.sc-win { background: linear-gradient(140deg, #ff9f0a, #ff375f 92%); }
.sc-quote { position: relative; z-index: 1; }
.sc-quote-mark { font-size: 52px; line-height: 0.5; font-weight: 800; color: rgba(255,255,255,0.55); height: 24px; }
.sc-quote-text { color: #fff; font-size: 22px; font-weight: 800; line-height: 1.26; letter-spacing: -0.015em; text-shadow: 0 1px 18px rgba(0,0,0,0.25); display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.sc-quote-sub { position: relative; z-index: 1; margin-top: 10px; color: rgba(255,255,255,0.86); font-size: 13.5px; line-height: 1.4; }

.sc-metric { background: linear-gradient(140deg, #0a9e6a, #30d158 95%); align-items: flex-start; }
.sc-bignum { position: relative; z-index: 1; color: #fff; font-size: 56px; font-weight: 850; letter-spacing: -0.04em; line-height: 1; text-shadow: 0 2px 22px rgba(0,0,0,0.28); }
.sc-metric-label { position: relative; z-index: 1; margin-top: 10px; color: rgba(255,255,255,0.92); font-size: 16px; font-weight: 600; line-height: 1.3; }
.sc-delta { position: relative; z-index: 1; margin-top: 10px; display: inline-flex; align-items: center; font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 999px; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.sc-delta.up { color: #eafff1; background: rgba(0,0,0,0.22); }
.sc-delta.down { color: #ffe9e7; background: rgba(0,0,0,0.28); }

.sc-chart { background: linear-gradient(140deg, #1f2a44, #0a84ff 240%); }
.sc-spark { position: relative; z-index: 1; display: flex; align-items: flex-end; gap: 3px; height: 96px; margin-top: 8px; }
.sc-spark-col { flex: 1; min-width: 2px; border-radius: 3px 3px 0 0; background: linear-gradient(180deg, #fff, rgba(255,255,255,0.55)); box-shadow: 0 0 10px rgba(255,255,255,0.25); }
.sc-chart-cap { position: relative; z-index: 1; margin-top: 12px; color: rgba(255,255,255,0.9); font-size: 13px; line-height: 1.4; }

/* image card — the visual + caption (square-ish, capped) */
.sc-imgwrap { margin: 0 6px; border-radius: 14px; overflow: hidden; background: var(--card); border: 1px solid var(--hair-soft); }
.sc-img { display: block; width: 100%; max-height: 460px; object-fit: cover; background: #0c0c0e; }
.sc-imgwrap.sc-img-failed { min-height: 120px; display: flex; align-items: center; justify-content: center; }
.sc-imgwrap.sc-img-failed::before { content: '🖼'; font-size: 30px; opacity: 0.4; }
.sc-cap { padding: 10px 14px 12px; font-size: 14px; line-height: 1.42; color: var(--label); }

/* article — title + body with read-more (a longer update) */
.sc-article { padding: 2px 12px 6px; }
.sc-art-title { font-size: 18px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.28; margin-bottom: 7px; }
.sc-art-body { font-size: 14.5px; line-height: 1.5; color: var(--label-2); white-space: pre-wrap; }
.sc-art-body.clamp { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.sc-art-body.open { display: block; }
.sc-more { font: inherit; font-size: 13.5px; font-weight: 600; color: var(--blue); background: none; border: none; padding: 6px 0 2px; cursor: pointer; }
.sc-more:active { opacity: 0.6; }

/* update — the compact line */
.sc-update { padding: 2px 12px 8px; }
.sc-up-title { font-size: 15.5px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.34; }
.sc-up-body { font-size: 14.5px; line-height: 1.46; color: var(--label-2); margin-top: 3px; white-space: pre-wrap; }
.sc-update .sc-spark { height: 56px; margin: 12px 0 2px; }
.sc-update .sc-spark-col { background: linear-gradient(180deg, var(--blue-2), rgba(10,132,255,0.45)); box-shadow: none; }

/* poll — prompt + big tappable options with live vote bars */
.sc-poll { margin: 0 6px; border-radius: 14px; padding: 16px 16px 14px; background: var(--glass); border: 1px solid rgba(191,90,242,0.30); -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%); box-shadow: 0 8px 28px rgba(0,0,0,0.28); }
.sc-poll-tag { font-size: 10.5px; font-weight: 800; letter-spacing: 0.05em; color: var(--purple); margin-bottom: 7px; }
.sc-poll-q { font-size: 16.5px; font-weight: 700; line-height: 1.34; letter-spacing: -0.01em; margin-bottom: 12px; }
.sc-poll-opts { display: flex; flex-direction: column; gap: 9px; }
.sc-poll-opt { position: relative; overflow: hidden; display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; font: inherit; cursor: pointer; padding: 13px 14px; border-radius: 14px; background: rgba(118,118,128,0.16); border: 1px solid var(--hair); color: var(--label); transition: transform 0.1s ease, border-color 0.2s ease; }
.sc-poll-opt:hover { border-color: rgba(191,90,242,0.5); }
.sc-poll-opt:active { transform: scale(0.99); }
.sc-poll-opt.voted { border-color: var(--purple); background: rgba(191,90,242,0.14); }
.sc-poll-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: linear-gradient(90deg, rgba(191,90,242,0.30), rgba(94,92,230,0.22)); transition: width 0.5s cubic-bezier(0.22,1,0.36,1); z-index: 0; }
.sc-poll-opt.voted .sc-poll-fill { background: linear-gradient(90deg, rgba(191,90,242,0.42), rgba(94,92,230,0.30)); }
.sc-poll-lbl { position: relative; z-index: 1; flex: 1; min-width: 0; font-size: 14.5px; font-weight: 600; }
.sc-poll-pct { position: relative; z-index: 1; flex: none; font-size: 13px; font-weight: 700; color: var(--label-2); }
.sc-poll-opt.voted .sc-poll-pct { color: #fff; }
.sc-poll-total { font-size: 12px; color: var(--label-3); margin-top: 11px; }

/* ---- action bar: Like · Comment · Loop · Share ---- */
.sc-actions { display: flex; align-items: center; gap: 1px; padding: 12px 10px 2px; color: var(--label); }
.sc-act { display: inline-flex; align-items: center; gap: 6px; font: inherit; background: none; border: none; color: var(--label); cursor: pointer; padding: 6px 5px; border-radius: 12px; transition: transform 0.1s ease, color 0.18s ease, background 0.18s ease; }
.sc-act:hover { background: rgba(255,255,255,0.05); }
.sc-act:active { transform: scale(0.92); }
.sc-ic { width: 23px; height: 23px; fill: none; transition: transform 0.1s ease; }
/* Head + body of a card open the source conversation on tap; the action bar stays its own controls. */
.sc-open.tappable { cursor: pointer; }
/* Brief highlight on the message a feed card jumped to. */
.msg-flash { animation: msgFlash 1.5s ease; }
@keyframes msgFlash { 0%, 100% { background: transparent; } 22% { background: rgba(10,132,255,0.18); } }
.sc-count { font-size: 13px; font-weight: 600; color: var(--label-2); min-width: 4px; }
.sc-loop-lbl { font-size: 13px; font-weight: 600; color: var(--label-2); }
.sc-spacer { flex: 1; }
/* like: heart fills red + pops */
.sc-like.on { color: var(--red); }
.sc-like.on .sc-heart { fill: var(--red); }
.sc-like.on .sc-count { color: var(--red); }
.sc-like.pop .sc-heart { animation: heartpop 0.42s cubic-bezier(0.22,1.4,0.36,1); }
@keyframes heartpop { 0% { transform: scale(1); } 35% { transform: scale(1.32); } 70% { transform: scale(0.9); } 100% { transform: scale(1); } }
/* loop: turns blue when active + a quick spin on tap */
.sc-loop.on { color: var(--blue-2); }
.sc-loop.on .sc-loop-lbl { color: var(--blue-2); }
.sc-loop.pop .sc-ic { animation: loopspin 0.5s cubic-bezier(0.4,0,0.2,1); }
@keyframes loopspin { from { transform: rotate(0); } to { transform: rotate(180deg); } }
.sc-share:hover { color: var(--blue-2); }

/* "new posts" pill — floats over the BOTTOM of the feed (conversation order) when live items arrive
   while you're scrolled up reading. Tap it to jump to the newest. */
.feed-pill { position: absolute; left: 50%; bottom: calc(var(--bottom-space) + 8px); transform: translate(-50%, 14px); z-index: 18; display: inline-flex; align-items: center; gap: 7px; font: inherit; font-size: 13.5px; font-weight: 700; color: #fff; cursor: pointer; padding: 9px 16px 9px 13px; border-radius: 999px; background: var(--blue); border: none; box-shadow: 0 10px 30px rgba(10,132,255,0.5), inset 0 1px 0 rgba(255,255,255,0.18); opacity: 0; pointer-events: none; transition: transform 0.3s cubic-bezier(0.22,1,0.36,1), opacity 0.3s ease; }
.feed-pill .sc-ic { width: 17px; height: 17px; }
.feed-pill.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.feed-pill:active { transform: translate(-50%, 0) scale(0.95); }

/* ============ UI-3 · Drop-pad composer (stories rail "+ Drop an idea") ============ */
/* A bottom sheet that routes an idea to Prime or the team (POST /api/drop). iOS sheet language. */
.drop-sheet {
  position: fixed; inset: 0; z-index: 55; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(0,0,0,0.55); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  opacity: 0; transition: opacity 0.24s ease;
}
.drop-sheet.show { opacity: 1; }
.dp-sheet {
  width: 100%; max-width: 620px; display: flex; flex-direction: column;
  background: var(--glass-strong); -webkit-backdrop-filter: blur(34px) saturate(200%); backdrop-filter: blur(34px) saturate(200%);
  border: 1px solid var(--hair); border-bottom: none; border-radius: 24px 24px 0 0;
  box-shadow: 0 -18px 50px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.08);
  padding: 12px 16px calc(env(safe-area-inset-bottom, 0px) + 14px);
  transform: translateY(100%); transition: transform 0.3s cubic-bezier(0.22,1,0.36,1);
}
.drop-sheet.show .dp-sheet { transform: none; }
.dp-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 2px 2px 12px; position: relative; }
.dp-head::before { content: ''; position: absolute; top: -4px; left: 50%; transform: translateX(-50%); width: 38px; height: 4px; border-radius: 999px; background: var(--hair); }
.dp-title { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
/* Recipient picker (Personal Note / All Team / contacts) — Instagram "New message" style */
.dp-to-label { font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--label-3); margin: 2px 2px 8px; }
.dp-recipients { display: flex; flex-direction: column; gap: 4px; max-height: 230px; overflow-y: auto; margin-bottom: 12px; }
.dp-rcpt { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; font: inherit; cursor: pointer; background: transparent; border: 1px solid transparent; border-radius: 14px; padding: 8px 10px; transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease; }
.dp-rcpt:active { transform: scale(0.99); }
.dp-rcpt.on { background: rgba(10,132,255,0.12); border-color: rgba(10,132,255,0.4); }
.dp-rcpt-ic { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 19px; background: rgba(118,118,128,0.2); border: 1px solid var(--hair); }
.dp-rcpt-mid { flex: 1; min-width: 0; }
.dp-rcpt-name { font-size: 15px; font-weight: 600; color: var(--label); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dp-rcpt-sub { font-size: 12px; color: var(--label-2); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dp-rcpt-check { flex: none; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--hair); transition: background 0.15s ease, border-color 0.15s ease; }
.dp-rcpt.on .dp-rcpt-check { background: var(--blue); border-color: var(--blue); box-shadow: inset 0 0 0 3px rgba(28,28,30,0.95); }
.dp-text { width: 100%; min-height: 132px; resize: vertical; font: inherit; font-size: 16px; line-height: 1.5; color: var(--label); background: rgba(118,118,128,0.18); border: 1px solid var(--hair); border-radius: 16px; padding: 14px 16px; outline: none; transition: border-color 0.18s ease; }
.dp-text:focus { border-color: rgba(64,156,255,0.6); }
.dp-text::placeholder { color: var(--label-3); }
.dp-send { font: inherit; font-size: 16px; font-weight: 600; cursor: pointer; width: 100%; color: #fff; background: var(--blue); border: none; border-radius: 16px; padding: 15px 18px; margin-top: 12px; box-shadow: 0 8px 24px rgba(10,132,255,0.38); transition: transform 0.1s ease, opacity 0.18s ease; }
.dp-send:active { transform: scale(0.985); }
.dp-send:disabled { opacity: 0.6; cursor: default; box-shadow: none; }

/* ============ First-run onboarding (3 slides) ============ */
.intro { position: absolute; inset: 0; z-index: 60; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(120% 90% at 50% 0%, rgba(10,60,130,0.45), rgba(0,0,0,0.93) 62%), var(--bg);
  opacity: 0; pointer-events: none; transition: opacity 0.3s ease; }
.intro.show { opacity: 1; pointer-events: auto; }
.intro-card { width: min(460px, 100%); display: flex; flex-direction: column; align-items: center; gap: 22px;
  padding: calc(env(safe-area-inset-top, 0px) + 24px) 8px calc(env(safe-area-inset-bottom, 0px) + 14px); }
.intro-body { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 16px;
  min-height: 330px; justify-content: center; width: 100%; animation: introIn 0.4s cubic-bezier(0.22,1,0.36,1); }
@keyframes introIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.intro-ic { width: 76px; height: 76px; border-radius: 22px; display: grid; place-items: center; font-size: 38px;
  background: linear-gradient(150deg, rgba(10,132,255,0.3), rgba(10,132,255,0.07)); border: 1px solid var(--hair);
  box-shadow: 0 12px 40px rgba(10,132,255,0.28); }
.intro-title { font-size: 27px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; max-width: 16ch; }
.intro-text { font-size: 15.5px; line-height: 1.55; color: var(--label-2); max-width: 34ch; }
.intro-goal { width: 100%; min-height: 120px; resize: none; font: inherit; font-size: 16px; line-height: 1.5;
  color: var(--label); background: rgba(118,118,128,0.18); border: 1px solid var(--hair); border-radius: 16px;
  padding: 14px 16px; outline: none; transition: border-color 0.18s ease; }
.intro-goal:focus { border-color: rgba(64,156,255,0.6); }
.intro-goal::placeholder { color: var(--label-3); }
.intro-hint { font-size: 12.5px; color: var(--label-3); max-width: 36ch; }
.intro-dots { display: flex; gap: 8px; }
.intro-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--card); border: 1px solid var(--hair); transition: all 0.22s ease; }
.intro-dot.on { background: var(--blue); border-color: transparent; width: 22px; border-radius: 999px; box-shadow: 0 0 8px rgba(10,132,255,0.8); }
.intro-foot { width: 100%; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.intro-next { width: 100%; font: inherit; font-size: 16px; font-weight: 600; cursor: pointer; color: #fff;
  background: var(--blue); border: none; border-radius: 16px; padding: 15px 18px; box-shadow: 0 8px 24px rgba(10,132,255,0.38);
  transition: transform 0.1s ease, opacity 0.18s ease; }
.intro-next:active { transform: scale(0.985); }
.intro-next:disabled { opacity: 0.6; cursor: default; box-shadow: none; }
.intro-skip { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 16px); right: 18px; font: inherit;
  font-size: 14px; font-weight: 600; color: var(--label-2); background: none; border: none; cursor: pointer; }
.intro-invite { font: inherit; font-size: 14.5px; font-weight: 600; color: var(--blue-2); background: none; border: none; cursor: pointer; padding: 6px; }

/* ============ UI-3 · Story viewer (full-screen decision, big answer buttons) ============ */
/* Instagram story chrome: progress bars up top, tap-through zones, a gradient stage; the question is
 * the hero and the OPTIONS are big tappable buttons. Answering reuses the existing question path. */
.story-viewer {
  position: fixed; inset: 0; z-index: 58; display: flex; align-items: stretch; justify-content: center;
  background: rgba(0,0,0,0.7); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; transition: opacity 0.24s ease;
}
.story-viewer.show { opacity: 1; }
.sv-stage {
  position: relative; width: 100%; max-width: 620px; display: flex; flex-direction: column; overflow: hidden;
  background:
    radial-gradient(120% 70% at 50% -10%, rgba(10,132,255,0.28), transparent 60%),
    radial-gradient(120% 80% at 80% 110%, rgba(191,90,242,0.22), transparent 60%),
    linear-gradient(160deg, #14141a, #000 80%);
  padding: calc(env(safe-area-inset-top, 0px) + 14px) 0 calc(env(safe-area-inset-bottom, 0px) + 16px);
  transform: scale(0.98); transition: transform 0.3s cubic-bezier(0.22,1,0.36,1);
}
.story-viewer.show .sv-stage { transform: none; }
@media (min-width: 640px) { .sv-stage { border-left: 1px solid var(--hair-soft); border-right: 1px solid var(--hair-soft); } }
/* progress bars (one per story, current one animates to full) */
.sv-bars { display: flex; gap: 5px; padding: 0 14px 12px; z-index: 3; }
.sv-bar { flex: 1; height: 3px; border-radius: 999px; background: rgba(255,255,255,0.26); overflow: hidden; }
.sv-bar.done { background: rgba(255,255,255,0.85); }
.sv-bar.on { background: rgba(255,255,255,0.26); position: relative; }
.sv-bar.on::after { content: ''; position: absolute; inset: 0; background: #fff; transform-origin: left; animation: svfill 6s linear forwards; }
@keyframes svfill { from { transform: scaleX(0.04); } to { transform: scaleX(1); } }
.sv-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 14px 8px; z-index: 3; }
.sv-id { display: flex; align-items: center; gap: 10px; }
.sv-tag { font-size: 11px; font-weight: 800; letter-spacing: 0.06em; color: var(--blue-2); }
.sv-count { font-size: 12px; font-weight: 600; color: rgba(255,255,255,0.55); }
.sv-head .glass-btn { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.18); }
/* tap-through zones — full-height halves behind the answer UI */
.sv-zone { position: absolute; top: 0; bottom: 0; width: 34%; z-index: 1; background: none; border: none; cursor: pointer; padding: 0; }
.sv-zone-prev { left: 0; }
.sv-zone-next { right: 0; }
.sv-body { position: relative; z-index: 2; flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 18px; padding: 16px 20px 0; overflow-y: auto; }
.sv-body::-webkit-scrollbar { width: 0; }
.sv-prompt { font-size: 27px; font-weight: 800; line-height: 1.24; letter-spacing: -0.02em; color: #fff; text-shadow: 0 2px 24px rgba(0,0,0,0.4); }
.sv-options { display: flex; flex-direction: column; gap: 10px; }
/* the BIG answer buttons — glass, full-width, springy */
.sv-opt {
  width: 100%; text-align: left; font: inherit; font-size: 16.5px; font-weight: 600; cursor: pointer; color: #fff;
  background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.22); border-radius: 16px; padding: 16px 18px;
  -webkit-backdrop-filter: blur(16px) saturate(160%); backdrop-filter: blur(16px) saturate(160%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12); transition: transform 0.1s ease, background 0.18s ease, border-color 0.18s ease;
}
.sv-opt:hover { background: rgba(255,255,255,0.2); border-color: rgba(255,255,255,0.4); }
.sv-opt:active { transform: scale(0.985); background: var(--blue); border-color: transparent; }
.sv-free { display: flex; align-items: center; gap: 8px; padding-bottom: 2px; }
.sv-free-input { flex: 1; font: inherit; font-size: 15px; color: #fff; background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.22); border-radius: 999px; padding: 12px 16px; outline: none; }
.sv-free-input::placeholder { color: rgba(255,255,255,0.55); }
.sv-free-input:focus { border-color: rgba(255,255,255,0.5); }
.sv-free-send { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--blue); border: none; color: #fff; cursor: pointer; transition: transform 0.12s ease; box-shadow: 0 6px 22px rgba(10,132,255,0.4); }
.sv-free-send:active { transform: scale(0.9); }
.sv-free-send .ic { width: 19px; height: 19px; fill: none; }

/* ============ UI-3 · Share picker (feed cards' Share → /api/share/targets · /api/feed/share) ============ */
.share-sheet {
  position: fixed; inset: 0; z-index: 56; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(0,0,0,0.55); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  opacity: 0; transition: opacity 0.24s ease;
}
.share-sheet.show { opacity: 1; }
.sh-sheet {
  width: 100%; max-width: 620px; max-height: 80dvh; display: flex; flex-direction: column;
  background: var(--glass-strong); -webkit-backdrop-filter: blur(34px) saturate(200%); backdrop-filter: blur(34px) saturate(200%);
  border: 1px solid var(--hair); border-bottom: none; border-radius: 24px 24px 0 0;
  box-shadow: 0 -18px 50px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.08);
  padding: 12px 14px calc(env(safe-area-inset-bottom, 0px) + 12px);
  transform: translateY(100%); transition: transform 0.3s cubic-bezier(0.22,1,0.36,1);
}
.share-sheet.show .sh-sheet { transform: none; }
.sh-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 2px 2px 10px; position: relative; flex: none; }
.sh-head::before { content: ''; position: absolute; top: -4px; left: 50%; transform: translateX(-50%); width: 38px; height: 4px; border-radius: 999px; background: var(--hair); }
.sh-title { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.sh-preview { font-size: 13px; color: var(--label-2); line-height: 1.4; background: rgba(118,118,128,0.12); border: 1px solid var(--hair-soft); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; flex: none; }
.sh-list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; display: flex; flex-direction: column; gap: 6px; padding: 2px; }
.sh-list::-webkit-scrollbar { width: 0; }
.sh-loading { font-size: 13.5px; color: var(--label-3); text-align: center; padding: 22px; }
.sh-empty { font-size: 13.5px; color: var(--label-3); text-align: center; padding: 22px 14px; line-height: 1.4; }
.sh-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; font: inherit; cursor: pointer; background: rgba(118,118,128,0.10); border: 1px solid var(--hair-soft); border-radius: 14px; padding: 10px 12px; transition: background 0.16s ease, border-color 0.16s ease, transform 0.1s ease; }
.sh-row:hover { background: rgba(255,255,255,0.05); }
.sh-row:active { transform: scale(0.99); }
.sh-row.on { background: rgba(10,132,255,0.14); border-color: rgba(10,132,255,0.4); }
.sh-mid { flex: 1; min-width: 0; }
.sh-name { font-size: 14.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sh-kind { font-size: 11.5px; color: var(--label-2); margin-top: 1px; }
/* the multiselect checkmark — empty ring → filled blue tick when selected */
.sh-check { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--hair); color: transparent; transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease; }
.sh-check svg { width: 16px; height: 16px; }
.sh-row.on .sh-check { background: var(--blue); border-color: var(--blue); color: #fff; }
.sh-send { flex: none; font: inherit; font-size: 16px; font-weight: 600; cursor: pointer; width: 100%; color: #fff; background: var(--blue); border: none; border-radius: 16px; padding: 15px 18px; margin-top: 10px; box-shadow: 0 8px 24px rgba(10,132,255,0.38); transition: transform 0.1s ease, opacity 0.18s ease; }
.sh-send:active { transform: scale(0.985); }
.sh-send:disabled { opacity: 0.5; cursor: default; box-shadow: none; }

/* ============ Settings (metrics + controls) ============ */
.settings { flex: 1; min-height: 0; overflow-y: auto; padding: var(--top-space) 16px var(--bottom-space); }
.set-section-title { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--label-3); margin: 6px 4px 10px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--glass); border: 1px solid var(--hair); border-radius: 16px; padding: 14px 16px; margin-bottom: 12px; -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%); }
.set-row .set-label, .conn-mid .set-label { font-size: 15px; font-weight: 600; }
.set-row .set-sub, .conn-mid .set-sub { font-size: 12px; color: var(--label-2); margin-top: 2px; }
.conn-mid .set-sub a { color: var(--blue); text-decoration: none; }
.set-intro { font-size: 13px; color: var(--label-2); line-height: 1.4; margin: 0 4px 14px; }
.conn-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; background: var(--glass); border: 1px solid var(--hair); border-radius: 16px; padding: 12px 14px; margin-bottom: 10px; -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%); }
.conn-ico { flex: none; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 21px; background: rgba(118,118,128,0.18); border: 1px solid var(--hair); }
.conn-mid { flex: 1; min-width: 0; }
.conn-btn { flex: none; font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; padding: 8px 16px; border-radius: 999px; color: var(--blue); background: rgba(10,132,255,0.14); border: 1px solid rgba(10,132,255,0.4); transition: transform 0.1s ease; }
.conn-btn:active { transform: scale(0.95); }
.conn-btn.on { color: var(--green); background: rgba(48,209,88,0.14); border-color: rgba(48,209,88,0.4); }
.conn-btn.dim { color: var(--label-2); background: rgba(118,118,128,0.14); border-color: var(--hair); font-size: 12.5px; padding: 7px 13px; }
.conn-btn:disabled { opacity: 0.5; cursor: default; }
.switch { position: relative; width: 52px; height: 31px; border-radius: 999px; background: rgba(118,118,128,0.32); border: none; cursor: pointer; transition: background 0.2s ease; flex: none; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; transition: transform 0.2s cubic-bezier(0.22,1,0.36,1); box-shadow: 0 1px 4px rgba(0,0,0,0.4); }
.switch.on { background: var(--green); }
.switch.on::after { transform: translateX(21px); }

/* ============ Autonomy (managed-profile send policy) ============ */
.seg { display: flex; gap: 4px; background: rgba(118,118,128,0.18); border: 1px solid var(--hair); border-radius: 12px; padding: 4px; margin: 0 0 8px; }
.seg-btn { flex: 1; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; padding: 9px 8px; border-radius: 9px; color: var(--label-2); background: transparent; border: none; transition: background 0.16s ease, color 0.16s ease; }
.seg-btn.on { color: var(--label); background: rgba(10,132,255,0.9); box-shadow: 0 2px 8px rgba(10,132,255,0.35); }
.seg-btn:not(.on):active { background: rgba(118,118,128,0.22); }
.seg-caption { font-size: 12px; color: var(--label-2); line-height: 1.4; margin: 0 4px 14px; }

/* ============ Trust (5-tier ladder chip + inline picker on conversation rows) ============ */
/* The chip sits in .conv-right beside the tier badge — same pill language, but tappable. */
.trust-chip { display: inline-flex; align-items: center; gap: 3px; flex: none; font: inherit; cursor: pointer; font-size: 10.5px; font-weight: 700; letter-spacing: 0.02em; padding: 3px 8px; border-radius: 999px; border: 1px solid transparent; transition: transform 0.1s ease, filter 0.16s ease; }
.trust-chip:active { transform: scale(0.94); }
.trust-lbl { line-height: 1; }
.trust-arrow { font-size: 11px; font-weight: 700; line-height: 1; opacity: 0.85; }
/* Tier colours — reuse the badge palette: trusted (admin/team) green, partner blue, lead amber, unknown grey. */
.trust-trusted { color: var(--green); background: rgba(48,209,88,0.14); border-color: rgba(48,209,88,0.32); }
.trust-partner { color: var(--blue-2); background: rgba(10,132,255,0.14); border-color: rgba(10,132,255,0.34); }
.trust-lead    { color: var(--amber); background: rgba(255,159,10,0.14); border-color: rgba(255,159,10,0.34); }
.trust-unknown { color: var(--label-2); background: rgba(118,118,128,0.18); border-color: var(--hair); }

/* Inline picker — a popover anchored under the tapped row inside the (positioned) conv-list. */
.conv-list { position: relative; }
.trust-pop { position: absolute; right: 12px; z-index: 40; width: min(280px, calc(100% - 24px)); background: var(--glass-strong); border: 1px solid var(--hair); border-radius: 16px; padding: 12px; box-shadow: 0 14px 40px rgba(0,0,0,0.5); -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%); animation: pop 0.18s cubic-bezier(0.22,1,0.36,1); }
.trust-pop-title { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--label-3); margin: 0 2px 8px; }
.trust-pop-sub { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--label-3); margin: 10px 2px 6px; }
.trust-tiers { display: flex; flex-direction: column; gap: 5px; }
.trust-tier { display: flex; align-items: center; font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; text-align: left; padding: 9px 12px; border-radius: 10px; border: 1px solid transparent; transition: transform 0.1s ease, filter 0.16s ease; }
.trust-tier:active { transform: scale(0.98); }
.trust-tier.on { box-shadow: inset 0 0 0 1.5px currentColor; }
.trust-dir { display: flex; gap: 4px; background: rgba(118,118,128,0.18); border: 1px solid var(--hair); border-radius: 12px; padding: 4px; }
.trust-dir-btn { flex: 1; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; padding: 8px 6px; border-radius: 9px; color: var(--label-2); background: transparent; border: none; transition: background 0.16s ease, color 0.16s ease; }
.trust-dir-btn.on { color: var(--label); background: rgba(10,132,255,0.9); box-shadow: 0 2px 8px rgba(10,132,255,0.35); }
.trust-dir-btn:not(.on):active { background: rgba(118,118,128,0.22); }

/* Trust matrix editor — per-class rule cards (Settings) */
.mx-card { background: var(--glass); border: 1px solid var(--hair); border-radius: 16px; padding: 12px 14px; margin-bottom: 10px; -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%); }
.mx-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.mx-title { font-size: 14.5px; font-weight: 700; }
.mx-reset { flex: none; font: inherit; font-size: 11.5px; font-weight: 600; cursor: pointer; padding: 5px 11px; border-radius: 999px; color: var(--label-2); background: rgba(118,118,128,0.16); border: 1px solid var(--hair); }
.mx-reset:active { transform: scale(0.95); }
.mx-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; }
.mx-key { flex: none; width: 96px; font-size: 12.5px; color: var(--label-2); }
.mx-sel, .mx-inp { flex: 1; min-width: 0; font: inherit; font-size: 13px; color: var(--label); background: rgba(118,118,128,0.18); border: 1px solid var(--hair); border-radius: 10px; padding: 7px 10px; outline: none; transition: border-color 0.18s ease; }
.mx-sel { -webkit-appearance: none; appearance: none; cursor: pointer; }
.mx-sel:focus, .mx-inp:focus { border-color: rgba(64,156,255,0.6); }
.mx-inp::placeholder { color: var(--label-3); }

/* ============ Drafts (replies awaiting approval) ============ */
.draft-card { background: var(--glass); border: 1px solid var(--hair); border-radius: 16px; padding: 12px 14px; margin-bottom: 10px; -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%); animation: pop 0.26s cubic-bezier(0.22,1,0.36,1); }
.draft-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.draft-chan { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.draft-conn { flex: none; font-size: 11px; font-weight: 600; color: var(--label-2); background: rgba(118,118,128,0.18); border: 1px solid var(--hair-soft); border-radius: 999px; padding: 3px 9px; }
.draft-context { font-size: 12px; color: var(--label-2); line-height: 1.4; margin-bottom: 8px; }
.draft-text { width: 100%; box-sizing: border-box; font: inherit; font-size: 14px; line-height: 1.45; color: var(--label); background: rgba(118,118,128,0.12); border: 1px solid var(--hair); border-radius: 12px; padding: 10px 12px; resize: vertical; outline: none; transition: border-color 0.18s ease; }
.draft-text:not([readonly]) { background: rgba(118,118,128,0.2); border-color: rgba(64,156,255,0.6); }
.draft-actions { display: flex; gap: 8px; margin-top: 10px; }
.draft-btn { font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--hair); background: rgba(118,118,128,0.14); color: var(--label-2); transition: transform 0.1s ease; }
.draft-btn:active { transform: scale(0.95); }
.draft-btn:disabled { opacity: 0.5; cursor: default; }
.draft-btn.approve { flex: 1; color: #fff; background: var(--blue); border-color: rgba(64,156,255,0.5); box-shadow: 0 4px 14px rgba(10,132,255,0.3); }
.draft-btn.edit.on { color: var(--blue); background: rgba(10,132,255,0.14); border-color: rgba(10,132,255,0.4); }
.draft-btn.reject { color: var(--red); background: rgba(255,69,58,0.12); border-color: rgba(255,69,58,0.35); }

/* ============ Prime Network (settings) ============ */
.net-card { background: var(--glass); border: 1px solid var(--hair); border-radius: 18px; padding: 14px; margin-bottom: 18px; -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%); }
.net-count { font-size: 13px; font-weight: 600; color: var(--label-2); margin: 0 2px 10px; }
.net-search { display: flex; gap: 8px; }
.net-input { flex: 1; min-width: 0; font: inherit; font-size: 14px; color: var(--label); background: rgba(118,118,128,0.18); border: 1px solid var(--hair); border-radius: 999px; padding: 9px 14px; outline: none; transition: border-color 0.18s ease; }
.net-input:focus { border-color: rgba(64,156,255,0.6); }
.net-input::placeholder { color: var(--label-3); }
.net-go { flex: none; font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; padding: 9px 16px; border-radius: 999px; color: var(--blue); background: rgba(10,132,255,0.14); border: 1px solid rgba(10,132,255,0.4); transition: transform 0.1s ease; }
.net-go:active { transform: scale(0.95); }
.net-go:disabled { opacity: 0.6; cursor: default; }

/* Preferences — how the owner wants Prime to work & sound (Layer 2, user-set) */
.pref-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.pref-row { display: flex; align-items: center; gap: 10px; background: rgba(118,118,128,0.10); border: 1px solid var(--hair-soft); border-radius: 14px; padding: 10px 12px; animation: pop 0.26s cubic-bezier(0.22,1,0.36,1); }
.pref-text { flex: 1; min-width: 0; font-size: 14px; line-height: 1.35; }
.pref-x { flex: none; width: 26px; height: 26px; border-radius: 999px; cursor: pointer; font-size: 17px; line-height: 1; color: var(--label-2); background: rgba(118,118,128,0.16); border: 1px solid var(--hair); transition: transform 0.1s ease, color 0.15s ease; }
.pref-x:hover { color: #ff453a; }
.pref-x:active { transform: scale(0.9); }
.pref-empty { font-size: 13px; color: var(--label-3); margin: 0 4px 12px; }
.pref-add { display: flex; gap: 8px; }
.pref-input { flex: 1; min-width: 0; font: inherit; font-size: 14px; color: var(--label); background: rgba(118,118,128,0.18); border: 1px solid var(--hair); border-radius: 999px; padding: 9px 14px; outline: none; transition: border-color 0.18s ease; }
.pref-input:focus { border-color: rgba(64,156,255,0.6); }
.pref-input::placeholder { color: var(--label-3); }
.pref-go { flex: none; font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; padding: 9px 16px; border-radius: 999px; color: var(--blue); background: rgba(10,132,255,0.14); border: 1px solid rgba(10,132,255,0.4); transition: transform 0.1s ease; }
.pref-go:active { transform: scale(0.95); }
.net-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.net-row { display: flex; align-items: center; gap: 11px; background: rgba(118,118,128,0.10); border: 1px solid var(--hair-soft); border-radius: 14px; padding: 10px 12px; animation: pop 0.26s cubic-bezier(0.22,1,0.36,1); }
.net-kind { flex: none; width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; font-size: 18px; background: rgba(118,118,128,0.18); border: 1px solid var(--hair); }
.net-mid { flex: 1; min-width: 0; }
.net-toprow { display: flex; align-items: center; gap: 7px; min-width: 0; }
.net-name { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.net-toprow .live-dot, .net-dot-off { flex: none; }
.net-dot-off { width: 8px; height: 8px; border-radius: 50%; background: rgba(118,118,128,0.55); }
.net-toprow .tier { flex: none; }
.net-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.net-chip { font-size: 11px; font-weight: 600; color: var(--label-2); background: rgba(118,118,128,0.18); border: 1px solid var(--hair-soft); border-radius: 999px; padding: 3px 9px; white-space: nowrap; }
.net-chat-btn { flex: none; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; padding: 7px 13px; border-radius: 999px; color: var(--blue); background: rgba(10,132,255,0.14); border: 1px solid rgba(10,132,255,0.4); transition: transform 0.1s ease; }
.net-chat-btn:active { transform: scale(0.95); }
.net-chat-btn:disabled { opacity: 0.6; cursor: default; }
/* ghost outreach — unclaimed/claimed status chips + the human-gated invite button */
.net-toprow .net-chip { flex: none; }
.net-chip-ghost { color: var(--amber); background: rgba(255,159,10,0.12); border-color: rgba(255,159,10,0.35); }
.net-chip-claimed { color: var(--green); background: rgba(48,209,88,0.12); border-color: rgba(48,209,88,0.35); }
.net-actions { flex: none; display: flex; flex-direction: column; align-items: stretch; gap: 6px; }
.net-invite-btn { flex: none; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; padding: 7px 13px; border-radius: 999px; color: #fff; background: var(--blue); border: 1px solid rgba(64,156,255,0.5); box-shadow: 0 4px 14px rgba(10,132,255,0.3); transition: transform 0.1s ease; }
.net-invite-btn:active { transform: scale(0.95); }
.net-invite-btn:disabled { opacity: 0.6; cursor: default; box-shadow: none; }
.net-empty { font-size: 13px; color: var(--label-3); text-align: center; padding: 14px 8px; line-height: 1.4; }
/* inline URL field under an OpenClaw/Hermes row (wraps to a full-width second line) */
.conn-url { display: flex; gap: 8px; width: 100%; animation: pop 0.26s cubic-bezier(0.22,1,0.36,1); }
.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.metric { background: var(--glass); -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%); border: 1px solid var(--hair); border-radius: 16px; padding: 13px; }
.metric-num { font-size: 24px; font-weight: 800; letter-spacing: -0.03em; }
.metric-num.accent { color: var(--blue-2); }
.metric-lbl { font-size: 11px; color: var(--label-2); margin-top: 3px; line-height: 1.25; }
.chart-card { background: var(--glass); border: 1px solid var(--hair); border-radius: 18px; padding: 16px; -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%); }
.chart-title { font-size: 15px; font-weight: 700; }
.chart-sub { font-size: 12px; color: var(--label-2); margin: 3px 0 14px; line-height: 1.35; }
.chart { display: flex; align-items: flex-end; gap: 6px; height: 120px; overflow: hidden; }
.chart-col { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; }
.chart-x { overflow: hidden; }
.chart-bars { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 3px; }
.bar { width: 7px; border-radius: 4px 4px 2px 2px; min-height: 2px; transition: height 0.5s cubic-bezier(0.22,1,0.36,1); }
.bar.msg { background: rgba(118,118,128,0.5); }
.bar.q { background: var(--green); box-shadow: 0 0 8px rgba(48,209,88,0.5); }
.chart-x { font-size: 9px; color: var(--label-3); }
.chart-legend { display: flex; gap: 16px; margin-top: 12px; }
.legend-key { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--label-2); }
.legend-swatch { width: 11px; height: 11px; border-radius: 3px; }
.legend-swatch.msg { background: rgba(118,118,128,0.5); }
.legend-swatch.q { background: var(--green); }
/* Brain card — the living project state (metrics view) */
.brain-card { background: var(--glass); border: 1px solid var(--hair); border-radius: 18px; padding: 16px; margin-bottom: 12px; -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%); }
.brain-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.brain-btn { font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; padding: 6px 12px; border-radius: 999px; color: var(--blue); background: rgba(10,132,255,0.14); border: 1px solid rgba(10,132,255,0.32); transition: transform 0.1s ease, background 0.2s ease; }
.brain-btn:hover { background: rgba(10,132,255,0.24); }
.brain-btn:active { transform: scale(0.95); }
.brain-btn:disabled { opacity: 0.5; cursor: default; }
.brain-empty { font-size: 13px; color: var(--label-3); margin-top: 8px; line-height: 1.4; }
.brain-objective { font-size: 13.5px; font-weight: 600; margin-top: 10px; line-height: 1.35; }
.brain-ws { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.brain-ws-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.brain-ws-title { font-size: 12.5px; color: var(--label-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brain-chip { flex: none; font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 999px; color: var(--blue-2); background: rgba(10,132,255,0.14); text-transform: lowercase; }
.brain-stats { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; }
.brain-stat { font-size: 11.5px; color: var(--label-2); }

/* ============ Toasts ============ */
/* Lifted above the bottom floating nav so toasts never hide behind it. */
.toasts { position: fixed; z-index: 40; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom, 0px) + var(--nav-h) + 26px); display: flex; flex-direction: column; gap: 8px; width: min(540px, calc(100% - 28px)); pointer-events: none; }
.toast { align-self: center; max-width: 100%; background: var(--glass-strong); -webkit-backdrop-filter: blur(28px) saturate(200%); backdrop-filter: blur(28px) saturate(200%); border: 1px solid var(--hair); border-radius: 16px; padding: 11px 15px; font-size: 13.5px; color: var(--label); display: flex; align-items: center; gap: 9px; box-shadow: 0 8px 30px rgba(0,0,0,0.5); animation: toastin 0.3s cubic-bezier(0.22,1,0.36,1); }
.toast.out { animation: toastout 0.3s ease forwards; }
.toast-ico { font-size: 16px; }
@keyframes toastin { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes toastout { to { opacity: 0; transform: translateY(12px); } }

/* ============ Live activity banners (iOS notification style) ============ */
/* Agent messages sent/received drop in at the VERY top — in front of (and above) the floating
   title + bell (z-index 38 > the topbar's 30) — stack, and auto-dismiss, so you can SEE Prime
   working the network. They cover the title row only for their ~1.9s life, then clear it. */
.banners {
  position: fixed; z-index: 38; left: 50%; transform: translateX(-50%);
  top: calc(env(safe-area-inset-top, 0px) + 6px);
  width: min(520px, calc(100% - 24px)); height: 0; pointer-events: none;
}
/* Banners pile on top of each other with a small décalage (iOS collapsed-stack look):
   newest in front, older ones peeking out behind, scaled + dimmed. Position + opacity are
   driven from JS (layoutBanners) and transition smoothly. */
.banner {
  --ban-ring: rgba(255,255,255,0.34); --ban-glow: rgba(120,160,255,0.28);
  position: absolute; top: 0; left: 0; right: 0;
  pointer-events: auto; cursor: pointer; display: flex; align-items: center; gap: 11px;
  background: var(--glass-strong); -webkit-backdrop-filter: blur(30px) saturate(200%); backdrop-filter: blur(30px) saturate(200%);
  border: 1px solid var(--ban-ring); border-radius: 18px; padding: 9px 13px 9px 10px;
  box-shadow: 0 14px 36px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.1), 0 0 0 1px var(--ban-ring), 0 0 18px 2px var(--ban-glow);
  transform-origin: top center; will-change: transform, opacity;
  transition: transform 0.34s cubic-bezier(0.22,1,0.36,1), opacity 0.3s ease;
  animation: banGlow 1.8s ease-in-out infinite;
}
/* Glowing border, direction-tinted: blue when Prime is sending ↑, green when a reply lands ↓. */
.banner.sent { --ban-ring: rgba(10,132,255,0.82); --ban-glow: rgba(10,132,255,0.55); }
.banner.recv { --ban-ring: rgba(48,209,88,0.82); --ban-glow: rgba(48,209,88,0.55); }
@keyframes banGlow {
  0%, 100% { box-shadow: 0 14px 36px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.1), 0 0 0 1px var(--ban-ring), 0 0 16px 1px var(--ban-glow); }
  50%      { box-shadow: 0 14px 36px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.1), 0 0 0 1.5px var(--ban-ring), 0 0 32px 6px var(--ban-glow); }
}
@media (prefers-reduced-motion: reduce) { .banner { animation: none; } }
.banner .avatar.sm { flex: none; }
.ban-mid { flex: 1; min-width: 0; }
.ban-top { display: flex; align-items: center; gap: 6px; }
.ban-dir { font-size: 13px; font-weight: 800; line-height: 1; }
.banner.sent .ban-dir { color: var(--blue-2); }
.banner.recv .ban-dir { color: var(--green); }
.ban-name { font-size: 13px; font-weight: 700; color: var(--label); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ban-now { margin-left: auto; flex: none; font-size: 10.5px; color: var(--sub, rgba(235,235,245,0.5)); }
.ban-body { font-size: 12.5px; color: var(--sub, rgba(235,235,245,0.62)); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ============ Team onboarding — invite card (settings) ============ */
.invite-card {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; cursor: pointer;
  background: linear-gradient(140deg, rgba(10,132,255,0.20), rgba(94,92,230,0.16));
  border: 1px solid rgba(64,156,255,0.42); border-radius: 18px; padding: 16px;
  margin-bottom: 18px; font: inherit; color: var(--label);
  -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 8px 28px rgba(10,132,255,0.18), inset 0 1px 0 rgba(255,255,255,0.08);
  transition: transform 0.1s ease;
}
.invite-card:active { transform: scale(0.99); }
.invite-ico { flex: none; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 23px; background: rgba(255,255,255,0.12); border: 1px solid var(--hair); }
.invite-mid { flex: 1; min-width: 0; }
.invite-title { font-size: 16px; font-weight: 700; }
.invite-sub { font-size: 12.5px; color: var(--label-2); margin-top: 3px; line-height: 1.35; }
.invite-arrow { flex: none; color: var(--blue-2); }
.invite-arrow svg { width: 22px; height: 22px; }

/* ============ Login — single-owner magic-link gate (shown INSTEAD of the app) ============ */
body.login-mode { background: var(--bg); }
.login {
  position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center;
  padding: calc(env(safe-area-inset-top, 0px) + 24px) 22px calc(env(safe-area-inset-bottom, 0px) + 24px);
}
.login-card {
  width: 100%; max-width: 380px; display: flex; flex-direction: column;
  animation: pop 0.32s cubic-bezier(0.22,1,0.36,1);
}
.login-brand { font-size: 15px; font-weight: 300; letter-spacing: 0.04em; color: var(--blue-2); text-transform: uppercase; margin-bottom: 18px; }
.login-title { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.login-sub { font-size: 13.5px; color: var(--label-2); margin: 8px 0 20px; line-height: 1.45; }
.login-input {
  width: 100%; font: inherit; font-size: 17px; color: var(--label);
  background: rgba(118,118,128,0.18); border: 1px solid var(--hair); border-radius: 16px;
  padding: 15px 16px; outline: none; transition: border-color 0.18s ease, background 0.18s ease;
}
.login-input:focus { border-color: rgba(64,156,255,0.6); background: rgba(118,118,128,0.24); }
.login-input::placeholder { color: var(--label-3); }
.login-input:disabled { opacity: 0.6; }
.login-note { font-size: 13px; color: var(--label-2); margin: 6px 2px 2px; min-height: 18px; line-height: 1.35; }
.login-note.err { color: var(--red); }
.login-btn {
  font: inherit; font-size: 16px; font-weight: 600; cursor: pointer; width: 100%; color: #fff;
  background: var(--blue); border: none; border-radius: 16px; padding: 15px 18px; margin-top: 12px;
  box-shadow: 0 8px 24px rgba(10,132,255,0.38); transition: transform 0.1s ease, opacity 0.18s ease;
}
.login-btn:active { transform: scale(0.985); }
.login-btn:disabled { opacity: 0.6; cursor: default; box-shadow: none; }
.login-btn.ghost { color: var(--blue); background: rgba(10,132,255,0.12); border: 1px solid rgba(10,132,255,0.32); box-shadow: none; margin-top: 16px; }

/* ============ Team onboarding — full-screen glass overlay ============ */
.onboard {
  position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(0,0,0,0.55); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  opacity: 0; transition: opacity 0.24s ease;
}
.onboard.show { opacity: 1; }
@media (min-width: 640px) { .onboard { align-items: center; } }
.onboard-sheet {
  width: 100%; max-width: 620px; max-height: 92dvh; display: flex; flex-direction: column;
  background: var(--glass-strong); -webkit-backdrop-filter: blur(34px) saturate(200%); backdrop-filter: blur(34px) saturate(200%);
  border: 1px solid var(--hair); border-radius: 26px 26px 0 0;
  box-shadow: 0 -10px 40px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.08);
  padding: 10px 18px calc(env(safe-area-inset-bottom, 0px) + 18px);
  transform: translateY(28px); transition: transform 0.26s cubic-bezier(0.22,1,0.36,1);
}
.onboard.show .onboard-sheet { transform: none; }
@media (min-width: 640px) { .onboard-sheet { border-radius: 26px; padding-top: 14px; } }
.onboard-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 2px 12px; flex: none; }
.onboard-dots { display: flex; align-items: center; gap: 7px; }
.onboard-dot { width: 22px; height: 5px; border-radius: 999px; background: rgba(118,118,128,0.34); transition: background 0.2s ease, width 0.2s ease; }
.onboard-dot.on { width: 30px; background: var(--blue); box-shadow: 0 0 8px rgba(10,132,255,0.7); }
.onboard-dot.done { background: var(--green); }
.onboard-body { overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.onboard-body::-webkit-scrollbar { width: 0; }

.ob-step { display: flex; flex-direction: column; animation: pop 0.3s cubic-bezier(0.22,1,0.36,1); }
.ob-head { margin: 4px 2px 18px; }
.ob-title { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.ob-sub { font-size: 13.5px; color: var(--label-2); margin-top: 8px; line-height: 1.45; }

.ob-field { margin-bottom: 10px; }
.ob-input {
  width: 100%; font: inherit; font-size: 18px; color: var(--label);
  background: rgba(118,118,128,0.18); border: 1px solid var(--hair); border-radius: 16px;
  padding: 15px 16px; outline: none; transition: border-color 0.18s ease, background 0.18s ease;
}
.ob-input:focus { border-color: rgba(64,156,255,0.6); background: rgba(118,118,128,0.24); }
.ob-input::placeholder { color: var(--label-3); }
.ob-code { text-align: center; letter-spacing: 0.5em; font-size: 26px; font-weight: 700; padding-left: 0.5em; }
/* invite role chips (who are you inviting?) */
.ob-roles { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 4px; }
.ob-role-chip {
  font: inherit; font-size: 14px; font-weight: 500; color: var(--label-2); cursor: pointer;
  background: rgba(118,118,128,0.18); border: 1px solid var(--hair); border-radius: 999px; padding: 8px 14px;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.ob-role-chip.on { background: var(--blue); border-color: transparent; color: #fff; }
.ob-role-chip:active { transform: scale(0.96); }

.ob-textarea {
  width: 100%; min-height: 132px; resize: vertical; font: inherit; font-size: 15px; line-height: 1.5; color: var(--label);
  background: rgba(118,118,128,0.18); border: 1px solid var(--hair); border-radius: 16px; padding: 14px 16px; outline: none;
}
.ob-textarea:focus { border-color: rgba(64,156,255,0.6); }
.ob-textarea::placeholder { color: var(--label-3); }

.ob-note { font-size: 13px; color: var(--label-2); margin: 6px 2px 2px; min-height: 18px; line-height: 1.35; }
.ob-note.ok { color: var(--green); }
.ob-note.err { color: var(--red); }

.ob-btn {
  font: inherit; font-size: 16px; font-weight: 600; cursor: pointer; width: 100%;
  padding: 15px 18px; border-radius: 16px; margin-top: 12px; transition: transform 0.1s ease, background 0.18s ease;
}
.ob-btn:active { transform: scale(0.985); }
.ob-btn.primary { color: #fff; background: var(--blue); border: none; box-shadow: 0 8px 24px rgba(10,132,255,0.38); }
.ob-btn.primary:disabled { opacity: 0.6; cursor: default; box-shadow: none; }
.ob-btn.ghost { color: var(--blue); background: rgba(10,132,255,0.12); border: 1px solid rgba(10,132,255,0.32); margin-top: 10px; }

.ob-group-title { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--label-3); margin: 16px 4px 8px; }
.ob-list { display: flex; flex-direction: column; gap: 8px; }
.ob-contact {
  display: flex; align-items: center; gap: 12px; background: var(--glass); border: 1px solid var(--hair);
  border-radius: 16px; padding: 10px 12px;
  -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
}
.ob-contact-mid { flex: 1; min-width: 0; }
.ob-contact-name { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ob-contact-phone { font-size: 12px; color: var(--label-2); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ob-invite-btn {
  flex: none; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; padding: 8px 14px; border-radius: 999px;
  color: var(--green); background: rgba(48,209,88,0.16); border: 1px solid rgba(48,209,88,0.42); transition: transform 0.1s ease;
}
.ob-invite-btn:active { transform: scale(0.95); }
.ob-invite-btn.done { color: var(--label-2); background: rgba(118,118,128,0.18); border-color: var(--hair); cursor: default; }
.ob-empty { font-size: 14px; color: var(--label-2); text-align: center; padding: 18px; }

/* ============ Comment sheet (feed cards) — slides up from the bottom, iOS sheet style ============ */
.comment-sheet {
  position: fixed; inset: 0; z-index: 54; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(0,0,0,0.55); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  opacity: 0; transition: opacity 0.24s ease;
}
.comment-sheet.show { opacity: 1; }
.cm-sheet {
  width: 100%; max-width: 620px; height: 74dvh; display: flex; flex-direction: column;
  background: var(--glass-strong); -webkit-backdrop-filter: blur(34px) saturate(200%); backdrop-filter: blur(34px) saturate(200%);
  border: 1px solid var(--hair); border-bottom: none; border-radius: 24px 24px 0 0;
  box-shadow: 0 -18px 50px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.08);
  padding: 10px 14px calc(env(safe-area-inset-bottom, 0px) + 10px);
  transform: translateY(100%); transition: transform 0.3s cubic-bezier(0.22,1,0.36,1);
}
.comment-sheet.show .cm-sheet { transform: none; }
.cm-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 2px 10px; flex: none; position: relative; }
.cm-head::before { content: ''; position: absolute; top: -4px; left: 50%; transform: translateX(-50%); width: 38px; height: 4px; border-radius: 999px; background: var(--hair); }
.cm-title { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.cm-list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; display: flex; flex-direction: column; gap: 12px; padding: 6px 2px; }
.cm-list::-webkit-scrollbar { width: 0; }
.cm-loading { font-size: 13.5px; color: var(--label-3); text-align: center; padding: 22px; }
.cm-empty { margin: auto; text-align: center; color: var(--label-3); padding: 30px 20px; font-size: 14px; }
.cm-empty-ico { font-size: 28px; margin-bottom: 8px; opacity: 0.7; }
.cm-row { display: flex; align-items: flex-start; gap: 10px; animation: pop 0.26s cubic-bezier(0.22,1,0.36,1); }
.cm-row.cm-in { animation: cmin 0.28s cubic-bezier(0.22,1,0.36,1); }
@keyframes cmin { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.cm-row.cm-failed { opacity: 0.5; }
.cm-mid { flex: 1; min-width: 0; background: rgba(118,118,128,0.16); border: 1px solid var(--hair-soft); border-radius: 16px; padding: 9px 12px; }
.cm-top { display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px; }
.cm-name { font-size: 13px; font-weight: 700; }
.cm-time { font-size: 11px; color: var(--label-3); }
.cm-text { font-size: 14.5px; line-height: 1.42; color: var(--label); white-space: pre-wrap; word-wrap: break-word; }
.cm-composer { flex: none; display: flex; align-items: center; gap: 8px; padding-top: 8px; }
.cm-input { flex: 1; font: inherit; font-size: 15px; color: var(--label); background: rgba(118,118,128,0.18); border: 1px solid var(--hair); border-radius: 999px; padding: 11px 16px; outline: none; }
.cm-input:focus { border-color: rgba(64,156,255,0.6); }
.cm-input::placeholder { color: var(--label-3); }
.cm-send { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--blue); border: none; color: #fff; cursor: pointer; transition: transform 0.12s ease; box-shadow: 0 6px 22px rgba(10,132,255,0.4); }
.cm-send:active { transform: scale(0.9); }
.cm-send .ic { width: 19px; height: 19px; fill: none; }
