/* OCA Team Dashboard - Claude-style chat interface
   Brand source: /home/ocm/docs/theme/Now Presenting You Branding 2023.pdf
   Layout: 3-screen shell (Chat / Feed / Settings), bottom-nav, mobile-first */

/* v1.5 P1.T5: Decisions slideshow styles */
@import "./decisions.css";

:root {
  --burgundy: #9F0A37;
  --navy: #283044;
  --teal: #17A398;
  --teal-deep: #128277;
  --teal-soft: #d4efed;
  --orange: #EF7B45;
  --orange-deep: #EE6528;
  --off-white: #F4F3EE;

  --bg: #F8F7F2;
  --surface: #FFFFFF;
  --surface-2: #FAF9F5;
  --surface-hover: #F2F1EC;
  --border: rgba(40, 48, 68, 0.10);
  --border-strong: rgba(40, 48, 68, 0.22);

  --text: var(--navy);
  --text-muted: rgba(40, 48, 68, 0.62);
  --text-subtle: rgba(40, 48, 68, 0.45);
  --on-primary: #FFFFFF;

  --success: #30CA30;
  --warning: var(--orange);
  --error: var(--burgundy);

  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Roboto Condensed", "Inter", system-ui, sans-serif;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 3px rgba(40, 48, 68, 0.06);
  --shadow-md: 0 4px 14px rgba(40, 48, 68, 0.08);
  --shadow-lg: 0 8px 28px rgba(40, 48, 68, 0.12);

  --topbar-h: 64px;
  --bottom-nav-h: 64px;
  --composer-max: 820px;
  --sidebar-w: 280px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body { overscroll-behavior: none; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 0;
}

h1 { font-size: 22px; }
h2 { font-size: 18px; }
h3 { font-size: 16px; }
h4 { font-size: 15px; }

p { margin: 0; }

button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: transparent; }

a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }

.eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 600;
}

.section-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 6px;
}

.summary-copy {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.55;
}

.app-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  /* 100dvh accounts for mobile browser chrome appearing/disappearing */
  height: 100dvh;
  width: 100%;
  background: var(--bg);
  overflow: hidden;
}

.app-statusbar { display: none; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: var(--topbar-h);
  padding: 14px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-sizing: border-box;
}

.topbar h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  font-family: var(--font-body);
  letter-spacing: 0;
}

.topbar .eyebrow { display: none; }

.topbar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.connection-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 500;
  background: var(--teal-soft);
  color: var(--teal-deep);
  border: 1px solid rgba(23, 163, 152, 0.22);
}

.connection-chip[data-state="online"] { background: var(--teal-soft); color: var(--teal-deep); }
.connection-chip[data-state="offline"] { background: #fff5e6; color: var(--orange-deep); border-color: rgba(239, 123, 69, 0.3); }
.connection-chip.subtle { background: var(--surface-2); color: var(--text-subtle); border-color: var(--border); }

.screens { flex: 1; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.screen { display: none; flex: 1; flex-direction: column; min-height: 0; padding-bottom: calc(var(--bottom-nav-h) + 8px); }
.screen.active { display: flex; }

.workspace { flex: 1; display: flex; flex-direction: row; min-height: 0; }

.sidebar {
  display: none;
  width: var(--sidebar-w);
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  background: var(--surface-2);
  overflow-y: auto;
}
.sidebar.open { display: flex; flex-direction: column; }

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}
.sidebar-head h2 { font-size: 14px; font-family: var(--font-body); font-weight: 600; margin: 0; }

/* Sections stacked in the sidebar — separated by a visible divider so each section reads as its own block. */
.thread-section {
  padding: 14px 8px 12px;
  border-bottom: 1px solid var(--border);
}
.thread-section:last-of-type { border-bottom: 0; }

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px 8px;
  margin-bottom: 6px;
  border-bottom: 1px dashed var(--border);
}
.section-header .section-label {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: 0.08em;
}

.pill {
  min-width: 22px;
  height: 20px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--teal);
  color: var(--on-primary);
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
}
.pill.subtle { background: var(--surface-hover); color: var(--text-muted); }

.thread-list { display: flex; flex-direction: column; gap: 2px; }

.thread-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.12s;
  border-left: 3px solid transparent;
}
.thread-item:hover { background: var(--surface-hover); }
.thread-item.active { background: var(--teal-soft); border-left-color: var(--teal); }
.thread-item.team { border-left-color: var(--burgundy); }
.thread-item.team:hover { background: rgba(159, 10, 55, 0.05); }

/* Condensed single-line thread row (used in sidebar) */
.thread-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: transparent;
  border: 0;
  border-left: 3px solid transparent;
  width: 100%;
  text-align: left;
  transition: background 0.12s;
  min-height: 0;
  color: var(--text);
  font: inherit;
}
.thread-row:hover { background: var(--surface-hover); }
.thread-row.active {
  background: var(--teal-soft);
  border-left-color: var(--teal);
}
.thread-row.team { border-left-color: var(--burgundy); }
.thread-row.team:hover { background: rgba(159, 10, 55, 0.05); }

.thread-row .avatar {
  width: 20px; height: 20px;
  font-size: 10px;
  flex-shrink: 0;
}

.thread-row-title {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.3;
}

.thread-role-prefix {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.thread-row .unread-pill {
  min-width: 18px;
  height: 16px;
  padding: 0 6px;
  background: var(--teal);
  color: var(--on-primary);
  border-radius: var(--radius-pill);
  font-size: 10px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Delete × on user-owned thread rows. Visible on hover so it doesn't add visual clutter. */
.thread-row-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: var(--text-subtle);
  background: transparent;
  font-size: 16px;
  line-height: 1;
  font-weight: 400;
  margin-left: 6px;
  flex-shrink: 0;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s, background 0.12s, color 0.12s;
}
.thread-row:hover .thread-row-delete,
.thread-row.active .thread-row-delete { opacity: 1; }
.thread-row-delete:hover {
  background: var(--burgundy);
  color: #FFFFFF;
}

.thread-row-overflow {
  display: block;
  width: 100%;
  padding: 10px 12px;
  margin-top: 8px;
  border: 1px solid var(--teal);
  border-radius: var(--radius-pill);
  background: var(--teal-soft);
  color: var(--teal-deep);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.thread-row-overflow:hover {
  background: var(--teal);
  color: #FFFFFF;
  border-color: var(--teal);
}
.thread-row-overflow.subtle {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}
.thread-row-overflow.subtle:hover {
  background: var(--surface-hover);
  color: var(--text);
}

/* Specialists section — power-user persona roster (all 8 personas) */
.specialists-section { padding: 12px 8px 8px; }
.specialists-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 6px 8px;
  margin: 0 0 4px;
  background: transparent;
  border: 0;
  cursor: pointer;
  text-align: left;
  color: var(--text-muted);
  font: inherit;
}
.specialists-toggle:hover { color: var(--text); }
.specialists-toggle .section-label { margin: 0; }
.specialists-chevron {
  font-size: 10px;
  color: var(--text-subtle);
  transition: color 0.12s;
}
.specialists-toggle:hover .specialists-chevron { color: var(--text-muted); }

.specialists-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.specialist-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  width: 100%;
  text-align: left;
  cursor: pointer;
  color: var(--text);
  font: inherit;
  transition: background 0.12s;
}
.specialist-row:hover { background: var(--surface-hover); }

