:root {
  --bg: #fafafa; --surface: #fff; --surface-2: #f5f5f5; --hover: #fafafa;
  --border: #ebebeb; --border-2: #d4d4d4;
  --fg: #171717; --fg-2: #525252; --fg-3: #737373; --fg-4: #a3a3a3;
  --accent: #0070f3; --focus: rgba(0,112,243,.35);
  --ok: #16a34a; --info: #0070f3; --warn: #d97706; --bad: #dc2626; --alt: #7c3aed; --neutral: #a3a3a3;
  --btn-bg: #171717; --btn-fg: #fff; --btn-hover: #383838;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --r: 8px; --r-s: 6px;
  --c-delivered: #2a78d6; --c-opened: #1baf7a; --c-clicked: #4a3aa7; --c-bounced: #e34948; --c-complained: #eda100; --c-failed: #737373; --c-pending: #c7c7c7; --c-total: #171717;
}
* { box-sizing: border-box; }
html { background: var(--bg); color: var(--fg); font: 14px/1.5 var(--sans); scrollbar-gutter: stable; overflow-y: scroll; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { margin: 0; min-height: 100vh; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
code, pre, .mono { font-family: var(--mono); font-size: 12.5px; }
code { padding: .05em .35em; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--border); }
pre { margin: .5rem 0 0; overflow-x: auto; color: var(--fg-2); white-space: pre-wrap; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
a:focus-visible { border-radius: 4px; }

/* top bar */
nav { background: var(--surface); border-bottom: 1px solid var(--border); }
nav .inner { max-width: 86rem; margin: 0 auto; padding: 0 1.5rem; display: flex; align-items: stretch; gap: .25rem; height: 48px; }
nav .brand { display: flex; align-items: center; gap: .5rem; margin-right: 1.25rem; font-weight: 600; letter-spacing: -.01em; }
nav .brand::before { content: ""; width: 16px; height: 16px; border-radius: 3px; background: url(/static/favicon.svg) center/contain no-repeat; }
nav a { display: flex; align-items: center; padding: 0 .625rem; color: var(--fg-3); font-size: 13.5px; position: relative; white-space: nowrap; flex: none; }
nav a:hover { color: var(--fg); text-decoration: none; }
nav a.active { color: var(--fg); }
nav a.active::after { content: ""; position: absolute; left: .625rem; right: .625rem; bottom: -1px; height: 2px; background: var(--fg); border-radius: 2px 2px 0 0; }
main { max-width: 86rem; margin: 0 auto; padding: 2rem 1.5rem 4rem; }

/* headings & text */
h1 { font-size: 22px; font-weight: 600; letter-spacing: -.02em; margin: 0 0 1.25rem; }
h2 { font-size: 13px; font-weight: 500; color: var(--fg-3); margin: 2rem 0 .75rem; }
p { margin: 0 0 1.5rem; color: var(--fg-2); }
h1, h2, td.empty { text-wrap: balance; }
p, small { text-wrap: pretty; }
.muted { color: var(--fg-2); }
.dim { color: var(--fg-3); }
.dimmer { color: var(--fg-4); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.row-between h1 { margin: 0; }
.stack { display: flex; align-items: center; gap: .75rem; }
.wrap { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; }
.mt { margin-top: 1rem; }
.mb { margin-bottom: 1.5rem; }
.right { text-align: right; }
.truncate { display: block; max-width: 30rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
td.subject { max-width: 0; width: 40%; } /* lets the inner span truncate inside an auto-layout table */
td.subject .truncate { max-width: none; }
.break { word-break: break-all; }
.nowrap { white-space: nowrap; }
td.sent, td.col-last, ol.events .small, .card.status p, .pager { font-variant-numeric: tabular-nums; }

/* surfaces */
.card, .table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); }
.card { padding: 1.25rem; }

.meta { display: grid; grid-template-columns: 8.5rem 1fr; row-gap: .5rem; margin: 0; font-size: 13.5px; }
.meta.wide { grid-template-columns: 12rem 1fr; }
.meta dt { color: var(--fg-3); }
.meta dd { margin: 0; color: var(--fg); word-break: break-all; }

/* tables */
.table-wrap { overflow-x: auto; }
table.dns td.type, table.dns td.name { white-space: nowrap; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th { text-align: left; font-weight: 500; font-size: 12px; color: var(--fg-3); padding: .625rem .875rem; background: var(--surface-2); border-bottom: 1px solid var(--border); }
thead th:first-child { border-top-left-radius: var(--r); }
thead th:last-child { border-top-right-radius: var(--r); }
td { padding: .75rem .875rem; vertical-align: middle; }
tbody tr + tr { border-top: 1px solid var(--border); }
tbody tr:hover { background: var(--hover); }
tr.link-row { cursor: pointer; }
tr.link-row:hover { background: var(--surface-2); }
tr.link-row:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
td a:hover { color: var(--accent); }
td.empty { text-align: center; padding: 3rem 1rem; color: var(--fg-3); }

/* status: dot + word */
.badge { display: inline-flex; align-items: center; gap: .4rem; font-size: 12.5px; font-weight: 500; color: var(--fg-2); white-space: nowrap; }
.badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--neutral); flex: none; }
.badge.ok::before { background: var(--ok); }
.badge.info::before { background: var(--info); }
.badge.warn::before { background: var(--warn); }
.badge.bad::before { background: var(--bad); }
.badge.alt::before { background: var(--alt); }
.badge.live::before { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .badge.live::before { animation: none; } }
.pill { display: inline-block; margin-left: .5rem; padding: .05rem .4rem; border-radius: 999px; border: 1px solid var(--border-2); color: var(--fg-3); font-size: 11px; white-space: nowrap; vertical-align: 1px; }
td.to { max-width: 0; width: 35%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } /* long recipient lists get an ellipsis instead of squeezing the subject */

/* alerts */
.alert { margin-bottom: 1rem; padding: .625rem .875rem; border-radius: var(--r); border: 1px solid; font-size: 13.5px; }
.alert.error { border-color: #fecaca; background: #fef2f2; color: #991b1b; }
.alert.success { border-color: #bbf7d0; background: #f0fdf4; color: #166534; padding: 1rem 1.25rem; }
.alert.success p { color: inherit; }

/* forms */
form { margin: 0; }
form.inline { display: flex; gap: .5rem; align-items: flex-start; margin-bottom: 1.5rem; }
form.tracking { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.25rem; padding: .75rem 1.25rem; border-bottom: 1px solid var(--border); font-size: 13.5px; background: var(--surface-2); }
label { display: inline-flex; align-items: center; gap: .4rem; }
input[type=text], input[type=password], input:not([type]), textarea { width: 20rem; padding: .4rem .625rem; border: 1px solid var(--border-2); border-radius: var(--r-s); background: var(--surface); color: var(--fg); font: inherit; font-size: 13.5px; outline: none; transition: border-color .12s, box-shadow .12s; }
input:focus, textarea:focus, select:focus { border-color: var(--fg-3); box-shadow: 0 0 0 3px rgba(0,0,0,.06); outline: none; }
textarea { width: 24rem; font-family: var(--mono); font-size: 12.5px; }
/* custom checkbox: <input type=checkbox> followed by <span class=check> */
input[type=checkbox] { position: absolute; opacity: 0; width: 0; height: 0; }
.check { display: inline-block; width: 16px; height: 16px; flex: none; border: 1px solid var(--border-2); border-radius: 4px; background: var(--surface); position: relative; transition: background .12s, border-color .12s; }
.check::after { content: ""; position: absolute; left: 50%; top: 50%; width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: translate(-50%, -60%) rotate(45deg); opacity: 0; }
input[type=checkbox]:checked + .check { background: var(--fg); border-color: var(--fg); }
input[type=checkbox]:checked + .check::after { opacity: 1; }
input[type=checkbox]:focus-visible + .check { outline: 2px solid var(--focus); outline-offset: 2px; }
label.toggle { position: relative; gap: .5rem; cursor: pointer; }

/* settings card: body with stacked fields, footer with hint + action */
.settings-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); }
.settings-card .body { padding: 1.25rem; display: flex; flex-direction: column; gap: 1.25rem; }
.settings-card footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem 1.25rem; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--r) var(--r); }
.field { display: flex; flex-direction: column; align-items: stretch; gap: .5rem; }
.field > span { font-size: 13px; font-weight: 500; color: var(--fg); }
.field input:not([type]) { width: 100%; max-width: 24rem; }

