@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600&family=Instrument+Sans:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg-sidebar: #142e2a;
  --bg-sidebar-hover: #1e3f39;
  --bg-page: #f7f8f5;
  --bg-surface: #ffffff;
  --bg-raised: #f1f4ee;
  --bg-tint: #eef5ec;
  --ink-primary: #1c2826;
  --ink-secondary: #51615c;
  --ink-muted: #76857f;
  --accent: #246348;
  --accent-hover: #1b4d38;
  --accent-soft: #e6f2e8;
  --accent-ink: #1e563e;
  --border-hairline: rgba(28, 40, 38, 0.09);
  --border-strong: rgba(28, 40, 38, 0.16);
  --danger: #b4463c;
  --danger-bg: #fdf1ef;
  --font-sans: 'Instrument Sans', 'DM Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Consolas, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  font-family: var(--font-sans);
  color: var(--ink-primary);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }
* { box-sizing: border-box; }
body { margin: 0; font-size: 14px; line-height: 1.5; }
button, input, textarea, select { font: inherit; }
button {
  cursor: pointer;
  transition: background-color 150ms var(--ease), border-color 150ms var(--ease), color 150ms var(--ease), transform 140ms var(--ease), opacity 140ms var(--ease);
}
button:active:not(:disabled) { transform: scale(0.98); }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, a:focus-visible {
  outline: 2px solid #7ab290;
  outline-offset: 2px;
}

h1, h2, h3, h4 {
  font-family: var(--font-sans);
  font-weight: 500;
  margin: 0;
  letter-spacing: -0.02em;
  color: var(--ink-primary);
}
h1 { font-size: 28px; line-height: 1.2; }
h2 { font-size: 24px; line-height: 1.25; }
h3 { font-size: 16px; line-height: 1.35; }
.muted { color: var(--ink-secondary); line-height: 1.55; }
.small { font-size: 12px; }
.error { color: var(--danger); font-size: 12px; margin-top: 12px; }

/* Animations */
@keyframes view-enter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes sheet-up {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes chat-pulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}
.view-animate { animation: view-enter 240ms var(--ease) both; }
.view-animate .stagger-item { animation: view-enter 280ms var(--ease) both; }
.view-animate .stagger-item:nth-child(1) { animation-delay: 15ms; }
.view-animate .stagger-item:nth-child(2) { animation-delay: 45ms; }
.view-animate .stagger-item:nth-child(3) { animation-delay: 75ms; }
.view-animate .stagger-item:nth-child(4) { animation-delay: 105ms; }
.view-animate .stagger-item:nth-child(5) { animation-delay: 135ms; }
.view-animate .stagger-item:nth-child(n+6) { animation-delay: 165ms; }

