:root {
  --bg: #f4f6fb;
  --panel: rgba(255, 255, 255, 0.84);
  --text: #1f2a44;
  --muted: #687792;
  --line: rgba(38, 56, 98, 0.08);
  --primary: #355cff;
  --primary-2: #6e8cff;
  --success: #16a34a;
  --danger: #dc2626;
  --shadow: 0 20px 50px rgba(43, 61, 110, 0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(53, 92, 255, 0.12), transparent 30%),
    radial-gradient(circle at top right, rgba(110, 140, 255, 0.18), transparent 28%),
    linear-gradient(180deg, #f9fbff 0%, #eef2fb 100%);
}

.page-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 30px 20px 50px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  align-items: start;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--primary);
  letter-spacing: 0.18em;
  font-size: 11px;
  font-weight: 700;
}

.hero-copy {
  min-width: 0;
  padding-top: 6px;
}

h1 {
  margin: 0;
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1.05;
}

.subtitle {
  max-width: 540px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.5;
}

.hero-card,
.panel,
.stat-card {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(18px);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.hero-card {
  min-width: 0;
  padding: 18px;
  display: grid;
  gap: 12px;
}

.hero-card span,
.stat-card span,
.field span,
.meta-pill span,
.register-card span,
.admin-card-grid span,
.admin-countdown span {
  color: var(--muted);
  font-size: 13px;
}

.hero-card strong {
  font-size: 18px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.hero-card-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  font-weight: 600;
}

.hero-card .small-btn {
  margin-top: 0;
  align-self: flex-start;
}

.domain-switch-card {
  width: 100%;
  align-items: stretch;
  position: relative;
  overflow: visible;
  z-index: 12;
}

.domain-card-title {
  display: grid;
  gap: 2px;
}

.domain-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.domain-card-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.domain-card-copy {
  display: grid;
  gap: 4px;
}

.domain-card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.domain-card-detail {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.domain-card-helper {
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(255, 141, 92, 0.18);
  background: rgba(255, 141, 92, 0.1);
  color: #b45309;
  font-size: 12px;
  line-height: 1.5;
}

.domain-card-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  background: rgba(76, 92, 145, 0.08);
  border: 1px solid rgba(76, 92, 145, 0.12);
}

.domain-card-badge.is-root {
  color: #a16207;
  background: rgba(250, 204, 21, 0.16);
  border-color: rgba(234, 179, 8, 0.28);
}

.domain-card-badge.is-subdomain {
  color: #15803d;
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.2);
}

.domain-switch-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 40;
  width: min(420px, calc(100vw - 40px));
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(76, 92, 145, 0.1);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(20px);
  box-shadow: 0 24px 60px rgba(31, 41, 55, 0.16);
}

.domain-switch-panel-copy {
  display: grid;
  gap: 4px;
}

.domain-switch-panel-copy strong {
  font-size: 13px;
}

.domain-switch-panel-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.domain-switch-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  max-height: 360px;
  overflow: auto;
  padding-right: 4px;
}

.domain-switch-item {
  width: 100%;
  border: 1px solid rgba(76, 92, 145, 0.14);
  border-radius: 16px;
  background: rgba(248, 250, 255, 0.86);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  transition: 0.2s ease;
  cursor: pointer;
}

.domain-switch-item:hover {
  border-color: rgba(53, 92, 255, 0.24);
  background: rgba(241, 245, 255, 0.96);
}

.domain-switch-item:disabled {
  cursor: default;
  opacity: 1;
}

.domain-switch-item.is-active {
  border-color: rgba(53, 92, 255, 0.28);
  background: linear-gradient(135deg, rgba(53, 92, 255, 0.10), rgba(255, 255, 255, 0.95));
  box-shadow: inset 0 0 0 1px rgba(53, 92, 255, 0.06);
}

.domain-switch-item-main {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.domain-switch-item-main strong {
  font-size: 15px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.domain-switch-item-main em {
  font-style: normal;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.domain-switch-item-meta {
  flex: 0 0 auto;
  display: grid;
  justify-items: end;
  gap: 6px;
}

.domain-switch-item-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid rgba(76, 92, 145, 0.12);
  background: rgba(76, 92, 145, 0.08);
  color: var(--text);
}

.domain-switch-item-badge.is-root {
  color: #a16207;
  background: rgba(250, 204, 21, 0.16);
  border-color: rgba(234, 179, 8, 0.28);
}

.domain-switch-item-badge.is-subdomain {
  color: #15803d;
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.2);
}

.domain-switch-item-state {
  font-size: 12px;
  line-height: 1;
  font-weight: 700;
  color: var(--muted);
}

.domain-switch-item.is-open .domain-switch-item-state,
.domain-switch-item.is-default .domain-switch-item-state {
  color: #0f766e;
}

.domain-switch-item.is-access .domain-switch-item-state {
  color: #b45309;
}

.domain-switch-item.is-private .domain-switch-item-state {
  color: #5b21b6;
}

.domain-switch-item.is-closed .domain-switch-item-state {
  color: var(--danger);
}

.domain-switch-card .button-row {
  flex-wrap: nowrap;
  justify-content: flex-end;
}

.domain-switch-card .small-btn {
  min-height: 40px;
}

.domain-card-actions .primary.small-btn,
.domain-card-actions .ghost.small-btn {
  min-width: 104px;
  justify-content: center;
}

.domain-switch-card .button-row .small-btn {
  min-width: 112px;
  justify-content: center;
}

.domain-switch-modal-panel {
  max-width: 420px;
}

.domain-switch-modal-panel input {
  min-height: 44px;
}

.grid {
  display: grid;
  gap: 20px;
}

.home-grid {
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
  align-items: start;
}

.legal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
}