/* option list: full-width selectable rows */
.option-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--r-s); max-width: 32rem; }
.option-list li + li { border-top: 1px solid var(--border); }
.option-list label { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .625rem .875rem; cursor: pointer; position: relative; font-size: 13.5px; }
.option-list label:hover { background: var(--surface-2); }
.option-list li:first-child label { border-radius: var(--r-s) var(--r-s) 0 0; }
.option-list li:last-child label { border-radius: 0 0 var(--r-s) var(--r-s); }
.option-list label:has(input:checked) { background: #f5f9ff; }
button { white-space: nowrap; padding: .4rem .75rem; border: 1px solid var(--btn-bg); border-radius: var(--r-s); background: var(--btn-bg); color: var(--btn-fg); font: inherit; font-size: 13.5px; font-weight: 500; cursor: pointer; transition: background .12s, border-color .12s, scale .1s; }
button:hover { background: var(--btn-hover); border-color: var(--btn-hover); }
button:active { scale: .96; }
button:disabled { opacity: .5; cursor: default; pointer-events: none; }
button.secondary { background: var(--surface); color: var(--fg); border-color: var(--border-2); font-size: 12.5px; padding: .3rem .625rem; }
button.secondary:hover { background: var(--surface-2); border-color: var(--fg-4); }
button.danger { background: var(--surface); color: var(--bad); border-color: var(--border-2); font-size: 12.5px; padding: .3rem .625rem; }
button.danger:hover { background: #fef2f2; border-color: #fecaca; }
/* press feedback opt-outs: text-like, full-width or clipped controls */
button.copy:active, button.linklike:active, .domain-toggle:active, .seg button:active { scale: none; }
/* tap targets: the visible control stays compact, the pseudo-element takes the clicks */
button, summary.button { position: relative; }
button::before, summary.button::before { content: ""; position: absolute; inset: -6px 0; }
.domain-toggle::before { bottom: 0; } /* wrapped head on narrow screens: keep clear of the actions row */
.keybox { display: block; user-select: all; padding: .625rem .875rem; border-radius: var(--r-s); background: var(--surface); border: 1px solid #bbf7d0; color: var(--fg); word-break: break-all; }

/* timeline */
ol.events { list-style: none; margin: 0; padding: 0 0 0 1.25rem; position: relative; }
ol.events::before { content: ""; position: absolute; left: 3px; top: 10px; bottom: 10px; width: 2px; background: var(--border); }
ol.events li { position: relative; padding: 0 0 1.25rem; }
ol.events li:last-child { padding-bottom: 0; }
ol.events li > div { display: flex; align-items: center; justify-content: space-between; }
ol.events li > div .badge::before { position: absolute; left: -1.25rem; margin-left: 0; box-shadow: 0 0 0 3px var(--bg); }
ol.events li.dim { padding-left: 0; }
.facts { display: grid; grid-template-columns: 7.5rem 1fr; row-gap: .2rem; margin: .375rem 0 0; font-size: 13px; }
.facts:empty { display: none; }
.facts dt { color: var(--fg-3); }
.facts dd { margin: 0; color: var(--fg-2); }
.facts dd a { color: var(--accent); }
.raw-event-trigger { margin-top: .375rem; padding: 0; font-size: 12px; text-decoration: underline; }
.raw-event-dialog { width: min(48rem, calc(100vw - 2rem)); max-height: min(42rem, calc(100vh - 2rem)); padding: 0; overflow: hidden; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); color: var(--fg); box-shadow: 0 0 0 1px rgba(0,0,0,.04), 0 4px 12px rgba(0,0,0,.08), 0 24px 64px rgba(0,0,0,.18); }
.raw-event-dialog::backdrop { background: rgba(0,0,0,.32); }
.raw-event-dialog header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem 1rem; border-bottom: 1px solid var(--border); }
.raw-event-dialog form { margin: 0; }
.raw-event-dialog pre { max-height: min(34rem, calc(100vh - 8rem)); margin: 0; padding: 1rem; overflow: auto; background: var(--surface-2); font-size: 12px; line-height: 1.5; }
.bot-indicator { display: inline-block; width: 1rem; height: 1rem; vertical-align: -.15em; background-color: var(--fg-3); -webkit-mask: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='7' width='16' height='12' rx='2'/%3E%3Cpath d='M12 3v4M8 12h.01M16 12h.01M8 16h8'/%3E%3C/svg%3E"); mask: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='7' width='16' height='12' rx='2'/%3E%3Cpath d='M12 3v4M8 12h.01M16 12h.01M8 16h8'/%3E%3C/svg%3E"); }
.pager { display: flex; align-items: center; gap: 1rem; margin-top: .75rem; font-size: 13px; }
.pager .grow { flex: 1; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: 1rem; }
.toolbar .grow { flex: 1; }
.toolbar input[name=q] { flex: 1; min-width: 12rem; max-width: 26rem; }
td .short { display: none; }
summary.button { display: inline-flex; align-items: center; padding: .4rem .75rem; border-radius: var(--r-s); font-size: 13.5px; font-weight: 500; transition: background .12s, border-color .12s, scale .1s; }
summary.button.secondary { background: var(--surface); color: var(--fg); border: 1px solid var(--border-2); font-size: 12.5px; padding: .3rem .625rem; }
summary.button.secondary:hover { background: var(--surface-2); border-color: var(--fg-4); color: var(--fg); text-decoration: none; }
summary.button:active { scale: .96; }
select { padding: .4rem 1.75rem .4rem .625rem; border: 1px solid var(--border-2); border-radius: var(--r-s); background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23737373' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right .625rem center; color: var(--fg); font: inherit; font-size: 13.5px; appearance: none; -webkit-appearance: none; }
.seg { display: inline-flex; border: 1px solid var(--border-2); border-radius: var(--r-s); background: var(--surface); }
.seg button:first-of-type { border-radius: calc(var(--r-s) - 1px) 0 0 calc(var(--r-s) - 1px); }
.seg button:last-of-type { border-radius: 0 calc(var(--r-s) - 1px) calc(var(--r-s) - 1px) 0; }
.seg button { border: 0; border-radius: 0; background: transparent; color: var(--fg-3); font-size: 13px; font-weight: 500; padding: .4rem .75rem; white-space: nowrap; }
.seg button + button { border-left: 1px solid var(--border); }
.seg button:hover { background: var(--surface-2); color: var(--fg); }
.seg button[aria-pressed=true] { background: var(--fg); color: #fff; }
.pager a { color: var(--fg-3); }
.pager a:hover { color: var(--accent); }
@media (max-width: 640px) {
  nav .inner, main { padding-left: 1rem; padding-right: 1rem; }
  nav .inner { overflow-x: auto; scrollbar-width: none; gap: 0; }
  nav .inner::-webkit-scrollbar { display: none; }
  nav .brand { margin-right: .75rem; }
  nav a { padding: 0 .5rem; }
  main { padding-top: 1.25rem; }
  h1 { font-size: 20px; }
  .meta, .facts { grid-template-columns: 1fr; }
  input[type=text], input[type=password], input:not([type]), textarea { width: 100%; }
  form.inline { flex-direction: column; }
  .toolbar input[name=q] { order: 10; flex-basis: 100%; max-width: none; }
  .toolbar select { flex: 1; min-width: 0; }
  .toolbar .grow { display: none; }
  .toolbar > button { order: 11; }
  .row-between { flex-wrap: wrap; }
  .actions { opacity: 1; }                 /* no hover on touch */
  .col-domain, .col-source, .col-last { display: none; }
  th, td { padding: .5rem .625rem; }
  td .full { display: none; }
  td .short { display: inline; }
  iframe.preview { height: 24rem; }
  .settings-card footer { flex-wrap: wrap; }
  .section { grid-template-columns: 1fr; gap: .75rem; }
  .section .fields { grid-template-columns: 1fr; }
  form.tracking label { width: 100%; }
  form.tracking label input:not([type=checkbox]) { flex: 1; width: auto; }

  /* emails: two-line rows — recipient + status, subject + time */
  table.emails thead { display: none; }
  table.emails, table.emails tbody { display: block; }
  table.emails tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: .75rem; padding: .625rem .875rem; }
  table.emails td { display: block; padding: 0; }
  table.emails td.to { width: auto; max-width: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; grid-column: 1; grid-row: 1; }
  table.emails td.status { grid-column: 2; grid-row: 1; text-align: right; }
  table.emails td.subject { grid-column: 1; grid-row: 2; width: auto; max-width: none; font-size: 13px; }
  table.emails td.subject .truncate { max-width: none; }
  table.emails td.sent { grid-column: 2; grid-row: 2; text-align: right; font-size: 12px; }
  table.emails td.empty { grid-column: 1 / -1; text-align: center; padding: 2rem 0; }

  /* API keys as stacked cards: name + key, domains, actions */
  table.keys thead { display: none; }
  table.keys, table.keys tbody { display: block; }
  table.keys tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: .75rem; padding: .75rem .875rem; }
  table.keys td { display: block; padding: 0; }
  table.keys td.name { grid-column: 1; grid-row: 1; font-weight: 500; }
  table.keys td.key { grid-column: 2; grid-row: 1; text-align: right; }
  table.keys td.domains { grid-column: 1 / -1; grid-row: 2; font-size: 13px; margin-top: .125rem; word-break: break-word; }
  table.keys td.act { grid-column: 1 / -1; grid-row: 3; text-align: left; margin-top: .5rem; }
  table.keys td.col-last { display: block; grid-column: 1 / -1; grid-row: 4; font-size: 12px; margin-top: .375rem; }
  table.keys td.col-last::before { content: "Last used: "; }
  table.keys tr.editing { display: block; }
  table.keys td.empty { grid-column: 1 / -1; }

  /* DNS records as stacked cards */
  table.dns, table.dns tbody, table.dns tr, table.dns td { display: block; }
  table.dns thead { display: none; }
  table.dns tr { padding: .75rem 1rem; position: relative; }
  table.dns tr + tr { border-top: 1px solid var(--border); }
  table.dns tr:hover { background: transparent; }
  table.dns td { padding: 0; }
  table.dns td.type { font-weight: 500; color: var(--fg); }
  table.dns td.status { position: absolute; top: .75rem; right: 1rem; }
  table.dns td.name, table.dns td.value { margin-top: .5rem; }
  table.dns td.name::before, table.dns td.value::before { content: attr(data-label); display: block; font-size: 11px; color: var(--fg-3); margin-bottom: .125rem; }
  table.dns td.value { max-width: none; }
  table.dns td.name button.copy > span { word-break: break-all; }
}

