:root {
  --canvas: #f6f7f9;
  --surface: #ffffff;
  --nav: #151922;
  --nav-raised: #202632;
  --ink: #111318;
  --soft: #5f6673;
  --faint: #858d9b;
  --line: #dde1e7;
  --line-strong: #c7cdd6;
  --ember: #e4572e;
  --ember-deep: #b83a1c;
  --ember-tint: #fff1eb;
  --iris: #625bf6;
  --iris-tint: #f0effe;
  --green: #16845b;
  --green-tint: #e6f4ee;
  --amber: #b35c00;
  --amber-tint: #f9efe2;
  --red: #c7372f;
  --red-tint: #fee4e2;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; background: var(--canvas); color: var(--ink); font-family: Geist, system-ui, sans-serif; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 224px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: var(--nav); color: white; border-right: 1px solid rgba(255,255,255,.1); }
.brand { height: 64px; display: flex; align-items: center; gap: 10px; padding: 0 18px; border-bottom: 1px solid rgba(255,255,255,.1); font-family: Fraunces, Georgia, serif; font-size: 20px; }
.brand-mark { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 6px; background: var(--ember); font-family: Geist, sans-serif; font-weight: 700; }
.workspace-switcher { padding: 16px; border-bottom: 1px solid rgba(255,255,255,.1); }
.workspace-switcher label { display: block; margin-bottom: 7px; color: #858d9b; font: 600 10px/1 Geist Mono, monospace; letter-spacing: .08em; text-transform: uppercase; }
.workspace-row { display: grid; grid-template-columns: minmax(0,1fr) 34px; gap: 7px; }
.workspace-row select, .workspace-row button { min-width: 0; height: 36px; border: 1px solid rgba(255,255,255,.15); border-radius: 6px; color: white; background: var(--nav-raised); }
.workspace-row select { padding: 0 9px; }
.icon-button { font-size: 20px; }
.side-nav { display: grid; gap: 3px; padding: 14px 10px; }
.side-link { display: flex; align-items: center; gap: 9px; width: 100%; border: 1px solid transparent; border-radius: 6px; padding: 10px; background: transparent; color: #aeb5c0; text-align: left; font-size: 13px; }
.side-link strong { margin-left: auto; border-radius: 999px; padding: 2px 7px; background: rgba(255,255,255,.08); font: 600 10px/1.5 Geist Mono, monospace; }
.side-link:hover, .side-link.is-active { border-color: rgba(255,255,255,.12); background: var(--nav-raised); color: white; }
.isolation-card { margin: auto 12px 14px; display: flex; align-items: flex-start; gap: 9px; border: 1px solid rgba(255,255,255,.12); border-radius: 7px; padding: 11px; background: var(--nav-raised); }
.isolation-card strong { font-size: 12px; }
.isolation-card p { margin: 3px 0 0; color: #9da5b1; font-size: 11px; line-height: 1.45; }
.status-dot { flex: none; width: 8px; height: 8px; margin-top: 4px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(22,132,91,.18); }
.main { min-width: 0; }
.topbar { min-height: 108px; display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; padding: 24px 28px 18px; border-bottom: 1px solid var(--line); background: rgba(246,247,249,.96); }
.eyebrow { margin: 0; color: var(--faint); font: 600 10px/1.3 Geist Mono, monospace; letter-spacing: .12em; text-transform: uppercase; }
.topbar h1 { margin: 7px 0 0; font: 500 27px/1.1 Fraunces, Georgia, serif; }
.platform-toggle { display: flex; flex: none; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.platform-toggle button { border: 0; border-radius: 5px; padding: 8px 13px; background: transparent; color: var(--soft); font-size: 12px; font-weight: 600; }
.platform-toggle button.is-active { background: var(--ink); color: white; }
.view { display: none; padding: 20px; }
.view.is-active { display: block; }
.lab-grid { min-height: calc(100vh - 148px); display: grid; grid-template-columns: 265px minmax(360px, 1fr) 310px; gap: 14px; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: 0 12px 30px -28px rgba(17,19,24,.5); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px; border-bottom: 1px solid var(--line); }
.panel-heading.compact { border-bottom: 0; padding-bottom: 8px; }
.panel-heading h2, .settings-card h2 { margin: 5px 0 0; font: 500 19px/1.2 Fraunces, Georgia, serif; }
.quiet-button { border: 0; background: transparent; color: var(--ember-deep); font-size: 12px; font-weight: 600; }
.conversation-list { max-height: calc(100vh - 226px); overflow-y: auto; }
.conversation-empty, .empty-list { padding: 28px 18px; color: var(--soft); font-size: 13px; line-height: 1.55; text-align: center; }
.empty-list.spacious { padding: 54px 18px; }
.conversation-item { width: 100%; display: grid; grid-template-columns: 34px minmax(0,1fr) auto; gap: 9px; align-items: center; border: 0; border-bottom: 1px solid var(--line); padding: 12px; background: white; text-align: left; }
.conversation-item:hover, .conversation-item.is-active { background: var(--ember-tint); }
.conversation-item.is-closed { opacity: .66; }
.avatar { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; background: var(--avatar); color: white; font-size: 12px; font-weight: 700; }
.conversation-copy { min-width: 0; }
.conversation-copy strong, .conversation-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-copy strong { font-size: 12px; }
.conversation-copy small { margin-top: 3px; color: var(--soft); font-size: 11px; }
.conversation-meta { display: grid; gap: 2px; color: var(--faint); font: 500 9px/1.3 Geist Mono, monospace; text-align: right; text-transform: uppercase; }
.conversation-meta em { color: var(--soft); font-size: 8px; font-style: normal; }
.chat-panel { min-height: 620px; display: flex; flex-direction: column; overflow: hidden; }
.chat-header { min-height: 67px; display: flex; align-items: center; gap: 11px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.chat-header .avatar { width: 38px; height: 38px; }
.chat-title { min-width: 0; }
.chat-title strong, .chat-title span { display: block; }
.chat-title strong { font-size: 13px; }
.chat-title span { margin-top: 3px; color: var(--faint); font-size: 11px; }
.sandbox-chip { margin-left: auto; border: 1px solid #cfcdfc; border-radius: 999px; padding: 4px 7px; background: var(--iris-tint); color: #4f46e5; font: 600 9px/1 Geist Mono, monospace; }
.thread-actions { margin-left: auto; display: flex; align-items: center; gap: 7px; }
.thread-actions .sandbox-chip { margin-left: 0; }
.thread-actions button { border: 1px solid var(--line); border-radius: 5px; padding: 5px 8px; background: white; color: var(--soft); font-size: 10px; font-weight: 600; }
.thread-notice { align-self: center; border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px; background: white; color: var(--faint); font-size: 10px; }
.post-context { margin: 12px 16px 0; display: grid; grid-template-columns: 64px 1fr; gap: 11px; border: 1px solid var(--line); border-radius: 7px; padding: 9px; background: var(--canvas); }
.post-context img { width: 64px; height: 64px; border-radius: 5px; object-fit: cover; background: var(--line); }
.post-context strong { display: block; font-size: 11px; }
.post-context p { margin: 5px 0 0; color: var(--soft); font-size: 11px; line-height: 1.45; }
.message-list { flex: 1; min-height: 320px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 18px; background: #fbfcfd; }
.empty-chat { margin: auto; max-width: 260px; text-align: center; color: var(--soft); font-size: 13px; line-height: 1.55; }
.message { max-width: 78%; }
.message.customer { align-self: flex-start; }
.message.business { align-self: flex-end; }
.bubble { border-radius: 13px; padding: 9px 11px; font-size: 13px; line-height: 1.45; white-space: pre-wrap; }
.customer .bubble { border: 1px solid var(--line); border-bottom-left-radius: 4px; background: white; }
.business .bubble { border-bottom-right-radius: 4px; background: var(--ink); color: white; }
.photo-card { margin-bottom: 7px; display: flex; align-items: center; gap: 8px; border-radius: 7px; padding: 9px; background: var(--canvas); color: var(--soft); font-size: 11px; }
.business .photo-card { background: rgba(255,255,255,.12); color: white; }
.message-status { margin-top: 4px; color: var(--faint); font: 500 9px/1.3 Geist Mono, monospace; text-transform: uppercase; }
.business .message-status { text-align: right; }
.message-photo { margin-bottom: 8px; overflow: hidden; border-radius: 8px; background: var(--canvas); }
.message-photo img { display: block; width: 100%; max-height: 220px; object-fit: cover; }
.shared-post-card { margin-bottom: 8px; overflow: hidden; border-radius: 8px; background: var(--canvas); color: var(--ink); }
.shared-post-card img { display: block; width: 100%; max-height: 210px; object-fit: cover; }
.shared-post-card div { display: grid; gap: 3px; padding: 8px; }
.shared-post-card strong { font-size: 10px; }
.shared-post-card span { color: var(--soft); font-size: 10px; line-height: 1.4; }
.business .shared-post-card { background: rgba(255,255,255,.12); color: white; }
.business .shared-post-card span { color: rgba(255,255,255,.78); }
.composer { border-top: 1px solid var(--line); padding: 11px; background: white; transition: background .15s ease, box-shadow .15s ease; }
.composer.is-dragging { background: var(--ember-tint); box-shadow: inset 0 0 0 2px var(--ember); }
.attachment-dropzone { min-height: 31px; display: flex; align-items: center; gap: 9px; margin-bottom: 8px; color: var(--faint); }
.attachment-button { display: inline-flex; flex: none; align-items: center; gap: 4px; border: 1px solid var(--line-strong); border-radius: 6px; padding: 6px 8px; background: white; color: var(--ink); font-size: 10px; font-weight: 700; cursor: pointer; }
.attachment-button:hover { border-color: var(--ember); color: var(--ember-deep); }
.attachment-button span { font-size: 14px; line-height: 8px; }
.drop-hint { min-width: 0; flex: 1; font-size: 10px; }
.photo-url-option { position: relative; flex: none; }
.photo-url-option summary { color: var(--faint); font-size: 10px; cursor: pointer; }
.photo-url-option[open] input { position: absolute; right: 0; bottom: calc(100% + 6px); z-index: 2; width: 230px; border: 1px solid var(--line-strong); border-radius: 6px; padding: 7px 8px; background: white; color: var(--soft); font-size: 10px; box-shadow: 0 8px 24px rgba(17,19,24,.12); }
.chat-attachment-preview { display: grid; grid-template-columns: 44px minmax(0,1fr) 28px; gap: 9px; align-items: center; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 7px; padding: 7px; background: var(--canvas); }
.chat-attachment-preview img { width: 44px; height: 44px; border-radius: 5px; object-fit: cover; }
.chat-attachment-preview strong, .chat-attachment-preview span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-attachment-preview strong { font-size: 11px; }
.chat-attachment-preview div span { margin-top: 3px; color: var(--green); font-size: 9px; font-weight: 600; }
.chat-attachment-preview button { width: 26px; height: 26px; border: 1px solid var(--line); border-radius: 50%; background: white; color: var(--soft); font-size: 16px; }
.attachment-progress { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; color: var(--soft); font-size: 10px; }
.attachment-progress i { width: 13px; height: 13px; border: 2px solid var(--line-strong); border-top-color: var(--ember); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.composer-row { display: grid; grid-template-columns: minmax(0,1fr) 74px; gap: 8px; }
.composer textarea { resize: none; border: 1px solid var(--line-strong); border-radius: 7px; padding: 9px 10px; font-size: 13px; }
.send-button, .primary-button { border: 1px solid var(--ember-deep); border-radius: 7px; background: var(--ember); color: white; font-size: 12px; font-weight: 700; }
.send-button:hover, .primary-button:hover { background: var(--ember-deep); }
.scenario-panel { align-self: start; padding-bottom: 14px; }
.scenario-panel > .field, .scenario-panel > .two-fields, .scenario-panel > .scenario-description, .scenario-panel > .expected-card, .scenario-panel > button, .scenario-panel > details { margin-left: 14px; margin-right: 14px; }
.field { display: grid; gap: 6px; margin-top: 11px; color: var(--soft); font-size: 11px; font-weight: 600; }
.field input, .field select { width: 100%; min-width: 0; border: 1px solid var(--line-strong); border-radius: 6px; padding: 8px 9px; background: white; color: var(--ink); font-size: 12px; }
.field.is-disabled { opacity: .48; }
.two-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.scenario-description { margin-top: 12px; color: var(--soft); font-size: 12px; line-height: 1.55; }
.expected-card { margin-top: 13px; border: 1px solid #d6d4ff; border-radius: 7px; padding: 11px; background: var(--iris-tint); }
.expected-card ul { margin: 9px 0 0; padding-left: 17px; color: #3f3b95; font-size: 11px; line-height: 1.65; }
.primary-button { width: calc(100% - 28px); min-height: 40px; margin-top: 13px; }
.secondary-button { min-height: 36px; border: 1px solid var(--line-strong); border-radius: 6px; background: white; color: var(--ink); font-size: 12px; font-weight: 600; }
.persona-editor { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 11px; }
.persona-editor summary { cursor: pointer; color: var(--ember-deep); font-size: 11px; font-weight: 600; }
.persona-editor form { padding-top: 4px; }
.events-layout { max-width: 1080px; margin: 0 auto; overflow: hidden; }
.section-copy { margin: 0; padding: 14px 16px; border-bottom: 1px solid var(--line); color: var(--soft); font-size: 12px; }
.event-list { display: grid; }
.event-item { display: grid; grid-template-columns: 112px minmax(0,1fr) 90px; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.event-item:last-child { border-bottom: 0; }
.event-item strong { font-size: 12px; }
.event-item p { margin: 4px 0 0; color: var(--soft); font-size: 11px; }
.event-item details { margin-top: 8px; }
.event-item summary { cursor: pointer; color: var(--ember-deep); font-size: 10px; font-weight: 600; }
.event-item pre { max-height: 260px; overflow: auto; border-radius: 6px; padding: 10px; background: var(--nav); color: #dce1e9; font: 10px/1.55 Geist Mono, monospace; white-space: pre-wrap; }
.status-pill { align-self: start; justify-self: end; border-radius: 999px; padding: 5px 7px; font: 600 9px/1 Geist Mono, monospace; }
.status-delivered { background: var(--green-tint); color: var(--green); }
.status-failed { background: var(--red-tint); color: var(--red); }
.status-skipped { background: var(--amber-tint); color: var(--amber); }
.status-pending { background: var(--iris-tint); color: var(--iris); }
.retry-button { display: block; margin: 8px 0 0 auto; border: 1px solid var(--line-strong); border-radius: 5px; padding: 5px 8px; background: white; color: var(--ink); font-size: 10px; font-weight: 600; }
.settings-grid { max-width: 960px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.settings-card { padding: 22px; }
.settings-card > p:not(.eyebrow) { color: var(--soft); font-size: 12px; line-height: 1.6; }
.settings-card .primary-button { width: 100%; margin-top: 16px; }
.credential { margin-top: 12px; }
.credential span { display: block; margin-bottom: 5px; color: var(--faint); font: 600 9px/1 Geist Mono, monospace; text-transform: uppercase; }
.credential code { display: block; overflow-wrap: anywhere; border: 1px solid var(--line); border-radius: 6px; padding: 9px; background: var(--canvas); font: 10px/1.5 Geist Mono, monospace; }
.security-note { margin-top: 17px; border-left: 3px solid var(--green); padding-left: 10px; }
.toast { position: fixed; right: 18px; bottom: 18px; z-index: 20; max-width: 340px; transform: translateY(20px); opacity: 0; pointer-events: none; border-radius: 7px; padding: 11px 14px; background: var(--ink); color: white; font-size: 12px; transition: .18s ease; }
.toast.is-visible { transform: translateY(0); opacity: 1; }

.people-layout { max-width: 1080px; margin: 0 auto; overflow: hidden; }
.people-create-button { min-height: 36px; border: 1px solid var(--ember-deep); border-radius: 7px; padding: 0 13px; background: var(--ember); color: white; font-size: 11px; font-weight: 700; }
.people-create-button:hover { background: var(--ember-deep); }
.people-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; padding: 16px; }
.person-card { min-width: 0; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 7px; padding: 14px; background: white; }
.person-card.is-actor { border-color: #d7b0a1; box-shadow: inset 0 3px 0 var(--ember); }
.person-card-heading { display: grid; grid-template-columns: 42px minmax(0,1fr); gap: 9px; align-items: center; }
.person-card-heading .avatar { width: 42px; height: 42px; }
.person-card-heading strong, .person-card-heading span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-card-heading strong { font-size: 13px; }
.person-card-heading span { margin-top: 3px; color: var(--faint); font-size: 10px; }
.person-card-heading b { grid-column: 1 / -1; justify-self: start; border-radius: 999px; padding: 4px 6px; background: var(--ember-tint); color: var(--ember-deep); font: 600 8px/1 Geist Mono, monospace; }
.person-card > p { min-height: 37px; margin: 13px 0; color: var(--soft); font-size: 11px; line-height: 1.55; }
.person-card dl { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; margin: 0; border-top: 1px solid var(--line); padding-top: 11px; }
.person-card dl div { min-width: 0; }
.person-card dt { color: var(--faint); font: 600 8px/1 Geist Mono, monospace; text-transform: uppercase; }
.person-card dd { margin: 5px 0 0; overflow: hidden; color: var(--ink); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.person-actions { display: flex; gap: 6px; margin-top: auto; padding-top: 14px; }
.person-actions button { flex: 1; border: 1px solid var(--line-strong); border-radius: 5px; padding: 7px 5px; background: white; color: var(--soft); font-size: 9px; font-weight: 700; }
.person-actions button:nth-child(2) { border-color: var(--ember); color: var(--ember-deep); }
.person-actions button:hover { background: var(--canvas); }

.feed-layout { max-width: 1080px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 660px) 320px; gap: 18px; align-items: start; justify-content: center; }
.social-surface { overflow: hidden; background: #fff; }
.social-header { height: 58px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 0 18px; }
.social-wordmark { font: 600 24px/1 Fraunces, Georgia, serif; letter-spacing: -.04em; }
.social-header-actions { display: flex; align-items: center; gap: 15px; font-size: 24px; }
.post-feed { min-height: 420px; }
.social-post { border-bottom: 1px solid var(--line); background: white; }
.social-post.is-linked { box-shadow: inset 3px 0 0 var(--ember); }
.social-post:last-child { border-bottom: 0; }
.post-header { height: 62px; display: flex; align-items: center; gap: 10px; padding: 10px 14px; }
.post-header .avatar { width: 36px; height: 36px; }
.post-header > div { min-width: 0; }
.post-header strong, .post-header span { display: block; }
.post-header strong { font-size: 12px; }
.post-header div span { margin-top: 2px; color: var(--faint); font-size: 10px; }
.post-menu { margin-left: auto; border: 0; padding: 7px; background: transparent; color: var(--soft); letter-spacing: 2px; }
.brand-avatar { background: var(--ink); box-shadow: inset 0 0 0 2px white, 0 0 0 1px var(--ember); }
.post-media { position: relative; width: 100%; display: block; overflow: hidden; border: 0; padding: 0; background: #eef0f3; }
.post-media img { width: 100%; aspect-ratio: 1 / 1; display: block; object-fit: cover; }
.post-media-frame { position: relative; }
.carousel-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; border: 0; border-radius: 50%; background: rgba(255,255,255,.92); color: var(--ink); font-size: 17px; line-height: 1; display: grid; place-items: center; box-shadow: 0 1px 6px rgba(0,0,0,.22); }
.carousel-nav.is-prev { left: 10px; }
.carousel-nav.is-next { right: 10px; }
.carousel-nav:disabled { opacity: 0; pointer-events: none; }
.carousel-count { position: absolute; top: 10px; right: 10px; padding: 2px 8px; border-radius: 999px; background: rgba(0,0,0,.62); color: #fff; font-size: 11px; letter-spacing: .02em; pointer-events: none; }
.carousel-dots { position: absolute; bottom: 9px; left: 0; right: 0; display: flex; justify-content: center; gap: 4px; pointer-events: none; }
.carousel-dots span { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.55); box-shadow: 0 0 3px rgba(0,0,0,.3); }
.carousel-dots span.is-active { background: #fff; }
.heart-burst { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; color: rgba(255,255,255,.95); font-size: 82px; text-shadow: 0 3px 20px rgba(0,0,0,.25); pointer-events: none; }
.post-media:active .heart-burst { opacity: 1; transform: scale(1.08); }
.post-body { padding: 10px 14px 8px; }
.post-actions { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.social-action { width: 25px; height: 25px; display: grid; place-items: center; border: 0; padding: 0; background: transparent; color: var(--ink); }
.social-action svg { width: 24px; height: 24px; display: block; }
.social-action:hover { color: var(--soft); }
.social-action.is-liked { color: #ed4956; }
.social-action.bookmark { margin-left: auto; }
.like-count { display: block; font-size: 12px; }
.share-count { display: block; margin-top: 3px; color: var(--faint); font-size: 10px; }
.post-caption { margin: 7px 0 0; font-size: 12px; line-height: 1.5; white-space: pre-wrap; }
.post-caption strong { margin-right: 3px; }
.comment-count { border: 0; padding: 5px 0 3px; background: transparent; color: var(--faint); font-size: 11px; }
.post-comments { display: grid; gap: 8px; margin-top: 5px; }
.no-comments { margin: 2px 0 7px; color: var(--faint); font-size: 11px; }
.comment-thread { display: grid; gap: 7px; }
.social-comment { display: grid; grid-template-columns: 28px minmax(0,1fr); gap: 8px; align-items: start; }
.social-comment.is-reply { margin-left: 34px; }
.social-comment .avatar { width: 28px; height: 28px; font-size: 9px; }
.social-comment-copy { min-width: 0; }
.social-comment-copy p { margin: 1px 0 0; overflow-wrap: anywhere; font-size: 11px; line-height: 1.45; }
.social-comment-copy p strong { margin-right: 4px; }
.reply-mention { color: var(--ember-deep); }
.social-comment-copy > img { width: 90px; max-height: 110px; display: block; margin-top: 6px; border-radius: 4px; object-fit: cover; }
.comment-meta { display: flex; align-items: center; gap: 11px; margin-top: 4px; color: var(--faint); font: 600 9px/1.3 Geist Mono, monospace; }
.comment-meta button { border: 0; padding: 0; background: transparent; color: var(--faint); font-weight: 600; }
.comment-meta button:hover { color: var(--ember-deep); }
.failed-label { color: var(--red); }
.post-time { display: block; margin-top: 9px; color: var(--faint); font: 500 9px/1 Geist Mono, monospace; text-transform: uppercase; }
.post-comment-form { min-height: 55px; display: grid; grid-template-columns: 28px minmax(0,1fr) auto; gap: 9px; align-items: center; border-top: 1px solid var(--line); padding: 9px 14px; }
.post-comment-form > .avatar { width: 28px; height: 28px; font-size: 9px; }
.comment-input-wrap { min-width: 0; }
.comment-input-wrap input { width: 100%; border: 0; padding: 7px 0; outline: 0; color: var(--ink); font-size: 11px; }
.post-comment-form > button { border: 0; padding: 6px 0; background: transparent; color: var(--ember); font-size: 11px; font-weight: 700; }
.post-comment-form > button:disabled { color: var(--faint); }
.replying-banner { display: flex; align-items: center; justify-content: space-between; color: var(--faint); font-size: 9px; }
.replying-banner button { border: 0; padding: 0 4px; background: transparent; color: var(--faint); }
.feed-empty { min-height: 480px; display: grid; place-content: center; justify-items: center; gap: 8px; padding: 28px; text-align: center; }
.feed-empty strong { font: 500 20px/1.2 Fraunces, Georgia, serif; }
.feed-empty span { max-width: 330px; color: var(--soft); font-size: 12px; line-height: 1.55; }
.feed-empty button { margin-top: 8px; border: 0; background: transparent; color: var(--ember-deep); font-size: 12px; font-weight: 700; }
.feed-controls { display: grid; gap: 14px; }
.actor-card, .feed-action-card, .feed-guide { padding: 18px; }
.actor-card h2, .feed-action-card h2 { margin: 5px 0 0; font: 500 19px/1.2 Fraunces, Georgia, serif; }
.actor-card > p:not(.eyebrow), .feed-action-card > p:not(.eyebrow) { color: var(--soft); font-size: 12px; line-height: 1.55; }
.actor-profile { display: flex; align-items: center; gap: 9px; margin-top: 13px; border-top: 1px solid var(--line); padding-top: 13px; }
.actor-profile strong, .actor-profile span { display: block; }
.actor-profile strong { font-size: 12px; }
.actor-profile span { margin-top: 2px; color: var(--faint); font-size: 10px; }
.manage-customers-button { width: 100%; margin-top: 13px; }
.feed-action-card .primary-button { width: 100%; min-height: 38px; margin-top: 8px; }
.feed-guide ol { display: grid; gap: 11px; margin: 13px 0 0; padding: 0; list-style: none; }
.feed-guide li { display: flex; align-items: center; gap: 9px; color: var(--soft); font-size: 11px; }
.feed-guide li span { width: 20px; height: 20px; display: grid; flex: none; place-items: center; border-radius: 50%; background: var(--iris-tint); color: var(--iris); font: 600 9px/1 Geist Mono, monospace; }
.lab-dialog { width: min(500px, calc(100vw - 28px)); border: 0; border-radius: 10px; padding: 0; background: transparent; box-shadow: 0 28px 80px rgba(17,19,24,.26); }
.lab-dialog::backdrop { background: rgba(21,25,34,.54); backdrop-filter: blur(2px); }
.dialog-card { display: grid; gap: 13px; padding: 20px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.dialog-heading h2 { margin: 5px 0 0; font: 500 22px/1.2 Fraunces, Georgia, serif; }
.dialog-close { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 50%; background: white; color: var(--soft); font-size: 20px; line-height: 1; }
.dialog-card .field { margin-top: 0; }
.field textarea { width: 100%; min-width: 0; resize: vertical; border: 1px solid var(--line-strong); border-radius: 6px; padding: 9px; background: white; color: var(--ink); font-size: 12px; }
.dialog-card .primary-button { width: 100%; min-height: 40px; margin-top: 2px; }
.dialog-actions { display: flex; align-items: center; gap: 9px; }
.dialog-actions .primary-button { flex: 1; }
.danger-button { min-height: 40px; border: 1px solid #efb6b2; border-radius: 7px; padding: 0 13px; background: var(--red-tint); color: var(--red); font-size: 11px; font-weight: 700; }
.asset-choices { display: flex; flex-wrap: wrap; gap: 7px; }
.asset-choices button { border: 1px solid var(--line); border-radius: 999px; padding: 6px 9px; background: var(--canvas); color: var(--soft); font-size: 10px; }
.message-post-preview { display: grid; grid-template-columns: 84px minmax(0,1fr); gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 7px; padding: 9px; background: var(--canvas); }
.message-post-preview img { width: 84px; height: 84px; border-radius: 5px; object-fit: cover; }
.message-post-preview strong { font-size: 11px; }
.message-post-preview p { margin: 5px 0; color: var(--soft); font-size: 11px; line-height: 1.4; }
.message-post-preview span { color: var(--faint); font: 500 9px/1.2 Geist Mono, monospace; }
.scenario-customer-button { width: calc(100% - 28px); margin: 13px 14px 0; }
.customer-dialog { width: min(680px, calc(100vw - 28px)); }
.customer-manager-list { max-height: 290px; overflow-y: auto; display: grid; border: 1px solid var(--line); border-radius: 7px; }
.customer-manager-item { display: grid; grid-template-columns: 34px minmax(0,1fr) auto; gap: 10px; align-items: center; padding: 10px; border-bottom: 1px solid var(--line); }
.customer-manager-item:last-child { border-bottom: 0; }
.customer-manager-item strong, .customer-manager-item span, .customer-manager-item small { display: block; }
.customer-manager-item strong { font-size: 12px; }
.customer-manager-item span { margin-top: 2px; color: var(--faint); font-size: 10px; }
.customer-manager-item small { max-width: 380px; margin-top: 4px; overflow: hidden; color: var(--soft); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.manager-item-actions { display: flex; gap: 5px; }
.manager-item-actions button, .manager-form-heading button { border: 0; padding: 5px 7px; background: transparent; color: var(--ember-deep); font-size: 10px; font-weight: 700; }
.manager-item-actions button:last-child { color: var(--red); }
.manager-item-actions button:disabled { color: var(--faint); cursor: not-allowed; }
.persona-manager-form { display: grid; gap: 10px; border-top: 1px solid var(--line); padding-top: 13px; }
.persona-manager-form .field { margin-top: 0; }
.manager-form-heading { display: flex; align-items: center; justify-content: space-between; }
.manager-form-heading strong { font: 500 16px/1.2 Fraunces, Georgia, serif; }
.persona-manager-form > .primary-button { width: 100%; }

@media (max-width: 1120px) {
  .feed-layout { grid-template-columns: minmax(0, 1fr) 280px; }
  .lab-grid { grid-template-columns: 240px minmax(360px, 1fr); }
  .scenario-panel { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; padding: 14px; }
  .scenario-panel .panel-heading { grid-column: 1 / -1; padding: 0; }
  .scenario-panel > .field, .scenario-panel > .two-fields, .scenario-panel > .scenario-description, .scenario-panel > .expected-card, .scenario-panel > button, .scenario-panel > details { margin: 0; }
  .scenario-panel .expected-card { grid-column: span 2; }
  .scenario-panel .primary-button { width: 100%; align-self: end; }
  .people-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

/* Mobile shell -------------------------------------------------------------
   Below 860px the sidebar becomes a bottom tab bar and the workspace switcher
   becomes a compact top bar, because a phone's scarce resource is vertical
   space: the old layout spent 560 of 812 pixels on chrome before the first post.
   The messages view stops stacking three tall panels and becomes what a phone
   messaging app is — a list you tap into, and a back button out. */

@media (max-width: 860px) {
  .app-shell { display: block; padding-bottom: calc(64px + env(safe-area-inset-bottom)); }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 12;
    height: auto;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px) * 0);
    border-right: 0;
    border-bottom: 1px solid rgba(255,255,255,.1);
  }
  .brand { height: auto; padding: 0; border-bottom: 0; font-size: 15px; }
  .brand span:not(.brand-mark) { display: none; }
  .brand-mark { width: 30px; height: 30px; }
  .workspace-switcher { padding: 0; border-bottom: 0; }
  .workspace-switcher > label { display: none; }
  .workspace-row { grid-template-columns: minmax(0,1fr) 40px; gap: 8px; }
  .workspace-row select, .workspace-row button { height: 40px; }
  .workspace-scope-note { display: none; }
  .workspace-signout { width: auto; margin: 0; padding: 0 10px; }
  .isolation-card { display: none; }

  /* The tab bar. Six destinations, thumb-reachable, over the home indicator. */
  .side-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 14;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0;
    padding: 0 0 env(safe-area-inset-bottom);
    background: var(--nav);
    border-top: 1px solid rgba(255,255,255,.12);
  }
  .side-link {
    position: relative;
    min-height: 56px;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    border: 0;
    border-radius: 0;
    padding: 8px 2px;
    font-size: 9px;
    line-height: 1.15;
    text-align: center;
    letter-spacing: -0.01em;
  }
  .side-link > span[aria-hidden] { font-size: 17px; line-height: 1; }
  .side-link:hover, .side-link.is-active { background: transparent; color: white; }
  .side-link.is-active::before {
    content: "";
    position: absolute;
    top: 0;
    left: 22%;
    right: 22%;
    height: 2px;
    background: var(--ember);
  }
  /* The count rides on the icon rather than taking a column of its own. */
  .side-link strong {
    position: absolute;
    top: 5px;
    left: 50%;
    margin: 0 0 0 4px;
    min-width: 16px;
    padding: 2px 4px;
    background: var(--nav-raised);
    font-size: 9px;
  }
  .side-link strong.is-alert { background: var(--red); }

  .standing-banner { padding: 9px 14px; font-size: 11.5px; }
  .standing-banner button { margin-left: 0; width: 100%; min-height: 38px; }

  /* The headline is decoration; on a phone the content is the point. */
  .topbar { min-height: 0; display: block; padding: 12px 14px; }
  .topbar .eyebrow { font-size: 9px; }
  .topbar h1 { margin-top: 4px; font-size: 18px; line-height: 1.25; }
  .platform-toggle { width: 100%; margin-top: 10px; }
  .platform-toggle button { flex: 1; min-height: 40px; }

  .view { padding: 10px; }

  .feed-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .feed-controls { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .social-surface { border-radius: 8px; }
  .post-comment-form > button { min-height: 40px; padding: 0 6px; }
  .comment-input-wrap input { min-height: 40px; font-size: 16px; }

  /* Messages: a list you tap into, not three panels stacked head to toe. */
  .lab-grid { display: block; min-height: 0; }
  .thread-panel { margin-bottom: 12px; }
  .conversation-list { max-height: none; }
  .conversation-item { min-height: 62px; padding: 11px 12px; }
  .conversation-search input { min-height: 42px; font-size: 16px; }
  .chat-panel { display: none; min-height: 0; }
  .scenario-panel { display: block; margin-bottom: 12px; padding: 0 0 16px; }
  .scenario-panel .panel-heading { padding: 14px 14px 4px; }
  .scenario-panel > .field, .scenario-panel > .two-fields, .scenario-panel > .scenario-description,
  .scenario-panel > .expected-card, .scenario-panel > button {
    margin-left: 14px;
    margin-right: 14px;
    margin-top: 12px;
  }
  .scenario-panel .primary-button, .scenario-customer-button { width: calc(100% - 28px); }
  .scenario-panel .field select { min-height: 42px; font-size: 16px; }

  .lab-grid.is-thread-open .thread-panel,
  .lab-grid.is-thread-open .scenario-panel { display: none; }
  /* Reading a thread is its own screen. Sizing it by subtracting guesses from the
     viewport put the composer behind the tab bar, so it is pinned to the real
     chrome instead: --top-chrome is measured from the header, and the tab bar
     height is the one constant this file actually owns. */
  .lab-grid.is-thread-open .chat-panel {
    position: fixed;
    top: var(--top-chrome, 56px);
    left: 0;
    right: 0;
    bottom: calc(56px + env(safe-area-inset-bottom));
    z-index: 10;
    display: flex;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    box-shadow: none;
  }
  /* The platform toggle belongs to the list, not to the thread on top of it. */
  .lab-grid.is-thread-open ~ * .topbar,
  .app-shell:has(.lab-grid.is-thread-open) .topbar { display: none; }
  .thread-back { display: inline-grid; }
  .chat-header { gap: 8px; padding: 10px 12px; }
  .chat-header .avatar { width: 34px; height: 34px; }
  .thread-actions { gap: 6px; }
  .thread-actions button { min-height: 34px; padding: 0 9px; }
  .message { max-width: 86%; }
  .message-list { min-height: 0; padding: 14px 12px; }
  .composer { padding: 9px 10px calc(9px + env(safe-area-inset-bottom) * 0.5); }
  /* 16px keeps iOS Safari from zooming the whole page on focus. */
  .composer textarea { font-size: 16px; }
  .composer-row { grid-template-columns: minmax(0,1fr) 64px; }
  .send-button { min-height: 44px; }
  .attachment-dropzone { flex-wrap: wrap; gap: 7px; }
  .attachment-button { min-height: 36px; }
  .drop-hint { display: none; }
  .photo-url-option[open] input { width: min(230px, calc(100vw - 48px)); }

  .people-grid, .settings-grid { grid-template-columns: minmax(0, 1fr); }
  .people-layout .panel-heading { flex-wrap: wrap; }
  .people-create-button { min-height: 40px; }

  /* Events: side-by-side columns become unreadable well before this width. */
  .event-item { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 13px 14px; }
  .event-item .status-pill { justify-self: start; }
  .event-item .retry-button { margin: 0; min-height: 38px; }
  .event-item pre { max-height: 200px; font-size: 9.5px; }
  .event-filters { gap: 5px; padding: 10px 12px; overflow-x: auto; flex-wrap: nowrap; }
  .event-filter { flex: none; min-height: 36px; }
  .event-actions { flex-wrap: wrap; gap: 6px; justify-content: flex-start; }
  .event-actions .secondary-button { flex: 1 1 100%; }
  .event-actions .secondary-button, .event-actions .quiet-button { min-height: 36px; }

  .connection-check { flex-direction: column; align-items: stretch; }
  .connection-check .secondary-button { flex: 1 1 auto; width: 100%; min-height: 42px; }

  .identify-layout { grid-template-columns: minmax(0, 1fr); }

  /* Dialogs become sheets: full width, capped height, scrolling inside. */
  .lab-dialog, .customer-dialog, .picker-dialog { width: 100%; max-width: 100%; margin: auto auto 0; border-radius: 12px 12px 0 0; }
  .lab-dialog .dialog-card, .picker-dialog .dialog-card {
    width: 100%;
    max-height: calc(100dvh - 40px);
    overflow-y: auto;
    border-radius: 12px 12px 0 0;
    padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  }
  .two-fields { grid-template-columns: minmax(0, 1fr); }
  .dialog-card .field input, .dialog-card .field select, .dialog-card .field textarea { min-height: 42px; font-size: 16px; }
  .dialog-close { width: 36px; height: 36px; }
  .customer-manager-list { max-height: 240px; }
  .customer-manager-item { grid-template-columns: 34px minmax(0,1fr); }
  .manager-item-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .manager-item-actions button { min-height: 36px; padding: 0 10px; }
  .picker-results, .picker-day { max-height: 42dvh; }
  .picker-tab { min-height: 40px; }

  .toast { left: 12px; right: 12px; bottom: calc(72px + env(safe-area-inset-bottom)); max-width: none; }

  .lock-screen { padding: 16px; align-items: center; }
  .lock-card { padding: 22px 18px; }
}

@media (max-width: 620px) {
  /* Below this a title and its buttons genuinely cannot share a row: "Signed
     webhook attempts" was breaking across three lines to make room for two. */
  .panel-heading { flex-direction: column; align-items: stretch; gap: 10px; padding: 14px 12px; }
  .panel-heading h2 { font-size: 17px; }
  .panel-heading > .quiet-button { align-self: flex-start; }
}

@media (max-width: 420px) {
  .topbar h1 { font-size: 16.5px; }
  .side-link { font-size: 8.5px; }
  .side-link > span[aria-hidden] { font-size: 16px; }
  .view { padding: 8px; }
  .post-body { padding-left: 12px; padding-right: 12px; }
  .post-comment-form { padding-left: 12px; padding-right: 12px; }
  .social-comment.is-reply { margin-left: 20px; }
  .person-card dl { grid-template-columns: minmax(0,1fr) auto; }
  .scenario-panel > .field, .scenario-panel > .two-fields, .scenario-panel > .scenario-description,
  .scenario-panel > .expected-card, .scenario-panel > button { margin-left: 12px; margin-right: 12px; }
  .scenario-panel .primary-button, .scenario-customer-button { width: calc(100% - 24px); }
}

/* Coarse pointers get real tap targets regardless of viewport width. */
@media (pointer: coarse) {
  .social-action { width: 34px; height: 34px; }
  .comment-meta button { min-height: 32px; padding: 0 2px; }
  .post-menu { min-width: 40px; min-height: 40px; }
  .quiet-button { min-height: 36px; }
  .carousel-nav { width: 34px; height: 34px; }
  .copy-button { min-height: 30px; padding: 5px 9px; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Image picker ----------------------------------------------------------- */
.chat-attachment-preview { display: flex; flex-wrap: wrap; gap: 8px; grid-template-columns: none; }
.staged-image { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 8px; align-items: center; margin: 0; border: 1px solid var(--line); border-radius: 7px; padding: 7px 26px 7px 7px; background: var(--surface); }
.staged-image.is-next { border-color: var(--ember); background: var(--ember-tint); }
.staged-image img { width: 44px; height: 44px; border-radius: 5px; object-fit: cover; }
.staged-image figcaption { min-width: 0; }
.staged-image strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 140px; font-size: 11px; }
.staged-image figcaption span { display: block; margin-top: 2px; color: var(--soft); font-size: 9px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.staged-image.is-next figcaption span { color: var(--ember-deep); }
.staged-image button { position: absolute; top: 4px; right: 4px; width: 18px; height: 18px; border: 0; border-radius: 50%; background: transparent; color: var(--faint); font-size: 14px; line-height: 1; cursor: pointer; }
.staged-image button:hover { background: var(--line); color: var(--ink); }

.picker-dialog .dialog-card { width: min(720px, 94vw); }
.picker-tabs { display: flex; gap: 4px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.picker-tab { border: 0; border-bottom: 2px solid transparent; padding: 7px 12px; background: none; color: var(--soft); font-size: 11px; font-weight: 700; letter-spacing: 0.03em; cursor: pointer; }
.picker-tab:hover { color: var(--ink); }
.picker-tab.is-active { border-bottom-color: var(--ember); color: var(--ember-deep); }
.picker-panel { display: grid; gap: 10px; min-height: 260px; align-content: start; }
.picker-hint { margin: 0; color: var(--faint); font-size: 10px; }
.picker-empty { margin: 0; padding: 18px 0; color: var(--faint); font-size: 11px; text-align: center; }

.picker-dropzone { display: grid; gap: 4px; border: 1px dashed var(--line-strong); border-radius: 9px; padding: 22px; background: var(--canvas); color: var(--ink); text-align: center; cursor: pointer; }
.picker-dropzone:hover { border-color: var(--ember); background: var(--ember-tint); }
.picker-dropzone strong { font-size: 12px; }
.picker-dropzone span { color: var(--soft); font-size: 10px; }

.picker-results { display: grid; gap: 10px; max-height: 330px; overflow-y: auto; }
.picker-product { border: 1px solid var(--line); border-radius: 8px; padding: 9px; background: var(--surface); }
.picker-product header { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; margin-bottom: 7px; }
.picker-product header strong { font-size: 11px; }
.picker-product header span { color: var(--soft); font-family: "Geist Mono", monospace; font-size: 10px; }
.picker-thumbs { display: flex; flex-wrap: wrap; gap: 7px; }
.picker-thumb { position: relative; width: 74px; border: 1px solid var(--line); border-radius: 7px; padding: 0; overflow: hidden; background: var(--canvas); cursor: pointer; }
.picker-thumb:hover { border-color: var(--ember); }
.picker-thumb img { display: block; width: 100%; height: 74px; object-fit: cover; }
.picker-thumb span { display: block; overflow: hidden; padding: 3px 5px; color: var(--soft); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.picker-thumb.is-empty { display: grid; place-items: center; height: 74px; padding: 5px; color: var(--faint); font-size: 9px; text-align: center; cursor: default; }

.picker-month { display: flex; justify-content: space-between; align-items: center; }
.picker-month strong { font-family: Fraunces, serif; font-size: 14px; }
.picker-calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.picker-weekday { padding-bottom: 3px; color: var(--faint); font-size: 9px; font-weight: 700; text-align: center; }
.picker-cell { position: relative; display: grid; place-items: center; aspect-ratio: 1 / 1; border: 1px solid transparent; border-radius: 6px; background: var(--canvas); color: var(--faint); font-size: 10px; cursor: default; }
.picker-cell.is-blank { background: none; }
.picker-cell.has-posts { border-color: var(--line); background: var(--surface); color: var(--ink); font-weight: 600; cursor: pointer; }
.picker-cell.has-posts:hover { border-color: var(--ember); }
.picker-cell.is-selected { border-color: var(--ember); background: var(--ember-tint); color: var(--ember-deep); }
.picker-cell i { position: absolute; right: 3px; bottom: 2px; color: var(--ember-deep); font-size: 8px; font-style: normal; font-weight: 700; }
.picker-day { display: grid; gap: 9px; max-height: 210px; overflow-y: auto; }
.picker-post { border: 1px solid var(--line); border-radius: 8px; padding: 9px; background: var(--surface); }
.picker-post header { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.picker-post header strong { font-size: 11px; }
.picker-post header span { color: var(--faint); font-size: 9px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.picker-post p { margin: 4px 0 7px; color: var(--soft); font-size: 10px; }
.picker-post-products { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 7px; }
.picker-post-products .eyebrow { margin-bottom: 5px; }

.picker-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }

/* Product identifier — the ladder, reported rung by rung. A miss is as much of a
   result as a hit here, so misses are styled as findings rather than as absence. */
.identify-layout { display: grid; grid-template-columns: minmax(0,360px) minmax(0,1fr); gap: 18px; align-items: start; max-width: 1080px; margin: 0 auto; }
.identify-input, .identify-output { overflow: hidden; }
.identify-input > .field, .identify-input > .primary-button { margin-left: 16px; margin-right: 16px; }
.identify-input > .primary-button { width: calc(100% - 32px); margin-bottom: 16px; }
.identify-drop { display: flex; align-items: center; justify-content: center; min-height: 104px; margin: 14px 16px 0; border: 1px dashed var(--line-strong); border-radius: 8px; padding: 14px; background: var(--canvas); color: var(--soft); font-size: 12px; text-align: center; cursor: pointer; }
.identify-drop:hover, .identify-drop.is-over { border-color: var(--ember); background: var(--ember-tint); color: var(--ember-deep); }
.identify-preview { display: block; width: calc(100% - 32px); max-height: 260px; margin: 12px 16px 0; border: 1px solid var(--line); border-radius: 7px; object-fit: contain; background: var(--canvas); }
.identify-candidates { display: grid; gap: 9px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.identify-candidates:empty { display: none; }
.identify-candidate { display: grid; grid-template-columns: 48px minmax(0,1fr) auto; gap: 11px; align-items: center; border: 1px solid var(--line); border-radius: 7px; padding: 9px; background: var(--canvas); }
.identify-candidate img { width: 48px; height: 48px; border-radius: 5px; object-fit: cover; background: var(--line); }
.identify-candidate h3 { margin: 0; font-size: 13px; font-weight: 600; }
.identify-candidate p { margin: 2px 0 0; color: var(--faint); font: 500 10px/1.4 Geist Mono, monospace; letter-spacing: .06em; text-transform: uppercase; }
.identify-band { border-radius: 999px; padding: 4px 9px; font: 700 10px/1 Geist Mono, monospace; letter-spacing: .08em; }
.identify-band.HIGH { background: var(--green-tint); color: var(--green); }
.identify-band.MEDIUM { background: var(--amber-tint); color: var(--amber); }
.identify-band.LOW { background: var(--canvas); color: var(--faint); }
.identify-stages { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.identify-stage { display: grid; grid-template-columns: 18px minmax(0,1fr); gap: 11px; border-bottom: 1px solid var(--line); padding: 12px 16px; }
.identify-stage:last-child { border-bottom: 0; }
.identify-stage > span { width: 18px; height: 18px; border-radius: 999px; font: 700 11px/18px Geist Mono, monospace; text-align: center; }
.identify-stage.hit > span { background: var(--green-tint); color: var(--green); }
.identify-stage.miss > span { background: var(--red-tint); color: var(--red); }
.identify-stage.skipped > span { background: var(--canvas); color: var(--faint); }
.identify-stage h3 { margin: 0; font-size: 12px; font-weight: 600; }
.identify-stage p { margin: 3px 0 0; color: var(--soft); font-size: 12px; }
.identify-empty { padding: 16px; color: var(--faint); font-size: 12px; }
@media (max-width: 900px) { .identify-layout { grid-template-columns: minmax(0,1fr); } }

/* Production surfaces --------------------------------------------------------
   Standing notices, connection health, event filters and the access gate. These
   answer questions the old console left to guesswork: is the lab talking to
   Jimmaa, why is nothing arriving, and what happened to the events that failed. */

.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.standing-banner { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; padding: 10px 28px; border-bottom: 1px solid var(--line); font-size: 12px; line-height: 1.5; }
.standing-banner strong { font-size: 12px; font-weight: 700; }
.standing-banner span { color: inherit; opacity: .82; }
.standing-banner button { margin-left: auto; border: 1px solid currentColor; border-radius: 6px; padding: 5px 9px; background: transparent; color: inherit; font-size: 11px; font-weight: 700; }
.standing-banner.is-offline { background: var(--red-tint); color: var(--red); border-bottom-color: #f0c4c1; }
.standing-banner.is-warning { background: var(--amber-tint); color: var(--amber); border-bottom-color: #e9d3b4; }

.conversation-search { display: block; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.conversation-search input { width: 100%; border: 1px solid var(--line-strong); border-radius: 6px; padding: 7px 9px; font-size: 12px; }

.conversation-meta em.is-failed { color: var(--red); font-weight: 700; }
.side-link strong.is-alert { background: var(--red); color: white; }

.connection-check { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin-top: 14px; border-top: 1px solid var(--line); padding-top: 14px; }
.connection-chip { display: inline-flex; align-items: center; gap: 7px; min-width: 0; flex: 1; border-radius: 6px; padding: 8px 10px; font-size: 11px; line-height: 1.4; }
.connection-chip::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.connection-chip.is-idle { background: var(--canvas); color: var(--faint); }
.connection-chip.is-checking { background: var(--iris-tint); color: var(--iris); }
.connection-chip.is-ok { background: var(--green-tint); color: var(--green); }
.connection-chip.is-failed { background: var(--red-tint); color: var(--red); }
.connection-check .secondary-button { flex: none; padding: 0 12px; }

.event-actions { display: flex; align-items: center; gap: 8px; }
.event-actions .secondary-button { min-height: 32px; padding: 0 11px; font-size: 11px; }
.event-filters { display: flex; flex-wrap: wrap; gap: 6px; padding: 11px 16px; border-bottom: 1px solid var(--line); }
.event-filter { border: 1px solid var(--line); border-radius: 999px; padding: 5px 11px; background: var(--surface); color: var(--soft); font-size: 11px; font-weight: 600; }
.event-filter b { margin-left: 5px; color: var(--faint); font: 600 10px/1 Geist Mono, monospace; }
.event-filter:hover { border-color: var(--line-strong); color: var(--ink); }
.event-filter.is-active { border-color: var(--ink); background: var(--ink); color: white; }
.event-filter.is-active b { color: rgba(255,255,255,.7); }
.event-item details .quiet-button { margin-top: 7px; padding: 0; }

.credential span { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.copy-button { border: 1px solid var(--line); border-radius: 5px; padding: 3px 7px; background: var(--surface); color: var(--soft); font: 600 9px/1.4 Geist Mono, monospace; letter-spacing: .06em; text-transform: uppercase; }
.copy-button:hover { border-color: var(--ember); color: var(--ember-deep); }

.bot-state { display: inline-block; margin-left: 8px; border-radius: 999px; padding: 4px 9px; background: var(--canvas); color: var(--faint); font: 600 9px/1 Geist Mono, monospace; letter-spacing: .08em; text-transform: uppercase; vertical-align: middle; }
.bot-state.is-running { background: var(--green-tint); color: var(--green); }
#bot-card .secondary-button { width: 100%; margin-top: 14px; }

.dialog-copy { margin: 0; color: var(--soft); font-size: 12px; line-height: 1.55; }

/* The gate. Rendered over everything because a locked lab has nothing behind it
   worth showing — the API answers 401 to every request the page could make. */
.lock-screen { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 24px; background: var(--nav); }
.lock-card { width: min(390px, 100%); display: grid; gap: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 26px; background: var(--surface); box-shadow: 0 30px 80px rgba(0,0,0,.4); }
.lock-card .brand { height: auto; padding: 0 0 4px; border-bottom: 0; color: var(--ink); }
.lock-card h1 { margin: 0; font: 500 24px/1.2 Fraunces, Georgia, serif; }
.lock-card > p { margin: 0; color: var(--soft); font-size: 12px; line-height: 1.55; }
.lock-card .primary-button { width: 100%; margin-top: 4px; }
.lock-note { color: var(--faint); font-size: 11px; }
.lock-note code { font: 500 10px/1.4 Geist Mono, monospace; }

.toast { cursor: pointer; }
.toast.is-error { background: var(--red); }

@media (max-width: 820px) {
  .standing-banner { padding: 9px 18px; }
  .event-actions { flex-wrap: wrap; justify-content: flex-end; }
}

.workspace-scope-note { margin: 9px 0 0; color: #9da5b1; font-size: 10px; line-height: 1.45; }
.workspace-signout { width: 100%; margin-top: 9px; min-height: 32px; border: 1px solid rgba(255,255,255,.18); border-radius: 6px; background: transparent; color: #aeb5c0; font-size: 11px; font-weight: 600; }
.workspace-signout:hover { border-color: rgba(255,255,255,.34); color: white; }
.is-scoped .workspace-row { grid-template-columns: minmax(0,1fr); }
.is-scoped #workspace-select { opacity: .82; }

/* The back affordance only exists where the thread is its own screen. */
.thread-back { display: none; width: 34px; height: 34px; flex: none; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: white; color: var(--ink); font-size: 21px; line-height: 1; }
.thread-back:hover { border-color: var(--line-strong); background: var(--canvas); }

.nav-short { display: none; }

@media (max-width: 860px) {
  /* One word per tab. "Connection settings" wraps to two lines and shoves the
     icons out of alignment across the whole bar. */
  .nav-long { display: none; }
  .nav-short { display: block; }
  /* The headline sells the tool once. On a phone, every time it is opened, it is
     120px of scrolling between the tester and the feed. */
  .topbar .eyebrow, .topbar h1 { display: none; }
  .topbar { padding: 10px 12px; border-bottom: 0; }
  .platform-toggle { margin-top: 0; }
  /* Re-stated after the base rule above, which is later in source order. */
  .thread-back { display: inline-grid; }
  /* "Settings" is the longest label and sits hard against the screen edge. */
  .side-nav { padding-left: 4px; padding-right: 4px; }
  /* Six tabs into 375px leaves 61px each, and "Settings" is the one label that
     does not fit at 8.5px. Tightening the tracking beats truncating it. */
  .side-link { padding-left: 0; padding-right: 0; font-size: 8.5px; letter-spacing: -0.02em; }
  .side-link .nav-short { overflow: hidden; max-width: 100%; text-overflow: ellipsis; white-space: nowrap; }
}
