.app-main { padding: 2.75rem 0 3.5rem; }
.app-wrap { max-width: 34rem; }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem 1.5rem 1.5rem;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
}

.panel h1 {
  margin: 0 0 0.35rem;
  font-size: 1.7rem;
}

.panel > .muted { margin-top: 0.15rem; }

.compose-header { margin-bottom: 0.25rem; }
.compose-header .muted { margin-top: 0.25rem; }

.app-switch {
  display: flex;
  gap: 0.25rem;
  width: fit-content;
  max-width: 100%;
  margin: 0 0 0.85rem;
  padding: 0.25rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
}

.tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  min-height: 44px;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  cursor: pointer;
}

.tab[aria-selected="true"] {
  background: var(--surface-2);
  color: var(--text);
}

.unread-badge {
  display: inline-block;
  min-width: 1.35rem;
  margin-left: 0.4rem;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  background: var(--accent-strong);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

.folder-label {
  margin: 1rem 0 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.folder-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0;
}

.folder-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  min-height: 44px;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  cursor: pointer;
}

.folder-tab[aria-selected="true"] {
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  color: var(--text);
  border-color: transparent;
}

.folder-tab:disabled {
  opacity: 0.6;
  cursor: progress;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
  margin-top: 1.15rem;
}

.form label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.88rem;
  font-weight: 600;
}

.form input,
.form textarea {
  font: inherit;
  font-weight: 400;
  font-size: 1rem;
  padding: 0.72rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: var(--bg);
  color: var(--text);
}

.form input::placeholder,
.form textarea::placeholder {
  color: #93a3bd;
  opacity: 1;
}

.form textarea { resize: vertical; min-height: 9rem; }

.from-line {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
  margin-top: 1.15rem;
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.95rem;
}

.from-line span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
}

.error,
.status {
  margin: 1rem 0 0;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  font-size: 0.95rem;
}

.error {
  color: var(--danger);
  background: var(--danger-surface);
  border: 1px solid var(--danger-border);
}

.status {
  color: var(--success);
  background: var(--success-surface);
  border: 1px solid var(--success-border);
  word-break: break-word;
}

.status-detail {
  display: block;
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.form .btn { width: 100%; margin-top: 0.15rem; }
.form .btn:disabled,
.btn-oauth:disabled { opacity: 0.6; cursor: not-allowed; }

.btn.is-busy:disabled,
.form .btn.is-busy:disabled,
.btn-oauth.is-busy:disabled,
.folder-tab.is-busy:disabled {
  opacity: 1;
  cursor: progress;
}

.btn.is-busy::before,
.folder-tab.is-busy::before {
  content: "";
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: btn-spin 0.7s linear infinite;
  flex: none;
}

@keyframes btn-spin {
  to { transform: rotate(360deg); }
}

.divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.25rem 0 0.85rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.oauth-row {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.btn-oauth {
  width: 100%;
  justify-content: flex-start;
  padding-left: 0.95rem;
  background: var(--bg);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.16);
}

.btn-oauth:hover {
  border-color: rgba(255, 255, 255, 0.36);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.btn-oauth svg { flex: none; }

.oauth-note { margin: 0.85rem 0 0; font-size: 0.85rem; }

.auth-switch { margin: 0.85rem 0 0; }
.auth-switch .btn { width: 100%; }

.gate-actions,
.pending-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.1rem;
}

#pendingAccounts { margin-top: 0.35rem; }

.pending-account {
  padding: 0.95rem 0;
  border-bottom: 1px solid var(--border);
}

.pending-account h2 {
  margin: 0;
  font-size: 1.05rem;
  overflow-wrap: anywhere;
}

.pending-account .muted { margin: 0.3rem 0 0; }

.allowlist-block {
  margin-top: 1.75rem;
  padding-top: 1.35rem;
  border-top: 1px solid var(--border);
}

.allowlist-block h2 {
  margin: 0 0 0.35rem;
  font-size: 1.25rem;
}

.allowlist-audit-heading {
  margin: 1.35rem 0 0.35rem;
  font-size: 1rem;
}

.allowlist-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.allowlist-domain {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92rem;
  overflow-wrap: anywhere;
}

.allowlist-row .btn {
  width: auto;
  flex: none;
}

.allowlist-audit-row {
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}

.allowlist-audit-row p { margin: 0.2rem 0 0; }

.account-list {
  margin: 1.15rem 0 1.25rem;
  display: grid;
  gap: 0;
}

.account-list div {
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--border);
}

