:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #667085;
  --line: #e3e8ef;
  --paper: #ffffff;
  --canvas: #f4f6fa;
  --brand: #2563eb;
  --brand-strong: #1d4ed8;
  --accent: #f59e0b;
  --danger: #d92d20;
  --soft: #eff6ff;
  --navy: #101828;
  --success: #079455;
  --shadow: 0 10px 28px rgba(16, 24, 40, 0.07);
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  min-height: 100%;
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  letter-spacing: -0.006em;
}

a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
  padding: 0 max(24px, calc((100vw - 1440px) / 2));
  background: rgba(16, 24, 40, 0.97);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
  color: #fff;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 17px;
  font-weight: 750;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 11px;
  background: linear-gradient(145deg, #3b82f6, #2563eb);
  color: #fff;
  font-weight: 900;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

.nav a,
.button,
button.button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  font-weight: 700;
  white-space: nowrap;
}

.topbar .nav a { border-color: transparent; background: transparent; color: #d0d5dd; }
.topbar .nav a:hover { border-color: rgba(255,255,255,.15); background: rgba(255,255,255,.08); color: #fff; box-shadow: none; }

.button.primary,
.nav a.primary {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}
.topbar .nav a.primary { border-color: #3b82f6; background: #2563eb; color: #fff; }

.button.warn { border-color: #fed7aa; color: #9a3412; background: #fff7ed; }
.button.danger { border-color: #fecaca; color: var(--danger); background: #fff5f5; }
.button:hover, .nav a:hover { transform: translateY(-1px); box-shadow: 0 10px 26px rgba(23, 32, 38, 0.08); }

.wrap {
  width: min(1360px, calc(100% - 40px));
  margin: 0 auto;
  padding: 32px 0 54px;
}

.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
  align-items: stretch;
}

.panel,
.card,
.auth-box {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.panel { padding: 26px; }
.card { padding: 20px; }
.auth-box {
  width: min(480px, calc(100% - 32px));
  margin: 42px auto;
  padding: 34px;
}

h1, h2, h3 { margin: 0; line-height: 1.18; }
h1 { font-size: 36px; letter-spacing: -0.035em; }
h2 { font-size: 24px; }
h3 { font-size: 17px; }
p { color: var(--muted); line-height: 1.65; }
.settings-page code {
  padding: 2px 6px;
  border-radius: 5px;
  background: #eef2f4;
  color: #24343e;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
}
.small { color: var(--muted); font-size: 13px; }
.kicker { color: var(--brand-strong); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }

.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.stat {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 108px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, #fff, #fafcff);
}
.stat strong { font-size: 30px; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field { display: flex; flex-direction: column; gap: 7px; }
.field.full { grid-column: 1 / -1; }
label { color: #2e3b43; font-size: 13px; font-weight: 800; }
input, textarea, select {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  outline: none;
}
textarea { min-height: 150px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12); }
.checkbox-row { display: flex; align-items: center; gap: 10px; min-height: 42px; }
.checkbox-row input { width: 18px; min-height: 18px; }

.alert {
  padding: 13px 15px;
  margin: 0 0 18px;
  border-radius: 10px;
  border: 1px solid #abefc6;
  background: #ecfdf3;
  color: #067647;
  font-weight: 700;
}
.alert.error { border-color: #fecaca; background: #fff1f2; color: var(--danger); }

.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; min-width: 720px; background: #fff; }
th, td { padding: 13px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: #475467; font-size: 11px; letter-spacing: .045em; text-transform: uppercase; background: #f8fafc; }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background 120ms ease; }
tbody tr:hover { background: #f8fbff; }
.badge { display: inline-flex; min-height: 26px; align-items: center; padding: 0 10px; border: 1px solid #dbeafe; border-radius: 999px; background: var(--soft); color: var(--brand-strong); font-size: 12px; font-weight: 750; }
.badge.gray { background: #eef2f4; color: #455660; }
.badge.warn { background: #fff7ed; color: #9a3412; }

.mail-shell {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 20px;
}
.mail-side {
  position: sticky;
  top: 86px;
  align-self: start;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.mail-side a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 8px;
  color: #33424c;
  font-weight: 700;
}
.mail-side a.active, .mail-side a:hover { background: var(--soft); color: var(--brand-strong); }
.mail-main { min-width: 0; }
.message-list { display: grid; gap: 10px; }
.message-row {
  display: grid;
  grid-template-columns: minmax(160px, 0.32fr) minmax(220px, 1fr) 120px;
  gap: 14px;
  align-items: center;
  min-height: 66px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.message-row.unread { border-color: #99f6e4; background: #f0fdfa; }
.message-subject { font-weight: 800; overflow-wrap: anywhere; }
.message-body {
  min-height: 320px;
  white-space: pre-wrap;
  line-height: 1.7;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.status-line { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 12px 0 0; }

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 13px;
}
.breadcrumb a:hover { color: var(--brand-strong); }
.breadcrumb strong { color: var(--ink); }
.settings-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.settings-side {
  position: sticky;
  top: 88px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  box-shadow: 0 10px 30px rgba(23, 32, 38, 0.06);
}
.settings-side-title {
  padding: 8px 10px 14px;
  font-size: 18px;
  font-weight: 850;
}
.settings-group {
  margin: 12px 10px 5px;
  color: #87949d;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.settings-side a {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px;
  border-radius: 8px;
  color: #33424c;
  font-size: 14px;
  font-weight: 750;
}
.settings-side a small { color: #7b8992; font-size: 11px; font-weight: 500; }
.settings-side a:hover { background: #f4f8f6; }
.section-overview .settings-side [data-section="overview"],
.section-mail .settings-side [data-section="mail"],
.section-tls .settings-side [data-section="tls"],
.section-smtp .settings-side [data-section="smtp"],
.section-database .settings-side [data-section="database"],
.section-redis .settings-side [data-section="redis"],
.section-access .settings-side [data-section="access"] {
  background: var(--soft);
  color: var(--brand-strong);
  box-shadow: inset 3px 0 var(--brand);
}
.settings-main { min-width: 0; }
.page-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 22px;
}
.page-heading h1 { margin-top: 4px; font-size: 34px; }
.page-heading p { max-width: 760px; margin: 8px 0 0; }
.settings-cards { display: grid; gap: 16px; }
.setting-card {
  display: block;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  box-shadow: 0 10px 30px rgba(23, 32, 38, 0.06);
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}
.setting-card:hover { transform: translateY(-2px); border-color: #9ccac4; box-shadow: var(--shadow); }
.setting-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.setting-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 10px;
  background: var(--soft);
  color: var(--brand-strong);
  font-size: 13px;
  font-weight: 900;
}
.setting-card h2 { font-size: 21px; }
.setting-card p { margin: 8px 0 18px; }
.setting-summary {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}
.setting-summary strong { color: var(--ink); overflow-wrap: anywhere; }
.setting-enter { display: inline-block; margin-top: 14px; color: var(--brand-strong); font-size: 13px; font-weight: 800; }
.setting-panel { margin-bottom: 18px; }
.setup-steps { display: grid; gap: 16px; margin: 0; padding: 0; list-style: none; counter-reset: none; }
.setup-step {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 16px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  box-shadow: 0 10px 30px rgba(23, 32, 38, 0.05);
}
.step-number {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 16px;
  font-weight: 900;
}
.step-content { min-width: 0; }
.step-content h2 { font-size: 20px; }
.step-content > p { margin: 7px 0 16px; }
.compact-form { max-width: 760px; }
.field-help { color: var(--muted); font-size: 12px; line-height: 1.5; }
.detected-addresses { display: grid; gap: 9px; margin: 12px 0 16px; padding: 14px; border: 1px solid #b8ddd7; border-radius: 8px; background: var(--soft); }
.dns-table-wrap { overflow-x: auto; margin-top: 12px; }
.dns-table { min-width: 620px; box-shadow: none; }
.callout {
  margin-top: 16px;
  padding: 13px 15px;
  border-left: 4px solid #d97706;
  border-radius: 6px;
  background: #fff7ed;
  color: #784211;
  font-size: 13px;
  line-height: 1.65;
}
.callout.success { border-left-color: var(--brand); background: var(--soft); color: #174e48; }
.service-status { margin: 14px 0; }
.check-list { display: grid; gap: 9px; margin: 14px 0 0; padding-left: 22px; color: var(--muted); line-height: 1.55; }
.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.choice-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}
.choice-card:has(input:checked) { border-color: var(--brand); background: var(--soft); }
.choice-card input { width: 18px; min-height: 18px; margin-top: 2px; }
.choice-card span { display: flex; flex-direction: column; gap: 5px; }
.choice-card strong { font-size: 15px; }
.choice-card small { color: var(--muted); font-weight: 500; line-height: 1.5; }
.section-divider { display: flex; align-items: center; gap: 12px; margin: 24px 0 18px; color: #53636d; font-size: 12px; font-weight: 800; text-transform: uppercase; }
.section-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.guide-panel { padding: 22px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfb; }
.guide-panel h2 { font-size: 19px; }
.guide-panel ol { display: grid; gap: 11px; margin: 15px 0 0; padding-left: 22px; color: var(--muted); line-height: 1.6; }
.enable-row { padding: 16px; border: 1px solid #b8ddd7; border-radius: 8px; background: var(--soft); }
.enable-row label { display: flex; align-items: flex-start; gap: 10px; }
.enable-row input, .checkbox-field input { width: 18px; min-height: 18px; }
.enable-row span { display: flex; flex-direction: column; gap: 4px; }
.enable-row small { color: var(--muted); font-weight: 500; }
.checkbox-field { justify-content: center; }
.checkbox-field label { display: flex; align-items: center; gap: 9px; min-height: 42px; }
.tenant-overview .nav [data-tenant-nav="overview"],
.tenant-domains .nav [data-tenant-nav="domains"],
.tenant-domain-detail .nav [data-tenant-nav="domains"],
.tenant-users .nav [data-tenant-nav="users"] {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}
.tenant-smtp .nav [data-tenant-nav="smtp"] { border-color: var(--brand); background: var(--brand); color: #fff; }
.dns-record-list { display: grid; gap: 12px; }
.dns-record { padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcfb; }
.dns-record > div { display: flex; gap: 10px; align-items: center; }
.dns-record dl { display: grid; grid-template-columns: 110px minmax(0, 1fr); margin: 14px 0 0; border-top: 1px solid var(--line); }
.dns-record dt, .dns-record dd { margin: 0; padding: 10px 0; border-bottom: 1px solid var(--line); }
.dns-record dt { color: var(--muted); font-size: 12px; font-weight: 800; }
.dns-record dd { overflow-wrap: anywhere; }
.dns-record textarea { min-height: 100px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.dns-record p { margin: 10px 0 0; font-size: 12px; }
.client-config-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.client-config-block { padding: 17px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcfb; }
.client-config-block h3 { margin-bottom: 12px; }
.client-config-block dl { margin: 0 0 14px; }
.client-config-block dt { margin-top: 9px; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.client-config-block dd { margin: 3px 0 0; overflow-wrap: anywhere; line-height: 1.5; }
.client-steps { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.client-steps li { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.client-steps li:last-child { border-bottom: 0; }
.client-steps li > span { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 50%; background: var(--soft); color: var(--brand-strong); font-weight: 900; }
.client-steps p { margin: 4px 0 0; font-size: 13px; }
.faq-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 16px; }
.faq-grid > div { padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.faq-grid p { margin: 5px 0 0; font-size: 13px; }
.smtp-parameter-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.smtp-parameter-grid > div { display: flex; flex-direction: column; gap: 6px; min-height: 82px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcfb; }
.smtp-parameter-grid span { color: var(--muted); font-size: 12px; font-weight: 750; }
.smtp-parameter-grid strong { overflow-wrap: anywhere; font-size: 15px; }
.smtp-alert { margin-top: 16px; margin-bottom: 0; }
.config-example { overflow: hidden; border: 1px solid #273842; border-radius: 9px; background: #172026; color: #e6f1ef; }
.config-example-title { padding: 11px 15px; border-bottom: 1px solid #334650; color: #a7c9c4; font-size: 12px; font-weight: 800; text-transform: uppercase; }
.config-example pre { overflow-x: auto; margin: 0; padding: 16px; font: 13px/1.7 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }

/* Commercial application shell */
.page-heading {
  padding: 2px 2px 4px;
}
.page-heading p { font-size: 14px; }
.settings-layout { grid-template-columns: 252px minmax(0, 1fr); gap: 28px; }
.settings-side,
.mail-side {
  border: 0;
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.settings-side { padding: 14px; }
.settings-side-title { padding: 10px 12px 16px; font-size: 15px; }
.settings-group { margin-top: 18px; color: #98a2b3; }
.settings-side a { min-height: 52px; padding: 10px 12px; }
.section-overview .settings-side [data-section="overview"],
.section-mail .settings-side [data-section="mail"],
.section-tls .settings-side [data-section="tls"],
.section-smtp .settings-side [data-section="smtp"],
.section-database .settings-side [data-section="database"],
.section-redis .settings-side [data-section="redis"],
.section-access .settings-side [data-section="access"] {
  box-shadow: inset 3px 0 var(--brand);
}
.settings-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.setting-card {
  min-height: 230px;
  border-radius: 14px;
  box-shadow: 0 4px 16px rgba(16, 24, 40, .045);
}
.setting-card:hover { transform: translateY(-3px); border-color: #bfdbfe; box-shadow: 0 16px 36px rgba(37, 99, 235, .10); }
.setting-icon { border-radius: 12px; background: #eff6ff; color: #1d4ed8; }
.setup-step { border-radius: 14px; box-shadow: 0 4px 16px rgba(16, 24, 40, .045); }
.step-number { background: linear-gradient(145deg, #3b82f6, #1d4ed8); box-shadow: 0 6px 16px rgba(37,99,235,.22); }
.callout { border-radius: 9px; }
.callout.success { border-left-color: var(--success); background: #ecfdf3; color: #067647; }
.mail-shell { grid-template-columns: 250px minmax(0, 1fr); gap: 24px; }
.mail-side { padding: 12px; }
.mail-side::before {
  content: "MAILBOX";
  display: block;
  padding: 10px 12px;
  color: #98a2b3;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
}
.mail-side a { min-height: 46px; }
.message-row { border-radius: 11px; box-shadow: 0 2px 8px rgba(16,24,40,.03); }
.message-row:hover { border-color: #bfdbfe; box-shadow: 0 8px 20px rgba(37,99,235,.08); }
.message-row.unread { border-color: #bfdbfe; background: #f5f9ff; }
.auth-page {
  background:
    radial-gradient(circle at 12% 10%, rgba(37,99,235,.13), transparent 30%),
    radial-gradient(circle at 90% 85%, rgba(14,165,233,.12), transparent 32%),
    var(--canvas);
}
.auth-page .auth-box { margin-top: 70px; }
.auth-box::before {
  content: "SECURE ACCESS";
  display: block;
  margin-bottom: 10px;
  color: var(--brand-strong);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .12em;
}
.auth-box h2 { font-size: 28px; }
.auth-box .button.primary { width: 100%; min-height: 46px; margin-top: 6px; }
.home-page .hero { min-height: calc(100vh - 72px); align-items: center; padding-top: 54px; padding-bottom: 72px; }
.home-page .hero > .panel { padding: 48px; background: linear-gradient(145deg, #fff 40%, #eef5ff); }
.home-page .hero h1 { max-width: 660px; margin-top: 12px; font-size: clamp(40px, 5vw, 64px); }
.home-page .hero > .grid .card { min-height: 142px; transition: transform 150ms ease, box-shadow 150ms ease; }
.home-page .hero > .grid .card:hover { transform: translateX(4px); box-shadow: 0 14px 30px rgba(37,99,235,.10); }
.home-page {
  background:
    radial-gradient(circle at 10% 12%, rgba(37,99,235,.12), transparent 26%),
    radial-gradient(circle at 88% 26%, rgba(14,165,233,.10), transparent 28%),
    #f7f9fc;
}
.landing-shell { padding-top: 0; }
.landing-hero {
  display: grid;
  min-height: 620px;
  grid-template-columns: minmax(0, .92fr) minmax(520px, 1.08fr);
  gap: 72px;
  align-items: center;
  padding: 72px 0 56px;
}
.landing-copy h1 { max-width: 720px; margin-top: 14px; font-size: clamp(42px, 5.2vw, 68px); line-height: 1.06; }
.landing-copy p { max-width: 640px; margin: 22px 0 0; font-size: 18px; line-height: 1.8; }
.landing-actions { margin-top: 30px; }
.landing-actions .button { min-height: 48px; padding: 0 22px; }
.product-visual { position: relative; padding: 20px 18px 42px; }
.visual-window {
  overflow: hidden;
  border: 1px solid rgba(148,163,184,.34);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 34px 80px rgba(15,23,42,.18), 0 8px 24px rgba(37,99,235,.08);
  transform: perspective(1200px) rotateY(-3deg) rotateX(1deg);
}
.visual-top { display: flex; align-items: center; gap: 7px; height: 48px; padding: 0 16px; border-bottom: 1px solid #e7ecf2; background: #fbfcfe; }
.visual-top span { width: 9px; height: 9px; border-radius: 50%; background: #d0d5dd; }
.visual-top span:first-child { background: #f97066; }
.visual-top span:nth-child(2) { background: #fdb022; }
.visual-top span:nth-child(3) { background: #32d583; }
.visual-top strong { margin-left: auto; margin-right: auto; color: #344054; font-size: 12px; }
.visual-body { display: grid; min-height: 390px; grid-template-columns: 74px 1fr; }
.visual-side { display: flex; flex-direction: column; gap: 18px; align-items: center; padding: 24px 0; background: #101828; }
.visual-side i { width: 24px; height: 7px; border-radius: 9px; background: #475467; }
.visual-side .visual-compose { width: 38px; height: 38px; margin-bottom: 8px; border-radius: 11px; background: #2563eb; }
.visual-inbox { padding: 24px; }
.visual-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; font-size: 18px; font-weight: 800; }
.visual-title b { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 9px; background: #eff6ff; color: #2563eb; font-size: 11px; }
.visual-mail { display: grid; grid-template-columns: 38px minmax(0,1fr) auto; gap: 12px; align-items: center; min-height: 70px; padding: 10px 12px; border-top: 1px solid #eef1f5; }
.visual-mail.active { margin: 0 -7px; padding-right: 19px; padding-left: 19px; border: 0; border-radius: 12px; background: #f0f6ff; }
.visual-mail > i { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; background: #e0e7ff; color: #3730a3; font-style: normal; font-size: 12px; font-weight: 800; }
.visual-mail > span { display: flex; min-width: 0; flex-direction: column; gap: 5px; }
.visual-mail b { color: #344054; font-size: 13px; }
.visual-mail small, .visual-mail time { overflow: hidden; color: #98a2b3; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.visual-security { position: absolute; right: -8px; bottom: 4px; display: flex; gap: 11px; align-items: center; padding: 13px 16px; border: 1px solid #d1fadf; border-radius: 13px; background: #fff; box-shadow: 0 16px 34px rgba(16,24,40,.14); }
.visual-security > span { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; background: #dcfae6; color: #079455; font-weight: 900; }
.visual-security div { display: flex; flex-direction: column; gap: 3px; }
.visual-security strong { font-size: 12px; }
.visual-security small { color: #667085; font-size: 10px; }
.portal-section { padding: 68px 0 86px; border-top: 1px solid #e4e7ec; }
.portal-heading { display: flex; justify-content: space-between; gap: 30px; align-items: end; margin-bottom: 26px; }
.portal-heading h2 { margin-top: 8px; font-size: 32px; }
.portal-heading p { max-width: 440px; margin: 0; text-align: right; }
.portal-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px; }
.portal-card { display: flex; gap: 18px; min-height: 210px; padding: 26px; border: 1px solid #e3e8ef; border-radius: 16px; background: #fff; box-shadow: 0 5px 18px rgba(16,24,40,.045); transition: transform 150ms ease, box-shadow 150ms ease, border 150ms ease; }
.portal-card:hover { transform: translateY(-4px); border-color: #bfdbfe; box-shadow: 0 20px 44px rgba(37,99,235,.11); }
.portal-card.featured { border-color: #bfdbfe; background: linear-gradient(145deg,#fff,#f2f7ff); }
.portal-icon { display: grid; width: 46px; height: 46px; flex: 0 0 46px; place-items: center; border-radius: 13px; background: #eff6ff; color: #1d4ed8; font-size: 18px; font-weight: 850; }
.portal-card h3 { font-size: 20px; }
.portal-card p { min-height: 72px; margin: 10px 0 16px; font-size: 13px; }
.portal-card strong { color: #1d4ed8; font-size: 13px; }
.admin-page .stat,
.tenant-page .stat { border-top: 3px solid #dbeafe; }
.smtp-parameter-grid > div,
.client-config-block,
.dns-record { border-radius: 11px; }
input[readonly] { background: #f8fafc; color: #475467; }
button:disabled, .button:disabled { cursor: not-allowed; opacity: .5; transform: none; }

/* Enterprise webmail workspace */
.commercial-mail-page {
  background: #f5f7fb;
  color: #182230;
}
.mail-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  min-height: 76px;
  grid-template-columns: 260px minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  padding: 0 max(24px, calc((100vw - 1540px) / 2));
  border-bottom: 1px solid #e4e7ec;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 1px 2px rgba(16,24,40,.035);
  backdrop-filter: blur(16px);
}
.mail-brand { display: inline-flex; gap: 11px; align-items: center; }
.mail-brand > span:last-child { display: flex; flex-direction: column; gap: 1px; }
.mail-brand strong { font-size: 17px; letter-spacing: -.02em; }
.mail-brand small { color: #667085; font-size: 10px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.mail-brand-mark { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 12px; background: linear-gradient(145deg,#2563eb,#1d4ed8); color: #fff; font-weight: 900; box-shadow: 0 8px 18px rgba(37,99,235,.22); }
.mail-topbar-title { color: #667085; font-size: 13px; }
.mail-account { display: flex; gap: 10px; align-items: center; }
.mail-account-copy { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.mail-account-copy strong { font-size: 13px; }
.mail-account-copy small { max-width: 220px; overflow: hidden; color: #667085; font-size: 11px; text-overflow: ellipsis; }
.mail-logout { margin-left: 6px; padding: 8px 11px; border: 1px solid #e4e7ec; border-radius: 8px; color: #475467; font-size: 12px; font-weight: 750; }
.mail-logout:hover { border-color: #bfdbfe; background: #eff6ff; color: #1d4ed8; }
.mail-workspace { display: grid; width: min(1540px, calc(100% - 40px)); min-height: calc(100vh - 76px); grid-template-columns: 260px minmax(0, 1fr); gap: 28px; margin: 0 auto; padding: 28px 0 50px; }
.commercial-mail-side { top: 104px; display: flex; max-height: calc(100vh - 128px); flex-direction: column; padding: 14px !important; border: 1px solid #e4e7ec !important; box-shadow: 0 8px 26px rgba(16,24,40,.055) !important; }
.commercial-mail-side::before { display: none !important; content: none !important; }
.commercial-mail-side .mail-compose-button { justify-content: center; min-height: 48px; margin-bottom: 18px; background: linear-gradient(145deg,#2563eb,#1d4ed8); color: #fff; box-shadow: 0 8px 18px rgba(37,99,235,.18); }
.commercial-mail-side .mail-compose-button:hover,
.commercial-mail-side .mail-compose-button.active { background: linear-gradient(145deg,#1d4ed8,#1e40af); color: #fff; }
.compose-plus { font-size: 22px; font-weight: 500; line-height: 1; }
.mail-nav-label { margin: 10px 10px 6px; color: #98a2b3; font-size: 10px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.mail-folder-nav { display: grid; gap: 3px; }
.commercial-mail-side .mail-folder-nav a { min-height: 44px; padding: 0 10px; color: #475467; font-size: 13px; }
.commercial-mail-side .mail-folder-nav a.active { box-shadow: inset 3px 0 #2563eb; }
.mail-nav-name { display: inline-flex; gap: 10px; align-items: center; }
.mail-nav-icon { display: grid; width: 26px; height: 26px; place-items: center; border-radius: 8px; background: #f2f4f7; color: #667085; font-size: 10px; font-weight: 850; }
.mail-folder-nav a.active .mail-nav-icon { background: #dbeafe; color: #1d4ed8; }
.mail-side-account { display: flex; gap: 10px; align-items: center; margin-top: auto; padding: 16px 10px 4px; border-top: 1px solid #eaecf0; }
.mail-side-account > div { display: flex; flex-direction: column; gap: 2px; }
.mail-side-account strong { font-size: 12px; }
.mail-side-account small { color: #98a2b3; font-size: 10px; }
.secure-dot { width: 9px; height: 9px; flex: 0 0 9px; border-radius: 50%; background: #12b76a; box-shadow: 0 0 0 4px #dcfae6; }
.mail-content { min-width: 0; }
.mailbox-heading { display: flex; gap: 24px; align-items: center; justify-content: space-between; margin: 2px 2px 24px; }
.mailbox-heading h1 { margin-top: 5px; font-size: 32px; }
.mailbox-heading p { margin: 7px 0 0; font-size: 13px; }
.mail-primary-action { min-height: 44px; padding: 0 19px; }
.mail-list-card,
.message-reader,
.compose-card { overflow: hidden; border: 1px solid #e4e7ec; border-radius: 16px; background: #fff; box-shadow: 0 8px 28px rgba(16,24,40,.055); }
.mail-list-tools { display: flex; gap: 16px; align-items: center; justify-content: space-between; min-height: 68px; padding: 12px 18px; border-bottom: 1px solid #eaecf0; background: #fcfcfd; }
.mail-search { display: flex; width: min(620px, 100%); align-items: center; overflow: hidden; border: 1px solid #d0d5dd; border-radius: 10px; background: #fff; }
.mail-search > span { padding-left: 13px; color: #98a2b3; font-size: 20px; }
.mail-search input { min-height: 40px; border: 0; box-shadow: none; }
.mail-search input:focus { box-shadow: none; }
.mail-search button { align-self: stretch; padding: 0 16px; border: 0; border-left: 1px solid #eaecf0; background: #f8fafc; color: #344054; cursor: pointer; font-weight: 750; }
.mail-search a { padding: 0 12px; color: #2563eb; font-size: 12px; font-weight: 700; }
.mail-refresh { padding: 9px 13px; border: 1px solid #e4e7ec; border-radius: 9px; color: #475467; font-size: 12px; font-weight: 750; }
.mail-search-result { padding: 10px 20px; border-bottom: 1px solid #eaecf0; background: #eff6ff; color: #1d4ed8; font-size: 12px; font-weight: 750; }
.commercial-message-list { display: block; }
.commercial-message-list .message-row { position: relative; grid-template-columns: 8px 40px minmax(145px,.28fr) minmax(260px,1fr) 105px; min-height: 82px; gap: 13px; padding: 11px 18px; border: 0; border-bottom: 1px solid #eef1f5; border-radius: 0; box-shadow: none; transition: background 120ms ease; }
.commercial-message-list .message-row:last-child { border-bottom: 0; }
.commercial-message-list .message-row:hover { border-color: #eef1f5; background: #f8fbff; box-shadow: none; }
.commercial-message-list .message-row.unread { border-color: #eef1f5; background: #f5f9ff; }
.commercial-message-list .message-row.unread:hover { background: #edf5ff; }
.unread-indicator { width: 7px; height: 7px; border-radius: 50%; background: transparent; }
.message-row.unread .unread-indicator { background: #2563eb; box-shadow: 0 0 0 3px #dbeafe; }
.mail-avatar { display: grid; width: 38px; height: 38px; flex: 0 0 38px; place-items: center; border-radius: 12px; background: linear-gradient(145deg,#e0e7ff,#dbeafe); color: #1d4ed8; font-size: 13px; font-style: normal; font-weight: 850; text-transform: uppercase; }
.small-avatar { width: 34px; height: 34px; flex-basis: 34px; border-radius: 10px; }
.large-avatar { width: 46px; height: 46px; flex-basis: 46px; border-radius: 14px; font-size: 16px; }
.message-person,
.message-copy,
.message-meta { display: flex; min-width: 0; flex-direction: column; gap: 5px; }
.message-person strong,
.message-copy strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.message-person small,
.message-copy small { overflow: hidden; color: #98a2b3; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.message-row.unread .message-person strong,
.message-row.unread .message-copy strong { color: #101828; font-weight: 850; }
.message-copy em { overflow: hidden; color: #d92d20; font-size: 10px; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.message-meta { align-items: flex-end; justify-content: center; color: #667085; font-size: 11px; }
.delivery-state { color: #079455; font-weight: 750; }
.delivery-state.failed { color: #d92d20; }
.starred { margin-right: 6px; color: #f79009; font-style: normal; }
.mail-empty { display: flex; min-height: 390px; flex-direction: column; align-items: center; justify-content: center; padding: 40px; text-align: center; }
.mail-empty > span { display: grid; width: 64px; height: 64px; place-items: center; border-radius: 20px; background: #eff6ff; color: #2563eb; font-size: 27px; }
.mail-empty h2 { margin-top: 18px; font-size: 20px; }
.mail-empty p { margin: 8px 0 18px; font-size: 13px; }
.message-toolbar { display: flex; gap: 18px; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.mail-back { color: #475467; font-size: 13px; font-weight: 750; }
.mail-back:hover { color: #1d4ed8; }
.message-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.message-actions form { margin: 0; }
.message-actions .button { min-height: 36px; padding: 0 12px; font-size: 12px; }
.message-reader { min-height: 650px; }
.message-reader-head { padding: 30px 34px 22px; border-bottom: 1px solid #eaecf0; }
.message-title-line { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; }
.message-reader-head h1 { overflow-wrap: anywhere; font-size: 30px; }
.message-sender-card { display: flex; gap: 13px; align-items: center; margin-top: 24px; }
.message-addresses { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 4px; }
.message-addresses strong { overflow-wrap: anywhere; font-size: 13px; }
.message-addresses span { color: #667085; font-size: 11px; }
.message-sender-card time { color: #667085; font-size: 12px; }
.message-reader .message-body { min-height: 330px; padding: 34px; border: 0; border-radius: 0; color: #253044; font-size: 15px; line-height: 1.82; }
.message-delivery-error { margin: 24px 34px 0; }
.message-reply-panel { display: flex; gap: 24px; align-items: center; justify-content: space-between; margin: 0 34px 30px; padding: 20px; border: 1px solid #dbeafe; border-radius: 12px; background: #f5f9ff; }
.message-reply-panel p { margin: 5px 0 0; font-size: 12px; }
.compose-card { min-height: 680px; }
.compose-head { display: flex; gap: 24px; align-items: center; justify-content: space-between; padding: 26px 30px; border-bottom: 1px solid #eaecf0; background: #fcfcfd; }
.compose-head h1 { margin-top: 4px; font-size: 28px; }
.compose-head p { margin: 7px 0 0; font-size: 12px; }
.compose-fields { padding: 0 30px; }
.compose-line { display: grid; grid-template-columns: 80px minmax(0,1fr); align-items: center; min-height: 62px; border-bottom: 1px solid #eaecf0; }
.compose-line > span,
.compose-body-field > span { color: #475467; font-size: 12px; font-weight: 800; }
.compose-line input { min-height: 60px; padding: 0; border: 0; border-radius: 0; box-shadow: none; }
.compose-line input:focus { box-shadow: none; }
.compose-body-field { display: flex; flex-direction: column; gap: 14px; padding: 22px 0; }
.compose-body-field textarea { min-height: 360px; padding: 0; border: 0; border-radius: 0; font-size: 15px; line-height: 1.75; box-shadow: none; }
.compose-body-field textarea:focus { box-shadow: none; }
.compose-footer { display: flex; gap: 20px; align-items: center; justify-content: space-between; padding: 18px 30px; border-top: 1px solid #eaecf0; background: #fcfcfd; }
.compose-footer > span { color: #667085; font-size: 11px; }
.compose-send { min-width: 130px; }
.commercial-mail-page .client-config { border-radius: 16px; }

@media (max-width: 900px) {
  .topbar { align-items: flex-start; flex-direction: column; padding: 16px 18px; }
  .nav { justify-content: flex-start; }
  .hero, .grid.two, .grid.three, .grid.four, .form-grid, .mail-shell, .settings-layout, .choice-grid, .client-config-grid, .faq-grid, .smtp-parameter-grid, .settings-cards { grid-template-columns: 1fr; }
  h1 { font-size: 30px; }
  .mail-side, .settings-side { position: static; }
  .settings-side { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-side-title, .settings-group { grid-column: 1 / -1; }
  .page-heading { flex-direction: column; }
  .setup-step { grid-template-columns: 1fr; }
  .message-row { grid-template-columns: 1fr; }
  .landing-hero { min-height: auto; grid-template-columns: 1fr; gap: 34px; padding-top: 48px; }
  .product-visual { max-width: 680px; width: 100%; margin: 0 auto; }
  .portal-grid { grid-template-columns: 1fr; }
  .portal-heading { align-items: flex-start; flex-direction: column; }
  .portal-heading p { text-align: left; }
  .mail-topbar { grid-template-columns: 1fr auto; padding: 12px 18px; }
  .mail-topbar-title { display: none; }
  .mail-workspace { width: min(100% - 28px, 760px); grid-template-columns: 1fr; gap: 16px; padding-top: 16px; }
  .commercial-mail-side { position: static; max-height: none; }
  .commercial-mail-side .mail-compose-button { margin-bottom: 8px; }
  .mail-folder-nav { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .mail-nav-label,
  .mail-side-account { display: none; }
  .commercial-message-list .message-row { grid-template-columns: 7px 36px minmax(120px,.35fr) minmax(180px,1fr) 80px; }
}

@media (max-width: 560px) {
  .settings-side { grid-template-columns: 1fr; }
  .setting-summary { grid-template-columns: 1fr; gap: 4px; }
  .setup-step { padding: 18px; }
  .dns-record dl { grid-template-columns: 1fr; }
  .dns-record dt { padding-bottom: 0; border-bottom: 0; }
  .landing-copy h1 { font-size: 40px; }
  .landing-copy p { font-size: 16px; }
  .product-visual { padding: 0 0 34px; }
  .visual-body { grid-template-columns: 52px minmax(0,1fr); }
  .visual-inbox { padding: 16px 12px; }
  .visual-mail { grid-template-columns: 32px minmax(0,1fr); }
  .visual-mail time { display: none; }
  .visual-security { right: -4px; }
  .portal-card { min-height: 0; }
  .mail-topbar { grid-template-columns: 1fr auto; gap: 10px; }
  .mail-account-copy { display: none; }
  .mail-logout { margin-left: 0; }
  .mail-workspace { width: calc(100% - 20px); }
  .mail-folder-nav { grid-template-columns: 1fr 1fr; }
  .commercial-mail-side .mail-folder-nav a { padding: 0 7px; }
  .mailbox-heading { align-items: flex-start; }
  .mailbox-heading h1 { font-size: 27px; }
  .mail-primary-action { min-height: 40px; padding: 0 12px; }
  .mail-list-tools { align-items: stretch; flex-direction: column; }
  .mail-refresh { align-self: flex-end; }
  .commercial-message-list .message-row { grid-template-columns: 7px 36px minmax(0,1fr) 66px; min-height: 88px; padding: 10px 12px; }
  .commercial-message-list .message-person { display: none; }
  .message-copy small { white-space: normal; }
  .message-toolbar { align-items: flex-start; flex-direction: column; }
  .message-actions { justify-content: flex-start; }
  .message-reader-head { padding: 24px 20px 18px; }
  .message-reader-head h1 { font-size: 25px; }
  .message-sender-card time { display: none; }
  .message-reader .message-body { padding: 26px 20px; }
  .message-reply-panel { align-items: flex-start; flex-direction: column; margin: 0 20px 22px; }
  .compose-head { align-items: flex-start; flex-direction: column; padding: 22px 20px; }
  .compose-head .actions { width: 100%; }
  .compose-head .actions .button { flex: 1; }
  .compose-fields { padding: 0 20px; }
  .compose-line { grid-template-columns: 62px minmax(0,1fr); }
  .compose-footer { padding: 16px 20px; }
  .compose-footer > span { display: none; }
  .compose-footer .button { width: 100%; }
}