/* key rows */
.actions { display: inline-flex; gap: .5rem; align-items: center; opacity: .55; transition: opacity .12s; }
tr:hover .actions, .actions:focus-within { opacity: 1; }
button.copy { background: transparent; border: 0; color: var(--fg-2); padding: 0; font-weight: 400; display: inline-flex; align-items: flex-start; gap: .45rem; cursor: pointer; text-align: left; font-family: inherit; font-size: inherit; max-width: 100%; white-space: normal; }
button.copy.mono { font-family: var(--mono); font-size: 12.5px; }
button.copy.muted { color: var(--fg-2); }
button.copy > span { min-width: 0; }
button.copy.break > span { word-break: break-all; flex: 1 1 auto; }
button.copy:hover { background: transparent; color: var(--fg); }
button.copy::after { content: ""; flex: none; margin-top: 2px; width: 14px; height: 14px; opacity: 0; background-color: var(--fg-3);
  -webkit-mask: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='9' width='13' height='13' rx='2'/%3E%3Cpath d='M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1'/%3E%3C/svg%3E");
  mask: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='9' width='13' height='13' rx='2'/%3E%3Cpath d='M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1'/%3E%3C/svg%3E");
  transition: opacity .12s, background-color .6s ease; }
tr:hover button.copy::after, button.copy:hover::after, button.copy:focus-visible::after, button.copy.copied::after { opacity: 1; }
button.copy.copied::after { background-color: var(--ok); transition: opacity .12s, background-color 0s; }
tr.editing td { background: var(--surface-2); padding: 1rem 1.25rem; }
.edit-scope .field > span { font-weight: 400; color: var(--fg-2); }
.edit-scope .field > span strong { font-weight: 500; color: var(--fg); }
.nosecret em { font-style: normal; font-family: var(--sans); font-size: 11px; color: var(--fg-4); margin-left: .5rem; opacity: 0; transition: opacity .12s; }
tr:hover .nosecret em { opacity: 1; }

