:root{font-family:Arial,sans-serif;color:#182d40;background:#f4f6f8;font-size:16px;--line:#e1e7ec;--blue:#1d5484;--muted:#617181}
*{box-sizing:border-box}
body{margin:0}
header{padding:22px 4%;background:#142b43;color:#fff;display:flex;justify-content:space-between;align-items:center;gap:20px}
header a{color:#cbd8e5;text-decoration:none;font-size:14px}
h1{font-size:26px;margin:8px 0 0}
h2{font-size:20px;margin:0 0 16px}
h3{font-size:17px;margin:24px 0 12px}
main{max-width:1550px;margin:auto;padding:24px 4% 60px;min-width:0}
.account{display:flex;align-items:center;gap:14px}
.panel{background:#fff;border:1px solid var(--line);border-radius:12px;padding:20px;margin-top:18px;min-width:0}
.filters{display:flex;flex-wrap:wrap;gap:12px;align-items:end}
.primary-filters{margin-top:18px}
.search-filter{flex:1;min-width:180px}
.search-filter input{max-width:none;width:100%}
label{font-size:13px;color:#526478;display:flex;flex-direction:column;gap:7px}
input,select,textarea,button{font:inherit;font-size:14px;border:1px solid #bbc7d2;border-radius:7px;padding:10px;background:#fff;color:#182d40}
input,select{max-width:220px;min-height:42px}
button{cursor:pointer;min-height:42px}
button:hover{background:#edf3f8}
button:disabled{opacity:.45;cursor:default}
button[type=submit],form>button:first-of-type{background:var(--blue);color:#fff;border-color:var(--blue)}
button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,summary:focus-visible,a:focus-visible{outline:3px solid #8bb2d5;outline-offset:3px}
textarea{width:100%;min-height:90px}
.muted,small{color:var(--muted);font-size:13px;line-height:1.5}
small{display:block;margin-top:5px}
details{margin-top:16px;border-top:1px solid var(--line);padding-top:16px}
details.panel{padding-top:20px}
summary{cursor:pointer;font-size:14px;font-weight:600;width:fit-content;max-width:100%}
details[open]>summary{margin-bottom:16px}
.report-nav,.periods{display:flex;gap:8px;flex-wrap:wrap}
.report-nav [aria-pressed=true],.periods [aria-pressed=true]{background:var(--blue);border-color:var(--blue);color:#fff}
.report-nav{margin-bottom:18px}
.periods button{min-height:34px;padding:7px 13px;font-size:13px}
.filter-panel{margin-top:0}
.chips{display:flex;flex-wrap:wrap;gap:8px}
.chips:empty{display:none}
.chips button{margin-top:14px;background:#eef4fa;border:0;min-height:30px;padding:6px 10px;font-size:13px}
.chips span{margin-left:10px;color:#546e86}
.section-caption,.section-heading{display:flex;justify-content:space-between;align-items:center;gap:16px;flex-wrap:wrap}
.section-caption{font-size:13px;color:var(--muted);margin-top:22px}
.section-caption p{margin:0;font-weight:600;color:#273f55}
.section-heading{margin-bottom:14px}
.section-heading h2{margin:0}
.section-caption span{font-size:12px}
.totals{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:10px;margin-top:12px}
.totals>div,.totals>button{padding:16px;background:#fff;border:1px solid var(--line);border-radius:10px;text-align:left;font-size:13px;color:#50667a;min-width:0}
.totals strong{display:block;font-size:28px;font-weight:600;color:#182d40;margin-top:10px}
.totals button:hover,.totals button[aria-pressed=true]{border-color:var(--blue);background:#eef5fb}
.diagnostics{margin-top:14px;display:flex;align-items:center;gap:12px;flex-wrap:wrap;font-size:13px;color:var(--muted)}
.diagnostics button{font-size:12px;border:0;padding:4px 0;min-height:28px;background:transparent;color:#526b80;text-decoration:underline;text-underline-offset:4px}
.diagnostics button:first-child{color:#8a5d1f}
.table-wrap{overflow:auto;width:100%;max-width:100%}
table{border-collapse:collapse;width:100%;font-size:14px;text-align:left}
th,td{padding:15px 12px;border-bottom:1px solid #e9edf1;vertical-align:top;min-width:105px}
th{font-size:12px;font-weight:500;color:#657687;background:#f8fafb;white-space:nowrap}
th:first-child,td:first-child{padding-left:10px}
tr:last-child td{border-bottom:0}
td button{border:0;background:transparent;padding:0;min-height:28px;color:#165c94;text-align:left;font-weight:600}
td small{overflow-wrap:anywhere}
td:first-child{min-width:160px}
td button:hover{text-decoration:underline;background:transparent}
.inquiries-table td{vertical-align:middle}
.inquiries-table td:nth-child(1){width:19%}
.inquiries-table td:nth-child(2){width:23%}
.inquiries-table td:nth-child(3){width:25%}
.request-text{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere;max-width:320px;line-height:1.45}
.route{line-height:1.5}
.route small{margin-top:4px}
.quality{display:inline-block;padding:5px 8px;border-radius:6px;background:#f0f3f6;font-size:12px;white-space:nowrap}
.quality.target{background:#e8f4ed;color:#246541}
.quality.engaged{background:#eaf1fb;color:#355e8c}
.quality.spam,.quality.non_target{color:#7c625e}
.count{color:var(--muted);font-weight:400;margin-left:6px}
.warning{color:#91641d}
.pager{display:flex;gap:20px;justify-content:center;align-items:center;margin-top:18px;font-size:13px}
#error,#report-error{color:#a32232;white-space:pre-wrap}
#error:empty{display:none}
dialog{width:min(860px,96vw);max-height:90vh;border:0;border-radius:14px;padding:24px}
dialog::backdrop{background:#10203999}
.dialog-head{display:flex;justify-content:space-between;align-items:start;gap:20px}
.dialog-head h2{font-size:19px;line-height:1.4}
.dialog-head button{flex-shrink:0}
.event,.message,.comment,.source-proof{border:1px solid var(--line);border-radius:8px;padding:14px;margin:10px 0;overflow-wrap:anywhere}
.source-proof{background:#f3f7fb;border:0;line-height:1.5}
.source-proof p{margin:8px 0}
.source-proof blockquote{border-left:3px solid #9bb4cb;margin:12px 0 0;padding-left:12px;font-size:14px}
.message p,.comment p{white-space:pre-wrap;font-size:14px;line-height:1.55}
.message.out{background:#f3f6fa}
.event dl{display:grid;grid-template-columns:150px 1fr;gap:8px;font-size:13px}
.event dd{margin:0;overflow-wrap:anywhere}
#review-form,#comment-form{display:grid;gap:12px}
#review-form button,#comment-form button{justify-self:start}
#account-list>div{padding:12px 0;display:flex;gap:15px;align-items:center;flex-wrap:wrap}
#login form{display:grid;gap:15px;max-width:340px}
.report-columns{display:grid;grid-template-columns:1fr 1fr;gap:24px}
.report-columns>div{min-width:0}
.report-columns td{min-width:0;overflow-wrap:anywhere}
#report-totals{margin-bottom:20px}
#report-export{padding:10px;color:#165c94}
.time-match{padding:12px;border-left:3px solid #9bb4cb;background:#f3f7fb;font-size:14px;line-height:1.5}
.time-match small{color:#526478}
[hidden]{display:none!important}
@media(max-width:1050px){.totals{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media(max-width:650px){header{align-items:start;padding:18px 16px}
h1{font-size:22px}
.account{flex-direction:column;gap:8px;align-items:end;font-size:13px}
.account button{min-height:32px;padding:6px 12px}
main{padding:16px 12px 40px}
.panel{padding:16px}
.totals{grid-template-columns:repeat(2,minmax(0,1fr))}
.totals>div,.totals>button{padding:14px}
.totals strong{font-size:26px}
.filters>label{flex:1 1 140px;min-width:0}
.filters input,.filters select{width:100%;max-width:100%}
.primary-filters>button{flex:1}
.report-nav button{flex:1;font-size:13px}
.section-heading .muted{font-size:12px}
.event dl{grid-template-columns:1fr}
.event dt{font-weight:600}
dialog{padding:16px}
.dialog-head{gap:10px}
.report-columns{grid-template-columns:1fr}
#report-crm-totals strong,#report-totals strong{font-size:24px}
.pager{gap:12px}
.pager button{padding:8px 12px}
.inquiries-table{min-width:760px}
.periods{gap:6px}
.periods button{flex:1;padding:7px 8px}
.section-caption{gap:6px}
.diagnostics{column-gap:14px;row-gap:4px}
}


.site-funnel{display:grid;gap:12px;max-width:620px;margin:20px 0}.site-funnel>div{display:grid;grid-template-columns:1fr auto;gap:6px 16px}.site-funnel progress{grid-column:1/-1;width:100%;height:14px;accent-color:#b09154}#review-form input[type=checkbox]{width:auto;min-height:0}
