/* No webfont is loaded. A mail client that fetches type from a CDN tells that
 * CDN when its owner reads mail.
 *
 * Weights use only 400/500/600/700, which every system face has. Intermediate
 * weights render on macOS and collapse elsewhere.
 */

/* --- tokens --------------------------------------------------------------- */

:root {
  color-scheme: light dark;

  --font-ui: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
             "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
               "Liberation Mono", monospace;

  --paper-rail: oklch(94.5% 0.008 252);
  --paper-list: oklch(97.5% 0.005 250);
  --paper-read: oklch(100% 0 0);
  --paper-hover: oklch(92.5% 0.011 252);
  --field: oklch(100% 0 0);

  --ink: oklch(24% 0.02 262);
  --ink-2: oklch(44% 0.018 260);
  --ink-3: oklch(52% 0.016 258);
  --line: oklch(87% 0.011 252);
  --line-strong: oklch(78% 0.013 252);

  --accent: oklch(51% 0.19 259);
  --accent-hover: oklch(44% 0.19 259);
  --on-accent: oklch(99% 0.002 250);
  --focus: oklch(52% 0.18 259);
  --focus-ring: oklch(72% 0.14 259);

  --accent-wash: oklch(95% 0.03 259);
  --danger: oklch(46% 0.17 27);
  --danger-wash: oklch(95.5% 0.035 27);

  --s1: 0.25rem; --s2: 0.5rem;  --s3: 0.75rem; --s4: 1rem;
  --s5: 1.25rem; --s6: 1.5rem;  --s8: 2rem;    --s10: 2.5rem;
  --s12: 3rem;

  --text-xs: 0.75rem;
  --text-sm: 0.8125rem;
  --text-base: 0.875rem;
  --text-lg: 1.25rem;
  --text-xl: 1.75rem;

  --r1: 0.25rem;
  --r2: 0.375rem;
  --r-full: 999px;

  --dur: 110ms;
  --ease: cubic-bezier(0.2, 0, 0, 1);

  /* Shared by all three panes so their columns start on one line. */
  --pane-top: var(--s6);
  --rail-w: 14rem;
  --list-w: 22rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper-rail: oklch(15.5% 0.014 262);
    --paper-list: oklch(20.5% 0.015 262);
    --paper-read: oklch(25.5% 0.017 262);
    --paper-hover: oklch(26% 0.02 262);
    --field: oklch(14.5% 0.012 262);

    --ink: oklch(94% 0.006 250);
    --ink-2: oklch(78% 0.012 252);
    --ink-3: oklch(68% 0.016 254);
    --line: oklch(33% 0.02 260);
    --line-strong: oklch(45% 0.022 260);

    --accent: oklch(74% 0.14 258);
    --accent-hover: oklch(84% 0.11 258);
    --on-accent: oklch(18% 0.014 262);
    --focus: oklch(74% 0.14 258);
    --focus-ring: oklch(58% 0.15 259);

    --accent-wash: oklch(30% 0.055 259);
    --danger: oklch(74% 0.14 27);
    --danger-wash: oklch(30% 0.07 27);
  }
}

/* --- base ----------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  overflow-x: clip;
  background: var(--paper-read);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--text-base);
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

h1, h2 {
  font-style: normal;
  font-weight: 700;
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
  min-width: 0;
  margin: 0;
}

a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: var(--r1);
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* --- form controls -------------------------------------------------------- */

input[type="email"],
input[type="password"],
input[type="search"],
input[type="text"],
textarea,
select {
  width: 100%;
  min-width: 0;
  padding: 0.5rem 0.625rem;
  font: inherit;
  color: var(--ink);
  background: var(--field);
  border: 1px solid var(--line-strong);
  border-radius: var(--r2);
  transition: border-color var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease);
  -webkit-appearance: none;
  appearance: none;
}
input:hover, textarea:hover, select:hover { border-color: var(--ink-3); }
input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}
textarea {
  min-height: 18em;
  resize: vertical;
  line-height: 1.6;
  /* The body is plain text and people wrap it by hand; a proportional face
     would hide where the lines actually fall. */
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}
select { padding-right: var(--s2); }
input::placeholder { color: var(--ink-3); }
input:disabled, textarea:disabled, select:disabled { opacity: 0.55; cursor: not-allowed; }