/* Shell & Sidebar */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100dvh; }
.sidebar {
  background: var(--bg-sidebar);
  color: #dbe8e0;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}
.wordmark {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.02em;
  color: #f4f7f4;
  padding: 0 8px 28px;
}
.wordmark small {
  font-weight: 500;
  font-size: 13px;
  color: #95bfa9;
}
.brand-logo-img { display: block; flex: none; border-radius: 10px; }
.sidebar-label {
  color: #84ab98;
  font-size: 12px;
  font-weight: 500;
  padding: 0 12px 8px;
}
.sidebar nav { display: grid; gap: 4px; }
.sidebar nav button {
  border: 0;
  text-align: left;
  height: 38px;
  padding: 0 12px;
  border-radius: var(--radius-md);
  background: transparent;
  color: #b4cdc0;
  font-weight: 500;
  font-size: 14px;
  display: flex;
  gap: 10px;
  align-items: center;
}
.sidebar nav button .nav-icon { width: 17px; height: 17px; flex: none; opacity: 0.85; }
.sidebar nav button:hover { background: var(--bg-sidebar-hover); color: #ffffff; }
.sidebar nav button.active {
  background: var(--bg-sidebar-hover);
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.sidebar nav button.active .nav-icon { opacity: 1; color: #c9e9cb; }
.nav-badge {
  margin-left: auto;
  min-width: 19px;
  height: 19px;
  padding: 0 6px;
  border-radius: 999px;
  background: #22a06b;
  color: #ffffff;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  font-weight: 600;
  display: inline-grid;
  place-items: center;
}
.sidebar-bottom { margin-top: auto; }
.agent-chip {
  display: flex;
  gap: 10px;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 16px 8px 12px;
}
.agent-chip strong { display: block; font-size: 13px; font-weight: 500; color: #f2f7f3; }
.agent-chip small { display: block; color: #95b5a6; font-size: 12px; }
.avatar {
  width: 32px;
  height: 32px;
  background: #254d40;
  color: #c9e9cb;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex: none;
}
.text-button { border: 0; background: none; color: #a7c5b6; padding: 8px; font-size: 13px; border-radius: var(--radius-sm); }
.text-button:hover { color: #ffffff; background: rgba(255, 255, 255, 0.06); }

/* Topbar */
.topbar {
  height: 60px;
  border-bottom: 1px solid var(--border-hairline);
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  font-size: 13px;
  color: var(--ink-secondary);
}
.topbar-left { display: flex; align-items: center; gap: 10px; font-weight: 500; color: var(--ink-primary); }
.topbar-mobile-logo { display: none; border-radius: 7px; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.lab-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-tint);
  color: var(--accent-ink);
  border: 1px solid rgba(36, 99, 72, 0.14);
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}
.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22a06b;
}
.install-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--ink-primary);
  padding: 5px 10px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 500;
}
.install-pill:hover { background: var(--bg-raised); }
.user-avatar {
  height: 34px;
  width: 34px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent-ink);
  border-radius: 50%;
  font-weight: 600;
  font-size: 13px;
  flex: none;
}

.content { max-width: 1280px; margin: 0 auto; padding: 28px 32px 72px; }
.page-intro { max-width: 680px; margin-bottom: 24px; }
.page-intro h2 { font-size: 26px; }
.page-intro p:last-child { font-size: 14px; margin: 6px 0 0; }
.eyebrow {
  font-size: 12px;
  font-weight: 500;
  color: var(--accent-ink);
  margin: 0 0 6px;
}

/* Cards, Buttons, Forms */
.card, .form-card, .composer, .post, .rail-card, .running-task-card, .priority-manage-card, .item {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 3px rgba(20, 46, 42, 0.03);
}
.form-card { padding: 24px; max-width: 720px; margin-bottom: 20px; }
.form-card h3 { margin-bottom: 16px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 28px 0 12px; }
.list { display: grid; gap: 10px; }
.item { padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.item strong { display: block; font-weight: 500; }
.item small { color: var(--ink-muted); display: block; margin-top: 4px; }
.empty {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
  color: var(--ink-muted);
  background: var(--bg-surface);
}

.primary {
  border: 0;
  background: var(--accent);
  color: #ffffff;
  border-radius: var(--radius-md);
  padding: 10px 16px;
  min-height: 40px;
  font-weight: 500;
  font-size: 14px;
}
.primary:hover:not(:disabled) { background: var(--accent-hover); }
.primary:disabled { opacity: 0.6; cursor: wait; }

.secondary {
  border: 1px solid var(--border-strong);
  color: var(--ink-primary);
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  min-height: 36px;
  font-weight: 500;
  font-size: 13px;
}
.secondary:hover:not(:disabled) { background: var(--bg-raised); }
.danger { color: var(--danger); border-color: rgba(180, 70, 60, 0.25); }
.danger:hover:not(:disabled) { background: var(--danger-bg); }
.text-link-btn {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 8px;
  border: 0;
  background: none;
  color: var(--ink-secondary);
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.text-link-btn:hover { color: var(--ink-primary); }

label { display: block; font-weight: 500; font-size: 13px; color: var(--ink-secondary); margin: 0 0 16px; }
input, textarea, select {
  display: block;
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-top: 6px;
  background: #fbfcfa;
  color: var(--ink-primary);
  outline: none;
  transition: border-color 150ms var(--ease), background-color 150ms var(--ease);
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); background: #ffffff; }
textarea { min-height: 108px; resize: vertical; }
label .optional { font-weight: 400; color: var(--ink-muted); font-size: 12px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > label { flex: 1; min-width: 180px; }

.notice {
  padding: 12px 16px;
  background: var(--accent-soft);
  border: 1px solid rgba(36, 99, 72, 0.2);
  border-radius: var(--radius-md);
  margin: 0 0 20px;
  color: var(--accent-ink);
  font-size: 13px;
  animation: view-enter 220ms var(--ease) both;
}
.notice.error { background: var(--danger-bg); border-color: rgba(180, 70, 60, 0.25); color: var(--danger); }

.badge {
  border-radius: 999px;
  background: var(--bg-tint);
  color: var(--accent-ink);
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.badge.paused { background: #fdf3e3; color: #8c611e; }
.badge.draft { background: var(--bg-raised); color: var(--ink-secondary); }
.badge.archived { background: #efefef; color: #666; }

/* Auth Screen */
.auth-shell {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background: var(--bg-page);
}
.auth-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-xl);
  padding: 32px;
  width: min(440px, 100%);
  box-shadow: 0 8px 32px rgba(20, 46, 42, 0.06);
  animation: view-enter 320ms var(--ease) both;
}
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; }
.brand-name { font-size: 18px; font-weight: 600; letter-spacing: -0.02em; color: var(--ink-primary); }
.brand-name span { color: var(--accent); font-weight: 500; }
.auth-sub { margin: 8px 0 20px; font-size: 14px; }
.tabs { display: flex; border-bottom: 1px solid var(--border-hairline); margin-bottom: 20px; gap: 16px; }
.tabs button { border: 0; background: none; padding: 10px 2px; color: var(--ink-muted); font-weight: 500; border-bottom: 2px solid transparent; }
.tabs button.selected { border-bottom-color: var(--accent); color: var(--ink-primary); }
.full { width: 100%; }

.whatsapp-returning {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--bg-tint);
  border: 1px solid rgba(36, 99, 72, 0.14);
  margin-bottom: 16px;
}
.whatsapp-returning strong { font-size: 13px; font-weight: 500; color: var(--accent-ink); }
.whatsapp-returning p { font-size: 12px; line-height: 1.5; color: var(--ink-secondary); margin: 4px 0 0; }
.whatsapp-returning code { font-family: var(--font-mono); color: var(--accent-ink); font-weight: 500; }

.interests-picker-group {
  margin: 18px 0 20px;
}
.interests-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-secondary);
  margin-bottom: 10px;
}
.interests-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.interest-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--ink-primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  transition: all 160ms var(--ease);
}
.interest-chip:hover {
  background: var(--bg-raised);
  border-color: rgba(36, 99, 72, 0.3);
}
.interest-chip.selected {
  background: var(--bg-sidebar);
  color: #ffffff;
  border-color: var(--bg-sidebar);
  box-shadow: 0 2px 8px rgba(20, 46, 42, 0.16);
  transform: translateY(-1px);
}
.interest-chip.selected .chip-check {
  display: inline-block;
}
.chip-check {
  display: none;
  font-size: 11px;
  color: #c9e9cb;
}

.whatsapp-setup-summary {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-raised);
  border: 1px solid var(--border-hairline);
  margin-bottom: 20px;
}
.setup-row { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.setup-row span { color: var(--ink-muted); }
.setup-row strong { font-weight: 500; color: var(--ink-primary); text-align: right; }

/* Timeline & Social Layout */
.social-layout { display: grid; grid-template-columns: minmax(0, 660px) minmax(220px, 280px); justify-content: center; gap: 28px; }
.social-main { min-width: 0; }
.feed-title { padding: 4px 0 20px; }
.feed-title h2 { font-size: 26px; }
.feed-title .muted { margin: 6px 0 0; }
.composer { padding: 20px; }
.composer-top, .post-head { display: flex; align-items: center; gap: 12px; }
.composer-top strong { font-size: 14px; font-weight: 500; }
.composer textarea { border: 0; background: none; min-height: 84px; padding: 14px 0 4px; margin: 0; font-size: 15px; }
.composer textarea:focus { border: 0; outline: none; }
.composer-bottom { border-top: 1px solid var(--border-hairline); padding-top: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.feed-divider { display: flex; justify-content: space-between; align-items: center; margin: 24px 0 12px; font-size: 14px; }
.feed-divider strong { font-weight: 500; }
.post { padding: 20px; margin-bottom: 12px; }
.post-head strong { font-size: 14px; font-weight: 500; }
.post-head small { display: block; color: var(--ink-muted); font-size: 12px; margin-top: 2px; }
.post p { font-size: 14px; line-height: 1.65; white-space: pre-wrap; margin: 14px 0; }
.right-rail { padding-top: 4px; }
.rail-card { padding: 20px; margin-bottom: 16px; }
.agent-rail { text-align: center; }
.agent-orb {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin: 0 auto 12px;
  border-radius: 12px;
  background: var(--bg-sidebar);
  padding: 8px;
}
.agent-orb img { width: 100%; height: 100%; }
.agent-rail h3 { font-size: 18px; }
.agent-rail p { color: var(--ink-secondary); font-size: 13px; margin: 6px 0 0; }
.agent-rail strong { font-family: var(--font-mono); font-weight: 500; color: var(--ink-primary); }

/* Media attachment */
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0 !important; }
.media-attachment { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 14px 0 4px; min-width: 0; }
.media-picker {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px 14px;
  min-height: 40px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg-raised);
  color: var(--ink-primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.media-picker:hover { background: var(--bg-tint); border-color: rgba(36, 99, 72, 0.25); }
.media-picker svg { width: 17px; height: 17px; flex: none; }
.media-file-note { color: var(--ink-muted); font-size: 12px; overflow-wrap: anywhere; }
.has-file .media-file-note { color: var(--accent-ink); }
.media-remove { background: none; border: 0; color: var(--danger); font-size: 12px; padding: 8px; text-decoration: underline; text-underline-offset: 3px; }
.attached-media { margin: 12px 0; border-radius: var(--radius-md); overflow: hidden; background: var(--bg-raised); }
.attached-media img, .attached-media video { display: block; width: 100%; max-height: 420px; object-fit: contain; }

/* Work, Priorities, Running Tasks */
.work-tabs { display: flex; gap: 6px; margin: 0 0 20px; border-bottom: 1px solid var(--border-hairline); overflow-x: auto; }
.work-tabs button { background: transparent; border: 0; border-bottom: 2px solid transparent; padding: 10px 16px; color: var(--ink-muted); font-weight: 500; white-space: nowrap; }
.work-tabs button[aria-selected="true"] { color: var(--ink-primary); border-color: var(--accent); }
.tab-count {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  background: var(--bg-raised);
  color: var(--ink-secondary);
  margin-left: 6px;
}

.running-task-grid, .priority-manage-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.running-task-grid > .empty, .priority-manage-list > .empty { grid-column: 1 / -1; }
.running-task-card, .priority-manage-card { min-width: 0; padding: 20px; scroll-margin-top: 24px; }
.running-task-card.is-expanded { grid-column: 1 / -1; }
.running-card-top, .priority-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.running-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-tint);
  color: var(--accent-ink);
}
.running-status.waiting { background: #edf1fb; color: #3a568a; }
.running-status.retry { background: #fdf3e3; color: #8c611e; }
.running-status.error { background: var(--danger-bg); color: var(--danger); }
.running-status.paused { background: var(--bg-raised); color: var(--ink-muted); }
.running-role { font-size: 12px; color: var(--ink-muted); white-space: nowrap; }
.running-task-card h3, .priority-card-heading h3 { font-size: 17px; line-height: 1.4; overflow-wrap: anywhere; }
.running-description, .priority-description { font-size: 13px; color: var(--ink-secondary); line-height: 1.6; margin: 8px 0 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.running-description { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.running-progress-note { display: flex; align-items: flex-start; gap: 8px; background: var(--bg-raised); border-radius: var(--radius-md); padding: 10px 12px; }
.running-progress-note svg { width: 16px; height: 16px; color: var(--accent); flex: none; margin-top: 2px; }
.running-progress-note p { font-size: 12px; line-height: 1.5; color: var(--ink-secondary); margin: 0; }
.running-metrics, .priority-task-summary { display: flex; flex-wrap: wrap; gap: 10px 16px; margin: 14px 0 10px; font-size: 12px; color: var(--ink-muted); }
.running-metrics strong, .priority-task-summary strong { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 14px; font-weight: 500; color: var(--ink-primary); margin-right: 4px; }
.running-times, .priority-check-times { display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: var(--ink-muted); margin-bottom: 12px; }
.running-card-actions, .priority-manage-card > .action-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border-hairline); }
.action-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.running-live-note { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-muted); margin: 0 0 16px; }
.task-started-note {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  margin: 0 0 20px;
  border: 1px solid rgba(36, 99, 72, 0.2);
  border-radius: var(--radius-lg);
  background: var(--bg-tint);
  color: var(--accent-ink);
}
.task-started-note .started-mark { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: #fff; font-size: 13px; flex: none; }
.task-started-note > button { margin-left: auto; background: none; border: 0; color: var(--ink-muted); font-size: 20px; }

.task-inline-details { margin-top: 14px; border-top: 1px solid var(--border-hairline); padding-top: 10px; }
.task-inline-details > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; list-style: none; font-size: 13px; font-weight: 500; color: var(--accent-ink); min-height: 36px; }
.task-inline-details > summary::-webkit-details-marker { display: none; }
.inline-chevron { transition: transform 180ms var(--ease); }
.task-inline-details[open] .inline-chevron { transform: rotate(180deg); }
.inline-task-body { padding-top: 12px; }
.inline-task-body > .work-item { border: 0; box-shadow: none; background: transparent; padding: 0; gap: 20px; }

.task-origin { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 10px; }
.origin-tag { display: inline-flex; border: 1px solid var(--border-hairline); border-radius: 999px; padding: 3px 9px; font-size: 11px; font-weight: 500; color: var(--ink-secondary); background: var(--bg-raised); }
.origin-priority-link, .priority-tasks-link { border: 0; background: none; color: var(--accent-ink); font-size: 12px; font-weight: 500; padding: 4px 0; text-decoration: underline; text-underline-offset: 3px; }
.priority-filter-note { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--bg-raised); border: 1px solid var(--border-hairline); border-radius: var(--radius-md); padding: 10px 14px; font-size: 13px; margin-bottom: 16px; }
.priority-filter-note button { margin-left: auto; border: 0; background: none; color: var(--accent-ink); text-decoration: underline; font-size: 12px; }
.priority-create { margin-bottom: 18px; border: 1px solid var(--border-hairline); background: var(--bg-surface); border-radius: var(--radius-lg); max-width: 720px; }
.priority-create > summary { cursor: pointer; padding: 16px 20px; color: var(--ink-primary); font-size: 14px; font-weight: 500; list-style: none; }
.priority-create > summary::-webkit-details-marker { display: none; }
.priority-create .form-card { border: 0; box-shadow: none; margin: 0; max-width: none; padding-top: 4px; }
.priority-management-note { color: var(--ink-muted); font-size: 12px; margin: 0 0 20px; max-width: 720px; }

.task-canvas { margin-top: 16px; padding: 16px; border: 1px solid var(--border-hairline); background: var(--bg-raised); border-radius: var(--radius-md); }
.canvas-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.task-canvas .task-question-form { margin-top: 14px; border-top: 1px solid var(--border-hairline); padding-top: 14px; }
.question-editor { border-top: 1px solid var(--border-hairline); padding: 10px 0; }
.question-editor summary { cursor: pointer; list-style: none; }
.question-editor summary::-webkit-details-marker { display: none; }
.question-editor summary strong { display: block; font-size: 13px; font-weight: 500; color: var(--ink-primary); }
.question-editor summary small { font-size: 12px; color: var(--ink-muted); }
.question-editor form { padding: 12px 0; }

.saved-terms { border: 1px solid var(--border-hairline); border-radius: var(--radius-md); margin: 8px 0 16px; padding: 14px; }
.saved-terms legend { font-size: 12px; font-weight: 500; color: var(--ink-secondary); }
.term-option { display: flex; gap: 10px; align-items: flex-start; margin: 8px 0; font-weight: 400; }
.term-option input { width: 16px; height: 16px; flex: none; margin: 2px 0 0; accent-color: var(--accent); }

/* Profile & People */
.profile-layout { display: grid; grid-template-columns: minmax(220px, 310px) minmax(0, 620px); gap: 20px; align-items: start; }
.profile-layout .form-card { max-width: none; width: 100%; }
.profile-identity { display: flex; align-items: center; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--border-hairline); }
.profile-identity strong, .profile-identity small { display: block; }
.profile-identity small { color: var(--ink-muted); font-size: 12px; margin-top: 2px; }
.profile-detail { display: flex; justify-content: space-between; gap: 10px; padding-top: 14px; font-size: 13px; }
.profile-detail span { color: var(--ink-muted); }
.profile-detail strong { font-weight: 500; text-align: right; overflow-wrap: anywhere; }