.admin-layout {
  display: grid;
  gap: 20px;
}

.admin-shell {
  max-width: 1440px;
}

.admin-topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  padding: 20px 22px;
  margin-bottom: 20px;
}

.admin-topbar-main {
  display: grid;
  gap: 8px;
}

.admin-topbar-label {
  margin: 0;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.admin-topbar-main h1 {
  margin: 0;
  font-size: clamp(34px, 4vw, 52px);
  line-height: 1.04;
}

.admin-topbar-subtitle {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.admin-topbar-side {
  min-width: 280px;
  display: grid;
  gap: 10px;
  justify-items: start;
}

.admin-topbar-meta {
  display: grid;
  gap: 4px;
}

.admin-topbar-meta span {
  color: var(--muted);
  font-size: 13px;
}

.admin-topbar-meta strong {
  font-size: 28px;
  line-height: 1.1;
}

.admin-topbar-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-topbar-stats span {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(76, 92, 145, 0.12);
  background: rgba(245, 248, 255, 0.82);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.admin-workbench {
  display: grid;
  grid-template-columns: 206px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.admin-sidebar {
  position: sticky;
  top: 20px;
  padding: 14px;
  display: grid;
  gap: 14px;
}

.admin-sidebar-block {
  display: grid;
  gap: 10px;
}

.admin-sidebar-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-tabs.admin-tabs-vertical {
  display: grid;
  gap: 8px;
  margin: 0;
}

.admin-tabs.admin-tabs-vertical .tab {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
  border-radius: 16px;
  padding: 12px 14px;
}

.admin-domain-pills {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 360px;
  overflow: auto;
  padding-right: 4px;
}

.admin-domain-pill {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  min-width: 0;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(76, 92, 145, 0.12);
  background: rgba(245, 248, 255, 0.84);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.admin-domain-pill.is-root-tier {
  color: #a16207;
  background: rgba(250, 204, 21, 0.14);
  border-color: rgba(234, 179, 8, 0.24);
}

.admin-domain-pill.is-subdomain-tier {
  color: #15803d;
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.18);
}

.admin-domain-pill.is-default,
.admin-domain-pill.is-public {
  color: #0f766e;
  background: rgba(20, 184, 166, 0.1);
  border-color: rgba(20, 184, 166, 0.16);
}

.admin-domain-pill.is-internal {
  color: #5b21b6;
  background: rgba(139, 92, 246, 0.1);
  border-color: rgba(139, 92, 246, 0.16);
}

.admin-domain-pill.is-reserved {
  color: #9a3412;
  background: rgba(249, 115, 22, 0.1);
  border-color: rgba(249, 115, 22, 0.16);
}

.admin-domain-pill.is-root-tier:not(.is-reserved),
.admin-domain-pill.is-root-tier.is-default,
.admin-domain-pill.is-root-tier.is-public,
.admin-domain-pill.is-root-tier.is-internal {
  color: #a16207;
  background: rgba(250, 204, 21, 0.14);
  border-color: rgba(234, 179, 8, 0.24);
}

.admin-domain-pill.is-subdomain-tier:not(.is-reserved),
.admin-domain-pill.is-subdomain-tier.is-default,
.admin-domain-pill.is-subdomain-tier.is-public,
.admin-domain-pill.is-subdomain-tier.is-internal {
  color: #15803d;
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.18);
}

.admin-main.panel {
  padding: 18px;
}

.admin-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(76, 92, 145, 0.08);
}

.admin-panel-head h2 {
  margin: 0;
  font-size: 24px;
}

.admin-panel-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.admin-pane {
  display: none;
}

.admin-pane.is-active {
  display: grid;
  gap: 18px;
  align-items: start;
}

.admin-pane-overview {
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
}

.overview-summary-section,
.overview-domains-section {
  grid-column: 1;
}

.overview-management-section,
.overview-internal-section,
.overview-send-section {
  grid-column: 2;
}

.admin-pane-access {
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
}

.access-settings-section {
  grid-column: 1;
}

.access-list-section {
  grid-column: 2;
}

.admin-pane-security {
  grid-template-columns: minmax(320px, 380px) minmax(0, 1fr);
}

.security-bans-section {
  grid-column: 1;
}

.security-reports-section {
  grid-column: 2;
}

.admin-section {
  margin: 0;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.74);
}

.login-panel {
  max-width: 480px;
  margin: 0 auto;
}

.admin-tabs {
  margin-bottom: 18px;
}

.admin-section + .admin-section {
  margin-top: 0;
}

.panel {
  padding: 22px;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.domain-quick-switches {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 8px;
  max-height: 186px;
  overflow: auto;
  padding-right: 4px;
}

.domain-quick-switches .tab {
  margin: 0;
  width: 100%;
  min-width: 0;
  justify-content: flex-start;
  padding: 9px 12px;
  font-size: 13px;
}

.domain-quick-switches .tab.is-root-tier:not(.is-active) {
  color: #a16207;
  border-color: rgba(234, 179, 8, 0.28);
  background: rgba(250, 204, 21, 0.08);
}

.domain-quick-switches .tab.is-subdomain-tier:not(.is-active) {
  color: #15803d;
  border-color: rgba(34, 197, 94, 0.22);
  background: rgba(34, 197, 94, 0.08);
}

.tab {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
  border-radius: 999px;
  padding: 11px 16px;
  cursor: pointer;
  transition: 0.2s ease;
  font-size: 14px;
  font-weight: 600;
}

.tab.is-active {
  color: white;
  border-color: transparent;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}

.tab-pane {
  display: none;
}

.tab-pane.is-active {
  display: block;
}

.is-hidden {
  display: none !important;
}

.field {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.field span {
  font-weight: 600;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid rgba(76, 92, 145, 0.18);
  background: rgba(245, 248, 255, 0.95);
  color: var(--text);
  border-radius: 18px;
  padding: 14px 16px;
  font: inherit;
}

textarea {
  resize: vertical;
  min-height: 120px;
}

.mode-options {
  display: grid;
  gap: 12px;
}

.mode-option {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid rgba(76, 92, 145, 0.18);
  background: rgba(245, 248, 255, 0.92);
  cursor: pointer;
  transition: 0.18s ease;
}

.mode-option input {
  display: none;
}

.mode-option strong {
  font-size: 17px;
}

.mode-option em {
  color: var(--muted);
  font-style: normal;
  font-size: 13px;
}

.mode-option.is-active {
  border-color: rgba(53, 92, 255, 0.34);
  background: linear-gradient(135deg, rgba(53, 92, 255, 0.10), rgba(110, 140, 255, 0.08));
  box-shadow: inset 0 0 0 1px rgba(53, 92, 255, 0.10);
}

.inline-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
}

.inline-toggle input {
  width: auto;
}

.field.is-disabled {
  opacity: 0.55;
}

.feature-disabled-note {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid rgba(255, 141, 92, 0.2);
  background: rgba(255, 141, 92, 0.08);
  color: #b45309;
  line-height: 1.55;
  font-size: 14px;
}

.feature-disabled-note.is-hidden {
  display: none;
}

.access-code-note {
  border-color: rgba(53, 92, 255, 0.16);
  background: rgba(53, 92, 255, 0.08);
  color: var(--primary);
}

.mode-options.is-disabled {
  opacity: 0.55;
  pointer-events: none;
}

.hint-row,
.section-head p,
.preview,
.muted,
.empty {
  color: var(--muted);
}

.hint-row {
  font-size: 14px;
  line-height: 1.55;
}

.button-row,
.filter-actions,
.admin-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.outlook-actions {
  align-items: stretch;
}

.button-stretch {
  flex: 1 1 280px;
}

.button-compact {
  min-width: 104px;
}

button.primary.action-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  border-radius: 18px;
  background: linear-gradient(135deg, #6a72ff, #c7b4ff);
  box-shadow: 0 18px 35px rgba(106, 114, 255, 0.22);
}

button.primary.action-submit.action-query.is-loading {
  background: linear-gradient(135deg, #3f8cff, #55c6c2);
  box-shadow: 0 18px 35px rgba(63, 140, 255, 0.24);
}

button.primary.action-submit.action-create.is-loading {
  background: linear-gradient(135deg, #ff8d5c, #ffb266);
  box-shadow: 0 18px 35px rgba(255, 141, 92, 0.24);
}

button.primary.action-submit::before {
  content: attr(data-icon);
  font-size: 14px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.95);
}

button.primary.action-submit.is-loading::before {
  content: '';
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.42);
  border-top-color: rgba(255, 255, 255, 0.98);
  animation: action-spin 0.85s linear infinite;
}

button.primary.action-submit:disabled {
  opacity: 0.82;
  cursor: not-allowed;
}

@keyframes action-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

button.primary,
button.ghost,
.code-pill,
.latest-code button {
  border: 0;
  cursor: pointer;
  font: inherit;
  border-radius: 16px;
  padding: 14px 20px;
}

button.primary,
.code-pill,
.latest-code button {
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 18px 35px rgba(79, 93, 213, 0.25);
}

button.ghost {
  color: var(--text);
  background: rgba(245, 248, 255, 0.95);
  border: 1px solid rgba(76, 92, 145, 0.16);
}

a.ghost,
a.small-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.small-btn {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}

.section-head > div:first-child p {
  margin-top: 8px;
}

.section-head-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.section-head h2 {
  margin: 0;
  font-size: 22px;
}

.section-head p {
  margin: 0;
  font-size: 14px;
}

.section-head p.error,
#admin-status.error,
#status-text.error {
  color: var(--danger);
}

.mailbox-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.mailbox-meta.is-hidden,
.latest-code.is-hidden {
  display: none;
}

.meta-pill {
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.74);
  padding: 14px 16px;
  display: grid;
  gap: 6px;
}

