/* Relnets Mail: light workspace, flexible panels and accessible controls. */
:root{color-scheme:light;--canvas:#eef2f7;--surface:#fff;--surface-subtle:#f6f8fc;--text:#19263b;--text-secondary:#40536b;--text-muted:#62748a;--border:#dce4ed;--border-strong:#b8c7d9;--accent:#335bc7;--accent-hover:#2449ad;--accent-active:#e9efff;--focus:#305dd3;--danger:#b42318;--success:#167548;--shadow:0 16px 48px #263b5a15;--radius-lg:14px}
html,body{max-width:100%;min-width:0} body{font-size:15px} button,a,input,select,textarea{touch-action:manipulation} button:focus-visible,a:focus-visible,summary:focus-visible{outline:2px solid var(--focus);outline-offset:2px} img{max-width:100%}
.brand-mark{background:#e9efff;flex-basis:40px;width:40px;height:40px}.brand-mark img{width:32px;height:32px;object-fit:contain;filter:none}.placeholder-symbol{background:#edf3ff}.brand-block{padding:0;min-width:0}.brand-block>div:nth-child(2){flex:1;min-width:0}.brand-name{font-size:15px;white-space:normal}.brand-subtitle{font-size:11px;color:var(--text-muted)}
.auth-view:not([hidden]){height:100dvh;min-height:0;overflow:auto;display:grid;place-items:center;padding:clamp(16px,3vw,42px);background:radial-gradient(ellipse at 12% 0%,#dce8ff 0%,#f2f5fa 65%)}
.hosting-auth-layout{display:grid;grid-template-columns:minmax(0,1.08fr) minmax(0,1fr);width:min(100%,970px);min-height:510px;border:1px solid var(--border);border-radius:24px;background:#fff;overflow:hidden;box-shadow:var(--shadow)}
.hosting-intro{display:flex;flex-direction:column;justify-content:center;padding:clamp(26px,4vw,52px);background:linear-gradient(145deg,#e8f0ff,#f7f9ff 80%);border-right:1px solid var(--border);color:var(--text)}.hosting-brand{display:flex;align-items:center;gap:10px;font-size:17px;letter-spacing:.09em;font-weight:750;margin-bottom:auto}.hosting-brand img{object-fit:contain}.hosting-brand small{font-size:12px;letter-spacing:.1em;color:var(--accent)}.hosting-kicker{font-size:11px;font-weight:750;letter-spacing:.15em;color:var(--accent);margin:34px 0 12px}.hosting-intro h2{font-size:clamp(34px,4vw,54px);letter-spacing:-.045em;line-height:1.08;margin:0 0 18px}.hosting-intro>p:not(.hosting-kicker){font-size:16px;color:var(--text-secondary);line-height:1.65;max-width:370px;margin:0 0 22px}.hosting-features{display:grid;gap:10px;color:var(--text-secondary);font-size:14px}.hosting-features span:before{content:'✓';margin-right:10px;color:var(--accent)}.hosting-intro footer{margin-top:auto;padding-top:28px;font-size:12px;color:var(--text-muted)}
.hosting-auth-layout .auth-card{width:100%;min-width:0;min-height:0;align-self:center;padding:clamp(24px,4vw,42px);border:0;border-radius:0;box-shadow:none;background:#fff}.auth-brand h1{font-size:clamp(23px,3vw,29px)}.auth-form{gap:15px}.auth-field{font-size:13px}.auth-field input,.auth-field select{min-height:48px;font-size:16px;background:#fff}.hosting-password{position:relative;display:block}.hosting-password input{padding-right:92px}.hosting-password button{position:absolute;right:7px;top:6px;bottom:6px;padding:0 9px;border-radius:7px;background:#f2f5fc;color:var(--accent-hover);font-size:12px;font-weight:650}.auth-submit{min-height:48px}.auth-link{white-space:normal;max-width:100%;text-align:left;color:var(--accent-hover)}.auth-help{line-height:1.6;font-size:13px}
.app-shell{grid-template-columns:clamp(210px,16.8vw,280px) clamp(280px,28vw,460px) minmax(0,1fr);gap:10px;padding:10px;max-width:100%;height:100dvh}.sidebar{overflow-y:auto;overscroll-behavior:contain;padding:16px 12px;background:#f9fbfe}.sidebar-spacer{min-height:12px}.desktop-collapse{display:inline-grid;flex:0 0 36px}.nav-group{min-width:0;margin:5px 0}.nav-group summary,.hosting-overview summary{cursor:pointer;list-style:none;display:flex;align-items:center;justify-content:space-between;min-height:40px;padding:7px 9px;color:var(--text-secondary);font-size:12px;font-weight:750}.nav-group summary::-webkit-details-marker,.hosting-overview summary::-webkit-details-marker{display:none}.nav-group summary:after,.hosting-overview summary:after{content:'›';font-size:20px;color:var(--text-muted);transform:rotate(0)}.nav-group[open] summary:after,.hosting-overview[open] summary:after{transform:rotate(90deg)}.nav-group summary:hover,.hosting-overview summary:hover{background:#eef3fa;border-radius:7px}.account-group{border-top:1px solid var(--border)}.account-actions{display:grid;gap:3px}.account-actions .text-button{min-height:42px;text-align:left}.admin-entry{margin:6px 0 4px;min-height:44px}.compose-button{margin:18px 0 10px}.mailbox-switcher{min-width:0}.mailbox-switcher select{min-width:0;width:100%;font-size:13px;min-height:44px;text-overflow:ellipsis}.mailbox-access-note{overflow-wrap:anywhere}.folder-button{min-height:44px}.folder-button.is-active .folder-icon{opacity:1}.column-header{padding:16px}.column-title-row>div{min-width:0}.column-header p{overflow-wrap:anywhere}.message-card{min-height:92px;padding:12px 16px 12px 20px}.message-card.is-unread{background:#f9fbff}.message-card.is-selected{background:var(--accent-active)}.message-card:hover{background:#f0f4fa}.message-body{overflow-wrap:anywhere;max-width:100%;padding:clamp(18px,3vw,40px);background:#fff}.message-head{padding:clamp(18px,3vw,34px)}.reader-toolbar{overflow-x:auto;flex-wrap:wrap;padding:10px 14px}.reader-toolbar button{min-height:44px}.sender-avatar{color:#234ca9;background:#e8efff}.reader-placeholder{padding:24px}.search-box input{min-width:0;font-size:14px}.message-html-frame{max-width:100%}
.admin-view{grid-template-columns:minmax(270px,34%) minmax(0,1fr)}.admin-header{padding:14px;position:static;background:#fff}.admin-topbar{display:flex;align-items:center;gap:6px}.admin-menu{display:none}.admin-header h1{font-size:clamp(19px,2vw,25px);line-height:1.2}.hosting-overview{margin-top:10px;border:1px solid var(--border);border-radius:10px;background:var(--surface-subtle)}.hosting-admin-summary{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;padding:0 8px 8px}.hosting-admin-summary .admin-stat{background:#fff;padding:8px}.hosting-admin-summary .admin-stat span{font-size:11px}.hosting-admin-summary .admin-stat strong{font-size:19px}.admin-tabs{margin-top:12px}.admin-tab{min-height:44px;white-space:normal;padding:4px 6px}.admin-tab.is-active{background:var(--accent-active);color:var(--accent-hover)}.admin-status-filter{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:10px;font-size:13px;font-weight:650}.admin-status-filter select{min-height:42px;width:65%;background:#fff;border:1px solid var(--border-strong);border-radius:8px;padding:6px 10px}.admin-create-actions{grid-template-columns:repeat(auto-fit,minmax(120px,1fr))}.admin-create-actions button{min-height:44px;white-space:normal}.admin-detail-pane{padding:clamp(16px,3vw,32px)}.admin-detail-heading{flex-wrap:wrap;gap:10px}.admin-detail-heading>div{min-width:0;flex:1 1 160px}.admin-detail-heading h2,.admin-detail-heading p{overflow-wrap:anywhere;word-break:normal}.admin-detail-grid{grid-template-columns:repeat(auto-fit,minmax(min(140px,100%),1fr))}.admin-detail-section{padding:20px 0}.admin-action-row button{min-height:44px;white-space:normal;max-width:100%}.admin-list-item{display:flex;align-items:stretch;min-width:0;border-bottom:1px solid var(--border)}.admin-list-item .admin-record{flex:1;min-width:0;border:0;padding:12px 14px;min-height:76px}.admin-record-primary{flex-wrap:wrap;justify-content:space-between}.admin-record-primary strong,.admin-record-meta span:first-child{white-space:normal;overflow-wrap:anywhere}.admin-record-meta{flex-wrap:wrap}.admin-quick-delete{align-self:center;margin:0 8px 0 2px;min-height:40px;font-size:12px;flex:0 0 auto;color:var(--danger)}.danger-button{background:#b42318;color:#fff;font-weight:650;border-radius:8px;min-height:44px;padding:0 16px}.danger-button:hover:not(:disabled){background:#941b13}.delete-dialog{border:1px solid var(--border);border-radius:14px;box-shadow:var(--shadow);padding:0;max-height:calc(100dvh - 32px);overflow:auto;background:white}.delete-dialog::backdrop{background:#15243b66}.delete-dialog p{overflow-wrap:anywhere}.delete-dialog .composer-fields{gap:14px}.delete-dialog .composer-footer{gap:8px}.delete-dialog .composer-header h2{font-size:20px}.membership-form select{max-width:100%;min-width:0}
@media(min-width:861px){.app-shell[data-nav-collapsed="true"]{grid-template-columns:clamp(280px,34vw,520px) minmax(0,1fr)}.app-shell[data-nav-collapsed="true"] .sidebar{display:none}.app-shell[data-nav-collapsed="true"] .message-column{grid-column:1}.app-shell[data-nav-collapsed="true"] .reader{grid-column:2}.app-shell[data-nav-collapsed="true"] .admin-view{grid-column:1/-1}.app-shell[data-nav-collapsed="true"] #menu-button,.app-shell[data-nav-collapsed="true"] .admin-menu{display:inline-grid}}
@media(min-width:861px) and (max-width:1050px){.app-shell{grid-template-columns:210px minmax(260px,30%) minmax(0,1fr)}}
@media(max-width:860px){.app-shell{grid-template-columns:minmax(270px,40%) minmax(0,1fr);gap:8px;padding:8px}.desktop-collapse{display:none}.admin-menu{display:inline-grid}.sidebar{width:min(300px,calc(100vw - 36px));background:#fff}.admin-view{grid-template-columns:minmax(250px,40%) minmax(0,1fr);grid-column:1/-1}.admin-detail-pane{padding:18px}.column-header{padding:14px}}
@media(max-width:740px){.hosting-auth-layout{grid-template-columns:1fr;max-width:460px;min-height:0;border-radius:18px}.hosting-intro{display:none}.hosting-auth-layout .auth-card{padding:28px 24px}}
@media(max-width:680px){.app-shell{display:block;padding:0;width:100%;height:100dvh}.sidebar{position:fixed;inset:0 auto 0 0;z-index:40;width:min(88vw,340px);height:100dvh;border-radius:0 16px 16px 0;padding:max(14px,env(safe-area-inset-top)) 14px max(16px,env(safe-area-inset-bottom));box-shadow:8px 0 30px #19263b33}.app-shell[data-mobile-view="nav"] .nav-backdrop{display:block;position:fixed;z-index:30;inset:0;background:#19263b55}.app-shell[data-mobile-view="nav"] .sidebar{display:flex}.app-shell[data-mobile-view="list"] .message-column{display:flex}.app-shell[data-mobile-view="reader"] .reader{display:block}.column-header{padding:max(12px,env(safe-area-inset-top)) 14px 12px}.column-header p{font-size:12px}.search-box input,.mailbox-switcher select,.admin-status-filter select,.field input,.field textarea{font-size:16px}.message-card{min-height:86px}.message-head,.message-body{padding:18px}.reader-toolbar{flex-wrap:nowrap;overflow-x:auto}.admin-view{height:100dvh}.admin-header{padding:max(14px,env(safe-area-inset-top)) 14px 12px}.admin-list-pane{padding-bottom:env(safe-area-inset-bottom)}.admin-detail-pane{padding:max(14px,env(safe-area-inset-top)) 16px max(20px,env(safe-area-inset-bottom))}.admin-detail-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.admin-action-row button{flex:1 1 150px}.hosting-overview{margin-top:8px}.auth-view:not([hidden]){padding:16px}.hosting-auth-layout .auth-card{padding:24px 20px}.delete-dialog{width:calc(100% - 24px);max-height:calc(100dvh - 24px)}.delete-dialog .composer-form{height:auto;min-height:0}.delete-dialog .composer-fields{overflow:auto}.delete-dialog .composer-footer{flex-wrap:wrap}.delete-dialog .composer-footer button{flex:1 1 90px}}
@media(max-width:360px){.admin-detail-grid{grid-template-columns:1fr}.hosting-auth-layout .auth-card{padding:20px 15px}.admin-quick-delete{margin-right:5px;padding:0 7px}.admin-record-primary strong{font-size:13px}.admin-header h1{font-size:19px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;transition:none!important;animation:none!important}}
[hidden]{display:none!important}

@media(max-height:540px){.auth-view:not([hidden]){place-items:start center}.hosting-auth-layout{min-height:0}.hosting-auth-layout .auth-card{padding:20px}.hosting-intro{padding:24px}.hosting-kicker{margin-top:20px}.hosting-intro footer{padding-top:16px}}

/* Message-list actions only; keep the existing workspace proportions. */
.message-bulk{flex:0 0 auto;padding:6px 10px;border-bottom:1px solid var(--border);background:var(--surface);min-width:0}
.bulk-top{display:flex;align-items:center;gap:8px;min-height:36px;flex-wrap:wrap}
.bulk-select-all{display:inline-flex;align-items:center;gap:7px;min-height:36px;padding:0 3px;color:var(--text-secondary);font-size:12px;font-weight:650;cursor:pointer}
.bulk-select-all input,.message-check{width:17px;height:17px;margin:0;accent-color:var(--accent);cursor:pointer;flex-shrink:0}
#bulk-count{font-size:12px;color:var(--accent-hover);font-weight:650;flex:1;min-width:0}
.bulk-clear{font-size:12px;min-height:36px;padding:0 7px;margin-left:auto}
.bulk-actions{display:flex;gap:5px;flex-wrap:wrap;padding:3px 0 5px}
.bulk-action{font-size:11px;min-height:36px;gap:5px;padding:0 7px;flex:1 1 auto;white-space:nowrap}
.bulk-action img{width:15px;height:15px;flex:0 0 15px}
.message-list-item{display:flex;min-width:0;align-items:stretch;background:var(--surface);border-bottom:1px solid var(--border)}
.message-list-item .message-card{flex:1;min-width:0;border-bottom:0;padding-left:8px}
.message-list-item .message-card:before{left:1px;width:4px;height:4px;top:18px}
.message-check-wrap{display:flex;flex:0 0 34px;align-items:center;justify-content:center;cursor:pointer}
.message-list-item.is-checked,.message-list-item.is-checked .message-card{background:#e9efff}
.message-list-item .message-check:focus-visible,.bulk-select-all input:focus-visible{outline:2px solid var(--focus);outline-offset:3px}
#folder-title:focus:not(:focus-visible){outline:none}
@media(max-width:680px){.message-check-wrap{flex-basis:42px}.bulk-select-all,.bulk-clear,.bulk-action{min-height:40px}.bulk-actions{gap:4px}.bulk-action{padding:0 6px}.message-check,.bulk-select-all input{width:19px;height:19px}}
