/* Domains: the notice, the list of connected domains as glass cards that
   unfold into their DNS steps, and the add dialog. Shares .card, .card-row,
   .row-ico and .pill with settings.css. */

.domains .settings-inner { max-width: 880px; gap: 24px; }
.domain-heading { display: flex; gap: 16px; justify-content: space-between; align-items: center; }
.domain-heading p { color: var(--text-3); font-size: 16px; margin: 8px 0 0; }
.domain-heading-actions { display: flex; gap: 8px; }

.domain-notice {
  display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; margin: 0 0 14px;
  font-size: 13.5px; line-height: 1.5; color: var(--text-2);
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent); border-radius: 12px;
}
.domain-notice p { margin: 0; }
.domain-notice .row-ico { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); border-color: color-mix(in srgb, var(--accent) 25%, transparent); }
.domain-notice.is-mock { background: color-mix(in srgb, var(--warn) 12%, transparent); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.domain-notice.is-mock .row-ico { color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, transparent); border-color: color-mix(in srgb, var(--warn) 28%, transparent); }
.domain-notice.is-plain { display: block; padding: 12px 14px; margin: 14px 0 0; font-size: 13px; color: var(--text-3); background: rgba(255, 255, 255, .03); border-color: var(--line-soft); }
:root[data-theme='light'] .domain-notice.is-plain { background: rgba(50, 55, 30, .04); }

.domain-list { display: grid; gap: 12px; }
/* the settings pane spaces sibling cards by margin; inside the list the grid gap is the spacing */
.settings-content .domain-list > .card + .card { margin-top: 0; }
.domain-empty { min-height: 0; padding: 36px 20px !important; gap: 10px; border-style: dashed !important; }
.domain-empty .domain-symbol { width: 56px; height: 56px; border-radius: 16px; margin-bottom: 4px; }
.domain-empty .domain-symbol svg { width: 26px; height: 26px; }
.domain-empty h3 { font-size: 16px; color: var(--text); }
.domain-empty p { max-width: 42ch; }
.domain-empty .btn { margin-top: 8px; }
.domain-empty .btn svg { width: 16px; height: 16px; opacity: 1; }

