:root {
  color-scheme: light;
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --surface-soft: #f8fafc;
  --surface-muted: #fbfcfe;
  --surface-inset: #eef2f7;
  --header-bg: rgb(255 255 255 / 94%);
  --field-bg: #ffffff;
  --field-disabled: #f8fafc;
  --line-soft: #e9edf5;
  --line: #d9dee8;
  --line-strong: #c7cfdd;
  --text: #111827;
  --text-strong: #0f172a;
  --muted: #667085;
  --muted-strong: #475467;
  --text-inverse: #ffffff;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --accent-soft: #e6fffb;
  --accent-muted: #f0fdfa;
  --accent-line: #99f6e4;
  --danger: #b42318;
  --danger-bg: #fef3f2;
  --danger-line: #fecdca;
  --warning: #93370d;
  --warning-bg: #fffaeb;
  --warning-line: #fedf89;
  --success: #067647;
  --success-bg: #ecfdf3;
  --success-line: #abefc6;
  --info: #1d4ed8;
  --info-bg: #eff6ff;
  --info-line: #bfdbfe;
  --focus-ring: rgb(15 118 110 / 12%);
  --shadow-soft: 0 1px 2px rgb(16 24 40 / 5%);
  --shadow-card: 0 12px 28px rgb(16 24 40 / 12%);
  --shadow-popover: 0 24px 56px rgb(16 24 40 / 24%);
  --backdrop: rgb(17 24 39 / 46%);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #101816;
    --surface: #18201d;
    --surface-raised: #1d2724;
    --surface-soft: #202c28;
    --surface-muted: #151d1a;
    --surface-inset: #0e1513;
    --header-bg: rgb(24 32 29 / 92%);
    --field-bg: #121a17;
    --field-disabled: #1a2420;
    --line-soft: #25342f;
    --line: #30413a;
    --line-strong: #466057;
    --text: #edf5f1;
    --text-strong: #ffffff;
    --muted: #a8b8b1;
    --muted-strong: #c7d4cf;
    --text-inverse: #07110e;
    --accent: #5eead4;
    --accent-strong: #2dd4bf;
    --accent-soft: #123a35;
    --accent-muted: #0f2d29;
    --accent-line: #1f766d;
    --danger: #ffb4ab;
    --danger-bg: #3d1f1d;
    --danger-line: #7f3029;
    --warning: #fcd59f;
    --warning-bg: #3a2a13;
    --warning-line: #8a5a19;
    --success: #86efac;
    --success-bg: #12351f;
    --success-line: #277247;
    --info: #93c5fd;
    --info-bg: #152b4f;
    --info-line: #2f5f9f;
    --focus-ring: rgb(94 234 212 / 22%);
    --shadow-soft: 0 1px 2px rgb(0 0 0 / 28%);
    --shadow-card: 0 16px 34px rgb(0 0 0 / 32%);
    --shadow-popover: 0 24px 56px rgb(0 0 0 / 44%);
    --backdrop: rgb(0 0 0 / 58%);
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  letter-spacing: 0;
}

body:not([data-auth-ready="true"]) .app-header,
body:not([data-auth-ready="true"]) .app-main {
  visibility: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--header-bg);
  border-bottom: 1px solid var(--line-strong);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(12px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  height: 64px;
  padding: 0 24px;
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-weight: 700;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
}

.brand-mark img {
  display: block;
  width: 36px;
  height: 36px;
}

.brand-name {
  white-space: nowrap;
}

.brand-name span {
  color: var(--accent);
}

.header-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-width: 0;
}

.domain-select-label {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  border: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  border: 0;
  white-space: nowrap;
}

.domain-select {
  width: clamp(96px, var(--domain-select-width, 160px), min(260px, 32vw));
  height: 36px;
  padding: 0 24px 0 4px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
}

.domain-select:disabled {
  cursor: not-allowed;
  color: var(--muted);
  background: transparent;
}

.domain-select:focus {
  background: var(--surface-soft);
  box-shadow: 0 0 0 3px var(--focus-ring);
  outline: none;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 84px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.status-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
}

.subscription-status-badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  max-width: 132px;
  padding: 0 7px;
  border: 1px solid var(--success-line);
  border-radius: 999px;
  background: var(--success-bg);
  color: var(--success);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.subscription-status-badge[data-status="none"] {
  border-color: var(--line-strong);
  background: var(--surface-inset);
  color: var(--muted-strong);
}