button {
  font: inherit;
  cursor: pointer;
  border-radius: var(--r2);
  transition: background-color var(--dur) var(--ease),
              border-color var(--dur) var(--ease),
              color var(--dur) var(--ease);
}
button:disabled { opacity: 0.55; cursor: not-allowed; }

.primary {
  width: 100%;
  padding: 0.5625rem var(--s4);
  font-weight: 600;
  color: var(--on-accent);
  background: var(--accent);
  border: 1px solid var(--accent);
}
.primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.primary:active:not(:disabled) { background: var(--accent-hover); transform: translateY(1px); }

.link-button {
  padding: var(--s1) 0;
  color: var(--ink-3);
  background: none;
  border: 0;
  font-size: var(--text-sm);
}
.link-button:hover { color: var(--accent); }
.link-button:active { color: var(--accent-hover); }

/* --- notices -------------------------------------------------------------- */

.notice {
  margin: 0 0 var(--s4);
  padding: var(--s2) var(--s3);
  font-size: var(--text-sm);
  color: var(--ink-2);
  background: var(--paper-hover);
  border-left: 2px solid var(--line-strong);
  border-radius: 0 var(--r1) var(--r1) 0;
}
.notice-error { color: var(--danger); background: var(--danger-wash); border-left-color: var(--danger); }
.notice-ok { color: var(--accent); background: var(--accent-wash); border-left-color: var(--accent); }

/* The filter's verdict outranks the message's own subject: the subject is the
   sender's claim, this is what the server found. */
.verdict {
  margin: 0 0 var(--s5);
  padding: var(--s3);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--danger);
  background: var(--danger-wash);
  border-left: 3px solid var(--danger);
  border-radius: 0 var(--r1) var(--r1) 0;
}
.verdict .detail {
  display: block;
  margin-top: var(--s1);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 400;
}

/* --- sign in -------------------------------------------------------------- */

.gate {
  display: grid;
  place-content: center;
  min-height: 100dvh;
  padding: var(--s10) var(--s6);
  background: var(--paper-list);
}

.gate-form { width: min(21rem, 100%); }

/* The logo (internal/brand): ink is the text colour, the flag the accent. */
.logo { width: 1.5rem; height: 1.5rem; flex: 0 0 auto; fill: currentColor; }
.logo .flag { fill: var(--accent); }
.brand, .wordmark { display: flex; align-items: center; gap: var(--s2); }
.brand {
  margin-bottom: var(--s3);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  letter-spacing: 0.02em;
  color: var(--ink);
}

.wordmark {
  margin: 0 0 var(--s10);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  letter-spacing: 0.02em;
  color: var(--ink-2);
}

.gate-form h1 { font-size: var(--text-xl); }

.gate-host {
  margin: var(--s1) 0 var(--s8);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--ink-3);
}

.field { margin-bottom: var(--s4); }
.field label {
  display: block;
  margin-bottom: var(--s1);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--ink-2);
}

/* --- app shell ------------------------------------------------------------ */
/* Three panes, held even when nothing is open, so the list does not jump
   sideways the moment a message is clicked. The reader keeps a floor: a third
   column is only worth having if what it holds is still readable. */

.app {
  display: grid;
  grid-template-columns: var(--rail-w) minmax(16rem, var(--list-w)) minmax(34rem, 1fr);
  height: 100dvh;
}

.rail, .list-pane, .reader {
  min-height: 0;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
}

/* --- rail ----------------------------------------------------------------- */

.rail {
  display: flex;
  flex-direction: column;
  gap: var(--s5);
  padding: var(--pane-top) var(--s3) var(--s4);
  background: var(--paper-rail);
}

.identity {
  display: flex;
  flex-direction: column;
  padding: 0 var(--s2);
}
.identity .account {
  font-weight: 600;
  overflow-wrap: anywhere;
}
.identity .host {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--ink-3);
}

.folders { display: flex; flex-direction: column; }

.folder {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2);
  padding: 0.3125rem var(--s2);
  border-radius: var(--r2);
  color: var(--ink-2);
  white-space: nowrap;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.folder:hover { background: var(--paper-hover); color: var(--ink); }
