:root {
  --purple: #4b1a5e;
  --purple-2: #7b2d92;
  --purple-3: #2b0f36;
  --paper: #fffdfb;
  --ink: #261b2b;
  --muted: #7a6f7f;
  --line: #e6d9e9;
  --gold: #ffc400;
  --danger: #b42318;
  --green: #1f7a4d;
  --shadow: 0 18px 50px rgba(56, 24, 66, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  background:
    radial-gradient(900px 500px at 8% -10%, #f0d9f4 0, transparent 60%),
    radial-gradient(800px 500px at 100% 0, #ffe8d1 0, transparent 55%),
    linear-gradient(180deg, #fbf7fc 0%, #f4edf6 100%);
}

a {
  color: var(--purple-2);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  color: #fff;
  background: linear-gradient(135deg, var(--purple-3), var(--purple) 55%, #8a2da0);
  border-bottom: 1px solid #1e0827;
  box-shadow: 0 2px 10px rgba(37, 9, 48, 0.25);
}

.topbar-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 12px 22px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 22px;
  letter-spacing: 0.3px;
}

.brand:hover {
  text-decoration: none;
}

.brand strong {
  color: #ffd85e;
  font-weight: 800;
}

.brand em {
  color: #e9c9f0;
  font-style: normal;
  font-weight: 400;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: var(--purple);
  background: linear-gradient(145deg, #ffd85e, #ff9f1a);
  box-shadow: 0 3px 0 #b56b00, 0 6px 16px rgba(0, 0, 0, 0.22);
  font-size: 19px;
}

.main-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.main-nav a {
  color: #f5e9f8;
  font-size: 14px;
  font-weight: 600;
}

.main-nav a:hover {
  color: #ffd85e;
  text-decoration: none;
}

.main-nav .nav-cta {
  padding: 7px 14px;
  border-radius: 7px;
  color: #3c124b;
  background: #ffd85e;
  box-shadow: 0 2px 0 #b67d00;
}

.main-nav .nav-cta:hover {
  color: #3c124b;
  background: #ffe58a;
}

.inline {
  display: inline;
  margin: 0;
}

.link-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: #f5e9f8;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.link-button:hover {
  color: #ffd85e;
}

.link-button.danger {
  color: var(--danger);
}

.link-button.success {
  color: var(--green);
}

.page {
  flex: 1;
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 34px 22px 56px;
}

.footer {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 20px 22px 26px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  border-top: 1px solid var(--line);
}

.hero {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 48px;
  align-items: center;
  padding: 34px 0 24px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid #dcc4e3;
  border-radius: 999px;
  color: var(--purple);
  background: #efe1f3;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.08;
}

.hero h1 {
  margin: 18px 0 14px;
  color: var(--purple-3);
  font-size: clamp(48px, 7vw, 82px);
  letter-spacing: -3px;
}

.hero h1 span {
  color: var(--purple-2);
}

.lead {
  max-width: 570px;
  color: #5f5265;
  font-size: 19px;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 26px;
}

.fine-print {
  margin-top: 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn.primary {
  color: #3c124b;
  background: linear-gradient(180deg, #ffd85e, #ffc400);
  border-color: #e6ad00;
  box-shadow: 0 2px 0 #b67d00;
}

.btn.primary:hover {
  background: linear-gradient(180deg, #ffe58a, #ffd23e);
}

.btn.ghost {
  color: var(--purple);
  background: rgba(255, 255, 255, 0.7);
  border-color: #d9c7df;
}

.btn.ghost:hover {
  background: #fff;
}

.btn.full {
  width: 100%;
}

.mail-window {
  overflow: hidden;
  border: 1px solid #caaed3;
  border-radius: 14px;
  background: var(--paper);
  box-shadow: var(--shadow);
  transform: rotate(1deg);
}

.window-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--purple-3), var(--purple-2));
  font-size: 13px;
  font-weight: 700;
}

.window-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ffd85e;
  box-shadow: 0 0 0 3px rgba(255, 216, 94, 0.18);
}

.window-body {
  padding: 8px 0;
}

.sample-row {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid #f0e5f2;
  color: #5d5162;
  font-size: 13px;
}

.sample-row b {
  color: var(--ink);
}

.sample-row.unread {
  background: #fff8e5;
}

.sample-row .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d8c8dc;
}

.sample-row.unread .dot {
  background: var(--purple-2);
}

.window-input {
  margin: 14px 18px;
  padding: 12px 14px;
  border: 1px dashed #d8c5de;
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 28px;
}

.feature {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 253, 251, 0.82);
  box-shadow: 0 8px 24px rgba(56, 24, 66, 0.05);
}

.feature .icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-bottom: 12px;
  border-radius: 9px;
  color: var(--purple);
  background: #f3e5f7;
  font-size: 17px;
}

