:root {
  color-scheme: dark;
  --bg: #0b0e13;
  --bg-elevated: #10151d;
  --surface: #141a23;
  --surface-2: #191f2a;
  --surface-3: #202735;
  --line: #293140;
  --line-strong: #384255;
  --text: #f4f6f8;
  --text-soft: #c3cad5;
  --muted: #8993a3;
  --muted-2: #687385;
  --accent: #7c8cff;
  --accent-hover: #8e9bff;
  --accent-soft: rgba(124, 140, 255, 0.12);
  --accent-line: rgba(124, 140, 255, 0.35);
  --success: #55c99a;
  --success-soft: rgba(85, 201, 154, 0.12);
  --danger: #ff7a86;
  --danger-soft: rgba(255, 122, 134, 0.1);
  --warning: #e9bc68;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 18px 45px rgba(0, 0, 0, 0.25);
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --header-height: 72px;
  --font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  content: "";
  pointer-events: none;
  background:
    radial-gradient(circle at 8% -10%, rgba(124, 140, 255, 0.11), transparent 30%),
    radial-gradient(circle at 95% 5%, rgba(85, 201, 154, 0.05), transparent 27%),
    var(--bg);
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  display: block;
}

[hidden] {
  display: none !important;
}

::selection {
  background: rgba(124, 140, 255, 0.32);
  color: var(--text);
}

:focus-visible {
  outline: 3px solid rgba(124, 140, 255, 0.35);
  outline-offset: 2px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  letter-spacing: -0.025em;
}

h1 {
  margin-bottom: 14px;
  font-size: clamp(2rem, 4vw, 3.8rem);
  line-height: 1.02;
}

h2 {
  margin-bottom: 8px;
  font-size: clamp(1.35rem, 2vw, 1.75rem);
  line-height: 1.15;
}

h3 {
  margin-bottom: 8px;
  font-size: 1rem;
  line-height: 1.3;
}

p {
  color: var(--text-soft);
}

code {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  color: #d9deff;
  padding: 2px 6px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.85em;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #10151d;
  color: var(--text);
  padding: 0 13px;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input::placeholder,
textarea::placeholder {
  color: #596477;
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--line-strong);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  background: #121821;
  outline: none;
  box-shadow: 0 0 0 3px rgba(124, 140, 255, 0.12);
}

input[readonly] {
  cursor: text;
}

select {
  appearance: none;
  padding-right: 40px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 20px,
    calc(100% - 13px) 20px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

select:disabled,
button:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

label {
  display: grid;
  gap: 7px;
  color: var(--text-soft);
  font-size: 0.88rem;
  font-weight: 600;
}

label > span {
  color: var(--text-soft);
}

.panel-card,
.glass-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(20, 26, 35, 0.93);
  box-shadow: var(--shadow-sm);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.13em;
  line-height: 1.2;
  text-transform: uppercase;
}

.hint,
.microcopy,
.muted {
  color: var(--muted);
}

.hint {
  margin-bottom: 0;
  font-size: 0.86rem;
}

.microcopy {
  margin: 12px 0 0;
  font-size: 0.78rem;
}

.full {
  width: 100%;
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.quiet-btn,
.toolbar-btn,
.icon-btn,
.icon-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0 15px;
  cursor: pointer;
  font-weight: 700;
  line-height: 1;
  transition: transform 130ms ease, background 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.primary-btn svg,
.secondary-btn svg,
.ghost-btn svg,
.quiet-btn svg,
.toolbar-btn svg,
.icon-action svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.primary-btn:hover,
.secondary-btn:hover,
.ghost-btn:hover,
.quiet-btn:hover,
.toolbar-btn:hover,
.icon-btn:hover,
.icon-action:hover {
  transform: translateY(-1px);
}

.primary-btn:active,
.secondary-btn:active,
.ghost-btn:active,
.quiet-btn:active,
.toolbar-btn:active,
.icon-btn:active,
.icon-action:active {
  transform: translateY(0);
}

.primary-btn {
  border-color: #8e9bff;
  background: var(--accent);
  color: #0b0e13;
  box-shadow: 0 8px 22px rgba(124, 140, 255, 0.18);
}

.primary-btn:hover {
  border-color: #a3adff;
  background: var(--accent-hover);
  box-shadow: 0 10px 26px rgba(124, 140, 255, 0.24);
}

.secondary-btn,
.toolbar-btn {
  border-color: var(--line-strong);
  background: var(--surface-2);
  color: var(--text);
}

.secondary-btn:hover,
.toolbar-btn:hover {
  border-color: #4a566d;
  background: var(--surface-3);
}

.ghost-btn,
.quiet-btn {
  border-color: transparent;
  background: transparent;
  color: var(--text-soft);
}

.ghost-btn:hover,
.quiet-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}