.folder:active { background: var(--line); }
/* Where-you-are is carried by surface and weight, not colour. The accent means
   one thing in this interface - unread, or something you can click - and the
   folder you are already in is neither. */
.folder.is-active {
  background: var(--paper-hover);
  color: var(--ink);
  font-weight: 600;
  box-shadow: inset 2px 0 0 var(--ink);
}
.folder-name { overflow: hidden; text-overflow: ellipsis; }

.badge {
  padding: 0.0625rem 0.375rem;
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--on-accent);
  background: var(--accent);
  border-radius: var(--r-full);
}

/* Sits above the folder list because starting a message is an action, not a
   place, and it is the one thing here that is not navigation. */
.compose-new {
  display: block;
  padding: 0.375rem var(--s3);
  border: 1px solid var(--line-strong);
  border-radius: var(--r2);
  background: var(--paper-read);
  color: var(--ink);
  font-weight: 500;
  text-align: center;
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.compose-new:hover { border-color: var(--accent); color: var(--accent); }
.compose-new:active { background: var(--paper-hover); }

.signout { margin-top: auto; padding: 0 var(--s2); }

/* --- list ----------------------------------------------------------------- */

.list-pane { background: var(--paper-list); }

.search {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  gap: var(--s2);
  padding: var(--pane-top) var(--s4) var(--s3);
  background: var(--paper-list);
  /* An edge, so rows scrolling under it are cut at a line rather than
     disappearing into flat colour. */
  box-shadow: 0 1px 0 var(--line);
}
.search input { flex: 1 1 auto; }
.search button {
  flex: 0 0 auto;
  padding: 0 var(--s3);
  color: var(--ink-2);
  background: var(--paper-hover);
  border: 1px solid var(--line-strong);
  font-size: var(--text-sm);
}
.search button:hover { color: var(--accent); border-color: var(--accent); }
.search button:active { background: var(--line); }

/* With a pointer and a single field, Enter submits and the button repeats the
   word already in the placeholder. Touch keeps it. */
@media (min-width: 721px) and (pointer: fine) {
  .search button {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
}

.list-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s3);
  padding: var(--s4) var(--s4) var(--s3);
}
.list-head h1 {
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0;
  color: var(--ink-2);
}
/* Wide enough for the rail, the folder name is already on screen and
   highlighted. Narrow enough that the rail is a scrolling strip, this is the
   only thing telling you where you are. */
@media (min-width: 721px) {
  .list-head:not(.is-search) { display: none; }
}

.clear { font-size: var(--text-sm); color: var(--accent); }
.clear:hover { text-decoration: underline; text-underline-offset: 2px; }

.messages { margin: 0; padding: 0; list-style: none; }

.message-row { border-top: 1px solid var(--line); }
.message-row:first-child { border-top: 0; }

/* Selecting (bulk.go). The box sits beside the link, never inside it, so
   ticking a row does not open it. */
.message-row { display: flex; align-items: stretch; }
.pick {
  display: flex;
  align-items: center;
  justify-content: center;
  /* A target wide enough for a thumb; the box itself stays small. In px:
     the root type is 14px, so 2.75rem would fall short. */
  min-width: 44px;
  padding: 0 0 0 var(--s2);
  cursor: pointer;
}
.pick input, .bulk-all input { width: 1rem; height: 1rem; margin: 0; accent-color: var(--accent); }
.message-row > a { flex: 1 1 auto; min-width: 0; }

.bulk-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2) var(--s4);
  padding: var(--s2) var(--s4);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: var(--text-sm);
}
.bulk-pick, .bulk-actions, .bulk-move {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s2);
}
.bulk-pick { gap: var(--s2) var(--s4); }
.bulk-pick a { color: var(--accent); }
.bulk-pick a:hover { text-decoration: underline; text-underline-offset: 2px; }
.bulk-all { display: inline-flex; align-items: center; gap: var(--s2); color: var(--ink-2); cursor: pointer; }
.bulk-bar button {
  padding: var(--s1) var(--s3);
  color: var(--ink-2);
  background: transparent;
  border: 1px solid var(--line-strong);
}
.bulk-bar button:hover { color: var(--accent); border-color: var(--accent); }
.bulk-bar button:active { background: var(--line); }
.bulk-bar select { width: auto; padding-top: var(--s1); padding-bottom: var(--s1); font-size: var(--text-sm); }
.bulk-bar a:focus-visible, .bulk-bar button:focus-visible, .pick input:focus-visible, .bulk-all input:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.primary.danger { background: var(--danger); border-color: var(--danger); }
.primary.danger:hover:not(:disabled), .primary.danger:active:not(:disabled) {
  background: var(--danger);
  border-color: var(--danger);
  filter: brightness(0.92);
}
.reader.bulk-confirm > * { max-width: 36rem; }
.reader.bulk-confirm > .notice { margin-bottom: var(--s4); }
.bulk-confirm h1 { font-size: var(--text-lg); line-height: 1.3; margin-bottom: var(--s4); text-wrap: pretty; }