.domain-card { padding: 0 !important; overflow: hidden; }
.domain-card summary { display: flex; align-items: center; gap: 14px; padding: 16px 18px; cursor: pointer; list-style: none; }
.domain-card summary::-webkit-details-marker { display: none; }
.domain-card summary:hover { background: rgba(255, 255, 255, .03); }
.domain-symbol { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .08); color: var(--text-2); flex: none; }
.domain-symbol svg { width: 20px; height: 20px; }
.domain-symbol.is-ok { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 30%, transparent); color: var(--accent); }
.domain-symbol.is-part { background: color-mix(in srgb, var(--warn) 14%, transparent); border-color: color-mix(in srgb, var(--warn) 30%, transparent); color: var(--warn); }
.domain-symbol.is-bad { background: var(--danger-soft); border-color: rgba(237, 66, 69, .3); color: var(--danger); }
:root[data-theme='light'] .domain-symbol { background: rgba(50, 55, 30, .05); border-color: rgba(50, 55, 30, .08); }
.domain-name { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; overflow-wrap: anywhere; }
.domain-name b { font-size: 16px; font-weight: 600; letter-spacing: -.005em; }
.domain-name .pill { align-self: flex-start; }
.domain-chevron { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; color: var(--text-4); transition: transform .15s ease; }
.domain-chevron svg { width: 18px; height: 18px; }
.domain-card[open] .domain-chevron { transform: rotate(180deg); }
.domain-detail { border-top: 1px solid var(--line-soft); padding: 18px; }
.domain-section { margin-top: 18px; }
.domain-section:first-child { margin-top: 0; }
.domain-section h3 { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.domain-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.domain-section-head h3 { margin-bottom: 0; }
.btn.btn-small { padding: 6px 10px; font-size: 13px; }
.domain-section .card-sub { font-size: 13.5px; color: var(--text-3); line-height: 1.5; }
.domain-switches { padding: 0 16px; border-radius: 12px; background: rgba(255, 255, 255, .03); border: 1px solid var(--line-soft); }
.domain-switches .card-row { padding: 14px 0; }
:root[data-theme='light'] .domain-switches { background: rgba(50, 55, 30, .03); }

.dns-records { display: grid; gap: 12px; margin: 16px 0 0; }
.dns-step { padding: 14px 16px; border-radius: 12px; background: rgba(255, 255, 255, .03); border: 1px solid var(--line-soft); }
:root[data-theme='light'] .dns-step { background: rgba(50, 55, 30, .03); }
.dns-step.is-found { border-color: color-mix(in srgb, var(--accent) 28%, transparent); }
.dns-step-head { display: flex; gap: 12px; align-items: flex-start; }
.dns-step-n { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--primary); color: var(--accent-ink); font-size: 12px; font-weight: 700; flex: none; }
.dns-step-n svg { width: 14px; height: 14px; }
.dns-step.is-found .dns-step-n { background: var(--accent); }
.dns-step-title { flex: 1; min-width: 0; }
.dns-step-title b { display: block; font-size: 14px; }
.dns-step-title p { margin: 3px 0 0; font-size: 12.5px; color: var(--text-3); line-height: 1.5; }
.dns-step .pill { flex: none; margin-top: 2px; }
.dns-record { margin-top: 12px; padding: 4px 12px 8px; border-radius: 10px; background: rgba(0, 0, 0, .18); border: 1px solid var(--line-soft); }
:root[data-theme='light'] .dns-record { background: rgba(255, 255, 255, .6); }
.dns-type { display: inline-block; margin: 8px 0 2px; font: 600 11.5px var(--mono); padding: 3px 8px; background: var(--accent-soft); border-radius: 5px; color: var(--accent); }
.dns-field { display: grid; grid-template-columns: 56px minmax(0, 1fr) 30px; align-items: center; gap: 10px; padding: 4px 0; }
.dns-field > span { font-size: 12.5px; color: var(--text-4); }
.dns-field code { font: 12.5px/1.6 var(--mono); overflow-wrap: anywhere; user-select: all; }
.dns-field .icon-btn { width: 28px; height: 28px; }
.dns-step .hint { margin: 10px 0 0; font-size: 12.5px; color: var(--text-4); line-height: 1.5; }
.domains .hint, .domain-detail > .hint { color: var(--text-4); font-size: 12.5px; line-height: 1.5; margin: 12px 0 0; }
.domain-result { font-size: 13.5px; color: var(--text-2); margin: 12px 0 0; }
.domain-result:empty { display: none; }
.domain-actions { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
/* Removing is the quiet action: plain text until hovered, then the danger tint. */
.btn.btn-remove { background: transparent; border-color: transparent; color: var(--text-3); box-shadow: none; }
.btn.btn-remove:hover, .btn.btn-remove:focus-visible { color: var(--danger); background: rgba(237, 66, 69, .1); }

.domain-queue { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: 12px; background: rgba(255, 255, 255, .03); border: 1px solid var(--line-soft); font-size: 13.5px; }
.domain-queue svg { flex: none; margin-top: 2px; color: var(--text-3); width: 18px; height: 18px; }
.domain-queue b { display: block; font-size: 14px; }
.domain-queue span { display: block; color: var(--text-3); line-height: 1.5; }
.domain-queue small { display: block; color: var(--text-4); margin-top: 4px; }
.domain-queue.is-expired { background: var(--danger-soft); border-color: rgba(237, 66, 69, .3); }
.domain-queue.is-expired svg { color: var(--danger); }
.domain-queue.is-ok { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 25%, transparent); }
.domain-queue.is-ok svg { color: var(--accent); }

