@font-face {
    font-family: Manrope;
    src: url("../fonts/manrope.woff2") format("woff2");
    font-weight: 200 800;
    font-display: swap;
}

:root {
    color-scheme: light;
    --accent: #5347d3;
    --on-accent: #fff;
    --nav: #181d37;
    --nav-muted: #a8b0d1;
    --paper: #fff;
    --canvas: #f3f5fa;
    --ink: #1e2740;
    --muted: #5b657b;
    --line: #e2e6f0;
    --tint: color-mix(in srgb, var(--accent) 8%, #fff);
    --accent-ink: color-mix(in srgb, var(--accent) 38%, #17213a);
    --green: #147754;
    --green-bg: #e3f5ec;
    --radius: 17px;
    --shadow: 0 10px 26px rgba(34, 43, 78, .045);
    font-family: Manrope, system-ui, sans-serif;
    font-synthesis: none;
    font-size: 15px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--canvas); color: var(--ink); line-height: 1.55; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.7rem, 3vw, 2.65rem); font-weight: 800; letter-spacing: -.055em; line-height: 1.1; }
h2 { font-size: 1.11rem; font-weight: 800; letter-spacing: -.032em; line-height: 1.25; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; color: inherit; }
button:disabled { cursor: wait; opacity: .61; }
img { display: block; max-width: 100%; }
textarea { resize: vertical; }
.icon { flex: 0 0 auto; vertical-align: middle; }
.inline-icon { display: inline-flex; flex: 0 0 auto; align-items: center; }
:focus-visible { outline: 3px solid var(--accent-ink); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: 12px; left: 12px; z-index: 20; transform: translateY(-150%); background: var(--paper); padding: 10px 16px; border-radius: 10px; }
.skip-link:focus { transform: none; }

