/* Aliasdock: plain, responsive layout without a framework.
 *
 * Layout from 55rem width: the header is fixed, below it sidebar and
 * content fill the remaining height. Both scroll individually so the
 * menu always reaches the bottom edge and stays put while paging through
 * a long mail list.
 *
 * Below that (phone, narrow window) the normal text flow applies: the
 * menu sits as a compact, wrapping bar above the content, the page
 * scrolls as a whole.
 */

:root {
  --bg: #ffffff;
  --bg-2: #f5f6f8;
  --border: #d8dbe0;
  --text: #1c1f24;
  --text-muted: #5c636e;
  --accent: #1f5fa9;
  --accent-text: #ffffff;
  --warning: #a4262c;
  --success: #1d6f42;
  --radius: 6px;
  --sidebar-width: 15rem;
  /* Focus ring of fields and checkboxes; shadow of floating panels. */
  --focus-ring: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent);
  --shadow: 0 6px 24px rgb(0 0 0 / .14);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16181c;
    --bg-2: #1e2126;
    --border: #333941;
    --text: #e6e8ec;
    --text-muted: #a0a7b2;
    --accent: #6ea8fe;
    --accent-text: #10131a;
    --warning: #ff8f8f;
    --success: #7ddba3;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
}

a { color: var(--accent); }
code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .9em; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: -9999px; top: 0; background: var(--accent);
  color: var(--accent-text); padding: .5rem 1rem; z-index: 10;
}
.skip-link:focus { left: 0; }

/* Header */
.header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: .6rem 1rem;
  border-bottom: 1px solid var(--border); background: var(--bg-2);
}
.brand { font-weight: 700; font-size: 1.1rem; text-decoration: none; color: var(--text); }
.header-nav { display: flex; align-items: center; gap: .75rem; }
.account-menu > summary { display: inline-flex; align-items: center; gap: .5rem; }
.account-menu > summary::after { content: none; }
.avatar {
  display: inline-grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 50%;
  background: var(--accent); color: var(--bg); font-weight: 700; font-size: .9rem; text-transform: uppercase;
}
.menu-panel.menu-right { left: auto; right: 0; }
.menu-head { margin: 0 0 .3rem; padding: .3rem .6rem .6rem; border-bottom: 1px solid var(--border); color: var(--text-muted); }
.menu-head strong { color: var(--text); }
.flash { transition: opacity .4s ease, transform .4s ease; }
.flash.flash-gone { opacity: 0; transform: translateY(-.4rem); }
@media (prefers-reduced-motion: reduce) {
  .flash { transition: none; }
}
.user { color: var(--text-muted); font-size: .9rem; overflow-wrap: anywhere; }

/* Body */
.page-body { display: flex; align-items: stretch; gap: 0; }
.page-body-narrow { justify-content: center; }
.sidebar {
  flex: 0 0 var(--sidebar-width);
  display: flex; flex-direction: column;
  padding: 1rem; border-right: 1px solid var(--border); background: var(--bg-2);
}
.content { flex: 1 1 auto; padding: 1rem 1.25rem 3rem; min-width: 0; }
/* The width limit sits on the inner column, not on .content: on large
   screens .content scrolls, and a narrower .content would put its
   scrollbar in the middle of the window. */
.content-inner { max-width: 72rem; }
.page-body-narrow .content { width: 100%; }
.page-body-narrow .content-inner { max-width: 30rem; margin: 0 auto; }
/* Quiet scrollbars for the two scrolling areas. */
.content, .sidebar { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }

.group {
  margin: 1rem 0 .25rem; font-size: .75rem; letter-spacing: .05em;
  text-transform: uppercase; color: var(--text-muted);
}
.group:first-child { margin-top: 0; }
.list { list-style: none; margin: 0; padding: 0; }
.list a {
  display: block; padding: .3rem .5rem; border-radius: var(--radius);
  text-decoration: none; color: var(--text);
}
.list a:hover { background: var(--bg); }
.list a.active { background: var(--bg); font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); }
.heading-sub { font-weight: 400; color: var(--text-muted); }
.counter {
  display: inline-block; min-width: 1.4em; padding: 0 .35em; border-radius: 999px;
  background: var(--accent); color: var(--accent-text);
  font-size: .75rem; text-align: center;
}
/* Spam waits to be looked at, it does not call for attention. */
.counter-muted { background: var(--border); color: var(--text); }
.dot {
  display: inline-block; width: .8em; height: .8em; border-radius: 50%;
  margin-right: .35em; vertical-align: -.05em;
}
/* Pushes the version to the bottom edge of the sidebar. */
.version { margin: auto 0 0; padding-top: 1rem; color: var(--text-muted); font-size: .8rem; }

h1 { font-size: 1.5rem; margin: .2rem 0 .8rem; }
h2 { font-size: 1.15rem; margin: 0 0 .6rem; }
h3 { font-size: 1rem; margin: 1rem 0 .3rem; }
.lead { color: var(--text-muted); margin-top: 0; }
.small { color: var(--text-muted); font-size: .85rem; }
.wrap { overflow-wrap: anywhere; }
.empty { color: var(--text-muted); padding: 2rem 0; }
.right, .table .right { text-align: right; }
.back { margin: 0 0 .5rem; }

/* Cards and forms */
.card {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-2); padding: 1rem; margin: 0 0 1.25rem;
}
.form p { margin: 0 0 .8rem; }
.form label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .2rem; }
/* Fields look the same in a form and in a row next to their button (2FA
   code, recovery codes), never like the browser's default. */