/* public proof page */
body.proof main { max-width: 44rem; padding-top: 3rem; }
body.proof .eyebrow { font-size: 12px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--fg-3); margin: 0 0 .5rem; }
body.proof h1 { font-size: 24px; margin-bottom: 1.5rem; }
body.proof .footnote { margin-top: 2.5rem; line-height: 1.6; }
button.copy-link.copied { border-color: #bbf7d0; background: #f0fdf4; color: #166534; }

/* email content preview */
iframe.preview { display: block; width: 100%; height: 34rem; border: 1px solid var(--border); border-radius: var(--r); background: #fff; }
.seg.small-seg button { padding: .25rem .625rem; font-size: 12px; }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 1rem 1.5rem; }
.field small { color: var(--fg-3); font-size: 12px; line-height: 1.4; }
.settings-card h2 { margin: .5rem 0 0; }
.settings-card .body > h2:first-child { margin-top: 0; }
/* settings form: one row per section — title + blurb left, fields right */
.settings-card .sections { display: flex; flex-direction: column; }
.section { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: 1rem 2.5rem; padding: 1.5rem 1.25rem; border-top: 1px solid var(--border); }
.section:first-child { border-top: 0; }
.section header h2 { margin: 0 0 .25rem; font-size: 14px; font-weight: 600; color: var(--fg); }
.section header p { margin: 0; font-size: 13px; color: var(--fg-3); line-height: 1.45; }
.section .fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem 1.5rem; max-width: 52rem; align-content: start; }
.section .fields > .span { grid-column: 1 / -1; }
.section .fields .field input:not([type]), .section .fields .field select { width: 100%; max-width: none; }
.section .fields .field > .toggle + small { color: var(--fg-3); font-size: 12px; line-height: 1.4; margin-left: 1.5rem; }
.section .fields > .toggle { align-self: center; }
.section .stack-v { display: flex; flex-direction: column; gap: 1.25rem; align-items: flex-start; }
.section .stack-v > form.stack { margin: 0; }
.section .meta.wide { grid-template-columns: 11rem 1fr; }
.aws-status { padding: .75rem 1rem; border: 1px solid var(--border); border-radius: var(--r-s); background: var(--surface-2); align-self: stretch; }
.aws-status .meta { font-size: 13px; }

