:root{--bg:#f5f6f7;--surface:#fff;--surface2:#f0f2f4;--text:#101317;--muted:#68707a;--line:#e3e6e9;--dark:#0d1117;--accent:#111820;--good:#0f7a4d;--warn:#a25d00;--danger:#b42318;--shadow:0 10px 30px rgba(16,19,23,.07);--radius:18px}*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;background:var(--bg);color:var(--text);font-family:Inter,ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;-webkit-font-smoothing:antialiased}a{color:inherit;text-decoration:none}button,input,textarea,select{font:inherit}button{cursor:pointer}.topbar{position:sticky;top:0;z-index:40;background:rgba(255,255,255,.94);backdrop-filter:blur(14px);border-bottom:1px solid var(--line);padding-top:env(safe-area-inset-top)}.topbar-inner{max-width:1180px;margin:auto;height:68px;padding:0 22px;display:flex;align-items:center;justify-content:space-between}.brand{display:flex;gap:11px;align-items:center}.brand strong{display:block;font-size:15px;line-height:1.1}.brand small{display:block;color:var(--muted);font-size:12px;margin-top:3px}.brand-mark{width:48px;height:48px;border-radius:15px;background:var(--dark);color:#fff;display:grid;place-items:center;font-weight:800;letter-spacing:.04em}.brand-mark.small{width:36px;height:36px;border-radius:11px;font-size:12px}.top-actions{display:flex;gap:8px}.icon-btn{width:40px;height:40px;border-radius:12px;display:grid;place-items:center;background:var(--surface2);font-size:18px}.page-shell{max-width:1180px;margin:auto;padding:34px 22px 120px}.page-shell.narrow{max-width:860px}.hero-row,.lead-header{display:flex;align-items:flex-end;justify-content:space-between;gap:18px;margin-bottom:26px}.hero-row h1,.lead-header h1{font-size:clamp(30px,5vw,48px);line-height:1;letter-spacing:-.04em;margin:0 0 10px}.hero-row p{margin:0;color:var(--muted);font-size:15px}.eyebrow{text-transform:uppercase;letter-spacing:.14em;font-size:11px;font-weight:800;color:var(--muted);margin-bottom:10px}.stats-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-bottom:18px}.stat-card{background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:18px;transition:.18s ease}.stat-card:hover,.stat-card.active{border-color:#aeb5bc;box-shadow:var(--shadow)}.stat-card span{display:block;font-size:12px;color:var(--muted);font-weight:700}.stat-card strong{display:block;font-size:30px;margin-top:10px;letter-spacing:-.04em}.research-history-card{background:var(--surface);border:1px solid var(--line);border-radius:18px;padding:18px;margin:0 0 14px}.research-history-head{display:flex;align-items:flex-end;justify-content:space-between;gap:14px;margin-bottom:12px}.research-history-head strong{display:block;font-size:15px}.research-history-head>span{font-size:11px;color:var(--muted);font-weight:800}.research-runs{display:grid;gap:8px}.research-run-row{display:grid;grid-template-columns:100px minmax(0,1fr) auto;gap:14px;align-items:center;padding:11px 12px;border:1px solid #edf0f2;border-radius:12px;background:#fafbfb}.research-run-row>div:first-child strong,.research-run-row>div:first-child span{display:block}.research-run-row>div:first-child strong{font-size:12px}.research-run-row>div:first-child span{font-size:10px;color:var(--muted);margin-top:3px}.research-run-metrics{display:flex;flex-wrap:wrap;gap:7px}.research-run-metrics span{font-size:10px;color:var(--muted);background:#eef1f4;border-radius:999px;padding:5px 8px}.research-run-metrics b{color:var(--text);font-size:11px}.research-run-ids{font-size:10px;color:var(--muted);white-space:nowrap}.bulk-send-panel{display:flex;align-items:center;justify-content:space-between;gap:16px;background:var(--dark);color:#fff;border-radius:16px;padding:16px 18px;margin-bottom:14px}.bulk-send-panel strong{display:block;font-size:15px}.bulk-send-panel span{display:block;margin-top:4px;font-size:12px;color:#cfd4da}.bulk-send-panel .btn-primary{background:#fff;color:var(--dark);white-space:nowrap}.toolbar{background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:12px;margin-bottom:14px}.search-form{display:flex;gap:8px}.search-form input{flex:1}.filter-scroll{display:flex;gap:7px;overflow:auto;padding-top:10px;scrollbar-width:none}.filter-scroll::-webkit-scrollbar{display:none}.filter-pill{white-space:nowrap;padding:8px 11px;border-radius:999px;background:var(--surface2);font-size:12px;font-weight:700;color:var(--muted)}.filter-pill.active{background:var(--dark);color:#fff}.lead-list{display:grid;gap:10px}.lead-card{background:var(--surface);border:1px solid var(--line);border-radius:18px;overflow:hidden}.lead-main{display:block;padding:20px}.lead-top{display:flex;justify-content:space-between;align-items:flex-start;gap:14px}.lead-top h2{margin:0 0 6px;font-size:18px;letter-spacing:-.02em}.lead-meta{font-size:13px;color:var(--muted);word-break:break-word}.lead-reason{margin:15px 0 10px;color:#343a41;line-height:1.55;font-size:14px;max-width:800px}.lead-subject{font-size:12px;color:var(--muted);font-weight:600}.status-badge{display:inline-flex;align-items:center;padding:7px 10px;border-radius:999px;font-size:11px;font-weight:800;white-space:nowrap;background:var(--surface2);color:#434a52}.status-approved{background:#fff4df;color:#8b5200}.status-sent{background:#e8f5ef;color:#0b6b43}.status-replied{background:#e7efff;color:#264f9c}.status-rejected,.status-failed{background:#ffeded;color:#9f2018}.quick-actions{border-top:1px solid var(--line);padding:10px 14px}.quick-actions form{display:flex;justify-content:flex-end;gap:8px}.btn{border:0;border-radius:12px;padding:11px 15px;font-weight:800;font-size:13px;display:inline-flex;align-items:center;justify-content:center;min-height:42px}.btn-primary{background:var(--dark);color:#fff}.btn-secondary{background:var(--surface2);color:var(--text);border:1px solid var(--line)}.btn-ghost{background:transparent;border:1px solid var(--line);color:var(--text)}.btn-ghost.danger{color:var(--danger)}.btn-lg{min-height:50px;padding:13px 18px}.btn-full{width:100%}.grow{flex:1}.fab{display:none;position:fixed;right:20px;bottom:calc(22px + env(safe-area-inset-bottom));width:58px;height:58px;border-radius:18px;background:var(--dark);color:#fff;font-size:30px;align-items:center;justify-content:center;box-shadow:0 16px 36px rgba(13,17,23,.24);z-index:35}.panel{background:var(--surface);border:1px solid var(--line);border-radius:18px;padding:22px;margin-bottom:14px}.panel-title,.section-title{font-size:12px;text-transform:uppercase;letter-spacing:.12em;font-weight:900;color:var(--muted);margin-bottom:16px}.top-gap{margin-top:28px}.detail-grid{display:grid;grid-template-columns:1fr;gap:0}.form-stack{display:grid;gap:15px}.form-grid{display:grid;gap:12px}.form-grid.two{grid-template-columns:repeat(2,minmax(0,1fr))}.span-two{grid-column:span 2}label{display:grid;gap:7px;font-size:12px;font-weight:800;color:#454b52}input,textarea,select{width:100%;border:1px solid #d7dce0;background:#fff;color:var(--text);border-radius:12px;padding:12px 13px;outline:none;transition:.16s ease}input:focus,textarea:focus,select:focus{border-color:#8c959f;box-shadow:0 0 0 3px rgba(13,17,23,.06)}textarea{resize:vertical;line-height:1.5}.email-editor{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:13px}.text-link{display:inline-block;color:#3d596f;font-size:13px;word-break:break-all}.back-link{font-weight:800;font-size:14px}.sticky-actionbar{position:sticky;bottom:0;padding:11px 0 calc(11px + env(safe-area-inset-bottom));background:linear-gradient(to top,var(--bg) 78%,transparent);z-index:25}.action-form{display:flex;gap:9px;background:var(--surface);border:1px solid var(--line);padding:10px;border-radius:16px;box-shadow:0 12px 35px rgba(16,19,23,.1)}.alert{border-radius:13px;padding:12px 14px;margin:0 0 14px;font-size:13px;font-weight:700}.alert-success{background:#e8f5ef;color:#0b6b43}.alert-error{background:#ffeded;color:#9f2018}.alert-info{background:#e7efff;color:#264f9c}.empty-state{padding:60px 20px;text-align:center;background:var(--surface);border:1px solid var(--line);border-radius:18px}.empty-icon{width:54px;height:54px;margin:auto;border-radius:18px;background:var(--surface2);display:grid;place-items:center;font-size:24px}.empty-state h2{margin:15px 0 6px}.empty-state p{margin:0;color:var(--muted)}.auth-body{min-height:100dvh;background:#eceff1;display:grid;place-items:center;padding:22px}.auth-shell{width:min(100%,430px)}.install-shell{width:min(100%,820px);padding:24px 0}.auth-card{background:#fff;border:1px solid var(--line);border-radius:24px;padding:28px;box-shadow:var(--shadow)}.auth-card h1{font-size:28px;letter-spacing:-.04em;margin:17px 0 6px}.auth-card .muted,.muted{color:var(--muted);line-height:1.5}.details-box{border:1px solid var(--line);border-radius:14px;background:#fafbfb}.details-box summary{cursor:pointer;padding:14px;font-size:13px;font-weight:800}.details-content{padding:0 14px 14px}.code-box{border:1px solid var(--line);background:#f7f8f9;border-radius:12px;padding:13px;font:12px/1.55 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;word-break:break-all;white-space:pre-wrap}.scroll-code{overflow:auto;max-height:360px}.install-card{width:100%}
@media(max-width:760px){.topbar-inner{height:60px;padding:0 15px}.page-shell{padding:24px 14px 110px}.hero-row{align-items:flex-start}.hero-row h1,.lead-header h1{font-size:34px}.desktop-only{display:none}.fab{display:flex}.stats-grid{grid-template-columns:repeat(2,1fr);gap:8px}.stat-card{padding:14px}.stat-card strong{font-size:25px}.research-history-card{padding:14px}.research-history-head{align-items:flex-start}.research-run-row{grid-template-columns:72px minmax(0,1fr);gap:10px}.research-run-ids{grid-column:1/-1;white-space:normal}.research-run-metrics{gap:5px}.bulk-send-panel{display:grid;padding:14px}.bulk-send-panel form,.bulk-send-panel .btn{width:100%}.toolbar{padding:9px}.search-form{display:grid;grid-template-columns:1fr auto}.search-form input{min-width:0}.lead-main{padding:16px}.lead-top{display:grid;gap:9px}.status-badge{justify-self:start}.lead-reason{font-size:13px;margin-top:12px}.quick-actions form{display:grid;grid-template-columns:1fr 1fr}.form-grid.two{grid-template-columns:1fr}.span-two{grid-column:auto}.panel{padding:16px;border-radius:16px}.auth-body{padding:14px}.auth-card{padding:22px;border-radius:20px}.action-form .btn{min-height:48px}.sticky-actionbar{bottom:0}.lead-header{margin-bottom:18px}}
@media(max-width:390px){.page-shell{padding-left:11px;padding-right:11px}.stats-grid{grid-template-columns:1fr 1fr}.stat-card span{font-size:11px}.stat-card strong{font-size:23px}.btn{padding-left:12px;padding-right:12px}.search-form{grid-template-columns:1fr}.search-form .btn{display:none}}

.bulk-schedule-panel{background:var(--surface);border:1px solid var(--line);border-radius:18px;padding:18px;margin:0 0 14px;box-shadow:var(--shadow)}.bulk-schedule-panel.active{border-color:#b8c0c8}.bulk-schedule-head{display:flex;align-items:center;justify-content:space-between;gap:16px}.bulk-schedule-head strong,.bulk-schedule-copy strong{display:block;font-size:17px;letter-spacing:-.02em}.bulk-schedule-head span,.bulk-schedule-copy span{display:block;margin-top:5px;font-size:12px;color:var(--muted)}.bulk-schedule-form{display:grid;grid-template-columns:1.2fr .8fr .8fr .8fr .8fr auto;gap:10px;align-items:end;margin-top:14px}.bulk-schedule-form label{min-width:0}.bulk-schedule-form .btn{white-space:nowrap}@media(max-width:900px){.bulk-schedule-form{grid-template-columns:repeat(3,1fr)}.bulk-schedule-form .btn{grid-column:1/-1}}@media(max-width:760px){.bulk-schedule-panel{padding:14px}.bulk-schedule-head{display:grid}.bulk-schedule-head form,.bulk-schedule-head .btn{width:100%}.bulk-schedule-form{grid-template-columns:1fr 1fr}.bulk-schedule-form .btn{grid-column:1/-1}}@media(max-width:430px){.bulk-schedule-form{grid-template-columns:1fr}.bulk-schedule-form .btn{grid-column:auto}}

.research-history-collapsible{padding:0;overflow:hidden}.research-history-collapsible summary{list-style:none}.research-history-collapsible summary::-webkit-details-marker{display:none}.research-history-toggle{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:16px 18px;cursor:pointer}.research-history-toggle .eyebrow{margin-bottom:5px}.research-history-toggle strong{display:block;font-size:14px}.research-history-toggle>span{font-size:11px;color:var(--muted);font-weight:800;white-space:nowrap}.research-history-toggle .chevron{display:inline-block;margin-left:5px;transition:transform .18s ease}.research-history-collapsible[open] .research-history-toggle .chevron{transform:rotate(180deg)}.research-history-collapsible .research-runs{padding:0 18px 18px}

.bulk-schedule-simple{padding:18px}.bulk-schedule-simple-form{display:grid;gap:14px;margin-top:16px}.schedule-date{max-width:250px}.slot-picker{display:grid;gap:8px}.slot-label{font-size:12px;font-weight:800;color:#454b52}.slot-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}.slot-btn{border:1px solid var(--line);background:#f8f9fa;color:var(--text);border-radius:14px;padding:13px 14px;text-align:left;transition:.16s ease}.slot-btn:hover{border-color:#b8c0c8}.slot-btn.active{background:var(--dark);color:#fff;border-color:var(--dark)}.slot-btn strong{display:block;font-size:14px}.slot-btn small{display:block;margin-top:4px;font-size:11px;color:var(--muted)}.slot-btn.active small{color:#cfd4da}.schedule-footer{display:flex;align-items:center;justify-content:space-between;gap:14px;padding-top:2px}.schedule-summary{font-size:12px;color:var(--muted);font-weight:700}.schedule-advanced{border-top:1px solid var(--line);padding-top:10px}.schedule-advanced summary{cursor:pointer;font-size:12px;font-weight:800;color:var(--muted);width:max-content}.schedule-advanced-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-top:12px}

@media(max-width:760px){.research-history-toggle{padding:14px}.research-history-collapsible .research-runs{padding:0 14px 14px}.slot-grid{grid-template-columns:1fr}.slot-btn{text-align:center}.schedule-date{max-width:none}.schedule-footer{display:grid}.schedule-footer .btn{width:100%}.schedule-advanced-grid{grid-template-columns:1fr 1fr}}
@media(max-width:430px){.schedule-advanced-grid{grid-template-columns:1fr}}

.stat-card.stat-scheduled{position:relative}.stat-card.stat-scheduled span:first-child:before{content:"";display:inline-block;width:7px;height:7px;border-radius:50%;background:#7a5b00;margin-right:7px;vertical-align:1px}.status-scheduled{background:#fff4d6;color:#775500}.bulk-schedule-panel.active{background:linear-gradient(180deg,#fff,#fbfcfd)}.bulk-schedule-panel.active .bulk-schedule-head>div{min-width:0;flex:1}.bulk-schedule-panel.active .bulk-schedule-head small{display:block;margin-top:7px;color:var(--muted);font-size:11px}.bulk-schedule-panel.active .bulk-schedule-head span b{color:var(--text)}.schedule-progress{height:7px;background:#eceff1;border-radius:999px;overflow:hidden;margin-top:12px;max-width:520px}.schedule-progress>span{display:block;height:100%;background:var(--dark);border-radius:999px}.filter-pill[href*="scheduled"].active{background:#6c5200;color:#fff}

.followup-panel{background:var(--surface);border:1px solid var(--line);border-radius:18px;padding:18px;margin:0 0 14px}.followup-head{display:flex;align-items:flex-start;justify-content:space-between;gap:18px}.followup-head h2{margin:0;font-size:20px;letter-spacing:-.03em}.followup-head p{margin:6px 0 0;color:var(--muted);font-size:12px;line-height:1.5}.followup-counts{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}.followup-counts span{background:var(--surface2);border-radius:999px;padding:8px 10px;font-size:11px;color:var(--muted);white-space:nowrap}.followup-counts b{color:var(--text);font-size:13px}.followup-action-row,.followup-run-state{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-top:14px;padding:13px 14px;background:#f8f9fa;border:1px solid var(--line);border-radius:14px}.followup-action-row>span,.followup-run-state span{font-size:12px;color:var(--muted)}.followup-run-state strong{display:block;font-size:13px;margin-bottom:4px}.followup-empty{margin-top:14px;color:var(--muted);font-size:12px}.followup-schedule-form{display:grid;grid-template-columns:220px minmax(0,1fr) auto;gap:10px;align-items:end;margin-top:14px;padding-top:14px;border-top:1px solid var(--line)}.followup-slot-group{display:flex;gap:7px}.mini-slot{border:1px solid var(--line);background:var(--surface2);color:var(--text);border-radius:10px;padding:10px 11px;font-size:11px;font-weight:800;white-space:nowrap}.mini-slot.active{background:var(--dark);border-color:var(--dark);color:#fff}.followup-note{font-size:11px;color:var(--warn);margin-top:9px}.followup-schedule-form button:disabled{opacity:.45;cursor:not-allowed}
@media(max-width:760px){.followup-head{display:grid}.followup-counts{justify-content:flex-start}.followup-action-row,.followup-run-state{display:grid}.followup-action-row .btn,.followup-run-state .btn{width:100%}.followup-schedule-form{grid-template-columns:1fr}.followup-slot-group{display:grid;grid-template-columns:repeat(3,1fr)}.mini-slot{white-space:normal;padding:10px 7px}.followup-schedule-form>.btn{width:100%}}

.mailbox-health-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin:12px 0}.mailbox-health-grid>div{background:var(--surface2);border:1px solid var(--line);border-radius:12px;padding:11px}.mailbox-health-grid span{display:block;font-size:10px;color:var(--muted);font-weight:800;text-transform:uppercase;letter-spacing:.06em}.mailbox-health-grid strong{display:block;margin-top:5px;font-size:12px;word-break:break-word}@media(max-width:760px){.mailbox-health-grid{grid-template-columns:1fr 1fr}}


/* Automatic business-hour queue */
.schedule-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap;justify-content:flex-end}.schedule-actions form{margin:0}.one-click-queue-form{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-top:14px;padding-top:14px;border-top:1px solid var(--line)}.automatic-slot-note,.followup-auto-slot{display:grid;gap:4px;min-width:0}.automatic-slot-note b,.followup-auto-slot strong{font-size:13px}.automatic-slot-note span,.followup-auto-slot span{font-size:11px;color:var(--muted);line-height:1.45}.followup-schedule-form{grid-template-columns:minmax(0,1fr) auto}
@media(max-width:760px){.schedule-actions{display:grid;grid-template-columns:1fr;width:100%}.schedule-actions form,.schedule-actions .btn{width:100%}.one-click-queue-form{display:grid}.one-click-queue-form .btn{width:100%}.followup-schedule-form{grid-template-columns:1fr}.followup-schedule-form>.btn{width:100%}}
