:root {
  color-scheme: light;
  --navy: #0b1727;
  --navy-soft: #14243a;
  --canvas: #f4f6f9;
  --card: #ffffff;
  --ink: #172033;
  --muted: #667085;
  --muted-light: #98a2b3;
  --line: #e4e8ef;
  --line-strong: #d2d8e2;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --blue-soft: #eff6ff;
  --green: #15955f;
  --green-soft: #eaf8f1;
  --amber: #b7791f;
  --amber-soft: #fff8e7;
  --red: #c13c4b;
  --red-soft: #fff0f2;
  --violet: #7656d6;
  --violet-soft: #f3f0ff;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-md: 0 8px 28px rgba(16, 24, 40, .09);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 14px/1.5 Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea, select { font: inherit; }
button, summary { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 3px solid rgba(37, 99, 235, .28);
  outline-offset: 2px;
}

.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;
}

.app-shell { min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  width: 244px;
  padding: 24px 18px 20px;
  overflow-y: auto;
  background: var(--navy);
  color: #d9e2ef;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 0 6px;
}

.brand-mark {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(145deg, #3b82f6, #1d4ed8);
  box-shadow: 0 5px 16px rgba(37, 99, 235, .35);
  color: white;
  font-size: 17px;
  font-weight: 800;
}

.brand > span:last-child { display: grid; min-width: 0; }
.brand strong { color: #fff; font-size: 15px; letter-spacing: -.01em; }
.brand small { color: #8fa0b7; font-size: 10px; letter-spacing: .05em; text-transform: uppercase; }

.sidebar-nav {
  display: grid;
  gap: 4px;
  margin-top: 42px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 8px;
  color: #98a9be;
  font-size: 13px;
  font-weight: 600;
  transition: background .18s ease, color .18s ease;
}

.sidebar-nav a span {
  display: grid;
  width: 20px;
  place-items: center;
  font-size: 15px;
}

.sidebar-nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.sidebar-nav a.active { background: #1b3150; color: #fff; }

.sidebar-footer { margin-top: auto; padding-top: 30px; }

.system-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 10px;
  background: rgba(255, 255, 255, .035);
}

.system-card > span:last-child { display: grid; }
.system-card strong { color: #dbe6f3; font-size: 11px; }
.system-card small { color: #7f91a8; font-size: 10px; }

.status-light {
  display: inline-block;
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  margin-top: 5px;
  border-radius: 50%;
  background: #25c987;
  box-shadow: 0 0 0 3px rgba(37, 201, 135, .12);
}

.sidebar-logout {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #8fa0b7;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}

.sidebar-logout:hover { background: rgba(255, 255, 255, .05); color: #fff; }

.workspace { min-width: 0; margin-left: 244px; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: 64px;
  padding: 0 34px;
  border-bottom: 1px solid rgba(228, 232, 239, .9);
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(14px);
}

.mobile-brand { display: none; }

.topbar-actions { display: flex; align-items: center; gap: 12px; }

.topbar-status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.topbar-status .status-light { margin-top: 0; }
.topbar-divider { width: 1px; height: 15px; margin: 0 3px; background: var(--line); }
.mobile-logout { display: none; margin: 0; }
.mobile-logout button { display: grid; width: 32px; height: 32px; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--muted); cursor: pointer; }

.app-main {
  width: 100%;
  max-width: 1380px;
  margin: 0 auto;
  padding: 34px clamp(22px, 3.2vw, 48px) 70px;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  scroll-margin-top: 84px;
}

.eyebrow {
  color: var(--blue);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.page-heading h1 {
  margin: 3px 0 4px;
  font-size: clamp(28px, 3vw, 36px);
  line-height: 1.2;
  letter-spacing: -.035em;
}

.page-heading p, .section-heading p { margin: 0; color: var(--muted); }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: #344054;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease, background .15s ease;
}

.button:hover:not(:disabled) { border-color: #b8c1ce; box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.button.primary { border-color: var(--blue); background: var(--blue); color: #fff; box-shadow: 0 5px 14px rgba(37, 99, 235, .17); }
.button.primary:hover:not(:disabled) { border-color: var(--blue-dark); background: var(--blue-dark); }
.button.secondary { background: #fff; }
.button.connect { border-color: #b9caf7; background: var(--blue-soft); color: #2452a6; }
.button.ghost { border-color: transparent; background: #f3f5f8; color: #596579; box-shadow: none; }
.button:disabled { cursor: not-allowed; opacity: .45; }
.add-mailbox { padding-inline: 16px; }
.add-mailbox span { font-size: 16px; font-weight: 400; }

.health-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
  padding: 13px 16px;
  border: 1px solid #cee9dc;
  border-radius: 10px;
  background: linear-gradient(90deg, #f0faf5, #f8fcfa);
}

.health-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #d9f3e7;
  color: #147a51;
  font-weight: 900;
}

.health-banner > div:nth-child(2) { display: flex; min-width: 0; gap: 8px; align-items: baseline; }
.health-banner strong { color: #176140; font-size: 12px; }
.health-banner > div span { overflow: hidden; color: #628273; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.health-badge { display: inline-flex; align-items: center; gap: 7px; margin-left: auto; color: #1c6848; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.health-badge .status-light { margin-top: 0; }

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.metric-card {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.metric-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 800;
}

.metric-icon.blue { background: var(--blue-soft); color: var(--blue); }
.metric-icon.green { background: var(--green-soft); color: var(--green); }
.metric-icon.violet { background: var(--violet-soft); color: var(--violet); }
.metric-icon.amber { background: var(--amber-soft); color: var(--amber); }
.metric-card > div { display: grid; min-width: 0; grid-template-columns: auto 1fr; align-items: baseline; }
.metric-card span:not(.metric-icon) { grid-column: 1; color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.metric-card strong { grid-column: 1; margin-top: 1px; font-size: 23px; line-height: 1.15; letter-spacing: -.03em; }
.metric-card small { grid-column: 1 / -1; color: var(--muted-light); font-size: 10px; }

.content-section { margin-top: 42px; scroll-margin-top: 84px; }

.workspace-access { margin-top: 36px; }
.access-path-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.access-path {
  display: flex;
  min-width: 0;
  min-height: 286px;
  flex-direction: column;
  padding: 19px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.access-path.featured { border-color: #cbdafb; background: linear-gradient(150deg, #fff 45%, #f6f9ff); }
.access-path-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.access-icon { display: grid; width: 37px; height: 37px; place-items: center; border-radius: 10px; font-size: 15px; font-weight: 900; }
.access-icon.admin { background: var(--blue-soft); color: var(--blue); }
.access-icon.routing { background: var(--violet-soft); color: var(--violet); }
.access-icon.oauth { background: #fceeee; color: #b23b3b; }
.access-badge { padding: 4px 7px; border-radius: 999px; background: var(--blue-soft); color: #315da9; font-size: 8px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.access-badge.neutral { background: var(--violet-soft); color: #684bbd; }
.access-badge.success { background: var(--green-soft); color: #14754e; }
.access-path h3 { margin: 14px 0 5px; font-size: 16px; letter-spacing: -.02em; }
.access-path > p { margin: 0; color: var(--muted); font-size: 11px; }
.access-benefits { display: grid; gap: 5px; margin: 14px 0 17px; padding: 0; color: #596579; font-size: 10px; list-style: none; }
.access-benefits li { position: relative; padding-left: 17px; }
.access-benefits li::before { position: absolute; left: 0; content: "✓"; color: var(--green); font-weight: 900; }
.access-path > .button { align-self: flex-start; margin-top: auto; }

.organization-records { display: grid; gap: 12px; margin-top: 14px; }
.organization-card { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow-sm); }
.organization-card.routing-card { border-left: 3px solid #8065d9; }
.organization-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.organization-card-head h3 { overflow-wrap: anywhere; margin: 2px 0 0; font-size: 15px; letter-spacing: -.02em; }
.record-kicker { color: var(--muted-light); font-size: 8px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.credential-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(230px, .8fr); gap: 9px; margin-top: 15px; }
.credential-grid > div { display: grid; min-width: 0; gap: 3px; padding: 10px 11px; border: 1px solid #edf0f4; border-radius: 8px; background: #fafbfc; }
.credential-grid > .wide { grid-column: 1 / -1; }
.credential-grid span { color: var(--muted-light); font-size: 8px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.credential-grid strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.copy-field { position: relative; padding-right: 58px !important; }
.copy-field code { overflow: hidden; color: #445167; font: 10px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; text-overflow: ellipsis; white-space: nowrap; }
.copy-field button { position: absolute; top: 50%; right: 8px; padding: 4px 7px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--blue); cursor: pointer; font-size: 8px; font-weight: 800; transform: translateY(-50%); }
.inline-warning { display: flex; align-items: flex-start; gap: 8px; margin: 10px 0 0; padding: 9px 10px; border-radius: 8px; background: var(--red-soft); color: #9f3442; font-size: 10px; overflow-wrap: anywhere; }
.inline-warning > span { font-weight: 900; }
.setup-details { margin-top: 12px; border-top: 1px solid var(--line); }
.setup-details > summary { padding: 12px 0 0; color: #465268; cursor: pointer; font-size: 10px; font-weight: 800; list-style-position: inside; }
.setup-checklist { display: grid; gap: 7px; margin: 12px 0; padding-left: 22px; color: #5f6a7b; font-size: 10px; }
.setup-checklist code { padding: 1px 4px; border-radius: 4px; background: #f1f4f8; color: #344054; font-size: 9px; }
.record-actions { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 8px; }
.record-actions form { margin: 0; }
.test-access-form { display: grid; grid-template-columns: minmax(190px, 250px) auto; align-items: end; gap: 8px; }
.test-access-form label { grid-column: 1 / -1; margin-bottom: -5px; font-size: 9px; }
.test-access-form input { margin: 0; }
.record-footnote { margin: 9px 0 0; color: var(--muted-light); font-size: 9px; }
.routing-summary { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 13px; }
.routing-summary span { padding: 4px 7px; border: 1px solid #e3def6; border-radius: 999px; background: #f8f6ff; color: #66539d; font-size: 8px; font-weight: 700; }
.confirm-routing-form { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.confirm-routing-form label { display: flex; align-items: center; gap: 7px; max-width: 330px; color: #536073; font-size: 9px; font-weight: 600; }
.confirm-routing-form input[type="checkbox"], .routing-options input[type="checkbox"] { flex: 0 0 auto; width: 16px; height: 16px; margin: 0; accent-color: var(--blue); }

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 13px;
}

.section-heading h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0 0;
  font-size: 20px;
  letter-spacing: -.025em;
}

.count-badge {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #e9edf3;
  color: #5b6575;
  font-size: 10px;
}

.section-heading > p { font-size: 11px; }
.mailbox-list { display: grid; gap: 13px; }

.mailbox-card {
  min-width: 0;
  padding: 19px 20px 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.mailbox-topline { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.mailbox-identity { display: flex; align-items: center; min-width: 0; gap: 12px; }

.provider-avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #eaf0ff;
  color: #3456a6;
  font-size: 14px;
  font-weight: 800;
}

.provider-gmail { background: #fceeee; color: #b23b3b; }
.provider-google_workspace { background: var(--blue-soft); color: var(--blue); }
.provider-rackspace { background: #e9f1ff; color: #225db6; }
.provider-outlook { background: #e6f3ff; color: #146eb4; }
.provider-yahoo { background: #f3edff; color: #7240b9; }
.provider-aol { background: #e9f4ff; color: #2267b5; }
.provider-zoho { background: #fff1e6; color: #b2541e; }
.provider-icloud { background: #edf1f5; color: #4a5664; }
.provider-fastmail { background: #f2edff; color: #6d4bd0; }

.mailbox-identity > div { min-width: 0; }
.identity-meta { display: flex; gap: 10px; color: var(--muted-light); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.identity-meta span:first-child { color: var(--blue); }
.mailbox-identity h3 { overflow: hidden; margin: 2px 0 0; font-size: 15px; letter-spacing: -.015em; text-overflow: ellipsis; white-space: nowrap; }

.status-pill {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #f1f3f6;
  color: #596273;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.status-pill .status-light { width: 6px; height: 6px; margin: 0; background: #98a2b3; box-shadow: none; }
.status-pill.live, .status-pill.forwarded { background: var(--green-soft); color: #14754e; }
.status-pill.live .status-light { background: #1fbf7a; box-shadow: 0 0 0 3px rgba(31, 191, 122, .12); }
.status-pill.pending { background: var(--amber-soft); color: #946313; }
.status-pill.rejected { background: var(--red-soft); color: #a72f40; }
.status-pill.paused, .status-pill.skipped { background: #f1f3f6; color: #667085; }
.status-pill.compact { padding: 4px 8px; font-size: 8px; }

.route-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 10px 13px;
  border: 1px solid #edf0f4;
  border-radius: 9px;
  background: #f8f9fb;
}

.route-endpoint { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; align-items: center; gap: 9px; min-width: 0; }
.endpoint-dot { width: 7px; height: 7px; border-radius: 50%; background: #d46a78; box-shadow: 0 0 0 3px rgba(212, 106, 120, .09); }
.endpoint-dot.connected { background: #24b777; box-shadow: 0 0 0 3px rgba(36, 183, 119, .1); }
.route-endpoint > div { display: grid; min-width: 0; }
.route-endpoint span { color: var(--muted-light); font-size: 8px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.route-endpoint strong { overflow: hidden; color: #394254; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.route-endpoint small { padding-left: 7px; color: #748094; font-size: 9px; white-space: nowrap; }
.route-arrow { color: #aab2bf; text-align: center; }

.error-box {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 13px;
  padding: 10px 12px;
  border: 1px solid #ffd1d7;
  border-radius: 8px;
  background: var(--red-soft);
  color: #9f3442;
  font-size: 11px;
}

.error-box[hidden] { display: none; }
.error-symbol { display: grid; flex: 0 0 auto; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: #f9d3d8; font-size: 10px; font-weight: 900; }
.error-box > span:nth-child(2) { min-width: 0; overflow-wrap: anywhere; }
.error-box form { margin: 0 0 0 auto; }
.dismiss { padding: 0 5px; border: 0; background: transparent; color: #9f3442; cursor: pointer; font-size: 19px; line-height: 1; }

.mailbox-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 16px;
  border: 1px solid #edf0f4;
  border-radius: 9px;
  overflow: hidden;
}

.mailbox-metrics > div { display: grid; gap: 1px; padding: 11px 13px; border-right: 1px solid #edf0f4; }
.mailbox-metrics > div:last-child { border-right: 0; }
.mailbox-metrics span { color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; }
.mailbox-metrics strong { font-size: 17px; letter-spacing: -.02em; }

.progress-row { display: grid; grid-template-columns: 190px minmax(120px, 1fr) auto; align-items: center; gap: 16px; padding: 14px 2px 16px; }
.progress-copy { display: grid; }
.progress-copy span { color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; }
.progress-copy strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.progress-track { height: 6px; overflow: hidden; border-radius: 999px; background: #e9edf2; }
.progress-track i { display: block; max-width: 100%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #346be8, #25a778); transition: width .35s ease; }
.secondary-stats { display: flex; justify-content: flex-end; gap: 11px; color: var(--muted); font-size: 9px; white-space: nowrap; }
.secondary-stats b { color: #465165; }

.mailbox-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
  margin: 0 -20px;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  background: #fbfcfd;
  border-radius: 0 0 12px 12px;
}

.settings-panel { position: relative; min-width: 0; }
.settings-panel > summary { display: inline-flex; align-items: center; gap: 7px; padding: 8px 2px; color: #5b6575; cursor: pointer; font-size: 11px; font-weight: 700; list-style: none; }
.settings-panel > summary::-webkit-details-marker, .more-menu > summary::-webkit-details-marker { display: none; }
.settings-panel[open] { width: min(520px, 100%); }
.settings-form { display: grid; gap: 7px; margin-top: 8px; padding: 16px; border: 1px solid var(--line); border-radius: 9px; background: #fff; box-shadow: var(--shadow-md); }

.scan-window-control {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  padding: 13px;
  border: 1px solid #dce4f1;
  border-radius: 9px;
  background: #f8faff;
}

.field-heading { display: grid; gap: 1px; }
.field-heading label { margin: 0; }
.field-heading small { color: var(--muted); font-size: 9px; }
.scan-window-grid { display: grid; grid-template-columns: minmax(0, 1fr) 130px; gap: 8px; }
.scan-window-grid select { margin: 0; background: #fff; }
.custom-days { position: relative; display: flex; align-items: center; margin: 0; }
.custom-days[hidden] { display: none; }
.custom-days input { height: 39px; margin: 0; padding-right: 42px; background: #fff; }
.custom-days > span:last-child { position: absolute; right: 11px; color: var(--muted); font-size: 9px; font-weight: 700; pointer-events: none; }
.scan-summary { display: flex; align-items: center; gap: 6px; color: #46618e; font-size: 9px; }
.scan-summary::before { content: "↳"; color: var(--blue); font-weight: 800; }
.settings-impact { display: flex; align-items: flex-start; gap: 7px; margin: 4px 0 3px; color: var(--muted); font-size: 9px; }
.settings-impact > span { display: grid; flex: 0 0 auto; width: 15px; height: 15px; place-items: center; border-radius: 50%; background: #e7edf8; color: #4265a1; font-size: 8px; font-weight: 900; }

label { display: block; color: #344054; font-size: 11px; font-weight: 700; }
label small { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; font-weight: 500; }

input, textarea, select {
  display: block;
  width: 100%;
  margin-top: 5px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  transition: border-color .15s ease, box-shadow .15s ease;
}

input, select { height: 39px; padding: 0 11px; }
textarea { min-height: 92px; padding: 10px 11px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: #75a0f6; outline: none; box-shadow: 0 0 0 3px rgba(37, 99, 235, .1); }
input::placeholder, textarea::placeholder { color: #a5adba; }

.mailbox-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.mailbox-actions form { margin: 0; }

.more-menu { position: relative; }
.more-menu > summary { display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; color: var(--muted); cursor: pointer; list-style: none; letter-spacing: 1px; }
.more-menu form { position: absolute; z-index: 5; top: 44px; right: 0; width: 150px; padding: 6px; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: var(--shadow-md); }
.menu-danger { width: 100%; padding: 8px; border: 0; border-radius: 6px; background: transparent; color: var(--red); cursor: pointer; font-size: 11px; font-weight: 700; text-align: left; }
.menu-danger:hover { background: var(--red-soft); }

.empty-state { display: grid; justify-items: center; padding: 48px 20px; border: 1px dashed #cbd2dd; border-radius: 12px; background: rgba(255,255,255,.55); text-align: center; }
.empty-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: var(--blue-soft); color: var(--blue); font-size: 19px; }
.empty-state h3 { margin: 13px 0 3px; font-size: 16px; }
.empty-state p { max-width: 450px; margin: 0 0 16px; color: var(--muted); font-size: 12px; }

.activity-section { margin-top: 24px; }
.activity-collapsible { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow-sm); }
.activity-summary { display: flex; align-items: center; gap: 13px; min-height: 74px; padding: 13px 16px; cursor: pointer; list-style: none; transition: background-color .15s ease; }
.activity-summary::-webkit-details-marker { display: none; }
.activity-summary:hover { background: #fafbfc; }
.activity-summary:focus-visible { outline: 3px solid rgba(37, 99, 235, .18); outline-offset: -3px; }
.activity-summary-icon { display: grid; flex: 0 0 auto; width: 38px; height: 38px; place-items: center; border-radius: 10px; background: var(--blue-soft); color: var(--blue); font-size: 17px; font-weight: 800; }
.activity-summary-copy { display: grid; min-width: 0; }
.activity-summary-copy .eyebrow { margin-bottom: 1px; font-size: 8px; }
.activity-summary-copy > strong { color: var(--ink); font-size: 15px; letter-spacing: -.02em; }
.activity-summary-copy > small { margin-top: 1px; color: var(--muted); font-size: 9px; }
.activity-summary-action { display: flex; align-items: center; gap: 9px; margin-left: auto; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; color: #536071; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.activity-summary-action i { font-size: 14px; font-style: normal; transition: transform .18s ease; }
.activity-collapsible[open] .activity-summary-action i { transform: rotate(180deg); }
.activity-collapsible[open] .activity-summary { border-bottom: 1px solid var(--line); }
.activity-card { overflow: hidden; background: #fff; }
.activity-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.filter-group { display: flex; gap: 3px; padding: 3px; border-radius: 8px; background: #f1f3f6; }
.filter { padding: 6px 10px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; font-size: 10px; font-weight: 700; }
.filter.active { background: #fff; color: #344054; box-shadow: 0 1px 4px rgba(16, 24, 40, .1); }
.activity-search { position: relative; width: 200px; margin: 0; }
.activity-search > span:first-child { position: absolute; top: 50%; left: 10px; z-index: 1; color: #8993a3; font-size: 15px; transform: translateY(-50%); }
.activity-search input { height: 32px; margin: 0; padding-left: 30px; background: #fafbfc; font-size: 10px; }
.table-wrap { max-width: 100%; overflow-x: auto; }

.activity-table { width: 100%; min-width: 760px; border-collapse: collapse; table-layout: fixed; }
.activity-table th { padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fafbfc; color: #7d8795; font-size: 8px; letter-spacing: .09em; text-align: left; text-transform: uppercase; }
.activity-table td { height: 51px; padding: 9px 14px; border-bottom: 1px solid #eef1f5; color: #586274; font-size: 10px; vertical-align: middle; }
.activity-table tr:last-child td { border-bottom: 0; }
.activity-table th:nth-child(1) { width: 100px; }
.activity-table th:nth-child(2) { width: 145px; }
.activity-table th:nth-child(4) { width: 180px; }
.activity-table th:nth-child(5) { width: 150px; }
.activity-table tr[hidden] { display: none; }
.cell-strong { overflow: hidden; color: #344054 !important; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.message-cell, .sender-cell, .date-cell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-error { display: block; overflow: hidden; max-width: 95px; margin-top: 3px; color: var(--red); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.empty-row { height: 90px !important; color: var(--muted) !important; text-align: center; }
.filter-empty { margin: 0; padding: 30px; color: var(--muted); font-size: 11px; text-align: center; }

.flash {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
  padding: 11px 13px;
  border: 1px solid #d7e3fa;
  border-radius: 9px;
  background: var(--blue-soft);
  color: #28549d;
  font-size: 11px;
}

.flash.success { border-color: #cee9dc; background: var(--green-soft); color: #176140; }
.flash.error { border-color: #ffd1d7; background: var(--red-soft); color: #9f3442; }
.flash-icon { display: grid; flex: 0 0 auto; width: 17px; height: 17px; place-items: center; border-radius: 50%; background: rgba(255,255,255,.65); font-size: 9px; font-weight: 900; }

.mailbox-dialog {
  width: min(660px, calc(100% - 32px));
  max-height: min(88vh, 820px);
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 30px 100px rgba(5, 14, 30, .35);
}

.mailbox-dialog::backdrop { background: rgba(9, 20, 36, .68); backdrop-filter: blur(3px); }
.mailbox-dialog > form { display: flex; max-height: inherit; flex-direction: column; }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 22px 24px 18px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { margin: 2px 0; font-size: 22px; letter-spacing: -.025em; }
.dialog-head p { max-width: 500px; margin: 0; color: var(--muted); font-size: 11px; }
.dialog-close { display: grid; flex: 0 0 auto; width: 32px; height: 32px; place-items: center; border: 0; border-radius: 8px; background: #f3f5f8; color: #697386; cursor: pointer; font-size: 20px; line-height: 1; }
.dialog-body { padding: 18px 24px 20px; overflow-y: auto; }
.dialog-body > label:not(:first-child), .dialog-body > .form-grid, .dialog-body > div[data-password-fields], .dialog-body > div[data-generic-fields], .dialog-body > div[data-workspace-fields] { margin-top: 13px; }
.dialog-body > .dialog-scan-window { margin-top: 13px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.host-grid { grid-template-columns: minmax(0, 1fr) 110px; }
.auth-note { display: flex; align-items: flex-start; gap: 9px; margin: 14px 0 0; padding: 10px 11px; border-radius: 8px; background: var(--blue-soft); color: #46618e; font-size: 10px; }
.auth-note > span { display: grid; flex: 0 0 auto; width: 17px; height: 17px; place-items: center; border-radius: 50%; background: #dce8ff; color: #2857aa; font-size: 9px; font-weight: 900; }
.field-help { margin: 6px 0 0; color: var(--amber); font-size: 9px; }
.organization-dialog { width: min(760px, calc(100% - 32px)); }
.setup-intro-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.setup-intro-grid article { position: relative; min-width: 0; padding: 13px; border: 1px solid var(--line); border-radius: 9px; background: #fafbfc; }
.setup-intro-grid article > span { display: grid; width: 22px; height: 22px; margin-bottom: 8px; place-items: center; border-radius: 7px; background: var(--blue-soft); color: var(--blue); font-size: 9px; font-weight: 900; }
.setup-intro-grid strong { font-size: 11px; }
.setup-intro-grid p { margin: 3px 0 0; color: var(--muted); font-size: 9px; }
.external-setup-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.external-setup-links a { padding: 6px 9px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--blue); font-size: 9px; font-weight: 700; }
.security-callout { display: flex; align-items: flex-start; gap: 9px; margin: 14px 0 0; padding: 11px; border: 1px solid #d7e3fa; border-radius: 8px; background: #f7faff; color: #50617d; font-size: 10px; }
.security-callout > span:first-child { color: var(--blue); font-weight: 900; }
.security-callout.caution { border-color: #f0dcb5; background: var(--amber-soft); color: #78551b; }
.security-callout.caution > span:first-child { color: var(--amber); }
input[type="file"] { height: auto; min-height: 39px; padding: 7px 9px; }
input[type="file"]::file-selector-button { margin-right: 9px; padding: 5px 8px; border: 0; border-radius: 6px; background: var(--blue-soft); color: var(--blue); cursor: pointer; font-size: 9px; font-weight: 800; }
.routing-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 15px 0 0; padding: 12px; border: 1px solid var(--line); border-radius: 9px; }
.routing-options legend { padding: 0 4px; color: #344054; font-size: 10px; font-weight: 800; }
.routing-options label { display: flex; align-items: flex-start; gap: 9px; padding: 10px; border: 1px solid #edf0f4; border-radius: 8px; background: #fafbfc; cursor: pointer; }
.routing-options label > span { display: grid; }
.routing-options strong { font-size: 10px; }
.routing-options small { margin: 1px 0 0; font-size: 8px; }
.dialog-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 13px 24px; border-top: 1px solid var(--line); background: #fafbfc; }

.auth-shell {
  display: grid;
  min-height: 100vh;
  padding: 28px;
  place-items: center;
  background:
    radial-gradient(circle at 10% 10%, rgba(47, 105, 210, .18), transparent 28%),
    radial-gradient(circle at 88% 90%, rgba(31, 177, 119, .12), transparent 26%),
    #eef2f7;
}

.auth-shell > .flash { position: fixed; z-index: 3; top: 18px; width: min(500px, calc(100% - 36px)); box-shadow: var(--shadow-md); }
.login-shell { display: grid; grid-template-columns: minmax(330px, .95fr) minmax(390px, 1.05fr); width: min(920px, 100%); min-height: 560px; overflow: hidden; border: 1px solid rgba(255,255,255,.65); border-radius: 20px; background: #fff; box-shadow: 0 24px 80px rgba(15, 28, 48, .18); }
.login-brand-panel { display: flex; flex-direction: column; padding: 38px; background: linear-gradient(155deg, #0b1727 0%, #102744 65%, #153357 100%); color: #fff; }
.brand-on-dark { padding: 0; }
.login-promise { margin: auto 0; padding: 48px 0; }
.login-kicker { color: #7fa9f5; font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.login-promise h1 { max-width: 370px; margin: 11px 0 16px; font-size: clamp(31px, 4vw, 43px); line-height: 1.08; letter-spacing: -.045em; }
.login-promise p { max-width: 350px; margin: 0; color: #a8b8cb; font-size: 13px; line-height: 1.65; }
.login-trust { display: flex; align-items: center; gap: 11px; padding-top: 23px; border-top: 1px solid rgba(255,255,255,.1); }
.shield { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 9px; background: rgba(37, 201, 135, .12); color: #4be0a4; font-weight: 900; }
.login-trust > span:last-child { display: grid; }
.login-trust strong { color: #dce6f2; font-size: 10px; }
.login-trust small { color: #8296ad; font-size: 9px; }
.login-form-panel { display: grid; place-items: center; padding: 42px; background: #fff; }
.login-form-wrap { width: min(330px, 100%); }
.login-form-wrap h2 { margin: 4px 0 4px; font-size: 29px; letter-spacing: -.035em; }
.login-form-wrap > p { margin: 0; color: var(--muted); font-size: 12px; }
.login-form { margin-top: 26px; }
.login-form label { margin-top: 14px; }
.login-form input { height: 43px; background: #fbfcfd; }
.login-submit { width: 100%; height: 43px; margin-top: 22px; }
.login-submit span { margin-left: auto; }
.login-help { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 25px !important; color: var(--muted-light) !important; font-size: 9px !important; }
.login-help .status-light { margin: 0; }

[hidden] { display: none !important; }

.guide-page-intro h2 { margin: 4px 0 7px; font-size: 23px; letter-spacing: -.03em; }
.guide-page-intro p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.guide-picker { min-width: 0; }
.guide-picker-control { display: grid; grid-template-columns: minmax(280px, 440px) minmax(0, 1fr); align-items: end; gap: 6px 18px; padding: 17px; border: 1px solid #e5eaf1; border-radius: 11px; background: #f7f9fc; }
.guide-picker-control label { grid-column: 1; color: #344054; font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.guide-picker-control select { grid-column: 1; height: 43px; margin: 0; border-color: #cdd8e8; background-color: #fff; color: #233148; font-size: 12px; font-weight: 700; }
.guide-picker-control p { grid-column: 2; grid-row: 2; align-self: center; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.guide-flow { display: grid; grid-template-columns: repeat(7, auto); align-items: center; justify-content: center; gap: 10px; margin: 14px 0; padding: 11px 15px; border: 1px solid #e6ebf2; border-radius: 10px; background: #fff; }
.guide-flow span { display: inline-flex; align-items: center; gap: 7px; color: #536071; font-size: 10px; font-weight: 750; white-space: nowrap; }
.guide-flow span b { display: grid; width: 22px; height: 22px; place-items: center; border-radius: 7px; background: #e8effc; color: #315da9; font-size: 9px; }
.guide-flow i { color: #a5afbd; font-size: 12px; font-style: normal; }
.guide-panels { margin-top: 0; }
.guide-panel { min-width: 0; padding: 24px; border: 1px solid #e2e8f1; border-radius: 12px; background: #fff; }
.guide-panel-head { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 13px; padding-bottom: 17px; border-bottom: 1px solid #edf0f4; }
.guide-logo { display: grid; width: 44px; height: 44px; place-items: center; border-radius: 12px; background: var(--blue-soft); color: var(--blue); font-size: 17px; font-weight: 900; }
.guide-logo.google { background: #fceeee; color: #b23b3b; }
.guide-logo.workspace { background: #e9f1ff; color: #285fb7; }
.guide-logo.routing { background: var(--violet-soft); color: var(--violet); }
.guide-logo.microsoft { background: #e6f3ff; color: #146eb4; }
.guide-logo.yahoo { background: #f3edff; color: #7240b9; }
.guide-logo.aol { background: #e9f4ff; color: #2267b5; }
.guide-logo.zoho { background: #fff1e6; color: #b2541e; }
.guide-logo.icloud { background: #edf1f5; color: #4a5664; }
.guide-logo.fastmail { background: #f2edff; color: #6d4bd0; }
.guide-panel-head > div { display: grid; min-width: 0; }
.guide-panel-head > div > span { color: var(--muted-light); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.guide-panel-head h3 { margin: 2px 0 0; font-size: 17px; line-height: 1.25; letter-spacing: -.025em; }
.guide-panel-head > b { padding: 6px 9px; border-radius: 999px; background: var(--green-soft); color: #14754e; font-size: 8px; letter-spacing: .03em; text-transform: uppercase; white-space: nowrap; }
.guide-summary { margin: 16px 0 0; color: #536071; font-size: 12px; line-height: 1.75; }
.guide-summary code, .guide-note code, .guide-troubleshooting code { padding: 2px 5px; border-radius: 5px; background: #eef2f7; color: #344054; font: 10px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
.guide-prerequisites { margin-top: 18px; padding: 15px 17px; border: 1px solid #dbe6f7; border-radius: 10px; background: #f7faff; }
.guide-prerequisites h4 { margin: 0; color: #315a99; font-size: 11px; letter-spacing: .02em; }
.guide-prerequisites ul { display: grid; gap: 7px; margin: 10px 0 0; padding-left: 18px; }
.guide-prerequisites li { padding-left: 2px; color: #596579; font-size: 11px; line-height: 1.55; }
.guide-steps { display: grid; grid-template-columns: 1fr; gap: 8px; margin: 18px 0 0; padding: 0; counter-reset: guide-step; list-style: none; }
.guide-steps li { position: relative; min-width: 0; min-height: 62px; padding: 13px 14px 13px 52px; border: 1px solid #e8ecf2; border-radius: 9px; background: #fafbfc; counter-increment: guide-step; }
.guide-steps li::before { position: absolute; top: 14px; left: 14px; display: grid; width: 25px; height: 25px; place-items: center; border-radius: 8px; background: #e8effc; color: #315da9; content: counter(guide-step); font-size: 10px; font-weight: 900; }
.guide-steps strong, .guide-steps span { display: block; }
.guide-steps strong { color: #344054; font-size: 11px; }
.guide-steps span { margin-top: 4px; color: #657184; font-size: 11px; line-height: 1.6; }
.guide-steps span b { color: #465367; }
.guide-steps code { font-size: 10px; }
.guide-success { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 12px; margin-top: 16px; padding: 14px 16px; border: 1px solid #cce8db; border-radius: 10px; background: #f1faf6; }
.guide-success strong { color: #176140; font-size: 10px; text-transform: uppercase; white-space: nowrap; }
.guide-success span { color: #3d6957; font-size: 11px; line-height: 1.6; }
.guide-troubleshooting { margin-top: 12px; border: 1px solid #e4e8ee; border-radius: 10px; background: #fff; }
.guide-troubleshooting summary { padding: 13px 15px; color: #455266; cursor: pointer; font-size: 11px; font-weight: 800; }
.guide-troubleshooting[open] summary { border-bottom: 1px solid #e8ecf2; }
.guide-troubleshooting ul { display: grid; gap: 9px; margin: 0; padding: 14px 18px 15px 34px; }
.guide-troubleshooting li { color: #657184; font-size: 11px; line-height: 1.6; }
.guide-note { margin: 13px 0 0; padding-top: 12px; border-top: 1px solid #edf0f4; color: var(--muted); font-size: 10px; line-height: 1.65; }
.guide-note a { color: var(--blue); font-weight: 750; }

.guide-page-heading { align-items: center; }
.guide-page-card { margin-top: 26px; padding: 26px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: var(--shadow-sm); }
.guide-page-intro { max-width: 760px; }
.guide-picker-full { margin-top: 24px; }

.receiving-page-heading { align-items: center; }
.receiving-setup-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(300px, .95fr); gap: 14px; margin-top: 26px; }
.receiving-connect-card, .receiving-explainer-card { position: relative; overflow: hidden; padding: 24px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: var(--shadow-sm); }
.receiving-connect-card { padding-left: 88px; }
.receiving-card-icon { position: absolute; top: 24px; left: 24px; display: grid; width: 46px; height: 46px; place-items: center; border-radius: 13px; background: linear-gradient(145deg, #326ee0, #2558b8); color: #fff; font-size: 22px; font-weight: 700; box-shadow: 0 9px 22px rgba(37, 99, 235, .22); }
.receiving-connect-card h2, .receiving-explainer-card h2 { margin: 5px 0 6px; font-size: 19px; letter-spacing: -.03em; }
.receiving-connect-card > p, .receiving-explainer-card > p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.65; }
.receiving-connect-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; margin-top: 18px; }
.receiving-connect-form label { grid-column: 1 / -1; }
.receiving-connect-form input { margin: 0; }
.receiving-permission-note { display: flex; align-items: flex-start; gap: 9px; margin-top: 15px; padding: 11px 12px; border-radius: 9px; background: #f4f7fc; color: #596579; }
.receiving-permission-note > span { display: grid; flex: 0 0 auto; width: 23px; height: 23px; place-items: center; border-radius: 7px; background: #e4ecfa; color: #315da9; }
.receiving-permission-note p { display: grid; gap: 2px; margin: 0; font-size: 9px; line-height: 1.5; }
.receiving-permission-note strong { color: #344054; font-size: 9px; }
.receiving-explainer-card { background: linear-gradient(145deg, #0f2036 0%, #152c49 100%); color: #fff; }
.receiving-explainer-card .eyebrow { color: #7fa9f5; }
.receiving-explainer-card h2 { color: #fff; }
.receiving-explainer-card ol { display: grid; gap: 9px; margin: 17px 0 0; padding: 0; list-style: none; counter-reset: receiving-step; }
.receiving-explainer-card li { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 9px; padding: 10px 11px; border: 1px solid rgba(255,255,255,.09); border-radius: 9px; background: rgba(255,255,255,.045); }
.receiving-explainer-card li b { color: #dce7f5; font-size: 10px; }
.receiving-explainer-card li span { color: #aabbd0; font-size: 10px; line-height: 1.5; }
.receiving-callback { display: grid; gap: 4px; margin-top: 14px !important; padding-top: 13px; border-top: 1px solid rgba(255,255,255,.1); }
.receiving-callback strong { color: #dce7f5; font-size: 8px; letter-spacing: .06em; text-transform: uppercase; }
.receiving-callback code { color: #94a9c3; font: 8px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
.receiving-list-section { margin-top: 24px; }
.receiving-inbox-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.receiving-inbox-card { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow-sm); }
.receiving-provider-mark { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 11px; background: #fceeee; color: #b23b3b; font-size: 16px; font-weight: 900; }
.receiving-inbox-copy { min-width: 0; }
.receiving-inbox-copy > span { color: var(--muted-light); font-size: 8px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.receiving-inbox-copy h3 { overflow: hidden; margin: 2px 0 2px; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.receiving-inbox-copy p { margin: 0; color: var(--muted); font-size: 9px; }
.receiving-inbox-meta { display: grid; grid-column: 2; }
.receiving-inbox-meta span { color: var(--muted-light); font-size: 8px; text-transform: uppercase; }
.receiving-inbox-meta strong { margin-top: 1px; color: #536071; font-size: 9px; }
.receiving-inbox-card .inline-warning { grid-column: 1 / -1; margin: 0; }
.receiving-reconnect-form { grid-column: 3; grid-row: 2; }
.receiving-reconnect-form .button { min-height: 32px; padding: 7px 9px; }
.receiving-empty-state { grid-column: 1 / -1; }

.redirect-page-heading { align-items: center; }
.redirect-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 24px; }
.redirect-summary-card { display: flex; min-width: 0; align-items: center; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow-sm); }
.redirect-summary-card > div { display: grid; min-width: 0; }
.redirect-summary-card strong { color: #243044; font-size: 18px; line-height: 1.2; letter-spacing: -.02em; }
.redirect-summary-card span:last-child { margin-top: 2px; color: var(--muted); font-size: 9px; font-weight: 700; }
.redirect-summary-icon { display: grid; flex: 0 0 auto; width: 36px; height: 36px; place-items: center; border-radius: 10px; font-size: 15px; font-weight: 900; }
.redirect-summary-icon.warning { background: var(--amber-soft); color: #9a6617; }
.redirect-summary-icon.success { background: var(--green-soft); color: #16734f; }
.redirect-summary-icon.confirmed { background: var(--red-soft); color: #a23b48; }
.redirect-live-card { border-color: #d7e7df; background: linear-gradient(145deg, #fff, #f7fcf9); }
.redirect-live-card .status-light { width: 10px; height: 10px; margin: 0 13px; }
.redirect-live-card strong { font-size: 13px; }
.redirect-coverage-details { margin-top: 12px; padding: 0 14px 12px; border: 1px solid #dfe5ee; border-radius: 11px; background: rgba(255,255,255,.72); }
.redirect-coverage-details summary { padding: 11px 0 0; color: #465268; cursor: pointer; font-size: 9px; font-weight: 800; }
.redirect-coverage-details > div { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 11px; }
.redirect-coverage-details > div span { padding: 5px 8px; border-radius: 999px; background: #eef3fb; color: #49617e; font-size: 8px; font-weight: 800; }
.redirect-coverage-details p { margin: 10px 0 0; color: var(--muted); font-size: 9px; line-height: 1.55; }
.redirect-list-section { margin-top: 22px; }
.redirect-section-heading { align-items: flex-end; }
.redirect-section-heading h2 { display: flex; align-items: center; gap: 7px; }
.redirect-section-heading > p { max-width: 420px; font-size: 10px; text-align: right; }
.redirect-toolbar { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: center; gap: 10px; margin: 16px 0 12px; padding: 11px; border: 1px solid var(--line); border-radius: 11px; background: #fff; box-shadow: var(--shadow-sm); }
.redirect-toolbar .mailbox-search { grid-column: span 2; }
.redirect-toolbar .mailbox-provider-filter { grid-template-columns: 1fr; gap: 4px; }
.redirect-toolbar .mailbox-provider-filter > span { padding-left: 2px; }
.redirect-toolbar-meta { display: flex; grid-column: 1 / -1; align-items: center; justify-content: space-between; min-height: 23px; padding: 3px 2px 0; border-top: 1px solid #edf0f4; }
.redirect-toolbar-meta .mailbox-result-count { padding-top: 6px; text-align: left; }
.redirect-filter-feedback { grid-column: 1 / -1; margin: -3px 2px 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.redirect-reset { margin: 5px 0 0; padding: 3px 0; border: 0; background: transparent; color: var(--blue); cursor: pointer; font: inherit; font-size: 9px; font-weight: 800; }
.redirect-reset:hover { color: #174995; text-decoration: underline; }
.redirect-reset:focus-visible { border-radius: 4px; outline: 2px solid #8eb1ef; outline-offset: 2px; }
.redirect-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 11px; background: #fff; transition: opacity .15s ease; }
.redirect-table-wrap[aria-busy="true"] { opacity: .62; }
.redirect-table { width: 100%; min-width: 1200px; border-collapse: collapse; }
.redirect-table th { padding: 10px 12px; border-bottom: 1px solid #e6eaf0; background: #f8f9fb; color: var(--muted); font-size: 8px; letter-spacing: .06em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.redirect-table td { padding: 12px; border-bottom: 1px solid #edf0f4; color: #596579; font-size: 9px; vertical-align: middle; }
.redirect-table tbody tr:last-child td { border-bottom: 0; }
.redirect-table tbody tr:hover { background: #fafcff; }
.redirect-table td:first-child { width: 190px; }
.redirect-table td:nth-child(2) { width: 225px; }
.redirect-table td:nth-child(4) { width: 235px; }
.redirect-table td:nth-child(5) { width: 120px; white-space: nowrap; }
.redirect-table td > strong, .redirect-table td > small { display: block; overflow: hidden; max-width: 260px; text-overflow: ellipsis; white-space: nowrap; }
.redirect-table td > strong { color: #344054; font-size: 10px; }
.redirect-table td > small { margin-top: 2px; color: var(--muted-light); font-size: 8px; }
.redirect-route { display: grid; grid-template-columns: minmax(170px, 1fr) 20px minmax(170px, 1fr); align-items: center; gap: 7px; }
.redirect-route > span { display: grid; min-width: 0; gap: 2px; }
.redirect-endpoint-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.redirect-route b { overflow: hidden; color: #344054; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.redirect-route code { color: #657287; font: 8px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; white-space: normal; word-break: break-all; }
.redirect-route i { color: #9aa5b4; font-size: 13px; font-style: normal; text-align: center; }
.redirect-copy { flex: 0 0 auto; padding: 3px 6px; border: 1px solid #d8e0eb; border-radius: 6px; background: #fff; color: #315da9; cursor: pointer; font: inherit; font-size: 7px; font-weight: 800; }
.redirect-copy:hover:not(:disabled) { border-color: #9eb5dc; background: #f4f7fd; }
.redirect-copy:focus-visible { outline: 2px solid #8eb1ef; outline-offset: 2px; }
.redirect-copy:disabled { cursor: wait; opacity: .72; }
.redirect-finding-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 5px; }
.redirect-category { display: inline-flex; padding: 3px 6px; border-radius: 999px; background: #eef3fb; color: #49617e; font-size: 7px; font-weight: 800; white-space: nowrap; }
.redirect-category.nested_chain { background: #f0ebfb; color: #684bbd; }
.redirect-category.base64_parameter, .redirect-category.encoded_parameter { background: #fff3dd; color: #8c641f; }
.redirect-category.meta_refresh, .redirect-category.script_redirect { background: #fdebed; color: #a23b48; }
.redirect-parameter { margin: 0 !important; color: #708097 !important; }
.redirect-status { display: inline-flex; padding: 4px 7px; border-radius: 999px; background: #f0f2f5; color: #687386; font-size: 8px; font-weight: 800; white-space: nowrap; }
.redirect-status.forwarded { background: var(--green-soft); color: #14754e; }
.redirect-status.pending { background: var(--blue-soft); color: #315da9; }
.redirect-status.rejected { background: var(--red-soft); color: #a23b48; }
.verification-result { display: inline-flex; justify-self: start; padding: 4px 7px; border-radius: 999px; background: #f0f2f5; color: #687386; font-size: 8px; font-weight: 800; white-space: nowrap; }
.verification-result.confirmed { background: var(--red-soft); color: #a23b48; }
.verification-result.not_vulnerable { background: var(--green-soft); color: #14754e; }
.verification-result.queued, .verification-result.testing { background: var(--blue-soft); color: #315da9; }
.verification-result.blocked { background: #fff3dd; color: #8c641f; }
.verification-result.inconclusive, .verification-result.not_testable { background: #eef1f5; color: #647084; }
.verification-evidence, .verification-detail, .verification-mail-status { display: block; margin-top: 5px !important; max-width: none !important; color: #6c788a !important; font-size: 8px !important; line-height: 1.45; white-space: normal !important; }
.verification-detail { color: #526075 !important; }
.verification-location { display: block; margin-top: 5px; color: #657287; font: 8px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; word-break: break-all; }
.redirect-retest { justify-self: start; margin-top: 7px; padding: 4px 7px; border: 1px solid #d8e0eb; border-radius: 6px; background: #fff; color: #315da9; cursor: pointer; font: inherit; font-size: 8px; font-weight: 800; }
.redirect-retest:hover:not(:disabled) { border-color: #9eb5dc; background: #f4f7fd; }
.redirect-retest:disabled { cursor: wait; opacity: .65; }
.redirect-table time { color: #6d798a; font-size: 8px; font-weight: 700; }
.redirect-empty { margin-top: 12px; }
.redirect-pagination, .mailbox-pagination { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 13px; padding: 12px 2px 2px; }
.redirect-pagination > p, .mailbox-pagination > p { margin: 0; color: var(--muted); font-size: 9px; font-weight: 700; }
.redirect-page-controls, .mailbox-page-controls { display: flex; align-items: center; justify-content: flex-end; gap: 5px; }
.redirect-page-button { display: inline-grid; min-width: 32px; height: 32px; padding: 0 8px; place-items: center; border: 1px solid #dce2ea; border-radius: 8px; background: #fff; color: #586477; cursor: pointer; font: inherit; font-size: 9px; font-weight: 800; transition: border-color .15s ease, background-color .15s ease, color .15s ease, box-shadow .15s ease; }
.redirect-page-button:hover:not(:disabled):not(.current) { border-color: #a9b9d4; background: #f7f9fc; color: #344054; }
.redirect-page-button.current { border-color: #2f67cb; background: var(--blue); color: #fff; box-shadow: 0 4px 10px rgba(37, 99, 235, .16); }
.redirect-page-button:disabled { cursor: not-allowed; opacity: .42; }
.redirect-page-button.previous, .redirect-page-button.next { min-width: 68px; }
.redirect-page-gap { display: inline-grid; width: 24px; height: 32px; place-items: center; color: #8994a5; font-size: 11px; }

.import-mode-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin: 17px 0; padding: 0; border: 0; }
.import-mode-picker legend { grid-column: 1 / -1; margin-bottom: 1px; color: #344054; font-size: 11px; font-weight: 800; }
.import-mode-picker > label { display: grid; grid-template-columns: 18px minmax(0, 1fr); align-items: start; gap: 8px; margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fafbfc; cursor: pointer; transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease; }
.import-mode-picker > label:has(input:checked) { border-color: #8bacec; background: #f4f7ff; box-shadow: 0 0 0 2px rgba(37, 99, 235, .07); }
.import-mode-picker input[type="radio"] { width: 16px; height: 16px; margin: 1px 0 0; accent-color: var(--blue); }
.import-mode-picker label > span { display: grid; gap: 3px; }
.import-mode-picker strong { color: #344054; font-size: 10px; }
.import-mode-picker small { color: var(--muted); font-size: 9px; font-weight: 500; line-height: 1.5; }
.compact-import-mode { margin-top: 13px; }
.field-action-link { display: inline-flex; align-items: center; gap: 5px; margin-top: 7px; color: var(--blue); font-size: 9px; font-weight: 800; }

.mailbox-toolbar { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(180px, 230px) minmax(145px, 180px) auto; align-items: center; gap: 10px; margin-bottom: 12px; padding: 11px; border: 1px solid var(--line); border-radius: 11px; background: #fff; box-shadow: var(--shadow-sm); }
.mailbox-search { position: relative; margin: 0; }
.mailbox-search > span { position: absolute; top: 50%; left: 12px; z-index: 1; color: #8893a4; font-size: 16px; transform: translateY(-50%); }
.mailbox-search input { height: 38px; margin: 0; padding-left: 35px; border-color: #e0e5ed; background: #fafbfc; font-size: 11px; }
.mailbox-provider-filter { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 8px; margin: 0; }
.mailbox-provider-filter > span { color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.mailbox-provider-filter select { height: 38px; margin: 0; background-color: #fafbfc; font-size: 10px; }
.mailbox-result-count { min-width: 62px; color: var(--muted); font-size: 9px; font-weight: 800; text-align: right; text-transform: uppercase; }
.filtered-empty { margin-top: 12px; }

.preview-state { display: flex; align-items: center; gap: 10px; margin-top: 13px; padding: 10px 12px; border: 1px solid #dbe6f7; border-radius: 9px; background: #f6f9ff; color: #315a99; }
.preview-state.succeeded { border-color: #cee9dc; background: #f0faf5; color: #176140; }
.preview-state.failed { border-color: #f1ccd1; background: var(--red-soft); color: #9f3442; }
.preview-state-icon { display: grid; flex: 0 0 auto; width: 22px; height: 22px; place-items: center; border: 2px solid currentColor; border-radius: 50%; opacity: .75; }
.preview-state.queued .preview-state-icon, .preview-state.running .preview-state-icon { border-right-color: transparent; animation: preview-spin .8s linear infinite; }
.preview-state.succeeded .preview-state-icon::before { content: "✓"; font-size: 11px; font-weight: 900; }
.preview-state.failed .preview-state-icon::before { content: "!"; font-size: 11px; font-weight: 900; }
.preview-state > div { display: grid; min-width: 0; }
.preview-state strong { font-size: 10px; }
.preview-state span:last-child { overflow-wrap: anywhere; font-size: 9px; opacity: .82; }
.status-pill.scanning { background: var(--blue-soft); color: #315da9; }
.status-pill.scanning .status-light { background: var(--blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); animation: preview-pulse 1.2s ease-in-out infinite; }
.preview-button .button-spinner { display: none; width: 12px; height: 12px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; }
.mailbox-card[data-preview-status="queued"] .preview-button .button-spinner,
.mailbox-card[data-preview-status="running"] .preview-button .button-spinner { display: inline-block; animation: preview-spin .8s linear infinite; }

@keyframes preview-spin { to { transform: rotate(360deg); } }
@keyframes preview-pulse { 50% { opacity: .4; } }

.page-heading-actions { display: flex; align-items: center; flex-wrap: nowrap; gap: 9px; }
.workspace-page-heading { align-items: flex-end; }
.workspace-metrics { margin-top: 22px; }
.workspace-directory { margin-top: 30px; }
.workspace-toolbar { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(210px, 260px) auto; align-items: center; gap: 10px; margin-bottom: 13px; padding: 11px; border: 1px solid var(--line); border-radius: 11px; background: #fff; box-shadow: var(--shadow-sm); }
.workspace-organization-list { display: grid; gap: 13px; }

.workspace-organization {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  scroll-margin-top: 82px;
}
.workspace-organization[open] { border-color: #ccd8eb; box-shadow: 0 8px 28px rgba(18, 41, 70, .08); }
.workspace-organization > summary { list-style: none; }
.workspace-organization > summary::-webkit-details-marker { display: none; }
.workspace-organization-summary { display: grid; grid-template-columns: 46px minmax(220px, 1fr) 82px 82px auto; align-items: center; gap: 14px; min-height: 84px; padding: 15px 17px; cursor: pointer; transition: background-color .15s ease; }
.workspace-organization-summary:hover { background: #fafbfd; }
.workspace-organization[open] > .workspace-organization-summary { border-bottom: 1px solid var(--line); background: linear-gradient(90deg, #f9fbff, #fff 56%); }
.organization-monogram { display: grid; width: 44px; height: 44px; place-items: center; border-radius: 12px; background: linear-gradient(145deg, #e8f0ff, #f3f7ff); color: #315da9; font-size: 17px; font-weight: 900; }
.organization-summary-main { display: grid; min-width: 0; gap: 2px; }
.organization-summary-main > strong { overflow: hidden; color: #182230; font-size: 16px; letter-spacing: -.02em; text-overflow: ellipsis; white-space: nowrap; }
.organization-summary-badges { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 3px; }
.mini-status { display: inline-flex; padding: 3px 6px; border-radius: 999px; background: #f1f3f6; color: #667085; font-size: 8px; font-weight: 800; }
.mini-status.success { background: var(--green-soft); color: #14754e; }
.mini-status.warning { background: var(--amber-soft); color: #8b611d; }
.mini-status.neutral { background: #eef1f5; color: #687386; }
.organization-summary-stat { display: grid; justify-items: center; padding-left: 12px; border-left: 1px solid #eaedf2; }
.organization-summary-stat b { color: #273448; font-size: 16px; }
.organization-summary-stat small { color: var(--muted-light); font-size: 8px; font-weight: 800; text-transform: uppercase; }
.organization-view-action { display: inline-flex; align-items: center; justify-self: end; gap: 8px; padding: 7px 9px; border: 1px solid #e2e7ee; border-radius: 8px; color: #4f5e72; font-size: 9px; font-weight: 800; white-space: nowrap; }
.organization-view-action i { font-size: 12px; font-style: normal; transition: transform .18s ease; }
.workspace-organization[open] .organization-view-action i { transform: rotate(180deg); }

.workspace-organization-body { padding: 18px; background: #fcfdff; }
.organization-mode-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.organization-mode-card { min-width: 0; padding: 15px; border: 1px solid #e3e9f2; border-radius: 11px; background: #fff; }
.organization-mode-card.routing-mode-card { border-color: #e5dff6; background: linear-gradient(145deg, #fff 50%, #faf8ff); }
.organization-mode-head { display: grid; grid-template-columns: 37px minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.organization-mode-head > div { display: grid; min-width: 0; }
.organization-mode-head > div > span { color: var(--muted-light); font-size: 8px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.organization-mode-head h3 { margin: 1px 0 0; font-size: 13px; letter-spacing: -.015em; }
.organization-mode-card > p { min-height: 34px; margin: 12px 0 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.organization-mode-card > .button { margin-top: 12px; }
.organization-mode-meta { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: 7px; margin-top: 11px; }
.organization-mode-meta > span { display: grid; min-width: 0; gap: 2px; padding: 8px 9px; border-radius: 8px; background: #f6f8fb; }
.organization-mode-meta small { color: var(--muted-light); font-size: 7px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.organization-mode-meta b { overflow: hidden; color: #4a5668; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }

.organization-mailboxes { margin-top: 15px; overflow: hidden; border: 1px solid #e3e8f0; border-radius: 11px; background: #fff; }
.organization-subheading { display: flex; align-items: flex-end; justify-content: space-between; gap: 15px; padding: 13px 14px; border-bottom: 1px solid #edf0f4; }
.organization-subheading h3 { display: flex; align-items: center; gap: 7px; margin: 2px 0 0; font-size: 14px; }
.organization-subheading > p { max-width: 430px; margin: 0; color: var(--muted); font-size: 9px; line-height: 1.5; text-align: right; }
.workspace-mailbox-table { width: 100%; border-collapse: collapse; font-size: 9px; }
.workspace-mailbox-table th { padding: 9px 12px; border-bottom: 1px solid #e7ebf1; background: #f8f9fb; color: var(--muted); font-size: 8px; letter-spacing: .05em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.workspace-mailbox-table td { padding: 11px 12px; border-bottom: 1px solid #edf0f4; color: #5a6678; vertical-align: middle; }
.workspace-mailbox-table tbody tr:last-child td { border-bottom: 0; }
.workspace-mailbox-table tbody tr:hover { background: #fafcff; }
.workspace-mailbox-table td:first-child, .workspace-mailbox-table td:nth-child(3) { min-width: 170px; }
.workspace-mailbox-table td > strong { display: block; overflow: hidden; max-width: 250px; color: #344054; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.workspace-mailbox-table td > small { display: block; margin-top: 2px; color: var(--muted-light); font-size: 8px; }
.workspace-row-error { color: #a23b48 !important; font-weight: 800; }
.mode-chip { display: inline-flex; padding: 4px 7px; border-radius: 999px; background: var(--blue-soft); color: #315da9; font-size: 8px; font-weight: 800; white-space: nowrap; }
.mode-chip.future { background: var(--violet-soft); color: #684bbd; }
.organization-empty-mailboxes { display: flex; align-items: flex-start; gap: 11px; padding: 18px; }
.organization-empty-mailboxes > span { display: grid; flex: 0 0 auto; width: 34px; height: 34px; place-items: center; border-radius: 9px; background: #eef2f7; color: #6c788a; }
.organization-empty-mailboxes strong { color: #3e4a5c; font-size: 10px; }
.organization-empty-mailboxes p { max-width: 680px; margin: 3px 0 0; color: var(--muted); font-size: 9px; line-height: 1.55; }

.organization-technical { margin-top: 11px; padding: 0 14px 14px; border: 1px solid #e3e8f0; border-radius: 10px; background: #fff; }
.organization-technical > summary { padding: 12px 0 0; color: #465268; cursor: pointer; font-size: 10px; font-weight: 800; list-style-position: inside; }
.organization-technical.routing-technical { border-color: #e5dff6; }
.workspace-empty-state { margin-top: 0; }
.empty-state-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

@media (max-width: 1100px) {
  .sidebar { width: 210px; }
  .workspace { margin-left: 210px; }
  .access-path-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .access-path.compact-path { min-height: 240px; }
  .progress-row { grid-template-columns: 160px minmax(100px, 1fr); }
  .secondary-stats { grid-column: 1 / -1; justify-content: flex-start; }
  .route-endpoint small { display: none; }
  .workspace-organization-summary { grid-template-columns: 46px minmax(190px, 1fr) 72px 72px auto; gap: 10px; }
  .organization-view-action > span { display: none; }
  .redirect-toolbar { grid-template-columns: minmax(240px, 1.3fr) repeat(2, minmax(160px, 1fr)); }
  .redirect-toolbar .mailbox-search { grid-column: span 2; }
}

@media (max-width: 860px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mailbox-footer { align-items: stretch; flex-direction: column; }
  .mailbox-actions { justify-content: flex-start; }
  .settings-panel[open] { width: 100%; }
  .mailbox-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mailbox-toolbar .mailbox-search { grid-column: 1 / -1; }
  .mailbox-result-count { grid-column: 1 / -1; text-align: left; }
  .receiving-setup-grid { grid-template-columns: 1fr; }
  .receiving-inbox-grid { grid-template-columns: 1fr; }
  .redirect-summary-grid { grid-template-columns: 1fr; }
  .redirect-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .redirect-toolbar .mailbox-search { grid-column: 1 / -1; }
  .workspace-toolbar { grid-template-columns: 1fr 220px; }
  .workspace-toolbar .mailbox-result-count { grid-column: 1 / -1; text-align: left; }
  .organization-mode-grid { grid-template-columns: 1fr; }
  .workspace-organization-summary { grid-template-columns: 42px minmax(180px, 1fr) 65px auto; }
  .workspace-organization-summary .organization-summary-stat:nth-of-type(2) { display: none; }
}

@media (max-width: 720px) {
  html { scroll-padding-top: 70px; }
  .sidebar { display: none; }
  .workspace { margin-left: 0; }
  .topbar { justify-content: space-between; height: 58px; padding: 0 16px; }
  .mobile-brand { display: flex; align-items: center; gap: 9px; }
  .mobile-brand .brand-mark { width: 30px; height: 30px; border-radius: 8px; font-size: 14px; }
  .mobile-brand strong { font-size: 13px; }
  .mobile-logout { display: block; }
  .app-main { padding: 24px 14px 50px; }
  .page-heading { align-items: flex-start; }
  .page-heading p { font-size: 12px; }
  .health-banner > div:nth-child(2) { display: grid; gap: 0; }
  .health-badge { display: none; }
  .access-path-grid { grid-template-columns: 1fr; }
  .access-path { min-height: 0; }
  .credential-grid { grid-template-columns: 1fr; }
  .credential-grid > .wide { grid-column: auto; }
  .organization-card-head { align-items: flex-start; }
  .setup-intro-grid { grid-template-columns: 1fr; }
  .route-strip { grid-template-columns: 1fr; gap: 7px; }
  .route-arrow { transform: rotate(90deg); }
  .mailbox-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mailbox-metrics > div:nth-child(2) { border-right: 0; }
  .mailbox-metrics > div:nth-child(-n+2) { border-bottom: 1px solid #edf0f4; }
  .progress-row { grid-template-columns: 1fr; gap: 9px; }
  .secondary-stats { grid-column: auto; flex-wrap: wrap; }
  .activity-toolbar { align-items: stretch; flex-direction: column; }
  .activity-summary { min-height: 68px; padding: 12px; }
  .activity-summary-action > span { display: none; }
  .activity-summary-action { padding: 6px 8px; }
  .redirect-toolbar { grid-template-columns: 1fr; }
  .redirect-toolbar .mailbox-search { grid-column: auto; }
  .redirect-table-wrap { overflow: visible; border: 0; background: transparent; }
  .redirect-table { min-width: 0; border-collapse: separate; }
  .redirect-table thead { display: none; }
  .redirect-table tbody { display: grid; gap: 11px; }
  .redirect-table tr { display: grid; overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: #fff; box-shadow: var(--shadow-sm); }
  .redirect-table td, .redirect-table td:first-child, .redirect-table td:nth-child(2), .redirect-table td:nth-child(4), .redirect-table td:nth-child(5) { display: grid; width: auto; padding: 11px 12px; border-bottom: 1px solid #edf0f4; white-space: normal; }
  .redirect-table td::before { margin-bottom: 5px; color: var(--muted); content: attr(data-label); font-size: 7px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
  .redirect-table td:last-child { border-bottom: 0; }
  .redirect-table td > strong, .redirect-table td > small { max-width: none; }
  .redirect-route { grid-template-columns: 1fr; gap: 7px; }
  .redirect-route > i { transform: rotate(90deg); }
  .redirect-route code { font-size: 9px; }
  .redirect-copy { padding: 5px 8px; font-size: 8px; }
  .redirect-section-heading { align-items: flex-start; flex-direction: column; }
  .redirect-section-heading > p { text-align: left; }
  .redirect-pagination, .mailbox-pagination { align-items: flex-start; flex-direction: column; }
  .redirect-page-controls, .mailbox-page-controls { justify-content: flex-start; flex-wrap: wrap; width: 100%; }
  .activity-search { width: 100%; }
  .guide-picker-control, .guide-picker-full .guide-picker-control { grid-template-columns: 1fr; }
  .guide-picker-control p { grid-column: 1; grid-row: auto; }
  .guide-steps { grid-template-columns: 1fr; }
  .mailbox-toolbar { grid-template-columns: 1fr; }
  .mailbox-toolbar .mailbox-search { grid-column: auto; }
  .mailbox-result-count { grid-column: auto; }
  .workspace-page-heading { align-items: flex-start; }
  .workspace-page-heading .page-heading-actions { flex-wrap: wrap; }
  .workspace-toolbar { grid-template-columns: 1fr; }
  .workspace-toolbar .mailbox-result-count { grid-column: auto; }
  .workspace-organization-summary { grid-template-columns: 42px minmax(0, 1fr) auto; padding: 13px; }
  .organization-summary-stat { display: none; }
  .organization-view-action { padding: 7px; }
  .organization-summary-main > strong { font-size: 14px; }
  .organization-summary-badges { display: none; }
  .workspace-organization-body { padding: 12px; }
  .organization-mode-head { grid-template-columns: 37px minmax(0, 1fr); }
  .organization-mode-head > .status-pill { grid-column: 1 / -1; justify-self: start; }
  .organization-mode-meta { grid-template-columns: 1fr; }
  .organization-subheading { align-items: flex-start; flex-direction: column; }
  .organization-subheading > p { text-align: left; }
  .workspace-mailbox-table-wrap { overflow-x: auto; }
  .workspace-mailbox-table { min-width: 850px; }
  .login-shell { grid-template-columns: 1fr; width: min(460px, 100%); }
  .login-brand-panel { min-height: 210px; padding: 26px; }
  .login-promise { padding: 40px 0 8px; }
  .login-promise h1 { max-width: 350px; margin-block: 8px 10px; font-size: 30px; }
  .login-promise p, .login-trust { display: none; }
  .login-form-panel { padding: 34px 26px 40px; }
}

@media (max-width: 520px) {
  .topbar-status > span:last-child, .topbar-divider { display: none; }
  .page-heading { align-items: stretch; flex-direction: column; gap: 15px; }
  .page-heading .add-mailbox { width: 100%; }
  .health-banner { align-items: flex-start; }
  .health-banner > div span { white-space: normal; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .metric-card { padding: 13px; }
  .metric-icon { width: 34px; height: 34px; }
  .section-heading > p { display: none; }
  .organization-card { padding: 14px; }
  .organization-card-head { flex-direction: column; gap: 9px; }
  .copy-field code { white-space: normal; overflow-wrap: anywhere; }
  .record-actions { align-items: stretch; flex-direction: column; }
  .record-actions > .button, .record-actions > form, .record-actions > form .button { width: 100%; }
  .test-access-form { grid-template-columns: 1fr; width: 100%; }
  .test-access-form label { grid-column: auto; margin-bottom: -2px; }
  .confirm-routing-form { align-items: stretch; flex-direction: column; }
  .confirm-routing-form label { max-width: none; }
  .mailbox-card { padding: 15px 14px 0; }
  .mailbox-topline { align-items: flex-start; }
  .mailbox-identity { gap: 9px; }
  .provider-avatar { width: 34px; height: 34px; }
  .status-pill { padding-inline: 7px; }
  .status-pill .status-light { display: none; }
  .route-endpoint { grid-template-columns: 8px minmax(0, 1fr); }
  .mailbox-footer { margin-inline: -14px; padding-inline: 14px; }
  .mailbox-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mailbox-actions form, .mailbox-actions .button { width: 100%; }
  .more-menu > summary { width: 100%; }
  .more-menu form { left: 0; right: auto; }
  .filter-group { display: grid; grid-template-columns: repeat(4, 1fr); }
  .filter { padding-inline: 5px; }
  .auth-shell { padding: 12px; align-items: center; }
  .login-shell { min-height: 0; border-radius: 16px; }
  .login-brand-panel { min-height: 180px; }
  .mailbox-dialog { width: 100%; max-height: 94vh; margin: auto 0 0; border-radius: 16px 16px 0 0; }
  .dialog-head, .dialog-body, .dialog-footer { padding-inline: 17px; }
  .form-grid, .host-grid { grid-template-columns: 1fr; }
  .routing-options { grid-template-columns: 1fr; }
  .scan-window-grid { grid-template-columns: 1fr; }
  .dialog-footer .button { flex: 1; }
  .guide-page-card { padding: 15px; }
  .guide-picker-control { padding: 13px; }
  .guide-flow { grid-template-columns: 1fr 1fr; justify-content: stretch; }
  .guide-flow i { display: none; }
  .guide-flow span { white-space: normal; }
  .guide-panel { padding: 16px; }
  .guide-panel-head { grid-template-columns: 34px minmax(0, 1fr); }
  .guide-panel-head > b { grid-column: 1 / -1; justify-self: start; }
  .guide-logo { width: 34px; height: 34px; }
  .guide-panel-head h3 { font-size: 15px; }
  .guide-success { grid-template-columns: 1fr; gap: 5px; }
  .guide-steps li { padding: 12px 12px 12px 47px; }
  .guide-steps li::before { top: 12px; left: 12px; }
  .receiving-connect-card { padding: 68px 16px 16px; }
  .receiving-card-icon { top: 14px; left: 16px; width: 40px; height: 40px; }
  .receiving-connect-form { grid-template-columns: 1fr; }
  .receiving-connect-form label { grid-column: auto; }
  .receiving-connect-form .button { width: 100%; }
  .receiving-inbox-card { grid-template-columns: 38px minmax(0, 1fr); }
  .receiving-inbox-card > .status-pill { grid-column: 1 / -1; justify-self: start; }
  .receiving-inbox-meta { grid-column: 1 / -1; }
  .receiving-reconnect-form { grid-column: 1 / -1; grid-row: auto; }
  .import-mode-picker { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
