/* Prime AI — iOS 26 dark. Minimal top bar + top-right nav (no bottom bar).
 * Pure black (no gradient), thin type, translucent glass, iMessage bubbles, x.com 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-space: calc(env(safe-area-inset-bottom, 0px) + 12px);
  --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 10px;
  background: transparent; pointer-events: none;
}
.brand, .topnav { pointer-events: auto; }
/* iOS 26 floating glass pills */
.brand {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  height: var(--pill-h); padding: 0 16px; 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);
}
.brand-spark { width: 17px; height: 17px; flex: none; fill: var(--blue-2); }
.brand-name { font-size: 17px; font-weight: 300; letter-spacing: 0.01em; color: var(--label); }
.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; } }

.topnav {
  display: flex; align-items: center; gap: 2px; height: var(--pill-h); padding: 0 6px; 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);
}
.nav-ic {
  position: relative;
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: transparent; border: none; cursor: pointer; color: var(--label-2);
  transition: color 0.18s ease, background 0.18s ease, transform 0.1s ease;
}
/* unseen-activity dot + blink on new activity in a section */
.nav-ic.has-activity::after {
  content: ''; position: absolute; top: 3px; right: 3px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--blue); box-shadow: 0 0 6px rgba(10,132,255,0.9);
}
.nav-ic.pulse { animation: navpulse 0.9s ease; }
@keyframes navpulse {
  0%   { transform: scale(1); color: var(--label-2); }
  35%  { transform: scale(1.22); color: var(--blue); filter: drop-shadow(0 0 6px rgba(10,132,255,0.8)); }
  100% { transform: scale(1); }
}
.nav-ic svg { width: 21px; height: 21px; fill: currentColor; }
.nav-ic:active { transform: scale(0.92); }
.nav-ic.active { color: var(--blue); background: rgba(10, 132, 255, 0.14); }

/* ============ 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.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; }

/* ============ 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 ============ */
.conv-list { flex: 1; min-height: 0; overflow-y: auto; padding: var(--top-space) 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; }
.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); }

/* ============ Updates — Instagram-style feed ============ */
.feed { flex: 1; min-height: 0; overflow-y: auto; padding-top: var(--top-space); padding-bottom: var(--bottom-space); }
.ig-post { border-bottom: 1px solid var(--hair-soft); padding-bottom: 8px; animation: pop 0.3s cubic-bezier(0.22,1,0.36,1); }
.ig-head { display: flex; align-items: center; gap: 10px; padding: 11px 14px; }
.ig-hmid { flex: 1; min-width: 0; }
.ig-name { font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ig-loc { font-size: 12px; color: var(--label-2); text-transform: lowercase; }
.ig-time { font-size: 12px; color: var(--label-3); flex: none; }
.ig-media { position: relative; aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center; padding: 30px 24px; text-align: center; overflow: hidden; }
.ig-media::after { content: ''; position: absolute; inset: 0; background: radial-gradient(120% 80% at 50% 0%, rgba(255,255,255,0.18), transparent 60%); pointer-events: none; }
.ig-media.ft-update { background: linear-gradient(140deg, #0a84ff, #5e5ce6); }
.ig-media.ft-deal { background: linear-gradient(140deg, #30d158, #0a9e6a); }
.ig-media.ft-milestone { background: linear-gradient(140deg, #5e5ce6, #bf5af2); }
.ig-media.ft-delivery { background: linear-gradient(140deg, #ff375f, #ff9f0a); }
.ig-directive { position: relative; z-index: 1; color: #fff; font-size: 20px; font-weight: 700; line-height: 1.32; letter-spacing: -0.01em; text-shadow: 0 1px 16px rgba(0,0,0,0.25); display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.ig-type { position: absolute; z-index: 2; top: 12px; left: 12px; font-size: 10.5px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: #fff; background: rgba(0,0,0,0.26); padding: 4px 10px; border-radius: 999px; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.ig-actions { display: flex; align-items: center; gap: 16px; padding: 12px 14px 2px; color: var(--label); }
.ig-ic { width: 25px; height: 25px; fill: none; transition: transform 0.1s ease; }
.ig-actions .ig-ic:active { transform: scale(0.85); }
.ig-spacer { flex: 1; }

/* ============ 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 ============ */
.toasts { position: fixed; z-index: 40; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom, 0px) + 18px); 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 top, stack, and auto-dismiss — so you can SEE
   Prime working the network. Sits just below the floating top pills; never blocks taps. */
.banners {
  position: fixed; z-index: 38; left: 50%; transform: translateX(-50%);
  top: calc(env(safe-area-inset-top, 0px) + 66px);
  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 {
  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(--hair); border-radius: 18px; padding: 9px 13px 9px 10px;
  box-shadow: 0 12px 34px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,255,255,0.08);
  transform-origin: top center; will-change: transform, opacity;
  transition: transform 0.34s cubic-bezier(0.22,1,0.36,1), opacity 0.3s ease;
}
.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; }