/* analytics */
.viz .stats { display: flex; flex-wrap: wrap; gap: 1rem 2rem; margin-bottom: 1.25rem; }
.stat { display: flex; flex-direction: column; gap: .125rem; }
.stat-label { font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--fg-3); display: inline-flex; align-items: center; gap: .4rem; }
.stat-label::before, .legend span::before { content: ""; width: 9px; height: 9px; border-radius: 2px; background: var(--c-total); flex: none; }
.stat-value { font-size: 22px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-value small { font-size: 12.5px; font-weight: 400; margin-left: .25rem; }
.legend { display: flex; flex-wrap: wrap; gap: .25rem 1rem; font-size: 12px; color: var(--fg-2); margin-bottom: .5rem; }
.legend span { display: inline-flex; align-items: center; gap: .4rem; }
.swatch-delivered::before { background: var(--c-delivered) !important; }
.swatch-opened::before { background: var(--c-opened) !important; }
.swatch-clicked::before { background: var(--c-clicked) !important; }
.swatch-bounced::before { background: var(--c-bounced) !important; }
.swatch-complained::before { background: var(--c-complained) !important; }
.swatch-failed::before { background: var(--c-failed) !important; }
.swatch-pending::before { background: var(--c-pending) !important; }
svg.chart { display: block; width: 100%; height: auto; overflow: visible; }
svg.chart .grid { stroke: var(--border); stroke-width: 1; }
svg.chart .tick { fill: var(--fg-3); font-size: 11px; font-family: var(--sans); }
svg.chart .bar { transition: opacity .1s; }
svg.chart .bar:hover { opacity: .8; }
svg.chart .bar.delivered { fill: var(--c-delivered); }
svg.chart .bar.opened { fill: var(--c-opened); }
svg.chart .bar.clicked { fill: var(--c-clicked); }
svg.chart .bar.bounced { fill: var(--c-bounced); }
svg.chart .bar.complained { fill: var(--c-complained); }
svg.chart .bar.failed { fill: var(--c-failed); }
svg.chart .bar.pending { fill: var(--c-pending); }
svg.chart .thresh { stroke-width: 1; stroke-dasharray: 3 3; }
svg.chart .thresh.warn { stroke: var(--warn); }
svg.chart .thresh.crit { stroke: var(--bad); }
svg.chart .bar.ok { fill: var(--c-delivered); }
svg.chart .bar.warn { fill: var(--warn); }
svg.chart .bar.bad { fill: var(--bad); }
.rate-value { font-size: 28px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin: .25rem 0; }
details.table-view { margin-top: 1rem; }
details.table-view summary { cursor: pointer; }
table.compact { font-size: 12.5px; }
table.compact th, table.compact td { padding: .375rem .625rem; }
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; }
.chart-wrap { overflow-x: auto; }
@media (max-width: 640px) {
  .viz .stats { gap: .75rem 1.25rem; } .stat-value { font-size: 18px; }
  svg.chart.daily { min-width: 720px; }
  svg.chart.rates { min-width: 420px; }
  .card.rate { overflow-x: auto; }
}