.meta-pill strong {
  font-size: 15px;
  overflow-wrap: anywhere;
  word-break: break-all;
}

.meta-copy-button {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  font: inherit;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  overflow-wrap: anywhere;
  word-break: break-all;
}

.meta-copy-button:hover {
  color: var(--primary);
}

.meta-pill.danger,
.admin-countdown {
  border-color: rgba(220, 38, 38, 0.18);
  background: rgba(220, 38, 38, 0.06);
}

.latest-code {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  margin-bottom: 18px;
  border: 1px solid rgba(22, 163, 74, 0.16);
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(22, 163, 74, 0.10), rgba(53, 92, 255, 0.08));
}

.latest-code strong {
  font-size: 36px;
  color: var(--success);
}

.result-list {
  display: grid;
  gap: 14px;
  min-height: 320px;
  align-content: start;
}

.result-empty {
  min-height: 300px;
  border: 1px dashed rgba(76, 92, 145, 0.18);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.42);
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 12px;
  padding: 28px 24px;
  text-align: center;
}

.result-empty strong {
  font-size: 20px;
}

.result-empty p {
  max-width: 320px;
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.result-empty-icon {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.9), transparent 42%),
    linear-gradient(135deg, rgba(53, 92, 255, 0.18), rgba(110, 140, 255, 0.3));
  box-shadow: inset 0 0 0 1px rgba(53, 92, 255, 0.08);
  position: relative;
}

