:root {
  color-scheme: dark;
  --bg: #050812;
  --bg-soft: #0c1220;
  --card: #10192c;
  --text: #eef3ff;
  --muted: #9fb0d9;
  --accent: #6ea8ff;
  --accent-2: #8f6dff;
  --border: rgba(170, 195, 255, 0.2);
}

body {
  margin: 0;
  background:
    radial-gradient(900px 420px at 18% -10%, rgba(110, 168, 255, 0.22), transparent 60%),
    radial-gradient(1000px 460px at 95% -15%, rgba(143, 109, 255, 0.18), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Liberation Sans",
    sans-serif;
}

.container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 22px 18px;
}

.muted {
  color: var(--muted);
}

.pill {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(110, 168, 255, 0.15);
  color: #cddcff;
  font-size: 13px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  backdrop-filter: blur(6px);
}

.hidden {
  display: none;
}

.row {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.row-between {
  justify-content: space-between;
}

label,
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.composer-bar {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 10px;
  align-items: center;
}

.composer-control {
  box-sizing: border-box;
  width: 100%;
  height: 52px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  line-height: 52px;
}

.localpart {
  font-weight: 600;
  font-size: 22px;
  line-height: normal;
}

.at-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.at-wrap,
.at {
  color: var(--muted);
  font-weight: 800;
  font-size: 24px;
}

.at {
  display: block;
  line-height: 1;
  transform: translateY(-1px);
}

.domain-wrap {
  position: relative;
  min-width: 150px;
  max-width: 170px;
}

.domain-btn {
  text-align: left;
  font-weight: 600;
  font-size: 18px;
  line-height: normal;
  display: flex;
  align-items: center;
}

.domain-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #0f1730;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px;
  z-index: 10;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.domain-option {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 15px;
}

.domain-option.active {
  background: rgba(110, 168, 255, 0.18);
  border-color: rgba(110, 168, 255, 0.5);
}

button {
  cursor: pointer;
  border-radius: 10px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  background: rgba(106, 164, 255, 0.12);
  color: var(--text);
  font-size: 14px;
}

button:hover {
  border-color: rgba(106, 164, 255, 0.5);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: none;
  color: #fff;
  font-weight: 600;
  min-width: 52px;
  min-height: 52px;
  font-size: 20px;
}

.mail-layout {
  display: grid;
  grid-template-columns: minmax(440px, 560px) 1fr;
  gap: 14px;
  height: calc(100vh - 44px);
}

.left-pane,
.right-pane {
  min-height: 0;
  overflow: hidden;
}

.left-top {
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.result {
  margin-top: 12px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.result .email,
.email {
  word-break: break-word;
  font-size: 19px;
  margin-top: 2px;
  font-weight: 700;
}

.email-line {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.dot {
  color: #6f7da0;
}

.status {
  margin-top: 0;
  font-size: 14px;
}

.tiny {
  font-size: 14px;
}

.messages-list {
  margin-top: 10px;
  height: calc(100% - 160px);
  overflow: auto;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

.msg-item {
  cursor: pointer;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 10px;
}

.msg-item.active {
  border-color: rgba(110, 168, 255, 0.8);
  background: rgba(110, 168, 255, 0.14);
}

.msg-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.msg-subject {
  font-weight: 700;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.msg-from {
  color: var(--muted);
  font-size: 13px;
  margin-top: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mail-header {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  font-size: 15px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}

.preview-body {
  margin: 10px 0 0;
  white-space: pre-wrap;
  word-break: break-word;
  background: rgba(0, 0, 0, 0.2);
  padding: 14px;
  border-radius: 10px;
  height: calc(100% - 110px);
  overflow: auto;
  font-size: 15px;
}

@media (max-width: 960px) {
  .mail-layout {
    grid-template-columns: 1fr;
    height: auto;
  }
  .messages-list {
    height: 260px;
  }
  .preview-body {
    height: 280px;
  }
}