.feature h3 {
  margin-bottom: 7px;
  font-size: 15px;
}

.feature p,
.step-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.steps {
  margin-top: 42px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.55);
}

.steps h2 {
  margin-bottom: 18px;
  font-size: 22px;
}

.step-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.step-grid span {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--purple-2);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.step-grid h3 {
  margin-bottom: 6px;
  font-size: 16px;
}

.auth-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr);
  gap: 24px;
  max-width: 940px;
  margin: 20px auto 0;
  align-items: start;
}

.panel {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 253, 251, 0.92);
  box-shadow: 0 12px 34px rgba(56, 24, 66, 0.08);
}

.auth-card h1,
.account-grid h1,
.mail-shell h1,
.compose-panel h1,
.message-panel h1 {
  margin-bottom: 8px;
  color: var(--purple-3);
  font-size: 34px;
  letter-spacing: -1px;
}

.sub {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.auth-side {
  padding: 28px;
  border: 1px solid #d9c4e1;
  border-radius: 14px;
  color: #f7edfa;
  background: linear-gradient(160deg, var(--purple-3), var(--purple) 65%, #8a2da0);
  box-shadow: var(--shadow);
}

.auth-side h2 {
  margin-bottom: 12px;
  color: #ffd85e;
  font-size: 24px;
}

.auth-side p {
  color: #e8d4ee;
  font-size: 14px;
  line-height: 1.55;
}

.auth-side ul {
  margin: 18px 0;
  padding-left: 20px;
  color: #f3e2f7;
  font-size: 14px;
  line-height: 1.9;
}

.mail-preview {
  display: grid;
  gap: 4px;
  margin-top: 20px;
  padding: 14px;
  border: 1px solid rgba(255, 216, 94, 0.35);
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.18);
  font-size: 12px;
}

.mail-preview span {
  color: #cbb0d3;
}

.mail-preview strong {
  color: #ffd85e;
  font-size: 15px;
  word-break: break-all;
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  margin-bottom: 6px;
  color: #4b3d50;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.field input,
.field textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #d8c7dd;
  border-radius: 7px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.field textarea {
  resize: vertical;
  line-height: 1.55;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--purple-2);
  box-shadow: 0 0 0 3px rgba(123, 45, 146, 0.13);
}

.hint {
  margin-top: 6px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.5;
}

.mt {
  margin-top: 18px;
}

.flash {
  margin-bottom: 18px;
  padding: 11px 13px;
  border: 1px solid;
  border-radius: 7px;
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.flash.error {
  border-color: #f0b8b2;
  color: #8d1c12;
  background: #fff1ef;
}

.flash.info {
  border-color: #b9dcc9;
  color: #145c39;
  background: #effaf4;
}

.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  color: #5d5162;
  background: #efe8f1;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.badge.active {
  color: #145c39;
  background: #e3f6eb;
}

.badge.pending {
  color: #805b00;
  background: #fff2cc;
}

.badge.error,
.badge.blocked {
  color: #8d1c12;
  background: #ffe6e2;
}

.badge.deleted {
  color: #5d5162;
  background: #eee9f0;
}

.account-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 22px;
  align-items: start;
}

.identity {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 24px 0 20px;
}