.message-row > a {
  display: flex;
  gap: 0.625rem;
  padding: var(--s2) var(--s4) var(--s2) var(--s3);
  transition: background-color var(--dur) var(--ease);
}
.message-row > a:hover { background: var(--paper-hover); }
.message-row > a:active { background: var(--line); }
.message-row.is-open > a {
  background: var(--paper-hover);
  box-shadow: inset 2px 0 0 var(--accent);
}

/* Unread is a mark at the leading edge, where scanning starts. An avatar of
   initials would spell "NR" for no-reply@, and machines send most mail. */
.dot {
  flex: 0 0 0.375rem;
  height: 0.375rem;
  margin-top: 0.6em;
  border-radius: var(--r-full);
  background: transparent;
}
.is-unread .dot { background: var(--accent); }

.row-body { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.row-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s3);
}
.sender {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.35;
  color: var(--ink-2);
}
.is-unread .sender { color: var(--ink); font-weight: 600; }

.row-top time {
  flex: 0 0 auto;
  min-width: 3.75rem;
  text-align: right;
  font-size: var(--text-xs);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--ink-3);
}

.subject {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--text-sm);
  line-height: 1.35;
  color: var(--ink-2);
}
.is-unread .subject { color: var(--ink); font-weight: 500; }

.row-meta {
  display: flex;
  gap: var(--s2);
  margin-top: var(--s1);
  font-size: var(--text-xs);
  color: var(--ink-3);
}
.tag {
  padding: 0 0.3125rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--r1);
  white-space: nowrap;
}
.why { color: var(--ink-3); }

.empty {
  padding: var(--s6) var(--s4);
  color: var(--ink-3);
  text-wrap: pretty;
}
.empty code { font-family: var(--font-mono); color: var(--ink-2); }

/* --- reader --------------------------------------------------------------- */

.reader {
  padding: var(--pane-top) var(--s8) var(--s12);
  background: var(--paper-read);
}
/* Centred measure. A 68ch column pinned to the left of the widest pane leaves
   a third of the screen as rag on every message. */
.reader > * { max-width: 68ch; margin-inline: auto; }

.back {
  display: none;
  font-size: var(--text-sm);
  color: var(--accent);
}
.back:hover { text-decoration: underline; text-underline-offset: 2px; }

.reader-head { margin-bottom: var(--s8); }
.reader-head h1 {
  font-size: var(--text-lg);
  line-height: 1.3;
  margin-bottom: var(--s5);
  text-wrap: pretty;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s4);
  margin: calc(var(--s5) * -1) 0 var(--s5);
  font-size: var(--text-sm);
}
.actions a { color: var(--accent); }
.actions a:hover { text-decoration: underline; text-underline-offset: 2px; }

/* --- compose -------------------------------------------------------------- */

.compose > * { max-width: 36rem; }
.compose h1 { font-size: var(--text-lg); margin-bottom: var(--s6); }
.compose .field { margin-bottom: var(--s4); }
.compose .field label {
  display: block;
  margin-bottom: var(--s1);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--ink-2);
}
.optional { font-weight: 400; color: var(--ink-3); }
.hint {
  margin: var(--s1) 0 0;
  font-size: var(--text-xs);
  color: var(--ink-3);
}
.hint code { font-family: var(--font-mono); color: var(--ink-2); }
.field-fixed {
  margin: 0;
  padding: 0.5rem 0;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--ink-2);
}

