:root {
  --bg: #10151c;
  --panel: #151c24;
  --panel-2: #1b2530;
  --text: #dce2e9;
  --muted: #909aa7;
  --line: #2a3543;
  --line-strong: #3f5064;
  --accent: #83a2c2;
  --accent-ink: #0e151d;
  --danger: #e48780;
  --note: #b8a5d3;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: #0c1117; }
body {
  margin: 0;
  min-height: 100svh;
  overflow: hidden;
  color: var(--text);
  background: #0c1117;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }

.app-frame {
  position: relative;
  isolation: isolate;
  height: 100svh;
  display: grid;
  grid-template-rows: 48px minmax(0, 1fr) 34px;
  overflow: hidden;
  background: var(--bg);
}
.app-frame::before {
  content: "";
  position: fixed;
  z-index: 0;
  inset: 0;
  pointer-events: none;
  background-color: #11171e;
  background-image:
    linear-gradient(90deg, transparent 0 12.5%, rgba(133, 148, 161, .18) 12.5% 25%, transparent 25% 50%, rgba(67, 79, 91, .28) 50% 62.5%, transparent 62.5% 87.5%, rgba(151, 163, 174, .1) 87.5%),
    linear-gradient(0deg, rgba(76, 89, 102, .24) 0 12.5%, transparent 12.5% 37.5%, rgba(143, 157, 169, .13) 37.5% 50%, transparent 50% 75%, rgba(50, 61, 72, .28) 75% 87.5%, transparent 87.5%),
    linear-gradient(90deg, transparent 0 37.5%, rgba(103, 119, 134, .16) 37.5% 50%, transparent 50% 75%, rgba(46, 57, 68, .3) 75% 100%),
    linear-gradient(0deg, transparent 0 25%, rgba(123, 139, 153, .12) 25% 37.5%, transparent 37.5% 62.5%, rgba(57, 69, 80, .24) 62.5% 75%, transparent 75%);
  background-position: 0 0, 32px 16px, 72px 44px, 16px 68px;
  background-size: 160px 128px, 128px 160px, 192px 192px, 96px 96px;
}
.app-frame::after {
  content: "";
  position: fixed;
  z-index: 0;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 47%, rgba(15, 20, 27, .98) 0 38%, rgba(15, 20, 27, .88) 64%, rgba(15, 20, 27, .48) 100%);
}
.global-bar, .global-footer, .screen {
  position: relative;
  z-index: 1;
}
.global-bar, .global-footer {
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-color: var(--line);
  background: rgba(13, 18, 24, .94);
}
.global-bar { border-bottom: 1px solid var(--line); }
.global-footer { border-top: 1px solid var(--line); color: var(--muted); font: 600 .65rem/1 ui-monospace, Consolas, monospace; }
.global-footer button { padding: 0; border: 0; color: inherit; background: none; text-decoration: underline; text-underline-offset: 3px; }
.wordmark { color: var(--text); text-decoration: none; font: 800 .79rem/1 ui-monospace, Consolas, monospace; letter-spacing: .13em; }
.wordmark span { color: var(--accent); }
.global-actions { display: flex; align-items: center; gap: 13px; min-width: 0; }
.language-picker { margin: 0; display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: .62rem; }
.language-picker select { width: auto; min-width: 104px; height: 30px; padding: 0 26px 0 8px; border-radius: 5px; font-size: .66rem; }
.push-control {
  min-height: 30px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--muted);
  background: transparent;
  font: 650 .66rem/1 ui-sans-serif, sans-serif;
  transition: color 120ms ease, border-color 120ms ease, background 120ms ease;
}
.push-control:hover { color: var(--text); border-color: var(--line-strong); }
.push-control:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.push-control:disabled { cursor: wait; opacity: .55; }
.push-control svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.push-control.is-enabled { color: var(--accent); border-color: rgba(131,162,194,.34); background: rgba(131,162,194,.07); }
.push-control.is-denied, .push-control.is-error { color: var(--danger); border-color: rgba(228,135,128,.3); }
.network-state { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: .69rem; }
.network-dot, .presence-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.network-state.is-safe .network-dot, .presence-dot { background: var(--accent); box-shadow: 0 0 0 3px rgba(131,162,194,.09); }
.network-state.is-warning .network-dot { background: #ffd36a; }

.screen { min-height: 0; display: none; animation: screen-in 220ms cubic-bezier(.22,.8,.3,1) both; }
.screen.is-active { display: flex; }
.eyebrow { margin: 0 0 12px; color: var(--accent); font: 700 .66rem/1 ui-monospace, Consolas, monospace; letter-spacing: .15em; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 22px; font-size: clamp(2.8rem, 7vw, 5.8rem); line-height: .94; letter-spacing: -.058em; font-weight: 730; }
h2 { margin-bottom: 8px; font-size: 1.25rem; line-height: 1.1; letter-spacing: -.025em; }
.lede { max-width: 620px; color: var(--muted); font-size: clamp(.96rem, 2vw, 1.15rem); line-height: 1.55; }

#landing-screen { padding: clamp(30px, 7vw, 92px); align-items: flex-end; justify-content: space-between; gap: 40px; }
.landing-copy { max-width: 830px; }
.landing-actions { width: min(100%, 330px); }
.landing-actions p { margin: 14px 0 0; color: var(--muted); font-size: .74rem; line-height: 1.5; }

.install-screen {
  position: relative;
  overflow-y: auto;
  padding: clamp(32px, 8vw, 112px);
  align-items: safe center;
  justify-content: center;
  background: transparent;
}
.install-screen::before {
  content: "";
  position: absolute;
  inset: clamp(14px, 3vw, 32px);
  border: 1px solid rgba(131,162,194,.12);
  pointer-events: none;
}
.install-stage {
  position: relative;
  width: min(100%, 760px);
  padding-left: clamp(18px, 4vw, 38px);
}
.install-stage::before {
  content: "";
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: 0;
  width: 2px;
  background: var(--accent);
}
.install-stage h1 { max-width: 760px; margin-bottom: 24px; font-size: clamp(3.6rem, 9vw, 7rem); }
.install-stage .lede { max-width: 590px; }

.user-auth-screen {
  position: relative;
  isolation: isolate;
  overflow-y: auto;
  padding: clamp(22px, 5vw, 72px) clamp(18px, 6vw, 86px);
  align-items: safe center;
  justify-content: space-between;
  gap: clamp(36px, 7vw, 110px);
  background: transparent;
}
.user-auth-screen::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 18px;
  border: 1px solid rgba(131,162,194,.1);
  pointer-events: none;
}
.user-auth-copy { width: min(100%, 720px); }
.user-auth-copy h1 { max-width: 720px; margin-bottom: 24px; font-size: clamp(3.3rem, 7.5vw, 6.3rem); }
.user-auth-copy .lede { max-width: 580px; }
.install-hero {
  width: min(100%, 580px);
  min-height: 78px;
  margin-top: 28px;
  padding: 10px 16px 10px 10px;
  display: grid;
  grid-template-columns: 52px minmax(0,1fr) auto;
  align-items: center;
  gap: 13px;
  border: 1px solid var(--accent);
  border-radius: 9px;
  color: var(--accent-ink);
  background: var(--accent);
  text-align: left;
  transition: transform 140ms ease, box-shadow 140ms ease;
}
.install-hero:hover { transform: translateY(-2px); box-shadow: 0 16px 38px rgba(0,0,0,.28); }
.install-hero:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
.install-hero-mark { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 5px; color: var(--accent); background: var(--accent-ink); font-size: 1.3rem; }
.install-hero strong, .install-hero small { display: block; }
.install-hero strong { margin-bottom: 5px; font-size: .94rem; }
.install-hero small { opacity: .72; font-size: .64rem; line-height: 1.35; }
.user-auth-panel {
  width: min(100%, 510px);
  flex: 0 0 auto;
  padding: clamp(20px, 3vw, 32px);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(21,28,36,.96);
  box-shadow: 0 28px 80px rgba(0,0,0,.34);
}
.auth-mode-switch { display: grid; grid-template-columns: 1fr 1fr; margin: 0 0 28px; border-bottom: 1px solid var(--line); }
.auth-mode-switch button { min-height: 38px; padding: 0 8px; border: 0; border-bottom: 2px solid transparent; color: var(--muted); background: transparent; font-size: .68rem; font-weight: 750; }
.auth-mode-switch button.is-active { border-bottom-color: var(--accent); color: var(--text); }
.form-heading h2 { margin-bottom: 7px; font-size: clamp(1.7rem, 4vw, 2.25rem); }
.form-heading > p:not(.eyebrow) { margin-bottom: 4px; color: var(--muted); font-size: .73rem; line-height: 1.5; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.user-auth-panel label { margin-top: 14px; }
.user-auth-panel .button { width: 100%; margin-top: 8px; }
.form-status { min-height: 18px; margin: 10px 0 0; color: var(--danger); font-size: .67rem; line-height: 1.4; }
.identity-privacy { margin: 17px 0 0; padding-top: 15px; border-top: 1px solid var(--line); color: var(--muted); font-size: .64rem; line-height: 1.5; }
.identity-privacy button { padding: 0; border: 0; color: var(--accent); background: transparent; text-decoration: underline; text-underline-offset: 3px; }
.code-input { font: 750 .83rem/1 ui-monospace, Consolas, monospace !important; letter-spacing: .08em; text-transform: uppercase; }

.user-code-screen { overflow-y: auto; padding: 30px; align-items: safe center; justify-content: center; background: transparent; }
.user-code-panel { width: min(100%, 690px); }
.user-code-panel h1 { margin-bottom: 24px; font-size: clamp(3.2rem, 8vw, 5.8rem); }
.user-code-panel .lede strong { color: var(--text); white-space: nowrap; }
.code-display { height: 68px !important; padding: 0 18px !important; border-color: var(--accent) !important; color: var(--accent) !important; background: rgba(131,162,194,.06) !important; font: 800 clamp(1rem, 4vw, 1.65rem)/1 ui-monospace, Consolas, monospace !important; letter-spacing: .075em; text-align: center; }
.user-code-panel .button { width: 100%; margin-top: 10px; }
.code-warning { margin: 12px 0 0; color: var(--danger); font-size: .7rem; line-height: 1.45; }

.user-home-screen {
  overflow-y: auto;
  padding: clamp(28px, 7vw, 86px);
  align-items: safe center;
  justify-content: space-between;
  gap: clamp(42px, 8vw, 120px);
  background: transparent;
}
.user-home-copy { width: min(100%, 760px); }
.user-home-copy h1 { max-width: 760px; font-size: clamp(3.3rem, 7.5vw, 6.3rem); }
.user-home-panel {
  width: min(100%, 430px);
  flex: 0 0 auto;
  padding: clamp(22px, 3vw, 32px);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(21,28,36,.96);
  box-shadow: 0 28px 80px rgba(0,0,0,.34);
}
.user-session-badge { margin-bottom: 30px; display: flex; align-items: center; gap: 9px; color: var(--accent); font: 700 .64rem/1 ui-monospace, Consolas, monospace; text-transform: uppercase; letter-spacing: .08em; }
.user-home-panel h2 { margin-bottom: 7px; font-size: clamp(1.7rem, 4vw, 2.25rem); overflow-wrap: anywhere; }
.user-home-phone { margin-bottom: 25px; color: var(--muted); font: 700 .76rem/1.4 ui-monospace, Consolas, monospace; overflow-wrap: anywhere; }
.user-home-guidance { padding: 18px 0; border-block: 1px solid var(--line); }
.user-home-guidance p { margin: 0; color: var(--muted); font-size: .72rem; line-height: 1.55; }
.user-home-guidance p + p { margin-top: 11px; color: var(--text); }
.user-home-panel .button { width: 100%; margin-top: 20px; }
.user-chat-access { padding: 18px 0; border-bottom: 1px solid var(--line); }
.user-chat-access .button { margin-top: 0; }
.user-chat-access .form-status { margin: 8px 0 -5px; }
#user-logout-button { margin-top: 18px; }
.user-home-panel .form-status { margin-bottom: -8px; }
.button { min-height: 48px; padding: 0 15px; border-radius: 6px; display: flex; align-items: center; justify-content: space-between; border: 1px solid var(--line-strong); text-decoration: none; font-weight: 700; transition: transform 120ms ease, border-color 120ms ease, background 120ms ease; }
.button:active { transform: scale(.988); }
.button-primary { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.button-primary:hover { background: #91afcd; border-color: #91afcd; }
.button-secondary { width: 100%; color: var(--text); background: var(--panel-2); }
.button-secondary:hover { border-color: var(--accent); background: #202c39; }
.button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.button:disabled { opacity: .42; cursor: not-allowed; }

.auth-screen { padding: clamp(28px, 7vw, 86px); align-items: safe center; justify-content: space-between; gap: 50px; overflow: auto; }
.auth-copy { max-width: 760px; }
.auth-panel { width: min(100%, 430px); padding: 26px; border: 1px solid var(--line-strong); border-radius: 12px; background: rgba(21,28,36,.96); box-shadow: 0 24px 70px rgba(0,0,0,.3); }
.auth-panel h2 { margin-bottom: 22px; }
.auth-panel details { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.auth-panel summary { color: var(--muted); font-size: .8rem; font-weight: 700; }
.auth-panel details p { margin: 18px 0 0; color: var(--muted); font-size: .76rem; line-height: 1.5; }
label { display: block; margin: 17px 0 8px; color: var(--muted); font-size: .72rem; font-weight: 700; }
label span { font-weight: 500; }
textarea, input:not([type="checkbox"]), select { width: 100%; border: 1px solid var(--line-strong); border-radius: 6px; outline: none; background: var(--panel-2); color: var(--text); }
textarea { padding: 12px; resize: none; line-height: 1.45; }
input:not([type="checkbox"]), select { height: 46px; padding: 0 12px; }
select { color-scheme: dark; }
textarea:focus, input:focus, select:focus { border-color: var(--accent); }
.auth-panel textarea { font: .72rem/1.45 ui-monospace, Consolas, monospace; overflow-wrap: anywhere; }
.auth-panel .button { width: 100%; margin-top: 14px; justify-content: center; }

.recovery-screen { overflow: auto; align-items: safe center; justify-content: center; padding: 30px; }
.recovery-panel { width: min(100%, 620px); }
.recovery-panel h1 { font-size: clamp(3rem, 8vw, 5.6rem); }
.recovery-panel textarea { min-height: 126px; font: .72rem/1.5 ui-monospace, Consolas, monospace; overflow-wrap: anywhere; }
.recovery-panel .button { width: 100%; margin-top: 10px; justify-content: center; }
.confirm-row { display: flex; align-items: flex-start; gap: 9px; margin: 18px 0; color: var(--text); font-size: .78rem; }
.confirm-row input { margin: 2px 0 0; accent-color: var(--accent); }

.visitor-screen { width: min(100%, 880px); margin: 0 auto; flex-direction: column; border-inline: 1px solid var(--line); background: rgba(21,28,36,.98); box-shadow: 0 0 64px rgba(0,0,0,.24); }
.conversation-bar { min-height: 64px; padding: 10px 16px; display: flex; align-items: center; gap: 11px; border-bottom: 1px solid var(--line); background: var(--panel); }
.conversation-bar h2 { margin: 0 0 5px; font-size: .91rem; }
.conversation-bar p { margin: 0; color: var(--muted); font-size: .66rem; }
.translation-control { margin: 0 0 0 auto; display: grid; grid-template-columns: auto 48px; align-items: center; gap: 3px 8px; color: var(--muted); font-size: .6rem; }
.translation-control > span { font-weight: 750; letter-spacing: .02em; }
.translation-control select { height: 30px; padding: 0 7px; border: 1px solid var(--line-strong); border-radius: 5px; outline: none; color: var(--text); background: var(--panel-2); font: 750 .65rem/1 ui-monospace, Consolas, monospace; }
.translation-control select:focus { border-color: var(--accent); }
.translation-control small { grid-column: 1 / -1; color: var(--accent); text-align: right; font: 600 .54rem/1 ui-monospace, Consolas, monospace; }
.translation-control small.is-warning { color: #ffd36a; }
.avatar { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: .77rem; font-weight: 850; }
.visitor-avatar { color: var(--text); background: var(--panel-2); border: 1px solid var(--line-strong); }
.icon-button { width: 32px; height: 32px; margin-left: auto; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--muted); }
.conversation-actions { margin-left: auto; display: flex; gap: 7px; }
.conversation-actions .icon-button { margin-left: 0; }
.referral-arrival { padding: 10px 12px; border: 1px solid rgba(131,162,194,.2); border-radius: 6px; background: rgba(131,162,194,.06); color: var(--text) !important; text-align: left; }
.message-stream { flex: 1; min-height: 0; padding: 22px clamp(14px, 4vw, 34px); overflow-y: auto; scrollbar-color: var(--line-strong) transparent; }
.chat-intro { width: min(100%, 420px); margin: max(5vh, 20px) auto; text-align: center; }
.chat-intro label { text-align: left; }
.chat-intro p, .conversation-empty p { color: var(--muted); font-size: .8rem; line-height: 1.55; }
.lock-mark { display: grid; place-items: center; width: 45px; height: 45px; margin: 0 auto 18px; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--accent); font-size: 1.25rem; }
.composer { min-height: 66px; padding: 10px 12px calc(10px + var(--safe-bottom)); display: grid; grid-template-columns: 42px minmax(0,1fr) 42px; gap: 8px; align-items: end; border-top: 1px solid var(--line); background: var(--panel); }
.composer textarea { grid-column: 2; grid-row: 2; max-height: 126px; min-height: 42px; padding: 10px 12px; background: var(--bg); }
.send-button { width: 42px; height: 42px; padding: 0; border: 0; border-radius: 50%; color: var(--accent-ink); background: var(--accent); font-size: 1.25rem; font-weight: 800; }
.composer .send-button { grid-column: 3; grid-row: 2; }
.send-button:disabled { opacity: .4; }
.visually-hidden { position: fixed !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
.attach-button { grid-column: 1; grid-row: 2; width: 42px; height: 42px; padding: 0; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--muted); background: transparent; }
.attach-button:hover { color: var(--text); background: var(--panel-2); }
.attach-button:disabled { opacity: .35; cursor: not-allowed; }
.attach-button:focus-visible, .attachment-action:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.attach-button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.attachment-queue { grid-column: 1 / -1; grid-row: 1; display: grid; gap: 6px; }
.attachment-queue-item { position: relative; min-width: 0; padding: 8px 9px; display: grid; grid-template-columns: 30px minmax(0,1fr) auto; align-items: center; gap: 8px; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: var(--bg); }
.attachment-queue-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 5px; color: var(--accent); background: rgba(131,162,194,.08); font: 800 .55rem/1 ui-monospace, Consolas, monospace; }
.attachment-queue-copy { min-width: 0; }
.attachment-queue-copy strong, .attachment-queue-copy span { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.attachment-queue-copy strong { font-size: .7rem; }
.attachment-queue-copy span { margin-top: 4px; color: var(--muted); font: .57rem/1 ui-monospace, Consolas, monospace; }
.attachment-queue-item.is-error { border-color: rgba(255,128,115,.4); }
.attachment-queue-actions { display: flex; align-items: center; gap: 2px; }
.attachment-queue-progress { position: absolute; inset: auto 0 0; height: 2px; background: rgba(131,162,194,.14); }
.attachment-queue-progress span { display: block; width: var(--progress, 0%); height: 100%; background: var(--accent); transition: width 120ms ease; }
.attachment-queue-action { width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; color: var(--muted); background: transparent; font-size: .9rem; }
.attachment-queue-action:hover { color: var(--text); background: var(--panel-2); }
.attachment-hint { grid-column: 1 / -1; grid-row: 3; margin: -1px 3px 0; color: var(--muted); font: .54rem/1.25 ui-monospace, Consolas, monospace; }
.attachment-composer.is-dragging { box-shadow: inset 0 0 0 2px rgba(131,162,194,.42); background: #17212b; }
.message-row { display: flex; margin: 5px 0; }
.message-row.is-own { justify-content: flex-end; }
.message-bubble { max-width: min(78%, 560px); padding: 9px 12px 7px; border: 1px solid var(--line); border-radius: 13px 13px 13px 3px; background: var(--panel-2); }
.is-own .message-bubble { border-color: rgba(131,162,194,.24); border-radius: 13px 13px 3px 13px; background: #1d3041; }
.message-row.is-note { justify-content: center; }
.is-note .message-bubble { max-width: 88%; border-color: rgba(215,183,255,.23); border-radius: 7px; background: rgba(215,183,255,.07); color: #eadbff; }
.message-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .86rem; line-height: 1.48; }
.message-text:empty { display: none; }
.message-attachments { margin-top: 7px; display: grid; gap: 7px; }
.message-attachment { min-width: min(280px, 68vw); padding: 9px; border: 1px solid var(--line); border-radius: 8px; background: rgba(0,0,0,.13); }
.message-attachment-head { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 8px; }
.message-attachment-copy { min-width: 0; }
.message-attachment-copy strong, .message-attachment-copy span { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.message-attachment-copy strong { font-size: .72rem; }
.message-attachment-copy span { margin-top: 4px; color: var(--muted); font: .56rem/1 ui-monospace, Consolas, monospace; }
.attachment-action { min-height: 30px; padding: 0 9px; border: 1px solid var(--line-strong); border-radius: 5px; color: var(--text); background: var(--panel-2); font-size: .62rem; font-weight: 750; }
.attachment-action:disabled { opacity: .45; cursor: not-allowed; }
.attachment-preview { margin-top: 8px; overflow: hidden; border-radius: 6px; background: #080d12; }
.attachment-preview img, .attachment-preview video { width: 100%; max-height: min(48vh, 420px); display: block; object-fit: contain; }
.attachment-error { margin: 7px 0 0; color: var(--danger); font-size: .62rem; line-height: 1.35; }
.message-translation { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); font-size: .82rem; line-height: 1.48; }
.message-translation.is-pending, .message-translation.is-unavailable { color: var(--muted); font-size: .68rem; }
.message-translation.is-same-language { display: none; }
.translation-label { display: block; margin-bottom: 5px; color: var(--accent); font: 700 .52rem/1 ui-monospace, Consolas, monospace; letter-spacing: .09em; }
.message-meta { margin: 5px 0 0; color: var(--muted); text-align: right; font: .58rem/1 ui-monospace, Consolas, monospace; }
.day-divider { margin: 18px 0 10px; color: var(--muted); text-align: center; font-size: .62rem; }

.workspace { min-height: 0; background: var(--panel); }
.inbox-panel { width: 330px; min-width: 280px; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: var(--bg); }
.inbox-head { padding: 18px 16px 12px; display: flex; align-items: center; justify-content: space-between; }
.inbox-head .eyebrow { margin-bottom: 7px; }
.inbox-head h2 { margin: 0; font-size: 1.45rem; }
.count-badge { min-width: 24px; height: 24px; padding: 0 7px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); font-size: .65rem; }
.manager-identity { margin: 0 10px 10px; padding: 11px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); }
.manager-identity > span { display: block; color: var(--muted); font-size: .62rem; }
.manager-identity strong { display: block; margin: 5px 0 10px; overflow: hidden; text-overflow: ellipsis; font: 700 .72rem/1.2 ui-monospace, Consolas, monospace; }
.identity-actions { display: grid; grid-template-columns: 1fr auto; gap: 6px; }
.identity-actions button { min-height: 32px; border: 1px solid var(--line-strong); border-radius: 5px; background: transparent; color: var(--text); font-size: .65rem; font-weight: 700; }
.chat-list { flex: 1; min-height: 0; overflow-y: auto; }
.chat-list-item { width: 100%; padding: 12px 14px; display: grid; grid-template-columns: 35px minmax(0,1fr) auto; gap: 10px; align-items: center; border: 0; border-top: 1px solid var(--line); background: transparent; color: var(--text); text-align: left; }
.chat-list-item:last-child { border-bottom: 1px solid var(--line); }
.chat-list-item:hover, .chat-list-item.is-active { background: var(--panel-2); }
.chat-list-item .avatar { width: 35px; height: 35px; color: var(--text); background: var(--panel); border: 1px solid var(--line-strong); }
.chat-list-copy { min-width: 0; }
.chat-list-copy strong, .chat-list-copy span { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.chat-list-copy strong { margin-bottom: 5px; font-size: .77rem; }
.chat-list-copy span, .chat-list-time { color: var(--muted); font-size: .61rem; }
.empty-list { padding: 34px 18px; color: var(--muted); text-align: center; font-size: .72rem; line-height: 1.6; }
.quiet-button { min-height: 42px; border: 0; border-top: 1px solid var(--line); background: transparent; color: var(--muted); font-size: .68rem; }
.manager-conversation { flex: 1; min-width: 0; min-height: 0; position: relative; }
.referral-review { min-height: 58px; padding: 9px 16px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); background: #121923; }
.referral-review p { margin: 4px 0 0; font-size: .73rem; }
.referral-kicker { color: var(--accent); font: 700 .52rem/1 ui-monospace, Consolas, monospace; letter-spacing: .11em; }
.referral-review-actions { display: flex; gap: 5px; }
.referral-review-actions button { min-height: 30px; padding: 0 9px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); background: transparent; font-size: .61rem; font-weight: 750; }
.referral-review-actions button.is-active { border-color: var(--accent); color: var(--accent); background: rgba(131,162,194,.08); }
.referral-review-actions button[data-referral-status="rejected"].is-active { border-color: var(--danger); color: var(--danger); background: rgba(255,128,115,.06); }
.conversation-empty { position: absolute; inset: 0; display: grid; place-content: center; padding: 30px; text-align: center; }
.conversation-empty .lock-mark { margin-bottom: 18px; }
.conversation-active { height: 100%; display: flex; flex-direction: column; }
.manager-composer { grid-template-columns: auto 42px minmax(0,1fr) 42px; }
.manager-composer .manager-quick-prompts { grid-column: 1 / -1; grid-row: 1; }
.manager-composer .attachment-queue { grid-row: 2; }
.manager-composer .compose-mode { grid-column: 1; grid-row: 3; }
.manager-composer .attach-button { grid-column: 2; grid-row: 3; }
.manager-composer textarea { grid-column: 3; grid-row: 3; }
.manager-composer .send-button { grid-column: 4; grid-row: 3; }
.manager-composer .attachment-hint { grid-column: 2 / -1; grid-row: 4; }
.manager-quick-prompts { display: flex; flex-wrap: wrap; gap: 6px; }
.manager-quick-prompts button { min-height: 32px; padding: 0 10px; border: 1px solid rgba(131,162,194,.35); border-radius: 5px; color: var(--accent); background: rgba(131,162,194,.07); font-size: .62rem; font-weight: 750; }
.manager-quick-prompts button:hover { border-color: var(--accent); background: rgba(131,162,194,.12); }
.manager-quick-prompts button:disabled { opacity: .42; cursor: not-allowed; }
.compose-mode { align-self: center; display: flex; gap: 3px; }
.compose-mode button { min-height: 30px; padding: 0 9px; border: 1px solid var(--line); border-radius: 5px; background: transparent; color: var(--muted); font-size: .62rem; }
.compose-mode button.is-active { border-color: var(--line-strong); background: var(--panel-2); color: var(--text); }
.mobile-back { display: none; margin-left: 0; }

.quick-prompt { min-width: min(330px, 68vw); }
.quick-prompt-title { margin: 0; font-weight: 750; }
.quick-prompt-actions { margin-top: 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.quick-prompt-actions button { min-height: 36px; border: 1px solid var(--line-strong); border-radius: 6px; color: var(--text); background: var(--panel); font-size: .72rem; font-weight: 750; }
.quick-prompt-actions button:first-child { border-color: var(--accent); color: var(--accent); }
.quick-prompt-actions button:hover:not(:disabled) { background: rgba(131,162,194,.1); }
.quick-prompt-actions button:disabled { opacity: .45; cursor: not-allowed; }
.quick-prompt-status { min-height: 16px; margin: 8px 0 0; color: var(--muted); font-size: .62rem; line-height: 1.35; }
.quick-prompt-status.is-error { color: var(--danger); }
.quick-prompt-response { color: var(--accent); font-weight: 750; }

.meta-consent { position: fixed; z-index: 12; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, calc(16px + env(safe-area-inset-bottom))); width: min(520px, calc(100% - 32px)); padding: 18px; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 16px; border: 1px solid var(--line-strong); border-radius: 10px; background: rgba(21,28,36,.98); box-shadow: 0 24px 64px rgba(0,0,0,.45); }
.meta-consent strong { display: block; margin-bottom: 7px; font-size: .82rem; }
.meta-consent p { margin: 0; color: var(--muted); font-size: .68rem; line-height: 1.5; }
.meta-consent-actions { display: flex; align-items: end; gap: 7px; }
.meta-consent-actions .button { min-height: 38px; padding-inline: 11px; font-size: .65rem; }

dialog { width: min(calc(100% - 28px), 500px); padding: 0; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--panel); color: var(--text); }
dialog::backdrop { background: rgba(0,0,0,.78); backdrop-filter: blur(5px); }
.dialog-body { padding: 27px; }
.dialog-body h2 { font-size: 2rem; }
.dialog-body > p:not(.eyebrow) { color: var(--muted); font-size: .81rem; line-height: 1.6; }
.dialog-body .button { width: 100%; margin-top: 22px; justify-content: center; }
.referral-link-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 7px; }
.referral-link-row input { min-width: 0; font: .66rem/1 ui-monospace, Consolas, monospace; }
.referral-link-row button { padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 6px; color: var(--text); background: var(--panel-2); font-size: .68rem; font-weight: 750; }
.referral-summary { margin: 18px 0 10px; display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: 7px; }
.referral-summary > div { padding: 14px; }
.referral-summary > div + div { border-left: 1px solid var(--line); }
.referral-summary strong, .referral-summary span { display: block; }
.referral-summary strong { color: var(--accent); font: 800 1.35rem/1 ui-monospace, Consolas, monospace; }
.referral-summary span { margin-top: 6px; color: var(--muted); font-size: .64rem; }
.referral-list { max-height: 230px; overflow-y: auto; }
.referral-list-item { padding: 10px 2px; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; border-bottom: 1px solid var(--line); }
.referral-list-item strong, .referral-list-item span { display: block; }
.referral-list-item strong { margin-bottom: 4px; font-size: .75rem; }
.referral-list-item span { color: var(--muted); font-size: .61rem; }
.referral-status { align-self: center; padding: 5px 7px; border: 1px solid var(--line); border-radius: 99px; font: 700 .55rem/1 ui-monospace, Consolas, monospace; }
.referral-status.is-approved { border-color: rgba(131,162,194,.42); color: var(--accent); }
.referral-status.is-rejected { border-color: rgba(255,128,115,.4); color: var(--danger); }
.toast { position: fixed; z-index: 10; left: 50%; bottom: calc(48px + var(--safe-bottom)); max-width: calc(100% - 32px); padding: 10px 14px; transform: translate(-50%, 12px); opacity: 0; pointer-events: none; border-radius: 6px; background: var(--text); color: var(--bg); font-size: .72rem; font-weight: 750; transition: opacity 150ms ease, transform 150ms ease; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.toast.is-error { background: var(--danger); }
.is-hidden { display: none !important; }

@keyframes screen-in { from { opacity: 0; transform: translateY(7px); } }
@media (max-width: 820px) {
  #landing-screen, .auth-screen, .user-auth-screen, .user-home-screen { flex-direction: column; align-items: stretch; justify-content: flex-start; }
  .app-frame::after { background: radial-gradient(ellipse at 50% 44%, rgba(15,20,27,.96) 0 42%, rgba(15,20,27,.78) 72%, rgba(15,20,27,.42) 100%); }
  .user-auth-screen { background: transparent; }
  .user-auth-copy { padding-top: 18px; }
  .user-auth-panel { width: 100%; }
  .landing-actions, .auth-panel { width: 100%; }
  .workspace.show-conversation .inbox-panel { display: none; }
  .workspace:not(.show-conversation) .manager-conversation { display: none; }
  .inbox-panel { width: 100%; border-right: 0; }
  .mobile-back { display: block; }
}
@media (max-width: 560px) {
  .app-frame { grid-template-rows: 44px minmax(0,1fr) 30px; }
  .global-bar { padding-inline: 13px; }
  .global-actions { gap: 9px; }
  .language-picker > span { display: none; }
  .language-picker select { min-width: 96px; }
  .push-control { width: 32px; min-height: 32px; padding: 0; justify-content: center; }
  .push-control span { display: none; }
  .global-footer { padding-inline: 13px; }
  #landing-screen, .install-screen, .auth-screen, .recovery-screen, .user-auth-screen, .user-code-screen, .user-home-screen { padding: 24px 18px; }
  .install-screen::before, .user-auth-screen::before { inset: 8px; }
  .install-stage { padding-left: 18px; }
  .install-stage h1 { font-size: clamp(3.2rem, 16vw, 5rem); }
  .user-auth-copy h1 { font-size: clamp(3rem, 14vw, 4.5rem); }
  .form-grid { grid-template-columns: 1fr; }
  .user-auth-panel { padding: 20px 16px; }
  .code-display { font-size: .96rem !important; letter-spacing: .035em; }
  .user-home-copy { padding-top: 18px; }
  .user-home-copy h1 { font-size: clamp(3rem, 14vw, 4.5rem); }
  .user-home-panel { padding: 24px 20px; }
  h1 { font-size: clamp(2.7rem, 13vw, 4.1rem); }
  .visitor-screen { border-inline: 0; }
  .manager-composer { grid-template-columns: 42px minmax(0,1fr) 42px; }
  .manager-composer .manager-quick-prompts { grid-row: 1; }
  .manager-composer .attachment-queue { grid-row: 2; }
  .manager-composer .compose-mode { grid-column: 1 / -1; grid-row: 3; }
  .manager-composer .attach-button { grid-column: 1; grid-row: 4; }
  .manager-composer textarea { grid-column: 2; grid-row: 4; }
  .manager-composer .send-button { grid-column: 3; grid-row: 4; }
  .manager-composer .attachment-hint { grid-column: 1 / -1; grid-row: 5; }
  .manager-quick-prompts { display: grid; grid-template-columns: 1fr 1fr; }
  .manager-quick-prompts button { min-height: 38px; padding: 6px 8px; line-height: 1.25; }
  .meta-consent { right: 12px; bottom: max(12px, calc(12px + env(safe-area-inset-bottom))); width: calc(100% - 24px); grid-template-columns: 1fr; }
  .meta-consent-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .message-bubble { max-width: 88%; }
  .manager-conversation .conversation-bar { flex-wrap: wrap; }
  .referral-review { align-items: stretch; flex-direction: column; }
  .referral-review-actions { display: grid; grid-template-columns: repeat(3, 1fr); }
  .translation-control { width: 100%; margin-left: 44px; grid-template-columns: 1fr 48px; }
  .translation-control small { text-align: left; }
}

html[dir="rtl"] .icon-button { margin-right: auto; margin-left: 0; }
html[dir="rtl"] .chat-intro label { text-align: right; }
html[dir="rtl"] .message-row.is-own { justify-content: flex-start; }
html[dir="rtl"] .message-meta { text-align: left; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Manager CRM */
.crm-workspace {
  --crm-ink: #172033;
  --crm-muted: #697386;
  --crm-line: #e2e6ec;
  --crm-surface: #ffffff;
  --crm-canvas: #f5f6f8;
  width: 100%;
  color: var(--crm-ink);
  background: var(--crm-canvas);
  overflow: hidden;
}
.crm-rail {
  width: 190px;
  flex: 0 0 190px;
  min-height: 0;
  padding: 18px 12px 14px;
  display: flex;
  flex-direction: column;
  color: #f7f8fb;
  background: #121826;
  border-right: 1px solid #20293a;
}
.crm-rail-brand { height: 44px; padding: 0 8px; display: flex; align-items: center; gap: 10px; font-size: .87rem; }
.crm-brand-mark { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 8px; color: #fff; background: #4775f2; font-size: .72rem; font-weight: 850; box-shadow: 0 6px 18px rgba(71,117,242,.28); }
.crm-nav { margin-top: 24px; display: grid; gap: 4px; }
.crm-nav button { min-height: 40px; padding: 0 10px; display: flex; align-items: center; gap: 10px; border: 0; border-radius: 8px; color: #98a2b5; background: transparent; text-align: left; font-size: .76rem; font-weight: 700; transition: color 150ms ease, background 150ms ease, transform 150ms ease; }
.crm-nav button:hover { color: #fff; background: #1a2333; transform: translateX(2px); }
.crm-nav button.is-active { color: #fff; background: #25324a; }
.crm-nav button span { width: 16px; color: #7f8ba1; text-align: center; }
.crm-nav button b { min-width: 20px; margin-left: auto; padding: 4px 6px; border-radius: 99px; color: #cbd3df; background: #313c50; font: 700 .58rem/1 ui-monospace, Consolas, monospace; text-align: center; }
.crm-rail-account { margin-top: auto; padding: 14px 8px; border-top: 1px solid #273044; }
.crm-rail-account > span { display: block; color: #7f8ba1; font-size: .62rem; }
.crm-rail-account > strong { display: block; margin: 7px 0 10px; overflow: hidden; color: #d9dfE9; font: 700 .63rem/1.2 ui-monospace, Consolas, monospace; text-overflow: ellipsis; }
.crm-rail .identity-actions button { color: #aeb8c9; border-color: #344057; background: #182131; }
.crm-lock { min-height: 34px; border: 0; color: #758096; background: transparent; font-size: .65rem; text-align: left; }

.crm-main { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--crm-canvas); }
.crm-header { min-height: 116px; padding: 22px 28px 18px; display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; border-bottom: 1px solid var(--crm-line); background: rgba(255,255,255,.88); }
.crm-kicker { margin: 0 0 5px; color: #4775f2; font: 800 .57rem/1 ui-monospace, Consolas, monospace; letter-spacing: .13em; }
.crm-header h1 { margin: 0 0 5px; font-size: clamp(1.85rem, 3vw, 2.65rem); line-height: 1; letter-spacing: -.055em; }
.crm-header p:not(.crm-kicker) { margin: 0; color: var(--crm-muted); font-size: .74rem; }
.crm-header-actions { display: flex; align-items: center; gap: 10px; }
.crm-search { width: min(30vw, 245px); height: 38px; margin: 0; padding: 0 10px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--crm-line); border-radius: 8px; color: #8791a4; background: #fff; }
.crm-search input { height: auto !important; padding: 0 !important; border: 0 !important; color: var(--crm-ink) !important; background: transparent !important; font-size: .72rem; }
.crm-view-toggle { height: 38px; padding: 3px; display: flex; border: 1px solid var(--crm-line); border-radius: 9px; background: #f0f2f5; }
.crm-view-toggle button { padding: 0 11px; border: 0; border-radius: 6px; color: var(--crm-muted); background: transparent; font-size: .67rem; font-weight: 750; }
.crm-view-toggle button.is-active { color: var(--crm-ink); background: #fff; box-shadow: 0 1px 4px rgba(20,29,45,.09); }

.crm-stats { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--crm-line); background: #fff; }
.crm-stats > div { min-height: 74px; padding: 14px 24px; display: grid; grid-template-columns: 1fr auto; align-content: center; gap: 4px 12px; }
.crm-stats > div + div { border-left: 1px solid var(--crm-line); }
.crm-stats span { color: var(--crm-muted); font-size: .64rem; font-weight: 650; }
.crm-stats strong { grid-row: 1 / span 2; grid-column: 2; color: var(--crm-ink); font-size: 1.65rem; line-height: 1; letter-spacing: -.045em; }
.crm-stats small { color: #9aa3b3; font-size: .56rem; }
.crm-content { flex: 1; min-height: 0; padding: 20px 22px 24px; overflow: auto; }
.crm-board { min-width: 1060px; height: 100%; display: grid; grid-template-columns: repeat(5, minmax(190px, 1fr)); gap: 12px; }
.crm-column { min-height: 100%; padding: 0 7px; border-radius: 11px; transition: background 160ms ease, box-shadow 160ms ease; }
.crm-column.is-dragover { background: rgba(71,117,242,.07); box-shadow: inset 0 0 0 2px rgba(71,117,242,.22); }
.crm-column-head { height: 37px; display: flex; align-items: flex-start; justify-content: space-between; border-bottom: 2px solid var(--stage-color); }
.crm-column-head strong { display: flex; align-items: center; gap: 7px; color: var(--crm-ink); font-size: .7rem; }
.crm-column-head strong::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--stage-color); }
.crm-column-head span { min-width: 21px; padding: 4px 6px; border-radius: 99px; color: var(--crm-muted); background: #e9ecf1; font: 750 .56rem/1 ui-monospace, Consolas, monospace; text-align: center; }
.crm-card-list { min-height: calc(100% - 37px); padding: 10px 0 30px; display: grid; align-content: start; gap: 9px; }
.crm-card { position: relative; padding: 13px; border: 1px solid var(--crm-line); border-radius: 10px; background: var(--crm-surface); box-shadow: 0 3px 12px rgba(25,37,57,.045); cursor: grab; transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease; animation: crm-card-in 240ms cubic-bezier(.22,.8,.3,1) both; }
.crm-card:hover { transform: translateY(-2px); border-color: #cbd3df; box-shadow: 0 8px 22px rgba(25,37,57,.09); }
.crm-card:active { cursor: grabbing; }
.crm-card.is-dragging { opacity: .45; transform: scale(.98); }
.crm-card-top { display: flex; align-items: flex-start; gap: 9px; }
.crm-card-avatar { width: 29px; height: 29px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 8px; color: #fff; background: var(--avatar-color, #4775f2); font-size: .67rem; font-weight: 800; }
.crm-card-person { min-width: 0; flex: 1; }
.crm-person-link { max-width: 100%; padding: 0; overflow: hidden; border: 0; color: var(--crm-ink); background: transparent; font-size: .71rem; font-weight: 780; white-space: nowrap; text-overflow: ellipsis; text-align: left; }
.crm-person-link:hover { color: #3567eb; text-decoration: underline; text-underline-offset: 3px; }
.crm-card-person span { display: block; margin-top: 4px; color: #9099a9; font-size: .56rem; }
.crm-note-button { width: 26px; height: 26px; padding: 0; border: 1px solid var(--crm-line); border-radius: 7px; color: #7d8799; background: #fafbfc; font-size: .7rem; }
.crm-note-button:hover { color: #3567eb; border-color: #b9c8ee; }
.crm-card-message { margin: 12px 0 10px; color: #4f5b6e; font-size: .63rem; line-height: 1.45; }
.crm-card-meta { padding-top: 9px; display: flex; justify-content: space-between; gap: 7px; border-top: 1px solid #edf0f3; color: #8b95a6; font-size: .55rem; }
.crm-referral-count { color: #4775f2; font-weight: 750; }
.crm-empty-column { padding: 22px 8px; color: #9ca5b4; font-size: .62rem; line-height: 1.45; text-align: center; }

.crm-gantt { min-width: 880px; border: 1px solid var(--crm-line); border-radius: 11px; overflow: hidden; background: #fff; }
.gantt-head, .gantt-row { display: grid; grid-template-columns: 210px minmax(650px, 1fr); }
.gantt-head { min-height: 48px; color: #7d8798; background: #f8f9fb; border-bottom: 1px solid var(--crm-line); font-size: .59rem; font-weight: 750; }
.gantt-person-head { padding: 17px; border-right: 1px solid var(--crm-line); }
.gantt-days { display: grid; grid-template-columns: repeat(7,1fr); }
.gantt-days span { padding: 17px 8px; text-align: center; border-right: 1px solid #edf0f3; }
.gantt-row { min-height: 66px; border-bottom: 1px solid #edf0f3; }
.gantt-row:last-child { border-bottom: 0; }
.gantt-person { padding: 12px 15px; display: flex; align-items: center; gap: 9px; border-right: 1px solid var(--crm-line); }
.gantt-person button { min-width: 0; padding: 0; overflow: hidden; border: 0; color: var(--crm-ink); background: transparent; font-size: .68rem; font-weight: 760; white-space: nowrap; text-overflow: ellipsis; text-align: left; }
.gantt-person small { display: block; margin-top: 4px; color: #8d97a8; font-size: .54rem; font-weight: 500; }
.gantt-track { position: relative; display: grid; grid-template-columns: repeat(7,1fr); align-items: center; overflow: hidden; }
.gantt-track::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0, transparent calc(14.285% - 1px), #edf0f3 calc(14.285% - 1px), #edf0f3 14.285%); }
.gantt-bar { position: absolute; z-index: 1; left: var(--gantt-left); min-width: 58px; height: 26px; width: var(--gantt-width); padding: 0 9px; display: flex; align-items: center; justify-content: space-between; gap: 8px; overflow: hidden; border-radius: 7px; color: #fff; background: var(--stage-color); box-shadow: 0 4px 12px rgba(32,45,67,.16); font-size: .55rem; font-weight: 750; white-space: nowrap; animation: gantt-grow 420ms cubic-bezier(.22,.8,.3,1) both; }
.gantt-empty { padding: 45px; color: #8c96a7; text-align: center; font-size: .72rem; }

.manager-chats-view { flex: 1; min-width: 0; min-height: 0; color: var(--text); background: var(--panel); }
.manager-chats-view:not(.is-hidden) { display: flex; }
.manager-chats-view .inbox-panel { width: 310px; min-width: 270px; }
.inbox-to-crm { min-height: 30px; padding: 0 9px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); background: transparent; font-size: .61rem; }
.quick-note-dialog .dialog-actions { margin-top: 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.quick-note-dialog .dialog-actions .button { margin-top: 0; justify-content: center; }

@keyframes crm-card-in { from { opacity: 0; transform: translateY(6px); } }
@keyframes gantt-grow { from { opacity: 0; transform: scaleX(.2); transform-origin: left; } }

@media (max-width: 980px) {
  .crm-workspace { flex-direction: column; }
  .crm-rail { width: 100%; height: 58px; flex: 0 0 58px; padding: 7px 12px; flex-direction: row; align-items: center; border-right: 0; border-bottom: 1px solid #20293a; }
  .crm-rail-brand { height: auto; padding: 0; }
  .crm-rail-brand strong { display: none; }
  .crm-nav { margin: 0 0 0 16px; display: flex; gap: 4px; }
  .crm-nav button { min-height: 38px; }
  .crm-rail-account { margin: 0 0 0 auto; padding: 0; border: 0; }
  .crm-rail-account > span, .crm-rail-account > strong, .crm-rail-account .identity-actions, .crm-lock { display: none; }
  .crm-header { padding: 18px 20px 15px; }
  .crm-stats > div { padding-inline: 16px; }
}
@media (max-width: 700px) {
  .crm-header { min-height: auto; align-items: stretch; flex-direction: column; gap: 14px; }
  .crm-header-actions { width: 100%; }
  .crm-search { width: 100%; flex: 1; }
  .crm-stats { grid-template-columns: repeat(2,1fr); }
  .crm-stats > div:nth-child(3) { border-left: 0; border-top: 1px solid var(--crm-line); }
  .crm-stats > div:nth-child(4) { border-top: 1px solid var(--crm-line); }
  .crm-content { padding: 14px 12px 18px; }
  .crm-board { grid-template-columns: repeat(5, 250px); }
  .crm-nav button { padding-inline: 8px; }
  .crm-nav button span { display: none; }
  .manager-chats-view .inbox-panel { width: 100%; }
  .crm-workspace.show-conversation .crm-rail { display: none; }
  .crm-workspace.show-conversation .manager-chats-view { height: 100%; }
}

/* Get contract graphite / digital-camo registration direction. */
:root {
  --bg: #111416;
  --panel: #1a1d1f;
  --panel-2: #202325;
  --text: #c5c7c9;
  --muted: #767a7d;
  --line: #34383b;
  --line-strong: #4b5053;
  --accent: #86a9ca;
  --accent-ink: #f0f2f4;
}

.app-frame {
  background: #111416;
}
.app-frame::before {
  background-color: #171a1c;
  background-image: url("/assets/digital-camo.png?v=32");
  background-position: center top;
  background-repeat: repeat;
  background-size: 860px 860px;
  filter: grayscale(.34) saturate(.56) brightness(.6) contrast(1.1);
  opacity: .88;
}
.app-frame::after {
  background: rgba(10, 12, 13, .4);
}
.global-bar,
.global-footer {
  border: 0;
  background: rgba(27, 29, 31, .96);
}
.global-footer {
  color: #7e8184;
  font-size: .66rem;
  letter-spacing: .015em;
}
.global-footer button {
  color: var(--accent);
}
.global-footer #install-button.install-action {
  display: inline-flex !important;
}
.wordmark {
  color: #d8d9da;
  font-size: .86rem;
  letter-spacing: .14em;
}
.wordmark span {
  color: var(--accent);
}
.language-picker select {
  border-color: #3d4144;
  color: #d5d6d7;
  background: rgba(25, 27, 29, .86);
}
.network-state {
  color: #7a7e82;
}
.network-dot,
.presence-dot {
  width: 8px;
  height: 8px;
}
.network-state.is-safe .network-dot,
.presence-dot {
  box-shadow: none;
}

.user-auth-screen {
  overflow-y: auto;
  background: transparent;
}
.user-auth-screen::before {
  z-index: -1;
  border-color: rgba(145, 151, 155, .4);
}
.user-auth-screen::after {
  content: "";
  position: absolute;
  z-index: -2;
  inset: 0 clamp(28px, 7vw, 92px);
  pointer-events: none;
  background: rgba(31, 33, 34, .88);
  box-shadow: 0 0 42px 22px rgba(15, 17, 18, .72);
  backdrop-filter: blur(12px);
}
.user-auth-copy,
.user-auth-panel {
  position: relative;
  z-index: 1;
}
.user-auth-copy h1 {
  color: #c7c8c9;
  font-weight: 720;
}
.user-auth-copy .lede,
.form-heading > p:not(.eyebrow) {
  color: #777a7c;
}
.eyebrow {
  color: var(--accent);
}
.user-auth-panel {
  border-color: rgba(139, 145, 149, .31);
  border-radius: 8px;
  background: rgba(29, 31, 32, .92);
  box-shadow: none;
  backdrop-filter: blur(15px);
}
.auth-mode-switch {
  border-bottom-color: #35393c;
}
.auth-mode-switch button {
  color: #777a7d;
  font-weight: 500;
}
.auth-mode-switch button.is-active {
  color: #c9cbcc;
}
.form-heading h2 {
  color: #b3b5b6;
  font-weight: 650;
}
.user-auth-panel label {
  color: #a5a8aa;
  font-weight: 600;
}
.user-auth-panel input:not([type="checkbox"]),
.user-auth-panel select {
  border-color: #4e5356;
  color: #c8cacc;
  background: rgba(28, 30, 31, .72);
}
.user-auth-panel input::placeholder {
  color: #666a6d;
  opacity: 1;
}
.user-auth-panel input:focus,
.user-auth-panel select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(134, 169, 202, .08);
}
.user-auth-panel .button-primary {
  justify-content: center;
  border-color: #455f78;
  color: #eef0f2;
  background: #455f78;
  font-weight: 500;
}
.user-auth-panel .button-primary:hover {
  border-color: #506d89;
  background: #506d89;
}
.user-auth-panel .button-primary > [aria-hidden="true"] {
  display: none;
}
.form-status:empty {
  min-height: 0;
  margin: 0;
}

@media (max-width: 820px) {
  .app-frame::after {
    background: rgba(10, 12, 13, .38);
  }
  .user-auth-copy {
    padding-top: 0;
  }
}

@media (max-width: 560px) {
  .app-frame {
    grid-template-rows: 46px minmax(0, 1fr) 44px;
  }
  .app-frame::before {
    background-position: center top;
    background-size: 426px 426px;
    opacity: .9;
  }
  .global-bar,
  .global-footer {
    padding-inline: 16px;
  }
  .global-actions {
    gap: 12px;
  }
  .language-picker select {
    width: 110px;
    min-width: 110px;
    height: 31px;
    padding-inline: 10px 27px;
    border-radius: 6px;
    font-size: .75rem;
  }
  .network-state {
    gap: 7px;
    font-size: .72rem;
    white-space: nowrap;
  }
  .global-footer {
    font-size: .64rem;
  }
  .user-auth-screen {
    padding: 90px 41px 10px;
    gap: 38px;
  }
  .user-auth-screen::before {
    inset: 0 9px;
  }
  .user-auth-screen::after {
    inset: 0 30px;
    background: rgba(31, 33, 34, .88);
    box-shadow: 0 0 28px 18px rgba(14, 16, 17, .72);
  }
  .user-auth-copy {
    padding-inline: 7px;
  }
  .user-auth-copy .eyebrow {
    margin-bottom: 18px;
    font-size: .67rem;
  }
  .user-auth-copy h1 {
    max-width: 330px;
    margin-bottom: 22px;
    font-size: 3.5rem;
    line-height: .92;
    letter-spacing: -.047em;
  }
  .user-auth-copy .lede {
    max-width: 320px;
    font-size: .84rem;
    line-height: 1.62;
  }
  .user-auth-panel {
    width: 100%;
    margin-top: -11px;
    padding: 16px 14px 26px;
    border-radius: 7px;
  }
  .auth-mode-switch {
    margin-bottom: 26px;
  }
  .auth-mode-switch button {
    min-height: 34px;
    padding-inline: 4px;
    font-size: .76rem;
  }
  .form-heading .eyebrow {
    margin-bottom: 15px;
    font-size: .66rem;
  }
  .form-heading h2 {
    margin-bottom: 9px;
    font-size: 1.58rem;
    line-height: 1.24;
  }
  .form-heading > p:not(.eyebrow) {
    margin-bottom: 2px;
    font-size: .76rem;
    line-height: 1.55;
  }
  .user-auth-panel label {
    margin: 12px 0 7px;
    font-size: .7rem;
  }
  #user-register-form > label {
    margin-top: 18px;
  }
  .user-auth-panel input:not([type="checkbox"]),
  .user-auth-panel select {
    height: 41px;
    padding-inline: 11px;
    border-radius: 7px;
    font-size: .92rem;
  }
  .form-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0 10px;
  }
  .user-auth-panel .button {
    min-height: 40px;
    margin-top: 18px;
    border-radius: 7px;
    font-size: .85rem;
  }
  #user-register-form .button {
    margin-top: 26px;
  }
  .identity-privacy {
    display: none;
  }
}

/* V31 manager workspace: quiet graphite surfaces framed by digital camouflage. */
.crm-workspace {
  --crm-ink: #c9ccce;
  --crm-muted: #858a8e;
  --crm-line: #3a3f42;
  --crm-surface: rgba(27, 30, 32, .96);
  --crm-canvas: rgba(16, 19, 21, .91);
  width: auto;
  margin: clamp(8px, 1vw, 16px) clamp(10px, 1.35vw, 28px);
  overflow: hidden;
  border: 1px solid rgba(147, 153, 157, .38);
  border-radius: 2px;
  color: var(--crm-ink);
  background: rgba(16, 19, 21, .84);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .025), 0 18px 54px rgba(0, 0, 0, .22);
  backdrop-filter: blur(10px);
  color-scheme: dark;
}

.crm-rail {
  color: #c9ccce;
  background: rgba(22, 25, 27, .97);
  border-color: var(--crm-line);
}
.crm-brand-mark {
  border: 1px solid #526d86;
  border-radius: 6px;
  color: #eef0f2;
  background: #455f78;
  box-shadow: none;
}
.crm-rail-brand strong { color: #d7d9da; }
.crm-nav button {
  border: 1px solid transparent;
  border-radius: 6px;
  color: #8d9397;
}
.crm-nav button:hover {
  color: #d7d9da;
  background: rgba(134, 169, 202, .09);
  transform: translateX(2px);
}
.crm-nav button.is-active {
  border-color: rgba(134, 169, 202, .24);
  color: #e0e2e3;
  background: rgba(69, 95, 120, .32);
}
.crm-nav button span { color: #86a9ca; }
.crm-nav button b {
  color: #bfc5c9;
  background: #30363a;
}
.crm-rail-account { border-color: var(--crm-line); }
.crm-rail-account > span,
.crm-lock { color: #858a8e; }
.crm-rail-account > strong { color: #c9ccce; }
.crm-rail .identity-actions button {
  border-color: #454b4f;
  color: #aeb4b8;
  background: rgba(18, 21, 23, .72);
}

.crm-main {
  background: var(--crm-canvas);
}
.crm-header {
  border-color: var(--crm-line);
  background: rgba(28, 31, 33, .94);
}
.crm-kicker { color: #86a9ca; }
.crm-header h1,
.crm-stats strong,
.crm-column-head strong,
.crm-person-link,
.gantt-person button { color: var(--crm-ink); }
.crm-header p:not(.crm-kicker),
.crm-stats span,
.crm-stats small { color: var(--crm-muted); }
.crm-search {
  border-color: #474d50;
  color: #858a8e;
  background: rgba(17, 20, 22, .78);
}
.crm-search input { color: var(--crm-ink) !important; }
.crm-search input::placeholder { color: #747a7e; }
.crm-view-toggle {
  border-color: #474d50;
  background: rgba(17, 20, 22, .78);
}
.crm-view-toggle button { color: var(--crm-muted); }
.crm-view-toggle button.is-active {
  color: #e0e2e3;
  background: rgba(69, 95, 120, .42);
  box-shadow: none;
}
.crm-stats {
  border-color: var(--crm-line);
  background: rgba(25, 28, 30, .92);
}
.crm-stats > div + div { border-color: var(--crm-line); }
.crm-content { background: rgba(13, 16, 18, .32); }
.crm-column-head span {
  color: #aeb3b6;
  background: #303538;
}
.crm-column.is-dragover {
  background: rgba(134, 169, 202, .07);
  box-shadow: inset 0 0 0 2px rgba(134, 169, 202, .2);
}
.crm-card {
  border-color: var(--crm-line);
  background: var(--crm-surface);
  box-shadow: none;
}
.crm-card:hover {
  border-color: #56616a;
  box-shadow: 0 9px 22px rgba(0, 0, 0, .18);
}
.crm-person-link:hover,
.crm-referral-count { color: #96b6d4; }
.crm-card-person span,
.crm-card-meta,
.crm-empty-column,
.gantt-empty { color: #858a8e; }
.crm-note-button {
  border-color: #474d50;
  color: #969b9f;
  background: #24282a;
}
.crm-note-button:hover {
  border-color: #60798f;
  color: #a9c4dd;
}
.crm-card-message { color: #b0b4b7; }
.crm-card-meta {
  border-color: #353a3d;
}
.crm-gantt {
  border-color: var(--crm-line);
  background: #1a1d1f;
}
.gantt-head {
  color: #92979b;
  background: #202426;
  border-color: var(--crm-line);
}
.gantt-person-head,
.gantt-days span,
.gantt-row,
.gantt-person { border-color: var(--crm-line); }
.gantt-track::before { background: none; }

.manager-chats-view {
  background: rgba(16, 19, 21, .74);
}
.inbox-panel {
  border-color: var(--crm-line);
  background: rgba(24, 27, 29, .96);
}
.inbox-head {
  border-bottom: 1px solid var(--crm-line);
  background: rgba(30, 33, 35, .72);
}
.inbox-head h2,
.manager-conversation .conversation-bar h2 { color: #d8dadd; }
.inbox-to-crm {
  border-color: #474d50;
  color: #9ca2a6;
}
.inbox-to-crm:hover {
  border-color: #60798f;
  color: #b9cee1;
  background: rgba(134, 169, 202, .07);
}
.chat-list-item {
  border-color: var(--crm-line);
  color: #c6c9cb;
  transition: color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}
.chat-list-item:last-child { border-color: var(--crm-line); }
.chat-list-item:hover,
.chat-list-item.is-active {
  background: rgba(134, 169, 202, .09);
  box-shadow: inset 3px 0 0 #86a9ca;
}
.chat-list-item .avatar {
  border-color: #4b5155;
  color: #d3d5d6;
  background: #24282a;
}
.chat-list-copy span,
.chat-list-time,
.empty-list { color: #858a8e; }

.manager-conversation {
  background: rgba(13, 16, 18, .58);
}
.manager-conversation .conversation-bar {
  min-height: 68px;
  border-color: var(--crm-line);
  background: rgba(27, 30, 32, .94);
}
.manager-conversation .message-stream {
  background: rgba(13, 16, 18, .38);
}
.manager-conversation .message-bubble {
  border-color: #3e4448;
  background: #24282a;
}
.manager-conversation .is-own .message-bubble {
  border-color: rgba(134, 169, 202, .3);
  background: #273948;
}
.manager-conversation .referral-review {
  border-color: var(--crm-line);
  background: #1b2023;
}
.manager-conversation .composer {
  border-color: #454b4f;
  background: rgba(26, 29, 31, .97);
  box-shadow: 0 -12px 30px rgba(0, 0, 0, .16);
}
.manager-composer textarea {
  overflow-y: auto;
  border-color: #4b5155;
  border-radius: 7px;
  color: #d8dadd;
  background: rgba(15, 18, 20, .92);
  scrollbar-width: thin;
  scrollbar-color: #555c60 transparent;
}
.manager-composer textarea::placeholder { color: #73787b; }
.manager-composer textarea:focus {
  border-color: #86a9ca;
  box-shadow: 0 0 0 2px rgba(134, 169, 202, .1);
}
.manager-composer .send-button {
  border: 1px solid #526d86;
  border-radius: 7px;
  color: #eef0f2;
  background: #455f78;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}
.manager-composer .send-button:hover:not(:disabled) {
  border-color: #6684a0;
  background: #506d89;
  transform: translateY(-1px);
}
.manager-composer .attach-button,
.manager-composer .compose-mode button {
  border-color: #474d50;
  border-radius: 7px;
  color: #9da2a6;
}
.manager-composer .compose-mode button.is-active {
  border-color: #526d86;
  color: #d8dadd;
  background: rgba(69, 95, 120, .34);
}
.manager-quick-prompts button {
  border-color: rgba(134, 169, 202, .28);
  border-radius: 6px;
  color: #a9c4dd;
  background: rgba(134, 169, 202, .06);
}
.manager-quick-prompts button:hover {
  border-color: #86a9ca;
  background: rgba(134, 169, 202, .11);
}

.crm-workspace button:focus-visible,
.crm-workspace textarea:focus-visible,
.crm-workspace input:focus-visible,
.crm-workspace select:focus-visible {
  outline: 2px solid #86a9ca;
  outline-offset: 2px;
}

@media (max-width: 980px) {
  .crm-workspace { margin: 8px 10px; }
  .crm-rail { border-color: var(--crm-line); }
}

@media (max-width: 560px) {
  .crm-workspace { margin: 5px; }
  .manager-conversation .composer { padding-inline: 9px; }
  .manager-composer {
    grid-template-columns: 42px minmax(0, 1fr) 42px;
  }
  .manager-composer .manager-quick-prompts { grid-column: 1 / -1; grid-row: 1; }
  .manager-composer .attachment-queue { grid-column: 1 / -1; grid-row: 2; }
  .manager-composer .compose-mode { grid-column: 1 / -1; grid-row: 3; }
  .manager-composer .attach-button { grid-column: 1; grid-row: 4; }
  .manager-composer textarea { grid-column: 2; grid-row: 4; }
  .manager-composer .send-button { grid-column: 3; grid-row: 4; }
  .manager-composer .attachment-hint { grid-column: 1 / -1; grid-row: 5; }
}

@media (max-width: 350px) {
  .user-auth-screen {
    padding-inline: 28px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .identity-privacy {
    display: block;
  }
}
