:root {
  --ink: #f1f3ef;
  --muted: #919892;
  --dim: #656b66;
  --bg: #0d100e;
  --panel: #121613;
  --panel-2: #171b18;
  --line: rgba(238, 243, 238, .11);
  --line-strong: rgba(238, 243, 238, .2);
  --accent: #56d9ff;
  --accent-rgb: 86, 217, 255;
  --mint: #8ee5cc;
  --danger: #ff8e7d;
  --radius: 4px;
  --shadow: 0 24px 70px rgba(0, 0, 0, .34);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(255,255,255,.027) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.027) 1px, transparent 1px),
    var(--bg);
  background-size: 58px 58px;
  font-family: Inter, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  overflow-x: hidden;
}

button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }
.mobile-only { display: none !important; }
.ambient { position: fixed; border-radius: 50%; pointer-events: none; filter: blur(120px); opacity: .13; }
.ambient-one { width: 520px; height: 520px; right: -180px; top: -180px; background: var(--accent); }
.ambient-two { width: 380px; height: 380px; left: 20%; bottom: -240px; background: #a7ffd9; }

.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 21px; font-weight: 760; letter-spacing: -.7px; }
.brand img { width: 29px; height: 29px; }
.brand em { margin-left: 3px; color: var(--dim); font-size: 9px; font-style: normal; font-weight: 800; letter-spacing: 1.5px; }
.brand-large { font-size: 27px; }
.brand-large img { width: 38px; height: 38px; }
.eyebrow, .section-kicker {
  color: #aeb4af;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.7px;
  text-transform: uppercase;
}
.eyebrow { display: flex; align-items: center; gap: 13px; }
.eyebrow i { width: 34px; height: 2px; background: var(--accent); }
.muted { color: var(--muted); }