.account-list dt {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.account-list dd {
  margin: 0.25rem 0 0;
  font-size: 1.02rem;
}

.settings-actions { margin-top: 0.25rem; }

.agent-admin {
  margin-top: 1.35rem;
  padding-top: 0.35rem;
}

.agent-admin h2 {
  margin: 0 0 0.35rem;
  font-size: 1.25rem;
}

.agent-admin .account-list { margin-top: 0.85rem; }

#creditsRemaining {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.agent-admin .settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

@media (max-width: 640px) {
  .app-main { padding-top: 1.5rem; }
  .panel { padding: 1.25rem 1rem 1.15rem; }
  .from-line { flex-direction: column; gap: 0.2rem; }
  .inbox-tools { width: 100%; }
  .mailbox-picker { width: 100%; }
  .mailbox-picker select { width: 100%; min-width: 0; }
}

.app-wrap.is-workspace { max-width: 68rem; }

.app-wrap.is-workspace #settingsPanel > h1,
.app-wrap.is-workspace #settingsPanel > .muted,
.app-wrap.is-workspace #settingsPanel > .account-list,
.app-wrap.is-workspace #settingsPanel > .fine,
.app-wrap.is-workspace #settingsPanel > .agent-admin,
.app-wrap.is-workspace #settingsPanel > .settings-actions {
  max-width: 40rem;
}

@media (min-width: 900px) {
  .app-wrap.is-workspace #composePanel {
    display: grid;
    grid-template-columns: minmax(0, 42rem) minmax(16rem, 1fr);
    column-gap: 2rem;
    align-items: start;
  }

  .app-wrap.is-workspace #composePanel > * { grid-column: 1; }

  .app-wrap.is-workspace #composePanel .draft-box {
    grid-column: 2;
    grid-row: 1 / span 12;
    margin-top: 0;
    padding: 0.15rem 0 0 1.25rem;
    border-left: 1px solid var(--border);
  }
}

.app-switch { flex-wrap: wrap; }

.inbox-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.inbox-head h1 { margin: 0; }

.inbox-head .btn { width: auto; }

.inbox-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
}

.mailbox-picker {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  min-width: 0;
}

.mailbox-picker span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.mailbox-picker select {
  width: auto;
  min-width: 16rem;
  max-width: 100%;
  min-height: 44px;
}

.forward-notes {
  margin-top: 0.65rem;
}

.forward-notes p {
  margin: 0.25rem 0 0;
}

.mailbox-kind { margin: 0.15rem 0 0.35rem; }

.client-mail {
  margin-top: 1.35rem;
  padding-top: 0.35rem;
}

.client-mail h2,
.client-card h3 {
  margin: 0 0 0.45rem;
  overflow-wrap: anywhere;
}

.client-mail h2 { font-size: 1.25rem; }

.client-card {
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  min-width: 0;
}

.client-card .account-list { margin: 0.55rem 0 0.75rem; }

.client-value {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.7rem;
}

.client-value code {
  overflow-wrap: anywhere;
  word-break: break-all;
}

.client-pending { margin: 0.45rem 0 0; }

.client-secret {
  margin: 0.35rem 0 0.85rem;
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(157, 222, 181, 0.08);
}

.client-secret code {
  font-size: 1.02rem;
  letter-spacing: 0.01em;
}

.mailbox-block > .btn { width: auto; margin-bottom: 0.35rem; }

.inbox-note { margin: 0.75rem 0 0; }

.search-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.85rem;
}

.search-label { flex: 1 1 14rem; min-width: 0; }

.search-label input {
  width: 100%;
  font: inherit;
  font-weight: 400;
  font-size: 1rem;
  padding: 0.72rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: var(--bg);
  color: var(--text);
}

.search-form .btn,
.inbox-head .btn { width: auto; min-height: 44px; }

.search-form .btn:disabled,
.inbox-head .btn:disabled { opacity: 0.6; cursor: progress; }

.compose-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.compose-actions .btn { width: auto; }

.draft-box { margin-top: 1.25rem; }

.draft-heading {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

.draft-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.45rem 0;
  border-top: 1px solid var(--border);
}