.compose-actions {
  display: flex;
  align-items: center;
  gap: var(--s5);
  margin-top: var(--s6);
}
.compose-actions .primary { width: auto; min-width: 8rem; }
.discard { font-size: var(--text-sm); color: var(--ink-3); }
.discard:hover { color: var(--danger); }

.envelope {
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 1fr);
  gap: var(--s1) var(--s3);
  margin: 0 0 var(--s5);
  padding-bottom: var(--s5);
  border-bottom: 1px solid var(--line);
  font-size: var(--text-sm);
}
.envelope dt { color: var(--ink-3); }
.envelope dd {
  margin: 0;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}
.envelope dd time { font-variant-numeric: tabular-nums; }
.envelope .addr { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--ink-3); }

.body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.65;
  color: var(--ink);
}

/* The rich view is the sender's own document in a sandboxed frame. There is
   no script on this page to size it to its content, so it takes most of the
   viewport and can be dragged taller. Mail is designed against white, so the
   frame stays white in dark mode rather than inverting someone's layout. */
.html-body {
  display: block;
  width: 100%;
  height: 75vh;
  min-height: 20rem;
  border: 1px solid var(--line);
  border-radius: var(--r1);
  background: #fff;
  resize: vertical;
}

/* An empty pane needs no caption saying it is empty. */
.reader-idle { background: var(--paper-read); }

/* --- two panes ------------------------------------------------------------ */
/* Below this the third column would be narrower than a readable measure, so
   the list and the reader take turns. */

@media (max-width: 1120px) {
  .app { grid-template-columns: var(--rail-w) minmax(0, 1fr); }
  .app .reader { display: none; }
  .app.reading .list-pane { display: none; }
  .app.reading .reader { display: block; }
  .app.reading .back {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    margin: calc(var(--s2) * -1) 0 var(--s2) calc(var(--s2) * -1);
    padding: var(--s2);
  }
  .reader { padding: var(--pane-top) var(--s6) var(--s12); }
}

/* The list inherits the reader's width here, which is far more than a row of
   sender-and-date was drawn for. */
@media (min-width: 721px) and (max-width: 1120px) {
  .row-body { max-width: 34rem; }
}

/* --- one column ----------------------------------------------------------- */

