:root {
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #eeeff5;
  background: #11131a;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --surface: #181a23;
  --surface-raised: #1d202a;
  --surface-hover: #242733;
  --border: #2a2d38;
  --muted: #898d9d;
  --faint: #606575;
  --accent: #c4f36b;
  --accent-ink: #171d0b;
  --danger: #ff777c;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(ellipse at 87% 2%, rgba(116, 144, 71, .08), transparent 28rem),
    #11131a;
}

button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.hidden { display: none !important; }

.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 3;
  display: flex;
  width: 248px;
  flex-direction: column;
  padding: 27px 17px 18px;
  border-right: 1px solid var(--border);
  background: rgba(19, 21, 28, .96);
}

.brand { display: flex; align-items: center; gap: 11px; margin: 0 0 48px 8px; color: inherit; text-decoration: none; }
.brand-mark { display: grid; width: 35px; height: 35px; place-items: center; border-radius: 12px; background: var(--accent); color: var(--accent-ink); font-size: 23px; font-weight: 800; }
.brand-name { font-size: 19px; font-weight: 800; letter-spacing: -.8px; }
.brand-dot { color: var(--accent); }
.nav-caption, .eyebrow { color: var(--faint); font-size: 10px; font-weight: 700; letter-spacing: 1.25px; }
.nav-caption { padding: 0 11px; margin-bottom: 12px; }
.navigation { display: grid; gap: 5px; }
.nav-item { display: flex; height: 44px; align-items: center; gap: 12px; padding: 0 11px; border: 0; border-radius: 9px; background: transparent; color: #a4a8b7; cursor: pointer; text-align: left; transition: background .16s, color .16s; }
.nav-item:hover { background: var(--surface-hover); color: #f3f4f8; }
.nav-item.active { background: rgba(196, 243, 107, .1); color: var(--accent); }
.nav-icon { width: 18px; font-size: 19px; text-align: center; }
.nav-count { margin-left: auto; color: var(--faint); font-size: 12px; }
.sidebar-bottom { margin-top: auto; }
.connection-card { display: flex; align-items: center; gap: 10px; padding: 13px 10px; border: 1px solid var(--border); border-radius: 10px; background: #171920; }
.connection-indicator { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px rgba(196, 243, 107, .5); }
.connection-card strong, .connection-card small { display: block; }
.connection-card strong { font-size: 11px; font-weight: 600; }
.connection-card small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.sidebar-foot { padding: 17px 10px 0; color: var(--faint); font-size: 11px; }

.main { width: calc(100% - 248px); min-width: 0; margin-left: 248px; padding: 0 44px 40px; }
.topbar { display: flex; min-height: 120px; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--border); }
.page-heading h1 { margin: 6px 0 0; font-size: 26px; font-weight: 700; letter-spacing: -.7px; }
.topbar-actions { display: flex; align-items: center; gap: 15px; }
.user-chip { display: flex; align-items: center; gap: 9px; color: #c4c7d2; font-size: 12px; }
.user-avatar { display: grid; width: 30px; height: 30px; place-items: center; border: 1px solid #444839; border-radius: 50%; background: #293022; color: var(--accent); font-size: 12px; font-weight: 700; }
.icon-button { display: grid; width: 35px; height: 35px; place-items: center; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: #c6c9d4; cursor: pointer; font-size: 21px; transition: transform .2s, background .15s; }
.icon-button:hover { background: var(--surface-hover); }
.icon-button.spinning { transform: rotate(180deg); }
.page-content { padding-top: 26px; }
.toast { position: fixed; top: 16px; right: 24px; z-index: 10; max-width: min(390px, calc(100vw - 32px)); padding: 12px 16px; border: 1px solid #3b414d; border-radius: 10px; background: #20232c; box-shadow: 0 10px 35px #0005; color: #eaebf0; font-size: 13px; }
.toast.error { border-color: #704247; color: #ffb1b4; }

.inbox-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 17px; }
.section-title { margin: 0; color: #e6e7ed; font-size: 15px; font-weight: 700; }
.section-subtitle { margin-top: 4px; color: var(--muted); font-size: 11px; }
.search-box { display: flex; width: min(270px, 42vw); height: 37px; align-items: center; gap: 8px; padding: 0 11px; border: 1px solid var(--border); border-radius: 8px; background: #171920; color: var(--muted); }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; color: #eceef4; font-size: 12px; }
.search-box input::placeholder { color: #666b79; }
.inbox-layout { display: grid; min-height: 470px; grid-template-columns: minmax(265px, .75fr) minmax(0, 1.5fr); overflow: hidden; border: 1px solid var(--border); border-radius: 12px; background: rgba(24, 26, 35, .9); }
.message-list { min-width: 0; border-right: 1px solid var(--border); }
.list-meta { padding: 14px 15px 11px; border-bottom: 1px solid var(--border); color: var(--faint); font-size: 10px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; }
.message-row { position: relative; display: block; width: 100%; padding: 14px 14px 13px 16px; border: 0; border-bottom: 1px solid rgba(42, 45, 56, .75); background: transparent; cursor: pointer; text-align: left; transition: background .14s; }
.message-row:hover { background: #20232c; }
.message-row.selected { background: #23262e; }
.message-row.selected::before { position: absolute; inset: 0 auto 0 0; width: 2px; background: var(--accent); content: ""; }
.message-row-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.message-sender { overflow: hidden; color: #e0e2e9; font-size: 12px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.message-date { flex: 0 0 auto; color: var(--faint); font-size: 9px; }
.message-subject { overflow: hidden; margin-top: 8px; color: #b7bbc8; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.message-recipient { overflow: hidden; margin-top: 5px; color: var(--faint); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.list-empty { padding: 28px 14px; color: var(--muted); font-size: 11px; text-align: center; }
.message-detail { min-width: 0; padding: 24px 25px; }
.detail-empty, .empty-state, .loading-state { display: flex; min-height: 300px; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--muted); text-align: center; }
.empty-icon { display: grid; width: 47px; height: 47px; place-items: center; margin-bottom: 4px; border: 1px solid #363a46; border-radius: 15px; background: #20232c; color: var(--accent); font-size: 21px; }
.empty-state strong, .detail-empty strong { color: #e5e6ed; font-size: 14px; }
.empty-state span, .detail-empty span { max-width: 270px; font-size: 11px; line-height: 1.6; }
.detail-heading { padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.detail-subject { margin: 0; color: #f0f1f5; font-size: 18px; font-weight: 700; line-height: 1.4; overflow-wrap: anywhere; }
.detail-addresses { display: grid; gap: 7px; margin-top: 14px; color: #afb3c0; font-size: 11px; overflow-wrap: anywhere; }
.detail-addresses b { display: inline-block; width: 31px; color: var(--faint); font-weight: 500; }
.detail-tools { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 14px 0 12px; }
.detail-actions { display: flex; align-items: center; gap: 7px; }
.detail-date { color: var(--muted); font-size: 10px; }
.button, .button-secondary, .button-danger { display: inline-flex; min-height: 35px; align-items: center; justify-content: center; gap: 7px; padding: 0 12px; border: 1px solid transparent; border-radius: 8px; cursor: pointer; font-size: 11px; font-weight: 600; text-decoration: none; transition: filter .14s, background .14s; }
.button { background: var(--accent); color: var(--accent-ink); }
.button:hover { filter: brightness(1.06); }
.button-secondary { border-color: var(--border); background: #20222b; color: #d7d9e2; }
.button-secondary:hover { background: var(--surface-hover); }
.button-danger { border-color: #563338; background: #291d22; color: #ff9a9e; }
.button-danger:hover { background: #392127; }
.email-body { min-height: 205px; max-height: 470px; overflow: auto; padding: 16px; border: 1px solid #292c37; border-radius: 9px; background: #14161d; color: #c6c9d4; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 12px; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
.pagination { display: flex; justify-content: center; padding: 12px; }

.admin-panel { max-width: 760px; padding: 22px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.panel-heading h2 { margin: 0; font-size: 15px; }
.panel-heading p { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.inline-form { display: flex; gap: 9px; margin: 18px 0; }
.text-input { width: 100%; min-width: 0; height: 38px; padding: 0 12px; border: 1px solid #343743; border-radius: 8px; background: #14161d; color: #edeeF3; font-size: 12px; }
.text-input::placeholder { color: #6f7483; }
.domain-list, .user-list { display: grid; gap: 8px; }
.domain-card, .user-card { display: flex; min-height: 53px; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 11px; border: 1px solid #2b2e39; border-radius: 9px; background: #191b24; }
.domain-name { display: flex; align-items: center; gap: 9px; color: #e2e4eb; font-size: 12px; font-weight: 600; overflow-wrap: anywhere; }
.domain-mark { color: var(--accent); font-size: 15px; }
.domain-meta, .user-meta { margin-top: 3px; color: var(--faint); font-size: 10px; }
.dns-guide { margin-top: 23px; padding: 17px; border: 1px solid #30333e; border-radius: 10px; background: #171920; }
.dns-guide-heading { display: flex; align-items: flex-start; gap: 11px; }
.dns-guide-icon { display: grid; width: 30px; height: 30px; flex: 0 0 auto; place-items: center; border: 1px solid #444839; border-radius: 8px; color: var(--accent); font-size: 15px; }
.dns-guide-heading h3 { margin: 0; color: #e4e6ed; font-size: 12px; }
.dns-guide-heading p { margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.dns-guide-heading b { color: var(--accent); font-weight: 600; }
.dns-records { display: grid; gap: 7px; margin-top: 15px; }
.dns-record { display: flex; align-items: center; gap: 11px; min-width: 0; padding: 10px; border: 1px solid #292c36; border-radius: 8px; background: #13151b; }
.dns-record-type { display: grid; width: 33px; height: 26px; flex: 0 0 auto; place-items: center; border-radius: 6px; background: #25301c; color: var(--accent); font-size: 10px; font-weight: 700; }
.dns-record-type.mx { background: #242533; color: #b7b2ff; }
.dns-record-data { display: grid; min-width: 0; gap: 4px; color: var(--muted); font-size: 9px; }
.dns-record-data strong { overflow-wrap: anywhere; color: #e0e2e9; font-size: 10px; font-weight: 600; }
.dns-record-data code { color: #c3c6d1; }
.dns-record-badge { flex: 0 0 auto; margin-left: auto; padding: 4px 6px; border-radius: 5px; background: #20232b; color: #adb1be; font-size: 8px; white-space: nowrap; }
.dns-guide > .hint { margin-bottom: 0; }
.user-info { min-width: 0; }
.user-id { color: #e2e4eb; font-size: 12px; font-weight: 600; }
.user-tag { display: inline-flex; padding: 4px 7px; border: 1px solid #444839; border-radius: 5px; color: var(--accent); font-size: 9px; }
.hint { margin-top: 12px; color: var(--faint); font-size: 10px; line-height: 1.6; }
.telegram-required { max-width: 470px; margin: 12vh auto 0; padding: 34px 28px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); text-align: center; }
.telegram-required .empty-icon { margin: 0 auto 17px; }
.telegram-required h2 { margin: 0; font-size: 20px; }
.telegram-required p { margin: 11px 0 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.loading-state { min-height: 280px; flex-direction: row; font-size: 12px; }
.spinner { width: 17px; height: 17px; border: 2px solid #3a3e49; border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (min-width: 1500px) {
  .main { padding-right: 7vw; padding-left: 7vw; }
}

@media (max-width: 950px) {
  .sidebar { width: 210px; }
  .main { width: calc(100% - 210px); margin-left: 210px; padding-right: 25px; padding-left: 25px; }
  .inbox-layout { grid-template-columns: minmax(220px, .8fr) minmax(0, 1.2fr); }
  .message-detail { padding: 20px 17px; }
}

@media (max-width: 680px) {
  .sidebar { inset: auto 0 0; width: 100%; height: calc(61px + env(safe-area-inset-bottom)); flex-direction: row; align-items: center; justify-content: center; padding: 5px 10px env(safe-area-inset-bottom); border-top: 1px solid var(--border); border-right: 0; background: rgba(19, 21, 28, .98); }
  .brand, .nav-caption, .sidebar-bottom { display: none; }
  .navigation { display: flex; width: min(420px, 100%); justify-content: space-around; gap: 5px; }
  .nav-item { min-width: 88px; height: 45px; flex-direction: column; justify-content: center; gap: 1px; padding: 3px 8px; font-size: 9px; }
  .nav-icon { width: auto; font-size: 17px; }
  .nav-count { display: none; }
  .main { width: 100%; margin-left: 0; padding: 0 15px calc(78px + env(safe-area-inset-bottom)); }
  .topbar { min-height: 91px; }
  .page-heading h1 { font-size: 22px; }
  .topbar-actions { gap: 9px; }
  .user-chip { gap: 6px; font-size: 10px; }
  .user-avatar { width: 27px; height: 27px; }
  .page-content { padding-top: 18px; }
  .inbox-toolbar { align-items: flex-start; }
  .search-box { width: min(190px, 51vw); }
  .inbox-layout { min-height: 440px; grid-template-columns: minmax(0, 1fr); }
  .message-list { border-right: 0; }
  .message-detail { min-height: 250px; padding: 20px 15px; border-top: 1px solid var(--border); }
  .message-detail:has(.detail-empty) { display: none; }
  .message-detail:not(:has(.detail-empty)) { display: block; }
  .detail-subject { font-size: 16px; }
  .admin-panel { padding: 16px; }
  .inline-form { align-items: stretch; }
  .toast { top: 8px; right: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Compact app shell and a persistent bottom navigation capsule. */
:root {
  --surface: #14171b;
  --surface-raised: #191d21;
  --surface-hover: #20252a;
  --border: #282d32;
  --muted: #929aa1;
  --faint: #69727a;
  --accent: #c5f477;
  --accent-ink: #13190c;
  background: #0c0e10;
  scrollbar-width: none;
}

* { scrollbar-width: none; }
*::-webkit-scrollbar { display: none; }

body {
  min-height: 100vh;
  min-height: 100svh;
  background: #0c0e10;
}

.app-shell { display: block; min-height: 100vh; min-height: 100svh; }

.sidebar {
  position: fixed;
  inset: auto auto max(14px, env(safe-area-inset-bottom)) 50%;
  z-index: 20;
  display: block;
  width: max-content;
  max-width: calc(100vw - 28px);
  padding: 6px;
  transform: translateX(-50%);
  border: 1px solid #30363b;
  border-radius: 999px;
  background: rgba(22, 25, 28, .9);
  box-shadow: 0 12px 40px #0008, inset 0 1px #ffffff0a;
  -webkit-backdrop-filter: blur(22px);
  backdrop-filter: blur(22px);
}

.navigation {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.nav-item {
  position: relative;
  display: inline-flex;
  min-width: 104px;
  height: 46px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 15px;
  border-radius: 999px;
  color: #a4abb0;
  font-size: 13px;
  font-weight: 550;
  white-space: nowrap;
}

.nav-item:hover { background: #ffffff0a; color: #f0f2f2; }
.nav-item.active { background: #ffffff12; color: #f1f3f1; }
.nav-item.active .nav-icon { color: var(--accent); }
.nav-icon { width: 18px; height: 18px; flex: 0 0 auto; color: currentColor; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.nav-count { display: inline-flex; min-width: 19px; height: 19px; align-items: center; justify-content: center; margin-left: 0; padding: 0 5px; border-radius: 999px; background: #ffffff0d; color: #c3c9c7; font-size: 10px; }

.main {
  width: min(100% - 64px, 1120px);
  margin: 0 auto;
  padding: 0 0 120px;
}

.topbar {
  display: grid;
  min-height: 94px;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border-bottom-color: #222629;
}

.brand {
  gap: 10px;
  margin: 0;
  color: #f0f2f2;
  text-decoration: none;
}

.brand-mark {
  width: 31px;
  height: 31px;
  border-radius: 10px;
  background: #e6ecdf;
  color: #181c17;
  font-size: 20px;
}

.brand-name { font-size: 16px; letter-spacing: -.5px; }
.brand-dot { display: none; }
.page-heading h1 { margin: 0; color: #f0f2f2; font-size: 20px; font-weight: 620; letter-spacing: -.45px; }
.topbar-actions { justify-self: end; gap: 14px; }
.user-chip { color: #b6bdc1; font-size: 12px; }
.user-avatar { width: 31px; height: 31px; border-color: #3a4039; background: #222820; color: var(--accent); }
.icon-button { width: 36px; height: 36px; border-color: #2b3034; border-radius: 50%; background: #15181b; }
.icon-button svg { width: 16px; height: 16px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.icon-button.spinning svg { animation: spin .7s ease; }
.page-content { padding-top: 25px; }
.toast { top: 16px; right: 16px; border-color: #343a3e; border-radius: 14px; background: #1b1f22; }

.inbox-toolbar { margin-bottom: 14px; }
.section-title { color: #e9ecea; font-size: 14px; font-weight: 620; }
.section-subtitle { color: #818a8e; font-size: 12px; }
.search-box { height: 39px; border-color: #2a3033; border-radius: 11px; background: #131619; }
.search-box input { font-size: 13px; }
.inbox-layout { min-height: 470px; border-color: #262b2e; border-radius: 16px; background: #111416; }
.message-list { border-right-color: #262b2e; }
.list-meta { color: #717a7d; font-size: 10px; letter-spacing: .65px; }
.message-row { padding-top: 15px; padding-bottom: 14px; border-bottom-color: #22272a; }
.message-row:hover, .message-row.selected { background: #191e20; }
.message-row.selected::before { width: 3px; border-radius: 0 3px 3px 0; }
.message-sender { color: #e5e9e7; font-size: 13px; }
.message-date { font-size: 10px; }
.message-subject { color: #bdc4c2; font-size: 12px; }
.message-recipient { font-size: 11px; }
.message-detail { padding: 25px; }
.detail-subject { font-size: 19px; font-weight: 620; }
.detail-addresses { color: #b0b8b5; font-size: 12px; }
.detail-tools { margin-top: 16px; }
.detail-date { font-size: 11px; }
.button, .button-secondary, .button-danger { min-height: 38px; border-radius: 10px; font-size: 12px; }
.button { background: #d7edb4; }
.button-secondary { border-color: #303639; background: #1b2022; }
.button-danger { border-color: #52373a; background: #251b1d; }
.email-body { border-color: #292f32; border-radius: 12px; background: #0e1112; font-size: 13px; }

.admin-panel { max-width: 820px; padding: 24px; border-color: #282d30; border-radius: 16px; background: #111416; }
.panel-heading { border-bottom-color: #292e31; }
.panel-heading h2 { font-size: 17px; font-weight: 620; }
.panel-heading p { font-size: 13px; }
.inline-form { gap: 10px; }
.text-input { height: 42px; border-color: #303639; border-radius: 11px; background: #0e1112; font-size: 13px; }
.domain-list, .user-list { gap: 9px; }
.domain-card, .user-card { min-height: 58px; padding: 11px 13px; border-color: #2a2f32; border-radius: 12px; background: #15191b; }
.domain-name, .user-id { font-size: 13px; }
.domain-meta, .user-meta { font-size: 11px; }
.dns-guide { padding: 18px; border-color: #2a3032; border-radius: 13px; background: #15191b; }
.dns-record { border-color: #282e30; border-radius: 10px; background: #101314; }
.dns-record-data { font-size: 10px; }
.dns-record-data strong { font-size: 11px; }
.hint { font-size: 11px; }
.telegram-required { border-color: #292e31; border-radius: 18px; background: #141719; }
.telegram-required h2 { font-size: 18px; }
.telegram-required p { font-size: 13px; }
.empty-icon { border-color: #343a3d; border-radius: 14px; background: #1a1e20; }
.loading-state { color: #aab1af; }
.spinner { border-top-color: #d7edb4; }

@media (min-width: 1500px) {
  .main { padding-right: 0; padding-left: 0; }
}

@media (max-width: 950px) {
  .main { width: calc(100% - 48px); padding-right: 0; padding-left: 0; }
  .inbox-layout { grid-template-columns: minmax(220px, .8fr) minmax(0, 1.2fr); }
}

@media (max-width: 680px) {
  .sidebar {
    inset: auto auto max(12px, env(safe-area-inset-bottom)) 50%;
    width: max-content;
    height: auto;
    padding: 5px;
    transform: translateX(-50%);
    border: 1px solid #343a3e;
    border-radius: 999px;
    background: rgba(22, 25, 28, .92);
  }
  .navigation { width: max-content; max-width: calc(100vw - 40px); gap: 3px; }
  .nav-item { min-width: 90px; height: 44px; flex-direction: row; gap: 7px; padding: 0 11px; font-size: 12px; }
  .nav-icon { width: 17px; height: 17px; font-size: initial; }
  .nav-count { display: inline-flex; min-width: 17px; height: 17px; font-size: 9px; }
  .main { width: calc(100% - 32px); padding: 0 0 110px; }
  .topbar { min-height: 76px; grid-template-columns: auto 1fr auto; gap: 10px; }
  .brand { gap: 7px; }
  .brand-mark { width: 28px; height: 28px; border-radius: 9px; font-size: 18px; }
  .brand-name { font-size: 14px; }
  .page-heading { justify-self: center; }
  .page-heading h1 { font-size: 16px; }
  .topbar-actions { gap: 8px; }
  .user-chip { gap: 0; }
  .user-chip #user-name { display: none; }
  .user-avatar { width: 29px; height: 29px; }
  .icon-button { width: 34px; height: 34px; }
  .page-content { padding-top: 18px; }
  .inbox-toolbar { align-items: center; }
  .section-title { font-size: 13px; }
  .section-subtitle { font-size: 11px; }
  .search-box { width: min(175px, 48vw); height: 36px; }
  .inbox-layout { min-height: 440px; grid-template-columns: minmax(0, 1fr); border-radius: 14px; }
  .message-list { border-right: 0; }
  .message-detail { min-height: 250px; padding: 19px 15px; border-top: 1px solid #262b2e; }
  .message-detail:has(.detail-empty) { display: none; }
  .message-detail:not(:has(.detail-empty)) { display: block; }
  .detail-subject { font-size: 16px; }
  .admin-panel { padding: 17px; border-radius: 14px; }
  .inline-form { align-items: stretch; }
  .inline-form .button { flex: 0 0 auto; }
  .dns-guide { padding: 14px; }
  .toast { top: max(8px, env(safe-area-inset-top)); right: 8px; }
}

@media (max-width: 370px) {
  .main { width: calc(100% - 24px); }
  .brand-name { display: none; }
  .nav-item { min-width: 82px; padding: 0 8px; }
  .inbox-toolbar { align-items: flex-start; }
  .search-box { width: 45vw; }
}

#page-content > * { animation: content-enter .34s cubic-bezier(.2, .75, .25, 1) both; }

@keyframes content-enter {
  from { opacity: 0; transform: translateY(9px); }
  to { opacity: 1; transform: translateY(0); }
}

.nav-item, .icon-button, .button, .button-secondary, .button-danger, .domain-card, .message-row {
  transition: background-color .18s ease, border-color .18s ease, color .18s ease, transform .18s ease, box-shadow .18s ease;
}

button:not(:disabled):active { transform: scale(.975); }
.button:disabled, .button-secondary:disabled, .icon-button:disabled { cursor: wait; opacity: .68; }

.domain-list { gap: 7px; }
.domain-card {
  min-height: 70px;
  animation: content-enter .3s cubic-bezier(.2, .75, .25, 1) both;
}
.domain-card:nth-child(2) { animation-delay: 35ms; }
.domain-card:nth-child(3) { animation-delay: 70ms; }
.domain-card:nth-child(4) { animation-delay: 105ms; }
.domain-card:hover { transform: translateY(-1px); border-color: #3a4443; box-shadow: 0 8px 22px #0002; }
.domain-card-main { display: grid; min-width: 0; gap: 8px; }
.domain-name { font-size: 14px; letter-spacing: -.15px; }
.domain-status-row { display: flex; flex-wrap: wrap; gap: 7px; }
.domain-card-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 7px; }
.domain-check-button { width: 34px; height: 34px; }
.domain-check-button svg, .dns-check-all svg { width: 15px; height: 15px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.domain-check-button.spinning svg, .dns-check-all.is-checking svg { animation: spin .8s linear infinite; }
.dns-check-all { flex: 0 0 auto; }
.dns-check-all svg { color: #b7c1bc; }

.dns-status {
  display: inline-flex;
  min-height: 23px;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border: 1px solid #303638;
  border-radius: 999px;
  background: #171b1c;
  color: #a4aeaa;
  font-size: 10px;
  line-height: 1;
  white-space: nowrap;
}

.dns-status i {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #727d79;
}

.dns-status.ready { border-color: #344438; color: #bfd9c1; }
.dns-status.ready i { background: #8bc69a; box-shadow: 0 0 8px #8bc69a55; }
.dns-status.missing { border-color: #493d32; color: #d7b78d; }
.dns-status.missing i { background: #d3a05f; }
.dns-status.unknown { color: #89918e; }
.dns-status.checking i { background: #c7dba4; animation: pulse 1s ease-in-out infinite; }

@keyframes pulse {
  50% { opacity: .35; box-shadow: 0 0 0 4px #c7dba422; }
}

.domain-check-error { margin: 0; color: #d7a09a; font-size: 11px; }
.dns-guide { margin-top: 21px; }
.dns-guide-heading { align-items: center; }
.dns-guide-heading h3 { font-size: 13px; }
.dns-guide-heading p { font-size: 11px; }
.dns-record { min-height: 65px; }
.dns-record-data { flex: 1 1 auto; }
.dns-record-data small { overflow-wrap: anywhere; color: #8d9994; font-size: 10px; }
.dns-record .dns-status { flex: 0 0 auto; }
.hint { margin-top: 14px; }

.message-row:nth-child(-n+8) { animation: content-enter .28s cubic-bezier(.2, .75, .25, 1) both; }
.message-row:nth-child(2) { animation-delay: 25ms; }
.message-row:nth-child(3) { animation-delay: 50ms; }
.message-row:nth-child(4) { animation-delay: 75ms; }
.message-row:nth-child(5) { animation-delay: 100ms; }
.message-row:nth-child(6) { animation-delay: 125ms; }
.message-row:nth-child(7) { animation-delay: 150ms; }
.message-row:nth-child(8) { animation-delay: 175ms; }

@media (max-width: 680px) {
  .domain-card { gap: 8px; padding: 11px; }
  .domain-name { font-size: 13px; }
  .domain-card-actions { gap: 5px; }
  .domain-card-actions .button-danger { min-height: 32px; padding: 0 8px; font-size: 10px; }
  .dns-status { min-height: 21px; padding: 3px 7px; font-size: 9px; }
  .dns-record { flex-wrap: wrap; }
  .dns-record .dns-status { margin-left: 44px; }
  .dns-check-all { min-height: 34px; padding: 0 9px; font-size: 10px; }
  .dns-check-all svg { width: 13px; height: 13px; }
}

.inbox-layout {
  display: block;
  min-height: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.message-list {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: rgba(24, 26, 35, .9);
}

.message-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
}

.message-modal.hidden { display: none; }

.message-modal-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: rgba(5, 6, 8, .74);
  cursor: default;
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
  animation: modal-backdrop-in .18s ease-out both;
}

@keyframes modal-backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.message-window {
  position: relative;
  z-index: 1;
  display: flex;
  width: min(940px, 100%);
  max-height: min(820px, calc(100vh - 48px));
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #383d46;
  border-radius: 18px;
  background: #15171d;
  box-shadow: 0 28px 90px #0009;
  animation: message-window-in .24s cubic-bezier(.2, .8, .2, 1) both;
}

@keyframes message-window-in {
  from { opacity: 0; transform: translateY(12px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.message-window-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--border);
}

.message-window-title { min-width: 0; }
.window-kicker { color: var(--faint); font-size: 9px; font-weight: 700; letter-spacing: 1.1px; }
.message-window-title h2 { margin: 7px 0 0; color: #f0f1f5; font-size: 20px; font-weight: 650; line-height: 1.35; overflow-wrap: anywhere; }
.message-window-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; }
.message-window-actions .icon-button { font-size: 24px; line-height: 1; }

.message-window-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 24px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: #191b22;
}

.message-window-meta > div { display: grid; min-width: 0; grid-template-columns: 90px minmax(0, 1fr); gap: 10px; align-items: baseline; }
.message-window-meta span { color: var(--faint); font-size: 11px; }
.message-window-meta strong { min-width: 0; color: #d9dbe3; font-size: 12px; font-weight: 500; overflow-wrap: anywhere; }

.message-window-body {
  min-height: 220px;
  flex: 1 1 auto;
  overflow: auto;
  padding: 18px 24px 24px;
  background: #101216;
}

.email-frame {
  display: block;
  width: 100%;
  min-height: 380px;
  height: 100%;
  border: 0;
  border-radius: 9px;
  background: #fff;
  color-scheme: light;
}

.email-body {
  width: 100%;
  min-height: 220px;
  max-height: none;
  margin: 0;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.message-window-body .loading-state,
.message-window-body .empty-state { min-height: 250px; }

@media (max-width: 680px) {
  .message-modal { align-items: end; padding: 0; }
  .message-window {
    width: 100%;
    max-height: calc(100vh - 16px);
    max-height: calc(100svh - 16px);
    border-radius: 18px 18px 0 0;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .message-window-header { align-items: center; gap: 10px; padding: 16px 15px 13px; }
  .message-window-title h2 { font-size: 17px; }
  .window-kicker { display: none; }
  .message-window-actions { gap: 5px; }
  .message-window-actions .button-danger,
  .message-window-actions .button-secondary { min-height: 33px; padding: 0 9px; font-size: 10px; }
  .message-window-actions .icon-button { width: 33px; height: 33px; }
  .message-window-meta { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 13px 15px; }
  .message-window-meta > div { grid-template-columns: 78px minmax(0, 1fr); gap: 8px; }
  .message-window-meta span { font-size: 10px; }
  .message-window-meta strong { font-size: 11px; }
  .message-window-body { min-height: 180px; padding: 12px 12px 16px; }
  .email-frame { min-height: 320px; }
}

@media (prefers-reduced-motion: reduce) {
  .message-window, .message-modal-backdrop { animation: none; }
}

@media (prefers-reduced-motion: reduce) {
  #page-content > *, .domain-card, .message-row, .dns-status.checking i { animation: none !important; }
}

.navigation { position: relative; }
.nav-indicator {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  border: 1px solid #ffffff0d;
  border-radius: 999px;
  background: linear-gradient(145deg, #ffffff16, #ffffff09);
  box-shadow: 0 2px 10px #0002, inset 0 1px #ffffff0a;
  opacity: 0;
  pointer-events: none;
  transition: width .28s cubic-bezier(.2, .8, .2, 1), height .28s cubic-bezier(.2, .8, .2, 1), transform .34s cubic-bezier(.2, .8, .2, 1), opacity .18s ease;
}
.nav-indicator[style*="width"] { opacity: 1; }
.nav-item, .nav-item.active { z-index: 1; background: transparent; }
.nav-item.active { color: #f1f3f1; }
.nav-item:hover { background: #ffffff08; }
.nav-item.active:hover { background: transparent; }

@keyframes page-in-next {
  from { opacity: .35; transform: translateX(18px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes page-in-previous {
  from { opacity: .35; transform: translateX(-18px); }
  to { opacity: 1; transform: translateX(0); }
}

#page-content.page-enter-next > *, #page-content.page-enter-previous > * {
  animation-duration: .3s;
  animation-timing-function: cubic-bezier(.2, .75, .25, 1);
}
#page-content.page-enter-next > * { animation-name: page-in-next; }
#page-content.page-enter-previous > * { animation-name: page-in-previous; }
#page-content { touch-action: pan-y; }

@media (prefers-reduced-motion: reduce) {
  .nav-indicator { transition: none; }
  #page-content.page-enter-next > *, #page-content.page-enter-previous > * { animation: none; }
}

:root { --telegram-brand-text: #f0f2f2; }
.brand-name { color: var(--telegram-brand-text); }
.topbar { min-height: 66px; }
.page-content { padding-top: 15px; }

@media (max-width: 680px) {
  .topbar { min-height: 58px; }
  .page-content { padding-top: 10px; }
}

@media (max-width: 680px) {
  .sidebar {
    position: fixed;
    inset: auto auto calc(12px + env(safe-area-inset-bottom, 0px)) 50%;
    z-index: 20;
    width: max-content;
    height: auto;
    padding: 5px;
    transform: translate3d(-50%, 0, 0);
    border: 1px solid #343a3e;
    border-radius: 999px;
    background: rgba(22, 25, 28, .92);
  }

  .navigation {
    width: max-content;
    max-width: calc(100vw - 40px);
    gap: 3px;
  }

  .nav-indicator { display: none; }

  .navigation .nav-item {
    width: 100px;
    min-width: 0;
    height: 44px;
    flex: 0 0 100px;
    flex-direction: row;
    gap: 7px;
    padding: 0 8px;
    border-radius: 999px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    -webkit-appearance: none;
    appearance: none;
    transition: color .16s ease, background-color .16s ease;
  }

  .navigation .nav-item:focus:not(:focus-visible) {
    outline: none;
    box-shadow: none;
  }

  .navigation .nav-item:hover,
  .navigation .nav-item:not(.active):active {
    background: transparent;
    color: #a4abb0;
  }

  .navigation .nav-item.active,
  .navigation .nav-item.active:hover,
  .navigation .nav-item.active:active {
    background: #ffffff12;
    color: #f1f3f1;
  }

  .navigation .nav-item:not(:disabled):active { transform: none; }
}

@media (max-width: 370px) {
  .navigation .nav-item {
    width: 88px;
    flex-basis: 88px;
  }
}
