.header-links{display:flex;align-items:center;gap:6px}
/* Reserve a usable editor; never clip fields on short or zoomed viewports. */
#composeView{overflow:auto}
#compose{overflow:visible;flex:1 0 auto}
.messagearea{min-height:100px}
#quickBcc{height:36px;min-height:36px;max-height:36px;resize:none;line-height:20px;overflow:auto}
.senderrow label{min-width:0}
@media(max-width:650px){
 header{display:grid;grid-template-columns:1fr 1fr 32px;gap:5px!important;padding:6px 10px!important;height:auto!important;min-height:0}
 header .header-actions{display:contents}
 header .brand{grid-column:1;grid-row:1;font-size:17px;gap:6px}
 header .brandmark{width:26px;height:26px}
 header #accountAction{grid-column:2/4;grid-row:1;justify-self:end;padding:6px 8px!important;min-height:30px;font-size:11px!important}
 header #setupGuide{grid-column:1;grid-row:2}
 header #privacyBtn{grid-column:3;grid-row:2;width:32px;height:32px}
 header #adminBell{grid-column:3;grid-row:3}
 header .secondary{min-height:32px;padding:5px 8px;font-size:12px;gap:4px}
 .tabs{height:39px;padding:4px 8px;gap:4px}
 .tab{min-width:0;padding:4px;font-size:11px;gap:4px}
 .tab>span{display:none}
 .readybar{height:32px;padding:2px 10px;gap:5px;flex-shrink:0}
 .ready-state{font-size:10px;white-space:nowrap}
 .connect-first{font-size:10px;padding:5px 7px;min-height:27px;gap:3px;white-space:nowrap}
 .viewhead{height:30px;padding:5px 10px}
 h1{font-size:16px}
 .senderrow{grid-template-columns:repeat(2,minmax(0,1fr));padding:0 10px 6px;gap:6px 8px}
 .senderrow label:first-child{grid-column:auto}
 .senderrow label:last-child{grid-column:1/-1;display:grid;grid-template-columns:auto 1fr;align-items:center;gap:8px}
 .senderrow label:last-child small{display:none}
 #compose label{font-size:11px;line-height:16px}
 #compose input{font-size:16px;height:34px;min-width:0;margin-top:2px;padding:5px 7px;font-weight:normal}
 #quickBcc{font:16px/22px Tahoma,sans-serif;margin:0;padding:5px 7px;height:34px;min-height:34px;max-height:34px}
 .fieldline{padding:0 10px 6px}
 .messagearea,.editorbar{margin-left:10px;margin-right:10px}
 .messagearea textarea{font-size:16px;padding:8px;line-height:1.4}
 .editorbar{height:30px;padding:0 7px}
 .editorbar .textbtn{min-height:28px;font-size:11px}
 .sendfooter{height:48px;padding:5px 10px;gap:6px}
 .sendfooter .primary{min-height:38px;padding:6px 12px;font-size:13px;gap:10px}
 .connection{font-size:11px;max-width:45%;overflow-wrap:anywhere}
 .framefoot{height:22px;padding:0 10px;display:flex}
 #fileList{padding:0 10px;max-height:36px}
 #identityActions{padding:0 10px 4px;flex-wrap:wrap;gap:4px}
 .notice{padding:4px 10px;max-height:40px}
}

/* Keep the cross-site action in the same two mobile header rows. */
header #emailExtractor{display:inline-flex;text-decoration:none;white-space:nowrap;background:linear-gradient(#ffe49b,#f5b846);border-color:#b67812;color:#302000;box-shadow:inset 0 1px 0 #fff8;font-weight:700}
header #emailExtractor:hover{background:linear-gradient(#fff0bf,#ffcb64)}
@media(max-width:650px){
 header{grid-template-columns:repeat(3,minmax(0,1fr))}
 header #accountAction{grid-column:2/4;margin-right:38px}
 header #privacyBtn{grid-column:3;grid-row:1;justify-self:end}
 header #emailExtractor{grid-column:3;grid-row:2;font-size:11px;padding:5px 3px}
 header #setupGuide{font-size:11px;padding:5px 3px;white-space:nowrap}
}