.draft-open {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.draft-item.is-current .draft-open { font-weight: 700; }

.draft-item .btn { width: auto; }

.inbox-layout {
  display: grid;
  grid-template-columns: minmax(12rem, 16.5rem) minmax(0, 1fr);
  min-height: 16rem;
  margin-top: 1rem;
  border-top: 1px solid var(--border);
}

.inbox-list {
  max-height: 28rem;
  overflow: auto;
  border-right: 1px solid var(--border);
}

.inbox-item {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 0.85rem 0.75rem 0;
  cursor: pointer;
}

.inbox-item.is-selected { background: color-mix(in srgb, var(--accent) 16%, transparent); }

.inbox-item.is-unread {
  box-shadow: inset 3px 0 0 var(--accent);
}
.inbox-item.is-unread .inbox-subject { font-weight: 700; }

.unread-dot {
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  margin-right: 0.35rem;
  border-radius: 50%;
  background: var(--accent);
  vertical-align: middle;
}

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

.inbox-from { font-size: 0.82rem; color: var(--muted); }

.inbox-subject { font-size: 0.98rem; }

.inbox-preview {
  display: block;
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inbox-read {
  min-width: 0;
  padding: 0.85rem 0 0.25rem 1rem;
}

.inbox-read h2 {
  margin: 0 0 0.35rem;
  font-size: 1.25rem;
}

.inbox-meta { margin: 0 0 0.85rem; }

.inbox-body {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font: inherit;
}

.inbox-read .btn { width: auto; margin-top: 1rem; }

.thread-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 1rem;
}

.inbox-read .thread-actions .btn { margin-top: 0; }

.inbox-subject-row {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  min-width: 0;
}

.inbox-subject-row .inbox-subject {
  flex: 1;
  min-width: 0;
}

.thread-count {
  flex: none;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  font-size: 0.75rem;
  font-weight: 700;
}

.thread-stream {
  max-height: 32rem;
  overflow: auto;
  padding-right: 0.25rem;
}

.thread-message {
  padding: 0.75rem 0;
  border-top: 1px solid var(--border);
}

.thread-message:first-child { border-top: 0; padding-top: 0; }

.thread-message h3 {
  margin: 0 0 0.2rem;
  font-size: 0.95rem;
}

.thread-message.is-hit {
  margin: 0.35rem 0;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
}

.search-hit-label {
  margin: 0 0 0.35rem;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.thread-message.is-outbound {
  margin-top: 0.35rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
}

.thread-message .inbox-body { margin-top: 0.55rem; }

.attach-field .fine { font-weight: 400; color: var(--muted); }
.form input[type="file"] { font-size: 0.88rem; }

.pending-files,
.attach-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.pending-file,
.attach-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
  font-size: 0.88rem;
  font-weight: 400;
}

.attach-name { min-width: 0; word-break: break-word; }

.attach-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; }

.pending-file .btn,
.attach-actions .btn,
.thread-actions .btn,
.compose-thread-note .btn,
.draft-item .btn {
  width: auto;
  margin: 0;
  min-height: 44px;
  padding: 0.45rem 0.85rem;
}

.attach-preview {
  display: block;
  width: 100%;
  max-width: 16rem;
  max-height: 12rem;
  margin-top: 0.2rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
}

.attach-text {
  width: 100%;
  margin: 0.2rem 0 0;
  max-height: 10rem;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font: inherit;
  font-size: 0.85rem;
}

.compose-thread-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin: 0.75rem 0 0;
}

.back-to-threads { display: none; }

.thread-id {
  color: var(--muted);
  font-size: 0.82rem;
}

.draft-empty { margin: 0.35rem 0 0; }

.inbox-skeleton {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.85rem 0.85rem 0.85rem 0;
}

.inbox-skeleton span {
  display: block;
  height: 2.75rem;
  border-radius: 10px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04),
    color-mix(in srgb, var(--accent) 28%, transparent),
    rgba(255, 255, 255, 0.04)
  );
  background-size: 200% 100%;
  animation: inbox-shimmer 1.1s ease-in-out infinite;
}

.inbox-skeleton span:nth-child(2) { width: 92%; }
.inbox-skeleton span:nth-child(3) { width: 80%; }

@keyframes inbox-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.inbox-empty { margin: 0.85rem 0.75rem 0.85rem 0; }

@media (max-width: 720px) {
  .inbox-layout { grid-template-columns: 1fr; }
  .inbox-list {
    max-height: none;
    border-right: 0;
    border-bottom: 0;
  }
  .inbox-read { display: none; padding-left: 0; }
  .inbox-layout.is-reading .inbox-list { display: none; }
  .inbox-layout.is-reading .inbox-read { display: block; }
  .back-to-threads {
    display: inline-flex;
    min-height: 44px;
    margin: 0 0 0.75rem;
  }
}

.domain-card {
  margin-top: 1.35rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--border);
}

.domain-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.7rem;
}

.domain-head h2 {
  margin: 0;
  font-size: 1.2rem;
  overflow-wrap: anywhere;
}

