/* Lead Desk inspired visual system: deep navy, clear status colors, and compact work surfaces. */
:root {
  --ink: #10263e;
  --muted: #64788d;
  --violet: #1768ae;
  --violet-dark: #0e568f;
  --line: #dce5ed;
  --paper: #f2f6f9;
  --white: #fff;
  --navy: #0b243e;
  --radius: 16px;
  color: var(--ink);
  background: var(--paper);
}

body { background: var(--paper); }
.ambient { display: none; }
.eyebrow { color: #268fbd; font-size: 10px; letter-spacing: .19em; }
.brand-lockup { color: var(--navy); letter-spacing: -.06em; }
.brand-symbol { background: #168ab5; box-shadow: 0 8px 22px #0c7db346; border-radius: 10px; }
.brand-dot { color: #2bc4b6; }

/* Entry screen */
.auth-shell { max-width: none; min-height: 100vh; grid-template-columns: minmax(0, 1.08fr) minmax(450px, .92fr); gap: 0; padding: 0; }
.auth-intro {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; flex-direction: column; justify-content: center;
  min-height: 100vh; max-width: none; padding: clamp(50px, 7vw, 112px);
  background: radial-gradient(circle at 85% 12%, #1b668b 0, transparent 32%), linear-gradient(145deg, #0b243e, #102e4c 70%, #133c59);
  color: #f5fbff;
}
.auth-intro::before, .auth-intro::after { content: ""; position: absolute; pointer-events: none; z-index: -1; border: 1px solid #ffffff18; border-radius: 50%; }
.auth-intro::before { width: 660px; height: 660px; right: -330px; bottom: -310px; }
.auth-intro::after { width: 390px; height: 390px; right: -180px; bottom: -180px; }
.auth-intro .brand-lockup { color: #fff; margin: 0 0 auto; }
.auth-intro .eyebrow { color: #71d5ce; margin-top: 9vh; }
.auth-intro h1 { max-width: 660px; font-size: clamp(48px, 5.5vw, 80px); line-height: 1.02; letter-spacing: -.075em; font-weight: 760; }
.auth-intro h1 em { color: #8de5dc; }
.auth-intro .lead { color: #b7cddd; font-size: 18px; max-width: 470px; margin-bottom: 32px; }
.auth-intro .feature-line { color: #d9e8f1; font-size: 13px; margin: 12px 0; }
.feature-icon { background: #ffffff17; color: #83ded7; border: 1px solid #ffffff19; }
.local-file-notice { margin-top: 30px; padding: 15px 18px; max-width: 475px; border: 1px solid #8de5dc66; border-radius: 12px; color: #e9ffff; background: #0b263aab; font-size: 13px; line-height: 1.6; }
.local-file-notice a { color: #8de5dc; font-weight: 750; overflow-wrap: anywhere; }
.auth-card { width: min(450px, calc(100% - 68px)); padding: 44px; margin: auto; background: #fff; border: 1px solid #dde7ee; border-radius: 20px; box-shadow: 0 28px 70px #12324a1a; }
.card-orb { background: radial-gradient(circle, #c8ebed6e, transparent 70%); }
.auth-icon { color: #1475a4; background: #e6f5f7; border-color: #cfeced; }
.auth-card h2 { color: #10263e; }
.auth-card .muted { color: #6c7e91; }
.auth-footnote { color: #8294a4; }

/* Application shell */
.app-shell { grid-template-columns: 256px minmax(0, 1fr); background: #f2f6f9; }
.sidebar { background: #0c263f; border-right: 1px solid #193e59; padding: 28px 15px 20px; box-shadow: 6px 0 28px #102d4510; }
.sidebar-brand { color: #f7fbff; margin-bottom: 38px; }
.workspace-switch { background: #ffffff0d; border-color: #ffffff18; color: #e8f5fb; margin-bottom: 38px; }
.workspace-avatar { background: #1982a8; color: white; }
.workspace-switch small, .workspace-chevron { color: #8bb2c8; }
.nav-heading { color: #7099b1; }
.nav-item { color: #a5c1d3; border: 1px solid transparent; font-size: 13px; min-height: 43px; }
.nav-item:hover { color: #fff; background: #ffffff10; transform: translateX(2px); }
.nav-item.active { color: #fff; background: #2475a64d; border-color: #58b9d03b; box-shadow: inset 3px 0 #65d7d0; }
.nav-icon { color: #77bbd2; }
.nav-item.active .nav-icon { color: #88e7da; }
.privacy-note { background: #0d3850; border-color: #2c6476; color: #baf2e8; }
.privacy-note small { color: #8bbbc0; }
.logout-button { color: #9fb9c9; }
.logout-button:hover { color: #fff; background: #ffffff12; }
.topbar { height: 72px; border-bottom-color: #e2e9ee; background: #fff; }
.topbar-label { color: #6b8195; }
.topbar-context { color: #173c59; }
.status-pill { background: #eaf7f5; color: #247f70; border-color: #c9ebe4; }
.status-pill i { background: #28ae91; }
.user-avatar { color: #0d6592; background: #dff1f6; }
.content { padding-top: 42px; }
.page-heading h1 { font-size: clamp(34px, 3.3vw, 48px); color: #10263e; }
.page-heading h1 em, .heading-period { color: #1585ad; }
.page-heading p:last-child { color: #6d8294; font-size: 14px; }
.role-badge { color: #176b8c; background: #e5f4f6; border-color: #cce8ec; }

/* Overview */
.hero-card { min-height: 280px; border: 1px solid #1b5470; border-radius: 18px; background: radial-gradient(circle at 78% 20%, #206b83 0, transparent 38%), linear-gradient(125deg, #0b263f 10%, #113c59 100%); box-shadow: 0 18px 36px #0b2a4433; }
.hero-card::before { width: 620px; height: 620px; right: -120px; top: -210px; border-color: #ffffff13; }
.hero-copy { padding: 39px 44px; }
.hero-kicker { color: #8fe5db; }
.hero-kicker-dot { background: #61dfce; }
.hero-copy h2 { font-size: clamp(32px, 3vw, 43px); }
.hero-copy h2 em { color: #9ae9e0; }
.hero-copy p { color: #c5dae7; font-size: 13px; max-width: 430px; }
.hero-art { opacity: .93; }
.hero-ring { border-color: #ffffff1b; }
.hero-center { background: #ffffff13; border: 1px solid #ffffff25; border-radius: 22px; box-shadow: 0 15px 30px #08203655; color: #9be6db; }
.floating-mail { color: #176f8e; border: 1px solid #daeff0; box-shadow: 0 12px 34px #061e3655; }
.floating-mail > span { color: #23435a; }
.stat-grid { gap: 14px; }
.stat-card, .step-card { border-color: #dce6ed; border-radius: 15px; box-shadow: 0 3px 12px #15354c08; }
.stat-card { min-height: 153px; padding: 22px; }
.stat-card:hover, .step-card:hover { box-shadow: 0 16px 28px #123a5218; }
.stat-card strong { color: #102b43; font-size: 32px; }
.stat-card > span:not(.stat-icon) { color: #536d80; font-size: 12px; }
.stat-card small { color: #8da2b2; }
.stat-icon.violet, .step-visual.purple { background: #e2f1fb; color: #1578b4; }
.stat-icon.coral, .step-visual.peach { background: #fff0e4; color: #da8750; }
.stat-icon.mint, .step-visual.blue { background: #e1f7ef; color: #229b7b; }
.section-title h2, .card-heading h2 { color: #14334c; }
.step-card { min-height: 170px; }
.step-card strong { font-size: 13px; color: #1d3b52; }
.step-card small { color: #7890a1; font-size: 11px; }
.step-arrow { color: #4e97b2; }

/* Work areas and controls */
.surface-card, .mailbox-list, .message-list { border: 1px solid #dce6ed; border-radius: 16px; box-shadow: 0 4px 17px #14354c0a; }
.inbox-toolbar { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; margin: 6px 0 16px; }
.inbox-toolbar label { display: grid; gap: 6px; color: #45657a; font-size: 11px; font-weight: 760; }
.inbox-toolbar select, .inbox-toolbar input { min-height: 42px; min-width: 170px; border: 1px solid #cddce7; border-radius: 9px; padding: 0 12px; background: #fff; color: #173a52; }
.inbox-toolbar input { width: min(320px, 72vw); }
.inbox-toolbar input:focus, .inbox-toolbar select:focus { border-color: #2e93bd; box-shadow: 0 0 0 4px #2e93bd20; outline: none; }
.inbox-result-count { margin-left: auto; padding-bottom: 11px; color: #70889a; font-size: 12px; font-weight: 650; }
.filter-field { display: grid; gap: 6px; color: #45657a; font-size: 11px; font-weight: 760; }
.multi-filter { position: relative; min-width: 250px; }
.multi-filter summary { min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid #cddce7; border-radius: 9px; padding: 0 12px; background: #fff; color: #173a52; cursor: pointer; list-style: none; }
.multi-filter summary::-webkit-details-marker { display: none; }
.multi-filter summary::after { content: "⌄"; color: #668397; font-size: 14px; }
.multi-filter[open] summary { border-color: #2e93bd; box-shadow: 0 0 0 4px #2e93bd20; }
.multi-filter-options { position: absolute; z-index: 8; top: calc(100% + 6px); left: 0; min-width: 100%; padding: 8px; border: 1px solid #cddce7; border-radius: 10px; background: #fff; box-shadow: 0 14px 35px #0d30472b; }
.inbox-toolbar .multi-filter-options label { display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 9px; border-radius: 7px; color: #294b61; cursor: pointer; white-space: nowrap; }
.inbox-toolbar .multi-filter-options label:hover { background: #eef6fa; }
.inbox-toolbar .multi-filter-options input { width: 16px; min-width: 16px; min-height: 16px; margin: 0; accent-color: #2e7bdc; }
.load-more { display: flex; margin: 0 auto 26px; }
.surface-card.narrow { max-width: 750px; }
.form-stack label, .inline-form label, .field-label { color: #37546b; }
.form-stack input, .form-stack select, .inline-form input, .inline-form select, .invite-result input, #alert-mailbox { border-color: #cddce7; background: #fbfdfe; color: #193a53; }
.form-stack input:focus, .form-stack select:focus, .inline-form input:focus, .inline-form select:focus, #alert-mailbox:focus { border-color: #2e93bd; box-shadow: 0 0 0 4px #2e93bd20; }
.button { border-radius: 9px; transition: transform .18s ease, box-shadow .18s ease, background .18s ease; }
.button-primary { background: #176caa; box-shadow: 0 7px 16px #176caa2a; }
.button-primary:hover:not(:disabled) { background: #0d588f; box-shadow: 0 10px 20px #176caa36; }
.button-secondary { background: #e8f1f8; color: #155d8e; border-color: #d3e6f2; }
.button-light { color: #124b72; }
.text-button { color: #176caa; }
.mailbox-row, .sender-row, .message-row, .team-row { border-bottom-color: #e8eef2; padding: 18px 0; }
.mailbox-row strong, .sender-row strong, .message-row strong, .team-row strong { color: #183a53; font-size: 13px; }
.mailbox-row { flex-wrap: wrap; }
.mailbox-start { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; width: 100%; padding-left: 46px; }
.mailbox-start label { color: #46677c; font-size: 11px; font-weight: 700; }
.mailbox-start input { display: block; width: 220px; max-width: 100%; margin-top: 6px; padding: 9px 11px; border: 1px solid #dceaf3; border-radius: 9px; background: #f8fbfd; color: #183a53; }
.mailbox-start small { width: 100%; }
.work-health { margin: 8px 0 28px; padding: 13px 16px; border: 1px solid #dceaf3; border-radius: 12px; background: #f4f9fc; color: #3b627d; font-size: 12px; line-height: 1.5; }
.work-health.warning { border-color: #eed5bb; background: #fff9f1; color: #935e2e; }
.work-section { margin: 26px 0 34px; }
.work-list { display: grid; gap: 15px; }
.work-thread { border: 1px solid #e2ebf1; border-radius: 17px; background: #fff; box-shadow: 0 10px 28px #16304b0a; overflow: hidden; }
.work-thread-title { padding: 13px 18px; background: #f7fafc; border-bottom: 1px solid #e8eef2; color: #4f6e82; font-size: 11px; font-weight: 750; }
.work-card { padding: 19px 20px; border-bottom: 1px solid #edf2f5; }
.work-card:last-child { border-bottom: 0; }
.work-result { display: block; color: #153b55; font-size: 16px; line-height: 1.4; }
.work-context { color: #49677a; font-size: 13px; line-height: 1.55; margin: 8px 0 11px; }
.work-facts { display: flex; gap: 7px 14px; flex-wrap: wrap; color: #71899a; font-size: 11px; }
.work-facts span { padding: 4px 0; }
.work-facts .work-urgent { color: #b44652; font-weight: 800; }
.work-facts .work-vip { color: #7b59af; font-weight: 800; }
.work-reason { display: block; color: #597a8f; margin-top: 8px; }
.work-source { margin-top: 12px; color: #355d78; font-size: 11px; }
.work-source summary { cursor: pointer; font-weight: 700; }
.work-source p { background: #f7fafc; padding: 12px; border-radius: 9px; line-height: 1.6; white-space: pre-wrap; }
.work-buttons, .settings-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.monitoring-list { display: grid; gap: 10px; }
.monitoring-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 0; border-bottom: 1px solid #e8eef2; }
.monitoring-row:last-child { border-bottom: 0; }
.monitoring-row > div { display: grid; gap: 4px; }
.monitoring-row small { color: #7890a1; }
.history-scan-row { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 18px; padding: 15px 10px; border: 0; border-bottom: 1px solid #e8eef2; background: transparent; color: #183a53; text-align: left; cursor: pointer; }
.history-scan-row:hover { background: #f4f9fc; }
.history-scan-row small { color: #7890a1; }
.history-scan-row .scan-running { color: #087b92; font-weight: 700; }
.history-scan-row .scan-running::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; background: #11a9c2; box-shadow: 0 0 0 0 rgba(17, 169, 194, .45); animation: scan-pulse 1.4s ease-out infinite; }
@keyframes scan-pulse { 70% { box-shadow: 0 0 0 8px rgba(17, 169, 194, 0); } 100% { box-shadow: 0 0 0 0 rgba(17, 169, 194, 0); } }
.work-related { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-top: 12px; padding: 11px 12px; border: 1px solid #cfe4ef; border-radius: 10px; background: #f3f9fc; color: #476b80; font-size: 11px; }
.work-related strong { color: #176f9e; }
.project-card { overflow: hidden; border: 1px solid #dce8ef; border-radius: 18px; background: #fff; box-shadow: 0 12px 32px #16304b0d; }
.project-card.project-high { border-color: #efc1c6; box-shadow: 0 12px 34px #a92f3d14; }
.project-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 20px 22px 16px; }
.project-header-actions { display: flex; flex: none; align-items: center; gap: 8px; }
.project-toggle { padding: 7px 10px; border: 1px solid #c9dbe5; border-radius: 8px; background: #fff; color: #315f78; font-size: 10px; font-weight: 850; cursor: pointer; transition: border-color .18s ease, background .18s ease, color .18s ease; }
.project-toggle:hover, .project-toggle:focus-visible { border-color: #2681a9; background: #f1f8fb; color: #176c95; outline: none; }
.project-details[hidden] { display: none; }
.project-card.project-collapsed .project-header { padding-bottom: 12px; }
.project-card.project-collapsed .project-progress { margin-bottom: 18px; }
.project-title { min-width: 0; }
.project-kicker { display: block; margin-bottom: 5px; color: #7890a1; font-size: 9px; font-weight: 850; letter-spacing: .11em; }
.project-title h3 { margin: 0; color: #153b55; font-size: 18px; line-height: 1.3; }
.project-title small { display: block; margin-top: 7px; color: #7890a1; font-size: 11px; }
.project-priority { flex: none; padding: 7px 10px; border-radius: 8px; background: #edf3f6; color: #587489; font-size: 10px; font-weight: 850; }
.project-priority.priority-high { background: #ffe7e9; color: #a92f3d; border: 1px solid #f1b5bc; }
.project-progress { height: 5px; margin: 0 22px; overflow: hidden; border-radius: 99px; background: #edf3f6; }
.project-progress-fill { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #28a7be, #176caa); transition: width .25s ease; }
.project-next { display: grid; gap: 4px; margin: 16px 22px; padding: 13px 15px; border: 1px solid #cfe5ef; border-radius: 11px; background: #f2f9fc; }
.project-high .project-next { border-color: #f0c9ce; background: #fff5f6; }
.project-next span { color: #247b9e; font-size: 9px; font-weight: 900; letter-spacing: .1em; }
.project-high .project-next span { color: #a92f3d; }
.project-next strong { color: #163b54; font-size: 13px; line-height: 1.45; }
.project-next small { color: #8a6570; font-size: 10px; }
.project-checklist { border-top: 1px solid #e8eef2; }
.project-task { display: flex; align-items: flex-start; gap: 13px; padding: 17px 22px; border-bottom: 1px solid #edf2f5; transition: background .18s ease; }
.project-task:last-child { border-bottom: 0; }
.project-task.next-task { background: #fbfdfe; }
.project-task.completed { background: #f8fafb; }
.task-check { width: 23px; height: 23px; flex: none; display: grid; place-items: center; margin-top: 1px; border: 2px solid #9eb9c9; border-radius: 7px; background: #fff; color: #fff; font-size: 13px; font-weight: 900; cursor: pointer; }
.task-check:hover { border-color: #287fa9; box-shadow: 0 0 0 4px #2e93bd18; }
.project-task.completed .task-check { border-color: #2a9a75; background: #2a9a75; }
.task-body { min-width: 0; flex: 1; }
.task-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.task-top strong { color: #173b54; font-size: 13px; line-height: 1.45; }
.project-task.completed .task-top strong { color: #77909f; text-decoration: line-through; }
.task-priority { flex: none; padding: 4px 7px; border-radius: 6px; background: #edf3f6; color: #6c8391; font-size: 9px; font-weight: 850; }
.task-priority.priority-high { background: #ffe7e9; color: #a92f3d; }
.task-body > p { margin: 5px 0 8px; color: #5b7688; font-size: 11px; line-height: 1.5; }
.task-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: #8196a4; font-size: 10px; }
.task-meta .task-waiting { color: #a46e25; font-weight: 800; }
.task-meta .task-done { color: #27815f; font-weight: 800; }
.task-source { margin-top: 8px; color: #53758a; font-size: 10px; }
.task-source summary { cursor: pointer; font-weight: 750; }
.task-source p { padding: 10px; border-radius: 8px; background: #f5f8fa; white-space: pre-wrap; }
.task-controls { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
@media (max-width: 650px) { .project-header, .task-top { align-items: flex-start; flex-direction: column; } .project-header-actions { width: 100%; justify-content: space-between; } .project-task { padding: 15px; } .project-next, .project-progress { margin-left: 15px; margin-right: 15px; } }
.connect-choice { display: flex; align-items: flex-start; gap: 10px; margin: 14px 0; line-height: 1.5; }
.connect-choice input { width: auto; margin-top: 4px; }
.work-completed { margin: 34px 0; color: #49677a; }
.work-completed summary { cursor: pointer; font-size: 13px; font-weight: 750; margin-bottom: 14px; }
.mailbox-row small, .sender-row small, .message-row small, .team-row small { color: #7890a1; font-size: 11px; }
.mailbox-icon, .team-avatar { background: #e4f2f8; color: #1477a5; }
.small-pill { background: #edf2f6; color: #6b8091; border-radius: 7px; }
.small-pill.admin { background: #e5eff9; color: #2363a2; }
.small-pill.active { background: #e2f7ed; color: #187e5c; }
.small-pill.disabled { background: #fff0e8; color: #b75d29; }
.small-pill.priority-high { background: #ffe7e9; color: #a92f3d; border: 1px solid #f1b5bc; font-weight: 850; }
.small-pill.priority-normal { background: #e8f1fa; color: #286d9d; }
.small-pill.priority-low { background: #edf3f5; color: #698391; }
.small-pill.category-action { background: #e5f4fb; color: #176f9e; }
.small-pill.category-update { background: #edf3f5; color: #6b8290; }
.small-pill.category-review { background: #fff3e4; color: #ab6e1f; }
.message-meta { display: flex; align-items: center; gap: 8px; min-width: 0; }
.message-meta .small-pill { flex: none; }
.message-meta .mini-button { margin-left: 4px; }
.message-row.message-row-high { margin: 0 -14px; padding-left: 14px; padding-right: 14px; border-left: 4px solid #c83e4d; background: linear-gradient(90deg, #fff1f2 0%, #ffffff 42%); }
.message-row.message-row-high:hover { background: linear-gradient(90deg, #ffe8eb 0%, #fbfdff 48%); }
.priority-callout { display: block; width: fit-content; margin-bottom: 6px; color: #ad3240; font-size: 9px; font-weight: 900; letter-spacing: .09em; }
.mini-button { background: #f2f8fc; color: #175f91; border-color: #dceaf3; }
.mini-button:hover { background: #e4f2fa; }
.mini-button.danger { color: #aa4a57; background: #fff5f5; border-color: #f1d9dd; }
.empty-state .empty-icon { background: #e8f4f8; color: #207fa5; }
.invite-result { background: #f0f8fb; border-color: #d7eaf0; }
.invite-result > span { color: #176c91; }
.toast { background: #113951; border-radius: 10px; }
.action-dialog { border-color: #d6e4ec; }
.action-dialog::backdrop { background: #0b243e99; }
.action-dialog select { width: 100%; min-height: 44px; border: 1px solid #cddce7; border-radius: 9px; padding: 0 12px; margin: 0 0 15px; background: #fff; color: #173a52; }

.inbox-ai-layout { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 20px; align-items: start; }
.inbox-ai-chat { padding: 0; overflow: hidden; }
.inbox-ai-chatbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 15px 20px; border-bottom: 1px solid #e2ebf0; background: #fff; }
.inbox-ai-chatbar > div:first-child { display: grid; gap: 2px; }
.inbox-ai-chatbar span { color: #7890a1; font-size: 10px; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; }
.inbox-ai-chatbar strong { max-width: 520px; overflow: hidden; color: #183a53; text-overflow: ellipsis; white-space: nowrap; }
.inbox-ai-chatbar > div:last-child { display: flex; gap: 7px; }
.inbox-ai-messages { min-height: 390px; max-height: 64vh; overflow-y: auto; padding: 24px; background: linear-gradient(180deg, #f8fcfe 0%, #fff 30%); }
.ai-message { display: flex; gap: 12px; max-width: 92%; margin: 0 0 18px; line-height: 1.55; }
.ai-message p { margin: 5px 0 0; }
.ai-message-icon { display: grid; flex: 0 0 34px; width: 34px; height: 34px; place-items: center; border-radius: 11px; background: #0f789b; color: #fff; box-shadow: 0 7px 18px #0f789b2b; }
.ai-message-user { width: fit-content; margin-left: auto; padding: 12px 16px; border-radius: 16px 16px 4px 16px; background: #123d59; color: #fff; }
.ai-message-assistant > div { flex: 1; padding: 14px 16px; border: 1px solid #dce9ef; border-radius: 4px 16px 16px; background: #fff; box-shadow: 0 8px 22px #173a520a; }
.ai-loading .ai-message-icon { animation: scan-pulse 1.4s ease-out infinite; }
.ai-error > div { border-color: #efc9cd; background: #fff7f8; color: #a13b49; }
.ai-answer-body > strong { display: block; font-size: 17px; color: #143c56; }
.ai-answer-body h3 { margin: 18px 0 7px; font-size: 13px; letter-spacing: .05em; text-transform: uppercase; color: #658294; }
.ai-finding-list, .ai-action-list { display: grid; gap: 8px; margin: 0; padding-left: 21px; }
.ai-citations { display: inline-flex; gap: 4px; }
.ai-citation { display: inline-grid; min-width: 24px; height: 22px; place-items: center; border-radius: 6px; background: #e7f6fa; color: #087b92; font-size: 11px; font-weight: 800; text-decoration: none; }
.ai-missing { margin-top: 18px !important; padding: 11px 13px; border-radius: 9px; background: #fff8e8; color: #755816; }
.ai-source-list { margin-top: 18px; border-top: 1px solid #e4edf2; padding-top: 12px; }
.ai-source-list summary { color: #176c91; font-weight: 800; cursor: pointer; }
.ai-source-row { display: grid; grid-template-columns: 28px 1fr; gap: 10px; margin-top: 10px; padding: 11px; border: 1px solid #e1ebf0; border-radius: 10px; color: #183a53; text-decoration: none; }
.ai-source-row:hover { border-color: #8cc9d8; background: #f7fcfd; }
.ai-source-row strong, .ai-source-row small { display: block; }
.ai-source-row small { margin-top: 2px; color: #6f899a; }
.ai-source-row p { margin: 5px 0 0; color: #526f81; font-size: 12px; }
.ai-source-number { display: grid; width: 27px; height: 27px; place-items: center; border-radius: 8px; background: #e7f6fa; color: #087b92; font-weight: 900; }
.inbox-ai-composer { padding: 20px 24px 24px; border-top: 1px solid #e2ebf0; background: #fff; }
.inbox-ai-composer label { display: block; margin: 0 0 6px; font-size: 12px; font-weight: 800; color: #4f6d80; }
.inbox-ai-composer select { margin-bottom: 13px; }
.inbox-ai-composer textarea { width: 100%; resize: vertical; }
.inbox-ai-submit { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 12px; }
.inbox-ai-submit small { max-width: 520px; color: #6c8595; }
.inbox-ai-examples { display: grid; gap: 9px; }
.inbox-ai-history { display: grid; gap: 6px; max-height: 260px; overflow-y: auto; }
.inbox-ai-history-row { display: grid; gap: 3px; width: 100%; padding: 10px 11px; border: 1px solid transparent; border-radius: 9px; background: #f6fafc; color: #244d66; text-align: left; cursor: pointer; }
.inbox-ai-history-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-ai-history-row small { color: #7d94a3; }
.inbox-ai-history-row:hover, .inbox-ai-history-row.active { border-color: #7cc3d2; background: #eaf8fb; }
.inbox-ai-history-empty { margin: 0; padding: 12px; border-radius: 9px; background: #f6fafc; color: #7890a1; font-size: 12px; text-align: center; }
.inbox-ai-example-heading { display: grid; gap: 2px; margin-top: 12px; padding-top: 14px; border-top: 1px solid #e3edf1; }
.inbox-ai-example-heading small { color: #7890a1; }
.inbox-ai-examples > button { width: 100%; padding: 12px 13px; border: 1px solid #d9e7ed; border-radius: 10px; background: #f8fbfc; color: #1a506e; text-align: left; font: inherit; font-weight: 800; cursor: pointer; }
.inbox-ai-examples > button:hover { border-color: #73bfd1; background: #edf9fb; transform: translateY(-1px); }
.inbox-ai-privacy { display: flex; gap: 9px; margin-top: 9px; padding: 13px; border-radius: 11px; background: #edf8f4; color: #35685b; font-size: 12px; }
.inbox-ai-privacy p { margin: 0; }

@media (max-width: 800px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-intro { min-height: auto; padding: 42px 28px 48px; }
  .auth-intro .brand-lockup { margin: 0 0 58px; }
  .auth-intro .eyebrow { margin-top: 0; }
  .auth-intro h1 { font-size: clamp(38px, 8vw, 54px); }
  .auth-intro .lead { margin-bottom: 0; }
  .auth-intro .feature-line { display: none; }
  .auth-card { margin: 26px auto 50px; }
  .sidebar { position: sticky; top: 0; z-index: 5; background: #0c263f; border-bottom-color: #24516b; }
  .sidebar-brand { display: none; }
  .nav-item { color: #bdd3df; min-height: 44px; }
  .nav-item.active { background: #2784ae56; }
  .hero-art { display: none; }
  .inbox-ai-layout { grid-template-columns: 1fr; }
  .inbox-ai-examples { order: -1; }
}

@media (max-width: 560px) {
  .auth-card { width: calc(100% - 32px); padding: 28px; margin-top: 18px; }
  .content { padding: 27px 17px 55px; }
  .topbar { padding: 0 17px; }
  .page-heading h1 { font-size: 33px; }
  .hero-copy { padding: 29px 26px; }
  .hero-copy h2 { font-size: 32px; }
  .message-row, .mailbox-row { align-items: flex-start; flex-wrap: wrap; }
  .message-meta, .mailbox-row .row-actions { width: 100%; justify-content: flex-start; flex-wrap: wrap; }
  .sidebar { padding: 11px 12px; }
  .inbox-toolbar label, .inbox-toolbar select, .inbox-toolbar input { width: 100%; }
  .filter-field, .multi-filter { width: 100%; }
  .inbox-result-count { margin-left: 0; width: 100%; padding-bottom: 0; }
  .mini-button, .text-button, .logout-button { min-height: 44px; }
  .monitoring-row, .history-scan-row { align-items: flex-start; flex-direction: column; }
  input, select, textarea { font-size: 16px; }
  .inbox-ai-messages { min-height: 310px; padding: 16px; }
  .inbox-ai-submit { align-items: stretch; flex-direction: column; }
  .inbox-ai-submit .button { width: 100%; }
  .inbox-ai-chatbar { align-items: flex-start; flex-direction: column; }
  .inbox-ai-chatbar > div:last-child { width: 100%; }
  .inbox-ai-chatbar .mini-button { flex: 1; }
}