.specialist-row.front { padding: 8px 10px; }
.specialist-row.back { opacity: 0.82; padding: 8px 10px; }
.specialist-row.back:hover { opacity: 1; }

.specialist-row .avatar { flex-shrink: 0; }

/* Keep the list visually uniform — no divider between front-/back-of-house rows. */
.specialist-row.front + .specialist-row.back {
  border-top: 0;
  margin-top: 0;
  padding-top: 8px;
}

/* Hide "Discuss this" button inside the chat panel — only makes sense in the feed */
#message-panel .discuss-row { display: none; }

.specialist-name {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}
/* Back-row names use the same size as front — keeps the list visually uniform. */
.specialist-row.back .specialist-name {
  font-size: 13px;
  font-weight: 500;
}
.specialist-role {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.thread-item-title {
  font-size: 14px; font-weight: 500; color: var(--text); line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.thread-item-meta { font-size: 11px; color: var(--text-muted); }

.sidebar-footer {
  margin-top: auto;
  padding: 16px;
  border-top: 2px solid var(--border-strong);
  background: var(--surface);
  font-size: 12px;
}
.signed-in-user { font-size: 13px; font-weight: 500; color: var(--text); margin-top: 4px; }
.role-chip {
  display: inline-block;
  padding: 1px 8px;
  margin-left: 6px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  vertical-align: middle;
}
.role-chip-operator {
  background: var(--burgundy, #9F0A37);
  color: #fff;
}
.sidebar-footer-actions { display: flex; gap: 8px; margin-top: 10px; }

.panel { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); }
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.panel-head h2 { font-size: 15px; font-family: var(--font-body); font-weight: 600; margin: 0; }
.panel-head .eyebrow { display: none; }
.panel-meta { display: flex; align-items: center; gap: 10px; }
.thread-status { font-size: 11px; color: var(--text-subtle); }

.feed-banner {
  padding: 8px 16px;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 12px;
  border-bottom: 1px solid var(--border);
  display: none;
}
.feed-banner.visible { display: block; }

.message-panel {
  flex: 1;
  overflow-y: auto;
  padding: 24px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.empty-state {
  text-align: center;
  max-width: 380px;
  margin: auto;
  padding: 40px 16px;
  color: var(--text-muted);
}
.empty-state h3 { color: var(--text); margin-bottom: 8px; font-size: 18px; font-family: var(--font-display); }

.welcome-state {
  max-width: 560px;
  margin: auto;
  padding: 40px 16px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}
.welcome-avatar { margin-bottom: 4px; }
.welcome-heading {
  font-size: 22px;
  font-family: var(--font-display);
  color: var(--text);
  letter-spacing: -0.01em;
  margin: 0;
}
.welcome-copy {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.55;
  max-width: 440px;
  margin: 0;
}
.welcome-suggestions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 420px;
  margin-top: 12px;
}
.suggestion-chip {
  padding: 11px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  transition: background 0.12s, border-color 0.12s;
  cursor: pointer;
}
.suggestion-chip:hover {
  background: var(--teal-soft);
  border-color: var(--teal);
}

.message {
  display: flex;
  gap: 12px;
  max-width: var(--composer-max);
  margin: 0 auto;
  width: 100%;
}
.message.user { flex-direction: row-reverse; }

.message-avatar {
  flex-shrink: 0;
  width: 32px; height: 32px;
  border-radius: var(--radius-pill);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 13px;
  color: var(--on-primary);
  background: var(--teal);
}
.message.user .message-avatar { background: var(--navy); }

.message-body { flex: 1; min-width: 0; max-width: 680px; }
.message-author { font-size: 13px; font-weight: 600; margin-bottom: 4px; font-family: var(--font-body); }
.message.user .message-author { text-align: right; }

.message-bubble {
  padding: 12px 14px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 15px; line-height: 1.55;
  color: var(--text);
  word-wrap: break-word;
  box-shadow: var(--shadow-sm);
}
.message.user .message-bubble { background: var(--navy); color: var(--on-primary); border-color: var(--navy); }
.message.team .message-bubble { border-left: 3px solid var(--burgundy); }

.message-timestamp { font-size: 11px; color: var(--text-subtle); margin-top: 4px; }
.message.user .message-timestamp { text-align: right; }

/* Chat message cards — user vs assistant visually distinct (Ask-AI style).
   User: right-aligned, navy bubble, white text.
   Assistant: left-aligned, surface bubble with persona-coloured accent. */
.message-card {
  position: relative;
  max-width: min(var(--composer-max), calc(100% - 48px));
  margin: 0 0 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  width: fit-content;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.message-card.user {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--on-primary);
  margin-left: auto;
  margin-right: 0;
  border-top-right-radius: 4px;
}
.message-card.user .author-name,
.message-card.user .author-meta,
.message-card.user .message-body { color: var(--on-primary); }
.message-card.team,
.message-card.assistant {
  margin-left: 0;
  margin-right: auto;
  border-left: 3px solid var(--burgundy);
  border-top-left-radius: 4px;
}
.message-card.failed { border-color: var(--error); }

/* Typing indicator — immediate feedback after submit, shown until reply arrives. */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 auto 16px 0;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--teal);
  border-radius: var(--radius-lg);
  border-top-left-radius: 4px;
  box-shadow: var(--shadow-sm);
  width: fit-content;
  max-width: min(var(--composer-max), calc(100% - 48px));
}
.typing-indicator .avatar { flex-shrink: 0; }
.typing-label {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 4px;
  font-style: italic;
}
.typing-dots {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}
.typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal);
  opacity: 0.4;
  animation: typing-bounce 1.2s infinite ease-in-out;
}
.typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.typing-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.card-accent { display: none; }