.domain-status {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.domain-status.is-verified { color: #9ddeb5; }
.domain-status.is-failed { color: #ffb4b4; }
.domain-status.is-pending { color: #f3d48a; }

.domain-card > .error { margin: 0.55rem 0 0; }

.domain-publish-note {
  margin: 0.75rem 0 0;
  color: var(--muted);
}

.domain-hold {
  margin: 0.75rem 0 0;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(243, 212, 138, 0.08);
}

.customer-home,
#domainPanel,
.domain-card {
  min-width: 0;
  max-width: 100%;
}

.dns-scroll {
  overflow-x: auto;
  max-width: 100%;
  margin-top: 0.75rem;
}

.dns-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.dns-table th:nth-child(1),
.dns-table td:nth-child(1) { width: 7.5rem; }
.dns-table th:nth-child(2),
.dns-table td:nth-child(2) { width: 9rem; }
.dns-table th:nth-child(3),
.dns-table td:nth-child(3) { width: 5rem; }
.dns-table th:nth-child(5),
.dns-table td:nth-child(5) { width: 5.5rem; }

.dns-table caption { caption-side: bottom; }

.dns-table th,
.dns-table td {
  text-align: left;
  vertical-align: top;
  padding: 0.55rem 0.45rem;
  border-bottom: 1px solid var(--border);
}

.dns-table th {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.dns-value {
  display: block;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-all;
  font-size: 0.82rem;
}

.dns-table .fine { display: block; margin-top: 0.3rem; }

.dns-recommended {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #f3d48a;
}

.dns-guide {
  display: block;
  margin-top: 0.35rem;
}

.domain-notes {
  margin: 0.75rem 0 0;
  padding-left: 1.15rem;
}

.domain-notes li { margin: 0.28rem 0; color: var(--muted); }

.domain-card > .btn { margin-top: 0.85rem; }

.spam-filter { margin-top: 1.25rem; }

.spam-filter h2 { margin: 0 0 0.35rem; font-size: 1.25rem; }

.spam-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.7rem;
  margin-top: 0.85rem;
}

.spam-row p { margin: 0; }

.spam-badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.mailbox-heading {
  margin: 1.15rem 0 0.3rem;
  font-size: 1.05rem;
}

.mailbox-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(9rem, 0.7fr) minmax(0, 1fr) auto;
  gap: 0.55rem;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.mailbox-address { margin: 0; overflow-wrap: anywhere; }

.mailbox-row select,
.mailbox-row input,
.mailbox-form input,
.mailbox-form select {
  width: 100%;
  min-height: 44px;
}

.mailbox-form { margin-top: 0.85rem; }

.mode-choices { display: flex; flex-wrap: wrap; gap: 0.55rem; }

.mailbox-form .mode-choice,
.mailbox-edit .mode-choice {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  flex: 1 1 100%;
  width: auto;
  min-height: 44px;
  margin: 0;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
}

.mode-choice input {
  width: auto;
  min-height: 1.15rem;
  margin: 0 0 0.2rem;
}

.mode-choice.is-selected {
  border-color: rgba(157, 222, 181, 0.75);
  background: rgba(157, 222, 181, 0.08);
}

.mode-title { font-weight: 700; }

.mode-hint {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.forward-editor { margin-top: 0.85rem; }

.forward-label {
  margin: 0 0 0.35rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.forward-list { display: flex; flex-direction: column; gap: 0.45rem; }

.forward-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.forward-row input { flex: 1 1 12rem; min-width: 0; }

.forward-row .btn,
.forward-editor > .btn { width: auto; min-height: 44px; }

.forward-editor > .btn { margin-top: 0.45rem; }

.field-error {
  margin: 0.35rem 0 0;
  color: var(--danger);
  font-size: 0.88rem;
}

.mailbox-edit { margin-top: 0.45rem; }

.mailbox-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.85rem;
}

.mailbox-actions .btn {
  width: auto;
  min-height: 44px;
  margin-top: 0;
}

.mailbox-delete-confirm {
  margin-top: 0.75rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.mailbox-delete-confirm p {
  margin: 0;
}

.mailbox-delete-confirm .mailbox-actions {
  margin-top: 0.65rem;
}

.mailbox-meta {
  margin: 0.2rem 0 0.15rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

@media (min-width: 721px) {
  .mailbox-form .mode-choice,
  .mailbox-edit .mode-choice { flex: 1 1 14rem; }
}

.mailbox-form fieldset,
.mailbox-edit fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.mailbox-form legend,
.mailbox-edit legend {
  margin-bottom: 0.25rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

@media (max-width: 720px) {
  .mailbox-row { grid-template-columns: 1fr; }

  .dns-table { table-layout: auto; }
  .dns-table th:nth-child(1),
  .dns-table td:nth-child(1),
  .dns-table th:nth-child(2),
  .dns-table td:nth-child(2),
  .dns-table th:nth-child(3),
  .dns-table td:nth-child(3),
  .dns-table th:nth-child(5),
  .dns-table td:nth-child(5) { width: auto; }
  .dns-table thead { display: none; }
  .dns-table,
  .dns-table tbody,
  .dns-table tr,
  .dns-table td { display: block; width: 100%; }
  .dns-table tr {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
  }
  .dns-table td { border: 0; padding: 0.12rem 0; }
}