.form input[type=text], .form input[type=email], .form input[type=password],
.form input[type=number], .form input[type=search], .form select, .form textarea,
.row input[type=text], .row input[type=email], .row input[type=password],
.row input[type=number], .row input[type=search], .row select {
  padding: .45rem .55rem; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg); color: var(--text); font: inherit; min-width: 0; max-width: 100%;
}
.form input[type=text], .form input[type=email], .form input[type=password],
.form input[type=number], .form input[type=search], .form select, .form textarea {
  width: 100%; max-width: 32rem;
}
.row input:focus-visible, .row select:focus-visible,
.form input:focus-visible, .form select:focus-visible, .form textarea:focus-visible {
  outline: none; border-color: var(--accent); box-shadow: var(--focus-ring);
}
.row > .form-inline { margin: 0; }
.row input::placeholder, .form input::placeholder { color: var(--text-muted); opacity: 1; }

/* Checkboxes: drawn in CSS instead of the browser default so they follow
   the theme. The tick is a rotated border, no image: the CSP allows none
   from data: URIs. */
input[type=checkbox] {
  appearance: none; -webkit-appearance: none;
  position: relative; flex: 0 0 auto;
  width: 1.15rem; height: 1.15rem; margin: 0 .4rem 0 0;
  vertical-align: -.2rem; cursor: pointer;
  border: 1.5px solid var(--text-muted); border-radius: 4px;
  background: var(--bg);
  transition: background-color .12s, border-color .12s, box-shadow .12s;
}
input[type=checkbox]:hover { border-color: var(--accent); }
input[type=checkbox]:checked { background: var(--accent-fill, var(--accent)); border-color: var(--accent); }
input[type=checkbox]::after {
  content: ""; position: absolute; left: 50%; top: 45%;
  width: .3rem; height: .6rem;
  border: solid var(--accent-fill-text, var(--accent-text)); border-width: 0 2px 2px 0;
  transform: translate(-50%, -50%) rotate(45deg) scale(0);
  transition: transform .12s;
}
input[type=checkbox]:checked::after { transform: translate(-50%, -50%) rotate(45deg) scale(1); }
input[type=checkbox]:focus-visible { outline: none; box-shadow: var(--focus-ring); }
input[type=checkbox]:disabled { opacity: .5; cursor: not-allowed; }
label:has(> input[type=checkbox]) { cursor: pointer; }
@media (prefers-reduced-motion: reduce) {
  input[type=checkbox], input[type=checkbox]::after { transition: none; }
}
.help { display: block; color: var(--text-muted); font-size: .85rem; margin-top: .2rem; max-width: 40rem; }
.row { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin: 0 0 .5rem; }
.inline { display: inline; }

/* Buttons */
.btn {
  display: inline-block; padding: .4rem .75rem; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--bg); color: var(--text);
  font: inherit; text-decoration: none; cursor: pointer;
}
.btn:hover { border-color: var(--accent); }
/* Surfaces use the brand color itself (--accent-fill, set by a brand
   stylesheet); text and borders use --accent, which a brand stylesheet
   keeps readable. Without a brand both are the same. */
.btn-primary { background: var(--accent-fill, var(--accent)); color: var(--accent-fill-text, var(--accent-text)); border-color: var(--accent); }
.btn-plain { background: transparent; }
.btn-small { padding: .2rem .45rem; font-size: .85rem; }
.btn-danger { color: var(--warning); border-color: var(--warning); }

/* Notices */
/* Each kind has a symbol and a broad left bar besides its color, so
   success and error differ for everyone, including red-green color
   blindness. The symbol is decoration (empty alternative text); the
   message itself says what happened. */
.notice, .error-message {
  position: relative; margin: .75rem 1rem; padding: .6rem .9rem .6rem 2.6rem;
  border-radius: var(--radius); border: 1px solid var(--border); border-left-width: 5px;
  background: var(--bg-2);
}
.content .notice, .error-message { margin: .75rem 0; }
.notice::before, .error-message::before {
  position: absolute; left: .7rem; top: .65rem;
  width: 1.3rem; height: 1.3rem; border-radius: 50%;
  display: grid; place-items: center; font-size: .8rem; font-weight: 700; line-height: 1;
  background: var(--text-muted); color: var(--bg);
  content: "i"; content: "i" / "";
}
.notice-success { border-color: var(--success); }
.notice-success::before { background: var(--success); content: "✓"; content: "✓" / ""; }
.notice-error { border-color: var(--warning); }
.notice-error::before, .error-message::before { background: var(--warning); content: "!"; content: "!" / ""; border-radius: 3px; }
.error-message { border-color: var(--warning); color: var(--warning); }

/* Tabs */
.tabs { display: flex; flex-wrap: wrap; gap: .25rem; margin: 0 0 .8rem; border-bottom: 1px solid var(--border); }
.tab {
  padding: .4rem .7rem; text-decoration: none; color: var(--text);
  border: 1px solid transparent; border-bottom: none; border-radius: var(--radius) var(--radius) 0 0;
}
.tab.active { border-color: var(--border); background: var(--bg-2); font-weight: 600; }