.message-top,
.author-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.author-row .avatar { flex-shrink: 0; }
.author-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  margin: 0;
  line-height: 1.2;
}
.message-card.user .author-name { color: var(--on-primary); }
.author-meta {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: 0;
  margin: 2px 0 0;
}
.message-card.user .author-meta { color: rgba(255,255,255,0.7); }

.message-body {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--text);
}
.message-body p { margin: 0 0 8px; }
.message-body p:last-child { margin-bottom: 0; }
.message-body .rich-block { margin: 0 0 8px; }
.message-body .rich-block:last-child { margin-bottom: 0; }
.message-body .rich-h3 { font-size: 16px; font-weight: 600; color: var(--text); margin: 14px 0 4px; }
.message-body .rich-h4 { font-size: 15px; font-weight: 600; color: var(--text); margin: 12px 0 3px; }
.message-body .rich-hr { border: none; border-top: 1px solid var(--border); margin: 14px 0; }
.message-body .rich-list { margin: 6px 0 10px 18px; padding: 0; }
.message-body .rich-list li { margin: 2px 0; }
.message-body pre { background: var(--surface-2); padding: 8px 10px; border-radius: var(--radius-sm); overflow-x: auto; font-size: 12px; margin: 6px 0; }
.message-body code { background: var(--surface-2); padding: 1px 4px; border-radius: 3px; font-size: 12px; }

.card-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.card-kicker {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--teal);
  font-weight: 600;
  margin: 0 0 2px;
}
.card-title {
  font-size: 15px;
  font-family: var(--font-body);
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  margin: 8px 0;
}
.metric-card {
  padding: 8px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.metric-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
}
.metric-value {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-top: 2px;
}

.action-row, .discuss-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.thread-tag,
.status-pill {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  font-weight: 500;
  background: var(--surface-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.badge-pill { margin-left: auto; }

.persona-chip-role {
  opacity: 0.65;
  font-weight: 400;
  font-size: 12px;
}

/* Expand button for collapsed card details */
.expand-button {
  padding: 5px 10px;
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
}
.expand-button:hover { background: var(--surface-hover); }

.card-expandable {
  margin-top: 8px;
  padding: 10px 12px;
  background: var(--surface-2);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--text-muted);
  border-left: 2px solid var(--border-strong);
}

.composer {
  position: sticky;
  bottom: 0;
  background: var(--bg);
  padding: 12px 16px 16px;
  border-top: 1px solid var(--border);
}
.composer-label { display: none; }

.composer-row {
  max-width: var(--composer-max);
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 8px 8px 8px 14px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.12s, box-shadow 0.12s;
}
.composer-row:focus-within {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(23, 163, 152, 0.12);
}

.composer textarea {
  flex: 1;
  resize: none;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 15px;
  line-height: 1.5;
  max-height: 140px;
  padding: 6px 0;
  color: var(--text);
}
.composer textarea::placeholder { color: var(--text-subtle); }

.composer #send-btn {
  flex-shrink: 0;
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  background: var(--teal);
  color: var(--on-primary);
  font-weight: 600; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.12s;
}
.composer #send-btn:hover:not(:disabled) { background: var(--teal-deep); }
.composer #send-btn:disabled { background: var(--surface-hover); color: var(--text-subtle); cursor: not-allowed; }

.composer-meta {
  max-width: var(--composer-max);
  margin: 6px auto 0;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-subtle);
}

