/* Maily — postal-office palette: cool envelope paper, navy ink, ultramarine stamp, wax-seal red. */
@font-face { font-family: "Bricolage Grotesque"; font-weight: 600; font-display: swap; src: url("fonts/bricolage-grotesque-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Bricolage Grotesque"; font-weight: 800; font-display: swap; src: url("fonts/bricolage-grotesque-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "Public Sans"; font-weight: 400; font-display: swap; src: url("fonts/public-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Public Sans"; font-weight: 600; font-display: swap; src: url("fonts/public-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 400; font-display: swap; src: url("fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2"); }

:root {
  --paper: #eef1f4;
  --sheet: #ffffff;
  --ink: #1d2340;
  --ink-soft: #5b6480;
  --rule: #d6dbe5;
  --stamp: #3b47d6;
  --stamp-ink: #ffffff;
  --stamp-soft: #e4e7fb;
  --seal: #c2253f;
  --seal-soft: #fbe5e9;
  --ok: #1f7a55;
  --ok-soft: #dff2e8;
  --warn: #9a5b00;
  --warn-soft: #fbefd9;
  --focus: #f0a400;
  --display: "Bricolage Grotesque", "Arial Rounded MT Bold", system-ui, sans-serif;
  --body: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #12162a; --sheet: #1a1f38; --ink: #e7eaf3; --ink-soft: #9aa3c0; --rule: #2c3354;
    --stamp: #7480ff; --stamp-ink: #0f1330; --stamp-soft: #262d5c; --seal: #ff6b81; --seal-soft: #3a1e2a;
    --ok: #5fd39d; --ok-soft: #173327; --warn: #f2b55a; --warn-soft: #36290f;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1rem/1.55 var(--body); }
a { color: var(--stamp); text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--display); font-weight: 800; letter-spacing: -.02em; line-height: 1.1; margin: 0; }
h1 { font-size: 2.25rem; }
h2 { font-size: 1.375rem; font-weight: 600; letter-spacing: -.01em; }
h3 { font-size: 1.0625rem; font-weight: 600; letter-spacing: 0; }
p { margin: 0 0 .75rem; max-width: 68ch; }
code, .mono { font-family: var(--mono); font-size: .8125rem; }
small, .muted { color: var(--ink-soft); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ------------------------------------------------------------------ layout */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--ink); color: #e7eaf3; padding: 1.5rem 1rem; display: flex; flex-direction: column; gap: 2rem; position: sticky; top: 0; height: 100vh; }
@media (prefers-color-scheme: dark) { .side { background: #0c0f1f; } }
.brand { display: flex; align-items: center; gap: .6rem; color: inherit; text-decoration: none; padding: 0 .5rem; }
.brand img { width: 34px; height: 34px; }
.brand span { font: 800 1.6rem/1 var(--display); letter-spacing: -.05em; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { color: #c3c9de; text-decoration: none; padding: .55rem .75rem; border-radius: 8px; font-weight: 600; font-size: .9375rem; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a[aria-current="page"] { background: rgba(116,128,255,.18); color: #fff; box-shadow: inset 3px 0 0 #7480ff; }
.side-foot { margin-top: auto; font-size: .8125rem; color: #8d95b3; padding: 0 .5rem; }
.side-foot form { margin-top: .5rem; }
.linkish { background: none; border: 0; padding: 0; color: #c3c9de; font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: .18em; }
.main { padding: 2.5rem clamp(1rem, 4vw, 3.5rem) 4rem; max-width: 1180px; width: 100%; }
.head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 2rem; }
.head p { margin: .5rem 0 0; color: var(--ink-soft); }
.section { margin-top: 2.5rem; }
.section > h2 { margin-bottom: .875rem; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 1.5rem; }
.grid-2 > * { min-width: 0; }

@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; padding: .875rem 1rem; }
  .nav { flex-direction: row; flex-wrap: wrap; gap: 0; }
  .nav a { padding: .4rem .6rem; font-size: .875rem; }
  .nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 #7480ff; }
  .side-foot { margin: 0 0 0 auto; display: flex; gap: .75rem; align-items: center; }
  .side-foot form { margin: 0; }
  .side-foot .who { display: none; }
  h1 { font-size: 1.75rem; }
  .main { padding-top: 1.5rem; }
}

/* ------------------------------------------------------------------ surfaces */
.sheet { background: var(--sheet); border: 1px solid var(--rule); border-radius: 12px; padding: 1.25rem 1.375rem; }
.sheet + .sheet { margin-top: 1rem; }
.sheet > h3 { margin-bottom: .75rem; }

/* The one signature element: an alias rendered as a perforated postage stamp. */
.stamp {
  display: inline-flex; flex-direction: column; gap: .15rem; max-width: 100%;
  padding: .85rem 1.2rem .95rem; background: var(--stamp); color: var(--stamp-ink);
  border: 7px dotted var(--paper); background-clip: border-box; /* paper-coloured dots read as perforation */
}
.stamp .addr { font: 800 clamp(1.25rem, 3.4vw, 2rem)/1.15 var(--display); letter-spacing: -.02em; overflow-wrap: anywhere; }
.stamp .meta { font-size: .8125rem; opacity: .85; }
.stamp.blocked { background: var(--seal); }
.stamp.small { border-width: 4px; padding: .35rem .7rem .4rem; }
.stamp.small .addr { font-size: .9375rem; font-weight: 600; letter-spacing: 0; }

/* ------------------------------------------------------------------ tables */
.table-wrap { overflow-x: auto; background: var(--sheet); border: 1px solid var(--rule); border-radius: 12px; }
table { border-collapse: collapse; width: 100%; font-size: .9375rem; }
th { text-align: left; font-weight: 600; font-size: .8125rem; color: var(--ink-soft); padding: .7rem 1rem; border-bottom: 1px solid var(--rule); white-space: nowrap; }
td { padding: .75rem 1rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td.num { font-variant-numeric: tabular-nums; text-align: right; }
th.num { text-align: right; }
td a.row-link { font-weight: 600; color: var(--ink); text-decoration: none; }
td a.row-link:hover { color: var(--stamp); text-decoration: underline; }
.empty { padding: 2rem 1rem; text-align: center; color: var(--ink-soft); }

/* ------------------------------------------------------------------ badges */
.badge { display: inline-flex; align-items: center; gap: .35rem; font-size: .8125rem; font-weight: 600; padding: .15rem .55rem; border-radius: 999px; white-space: nowrap; }
.badge::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: currentColor; }
.badge.ok { color: var(--ok); background: var(--ok-soft); }
.badge.warn, .badge.pending, .badge.quarantined { color: var(--warn); background: var(--warn-soft); }
.badge.fail, .badge.blocked, .badge.rejected, .badge.failed { color: var(--seal); background: var(--seal-soft); }
.badge.dropped, .badge.info { color: var(--ink-soft); background: var(--paper); }

/* ------------------------------------------------------------------ forms */
label { display: block; font-weight: 600; font-size: .9375rem; margin-bottom: .35rem; }
.hint { display: block; font-weight: 400; color: var(--ink-soft); font-size: .8125rem; margin-top: .3rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], input[type=date], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--sheet); border: 1.5px solid var(--rule); border-radius: 8px; padding: .6rem .75rem;
}
input:focus, select:focus, textarea:focus { border-color: var(--stamp); outline: none; box-shadow: 0 0 0 3px var(--stamp-soft); }
textarea { min-height: 5rem; resize: vertical; }
.field { margin-bottom: 1rem; }
.inline { display: flex; flex-wrap: wrap; gap: .75rem; align-items: end; }
.inline .field { margin: 0; flex: 1 1 200px; }
.check { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; margin-bottom: .6rem; }
.check input { margin-top: .3rem; accent-color: var(--stamp); width: 1rem; height: 1rem; flex: none; }
.addr-input { display: flex; align-items: stretch; }
.addr-input input { border-radius: 8px 0 0 8px; }
.addr-input select { border-radius: 0 8px 8px 0; border-left: 0; width: auto; max-width: 55%; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; font: 600 .9375rem/1 var(--body); padding: .7rem 1.05rem; border-radius: 8px; border: 1.5px solid transparent; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn.primary { background: var(--stamp); color: var(--stamp-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.quiet { background: transparent; border-color: var(--rule); color: var(--ink); }
.btn.quiet:hover { border-color: var(--ink-soft); }
.btn.danger { background: var(--seal); color: #fff; }
.btn.danger-quiet { background: transparent; color: var(--seal); border-color: var(--seal-soft); }
.btn.small { padding: .4rem .65rem; font-size: .8125rem; }
.btn[aria-busy="true"] { opacity: .65; cursor: progress; }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }

/* ------------------------------------------------------------------ flashes */
.flash { padding: .8rem 1rem; border-radius: 10px; margin-bottom: 1rem; border-left: 4px solid var(--ok); background: var(--ok-soft); font-weight: 600; overflow-wrap: anywhere; }
.flash.error { border-color: var(--seal); background: var(--seal-soft); }

/* ------------------------------------------------------------------ dashboard */
.counts { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); border: 1px solid var(--rule); border-radius: 12px; background: var(--sheet); overflow: hidden; }
.counts div { padding: 1rem 1.25rem; border-right: 1px solid var(--rule); }
.counts div:last-child { border-right: 0; }
.counts strong { display: block; font: 800 2rem/1.1 var(--display); font-variant-numeric: tabular-nums; }
.counts span { font-size: .875rem; color: var(--ink-soft); }
.steps { list-style: none; padding: 0; margin: 0; counter-reset: step; }
.steps li { counter-increment: step; display: flex; gap: .9rem; align-items: center; padding: .7rem 0; border-bottom: 1px dashed var(--rule); }
.steps li:last-child { border-bottom: 0; }
.steps li::before { content: counter(step); flex: none; width: 1.75rem; height: 1.75rem; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .875rem; border: 1.5px solid var(--rule); }
.steps li.done::before { content: "✓"; background: var(--ok); border-color: var(--ok); color: #fff; }
.steps li.done a { color: var(--ink-soft); }

/* ------------------------------------------------------------------ DNS records */
.records { display: flex; flex-direction: column; gap: .75rem; }
.record { background: var(--sheet); border: 1px solid var(--rule); border-left: 4px solid var(--rule); border-radius: 10px; padding: 1rem 1.125rem; }
.record.ok { border-left-color: var(--ok); }
.record.warn, .record.pending { border-left-color: var(--warn); }
.record.fail { border-left-color: var(--seal); }
.record-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; align-items: center; margin-bottom: .7rem; }
.record-head h3 { display: flex; gap: .5rem; align-items: baseline; }
.record-head .opt { font: 400 .8125rem var(--body); color: var(--ink-soft); }
.kv { display: grid; grid-template-columns: 5.5rem 1fr auto; gap: .35rem .75rem; align-items: center; }
.kv dt { font-size: .8125rem; color: var(--ink-soft); }
.kv dd { margin: 0; min-width: 0; }
.kv .val { display: block; font-family: var(--mono); font-size: .8125rem; background: var(--paper); border-radius: 6px; padding: .35rem .5rem; overflow-wrap: anywhere; word-break: break-all; }
.record .msg { margin: .7rem 0 0; font-size: .875rem; }
.record .found { margin: .35rem 0 0; font-size: .8125rem; color: var(--ink-soft); overflow-wrap: anywhere; }
.copy { font: 600 .75rem var(--body); background: transparent; border: 1.5px solid var(--rule); color: var(--ink); border-radius: 6px; padding: .3rem .55rem; cursor: pointer; }
.copy:hover { border-color: var(--stamp); color: var(--stamp); }
.copy.copied { background: var(--ok); border-color: var(--ok); color: #fff; }
@media (max-width: 560px) { .kv { grid-template-columns: 1fr auto; } .kv dt { grid-column: 1 / -1; margin-top: .3rem; } }

.wizard { display: flex; gap: 0; list-style: none; padding: 0; margin: 0 0 1.75rem; border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; background: var(--sheet); }
.wizard li { flex: 1; padding: .7rem 1rem; font-size: .875rem; color: var(--ink-soft); border-right: 1px solid var(--rule); }
.wizard li:last-child { border-right: 0; }
.wizard li b { display: block; color: var(--ink); font-family: var(--display); font-weight: 600; font-size: 1rem; }
.wizard li.current { background: var(--stamp-soft); }
.wizard li.done b::after { content: " ✓"; color: var(--ok); }
@media (max-width: 640px) { .wizard { flex-direction: column; } .wizard li { border-right: 0; border-bottom: 1px solid var(--rule); } }

/* ------------------------------------------------------------------ standalone pages (login, magic) */
.solo { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem; }
.solo-card { width: 100%; max-width: 420px; }
.solo-card.wide { max-width: 640px; }
.solo-brand { display: flex; align-items: center; gap: .6rem; margin-bottom: 1.5rem; text-decoration: none; color: var(--ink); }
.solo-brand img { width: 40px; height: 40px; }
.solo-brand span { font: 800 1.9rem/1 var(--display); letter-spacing: -.05em; }
.solo h1 { font-size: 1.75rem; margin-bottom: .5rem; }
.solo .lead { color: var(--ink-soft); margin-bottom: 1.5rem; }
.qr { display: block; width: 210px; height: 210px; border-radius: 10px; border: 1px solid var(--rule); background: #fff; }
.secret { font-family: var(--mono); font-size: .875rem; letter-spacing: .05em; background: var(--paper); padding: .5rem .7rem; border-radius: 6px; display: inline-block; overflow-wrap: anywhere; }
.code-input { font-family: var(--mono) !important; font-size: 1.5rem !important; letter-spacing: .35em; text-align: center; }

.pager { display: flex; gap: .75rem; justify-content: flex-end; align-items: center; margin-top: 1rem; font-size: .875rem; }
.filters { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1rem; }
.filters input[type=search] { flex: 1 1 240px; width: auto; }
.filters select { width: auto; }
details.danger { margin-top: 2.5rem; }
details.danger summary { cursor: pointer; color: var(--seal); font-weight: 600; }
details.danger .sheet { margin-top: .75rem; border-color: var(--seal-soft); }

@media (prefers-reduced-motion: no-preference) {
  .flash { animation: drop .35s ease-out; }
  @keyframes drop { from { transform: translateY(-6px); opacity: 0; } }
}
.mt { margin-top: 1rem; }
fieldset.bare { border: 0; padding: 0; margin: 0 0 1rem; min-width: 0; }
.legend { font-weight: 600; font-size: .9375rem; margin-bottom: .5rem; padding: 0; }
.head.tight { margin-bottom: .5rem; align-items: center; }

/* ------------------------------------------------------------------ charts */
.chart { margin: 0; background: var(--sheet); border: 1px solid var(--rule); border-radius: 12px; padding: 1rem 1.25rem .85rem; }
.chart svg { display: block; width: 100%; height: 140px; }
.chart .axis { stroke: var(--rule); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart .bar-ok { fill: var(--stamp); }
.chart .bar-blocked { fill: var(--seal); }
.chart .bar-hit { fill: transparent; }
.chart g:hover .bar-hit { fill: var(--stamp-soft); }
.chart figcaption { display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; margin-top: .6rem; font-size: .8125rem; color: var(--ink-soft); }
.chart .key::before { content: ""; display: inline-block; width: .65rem; height: .65rem; border-radius: 2px; margin-right: .4rem; vertical-align: -1px; }
.chart .key.ok::before { background: var(--stamp); }
.chart .key.blocked::before { background: var(--seal); }
.chart .range { margin-left: auto; }

/* ------------------------------------------------------------------ bulk selection */
.bulkbar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin: 0 0 .75rem; }
.bulkbar select { width: auto; }
.bulkbar .count { font-size: .875rem; color: var(--ink-soft); }
td.pick, th.pick { width: 2.25rem; padding-right: 0; }
td.pick input, th.pick input { width: 1rem; height: 1rem; accent-color: var(--stamp); }
.flags { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .3rem; }
.flags .badge { font-weight: 600; }
.bar-inline { display: inline-block; height: .5rem; border-radius: 2px; background: var(--seal); vertical-align: middle; min-width: 2px; }

/* ------------------------------------------------------------------ message viewer */
.msg-headers { display: grid; grid-template-columns: 7rem 1fr; gap: .35rem 1rem; margin: 0; font-size: .9375rem; }
.msg-headers dt { color: var(--ink-soft); }
.msg-headers dd { margin: 0; overflow-wrap: anywhere; }
.msg-text { white-space: pre-wrap; overflow-wrap: anywhere; font: .9375rem/1.55 var(--body); margin: 0; max-height: 70vh; overflow: auto; }
.msg-frame { width: 100%; height: 70vh; border: 1px solid var(--rule); border-radius: 10px; background: #fff; }
.tabs { display: flex; gap: .25rem; margin-bottom: .75rem; }
.tabs a { padding: .45rem .8rem; border-radius: 8px; text-decoration: none; font-weight: 600; font-size: .875rem; color: var(--ink-soft); }
.tabs a[aria-current="page"] { background: var(--stamp-soft); color: var(--ink); }

/* ------------------------------------------------------------------ device links */
.inline-form { display: flex; flex-wrap: wrap; align-items: end; gap: .75rem 1rem; margin-top: 1rem; }
.inline-form .field { margin: 0; flex: 1 1 200px; }
code.wrap { display: block; word-break: break-all; white-space: normal; }
.device-app .sheet h3 + .steps { margin-bottom: 1.25rem; }
.device-alt { margin: 1.25rem 0 .75rem; }

/* ------------------------------------------------------------------ phone (and the home-screen app) */
.tabbar { display: none; }
.menu-list { display: flex; flex-direction: column; background: var(--sheet); border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; }
.menu-list a { display: flex; flex-direction: column; gap: .15rem; padding: 1rem 1.25rem; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--rule); }
.menu-list a:last-child { border-bottom: 0; }
.menu-list a span { font-size: .875rem; color: var(--ink-soft); }
.menu-list a:active { background: var(--stamp-soft); }
.btn.wide { width: 100%; }

@media (max-width: 860px) {
  body { touch-action: manipulation; }
  .side { padding: calc(.75rem + env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) .75rem max(1rem, env(safe-area-inset-left)); }
  /* Sticky, so the dark header stays in place under the status bar while the page scrolls. */
  .side { position: sticky; top: 0; z-index: 25; }
  .side .nav, .side .side-foot { display: none; }
  .brand img { width: 28px; height: 28px; }
  .brand span { font-size: 1.35rem; }
  .main { padding: 1.25rem max(1rem, env(safe-area-inset-right)) calc(6rem + env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left)); }
  .head { margin-bottom: 1.25rem; }
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    padding: .35rem max(.25rem, env(safe-area-inset-right)) calc(.35rem + env(safe-area-inset-bottom)) max(.25rem, env(safe-area-inset-left));
    background: var(--sheet); border-top: 1px solid var(--rule);
  }
  @supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
    .tabbar { background: color-mix(in srgb, var(--sheet) 82%, transparent); -webkit-backdrop-filter: saturate(1.6) blur(18px); backdrop-filter: saturate(1.6) blur(18px); }
  }
  .tabbar a {
    flex: 1 1 0; min-width: 0; min-height: 48px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem;
    color: var(--ink-soft); text-decoration: none; font-size: .6875rem; font-weight: 600; -webkit-tap-highlight-color: transparent;
  }
  .tabbar svg { width: 25px; height: 25px; }
  .tabbar a[aria-current="page"] { color: var(--stamp); }
  .counts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .counts div { border-right: 0; border-bottom: 1px solid var(--rule); }
  .counts div:nth-child(odd) { border-right: 1px solid var(--rule); }
  .counts strong { font-size: 1.6rem; }
  .counts div:last-child:nth-child(odd) { grid-column: 1 / -1; border-right: 0; }
  .counts div:last-child, .counts div:nth-last-child(2):nth-child(odd) { border-bottom: 0; }
}

/* Tables become one card per row on a phone (labels are added by maily.js). */
@media (max-width: 640px) {
  table.stacked thead { display: none; }
  table.stacked, table.stacked tbody { display: block; }
  table.stacked tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem 1rem; padding: .9rem 1rem; border-bottom: 1px solid var(--rule); }
  table.stacked tr:last-child { border-bottom: 0; }
  table.stacked td { display: block; padding: 0; border: 0; text-align: left; min-width: 0; font-size: .875rem; }
  table.stacked td.cell-main { flex: 1 1 calc(100% - 2.5rem); font-size: .9375rem; overflow-wrap: anywhere; }
  table.stacked td.pick { flex: 0 0 1.25rem; order: -1; }
  table.stacked td.pick input { margin: 0; }
  table.stacked td.empty { flex: 1 1 100%; }
  table.stacked td[data-label]:not(.cell-main)::before { content: attr(data-label) " "; color: var(--ink-soft); font-size: .75rem; font-weight: 600; }
  table.stacked td:empty { display: none; }
}

/* Home-screen app. The page handles pull-to-refresh itself (maily.js), so the native bounce is off. */
@media (display-mode: standalone) {
  html { overscroll-behavior-y: none; }

  .solo { padding-top: calc(2rem + env(safe-area-inset-top)); padding-bottom: calc(2rem + env(safe-area-inset-bottom)); }
}

/* iOS 26 lays a light haze under the status bar of the home-screen app; the logo sits below it. */
@media (display-mode: standalone) and (max-width: 860px) {
  .side { padding-top: calc(env(safe-area-inset-top) + 2.5rem); padding-bottom: .9rem; }
}

/* Pull to refresh (home-screen app only; maily.js adds the element and drives it). */
.ptr {
  position: fixed; left: 50%; top: 0; z-index: 24; width: 40px; height: 40px; margin-left: -20px; border-radius: 50%;
  display: grid; place-items: center; background: var(--sheet); color: var(--ink-soft); border: 1px solid var(--rule);
  box-shadow: 0 4px 14px rgba(29, 35, 64, .18); opacity: 0; transform: translateY(-48px) scale(.6); pointer-events: none;
  transition: transform .32s cubic-bezier(.2, .9, .3, 1.2), opacity .2s ease, color .15s ease;
}
.ptr.dragging { transition: color .15s ease; }
.ptr.ready, .ptr.loading { color: var(--stamp); }
.ptr.ready svg { animation: ptr-pop .22s ease; }
.ptr svg { width: 21px; height: 21px; }
.ptr.loading svg { animation: ptr-spin .75s linear infinite; }
.ptr.done { opacity: 0; transform: translateY(8px) scale(.4); transition: transform .28s ease-in, opacity .28s ease-in; }
.ptr-pulling { will-change: transform; }
.ptr-settle { transition: transform .38s cubic-bezier(.2, .9, .3, 1.15); }
@keyframes ptr-spin { to { transform: rotate(360deg); } }
@keyframes ptr-pop { 0% { scale: 1; } 50% { scale: 1.28; } 100% { scale: 1; } }
@media (prefers-reduced-motion: reduce) {
  .ptr, .ptr.done, .ptr-settle { transition-duration: .01s; }
  .ptr.loading svg { animation-duration: 2s; }
}

/* ------------------------------------------------------------------ quarantine */
.sheet.hold { border-left: 4px solid var(--warn); margin-bottom: 1.25rem; }
.sheet.hold h3 { color: var(--warn); }

/* Swipe back (home-screen app only; maily.js adds the element and drives it). */
.swipe-back {
  position: fixed; left: 0; top: 50%; z-index: 35; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; background: var(--sheet); color: var(--ink-soft); border: 1px solid var(--rule);
  box-shadow: 0 4px 14px rgba(29, 35, 64, .2); opacity: 0; transform: translate(-44px, -50%) scale(.6); pointer-events: none;
}
.swipe-back svg { width: 22px; height: 22px; }
.swipe-back.ready { color: var(--stamp); }
.swiping { will-change: transform; box-shadow: -12px 0 28px rgba(0, 0, 0, .18); }
.swipe-settle { transition: transform .28s cubic-bezier(.2, .8, .3, 1), opacity .2s ease; }
@media (prefers-reduced-motion: reduce) { .swipe-settle { transition-duration: .01s; } }