/* The add dialog. */
.domain-dialog { width: min(480px, 100%); }
.domain-dialog .card-row.is-boxed { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin: 4px 0 14px; border-radius: 12px; background: rgba(255, 255, 255, .03); border: 1px solid var(--line-soft); }
.domain-dialog .card-row.is-boxed .t { flex: 1; min-width: 0; }
.domain-dialog .card-row.is-boxed .t b { display: block; font-size: 14px; font-weight: 600; }
.domain-dialog .card-row.is-boxed .t span { display: block; font-size: 12.5px; color: var(--text-3); line-height: 1.45; margin-top: 2px; }
.domain-dialog .auth-alert { margin: 0; }
:root[data-theme='light'] .domain-dialog .card-row.is-boxed { background: rgba(50, 55, 30, .04); }

@media (max-width: 540px) {
  .domain-heading { flex-wrap: wrap; }
  .domain-detail { padding: 14px; }
  .dns-field { grid-template-columns: minmax(0, 1fr) 30px; gap: 4px; }
  .dns-field > span { grid-column: 1 / -1; }
}

/* The SPF merge under the record: the found record, one line per mechanism with its switch. */
.spf-merge { margin-top: 10px; display: grid; gap: 8px; }
.spf-merge code { font-family: var(--font-mono, ui-monospace, monospace); font-size: 12.5px; }
/* The record is already published but no check has seen it yet: a notice
   with a title, what that means and the check, not a loose green line. */
.spf-merge .domain-notice { margin: 0; }
.domain-notice-body { display: grid; gap: 4px; min-width: 0; }
.domain-notice-body b { font-size: 13.5px; color: var(--text); }
.domain-notice-body p { color: var(--text-3); }
.domain-notice-body .btn { justify-self: start; margin-top: 6px; }
.spf-merge .hint.is-warn { color: var(--warn, #d9a441); }
.spf-terms { display: grid; gap: 6px; padding: 10px 12px; border-radius: 10px; background: var(--hover); }
.spf-term { display: flex; align-items: center; gap: 10px; font-size: 13px; cursor: pointer; }
.spf-term span { color: var(--text-3); }
.spf-term input { accent-color: var(--primary); }

/* The check result: one line per record, found or still missing. */
.dns-check { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.dns-check li { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--hover); }
.dns-check li svg { flex: none; width: 16px; height: 16px; margin-top: 2px; }
.dns-check li.is-ok svg { color: var(--ok, var(--accent)); }
.dns-check li.is-wait svg { color: var(--text-3); }
.dns-check li b { display: block; font-size: 13.5px; }
.dns-check li span { font-size: 12.5px; color: var(--text-3); overflow-wrap: anywhere; }
.domain-notice.is-ok { color: var(--ok, var(--accent)); }

/* A verified step folds to its head; the head is the toggle. */
.dns-step.is-found .dns-step-head { cursor: pointer; }
.dns-step.is-folded > :not(.dns-step-head) { display: none; }
.dns-step.is-folded .dns-step-title p { display: none; }

/* The mode picker in the add dialog: the two cards signup uses. */
.domain-modes { margin: 6px 0 0; }
.domain-modes legend { font-size: 13.5px; font-weight: 600; color: var(--text-2); margin-bottom: 8px; }
.domain-modes .signup-option { align-items: flex-start; }
.domain-modes .signup-option svg { margin-top: 2px; }
.domain-modes .signup-option .pill { height: 18px; margin-left: 6px; padding: 0 7px; font-size: 10.5px; vertical-align: 1px; }
.signup-option.is-disabled { opacity: .6; cursor: not-allowed; }
.signup-option.is-disabled:hover { border-color: var(--input-border); }
.domain-mode-hint { margin: 10px 0 12px !important; }
.domain-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.domain-detail.is-console { padding: 0; }
/* The API email switch on a workspace card: its own strip over the console,
   since it belongs to the domain rather than to any one of its tabs. */
.domain-detail.is-api { padding: 14px 18px; }
.domain-detail.is-api + .domain-detail.is-console { border-top: 1px solid var(--line-soft); }
.domain-notice.is-danger { background: var(--danger-soft); border-color: rgba(237, 66, 69, .3); }
.domain-notice.is-danger .row-ico { color: var(--danger); background: rgba(237, 66, 69, .12); border-color: rgba(237, 66, 69, .28); }

/* The workspace console: a tab strip under the card's head, then the tab. */
.ws-tabs { display: flex; gap: 0; padding: 6px 10px 0; border-bottom: 1px solid var(--line-soft); overflow-x: auto; scrollbar-width: none; }
.ws-tab {
  display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 9px; margin-bottom: -1px;
  border: 0; border-bottom: 2px solid transparent; background: none; color: var(--text-3);
  font-size: 13.5px; font-weight: 500; white-space: nowrap; cursor: pointer;
}
.ws-tab svg { width: 14px; height: 14px; flex: none; }
.ws-tab:hover { color: var(--text); }
.ws-tab.is-active { color: var(--text); border-bottom-color: var(--accent); }
.ws-tab.is-active svg { color: var(--accent); }
.ws-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--hover); color: var(--text-3); font-size: 11px; font-weight: 600; }
.ws-count:empty { display: none; }
.ws-panel { padding: 16px 18px 18px; min-height: 140px; }
.ws-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.ws-head .card-sub { margin: 0; max-width: 62ch; font-size: 13.5px; color: var(--text-3); line-height: 1.5; }
.ws-head .btn, .ws-head select { flex: none; }
.ws-head select.input { width: auto; max-width: 240px; height: 34px; padding-top: 0; padding-bottom: 0; }
.ws-note { color: var(--text-4); }
.ws-loading { display: flex; align-items: center; gap: 10px; padding: 18px 0; color: var(--text-3); font-size: 13.5px; }
.ws-loading .spinner { width: 18px; height: 18px; }
.ws-empty { display: grid; justify-items: center; gap: 8px; padding: 28px 16px; text-align: center; border: 1px dashed var(--line); border-radius: 12px; }
.ws-empty h3 { font-size: 15px; }
.ws-empty p { margin: 0; max-width: 46ch; font-size: 13.5px; color: var(--text-3); line-height: 1.5; }
.ws-empty .btn { margin-top: 6px; }
/* The console table never scrolls sideways: fixed columns, the person takes
   what is left and ellipsizes, so the actions are always in view. */