.small-btn {
  min-height: 34px;
  padding: 0 11px;
  font-size: 0.82rem;
}

.icon-btn,
.icon-action {
  width: 42px;
  min-width: 42px;
  padding: 0;
  border-color: var(--line);
  background: var(--surface-2);
}

.icon-btn svg,
.icon-action svg {
  width: 19px;
  height: 19px;
}

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

.danger-soft {
  border-color: rgba(255, 122, 134, 0.24) !important;
  background: var(--danger-soft) !important;
  color: #ff9aa3 !important;
}

.alert {
  margin-bottom: 18px;
  border: 1px solid;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 0.9rem;
}

.alert-error {
  border-color: rgba(255, 122, 134, 0.28);
  background: var(--danger-soft);
  color: #ffabb2;
}

.alert-success {
  border-color: rgba(85, 201, 154, 0.28);
  background: var(--success-soft);
  color: #8adcb9;
}

/* Header */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  border-bottom: 1px solid rgba(41, 49, 64, 0.82);
  background: rgba(11, 14, 19, 0.88);
  padding: 0 max(22px, calc((100vw - 1440px) / 2));
  backdrop-filter: blur(18px);
}

.app-logo {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-size: 1rem;
  font-weight: 760;
  letter-spacing: -0.02em;
}

.brand-symbol {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(124, 140, 255, 0.38);
  border-radius: 10px;
  background: var(--accent-soft);
  color: #a9b2ff;
}

.brand-symbol svg {
  width: 21px;
  height: 21px;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0;
}

.user-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text-soft);
  font-size: 0.82rem;
  font-weight: 750;
}

.user-summary {
  display: grid;
  min-width: 0;
  line-height: 1.2;
}