.subscription-status-badge[data-status="trialing"] {
  border-color: var(--info-line);
  background: var(--info-bg);
  color: var(--info);
}

.subscription-status-badge[data-status="past_due"],
.subscription-status-badge[data-status="unpaid"],
.subscription-status-badge[data-status="incomplete"],
.subscription-status-badge[data-status="incomplete_expired"] {
  border-color: var(--warning-line);
  background: var(--warning-bg);
  color: var(--warning);
}

.subscription-status-badge[data-status="canceled"],
.subscription-status-badge[data-status="paused"] {
  border-color: var(--danger-line);
  background: var(--danger-bg);
  color: var(--danger);
}

.icon-text-button {
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.icon-text-button:hover:not(:disabled) {
  border-color: var(--line-strong);
  color: var(--text);
}

.icon-text-button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.app-main {
  width: 100%;
  min-height: calc(100vh - 64px);
  margin: 0;
  padding: 0;
}

.dashboard-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: calc(100vh - 64px);
}

.sidebar {
  position: sticky;
  top: 64px;
  align-self: start;
  min-height: calc(100vh - 64px);
  padding: 18px 12px;
  border-right: 1px solid var(--line-strong);
  background: var(--surface-muted);
}

.sidebar-nav {
  display: grid;
  gap: 4px;
}

.sidebar-link {
  position: relative;
  width: 100%;
  min-height: 38px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  text-align: left;
}

.sidebar-link.has-domain-attention {
  padding-right: 28px;
}

.sidebar-link.has-domain-attention::before {
  content: "";
  position: absolute;
  top: 50%;
  right: 12px;
  width: 8px;
  height: 8px;
  border: 2px solid var(--surface-muted);
  border-radius: 999px;
  background: var(--danger);
  transform: translateY(-50%);
}

.sidebar-link:hover {
  background: var(--surface-inset);
  color: var(--text);
}

.sidebar-link:focus {
  box-shadow: 0 0 0 3px var(--focus-ring);
  outline: none;
}

.sidebar-link.is-active {
  background: var(--accent-muted);
  color: var(--accent-strong);
}

.sidebar-link.is-locked {
  color: var(--muted);
  opacity: 0.74;
}

.sidebar-link.is-locked::after {
  content: "Upgrade";
  float: right;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.sidebar-divider {
  display: block;
  height: 1px;
  margin: 10px 8px;
  background: var(--line);
}

.workspace {
  min-width: 0;
  padding: 28px 32px;
}

.dashboard-section {
  width: 100%;
  min-height: calc(100vh - 112px);
  max-width: 1120px;
  margin: 0 auto;
}

.dashboard-section[hidden] {
  display: none;
}

.dashboard-section:not(.is-locked) > .upgrade-panel,
.dashboard-section.is-locked > .gated-content {
  display: none;
}

.home-section {
  padding: 0 0 24px;
}

.home-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.home-toolbar h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
}

.home-toolbar p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.section-header h1,
.upgrade-panel h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
}

.section-header p,
.upgrade-panel p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.placeholder-panel,
.upgrade-panel {
  margin-top: 22px;
  max-width: 680px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
}

.placeholder-panel h2 {
  margin: 0;
  font-size: 18px;
}

.placeholder-panel p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.billing-overview {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1.1fr);
  gap: 16px;
  margin-top: 14px;
}

.billing-plan-panel,
.billing-status-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
}

.billing-plan-panel {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 22px;
}

.billing-plan-panel h2 {
  margin: 0;
  font-size: 30px;
  line-height: 1.15;
}

