:root {
  --ink: #495057; --muted: #6e7687; --primary: #467fcf;
  --primary-fill: #3d75c6; --primary-ink: #2e65b3;
  --purple: var(--primary); --line: #e0e5eb; --bg: #f5f7fb; --green: #267953;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 "Source Sans Pro",-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif; }
a { color: var(--primary-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
button,input,select { font: inherit; }
button,a,input,select,summary { outline-offset: 4px; }
:focus-visible { outline: 3px solid var(--primary-ink); }
[hidden] { display: none !important; }
.app-header { background: #fff; border-bottom: 1px solid var(--line); }
.header-inner,.main-nav { max-width: 1180px; margin: auto; padding: 0 28px; }
.header-inner { min-height: 62px; display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-size: 20px; font-weight: 750; letter-spacing: -.6px; }
.brand:hover { text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; background: var(--primary-fill); color: #fff; border-radius: 3px; font-size: 22px; }
.header-tools { display: flex; align-items: center; gap: 18px; }
.pilot-badge { color: var(--muted); background: var(--bg); border: 1px solid var(--line); border-radius: 3px; padding: 4px 9px; font-size: 12px; }
.sign-out { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 10px; }
.navigation-bar { background: #fff; border-bottom: 1px solid var(--line); }
.main-nav { display: flex; flex-wrap: wrap; gap: 20px; }
.main-nav a { padding: 15px 4px; border-bottom: 1px solid transparent; color: var(--muted); font-weight: 400; transition: color .3s ease, border-color .3s ease, background-color .3s ease; }
.main-nav a:hover,.main-nav a:focus-visible { color: var(--primary-ink); border-bottom-color: var(--primary); text-decoration: none; }
.main-nav a[aria-current] { color: var(--primary-ink); border-bottom-color: var(--primary); }
.content { max-width: 1180px; margin: auto; padding: 32px 28px 48px; min-height: 70vh; }
.app-footer { max-width: 1180px; padding: 24px 28px; margin: auto; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.skip-link { position: absolute; left: 16px; top: -100px; background: #fff; padding: 12px; z-index: 5; }
.skip-link:focus { top: 10px; }
h1 { font-size: 29px; line-height: 1.25; letter-spacing: -.7px; margin: 0 0 8px; overflow-wrap: anywhere; }
h2 { font-size: 16px; margin: 0; }
h3 { font-size: 18px; margin: 12px 0; }
p { color: var(--muted); line-height: 1.7; margin: 0; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; flex-wrap: wrap; }
.eyebrow { display: block; color: var(--primary); font-size: 11px; font-weight: 650; letter-spacing: 1px; margin-bottom: 8px; }
.inbox-heading { min-width: 0; max-width: 100%; }
.inbox-address { color: var(--muted); font-size: .75em; font-weight: 500; letter-spacing: 0; }
.subtitle { margin: 8px 0 24px; overflow-wrap: anywhere; }
.actions,.card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 6px; min-height: 38px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 3px; color: var(--ink); background: #fff; font-size: 13px; font-weight: 600; cursor: pointer; line-height: 24px; }
.button:hover { text-decoration: none; background: #eef1f5; border-color: #c6cdd6; }
.button.primary { color: #fff; background: var(--primary-fill); border-color: var(--primary-fill); }
.button.primary:hover { background: #3568b1; border-color: #3568b1; }
.button.subtle { color: var(--primary-ink); background: #fff; border-color: var(--primary); }
.button.subtle:hover { color: #fff; background: var(--primary-fill); border-color: var(--primary-fill); }
.button.danger { color: #b12f3e; border-color: #cd5966; background: #fff; }
.button.danger:hover { color: #fff; background: #b12f3e; border-color: #b12f3e; }
.button:disabled { opacity: .6; cursor: not-allowed; }
.button.full { width: 100%; margin-top: 16px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 3px; box-shadow: 0 1px 2px #00000005; min-width: 0; }
.panel-heading { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.count { background: #edf2f7; color: var(--muted); padding: 3px 8px; border-radius: 5px; font-size: 12px; margin-left: 6px; }
.summary-strip { display: flex; gap: 22px; flex-wrap: wrap; margin: -4px 0 24px; color: var(--muted); }
.summary-strip strong { color: var(--ink); }
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.filter-panel { padding: 18px 20px; margin-bottom: 24px; }
.filter-form { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
.filter-form > div { min-width: 0; }
.filter-form .search-field { flex: 1; min-width: 200px; }
label { display: block; font-size: 13px; font-weight: 600; margin: 20px 0 8px; }
.filter-form label { margin: 0 0 6px; font-size: 12px; }
input,select { width: 100%; max-width: 100%; min-width: 0; min-height: 38px; padding: 8px 12px; border: 1px solid #cdd3dc; border-radius: 3px; background: #fff; color: var(--ink); }
.filter-form select { max-width: 285px; }
input[type=checkbox] { width: auto; min-height: auto; }
.input-hint { display: block; color: var(--muted); font-size: 12px; line-height: 1.7; margin-top: 9px; }
.list-heading { display: flex; justify-content: space-between; gap: 16px; align-items: start; margin: 16px 0; }
.inline-help { max-width: 390px; font-size: 12px; }
summary { cursor: pointer; color: var(--primary-ink); font-weight: 600; }
.inline-help p { margin-top: 10px; }
.alias-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.alias-card { padding: 20px; }
.alias-card-heading { display: flex; gap: 12px; justify-content: space-between; align-items: start; }
.alias-info { min-width: 0; flex: 1; }
.alias-info strong { display: block; font-size: 14px; overflow-wrap: anywhere; }
.alias-info span { display: block; color: var(--muted); margin-top: 5px; overflow-wrap: anywhere; }
.alias-meta { display: flex; gap: 8px 18px; flex-wrap: wrap; color: var(--muted); font-size: 12px; margin: 18px 0; }
.badge { display: inline-block; background: #e8f5ec; color: #216c47; border-radius: 20px; font-size: 11px; font-weight: 650; padding: 4px 9px; white-space: nowrap; }
.pending-badge { background: #fff2dc; color: #805917; }
.card-actions { border-top: 1px solid var(--line); padding-top: 16px; }
.card-actions .button { min-height: 32px; padding: 3px 10px; font-size: 12px; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 20px; margin-top: 20px; flex-wrap: wrap; }
.pagination span { font-size: 12px; color: var(--muted); }
.empty-state { padding: 55px 24px; text-align: center; grid-column: 1/-1; }
.empty-state h3 { margin-top: 0; }
.empty-state .button { margin-top: 20px; }
.empty-icon { font-size: 28px; color: var(--primary); margin: 0 auto 15px; }
.stats { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; margin-bottom: 24px; }
.stat { padding: 18px 22px; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.stat span,.stat small { display: block; color: var(--muted); font-size: 12px; }
.stat strong { display: block; font-size: 27px; margin: 5px 0; }
.stat .stat-text { color: var(--primary); font-size: 24px; }
.message-row { display: flex; align-items: center; gap: 14px; padding: 18px 22px; border-bottom: 1px solid var(--line); color: var(--ink); }
.message-row:hover { background: #f5f8fe; text-decoration: none; }
.sender-avatar { display: grid; place-items: center; width: 36px; height: 36px; flex-shrink: 0; background: #edf3fc; color: var(--primary); border-radius: 50%; }
.message-main { flex: 1; min-width: 0; }
.message-main strong,.message-main span,.message-recipient strong,.message-recipient span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.message-main span,.message-recipient span { color: var(--muted); font-size: 12px; margin-top: 4px; }
.message-recipient { width: 230px; min-width: 0; font-size: 12px; }
.message-row time { color: var(--muted); font-size: 12px; white-space: nowrap; }
.form-panel { max-width: 650px; padding: 24px; margin: 20px 0; }
.form-panel h2 { margin: 10px 0; }
.back-link { display: inline-block; margin-bottom: 20px; color: var(--muted); }
.info-box { padding: 14px 16px; border: 1px solid #cbdcf3; background: #f0f5fc; border-radius: 6px; color: #385e8e; font-size: 13px; line-height: 1.7; }
.action-notice { margin-bottom: 20px; }
.form-error { padding: 12px 0; color: #a62d3a; font-size: 13px; }
.form-error ul { padding-left: 20px; }
.muted { color: var(--muted); font-size: 12px; }
.text-link { color: var(--primary-ink); font-size: 13px; }
.format-help { padding: 14px; margin-top: 16px; background: #f7f9fc; border: 1px solid var(--line); border-radius: 6px; font-size: 13px; }
.format-help p { margin-top: 12px; }
.format-help code,.credential code { overflow-wrap: anywhere; }
.format-help dt { margin-top: 12px; font-weight: 600; }
.format-help dd { margin: 4px 0; color: var(--muted); }
.format-presets { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 12px; color: var(--muted); font-size: 12px; }
.format-presets button { background: #fff; color: var(--primary-ink); border: 1px solid var(--primary); padding: 6px 10px; border-radius: 3px; cursor: pointer; }
.format-presets button:hover { background: #edf3fb; }
.domain-choice { display: flex; justify-content: space-between; gap: 12px; margin: 20px 0; background: var(--bg); padding: 16px; border-radius: 5px; }
.forwarding-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; }
.forwarding-grid .form-panel { max-width: none; }
.forwarding-grid h3 { overflow-wrap: anywhere; }
.alias-row { display: flex; gap: 16px; align-items: center; padding: 20px 24px; border-bottom: 1px solid var(--line); color: var(--ink); }
.alias-row:hover { background: #f5f8fe; text-decoration: none; }
.alias-icon { color: var(--primary); font-size: 25px; }
.dns-value { display: block; overflow-wrap: anywhere; padding: 14px; background: #f5f7fb; border: 1px solid var(--line); border-radius: 5px; margin: 12px 0; }
.credential { padding: 15px 0; border-bottom: 1px solid var(--line); }
.credential span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.credential code { color: #315a91; }
.delivery-panel { margin-top: 24px; }
.delivery-row { display: flex; gap: 12px; justify-content: space-between; align-items: start; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.delivery-row div { min-width: 0; }
.delivery-row strong,.delivery-row span { display: block; overflow-wrap: anywhere; }
.delivery-row div>span,.delivery-row p { font-size: 12px; color: var(--muted); margin-top: 5px; }
.page-note { font-size: 12px; text-align: center; color: var(--muted); margin-top: 20px; }
.reader-layout { max-width: 960px; margin: 0 auto; }
.reader-toolbar { margin-bottom: 18px; }
.reader-toolbar .back-link { margin: 0; }
.email-panel { overflow: hidden; }
.email-header { padding: 26px 30px 20px; border-bottom: 1px solid var(--line); }
.email-panel h1 { font-size: 24px; color: #343a40; margin-bottom: 18px; }
.email-details { margin: 0; }
.email-details div { display: flex; gap: 16px; margin: 8px 0; font-size: 13px; }
.email-details span { width: 100px; color: var(--muted); flex-shrink: 0; }
.email-details strong { font-weight: 500; overflow-wrap: anywhere; }
.email-canvas { padding: 24px; background: var(--bg); }
.email-body { max-width: 72ch; margin: 0 auto; white-space: pre-wrap; overflow-wrap: anywhere; font: 15px/1.8 "Source Sans Pro",-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif; padding: 16px 0; color: var(--ink); }
.email-frame { display: block; width: 100%; max-width: 800px; height: 680px; border: 1px solid var(--line); border-radius: 3px; background: #fff; margin: 0 auto; }
.email-privacy { display: flex; align-items: start; gap: 9px; padding: 12px 30px; background: #f0f5fc; border-bottom: 1px solid var(--line); }
.email-privacy p { color: #526881; font-size: 12px; }
.privacy-mark { color: var(--green); line-height: 20px; }
.email-plain { padding: 16px 30px; border-top: 1px solid var(--line); }
.email-plain[open] summary { margin-bottom: 12px; }
.plain-canvas { min-height: 260px; background: #fff; padding: 24px 30px; }
.email-options { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; margin-top: 18px; }
.email-options .format-help { margin: 0; background: #fff; border-radius: 3px; padding: 16px 18px; }
.email-options .button { margin-top: 14px; }
.recovery-panel { max-width: none; }
.recovery-panel>.panel-heading { padding: 0 0 16px; }
.recovery-panel>p,.recovery-panel>form { margin-top: 16px; }
.copy-status { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); border-radius: 6px; background: #253348; color: #fff; padding: 12px 20px; z-index: 10; max-width: calc(100vw - 32px); font-size: 13px; }
.copy-status:empty { display: none; }
.login-shell { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; background: #fff; }
.login-intro { padding: 48px 56px; background: #edf3fc; display: flex; flex-direction: column; }
.intro-copy { margin: auto 0; padding: 50px 0; }
.intro-copy h1 { font-size: 42px; margin: 18px 0; }
.intro-copy p { margin-bottom: 24px; }
.intro-feature { margin: 14px 0; color: var(--muted); }
.intro-feature span { margin-right: 12px; color: var(--primary); }
.login-intro>small { color: var(--muted); }
.login-form-wrap { display: flex; align-items: center; justify-content: center; padding: 50px; }
.login-form { width: 100%; max-width: 340px; }
.login-form h2 { font-size: 28px; margin: 15px 0; }
.login-form p { margin-bottom: 24px; }
.login-footer { text-align: center; font-size: 12px; color: var(--muted); margin-top: 20px; }
.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; }
@media (max-width: 900px) {
  .alias-grid,.forwarding-grid { grid-template-columns: 1fr; }
  .message-recipient { width: 170px; }
}
@media (max-width: 600px) {
  .header-inner { padding: 16px; gap: 10px; }
  .brand { font-size: 17px; }
  .header-tools { gap: 4px; }
  .pilot-badge { display: none; }
  .main-nav { padding: 0 12px; gap: 0 14px; }
  .main-nav a { font-size: 12px; padding: 12px 2px 9px; }
  .content { padding: 24px 16px 36px; }
  .page-heading { align-items: start; }
  h1 { font-size: 25px; }
  .stats { grid-template-columns: 1fr; gap: 10px; }
  .stat { padding: 12px 16px; }
  .stat strong { font-size: 23px; }
  .filter-form > div,.filter-form .search-field { width: 100%; flex: auto; min-width: 0; }
  .filter-form select { max-width: none; }
  .list-heading { flex-wrap: wrap; }
  .message-row { align-items: start; padding: 16px; flex-wrap: wrap; gap: 8px; }
  .message-main { flex-basis: calc(100% - 46px); }
  .message-recipient { width: auto; flex: 1; margin-left: 44px; }
  .message-row time { font-size: 11px; }
  .alias-card,.form-panel { padding: 18px; }
  .alias-card-heading,.alias-row { flex-wrap: wrap; }
  .email-header { padding: 20px 18px 16px; }
  .email-panel h1 { font-size: 21px; }
  .email-details div { gap: 10px; }
  .email-details span { width: 78px; }
  .email-canvas { padding: 12px; }
  .email-frame { height: 560px; }
  .email-privacy { padding: 12px 18px; }
  .email-plain,.plain-canvas { padding: 16px 18px; }
  .email-options { grid-template-columns: 1fr; }
  .app-footer { padding: 20px 16px; }
  .login-shell { grid-template-columns: 1fr; }
  .login-intro { padding: 24px; }
  .intro-copy,.login-intro>small { display: none; }
  .login-form-wrap { padding: 40px 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .main-nav a { transition: none; }
}

.bulk-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; margin-bottom: 18px; padding: 16px 20px; }
.bulk-toolbar .actions { margin-left: auto; }
.selection-control { display: inline-flex; align-items: center; gap: 9px; margin: 0; cursor: pointer; }
.selection-control[hidden] { display: none; }
.selection-control input, .alias-checkbox { width: 18px; height: 18px; accent-color: var(--primary); flex: 0 0 auto; cursor: pointer; }
.alias-checkbox { margin: 3px 0 0; }
.alias-card:has(.alias-checkbox:checked) { border-color: var(--primary); background: #f0f5fd; }
.alias-review-list { padding: 0; list-style: none; margin: 24px 0; }
.alias-review-list li { padding: 12px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.alias-review-list span { display: block; color: var(--muted); font-size: .875rem; }
.button:disabled { opacity: .55; cursor: not-allowed; }
@media (max-width: 600px) { .bulk-toolbar .actions { margin-left: 0; width: 100%; } }