@media (max-width: 720px) {
  .app {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
  }

  .rail {
    flex-direction: row;
    align-items: center;
    gap: var(--s3);
    overflow: hidden;
    padding: var(--s2) var(--s3);
    border-bottom: 1px solid var(--line);
  }
  .identity { flex: 0 0 auto; }
  .identity .account {
    max-width: 9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .identity .host { display: none; }

  /* Only the folders scroll. Sign out stays put, rather than ending up past
     the end of a strip that has no visible scrollbar. */
  .folders {
    flex: 1 1 auto;
    flex-direction: row;
    gap: var(--s1);
    min-width: 0;
    overflow-x: auto;
    mask-image: linear-gradient(90deg, #000 calc(100% - 2rem), transparent);
  }
  .signout { flex: 0 0 auto; margin-top: 0; padding: 0 0 0 var(--s2); }

  .search { padding: var(--s3) var(--s4); }
  .reader { padding: var(--s4) var(--s4) var(--s12); }
}

@media (max-width: 480px) {
  /* The account name costs a third of the strip to tell the only person who
     can be signed in something they already know. */
  .identity { display: none; }
  .search { padding: var(--s3); }
  .list-head { padding: var(--s3); }
  .message-row > a { padding: var(--s2) var(--s3); }
  .pick { padding-left: var(--s1); }
  .bulk-bar { padding: var(--s2) var(--s3); }
  .reader { padding: var(--s4) var(--s3) var(--s12); }
  .envelope { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .envelope dt { margin-top: var(--s3); }
  .envelope dt:first-of-type { margin-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 1ms !important;
    animation-duration: 1ms !important;
  }
  .primary:active:not(:disabled) { transform: none; }
}

/* --- unsubscribe page ----------------------------------------------------- */
/* Running text at 16px and nothing under 12px, on the reading paper, with
 * ink and ink-2 only, which hold 4.5:1 there in both schemes. */

.unsub {
  background: var(--paper-read);
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.5;
}
.unsub-top {
  display: flex;
  justify-content: space-between;
  gap: var(--s4);
  padding: var(--s4) var(--s6);
  border-bottom: 1px solid var(--line);
  background: var(--paper-read);
}
.unsub-back { color: var(--accent); }
.unsub-account { color: var(--ink-2); }
.unsub-main { max-width: 56rem; margin: 0 auto; padding: var(--s6); }
.unsub-main h1 { font-size: var(--text-xl); margin-bottom: var(--s3); }
.unsub-main h2 { font-size: var(--text-lg); margin: var(--s8) 0 var(--s3); }
.unsub-lede, .unsub-empty, .unsub-foot { color: var(--ink-2); max-width: 44rem; }
.unsub-main .notice { font-size: 1rem; }
.unsub-table { width: 100%; border-collapse: collapse; }
.unsub-table th, .unsub-table td {
  text-align: left;
  vertical-align: top;
  padding: var(--s3) var(--s3) var(--s3) 0;
  border-bottom: 1px solid var(--line);
}
.unsub-table thead th { color: var(--ink-2); font-weight: 600; border-bottom-color: var(--line-strong); }
.unsub-table .num { text-align: right; padding-right: var(--s6); font-variant-numeric: tabular-nums; }
.unsub-name { font-weight: 600; overflow-wrap: anywhere; }
.unsub-note { display: block; font-weight: 400; font-size: 0.875rem; color: var(--ink-2); }
.unsub-host, .unsub-done, .unsub-none { margin: var(--s1) 0 0; color: var(--ink-2); }
.unsub-host { overflow-wrap: anywhere; }
.unsub button { font-size: 1rem; }
.unsub-undo {
  margin-top: var(--s2);
  background: none;
  border: 1px solid var(--line-strong);
  color: var(--ink);
}
.unsub button:focus-visible, .unsub a:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }

/* The link taken from a sender's message is the only action in its cell,
   so it must look like one: colour and an underline, not colour alone. */
.unsub-body-link {
  display: inline-block;
  padding: var(--s2) 0;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  overflow-wrap: anywhere;
}
.unsub-body-link:hover { color: var(--accent-hover); }

/* --- app passwords page ---------------------------------------------------- */

.apppw-new {
  margin: var(--s6) 0;
  padding: var(--s4);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
}
.apppw-new h2 { margin-top: 0; overflow-wrap: anywhere; }
.apppw-secret code {
  display: block;
  padding: var(--s3);
  font-size: 1rem;
  overflow-wrap: anywhere;
  user-select: all;
}
.apppw-phone {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s5);
  align-items: flex-start;
  margin-top: var(--s5);
  padding-top: var(--s5);
  border-top: 1px solid var(--line);
}
.apppw-phone > div { flex: 1 1 18rem; min-width: 0; }
.apppw-phone h3 { margin: 0 0 var(--s2); font-size: 1rem; }
/* A QR code is read as dark on light, whatever the theme. */
.apppw-qr {
  flex: 0 0 auto;
  /* The padding sits outside the picture, so the picture keeps its own
     size: a whole number of pixels for every module of the code. */
  box-sizing: content-box;
  padding: var(--s2);
  background: #fff;
  border-radius: 6px;
  image-rendering: pixelated;
}
.apppw-link { overflow-wrap: anywhere; user-select: all; font-family: var(--font-mono); font-size: var(--text-sm); }
/* 44px, not rem: the root type is 14px, so 2.75rem falls short of a thumb. */
.phone-setup-button { display: inline-flex; align-items: center; justify-content: center; width: auto; min-height: 44px; border-radius: var(--r2); padding-left: var(--s6); padding-right: var(--s6); text-align: center; }
.phone-setup-next { max-width: 44rem; margin: var(--s4) 0; padding-left: var(--s5); }
.phone-setup-next li { margin-bottom: var(--s3); }
.phone-setup-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s1); margin: var(--s4) 0; }
.phone-setup-list dt { margin-top: var(--s3); color: var(--ink-2); font-size: var(--text-sm); }
.phone-setup-list dd { margin: 0; overflow-wrap: anywhere; }
.phone-setup-list code { user-select: all; font-size: 1rem; }
.apppw-again { width: auto; padding-left: var(--s6); padding-right: var(--s6); }
.apppw-form { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
.apppw-form input[type="text"] { flex: 1 1 16rem; font-size: 1rem; }