/* Feed screen — fill the shell between top and bottom bars, cap reading width at 760. */
.feed-screen {
  padding: 20px 24px 24px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.feed-header { width: 100%; margin: 0 0 16px; }
.feed-header h2 { font-size: 22px; margin-bottom: 4px; }
.feed-list { width: 100%; display: flex; flex-direction: column; gap: 12px; }

/* Priorities (v1.5) */
/* Priorities / Steering (v1.5 redesign) — chat-like reading column with intro card */
.steering-screen {
  padding: 20px 24px 24px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.steering-body {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.steering-header { width: 100%; margin: 0; }
.steering-header h2 { font-size: 22px; margin-bottom: 4px; }
.priorities-intro-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  box-shadow: var(--shadow-sm);
}
.priorities-intro-card h3 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.priorities-intro-card ul {
  margin: 0;
  padding-left: 20px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.55;
}
.priorities-intro-card li + li { margin-top: 4px; }
.priorities-list {
  width: 100%;
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.priorities-list:empty { display: none; }
.priority-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.priority-row:last-child { border-bottom: none; }
.priority-position {
  color: var(--text-muted);
  font-weight: 600;
  min-width: 24px;
  font-variant-numeric: tabular-nums;
}
.priority-text {
  flex: 1;
  outline: none;
  padding: 4px 6px;
  border-radius: 4px;
  color: var(--text);
  line-height: 1.45;
}
.priority-text:focus { background: var(--surface-hover); }
.priority-delete {
  border: none;
  background: transparent;
  color: var(--text-subtle);
  font-size: 20px;
  cursor: pointer;
  padding: 0 8px;
  line-height: 1;
}
.priority-delete:hover { color: var(--danger, #c43); }
.priorities-add-row {
  display: flex;
  gap: 8px;
  width: 100%;
  margin: 0;
}
.priorities-add-row input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
}
.priorities-add-row input:focus {
  outline: none;
  border-color: var(--teal, #1d7a76);
}
.priorities-footer-hint {
  color: var(--text-muted);
  font-size: 13px;
  margin: 0;
}
.empty-state-hint {
  color: var(--text-muted);
  font-size: 14px;
  margin: 0;
  padding: 12px 0;
}

.departments-screen {
  padding: 20px 24px 24px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.departments-header {
  width: 100%;
  margin: 0 0 16px;
}

#departments-content {
  width: 100%;
}

.feed-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: box-shadow 0.12s, transform 0.12s;
}
.feed-card:hover { box-shadow: var(--shadow-md); }
.feed-card-head { display: flex; align-items: center; gap: 10px; }
.feed-card-author { flex: 1; }
.feed-card-author-name { font-weight: 600; font-size: 14px; color: var(--text); }
.feed-card-author-role { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.feed-card-timestamp { font-size: 11px; color: var(--text-subtle); }
.feed-card-headline { font-size: 15px; font-weight: 500; color: var(--text); }
.feed-card-summary {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.65;
  white-space: normal;
}
.feed-card-summary .rich-h3 { font-size: 17px; font-weight: 600; color: var(--text); margin: 14px 0 4px; }
.feed-card-summary .rich-h4 { font-size: 16px; font-weight: 600; color: var(--text); margin: 12px 0 3px; }
.feed-card-summary .rich-hr { border: none; border-top: 2px solid var(--border-strong); margin: 18px 0 18px; }
.feed-card-summary .rich-list { margin: 8px 0 14px 18px; padding: 0; }
.feed-card-summary .rich-list li { margin: 2px 0; }
.feed-card-summary pre { background: var(--surface-2); padding: 8px 10px; border-radius: var(--radius-sm); overflow-x: auto; font-size: 12px; margin: 6px 0; }
.feed-card-summary code { background: var(--surface-2); padding: 1px 4px; border-radius: 3px; font-size: 12px; }
.feed-card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}
.feed-card-actions .pill,
.feed-card-actions .pill-new {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 12px;
}

/* Branded primary action on feed cards. */
.discuss-now-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 14px;
  background: var(--orange);
  color: #FFFFFF;
  border: 0;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 0.12s, transform 0.12s, box-shadow 0.12s;
  box-shadow: 0 1px 2px rgba(238, 101, 40, 0.2);
}
.discuss-now-btn:hover { background: var(--orange-deep); }
.discuss-now-btn:active { transform: translateY(1px); }

.departments-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
}

.dept-tile {
  min-height: 100%;
}

.dept-tile-focus {
  font-size: 14px;
  color: var(--text);
  line-height: 1.55;
}

.dept-tile-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.metric-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}

/* Feed filter bar — department chips */
.feed-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}
.feed-filter-chip {
  padding: 5px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.feed-filter-chip:hover { border-color: var(--teal); color: var(--teal-deep); }
.feed-filter-chip.active {
  background: var(--teal);
  border-color: var(--teal);
  color: #FFFFFF;
}

/* Day-group headers */
.feed-day-header {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 10px 0 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

/* "New since last visit" divider */
.feed-new-divider {
  font-size: 11px;
  font-weight: 600;
  color: var(--teal-deep);
  text-align: center;
  padding: 6px 0;
  margin: 4px 0 8px;
  border-top: 1px dashed var(--teal);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* New-item dot + subtle card highlight */
.feed-new-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
  margin-right: 6px;
  vertical-align: middle;
}
.feed-card-new { border-left: 3px solid var(--teal); }

.feed-empty { max-width: 420px; margin: 80px auto; text-align: center; color: var(--text-muted); }
.feed-empty h3 { color: var(--text); margin-bottom: 8px; }

/* Settings screen */
.settings-screen { padding: 20px 24px 80px; overflow-y: auto; flex: 1; min-height: 0; }
.settings-list { width: 100%; display: flex; flex-direction: column; gap: 16px; }

.settings-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}
.settings-card h3 { font-family: var(--font-body); font-weight: 600; font-size: 15px; color: var(--text); }

/* Full team roster on Settings page */
.team-roster { display: flex; flex-direction: column; gap: 14px; }
.settings-persona-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.settings-persona-card:last-child { border-bottom: 0; }
.settings-persona-card .avatar { flex-shrink: 0; width: 36px; height: 36px; font-size: 14px; }
.settings-persona-detail { flex: 1; min-width: 0; }
.settings-persona-name { font-weight: 600; font-size: 14px; color: var(--text); }
.settings-persona-role { font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.settings-persona-bio { font-size: 13px; color: var(--text-muted); line-height: 1.45; margin-top: 4px; }

/* Dashboard link grid on Settings page */
.dashboard-link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}
.dashboard-link-card {
  display: block;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.dashboard-link-card:hover {
  border-color: var(--teal);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}
.dashboard-link-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
}
.dashboard-link-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

.persona-roster { display: flex; flex-wrap: wrap; gap: 10px; }
.persona-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.avatar {
  width: 28px; height: 28px;
  border-radius: var(--radius-pill);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 12px; color: var(--on-primary);
}
.avatar-sm { width: 22px; height: 22px; font-size: 10px; }
.avatar-lg { width: 48px; height: 48px; font-size: 18px; }
.avatar.marla    { background: var(--teal); }
.avatar.victoria { background: var(--orange); }
.avatar.rex      { background: var(--burgundy); }
/* Behind-the-scenes personas (contributors on feed cards).
   Roles per /home/ocm/personas/configs/*.yaml — authoritative. */
.avatar.wilfred  { background: #198EB3; }   /* CFO — Chief Financial Officer */
.avatar.lucius   { background: #128277; }   /* CTO — Chief Technology Officer */
.avatar.tim      { background: #D49A3F; }   /* Knowledge Director */
.avatar.kai      { background: #6B3A8C; }   /* Brand & Messaging Advisor */
.avatar.jenna    { background: #8B4B6B; }   /* Project Manager */
.avatar.team     { background: var(--navy); }
.avatar.user     { background: var(--navy); }

/* Contributor row — shows behind-the-scenes personas who fed data into this card */
.feed-card-contributors {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
  font-size: 12px;
  color: var(--text-muted);
}
.contributor-stack {
  display: flex;
  align-items: center;
}
.contributor-stack .avatar {
  border: 2px solid var(--surface);
  margin-left: -6px;
  width: 24px; height: 24px;
  font-size: 10px;
}
.contributor-stack .avatar:first-child { margin-left: 0; }
.contributor-label {
  font-size: 12px;
  color: var(--text-muted);
}
.contributor-label strong {
  color: var(--text);
  font-weight: 600;
}

.ios-steps { display: flex; gap: 16px; overflow-x: auto; }
.ios-step { flex-shrink: 0; max-width: 180px; margin: 0; text-align: center; }
.ios-step img { width: 100%; max-width: 140px; border-radius: var(--radius-md); background: var(--surface-2); }
.ios-step figcaption { font-size: 12px; color: var(--text-muted); margin-top: 6px; }

.settings-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Buttons */
.primary-btn {
  padding: 9px 16px;
  border-radius: var(--radius-md);
  background: var(--orange);
  color: var(--on-primary);
  font-weight: 600; font-size: 14px;
  border: 1px solid var(--burgundy);
  transition: background 0.12s;
}
.primary-btn:hover:not(:disabled) { background: var(--orange-deep); }
.primary-btn:disabled { background: var(--surface-hover); color: var(--text-subtle); border-color: var(--border); cursor: not-allowed; }

.ghost-btn {
  padding: 7px 12px;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text);
  font-weight: 500; font-size: 13px;
  border: 1px solid var(--border-strong);
  transition: background 0.12s;
}
.ghost-btn:hover { background: var(--surface-hover); }
.ghost-btn.danger { color: var(--burgundy); border-color: rgba(159, 10, 55, 0.3); }
.ghost-btn.danger:hover { background: rgba(159, 10, 55, 0.06); }

.mobile-only { display: inline-flex; }
@media (min-width: 900px) { .mobile-only { display: none; } }

/* ── OCA v1 Phase 7: 3-button primary nav ──────────────────────────────────── */
.oca-primary-nav {
  display: flex;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: var(--topbar-h);
  z-index: 20;
}
.oca-primary-nav .nav-btn {
  padding: 8px 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.01em;
  color: var(--text-muted);
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.oca-primary-nav .nav-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
}
.oca-primary-nav .nav-btn.active {
  border-color: var(--burgundy);
  background: #fdf2f5;
  color: var(--burgundy);
}

/* OCA v1 Phase 7: Work view sort bar */
.work-sortbar {
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
}
.work-sortbar label { display: flex; align-items: center; gap: 8px; }
.work-sortbar select {
  font-size: 13px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  background: var(--surface);
  color: var(--text);
}

/* OCA v1 Phase 7: Work merged departments feed */
.work-feed { padding: 8px 16px 16px; }
.work-item {
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  margin-bottom: 8px;
}
.work-item-persona {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  color: var(--text-subtle);
  margin-bottom: 2px;
}
.work-item-title {
  font-size: 14px;
  color: var(--text);
  line-height: 1.4;
}
.work-item-ts {
  font-size: 11px;
  color: var(--text-subtle);
  margin-top: 4px;
}

/* OCA v1 Phase 7: provider picker in settings */
.setting-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.setting-row label { font-size: 14px; color: var(--text-muted); }
.setting-row select {
  font-size: 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  background: var(--surface);
  color: var(--text);
}
.provider-status { font-size: 13px; color: var(--text-muted); margin-top: 6px; }

/* OCA v1 Phase 7: legacy nav and screen padding.
   The fixed bottom-nav is replaced by oca-primary-nav in the document flow.
   Remove the extra bottom clearance that was reserved for the old fixed nav. */
.legacy.hidden { display: none !important; }
.screens .screen { padding-bottom: 8px; }

/* Bottom nav */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 30;
  height: var(--bottom-nav-h);
  display: flex;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
  max-width: 1200px;
  margin: 0 auto;
}
/* [hidden] attribute on nav buttons must override display:flex (operator-only gating). */
.bottom-nav button[hidden] { display: none !important; }

.bottom-nav button {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 8px 4px;
  border-top: 3px solid transparent;
  background: transparent;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.bottom-nav button:hover { color: var(--text); background: var(--surface-hover); }
.bottom-nav button .nav-icon { font-size: 22px; line-height: 1; transition: transform 0.15s; }

/* Vertical dividers between buttons for clear delineation. */
.bottom-nav button + button {
  border-left: 1px solid var(--border);
}

/* Active state: bold teal top bar + soft teal-tinted background + teal text. */
.bottom-nav button.active {
  color: var(--teal-deep);
  background: var(--teal-soft);
  border-top-color: var(--teal);
}
.bottom-nav button.active .nav-icon { transform: translateY(-1px); }

/* Modals */
dialog { border: 0; padding: 0; background: transparent; max-width: 100%; }
dialog::backdrop { background: rgba(40, 48, 68, 0.45); backdrop-filter: blur(4px); }

.login-modal, .onboarding-modal { width: min(420px, calc(100vw - 32px)); margin: auto; }

.login-card, .onboarding-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.login-card[hidden], .onboarding-card[hidden] { display: none !important; }
.login-card h2 { font-size: 20px; }

.field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: block;
  margin-bottom: 4px;
}

.login-card input {
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  font-size: 15px;
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.login-card input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(23, 163, 152, 0.12); }

.error-banner {
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: rgba(159, 10, 55, 0.08);
  color: var(--burgundy);
  font-size: 13px;
  border: 1px solid rgba(159, 10, 55, 0.2);
}

/* Magic-link login additions */
#ml-form { display: flex; flex-direction: column; gap: 14px; }
#ml-form input[type="email"] {
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  font-size: 15px;
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
  width: 100%;
}
#ml-form input[type="email"]:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(23, 163, 152, 0.12); }
#ml-btn { display: flex; align-items: center; justify-content: center; gap: 8px; }
.ml-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: ml-spin 0.65s linear infinite;
  flex-shrink: 0;
}
@keyframes ml-spin { to { transform: rotate(360deg); } }
.ml-sent-msg {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}
.ml-sent-msg strong { color: var(--text); }
.ml-toggle-link {
  background: none;
  border: none;
  padding: 0;
  font-size: 13px;
  color: var(--teal);
  cursor: pointer;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.ml-toggle-link:hover { color: var(--teal-deep); }
.ml-resend-btn { font-size: 13px; padding: 6px 14px; margin-top: 10px; }
/* End magic-link additions */

.onboarding-modal { width: min(520px, calc(100vw - 32px)); }
.onboarding-header { text-align: center; margin-bottom: 12px; }
.onboarding-header h2 { font-size: 22px; margin-bottom: 6px; }

.persona-intro-grid { display: flex; flex-direction: column; gap: 10px; }
.persona-intro-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.persona-intro-card h3 { font-size: 15px; font-family: var(--font-body); font-weight: 600; margin-bottom: 2px; }
.persona-intro-card .role {
  font-size: 11px;
  color: var(--teal);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  margin-bottom: 6px;
}
.persona-intro-card .description { font-size: 13px; color: var(--text-muted); }

.onboarding-illustration { text-align: center; padding: 20px 0; font-size: 48px; }

.onboarding-benefits { display: flex; flex-direction: column; gap: 8px; padding: 12px 0; }
.benefit-item { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text); }
.benefit-item .checkmark { color: var(--teal); font-weight: 700; }

.onboarding-form textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  font-size: 14px;
  resize: vertical;
  min-height: 100px;
  background: var(--surface);
  color: var(--text);
}

.char-counter { font-size: 11px; color: var(--text-subtle); text-align: right; margin-top: 4px; }

.onboarding-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }

/* Responsive */
@media (min-width: 900px) {
  .sidebar { display: flex; flex-direction: column; }
  .mobile-overlay { display: none !important; }
}

@media (max-width: 899px) {
  .sidebar {
    position: fixed;
    top: var(--topbar-h);
    left: 0;
    bottom: var(--bottom-nav-h);
    z-index: 15;
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    display: flex;
    flex-direction: column;
    width: 85%;
    max-width: var(--sidebar-w);
  }
  .sidebar.open { transform: translateX(0); }
  .mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(40, 48, 68, 0.35);
    z-index: 14;
  }
}

/* ── Attachments (re-added 2026-04-14) ── */

.composer-icon-btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  min-width: 44px;
  min-height: 44px;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-muted);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s, color 0.12s;
  padding: 0;
  border: 0;
}
.composer-icon-btn:hover { background: var(--surface-hover); color: var(--text); }

.attachment-tray {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 12px 4px;
  max-width: var(--composer-max);
  margin: 0 auto;
}

.attach-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px 5px 6px;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text);
  max-width: 200px;
}
.attach-chip-thumb {
  width: 28px;
  height: 28px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}
.attach-chip-icon {
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
}
.attach-chip-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
  color: var(--text-muted);
}
.attach-chip-remove {
  flex-shrink: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
  color: var(--text-subtle);
  padding: 2px;
  font-size: 12px;
  line-height: 1;
  border-radius: 3px;
}
.attach-chip-remove:hover { color: var(--burgundy); background: rgba(159, 10, 55, 0.08); }