.whatsapp-card { padding: 24px; }
.whatsapp-heading { display: flex; align-items: center; gap: 14px; }
.whatsapp-heading h3 { margin: 0; font-size: 17px; }
.whatsapp-heading p { margin: 4px 0 0; color: var(--ink-secondary); font-size: 13px; }
.whatsapp-mark { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--border-hairline); border-radius: var(--radius-md); background: var(--bg-tint); color: var(--accent); flex: none; }
.whatsapp-mark svg { width: 22px; height: 22px; }
.whatsapp-hint { color: var(--ink-secondary); font-size: 13px; margin: 16px 0 14px; max-width: 480px; }
.whatsapp-connect { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 10px 16px; border: 0; border-radius: var(--radius-md); background: var(--accent); color: #fff; font-size: 13px; font-weight: 500; }
.whatsapp-connect:hover { background: var(--accent-hover); }
.whatsapp-connect svg { width: 17px; height: 17px; }
.whatsapp-instructions { margin-top: 16px; padding: 14px; border: 1px solid var(--border-hairline); border-radius: var(--radius-md); background: var(--bg-raised); }
.link-command { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.link-command code { font-family: var(--font-mono); font-size: 12px; flex: 1 1 180px; color: var(--accent-ink); }
.whatsapp-linked { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; font-size: 13px; color: var(--ink-secondary); }
.connection-badge { padding: 4px 10px; background: var(--accent-soft); color: var(--accent-ink); border-radius: 999px; font-size: 12px; font-weight: 500; }
.engagement-controls { margin: 18px 0 0; padding: 14px 0 0; border: 0; border-top: 1px solid var(--border-hairline); }
.engagement-controls legend { font-size: 12px; font-weight: 500; color: var(--ink-secondary); }
.engagement-controls label { display: flex; align-items: center; gap: 10px; margin: 10px 0 0; font-weight: 400; }
.engagement-controls input { width: 16px; height: 16px; margin: 0; flex: none; accent-color: var(--accent); }

.people-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.people-grid .form-card { width: 100%; max-width: none; }
.code-card { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--radius-md); background: var(--bg-tint); margin: 12px 0; }
.code-card strong { font-family: var(--font-mono); font-size: 24px; font-weight: 500; letter-spacing: 0.1em; color: var(--accent-ink); }
.code-chip { font-family: var(--font-mono); font-size: 12px; font-weight: 500; color: var(--accent-ink); }
.toggle-line { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.toggle-line input { width: 16px; height: 16px; flex: none; margin: 2px 0 0; accent-color: var(--accent); }

/* Chat View */
.content.chat-content { padding: 0 28px; width: 100%; max-width: 1040px; }
.chat-view { height: calc(100dvh - 60px); min-height: 380px; }
.chat-shell { height: 100%; display: flex; flex-direction: column; max-width: 780px; margin: 0 auto; }
.chat-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 4px 14px; border-bottom: 1px solid var(--border-hairline); }
.chat-heading > div { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; }
.chat-heading > span { font-size: 12px; color: var(--ink-muted); }
.chat-agent-mark { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--bg-sidebar); padding: 4px; }
.chat-messages { flex: 1; overflow-y: auto; overscroll-behavior: contain; min-height: 0; padding: 24px 4px; scrollbar-width: thin; }
.chat-welcome { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100%; text-align: center; padding: 24px 8px; animation: view-enter 320ms var(--ease) both; }
.chat-welcome-mark { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; background: var(--bg-sidebar); padding: 10px; margin-bottom: 20px; }
.chat-welcome h2 { font-size: 24px; max-width: 480px; }
.chat-welcome > p { color: var(--ink-secondary); font-size: 14px; max-width: 380px; margin: 10px 0 22px; }
.chat-starters { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.chat-starters button { border: 1px solid var(--border-strong); border-radius: var(--radius-md); padding: 10px 14px; background: var(--bg-surface); color: var(--ink-primary); font-size: 13px; min-height: 40px; }
.chat-starters button:hover { background: var(--bg-tint); border-color: rgba(36, 99, 72, 0.25); }
.chat-turn { display: flex; flex-direction: column; gap: 18px; margin-bottom: 24px; animation: view-enter 240ms var(--ease) both; }
.chat-user-message { align-self: flex-end; max-width: 82%; padding: 12px 16px; border-radius: 16px 16px 4px 16px; background: var(--bg-tint); color: var(--ink-primary); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.6; }
.chat-agent-message { display: flex; align-items: flex-start; gap: 12px; max-width: 100%; }
.chat-reply-mark { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--bg-sidebar); padding: 5px; margin-top: 2px; }
.chat-reply-body { min-width: 0; flex: 1; }
.chat-draft-button { display: inline-flex; align-items: center; gap: 12px; margin-top: 12px; padding: 10px 14px; border: 1px solid var(--border-strong); border-radius: var(--radius-md); background: var(--bg-surface); color: var(--accent-ink); font-size: 13px; font-weight: 500; min-height: 40px; }
.chat-draft-button:hover { background: var(--bg-tint); }
.chat-compose-area { flex: none; padding: 10px 0 0; background: var(--bg-page); }
.chat-compose { display: flex; gap: 10px; align-items: flex-end; padding: 10px 12px 10px 16px; background: var(--bg-surface); border: 1px solid var(--border-strong); border-radius: var(--radius-xl); box-shadow: 0 2px 10px rgba(20, 46, 42, 0.04); }
.chat-compose:focus-within { border-color: var(--accent); }
.chat-compose textarea { min-height: 24px; max-height: 180px; resize: none; margin: 0; border: 0; padding: 6px 0; background: transparent; line-height: 1.5; font-size: 14px; flex: 1; min-width: 0; }
.chat-compose textarea:focus { outline: none; border: 0; }
.chat-send { display: grid; place-items: center; flex: none; border: 0; border-radius: 50%; width: 36px; height: 36px; background: var(--accent); color: #ffffff; }
.chat-send:hover:not(:disabled) { background: var(--accent-hover); }
.chat-send svg { width: 18px; height: 18px; }
.chat-send:disabled { background: #c3cec6; cursor: wait; }
.chat-footnote { font-size: 11px; color: var(--ink-muted); text-align: center; margin: 8px 0 12px; }
.chat-thinking { display: flex; align-items: center; gap: 8px; color: var(--ink-muted); font-size: 13px; }
.thinking-dots { animation: chat-pulse 1.4s ease-in-out infinite; }
.chat-error, .chat-turn-error { font-size: 12px; color: var(--danger); margin: 0 0 10px; }
.chat-turn-error button { border: 0; background: none; color: var(--accent-ink); text-decoration: underline; padding: 6px; }
.chat-error { padding: 10px 14px; background: var(--danger-bg); border-radius: var(--radius-md); }

.chat-markdown { font-size: 14px; line-height: 1.7; color: var(--ink-primary); overflow-wrap: anywhere; }
.chat-markdown p { margin: 0 0 10px; white-space: pre-wrap; }
.chat-markdown p:last-child { margin-bottom: 0; }
.chat-markdown strong { font-weight: 600; }
.chat-markdown ul, .chat-markdown ol { margin: 8px 0 12px; padding-left: 22px; }
.chat-markdown li { margin: 4px 0; }
.chat-markdown code { font-family: var(--font-mono); font-size: 0.88em; background: var(--bg-raised); border-radius: 4px; padding: 2px 5px; }
.chat-markdown pre { overflow-x: auto; border: 1px solid var(--border-hairline); background: var(--bg-raised); border-radius: var(--radius-md); padding: 14px; margin: 10px 0; white-space: pre; }
.chat-markdown pre code { background: none; padding: 0; }
.chat-markdown a { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; }

.channel-badge { display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 500; background: rgba(36, 99, 72, 0.12); color: var(--accent-ink); }
.chat-proactive-tag { font-size: 11px; font-weight: 500; color: var(--ink-muted); margin-bottom: 4px; }
.chat-attachments { display: grid; gap: 10px; margin-top: 10px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.chat-attachment { margin: 0; border: 1px solid var(--border-hairline); border-radius: var(--radius-md); overflow: hidden; background: var(--bg-raised); }
.chat-attachment img, .chat-attachment video { display: block; width: 100%; max-height: 260px; object-fit: cover; }
.chat-attachment figcaption { font-size: 12px; padding: 6px 10px; color: var(--ink-secondary); }

/* PWA Install Pop-up */
.pwa-banner {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 40;
  width: min(380px, calc(100vw - 24px));
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  padding: 18px;
  box-shadow: 0 12px 36px rgba(20, 46, 42, 0.14);
  animation: sheet-up 320ms var(--ease) both;
}
.pwa-banner-head { display: flex; align-items: flex-start; gap: 12px; }
.pwa-banner-head img { border-radius: 10px; flex: none; }
.pwa-banner-copy { flex: 1; min-width: 0; }
.pwa-banner-copy strong { display: block; font-size: 15px; font-weight: 600; color: var(--ink-primary); }
.pwa-banner-copy p { margin: 4px 0 0; font-size: 13px; color: var(--ink-secondary); line-height: 1.45; }
.pwa-close { border: 0; background: none; color: var(--ink-muted); padding: 4px; border-radius: var(--radius-sm); flex: none; }
.pwa-close:hover { background: var(--bg-raised); color: var(--ink-primary); }
.pwa-ios-steps { display: grid; gap: 8px; margin-top: 14px; padding: 12px; border-radius: var(--radius-md); background: var(--bg-raised); }
.pwa-step { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-primary); }
.pwa-step-num { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 12px; font-weight: 600; display: grid; place-items: center; flex: none; }
.inline-share-icon { vertical-align: -2px; color: var(--accent-ink); }
.pwa-banner-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }

/* Avatar Profile Trigger */
.avatar-btn { border: 0; cursor: pointer; transition: transform 140ms var(--ease), box-shadow 140ms var(--ease); }
.avatar-btn:hover { transform: scale(1.06); box-shadow: 0 0 0 3px rgba(36, 99, 72, 0.22); }
.avatar-btn.is-active { box-shadow: 0 0 0 3px var(--accent); }

/* Tasks Deal-Room View (Horizontal Task Tabs + Vertical Negotiation Timeline) */
.task-tabs-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 12px;
  margin-bottom: 16px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.task-tab {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--ink-secondary);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background 150ms var(--ease), border-color 150ms var(--ease), color 150ms var(--ease);
}
.task-tab:hover { background: var(--bg-tint); color: var(--ink-primary); }
.task-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}
.task-tab-dot { width: 8px; height: 8px; border-radius: 50%; background: #94a3b8; flex: none; }
.task-tab-dot.running { background: #10b981; }
.task-tab-dot.waiting { background: #f59e0b; }
.task-tab.active .task-tab-dot.running { background: #a7f3d0; }
.task-tab-badge {
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: #e11d48;
  color: #ffffff;
}
.task-tab.active .task-tab-badge { background: #ffffff; color: #be123c; }

.task-hero-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-xl);
  padding: 20px;
  margin-bottom: 22px;
  box-shadow: 0 2px 12px rgba(20, 46, 42, 0.04);
}
.task-hero-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.task-hero-head h3 { margin: 4px 0 6px; font-size: 19px; }
.task-hero-meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: 12px; color: var(--ink-muted); margin-top: 8px; }
.task-hero-meta span { background: var(--bg-raised); padding: 4px 10px; border-radius: 999px; }
.task-hero-compare { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border-hairline); }

.neg-timeline {
  position: relative;
  padding-left: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.neg-timeline::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(36, 99, 72, 0.25), rgba(148, 163, 184, 0.22));
}
.neg-node { position: relative; }
.neg-dot {
  position: absolute;
  left: -25px;
  top: 18px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #246348;
  border: 3px solid #ffffff;
  box-shadow: 0 0 0 2px rgba(36, 99, 72, 0.25);
}
.neg-node.needs-reply .neg-dot { background: #e11d48; box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.22); }
.neg-node.match .neg-dot { background: #059669; box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.22); }
.neg-node.conflict .neg-dot { background: #dc2626; box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.2); }

.neg-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: 0 4px 14px rgba(20, 46, 42, 0.05);
}
.neg-node.needs-reply .neg-card { border-color: rgba(225, 29, 72, 0.35); background: #fffafb; }
.neg-node.match .neg-card { border-color: rgba(5, 150, 105, 0.3); }
.neg-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.neg-time {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--bg-raised);
  color: var(--ink-secondary);
}
.neg-peer { font-size: 15px; font-weight: 600; color: var(--ink-primary); margin: 0; }
.neg-node.needs-reply .neg-peer { color: #be123c; }
.neg-status-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--bg-raised);
  color: var(--ink-secondary);
}
.neg-node.needs-reply .neg-status-pill { background: #ffe4e6; color: #be123c; }
.neg-node.match .neg-status-pill { background: #d1fae5; color: #065f46; }
.neg-node.conflict .neg-status-pill { background: #fee2e2; color: #991b1b; }
.neg-preview { margin: 6px 0 0; font-size: 13.5px; color: var(--ink-secondary); line-height: 1.5; }
.neg-inline-reply { margin-top: 12px; padding-top: 12px; border-top: 1px dashed rgba(225, 29, 72, 0.25); }
.neg-expand { margin-top: 12px; }
.neg-expand > summary { cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--accent-ink); }
.neg-messages { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.neg-msg { padding: 9px 12px; border-radius: 10px; font-size: 13px; line-height: 1.45; max-width: 90%; }
.neg-msg.you { align-self: flex-end; background: var(--bg-tint); color: var(--ink-primary); }
.neg-msg.counterpart { align-self: flex-start; background: var(--bg-raised); color: var(--ink-primary); }
.neg-msg small { display: block; font-size: 10.5px; color: var(--ink-muted); margin-bottom: 2px; }
.neg-msg-media { margin-top: 8px; }
.neg-msg-media img, .neg-msg-media video { display: block; max-width: 100%; max-height: 240px; border-radius: 8px; object-fit: cover; }

/* Card Bottom-Right Talk Icon & Slide-Down Bordered Composer */
.neg-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.neg-talk-btn {
  margin-left: auto;
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--bg-raised);
  color: var(--ink-secondary);
  cursor: pointer;
  transition: transform 140ms var(--ease), background 150ms var(--ease), color 150ms var(--ease), box-shadow 150ms var(--ease);
}
.neg-talk-btn:hover { transform: scale(1.07); }
.neg-talk-btn.needs-reply { background: #ffe4e6; border-color: rgba(225, 29, 72, 0.35); color: #be123c; }
.neg-talk-btn.is-answered { background: #d1fae5; border-color: rgba(5, 150, 105, 0.35); color: #065f46; }
.neg-talk-btn.is-open { box-shadow: 0 0 0 3px rgba(36, 99, 72, 0.22); }
.neg-talk-btn svg { width: 17px; height: 17px; }

.neg-composer-wrap {
  margin-top: 10px;
  animation: sheet-up 180ms var(--ease) both;
}
.composer-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1.5px solid var(--border-strong);
  border-radius: 14px;
  background: var(--bg-surface);
  padding: 8px 10px;
  transition: border-color 140ms var(--ease);
}
.composer-box:focus-within { border-color: var(--accent); }
.composer-box textarea,
.composer-box input[type="text"] {
  width: 100%;
  border: 0 !important;
  margin: 0 !important;
  padding: 4px 2px !important;
  background: transparent !important;
  font-size: 13.5px;
  line-height: 1.45;
  resize: vertical;
  min-height: 38px;
}
.composer-box input[type="text"] { min-height: 28px; }
.composer-box textarea:focus,
.composer-box input[type="text"]:focus { outline: none; }
.composer-box-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}
.composer-file-chip {
  margin-right: auto;
  font-size: 11px;
  color: var(--accent-ink);
  background: var(--bg-tint);
  padding: 2px 8px;
  border-radius: 999px;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.composer-icon-btn,
.composer-send-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 9px;
  border: 1px solid var(--border-hairline);
  background: var(--bg-raised);
  color: var(--ink-secondary);
  cursor: pointer;
  flex: none;
  vertical-align: middle;
}
.composer-icon-btn:hover { background: var(--bg-tint); color: var(--ink-primary); }
.composer-send-btn {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}
.composer-send-btn:hover:not(:disabled) { background: var(--accent-hover); }
.composer-send-btn:disabled { opacity: 0.6; cursor: wait; }
.composer-icon-btn svg,
.composer-send-btn svg { width: 16px; height: 16px; }
.composer-secondary-row { display: flex; gap: 8px; margin-top: 8px; justify-content: flex-end; }
.composer-secondary-row button { font-size: 12px; padding: 5px 10px; min-height: 30px; }

/* Two-Sided Criteria Scorecard */
.crit-scorecard { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.crit-group { background: var(--bg-raised); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.crit-group-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-muted); }
.crit-row { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; line-height: 1.4; }
.crit-badge { flex: none; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.crit-badge.ok { background: #d1fae5; color: #065f46; }
.crit-badge.partial { background: #fef3c7; color: #92400e; }
.crit-badge.unclear { background: #e2e8f0; color: #334155; }
.crit-badge.bad { background: #fee2e2; color: #991b1b; }
.crit-body { min-width: 0; flex: 1; }
.crit-body strong { display: block; font-weight: 500; color: var(--ink-primary); }
.crit-ev { margin: 2px 0 0; font-size: 12px; color: var(--ink-secondary); }
.contact-line { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 6px; }
.contact-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--bg-tint);
  color: var(--accent-ink);
  text-decoration: none;
  border: 1px solid rgba(36, 99, 72, 0.18);
}
.contact-chip:hover { background: rgba(36, 99, 72, 0.14); }
.contact-chip.wa { background: #dcfce7; color: #166534; border-color: rgba(22, 101, 52, 0.2); }

/* Responsive */
#logout-mobile { display: none; }
@media (max-width: 1050px) {
  .social-layout { grid-template-columns: minmax(0, 680px); }
  .right-rail { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .agent-rail { grid-column: 1 / -1; }
  .running-task-grid, .priority-manage-list { grid-template-columns: 1fr; }
}
@media (max-width: 850px) {
  .profile-layout, .people-grid { grid-template-columns: 1fr; }
  .profile-card { order: 2; }
}
@media (max-width: 720px) {
  .shell { display: block; padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .sidebar {
    position: fixed;
    z-index: 20;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(64px + env(safe-area-inset-bottom));
    padding: 0 4px env(safe-area-inset-bottom);
    background: var(--bg-surface);
    border-right: 0;
    border-top: 1px solid var(--border-hairline);
    box-shadow: 0 -4px 16px rgba(20, 46, 42, 0.06);
  }
  .sidebar .wordmark, .sidebar-label, .sidebar-bottom { display: none; }
  .sidebar nav { height: 64px; display: flex; justify-content: space-around; gap: 0; }
  .sidebar nav button {
    border-radius: 0;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--ink-muted);
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    height: 100%;
    padding: 4px;
    flex: 1;
    min-width: 0;
  }
  .sidebar nav button span { font-size: 10px; font-weight: 500; }
  .sidebar nav button.active { color: var(--accent); border-top: 2px solid var(--accent); }
  .sidebar nav button.active .nav-icon { color: var(--accent); }
  .topbar { height: 56px; padding: 0 16px; }
  .topbar-mobile-logo { display: block; }
  .topbar .lab-pill { display: none; }
  #logout-mobile { display: inline-grid; place-items: center; color: var(--ink-secondary); padding: 6px; }
  .content { padding: 20px 16px 32px; }
  .content.chat-content { padding: 0 14px; }
  .chat-view { height: calc(100dvh - 120px - env(safe-area-inset-bottom)); min-height: 300px; }
  .right-rail { display: none; }
  .form-card input, .form-card select, .form-card textarea, .composer textarea { font-size: 16px; }
  .pwa-banner { right: 12px; left: 12px; bottom: calc(74px + env(safe-area-inset-bottom)); width: auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

.task-project,.project-thread { margin-block: 1rem; border: 1px solid var(--line, #8884); border-radius: 1rem; padding: .8rem; }
.task-project summary,.project-thread summary { cursor: pointer; font-weight: 600; }
.project-thread summary small { font-weight: 400; margin-inline-start: .5rem; }
.thread-timeline { list-style: none; padding-inline-start: 1rem; margin: 1rem 0 0 .45rem; border-inline-start: 2px solid var(--line, #8886); }
.thread-timeline li { position: relative; padding-block-end: .85rem; overflow-wrap: anywhere; }
.thread-timeline li::before { content: ''; position: absolute; inset-inline-start: -1.3rem; top: .35rem; width: .5rem; height: .5rem; border-radius: 50%; background: currentColor; }
.thread-timeline p,.project-quote,.project-offer output { white-space: pre-wrap; overflow-wrap: anywhere; margin-block: .25rem; }
.project-offer fieldset { min-width: 0; }

.project-compare output,.project-criteria output { display: block; white-space: pre-wrap; margin-block: .45rem; }

/* ChatGPT-style zero-friction welcome chat landing */
.welcome-shell[hidden], .auth-shell[hidden], .shell[hidden] { display: none !important; }
.welcome-shell {
  min-height: 100dvh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg, #f6f4ef);
}
.welcome-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  background: var(--surface, #fff);
  border-bottom: 1px solid var(--line, #e4e1d9);
}
.welcome-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.welcome-unlock-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 20px;
  background: #e8f4f0;
  border-bottom: 1px solid #c5e3d9;
  color: #142e2a;
  font-size: 13.5px;
}
.welcome-unlock-bar[hidden] { display: none !important; }
.welcome-chat-main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  padding: 12px 16px;
}
.welcome-chat-main .chat-shell {
  flex: 1;
  min-height: 0;
  height: 100%;
}
.auth-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
@media (max-width: 640px) {
  .welcome-header { padding: 10px 14px; }
  .welcome-chat-main { padding: 6px 8px; }
  .welcome-unlock-bar { padding: 10px 14px; font-size: 13px; }
}