.result-empty-icon::after {
  content: '';
  position: absolute;
  inset: 16px;
  border-radius: 12px;
  border: 2px solid rgba(53, 92, 255, 0.24);
}

.mail-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: start;
  padding: 18px 20px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.mail-card.has-code {
  border-color: rgba(22, 163, 74, 0.24);
  background: linear-gradient(135deg, rgba(22, 163, 74, 0.10), rgba(255, 255, 255, 0.88));
}

.mailbox-empty-card {
  border-radius: 24px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.76);
  overflow: hidden;
}

.mailbox-empty-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px dashed rgba(76, 92, 145, 0.18);
}

.mailbox-empty-head h3 {
  margin: 0;
  font-size: 28px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.mailbox-empty-head span {
  color: var(--muted);
  white-space: nowrap;
}

.mailbox-empty-body {
  min-height: 220px;
  display: grid;
  place-items: center;
  padding: 28px 20px 34px;
  text-align: center;
  color: var(--muted);
}

.mailbox-empty-icon {
  width: 54px;
  height: 40px;
  margin: 0 auto 16px;
  border: 3px solid rgba(193, 202, 221, 0.96);
  border-radius: 8px;
  position: relative;
  box-sizing: border-box;
}

.mailbox-empty-icon::before {
  content: '';
  position: absolute;
  top: -12px;
  left: 8px;
  width: 18px;
  height: 14px;
  border: 3px solid rgba(193, 202, 221, 0.96);
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  background: rgba(255, 255, 255, 0.92);
}

.mailbox-empty-body p,
.mailbox-empty-source {
  margin: 0;
}

.mailbox-empty-body p {
  font-size: 18px;
  margin-bottom: 8px;
}

.mailbox-empty-source {
  font-size: 14px;
}

.mail-main h3 {
  margin: 0 0 6px;
  font-size: 20px;
}

.mail-sender {
  display: grid;
  gap: 4px;
  margin: 0 0 8px;
}

.mail-sender p {
  margin: 0;
}

.mail-sender-name {
  color: var(--text);
  font-weight: 700;
}

.mail-sender-email {
  color: var(--muted);
  font-size: 14px;
  word-break: break-all;
}

.mail-main p,
.mail-main time {
  display: block;
  margin: 0 0 6px;
}

.mail-main .mail-sender p {
  margin: 0;
}

.preview {
  margin-top: 10px;
}

.mail-side {
  min-width: 120px;
}

.code-pill {
  min-width: 110px;
  font-size: 26px;
  padding: 16px 18px;
}

.twofa-card {
  display: grid;
  gap: 16px;
  padding: 18px 20px;
  border-radius: 22px;
  border: 1px solid rgba(53, 92, 255, 0.16);
  background: linear-gradient(135deg, rgba(53, 92, 255, 0.08), rgba(255, 255, 255, 0.88));
}

.twofa-card-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.twofa-card-head h3 {
  margin: 0 0 6px;
  font-size: 20px;
}

.twofa-card-head p,
.twofa-foot {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.twofa-countdown {
  min-width: 122px;
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid rgba(220, 38, 38, 0.18);
  background: rgba(220, 38, 38, 0.06);
}

.twofa-code-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.twofa-code-block {
  display: grid;
  gap: 6px;
}

.twofa-code-block strong {
  font-size: clamp(28px, 4.2vw, 42px);
  letter-spacing: 0.08em;
  color: var(--primary);
}

.register-card,
.admin-card {
  margin-top: 16px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
}

.register-card {
  display: grid;
  gap: 12px;
}

.register-card strong {
  font-size: 16px;
  overflow-wrap: anywhere;
  word-break: break-all;
}

.feature-flag-card {
  display: grid;
  gap: 12px;
}

.feature-flag-card-compact {
  gap: 10px;
}

.feature-flag-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px 18px;
  align-items: center;
}

.feature-flag-grid-compact {
  gap: 14px 20px;
}

.feature-flag-inline-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.feature-flag-copy {
  display: grid;
  gap: 8px;
}

.feature-flag-copy strong {
  font-size: 15px;
}

.feature-flag-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 13px;
}