.attach-chip-error {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: rgba(159, 10, 55, 0.06);
  border: 1px solid rgba(159, 10, 55, 0.2);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--burgundy);
}

.message-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.message-attachment-image img {
  max-width: 200px;
  max-height: 160px;
  border-radius: var(--radius-sm);
  cursor: zoom-in;
  object-fit: cover;
  display: block;
  border: 1px solid var(--border);
}
.message-attachment-file {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text);
  font-size: 13px;
  max-width: 240px;
  transition: background 0.12s;
}
.message-attachment-file:hover { background: var(--surface-2); text-decoration: none; }
.message-attachment-file-icon { font-size: 16px; flex-shrink: 0; }
.message-attachment-file-info { display: flex; flex-direction: column; overflow: hidden; }
.message-attachment-file-name {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-size: 12px; font-weight: 500;
}
.message-attachment-file-size { font-size: 11px; color: var(--text-muted); }

/* Lightbox */
.lightbox {
  border: 0;
  padding: 0;
  background: rgba(0, 0, 0, 0.88);
  max-width: 95vw;
  max-height: 95vh;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: fixed;
}
.lightbox::backdrop { background: rgba(0, 0, 0, 0.6); }
.lightbox img {
  display: block;
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
}
.lightbox-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255, 255, 255, 0.15);
  border: 0;
  color: #fff;
  font-size: 18px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.lightbox-close:hover { background: rgba(255, 255, 255, 0.28); }