/* Getting started */
.badge {
  display: inline-block; margin-left: .4rem; padding: .05rem .5rem; border-radius: 999px;
  border: 1px solid var(--border); font-size: .75rem; font-weight: 500;
  color: var(--text-muted); vertical-align: middle;
}
.badge-done { border-color: var(--accent); color: var(--accent); }
.welcome-section { margin: 0 0 1.75rem; }
.welcome-section h3 { margin: 0 0 .35rem; font-size: 1rem; }
.welcome-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: .9rem; }
.welcome-concept { margin: 0; }
.welcome-concept p { margin: 0; color: var(--text-muted); }
.welcome-icon {
  display: inline-grid; place-items: center; width: 2.2rem; height: 2.2rem; margin-bottom: .5rem;
  border-radius: 50%; background: var(--accent); color: var(--accent-text); font-weight: 700;
}
.welcome-steps { list-style: none; margin: .75rem 0 0; padding: 0; }
.welcome-step { position: relative; display: flex; gap: .9rem; padding: 0 0 1.25rem; }
/* The line connecting the step markers. */
.welcome-step:not(:last-child)::before {
  content: ""; position: absolute; left: 1rem; top: 2.2rem; bottom: .2rem;
  width: 2px; margin-left: -1px; background: var(--border);
}
.welcome-step-mark {
  flex: 0 0 auto; display: grid; place-items: center; width: 2rem; height: 2rem;
  border-radius: 50%; border: 2px solid var(--border); background: var(--bg);
  font-weight: 700; color: var(--text-muted);
}
.welcome-step.done .welcome-step-mark { border-color: var(--accent); background: var(--accent-fill, var(--accent)); color: var(--accent-fill-text, var(--accent-text)); }
.welcome-step-body { flex: 1 1 auto; min-width: 0; padding-top: .2rem; }
.welcome-step-body p { margin: 0 0 .6rem; color: var(--text-muted); max-width: 44rem; }
.welcome-finish p { margin: 0 0 .75rem; }
.welcome-finish-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.welcome-hint { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; margin: 0 0 1rem; }
.welcome-hint-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0; }

/* Reseller portal */
.badge-warn { border-color: var(--warning); color: var(--warning); }
.choice { border: 0; padding: 0; margin: 0 0 .8rem; }
.choice legend { font-weight: 600; font-size: .9rem; margin-bottom: .2rem; padding: 0; }
.choice label { display: inline-flex; align-items: center; margin: 0 1rem .2rem 0; font-weight: normal; }
.choice input[type=radio] { margin: 0 .35rem 0 0; accent-color: var(--accent); }
.form textarea { width: 100%; max-width: 32rem; padding: .45rem .55rem; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--bg); color: var(--text); font: inherit; }
.danger-zone { border-color: var(--warning); }
.plain-list { margin: 0; padding-left: 1.1rem; }
.inline-form { margin: 0; flex-wrap: nowrap; }
.add-user { margin-top: .75rem; }
.add-user input[type=email] {
  flex: 1 1 14rem; padding: .4rem .5rem; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg); color: var(--text); font: inherit;
}
.stat-grid + section, .tabs + .stat-grid { margin-top: .9rem; }
.limits { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; margin: 0 0 1rem; }
.limits div { min-width: 8rem; }
.limits dt { font-size: .8rem; color: var(--text-muted); }
.limits dd { margin: 0; font-weight: 600; }
.overrides { margin: 0 0 .8rem; padding: .5rem .75rem; border: 1px dashed var(--border); border-radius: var(--radius); }
.overrides summary { cursor: pointer; font-weight: 600; font-size: .9rem; }
.billing-nav { margin: 0 0 1rem; }
.billing-month { min-width: 9rem; text-align: center; }
.billing-group { margin: 1.25rem 0 0; }
.billing-group h2 { font-size: 1.05rem; }

/* Connect an app */
.connect-card { max-width: 40rem; }
.connect-scopes { margin: .25rem 0 .75rem; padding-left: 1.2rem; }
.connect-scopes.denied { color: var(--text-muted); text-decoration: line-through; }
.connect-actions { margin-top: 1rem; }

/* Second factor */
.qr { image-rendering: pixelated; border: 8px solid #fff; border-radius: var(--radius); }
.recovery-codes { font-size: 1.05rem; line-height: 1.6; columns: 2; max-width: 24rem; }

/* Attachments */
.attachments { margin: 0 0 1rem; }
.attachments-heading { font-size: 1rem; margin: 0 0 .4rem; }
.attachment-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.attachment {
  display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem;
  padding: .45rem .7rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-2);
}
.attachment-icon { color: var(--text-muted); }
.attachment-name { font-weight: 600; min-width: 0; }
.attachment-meta { color: var(--text-muted); }
.attachment-actions { margin-left: auto; display: flex; gap: .35rem; }
.attachment-risky { border-color: var(--warning); }
.attachment-risky .attachment-icon, .attachment-warning { color: var(--warning); font-weight: 600; }
.attachment-mark { margin-left: .35rem; font-size: .8rem; }
.attachment-frame {
  width: 100%; height: 75vh; min-height: 20rem;
  border: 1px solid var(--border); border-radius: var(--radius); background: #fff;
}
.attachment-image img {
  max-width: 100%; height: auto; border: 1px solid var(--border); border-radius: var(--radius);
}

/* Tracker protection */
.tracker-switch { margin: 0; }
.tracker-state { font-weight: 600; color: var(--text-muted); }
.tracker-state-on { color: var(--success); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: .9rem; }
.stat { margin: 0; display: flex; flex-direction: column; gap: .15rem; }
.stat-value { font-size: 2rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-label { color: var(--text-muted); font-size: .9rem; }
.tracker-chips { list-style: none; display: flex; flex-wrap: wrap; gap: .35rem; margin: .4rem 0 0; padding: 0; }
.tracker-chip {
  padding: .1rem .55rem; border-radius: 999px; font-size: .85rem;
  border: 1px solid var(--border); background: var(--bg);
}
.tracker-chip.tracker-pixel { border-color: var(--success); }
.tracker-mails { list-style: none; margin: 0; padding: 0; }
.tracker-mail { margin: 0 0 .6rem; padding: .7rem .9rem; }
.tracker-mail-head { margin: 0; display: flex; flex-wrap: wrap; gap: .25rem .75rem; align-items: baseline; }
.tracker-mail-head a { overflow-wrap: anywhere; }
.tracker-notice p { margin: 0; }
.breach-alias + .breach-alias { border-top: 1px solid var(--border); margin-top: .75rem; padding-top: .75rem; }
.breach-alias h3 { margin: 0 0 .35rem; font-size: 1rem; }
.breach-alias.done { opacity: .7; }
.old-addresses { margin-bottom: 1rem; }
.old-addresses li + li { margin-top: .35rem; }
.forged-mark { color: var(--warning); font-weight: 700; margin-left: .25rem; }
.sender-warning { font-weight: 600; }
.tracker-mark {
  margin-left: .35rem; font-size: .75rem; white-space: nowrap; color: var(--success);
}

/* Filters */
.filter { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; margin: 0 0 .8rem; }
.filter-field { margin: 0; }
.filter-field label { display: block; font-size: .8rem; color: var(--text-muted); }
.filter-field input, .filter-field select {
  padding: .35rem .5rem; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg); color: var(--text); font: inherit; max-width: 100%;
}
.filter-toggle label { display: block; font-size: .9rem; color: var(--text); padding-top: 1rem; }