.avatar {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(145deg, var(--purple), #a83abb);
  box-shadow: 0 5px 14px rgba(75, 26, 94, 0.25);
  font-size: 24px;
  font-weight: 800;
}

.identity h2 {
  margin: 0 0 3px;
  font-size: 22px;
}

.identity .mail {
  color: var(--muted);
  font-size: 13px;
  word-break: break-all;
}

.identity-status {
  margin-left: auto;
}

.kv {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 10px 16px;
  margin: 20px 0;
  padding: 16px;
  border: 1px solid #eee2f0;
  border-radius: 9px;
  background: #fffafd;
  font-size: 13px;
}

.kv dt {
  color: var(--muted);
}

.kv dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.kv.compact {
  grid-template-columns: 90px minmax(0, 1fr);
  font-size: 12.5px;
}

.stack {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.stack.row {
  flex-direction: row;
}

.divider {
  height: 1px;
  margin: 26px 0;
  background: var(--line);
}

.narrow {
  max-width: 440px;
}

.side-panel h2 {
  margin-bottom: 8px;
  font-size: 22px;
}

.note {
  margin: 18px 0;
  padding: 13px;
  border-left: 3px solid var(--purple-2);
  border-radius: 0 7px 7px 0;
  color: #5b4d60;
  background: #f8f0fa;
  font-size: 12.5px;
  line-height: 1.55;
}

.note strong {
  color: var(--purple);
}

.mail-shell {
  max-width: 1020px;
  margin: 0 auto;
}

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

.mail-head h1 {
  margin: 10px 0 4px;
  font-size: 40px;
}

.mail-actions {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
}

.mail-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  box-shadow: 0 10px 30px rgba(56, 24, 66, 0.07);
}

.mail-row {
  display: grid;
  grid-template-columns: 12px minmax(120px, 0.7fr) minmax(0, 2fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid #f0e7f2;
  color: #5f5364;
  font-size: 13px;
}

.mail-row:last-child {
  border-bottom: 0;
}

.mail-row:hover {
  background: #fbf4fd;
  text-decoration: none;
}

.mail-row.unread {
  color: var(--ink);
  background: #fffaf0;
  font-weight: 600;
}

.mail-row.unread:hover {
  background: #fff4d8;
}

.mail-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d8c8dc;
}

.mail-row.unread .mail-dot {
  background: var(--purple-2);
  box-shadow: 0 0 0 3px rgba(123, 45, 146, 0.12);
}

.mail-from,
.mail-subject {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mail-date {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 400;
  white-space: nowrap;
}

.empty-state {
  padding: 54px 24px;
  border: 1px dashed #d9c6df;
  border-radius: 12px;
  text-align: center;
  background: rgba(255, 253, 251, 0.7);
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 16px;
  color: var(--purple);
  background: #f2e3f7;
  font-size: 26px;
}

.empty-state h2 {
  margin-bottom: 8px;
  font-size: 22px;
}

.empty-state p {
  max-width: 480px;
  margin: 0 auto 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.message-panel,
.compose-panel {
  max-width: 900px;
  margin: 0 auto;
}

.back-link {
  display: inline-block;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.message-subject {
  font-size: clamp(24px, 4vw, 36px) !important;
  overflow-wrap: anywhere;
}

.message-meta {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 6px 12px;
  margin: 20px 0;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
}

.message-meta dt {
  color: var(--muted);
}

.message-meta dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.mail-body {
  margin: 22px 0;
  padding: 18px;
  border: 1px solid #eee3f0;
  border-radius: 9px;
  color: #3b2f40;
  background: #fff;
  font: inherit;
  font-size: 14px;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.admin-body {
  background:
    radial-gradient(800px 460px at 0 0, #ece8f3 0, transparent 58%),
    linear-gradient(180deg, #f8f7fa 0%, #f1eef4 100%);
}

.admin-auth {
  max-width: 560px;
}

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

.admin-head h1 {
  margin: 10px 0 4px;
  font-size: 38px;
  letter-spacing: -1px;
}

.admin-head .sub {
  margin-bottom: 0;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.stat {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.8);
}

.stat span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.stat strong {
  color: var(--purple-3);
  font-size: 28px;
  line-height: 1;
}

.admin-test {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.admin-test h2 {
  margin-bottom: 6px;
  font-size: 20px;
}

.admin-test .sub {
  margin: 0;
}

.table-panel {
  padding: 22px;
}

.table-panel h2 {
  margin-bottom: 16px;
  font-size: 22px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  padding: 12px 10px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid #efe5f1;
}

th {
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

td.actions {
  white-space: nowrap;
}

td.actions .link-button {
  color: var(--purple-2);
  font-size: 12px;
}

td.actions .link-button.danger {
  color: var(--danger);
}

td.actions .link-button.success {
  color: var(--green);
}

td.actions form + form {
  margin-left: 10px;
}

.small {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.error-text {
  color: var(--danger);
}

.empty-cell {
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.center-card {
  max-width: 560px;
  margin: 46px auto;
  text-align: center;
}

.error-code {
  color: var(--purple-2);
  font-size: 76px;
  font-weight: 800;
  line-height: 1;
  opacity: 0.3;
}

.center-card h1 {
  margin: 8px 0 10px;
  font-size: 30px;
}

.center-card p {
  margin: 0 0 20px;
  color: var(--muted);
  line-height: 1.55;
}

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .mail-window {
    transform: none;
    max-width: 560px;
  }

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

  .stat-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .account-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .topbar-inner {
    align-items: flex-start;
    gap: 12px;
  }

  .main-nav {
    gap: 12px;
  }

  .auth-wrap {
    grid-template-columns: 1fr;
  }

  .auth-side {
    order: 2;
  }

  .auth-card {
    order: 1;
  }

  .step-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .mail-head,
  .admin-head,
  .admin-test {
    align-items: flex-start;
    flex-direction: column;
  }

  .mail-row {
    grid-template-columns: 10px minmax(0, 1fr) auto;
  }

  .mail-dot {
    grid-column: 1;
    grid-row: 1;
  }

  .mail-subject {
    grid-column: 2 / -1;
    white-space: normal;
    line-height: 1.4;
  }

  .mail-date {
    grid-column: 3;
    grid-row: 1;
  }

  .mail-from {
    grid-column: 2;
    grid-row: 1;
  }

  .kv {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .kv dt {
    margin-top: 8px;
  }

  .identity-status {
    display: none;
  }
}

@media (max-width: 520px) {
  .page {
    padding: 24px 15px 42px;
  }

  .topbar-inner {
    padding: 11px 15px;
    flex-wrap: wrap;
  }

  .brand {
    font-size: 19px;
  }

  .main-nav {
    width: 100%;
    margin-left: 0;
  }

  .panel,
  .auth-side {
    padding: 21px;
  }

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

  .hero h1 {
    font-size: 45px;
    letter-spacing: -2px;
  }

  .mail-actions {
    width: 100%;
  }

  .mail-actions .btn {
    flex: 1;
  }

  .footer {
    flex-direction: column;
  }
}

/* ---------------------------------------------------------------- webmail */

.webmail {
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  min-height: 640px;
  overflow: hidden;
  border: 1px solid #d9c4e1;
  border-radius: 16px;
  background: #fffdfb;
  box-shadow: 0 18px 50px rgba(56, 24, 66, 0.12);
}

.wm-side {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px 18px;
  color: #f7edfa;
  background:
    radial-gradient(300px 220px at 15% 0, rgba(255, 216, 94, 0.12), transparent 70%),
    linear-gradient(165deg, #2b0f36, #4b1a5e 60%, #6f2284);
}

.wm-account {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.wm-account div {
  display: grid;
  min-width: 0;
}

.wm-account strong {
  color: #fff;
  font-size: 14px;
}

.wm-account span:not(.wm-avatar) {
  overflow: hidden;
  color: #d7bce0;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wm-avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  color: #3c124b;
  background: linear-gradient(145deg, #ffd85e, #ff9f1a);
  box-shadow: 0 2px 0 #b56b00;
  font-size: 17px;
  font-weight: 800;
}

.wm-avatar.large {
  width: 46px;
  height: 46px;
  font-size: 19px;
}

.wm-compose {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 13px;
  border-radius: 8px;
  color: #3c124b;
  background: linear-gradient(145deg, #ffd85e, #ffb51a);
  box-shadow: 0 3px 0 #a96600;
  font-size: 13px;
  font-weight: 800;
}

.wm-compose:hover {
  color: #3c124b;
  text-decoration: none;
  background: #ffe58a;
}

.wm-compose span {
  font-size: 18px;
  line-height: 1;
}

.wm-folders {
  display: grid;
  gap: 3px;
}

.wm-folder {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 11px;
  border-radius: 7px;
  color: #e8d4ee;
  font-size: 13px;
  font-weight: 600;
}

.wm-folder:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  text-decoration: none;
}

.wm-folder.active {
  color: #3c124b;
  background: #ffd85e;
}

.wm-folder b {
  min-width: 20px;
  padding: 2px 6px;
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, 0.17);
  font-size: 10px;
  text-align: center;
}

.wm-folder.active b {
  color: #fff;
  background: #6f2284;
}

.wm-quota {
  margin-top: auto;
  padding: 12px;
  border: 1px solid rgba(255, 216, 94, 0.22);
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.17);
}

.wm-quota.full {
  border-color: rgba(255, 130, 120, 0.7);
  background: rgba(130, 20, 20, 0.3);
}

.wm-quota-head,
.wm-quota-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #cdb2d6;
  font-size: 10.5px;
}

.wm-quota-head strong {
  color: #ffd85e;
  font-size: 12px;
}

.wm-quota-foot {
  margin-top: 5px;
}

.wm-progress,
.account-quota progress,
.admin-quota-progress {
  display: block;
  width: 100%;
  height: 6px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  accent-color: #ffd85e;
}

.wm-progress::-webkit-progress-bar,
.account-quota progress::-webkit-progress-bar,
.admin-quota-progress::-webkit-progress-bar {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

.wm-progress::-webkit-progress-value {
  border-radius: 999px;
  background: #ffd85e;
}

.wm-quota.full .wm-progress::-webkit-progress-value {
  background: #ff8278;
}

.wm-progress::-moz-progress-bar {
  border-radius: 999px;
  background: #ffd85e;
}

.wm-side-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 11.5px;
}

.wm-side-foot a {
  color: #d7bce0;
  font-weight: 600;
}

.wm-side-foot a:hover {
  color: #ffd85e;
}

.wm-logout {
  padding: 0;
  border: 0;
  color: #d7bce0;
  background: none;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.wm-logout:hover {
  color: #ffd85e;
}

.wm-main {
  min-width: 0;
  padding: 28px 30px 34px;
  background:
    radial-gradient(700px 280px at 100% 0, #fff3d9 0, transparent 60%),
    #fffdfb;
}

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

.wm-head h1 {
  margin: 9px 0 3px;
  color: var(--purple-3);
  font-size: 38px;
  letter-spacing: -1.3px;
}

.wm-head .sub {
  margin: 0;
}

.wm-search {
  display: flex;
  align-items: center;
  gap: 6px;
  width: min(280px, 100%);
  padding: 4px;
  border: 1px solid #ddcbdf;
  border-radius: 8px;
  background: #fff;
}

.wm-search input {
  min-width: 0;
  flex: 1;
  padding: 7px 8px;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font: inherit;
  font-size: 12.5px;
}

.wm-search button {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 29px;
  height: 29px;
  border: 0;
  border-radius: 6px;
  color: var(--purple);
  background: #f3e5f7;
  font-size: 17px;
  cursor: pointer;
}

.wm-list {
  overflow: hidden;
  border: 1px solid #eee2f0;
  border-radius: 11px;
  background: #fff;
}

.wm-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border-bottom: 1px solid #f3eaf4;
  color: #5f5364;
}

.wm-row:last-child {
  border-bottom: 0;
}

.wm-row:hover {
  background: #fbf4fd;
  text-decoration: none;
}

.wm-row.unread {
  background: #fffaf0;
}

.wm-row.unread:hover {
  background: #fff4d8;
}

.wm-row-avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  color: var(--purple);
  background: #f2e3f7;
  font-size: 14px;
  font-weight: 800;
}

.wm-row-main {
  display: grid;
  min-width: 0;
  flex: 1;
  gap: 2px;
}

.wm-row-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.wm-row-top strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 12.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wm-row-top time {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 10.5px;
}

.wm-row-subject {
  overflow: hidden;
  color: #4c4051;
  font-size: 12.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wm-row-size {
  color: #a397a8;
  font-size: 10px;
}

.wm-unread {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--purple-2);
  box-shadow: 0 0 0 3px rgba(123, 45, 146, 0.1);
}

.wm-empty {
  padding: 54px 22px;
  border: 1px dashed #ddc9e3;
  border-radius: 12px;
  text-align: center;
  background: #fffdfb;
}

.wm-empty-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin: 0 auto 13px;
  border-radius: 15px;
  color: var(--purple);
  background: #f2e3f7;
  font-size: 25px;
}

.wm-empty h2 {
  margin-bottom: 7px;
  font-size: 20px;
}

.wm-empty p {
  max-width: 420px;
  margin: 0 auto 16px;
  color: var(--muted);
  font-size: 13px;
}

.wm-full-banner {
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid #efb5ad;
  border-radius: 8px;
  color: #7d2318;
  background: #fff2ef;
  font-size: 12.5px;
  line-height: 1.55;
}

.wm-full-banner strong {
  display: block;
  margin-bottom: 2px;
}

.wm-reader {
  overflow: hidden;
  border: 1px solid #eee2f0;
  border-radius: 12px;
  background: #fff;
}

.wm-reader-head {
  padding: 22px 24px 18px;
  border-bottom: 1px solid #f0e5f2;
}

.wm-reader-head h1 {
  margin-bottom: 16px;
  color: var(--purple-3);
  font-size: clamp(23px, 3.4vw, 32px);
  overflow-wrap: anywhere;
}

.wm-from {
  display: flex;
  align-items: center;
  gap: 11px;
}

.wm-from div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.wm-from strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 12.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wm-from span:not(.wm-avatar) {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wm-from time {
  margin-left: auto;
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 10.5px;
}

.wm-body {
  margin: 0;
  padding: 24px;
  color: #3b2f40;
  background: #fff;
  font: inherit;
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.wm-attachments {
  padding: 0 24px 20px;
}

.wm-attachments h2 {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.wm-attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.wm-attachment {
  display: flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  padding: 8px 10px;
  border: 1px solid #e6d8e9;
  border-radius: 7px;
  color: var(--purple);
  background: #fcf7fd;
  font-size: 12px;
}

.wm-attachment:hover {
  text-decoration: none;
  background: #f7edfa;
}

.wm-attachment span:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wm-attachment small {
  color: var(--muted);
  font-size: 10px;
}

.wm-reader-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 24px 20px;
  border-top: 1px solid #f0e5f2;
}

.wm-compose-form {
  max-width: 760px;
  padding: 22px;
  border: 1px solid #eee2f0;
  border-radius: 12px;
  background: #fff;
}

.wm-compose-form textarea {
  min-height: 260px;
  resize: vertical;
}

.wm-compose-actions {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
}

.btn.danger {
  border: 1px solid #e7b4ae;
  color: #8f2015;
  background: #fff4f2;
}

.btn.danger:hover {
  background: #ffe8e4;
  text-decoration: none;
}

.account-quota {
  margin: 4px 0 18px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fcf8fd;
}

.account-quota.full {
  border-color: #efb5ad;
  background: #fff2ef;
}

.account-quota progress::-webkit-progress-bar,
.admin-quota-progress::-webkit-progress-bar {
  background: #eee2f1;
}

.account-quota progress::-webkit-progress-value {
  background: var(--purple-2);
}

.account-quota.full progress::-webkit-progress-value {
  background: var(--danger);
}

.account-quota progress::-moz-progress-bar {
  background: var(--purple-2);
}

.account-quota .hint {
  margin: 8px 0 0;
}

.admin-quota-status {
  align-items: flex-start;
}

.admin-quota-status .badge {
  flex: 0 0 auto;
}

.quota-cell {
  min-width: 150px;
}

.quota-cell strong {
  font-size: 12px;
}

.admin-quota-progress {
  margin: 6px 0;
  background: #eee2f1;
  accent-color: var(--purple-2);
}

.admin-quota-progress::-webkit-progress-value {
  background: var(--purple-2);
}

.quota-form {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 5px;
}

.quota-form input {
  width: 78px;
  padding: 4px 6px;
  border: 1px solid #d8c7dd;
  border-radius: 5px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  font-size: 11px;
}

.quota-form .link-button {
  color: var(--purple-2);
  font-size: 11px;
}

@media (max-width: 860px) {
  .webmail {
    grid-template-columns: 1fr;
  }

  .wm-side {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 15px 18px;
  }

  .wm-account {
    grid-column: 1;
  }

  .wm-compose {
    grid-column: 2;
    grid-row: 1;
    padding: 8px 11px;
  }

  .wm-folders {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
  }

  .wm-folder {
    flex: 1;
    min-width: 88px;
    justify-content: center;
    padding: 8px;
  }

  .wm-quota {
    grid-column: 1 / -1;
    margin-top: 0;
  }

  .wm-side-foot {
    grid-column: 1 / -1;
    padding-top: 9px;
  }

  .wm-main {
    padding: 20px 18px 26px;
  }

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

  .wm-search {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .wm-head h1 {
    font-size: 31px;
  }

  .wm-row {
    gap: 9px;
    padding: 11px 10px;
  }

  .wm-row-avatar {
    width: 30px;
    height: 30px;
  }

  .wm-row-size {
    display: none;
  }

  .wm-reader-head,
  .wm-body,
  .wm-attachments,
  .wm-reader-actions {
    padding-left: 16px;
    padding-right: 16px;
  }

  .wm-from time {
    display: none;
  }

  .wm-compose-form {
    padding: 16px;
  }
}

.admin-quota-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-quota-actions form {
  margin: 0;
}