.billing-plan-panel p {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.panel-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.billing-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.billing-actions span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.billing-status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.billing-status-grid article {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 124px;
  padding: 18px;
}

.billing-status-grid strong {
  font-size: 18px;
  line-height: 1.25;
}

.billing-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.billing-catalog {
  margin-top: 28px;
}

.send-email-workspace {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.send-email-panel {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
}

.send-email-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.send-email-panel h2 {
  margin: 4px 0 0;
  font-size: 20px;
  line-height: 1.25;
}

.send-email-panel-label {
  text-transform: none;
}

.smtp-note,
.smtp-status-note {
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted-strong);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
}

.smtp-status-note.is-success {
  border-color: var(--success-line);
  background: var(--success-bg);
  color: var(--success);
}

.smtp-status-note.is-warning {
  border-color: var(--warning-line);
  background: var(--warning-bg);
  color: var(--warning);
}

.gmail-steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.gmail-step {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.gmail-step h3 {
  margin: 0 0 10px;
  font-size: 15px;
  line-height: 1.3;
}

.gmail-step ol {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 20px;
  color: var(--muted-strong);
  font-size: 14px;
  line-height: 1.45;
}

.smtp-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.smtp-settings-grid div {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
}

.smtp-settings-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.smtp-settings-grid code {
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.send-email-context {
  margin-top: 14px;
}

.send-test-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.send-email-content-field,
.send-email-attachment-field,
.send-email-actions {
  grid-column: 1 / -1;
}

.format-toggle {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(260px, 100%);
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-inset);
}

.format-toggle-button {
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
}

.format-toggle-button.is-active {
  background: var(--surface-raised);
  color: var(--accent-strong);
  box-shadow: var(--shadow-soft);
}

.format-toggle-button:focus {
  box-shadow: 0 0 0 3px var(--focus-ring);
  outline: none;
}

.send-email-attachment-field p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.send-email-attachment-field input[type="file"] {
  height: auto;
  padding: 7px;
  color: var(--muted);
}

.send-email-attachment-field input[type="file"]::file-selector-button {
  height: 30px;
  margin-right: 12px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface-raised);
  color: var(--accent-strong);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
}

.send-email-attachment-field input[type="file"]::file-selector-button:hover {
  border-color: var(--accent-line);
  background: var(--accent-muted);
}

.attachment-preview {
  display: grid;
  gap: 6px;
}

.attachment-preview:empty {
  display: none;
}

.attachment-preview-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted-strong);
  font-size: 13px;
  line-height: 1.35;
}

.attachment-preview-name {
  min-width: 0;
  overflow-wrap: anywhere;
}

.attachment-preview-item strong {
  flex: 0 0 auto;
  color: var(--text);
  font-weight: 800;
}

.attachment-remove-button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted-strong);
  cursor: pointer;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}

.attachment-remove-button:hover,
.attachment-remove-button:focus-visible {
  border-color: var(--danger);
  color: var(--danger);
}

