:root {
  font-family: "DM Sans", sans-serif;
  color: #0f172a;
  background: #f8fafc;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --muted: #94a3b8;
  --line: #e2e8f0;
  --purple: #334155;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; min-height: 100vh; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: 254px; flex: 0 0 254px; display: flex; flex-direction: column; padding: 25px 16px 14px; background: #fff; border-right: 1px solid #ebebef; transition: width .2s ease, flex-basis .2s ease, padding .2s ease; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; color: #202127; text-decoration: none; font: 800 17px Manrope, sans-serif; letter-spacing: -.7px; }
.brand-mark { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 9px; color: #fff; background: linear-gradient(140deg, #9f82ff, #6541d9); font-size: 15px; }
.brand-light { font-weight: 500; color: #6d6f79; }
.workspace-label, .sidebar-section-heading, .eyebrow { color: #9b9da7; font-size: 10px; font-weight: 700; letter-spacing: 1.15px; }
.workspace-label { margin: 43px 8px 11px; }
.workspace { height: 42px; display: flex; align-items: center; gap: 10px; padding: 0 9px; border: 1px solid #edecf1; border-radius: 8px; font-size: 12px; font-weight: 600; }
.workspace-avatar, .profile-avatar, .topbar-avatar { display: grid; place-items: center; border-radius: 7px; background: #eee9ff; color: #704ddd; font-weight: 700; }
.workspace-avatar { width: 23px; height: 23px; font-size: 11px; }
.workspace-name { flex: 1; }
.workspace-chevron { color: #9798a1; font-size: 17px; }
.main-nav { display: grid; gap: 4px; margin-top: 25px; }
.nav-item.mobile-account-nav, .mobile-labels { display: none; }
.nav-item, .label-item { width: 100%; display: flex; align-items: center; border: 0; border-radius: 7px; background: transparent; color: #62646f; text-align: left; }
.nav-item { gap: 11px; height: 37px; padding: 0 10px; font-size: 12px; font-weight: 500; }
.nav-item.active { background: #f2efff; color: #6848da; font-weight: 600; }
.nav-icon { display: grid; width: 14px; place-items: center; color: #9395a0; text-align: center; font-size: 15px; }
.nav-icon svg { display: block; width: 20px; height: 20px; }
.nav-mobile-label { display: none; }
.nav-item.active .nav-icon { color: #7658e8; }
.nav-count { margin-left: auto; font-size: 10px; color: #8d8e98; }
.sidebar-section-heading { display: flex; align-items: center; justify-content: space-between; margin: 31px 8px 10px; }
.icon-button { border: 0; background: transparent; color: #8b8d97; font-size: 18px; }
.sidebar-section-heading .icon-button { font-size: 19px; line-height: 10px; }
.label-list { display: grid; gap: 3px; }
.label-item { height: 31px; gap: 10px; padding: 0 10px; font-size: 12px; }
.label-item:hover, .nav-item:hover { background: #f6f5f8; }
.label-dot { width: 8px; height: 8px; border-radius: 50%; background: #ea9b5b; }
.label-dot.work { background: #64b49b; }
.label-dot.personal { background: #7195e8; }
.label-dot.follow-up { background: #ea9b5b; }
.sidebar-spacer { flex: 1; min-height: 40px; }
.connections { border-top: 1px solid #f0f0f2; padding-top: 2px; }
.connections .sidebar-section-heading { margin-top: 19px; }
.connection-row { display: flex; align-items: center; gap: 9px; height: 34px; padding: 0 7px; }
.service-icon, .provider-card-icon { display: grid; place-items: center; width: 22px; height: 22px; flex: 0 0 auto; border-radius: 6px; font-weight: 700; font-size: 12px; }
.gmail-icon { color: #dc6359; background: #fff0ef; }
.telegram-icon { color: #3196cb; background: #eaf6fc; }
.connection-name { flex: 1; color: #62646f; font-size: 11px; }
.connection-dot { width: 6px; height: 6px; border-radius: 50%; background: #c9cbd1; }
.connection-dot.connected { background: #42b889; box-shadow: 0 0 0 3px #e6f7f0; }
.manage-link { display: flex; justify-content: space-between; width: 100%; padding: 9px 7px 12px; border: 0; background: none; color: #795ce1; text-align: left; font-size: 11px; }
.profile { display: flex; align-items: center; gap: 9px; padding: 12px 4px 0; border-top: 1px solid #f0f0f2; }
.profile-avatar, .topbar-avatar { width: 28px; height: 28px; font-size: 11px; }
.profile strong, .profile small { display: block; }
.profile strong { font-size: 11px; font-weight: 600; }
.profile small { margin-top: 2px; color: #9b9da7; font-size: 10px; }
.profile-menu { margin-left: auto; font-size: 12px; letter-spacing: 1px; }
.main-panel { flex: 1; min-width: 0; }
.topbar { height: 63px; display: flex; align-items: center; justify-content: space-between; padding: 0 42px; border-bottom: 1px solid #eaeaf0; background: rgba(255,255,255,.62); }
.topbar-leading { display: flex; align-items: center; gap: 14px; min-width: 0; }
.sidebar-toggle { display: grid; width: 31px; height: 31px; flex: 0 0 auto; place-items: center; border: 1px solid #e9e9ee; border-radius: 7px; background: #fff; color: #777984; font-size: 15px; }
.sidebar-toggle:hover { border-color: #d7d0f0; background: #f8f6ff; color: #674bd3; }
.breadcrumbs { color: #91939c; font-size: 11px; }
.breadcrumbs span { margin: 0 9px; color: #c1c2c9; }
.breadcrumbs strong { color: #383941; font-weight: 600; }
.topbar-actions { display: flex; align-items: center; gap: 15px; }
.notification-button { position: relative; display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border: 1px solid var(--theme-border); border-radius: 9px; background: var(--theme-surface); color: var(--theme-secondary); }
.notification-button:hover { border-color: var(--theme-accent); color: var(--theme-accent-ink); }
.notification-button svg { width: 18px; height: 18px; }
.notification-count { position: absolute; top: -5px; right: -6px; min-width: 17px; height: 17px; padding: 0 4px; border: 2px solid var(--theme-surface); border-radius: 10px; background: #e05252; color: #fff; font-size: 9px; font-weight: 700; line-height: 13px; text-align: center; }
.notifications-dialog { position: fixed; inset: 76px clamp(16px, 3.2vw, 46px) auto auto; width: min(420px, calc(100vw - 32px)); max-height: min(76vh, 640px); overflow: hidden; margin: 0; padding: 18px; border: 1px solid var(--theme-border); border-radius: 14px; background: var(--theme-surface); color: var(--theme-ink); box-shadow: 0 18px 60px #1719232b; }
.notifications-dialog::backdrop { background: #17192342; backdrop-filter: blur(2px); }
.notifications-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.notifications-header .eyebrow { color: var(--theme-muted); font-size: 9px; }
.notifications-header h2 { margin: 5px 0 0; font: 700 19px Manrope, sans-serif; letter-spacing: -.4px; }
.notifications-header .icon-button { width: 30px; height: 30px; border: 1px solid var(--theme-border); border-radius: 8px; color: var(--theme-secondary); font-size: 20px; }
.notifications-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--theme-border); }
.notifications-toolbar p { margin: 0; color: var(--theme-muted); font-size: 10px; line-height: 1.5; }
.notifications-mark-all { flex: 0 0 auto; padding: 5px 0; border: 0; background: transparent; color: var(--theme-accent-ink); font-size: 10px; font-weight: 600; }
.notifications-list { display: grid; max-height: min(48vh, 390px); overflow-y: auto; }
.notification-item { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; width: 100%; padding: 12px 2px; border: 0; border-bottom: 1px solid var(--theme-border); background: transparent; color: var(--theme-secondary); text-align: left; }
.notification-item:hover { background: var(--theme-input); }
.notification-item.unread { box-shadow: inset 3px 0 var(--theme-accent); padding-left: 9px; }
.notification-copy { display: grid; min-width: 0; gap: 3px; }
.notification-copy strong, .notification-subject, .notification-snippet { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notification-copy strong { color: var(--theme-ink); font-size: 11px; }
.notification-subject { color: var(--theme-secondary); font-size: 10px; font-weight: 600; }
.notification-snippet { color: var(--theme-muted); font-size: 10px; }
.notification-time { flex: 0 0 auto; padding-top: 1px; color: var(--theme-muted); font-size: 9px; }
.notifications-empty, .notifications-status { margin: 0; padding: 26px 8px; color: var(--theme-muted); font-size: 11px; line-height: 1.55; text-align: center; }
.notifications-error { display: grid; justify-items: center; gap: 8px; color: #b74940; }
.notifications-error p { margin: 0; }
.notifications-footer { display: flex; align-items: center; justify-content: space-between; gap: 9px; padding-top: 12px; color: var(--theme-muted); font-size: 9px; line-height: 1.4; }
.notifications-footer .small-button { flex: 0 0 auto; min-height: 30px; padding: 0 8px; font-size: 9px; }
.help-button { width: 22px; height: 22px; border: 1px solid #dfe0e5; border-radius: 50%; background: #fff; color: #777984; font-size: 12px; }
.profile-button { display: inline-flex; align-items: center; gap: 7px; padding: 0; border: 0; background: transparent; color: var(--theme-secondary); font-size: 10px; font-weight: 600; }
.profile-button:hover { color: var(--theme-accent-ink); }
.topbar-avatar { padding: 0; border: 0; background: #e8e2ff; cursor: pointer; overflow: hidden; }
.topbar-avatar img, .profile-avatar img, .workspace-avatar img, .team-member-avatar img, .profile-image-control > img { width: 100%; height: 100%; object-fit: cover; }
.workspace-avatar, .profile-avatar, .team-member-avatar { overflow: hidden; }
.inbox { width: min(100%, 1050px); margin: 0 auto; padding: 49px 42px 25px; }
.inbox-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 27px; }
.eyebrow { color: #8b70e4; font-size: 9px; letter-spacing: 1.3px; }
h1 { margin: 8px 0 5px; font: 700 25px Manrope, sans-serif; letter-spacing: -.8px; }
.heading-count { margin-left: 5px; color: #a0a1aa; font: 500 13px "DM Sans", sans-serif; }
.inbox-heading p { margin: 0; color: #898b95; font-size: 12px; }
.primary-button { display: flex; align-items: center; gap: 8px; height: 37px; padding: 0 14px; border: 0; border-radius: 7px; background: #7557e4; color: #fff; box-shadow: 0 3px 8px #7557e426; font-size: 11px; font-weight: 600; }
.primary-button:hover { background: #684bd4; }
.primary-button span { font-size: 17px; line-height: 12px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 12px; border: 1px solid #e9e9ee; border-radius: 9px 9px 0 0; background: #fff; }
.search-box { display: flex; align-items: center; gap: 9px; width: min(390px, 52%); height: 31px; padding: 0 9px; border: 1px solid #ededf1; border-radius: 6px; color: #a1a2aa; }
.search-icon { font-size: 20px; line-height: 1; transform: rotate(-20deg); }
.search-box input { flex: 1; min-width: 0; border: 0; outline: 0; color: #393a41; font-size: 11px; }
.search-box input::placeholder { color: #a0a1aa; }
kbd { padding: 2px 4px; border: 1px solid #e6e6eb; border-radius: 3px; background: #fafafd; color: #a5a6ae; font: 9px "DM Sans", sans-serif; }
.toolbar-filters { display: flex; align-items: center; gap: 8px; }
.select-wrap select, .filter-button { height: 31px; padding: 0 9px; border: 1px solid #ededf1; border-radius: 6px; background: #fff; color: #6f717b; font-size: 10px; }
.filter-button { display: flex; align-items: center; gap: 6px; }
.filter-button span { font-size: 15px; }
.notice { padding: 10px 13px; border-right: 1px solid #e9e9ee; border-left: 1px solid #e9e9ee; background: #f6f4ff; color: #6348c8; font-size: 11px; }
.notice.error { background: #fff1f0; color: #b74940; }
.setup-panel { display: grid; gap: 13px; margin: -12px 0 17px; padding: 15px; border: 1px solid var(--theme-border); border-radius: 12px; background: var(--theme-surface); }
.setup-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.setup-kicker { color: var(--theme-muted); font-size: 9px; font-weight: 750; letter-spacing: 1px; }
.setup-panel-heading h2 { margin: 4px 0 3px; color: var(--theme-ink); font-size: 14px; letter-spacing: -.25px; }
.setup-panel-heading p { margin: 0; color: var(--theme-muted); font-size: 10px; line-height: 1.5; }
.setup-team-button { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 8px; min-height: 34px; padding: 0 11px; border: 1px solid var(--theme-border); border-radius: 8px; background: var(--theme-input); color: var(--theme-secondary); font-size: 10px; font-weight: 650; }
.setup-team-button:hover { border-color: var(--theme-accent); color: var(--theme-accent-ink); }
.setup-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.setup-choice { display: grid; grid-template-areas: "icon copy action"; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-width: 0; padding: 12px; border: 1px solid var(--theme-border); border-radius: 10px; background: var(--theme-canvas); }
.setup-choice-icon { grid-area: icon; display: grid; width: 34px; height: 34px; place-items: center; border-radius: 9px; font-size: 14px; font-weight: 750; }
.setup-choice-icon.gmail-icon { color: #dc6359; background: #fff0ef; }
.sample-choice-icon { color: var(--theme-accent-ink); background: var(--theme-accent-soft); }
.setup-choice-copy { grid-area: copy; display: grid; gap: 4px; min-width: 0; }
.setup-choice-copy strong { color: var(--theme-ink); font-size: 11px; }
.setup-choice-copy span { color: var(--theme-muted); font-size: 9px; line-height: 1.5; }
.setup-choice-status { justify-self: start; margin-top: 2px; padding: 3px 6px; border-radius: 12px; background: var(--theme-surface); color: var(--theme-muted); font-size: 8px; font-weight: 650; white-space: nowrap; }
.setup-choice-status.is-connected { background: #e8f7ef; color: #25815f; }
.setup-action-button { grid-area: action; justify-self: end; min-height: 31px; border-radius: 7px; }
.setup-action-button:disabled { color: #25815f; background: #e8f7ef; border-color: #ccebd9; cursor: default; opacity: 1; }
.message-list { min-height: 280px; border: 1px solid #e9e9ee; border-top: 0; background: #fff; }
.loading, .empty-state { padding: 48px 20px; color: #90919a; text-align: center; font-size: 12px; }
.empty-state strong { display: block; margin-bottom: 6px; color: #42434a; font-size: 13px; }
.empty-state p { margin: 0; }
.message-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 11px; align-items: start; padding: 15px 16px; border-bottom: 1px solid #f0f0f3; }
.message-row:last-child { border-bottom: 0; }
.message-row:hover { background: #fcfcfd; }
.message-open { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 11px; min-width: 0; padding: 0; border: 0; background: transparent; color: inherit; text-align: left; }
.message-open:focus-visible { border-radius: 6px; outline: 2px solid #7557e4; outline-offset: 3px; }
.message-open .message-main { display: block; }
.message-row.unread .message-sender, .message-row.unread .message-subject { color: #282930; font-weight: 700; }
.message-avatar { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 8px; background: #f0edff; color: #7457dc; font-size: 10px; font-weight: 700; }
.message-avatar.telegram { background: #eaf6fc; color: #3196cb; }
.message-main { min-width: 0; }
.message-topline { display: flex; justify-content: space-between; gap: 12px; }
.message-sender { overflow: hidden; color: #50515a; font-size: 11px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.message-time { flex: 0 0 auto; color: #9b9ca5; font-size: 10px; }
.message-subject { overflow: hidden; margin-top: 5px; color: #50515a; font-size: 11px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.message-snippet { overflow: hidden; margin-top: 4px; color: #92939c; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.message-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 8px; }
.provider-pill, .label-pill { padding: 3px 6px; border-radius: 4px; background: #f3f2f6; color: #73747d; font-size: 9px; }
.provider-pill.telegram { background: #eaf6fc; color: #318bb9; }
.sample-pill { padding: 3px 6px; border-radius: 4px; background: #fff3d6; color: #805c11; font-size: 9px; font-weight: 600; }
.label-pill { background: #fff4e9; color: #ad7440; }
.label-pill.work { background: #eaf7f2; color: #3b8c72; }
.label-pill.personal { background: #eef2ff; color: #6379b8; }
.message-actions { display: flex; align-items: center; gap: 6px; }
.message-actions select, .message-actions button { height: 26px; padding: 0 6px; border: 1px solid #ededf1; border-radius: 5px; background: #fff; color: #787a83; font-size: 9px; }
.message-actions button { padding: 0 8px; white-space: nowrap; }
.message-actions button:hover, .message-actions select:hover { border-color: #cfc5f5; color: #674bd3; }
.inbox-footer { display: flex; justify-content: space-between; padding: 12px 2px; color: #9a9ba4; font-size: 9px; }
.message-dialog { width: min(720px, calc(100vw - 32px)); max-height: min(86vh, 820px); overflow-y: auto; padding: 25px 29px 20px; border: 1px solid var(--theme-border); border-radius: 14px; background: var(--theme-surface); color: var(--theme-ink); box-shadow: 0 18px 70px #24252b30; }
.message-dialog::backdrop { background: #17192380; backdrop-filter: blur(2px); }
.message-dialog-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 21px; }
.message-dialog-header .eyebrow { color: var(--theme-muted); }
.message-dialog-header .icon-button { width: 32px; height: 32px; border: 1px solid var(--theme-border); border-radius: 8px; font-size: 21px; }
.detail-subject-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.detail-subject-row h2 { margin: 0 0 18px; color: var(--theme-ink); font: 700 20px Manrope, sans-serif; letter-spacing: -.4px; overflow-wrap: anywhere; }
.detail-subject-row .provider-pill { flex: 0 0 auto; margin-top: 2px; }
.detail-subject-row .provider-pill.telegram { background: #eaf6fc; color: #318bb9; }
.detail-sender-row { display: flex; align-items: center; gap: 11px; padding: 14px 0; border-top: 1px solid var(--theme-border); border-bottom: 1px solid var(--theme-border); }
.detail-sender-copy { display: grid; flex: 1; min-width: 0; gap: 4px; font-size: 11px; }
.detail-sender-copy strong { overflow-wrap: anywhere; }
.detail-sender-copy > span, .detail-sender-row time { color: var(--theme-muted); font-size: 10px; }
.detail-sender-row time { flex: 0 0 auto; }
.detail-extra { display: grid; gap: 6px; padding: 12px 0 0 40px; }
.detail-extra div { display: flex; gap: 7px; color: var(--theme-secondary); font-size: 10px; overflow-wrap: anywhere; }
.detail-extra strong { flex: 0 0 52px; color: var(--theme-muted); font-weight: 500; }
.detail-labels { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 13px; }
.detail-body { min-height: 120px; padding: 22px 1px; color: var(--theme-ink); font-size: 13px; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
.detail-attachments { padding: 14px 0; border-top: 1px solid var(--theme-border); }
.detail-attachments h3 { margin: 0 0 9px; color: var(--theme-secondary); font-size: 11px; }
.detail-attachments ul { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.detail-attachments li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--theme-border); border-radius: 8px; background: var(--theme-input); font-size: 11px; }
.detail-attachments li span { overflow-wrap: anywhere; }
.detail-attachments li small, .detail-attachments p { color: var(--theme-muted); font-size: 10px; }
.detail-attachments p { margin: 8px 0 0; }
.detail-contact-section { padding: 14px 0; border-top: 1px solid var(--theme-border); }
.detail-contact-section h3 { margin: 0 0 10px; color: var(--theme-secondary); font-size: 11px; }
.detail-contact-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.detail-contact-button { display: inline-flex; min-height: 34px; align-items: center; padding: 0 11px; border: 1px solid var(--theme-border); border-radius: 7px; background: var(--theme-input); color: var(--theme-secondary); font-size: 10px; font-weight: 600; text-decoration: none; }
.detail-contact-button:hover, .detail-contact-button:focus-visible { border-color: var(--theme-accent); background: var(--theme-accent-soft); color: var(--theme-accent-ink); }
.detail-contact-note { margin: 0; color: var(--theme-muted); font-size: 10px; line-height: 1.5; }
.detail-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 13px; border-top: 1px solid var(--theme-border); color: var(--theme-muted); font-size: 10px; }
.detail-footer .small-button:disabled { opacity: .6; }
.detail-loading, .detail-error { padding: 35px 10px; color: var(--theme-secondary); text-align: center; font-size: 12px; }
.detail-error { color: #b74940; }
.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; }
.connections-dialog { width: min(560px, calc(100vw - 32px)); max-height: min(85vh, 760px); overflow-y: auto; padding: 27px; border: 1px solid #ecebf0; border-radius: 13px; box-shadow: 0 18px 70px #24252b24; }
.connections-dialog::backdrop { background: #23212d66; backdrop-filter: blur(2px); }
.dialog-close-form { position: absolute; top: 16px; right: 16px; }
.dialog-close-form .icon-button { font-size: 23px; }
.connections-dialog h2 { margin: 8px 0 6px; font: 700 20px Manrope, sans-serif; letter-spacing: -.5px; }
.dialog-intro { margin: 0 0 19px; color: #888a94; font-size: 11px; line-height: 1.6; }
.integration-search { display: flex; align-items: center; gap: 9px; height: 39px; margin: 0 0 12px; padding: 0 11px; border: 1px solid var(--theme-border); border-radius: 7px; background: var(--theme-input); color: var(--theme-muted); }
.integration-search > span:first-child { font-size: 18px; line-height: 1; }
.integration-search input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--theme-ink); font: inherit; font-size: 11px; }
.integration-search input::placeholder { color: var(--theme-muted); }
.connections-dialog [hidden] { display: none !important; }
.provider-card { display: flex; align-items: center; gap: 11px; padding: 13px 0; border-top: 1px solid #f0f0f2; }
.provider-card-icon { width: 32px; height: 32px; font-size: 15px; }
.provider-card-icon.instagram-icon { color: #b0448e; background: #fff0f8; font-size: 10px; }
.provider-card-icon.facebook-icon { color: #3974d6; background: #edf3ff; font-size: 19px; }
.provider-card-icon.whatsapp-icon { color: #128c59; background: #e9f8f0; font-size: 10px; }
.provider-card-icon.pinterest-icon { color: #bd1e2d; background: #fff0f0; }
.provider-card-icon.reddit-icon { color: #eb5428; background: #fff1eb; font-size: 11px; }
.provider-card-icon.quora-icon { color: #a82420; background: #fff0ef; }
.provider-card-icon.linkedin-icon { color: #2577a8; background: #eaf6fc; font-size: 11px; }
.provider-card-icon.wordpress-icon { color: #3d596d; background: #edf2f5; font-family: Georgia, serif; }
.provider-card-icon.woocommerce-icon { color: #7851aa; background: #f3edfa; font-size: 10px; }
.provider-card-icon.website-icon { color: #548776; background: #edf7f3; font-size: 10px; }
.provider-card-copy { display: grid; flex: 1 1 180px; gap: 4px; }
.provider-card-copy strong { font-size: 11px; }
.provider-card-copy span, .provider-status, .provider-state { color: #8b8d96; font-size: 10px; line-height: 1.5; }
.provider-state { flex: 0 0 auto; max-width: 110px; text-align: right; }
.provider-state.is-connected { color: #25815f; font-weight: 700; }
.integration-no-results { padding: 19px 10px; color: var(--theme-muted); text-align: center; font-size: 11px; }
.provider-connect-button { flex: 0 0 auto; }
.small-button { padding: 7px 11px; border: 1px solid #e5e1f3; border-radius: 6px; background: #f7f5ff; color: #694ed1; font-size: 10px; font-weight: 600; }
.docs-button { flex: 0 0 auto; text-decoration: none; white-space: nowrap; }
.catalog-heading { display: grid; gap: 4px; margin-top: 20px; padding: 13px 0 9px; border-top: 1px solid #ececf0; }
.catalog-heading strong { color: #383941; font-size: 12px; }
.catalog-heading span, .catalog-footnote { color: #8b8d96; font-size: 10px; line-height: 1.55; }
.catalog-footnote { margin: 12px 0 0; padding: 10px; border-radius: 7px; background: #f7f7fa; }
.small-button:disabled { color: #4a9a7c; background: #effaf5; border-color: #d7f0e5; cursor: default; }
.setup-note { display: grid; gap: 6px; margin-top: 12px; padding: 11px; border-radius: 7px; background: #f7f7fa; color: #777983; font-size: 10px; line-height: 1.6; }
.setup-note strong { color: #4b4c54; font-size: 10px; }
.setup-note a { color: #6e52d6; }
.setup-note code { overflow-wrap: anywhere; color: #555660; }
.dialog-done { display: block; margin: 18px 0 0 auto; padding: 8px 16px; border: 0; border-radius: 6px; background: #7557e4; color: #fff; font-size: 10px; font-weight: 600; }
.theme-toggle { display: grid; width: 30px; height: 30px; place-items: center; border: 1px solid #e8e8ed; border-radius: 50%; background: #fff; color: #6e55cb; font-size: 16px; }
.theme-toggle:hover { border-color: #d7d0f0; background: #f8f6ff; }

:root[data-theme="dark"] {
  color-scheme: dark;
  color: #e8e9f1;
  background: #11131a;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] body,
:root[data-theme="dark"] .app-shell,
:root[data-theme="dark"] .main-panel { background: #11131a; color: #e8e9f1; }
:root[data-theme="dark"] .sidebar { background: #171923; border-color: #292b37; }
:root[data-theme="dark"] .brand { color: #f0eff7; }
:root[data-theme="dark"] .brand-light { color: #a4a6b4; }
:root[data-theme="dark"] .workspace { background: #1d202b; border-color: #303342; color: #e4e5ed; }
:root[data-theme="dark"] .workspace-avatar { background: #30294b; color: #c1b2ff; }
:root[data-theme="dark"] .workspace-chevron,
:root[data-theme="dark"] .nav-icon { color: #9a9daf; }
:root[data-theme="dark"] .nav-item,
:root[data-theme="dark"] .label-item { color: #b4b6c3; }
:root[data-theme="dark"] .nav-item:hover,
:root[data-theme="dark"] .label-item:hover { background: #232532; }
:root[data-theme="dark"] .nav-item.active { background: #29243d; color: #c1afff; }
:root[data-theme="dark"] .nav-item.active .nav-icon { color: #c1afff; }
:root[data-theme="dark"] .sidebar-section-heading,
:root[data-theme="dark"] .workspace-label { color: #9295a5; }
:root[data-theme="dark"] .icon-button { color: #a7a9b7; }
:root[data-theme="dark"] .connections,
:root[data-theme="dark"] .profile { border-color: #292b37; }
:root[data-theme="dark"] .connection-name { color: #b5b7c3; }
:root[data-theme="dark"] .connection-dot { background: #555867; }
:root[data-theme="dark"] .connection-dot.connected { background: #42b889; }
:root[data-theme="dark"] .profile strong { color: #e2e3eb; }
:root[data-theme="dark"] .profile small { color: #9699a8; }
:root[data-theme="dark"] .topbar { background: rgba(23,25,35,.92); border-color: #292b37; }
:root[data-theme="dark"] .breadcrumbs { color: #a2a4b2; }
:root[data-theme="dark"] .breadcrumbs span { color: #606372; }
:root[data-theme="dark"] .breadcrumbs strong { color: #e4e5ed; }
:root[data-theme="dark"] .sidebar-toggle,
:root[data-theme="dark"] .theme-toggle,
:root[data-theme="dark"] .help-button { background: #1d202b; border-color: #343746; color: #c4b8ff; }
:root[data-theme="dark"] .sidebar-toggle:hover,
:root[data-theme="dark"] .theme-toggle:hover { background: #28243b; border-color: #514476; }
:root[data-theme="dark"] .topbar-avatar { background: #30294b; color: #c1b2ff; }
:root[data-theme="dark"] .profile-button { color: var(--theme-secondary); }
:root[data-theme="dark"] .eyebrow { color: #b5a2ff; }
:root[data-theme="dark"] h1,
:root[data-theme="dark"] .inbox-heading h1 { color: #f0f0f5; }
:root[data-theme="dark"] .heading-count { color: #a0a3b2; }
:root[data-theme="dark"] .inbox-heading p { color: #a3a5b2; }
:root[data-theme="dark"] .toolbar,
:root[data-theme="dark"] .message-list { background: #191b25; border-color: #2b2e3a; }
:root[data-theme="dark"] .search-box,
:root[data-theme="dark"] .select-wrap select,
:root[data-theme="dark"] .filter-button,
:root[data-theme="dark"] .message-actions select,
:root[data-theme="dark"] .message-actions button { background: #1e212c; border-color: #343745; color: #c2c4cf; }
:root[data-theme="dark"] .search-box input { background: transparent; color: #e5e6ed; }
:root[data-theme="dark"] .search-box input::placeholder { color: #858898; }
:root[data-theme="dark"] kbd { background: #282b37; border-color: #3a3d4a; color: #a5a8b7; }
:root[data-theme="dark"] .message-row { border-color: #292c37; }
:root[data-theme="dark"] .message-row:hover { background: #20232e; }
:root[data-theme="dark"] .message-row.unread .message-sender,
:root[data-theme="dark"] .message-row.unread .message-subject { color: #f0f0f5; }
:root[data-theme="dark"] .message-sender,
:root[data-theme="dark"] .message-subject { color: #d1d2dc; }
:root[data-theme="dark"] .message-time,
:root[data-theme="dark"] .message-snippet,
:root[data-theme="dark"] .loading,
:root[data-theme="dark"] .inbox-footer { color: #989baa; }
:root[data-theme="dark"] .empty-state strong { color: #e1e2ea; }
:root[data-theme="dark"] .message-avatar { background: #30294b; color: #c1b2ff; }
:root[data-theme="dark"] .message-avatar.telegram { background: #1c3442; color: #73c2ea; }
:root[data-theme="dark"] .provider-pill { background: #2a2d39; color: #c3c4ce; }
:root[data-theme="dark"] .provider-pill.telegram { background: #1c3442; color: #85c9eb; }
:root[data-theme="dark"] .label-pill { background: #433322; color: #edbd89; }
:root[data-theme="dark"] .label-pill.work { background: #1d3b32; color: #8bd1b8; }
:root[data-theme="dark"] .label-pill.personal { background: #293451; color: #aabdf1; }
:root[data-theme="dark"] .notice { background: #29243d; color: #d0c3ff; border-color: #39324f; }
:root[data-theme="dark"] .notice.error { background: #422729; color: #ffb4ad; }
:root[data-theme="dark"] .connections-dialog { background: #191b25; border-color: #343746; color: #e5e6ed; }
:root[data-theme="dark"] .connections-dialog h2,
:root[data-theme="dark"] .provider-card-copy strong,
:root[data-theme="dark"] .catalog-heading strong { color: #ededf3; }
:root[data-theme="dark"] .dialog-intro,
:root[data-theme="dark"] .provider-card-copy span,
:root[data-theme="dark"] .provider-status,
:root[data-theme="dark"] .catalog-heading span,
:root[data-theme="dark"] .catalog-footnote { color: #a4a6b4; }
:root[data-theme="dark"] .provider-card,
:root[data-theme="dark"] .catalog-heading { border-color: #303341; }
:root[data-theme="dark"] .setup-note,
:root[data-theme="dark"] .catalog-footnote { background: #222530; }
:root[data-theme="dark"] .setup-note { color: #b0b2bf; }
:root[data-theme="dark"] .setup-note strong { color: #e0e1e9; }
:root[data-theme="dark"] .setup-note code { color: #d0d1db; }
:root[data-theme="dark"] .small-button,
:root[data-theme="dark"] .docs-button { background: #28243b; border-color: #443a62; color: #c4b4ff; }
:root[data-theme="dark"] .small-button:disabled { background: #1d3b32; border-color: #2e594b; color: #8bd1b8; }
:root[data-theme="dark"] .mobile-label-chip { background: #1e212c; border-color: #343745; color: #c2c4cf; }
:root[data-theme="dark"] .mobile-label-chip.active { background: #29243d; border-color: #514476; color: #c1afff; }
:root[data-theme="dark"] .sidebar-collapsed .nav-count { background: #1d202b; }
:root[data-theme="dark"] .sidebar { color-scheme: dark; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) { color-scheme: dark; background: #11131a; color: #e8e9f1; }
  :root:not([data-theme]) body,
  :root:not([data-theme]) .app-shell,
  :root:not([data-theme]) .main-panel { background: #11131a; color: #e8e9f1; }
  :root:not([data-theme]) .sidebar { background: #171923; border-color: #292b37; }
  :root:not([data-theme]) .topbar { background: rgba(23,25,35,.92); border-color: #292b37; }
}

.auth-screen { display: grid; min-height: 100vh; place-items: center; padding: 28px 16px; background: var(--theme-canvas); }
.auth-card { width: min(100%, 430px); padding: 32px; border: 1px solid var(--theme-border); border-radius: 14px; background: var(--theme-surface); box-shadow: 0 20px 60px #0f172a0d; }
.auth-brand { width: fit-content; margin: 0 auto 28px; }
.install-app-button { min-height: 31px; padding: 0 10px; border: 1px solid var(--theme-border); border-radius: 6px; background: var(--theme-input); color: var(--theme-secondary); font-size: 10px; font-weight: 600; }
.auth-card > .install-app-button { width: 100%; margin: -12px 0 15px; }
.install-app-button:hover { border-color: var(--theme-accent); color: var(--theme-accent-ink); }
.topbar-install-button { white-space: nowrap; }
.install-guide { max-width: 430px; }
.app-update-banner { position: fixed; z-index: 20; top: 12px; left: 50%; display: flex; align-items: center; gap: 9px; width: min(620px, calc(100vw - 24px)); padding: 10px 12px; transform: translateX(-50%); border: 1px solid var(--theme-border); border-radius: 9px; background: var(--theme-surface-raised); color: var(--theme-secondary); box-shadow: 0 8px 30px #0f172a24; font-size: 11px; }
.app-update-banner > span { flex: 1; }
.app-update-button, .app-update-later { min-height: 30px; padding: 0 10px; border: 1px solid var(--theme-border); border-radius: 6px; background: var(--theme-input); color: var(--theme-secondary); font-size: 10px; font-weight: 600; white-space: nowrap; }
.app-update-button { border-color: var(--theme-accent); background: var(--theme-accent); color: var(--palette-cloud); }
.app-update-button:hover { background: var(--theme-accent-hover); }
.app-update-button:disabled { opacity: .7; cursor: wait; }
.demo-entry-button { display: flex; align-items: center; justify-content: center; gap: 7px; width: 100%; min-height: 38px; margin-bottom: 14px; border: 1px solid var(--theme-border); border-radius: 7px; background: var(--theme-accent-soft); color: var(--theme-accent-ink); font-size: 11px; font-weight: 700; }
.demo-entry-button:hover { border-color: var(--theme-muted); }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-bottom: 23px; padding: 4px; border-radius: 8px; background: var(--theme-canvas); }
.auth-tab { min-height: 36px; border: 0; border-radius: 6px; background: transparent; color: var(--theme-muted); font-size: 11px; font-weight: 600; }
.auth-tab.active { background: var(--theme-surface-raised); color: var(--theme-ink); box-shadow: 0 1px 3px #0f172a12; }
.auth-form h1, .auth-form h2 { margin: 0 0 7px; color: var(--theme-ink); font-size: 23px; letter-spacing: -.5px; }
.auth-form > p { margin: 0 0 20px; color: var(--theme-muted); font-size: 11px; line-height: 1.5; }
.auth-form label, .invite-form label { display: grid; gap: 7px; margin-top: 14px; color: var(--theme-secondary); font-size: 10px; font-weight: 600; }
.auth-form input, .invite-form input { width: 100%; min-width: 0; height: 39px; padding: 0 11px; border: 1px solid var(--theme-border); border-radius: 7px; outline: 0; background: var(--theme-input); color: var(--theme-ink); font-size: 11px; }
.auth-form input:focus, .invite-form input:focus { border-color: var(--theme-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--theme-accent) 15%, transparent); }
.auth-form input[readonly] { background: var(--theme-canvas); }
.auth-submit { justify-content: center; width: 100%; height: 40px; margin-top: 20px; font-size: 11px; }
.password-hint { display: block; margin-top: 6px; color: var(--theme-muted); font-size: 9px; }
.auth-footer { margin-top: 22px; padding-top: 15px; border-top: 1px solid var(--theme-border); color: var(--theme-muted); font-size: 9px; line-height: 1.5; text-align: center; }
.invite-banner { margin-bottom: 15px; padding: 10px; border-radius: 7px; background: var(--theme-accent-soft); color: var(--theme-accent-ink); font-size: 11px; }
.auth-error { margin: 0 0 15px; border: 0; border-radius: 7px; line-height: 1.5; }
.auth-status { display: grid; gap: 10px; margin: 0 0 15px; padding: 11px 12px; border: 1px solid var(--theme-border); border-radius: 7px; background: var(--theme-accent-soft); color: var(--theme-accent-ink); font-size: 11px; line-height: 1.5; }
.auth-status button { justify-self: start; min-height: 31px; padding: 0 10px; border: 1px solid var(--theme-border); border-radius: 6px; background: var(--theme-input); color: var(--theme-secondary); font-size: 10px; font-weight: 650; }
.auth-status button:hover { border-color: var(--theme-accent); color: var(--theme-accent-ink); }
.team-button { height: 30px; padding: 0 10px; border: 1px solid var(--theme-border); border-radius: 6px; background: var(--theme-input); color: var(--theme-secondary); font-size: 10px; font-weight: 600; }
.team-button:hover { border-color: var(--theme-accent); color: var(--theme-accent-ink); }
.demo-banner { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 24px; border-bottom: 1px solid var(--theme-border); background: var(--theme-accent-soft); }
.demo-banner > div:first-child { display: grid; gap: 3px; }
.demo-banner strong { color: var(--theme-accent-ink); font-size: 11px; }
.demo-banner span { color: var(--theme-secondary); font-size: 10px; }
.demo-banner-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; }
.demo-exit-button, .demo-signup-button { min-height: 30px; padding: 0 10px; border: 1px solid var(--theme-border); border-radius: 6px; background: var(--theme-input); color: var(--theme-secondary); font-size: 10px; font-weight: 600; }
.demo-signup-button { border-color: var(--theme-accent); background: var(--theme-accent); color: var(--palette-cloud); }
.demo-signup-button:hover { background: var(--theme-accent-hover); }
.signout-button { display: grid; width: 29px; height: 29px; place-items: center; padding: 0; border: 1px solid var(--theme-border); border-radius: 50%; background: var(--theme-input); color: var(--theme-secondary); font-size: 16px; }
.signout-button:hover { border-color: var(--theme-accent); color: var(--theme-accent-ink); }
.team-dialog { max-width: 500px; }
.team-members { display: grid; max-height: 210px; overflow-y: auto; margin: 14px 0; border-top: 1px solid var(--theme-border); }
.team-member { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 10px 0; border-bottom: 1px solid var(--theme-border); }
.team-member-avatar { display: grid; width: 29px; height: 29px; flex: 0 0 auto; place-items: center; border-radius: 8px; background: var(--theme-accent-soft); color: var(--theme-accent-ink); font-size: 10px; font-weight: 700; }
.team-member-info { display: grid; flex: 1; min-width: 0; gap: 3px; }
.team-member-info strong { overflow: hidden; color: var(--theme-secondary); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.team-member-info small, .team-role, .invite-result small { color: var(--theme-muted); font-size: 9px; }
.team-member-info small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-role { padding: 4px 7px; border-radius: 5px; background: var(--theme-accent-soft); color: var(--theme-accent-ink); text-transform: capitalize; }
.profile-dialog { max-width: 570px; }
.profile-form { display: grid; gap: 10px; padding: 16px 0; border-top: 1px solid var(--theme-border); }
.profile-form h3 { margin: 0; color: var(--theme-ink); font-size: 13px; }
.profile-form > p { margin: -5px 0 2px; color: var(--theme-muted); font-size: 10px; line-height: 1.5; overflow-wrap: anywhere; }
.profile-form > p strong { color: var(--theme-secondary); }
.profile-form label { display: grid; gap: 6px; color: var(--theme-secondary); font-size: 10px; font-weight: 600; }
.profile-form input:not([type="file"]), .profile-form textarea { width: 100%; min-width: 0; padding: 9px 10px; border: 1px solid var(--theme-border); border-radius: 7px; outline: 0; background: var(--theme-input); color: var(--theme-ink); font: inherit; font-size: 11px; }
.profile-form input:not([type="file"]) { height: 38px; }
.profile-form textarea { resize: vertical; line-height: 1.5; }
.profile-form input:focus, .profile-form textarea:focus { border-color: var(--theme-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--theme-accent) 15%, transparent); }
.profile-form input[type="file"] { max-width: 100%; color: var(--theme-muted); font-size: 10px; }
.profile-image-control { display: flex; align-items: center; gap: 13px; min-height: 70px; }
.profile-image-control > img, .profile-image-placeholder { display: grid; width: 64px; height: 64px; flex: 0 0 64px; place-items: center; border-radius: 15px; background: var(--theme-accent-soft); color: var(--theme-accent-ink); font-size: 20px; font-weight: 750; }
.profile-image-control > div { display: grid; gap: 8px; min-width: 0; }
.profile-remove-image { justify-self: start; padding: 0; border: 0; background: none; color: var(--theme-muted); font-size: 10px; text-decoration: underline; }
.profile-save { justify-self: start; margin-top: 3px; }
.profile-feedback { margin: 10px 0; padding: 10px; border-radius: 7px; background: var(--theme-accent-soft); color: var(--theme-accent-ink); font-size: 11px; line-height: 1.5; }
.profile-feedback.error { background: #fff1f0; color: #b74940; }
.team-member { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 9px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--theme-border); }
.team-member-avatar { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 9px; background: var(--theme-accent-soft); color: var(--theme-accent-ink); font-size: 11px; font-weight: 700; }
.team-member-info { display: grid; min-width: 0; gap: 2px; }
.team-member-info strong { color: var(--theme-ink); font-size: 11px; }
.team-member-info small { overflow-wrap: anywhere; color: var(--theme-muted); font-size: 9px; }
.team-member-info em { color: var(--theme-muted); font-size: 9px; font-style: normal; }
.team-role { color: var(--theme-muted); font-size: 9px; }
.invite-form { display: flex; align-items: end; gap: 9px; padding: 14px 0; border-top: 1px solid var(--theme-border); }
.invite-form label { flex: 1; min-width: 0; margin: 0; }
.invite-form .small-button { height: 39px; white-space: nowrap; }
.invite-result { display: grid; gap: 8px; padding: 12px; border-radius: 8px; background: var(--theme-canvas); }
.invite-result > strong { color: var(--theme-secondary); font-size: 10px; }
.invite-link-row { display: flex; gap: 7px; }
.invite-link-row input { min-width: 0; flex: 1; padding: 0 8px; border: 1px solid var(--theme-border); border-radius: 6px; background: var(--theme-input); color: var(--theme-secondary); font-size: 9px; }
.team-dialog .dialog-done { margin-top: 13px; }
:root[data-theme="dark"] .auth-card { box-shadow: 0 20px 60px #02061755; }

@media (min-width: 761px) {
  .app-shell.sidebar-collapsed .sidebar { width: 68px; flex-basis: 68px; padding-right: 10px; padding-left: 10px; }
  .app-shell.sidebar-collapsed .brand { justify-content: center; padding: 0; }
  .app-shell.sidebar-collapsed .brand > span:last-child,
  .app-shell.sidebar-collapsed .workspace-label,
  .app-shell.sidebar-collapsed .workspace,
  .app-shell.sidebar-collapsed .sidebar-section-heading > span,
  .app-shell.sidebar-collapsed .label-list,
  .app-shell.sidebar-collapsed .connections,
  .app-shell.sidebar-collapsed .profile > div:not(.profile-avatar),
  .app-shell.sidebar-collapsed .profile-menu,
  .app-shell.sidebar-collapsed .nav-label { display: none; }
  .app-shell.sidebar-collapsed .main-nav { margin-top: 25px; }
  .app-shell.sidebar-collapsed .nav-item { position: relative; justify-content: center; padding: 0; }
  .app-shell.sidebar-collapsed .nav-icon { width: 100%; }
  .app-shell.sidebar-collapsed .nav-count { position: absolute; top: 2px; right: 2px; min-width: 14px; height: 14px; display: grid; place-items: center; border-radius: 8px; background: #fff; font-size: 8px; }
  .app-shell.sidebar-collapsed .sidebar-section-heading { justify-content: center; margin-right: 0; margin-left: 0; }
  .app-shell.sidebar-collapsed .profile { justify-content: center; padding-right: 0; padding-left: 0; }
  .app-shell.sidebar-collapsed .topbar { padding-right: 28px; padding-left: 28px; }
}
@media (min-width: 761px) and (max-width: 1020px) {
  .sidebar { width: 220px; flex-basis: 220px; }
  .topbar { padding-right: 28px; padding-left: 28px; }
  .inbox { padding-right: 28px; padding-left: 28px; }
}
@media (max-width: 760px) {
  body { min-height: 100dvh; }
  .app-shell { display: block; min-height: 100dvh; }
  .sidebar {
    position: fixed;
    z-index: 5;
    right: 12px;
    bottom: max(10px, env(safe-area-inset-bottom));
    left: 12px;
    width: auto;
    height: 68px;
    min-height: 0;
    flex-direction: row;
    align-items: stretch;
    padding: 5px;
    border: 1px solid color-mix(in srgb, var(--theme-border) 82%, transparent);
    border-radius: 19px;
    background: color-mix(in srgb, var(--theme-surface) 92%, transparent);
    box-shadow: 0 8px 30px #1720331a, 0 1px 3px #1720330d;
    backdrop-filter: blur(18px) saturate(1.35);
  }
  .brand, .workspace-label, .workspace, .sidebar > .sidebar-section-heading,
  .label-list, .sidebar-spacer, .connections, .profile { display: none; }
  .main-nav { display: flex; width: 100%; height: 100%; gap: 3px; margin: 0; }
  .nav-item, .nav-item:not(.active) {
    position: relative;
    display: flex;
    flex: 1;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    min-width: 0;
    min-height: 0;
    height: 100%;
    padding: 3px 2px 2px;
    border-radius: 14px;
    color: var(--theme-muted);
    font-size: 10px;
    font-weight: 600;
    text-align: center;
    transition: color .16s ease, background-color .16s ease, transform .16s ease;
  }
  .nav-item:active { transform: scale(.96); }
  .nav-item.active, .nav-item.active:hover { background: var(--theme-accent-soft); color: var(--theme-accent-ink); font-weight: 700; }
  .nav-item.active { box-shadow: none; }
  .nav-icon { width: 28px; height: 27px; color: inherit; font-size: 19px; line-height: 21px; }
  .nav-icon svg { width: 22px; height: 22px; }
  .nav-item.active .nav-icon { color: var(--theme-accent-ink); }
  .nav-label { display: none; }
  .nav-mobile-label { display: inline; }
  .nav-count { position: absolute; top: 3px; left: calc(50% + 9px); display: inline-grid; min-width: 17px; height: 17px; place-items: center; padding: 0 4px; border: 2px solid var(--theme-surface); border-radius: 10px; background: #e85d75; color: #fff; font-size: 8px; font-weight: 700; }
  .mobile-account-nav { display: flex; }
  .main-panel { min-height: 100dvh; padding-bottom: calc(100px + env(safe-area-inset-bottom)); }
  .topbar { position: sticky; z-index: 3; top: 0; height: 50px; padding: 0 16px; border-bottom-color: #efeff2; background: rgba(255,255,255,.94); backdrop-filter: blur(12px); }
  .sidebar-toggle { display: none; }
  .topbar-leading { gap: 0; }
  .breadcrumbs { color: #292a31; font-size: 13px; font-weight: 700; }
  .breadcrumbs span { display: none; }
  .breadcrumbs strong { display: none; }
  .topbar-actions { gap: 9px; }
  .topbar-install-button { display: none; }
  .app-update-banner { top: 7px; flex-wrap: wrap; }
  .app-update-banner > span { flex-basis: 100%; }
  .demo-banner { align-items: flex-start; flex-direction: column; gap: 9px; padding: 10px 14px; }
  .demo-banner-actions { width: 100%; }
  .demo-signup-button { margin-left: auto; }
  .help-button { display: none; }
  .topbar-avatar { width: 29px; height: 29px; }
  .inbox { width: 100%; padding: 24px 14px 18px; }
  .inbox-heading { align-items: flex-start; gap: 12px; margin-bottom: 16px; }
  .setup-panel { margin-top: 0; margin-bottom: 13px; padding: 13px; }
  .setup-choices { grid-template-columns: minmax(0, 1fr); }
  .eyebrow { font-size: 8px; letter-spacing: 1px; }
  h1 { margin-top: 6px; font-size: 21px; letter-spacing: -.5px; }
  .heading-count { font-size: 11px; }
  .inbox-heading p { max-width: 235px; font-size: 11px; line-height: 1.45; }
  .primary-button { flex: 0 0 auto; gap: 5px; height: 34px; padding: 0 9px; border-radius: 7px; font-size: 9px; }
  .primary-button span { font-size: 14px; }
  .mobile-labels { display: flex; gap: 7px; overflow-x: auto; margin: 0 -14px 13px; padding: 2px 14px 4px; scrollbar-width: none; }
  .mobile-labels::-webkit-scrollbar { display: none; }
  .mobile-label-chip { flex: 0 0 auto; padding: 7px 11px; border: 1px solid #e8e7ed; border-radius: 20px; background: #fff; color: #6f717b; font-size: 10px; }
  .mobile-label-chip.active { border-color: #ded7fc; background: #f2efff; color: #674bd3; font-weight: 600; }
  .toolbar { align-items: stretch; flex-direction: column; gap: 9px; padding: 10px; border-radius: 9px 9px 0 0; }
  .search-box { width: 100%; height: 37px; }
  .search-box input { font-size: 12px; }
  .toolbar-filters { justify-content: space-between; }
  .select-wrap { flex: 1; }
  .select-wrap select, .filter-button { height: 34px; font-size: 10px; }
  .select-wrap select { width: 100%; }
  .message-list { min-height: 210px; border-radius: 0 0 9px 9px; }
  .loading, .empty-state { padding: 42px 18px; line-height: 1.5; }
  .message-row { grid-template-columns: minmax(0, 1fr); gap: 9px; padding: 14px 11px; }
  .message-open { grid-template-columns: 31px minmax(0, 1fr); gap: 9px; }
  .message-avatar { width: 30px; height: 30px; }
  .message-topline { align-items: baseline; gap: 8px; }
  .message-sender { font-size: 11px; }
  .message-time { font-size: 9px; }
  .message-subject { margin-top: 6px; font-size: 11px; white-space: normal; }
  .message-snippet { font-size: 10px; line-height: 1.45; white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  .message-actions { grid-column: 1; display: flex; width: 100%; margin-top: 1px; }
  .message-actions select, .message-actions button { min-height: 30px; font-size: 10px; }
  .message-actions select { flex: 1; }
  .message-actions button { padding: 0 10px; }
  .inbox-footer { gap: 9px; padding: 11px 1px; font-size: 9px; }
  .message-dialog { position: fixed; inset: auto 0 0; width: 100%; max-width: none; max-height: 92dvh; margin: 0; padding: 19px 17px calc(17px + env(safe-area-inset-bottom)); border: 0; border-top: 1px solid var(--theme-border); border-radius: 18px 18px 0 0; box-shadow: 0 -14px 50px #24252b20; }
  .message-dialog-header { margin-bottom: 14px; }
  .detail-subject-row h2 { font-size: 17px; }
  .detail-sender-row { align-items: flex-start; }
  .detail-sender-row time { max-width: 100px; text-align: right; line-height: 1.4; }
  .detail-body { padding: 17px 0; font-size: 12px; }
  .connections-dialog { position: fixed; inset: auto 0 0; width: 100%; max-width: none; max-height: 88dvh; margin: 0; padding: 25px 17px calc(18px + env(safe-area-inset-bottom)); border: 0; border-top: 1px solid #ecebf0; border-radius: 18px 18px 0 0; box-shadow: 0 -14px 50px #24252b20; }
  .connections-dialog::backdrop { background: #23212d66; }
  .dialog-close-form { top: 12px; right: 13px; }
  .connections-dialog h2 { font-size: 18px; }
  .dialog-intro { max-width: 90%; }
  .provider-card { align-items: flex-start; flex-wrap: wrap; gap: 9px; padding: 12px 0; }
  .provider-card-copy { min-width: 0; flex-basis: calc(100% - 41px); }
  .provider-card-copy span { font-size: 9px; }
  .provider-state { max-width: 90px; }
  .provider-connect-button { margin-left: 41px; }
  .docs-button { padding: 7px; font-size: 9px; }
  .setup-note { font-size: 9px; }
  .catalog-heading { margin-top: 13px; }
  .dialog-done { position: sticky; bottom: 0; }
}

@media (max-width: 380px) {
  .inbox { padding-right: 11px; padding-left: 11px; }
  .mobile-labels { margin-right: -11px; margin-left: -11px; padding-right: 11px; padding-left: 11px; }
  .inbox-heading { gap: 7px; }
  h1 { font-size: 19px; }
  .primary-button { padding: 0 7px; font-size: 8px; }
  .primary-button span { display: none; }
  .message-row { padding-right: 8px; padding-left: 8px; }
}

:root {
  --palette-cloud: #f8fafc;
  --palette-border: #e2e8f0;
  --palette-muted: #94a3b8;
  --palette-slate: #334155;
  --palette-navy: #0f172a;
  --theme-canvas: var(--palette-cloud);
  --theme-surface: #fff;
  --theme-surface-raised: #fff;
  --theme-ink: var(--palette-navy);
  --theme-secondary: var(--palette-slate);
  --theme-muted: var(--palette-muted);
  --theme-border: var(--palette-border);
  --theme-accent: var(--palette-slate);
  --theme-accent-hover: var(--palette-navy);
  --theme-accent-soft: var(--palette-border);
  --theme-accent-ink: var(--palette-navy);
  --theme-input: #fff;
}

:root[data-theme="dark"] {
  --theme-canvas: var(--palette-navy);
  --theme-surface: var(--palette-navy);
  --theme-surface-raised: var(--palette-slate);
  --theme-ink: var(--palette-cloud);
  --theme-secondary: var(--palette-border);
  --theme-muted: var(--palette-muted);
  --theme-border: var(--palette-slate);
  --theme-accent: var(--palette-slate);
  --theme-accent-hover: #475569;
  --theme-accent-soft: var(--palette-slate);
  --theme-accent-ink: var(--palette-cloud);
  --theme-input: #1e293b;
}

:root,
:root body,
:root .app-shell,
:root .main-panel { background: var(--theme-canvas); color: var(--theme-ink); }
:root .sidebar { background: var(--theme-surface); border-color: var(--theme-border); }
:root .brand { color: var(--theme-ink); }
:root .brand-mark { background: linear-gradient(140deg, var(--palette-slate), var(--palette-navy)); }
:root .brand-light,
:root .connection-name,
:root .nav-item,
:root .label-item,
:root .workspace,
:root .profile strong,
:root .breadcrumbs strong,
:root .message-sender,
:root .message-subject,
:root .empty-state strong,
:root .provider-card-copy strong,
:root .catalog-heading strong { color: var(--theme-secondary); }
:root .workspace { background: var(--theme-input); border-color: var(--theme-border); }
:root .workspace-avatar,
:root .profile-avatar,
:root .topbar-avatar { background: var(--theme-accent-soft); color: var(--theme-accent-ink); }
:root .workspace-chevron,
:root .nav-icon,
:root .icon-button,
:root .sidebar-section-heading,
:root .workspace-label,
:root .nav-count,
:root .profile small,
:root .breadcrumbs,
:root .breadcrumbs span,
:root .heading-count,
:root .inbox-heading p,
:root .search-box,
:root .search-box input::placeholder,
:root .loading,
:root .message-time,
:root .message-snippet,
:root .inbox-footer,
:root .dialog-intro,
:root .provider-card-copy span,
:root .provider-status,
:root .provider-state,
:root .catalog-heading span,
:root .catalog-footnote { color: var(--theme-muted); }
:root .provider-state.is-connected { color: #25815f; }
:root[data-theme="dark"] .provider-state.is-connected { color: #68c99e; }
:root .connections,
:root .profile,
:root .topbar,
:root .connections-dialog,
:root .provider-card,
:root .catalog-heading { border-color: var(--theme-border); }
:root .topbar { background: var(--theme-surface); }
:root .sidebar-toggle,
:root .theme-toggle,
:root .signout-button,
:root .help-button,
:root .toolbar,
:root .message-list,
:root .search-box,
:root .select-wrap select,
:root .filter-button,
:root .message-actions select,
:root .message-actions button,
:root .mobile-label-chip { background: var(--theme-input); border-color: var(--theme-border); color: var(--theme-secondary); }
:root .sidebar-toggle:hover,
:root .theme-toggle:hover { background: var(--theme-accent-soft); border-color: var(--theme-accent); color: var(--theme-accent-ink); }
:root .nav-item.active,
:root .mobile-label-chip.active { background: var(--theme-accent-soft); color: var(--theme-accent-ink); }
:root .nav-item.active .nav-icon { color: var(--theme-accent); }
:root .nav-item:hover,
:root .label-item:hover,
:root .message-row:hover { background: color-mix(in srgb, var(--theme-surface-raised) 55%, var(--theme-canvas)); }
:root .eyebrow { color: var(--theme-secondary); }
:root h1,
:root .inbox-heading h1 { color: var(--theme-ink); }
:root .primary-button,
:root .dialog-done { background: var(--theme-accent); color: var(--palette-cloud); box-shadow: none; }
:root .primary-button:hover,
:root .dialog-done:hover { background: var(--theme-accent-hover); }
:root .search-box input { background: transparent; color: var(--theme-ink); }
:root kbd { background: var(--theme-canvas); border-color: var(--theme-border); color: var(--theme-muted); }
:root .notice { background: var(--theme-accent-soft); border-color: var(--theme-border); color: var(--theme-accent-ink); }
:root .notice.error { background: #fff1f0; color: #b74940; }
:root .setup-panel { background: var(--theme-surface); }
:root .setup-choice { background: var(--theme-canvas); }
:root .setup-choice-status { background: var(--theme-surface); }
:root .setup-choice-status.is-connected { background: #e8f7ef; color: #25815f; }
:root .setup-action-button:disabled { background: #e8f7ef; border-color: #ccebd9; color: #25815f; }
:root[data-theme="dark"] .setup-choice-status.is-connected,
:root[data-theme="dark"] .setup-action-button:disabled { background: #163c2d; border-color: #285d46; color: #9de0bd; }
:root .sample-pill { background: var(--theme-accent-soft); color: var(--theme-accent-ink); }
:root .message-row { border-color: var(--theme-border); }
:root .message-row.unread .message-sender,
:root .message-row.unread .message-subject { color: var(--theme-ink); }
:root .message-avatar { background: var(--theme-accent-soft); color: var(--theme-accent-ink); }
:root .provider-pill,
:root .label-pill,
:root .provider-pill.telegram,
:root .label-pill.work,
:root .label-pill.personal { background: var(--theme-accent-soft); color: var(--theme-secondary); }
:root .provider-pill.telegram { color: var(--theme-accent-ink); }
:root .message-actions button:hover,
:root .message-actions select:hover { border-color: var(--theme-accent); color: var(--theme-accent-ink); }
:root .connections-dialog { background: var(--theme-surface); color: var(--theme-ink); }
:root .setup-note,
:root .catalog-footnote { background: var(--theme-canvas); color: var(--theme-secondary); }
:root .setup-note strong { color: var(--theme-ink); }
:root .setup-note code { color: var(--theme-secondary); }
:root .setup-note a { color: var(--theme-accent-ink); }
:root .small-button,
:root .docs-button,
:root .small-button:disabled { background: var(--theme-accent-soft); border-color: var(--theme-border); color: var(--theme-accent-ink); }
:root .sidebar-collapsed .nav-count { background: var(--theme-surface); color: var(--theme-secondary); }
:root .mobile-label-chip.active { border-color: var(--theme-accent); }
:root .sidebar { color-scheme: var(--theme-scheme, light); }
:root[data-theme="dark"] .sidebar { color-scheme: dark; }
:root[data-theme="light"] .sidebar { color-scheme: light; }
:root[data-theme="dark"] .notice.error { background: #422729; color: #ffb4ad; }
:root[data-theme="dark"] .sample-pill { background: var(--theme-accent-soft); color: var(--theme-accent-ink); }
:root[data-theme="dark"] .small-button:disabled { background: #1e293b; border-color: var(--theme-border); color: var(--palette-cloud); }

:root[data-theme="dark"] body,
:root[data-theme="dark"] .app-shell,
:root[data-theme="dark"] .main-panel { background: var(--theme-canvas); color: var(--theme-ink); }
:root[data-theme="dark"] .sidebar { background: var(--theme-surface); border-color: var(--theme-border); }
:root[data-theme="dark"] .brand,
:root[data-theme="dark"] .breadcrumbs strong,
:root[data-theme="dark"] .connection-name,
:root[data-theme="dark"] .nav-item,
:root[data-theme="dark"] .label-item,
:root[data-theme="dark"] .workspace,
:root[data-theme="dark"] .profile strong,
:root[data-theme="dark"] .message-sender,
:root[data-theme="dark"] .message-subject,
:root[data-theme="dark"] .empty-state strong,
:root[data-theme="dark"] .provider-card-copy strong,
:root[data-theme="dark"] .catalog-heading strong { color: var(--theme-secondary); }
:root[data-theme="dark"] .brand-light,
:root[data-theme="dark"] .workspace-chevron,
:root[data-theme="dark"] .nav-icon,
:root[data-theme="dark"] .icon-button,
:root[data-theme="dark"] .sidebar-section-heading,
:root[data-theme="dark"] .workspace-label,
:root[data-theme="dark"] .nav-count,
:root[data-theme="dark"] .profile small,
:root[data-theme="dark"] .breadcrumbs,
:root[data-theme="dark"] .breadcrumbs span,
:root[data-theme="dark"] .heading-count,
:root[data-theme="dark"] .inbox-heading p,
:root[data-theme="dark"] .search-box,
:root[data-theme="dark"] .search-box input::placeholder,
:root[data-theme="dark"] .loading,
:root[data-theme="dark"] .message-time,
:root[data-theme="dark"] .message-snippet,
:root[data-theme="dark"] .inbox-footer,
:root[data-theme="dark"] .dialog-intro,
:root[data-theme="dark"] .provider-card-copy span,
:root[data-theme="dark"] .provider-status,
:root[data-theme="dark"] .provider-state,
:root[data-theme="dark"] .catalog-heading span,
:root[data-theme="dark"] .catalog-footnote { color: var(--theme-muted); }
:root[data-theme="dark"] .workspace { background: var(--theme-input); border-color: var(--theme-border); }
:root[data-theme="dark"] .workspace-avatar,
:root[data-theme="dark"] .profile-avatar,
:root[data-theme="dark"] .topbar-avatar,
:root[data-theme="dark"] .message-avatar { background: var(--theme-accent-soft); color: var(--theme-accent-ink); }
:root[data-theme="dark"] .topbar,
:root[data-theme="dark"] .connections,
:root[data-theme="dark"] .profile,
:root[data-theme="dark"] .connections-dialog,
:root[data-theme="dark"] .provider-card,
:root[data-theme="dark"] .catalog-heading { border-color: var(--theme-border); }
:root[data-theme="dark"] .topbar { background: var(--theme-surface); }
:root[data-theme="dark"] .sidebar-toggle,
:root[data-theme="dark"] .theme-toggle,
:root[data-theme="dark"] .signout-button,
:root[data-theme="dark"] .help-button,
:root[data-theme="dark"] .toolbar,
:root[data-theme="dark"] .message-list,
:root[data-theme="dark"] .search-box,
:root[data-theme="dark"] .select-wrap select,
:root[data-theme="dark"] .filter-button,
:root[data-theme="dark"] .message-actions select,
:root[data-theme="dark"] .message-actions button,
:root[data-theme="dark"] .mobile-label-chip { background: var(--theme-input); border-color: var(--theme-border); color: var(--theme-secondary); }
:root[data-theme="dark"] .sidebar-toggle:hover,
:root[data-theme="dark"] .theme-toggle:hover { background: var(--theme-accent-soft); border-color: var(--theme-accent); color: var(--theme-accent-ink); }
:root[data-theme="dark"] .nav-item.active,
:root[data-theme="dark"] .mobile-label-chip.active { background: var(--theme-accent-soft); border-color: var(--theme-accent); color: var(--theme-accent-ink); }
:root[data-theme="dark"] .nav-item.active .nav-icon { color: var(--theme-accent-ink); }
:root[data-theme="dark"] .nav-item:hover,
:root[data-theme="dark"] .label-item:hover,
:root[data-theme="dark"] .message-row:hover { background: #1e293b; }
:root[data-theme="dark"] .eyebrow { color: var(--theme-secondary); }
:root[data-theme="dark"] h1,
:root[data-theme="dark"] .inbox-heading h1 { color: var(--theme-ink); }
:root[data-theme="dark"] .primary-button,
:root[data-theme="dark"] .dialog-done { background: var(--theme-accent); color: var(--palette-cloud); box-shadow: none; }
:root[data-theme="dark"] .primary-button:hover,
:root[data-theme="dark"] .dialog-done:hover { background: var(--theme-accent-hover); }
:root[data-theme="dark"] .search-box input { background: transparent; color: var(--theme-ink); }
:root[data-theme="dark"] kbd { background: var(--theme-canvas); border-color: var(--theme-border); color: var(--theme-muted); }
:root[data-theme="dark"] .notice { background: var(--theme-accent-soft); color: var(--theme-accent-ink); border-color: var(--theme-border); }
:root[data-theme="dark"] .message-row { border-color: var(--theme-border); }
:root[data-theme="dark"] .message-row.unread .message-sender,
:root[data-theme="dark"] .message-row.unread .message-subject { color: var(--theme-ink); }
:root[data-theme="dark"] .message-avatar.telegram { background: var(--theme-accent-soft); color: var(--theme-accent-ink); }
:root[data-theme="dark"] .provider-pill,
:root[data-theme="dark"] .provider-pill.telegram,
:root[data-theme="dark"] .label-pill,
:root[data-theme="dark"] .label-pill.work,
:root[data-theme="dark"] .label-pill.work,
:root[data-theme="dark"] .label-pill.personal { background: var(--theme-accent-soft); color: var(--theme-secondary); }
:root[data-theme="dark"] .connections-dialog { background: var(--theme-surface); color: var(--theme-ink); }
:root[data-theme="dark"] .setup-note,
:root[data-theme="dark"] .catalog-footnote { background: #1e293b; color: var(--theme-secondary); }
:root[data-theme="dark"] .setup-note strong { color: var(--theme-ink); }
:root[data-theme="dark"] .setup-note code { color: var(--theme-secondary); }
:root[data-theme="dark"] .setup-note a { color: var(--palette-cloud); }
:root[data-theme="dark"] .small-button,
:root[data-theme="dark"] .docs-button,
:root[data-theme="dark"] .small-button:disabled { background: var(--theme-accent-soft); border-color: var(--theme-border); color: var(--palette-cloud); }
:root[data-theme="dark"] .sidebar-collapsed .nav-count { background: var(--theme-surface); color: var(--theme-secondary); }
:root[data-theme="dark"] { background: var(--theme-canvas); color: var(--theme-ink); }

/* Interaction and layout refinements */
:root {
  font-family: "Segoe UI", system-ui, sans-serif;
  --theme-focus: color-mix(in srgb, var(--theme-accent) 48%, transparent);
}

button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--theme-focus);
  outline-offset: 2px;
}
button:disabled { cursor: not-allowed; opacity: .58; }
.app-shell { min-height: 100dvh; }
.sidebar { width: 264px; flex-basis: 264px; padding: 22px 15px 15px; }
.workspace-label { margin-top: 32px; }
.inbox-section-label { margin-top: 25px; }
.main-nav { margin-top: 9px; }
.nav-item, .label-item { min-height: 40px; }
.nav-item { border-radius: 9px; }
.nav-item.active { box-shadow: inset 2px 0 0 var(--theme-accent); }
.nav-item:focus-visible { outline: 2px solid var(--theme-accent); outline-offset: 2px; }
.profile { min-width: 0; }
.profile-summary { min-width: 0; }
.profile-summary strong, .profile-summary small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-menu { width: 32px; height: 32px; border-radius: 7px; }
.mobile-team-nav { display: none; }
.profile-menu:hover, .icon-button:hover { background: var(--theme-accent-soft); color: var(--theme-accent-ink); }
.topbar { position: sticky; z-index: 4; top: 0; height: 66px; padding: 0 clamp(20px, 3.2vw, 46px); backdrop-filter: blur(14px); }
.topbar-actions { gap: 12px; }
.inbox { width: min(100%, 1140px); padding: 43px clamp(20px, 3.2vw, 46px) 28px; }
.inbox-heading { margin-bottom: 25px; }
.eyebrow { display: flex; align-items: center; gap: 8px; }
.eyebrow-dot { width: 7px; height: 7px; border-radius: 50%; background: #22a06b; box-shadow: 0 0 0 3px color-mix(in srgb, #22a06b 14%, transparent); }
.inbox-heading h1 { margin-top: 11px; font-size: clamp(25px, 3vw, 31px); letter-spacing: -1px; }
.inbox-heading p { font-size: 13px; line-height: 1.55; }
.primary-button { min-height: 40px; padding: 0 15px; border-radius: 9px; font-size: 12px; transition: background .15s, transform .15s; }
.primary-button:hover { transform: translateY(-1px); }
.team-button { min-height: 36px; border-radius: 8px; }
.toolbar { min-height: 68px; gap: 15px; padding: 12px 14px; border-radius: 12px 12px 0 0; }
.search-box { width: min(450px, 55%); height: 40px; gap: 10px; padding: 0 11px; border-radius: 8px; }
.search-box:focus-within { border-color: var(--theme-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--theme-accent) 12%, transparent); }
.search-box input { font-size: 12px; }
.search-icon { font-size: 21px; }
.clear-search { display: grid; width: 25px; height: 25px; flex: 0 0 auto; place-items: center; border: 0; border-radius: 50%; background: var(--theme-accent-soft); color: var(--theme-secondary); font-size: 17px; }
.toolbar-filters { gap: 9px; }
.filter-label { color: var(--theme-muted); font-size: 11px; }
.select-wrap select, .filter-button { height: 38px; border-radius: 8px; font-size: 11px; }
.filter-button { padding: 0 11px; }
.filter-button:disabled { opacity: .7; }
.refresh-button.is-refreshing > span:first-child { animation: inbox-spin .8s linear infinite; }
.active-filter-summary { padding: 9px 14px; border-right: 1px solid var(--theme-border); border-left: 1px solid var(--theme-border); background: var(--theme-canvas); color: var(--theme-secondary); font-size: 11px; }
.message-list { min-height: 330px; overflow: hidden; border-color: var(--theme-border); border-radius: 0 0 12px 12px; }
.message-row { gap: 15px; padding: 17px 18px; transition: background .14s; }
.message-row.unread { border-left: 3px solid #3b82f6; padding-left: 15px; }
.message-open { gap: 13px; min-width: 0; }
.message-avatar { width: 38px; height: 38px; border-radius: 12px; font-size: 13px; }
.message-topline { gap: 12px; }
.message-sender { font-size: 12px; }
.message-time { font-size: 10px; }
.message-subject { margin-top: 5px; font-size: 12px; }
.message-snippet { margin-top: 4px; font-size: 11px; line-height: 1.55; }
.message-meta { margin-top: 8px; }
.message-actions { gap: 7px; }
.message-actions select, .message-actions button { min-height: 34px; padding: 0 9px; border-radius: 7px; font-size: 10px; }
.inbox-footer { padding: 14px 3px; font-size: 10px; }
.privacy-lock { margin-right: 5px; color: var(--theme-muted); font-size: 9px; }
.empty-state { display: flex; min-height: 320px; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 36px 24px; }
.empty-state-icon { display: grid; width: 48px; height: 48px; margin-bottom: 4px; place-items: center; border: 1px solid var(--theme-border); border-radius: 15px; background: var(--theme-canvas); color: var(--theme-secondary); font-size: 22px; }
.empty-state strong { margin: 0; font-size: 14px; }
.empty-state p { max-width: 360px; margin: 0 0 6px; color: var(--theme-muted); font-size: 12px; line-height: 1.6; }
.empty-state .small-button { min-height: 36px; border-radius: 8px; font-size: 11px; }
.empty-state .primary-button { margin-top: 5px; }
.error-state .empty-state-icon { border-color: #f0c4c0; background: #fff1f0; color: #b74940; }
.loading { display: flex; min-height: 320px; align-items: center; justify-content: center; gap: 10px; font-size: 12px; }
.loading-spinner { width: 16px; height: 16px; border: 2px solid var(--theme-border); border-top-color: var(--theme-accent); border-radius: 50%; animation: inbox-spin .8s linear infinite; }
@keyframes inbox-spin { to { transform: rotate(360deg); } }
.auth-card { border-radius: 18px; box-shadow: 0 24px 70px #0f172a12; }
.auth-brand { margin-bottom: 24px; }
.demo-entry-button, .auth-tab, .auth-submit { min-height: 44px; border-radius: 9px; font-size: 12px; }
.auth-form label, .invite-form label { font-size: 11px; }
.auth-form input, .invite-form input { height: 44px; border-radius: 8px; font-size: 12px; }
.connections-dialog { border-radius: 16px; }
.help-tip { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-top: 1px solid var(--theme-border); }
.help-tip-icon { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border-radius: 10px; background: var(--theme-accent-soft); color: var(--theme-accent-ink); font-size: 16px; }
.help-tip > div { display: grid; flex: 1; gap: 4px; }
.help-tip strong { color: var(--theme-secondary); font-size: 11px; }
.help-tip span:not(.help-tip-icon) { color: var(--theme-muted); font-size: 10px; line-height: 1.5; }
.help-tip kbd { white-space: nowrap; }
.label-form > label { display: block; margin-bottom: 7px; color: var(--theme-secondary); font-size: 11px; font-weight: 650; }
.label-form > input { width: 100%; height: 42px; padding: 0 11px; border: 1px solid var(--theme-border); border-radius: 8px; background: var(--theme-input); color: var(--theme-ink); font-size: 12px; }
.label-form-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 17px; }
.label-form-actions .dialog-done { margin: 0; min-height: 38px; border-radius: 8px; font-size: 11px; }
.label-form-actions .secondary-button { min-height: 38px; border-radius: 8px; font-size: 11px; }
.notice { border-radius: 8px; line-height: 1.5; }
.notice.error { border: 1px solid #fecaca; }

:root[data-theme="dark"] .error-state .empty-state-icon { border-color: #693b3b; background: #422729; color: #ffb4ad; }
:root[data-theme="dark"] .empty-state-icon { border-color: var(--theme-border); background: #1e293b; }
:root[data-theme="dark"] .message-row.unread { border-left-color: #60a5fa; }
:root[data-theme="dark"] .auth-card { box-shadow: 0 24px 70px #0005; }
:root[data-theme="dark"] .label-form > input { border-color: var(--theme-border); background: var(--theme-input); color: var(--theme-ink); }

@media (max-width: 760px) {
  .sidebar { width: auto; flex: 0 0 auto; padding: 5px; box-shadow: 0 8px 30px #1720331a, 0 1px 3px #1720330d; }
  .main-nav { width: 100%; height: 100%; gap: 5px; margin: 0; }
  .nav-item, .nav-item:not(.active) { min-width: 0; min-height: 44px; height: 100%; }
  .nav-item.mobile-team-nav { display: flex; }
  .nav-item.active { box-shadow: none; }
  .topbar { height: 56px; padding: 0 15px; }
  .topbar-actions { gap: 10px; }
  .notification-button { width: 32px; height: 32px; }
  .notifications-dialog { inset: auto 0 0; width: 100%; max-width: none; max-height: 82dvh; margin: 0; padding: 18px 17px calc(16px + env(safe-area-inset-bottom)); border: 0; border-top: 1px solid var(--theme-border); border-radius: 18px 18px 0 0; }
  .notifications-list { max-height: 54dvh; }
  .team-button { display: none; }
  .help-button { display: grid; width: 32px; height: 32px; place-items: center; }
  .profile-button-label { display: none; }
  .topbar-avatar { width: 32px; height: 32px; }
  .inbox { padding: 26px 16px 18px; }
  .inbox-heading { align-items: flex-start; margin-bottom: 20px; }
  .inbox-heading h1 { font-size: 24px; }
  .toolbar { gap: 10px; padding: 10px; }
  .search-box { width: 100%; height: 42px; }
  .filter-label { display: none; }
  .toolbar-filters { justify-content: stretch; }
  .toolbar-filters .select-wrap { flex: 1; }
  .toolbar-filters .select-wrap select { width: 100%; }
  .toolbar-filters .filter-button { min-width: 38px; justify-content: center; }
  .refresh-button > span:last-child { display: none; }
  .message-list { min-height: 270px; }
  .loading, .empty-state { min-height: 270px; }
  .message-row { padding: 15px 13px; }
  .message-row.unread { padding-left: 10px; }
  .message-actions select, .message-actions button { min-height: 38px; }
  .inbox-footer { align-items: flex-start; }
  .inbox-footer > span:last-child { max-width: 48%; text-align: right; }
  .help-dialog, .label-dialog { max-height: 88dvh; }
}

@media (max-width: 380px) {
  .topbar { padding-right: 11px; padding-left: 11px; }
  .topbar-actions { gap: 7px; }
  .inbox { padding-right: 11px; padding-left: 11px; }
  .inbox-heading { align-items: center; }
  .inbox-heading h1 { font-size: 21px; }
  .inbox-heading p { max-width: 205px; font-size: 11px; }
  .inbox-heading .primary-button { min-height: 38px; padding: 0 10px; font-size: 10px; }
  .inbox-heading .primary-button span { display: inline; }
  .search-box kbd { display: none; }
  .filter-button { padding: 0 8px; }
  .setup-panel-heading { align-items: flex-start; flex-direction: column; }
}

.tour-overlay { position: fixed; z-index: 40; inset: 0; pointer-events: none; }
.tour-backdrop { position: fixed; inset: 0; background: transparent; pointer-events: auto; }
.tour-spotlight {
  position: fixed;
  z-index: 1;
  border: 2px solid #fff;
  border-radius: 12px;
  box-shadow: 0 0 0 9999px #0f172a9c, 0 0 0 5px #fff3, 0 6px 24px #0f172a33;
  pointer-events: auto;
  transition: left .18s ease, top .18s ease, width .18s ease, height .18s ease;
}
.tour-card {
  position: fixed;
  z-index: 2;
  width: min(360px, calc(100vw - 32px));
  padding: 19px 20px 16px;
  border: 1px solid var(--theme-border);
  border-radius: 14px;
  background: var(--theme-surface);
  color: var(--theme-ink);
  box-shadow: 0 18px 55px #0206174d;
  pointer-events: auto;
}
.tour-card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tour-kicker { color: var(--theme-muted); font-size: 9px; font-weight: 750; letter-spacing: 1.1px; }
.tour-progress { color: var(--theme-muted); font-size: 10px; font-weight: 650; }
.tour-progress-track { height: 4px; overflow: hidden; margin: 11px 0 16px; border-radius: 5px; background: var(--theme-border); }
.tour-progress-track > span { display: block; height: 100%; border-radius: inherit; background: #64748b; transition: width .2s ease; }
.tour-card h2 { margin: 0 0 7px; color: var(--theme-ink); font-size: 17px; letter-spacing: -.3px; }
.tour-card p { margin: 0; color: var(--theme-muted); font-size: 11px; line-height: 1.65; }
.tour-card-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; }
.tour-navigation { display: flex; align-items: center; gap: 7px; }
.tour-card button { min-height: 35px; padding: 0 11px; border: 1px solid var(--theme-border); border-radius: 7px; background: var(--theme-input); color: var(--theme-secondary); font-size: 10px; font-weight: 650; }
.tour-card .tour-skip { padding: 0; border-color: transparent; background: transparent; color: var(--theme-muted); }
.tour-card .tour-skip:hover, .tour-card .tour-back-button:hover { color: var(--theme-ink); }
.tour-card .tour-next-button { display: inline-flex; align-items: center; gap: 8px; border-color: var(--theme-accent); background: var(--theme-accent); color: #fff; }
.tour-card .tour-next-button:hover { background: var(--theme-accent-hover); }
.tour-card button:disabled { opacity: .4; }
.help-dialog-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; margin-top: 16px; }
.help-dialog-actions .dialog-done { margin: 0; min-height: 36px; border-radius: 7px; }
.help-dialog-actions .secondary-button { min-height: 36px; border-radius: 7px; font-size: 10px; }
:root[data-theme="dark"] .tour-card { border-color: #475569; }
:root[data-theme="dark"] .tour-card .tour-next-button { color: #f8fafc; }
@media (max-width: 760px) {
  .tour-card { width: auto; padding: 17px 17px 14px; }
  .tour-card-actions { margin-top: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

.auth-screen {
  display: grid;
  min-height: 100dvh;
  grid-template-columns: minmax(0, 1fr) minmax(430px, .82fr);
  align-items: stretch;
  gap: clamp(32px, 7vw, 112px);
  padding: clamp(28px, 5vw, 76px) clamp(28px, 7.5vw, 120px);
  background:
    radial-gradient(ellipse at 2% 5%, #e0eaf8 0, transparent 36%),
    var(--theme-canvas);
}
.auth-splash {
  display: flex;
  width: min(100%, 690px);
  flex-direction: column;
  justify-self: end;
  justify-content: center;
  gap: clamp(24px, 4vh, 38px);
  padding: 5px 0;
}
.splash-brand { align-self: flex-start; margin: 0; font-size: 19px; }
.splash-brand .brand-mark { width: 34px; height: 34px; border-radius: 11px; }
.splash-copy { max-width: 620px; }
.splash-eyebrow { display: flex; align-items: center; gap: 9px; color: #64748b; font-size: 10px; font-weight: 750; letter-spacing: 1.25px; }
.splash-eyebrow > span { width: 8px; height: 8px; border-radius: 50%; background: #10b981; box-shadow: 0 0 0 4px #10b98120; }
.splash-copy h1 { margin: 17px 0 14px; color: var(--theme-ink); font-size: clamp(38px, 4.5vw, 62px); font-weight: 750; line-height: 1.07; letter-spacing: -2.7px; }
.splash-copy h1 span { color: #475569; }
.splash-copy p { max-width: 475px; margin: 0; color: #64748b; font-size: 15px; line-height: 1.75; }
.splash-preview { width: min(100%, 520px); margin: 0; padding: 15px 17px 0; overflow: hidden; border: 1px solid #dbe3ec; border-radius: 15px; background: #fff; box-shadow: 0 18px 55px #0f172a10; transform: perspective(1000px) rotateY(3deg); }
.splash-preview-top { display: flex; align-items: center; gap: 10px; padding: 0 0 12px; border-bottom: 1px solid #eef2f6; }
.splash-preview-logo { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 9px; background: #334155; color: #fff; font-size: 13px; font-weight: 750; }
.splash-preview-top > span:nth-child(2) { display: grid; flex: 1; gap: 3px; }
.splash-preview-top strong { color: #1e293b; font-size: 11px; }
.splash-preview-top small { color: #94a3b8; font-size: 9px; }
.splash-preview-count { display: grid; width: 25px; height: 25px; place-items: center; border-radius: 8px; background: #f1f5f9; color: #475569; font-size: 10px; font-weight: 700; }
.splash-preview-row { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 11px 2px; border-bottom: 1px solid #f1f5f9; }
.splash-preview-avatar { display: grid; width: 32px; height: 32px; flex: 0 0 auto; place-items: center; border-radius: 11px; font-size: 11px; font-weight: 750; }
.avatar-coral { background: #fff1ed; color: #c46954; }
.avatar-blue { background: #eaf3ff; color: #4676ac; }
.avatar-violet { background: #f1edff; color: #735ab2; }
.splash-preview-message { display: grid; flex: 1; min-width: 0; gap: 3px; }
.splash-preview-message strong { color: #475569; font-size: 9px; }
.splash-preview-message b { overflow: hidden; color: #1e293b; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.splash-preview-message small { overflow: hidden; color: #94a3b8; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.splash-preview-provider { display: grid; width: 23px; height: 23px; flex: 0 0 auto; place-items: center; border-radius: 7px; font-size: 10px; font-weight: 750; }
.gmail-mark { background: #fff1f0; color: #d35f57; }
.chat-mark { background: #eaf6fc; color: #318bb9; }
.splash-preview figcaption { padding: 10px 0 12px; color: #64748b; font-size: 9px; }
.splash-benefits { display: flex; flex-wrap: wrap; gap: 10px 22px; color: #64748b; font-size: 10px; }
.splash-benefits span { display: inline-flex; align-items: center; gap: 7px; }
.splash-benefits b { display: grid; width: 18px; height: 18px; place-items: center; border-radius: 50%; background: #dcfce7; color: #15803d; font-size: 10px; }
.auth-card {
  align-self: center;
  width: min(100%, 520px);
  max-width: 520px;
  justify-self: start;
  padding: clamp(24px, 3.2vw, 40px);
  border-color: color-mix(in srgb, var(--theme-border) 75%, transparent);
  border-radius: 19px;
  box-shadow: 0 25px 80px #0f172a12, 0 2px 8px #0f172a05;
}
.auth-card-top { display: flex; min-height: 34px; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 23px; }
.auth-mobile-brand { display: flex; min-width: 0; flex-direction: column; gap: 7px; }
.auth-card .auth-brand { display: none; margin: 0; font-size: 15px; }
.auth-card-caption { color: var(--theme-muted); font-size: 9px; font-weight: 750; letter-spacing: 1.1px; }
.auth-card-top .install-app-button { flex: 0 0 auto; min-height: 34px; border-radius: 8px; font-size: 10px; }
.auth-separator { display: flex; align-items: center; gap: 12px; margin: 16px 0; color: var(--theme-muted); font-size: 8px; font-weight: 700; letter-spacing: .9px; }
.auth-separator::before, .auth-separator::after { height: 1px; flex: 1; background: var(--theme-border); content: ""; }
.demo-entry-button { min-height: 45px; gap: 10px; margin: 0; padding: 0 13px; border-radius: 9px; background: var(--theme-canvas); text-align: left; transition: background .15s, border-color .15s; }
.demo-entry-button:hover { border-color: var(--theme-muted); background: var(--theme-accent-soft); }
.demo-play-icon { display: grid; width: 26px; height: 26px; flex: 0 0 auto; place-items: center; border-radius: 8px; background: var(--theme-accent-soft); color: var(--theme-accent-ink); font-size: 9px; }
.demo-entry-button > span:nth-child(2) { flex: 1; }
.demo-entry-arrow { color: var(--theme-muted); font-size: 15px; }
.auth-tabs { margin: 0 0 23px; padding: 4px; border: 1px solid var(--theme-border); border-radius: 10px; }
.auth-tab { min-height: 40px; border-radius: 7px; font-size: 11px; }
.auth-form h1, .auth-form h2 { margin: 0 0 7px; font-size: 25px; letter-spacing: -.7px; }
.auth-form > p { margin: 0 0 21px; font-size: 12px; line-height: 1.55; }
.auth-form label { gap: 7px; margin-top: 16px; font-size: 11px; font-weight: 650; }
.auth-form input { height: 45px; padding: 0 12px; border-radius: 9px; font-size: 12px; }
.auth-form input::placeholder { color: #a0a9b7; }
.auth-form input:focus-visible { outline: 0; border-color: var(--theme-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--theme-accent) 15%, transparent); }
.password-field { position: relative; display: flex; min-width: 0; align-items: center; }
.password-field input { padding-right: 68px; }
.password-visibility { position: absolute; right: 7px; min-width: 48px; min-height: 32px; padding: 0 7px; border: 0; border-radius: 6px; background: transparent; color: var(--theme-secondary); font-size: 10px; font-weight: 650; }
.password-visibility:hover { background: var(--theme-accent-soft); color: var(--theme-accent-ink); }
.auth-submit { justify-content: space-between; min-height: 47px; height: auto; margin-top: 21px; padding: 0 15px; border-radius: 9px; font-size: 12px; }
.auth-submit > span:last-child { font-size: 16px; }
.auth-submit[aria-busy="true"] { cursor: progress; }
.signup-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.signup-fields label { min-width: 0; }
.password-strength { height: 4px; overflow: hidden; margin-top: 9px; border-radius: 4px; background: var(--theme-border); }
.password-strength > span { display: block; width: 0; height: 100%; border-radius: inherit; background: #ef4444; transition: width .2s ease, background .2s ease; }
.password-strength > span[data-strength="1"] { width: 34%; background: #ef4444; }
.password-strength > span[data-strength="2"] { width: 68%; background: #eab308; }
.password-strength > span[data-strength="3"] { width: 100%; background: #22a06b; }
.password-hint { display: block; margin-top: 6px; font-size: 10px; line-height: 1.5; }
.verification-hint { display: flex; align-items: flex-start; gap: 7px; margin-top: 13px; color: var(--theme-muted); font-size: 10px; line-height: 1.5; }
.verification-hint > span { color: var(--theme-secondary); }
.auth-footer { display: flex; align-items: flex-start; justify-content: center; gap: 7px; margin-top: 23px; padding-top: 15px; font-size: 10px; line-height: 1.6; }
.auth-footer > span { color: var(--theme-muted); }
.auth-error { margin-bottom: 14px; padding: 11px 12px; border: 1px solid #fecaca !important; border-radius: 9px; font-size: 11px; }
.auth-status { border-radius: 9px; font-size: 11px; }
.auth-status button { min-height: 36px; border-radius: 8px; }
.invite-banner { padding: 12px; border: 1px solid var(--theme-border); border-radius: 9px; line-height: 1.5; }
:root[data-theme="dark"] .auth-screen { background: radial-gradient(ellipse at 2% 5%, #1e293b 0, transparent 38%), var(--theme-canvas); }
:root[data-theme="dark"] .splash-copy h1 span { color: #cbd5e1; }
:root[data-theme="dark"] .splash-eyebrow,
:root[data-theme="dark"] .splash-copy p,
:root[data-theme="dark"] .splash-benefits { color: #aeb8c7; }
:root[data-theme="dark"] .splash-preview { border-color: #334155; background: #f8fafc; }
:root[data-theme="dark"] .auth-card { box-shadow: 0 25px 80px #0005, 0 2px 8px #0002; }

@media (max-width: 760px) {
  :root .sidebar {
    border-color: color-mix(in srgb, var(--theme-border) 82%, transparent);
    background: color-mix(in srgb, var(--theme-surface) 92%, transparent);
  }
  :root .nav-item.active,
  :root .nav-item.active:hover { background: var(--theme-accent-soft); color: var(--theme-accent-ink); }
  :root .nav-item.active .nav-icon { color: var(--theme-accent-ink); }
  :root .nav-item:focus-visible { outline: 2px solid var(--theme-accent); outline-offset: 1px; }
  :root .nav-count { border-color: var(--theme-surface); }
}

@media (max-width: 1050px) {
  .auth-screen { grid-template-columns: minmax(0, 1fr) minmax(390px, .9fr); gap: 36px; padding-right: 38px; padding-left: 38px; }
  .splash-copy h1 { font-size: clamp(38px, 5vw, 51px); }
  .splash-preview { transform: none; }
}
@media (max-width: 760px) {
  .auth-screen { grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 23px; padding: 28px 18px 32px; }
  .auth-splash { width: min(100%, 520px); gap: 18px; padding: 0; }
  .splash-brand { display: none; }
  .splash-copy h1 { margin: 10px 0 8px; font-size: clamp(31px, 8vw, 43px); letter-spacing: -1.7px; }
  .splash-copy p { font-size: 13px; line-height: 1.6; }
  .splash-preview { display: none; }
  .splash-benefits { gap: 8px 17px; font-size: 9px; }
  .splash-benefits b { width: 16px; height: 16px; }
  .auth-card { justify-self: center; width: min(100%, 520px); padding: 24px; }
  .auth-card .auth-brand { display: flex; }
  .auth-card-top { align-items: center; margin-bottom: 20px; }
}
@media (max-width: 460px) {
  .auth-screen { gap: 18px; padding: 22px 14px 26px; }
  .splash-eyebrow { font-size: 8px; letter-spacing: .9px; }
  .splash-copy h1 { font-size: 32px; }
  .splash-copy p { max-width: 370px; font-size: 12px; }
  .splash-benefits { flex-direction: column; gap: 7px; }
  .auth-card { padding: 20px 17px; border-radius: 15px; }
  .auth-form h1, .auth-form h2 { font-size: 22px; }
  .signup-fields { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .auth-separator { font-size: 7px; letter-spacing: .6px; }
}