.ws-table { table-layout: fixed; }
.ws-table th, .ws-table td { max-width: none; white-space: normal; padding: 10px; }
.ws-table th:nth-child(2) { width: 112px; }
.ws-table th:nth-child(3) { width: 88px; }
.ws-table th:nth-child(4) { width: 150px; }
.ws-table th:nth-child(5) { width: 60px; }
.ws-table td.ws-actions { text-align: right; white-space: nowrap; }
.ws-person > div { min-width: 0; }
.ws-person b, .ws-person span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 640px) {
  .ws-table th:nth-child(3), .ws-table td:nth-child(3), .ws-table th:nth-child(4), .ws-table td:nth-child(4) { display: none; }
}
.domain-dialog p.hint { margin: 10px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--text-4); }
.ws-fields .field { align-content: start; }
.ws-table tr.is-invited .ws-person b { color: var(--text-3); font-weight: 500; }
.ws-person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ws-person b { display: block; font-size: 13.5px; font-weight: 600; }
.ws-person span { display: block; font-size: 12.5px; color: var(--text-3); }
.ws-pills { display: flex; gap: 6px; }
.ws-when small { display: block; font-size: 11.5px; color: var(--text-4); }
.ws-list { display: grid; gap: 8px; }
.ws-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: rgba(255, 255, 255, .03); border: 1px solid var(--line-soft); }
:root[data-theme='light'] .ws-row { background: rgba(255, 255, 255, .55); }
.ws-row .t { flex: 1; min-width: 0; }
.ws-row .t b { display: block; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.ws-row .t span { display: block; margin-top: 2px; font-size: 12.5px; color: var(--text-3); }
.ws-row .t small { display: block; margin-top: 3px; font-size: 12px; color: var(--text-4); }
.ws-row.is-closed { opacity: .65; }
.ws-log .t b { font-weight: 500; }
.ws-code { margin-left: 6px; padding: 2px 6px; border-radius: 6px; background: var(--hover); font: 500 12px var(--mono); }
.ws-stack { display: flex; flex: none; }
.ws-stack .avatar + .avatar { margin-left: -8px; box-shadow: 0 0 0 2px var(--bg); }
.settings-content .card-row.ws-name, .ws-name { margin: 0 0 14px; padding: 12px 14px; border: 1px solid var(--line-soft); border-radius: 12px; align-items: flex-start; }
.ws-name-field { display: flex; gap: 8px; max-width: 420px; margin-top: 10px; }
.ws-name-field .input { flex: 1; }
.ws-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ws-facts { display: grid; gap: 6px; margin: 12px 0 0; padding-left: 18px; font-size: 13.5px; color: var(--text-2); line-height: 1.5; }
.ws-addr { height: 44px; }
.ws-addr input { font-size: 15px; }
.ws-members { display: grid; gap: 2px; max-height: 260px; overflow-y: auto; padding: 4px; border-radius: 12px; border: 1px solid var(--line-soft); }
.ws-member { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.ws-member:hover { background: var(--hover); }
.ws-member input { accent-color: var(--primary); }
.ws-member b { display: block; font-size: 13.5px; }
.ws-member small { display: block; font-size: 12px; color: var(--text-3); }
.ws-choices { display: grid; gap: 8px; margin: 0; padding: 0; border: 0; }
.ws-choices legend { margin-bottom: 10px; font-size: 14px; font-weight: 600; }
.ws-choice { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-soft); cursor: pointer; }
.ws-choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.ws-choice input { margin-top: 3px; accent-color: var(--primary); }
.ws-choice b { display: block; font-size: 14px; }
.ws-choice small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--text-3); line-height: 1.45; }
.ws-choice-pick { padding-left: 38px; }
.ws-choice-pick select { max-width: 420px; }
.ws-copy { grid-template-columns: 44px minmax(0, 1fr) 30px; }
@media (max-width: 640px) {
  .ws-panel { padding: 14px; }
  .ws-head { flex-wrap: wrap; }
  .ws-fields { grid-template-columns: 1fr; }
  .ws-row { flex-wrap: wrap; }
  .ws-row .console-actions { width: 100%; justify-content: flex-start; }
  .ws-stack { display: none; }
}