.api-workspace {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.api-key-panel {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
}

.api-key-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.api-key-panel h2 {
  margin: 4px 0 0;
  font-size: 20px;
  line-height: 1.25;
}

.api-domain-context {
  margin-top: 14px;
}

.api-key-display {
  display: grid;
  gap: 7px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.api-key-display span,
.api-key-secret-panel label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.api-key-display code {
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.api-key-secret-panel {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--success-line);
  border-radius: 8px;
  background: var(--success-bg);
}

.api-key-secret-panel[hidden] {
  display: none;
}

.api-key-secret-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.copyable-api-key {
  position: relative;
  min-width: 0;
  border-radius: 8px;
  cursor: pointer;
}

.copyable-api-key:focus {
  box-shadow: 0 0 0 3px var(--focus-ring);
  outline: none;
}

.api-key-secret-row input {
  width: 100%;
  min-width: 0;
  height: 38px;
  padding: 0 64px 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--field-bg);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}

.api-key-secret-row input:focus {
  box-shadow: none;
  outline: none;
}

.copyable-api-key:focus input,
.copyable-api-key:hover input {
  border-color: var(--accent);
}

.copy-tooltip {
  position: absolute;
  top: 50%;
  right: 8px;
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border-radius: 6px;
  background: var(--text);
  color: var(--text-inverse);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transform: translateY(calc(-50% + 2px));
  transition: opacity 140ms ease, transform 140ms ease;
}

.copyable-api-key:hover .copy-tooltip,
.copyable-api-key:focus .copy-tooltip,
.copyable-api-key.is-copied .copy-tooltip {
  opacity: 1;
  transform: translateY(-50%);
}

.api-key-secret-panel p {
  margin: 0;
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

.api-key-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}

.api-quickstart-panel {
  display: grid;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
}

.api-quickstart-panel h2 {
  margin: 4px 0 0;
  font-size: 20px;
  line-height: 1.25;
}

.api-quickstart-panel p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.api-auth-line {
  display: grid;
  gap: 7px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.api-auth-line span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.api-auth-line code {
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.api-example-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.api-example-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.api-example-card h3 {
  margin: 0;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-raised);
  font-size: 15px;
  line-height: 1.3;
}

.api-example-card pre {
  margin: 0;
  padding: 14px;
  overflow-x: auto;
  color: var(--muted-strong);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
}

.api-example-card code {
  font: inherit;
  white-space: pre;
}

.billing-plan-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.billing-plan-card {
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
}

.billing-plan-card.is-current {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.billing-plan-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.billing-plan-card h2 {
  margin: 4px 0 0;
  font-size: 22px;
  line-height: 1.15;
}

.billing-plan-card-header strong {
  color: var(--text);
  font-size: 18px;
  line-height: 1.2;
  white-space: nowrap;
}

.billing-plan-card p {
  min-height: 44px;
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.billing-plan-card dl {
  display: grid;
  gap: 9px;
  margin: 0;
}

.billing-plan-card dl div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
}

.billing-plan-card dt {
  color: var(--muted);
  font-weight: 700;
}

.billing-plan-card dd {
  margin: 0;
  font-weight: 800;
}

.billing-plan-card button {
  width: 100%;
  margin-top: 2px;
}

.upgrade-panel .primary-button {
  margin-top: 18px;
}

.primary-button,
.secondary-button,
.danger-button {
  height: 38px;
  padding: 0 14px;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  white-space: nowrap;
}

.primary-button {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--text-inverse);
}

.primary-button:hover:not(:disabled) {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.secondary-button {
  border: 1px solid var(--line-strong);
  background: var(--surface-raised);
  color: var(--muted);
}

.danger-button {
  border: 1px solid var(--danger);
  background: var(--danger);
  color: var(--text-inverse);
}

.danger-button:hover:not(:disabled) {
  border-color: var(--danger);
  background: var(--danger-bg);
  color: var(--danger);
}

.text-action-button {
  height: 38px;
  padding: 0 2px;
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  white-space: nowrap;
}

.text-action-button:hover:not(:disabled) {
  color: var(--accent-strong);
}

.text-action-button:focus {
  border-radius: 8px;
  box-shadow: 0 0 0 3px var(--focus-ring);
  outline: none;
}

.text-action-button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.text-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  line-height: inherit;
  text-align: left;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.text-link:hover:not(:disabled),
.text-link:focus:not(:disabled) {
  color: var(--accent-strong);
}

.text-link:focus {
  border-radius: 4px;
  box-shadow: 0 0 0 3px var(--focus-ring);
  outline: none;
}

.text-link:disabled {
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.65;
}

.primary-button:disabled,
.secondary-button:disabled,
.danger-button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.add-domain-form,
.add-email-account-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 14px;
  margin-top: 22px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.add-domain-form[hidden],
.add-email-account-form[hidden] {
  display: none;
}

.cold-start-domain-panel {
  display: grid;
  gap: 18px;
  margin-top: 22px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
  box-shadow: var(--shadow-soft);
}

.cold-start-domain-panel[hidden] {
  display: none;
}

.cold-start-domain-heading {
  display: grid;
  gap: 5px;
}

.cold-start-domain-heading h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
}

.cold-start-domain-form {
  display: grid;
  gap: 12px;
}

.cold-start-address-row {
  display: grid;
  grid-template-columns: minmax(320px, 1.1fr) auto minmax(240px, 0.9fr);
  gap: 14px;
  align-items: center;
}

.cold-start-custom-address {
  display: grid;
  grid-template-columns: minmax(110px, 0.85fr) auto minmax(160px, 1.15fr);
  align-items: center;
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--field-bg);
}

.cold-start-custom-address span {
  display: grid;
  place-items: center;
  height: 44px;
  padding: 0 8px;
  color: var(--muted);
  font-size: 18px;
  font-weight: 800;
}

.cold-start-custom-address input,
.cold-start-gmail-address input {
  width: 100%;
  min-width: 0;
  height: 44px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 15px;
}

.cold-start-custom-address input {
  padding: 0 11px;
}

.cold-start-custom-address input:first-of-type {
  border-radius: 8px 0 0 8px;
}

.cold-start-custom-address input:last-of-type {
  border-radius: 0 8px 8px 0;
}

.cold-start-gmail-address {
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--field-bg);
}

.cold-start-gmail-address input {
  padding: 0 11px;
  border-radius: 8px;
}

.cold-start-custom-address:focus-within,
.cold-start-gmail-address:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.cold-start-custom-address input:focus,
.cold-start-gmail-address input:focus {
  outline: none;
}