.feature-toggle {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.feature-toggle.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.feature-toggle-inline {
  justify-content: flex-end;
}

.feature-toggle-master {
  padding-left: 12px;
  border-left: 1px solid rgba(123, 143, 198, 0.16);
}

.feature-toggle-copy {
  display: grid;
  gap: 2px;
}

.feature-toggle-copy strong {
  font-size: 14px;
  line-height: 1.1;
}

.feature-toggle-copy span {
  font-size: 12px;
  color: var(--muted);
}

.feature-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.feature-toggle-slider {
  width: 58px;
  height: 32px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.42);
  position: relative;
  transition: 0.2s ease;
}

.feature-toggle-slider::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 4px 10px rgba(31, 41, 55, 0.15);
  transition: 0.2s ease;
}

.feature-toggle input:checked + .feature-toggle-slider {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}

.feature-toggle input:checked + .feature-toggle-slider::after {
  transform: translateX(26px);
}

.feature-toggle input:disabled + .feature-toggle-slider {
  opacity: 0.65;
}

#domain-registration-toggle-label,
#registration-access-code-toggle-label {
  font-weight: 700;
  color: var(--muted);
}

#domain-registration-toggle-label.is-on,
#registration-access-code-toggle-label.is-on {
  color: var(--success);
}

.domain-toggle-label {
  font-weight: 700;
  color: var(--muted);
}

.domain-toggle-label.is-on {
  color: var(--success);
}

.feature-flag-summary {
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(53, 92, 255, 0.14);
  background: rgba(53, 92, 255, 0.06);
  color: var(--muted);
  line-height: 1.55;
  font-size: 13px;
}

.feature-flag-summary-compact {
  padding: 10px 12px;
  font-size: 12px;
}

.feature-flag-actions {
  display: flex;
  justify-content: flex-end;
}

.compact-section-head {
  margin-bottom: 8px;
}

.compact-section-head-inline {
  margin-bottom: 0;
  align-items: center;
}

.compact-section-head h3 {
  margin: 0;
  font-size: 18px;
}

.compact-section-head p {
  margin: 6px 0 0;
}

.domain-registration-list {
  display: grid;
  gap: 8px;
}

.domain-registration-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px 14px;
  padding: 10px 12px;
  border-radius: 16px;
}

.domain-access-board {
  display: grid;
  gap: 12px;
}

.reserved-domain-list {
  margin-top: 10px;
}

.domain-registration-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}

.domain-registration-state {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}

.domain-registration-state.is-on {
  color: var(--primary);
}

.domain-toggle-stack {
  min-width: 0;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid rgba(123, 143, 198, 0.16);
  border-radius: 14px;
  background: rgba(245, 248, 255, 0.76);
}

.domain-toggle-copy {
  display: grid;
  gap: 1px;
}

.domain-toggle-copy strong {
  font-size: 12px;
  line-height: 1.15;
}

.domain-access-main {
  min-width: 0;
  gap: 8px;
}

.domain-access-title {
  justify-content: space-between;
  gap: 6px 10px;
}

.domain-registration-row.is-root-tier .domain-access-title strong {
  color: #a16207;
}

.domain-registration-row.is-subdomain-tier .domain-access-title strong {
  color: #15803d;
}

.domain-access-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.domain-access-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.domain-access-switches {
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.scan-progress-card {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid rgba(83, 109, 254, 0.14);
  background: rgba(245, 248, 255, 0.88);
}

.scan-progress-card.is-hidden {
  display: none;
}

.scan-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.scan-progress-head strong {
  font-size: 14px;
}

.scan-progress-bar {
  position: relative;
  width: 100%;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
}

.scan-progress-bar span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #4f46e5 0%, #7c3aed 100%);
  transition: width 0.28s ease;
}

