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

:root {
    --bg: #071013;
    --bg-elevated: #0b171a;
    --surface: rgba(13, 31, 33, .78);
    --surface-solid: #102125;
    --surface-2: rgba(255, 255, 255, .06);
    --surface-3: rgba(255, 255, 255, .095);
    --text: #f7f5ef;
    --muted: #9aa9a7;
    --subtle: #6f817f;
    --line: rgba(226, 239, 235, .10);
    --line-strong: rgba(226, 239, 235, .18);
    --primary: #f2b84b;
    --primary-2: #df7540;
    --cyan: #58c7d5;
    --green: #4fd59d;
    --rose: #f27983;
    --warning: #f5c66c;
    --danger: #f36f75;
    --shadow: 0 28px 90px rgba(0, 0, 0, .34);
    --radius: 22px;
    --radius-sm: 14px;
}

html[data-theme="light"] {
    --bg: #f4f0e7;
    --bg-elevated: #fffdf8;
    --surface: rgba(255, 253, 248, .82);
    --surface-solid: #fffdf8;
    --surface-2: rgba(27, 54, 52, .05);
    --surface-3: rgba(27, 54, 52, .085);
    --text: #1e2a2b;
    --muted: #637472;
    --subtle: #899694;
    --line: rgba(30, 61, 58, .11);
    --line-strong: rgba(30, 61, 58, .19);
    --shadow: 0 28px 80px rgba(55, 48, 33, .13);
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body {
    min-height: 100vh;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "DM Sans", "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }
::selection { background: rgba(242, 184, 75, .35); }

.ambient { position: fixed; pointer-events: none; filter: blur(10px); opacity: .58; z-index: 0; }
.ambient-one { width: 580px; height: 580px; right: -220px; top: -240px; background: radial-gradient(circle, rgba(223, 117, 64, .32), transparent 68%); }
.ambient-two { width: 520px; height: 520px; left: -240px; bottom: -220px; background: radial-gradient(circle, rgba(45, 183, 172, .18), transparent 67%); }

.glass-card {
    background: linear-gradient(145deg, var(--surface), rgba(255,255,255,.018));
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    border-radius: var(--radius);
}

.auth-body { display: grid; place-items: center; padding: 34px; overflow-x: hidden; }
.setup-shell { position: relative; z-index: 1; width: min(1220px, 100%); display: grid; grid-template-columns: .9fr 1.1fr; gap: 54px; align-items: center; }
.setup-brand { padding: 34px 16px; }
.setup-brand h1 { font-family: "Cormorant Garamond", Georgia, serif; font-size: clamp(38px, 4.5vw, 62px); line-height: 1.02; margin: 18px 0; letter-spacing: -.035em; }
.login-copy h1 { font-family: "Cormorant Garamond", Georgia, serif; font-size: clamp(28px, 4vw, 33px); line-height: 1.08; margin: 13px 0 9px; letter-spacing: -.025em; }
.setup-brand > p { color: var(--muted); font-size: 15px; line-height: 1.75; max-width: 590px; }
.login-copy p { color: var(--muted); font-size: 13px; line-height: 1.65; max-width: 360px; margin: 0 auto; }
.setup-card { padding: 32px; max-height: calc(100vh - 44px); overflow: auto; scrollbar-width: thin; }
.login-shell { width: min(470px, 100%); position: relative; z-index: 1; }
.login-card { padding: 38px; }
.login-copy { text-align: center; padding: 27px 0 20px; }

.brand-lockup { display: flex; align-items: center; gap: 13px; min-width: 0; }
.brand-lockup.centered { justify-content: center; }
.brand-lockup strong { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-lockup small { display: block; color: var(--muted); margin-top: 3px; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
.brand-mark { position: relative; width: 43px; height: 43px; border-radius: 14px; display: grid; place-items: center; flex: 0 0 auto; background: linear-gradient(145deg, #ffe0a0, #e28a43 58%, #a84d2b); box-shadow: 0 13px 32px rgba(223, 117, 64, .35), inset 0 1px rgba(255,255,255,.55); color: white; }
.brand-mark::after { content: ""; position: absolute; inset: 4px; border: 1px solid rgba(255,255,255,.34); border-radius: 11px; }
.brand-mark span { font-family: "Cormorant Garamond", Georgia, serif; font-size: 22px; font-weight: 700; transform: translateY(-1px); }
.brand-mark.large { width: 62px; height: 62px; border-radius: 19px; }
.brand-mark.large span { font-size: 32px; }

.eyebrow { color: var(--primary); font-size: 10px; line-height: 1; font-weight: 800; letter-spacing: .22em; text-transform: uppercase; }
.feature-stack { display: grid; gap: 13px; margin-top: 34px; }
.feature-stack > div { display: grid; grid-template-columns: 46px 1fr; column-gap: 14px; align-items: center; padding: 15px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface-2); }
.feature-stack .feature-icon { grid-row: span 2; width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; background: rgba(242,184,75,.14); color: var(--primary); }
.feature-stack b { font-size: 14px; }
.feature-stack small { color: var(--muted); margin-top: 4px; }
.section-head, .panel-head, .setting-title, .section-title { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; }
.section-head h2, .panel-head h3, .setting-title h3, .section-title h2 { margin: 7px 0 0; }
.step-badge { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; border: 1px solid var(--line); color: var(--primary); font-weight: 800; background: var(--surface-2); }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; margin-top: 25px; }
.stack-form { display: grid; gap: 17px; }
.stack-form.compact { gap: 13px; }
.span-2 { grid-column: span 2; }
.field { min-width: 0; }
.field label { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.field label em { font-style: normal; color: var(--subtle); text-transform: none; letter-spacing: 0; font-weight: 500; }
.field input, .field textarea, .field select, .search-box input {
    width: 100%; border: 1px solid var(--line); color: var(--text); background: rgba(7, 10, 20, .28); border-radius: 14px; padding: 13px 14px; outline: none; transition: .22s ease; resize: vertical;
}
html[data-theme="light"] .field input, html[data-theme="light"] .field textarea, html[data-theme="light"] .field select, html[data-theme="light"] .search-box input { background: rgba(255,255,255,.68); }
.field input:focus, .field textarea:focus, .field select:focus, .search-box input:focus { border-color: rgba(242,184,75,.75); box-shadow: 0 0 0 4px rgba(242,184,75,.11); }
.field small { display: block; color: var(--subtle); font-size: 11px; line-height: 1.55; margin-top: 7px; }
.field code { color: var(--primary); }
select option { background: var(--surface-solid); color: var(--text); }
.divider { position: relative; display: flex; align-items: center; margin: 8px 0 -2px; color: var(--subtle); font-size: 10px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.divider::after { content: ""; height: 1px; flex: 1; margin-left: 12px; background: var(--line); }

.btn { border: 1px solid transparent; border-radius: 14px; min-height: 45px; padding: 11px 17px; display: inline-flex; justify-content: center; align-items: center; gap: 9px; cursor: pointer; font-size: 13px; font-weight: 750; transition: transform .2s, border-color .2s, background .2s, box-shadow .2s; }
.btn:hover { transform: translateY(-2px); }
.btn.primary { background: linear-gradient(135deg, #f6c866, #e38342 58%, #b95631); color: #fff; box-shadow: 0 13px 34px rgba(223, 117, 64, .28), inset 0 1px rgba(255,255,255,.35); }
.btn.secondary { background: var(--surface-2); border-color: var(--line); }
.btn.secondary:hover { background: var(--surface-3); border-color: var(--line-strong); }
.btn.danger-soft { color: var(--danger); background: rgba(255, 92, 111, .10); border-color: rgba(255, 92, 111, .17); }

.alert { position: relative; z-index: 2; border-radius: 16px; border: 1px solid var(--line); padding: 14px 16px; display: flex; justify-content: space-between; gap: 14px; margin-bottom: 18px; background: var(--surface); box-shadow: 0 14px 34px rgba(0,0,0,.12); }
.alert b { font-size: 13px; }
.alert.success { border-color: rgba(79,213,157,.28); background: rgba(79,213,157,.09); }
.alert.error { border-color: rgba(255,110,119,.3); background: rgba(255,110,119,.1); }
.alert button { border: 0; background: none; cursor: pointer; font-size: 20px; color: var(--muted); }
.alert-details { display: grid; gap: 4px; margin-top: 7px; font-size: 12px; color: var(--muted); }

.app-body { overflow-x: hidden; }
.app-shell { position: relative; z-index: 1; min-height: 100vh; display: grid; grid-template-columns: 258px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 24px 18px; border-right: 1px solid var(--line); background: rgba(8,10,18,.58); backdrop-filter: blur(24px); z-index: 20; }
html[data-theme="light"] .sidebar { background: rgba(248,249,253,.74); }
.nav-list { display: grid; gap: 7px; margin-top: 42px; }
.nav-item { width: 100%; display: flex; align-items: center; gap: 12px; padding: 11px 13px; min-height: 45px; border-radius: 14px; color: var(--muted); border: 1px solid transparent; background: transparent; cursor: pointer; font-size: 13px; font-weight: 650; text-align: left; transition: .2s ease; }
.nav-item:hover { color: var(--text); background: var(--surface-2); }
.nav-item.active { color: var(--text); border-color: rgba(242,184,75,.22); background: linear-gradient(100deg, rgba(242,184,75,.17), rgba(88,199,213,.035)); box-shadow: inset 3px 0 var(--primary); }
.nav-item.active svg { color: var(--primary); }
.sidebar-foot { margin-top: auto; display: grid; gap: 12px; }
.status-panel { display: flex; gap: 11px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-2); }
.status-panel b, .status-panel small { display: block; }
.status-panel b { font-size: 12px; }
.status-panel small { color: var(--muted); margin-top: 3px; font-size: 10px; }
.live-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px rgba(79,213,157,.1), 0 0 16px rgba(79,213,157,.65); animation: breathe 2s infinite; }
.live-dot.paused { background: var(--warning); box-shadow: 0 0 0 5px rgba(255,202,105,.1); }
@keyframes breathe { 50% { transform: scale(.75); opacity: .68; } }
.logout-btn { border: none; }
.main-area { min-width: 0; }
.topbar { min-height: 88px; position: sticky; top: 0; z-index: 14; display: flex; justify-content: space-between; align-items: center; gap: 22px; padding: 16px 30px; border-bottom: 1px solid var(--line); background: rgba(8,10,18,.66); backdrop-filter: blur(24px); }
html[data-theme="light"] .topbar { background: rgba(246,248,252,.76); }
.page-heading h1 { margin: 6px 0 0; font-size: 21px; }
.top-actions { display: flex; gap: 11px; align-items: center; }
.icon-button { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 14px; display: grid; place-items: center; background: var(--surface-2); cursor: pointer; }
.icon-button:hover { background: var(--surface-3); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 7px 12px 7px 8px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface-2); }
.user-chip > span { width: 31px; height: 31px; border-radius: 11px; display: grid; place-items: center; background: rgba(242,184,75,.15); color: var(--primary); }
.user-chip b, .user-chip small { display: block; }
.user-chip b { font-size: 11px; }.user-chip small { color: var(--muted); font-size: 9px; margin-top: 2px; }
.mobile-menu { display: none; }
.content-area { width: min(1500px, 100%); margin: 0 auto; padding: 28px 30px 60px; }

.hero-panel { min-height: 315px; padding: 38px 42px; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr); align-items: center; overflow: hidden; position: relative; }
.hero-panel::before { content: ""; position: absolute; width: 440px; height: 440px; right: -100px; top: -100px; border-radius: 50%; background: radial-gradient(circle, rgba(242,184,75,.22), transparent 66%); }
.hero-copy { position: relative; z-index: 2; }
.hero-copy h2 { font-family: "Cormorant Garamond", Georgia, serif; font-size: clamp(34px, 4vw, 52px); line-height: 1.06; letter-spacing: -.03em; max-width: 760px; margin: 13px 0 15px; }
.hero-copy p { color: var(--muted); line-height: 1.75; max-width: 680px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 11px; margin-top: 24px; }
.orbital-status { position: relative; width: 250px; height: 250px; display: grid; place-items: center; justify-self: center; }
.orb-ring { position: absolute; border: 1px solid rgba(242,184,75,.21); border-radius: 50%; }
.ring-one { inset: 10px; animation: spin 20s linear infinite; border-style: dashed; }
.ring-two { inset: 42px; animation: spin 13s linear infinite reverse; border-color: rgba(88,199,213,.22); }
.ring-one::after, .ring-two::after { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 16px var(--primary); position: absolute; top: 17px; left: 30px; }
.ring-two::after { background: var(--cyan); bottom: 5px; right: 29px; left: auto; top: auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.orb-core { width: 135px; height: 135px; border-radius: 50%; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 8px; border: 1px solid rgba(255,255,255,.14); background: radial-gradient(circle at 35% 25%, rgba(255,255,255,.16), rgba(104,78,255,.15) 52%, rgba(8,10,18,.8)); box-shadow: inset 0 0 35px rgba(242,184,75,.12), 0 24px 60px rgba(58, 35, 18,.3); }
.orb-core strong { font-size: 12px; letter-spacing: .19em; }.orb-core small { color: var(--muted); font-size: 10px; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 17px; margin-top: 18px; }
.stat-card { padding: 20px; display: flex; gap: 15px; align-items: center; box-shadow: 0 14px 45px rgba(0,0,0,.15); }
.stat-card small, .stat-card strong, .stat-card em { display: block; }
.stat-card small { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; font-weight: 750; }
.stat-card strong { font-size: 28px; margin-top: 5px; }.stat-card em { color: var(--subtle); font-style: normal; font-size: 10px; margin-top: 2px; }
.stat-icon { width: 47px; height: 47px; border-radius: 15px; display: grid; place-items: center; flex: 0 0 auto; }
.stat-icon.violet { color: var(--primary); background: rgba(242,184,75,.13); }.stat-icon.cyan { color: var(--cyan); background: rgba(88,199,213,.12); }.stat-icon.green { color: var(--green); background: rgba(79,213,157,.11); }.stat-icon.rose { color: var(--rose); background: rgba(255,111,158,.11); }
.grid-two { display: grid; grid-template-columns: 1.25fr .75fr; gap: 18px; margin-top: 18px; }
.panel-card { padding: 24px; box-shadow: 0 14px 45px rgba(0,0,0,.15); }
.panel-head h3 { font-size: 17px; }.panel-head > a { color: var(--primary); font-size: 11px; font-weight: 750; }
.activity-list { display: grid; margin-top: 17px; }
.activity-row { display: grid; grid-template-columns: 40px minmax(0,1fr) auto; gap: 12px; align-items: center; padding: 12px 4px; border-top: 1px solid var(--line); }
.activity-row:first-child { border-top: 0; }.activity-row:hover b { color: var(--primary); }
.avatar { width: 40px; height: 40px; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(145deg, rgba(242,184,75,.22), rgba(88,199,213,.10)); color: var(--primary); border: 1px solid rgba(242,184,75,.15); font-size: 13px; font-weight: 800; }
.activity-row b, .activity-row p { display: block; margin: 0; }.activity-row b { font-size: 12px; transition: .2s; }.activity-row p { color: var(--muted); font-size: 11px; margin-top: 4px; }
.activity-meta { display: grid; justify-items: end; gap: 5px; }.activity-meta small { color: var(--subtle); font-size: 9px; }
.direction { font-size: 8px; padding: 3px 6px; border-radius: 6px; text-transform: uppercase; font-weight: 800; letter-spacing: .06em; }
.direction.inbound { color: var(--cyan); background: rgba(88,199,213,.1); }.direction.outbound { color: var(--green); background: rgba(79,213,157,.1); }
.webhook-card > p { color: var(--muted); font-size: 12px; line-height: 1.65; }
.secure-pill { display: inline-flex; align-items: center; gap: 5px; color: var(--green); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.copy-field { display: grid; grid-template-columns: minmax(0,1fr) 44px; align-items: stretch; gap: 8px; margin-top: 15px; }
.copy-field code { min-width: 0; overflow: auto; white-space: nowrap; padding: 13px 14px; border-radius: 13px; border: 1px solid var(--line); background: rgba(0,0,0,.18); color: var(--cyan); font-size: 11px; }
.copy-field button { border: 1px solid var(--line); background: var(--surface-2); border-radius: 13px; cursor: pointer; display: grid; place-items: center; }
.notice { display: grid; gap: 3px; padding: 12px 13px; border-radius: 13px; margin-top: 13px; font-size: 10px; }
.notice.warning { color: var(--warning); background: rgba(255,202,105,.08); border: 1px solid rgba(255,202,105,.16); }.notice.success { color: var(--green); background: rgba(79,213,157,.08); border: 1px solid rgba(79,213,157,.16); }
.notice span { color: var(--muted); line-height: 1.5; }
.mini-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 16px; }
.mini-steps div { padding: 10px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }.mini-steps span { color: var(--primary); font-size: 9px; font-weight: 800; }.mini-steps p { color: var(--muted); font-size: 9px; line-height: 1.4; margin: 5px 0 0; }

.section-title { margin: 4px 0 23px; align-items: end; }.section-title h2 { font-family: "Cormorant Garamond", Georgia, serif; font-size: 34px; letter-spacing: -.02em; }.section-title p { color: var(--muted); font-size: 12px; margin: 7px 0 0; }
.search-box { width: min(320px, 100%); }.search-box input { border-radius: 16px; }
.conversation-grid { display: grid; gap: 11px; }
.conversation-card { display: grid; grid-template-columns: 52px minmax(0,1fr) auto; gap: 16px; align-items: center; padding: 17px 18px; box-shadow: 0 10px 35px rgba(0,0,0,.11); transition: .2s ease; }
.conversation-card:hover { transform: translateY(-2px); border-color: rgba(242,184,75,.28); }
.large-avatar { width: 52px; height: 52px; border-radius: 18px; font-size: 16px; }
.conversation-title { display: flex; align-items: baseline; gap: 10px; }.conversation-title b { font-size: 13px; }.conversation-title small { color: var(--subtle); font-size: 10px; }
.conversation-main p { color: var(--muted); font-size: 11px; margin: 7px 0 0; }.conversation-main p .direction { margin-right: 7px; }
.conversation-side { display: grid; gap: 6px; justify-items: end; }.conversation-side small { color: var(--subtle); font-size: 9px; }.count-pill, .blocked-pill { padding: 4px 7px; border-radius: 8px; font-size: 9px; font-weight: 750; background: var(--surface-2); }.blocked-pill { color: var(--danger); background: rgba(255,110,119,.09); }
.empty-state { width: 100%; display: grid; justify-items: center; text-align: center; padding: 40px 15px; color: var(--muted); }.empty-state b { color: var(--text); margin-top: 10px; font-size: 13px; }.empty-state p { font-size: 11px; }.empty-state.wide { grid-column: 1 / -1; }

.contact-header { display: flex; justify-content: space-between; gap: 20px; align-items: center; padding: 22px 24px; margin-bottom: 17px; }
.contact-person { display: flex; align-items: center; gap: 15px; }.xl-avatar { width: 61px; height: 61px; border-radius: 21px; font-size: 19px; }.contact-person h2 { margin: 0; font-size: 18px; }.contact-person p { margin: 3px 0 8px; color: var(--muted); font-size: 11px; }.status-label { color: var(--green); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }.status-label.blocked { color: var(--danger); }
.contact-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.chat-panel { overflow: hidden; }.chat-head { padding: 17px 20px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }.chat-head > div { display: flex; align-items: center; gap: 10px; }.chat-head b { font-size: 12px; }.chat-head small { color: var(--muted); font-size: 10px; }
.message-stream { min-height: 430px; max-height: calc(100vh - 260px); overflow: auto; padding: 25px; background: radial-gradient(circle at 50% 0, rgba(242,184,75,.05), transparent 38%); }
.message-row { display: flex; margin: 10px 0; }.message-row.outbound { justify-content: flex-end; }
.message-bubble { max-width: min(680px, 82%); padding: 13px 15px 9px; border-radius: 17px 17px 17px 5px; background: var(--surface-2); border: 1px solid var(--line); }.message-row.outbound .message-bubble { border-radius: 17px 17px 5px 17px; background: linear-gradient(145deg, rgba(242,184,75,.18), rgba(190, 91, 50,.11)); border-color: rgba(242,184,75,.22); }.message-bubble p { margin: 0; white-space: normal; font-size: 12px; line-height: 1.7; }.message-bubble > div { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 7px; color: var(--subtle); font-size: 8px; }.message-bubble > div span { margin-right: auto; font-weight: 700; }

.settings-layout { display: grid; gap: 17px; }.setting-card { padding: 25px; box-shadow: 0 14px 45px rgba(0,0,0,.13); }.setting-title { justify-content: flex-start; align-items: center; }.setting-title h3 { margin: 0; font-size: 16px; }.setting-title p { color: var(--muted); margin: 4px 0 0; font-size: 10px; }
.switch-row { min-height: 63px; display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 13px 15px; border-radius: 15px; border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; }.switch-row b, .switch-row small { display: block; }.switch-row b { font-size: 12px; }.switch-row small { color: var(--muted); margin-top: 4px; font-size: 10px; }.switch-row input { display: none; }.switch-row i { position: relative; width: 44px; height: 24px; border-radius: 20px; background: rgba(120,128,150,.35); transition: .2s; flex: 0 0 auto; }.switch-row i::after { content: ""; position: absolute; width: 18px; height: 18px; top: 3px; left: 3px; border-radius: 50%; background: white; transition: .2s; box-shadow: 0 3px 10px rgba(0,0,0,.22); }.switch-row input:checked + i { background: linear-gradient(135deg, var(--primary), var(--primary-2)); }.switch-row input:checked + i::after { transform: translateX(20px); }
.settings-savebar { position: sticky; bottom: 15px; z-index: 9; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 15px 17px; }.settings-savebar b, .settings-savebar small { display: block; }.settings-savebar b { font-size: 12px; }.settings-savebar small { color: var(--muted); margin-top: 3px; font-size: 10px; }
.security-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 17px; margin-top: 17px; }.security-grid p { color: var(--muted); font-size: 11px; line-height: 1.65; }

.tool-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 17px; }.tool-card { padding: 25px; position: relative; overflow: hidden; }.tool-card::after { content: ""; position: absolute; width: 150px; height: 150px; right: -70px; top: -70px; border-radius: 50%; background: radial-gradient(circle, rgba(242,184,75,.13), transparent 65%); }.tool-icon { width: 52px; height: 52px; border-radius: 17px; display: grid; place-items: center; color: var(--primary); background: rgba(242,184,75,.13); }.tool-card h3 { margin: 17px 0 6px; }.tool-card > p { color: var(--muted); font-size: 11px; line-height: 1.7; }.tool-card dl { margin: 17px 0; display: grid; gap: 7px; }.tool-card dl div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 11px; background: var(--surface-2); border-radius: 11px; font-size: 10px; }.tool-card dt { color: var(--muted); }.tool-card dd { margin: 0; font-weight: 700; }.tool-card.span-2 { grid-column: span 2; }

.log-panel { overflow: hidden; }.log-table-wrap { overflow: auto; }.log-table { width: 100%; border-collapse: collapse; min-width: 890px; }.log-table th { text-align: left; color: var(--subtle); font-size: 9px; text-transform: uppercase; letter-spacing: .1em; padding: 14px 16px; border-bottom: 1px solid var(--line); }.log-table td { font-size: 10px; padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }.log-table time { color: var(--muted); white-space: nowrap; }.log-table code { color: var(--subtle); }.log-level { font-size: 8px; font-weight: 800; padding: 4px 6px; border-radius: 7px; }.log-level.info { color: var(--cyan); background: rgba(88,199,213,.1); }.log-level.warning { color: var(--warning); background: rgba(255,202,105,.1); }.log-level.error { color: var(--danger); background: rgba(255,110,119,.1); }

@media (max-width: 1120px) {
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .grid-two { grid-template-columns: 1fr; }
    .setup-shell { grid-template-columns: 1fr; max-width: 760px; }
    .setup-brand { display: none; }
    .setup-card { max-height: none; }
}

@media (max-width: 880px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { position: fixed; left: -280px; width: 258px; transition: left .25s ease; box-shadow: 20px 0 60px rgba(0,0,0,.3); }
    .sidebar.open { left: 0; }
    .mobile-menu { display: flex; flex-direction: column; gap: 4px; }
    .mobile-menu span { width: 17px; height: 1px; background: currentColor; }
    .topbar { padding: 14px 18px; }.content-area { padding: 22px 18px 50px; }
    .hero-panel { grid-template-columns: 1fr; }.orbital-status { display: none; }
    .security-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .auth-body { padding: 15px; }.setup-card, .login-card { padding: 22px; border-radius: 19px; }
    .form-grid, .tool-grid { grid-template-columns: 1fr; }.span-2, .tool-card.span-2 { grid-column: span 1; }
    .topbar { gap: 10px; }.topbar .eyebrow, .user-chip div { display: none; }.user-chip { padding: 6px; }.page-heading h1 { font-size: 16px; }
    .hero-panel { padding: 27px 22px; min-height: 0; }.hero-copy h2 { font-size: 34px; }
    .stats-grid { grid-template-columns: 1fr; }
    .section-title { align-items: flex-start; flex-direction: column; }.search-box { width: 100%; }
    .conversation-card { grid-template-columns: 46px minmax(0,1fr); }.conversation-side { grid-column: 2; display: flex; justify-content: flex-start; }
    .contact-header { align-items: flex-start; flex-direction: column; }.contact-actions { width: 100%; }.contact-actions form, .contact-actions .btn { width: 100%; }
    .message-bubble { max-width: 94%; }.message-stream { padding: 14px; }
    .settings-savebar { align-items: stretch; flex-direction: column; }.settings-savebar .btn { width: 100%; }
    .mini-steps { grid-template-columns: 1fr; }
}


/* ChatPilot AMZ visual and interaction refinement */
body {
    background:
        radial-gradient(circle at 12% -10%, rgba(45, 183, 172, .12), transparent 34%),
        radial-gradient(circle at 94% 2%, rgba(223, 117, 64, .16), transparent 31%),
        linear-gradient(145deg, var(--bg), color-mix(in srgb, var(--bg) 92%, #18332f 8%));
}
html[data-theme="light"] body {
    background:
        radial-gradient(circle at 12% -10%, rgba(45, 183, 172, .11), transparent 34%),
        radial-gradient(circle at 94% 2%, rgba(223, 117, 64, .10), transparent 31%),
        linear-gradient(145deg, #f7f4ed, var(--bg));
}
.ambient { animation: ambientFloat 13s ease-in-out infinite alternate; }
.ambient-one { background: radial-gradient(circle, rgba(223,117,64,.29), transparent 68%); }
.ambient-two { background: radial-gradient(circle, rgba(45,183,172,.19), transparent 67%); animation-delay: -6s; }
@keyframes ambientFloat { from { transform: translate3d(-18px,-10px,0) scale(.98); } to { transform: translate3d(24px,18px,0) scale(1.05); } }

.glass-card {
    background: linear-gradient(145deg, var(--surface), color-mix(in srgb, var(--surface) 76%, transparent));
    box-shadow: var(--shadow), inset 0 1px rgba(255,255,255,.035);
}
.auth-body::before {
    content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .23;
    background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
    background-size: 44px 44px; mask-image: linear-gradient(to bottom, black, transparent 78%);
}
.login-shell { width: min(438px, 100%); }
.login-card { padding: 31px; position: relative; overflow: hidden; animation: authEnter .55s cubic-bezier(.2,.8,.2,1) both; }
.login-card::before { content: ""; position: absolute; left: 28px; right: 28px; top: 0; height: 2px; background: linear-gradient(90deg, transparent, var(--primary), var(--cyan), transparent); }
.login-card .field input { min-height: 46px; }
@keyframes authEnter { from { opacity: 0; transform: translateY(18px) scale(.985); } to { opacity: 1; transform: none; } }

.brand-mark { background: linear-gradient(145deg, #ffe7ad, #e28a43 58%, #a84d2b); box-shadow: 0 13px 32px rgba(190,91,50,.28), inset 0 1px rgba(255,255,255,.58); }
.eyebrow { color: var(--primary); }
.field input:focus, .field textarea:focus, .field select:focus, .search-box input:focus { border-color: rgba(242,184,75,.72); box-shadow: 0 0 0 4px rgba(242,184,75,.11); }
.btn.primary { background: linear-gradient(135deg, #f6c866, #df7540 62%, #a84d2b); box-shadow: 0 13px 34px rgba(190,91,50,.24), inset 0 1px rgba(255,255,255,.38); }
.btn, .icon-button, .nav-item, .conversation-card { transition-timing-function: cubic-bezier(.2,.8,.2,1); }
.icon-button:hover { transform: translateY(-1px); border-color: var(--line-strong); }

.app-shell { transition: grid-template-columns .34s cubic-bezier(.2,.8,.2,1); }
.sidebar { transition: transform .34s cubic-bezier(.2,.8,.2,1), opacity .24s ease, box-shadow .3s ease; background: color-mix(in srgb, var(--bg) 70%, transparent); }
html[data-theme="light"] .sidebar { background: rgba(248,245,237,.82); }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sidebar-close { width: 36px; height: 36px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 12px; display: grid; place-items: center; color: var(--muted); background: var(--surface-2); cursor: pointer; }
.sidebar-close:hover { color: var(--text); background: var(--surface-3); }
.sidebar-trigger { display: flex; flex-direction: column; gap: 4px; flex: 0 0 auto; }
.sidebar-trigger span { width: 17px; height: 1.5px; border-radius: 2px; background: currentColor; transition: transform .25s ease, width .25s ease; }
.sidebar-trigger:hover span:nth-child(2) { width: 12px; }
.sidebar-overlay { display: none; }
.nav-item { position: relative; overflow: hidden; }
.nav-item::after { content: ""; position: absolute; inset: 0; opacity: 0; background: linear-gradient(100deg, transparent, rgba(255,255,255,.05), transparent); transform: translateX(-80%); transition: .35s ease; }
.nav-item:hover::after { opacity: 1; transform: translateX(80%); }
.nav-item.active { border-color: rgba(242,184,75,.23); background: linear-gradient(100deg, rgba(242,184,75,.16), rgba(45,183,172,.045)); box-shadow: inset 3px 0 var(--primary); }

.topbar { background: color-mix(in srgb, var(--bg) 74%, transparent); }
html[data-theme="light"] .topbar { background: rgba(247,244,237,.82); }
.content-area > section, .content-area > form { animation: contentEnter .42s cubic-bezier(.2,.8,.2,1) both; }
@keyframes contentEnter { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: none; } }

.hero-panel::before { background: radial-gradient(circle, rgba(223,117,64,.18), transparent 66%); }
.orb-ring { border-color: rgba(242,184,75,.23); }
.ring-two { border-color: rgba(45,183,172,.26); }
.ring-one::after { background: var(--primary); box-shadow: 0 0 16px var(--primary); }
.ring-two::after { background: var(--cyan); }
.orb-core { background: radial-gradient(circle at 35% 25%, rgba(255,255,255,.16), rgba(223,117,64,.13) 52%, rgba(7,16,19,.82)); box-shadow: inset 0 0 35px rgba(242,184,75,.1), 0 24px 60px rgba(30,22,12,.3); }
.stat-card:hover, .panel-card:hover, .setting-card:hover, .tool-card:hover { border-color: rgba(242,184,75,.18); }
.avatar { background: linear-gradient(145deg, rgba(242,184,75,.21), rgba(45,183,172,.11)); color: var(--primary); border-color: rgba(242,184,75,.16); }
.user-chip > span { background: rgba(242,184,75,.14); color: var(--primary); }

.conversation-tools { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; }
.live-sync-pill { min-height: 44px; display: flex; align-items: center; gap: 10px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface-2); }
.live-sync-pill b, .live-sync-pill small { display: block; }
.live-sync-pill b { font-size: 10px; }
.live-sync-pill small { color: var(--muted); font-size: 9px; margin-top: 2px; white-space: nowrap; }
.live-sync-pill[data-state="offline"] .live-dot, .live-inline-status[data-state="offline"]::before { background: var(--warning); box-shadow: 0 0 0 5px rgba(245,198,108,.1); }
.live-inline-status { display: inline-flex; align-items: center; gap: 5px; padding: 4px 7px; border-radius: 8px; color: var(--green); background: rgba(79,213,157,.08); font-size: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.live-inline-status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--green); }
.live-inline-status[data-state="offline"] { color: var(--warning); background: rgba(245,198,108,.08); }
.conversation-card { position: relative; overflow: hidden; }
.conversation-card::before { content: ""; position: absolute; left: 0; top: 16%; bottom: 16%; width: 2px; border-radius: 2px; background: linear-gradient(var(--primary), var(--cyan)); opacity: 0; transform: scaleY(.45); transition: .25s ease; }
.conversation-card:hover::before { opacity: 1; transform: scaleY(1); }
.live-card-enter { animation: liveCardEnter .35s cubic-bezier(.2,.8,.2,1) both; animation-delay: var(--enter-delay, 0ms); }
@keyframes liveCardEnter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.message-stream { background: radial-gradient(circle at 50% 0, rgba(45,183,172,.055), transparent 38%); scroll-behavior: smooth; }
.message-bubble p { white-space: pre-wrap; overflow-wrap: anywhere; }
.message-row.outbound .message-bubble { background: linear-gradient(145deg, rgba(242,184,75,.17), rgba(190,91,50,.10)); border-color: rgba(242,184,75,.22); }
.message-arrival { animation: messageArrival .34s cubic-bezier(.2,.8,.2,1) both; }
@keyframes messageArrival { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }

@media (min-width: 881px) {
    .app-shell.sidebar-hidden { grid-template-columns: 0 minmax(0, 1fr); }
    .app-shell.sidebar-hidden .sidebar { transform: translateX(-106%); opacity: 0; pointer-events: none; }
    .app-shell.sidebar-hidden .sidebar-trigger span:first-child { transform: translateY(5.5px) rotate(45deg); }
    .app-shell.sidebar-hidden .sidebar-trigger span:nth-child(2) { opacity: 0; }
    .app-shell.sidebar-hidden .sidebar-trigger span:last-child { transform: translateY(-5.5px) rotate(-45deg); }
}

@media (max-width: 880px) {
    .sidebar { left: 0; transform: translateX(-108%); }
    .sidebar.open { left: 0; transform: translateX(0); }
    .sidebar-overlay { display: block; position: fixed; inset: 0; z-index: 19; border: 0; background: rgba(1,8,9,.58); backdrop-filter: blur(4px); opacity: 0; pointer-events: none; transition: opacity .25s ease; }
    body.menu-open .sidebar-overlay { opacity: 1; pointer-events: auto; }
    .mobile-menu { display: none; }
    .conversation-tools { width: 100%; justify-content: stretch; }
    .live-sync-pill { flex: 0 0 auto; }
    .conversation-tools .search-box { flex: 1 1 220px; width: auto; }
}

@media (max-width: 640px) {
    .login-card { padding: 24px; }
    .login-copy { padding: 23px 0 18px; }
    .login-copy h1 { font-size: 28px; }
    .login-copy p { font-size: 12px; }
    .conversation-tools { display: grid; grid-template-columns: 1fr; }
    .live-sync-pill { justify-content: center; }
    .chat-head { align-items: flex-start; gap: 10px; }
    .chat-head > div { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .001ms !important; }
}