.cold-start-arrow {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--info-line);
  border-radius: 999px;
  background: var(--info-bg);
  color: var(--info);
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
}

.cold-start-domain-message {
  min-height: 20px;
  margin-top: 0;
}

.cold-start-actions {
  display: flex;
  justify-content: flex-end;
}

.add-email-account-form {
  grid-template-columns: minmax(160px, 0.9fr) minmax(180px, 0.9fr) minmax(220px, 1.1fr) auto;
  align-items: end;
}

.account-mode-tabs {
  display: inline-grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(360px, 100%);
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-inset);
}

.account-mode-tab {
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.account-mode-tab:hover {
  color: var(--text);
}

.account-mode-tab:focus {
  box-shadow: 0 0 0 3px var(--focus-ring);
  outline: none;
}

.account-mode-tab.is-active {
  background: var(--surface-raised);
  color: var(--accent-strong);
  box-shadow: var(--shadow-soft);
}

.account-mode-note {
  align-self: end;
  grid-column: 1 / -1;
  min-height: 38px;
  margin: 0;
  padding: 8px 11px;
  border: 1px solid var(--success-line);
  border-radius: 8px;
  background: var(--success-bg);
  color: var(--success);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
}

.account-mode-note[hidden] {
  display: none;
}

.account-feature-status {
  display: flex;
  align-items: end;
  min-height: 38px;
}

.account-feature-status span {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0;
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 800;
}

.account-feature-status[hidden] {
  display: none;
}

.account-upgrade-notice {
  grid-column: 1 / -1;
  margin: 0;
  padding: 0;
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.account-upgrade-notice a,
.account-upgrade-notice button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent-strong);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
}

.account-upgrade-notice a:hover,
.account-upgrade-notice a:focus,
.account-upgrade-notice button:hover,
.account-upgrade-notice button:focus {
  text-decoration: underline;
}

.account-upgrade-notice[hidden] {
  display: none;
}

.field {
  display: grid;
  gap: 8px;
}

.field[hidden] {
  display: none;
}

.add-email-account-form .form-actions {
  grid-column: 1 / -1;
}

.field label {
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--field-bg);
  color: var(--text);
  font: inherit;
}

.field input,
.field select {
  height: 38px;
}

.field textarea {
  min-height: 168px;
  padding: 10px 11px;
  line-height: 1.5;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
  outline: none;
}

.field input:disabled,
.field select:disabled,
.field textarea:disabled {
  cursor: not-allowed;
  background: var(--field-disabled);
  color: var(--muted);
}

.form-actions {
  display: flex;
  align-items: end;
  gap: 8px;
}

.domain-message {
  min-height: 22px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 14px;
}

.domain-message[data-type="error"] {
  color: var(--danger);
}

.domain-message[data-type="success"] {
  color: var(--success);
}

.account-limit-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
}

.account-limit-note[hidden] {
  display: none;
}

.notice-dismiss-button {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 18px;
  line-height: 1;
}

.notice-dismiss-button:hover,
.notice-dismiss-button:focus {
  border-color: var(--line);
  background: var(--surface-raised);
  color: var(--text);
  outline: none;
}

.dns-check-messages {
  display: grid;
  gap: 6px;
  margin: 8px 0 0;
  padding: 10px 12px 10px 28px;
  border: 1px solid var(--warning-line);
  border-radius: 8px;
  background: var(--warning-bg);
  color: var(--warning);
  font-size: 14px;
  line-height: 1.45;
}

.empty-state {
  margin-top: 22px;
  padding: 28px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: var(--surface-muted);
}

.empty-state h2 {
  margin: 0;
  font-size: 18px;
}

.empty-state p {
  max-width: 560px;
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.accounts-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
}

.log-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
}

.log-toolbar-actions {
  display: flex;
  align-items: end;
  gap: 10px;
}

.log-limit-field {
  min-width: 132px;
}

.log-limit-field span {
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 700;
}

.block-email-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
}

.block-email-rule-panel {
  display: grid;
  gap: 18px;
  margin-top: 12px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
}

.block-email-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.block-email-panel-header h2 {
  margin: 4px 0 0;
  font-size: 20px;
  line-height: 1.25;
}

.block-email-tabs {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(280px, 100%);
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-inset);
}