/* Internal cleanup workspace and compact, extensible header. */
header{height:auto;min-height:44px;flex-wrap:wrap;gap:6px}
.header-actions{flex-wrap:wrap;gap:6px}
header .brand{flex-shrink:0}
header .secondary{min-height:28px;padding:5px 9px;gap:5px}
header #filterOpen{background:linear-gradient(#e3f8ff,#a7dff2);color:#123d59;border-color:#528ca8}
button,a.secondary{transition:background-color .15s,box-shadow .15s,transform .15s}
button:active:not(:disabled),a.secondary:active{transform:translateY(1px);filter:brightness(.92)}
header a.secondary:hover,header button:hover:not(:disabled){box-shadow:0 0 0 2px #ffffff45}
#filterView{overflow:hidden}
.filter-workspace{min-height:0;flex:1;overflow:auto;padding:0 20px;display:flex;flex-direction:column;gap:7px}
.filter-help,#filterStatus{font-size:12px;line-height:1.4;margin:0}
#filterInput{min-height:90px;height:140px;max-height:250px;flex-shrink:0;resize:vertical;border:1px solid #8a8a8a;font-size:14px;padding:8px;line-height:1.4}
.filter-tools{display:flex;gap:6px;align-items:center;flex-wrap:wrap}
.filter-tools button,.filter-export button{min-height:32px;padding:6px 10px;font-size:12px;gap:4px}
#filterResults{min-height:60px;overflow:auto;flex:1;background:#ffffff70}
#filterResults table{width:100%;border-collapse:collapse;font-size:12px}
#filterResults caption{text-align:left;padding:6px;color:#555}
#filterResults th,#filterResults td{padding:7px 8px;text-align:left;border-bottom:1px solid #bbb;overflow-wrap:anywhere}
#filterResults th{background:#dbe6f2;position:sticky;top:0}
.filter-export{display:flex;justify-content:flex-end;flex-shrink:0;gap:6px;padding:8px 20px;border-top:1px solid #aaa}
@media(max-width:650px){
 header{grid-template-columns:minmax(74px,1fr) auto 26px 26px;grid-template-rows:28px auto;gap:4px!important;padding:5px 8px!important}
 header .brand{grid-column:1;grid-row:1;font-size:15px;gap:5px}
 header .brandmark{width:24px;height:24px}
 header #accountAction{grid-column:2;grid-row:1;margin:0;padding:4px 6px!important;min-height:26px;font-size:10px!important;white-space:nowrap}
 header #privacyBtn{grid-column:4;grid-row:1;width:26px;height:26px}
 header #adminBell{grid-column:3;grid-row:1;width:26px;height:26px;align-self:center;justify-self:end}
 header .header-actions{display:contents}
 header #setupGuide,header #emailExtractor,header #filterOpen{grid-column:auto;grid-row:auto;font-size:10px;padding:4px 3px;min-height:28px;white-space:nowrap;border-radius:4px;letter-spacing:-.15px}
 header .header-links{grid-column:1/-1;grid-row:2;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px}
 .filter-workspace{padding:0 10px;gap:6px}
 .filter-help,#filterStatus{font-size:11px}
 #filterInput{font-size:16px;height:110px;min-height:80px}
 .filter-export{padding:6px 10px;justify-content:stretch;gap:5px}
 .filter-export button{flex:1;min-height:34px;font-size:11px;padding:5px}
}
@media(prefers-reduced-motion:reduce){button,a.secondary{transition:none;transform:none!important}}

.header-links>*{min-width:0;text-align:center}
@media(max-width:650px){header .header-links{gap:6px}header #setupGuide,header #emailExtractor,header #filterOpen{font-size:11px;letter-spacing:0;padding:5px 4px}}
/* Results-first filter: raw input disappears after automatic cleanup. */
.app-frame:has(#filterView:not([hidden]))>.readybar,.app-frame:has(#filterView:not([hidden]))>#notice{display:none}
#filterView{background:#edf2f7}
#filterView .viewhead{background:transparent;height:40px;padding:8px 20px}
.filter-local{font-size:10px;color:#52677b}
.filter-workspace{padding:0 20px 10px;gap:8px;overflow:auto}
.filter-tools{flex-shrink:0;gap:8px}
.filter-tools button{border-radius:6px;min-height:32px}
#filterEntry{flex-shrink:0;background:#fff;border:1px solid #c2cfdd;border-radius:8px;padding:10px}
#filterEntry label{font-size:12px;color:#425a73}
#filterInput{display:block;height:70px;min-height:60px;max-height:120px;margin-top:5px;resize:none;border:0;background:#f5f8fc;border-radius:5px}
#filterEntry .filter-help{font-size:10px;color:#65758b;margin:5px 0 0}
#filterStatus{color:#315b79;font-size:12px;flex-shrink:0;line-height:1.35}
#filterResults{background:#fff;border:1px solid #c2cfdd;border-radius:8px;min-height:160px;flex:1;overflow:auto}
#filterResults table{table-layout:fixed}
#filterResults th:first-child{width:26%}
#filterResults th,#filterResults td{height:30px;padding:6px 10px;border-bottom:1px solid #e6edf4;font-size:12px;line-height:18px}
#filterResults th{background:#e8f0f8;color:#355775;font-size:11px}
#filterResults tbody tr:nth-child(even){background:#f8fafc}
.filter-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;min-height:150px;color:#697d91;font-size:12px;text-align:center;padding:15px}
.filter-empty strong{font-size:15px;color:#355775}
.filter-export{background:#e4ecf5;border-color:#c2cfdd}
.filter-export button{border-radius:6px}
#filterPages{display:flex;align-items:center;justify-content:space-between;font-size:11px;flex-shrink:0}
@media(max-width:650px){#filterView .viewhead{height:34px;padding:6px 10px}.filter-workspace{padding:0 10px 8px;gap:6px}#filterResults th,#filterResults td{font-size:11px;padding:5px 7px;height:28px;line-height:18px}#filterResults{min-height:170px}#filterStatus{font-size:11px}.filter-tools button{min-height:30px;font-size:11px}.filter-export{padding:6px 10px}}

.suggested-name{display:block;font-size:9px;line-height:10px;color:#65758b;font-weight:normal}

#finderOpen{font-size:11px;min-height:26px;padding:4px 9px;color:white;background:linear-gradient(100deg,#f97316,#ea580c);border-color:#c2410c;border-radius:6px;white-space:nowrap}.app-frame:has(#findersView:not([hidden]))>.readybar,.app-frame:has(#findersView:not([hidden]))>#notice{display:none}#findersView{overflow:hidden}
/* Compact membership card; naturally scrolls on small screens or with the keyboard open. */
#membershipOpen{font-size:11px;padding:5px 8px;min-height:28px;white-space:nowrap}#membershipDialog,#paymentAdminDialog{width:min(460px,calc(100vw - 24px));max-height:calc(100dvh - 24px);padding:16px;border:1px solid #bad4e8;border-radius:16px;color:#173750;background:#f9fcff;overflow:auto}#membershipDialog::backdrop,#paymentAdminDialog::backdrop{background:#10263e99}.pay-head{display:flex;align-items:center;justify-content:space-between;gap:8px}.pay-head h2{font-size:18px;margin:0}.pay-head button{border:0;background:none;font-size:26px;cursor:pointer}.pay-muted,.pay-benefits{font-size:12px;line-height:1.4;margin:8px 0}.pay-fine{font-size:10px;line-height:1.3;margin:8px 0 0;color:#566c7d}.pay-methods{display:grid;grid-template-columns:1fr 1fr;gap:8px}.pay-methods button{background:white;border:1px solid #afc4d8;border-radius:9px;padding:10px 5px;font-size:18px;font-weight:700;color:#153e60}.pay-methods small{display:block;font-size:11px}.pay-methods .selected{background:#e5f4ff;border:2px solid #2675b5}.pay-benefits{text-align:center}#payDetails{border-radius:10px;background:#eaf3fa;padding:10px;font-size:12px;line-height:1.4;margin:8px 0}.pay-account{font-weight:800;font-size:18px;margin-top:4px}.pay-wallet{overflow-wrap:anywhere;font-family:monospace;font-size:12px}.pay-copy{font-size:11px;border:0;color:#135e99;background:none;padding:5px 6px;cursor:pointer}#paymentForm{display:grid;gap:8px}#paymentForm label{font-size:11px;font-weight:600;display:grid;gap:3px}#paymentForm input{width:100%;min-width:0;height:32px;padding:5px;border:1px solid #a6bdce;border-radius:5px;font-size:13px;background:white}#paymentForm input[type=file]{font-size:11px;padding:4px}.pay-grid{display:grid;grid-template-columns:1fr 1fr;gap:7px}.pay-wide{grid-column:1/-1}#paymentSubmit{width:100%;padding:9px;min-height:36px;font-size:14px}#paymentMessage{font-size:12px;line-height:1.4;margin:8px 0}.pay-contact{font-size:12px;color:#1268a4;display:block;text-align:center}.pay-review{padding:12px;border:1px solid #b1c9da;border-radius:8px;margin:12px 0;overflow-wrap:anywhere}.pay-review p{font-size:12px}.pay-review label{display:block;margin:10px 0;font-size:12px}.pay-review textarea{width:100%;min-height:60px}.pay-review button,.pay-review a{margin:5px}.plan-admin[hidden]{display:none!important}
@media(max-width:480px){#membershipDialog{padding:12px}#paymentForm input{font-size:16px}.pay-head h2{font-size:16px}.pay-benefits{font-size:11px}.pay-account{font-size:16px}}
@media(max-height:700px){#membershipDialog{padding:10px}.pay-muted,.pay-benefits,#paymentMessage{margin:5px 0}.pay-fine{margin-top:5px}#payDetails{margin:5px 0;padding:8px}.pay-methods button{padding:8px 5px}#paymentForm{gap:6px}}
@media(max-width:650px){header .header-links{grid-template-columns:repeat(4,minmax(0,1fr))}header .header-links .secondary,header .header-links #membershipOpen{min-width:0;white-space:normal;text-align:center;justify-content:center;font-size:10px!important;padding:4px 2px!important;line-height:12px}}