/* Alias domains (docs/mail-platform-api.md § 2c): extra names for one
   verified domain, listed inside its card. Reuses .ws-row, .pill and the
   .dns-record fields of the steps above it. */
.domain-alias-pill svg { width: 13px; height: 13px; }
.domain-aliases .alias-list { margin-top: 12px; }
.domain-aliases .card-sub { max-width: 68ch; }
.alias-item { border-radius: 12px; border: 1px solid var(--line-soft); background: rgba(255, 255, 255, .03); overflow: hidden; }
:root[data-theme='light'] .alias-item { background: rgba(50, 55, 30, .03); }
.alias-item.is-verified { border-color: color-mix(in srgb, var(--accent) 26%, transparent); }
.alias-item .ws-row { border: 0; background: none; border-radius: 0; flex-wrap: wrap; }
.alias-item .row-ico.is-ok { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); border-color: color-mix(in srgb, var(--accent) 25%, transparent); }
.alias-row .t b { font: 600 14px var(--mono); letter-spacing: -.01em; }
.alias-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.alias-none { margin: 0; padding: 14px; text-align: center; border: 1px dashed var(--line); border-radius: 12px; }
.alias-records { padding: 0 14px 14px; display: grid; gap: 10px; }
.alias-records-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.alias-records-head .hint { margin: 0; }
.alias-records .dns-record { margin: 0; }
.alias-item .domain-result:empty { display: none; }
.alias-item .domain-result { margin: 0; padding: 0 14px 12px; font-size: 13px; color: var(--text-3); }
.alias-add { display: flex; gap: 8px; margin-top: 12px; max-width: 460px; }
.alias-add .input { flex: 1; }
.domain-aliases .auth-alert { margin-top: 10px; }
.domain-aliases > .hint:last-child { margin: 10px 0 0; }
@media (max-width: 640px) {
  .alias-add { flex-wrap: wrap; max-width: none; }
  .alias-item .ws-row .console-actions { width: 100%; justify-content: flex-start; }
}