.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(450px, .8fr); }
.login-story { position: relative; display: flex; flex-direction: column; justify-content: center; padding: 8vh clamp(50px, 8vw, 145px); border-right: 1px solid var(--line); overflow: hidden; }
.login-story::after {
  position: absolute; content: ""; width: 420px; height: 420px; right: -220px; top: 20%;
  border: 1px solid rgba(var(--accent-rgb), .22); border-radius: 50%; box-shadow: 0 0 0 70px rgba(var(--accent-rgb), .025), 0 0 0 140px rgba(var(--accent-rgb), .018);
}
.login-story .brand { position: absolute; left: clamp(50px, 8vw, 145px); top: 55px; }
.login-story .eyebrow { margin-bottom: 27px; }
.login-story h1 { margin: 0; max-width: 760px; font-size: clamp(62px, 7.2vw, 118px); line-height: .87; letter-spacing: -6px; text-transform: uppercase; }
.login-story h1 span { color: transparent; -webkit-text-stroke: 1px rgba(241,243,239,.65); }
.login-story > p { max-width: 640px; margin: 36px 0 52px; color: #b7bdb8; font-size: 19px; line-height: 1.65; }
.proof-row { display: flex; gap: 1px; max-width: 700px; background: var(--line); border: 1px solid var(--line); }
.proof-row div { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 7px; padding: 21px 23px; background: rgba(13,16,14,.82); }
.proof-row strong { font-size: 15px; text-transform: uppercase; }
.proof-row span { color: var(--dim); font-size: 11px; }

.login-panel { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px; background: rgba(18,22,19,.58); backdrop-filter: blur(24px); }
.login-card { width: min(100%, 470px); padding: 42px; border: 1px solid var(--line-strong); background: rgba(19,23,20,.92); box-shadow: var(--shadow); }
.pilot-pill { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 29px; padding: 8px 11px; border: 1px solid var(--line); color: #adb4ae; font-size: 9px; font-weight: 800; letter-spacing: 1.3px; text-transform: uppercase; }
.pilot-pill span, .live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 5px rgba(142,229,204,.09); }
.login-card h2 { margin: 0 0 9px; font-size: 30px; letter-spacing: -1px; }
.login-card > p { margin: 0 0 30px; line-height: 1.6; }
label { display: flex; flex-direction: column; gap: 9px; color: #aeb5af; font-size: 9px; font-weight: 800; letter-spacing: 1.3px; text-transform: uppercase; }
input, textarea, select {
  width: 100%; border: 1px solid var(--line-strong); border-radius: 0; color: var(--ink); background: #0f1310; transition: border .18s, box-shadow .18s;
}
input, select { height: 48px; padding: 0 15px; }
textarea { padding: 14px 15px; line-height: 1.5; resize: vertical; }
input:hover, textarea:hover, select:hover { border-color: rgba(255,255,255,.3); }
input:focus, textarea:focus, select:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb),.08); }
.login-card form { display: grid; gap: 18px; }
.form-error { min-height: 16px; margin: -5px 0 !important; color: var(--danger) !important; font-size: 12px; }
.button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 23px; padding: 0 19px; border: 1px solid var(--line-strong); background: transparent; font-size: 11px; font-weight: 800; letter-spacing: .2px; cursor: pointer; transition: transform .17s, background .17s, border .17s; }
.button:hover { transform: translateY(-2px); border-color: rgba(255,255,255,.4); }
.button-primary { border-color: var(--accent); color: #071013; background: var(--accent); }
.button-primary:hover { background: #8be6ff; }
.button-primary span { font-size: 20px; font-weight: 400; transition: transform .17s; }
.button-primary:hover span { transform: translateX(4px); }
.button-full { width: 100%; min-height: 52px; margin-top: 3px; }
.button-quiet { min-height: 38px; padding-inline: 15px; }
.divider { display: flex; align-items: center; gap: 12px; margin: 27px 0 18px; color: var(--dim); font-size: 8px; font-weight: 800; letter-spacing: 1.4px; text-transform: uppercase; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.demo-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.demo-buttons button { display: flex; align-items: center; gap: 11px; padding: 13px; border: 1px solid var(--line); text-align: left; background: transparent; cursor: pointer; }
.demo-buttons button:hover { border-color: rgba(var(--accent-rgb),.5); background: rgba(var(--accent-rgb),.04); }
.demo-buttons button > span:last-child { display: flex; flex-direction: column; gap: 3px; }
.demo-buttons strong { font-size: 11px; }
.demo-buttons small { color: var(--dim); font-size: 9px; }
.demo-icon { width: 31px; height: 31px; display: grid !important; place-items: center; flex: 0 0 auto; color: #071013; background: var(--accent); font-size: 11px; font-weight: 900; }
.demo-icon.mint { background: var(--mint); }
.demo-site-link { margin-top: 25px; color: var(--muted); font-size: 11px; font-weight: 700; }
.demo-site-link span { margin-left: 8px; color: var(--accent); }

.app-shell { min-height: 100vh; }
.topbar { height: 72px; display: grid; grid-template-columns: 350px 1fr auto; align-items: center; padding: 0 22px 0 26px; border-bottom: 1px solid var(--line); background: rgba(13,16,14,.9); backdrop-filter: blur(18px); }
.topnav { align-self: stretch; display: flex; justify-content: center; gap: 5px; }
.nav-button { position: relative; padding: 0 22px; border: 0; color: var(--muted); background: none; font-size: 11px; font-weight: 750; cursor: pointer; }
.nav-button::after { position: absolute; content: ""; height: 2px; left: 20px; right: 20px; bottom: -1px; background: var(--accent); transform: scaleX(0); transition: transform .2s; }
.nav-button.active { color: var(--ink); }
.nav-button.active::after { transform: scaleX(1); }
.nav-button span { min-width: 19px; height: 19px; display: inline-grid; place-items: center; margin-left: 7px; border-radius: 50%; color: #071013; background: var(--accent); font-size: 9px; }
.top-actions { display: flex; align-items: center; gap: 24px; }
.preview-link { display: flex; align-items: center; gap: 9px; color: #b8bdb9; font-size: 10px; font-weight: 750; }
.user-menu { position: relative; }
.user-menu > button { display: flex; align-items: center; gap: 9px; padding: 0; border: 0; background: none; cursor: pointer; }
.user-menu > button > span:first-child { width: 34px; height: 34px; display: grid; place-items: center; color: #061014; background: var(--accent); font-size: 11px; font-weight: 900; }
.user-menu > button > span:nth-child(2) { font-size: 11px; font-weight: 750; }
.user-menu i { color: var(--dim); font-style: normal; }
.popover { position: absolute; z-index: 20; width: 220px; right: 0; top: 45px; padding: 16px; border: 1px solid var(--line-strong); background: #171b18; box-shadow: var(--shadow); }
.popover p { margin: 0 0 12px; color: var(--muted); font-size: 11px; }
.popover button { width: 100%; padding: 10px; border: 1px solid var(--line); background: transparent; cursor: pointer; }

.workspace { height: calc(100vh - 72px); min-height: 590px; display: grid; grid-template-columns: 350px minmax(430px, 1fr) 310px; }
.conversation-rail, .context-panel { min-width: 0; background: rgba(15,19,16,.83); }
.conversation-rail { display: flex; flex-direction: column; border-right: 1px solid var(--line); }
.rail-head { min-height: 91px; display: flex; align-items: center; justify-content: space-between; padding: 21px 22px 16px; }
.rail-head h2 { margin: 6px 0 0; font-size: 23px; letter-spacing: -.7px; }
.icon-button { width: 36px; height: 36px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); color: var(--muted); background: transparent; font-size: 18px; cursor: pointer; transition: border .17s, color .17s, transform .17s; }
.icon-button:hover { border-color: var(--line-strong); color: var(--ink); transform: rotate(4deg); }
.tenant-picker-wrap { margin: 0 22px 16px; }
.tenant-picker-wrap label { gap: 7px; }
.tenant-picker-wrap select { height: 41px; padding-right: 34px; font-size: 11px; font-weight: 700; }
.filter-row { display: grid; grid-template-columns: repeat(3, 1fr); padding: 0 22px 16px; border-bottom: 1px solid var(--line); }
.filter-button { height: 33px; border: 1px solid var(--line); color: var(--dim); background: transparent; font-size: 9px; font-weight: 800; text-transform: uppercase; cursor: pointer; }
.filter-button + .filter-button { border-left: 0; }
.filter-button.active { color: #071013; border-color: var(--accent); background: var(--accent); }
.conversation-list { min-height: 0; flex: 1; overflow-y: auto; scrollbar-color: #303632 transparent; scrollbar-width: thin; }
.conversation-item { position: relative; width: 100%; display: grid; grid-template-columns: 42px minmax(0,1fr) auto; gap: 12px; padding: 18px 20px; border: 0; border-bottom: 1px solid var(--line); text-align: left; background: transparent; cursor: pointer; }
.conversation-item::before { position: absolute; content: ""; width: 2px; inset: 0 auto 0 0; background: var(--accent); transform: scaleY(0); transition: transform .16s; }
.conversation-item:hover, .conversation-item.active { background: rgba(255,255,255,.025); }
.conversation-item.active::before { transform: scaleY(1); }
.conversation-avatar { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--line-strong); color: #c9cfca; background: #171c18; font-size: 11px; font-weight: 850; }
.conversation-copy { min-width: 0; }
.conversation-copy strong { display: block; margin: 2px 0 6px; font-size: 12px; }
.conversation-copy p { margin: 0; overflow: hidden; color: var(--muted); font-size: 10px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.conversation-copy small { display: block; margin-top: 7px; color: var(--dim); font-size: 8px; font-weight: 750; letter-spacing: .7px; text-transform: uppercase; }
.conversation-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 9px; color: var(--dim); font-size: 8px; }
.waiting-mark { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(var(--accent-rgb),.1); }
.list-empty { padding: 50px 28px; color: var(--dim); text-align: center; font-size: 11px; line-height: 1.6; }

.thread-panel { min-width: 0; background: rgba(13,16,14,.5); }
.thread-empty { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.empty-orbit { position: relative; width: 78px; height: 78px; display: grid; place-items: center; margin-bottom: 25px; border: 1px solid var(--line); border-radius: 50%; }
.empty-orbit::after { position: absolute; content: ""; inset: -18px; border: 1px dashed rgba(255,255,255,.08); border-radius: 50%; animation: orbit 18s linear infinite; }
@keyframes orbit { to { transform: rotate(360deg); } }
.empty-orbit img { width: 31px; }
.thread-empty h2 { margin: 0 0 9px; font-size: 20px; }
.thread-empty p { max-width: 310px; margin: 0; color: var(--dim); font-size: 11px; line-height: 1.6; }
.thread-content { height: 100%; display: grid; grid-template-rows: 77px minmax(0,1fr) auto; }
.thread-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 24px; border-bottom: 1px solid var(--line); }
.visitor-heading { display: flex; align-items: center; gap: 12px; min-width: 0; }
.visitor-avatar { width: 39px; height: 39px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid rgba(var(--accent-rgb),.36); color: var(--accent); background: rgba(var(--accent-rgb),.06); font-size: 11px; font-weight: 900; }
.visitor-heading h2 { max-width: 260px; margin: 0 0 5px; overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.visitor-heading p { margin: 0; color: var(--dim); font-size: 9px; }
.channel-dot { width: 5px; height: 5px; display: inline-block; margin-right: 4px; border-radius: 50%; background: var(--mint); }
.thread-actions { display: flex; align-items: center; gap: 8px; }
.mode-badge { height: 31px; display: inline-flex; align-items: center; gap: 7px; padding: 0 10px; border: 1px solid var(--line); color: var(--muted); font-size: 8px; font-weight: 850; letter-spacing: .6px; text-transform: uppercase; }
.mode-badge i { width: 6px; height: 6px; border-radius: 50%; background: var(--mint); }
.mode-badge.human i { background: var(--accent); }
.mode-badge.waiting { color: var(--accent); }
.mode-badge.waiting i { background: var(--accent); animation: pulse 1.6s ease infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px rgba(var(--accent-rgb),.12); } }
.message-list { min-height: 0; overflow-y: auto; padding: 28px clamp(22px, 4vw, 58px); scrollbar-color: #303632 transparent; scrollbar-width: thin; }
.message-row { display: flex; gap: 11px; margin: 0 0 22px; }
.message-row.visitor { justify-content: flex-end; }
.message-mini-avatar { width: 28px; height: 28px; display: grid; place-items: center; flex: 0 0 auto; margin-top: 19px; border: 1px solid var(--line); color: var(--muted); font-size: 8px; font-weight: 900; }
.message-bundle { max-width: min(78%, 610px); }
.message-row.visitor .message-bundle { display: flex; flex-direction: column; align-items: flex-end; }
.message-label { display: flex; align-items: center; gap: 9px; margin: 0 0 6px; color: var(--dim); font-size: 8px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; }
.message-bubble { padding: 13px 15px; border: 1px solid var(--line); color: #c9cfca; background: rgba(24,29,25,.8); font-size: 12px; line-height: 1.55; white-space: pre-wrap; }
.message-row.visitor .message-bubble { border-color: rgba(var(--accent-rgb),.25); color: #d9e0db; background: rgba(var(--accent-rgb),.065); }
.message-row.agent .message-bubble { border-color: rgba(142,229,204,.22); }
.system-message { display: flex; align-items: center; gap: 10px; margin: 23px 0; color: var(--dim); font-size: 9px; }
.system-message::before, .system-message::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.reply-area { padding: 15px 22px 20px; border-top: 1px solid var(--line); background: rgba(15,19,16,.88); }
.ai-notice { min-height: 61px; display: flex; align-items: center; justify-content: center; gap: 13px; border: 1px dashed var(--line-strong); }
.spark { color: var(--accent); font-size: 18px; }
.ai-notice p { display: flex; flex-direction: column; gap: 4px; margin: 0; }
.ai-notice strong { font-size: 10px; }
.ai-notice small { color: var(--dim); font-size: 9px; }
.reply-form { display: grid; grid-template-columns: 1fr 44px; gap: 9px; align-items: end; }
.reply-form textarea { min-height: 61px; max-height: 140px; resize: none; }
.send-button { width: 44px; height: 44px; border: 1px solid var(--accent); color: #061014; background: var(--accent); font-size: 19px; cursor: pointer; }
.send-button:hover { background: #8be6ff; transform: translateY(-2px); }

.context-panel { border-left: 1px solid var(--line); overflow-y: auto; }
.context-placeholder { height: 100%; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 30px; color: var(--dim); font-size: 10px; line-height: 1.5; }
.context-placeholder span { color: var(--accent); }
.context-head { display: flex; align-items: center; justify-content: space-between; padding: 27px 23px 8px; }
.contact-card { display: flex; flex-direction: column; align-items: center; padding: 20px 22px 25px; border-bottom: 1px solid var(--line); text-align: center; }
.contact-avatar { width: 64px; height: 64px; display: grid; place-items: center; margin-bottom: 17px; border: 1px solid var(--line-strong); color: var(--accent); background: rgba(var(--accent-rgb),.05); font-size: 17px; font-weight: 900; }
.contact-card h3 { margin: 0 0 7px; font-size: 17px; }
.contact-card > p { margin: 0; color: var(--muted); font-size: 10px; }
.lead-meter { width: 100%; margin-top: 24px; text-align: left; }
.lead-meter > span { height: 3px; display: block; overflow: hidden; background: rgba(255,255,255,.08); }
.lead-meter i { height: 100%; display: block; width: 15%; background: var(--accent); transition: width .5s ease; }
.lead-meter p { margin: 8px 0 0; color: var(--dim); font-size: 8px; text-transform: uppercase; }
.lead-meter strong { color: #bcc3bd; }
.detail-list { margin: 0; padding: 9px 22px; }
.detail-list div { display: flex; justify-content: space-between; gap: 20px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.detail-list dt { color: var(--dim); font-size: 8px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; }
.detail-list dd { margin: 0; color: #bec4bf; font-size: 10px; text-align: right; }
.context-tip { display: flex; gap: 12px; margin: 18px 22px; padding: 15px; border: 1px solid rgba(var(--accent-rgb),.18); background: rgba(var(--accent-rgb),.035); }
.context-tip > span { color: var(--accent); }
.context-tip p { margin: 0; color: var(--dim); font-size: 9px; line-height: 1.55; }
.context-tip strong { display: block; margin-bottom: 2px; color: #cbd1cc; }

.manage-view { min-height: calc(100vh - 72px); display: grid; grid-template-columns: minmax(320px, .72fr) minmax(560px, 1.28fr); }
.manage-intro { position: relative; padding: clamp(60px, 8vh, 105px) clamp(45px, 6vw, 105px); border-right: 1px solid var(--line); overflow: hidden; }
.manage-intro::after { position: absolute; content: ""; width: 370px; height: 370px; left: -200px; bottom: -190px; border: 1px solid rgba(var(--accent-rgb),.12); border-radius: 50%; box-shadow: 0 0 0 60px rgba(var(--accent-rgb),.016), 0 0 0 120px rgba(var(--accent-rgb),.012); }
.manage-intro h1 { margin: 22px 0 26px; font-size: clamp(43px, 5vw, 72px); line-height: .98; letter-spacing: -3px; text-transform: uppercase; }
.manage-intro h1 em { color: transparent; font-style: normal; -webkit-text-stroke: 1px rgba(241,243,239,.53); }
.manage-intro > p { max-width: 480px; margin: 0; color: var(--muted); font-size: 15px; line-height: 1.75; }
.manage-note { display: flex; gap: 18px; max-width: 490px; margin-top: 60px; padding-top: 23px; border-top: 1px solid var(--line); }
.manage-note > span { color: var(--accent); font-size: 9px; font-weight: 850; }
.manage-note p { margin: 0; color: var(--dim); font-size: 11px; line-height: 1.6; }
.manage-note strong { display: block; margin-bottom: 4px; color: #c5cbc6; font-size: 12px; }
.manage-content { padding: clamp(36px, 5vw, 72px); background: rgba(17,21,18,.72); }
.manage-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 31px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.manage-toolbar h2 { margin: 0 0 6px; font-size: 23px; }
.manage-toolbar p { margin: 0; color: var(--dim); font-size: 10px; }
.knowledge-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 13px; }
.knowledge-card { position: relative; min-height: 190px; padding: 22px; border: 1px solid var(--line); background: rgba(13,16,14,.65); transition: border .2s, transform .2s, background .2s; }
.knowledge-card:hover { border-color: rgba(var(--accent-rgb),.32); background: rgba(var(--accent-rgb),.025); transform: translateY(-3px); }
.knowledge-card-number { color: var(--accent); font-size: 8px; font-weight: 850; letter-spacing: 1px; }
.knowledge-card h3 { margin: 17px 32px 10px 0; font-size: 16px; }
.knowledge-card p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.65; }
.knowledge-card small { display: block; margin-top: 16px; color: var(--dim); font-size: 8px; text-transform: uppercase; }
.delete-knowledge { position: absolute; right: 13px; top: 13px; width: 28px; height: 28px; border: 1px solid transparent; color: var(--dim); background: transparent; cursor: pointer; }
.delete-knowledge:hover { border-color: rgba(255,142,125,.24); color: var(--danger); }

.settings-content { max-width: none; }
.settings-form { max-width: 760px; display: grid; gap: 22px; }
.settings-form label { gap: 9px; }
.settings-form label small { color: var(--dim); font-size: 9px; font-weight: 400; letter-spacing: 0; text-transform: none; }
.field-row { display: grid; grid-template-columns: 1fr 210px; gap: 14px; }
.color-field { display: flex; height: 48px; border: 1px solid var(--line-strong); background: #0f1310; }
.color-field input { width: 62px; height: 46px; padding: 8px; border: 0; background: none; }
.color-field b { display: flex; align-items: center; padding: 0 12px; border-left: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.settings-save { width: fit-content; min-width: 190px; margin-top: 6px; }
.saved-indicator { color: var(--mint); font-size: 9px; font-weight: 800; opacity: 0; transition: opacity .2s; }
.saved-indicator.show { opacity: 1; }
.assistant-preview { display: flex; align-items: center; gap: 17px; margin-top: 54px; padding: 22px; border: 1px solid var(--line); background: rgba(255,255,255,.018); }
.assistant-orb { width: 54px; height: 54px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid rgba(var(--accent-rgb),.3); border-radius: 50%; color: var(--accent); background: rgba(var(--accent-rgb),.05); box-shadow: inset 0 0 22px rgba(var(--accent-rgb),.07); }
.assistant-preview small { display: block; margin-bottom: 6px; color: var(--dim); font-size: 8px; font-weight: 850; letter-spacing: 1px; }
.assistant-preview strong { font-size: 15px; }
.assistant-preview p { margin: 5px 0 0; color: var(--muted); font-size: 9px; line-height: 1.4; }

.modal { width: min(540px, calc(100vw - 36px)); padding: 0; border: 1px solid var(--line-strong); color: var(--ink); background: #171b18; box-shadow: 0 30px 90px rgba(0,0,0,.65); }
.modal::backdrop { background: rgba(3,5,4,.78); backdrop-filter: blur(7px); }
.modal form { display: grid; gap: 19px; padding: 30px; }
.modal-head { display: flex; justify-content: space-between; margin-bottom: 5px; }
.modal-head h2 { margin: 7px 0 0; font-size: 23px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 4px; }
.toast { position: fixed; z-index: 100; right: 24px; bottom: 24px; max-width: 360px; padding: 14px 18px; border: 1px solid rgba(var(--accent-rgb),.35); color: #d8dfda; background: #171c18; box-shadow: var(--shadow); font-size: 11px; opacity: 0; transform: translateY(15px); pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 1180px) {
  .topbar { grid-template-columns: 260px 1fr auto; }
  .workspace { grid-template-columns: 300px minmax(400px,1fr); }
  .context-panel { position: fixed; z-index: 15; width: 310px; right: 0; top: 72px; bottom: 0; box-shadow: -25px 0 60px rgba(0,0,0,.35); transform: translateX(100%); transition: transform .2s; }
  .context-panel.open { transform: translateX(0); }
  .mobile-only { display: grid !important; }
  .manage-view { grid-template-columns: .65fr 1fr; }
}

@media (max-width: 900px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-story { min-height: 560px; padding: 120px 45px 60px; border-right: 0; border-bottom: 1px solid var(--line); }
  .login-story .brand { left: 45px; top: 38px; }
  .login-story h1 { font-size: clamp(58px, 12vw, 90px); }
  .login-panel { padding: 55px 24px; }
  .topbar { grid-template-columns: 1fr auto; }
  .topnav { position: fixed; z-index: 12; height: 54px; left: 0; right: 0; bottom: 0; background: #111512; border-top: 1px solid var(--line); }
  .nav-button { flex: 1; }
  .nav-button::after { top: -1px; bottom: auto; }
  .preview-link { display: none; }
  .workspace { height: calc(100vh - 126px); grid-template-columns: 280px minmax(360px,1fr); }
  .manage-view { min-height: calc(100vh - 126px); grid-template-columns: 1fr; padding-bottom: 54px; }
  .manage-intro { padding: 55px 38px; border-right: 0; border-bottom: 1px solid var(--line); }
  .manage-intro h1 { font-size: 49px; }
  .manage-note, .assistant-preview { margin-top: 35px; }
}

@media (max-width: 680px) {
  body { background-size: 42px 42px; }
  .login-story { min-height: auto; padding: 110px 24px 45px; }
  .login-story .brand { left: 24px; top: 30px; }
  .login-story h1 { font-size: 52px; letter-spacing: -3px; }
  .login-story > p { margin: 27px 0 35px; font-size: 15px; }
  .proof-row { display: none; }
  .login-card { padding: 28px 22px; }
  .demo-buttons { grid-template-columns: 1fr; }
  .topbar { height: 64px; padding: 0 16px; }
  .brand em, .user-menu > button > span:nth-child(2), .user-menu i { display: none; }
  .workspace { height: calc(100vh - 118px); display: block; }
  .conversation-rail { width: 100%; height: 100%; border-right: 0; }
  .thread-panel { position: fixed; z-index: 10; inset: 64px 0 54px; background: var(--bg); transform: translateX(100%); transition: transform .22s; }
  .thread-panel.mobile-open { transform: translateX(0); }
  .thread-head { padding: 0 13px; }
  .thread-head::before { content: "‹"; color: var(--accent); font-size: 30px; cursor: pointer; }
  .visitor-heading { margin-right: auto; }
  .thread-actions .mode-badge { display: none; }
  .thread-actions .button { min-width: 0; padding: 0 10px; font-size: 9px; }
  .message-list { padding: 22px 15px; }
  .message-bundle { max-width: 87%; }
  .context-panel { top: 64px; bottom: 54px; width: min(88vw, 340px); }
  .manage-intro, .manage-content { padding: 42px 24px; }
  .manage-intro h1 { font-size: 42px; }
  .knowledge-grid { grid-template-columns: 1fr; }
  .manage-toolbar { align-items: flex-end; }
  .manage-toolbar .button { padding-inline: 12px; }
  .field-row { grid-template-columns: 1fr; }
}