/* login */
body.login { display: grid; place-items: center; background: var(--surface-2); padding: 1.5rem; box-sizing: border-box; }
.login-card { width: 100%; max-width: 20rem; display: flex; flex-direction: column; gap: 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); }
.login-card .brand { display: flex; align-items: center; gap: .5rem; font-weight: 600; letter-spacing: -.01em; margin-bottom: .25rem; }
.login-card .brand::before { content: ""; width: 20px; height: 20px; border-radius: 4px; background: url(/static/favicon.svg) center/contain no-repeat; }
.login-card input[type=password], .login-card input:not([type]) { width: 100%; box-sizing: border-box; }
.login-card label { font-size: 12.5px; color: var(--fg-3); }
.login-card .error { margin: 0; color: var(--bad); }
.login-card button { width: 100%; }
nav .signout { margin-left: auto; display: flex; align-items: stretch; }
button.linklike { background: none; border: 0; padding: 0 .625rem; color: var(--fg-3); font-weight: 400; font-size: 13.5px; }
button.linklike:hover { background: none; color: var(--fg); }

/* popover (details-based) */
details.popover { position: relative; }
details.popover > summary { list-style: none; display: inline-flex; cursor: pointer; }
details.popover > summary::-webkit-details-marker { display: none; }
details.popover .popover-body { position: absolute; right: 0; top: calc(100% + .375rem); z-index: 10; display: flex; flex-direction: column; gap: .5rem; min-width: 22rem; padding: .875rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: 0 0 0 1px rgba(0,0,0,.03), 0 2px 6px rgba(0,0,0,.05), 0 12px 32px rgba(0,0,0,.1); }
details.popover .popover-body input { width: 100%; box-sizing: border-box; }