.user-summary strong {
  max-width: 160px;
  overflow: hidden;
  color: var(--text);
  font-size: 0.84rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-summary small {
  max-width: 220px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Login */
.auth-wrap {
  display: grid;
  min-height: calc(100vh - var(--header-height));
  place-items: center;
  padding: 48px 24px;
}

.login-card {
  display: grid;
  width: min(100%, 980px);
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.login-copy {
  position: relative;
  display: flex;
  min-height: 540px;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  border-right: 1px solid var(--line);
  padding: clamp(42px, 7vw, 76px);
  background:
    linear-gradient(160deg, rgba(124, 140, 255, 0.12), transparent 52%),
    #111720;
}

.login-copy::after {
  position: absolute;
  right: -90px;
  bottom: -130px;
  width: 360px;
  height: 360px;
  border: 1px solid rgba(124, 140, 255, 0.12);
  border-radius: 50%;
  box-shadow:
    0 0 0 45px rgba(124, 140, 255, 0.025),
    0 0 0 90px rgba(124, 140, 255, 0.018);
  content: "";
}

.login-kicker {
  width: fit-content;
  margin-bottom: 28px;
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  background: var(--accent-soft);
  color: #b2baff;
  padding: 7px 11px;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.login-copy h1 {
  max-width: 560px;
  margin-bottom: 20px;
}

.login-copy > p {
  max-width: 530px;
  margin-bottom: 34px;
  color: var(--text-soft);
  font-size: 1.02rem;
}

.feature-list {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
  color: var(--text-soft);
  font-size: 0.9rem;
}

.feature-list span {
  display: flex;
  align-items: center;
  gap: 10px;
}

.feature-list i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 5px rgba(85, 201, 154, 0.08);
}

.login-form {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(36px, 6vw, 62px);
}

.form-heading {
  margin-bottom: 28px;
}

.form-heading h2 {
  margin-bottom: 9px;
  font-size: 1.75rem;
}

.form-heading p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.login-form label + label {
  margin-top: 16px;
}

.login-form .primary-btn {
  min-height: 48px;
  margin-top: 22px;
}

/* Mail workspace */
.mail-page {
  width: min(100%, 1440px);
  margin: 0 auto;
  padding: 28px 24px 48px;
}

.mail-workspace {
  display: grid;
  align-items: start;
  grid-template-columns: 350px minmax(0, 1fr);
  gap: 20px;
}

.mail-sidebar {
  position: sticky;
  top: calc(var(--header-height) + 28px);
  display: grid;
  gap: 16px;
}

.address-card-pro,
.mailbox-history-card {
  padding: 22px;
}

.address-card-head,
.history-head,
.inbox-top,
.admin-head,
.section-head,
.user-main-line {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.address-card-head h1 {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.2;
}

.live-pill,
.count-pill,
.history-count,
.access-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-soft);
  padding: 5px 9px;
  font-size: 0.7rem;
  font-weight: 720;
  white-space: nowrap;
}

.live-pill {
  gap: 6px;
  border-color: rgba(85, 201, 154, 0.24);
  background: var(--success-soft);
  color: #8adcb9;
}

.live-pill i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.live-pill.active i {
  animation: statusPulse 1.15s ease-in-out infinite;
}

.live-pill.error {
  border-color: rgba(255, 122, 134, 0.26);
  background: var(--danger-soft);
  color: #ff9aa3;
}

.address-display {
  display: flex;
  gap: 9px;
  margin-top: 20px;
}

.address-display input {
  min-width: 0;
  height: 50px;
  border-color: var(--line-strong);
  background: #0f141c;
  color: var(--text);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.84rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.address-display .icon-action {
  width: auto;
  min-width: 82px;
  height: 50px;
  padding: 0 13px;
}

.mailbox-meta {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 0.78rem;
}

.mailbox-meta > span {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.mailbox-meta svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.user-access-note {
  display: grid;
  gap: 2px;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #111720;
  padding: 11px 12px;
}

.user-access-note span {
  color: var(--muted);
  font-size: 0.7rem;
}

.user-access-note strong {
  color: var(--text-soft);
  font-size: 0.8rem;
  font-weight: 650;
}

.mailbox-actions {
  display: grid;
  gap: 8px;
  margin-top: 22px;
}

.mailbox-actions .primary-btn {
  min-height: 46px;
}

.mailbox-actions .quiet-btn {
  min-height: 38px;
  justify-content: flex-start;
  padding-left: 10px;
  font-size: 0.82rem;
}

.history-head h2 {
  margin: 0;
  font-size: 1rem;
}

.mailbox-history-card select {
  margin-top: 17px;
  font-size: 0.82rem;
}

.history-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 9px;
}

.history-controls .secondary-btn,
.history-controls .quiet-btn {
  min-height: 38px;
  font-size: 0.78rem;
}

.mail-content {
  min-width: 0;
}

.inbox-panel,
.detail-panel {
  min-height: 680px;
  overflow: hidden;
}

.inbox-top {
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 22px 24px;
}

.inbox-top h2 {
  margin: 0;
  font-size: 1.4rem;
}

.inbox-top p:last-child {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.inbox-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.refresh-only-btn {
  min-width: 112px;
}

.refresh-only-btn.is-loading svg {
  animation: spin 0.85s linear infinite;
}

.message-table {
  position: relative;
  min-height: 586px;
}

.message-table-head,
.message-row {
  display: grid;
  grid-template-columns: minmax(180px, 0.9fr) minmax(220px, 1.45fr) 120px;
  gap: 22px;
  align-items: center;
}

.message-table-head {
  min-height: 45px;
  border-bottom: 1px solid var(--line);
  background: rgba(16, 21, 29, 0.7);
  padding: 0 24px;
  color: var(--muted-2);
  font-size: 0.68rem;
  font-weight: 760;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.message-row {
  position: relative;
  width: 100%;
  min-height: 72px;
  border: 0;
  border-bottom: 1px solid rgba(41, 49, 64, 0.72);
  background: transparent;
  padding: 10px 24px;
  text-align: left;
  cursor: pointer;
  transition: background 150ms ease;
}

.message-row:hover {
  background: rgba(124, 140, 255, 0.055);
}

.message-row.selected {
  background: var(--accent-soft);
}

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

.sender-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface-2);
  color: #b8c0ce;
  font-size: 0.72rem;
  font-weight: 760;
  text-transform: uppercase;
}

.sender-cell,
.subject-cell,
.message-row time {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sender-cell {
  color: var(--text-soft);
  font-size: 0.86rem;
  font-weight: 650;
}

.subject-cell {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 620;
}

.message-row time {
  color: var(--muted);
  font-size: 0.76rem;
  text-align: right;
}

.row-arrow {
  display: none;
  width: 17px;
  height: 17px;
  color: var(--muted);
}

.empty-state {
  display: grid;
  min-height: 430px;
  place-content: center;
  justify-items: center;
  padding: 50px 24px;
  text-align: center;
}

.empty-state[hidden] {
  display: none !important;
}

.empty-icon {
  display: grid;
  width: 62px;
  height: 62px;
  margin-bottom: 20px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-2);
  color: var(--muted);
}

.empty-icon svg {
  width: 31px;
  height: 31px;
}

.empty-state h3 {
  margin-bottom: 7px;
  font-size: 1.05rem;
}

.empty-state p {
  max-width: 380px;
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.inbox-loader {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  background: rgba(11, 14, 19, 0.58);
  opacity: 0;
  transition: opacity 180ms ease;
  backdrop-filter: blur(4px);
}

.inbox-loader.is-visible {
  opacity: 1;
}

.loader-card {
  display: flex;
  align-items: center;
  gap: 13px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: #171d27;
  padding: 14px 17px;
  box-shadow: var(--shadow-md);
}

.loader-card strong,
.loader-card small {
  display: block;
}

.loader-card strong {
  color: var(--text);
  font-size: 0.86rem;
}

.loader-card small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.72rem;
}

.spinner {
  width: 21px;
  height: 21px;
  flex: 0 0 auto;
  border: 2px solid rgba(124, 140, 255, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

/* Message detail */
.detail-panel {
  background: var(--surface);
}

.detail-toolbar {
  display: flex;
  min-height: 70px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding: 13px 20px;
}

.detail-toolbar > .quiet-btn {
  padding-left: 6px;
}

.detail-actions {
  display: flex;
  gap: 8px;
}

.detail-actions .secondary-btn {
  min-height: 38px;
  font-size: 0.78rem;
}

.detail-header {
  border-bottom: 1px solid var(--line);
  padding: 28px 32px 24px;
}

.detail-header h2 {
  margin: 0;
  font-size: clamp(1.45rem, 2.3vw, 2rem);
  overflow-wrap: anywhere;
}

.detail-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  margin-top: 24px;
}

.detail-meta div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.detail-meta span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.detail-meta strong {
  overflow: hidden;
  color: var(--text-soft);
  font-size: 0.84rem;
  font-weight: 620;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-render {
  min-height: 490px;
  overflow: auto;
  background: #f7f8fa;
  color: #1b2028;
  padding: 32px;
  line-height: 1.65;
}

.message-render.plain-email {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: var(--font);
}

.message-render.html-email {
  color-scheme: light;
}

.message-render.html-email img {
  max-width: 100% !important;
  height: auto !important;
}

.message-render.html-email table {
  max-width: 100% !important;
}

/* Mailbox modal */
body.modal-open {
  overflow: hidden;
}

.mail-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  overflow: auto;
  place-items: center;
  background: rgba(5, 7, 10, 0.78);
  padding: 24px;
  animation: fadeIn 150ms ease-out;
  backdrop-filter: blur(8px);
}

.mail-modal {
  width: min(100%, 760px);
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  background: #131922;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.48);
  animation: modalIn 180ms ease-out;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
  border-bottom: 1px solid var(--line);
  padding: 24px 26px 21px;
}

.modal-head h2 {
  margin: 0;
  font-size: 1.45rem;
}

.modal-head p:last-child {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

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

.choice-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #10151d;
  padding: 20px;
}

.choice-card:hover {
  border-color: var(--line-strong);
}

.choice-icon {
  display: grid;
  width: 40px;
  height: 40px;
  margin-bottom: 18px;
  place-items: center;
  border: 1px solid var(--accent-line);
  border-radius: 11px;
  background: var(--accent-soft);
  color: #a8b1ff;
}

.choice-icon svg {
  width: 21px;
  height: 21px;
}

.choice-card h3 {
  margin-bottom: 6px;
  font-size: 1rem;
}

.choice-card p {
  min-height: 42px;
  margin-bottom: 17px;
  color: var(--muted);
  font-size: 0.82rem;
}

.preview-address {
  margin-top: auto;
  margin-bottom: 13px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #0b0f15;
  color: var(--text-soft);
  padding: 10px 11px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-line {
  display: flex;
  min-width: 0;
  margin-top: 4px;
}

.custom-line input {
  min-width: 0;
  border-radius: 10px 0 0 10px;
}

.domain-chip {
  display: flex;
  max-width: 46%;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-left: 0;
  border-radius: 0 10px 10px 0;
  background: var(--surface-2);
  color: var(--muted);
  padding: 0 11px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-preview {
  margin-top: 10px;
}

.mini-label {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
}

/* Toast */
.toast-region {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 130;
  display: grid;
  width: min(360px, calc(100vw - 44px));
  gap: 9px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #171d27;
  color: var(--text-soft);
  padding: 12px 14px;
  box-shadow: var(--shadow-md);
  font-size: 0.84rem;
  animation: toastIn 190ms ease-out;
}

.toast.is-leaving {
  animation: toastOut 170ms ease-in forwards;
}

.toast::before {
  width: 7px;
  height: 7px;
  margin-top: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--success);
  content: "";
}

.toast.error::before {
  background: var(--danger);
}

/* Admin */
.admin-shell {
  padding: 28px;
}

.admin-layout {
  display: grid;
  width: min(100%, 1380px);
  margin: 0 auto;
  align-items: start;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 20px;
}

.brand-panel {
  position: sticky;
  top: 28px;
  display: flex;
  min-height: 430px;
  flex-direction: column;
  justify-content: space-between;
  padding: 26px;
  background:
    linear-gradient(155deg, rgba(124, 140, 255, 0.1), transparent 48%),
    var(--surface);
}

.brand-panel .logo-mark,
.logo-mark {
  display: grid;
  width: 44px;
  height: 44px;
  margin-bottom: 28px;
  place-items: center;
  border: 1px solid var(--accent-line);
  border-radius: 12px;
  background: var(--accent-soft);
  color: #b4bcff;
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.brand-panel h1 {
  margin-bottom: 16px;
  font-size: 2rem;
  line-height: 1.08;
}

.brand-panel .muted {
  margin: 0;
  font-size: 0.9rem;
}

.mini-grid {
  display: grid;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--line);
}

.mini-grid span {
  background: #111720;
  color: var(--muted);
  padding: 10px 12px;
  font-size: 0.75rem;
}

.admin-card {
  min-width: 0;
  padding: 26px;
}

.admin-head {
  align-items: center;
  border-bottom: 1px solid var(--line);
  margin: -4px -2px 24px;
  padding: 0 2px 22px;
}

.admin-head h2 {
  margin: 0;
}

.timezone-note {
  margin-top: 8px;
}

.stack-form {
  width: min(100%, 460px);
  margin: 70px auto;
}

.stack-form > * + * {
  margin-top: 18px;
}

.stack-form h2 {
  font-size: 1.8rem;
}

.settings-form {
  display: grid;
  gap: 16px;
}

.form-section {
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #111720;
  padding: 20px;
}

.form-section h3 {
  margin-bottom: 17px;
  font-size: 1rem;
}

.form-section > .hint {
  margin-top: 14px;
}

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

.time-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.toggle-row {
  display: grid;
  gap: 9px;
}

.check {
  display: flex;
  min-height: 40px;
  align-items: center;
  grid-template-columns: auto 1fr;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0f141c;
  padding: 9px 11px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 580;
}

.check input[type="checkbox"] {
  width: 17px;
  min-height: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--accent);
}

.inline-check {
  align-self: end;
}

.settings-form > .primary-btn {
  position: sticky;
  bottom: 18px;
  z-index: 4;
  min-height: 48px;
  box-shadow: 0 14px 34px rgba(5, 7, 10, 0.48);
}

.user-section {
  margin-top: 22px;
}

.section-head {
  align-items: center;
  margin-bottom: 17px;
}

.section-head h3 {
  margin: 0;
}

.compact-form {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0e131a;
  padding: 16px;
}

.compact-form .hint {
  margin: 0;
}

.compact-form > .secondary-btn {
  width: fit-content;
}

.user-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.user-row {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0f141c;
  padding: 15px;
}

.user-main-line {
  align-items: center;
}

.user-main-line > div:first-child {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.user-main-line strong {
  color: var(--text);
  font-size: 0.92rem;
}

.user-main-line span {
  color: var(--muted);
  font-size: 0.76rem;
}

.user-actions,
.action-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.user-actions form,
.action-row form {
  margin: 0;
}

.user-expiry-form {
  display: grid;
  grid-template-columns: minmax(220px, 1.65fr) repeat(4, minmax(64px, 0.55fr)) auto auto;
  gap: 8px;
  align-items: end;
  border-top: 1px solid var(--line);
  margin-top: 14px;
  padding-top: 14px;
}

.user-expiry-form label {
  font-size: 0.72rem;
}

.user-expiry-form input {
  min-height: 39px;
  padding: 0 9px;
  font-size: 0.76rem;
}

.user-never {
  min-height: 39px;
  white-space: nowrap;
}

.small-expiry-btn {
  min-height: 39px;
  white-space: nowrap;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 22px;
}

.status-card {
  display: grid;
  min-width: 0;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #111720;
  padding: 14px;
}

.status-card span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.status-card strong {
  overflow: hidden;
  color: var(--text-soft);
  font-size: 0.82rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.action-row {
  margin-top: 14px;
}

.code-panel {
  display: grid;
  gap: 13px;
  margin-top: 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #0f141c;
  padding: 18px;
}

.code-panel > p {
  margin: 0;
}

.code-panel > p:not(.eyebrow) {
  color: var(--muted);
  font-size: 0.84rem;
}

.code-panel label {
  min-width: 0;
}

.code-panel code {
  display: block;
  overflow: auto;
  padding: 10px 11px;
  white-space: nowrap;
}

.animate-in {
  animation: pageIn 260ms ease-out both;
}

/* Compatibility for retained markup */
.compose-panel,
.address-hero,
.toolbar,
.toolbar-single,
.mailbox-manage-card,
.status-line,
.pro-status-line,
.pro-address-line,
.feature-row,
.hero-badges {
  min-width: 0;
}

/* Animations */
@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes statusPulse {
  0%, 100% { opacity: 0.42; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes toastOut {
  to { opacity: 0; transform: translateY(7px); }
}

@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Responsive */
@media (max-width: 1120px) {
  .mail-workspace {
    grid-template-columns: 310px minmax(0, 1fr);
  }

  .message-table-head,
  .message-row {
    grid-template-columns: minmax(155px, 0.85fr) minmax(190px, 1.25fr) 92px;
    gap: 15px;
  }

  .admin-layout {
    grid-template-columns: 250px minmax(0, 1fr);
  }

  .user-expiry-form {
    grid-template-columns: repeat(4, minmax(74px, 1fr));
  }

  .user-expiry-form label:first-of-type {
    grid-column: 1 / -1;
  }

  .user-never,
  .small-expiry-btn {
    grid-column: span 2;
  }

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

@media (max-width: 880px) {
  .topbar {
    padding-inline: 18px;
  }

  .mail-page {
    padding: 18px 16px 36px;
  }

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

  .mail-sidebar {
    position: static;
    grid-template-columns: minmax(0, 1.25fr) minmax(250px, 0.75fr);
  }

  .inbox-panel,
  .detail-panel {
    min-height: 620px;
  }

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

  .login-copy {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 48px;
  }

  .login-copy h1 {
    font-size: 2.6rem;
  }

  .login-form {
    padding: 42px 48px;
  }

  .admin-shell {
    padding: 18px;
  }

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

  .brand-panel {
    position: static;
    min-height: auto;
    gap: 24px;
  }

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

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

@media (max-width: 650px) {
  :root {
    --header-height: 62px;
  }

  .brand-name {
    font-size: 0.94rem;
  }

  .brand-symbol {
    width: 33px;
    height: 33px;
  }

  .topbar-user {
    gap: 6px;
  }

  .user-avatar,
  .user-summary {
    display: none;
  }

  .auth-wrap {
    padding: 22px 14px;
  }

  .login-card {
    border-radius: 18px;
  }

  .login-copy,
  .login-form {
    padding: 32px 24px;
  }

  .login-copy h1 {
    font-size: 2.1rem;
  }

  .login-copy > p {
    font-size: 0.94rem;
  }

  .mail-page {
    padding: 12px 10px 28px;
  }

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

  .address-card-pro,
  .mailbox-history-card {
    padding: 18px;
  }

  .address-display {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .address-display .icon-action {
    min-width: 48px;
  }

  .address-display .icon-action span {
    display: none;
  }

  .inbox-panel,
  .detail-panel {
    min-height: 560px;
    border-radius: 16px;
  }

  .inbox-top {
    display: grid;
    padding: 19px 18px;
  }

  .inbox-actions {
    width: 100%;
    justify-content: space-between;
  }

  .message-table-head {
    display: none;
  }

  .message-table {
    min-height: 475px;
  }

  .message-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "sender time"
      "subject arrow";
    gap: 6px 10px;
    min-height: 84px;
    padding: 13px 17px;
  }

  .sender-group {
    grid-area: sender;
  }

  .sender-avatar {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
    border-radius: 9px;
  }

  .sender-cell {
    font-size: 0.81rem;
  }

  .subject-cell {
    grid-area: subject;
    padding-left: 41px;
    color: var(--text-soft);
    font-size: 0.82rem;
  }

  .message-row time {
    grid-area: time;
    font-size: 0.7rem;
  }

  .row-arrow {
    display: block;
    grid-area: arrow;
    align-self: center;
  }

  .detail-toolbar {
    padding: 11px 13px;
  }

  .detail-actions .secondary-btn {
    width: 39px;
    min-width: 39px;
    padding: 0;
  }

  .detail-actions .secondary-btn svg {
    margin: 0;
  }

  .detail-actions .secondary-btn {
    font-size: 0;
  }

  .detail-header {
    padding: 23px 20px 20px;
  }

  .detail-meta {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .message-render {
    min-height: 410px;
    padding: 20px;
  }

  .mail-modal-backdrop {
    align-items: end;
    padding: 0;
  }

  .mail-modal {
    max-height: 92vh;
    overflow: auto;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 20px 20px 0 0;
  }

  .modal-head {
    padding: 20px;
  }

  .choice-grid {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .choice-card p {
    min-height: 0;
  }

  .admin-shell {
    padding: 10px;
  }

  .brand-panel,
  .admin-card {
    border-radius: 16px;
    padding: 18px;
  }

  .admin-card {
    overflow: hidden;
  }

  .admin-head {
    align-items: flex-start;
  }

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

  .form-section {
    padding: 15px;
  }

  .user-main-line {
    display: grid;
  }

  .user-actions {
    margin-top: 9px;
  }

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

  .user-expiry-form label:first-of-type,
  .user-never,
  .small-expiry-btn {
    grid-column: 1 / -1;
  }

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

  .toast-region {
    right: 12px;
    bottom: 12px;
    width: calc(100vw - 24px);
  }
}

@media (max-width: 390px) {
  .inbox-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .count-pill {
    align-self: flex-start;
  }

  .refresh-only-btn {
    width: 100%;
  }

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

.email-frame {
  display: block;
  width: 100%;
  min-height: 620px;
  border: 0;
  background: #fff;
}

.icon-action.is-copied {
  border-color: rgba(85, 201, 154, 0.35);
  background: var(--success-soft);
  color: #8adcb9;
}

@media (max-width: 650px) {
  .email-frame {
    min-height: 520px;
  }
}

/* Requested dropdown, confirmation dialog, and domain-management UI */
select {
  cursor: pointer;
  color-scheme: dark;
  font-weight: 650;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025), 0 1px 2px rgba(0, 0, 0, 0.18);
}

select:hover {
  background-color: #141a23;
}

select option,
select optgroup {
  background: #141a23;
  color: var(--text);
  font-weight: 600;
}

select option:checked {
  background: var(--accent);
  color: #0b0e13;
}

.modal-domain-field {
  margin: 20px 20px 0;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #0f141c;
  padding: 13px 14px;
}

.modal-domain-field > span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.modal-domain-field select {
  min-height: 44px;
  border-color: var(--line-strong);
  background-color: #141a23;
}

.confirm-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 180;
  display: grid;
  overflow: auto;
  place-items: center;
  background: rgba(5, 7, 10, 0.82);
  padding: 22px;
  animation: fadeIn 150ms ease-out;
  backdrop-filter: blur(9px);
}

.confirm-dialog {
  display: grid;
  width: min(100%, 430px);
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  border: 1px solid var(--line-strong);
  border-radius: 19px;
  background: #141a23;
  padding: 22px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.52);
  animation: modalIn 170ms ease-out;
}

.confirm-dialog-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(255, 122, 134, 0.3);
  border-radius: 13px;
  background: var(--danger-soft);
  color: var(--danger);
}

.confirm-dialog-icon svg {
  width: 23px;
  height: 23px;
}

.confirm-dialog-copy {
  min-width: 0;
}

.confirm-dialog-copy .eyebrow {
  margin-bottom: 5px;
  color: var(--danger);
}

.confirm-dialog-copy h2 {
  margin: 0;
  font-size: 1.2rem;
}

.confirm-dialog-copy p:last-child {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.87rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.confirm-dialog-actions {
  display: flex;
  grid-column: 1 / -1;
  justify-content: flex-end;
  gap: 9px;
  border-top: 1px solid var(--line);
  margin-top: 2px;
  padding-top: 16px;
}

.danger-confirm-btn {
  border-color: rgba(255, 122, 134, 0.45);
  background: var(--danger);
  color: #17080b;
  box-shadow: 0 8px 22px rgba(255, 122, 134, 0.14);
}

.danger-confirm-btn:hover {
  border-color: #ff9ba4;
  background: #ff8b95;
  box-shadow: 0 10px 26px rgba(255, 122, 134, 0.2);
}

.domain-section {
  margin-top: 22px;
}

.domain-count,
.primary-domain-badge {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  background: var(--accent-soft);
  color: #b7beff;
  padding: 0 10px;
  font-size: 0.72rem;
  font-weight: 750;
  white-space: nowrap;
}

.domain-list {
  display: grid;
  gap: 9px;
  margin-top: 16px;
}

.domain-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0e131a;
  padding: 12px;
}

.domain-row-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--muted);
}

.domain-row-icon svg {
  width: 20px;
  height: 20px;
}

.domain-row > div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.domain-row strong {
  overflow: hidden;
  color: var(--text);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.86rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.domain-row > div > span {
  color: var(--muted);
  font-size: 0.75rem;
}

.add-domain-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
  border-top: 1px solid var(--line);
  margin-top: 16px;
  padding-top: 16px;
}

.add-domain-form .secondary-btn {
  min-height: 46px;
}

@media (max-width: 620px) {
  .modal-domain-field {
    margin: 14px 14px 0;
  }

  .confirm-dialog-backdrop {
    align-items: end;
    padding: 0;
  }

  .confirm-dialog {
    width: 100%;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 20px 20px 0 0;
    padding: 20px;
  }

  .confirm-dialog-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

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

  .domain-row > form,
  .primary-domain-badge {
    grid-column: 1 / -1;
    justify-self: stretch;
  }

  .domain-row > form .small-btn,
  .primary-domain-badge {
    width: 100%;
    justify-content: center;
  }

  .add-domain-form {
    grid-template-columns: 1fr;
  }

  .add-domain-form .secondary-btn {
    width: 100%;
  }
}


/* Fully styled dropdowns for mailbox domain and recent-address selection */
.custom-select {
  position: relative;
  width: 100%;
}

.custom-select-native {
  position: absolute !important;
  width: 1px !important;
  min-height: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  border: 0 !important;
  margin: -1px !important;
  padding: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  white-space: nowrap !important;
}

.custom-select-trigger {
  display: flex;
  width: 100%;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, #171d27 0%, #121821 100%);
  color: var(--text);
  padding: 0 12px 0 14px;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035), 0 3px 10px rgba(0, 0, 0, 0.14);
  font-size: 0.84rem;
  font-weight: 700;
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.custom-select-trigger:hover {
  border-color: #465168;
  background: linear-gradient(180deg, #1b2230 0%, #151b25 100%);
}

.custom-select-trigger:focus-visible,
.custom-select.is-open .custom-select-trigger {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(124, 140, 255, 0.13), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.custom-select-trigger:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.custom-select-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-select-trigger.is-placeholder .custom-select-value {
  color: var(--muted);
}

.custom-select-arrow {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  transition: transform 160ms ease, border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.custom-select-arrow svg {
  width: 17px;
  height: 17px;
}

.custom-select.is-open .custom-select-arrow {
  transform: rotate(180deg);
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: #b9c0ff;
}

.custom-select-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: 0;
  z-index: 260;
  display: grid;
  max-height: 260px;
  gap: 4px;
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid #3a4559;
  border-radius: 12px;
  background: #141a23;
  padding: 6px;
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.035);
  animation: customSelectIn 140ms ease-out;
  scrollbar-color: #49546a transparent;
  scrollbar-width: thin;
}

.custom-select-menu[hidden] {
  display: none !important;
}

.custom-select-option {
  display: flex;
  width: 100%;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text-soft);
  padding: 8px 9px 8px 11px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 650;
  line-height: 1.3;
  text-align: left;
  transition: border-color 130ms ease, background 130ms ease, color 130ms ease;
}

.custom-select-option:hover,
.custom-select-option:focus-visible {
  border-color: var(--line);
  background: #1d2532;
  color: var(--text);
  outline: none;
}

.custom-select-option[aria-selected="true"] {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: #d8dcff;
}

.custom-select-option.is-expired .custom-select-option-text {
  color: var(--muted);
}

.custom-select-option-text {
  min-width: 0;
  overflow-wrap: anywhere;
}

.custom-select-option-check {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 7px;
  color: transparent;
}

.custom-select-option-check svg {
  width: 17px;
  height: 17px;
}

.custom-select-option[aria-selected="true"] .custom-select-option-check {
  background: rgba(124, 140, 255, 0.16);
  color: #aeb7ff;
}

.mailbox-history-card .custom-select {
  margin-top: 17px;
}

.mailbox-history-card .custom-select-trigger {
  min-height: 44px;
  font-size: 0.82rem;
}

.modal-domain-field .custom-select {
  margin-top: 8px;
}

.modal-domain-field .custom-select-trigger {
  min-height: 46px;
  border-color: var(--line-strong);
}

@keyframes customSelectIn {
  from {
    transform: translateY(-5px) scale(0.99);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@media (max-width: 620px) {
  .custom-select-menu {
    max-height: 220px;
  }
}