.block-email-tab {
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.block-email-tab:hover {
  color: var(--text);
}

.block-email-tab:focus {
  box-shadow: 0 0 0 3px var(--focus-ring);
  outline: none;
}

.block-email-tab.is-active {
  background: var(--surface-raised);
  color: var(--accent-strong);
  box-shadow: var(--shadow-soft);
}

.block-email-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  align-items: end;
  gap: 12px;
}

.block-email-form[hidden] {
  display: none;
}

.block-email-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.block-email-table-card {
  min-width: 0;
}

.block-email-table {
  min-width: 520px;
}

.block-email-table td:first-child {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 700;
}

.block-email-table th:last-child,
.block-email-table td:last-child {
  width: 112px;
  text-align: right;
}

.toolbar-label {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.accounts-table-card {
  margin-top: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
}

.table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.table-header h2 {
  margin: 0;
  font-size: 18px;
}

.table-header span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.table-scroll {
  overflow-x: auto;
}

.log-table-card .table-scroll {
  max-height: clamp(360px, calc(100vh - 340px), 720px);
  overflow: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.data-table td {
  color: var(--text);
  font-size: 14px;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.log-table {
  min-width: 1120px;
}

.log-table th,
.log-table td {
  white-space: nowrap;
}

.log-table th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.log-table th:first-child,
.log-table td:first-child {
  min-width: 230px;
}

.log-table td:nth-child(4),
.log-table td:nth-child(5),
.log-table td:nth-child(8) {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table-address {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 700;
}

.actions-cell {
  width: 72px;
  text-align: right;
  white-space: nowrap;
}

.row-menu-button {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.row-menu-button:hover,
.row-menu-button[aria-expanded="true"] {
  border-color: var(--line);
  background: var(--surface-soft);
  color: var(--text);
}

.row-menu-button:focus {
  border-color: var(--line);
  box-shadow: 0 0 0 3px var(--focus-ring);
  outline: none;
}

.row-menu-button svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.link-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
}

.link-button:hover:not(:disabled) {
  color: var(--accent-strong);
}

.link-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.link-button.is-danger {
  color: var(--danger);
}

.row-action-menu {
  position: fixed;
  z-index: 45;
  display: grid;
  width: 172px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
  box-shadow: var(--shadow-card);
}

.row-action-menu[hidden] {
  display: none;
}

.row-action-menu button {
  min-height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
}

.row-action-menu button:hover,
.row-action-menu button:focus {
  background: var(--surface-soft);
  outline: none;
}

.row-action-menu button.is-danger {
  color: var(--danger);
}

.row-action-menu button.is-danger:hover,
.row-action-menu button.is-danger:focus {
  background: var(--danger-bg);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: var(--backdrop);
}

.modal-backdrop[hidden] {
  display: none;
}

.stripe-redirect-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--backdrop);
  backdrop-filter: blur(5px);
}

.stripe-redirect-overlay[hidden],
.setup-transition-overlay[hidden] {
  display: none;
}

.stripe-redirect-panel,
.setup-transition-panel {
  display: grid;
  justify-items: center;
  gap: 14px;
  width: min(360px, 100%);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
  box-shadow: var(--shadow-popover);
  text-align: center;
}

.stripe-redirect-panel p,
.setup-transition-panel p {
  margin: 0;
  color: var(--text-strong);
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.45;
}

.stripe-redirect-spinner,
.setup-transition-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid var(--line);
  border-top-color: var(--info);
  border-radius: 50%;
  animation: stripe-redirect-spin 0.8s linear infinite;
}

.setup-transition-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--backdrop);
  backdrop-filter: blur(5px);
}

.setup-transition-spinner {
  border-top-color: var(--accent);
}

@keyframes stripe-redirect-spin {
  to {
    transform: rotate(360deg);
  }
}

.confirm-modal {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 14px;
  width: min(460px, 100%);
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
  box-shadow: var(--shadow-popover);
}

.domain-delete-modal {
  grid-template-columns: 1fr;
}

.domain-delete-modal-content {
  min-width: 0;
}

.modal-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.modal-title-row .modal-warning-mark {
  flex: 0 0 auto;
}

.modal-warning-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
}

.modal-action-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  background: var(--accent-muted);
}

.modal-warning-mark svg {
  width: 32px;
  height: 32px;
  overflow: visible;
}

.modal-action-mark svg {
  width: 22px;
  height: 22px;
}