/* passkeys */
.passkeys form.inline { margin-bottom: 0; align-items: center; }
.passkey-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .625rem .875rem; font-size: 13.5px; }
.login-card .or { display: flex; align-items: center; gap: .75rem; color: var(--fg-4); font-size: 12px; }
.login-card .or::before, .login-card .or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.login-card button.secondary { width: 100%; }

/* email detail: meta card and events side by side on wide screens */
.detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.detail .meta { margin: 0; }
.detail-events h2 { margin-top: 0; }
@media (max-width: 900px) { .detail { grid-template-columns: minmax(0, 1fr); } .detail-events h2 { margin-top: .5rem; } }

/* domains: one collapsible row per domain */
.domains { display: flex; flex-direction: column; gap: .5rem; }
.domain { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); }
.domain-head { display: flex; align-items: center; gap: 1rem; padding: .625rem .875rem .625rem .5rem; font-size: 13.5px; }
.domain-toggle { display: flex; align-items: center; gap: .5rem; flex: 1; min-width: 0; background: none; border: 0; padding: .25rem .375rem; color: var(--fg); font-weight: 500; text-align: left; cursor: pointer; border-radius: var(--r-s); }
.domain-toggle:hover { background: var(--surface-2); }
.domain-toggle .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.domain-toggle .region { font-weight: 400; }
.chev { width: 6px; height: 6px; border: solid var(--fg-3); border-width: 0 1.5px 1.5px 0; transform: rotate(-45deg); transition: transform .12s; flex: none; margin: 0 .25rem 0 .125rem; }
.domain.open .chev { transform: rotate(45deg); }
.dots { display: inline-flex; align-items: center; gap: .3rem .75rem; color: var(--fg-3); font-size: 12.5px; white-space: nowrap; margin-right: .5rem; }
.dots .dot { margin-right: -.4rem; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--fg-4); }
.dot.ok { background: var(--ok); }
.dot.warn { background: var(--warn); }
.dot.bad { background: var(--bad); }
.domain-head .actions { opacity: 1; display: inline-flex; gap: .5rem; align-items: center; }
/* both labels share one grid cell so the button keeps the wider width while busy */
.domain-head .actions button { display: inline-grid; justify-items: center; }
.domain-head .actions button > span { grid-area: 1 / 1; }
.domain-head .busy, .domain-head button[disabled] .idle { visibility: hidden; }
.domain-head button[disabled] .busy { visibility: visible; }
.domain-body { display: none; border-top: 1px solid var(--border); }
.domain.open .domain-body { display: block; }
.domain-body form.tracking { border-bottom: 1px solid var(--border); }
.domain-body table.dns { border-radius: 0 0 var(--r) var(--r); }
.notice.ok { color: var(--ok); }
.notice.error { color: var(--bad); }
@media (max-width: 900px) {
  .domain-head { flex-wrap: wrap; gap: .5rem .75rem; }
  .domain-toggle { width: 100%; flex: none; }
  .domain-head .actions { margin-left: auto; }
}