/* Persona bio modal (Departments page trigger) */
.persona-bio-modal {
  border: 0;
  padding: 0;
  background: var(--surface, #fff);
  color: var(--text, #283044);
  max-width: 520px;
  width: 90vw;
  border-radius: 12px;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.18);
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.persona-bio-modal::backdrop { background: rgba(0, 0, 0, 0.55); }
.persona-bio-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.06);
  border: 0;
  color: var(--text, #283044);
  font-size: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.persona-bio-close:hover { background: rgba(0, 0, 0, 0.12); }
.persona-bio-header {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 22px 50px 14px 22px;
  border-bottom: 1px solid var(--border, #E4E7EB);
}
.persona-bio-header .avatar {
  width: 56px;
  height: 56px;
  font-size: 20px;
  flex-shrink: 0;
}
.persona-bio-heading { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.persona-bio-name { font-size: 18px; font-weight: 700; margin: 0; }
.persona-bio-role { font-size: 13px; color: var(--muted, #7A8599); }
.persona-bio-text {
  padding: 16px 22px 22px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text, #283044);
  white-space: pre-wrap;
}

/* Persona name button in Departments tile */
.persona-name-btn {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  text-align: left;
}
.persona-name-btn:hover { text-decoration: underline; }
.persona-name-info {
  display: inline-flex;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--chip-bg, #EEF1F5);
  color: var(--muted, #546478);
  font-size: 10px;
  font-weight: 700;
  font-style: italic;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.persona-name-btn:hover .persona-name-info {
  background: var(--teal, #17A398);
  color: #fff;
}

/* ═══════════════════════════════════════════════════════════════
   Phase W4 — Progressive disclosure: operator vs client UX
   ═══════════════════════════════════════════════════════════════ */

/* Default: operator-only elements are hidden for all roles.
   body.role-operator overrides them to visible.               */
.operator-only { display: none !important; }
body.role-operator .operator-only { display: revert !important; }

/* Routing chip — small muted tag showing persona/model choice */
.routing-chip {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  background: var(--surface-hover);
  border: 1px solid var(--border);
  font-size: 10px;
  font-weight: 600;
  color: var(--text-subtle);
  vertical-align: middle;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Credit usage display in sidebar footer */
.credit-usage-display {
  font-size: 11px;
  color: var(--text-subtle);
  margin: 2px 0 6px;
  padding: 0;
}

/* Thinking trace block */
.thinking-block {
  border-top: 1px solid var(--border);
  margin-top: 10px;
  padding-top: 6px;
}

.thinking-toggle {
  background: none;
  border: none;
  padding: 2px 0;
  font-size: 12px;
  color: var(--text-subtle);
  cursor: pointer;
  font-family: var(--font-body);
  transition: color 0.12s;
}
.thinking-toggle:hover { color: var(--teal); }

.thinking-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.2s ease;
}
.thinking-content.open { max-height: 600px; }

.thinking-trace {
  margin: 8px 0 0;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-family: "Courier New", monospace;
  color: var(--text-muted);
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.55;
}

/* Client mode: explicit shortRole tags hidden in Specialists list */
body.role-client .specialist-role { visibility: hidden; }

/* Operator-only settings card uses default card styling (already set) */

/* ── Onboarding (W4) ────────────────────────────────────────────────────── */

/* Modal sizing — wider than login, scrollable on small phones */
.onboarding-modal {
  width: min(540px, calc(100vw - 24px));
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
}

/* Progress dots */
.onboarding-progress {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding-bottom: 4px;
}
.ob-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-strong);
  transition: background 0.2s;
}
.ob-dot-active { background: var(--teal); }

/* Step header */
.onboarding-header { text-align: center; margin-bottom: 16px; }
.onboarding-header h2 { font-size: 21px; margin-bottom: 6px; color: var(--navy); }
.onboarding-header .summary-copy { font-size: 14px; color: var(--text-muted); }

/* Step 1 welcome hero */
.ob-welcome-hero {
  text-align: center;
  padding: 20px 0 8px;
}
.ob-avatar-row {
  display: flex;
  justify-content: center;
  gap: -8px;
  margin-bottom: 12px;
}
.ob-avatar-stack {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  border: 3px solid var(--surface);
  margin-left: -8px;
}
.ob-avatar-stack:first-child { margin-left: 0; }
.ob-avatar-stack.marla    { background: #17A398; }
.ob-avatar-stack.victoria { background: #EF7B45; }
.ob-avatar-stack.rex      { background: #9F0A37; }
.ob-tagline {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Step 2 persona list */
.ob-persona-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ob-persona-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.ob-persona-detail { flex: 1; }
.ob-persona-detail strong { font-size: 14px; font-weight: 600; }
.ob-persona-detail p {
  font-size: 13px;
  color: var(--text-muted);
  margin: 3px 0 0;
}
.ob-role-badge {
  display: inline-block;
  margin-left: 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--teal);
  vertical-align: middle;
}
.ob-example {
  font-size: 12px;
  color: var(--text-subtle);
  font-style: italic;
  margin-top: 4px;
}
.ob-specialists-note {
  font-size: 12px;
  color: var(--text-subtle);
  text-align: center;
  padding: 4px 0 0;
}

/* Step 3 setup form */
.ob-setup-form { display: flex; flex-direction: column; gap: 14px; }
.ob-field { display: flex; flex-direction: column; }
.ob-field input,
.ob-field select,
.ob-field textarea {
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  font-size: 14px;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-body);
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.ob-field input:focus,
.ob-field select:focus,
.ob-field textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(23, 163, 152, 0.12);
}
.ob-field textarea { resize: vertical; min-height: 72px; }
.ob-optional { font-weight: 400; font-size: 11px; color: var(--text-subtle); }

/* Step 4 Marla preview */
.ob-message-preview {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin: 8px 0;
}
.ob-preview-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #17A398;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ob-preview-bubble {
  font-size: 13px;
  color: var(--text);
  line-height: 1.55;
}

/* Step 5 tips */
.ob-tips-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ob-tips-list li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 14px;
  color: var(--text);
}
.ob-tip-icon { font-size: 18px; flex-shrink: 0; }

/* Shared: skip button style */
.ob-skip {
  font-size: 12px;
  color: var(--text-subtle);
  padding: 6px 0;
}
.ob-skip:hover { color: var(--text-muted); }

/* Shared: action row */
.onboarding-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

/* Mobile tweaks */
@media (max-width: 480px) {
  .ob-persona-row { gap: 10px; }
  .ob-avatar-stack { width: 44px; height: 44px; font-size: 17px; }
}

/* Wave 1: inline reply error state */
.message-error-state {
  display: none;
  margin-top: 6px;
  padding: 4px 0 2px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  animation: wave1-error-fade 0.18s ease both;
}
.message-error-state.visible {
  display: flex;
  align-items: center;
  gap: 6px;
}
.retry-reply-btn {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--teal);
  color: var(--teal);
  background: transparent;
  font-size: 12px;
  font-family: var(--font-body);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  white-space: nowrap;
}
.retry-reply-btn:hover {
  background: var(--teal-soft);
  color: var(--teal-deep);
}
@keyframes wave1-error-fade {
  from { opacity: 0; transform: translateY(-3px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Wave 2: streaming reply UI ─────────────────────────────────────────────── */

/* Streaming bubble: subtle teal left-border + slightly muted text while tokens arrive */
.message-card.message-streaming {
  border-left: 3px solid var(--teal);
  opacity: 0.88;
  transition: opacity 0.2s, border-left-color 0.2s;
}

/* The text content node inside a streaming bubble */
.message-streaming-content {
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
  font-size: var(--font-size-base, 14px);
  line-height: 1.55;
}

/* Pulsing cursor dot appended while is_final=false */
.streaming-cursor {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
  margin-left: 4px;
  vertical-align: middle;
  animation: streaming-pulse 0.9s ease-in-out infinite;
}

@keyframes streaming-pulse {
  0%, 100% { opacity: 1;   transform: scale(1);    }
  50%       { opacity: 0.3; transform: scale(0.75); }
}

/* v1.5 P1: Progressive reveal stage gates ───────────────────────────────── */
/* Elements with data-min-stage > current maturity_stage are hidden. */
.stage-gated-hidden {
  display: none;
}

/* Map of the World (v1.5 P3.1) ───────────────────────────────────────────── */
.map-of-world-screen {
  padding: 16px;
  width: 100%;
  max-width: none;
  margin: 0;
  height: 100%;
  overflow-y: auto;
  box-sizing: border-box;
}
.map-of-world-header {
  margin-bottom: 16px;
}
.map-panel {
  background: var(--surface, #fff);
  border: 1px solid var(--border, #E4E7EB);
  border-radius: 10px;
  margin-bottom: 12px;
  overflow: hidden;
}
.map-panel-accent-banner { border-color: #17A398; }
.map-panel-accent-warning { border-color: #D49A3F; background: #FFF8E6; }
.map-panel-summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  font-weight: 600;
  user-select: none;
}
.map-panel-summary::-webkit-details-marker { display: none; }
.map-panel-summary::before {
  content: "▸";
  display: inline-block;
  transition: transform 0.15s ease;
  color: var(--muted, #7A8599);
  margin-right: 6px;
}
.map-panel[open] > .map-panel-summary::before {
  transform: rotate(90deg);
}
.map-panel-title { flex: 1; }
.map-panel-chip {
  font-size: 12px;
  font-weight: 500;
  padding: 2px 8px;
  background: var(--chip-bg, #EEF1F5);
  color: var(--muted, #546478);
  border-radius: 10px;
}
.map-panel-accent-warning .map-panel-chip {
  background: #D49A3F;
  color: #fff;
}
.map-panel-body {
  padding: 12px 16px 16px 16px;
  border-top: 1px solid var(--border, #E4E7EB);
}
.map-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}
.map-summary-item {
  display: flex;
  flex-direction: column;
  font-size: 13px;
}
.map-summary-item .label { color: var(--muted, #7A8599); font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; }
.map-summary-item .value { font-weight: 600; font-size: 14px; margin-top: 2px; }
.map-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.map-list-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-faint, #F0F2F5);
  font-size: 14px;
  line-height: 1.4;
}
.map-list-item:last-child { border-bottom: none; }
.map-list-item.map-empty { color: var(--muted, #7A8599); font-style: italic; }
.map-list-item.map-failing { color: #9F0A37; font-weight: 500; }
.map-list-name { flex: 1; }
.map-age {
  font-size: 11px;
  background: #EEF1F5;
  padding: 1px 6px;
  border-radius: 8px;
  color: var(--muted, #546478);
}
.map-sha {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  background: #EEF1F5;
  padding: 1px 5px;
  border-radius: 4px;
  color: var(--muted, #546478);
}
.map-gid {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  color: var(--muted, #7A8599);
}
.map-status {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 8px;
  background: #D49A3F;
  color: #fff;
}
.map-link {
  font-size: 12px;
  color: #17A398;
  text-decoration: none;
}
.map-link:hover { text-decoration: underline; }
.map-meta {
  color: var(--muted, #546478);
  font-size: 13px;
  margin: 6px 0;
}
.map-muted { color: var(--muted, #7A8599); font-size: 12px; }
.map-subhead {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted, #7A8599);
  margin: 12px 0 6px;
}
.map-kv {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 12px;
  font-size: 13px;
  margin: 0;
}
.map-kv dt { color: var(--muted, #7A8599); }
.map-kv dd { margin: 0; font-weight: 500; }
.map-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.map-table th, .map-table td {
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border-faint, #F0F2F5);
  vertical-align: top;
}
.map-table th {
  color: var(--muted, #7A8599);
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.map-prio-num {
  color: var(--muted, #7A8599);
  font-variant-numeric: tabular-nums;
  min-width: 20px;
}

/* Map of the World — Regenerate button (data freshness fix 2026-04-21) */
.map-regen-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border, #E5E7EB);
}
.map-regen-btn {
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 500;
  background: var(--teal, #17A398);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s;
}
.map-regen-btn:hover { opacity: 0.85; }
.map-regen-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.map-regen-status {
  font-size: 12px;
  color: var(--muted, #7A8599);
  flex: 1;
}

/* ──────────────────────────────────────────────────────────────────────────
   Tenant switcher (operator-only, top nav).
   Lets Ken switch active tenant context for chat/feed/etc without re-auth.
   Spec: docs/superpowers/specs/2026-05-11-two-tier-product-restructure.md
   ──────────────────────────────────────────────────────────────────────── */
.tenant-switcher {
  display: flex;
  align-items: center;
  gap: 6px;
}
.tenant-switcher select {
  appearance: none;
  -webkit-appearance: none;
  padding: 6px 26px 6px 10px;
  border: 1px solid var(--border-strong, #c9d1de);
  border-radius: var(--radius-sm, 6px);
  background: var(--surface, #fff);
  font-size: 13px;
  color: var(--text, #1a1a1a);
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23667' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 10px 6px;
}
.tenant-switcher select:focus { outline: 2px solid var(--teal, #2e8a8a); outline-offset: 1px; }
.tenant-switcher select[data-tier="t1"] { border-left: 3px solid var(--teal, #2e8a8a); }
.tenant-switcher select[data-tier="t2"] { border-left: 3px solid var(--burgundy, #7a2941); }

/* Visually-hidden utility for accessible labels. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* T1/T2 SKU gates (2026-05-11). data-min-tier="t2" elements are hidden when
   active tenant is tier t1. applyTierGates() in app.js toggles the
   .tier-gated-hidden class based on /api/tenant/stage response. */
.tier-gated-hidden { display: none !important; }

/* T1-only elements (e.g. T2 upsell card) are visible only when tier=t1.
   Hidden for T2 tenants who already have everything. */
body.tier-t2 .t1-only { display: none !important; }

/* T2 upsell card styling */
#t2-upsell-card {
  border-left: 4px solid var(--burgundy, #7a2941);
  background: linear-gradient(180deg, var(--surface, #fff) 0%, rgba(122, 41, 65, 0.03) 100%);
}
#t2-upsell-card .t2-persona-list {
  list-style: none;
  padding: 0;
  margin: 12px 0;
  display: grid;
  gap: 8px;
}
#t2-upsell-card .t2-persona-list li {
  padding: 8px 12px;
  background: var(--surface-2, #f6f8fb);
  border-radius: var(--radius-sm, 6px);
  font-size: 13px;
}
#t2-upsell-card .t2-persona-list li strong {
  color: var(--burgundy, #7a2941);
}
#t2-upgrade-btn[disabled] { opacity: 0.6; cursor: not-allowed; }

/* ── W4: install prompts ────────────────────────────────────────────────────
   Banners are hidden by default (the `hidden` HTML attribute is set server-
   side / on page load). JS reveals them after the 30 s delay gate or on the
   first message send, provided the 7-day cooldown has not already fired.
   ───────────────────────────────────────────────────────────────────────── */

@keyframes install-prompt-enter {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.install-banner {
  position: fixed;
  bottom: calc(var(--bottom-nav-height, 60px) + 8px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  background: var(--surface, #fff);
  border: 1px solid var(--border-strong, rgba(40, 48, 68, 0.22));
  border-radius: var(--radius-lg, 14px);
  box-shadow: var(--shadow-md, 0 4px 14px rgba(40,48,68,.12));
  padding: 14px 18px;
  max-width: 360px;
  width: calc(100% - 32px);
  animation: install-prompt-enter 0.25s ease both;
}

.install-banner[hidden] { display: none; }

.install-banner h3 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text, #283044);
}

.install-banner p {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--text-muted, rgba(40,48,68,.62));
}

.install-banner .install-banner-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.ios-install-banner {
  position: fixed;
  bottom: calc(var(--bottom-nav-height, 60px) + 8px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  background: var(--surface, #fff);
  border: 1px solid var(--border-strong, rgba(40, 48, 68, 0.22));
  border-radius: var(--radius-lg, 14px);
  box-shadow: var(--shadow-md, 0 4px 14px rgba(40,48,68,.12));
  padding: 14px 18px;
  max-width: 360px;
  width: calc(100% - 32px);
  animation: install-prompt-enter 0.25s ease both;
}

.ios-install-banner[hidden] { display: none; }

.ios-install-banner .ios-install-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 10px 0;
}

.ios-install-banner .ios-install-steps img {
  width: 24px;
  height: 24px;
  vertical-align: middle;
  margin-right: 6px;
}