.scan-progress-card.is-complete .scan-progress-bar span {
  background: linear-gradient(90deg, #059669 0%, #10b981 100%);
}

.scan-progress-card p {
  margin: 0;
  font-size: 12px;
}

.domain-access-switches .feature-toggle-slider {
  width: 48px;
  height: 28px;
}

.domain-access-switches .feature-toggle-slider::after {
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
}

.domain-access-switches .feature-toggle input:checked + .feature-toggle-slider::after {
  transform: translateX(20px);
}

.access-code-manager-compact {
  display: grid;
  gap: 10px;
}

.access-code-toolbar {
  display: grid;
  grid-template-columns: minmax(140px, 0.7fr) minmax(0, 1fr) repeat(2, minmax(110px, 0.38fr)) auto;
  gap: 10px;
  align-items: end;
}

.access-code-manager-compact .field {
  margin-bottom: 0;
}

.access-code-manager-compact textarea {
  min-height: 72px;
}

.small-field input {
  min-height: 48px;
}

.compact-button-row {
  gap: 10px;
}

.access-code-selection-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-bottom: 10px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(245, 248, 255, 0.82);
}

.admin-check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.admin-check input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--primary);
}

.access-code-row {
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: flex-start;
}

.access-code-select-cell {
  padding-top: 4px;
}

.row-check {
  gap: 0;
}

.site-footer {
  max-width: 620px;
  margin: 12px auto 0;
  padding: 10px 14px;
  border: 1px solid rgba(105, 124, 182, 0.16);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.66);
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 38px rgba(76, 104, 175, 0.08);
  display: grid;
  gap: 8px;
}

.site-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.site-footer .site-footer-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(105, 124, 182, 0.16);
  background: rgba(255, 255, 255, 0.84);
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 13px;
  transition: transform 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.site-footer .site-footer-links a:hover {
  color: var(--primary);
  border-color: rgba(84, 110, 255, 0.26);
  transform: translateY(-1px);
}

.site-footer-links a[aria-current="page"] {
  color: var(--text);
}

.site-footer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  align-items: center;
  justify-content: center;
}

.site-footer-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0;
}

.site-footer-meta a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}

.site-footer-meta a:hover {
  color: var(--primary);
}

.legal-panel {
  display: grid;
  gap: 18px;
}

.legal-contact-panel {
  align-self: start;
  display: grid;
  gap: 18px;
}

.legal-section + .legal-section {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.legal-section h2 {
  margin: 0 0 12px;
  font-size: 20px;
}

.legal-list {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.8;
}

.legal-list li + li {
  margin-top: 8px;
}

.legal-contact-list {
  display: grid;
  gap: 12px;
}

.legal-links {
  padding-top: 4px;
}

.legal-links a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.countdown-text {
  color: var(--danger);
  font-size: 18px;
  font-weight: 700;
}

.countdown-text.is-expired {
  opacity: 0.8;
}

.filter-row {
  display: grid;
  grid-template-columns: minmax(220px, 0.95fr) minmax(0, 1.2fr) repeat(3, minmax(140px, 0.58fr)) auto;
  gap: 12px;
  align-items: end;
}

.security-filter-row {
  grid-template-columns: minmax(0, 1.1fr) repeat(2, minmax(0, 220px)) auto;
  margin-bottom: 18px;
}

.summary-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.stat-card {
  padding: 14px 16px;
  display: grid;
  gap: 4px;
  border-radius: 18px;
  box-shadow: none;
  background: rgba(245, 248, 255, 0.86);
}

.stat-card strong {
  font-size: 25px;
}

.admin-list {
  display: grid;
  gap: 10px;
}

.pagination-bar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(76, 92, 145, 0.12);
}

.pagination-bar p {
  margin: 0;
}

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

.page-size-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.page-size-inline select {
  width: auto;
  min-width: 82px;
  padding: 10px 12px;
  border-radius: 14px;
}

.compact-list {
  gap: 12px;
}

.compact-tabs {
  margin-bottom: 14px;
}

.admin-row {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.82);
  display: grid;
  gap: 8px;
}

.admin-row-main {
  display: grid;
  gap: 5px;
}

.admin-row-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.admin-row-title strong {
  font-size: 15px;
  overflow-wrap: anywhere;
  word-break: break-all;
}

.admin-row-main p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.admin-row-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px 14px;
}

.admin-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  color: var(--muted);
  font-size: 12px;
}