.modal-action-mark svg path {
  fill: none;
  stroke: var(--accent-strong);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.modal-warning-mark svg path:first-child {
  fill: var(--danger-bg);
  stroke: var(--danger);
  stroke-width: 1.25;
  stroke-linejoin: round;
}

.modal-warning-mark svg path:not(:first-child) {
  fill: none;
  stroke: var(--danger);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.confirm-modal h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.3;
}

.confirm-modal p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.confirm-modal strong {
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.modal-actions {
  display: flex;
  grid-column: 1 / -1;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.modal-detail-panel,
.modal-confirm-panel {
  display: grid;
  gap: 10px;
  min-height: 76px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.modal-detail-panel {
  align-content: center;
}

.modal-detail-panel[hidden],
.modal-confirm-panel[hidden] {
  display: none;
}

.modal-detail-panel p,
.modal-confirm-panel p {
  margin: 0;
  font-size: 13px;
}

.modal-checking-panel {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  color: var(--muted);
}

.modal-loading-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 5px var(--focus-ring);
}

.modal-confirm-panel label {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.modal-confirm-panel input {
  width: 100%;
  height: 38px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--field-bg);
  color: var(--text);
  font: inherit;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  overflow-wrap: anywhere;
}

.modal-confirm-panel input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
  outline: none;
}

.status-badge.is-muted {
  border-color: var(--line);
  background: var(--surface-soft);
  color: var(--muted);
}

.status-badge.is-warning {
  border-color: var(--warning-line);
  background: var(--warning-bg);
  color: var(--warning);
}

.input-with-suffix {
  display: flex;
  align-items: stretch;
}

.input-with-suffix input {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.input-with-suffix span {
  display: inline-flex;
  align-items: center;
  max-width: 45%;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-left: 0;
  border-radius: 0 8px 8px 0;
  background: var(--field-disabled);
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted-strong);
  font-size: 14px;
  font-weight: 700;
}

.checkbox-field[hidden] {
  display: none;
}

.checkbox-field input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.domain-list {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.domain-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
  scroll-margin-top: 82px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.domain-card:focus {
  outline: none;
}

.domain-card.is-highlighted {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.domain-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.domain-card-actions {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.domain-card h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.domain-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--warning-line);
  border-radius: 999px;
  background: var(--warning-bg);
  color: var(--warning);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.status-badge.is-verified {
  border-color: var(--success-line);
  background: var(--success-bg);
  color: var(--success);
}

.direction-badge {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.direction-badge.is-smtp {
  border-color: var(--info-line);
  background: var(--info-bg);
  color: var(--info);
}

.direction-badge.is-forwarding {
  border-color: var(--accent-line);
  background: var(--accent-muted);
  color: var(--accent);
}

.domain-card-body {
  display: grid;
  gap: 16px;
  padding: 16px;
}

.dns-record-group {
  display: grid;
  gap: 10px;
}

.dns-provider-hint {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--info-line);
  border-radius: 8px;
  background: var(--info-bg);
}

.dns-provider-hint p {
  margin: 0;
  color: var(--info);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.45;
}

.dns-provider-hint strong {
  font-weight: 800;
}

.dns-record-group h3 {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.3;
}

.dns-records {
  display: grid;
  gap: 10px;
}

.domain-danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 6px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.domain-danger-zone h3 {
  margin: 0;
  color: var(--danger);
  font-size: 14px;
  line-height: 1.3;
}

.domain-danger-zone p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.dns-record-header {
  padding-top: 0;
  padding-bottom: 0;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.dns-record-header div:last-child {
  text-align: right;
}

.dns-record {
  display: grid;
  grid-template-columns: 72px minmax(150px, 0.3fr) minmax(0, 1fr) 72px 90px;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.dns-record.is-record-verified {
  border-color: var(--success-line);
  background: var(--success-bg);
}

.dns-record.is-record-missing {
  border-color: var(--warning-line);
  background: var(--warning-bg);
}

.dns-copy-field {
  appearance: none;
  position: relative;
  justify-self: start;
  max-width: 100%;
  width: fit-content;
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.dns-copy-field:hover,
.dns-copy-field:focus {
  background: var(--surface-inset);
  outline: none;
}

.dns-copy-field:focus-visible {
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.dns-copy-field::after {
  position: absolute;
  top: -10px;
  right: 6px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  height: 22px;
  min-width: 44px;
  padding: 0 7px;
  border-radius: 6px;
  background: var(--text);
  color: var(--text-inverse);
  content: "Copy";
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 11px;
  font-weight: 800;
  justify-content: center;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transform: translateY(2px);
  transition: opacity 140ms ease, transform 140ms ease;
  white-space: nowrap;
}

.dns-copy-field:hover::after,
.dns-copy-field:focus::after,
.dns-copy-field.is-copied::after {
  opacity: 1;
  transform: translateY(0);
}

.dns-copy-field.is-copied::after {
  content: "Copied";
}

.dns-type {
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 800;
}

.dns-host {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  min-width: 0;
  overflow-wrap: anywhere;
}

.dns-value {
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.dns-priority {
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

.dns-check {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-align: right;
}

.is-record-verified .dns-check {
  display: flex;
  justify-content: flex-end;
  color: var(--success);
}

.dns-verified-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border: 2px solid var(--success-line);
  border-radius: 999px;
  background: var(--success);
}

.is-record-missing .dns-check {
  color: var(--warning);
}

@media (max-width: 680px) {
  .header-inner {
    gap: 12px;
    padding: 0 12px;
  }

  .brand-mark {
    width: 32px;
    height: 32px;
  }

  .brand-mark img {
    width: 32px;
    height: 32px;
  }

  .brand-name {
    font-size: 14px;
  }

  .header-nav {
    justify-content: flex-end;
  }

  .domain-select {
    width: clamp(96px, var(--domain-select-width, 160px), min(42vw, 220px));
  }

  .header-actions {
    display: none;
  }

  .app-main {
    padding: 0;
  }

  .dashboard-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    overflow-x: auto;
    min-height: auto;
    padding: 10px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line-strong);
  }

  .sidebar-nav {
    display: flex;
    gap: 6px;
    min-width: max-content;
  }

  .sidebar-link {
    width: auto;
    min-height: 34px;
    white-space: nowrap;
  }

  .sidebar-divider {
    width: 1px;
    height: 22px;
    margin: 6px 4px;
  }

  .sidebar-link.is-locked::after {
    display: none;
  }

  .workspace {
    padding: 16px 12px;
  }

  .dashboard-section {
    max-width: none;
  }

  .home-section {
    padding: 0 0 18px;
  }

  .home-toolbar {
    display: grid;
  }

  .add-domain-form,
  .add-email-account-form {
    grid-template-columns: 1fr;
  }

  .cold-start-domain-panel {
    padding: 16px;
  }

  .cold-start-domain-heading h2 {
    font-size: 20px;
  }

  .cold-start-address-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .cold-start-custom-address {
    grid-template-columns: minmax(0, 0.9fr) auto minmax(0, 1.1fr);
  }

  .cold-start-arrow {
    justify-self: center;
    width: 34px;
    height: 34px;
  }

  .cold-start-actions {
    justify-content: stretch;
  }

  .cold-start-actions .primary-button {
    width: 100%;
  }

  .form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .dns-record {
    grid-template-columns: 1fr;
  }

  .dns-record-header {
    display: none;
  }

  .dns-record > [data-dns-field-label]::before {
    display: block;
    margin-bottom: 3px;
    color: var(--muted);
    content: attr(data-dns-field-label);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.2;
  }

  .dns-record > .dns-priority:empty {
    display: none;
  }

  .dns-copy-field::after {
    top: 6px;
    right: 8px;
  }

  .accounts-toolbar,
  .block-email-toolbar,
  .block-email-panel-header,
  .log-toolbar,
  .table-header,
  .billing-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .log-toolbar-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .billing-overview,
  .billing-status-grid,
  .billing-detail-grid,
  .billing-plan-grid,
  .block-email-form,
  .block-email-grid,
  .api-example-grid,
  .gmail-steps,
  .send-test-form,
  .smtp-settings-grid {
    grid-template-columns: 1fr;
  }

  .send-email-panel-header,
  .api-key-panel-header,
  .api-key-actions,
  .attachment-preview-item {
    align-items: stretch;
    flex-direction: column;
  }

  .api-key-secret-row {
    grid-template-columns: 1fr;
  }

  .data-table {
    min-width: 760px;
  }

  .log-table {
    min-width: 1120px;
  }

  .domain-card-header,
  .domain-card-actions,
  .domain-danger-zone {
    display: grid;
  }

  .dns-check {
    text-align: left;
  }
}