.btn, .icon-btn {
    border: 1px solid transparent;
    border-radius: 10px;
    min-height: 44px;
    padding: 8px 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    line-height: 1.25;
    font-size: .88rem;
    font-weight: 800;
    background: var(--paper);
    transition: background .16s ease, border-color .16s ease;
}
.btn .icon, .icon-btn .icon { width: 17px; height: 17px; }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(.95); }
.btn.subtle, .icon-btn { border-color: var(--line); }
.btn.subtle:hover, .icon-btn:hover { background: var(--tint); border-color: color-mix(in srgb, var(--accent) 25%, var(--line)); }
.icon-btn { width: 44px; padding: 0; flex-shrink: 0; }
.btn.full { width: 100%; }
.pill { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 6px 10px; font-size: .75rem; font-weight: 800; line-height: 1.3; border-radius: 30px; white-space: nowrap; }
.pill.neutral, .pill.connection { color: #596278; background: #e9edf5; }
.pill.is-live, .pill.connection.is-live { color: var(--green); background: var(--green-bg); }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; background: currentColor; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: .71rem; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; }
.eyebrow i { width: 8px; height: 8px; border-radius: 2px; background: var(--accent); transform: rotate(16deg); }
.lede { color: var(--muted); font-size: .97rem; margin: 12px 0 24px; max-width: 52ch; }
.notice { padding: 12px 15px; margin: 0 0 17px; border-radius: 10px; font-weight: 700; font-size: .9rem; }
.notice.success { background: var(--green-bg); color: var(--green); }
.notice.danger { background: #fff0ef; color: #9a292a; border: 1px solid #f4cac7; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.stack { display: grid; gap: 16px; align-content: start; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .wide { grid-column: 1 / -1; }
label { display: grid; gap: 5px; font-size: .85rem; font-weight: 800; min-width: 0; }
label small, .helper { font-weight: 500; color: var(--muted); font-size: .8rem; }
input:not([type="checkbox"]), textarea, select {
    width: 100%;
    min-width: 0;
    border: 1px solid #cfd6e6;
    border-radius: 9px;
    background: #fff;
    padding: 10px 11px;
    min-height: 44px;
    color: var(--ink);
    font-size: .95rem;
    font-weight: 550;
}
textarea:focus, input:focus, select:focus { border-color: var(--accent-ink); }
input::placeholder, textarea::placeholder { color: #67718a; opacity: 1; }
input[type="checkbox"] { accent-color: var(--accent); width: 18px; height: 18px; margin: 0; flex-shrink: 0; }
input[type="file"] { padding: 7px; }
input[type="file"]::file-selector-button { border: 0; border-radius: 6px; background: var(--tint); color: var(--accent-ink); font: inherit; font-size: .81rem; font-weight: 800; padding: 6px 8px; margin-right: 7px; }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; flex-wrap: wrap; }
.button-wrap { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.check-label { display: flex; align-items: center; gap: 8px; font-size: .8rem; min-height: 44px; }
.switch-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 11px 12px;
    min-height: 58px;
    background: var(--canvas);
    border: 1px solid var(--line);
    border-radius: 10px;
}
.switch-row small { display: block; padding-top: 1px; }
.switch-row input[role="switch"] {
    appearance: none;
    width: 42px;
    height: 23px;
    border-radius: 20px;
    background: #78849c;
    cursor: pointer;
    padding: 3px;
}
.switch-row input[role="switch"]::before { content: ""; display: block; width: 17px; height: 17px; border-radius: 50%; background: #fff; transition: transform .16s ease; }
.switch-row input[role="switch"]:checked { background: var(--accent-ink); }
.switch-row input[role="switch"]:checked::before { transform: translateX(19px); }
.feature-icon { width: 43px; height: 43px; flex: 0 0 auto; display: inline-grid; place-items: center; background: var(--tint); color: var(--accent-ink); border-radius: 12px; }
.feature-icon .icon { width: 20px; height: 20px; }

.auth-shell { min-height: 100dvh; display: grid; grid-template-columns: minmax(280px, .85fr) minmax(480px, 1.15fr); }
.auth-panel {
    position: sticky;
    top: 0;
    height: 100dvh;
    min-height: 600px;
    background: var(--nav);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 24px;
    padding: clamp(24px, 5vw, 72px);
    overflow: hidden;
}
.auth-brand { display: flex; align-items: center; gap: 12px; font-size: 1.22rem; letter-spacing: -.04em; }
.brand-glyph { width: 39px; height: 39px; flex: 0 0 auto; background: var(--accent); color: var(--on-accent); border-radius: 11px; display: grid; place-items: center; }
.brand-glyph .icon { width: 22px; height: 22px; }
.brand-image { overflow: hidden; background: #fff; }
.brand-image img { width: 100%; height: 100%; object-fit: contain; }
.auth-story { max-width: 460px; margin: 0 auto; width: 100%; }
.auth-story .kicker { color: #a7a3ff; font-weight: 800; font-size: .76rem; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 12px; }
.auth-story h2 { color: #fff; font-size: clamp(2.15rem, 4.2vw, 4.1rem); line-height: 1.05; letter-spacing: -.067em; margin-bottom: 14px; max-width: 12ch; }
.auth-story > p:last-of-type { color: #c0c7e1; font-size: .96rem; max-width: 34ch; }
.auth-foot { color: #c0c7e1; font-size: .77rem; font-weight: 700; }
.signal-board { min-height: 175px; position: relative; margin-top: 24px; border: 1px solid #41486d; border-radius: 17px; overflow: hidden; background: #212744; }
.signal-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.signal-note, .signal-state { position: absolute; border-radius: 9px; background: #282f50; border: 1px solid #4a527a; color: #eef0ff; }
.signal-note { display: flex; align-items: center; gap: 9px; left: 15px; top: 16px; padding: 9px 10px; }
.signal-note > span { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 7px; background: #403f74; color: #c9c8ff; }
.signal-note strong, .signal-note small { display: block; font-size: .75rem; }
.signal-note small { font-size: .66rem; color: #c5cae3; }
.signal-state { right: 15px; bottom: 15px; display: flex; align-items: center; gap: 8px; padding: 7px 9px; font-size: .72rem; font-weight: 750; }
.signal-state .dot { color: #82d7b8; }
.auth-main { background: #fbfcff; padding: clamp(24px, 5.1vw, 74px); display: flex; justify-content: center; }
.setup-content { width: min(100%, 640px); }
.auth-main h1 { margin-top: 10px; }
.login-main { align-items: center; }
.login-content { width: min(100%, 430px); }
.login-content .stack { gap: 18px; }
.login-content .btn { margin-top: 5px; justify-content: space-between; padding-inline: 15px; }
.requirements { border: 1px solid var(--line); border-radius: 11px; margin-bottom: 17px; background: #fff; }
.requirements summary { display: flex; align-items: center; gap: 8px; padding: 10px 12px; cursor: pointer; font-size: .86rem; font-weight: 800; list-style: none; }
.requirements summary > .icon { margin-left: auto; width: 16px; height: 16px; }
.requirements ul { display: grid; grid-template-columns: repeat(2, 1fr); gap: 5px 12px; margin: 0; padding: 4px 14px 14px; list-style: none; }
.requirements li { font-size: .77rem; color: var(--muted); }
.requirements li .icon { width: 16px; height: 16px; }
.status-icon { border-radius: 20px; display: grid; place-items: center; width: 24px; height: 24px; }
.status-icon .icon { width: 14px; height: 14px; }
.status-icon.good { background: var(--green-bg); color: var(--green); }
.status-icon.bad { background: #ffeded; color: #9a292a; }
.setup-section { min-width: 0; margin: 0; padding: 11px 14px 15px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.setup-section legend { display: flex; gap: 8px; align-items: center; padding: 0 5px; font-size: .93rem; font-weight: 800; }
.setup-section legend span { color: var(--accent-ink); background: var(--tint); border-radius: 6px; padding: 3px 5px; font-size: .71rem; }
.setup-section p { color: var(--muted); font-size: .83rem; margin-bottom: 10px; }
.error-page { display: grid; place-items: center; min-height: 100dvh; padding: 20px; }
.error-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(20px, 6vw, 52px); max-width: 530px; }
.error-card > * + * { margin-top: 16px; }

.app-shell { display: grid; grid-template-columns: 222px minmax(0, 1fr); min-height: 100dvh; }
.sidebar { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; background: var(--nav); color: #eef0ff; padding: 20px 13px 13px; }
.workspace-brand { display: flex; align-items: center; min-height: 48px; gap: 10px; margin: 0 4px 25px; }
.workspace-brand > span:last-child, .sidebar-profile > span:nth-child(2) { min-width: 0; }
.workspace-brand strong, .sidebar-profile strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 800; }
.workspace-brand strong { font-size: 1rem; letter-spacing: -.025em; }
.workspace-brand small, .sidebar-profile small { display: block; color: var(--nav-muted); font-weight: 650; font-size: .72rem; }
.desktop-nav { display: flex; flex-direction: column; gap: 4px; }
.nav-caption { color: #a3acd0; text-transform: uppercase; letter-spacing: .09em; font-size: .67rem; font-weight: 800; padding: 11px 10px 5px; }
.nav-link { min-height: 45px; padding: 9px 10px; border: 0; display: flex; align-items: center; gap: 10px; border-radius: 9px; color: #c8cfe8; font-size: .88rem; font-weight: 750; background: transparent; text-align: left; width: 100%; }
.nav-link .icon { width: 19px; height: 19px; }
.nav-link:hover, .nav-link.selected { background: #2d3356; color: #fff; }
.nav-link.selected { box-shadow: inset 3px 0 #a8a3ff; }
.nav-link:focus-visible, .workspace-brand:focus-visible { outline-color: #b4b5ff; }
.nav-count, .nav-presence { margin-left: auto; padding: 2px 6px; border-radius: 7px; background: #4a4a7c; color: #fff; font-size: .68rem; }
.nav-presence { background: #264b4c; color: #bdffde; }
.sidebar-bottom { margin-top: auto; display: grid; gap: 8px; padding-top: 12px; }
.sidebar-profile { border-top: 1px solid #343c61; border-radius: 8px; }
.sidebar-profile .icon { margin-left: auto; width: 15px; }
.avatar { display: inline-grid; place-items: center; width: 34px; height: 34px; flex: 0 0 auto; overflow: hidden; color: #41368c; background: #eae6ff; border-radius: 50%; font-size: .73rem; font-weight: 800; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.visitor-avatar { color: #304878; background: #e9effe; }
.avatar.large-avatar { width: 52px; height: 52px; font-size: 1.04rem; }
.app-main { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 5; height: 65px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 clamp(16px, 3vw, 31px); background: #fff; }
.topbar-title, .topbar-actions { display: flex; align-items: center; gap: 9px; }
.topbar-label { font-weight: 800; font-size: .93rem; }
.topbar-actions .icon-btn { width: 42px; min-height: 42px; }
.availability { background: var(--green-bg); color: var(--green); padding: 8px 11px; min-height: 40px; }
.availability[aria-pressed="false"] { background: #edf0f6; color: #5c6578; }
.sound-button[aria-pressed="true"] { color: var(--accent-ink); background: var(--tint); }
.top-avatar { min-width: 44px; min-height: 44px; display: grid; place-items: center; }
.mobile-glyph, .mobile-nav, .mobile-back { display: none; }
.workspace-main { width: 100%; padding: 24px clamp(15px, 2.6vw, 30px) 28px; }
.page-main { max-width: 1260px; margin: 0 auto; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.page-heading h1 { margin: 4px 0 6px; }
.page-heading p { color: var(--muted); font-size: .88rem; }
.heading-tools { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; flex-shrink: 0; }

.inbox-grid { display: grid; grid-template-columns: minmax(225px, .76fr) minmax(310px, 1.55fr) minmax(170px, .54fr); gap: 12px; min-height: 480px; height: calc(100dvh - 201px); }
.conversation-list, .conversation-panel, .conversation-details { overflow: hidden; min-height: 0; }
.conversation-list { display: flex; flex-direction: column; }
.list-head { display: flex; align-items: center; gap: 8px; padding: 15px 13px 10px; }
.count-chip { font-size: .73rem; font-weight: 800; color: var(--accent-ink); background: var(--tint); padding: 2px 7px; border-radius: 8px; }
.search-box { display: flex; align-items: center; gap: 5px; margin: 0 12px; padding: 0 8px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); }
.search-box .icon { width: 16px; height: 16px; }
.search-box input { min-height: 40px; border: 0; background: transparent; padding: 6px 3px; font-size: .85rem; }
.search-box:focus-within { outline: 2px solid var(--accent-ink); }
.search-box input:focus-visible { outline: none; }
.filters { display: flex; gap: 2px; padding: 6px 10px; border-bottom: 1px solid var(--line); }
.filters button { flex: 1; min-height: 44px; padding: 3px 5px; border: 0; border-radius: 7px; color: var(--muted); background: transparent; font-size: .73rem; font-weight: 800; }
.filters button[aria-pressed="true"] { background: var(--tint); color: var(--accent-ink); }
.filters button:hover { background: var(--canvas); }
.thread-list { min-height: 0; flex: 1; overflow-y: auto; padding: 5px 5px 8px; overscroll-behavior: contain; }
.thread-row { display: flex; width: 100%; text-align: left; padding: 11px 8px; align-items: center; gap: 8px; min-height: 64px; border: 1px solid transparent; border-radius: 10px; background: transparent; }
.thread-row:hover { background: var(--canvas); }
.thread-row.selected { background: var(--tint); border-color: color-mix(in srgb, var(--accent) 22%, #fff); }
.thread-row:focus-visible { outline-offset: -2px; }
.thread-row-content { flex: 1; display: grid; min-width: 0; gap: 3px; }
.thread-row-upper, .thread-row-lower { display: flex; align-items: center; gap: 5px; justify-content: space-between; min-width: 0; }
.thread-row-upper strong, .thread-preview { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.thread-row-upper strong { font-size: .84rem; }
.thread-row-upper time, .thread-preview { color: var(--muted); font-size: .74rem; }
.thread-row-upper time { flex-shrink: 0; }
.thread-resolved { color: #637087; font-size: .65rem; font-weight: 750; }
.unread-dot { width: 8px; height: 8px; flex-shrink: 0; background: var(--accent); border-radius: 50%; }
.list-empty { color: var(--muted); display: grid; justify-items: center; text-align: center; gap: 7px; padding: 28px 13px; font-size: .82rem; }
.list-empty .inline-icon { color: var(--accent-ink); background: var(--tint); padding: 10px; border-radius: 12px; margin-bottom: 4px; }
.list-empty strong { color: var(--ink); }
.list-empty p { max-width: 26ch; }
.conversation-panel { position: relative; }
.thread-empty { display: grid; justify-items: center; align-content: center; min-height: 100%; padding: 20px 19px; text-align: center; gap: 9px; }
.thread-empty p { color: var(--muted); font-size: .86rem; max-width: 35ch; }
.empty-art { position: relative; display: grid; place-items: center; width: 118px; height: 103px; margin-bottom: 7px; }
.empty-art i { position: absolute; width: 94px; height: 75px; border: 1px solid #dadbf4; border-radius: 30px; transform: rotate(13deg); }
.empty-art i:nth-child(2) { transform: rotate(-13deg); }
.empty-art span { display: grid; place-items: center; width: 63px; height: 63px; background: var(--tint); color: var(--accent-ink); border-radius: 19px; }
.empty-art .icon { width: 31px; height: 31px; }
.thread-view {
    height: 100%;
    min-width: 0;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
}
.thread-top { min-height: 67px; padding: 10px 12px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 9px; }
.thread-title { flex: 1; min-width: 0; }
.thread-title h2, .thread-title span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.thread-title span { display: block; color: var(--muted); font-size: .73rem; }
.resolve-btn { padding-inline: 9px; min-height: 39px; }
.show-details, .close-details { display: none; }
.thread-scroll { min-width: 0; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; padding: 14px 13px; background: #f9faff; }
.older { margin: 0 auto 14px; display: flex; min-height: 38px; }
.messages { display: flex; flex-direction: column; gap: 13px; }
.thread-message { display: flex; align-items: flex-end; gap: 7px; align-self: flex-start; max-width: min(90%, 600px); min-width: 0; }
.thread-message.agent-message { align-self: flex-end; flex-direction: row-reverse; }
.thread-message .avatar { width: 28px; height: 28px; font-size: .65rem; }
.message-content { min-width: 0; }
.message-meta { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; color: var(--muted); font-size: .68rem; margin: 0 1px 3px; }
.agent-message .message-meta { justify-content: flex-end; }
.message-meta strong { color: var(--ink); }
.email-chip { display: inline-flex; align-items: center; gap: 2px; color: #514795; }
.email-chip .icon { width: 12px; height: 12px; }
.message-bubble { padding: 9px 11px; border: 1px solid var(--line); background: #fff; border-radius: 12px 12px 12px 3px; font-size: .91rem; overflow-wrap: anywhere; white-space: pre-wrap; }
.agent-message .message-bubble { background: var(--accent); color: var(--on-accent); border-color: var(--accent); border-radius: 12px 12px 3px 12px; }
.reply-form { min-width: 0; padding: 10px 12px 8px; border-top: 1px solid var(--line); }
.reply-controls {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) max-content;
    align-items: end;
    gap: 7px;
    min-width: 0;
}
.reply-controls [data-attach] { grid-area: 1 / 1; }
.reply-controls textarea {
    grid-area: 1 / 2;
    min-width: 0;
    width: 100%;
    min-height: 44px;
    max-height: 144px;
    resize: none;
}
.reply-controls textarea:focus-visible { outline-offset: -2px; outline-width: 2px; }
.reply-controls .btn { grid-area: 1 / 3; min-height: 44px; white-space: nowrap; }
.reply-caption, .resolved-notice { padding-top: 4px; font-size: .73rem; color: var(--muted); }
.resolved-notice { padding: 6px 0; color: var(--green); font-weight: 750; }
.resolved-notice .icon { width: 15px; height: 15px; }
.form-error { margin: 0 0 7px; color: #a0262b; font-weight: 700; font-size: .79rem; }
.details-heading { display: flex; align-items: center; justify-content: space-between; min-height: 60px; border-bottom: 1px solid var(--line); padding: 9px 13px; }
.details-empty { display: grid; justify-items: center; gap: 7px; padding: 22px 12px; text-align: center; color: var(--muted); font-size: .81rem; }
.detail-profile { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 17px 10px 11px; overflow-wrap: anywhere; }
.detail-profile > strong { font-size: .91rem; }
.detail-list { margin: 0; padding: 8px 13px 15px; }
.detail-list dt { margin-top: 9px; color: var(--muted); font-size: .74rem; font-weight: 750; }
.detail-list dd { margin: 0; overflow-wrap: anywhere; font-size: .8rem; font-weight: 750; }
.conversation-details { overflow-y: auto; }

.visitor-summary { position: relative; overflow: hidden; min-height: 110px; background: #202746; color: #fff; border-radius: var(--radius); display: flex; align-items: center; margin-bottom: 15px; padding: 17px 20px; }
.visitor-summary-copy { z-index: 1; display: flex; align-items: center; gap: 13px; }
.visitor-summary h2 { font-size: clamp(1.3rem, 3vw, 1.75rem); }
.visitor-summary p { margin-top: 4px; color: #d1d6ee; font-size: .86rem; }
.summary-icon { flex: 0 0 auto; width: 53px; height: 53px; border-radius: 13px; background: #343c62; color: #a5ead0; display: grid; place-items: center; }
.summary-icon .icon { width: 27px; height: 27px; }
.signal-decoration { position: absolute; right: 8%; inset-block: 0; display: grid; place-items: center; }
.signal-decoration i { position: absolute; width: 155px; height: 155px; border-radius: 39%; border: 1px solid #596489; transform: rotate(18deg); }
.signal-decoration i:nth-child(2) { width: 205px; height: 205px; }
.signal-decoration i:nth-child(3) { width: 255px; height: 255px; }
.section-head { padding: 16px 17px 11px; border-bottom: 1px solid var(--line); }
.section-head p { color: var(--muted); font-size: .82rem; margin-top: 2px; }
.visitor-row { display: grid; grid-template-columns: minmax(120px, .9fr) minmax(120px, 1fr) minmax(64px, .48fr) auto; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.visitor-row:last-child { border-bottom: 0; }
.visitor-identity { display: flex; align-items: center; gap: 8px; min-width: 0; }
.visitor-row small { display: block; font-size: .73rem; color: var(--muted); }
.visitor-row strong, .visitor-row span { font-size: .83rem; overflow-wrap: anywhere; }
.visitor-action { justify-self: end; }
.large-empty { min-height: 170px; align-content: center; }

.setting-card { padding: 17px; margin-bottom: 14px; }
.setting-intro { display: flex; align-items: center; gap: 10px; margin-bottom: 13px; }
.stack > .setting-intro { margin-bottom: 0; }
.setting-intro p { margin-top: 3px; color: var(--muted); font-size: .81rem; }
.setting-intro .pill { margin-left: auto; }
.copy-field { display: flex; align-items: stretch; gap: 8px; min-width: 0; }
.copy-field textarea, .copy-field input { background: #f8f9fd; color: #333f59; font-family: ui-monospace, Consolas, monospace; font-size: .81rem; overflow-wrap: anywhere; }
.copy-field button { flex-shrink: 0; }
.embed-card .helper { margin-top: 8px; }
.settings-columns { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(230px, 1fr); gap: 14px; align-items: start; }
.color-field { display: flex; align-items: center; gap: 8px; }
.color-field input[type="color"] { width: 52px; flex: 0 0 auto; padding: 4px; cursor: pointer; }
.color-field input:last-child { max-width: 155px; }
.design-preview { position: sticky; top: 78px; }
.mock-widget { border-radius: 13px; border: 1px solid var(--line); overflow: hidden; margin-bottom: 12px; background: #fff; }
.mock-top { background: var(--accent); color: var(--on-accent); padding: 11px; display: flex; gap: 8px; align-items: center; overflow-wrap: anywhere; }
.mock-top strong, .mock-top span { display: block; }
.mock-top span { font-size: .71rem; }
.mock-avatar { border-radius: 10px; width: 35px; height: 35px; flex-shrink: 0; display: grid !important; place-items: center; background: color-mix(in srgb, var(--on-accent) 15%, transparent); overflow: hidden; }
.mock-avatar img { width: 100%; height: 100%; object-fit: contain; }
.mock-content { background: #f8f9ff; padding: 12px; display: grid; min-height: 164px; gap: 30px; }
.mock-bubble { background: #fff; border-radius: 10px; padding: 8px 10px; font-size: .84rem; align-self: start; overflow-wrap: anywhere; border: 1px solid var(--line); }
.mock-input { color: #5d677f; background: #fff; border: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; border-radius: 8px; font-size: .75rem; padding: 6px 8px; align-self: end; }
.mock-input .icon { width: 17px; color: var(--accent-ink); }
.mock-widget[data-mode="dark"] .mock-content { background: #151a30; color: #f0f1fa; }
.mock-widget[data-mode="dark"] :is(.mock-bubble, .mock-input) { background: #252d4b; border-color: #475274; color: #f0f1fa; }
@media (prefers-color-scheme: dark) {
    .mock-widget[data-mode="system"] .mock-content { background: #151a30; color: #f0f1fa; }
    .mock-widget[data-mode="system"] :is(.mock-bubble, .mock-input) { background: #252d4b; border-color: #475274; color: #f0f1fa; }
}
.guide-panel { background: #f4f6fb; border-radius: 10px; border: 1px solid var(--line); padding: 11px; font-size: .82rem; }
.guide-panel p { margin: 2px 0 5px; color: var(--muted); }
.guide-panel .copy-field { margin-top: 8px; }
.integration-actions { display: flex; gap: 7px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 13px; }
.email-settings, #notifications { scroll-margin-top: 78px; }
.member-info { display: flex; align-items: center; gap: 9px; }
.member-info > div { min-width: 0; }
.member-info strong, .member-info small { display: block; overflow-wrap: anywhere; }
.member-info strong { font-size: .92rem; }
.member-info small { color: var(--muted); font-size: .76rem; }
.member-info .pill { margin-left: auto; }
.team-member { border-top: 1px solid var(--line); padding: 11px 0 9px; }
.member-actions { display: flex; gap: 7px; flex-wrap: wrap; align-items: start; margin-top: 7px; }
.member-actions details { font-size: .8rem; min-width: 125px; }
.member-actions summary { padding: 9px 7px; cursor: pointer; color: var(--accent-ink); font-weight: 800; }
.member-actions details .stack { padding: 7px; gap: 7px; }
.password-card { max-width: 750px; }
.signout { margin: 5px 0 0; }
.demo-browser { display: flex; gap: 6px; align-items: center; padding: 11px 13px; border-bottom: 1px solid var(--line); }
.demo-browser > span { width: 8px; height: 8px; background: #b5bfd4; border-radius: 50%; }
.demo-browser strong { margin-left: 9px; font-size: .76rem; color: var(--muted); }
.demo-content { display: grid; gap: 12px; justify-items: start; padding: clamp(26px, 8vw, 100px); background: radial-gradient(ellipse at 95% 20%, #e9e8ff, transparent 65%), #f9faff; border-radius: 0 0 var(--radius) var(--radius); }
.demo-content h2 { font-size: clamp(1.9rem, 5vw, 3.5rem); }
.demo-content p { max-width: 44ch; color: var(--muted); }
.toasts { position: fixed; z-index: 10; right: 13px; top: 74px; display: grid; gap: 6px; width: min(310px, calc(100vw - 26px)); pointer-events: none; }
.toast { display: flex; align-items: center; gap: 9px; min-height: 52px; background: #232a49; color: #fff; border: 1px solid #414b71; border-radius: 11px; padding: 9px 11px; box-shadow: 0 10px 20px #17204035; animation: appear .18s ease both; }
a.toast { pointer-events: auto; }
.toast > .inline-icon { color: #b9b5ff; }
.toast-text { min-width: 0; }
.toast-text strong, .toast-text small { display: block; overflow-wrap: anywhere; }
.toast-text strong { font-size: .84rem; }
.toast-text small { font-size: .75rem; color: #e3e7fa; }
@keyframes appear { from { opacity: 0; transform: translateY(-6px); } }
.install-dialog { width: min(430px, calc(100% - 30px)); color: var(--ink); border: 1px solid var(--line); border-radius: 16px; padding: 17px; box-shadow: 0 14px 50px #1a234a4f; }
.install-dialog::backdrop { background: #17213c78; }
.install-dialog form { display: grid; gap: 12px; }
.install-dialog p { color: var(--muted); }
.dialog-heading { display: flex; justify-content: space-between; }

@media (max-width: 1180px) {
    .inbox-grid { grid-template-columns: minmax(222px, .79fr) minmax(300px, 1.4fr); position: relative; }
    .conversation-details { display: none; }
    .conversation-details.details-open { position: absolute; z-index: 4; right: 0; top: 0; display: block; width: min(260px, 100%); max-height: 100%; box-shadow: 0 8px 30px #20294832; }
    .show-details, .close-details { display: inline-flex; }
}
@media (max-width: 930px) {
    .app-shell { grid-template-columns: 175px minmax(0, 1fr); }
    .sidebar { padding-inline: 10px; }
    .settings-columns { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .design-preview { position: static; }
    .mock-widget { max-width: 420px; }
    .auth-shell { grid-template-columns: minmax(240px, .8fr) minmax(405px, 1.2fr); }
    .auth-panel { padding: 27px; }
    .auth-main { padding: 27px; }
}
@media (max-width: 760px), (max-width: 950px) and (max-height: 500px) and (pointer: coarse) {
    :root {
        font-size: 14px;
        --mobile-topbar: calc(50px + env(safe-area-inset-top, 0px));
        --mobile-nav: calc(52px + env(safe-area-inset-bottom, 0px));
    }
    body { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
    .app-shell { display: block; }
    .sidebar, .push-shortcut, .top-avatar { display: none; }
    .topbar {
        height: var(--mobile-topbar);
        padding-top: env(safe-area-inset-top, 0px);
        padding-inline: max(9px, env(safe-area-inset-left, 0px)) max(9px, env(safe-area-inset-right, 0px));
    }
    .topbar-title, .topbar-actions { gap: 5px; min-width: 0; }
    .topbar-label { font-size: .89rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .topbar-actions { flex-shrink: 0; }
    .topbar .availability { min-height: 36px; padding: 5px 8px; font-size: .78rem; }
    .topbar-actions .icon-btn { width: 38px; min-height: 38px; }
    .topbar-actions .icon { width: 15px; height: 15px; }
    .mobile-glyph { display: grid; place-items: center; flex: 0 0 28px; height: 28px; color: var(--on-accent); background: var(--accent); border-radius: 7px; }
    .mobile-glyph .icon { width: 15px; height: 15px; }
    .mobile-nav {
        display: flex;
        position: fixed;
        z-index: 6;
        inset: auto 0 0;
        justify-content: space-around;
        height: var(--mobile-nav);
        padding: 3px max(4px, env(safe-area-inset-right, 0px)) max(3px, env(safe-area-inset-bottom, 0px)) max(4px, env(safe-area-inset-left, 0px));
        background: #fff;
        border-top: 1px solid var(--line);
    }
    .mobile-nav a {
        position: relative;
        min-width: 42px;
        min-height: 44px;
        display: grid;
        align-content: center;
        justify-items: center;
        gap: 1px;
        padding: 2px 4px;
        font-size: .72rem;
        font-weight: 800;
        color: var(--muted);
        border-radius: 8px;
        flex: 1;
    }
    .mobile-nav a[aria-current="page"] { color: var(--accent-ink); background: var(--tint); }
    .mobile-nav .icon { width: 17px; height: 17px; }
    .mobile-count { position: absolute; background: var(--accent); color: var(--on-accent); padding: 0 3px; min-width: 13px; border-radius: 6px; font-size: .62rem; left: calc(50% + 6px); top: 1px; }
    .workspace-main {
        padding: 12px max(8px, env(safe-area-inset-right, 0px)) calc(var(--mobile-nav) + 10px) max(8px, env(safe-area-inset-left, 0px));
    }
    .page-heading { align-items: flex-start; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
    .page-heading h1 { font-size: 1.63rem; }
    .page-heading p { font-size: .85rem; }
    .heading-tools { gap: 4px; }
    .heading-tools .btn { min-height: 37px; }
    .btn { gap: 5px; padding: 6px 9px; }
    .btn .icon, .icon-btn .icon { width: 15px; height: 15px; }
    .avatar { width: 29px; height: 29px; }
    .feature-icon { width: 36px; height: 36px; border-radius: 10px; }
    .feature-icon .icon { width: 17px; height: 17px; }
    .setting-card { padding: 11px; }
    .setting-intro { gap: 7px; }
    .stack, .form-grid { gap: 11px; }
    .section-head { padding: 12px 13px 8px; }

    .inbox-grid { height: auto; min-height: 0; display: block; }
    .conversation-list { min-height: 290px; }
    .conversation-panel { display: none; }
    .thread-list { max-height: calc(100dvh - 270px); min-height: 180px; }
    .thread-row { min-height: 54px; padding: 8px 6px; gap: 6px; }
    .list-head { padding: 12px 10px 8px; }
    .search-box { margin-inline: 9px; }
    .filters { padding: 4px 6px; }

    .workspace[data-chat-open="true"] .app-shell {
        position: fixed;
        inset-inline: 0;
        top: var(--chat-viewport-top, 0px);
        height: var(--chat-viewport-height, 100dvh);
        min-height: 0;
        display: flex;
        padding-bottom: var(--mobile-nav);
    }
    .workspace[data-chat-open="true"] .app-main { display: flex; flex: 1; flex-direction: column; min-height: 0; }
    .workspace[data-chat-open="true"] .topbar { position: relative; flex: none; }
    .workspace[data-chat-open="true"] .inbox-main {
        display: flex;
        flex: 1;
        min-height: 0;
        flex-direction: column;
        padding-block: 5px;
    }
    .workspace[data-chat-open="true"] .inbox-grid { display: flex; flex: 1; min-height: 0; }
    .workspace[data-chat-open="true"] :is(.inbox-heading, .conversation-list) { display: none; }
    .workspace[data-chat-open="true"] .conversation-panel { display: block; flex: 1; min-height: 0; }
    .workspace[data-chat-open="true"][data-keyboard-open="true"] .app-shell { padding-bottom: 0; }
    .workspace[data-chat-open="true"][data-keyboard-open="true"] :is(.mobile-nav, .topbar, .reply-caption) { display: none; }

    .mobile-back { display: inline-flex; }
    .thread-top { min-height: 50px; padding: 4px 5px; gap: 4px; min-width: 0; }
    .thread-top .icon-btn { width: 38px; min-height: 40px; }
    .thread-top .resolve-btn { flex: 0 0 auto; min-height: 40px; font-size: .79rem; padding-inline: 6px; }
    .thread-title h2 { font-size: .94rem; line-height: 1.25; }
    .thread-title span { font-size: .72rem; }
    .thread-top #thread-avatar .avatar { width: 25px; height: 25px; }
    .thread-top .resolve-btn > .icon { display: none; }
    .thread-scroll { padding: 8px 7px; }
    .messages { gap: 9px; }
    .thread-message { gap: 5px; max-width: 94%; }
    .thread-message .avatar { width: 23px; height: 23px; }
    .message-meta { font-size: .73rem; }
    .message-bubble { padding: 7px 8px; font-size: .94rem; }
    .reply-form { padding: 6px; }
    .reply-controls { grid-template-columns: 44px minmax(0, 1fr) 44px; gap: 5px; }
    .reply-controls .btn, .reply-controls [data-attach] { width: 44px; min-height: 44px; padding: 0; }
    .reply-controls .btn > span { display: none; }
    .reply-controls textarea { padding: 9px 7px; max-height: 90px; }
    .reply-caption { padding-top: 3px; }
    .conversation-details.details-open { width: min(245px, 100%); }
    .toast { min-height: 44px; padding: 7px 9px; box-shadow: 0 5px 15px #17204035; }
    .toasts { top: calc(var(--mobile-topbar) + 4px); }
    .workspace[data-keyboard-open="true"] .toasts { top: calc(var(--chat-viewport-top, 0px) + 4px); }

    .visitor-row { grid-template-columns: minmax(0, 1fr) auto; gap: 6px; padding: 9px 11px; }
    .visitor-identity { grid-column: 1; }
    .visitor-position { grid-column: 1; grid-row: 2; }
    .visitor-time { grid-column: 2; grid-row: 2; justify-self: end; }
    .visitor-action { grid-column: 2; grid-row: 1; font-size: .74rem; }
    .auth-shell { display: flex; flex-direction: column; }
    .auth-panel { position: static; height: auto; min-height: 0; padding: 13px 15px; gap: 8px; }
    .auth-story { margin: 0; }
    .auth-story .kicker, .auth-story > p:last-of-type, .auth-foot, .signal-board { display: none; }
    .auth-story h2 { font-size: 1.25rem; max-width: 100%; margin: 0; }
    .auth-main { padding: 17px 12px 24px; }
    .login-main { flex: 1; align-items: start; padding-top: 26px; }

    /* A full-size editing font keeps iOS from zooming the page on focus. */
    input:not([type="checkbox"]), textarea, select, .search-box input { font-size: 16px; }
}
@media (max-width: 420px) {
    .form-grid { grid-template-columns: minmax(0, 1fr); }
    .requirements ul { grid-template-columns: 1fr; }
    .copy-field { flex-wrap: wrap; }
    .copy-field button { margin-left: auto; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

@media (min-width: 761px) and (min-height: 650px) {
    .workspace[data-page="inbox"] .app-main { display: flex; flex-direction: column; height: 100dvh; }
    .workspace[data-page="inbox"] .topbar { flex: none; }
    .inbox-main { display: flex; flex-direction: column; flex: 1; min-height: 0; }
    .inbox-heading { flex: none; }
    .inbox-grid { flex: 1; height: auto; min-height: 0; }
}

.mail-fields { min-width: 0; padding: 12px; margin: 0; border: 1px solid var(--line); border-radius: 12px; }
.mail-fields legend { padding: 0 5px; font-weight: 800; }

.platform-wrap { width: min(100% - 40px, 1120px); margin-inline: auto; }
.platform-bar { background: var(--paper); border-bottom: 1px solid var(--line); }
.platform-bar .platform-wrap { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 70px; padding-block: 8px; }
.platform-brand { display: flex; align-items: center; gap: 10px; min-width: 0; line-height: 1.3; }
.platform-brand .brand-glyph { flex: 0 0 38px; width: 38px; height: 38px; border-radius: 10px; background: var(--accent); color: var(--on-accent); }
.platform-brand strong, .platform-brand small { display: block; }
.platform-brand small { color: var(--muted); font-size: .74rem; font-weight: 650; }
.platform-nav { display: flex; align-items: center; gap: 6px; }
.platform-nav .btn { white-space: nowrap; }
.platform-main { padding-block: 24px 48px; }
.platform-intro { margin-bottom: 22px; padding: 23px clamp(16px, 3vw, 32px); color: #fff; background: var(--nav); border-radius: var(--radius); }
.platform-intro .eyebrow { color: #c8cbf0; }
.platform-intro h1 { margin-block: 6px; overflow-wrap: anywhere; }
.platform-intro p { color: #e0e2f5; max-width: 60ch; overflow-wrap: anywhere; }
.platform-create-jump.btn { display: none; margin-top: 12px; color: var(--ink); }
#create-workspace { scroll-margin-top: 12px; }
.platform-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; gap: 16px; }
.platform-card { padding: clamp(13px, 2vw, 20px); }
.platform-column { display: grid; gap: 16px; min-width: 0; }
.platform-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-bottom: 12px; }
.platform-section-head p, .platform-empty p { color: var(--muted); font-size: .85rem; margin-top: 3px; }
.platform-empty { display: flex; align-items: center; gap: 12px; padding: 14px; background: var(--canvas); border-radius: 12px; }
.platform-empty .feature-icon { flex: 0 0 auto; }
.platform-directory { list-style: none; margin: 0; padding: 0; }
.platform-directory li { border-top: 1px solid var(--line); }
.platform-site { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 9px; min-height: 62px; padding: 7px 3px; }
.platform-site:hover { background: var(--tint); }
.platform-site-info { min-width: 0; overflow-wrap: anywhere; }
.platform-site-info strong, .platform-site-info small { display: block; }
.platform-site-info small { color: var(--muted); font-size: .77rem; }
.platform-site > .icon { width: 16px; height: 16px; color: var(--muted); }
.platform-pages { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 7px; padding-top: 12px; }
.platform-pages span { color: var(--muted); font-size: .8rem; }
.platform-back { margin-bottom: 12px; }
.platform-title { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; }
.platform-login-card { margin-bottom: 16px; border-color: color-mix(in srgb, var(--accent) 36%, var(--line)); background: var(--tint); }
.platform-login-card textarea, #workspace-embed { font-family: ui-monospace, Consolas, monospace; font-size: .83rem; }
.platform-form-divider { border-top: 1px solid var(--line); }
.platform-shell .btn.copied { color: var(--green); background: var(--green-bg); border-color: var(--green); }
.platform-shell .form-actions { align-items: flex-start; }
.platform-shell .email-settings { max-width: 880px; }

@media (max-width: 740px) {
    .platform-wrap { width: min(100% - 24px, 620px); }
    .platform-main { padding-top: 14px; }
    .platform-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .platform-column { gap: 12px; }
    .platform-intro { margin-bottom: 12px; }
    .platform-create-jump.btn { display: inline-flex; }
    .platform-bar .platform-wrap { min-height: 60px; }
    .platform-nav .btn { min-height: 44px; }
    .platform-nav a.btn span { display: none; }
    .platform-nav a.btn { width: 44px; }
    .platform-site { min-height: 56px; }
}
@media (max-width: 420px) {
    .platform-shell .copy-field textarea { flex-basis: 100%; }
}