.row-countdown {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.admin-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.admin-row.is-restricted {
  border-color: rgba(220, 38, 38, 0.22);
  background: rgba(255, 250, 250, 0.92);
}

.restriction-note {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  margin-top: 4px;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(220, 38, 38, 0.14);
  background: rgba(220, 38, 38, 0.05);
}

.restriction-copy {
  display: grid;
  gap: 4px;
}

.restriction-copy strong {
  font-size: 13px;
  color: #991b1b;
}

.restriction-copy p,
.restriction-copy span {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}

.admin-row .mode-badge {
  padding: 5px 10px;
  font-size: 12px;
}

.admin-row .small-btn {
  min-height: 36px;
  padding: 0 11px;
  border-radius: 14px;
  font-size: 12px;
}

.danger-btn {
  color: var(--danger) !important;
  border-color: rgba(220, 38, 38, 0.18) !important;
  background: rgba(220, 38, 38, 0.06) !important;
}

.password-inline {
  display: grid;
  gap: 6px;
  border-top: 1px dashed rgba(76, 92, 145, 0.16);
  padding-top: 12px;
}

.password-inline.is-hidden {
  display: none;
}

.password-inline strong {
  font-size: 16px;
}

.admin-card-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.admin-card-head h3 {
  margin: 0 0 6px;
  font-size: 20px;
}

.admin-card-head p {
  margin: 0;
  color: var(--muted);
}

.mode-badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.mode-badge.is-temp {
  color: var(--danger);
  background: rgba(220, 38, 38, 0.08);
}

.mode-badge.is-permanent {
  color: #0f766e;
  background: rgba(15, 118, 110, 0.10);
}

.mode-badge.is-success {
  color: #0f766e;
  background: rgba(15, 118, 110, 0.10);
}

.mode-badge.is-warning {
  color: #9a3412;
  background: rgba(249, 115, 22, 0.10);
}

.mode-badge.is-code {
  color: #6d28d9;
  background: rgba(124, 58, 237, 0.12);
}

.mode-badge.is-root-tier {
  color: #a16207;
  background: rgba(250, 204, 21, 0.14);
}

.mode-badge.is-subdomain-tier {
  color: #15803d;
  background: rgba(34, 197, 94, 0.11);
}

.mode-badge.is-off {
  color: #64748b;
  background: rgba(148, 163, 184, 0.16);
}

.mode-badge.is-restricted {
  color: #b42318;
  background: rgba(220, 38, 38, 0.12);
}

.mail-card.is-restriction {
  border-color: rgba(220, 38, 38, 0.2);
  background: rgba(255, 250, 250, 0.9);
}

.admin-card-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.admin-card-grid div,
.admin-countdown {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px 14px;
  background: rgba(245, 248, 255, 0.74);
}

.admin-card-grid strong {
  font-size: 15px;
}

.admin-countdown {
  margin-top: 12px;
}

.management-row {
  gap: 16px;
}

.internal-test-result {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.internal-test-result.is-hidden {
  display: none;
}

.internal-test-result .button-row {
  margin-top: 12px;
}

.management-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  max-width: 760px;
}

.mail-drawer {
  position: fixed;
  inset: 0;
  z-index: 40;
}

.mail-drawer.is-hidden {
  display: none;
}

.mail-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 29, 52, 0.42);
}

.mail-drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(680px, 100%);
  height: 100%;
  background: rgba(248, 250, 255, 0.96);
  backdrop-filter: blur(18px);
  border-left: 1px solid var(--line);
  box-shadow: -18px 0 40px rgba(31, 42, 68, 0.14);
  padding: 24px;
  overflow-y: auto;
}

.mail-drawer-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.mail-drawer-head h2 {
  margin: 0;
  font-size: 28px;
}

body.drawer-open {
  overflow: hidden;
}

.security-modal {
  position: fixed;
  inset: 0;
  z-index: 70;
}

.security-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 29, 52, 0.42);
}

.security-modal-panel {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(520px, calc(100% - 32px));
  transform: translate(-50%, -50%);
  border: 1px solid var(--line);
  background: rgba(248, 250, 255, 0.97);
  backdrop-filter: blur(18px);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 24px;
}

.security-head {
  margin-bottom: 14px;
}

.security-reason,
.security-ban {
  border-radius: 20px;
  border: 1px solid rgba(220, 38, 38, 0.14);
  background: rgba(220, 38, 38, 0.06);
  padding: 14px 16px;
  margin-bottom: 14px;
}

.security-ban {
  display: grid;
  gap: 6px;
}

.security-ban span {
  color: var(--muted);
  font-size: 13px;
}

.loading-modal {
  position: fixed;
  inset: 0;
  z-index: 75;
}

.loading-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 29, 52, 0.42);
}

.loading-modal-panel {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(420px, calc(100% - 32px));
  transform: translate(-50%, -50%);
  border: 1px solid var(--line);
  background: rgba(248, 250, 255, 0.97);
  backdrop-filter: blur(18px);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 24px;
  text-align: center;
  display: grid;
  gap: 12px;
}

.loading-modal-panel h2 {
  margin: 0;
  font-size: 24px;
}

.loading-modal-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

body.modal-open {
  overflow: hidden;
}

.copy-toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%) translateY(20px);
  background: rgba(31, 42, 68, 0.92);
  color: white;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: 0.18s ease;
  z-index: 60;
}

