:root {
  --black: #0d0d0d;
  --carbon: #141414;
  --carbon-2: #191919;
  --carbon-3: #232323;
  --line: rgba(247, 246, 242, .1);
  --line-strong: rgba(247, 246, 242, .18);
  --mail-orange: #ff641f;
  --mail-orange-soft: #ffad85;
  --white: #f7f6f2;
  --muted: #a4a29d;
  --danger: #ef6a6a;
  --success: #7cdb9c;
  --radius: 14px;
  --shadow: 0 24px 80px rgba(0, 0, 0, .42);
  --workspace-gutter: clamp(22px, 3vw, 56px);
  color-scheme: dark;
  font-family: Montserrat, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--black); }
body { margin: 0; min-height: 100vh; color: var(--white); background: var(--black); font-size: 16px; line-height: 1.5; }
button, input, textarea, select { color: inherit; font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
svg, img { display: block; }

.eyebrow { margin: 0 0 11px; color: var(--mail-orange); font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.muted { color: var(--muted); line-height: 1.65; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.brand { display: inline-flex; align-items: center; width: fit-content; }
.brand-lockup { width: 184px; height: auto; }
.brand--large .brand-lockup { width: clamp(270px, 29vw, 380px); }

.topbar { position: relative; z-index: 20; display: grid; grid-template-columns: 230px minmax(0, 1fr) auto; align-items: center; min-height: 82px; padding: 0 var(--workspace-gutter); border-bottom: 1px solid var(--line); background: rgba(13, 13, 13, .96); backdrop-filter: blur(20px); }
.topnav { display: flex; align-items: stretch; height: 82px; gap: 36px; }
.topnav a { position: relative; display: grid; place-items: center; color: var(--muted); font-size: 14px; font-weight: 650; }
.topnav a:hover, .topnav a[aria-current="page"] { color: var(--white); }
.topnav a[aria-current="page"]::after { content: ""; position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; background: var(--mail-orange); box-shadow: 0 -4px 18px rgba(255, 100, 31, .6); }
.profile-menu { display: flex; align-items: center; gap: 11px; }
.profile-copy { display: flex; flex-direction: column; min-width: 0; }
.profile-copy b { max-width: 220px; overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.profile-copy small { max-width: 220px; margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.avatar { display: grid; flex: 0 0 auto; place-items: center; width: 34px; height: 34px; border: 1px solid rgba(255,100,31,.32); border-radius: 50%; color: var(--mail-orange-soft); background: linear-gradient(145deg, #3a261d, #171a1e); font-size: 11px; font-weight: 800; letter-spacing: .04em; }
.avatar--sender { width: 40px; height: 40px; border-color: rgba(255,100,31,.26); color: var(--mail-orange-soft); background: linear-gradient(145deg, #36231b, #171717); }
.avatar--large { width: 48px; height: 48px; }
.avatar--account { border-radius: 11px; color: var(--mail-orange); }

.icon-button { display: grid; flex: 0 0 auto; place-items: center; width: 36px; height: 36px; padding: 0; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: transparent; cursor: pointer; }
.icon-button:hover { border-color: var(--line-strong); color: var(--white); background: var(--carbon-3); }
.icon-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.icon-button--danger:hover { color: var(--danger); }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 46px; padding: 0 20px; border: 1px solid transparent; border-radius: 10px; font-size: 14px; font-weight: 750; letter-spacing: .01em; cursor: pointer; transition: transform .16s ease, border-color .16s ease, background .16s ease; }
.button:hover { transform: translateY(-1px); }
.button--primary { border-color: rgba(255,255,255,.9); color: #0d0d0d; background: var(--white); box-shadow: 0 12px 35px rgba(0,0,0,.2); }
.button--primary:hover { border-color: var(--mail-orange); background: #fff; }
.button--secondary { border-color: var(--line-strong); color: var(--white); background: var(--carbon-3); }
.button--quiet { min-height: 34px; padding: 0 12px; border-color: var(--line); color: var(--muted); background: transparent; }
.button--wide { width: 100%; }

.toast { position: fixed; z-index: 100; top: 96px; left: 50%; max-width: min(620px, calc(100vw - 32px)); padding: 14px 20px; border: 1px solid var(--line-strong); border-radius: 10px; color: var(--white); background: #202229; box-shadow: var(--shadow); transform: translateX(-50%); font-size: 14px; }
.toast--success { border-color: rgba(124, 219, 156, .35); }
.toast--error { border-color: rgba(239, 106, 106, .4); }
.alert { margin: 18px 0; padding: 13px 15px; border-radius: 10px; font-size: 12px; line-height: 1.5; }
.alert--error { border: 1px solid rgba(239,106,106,.3); color: #ffb1b1; background: rgba(239,106,106,.08); }

/* Authentication */
.auth-layout { display: grid; grid-template-columns: minmax(380px, .92fr) minmax(460px, 1.08fr); min-height: 100vh; }
.auth-brand-panel { position: relative; display: flex; flex-direction: column; justify-content: space-between; min-height: 100vh; padding: 56px clamp(40px, 6vw, 92px); overflow: hidden; border-right: 1px solid var(--line); background: radial-gradient(circle at 24% 82%, rgba(255,100,31,.12), transparent 34%), #0d0d0d; }
.auth-brand-panel::before { content: ""; position: absolute; right: -120px; bottom: -100px; width: 520px; height: 520px; opacity: .11; background: linear-gradient(135deg, transparent 42%, var(--mail-orange) 42% 49%, transparent 49% 58%, var(--mail-orange) 58% 62%, transparent 62%); transform: rotate(-12deg); }
.auth-statement { position: relative; z-index: 1; margin: auto 0; }
.auth-statement h1 { margin: 0; font-family: Raleway, Inter, sans-serif; font-size: clamp(42px, 5vw, 72px); line-height: .98; letter-spacing: -.045em; }
.auth-statement h1 span { color: var(--mail-orange); }
.auth-statement > p:last-child { max-width: 470px; margin: 28px 0 0; color: var(--muted); font-size: 15px; line-height: 1.8; }
.secure-note { position: relative; z-index: 1; display: flex; align-items: center; gap: 9px; margin: 0; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .15em; }
.secure-note span { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 14px var(--success); }
.auth-form-panel { display: grid; place-items: center; padding: 48px; background: linear-gradient(160deg, #151515, #0d0d0d); }
.auth-card { width: min(440px, 100%); padding: 40px; border: 1px solid var(--line); border-radius: 16px; background: rgba(23, 23, 23, .92); box-shadow: var(--shadow); }
.auth-card h2 { margin: 0 0 9px; font-family: Raleway, Inter, sans-serif; font-size: 30px; letter-spacing: -.025em; }
.auth-card > .muted { margin: 0 0 28px; font-size: 15px; }
.auth-card label, .settings-form label { display: grid; gap: 9px; margin: 0 0 19px; color: #d9dae0; font-size: 14px; font-weight: 700; }
.auth-card label small, .settings-form label small { color: var(--muted); font-weight: 500; line-height: 1.5; }
input, textarea, select { width: 100%; border: 1px solid var(--line-strong); border-radius: 9px; outline: none; color: var(--white); background: #101010; }
input, select { min-height: 46px; padding: 0 14px; }
textarea { padding: 14px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: rgba(255,100,31,.65); box-shadow: 0 0 0 3px rgba(255,100,31,.09); }
input::placeholder, textarea::placeholder { color: #676a74; }
input[readonly] { color: var(--muted); }
.auth-card .button { margin-top: 7px; }
.auth-link { margin: 22px 0 0; text-align: center; font-size: 12px; }
.auth-link a { color: var(--mail-orange-soft); }
.privacy-copy { margin: 28px 0 0; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.65; text-align: left; }

/* Mail workspace */
.mail-layout { display: grid; grid-template-columns: 245px minmax(360px, 430px) minmax(480px, 1fr); height: calc(100vh - 79px); overflow: hidden; }
.mail-sidebar { display: flex; flex-direction: column; min-width: 0; border-right: 1px solid var(--line); background: #111; }
.compose-button { margin: 20px; }
.button--roundcube { width: calc(100% - 40px); margin: 20px 20px 0; border-color: rgba(255,100,31,.34); color: var(--mail-orange-soft); background: rgba(255,100,31,.07); }
.button--roundcube:hover { border-color: var(--mail-orange); color: var(--white); background: rgba(255,100,31,.12); }
.compose-button svg, .attachment-picker svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-width: 2; }
.account-switcher { display: grid; gap: 8px; margin: 0 20px 18px; color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.account-switcher select { min-height: 44px; font-size: 14px; text-transform: none; letter-spacing: 0; }
.folder-list { display: grid; gap: 3px; padding: 5px 12px; overflow-y: auto; }
.folder-list a { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 12px; border-radius: 9px; color: var(--muted); font-size: 14px; }
.folder-list a:hover { color: var(--white); background: rgba(255,255,255,.04); }
.folder-list a[aria-current="page"] { color: var(--white); background: rgba(255,100,31,.1); box-shadow: inset 2px 0 var(--mail-orange); }
.folder-list svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.6; }
.folder-list a > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-count { display: grid; flex: 0 0 auto; min-width: 24px; height: 24px; margin-left: auto; padding: 0 7px; place-items: center; border-radius: 999px; color: var(--mail-orange-soft); background: rgba(255,100,31,.11); font-size: 11px; }
.folder-list a[aria-current="page"] .folder-count { color: #0d0d0d; background: var(--mail-orange); }
.mail-sidebar-footer { display: flex; align-items: center; gap: 10px; margin-top: auto; padding: 18px 20px; border-top: 1px solid var(--line); }
.mail-sidebar-footer > span:last-child { display: flex; min-width: 0; flex-direction: column; }
.mail-sidebar-footer b, .mail-sidebar-footer small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-sidebar-footer b { font-size: 14px; }
.mail-sidebar-footer small { margin-top: 4px; color: var(--muted); font-size: 12px; }
.message-list-panel { min-width: 0; overflow-y: auto; border-right: 1px solid var(--line); background: #151515; }
.panel-header { display: flex; align-items: center; justify-content: space-between; min-height: 88px; padding: 20px 24px 13px; }
.panel-header h1 { margin: 0; font-family: Raleway, Inter, sans-serif; font-size: 24px; letter-spacing: -.025em; }
.sidebar-toggle { display: none; }
.search { position: relative; margin: 0 20px 14px; }
.search svg { position: absolute; top: 50%; left: 13px; width: 17px; height: 17px; fill: none; stroke: var(--muted); stroke-linecap: round; stroke-width: 1.7; transform: translateY(-50%); }
.search input { min-height: 44px; padding-left: 40px; border-color: transparent; background: #202020; font-size: 14px; }
.list-meta { display: flex; justify-content: space-between; padding: 0 24px 12px; color: var(--muted); font-size: 11px; letter-spacing: .05em; text-transform: uppercase; }
.list-meta a:hover { color: var(--mail-orange); }
.message-list { border-top: 1px solid var(--line); }
.message-row { position: relative; display: flex; gap: 12px; min-height: 93px; padding: 17px 20px; border-bottom: 1px solid var(--line); background: #151515; }
.message-row:hover { background: #1b1b1b; }
.message-row--unread { background: linear-gradient(90deg, rgba(255,100,31,.07), #171717 42%); }
.message-row--unread::before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 2px; background: var(--mail-orange); }
.message-copy { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 5px; }
.message-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.message-line b { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.message-line time { flex: 0 0 auto; color: var(--muted); font-size: 11px; }
.message-copy strong { overflow: hidden; font-size: 15px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.message-copy small { color: var(--muted); font-size: 12px; }
.message-meta { display: flex; align-items: center; gap: 8px; }
.message-flag { color: var(--mail-orange-soft) !important; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 18px; color: var(--muted); font-size: 10px; }
.pagination a { color: var(--mail-orange); }
.reading-placeholder, .reading-panel { min-width: 0; overflow-y: auto; background: radial-gradient(circle at 50% 38%, rgba(255,100,31,.04), transparent 35%), #0d0d0d; }
.reading-placeholder { display: grid; place-items: center; padding: 40px; text-align: center; }
.reading-placeholder svg { width: 64px; margin: 0 auto 22px; fill: none; stroke: #5a5d66; stroke-width: 1; }
.reading-placeholder h2 { margin: 0 0 8px; color: #b5b7be; font: 600 17px Raleway, sans-serif; }
.reading-placeholder p { margin: 0; color: #666a74; font-size: 11px; }
.empty-state { display: grid; place-items: center; padding: 60px 30px; text-align: center; }
.empty-state--small { padding: 46px 20px; }
.empty-icon { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 17px; border: 1px solid rgba(255,100,31,.25); border-radius: 50%; color: var(--mail-orange); background: rgba(255,100,31,.07); font-size: 17px; }
.empty-state h1, .empty-state h2, .empty-state h3 { margin: 0 0 9px; font-family: Raleway, sans-serif; }
.empty-state p { max-width: 560px; margin: 0 0 20px; color: var(--muted); font-size: 14px; line-height: 1.7; }
.message-list-panel--compact { background: #111; }
.back-link { display: block; margin: 0 22px 20px; color: var(--muted); font-size: 10px; }
.back-link:hover { color: var(--mail-orange); }
.message-mini { display: flex; gap: 11px; margin: 0 12px; padding: 14px 12px; border: 1px solid rgba(255,100,31,.18); border-radius: 10px; background: rgba(255,100,31,.06); }
.message-mini > span:last-child { display: flex; min-width: 0; flex-direction: column; justify-content: center; gap: 5px; }
.message-mini b, .message-mini small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.message-mini b { font-size: 10px; }
.message-mini small { color: var(--muted); font-size: 9px; }
.reading-panel { padding: clamp(26px, 4vw, 58px); }
.reading-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding-bottom: 26px; border-bottom: 1px solid var(--line); }
.reading-header h1 { max-width: 800px; margin: 0; font-family: Raleway, sans-serif; font-size: clamp(25px, 3vw, 38px); line-height: 1.15; letter-spacing: -.03em; }
.reading-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.reading-actions form { margin: 0; }
.sender-card { display: flex; align-items: center; gap: 13px; padding: 24px 0; }
.sender-card > div { display: flex; min-width: 0; flex-direction: column; gap: 5px; }
.sender-card b { font-size: 12px; }
.sender-card small { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.message-primary-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 0 12px 61px; }
.mail-body { max-width: 850px; min-height: 200px; padding: 20px 0 55px; color: #d8d9de; font: 14px/1.85 ui-monospace, "SFMono-Regular", Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.attachments { padding-top: 22px; border-top: 1px solid var(--line); }
.attachments h2 { font: 650 13px Raleway, sans-serif; }
.attachments > div { display: flex; flex-wrap: wrap; gap: 10px; }
.attachments a { display: grid; grid-template-columns: 28px auto; column-gap: 10px; align-items: center; min-width: 190px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--carbon); }
.attachments a:hover { border-color: rgba(255,100,31,.35); }
.attachments a > span { grid-row: span 2; color: var(--mail-orange); }
.attachments b { max-width: 240px; overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.attachments small { color: var(--muted); font-size: 8px; }

/* Compose */
.mail-layout--compose { grid-template-columns: 245px 1fr; }
.compose-panel { overflow-y: auto; padding: 0 clamp(24px, 6vw, 96px) 40px; background: radial-gradient(circle at 70% 0, rgba(255,100,31,.05), transparent 35%), #111; }
.compose-panel .panel-header { padding-right: 0; padding-left: 0; }
.compose-form { max-width: 980px; border: 1px solid var(--line); border-radius: var(--radius); background: #171717; box-shadow: var(--shadow); }
.compose-notice { max-width: 980px; margin: 0 0 14px; }
.compose-from, .compose-line { display: grid; grid-template-columns: 75px 1fr; align-items: center; min-height: 55px; margin: 0; padding: 0 20px; border-bottom: 1px solid var(--line); }
.compose-from > span, .compose-line > span { color: var(--muted); font-size: 13px; font-weight: 700; }
.compose-from b { font-size: 14px; }
.compose-line input { min-height: 54px; padding: 0; border: 0; background: transparent; box-shadow: none; font-size: 15px; }
.recipient-details { border-bottom: 1px solid var(--line); }
.recipient-details summary { width: fit-content; margin-left: auto; padding: 8px 20px; color: var(--muted); cursor: pointer; font-size: 9px; }
.recipient-details .compose-line:last-child { border-bottom: 0; }
.compose-body textarea { min-height: 360px; padding: 26px 28px; border: 0; border-radius: 0; background: transparent; box-shadow: none; font-size: 16px; line-height: 1.75; }
.compose-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 20px; border-top: 1px solid var(--line); }
.attachment-picker { display: flex; align-items: center; gap: 9px; color: var(--muted); cursor: pointer; font-size: 10px; }
.attachment-picker:hover { color: var(--white); }
.attachment-picker input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.form-note { margin: 0; padding: 0 20px 18px; color: var(--muted); font-size: 9px; }

/* Settings and admin */
.settings-page { min-height: calc(100vh - 83px); padding: 48px var(--workspace-gutter) 80px; background: radial-gradient(circle at 82% -8%, rgba(255,100,31,.07), transparent 30%), #0d0d0d; }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 30px; width: 100%; max-width: none; margin: 0 0 34px; }
.page-heading > div { max-width: 850px; }
.page-heading h1 { margin: 0 0 8px; font: 700 clamp(30px, 4vw, 48px) Raleway, sans-serif; letter-spacing: -.04em; }
.page-heading > div > p:last-child { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.65; }
.status-badge { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .07em; }
.status-badge i { width: 6px; height: 6px; border-radius: 50%; background: var(--success); box-shadow: 0 0 10px rgba(124,219,156,.8); }
.status-badge--private i { background: var(--mail-orange); box-shadow: 0 0 10px rgba(255,100,31,.5); }
.settings-grid { display: grid; grid-template-columns: minmax(380px, .72fr) minmax(560px, 1.28fr); gap: 24px; width: 100%; max-width: none; margin: 0; align-items: start; }
.settings-grid--admin { grid-template-columns: minmax(360px, .8fr) minmax(520px, 1.2fr); }
.account-paths { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; width: 100%; max-width: none; margin: -7px 0 24px; }
.account-path { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 14px; min-height: 82px; padding: 15px 18px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); background: rgba(21,21,21,.72); }
.account-path:hover { border-color: var(--line-strong); color: var(--white); }
.account-path--active { border-color: rgba(255,100,31,.36); color: var(--white); background: rgba(255,100,31,.06); }
.account-path > span { display: grid; width: 36px; height: 36px; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--mail-orange); font-size: 11px; font-weight: 800; }
.account-path > div { display: flex; min-width: 0; flex-direction: column; gap: 5px; }
.account-path b { font-size: 15px; }
.account-path small { color: var(--muted); font-size: 13px; line-height: 1.5; }
.account-path > strong { color: var(--mail-orange-soft); font-size: 13px; white-space: nowrap; }
.admin-overview { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; width: 100%; max-width: none; margin: -7px 0 24px; }
.admin-overview article { display: flex; min-height: 105px; flex-direction: column; justify-content: center; padding: 18px 20px; border: 1px solid var(--line); border-radius: 12px; background: #141414; }
.admin-overview span, .admin-overview small { color: var(--muted); font-size: 13px; }
.admin-overview b { margin: 8px 0 6px; font: 700 28px Raleway, sans-serif; }
.status-badge--paused i { background: var(--mail-orange); box-shadow: 0 0 10px rgba(255,100,31,.5); }
.settings-card { padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(21,21,21,.96); box-shadow: 0 18px 55px rgba(0,0,0,.2); }
.settings-card--wide { grid-column: 1 / -1; }
.settings-card--form { border-top-color: rgba(255,100,31,.5); }
.section-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.section-title h2 { margin: 0; font: 650 25px Raleway, sans-serif; }
.section-title > a { color: var(--muted); font-size: 13px; }
.account-cards { display: grid; gap: 10px; }
.account-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 13px; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: #111; }
.account-card h3, .account-card p { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-card h3 { font-size: 15px; }
.account-card p { margin-top: 4px; color: #c0c2c9; font-size: 13px; }
.account-card small { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.account-actions { display: flex; gap: 5px; }
.account-actions form { margin: 0; }

/* Roundcube launch */
.webmail-launcher { overflow: hidden; }
.webmail-hero { position: relative; display: grid; width: 100%; max-width: none; min-height: 280px; margin: 0 0 24px; padding: clamp(32px, 4vw, 68px); align-items: center; overflow: hidden; border: 1px solid rgba(255,100,31,.24); border-radius: 18px; background: radial-gradient(circle at 82% 34%, rgba(255,100,31,.18), transparent 25%), linear-gradient(125deg, #191919, #101010); box-shadow: 0 25px 80px rgba(0,0,0,.25); }
.webmail-hero::after { content: ""; position: absolute; inset: 0; opacity: .12; background: repeating-linear-gradient(120deg, transparent 0 38px, rgba(255,255,255,.12) 39px, transparent 40px 78px); pointer-events: none; }
.webmail-hero > div { position: relative; z-index: 1; max-width: 720px; }
.webmail-hero h2 { max-width: 680px; margin: 0; font: 720 clamp(30px, 4.5vw, 58px)/1.02 Raleway, sans-serif; letter-spacing: -.045em; }
.webmail-hero p:not(.eyebrow) { max-width: 760px; margin: 22px 0 0; color: var(--muted); font-size: 16px; line-height: 1.75; }
.webmail-hero__mark { position: absolute; right: clamp(24px, 7vw, 100px); width: clamp(150px, 19vw, 250px); height: auto; opacity: .3; transform: rotate(-8deg); }
.webmail-account-grid { display: grid; grid-template-columns: repeat(3, minmax(280px, 1fr)); gap: 18px; width: 100%; max-width: none; margin: 0; }
.webmail-account-card { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 16px; padding: 22px; border: 1px solid var(--line); border-radius: 15px; background: rgba(21,21,21,.94); }
.webmail-account-card > div { min-width: 0; }
.webmail-account-card h2, .webmail-account-card p { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.webmail-account-card h2 { font: 650 19px Raleway, sans-serif; }
.webmail-account-card > div > p:last-child { margin-top: 6px; color: var(--muted); font-size: 13px; }
.webmail-account-card form, .webmail-compact-link { grid-column: 1 / -1; }
.webmail-account-card form { margin: 5px 0 0; }
.webmail-compact-link { color: var(--muted); font-size: 13px; text-align: left; }
.webmail-compact-link:hover, .webmail-direct-login a { color: var(--mail-orange-soft); }
.webmail-direct-login { width: 100%; max-width: none; margin: 24px 0 0; color: var(--muted); font-size: 14px; text-align: left; }

.handoff-page { display: grid; min-height: calc(100vh - 79px); padding: 28px; place-items: center; background: radial-gradient(circle at 50% 45%, rgba(255,100,31,.12), transparent 28%), var(--black); }
.handoff-card { width: min(520px, 100%); padding: 42px; border: 1px solid var(--line); border-top-color: rgba(255,100,31,.6); border-radius: 18px; background: rgba(21,21,21,.96); box-shadow: var(--shadow); text-align: center; }
.handoff-card .brand-lockup { width: 205px; margin: 0 auto 36px; }
.handoff-card h1 { margin: 0; font: 680 29px Raleway, sans-serif; letter-spacing: -.03em; }
.handoff-card > p:not(.eyebrow) { margin: 12px 0 24px; color: var(--muted); font-size: 11px; line-height: 1.65; }
.handoff-card form { margin: 0 0 18px; }
.handoff-card small { color: #74736f; font-size: 9px; }
.handoff-spinner { display: block; width: 42px; height: 42px; margin: 0 auto 25px; border: 2px solid var(--line-strong); border-top-color: var(--mail-orange); border-radius: 50%; animation: handoff-spin .8s linear infinite; }
@keyframes handoff-spin { to { transform: rotate(360deg); } }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-grid--server { grid-template-columns: 1fr 92px; }
.provider-helper { display: grid; grid-template-columns: 1fr 150px auto; align-items: end; gap: 12px; margin: 24px 0 18px; padding: 15px; border: 1px solid rgba(255,100,31,.2); border-radius: 10px; background: rgba(255,100,31,.035); }
.provider-helper > div { display: flex; flex-direction: column; gap: 5px; }
.provider-helper b { font-size: 14px; }
.provider-helper small { color: var(--muted); font-size: 12px; line-height: 1.5; }
.provider-helper label { margin: 0; }
.provider-helper input, .provider-helper .button { min-height: 40px; }
.form-step-label { margin: 24px 0 16px; color: var(--mail-orange); font-size: 12px; font-weight: 800; letter-spacing: .12em; }
.form-security { display: flex; gap: 11px; margin: 22px 0; padding: 14px; border: 1px solid rgba(124,219,156,.18); border-radius: 10px; background: rgba(124,219,156,.04); }
.form-security > span { display: grid; flex: 0 0 auto; place-items: center; width: 26px; height: 26px; border-radius: 50%; color: var(--success); background: rgba(124,219,156,.1); }
.form-security p { display: flex; flex-direction: column; gap: 4px; margin: 0; }
.form-security b { font-size: 14px; }
.form-security small { color: var(--muted); font-size: 12px; line-height: 1.5; }
.notice { padding: 17px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); font-size: 13px; line-height: 1.65; }
.notice--warning { border-color: rgba(255,100,31,.24); background: rgba(255,100,31,.05); }
.notice strong, .notice span { display: block; }
.notice strong { margin-bottom: 8px; color: var(--white); font-size: 15px; }
.notice a { color: var(--mail-orange-soft); text-decoration: underline; text-underline-offset: 3px; }
.provisioning-steps { display: grid; gap: 9px; margin-top: 14px; }
.provisioning-steps span { display: flex; align-items: center; gap: 11px; color: var(--muted); font-size: 13px; }
.provisioning-steps b { display: grid; width: 28px; height: 28px; place-items: center; border: 1px solid rgba(255,100,31,.25); border-radius: 50%; color: var(--mail-orange); font-size: 11px; }
.danger-zone { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.danger-zone button { padding: 0; border: 0; color: var(--danger); background: transparent; cursor: pointer; font-size: 10px; }
.invite-result { margin-top: 22px; padding: 16px; border: 1px solid rgba(255,100,31,.25); border-radius: 12px; background: rgba(255,100,31,.05); }
.invite-result > p:not(.eyebrow) { color: var(--muted); font-size: 10px; }
.invite-result > div { display: flex; gap: 8px; }
.invite-result input { min-width: 0; font-size: 9px; }
.address-field { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; border: 1px solid var(--line-strong); border-radius: 10px; background: #101010; }
.address-field:focus-within { border-color: rgba(255,100,31,.65); box-shadow: 0 0 0 3px rgba(255,100,31,.09); }
.address-field input { border: 0; box-shadow: none; }
.address-field b { padding: 0 14px 0 8px; color: var(--muted); font-size: 11px; }
.provision-list { display: grid; }
.provision-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.provision-row:last-child { border-bottom: 0; }
.provision-row > div { display: flex; min-width: 0; flex-direction: column; gap: 4px; }
.provision-row b, .provision-row small, .provision-row em { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.provision-row b { font-size: 11px; }
.provision-row small { color: var(--muted); font-size: 9px; }
.provision-row em { color: var(--danger); font-size: 9px; font-style: normal; }
.user-list { display: grid; }
.user-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.user-row:last-child { border-bottom: 0; }
.user-row > div { display: flex; min-width: 0; flex-direction: column; gap: 4px; }
.user-row b, .user-row small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-row b { font-size: 15px; }
.user-row small { color: var(--muted); font-size: 12px; }
.user-status { padding: 6px 9px; border-radius: 999px; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; }
.user-status--active { color: var(--success); background: rgba(124,219,156,.08); }
.user-status--disabled { color: var(--danger); background: rgba(239,106,106,.08); }
.user-status--queued, .user-status--processing { color: var(--mail-orange-soft); background: rgba(255,100,31,.08); }
.user-status--ready, .user-status--claimed { color: var(--success); background: rgba(124,219,156,.08); }
.user-status--needs_review { color: var(--danger); background: rgba(239,106,106,.08); }

.error-page { display: grid; min-height: calc(100vh - 79px); place-items: center; padding: 30px; background: radial-gradient(circle, rgba(255,100,31,.07), transparent 38%), var(--black); }

@media (max-width: 1100px) {
  .mail-layout { grid-template-columns: 220px minmax(330px, 390px) 1fr; }
  .profile-copy { display: none; }
  .settings-grid, .settings-grid--admin { grid-template-columns: 1fr; }
  .admin-overview { grid-template-columns: 1fr 1fr 1fr; }
  .webmail-account-grid { grid-template-columns: repeat(2, minmax(240px, 1fr)); }
}

@media (max-width: 820px) {
  .topbar { grid-template-columns: 1fr auto; min-height: 66px; padding: 0 15px; }
  .topnav { position: fixed; right: 0; bottom: 0; left: 0; z-index: 50; height: 58px; justify-content: space-around; gap: 0; border-top: 1px solid var(--line); background: #111; }
  .topnav a { flex: 1; font-size: 12px; }
  .profile-menu .avatar { display: none; }
  .mail-layout { grid-template-columns: minmax(300px, 42%) 1fr; height: calc(100vh - 124px); }
  .mail-sidebar { position: fixed; z-index: 40; top: 66px; bottom: 58px; left: 0; width: min(280px, 82vw); box-shadow: 25px 0 60px rgba(0,0,0,.5); transform: translateX(-105%); transition: transform .2s ease; }
  .mail-sidebar.is-open { transform: translateX(0); }
  .sidebar-toggle { display: grid; }
  .mail-layout--compose { grid-template-columns: 1fr; }
  .reading-panel { padding: 26px; }
  .auth-layout { grid-template-columns: 1fr; }
  .auth-brand-panel { min-height: 290px; padding: 32px; }
  .auth-brand-panel--compact { min-height: 220px; }
  .auth-statement { margin: 52px 0 20px; }
  .auth-statement h1 { font-size: 40px; }
  .auth-statement > p:last-child, .secure-note { display: none; }
  .auth-form-panel { padding: 28px 20px 50px; }
  .settings-page { min-height: calc(100vh - 124px); padding: 34px 18px 90px; }
  .account-paths { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .mail-layout { grid-template-columns: 1fr; }
  .reading-placeholder { display: none; }
  .message-list-panel--compact { display: none; }
  .reading-panel { grid-column: 1; }
  .topbar .brand-lockup { width: 150px; }
  .profile-menu { gap: 4px; }
  .panel-header { min-height: 76px; padding: 16px 18px 10px; }
  .search { margin-right: 14px; margin-left: 14px; }
  .message-row { padding-right: 14px; padding-left: 14px; }
  .reading-panel { padding: 22px 18px 80px; }
  .reading-header { flex-direction: column; }
  .sender-card small { white-space: normal; }
  .message-primary-actions { padding-left: 0; }
  .reading-actions { justify-content: flex-start; }
  .compose-panel { padding: 0 12px 80px; }
  .compose-form { border-radius: 13px; }
  .compose-from, .compose-line { grid-template-columns: 58px 1fr; padding: 0 14px; }
  .compose-body textarea { min-height: 310px; padding: 20px 16px; }
  .compose-footer { align-items: stretch; flex-direction: column; }
  .compose-footer .button { width: 100%; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .admin-overview { grid-template-columns: 1fr; }
  .settings-card { padding: 20px; }
  .field-grid, .field-grid--server { grid-template-columns: 1fr; gap: 0; }
  .provider-helper { grid-template-columns: 1fr; }
  .provider-helper .button { width: 100%; }
  .user-row { grid-template-columns: auto minmax(0,1fr) auto; }
  .user-row form { grid-column: 2 / -1; }
  .provision-row { grid-template-columns: auto minmax(0,1fr) auto; }
  .provision-row form { grid-column: 2 / -1; }
  .auth-card { padding: 28px 22px; }
  .auth-brand-panel { padding: 25px; }
  .brand--large .brand-lockup { width: min(290px, 78vw); }
  .auth-statement { margin-top: 34px; }
  .webmail-hero { min-height: 300px; padding: 28px 22px; }
  .webmail-hero__mark { right: -16px; bottom: -36px; opacity: .55; }
  .webmail-account-grid { grid-template-columns: 1fr; }
  .handoff-card { padding: 30px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