/* Tables. The frame catches wide tables so the page itself never has to
   scroll horizontally. */
/* position: relative is necessary, not decoration: without a positioned
   ancestor the absolutely positioned .sr-only elements in the table
   headers refer to the viewport. They would then sit at their static
   position inside the horizontally scrolled table and make the page
   itself wider. */
.table-wrap { overflow-x: auto; margin: .5rem 0 1rem; position: relative; }
.table, .mail-list { width: 100%; border-collapse: collapse; }
.table th, .table td, .mail-list th, .mail-list td {
  text-align: left; padding: .45rem .5rem; border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.table th, .mail-list th { font-size: .8rem; color: var(--text-muted); font-weight: 600; }
.mail-list tr.unread { font-weight: 600; }
.mail-list a { text-decoration: none; }
.mail-list a:hover { text-decoration: underline; }
.col-select { width: 2rem; }
.col-select input[type=checkbox] { margin: 0; }
.col-date { width: 7rem; white-space: nowrap; color: var(--text-muted); }
.col-sender { width: 16rem; }
.col-category { width: 10rem; }
.col-sender .small { display: block; font-weight: 400; }
.actions { white-space: nowrap; }
.actions > * { margin-right: .25rem; }
.bulk-action {
  display: flex; flex-wrap: wrap; gap: .35rem; align-items: center;
  padding: .5rem 0; border-bottom: 1px solid var(--border);
}
.bulk-action .all { margin-right: .5rem; }
.paging { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: 1rem 0; }

/* Quick actions in the mail list */
.col-quick { width: 9rem; white-space: nowrap; text-align: right; }
.btn-quick {
  padding: .1rem .4rem; font-size: .95rem; line-height: 1.3;
  min-width: 1.9rem; text-align: center;
}
.mail-list tr:not(:hover) .btn-quick { border-color: transparent; }
.mail-list tr:hover .btn-quick { border-color: var(--border); }
.btn-quick:focus-visible { border-color: var(--accent); }
/* Removing stands apart from the harmless actions, on hover already. */
.mail-list .q-trash:hover, .mail-list .q-trash:focus-visible,
.btn-danger-soft:hover, .btn-danger-soft:focus-visible { color: var(--warning); border-color: var(--warning); }

/* Domain setup checklist */
.checklist { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .6rem; }
.check {
  display: grid; grid-template-columns: 2.2rem 1fr; gap: .2rem .8rem;
  padding: .8rem 1rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg);
}
.check-mark {
  display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%;
  font-weight: 700; background: var(--bg-2); color: var(--text-muted);
}
.check-ok .check-mark { background: var(--success); color: var(--bg); }
.check-missing .check-mark, .check-wrong .check-mark { background: var(--warning); color: var(--bg); }
.check-missing, .check-wrong { border-color: var(--warning); }
.check-title { font-size: 1.02rem; margin: .2rem 0 .1rem; }
.check-state { font-weight: 400; color: var(--text-muted); margin-left: .35rem; }
.check-body .help { margin: 0 0 .5rem; }
.record { display: grid; grid-template-columns: max-content 1fr; gap: .25rem .8rem; margin: .4rem 0; align-items: center; }
.record dt { color: var(--text-muted); font-size: .85rem; }
.record dd { margin: 0; min-width: 0; }
.found { margin: .2rem 0 .5rem; }
.danger-zone h2 { font-size: 1rem; }

/* Empty states: what is missing, and the way on. */
div.empty { display: grid; justify-items: start; gap: .6rem; }
div.empty p { margin: 0; }

/* Backup */
.backup-todo { margin: .5rem 0 0; padding-left: 1.2rem; }
.backup-todo li { margin: .25rem 0; }
.warning-text { color: var(--warning); font-weight: 600; }
.form input[type=file] { font: inherit; max-width: 100%; }