/* rows removed via htmx: the delete button marks its target so only that fades */
.removing { opacity: 0; transition: opacity .15s; }

/* domain reputation panel */
.reputation { padding: .625rem 1.25rem; border-bottom: 1px solid var(--border); font-size: 13px; background: var(--surface); }
.rep-grid { display: flex; flex-wrap: wrap; gap: .375rem 1.25rem; }
.rep-item { display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap; }

/* api key limits line */
.limits { margin-top: .25rem; display: flex; align-items: center; gap: .4rem; }
button.linklike.tiny { font-size: 11.5px; padding: 0; text-decoration: underline; }

/* domain settings: Reply-To rewrite list */
form.tracking details.rewrite { width: 100%; order: 10; }
form.tracking details.rewrite summary { cursor: pointer; color: var(--fg-2); font-size: 13px; user-select: none; list-style: none; display: inline-flex; align-items: center; }
form.tracking details.rewrite summary::-webkit-details-marker { display: none; }
form.tracking details.rewrite summary .chev { margin-right: .45rem; }
form.tracking details.rewrite[open] summary .chev { transform: rotate(45deg); }
form.tracking details.rewrite label.stack { display: flex; flex-direction: column; align-items: flex-start; gap: .35rem; margin-top: .5rem; width: 100%; max-width: 32rem; }
form.tracking details.rewrite textarea { width: 100%; resize: vertical; }
form.tracking button { order: 20; }
form.tracking .notice, form.tracking .dim { order: 21; }

/* status page */
.checks { list-style: none; margin: 0; padding: 0; }
.checks li { display: grid; grid-template-columns: 8px 9rem 1fr; align-items: baseline; gap: .75rem; padding: .5rem 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.checks li:last-child { border-bottom: 0; }
.checks .dot { position: relative; top: -1px; }
.check-name { font-weight: 500; }
.card.status p { margin: .75rem 0 0; }