.copy-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 960px) {
  .admin-topbar,
  .admin-workbench,
  .admin-pane-overview,
  .admin-pane-access,
  .admin-pane-security,
  .hero,
  .home-grid,
  .legal-layout,
  .summary-grid,
  .access-code-toolbar,
  .filter-row,
  .security-filter-row {
    grid-template-columns: 1fr;
  }

  .hero {
    align-items: stretch;
  }

  .admin-sidebar {
    position: static;
  }

  .admin-tabs.admin-tabs-vertical {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .admin-domain-pills,
  .domain-quick-switches {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .overview-summary-section,
  .overview-domains-section,
  .overview-management-section,
  .overview-internal-section,
  .overview-send-section,
  .access-settings-section,
  .access-list-section,
  .security-bans-section,
  .security-reports-section {
    grid-column: auto;
  }

  .mail-card {
    grid-template-columns: 1fr;
  }

  .feature-flag-card {
    width: 100%;
  }

  .feature-flag-grid {
    grid-template-columns: 1fr;
  }

  .mailbox-empty-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .twofa-card-head,
  .twofa-code-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .latest-code {
    flex-direction: column;
    align-items: flex-start;
  }

  .mail-drawer-panel {
    width: 100%;
  }

  .pagination-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .pagination-actions {
    justify-content: flex-start;
  }

  .site-footer-meta {
    gap: 6px 12px;
    align-items: center;
  }

  .admin-card-grid {
    grid-template-columns: 1fr;
  }

  .feature-flag-actions {
    justify-content: flex-start;
  }

  .scan-progress-head {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 720px) {
  .page-shell {
    padding: 22px 14px 36px;
  }

  .admin-topbar {
    padding: 16px;
    gap: 14px;
  }

  .admin-domain-pills,
  .domain-quick-switches {
    grid-template-columns: 1fr;
  }

  .admin-topbar-main h1 {
    font-size: clamp(30px, 12vw, 44px);
  }

  .admin-topbar-subtitle {
    font-size: 14px;
    line-height: 1.55;
  }

  .admin-topbar-side {
    min-width: 0;
    width: 100%;
  }

  .admin-topbar-meta strong {
    font-size: 24px;
  }

  .admin-main.panel {
    padding: 14px;
  }

  .admin-panel-head {
    margin-bottom: 14px;
    padding-bottom: 12px;
  }

  .admin-section {
    padding: 14px;
    border-radius: 18px;
  }

  .admin-tabs.admin-tabs-vertical {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-copy {
    padding-top: 0;
  }

  h1 {
    font-size: clamp(30px, 12vw, 46px);
  }

  .subtitle {
    margin-top: 10px;
    font-size: 15px;
    line-height: 1.55;
  }

  .hero {
    gap: 14px;
    margin-bottom: 18px;
  }

  .hero-card,
  .panel,
  .stat-card {
    border-radius: 24px;
  }

  .hero-card {
    min-width: 0;
    padding: 14px;
  }

  .domain-card-head {
    align-items: flex-start;
  }

  .domain-card-summary {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .domain-switch-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .domain-switch-list {
    grid-template-columns: 1fr;
    max-height: min(52vh, 360px);
    overflow: auto;
  }

  .domain-switch-item-badge {
    min-width: 0;
  }

  .domain-switch-item-meta {
    width: 100%;
    justify-items: start;
  }

  .domain-switch-panel {
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    width: auto;
  }

  .domain-switch-card .button-row {
    justify-content: stretch;
  }

  .domain-switch-card .button-row .small-btn {
    width: 100%;
  }

  .panel {
    padding: 18px 16px;
  }

  .tabs {
    gap: 10px;
    margin-bottom: 18px;
  }

  .tab {
    padding: 10px 14px;
    font-size: 14px;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .section-head h2 {
    font-size: 20px;
  }

  .mailbox-empty-head h3 {
    font-size: 20px;
  }

  .mailbox-empty-head span {
    white-space: normal;
  }

  .mailbox-empty-body {
    min-height: 180px;
  }

  .result-empty {
    min-height: 220px;
    padding: 24px 18px;
  }

  textarea {
    min-height: 96px;
  }

  .feature-disabled-note,
  .hint-row {
    font-size: 13px;
  }

  .button-row,
  .filter-actions,
  .admin-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .admin-row-footer,
  .domain-registration-row {
    grid-template-columns: 1fr;
  }

  .admin-row-actions {
    justify-content: flex-start;
  }

  .domain-registration-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .access-code-selection-bar {
    align-items: stretch;
  }

  .access-code-row {
    grid-template-columns: 1fr;
  }

  .access-code-select-cell {
    padding-top: 0;
  }

  .domain-switch-panel .button-row {
    flex-direction: row;
  }

  .domain-switch-panel .small-btn {
    width: auto;
    flex: 1 1 0;
  }

  .button-stretch,
  .button-compact {
    min-width: 0;
    width: 100%;
    flex: 1 1 100%;
  }

  button.primary.action-submit {
    min-height: 54px;
    border-radius: 20px;
  }

  button.primary,
  button.ghost,
  .code-pill,
  .latest-code button {
    width: 100%;
    justify-content: center;
  }

  .site-footer {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 16px;
  }

  .site-footer .site-footer-links a {
    padding: 7px 10px;
    font-size: 13px;
  }

  .site-footer-meta {
    font-size: 13px;
    line-height: 1.55;
    justify-content: flex-start;
  }
}