/* Rules as a numbered list of sentences */
.rule-list { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .5rem; }
.rule {
  display: grid; grid-template-columns: 2rem 1fr auto; align-items: center; gap: .4rem .8rem;
  padding: .6rem .8rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg);
}
.rule-off { opacity: .7; }
.rule-pos {
  display: grid; place-items: center; width: 1.8rem; height: 1.8rem; border-radius: 50%;
  background: var(--bg-2); color: var(--text-muted); font-weight: 700; font-size: .9rem;
}
.rule-sentence { margin: .15rem 0 0; color: var(--text-muted); overflow-wrap: anywhere; }
.rule-actions { display: flex; flex-wrap: wrap; gap: .3rem; justify-content: flex-end; }
.btn-icon { min-width: 2rem; text-align: center; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
@media (max-width: 40rem) {
  .rule { grid-template-columns: 2rem 1fr; }
  .rule-actions { grid-column: 1 / -1; justify-content: flex-start; }
}

/* Mail view */
.mail-headers { display: grid; grid-template-columns: 9rem 1fr; gap: .2rem .8rem; margin: 0 0 1rem; }
.mail-headers dt { color: var(--text-muted); font-size: .9rem; }
.mail-headers dd { margin: 0; overflow-wrap: anywhere; }
.mail-meta { margin: -.3rem 0 .9rem; overflow-wrap: anywhere; }
.mail-meta .mail-date { margin-left: .5rem; }
/* Mail toolbar: main actions, then "More" as a drop-down. */
.mail-toolbar { display: flex; flex-wrap: wrap; align-items: flex-start; gap: .5rem; margin: 0 0 .75rem; }
.mail-toolbar .mail-actions { margin: 0; }
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary::after { content: " ▾"; content: " ▾" / ""; }
.menu[open] > summary { border-color: var(--accent); color: var(--accent); }
.menu-panel {
  position: absolute; z-index: 20; top: calc(100% + .3rem); left: 0; min-width: 17rem;
  display: grid; gap: .15rem; padding: .5rem;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.menu-panel form { margin: 0; }
.menu-form { padding: .25rem .4rem .6rem; border-bottom: 1px solid var(--border); margin-bottom: .25rem; }
.menu-form .row { flex-wrap: nowrap; }
.menu-form select { min-width: 0; flex: 1 1 auto; }
.menu-form label { display: block; font-size: .85rem; color: var(--text-muted); margin-bottom: .25rem; }
.menu-item {
  display: block; width: 100%; padding: .5rem .6rem; border: 0; border-radius: calc(var(--radius) - 2px);
  background: none; color: var(--text); font: inherit; text-align: left; text-decoration: none; cursor: pointer;
}
.menu-item:hover, .menu-item:focus-visible { background: var(--bg-2); }
.menu-danger { color: var(--warning); }
.mail-details { margin: 0 0 .75rem; }
.mail-details > summary { cursor: pointer; color: var(--text-muted); font-size: .9rem; width: max-content; }
.mail-details[open] > summary { margin-bottom: .4rem; }
/* The frame fills the rest of the window and scrolls itself: without
   scripts in the frame its content height cannot be measured. */
.mail-frame {
  display: block; width: 100%; height: calc(100dvh - 9rem); min-height: 22rem;
  border: 1px solid var(--border); border-radius: var(--radius); background: #fff;
}
.mail-text {
  white-space: pre-wrap; overflow-wrap: anywhere; padding: 1rem;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-2);
}
.dns {
  padding: .75rem; overflow-x: auto; background: var(--bg);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.address {
  padding: .1rem .3rem; background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); overflow-wrap: anywhere;
}
.warning {
  display: inline-block; margin-left: .35em; padding: 0 .35em;
  border: 1px solid var(--warning); border-radius: var(--radius);
  color: var(--warning); font-size: .8rem;
}

/* Category colors. Fixed palette as classes so the page gets by without
   inline styles and style-src 'self' stays in place. */
/* Category colors. Chosen so that every pair stays apart with red, green
   or blue color blindness (simulated, Machado et al. 2009: at least
   ΔE 15) and every color has 3:1 against the page. On top of that each
   color has its own shape, so telling them apart never rests on color
   alone. */
.dot-gray    { background: #676b74; border-radius: 50%; }
.dot-blue    { background: #104fcb; border-radius: 1px; }
.dot-teal    { background: #0e99af; border-radius: 0; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.dot-green   { background: #1f703a; border-radius: 0; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.dot-yellow  { background: #9a7c04; border-radius: 0; clip-path: polygon(0 0, 100% 0, 50% 100%); }
.dot-orange  { background: #964108; border-radius: 0; clip-path: polygon(50% 0, 100% 38%, 82% 100%, 18% 100%, 0 38%); }
.dot-red     { background: #810e0e; border-radius: 0; clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); }
.dot-purple  { background: #471579; border-radius: 0; clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
.dot-pink    { background: #721d4f; border-radius: 0; clip-path: polygon(35% 0, 65% 0, 65% 35%, 100% 35%, 100% 65%, 65% 65%, 65% 100%, 35% 100%, 35% 65%, 0 65%, 0 35%, 35% 35%); }

@media (prefers-color-scheme: dark) {
  .dot-gray    { background: #acb0b9; }
  .dot-blue    { background: #7599e0; }
  .dot-teal    { background: #71e2f4; }
  .dot-green   { background: #87dea4; }
  .dot-yellow  { background: #f9ce1f; }
  .dot-orange  { background: #f69351; }
  .dot-red     { background: #e83030; }
  .dot-purple  { background: #8c50c8; }
  .dot-pink    { background: #d14798; }
}

/* --- Fixed sidebar from 55rem ------------------------------------------- */
@media (min-width: 55.0625rem) {
  html, body { height: 100%; }
  /* Only menu and content scroll, not the page itself. */
  body { display: flex; flex-direction: column; overflow: hidden; }
  .header { flex: 0 0 auto; }
  body > .notice { flex: 0 0 auto; }
  .page-body { flex: 1 1 auto; min-height: 0; }
  .sidebar { overflow-y: auto; overscroll-behavior: contain; }
  .content { overflow-y: auto; overscroll-behavior: contain; }
}

/* --- Desktop: the phone-only parts stay hidden ---------------------------- */
.tabbar, .drawer-head, .drawer-backdrop, .drawer-user,
.filter-more-toggle, .filter-more-label { display: none; }
.brand { display: inline-flex; align-items: center; gap: .45rem; }
.brand img { display: block; }

/* --- Phones and narrow windows ----------------------------------------------
   App layout: header at the top, the folders as a tab bar at the bottom,
   everything else in a drawer that slides in from the left. The page
   scrolls as a whole. env(safe-area-inset-*) keeps clear of the notch and
   the home indicator when installed as a web app (viewport-fit=cover). */
@media (max-width: 55rem) {
  :root { --tabbar-height: 3.6rem; }
  body { padding-bottom: calc(var(--tabbar-height) + env(safe-area-inset-bottom)); }

  .header {
    position: sticky; top: 0; z-index: 20;
    padding: calc(.5rem + env(safe-area-inset-top)) calc(1rem + env(safe-area-inset-right)) .5rem calc(1rem + env(safe-area-inset-left));
  }
  .header .user { display: none; }
  .header .btn { padding: .35rem .65rem; font-size: .9rem; }

  .page-body { display: block; }
  .content { padding: 1rem calc(1rem + env(safe-area-inset-right)) 1.5rem calc(1rem + env(safe-area-inset-left)); }
  body > .notice { margin: .75rem 1rem 0; }
  h1 { font-size: 1.3rem; }

  /* Drawer */
  .sidebar {
    position: fixed; z-index: 40; top: 0; bottom: 0; left: 0;
    width: min(20rem, 86vw); overflow-y: auto; overscroll-behavior: contain;
    padding: calc(.75rem + env(safe-area-inset-top)) 1rem calc(1rem + env(safe-area-inset-bottom)) calc(1rem + env(safe-area-inset-left));
    border-right: 1px solid var(--border);
    transform: translateX(-105%); visibility: hidden;
    transition: transform .2s ease, visibility 0s linear .2s;
  }
  .sidebar:target, .menu-open .sidebar {
    transform: none; visibility: visible;
    transition: transform .2s ease, visibility 0s;
    box-shadow: 0 0 2rem rgb(0 0 0 / .25);
  }
  .drawer-head { display: flex; align-items: center; justify-content: space-between; margin: 0 0 .5rem; }
  .drawer-title { font-weight: 700; font-size: 1.1rem; }
  .drawer-close { font-size: 1.1rem; min-width: 2.75rem; min-height: 2.75rem; display: inline-grid; place-items: center; }
  .drawer-user { display: block; margin: 1rem 0 0; overflow-wrap: anywhere; }
  .nav-folders { display: none; }
  .sidebar .list a { padding: .65rem .75rem; }
  .drawer-backdrop {
    display: block; position: fixed; inset: 0; z-index: 35;
    background: rgb(0 0 0 / .4); opacity: 0; pointer-events: none; transition: opacity .2s;
  }
  .sidebar:target ~ .drawer-backdrop, .menu-open .drawer-backdrop { opacity: 1; pointer-events: auto; }

  /* Tab bar */
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; z-index: 30; left: 0; right: 0; bottom: 0;
    padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    background: var(--bg-2); border-top: 1px solid var(--border);
    view-transition-name: tabbar;
  }
  .tabbar a {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: .15rem; min-height: var(--tabbar-height); padding: .3rem .1rem;
    color: var(--text-muted); text-decoration: none; font-size: .7rem; line-height: 1.1;
    -webkit-tap-highlight-color: transparent;
  }
  .tabbar a span:not(.counter) { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tabbar svg {
    width: 1.5rem; height: 1.5rem; fill: none; stroke: currentColor;
    stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  }
  .tabbar a.active { color: var(--accent); font-weight: 600; }
  .tabbar-portal { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 1fr; }
  .tabbar .counter { position: absolute; top: .3rem; left: calc(50% + .45rem); font-size: .65rem; }

  /* Filters: search plus a toggle for the rest */
  .filter { gap: .5rem; }
  /* Search and the toggle fill the first row together; the basis keeps
     the opened filters from moving up next to the search and squeezing it. */
  .filter-search { flex: 1 1 calc(100% - 7rem); min-width: 0; }
  .filter-field input:not([type=checkbox]), .filter-field select { width: 100%; }
  .filter-more-label { display: inline-block; flex: 0 0 auto; align-self: flex-end; margin: 0; font-size: .95rem; }
  /* input. raises the specificity above the general checkbox rule,
     which would otherwise give the hidden toggle a place in the row. */
  input.filter-more-toggle {
    display: block; position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none;
  }
  .filter-more-toggle:focus-visible + .filter-more-label { outline: 2px solid var(--accent); outline-offset: 2px; }
  .filter-more-toggle:checked + .filter-more-label { border-color: var(--accent); color: var(--accent); }
  .filter-extra { display: none; flex: 1 1 12rem; }
  .filter-more-toggle:checked ~ .filter-extra { display: block; }
  .filter-more-toggle:checked ~ .filter-buttons { display: flex; flex-wrap: wrap; gap: .5rem; flex-basis: 100%; }
  .filter-toggle label { padding-top: .25rem; }

  /* Touch targets */
  .btn { padding: .5rem .85rem; }
  .btn-small { padding: .35rem .6rem; }
  .bulk-action { gap: .4rem; }
  .bulk-action .btn { font-size: .9rem; padding: .4rem .65rem; }
  /* The bulk actions only appear once a mail is ticked; until then the
     bar is just "select all" and the list starts higher up. */
  @supports selector(:has(*)) {
    form:not(:has(input[name=mail]:checked)) > .bulk-action .btn { display: none; }
    form:has(input[name=mail]:checked) > .bulk-action {
      position: sticky; top: 3.4rem; z-index: 10; background: var(--bg);
    }
  }

  /* Mail view: subject, sender line, one row of actions, then the mail.
     The header details stay folded. */
  .back { margin: 0 0 .25rem; font-size: .9rem; }
  .mail-view h1 { font-size: 1.15rem; margin-bottom: .5rem; }
  .mail-meta { margin: 0 0 .5rem; font-size: .95rem; }
  .mail-meta .mail-date { display: block; margin: 0; }
  /* "More" opens as a sheet above the tab bar; the account menu in the
     header stays a drop-down under its button. */
  .mail-toolbar .menu-panel { position: fixed; left: .5rem; right: .5rem; top: auto; bottom: 4.5rem; min-width: 0; }
  .mail-headers { grid-template-columns: 5.5rem minmax(0, 1fr); gap: .15rem .6rem; font-size: .9rem; }
  .mail-headers dt { font-size: .85rem; }
  /* The few actions share the width evenly on one line instead of
     wrapping or scrolling sideways; "More" sits at its end, sized like
     its neighbours. */
  .mail-toolbar { flex-wrap: nowrap; gap: .35rem; }
  .mail-toolbar .mail-actions { flex: 1 1 auto; min-width: 0; }
  .mail-actions .row {
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
    gap: .35rem; margin: 0;
  }
  .mail-actions .btn { white-space: normal; text-align: center; line-height: 1.2; padding: .45rem .3rem; font-size: .8rem; }
  .mail-toolbar .menu > summary { line-height: 1.2; padding: .45rem .5rem; font-size: .8rem; white-space: nowrap; }
  .mail-view .tabs { margin-bottom: .5rem; }
  .mail-view .tab { padding: .3rem .65rem; font-size: .9rem; }
  .mail-view .notice { font-size: .9rem; margin: .5rem 0; }
  .mail-frame { height: calc(100dvh - 8rem); min-height: 20rem; }
  .mail-text { padding: .75rem; }
  .welcome-hint-actions { flex: 1 1 100%; }
  .welcome-hint .btn { flex: 1 1 auto; text-align: center; }
}

/* The mail list as cards: sender and date, subject below, then category
   and the quick actions. A table with six columns cannot fit a phone. */
@media (max-width: 40rem) {
  .table-wrap:has(> .mail-list) { overflow: visible; }
  .mail-list, .mail-list tbody { display: block; }
  .mail-list thead { display: none; }
  .mail-list tr {
    display: grid; grid-template-columns: 1.6rem minmax(0, 1fr) auto;
    grid-template-areas: "sel sender date" "sel subject subject" "sel cat quick";
    column-gap: .6rem; row-gap: .1rem; padding: .7rem 0; border-bottom: 1px solid var(--border);
  }
  .mail-list td { display: block; padding: 0; border: 0; width: auto; }
  .mail-list .col-select { grid-area: sel; padding-top: .2rem; }
  .mail-list .col-sender { grid-area: sender; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .mail-list .col-sender .small { display: none; }
  .mail-list .col-date { grid-area: date; font-size: .8rem; align-self: center; justify-self: end; }
  /* Two blue links per card are too loud; the card reads as text. */
  .mail-list a { color: var(--text); }
  .mail-list .col-subject { grid-area: subject; font-weight: 400; color: var(--text); }
  .mail-list tr.unread .col-subject { font-weight: 600; }
  .mail-list .col-category { display: block; grid-area: cat; align-self: center; font-size: .8rem; font-weight: 400; color: var(--text-muted); }
  .mail-list .col-quick { grid-area: quick; display: flex; gap: .3rem; justify-content: flex-end; }
  /* Phones have no hover, so the buttons keep their frame. */
  .mail-list tr:not(:hover) .btn-quick, .mail-list .btn-quick { min-width: 2.5rem; min-height: 2.25rem; border-color: var(--border); }
}

/* --- Page changes ----------------------------------------------------------
   Every click loads a full page. With cross-document view transitions the
   browser cross-fades the content instead of blanking the window, and the
   header and sidebar, which look the same on every page, stay put.
   Browsers without support simply navigate as before. */
@view-transition { navigation: auto; }
.header { view-transition-name: header; }
.sidebar { view-transition-name: sidebar; }
::view-transition-group(root) { animation-duration: 120ms; }
::view-transition-group(header), ::view-transition-group(sidebar) { animation: none; }
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
}

/* White label */
.brand-logo { max-height: 28px; width: auto; vertical-align: middle; }
.brand-preview { max-height: 40px; width: auto; border: 1px solid var(--border); border-radius: var(--radius); padding: 2px; background: #fff; }

/* --- Navigation aids --------------------------------------------------------- */
/* Portal tabs stay on one line and scroll sideways instead of wrapping
   into a second row on narrow screens. */
.tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; }
.tab { white-space: nowrap; flex: 0 0 auto; }
/* A second level below the tabs (billing: overview / invoices). */
.subnav { display: flex; gap: .25rem; margin: -.3rem 0 1rem; }
.subnav-item {
  padding: .25rem .7rem; border-radius: 999px; text-decoration: none;
  color: var(--text-muted); border: 1px solid var(--border); font-size: .9rem;
}
.subnav-item[aria-current="page"] { background: var(--bg-2); color: var(--text); font-weight: 600; }

/* Quick actions in the mail list: line icons like the tab bar. */
.btn-quick svg {
  width: 1.1rem; height: 1.1rem; display: block; margin: auto; fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
/* Bulk bar: idle until a mail is ticked (the class is set by app.js). */
.bulk-hint, .bulk-count:empty { display: none; }
.bulk-count { font-weight: 600; margin-right: .5rem; }
.bulk-buttons { display: contents; }
.bulk-idle .bulk-buttons { display: none; }
.bulk-idle .bulk-hint { display: inline; }
.js .filter-submit { display: none; }
/* A create form folded behind its button, below the list. */
.fold-card > summary { list-style: none; display: inline-block; cursor: pointer; }
.fold-card > summary::-webkit-details-marker { display: none; }
.fold-card[open] > summary { margin-bottom: 1rem; }
/* Phones: the bar stays just "select all" until something is ticked. */
@media (max-width: 55rem) {
  .bulk-idle .bulk-hint { display: none; }
}

/* New mail arrived while the list was open. */
.new-mail {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  margin: 0 0 .75rem; padding: .5rem .75rem; border: 1px solid var(--accent);
  border-radius: var(--radius); background: var(--bg-2);
}
.new-mail[hidden] { display: none; }

/* Pull to refresh in the installed app (app.js sets --pull). */
.pull-indicator {
  position: fixed; z-index: 25; left: 50%; top: calc(3.6rem + env(safe-area-inset-top));
  width: 2rem; height: 2rem; margin-left: -1rem; border-radius: 50%;
  border: 3px solid var(--border); border-top-color: var(--accent);
  background: var(--bg); opacity: 0; pointer-events: none;
  transform: translateY(calc(var(--pull, 0px) / 2 - 2.5rem)) rotate(calc(var(--pull, 0px) * 3));
}
.pull-indicator.active { opacity: 1; }
.pull-indicator.ready { border-color: var(--accent); }
.pull-indicator.loading { animation: pull-spin .8s linear infinite; }
@keyframes pull-spin { to { transform: translateY(0) rotate(360deg); } }

/* Quick actions: the read toggle that applies to the row. */
.mail-list tr.unread .q-unread, .mail-list tr:not(.unread) .q-read { display: none; }
.mail-list tr.busy { opacity: .6; }
.mail-list tr.gone { opacity: 0; transition: opacity .2s; }
/* Swipe feedback on phones: the row slides, the color says what happens. */
.mail-list tr { transition: background-color .15s; }
.mail-list tr.swipe-left { background: color-mix(in srgb, var(--warning) 18%, var(--bg)); }
.mail-list tr.swipe-right { background: color-mix(in srgb, var(--accent) 18%, var(--bg)); }
@media (prefers-reduced-motion: reduce) {
  .mail-list tr.gone { transition: none; }
}

/* Tables as cards on phones. app.js copies each column heading into the
   cells (data-label) and adds .cards; without it the table scrolls
   sideways as before. */
@media (max-width: 40rem) {
  .table.cards thead { display: none; }
  .table.cards, .table.cards tbody, .table.cards tr, .table.cards td { display: block; width: auto; }
  .table.cards tr { padding: .6rem 0; border-bottom: 1px solid var(--border); }
  .table.cards td { display: flex; gap: .75rem; justify-content: space-between; align-items: baseline; padding: .15rem 0; border: 0; text-align: right; }
  .table.cards td::before { content: attr(data-label); color: var(--text-muted); font-size: .85rem; text-align: left; flex: 0 0 auto; }
  .table.cards td:first-child { font-weight: 600; text-align: left; }
  .table.cards td:first-child::before, .table.cards td[data-label=""]::before { content: none; }
  .table.cards td.actions { justify-content: flex-start; flex-wrap: wrap; white-space: normal; padding-top: .4rem; }
  .table-wrap:has(> .table.cards) { overflow: visible; }
}

/* Replying from the alias. */
.reply-form .reply-body { max-width: 48rem; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9rem; }
.sent-replies { margin: 1rem 0; }
.sent-reply { margin: 0 0 .5rem; padding: .5rem .75rem; border: 1px solid var(--border); border-radius: var(--radius); }
.sent-reply > summary { cursor: pointer; }
.sent-reply-body { white-space: pre-wrap; overflow-wrap: anywhere; margin: .5rem 0 0; }

/* --- Alias page ---------------------------------------------------------- */
.alias-address { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: 0; }
.alias-address .address { font-size: 1.1rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: .75rem; margin: 0; }
.stats div { border: 1px solid var(--border); border-radius: var(--radius); padding: .5rem .75rem; background: var(--bg-2); }
.stats dt { font-size: .8rem; color: var(--text-muted); }
.stats dd { margin: .15rem 0 0; font-size: 1.15rem; font-weight: 600; }
.recent-mails li { margin-bottom: .4rem; }
.recent-mails .small { display: block; }

/* One-click random alias: on the alias list and under the aliases in
   the sidebar; the result line shows the copied address. */
.random-alias { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: 0 0 1rem; }
.random-alias select { width: auto; }
.nav-random { padding: .25rem .75rem .5rem; display: flex; flex-direction: column; gap: .25rem; align-items: flex-start; }
.nav-random [data-random-result] { word-break: break-all; }

/* --- Keyboard and density ------------------------------------------------- */
.mail-list tr.kb-focus { outline: 2px solid var(--accent); outline-offset: -2px; }
.mail-list .q-spam { display: none; }
body.compact .mail-list td { padding-top: .2rem; padding-bottom: .2rem; }
body.compact .mail-list .col-sender .small { display: none; }
@media (min-width: 40.01rem) {
  body.compact .mail-list .col-subject a { display: inline-block; max-width: 34rem; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
}
.shortcuts-dialog { max-width: 32rem; width: calc(100% - 2rem); border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg); color: var(--text); padding: 1rem 1.25rem; box-shadow: var(--shadow); }
.shortcuts-dialog::backdrop { background: rgb(0 0 0 / .35); }
.shortcuts-dialog dl { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0 0 1rem; }
.shortcuts-dialog dt { text-align: right; }
.shortcuts-dialog kbd { font: inherit; font-family: ui-monospace, monospace; border: 1px solid var(--border);
  border-bottom-width: 2px; border-radius: 4px; padding: 0 .35em; }
.inbox-tools { display: flex; gap: .75rem; align-items: center; justify-content: flex-end; margin: -.25rem 0 .5rem; }
@media (max-width: 40rem) { .inbox-tools .kb-hint { display: none; } }

/* --- Alias suggestions ---------------------------------------------------- */
.block { display: block; }
.suggestions tr.done { opacity: .6; }
.suggestions td .small.block { margin-top: .15rem; }
.suggestions-actions { margin-top: 1rem; }

/* A page heading with an action next to it (inbox: New mail). */
.heading-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; }
.heading-row h1 { margin-bottom: .5rem; }

/* --- Unsubscribe overview ------------------------------------------------- */
.error-text { color: var(--warning); }
.unsubscribe td.actions { white-space: nowrap; }
@media (max-width: 40rem) { .unsubscribe td.actions { white-space: normal; } }
