/* z•mail web — colors and type match the iOS iPad landscape UI (Theme.swift).
   System font stack only; Avenir Next is not bundled. */

:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-raised: #e6e8ee;
  --hairline: #d8dce3;
  --text: #0b0c0e;
  --text-2: #5c6470;
  --brand: #4a90e2;
  --brand-muted: rgba(74, 144, 226, 0.14);
  --dot: #c4453a;
  --danger: #e11d48;
  --warning: #d97706;
  --success: #16a34a;
  --indigo: #4f46e5;
  --security: #dc2626;
  --pdf: #a0675f;
  --image: #7a6e9c;
  --sheet: #5f8566;
  --document: #5a7a9c;
  --other: #74787f;
  --header-h: 52px;
  --footer-h: 56px;
  --list-w: 420px;
  --radius: 14px;
  --radius-sm: 12px;
  --motion: 0.18s;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  /* On-device Avenir Next if present (same names as the native About); never bundled. */
  --znorx-type: "AvenirNext-Regular", "Avenir Next", Avenir, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --zmail-text-scale: 1;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0c0e;
    --surface: #14161a;
    --surface-raised: #1c1f26;
    --hairline: #232730;
    --text: #f3f4f6;
    --text-2: #8b929e;
    --danger: #f43f5e;
    --warning: #f59e0b;
    --success: #22c55e;
    --indigo: #6366f1;
    --security: #ef4444;
    --pdf: #c4918a;
    --image: #a79cc4;
    --sheet: #8ab092;
    --document: #87a5c4;
    --other: #9da1a8;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); }
button, input, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
button:disabled { opacity: 0.4; cursor: default; }
button:focus-visible, input:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
img { max-width: 100%; }
a { color: var(--brand); }

.app {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--bg);
}

/* —— Header (full width, above both panes) —— */
.header {
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--header-h);
  padding: 8px 16px;
  flex-shrink: 0;
}
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.wordmark {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--text);
  line-height: 0;
}
.wordmark-z {
  width: 17px;
  height: 17px;
  color: var(--brand);
  display: block;
  overflow: visible;
}
.wordmark-dot {
  width: 7.2px;
  height: 7.2px;
  margin-left: 8.5px;
  border-radius: 50%;
  background: var(--dot);
  flex-shrink: 0;
}
.wordmark-mail {
  margin-left: 6px;
  font-size: 23.5px;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1;
  padding-bottom: 1px;
}

.icon-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-raised);
  border-radius: 50%;
  color: var(--text);
}
.icon-btn svg { width: 15px; height: 15px; }
.icon-btn.capsule {
  width: auto;
  padding: 6px 10px;
  border-radius: 999px;
}

/* —— Split —— */
.split {
  display: flex;
  flex: 1;
  min-height: 0;
  border-top: 1px solid var(--hairline);
}
.pane-left {
  width: var(--list-w);
  max-width: 420px;
  min-width: 320px;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--bg);
}
.pane-right {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--bg);
  border-left: 1px solid var(--hairline);
}
.pane-body { flex: 1; min-height: 0; overflow: auto; }

/* —— Footer (56px, aligned across both panes) —— */
.footer {
  height: var(--footer-h);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding: 0 10px;
  background: var(--surface);
  border-top: 1px solid var(--hairline);
}
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 14px;
  border-radius: 12px;
  color: var(--text-2);
}
.tab svg { width: 16px; height: 16px; }
.tab span { font-size: 10px; font-weight: 600; }
.tab.active { color: var(--text); background: var(--surface-raised); }
.compose-btn {
  margin-left: auto;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-raised);
  border-radius: 50%;
  color: var(--text);
}
.compose-btn svg { width: 18px; height: 18px; }

.reader-actions { width: 100%; display: flex; }
.bar-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--text);
  padding: 6px 0;
}
.bar-btn svg { width: 16px; height: 16px; }
.bar-btn span { font-size: 9px; font-weight: 500; }
.bar-btn:hover { color: var(--brand); }

/* —— Pills / action strip —— */
.action-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px 8px;
  flex-shrink: 0;
}
.pill {
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--text-2);
  white-space: nowrap;
}
.pill.active {
  background: var(--surface-raised);
  color: var(--text);
}
.pill.accent { background: var(--brand); color: #fff; border-color: transparent; }
.action-strip .spacer { flex: 1; }

/* —— Search —— */
.search-wrap { padding: 0 16px 8px; flex-shrink: 0; }
.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--surface);
  border-radius: 10px;
}
.search-bar input {
  flex: 1;
  border: 0;
  background: transparent;
  outline: none;
  min-width: 0;
}
.search-bar svg { width: 14px; height: 14px; color: var(--text-2); flex-shrink: 0; }
.search-meta {
  display: inline-block;
  margin-top: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--brand);
  background: var(--brand-muted);
  padding: 3px 8px;
  border-radius: 999px;
}

/* —— Folder heading —— */
.folder-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px 6px;
  flex-shrink: 0;
}
.folder-title {
  font-size: 20px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.folder-title svg { width: 11px; height: 11px; color: var(--text-2); }
.count-badge {
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: var(--brand);
  padding: 2px 7px;
  border-radius: 999px;
}
.folder-menu {
  position: relative;
}
.folder-pop {
  position: absolute;
  top: 100%;
  left: 16px;
  z-index: 20;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 6px;
  min-width: 160px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
}
.folder-pop button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
}
.folder-pop button:hover, .folder-pop button.active { background: var(--surface-raised); }

/* —— Demo / account hint —— */
.hint-card {
  margin: 0 16px 8px;
  padding: 12px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  display: flex;
  gap: 10px;
  align-items: center;
}
.hint-card h3 { margin: 0 0 4px; font-size: 13px; font-weight: 600; }
.hint-card p { margin: 0; font-size: 12px; color: var(--text-2); }

/* —— Digest banner (compact, left pane) —— */
.digest-banner {
  margin: 0 16px 10px;
  padding: 12px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--brand) 35%, transparent);
  text-align: left;
  width: calc(100% - 32px);
  cursor: pointer;
}
.digest-banner .row { display: flex; align-items: center; gap: 8px; }
.kicker {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.6px;
  color: var(--text-2);
  text-transform: none;
}
.producer {
  font-size: 11px;
  font-weight: 600;
  color: var(--brand);
  background: var(--brand-muted);
  padding: 3px 8px;
  border-radius: 999px;
}
.digest-banner .banner-text {
  margin: 8px 0 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.count-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.count-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 999px;
}
.count-pill.warn { color: var(--warning); background: color-mix(in srgb, var(--warning) 14%, transparent); }
.count-pill.indigo { color: var(--indigo); background: color-mix(in srgb, var(--indigo) 14%, transparent); }
.count-pill.muted { color: var(--text-2); background: color-mix(in srgb, var(--text-2) 14%, transparent); }

/* —— Message list —— */
.msg-list { padding-bottom: 8px; }
.msg-row {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 16px;
  position: relative;
  background: var(--bg);
  border: 0;
  cursor: pointer;
}
.msg-row.selected { background: var(--surface); }
.msg-row .top, .msg-row .mid, .msg-row .snipo {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.sender {
  font-size: calc(15px * var(--zmail-text-scale, 1));
  color: var(--text);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.msg-row.unread .sender, .msg-row.unread .subject { font-weight: 600; }
.paperclip { width: 11px; height: 11px; color: var(--text-2); flex-shrink: 0; }
.digest-tag {
  font-size: calc(9px * var(--zmail-text-scale, 1));
  font-weight: 700;
  letter-spacing: 0.4px;
  color: var(--brand);
  background: var(--brand-muted);
  padding: 2px 6px;
  border-radius: 999px;
  flex-shrink: 0;
}
.when {
  margin-left: auto;
  font-size: calc(12px * var(--zmail-text-scale, 1));
  font-weight: 500;
  color: var(--text-2);
  flex-shrink: 0;
}
.subject {
  font-size: calc(13.5px * var(--zmail-text-scale, 1));
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
}
.snipo {
  margin-top: 2px;
  font-size: calc(13px * var(--zmail-text-scale, 1));
  color: var(--text-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
}
.unread-dot {
  position: absolute;
  left: 13px;
  top: 15px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
}
.msg-row .inner { padding-left: 12px; }
.msg-row + .msg-row .inner, .msg-row .rule {
  /* hairline is drawn under each row, inset like iOS */
}
.msg-row .rule {
  height: 1px;
  background: var(--hairline);
  margin: 9px 0 -9px 12px;
}
.check {
  width: 22px;
  height: 22px;
  margin-right: 12px;
  flex-shrink: 0;
  color: var(--text-2);
}
.msg-row.picked .check { color: var(--brand); }
.msg-row.selecting .top-line { display: flex; }

.load-older {
  display: block;
  margin: 12px auto 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand);
  padding: 8px 14px;
}

.empty-state {
  text-align: center;
  padding: 48px 24px 0;
  color: var(--text-2);
}
.empty-state h3 { margin: 10px 0 6px; font-size: 17px; font-weight: 600; color: var(--text); }
.empty-state p { margin: 0; font-size: 14px; }
.sync-line {
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  padding: 4px 16px 8px;
}

/* —— Right pane: digest expanded —— */
.digest-pane { display: flex; flex-direction: column; height: 100%; }
.digest-chrome {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px 6px;
  flex-shrink: 0;
}
.digest-chrome .kicker { font-size: 12px; font-weight: 600; letter-spacing: 0.8px; }
.digest-scroll { flex: 1; overflow: auto; padding: 8px 16px 36px; }

.digest-header {
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  margin-bottom: 16px;
}
.digest-header .row { display: flex; align-items: center; gap: 8px; }
.digest-header h2 {
  margin: 10px 0 0;
  font-size: calc(17px * var(--zmail-text-scale, 1));
  font-weight: 600;
}
.digest-header .summary {
  margin: 8px 0 0;
  font-size: calc(15px * var(--zmail-text-scale, 1));
  color: var(--text);
}
.high-pill {
  font-size: 11px;
  font-weight: 700;
  color: var(--security);
  background: color-mix(in srgb, var(--security) 16%, transparent);
  padding: 4px 8px;
  border-radius: 999px;
}

.section-label {
  margin: 16px 0 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.7px;
  color: var(--text-2);
  text-transform: uppercase;
}

.item-card {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px;
  margin-bottom: 8px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--motion) ease, border-color var(--motion) ease;
}
.item-card.highlight {
  background: color-mix(in srgb, var(--indigo) 10%, transparent);
  border-color: color-mix(in srgb, var(--indigo) 45%, transparent);
}
.item-card h3 {
  margin: 0;
  font-size: calc(15px * var(--zmail-text-scale, 1));
  font-weight: 600;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.item-card h3 .grow { flex: 1; min-width: 0; }
.amount {
  font-size: calc(12px * var(--zmail-text-scale, 1));
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  flex-shrink: 0;
}
.item-meta {
  margin-top: 8px;
  font-size: calc(12px * var(--zmail-text-scale, 1));
  font-weight: 500;
  color: var(--text-2);
}
.item-summary {
  margin-top: 8px;
  font-size: calc(13.5px * var(--zmail-text-scale, 1));
  color: var(--text-2);
}
.next-step {
  margin-top: 8px;
  padding: 8px;
  border-radius: 8px;
  font-size: calc(13px * var(--zmail-text-scale, 1));
  font-weight: 500;
  display: flex;
  gap: 6px;
  align-items: flex-start;
}
.next-step svg { width: 13px; height: 13px; flex-shrink: 0; margin-top: 2px; }
.ref-chip, .link-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--brand);
  background: var(--brand-muted);
  padding: 5px 8px;
  border-radius: 999px;
  max-width: 100%;
}
.ref-chip svg, .link-chip svg { width: 14px; height: 14px; }
.ref-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-card .link { display: inline-block; margin-top: 8px; font-size: 12px; font-weight: 500; }

.cleanup-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-2);
  background: var(--surface-raised);
  padding: 6px 9px;
  border-radius: 999px;
  margin: 0 8px 8px 0;
}

/* —— Reader —— */
.reader { display: flex; flex-direction: column; height: 100%; }
.reader-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  flex-shrink: 0;
  min-height: 44px;
}
.nav-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  background: var(--surface-raised);
  padding: 0 12px;
  height: 32px;
  border-radius: 999px;
}
.nav-chip svg { width: 12px; height: 12px; }
.toolbar-title {
  flex: 1;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}
.step-btns { display: flex; gap: 6px; }
.reader-scroll { flex: 1; overflow: auto; padding: 0 16px 24px; }

.header-card {
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  margin-bottom: 14px;
}
.header-card h1 {
  margin: 0 0 8px;
  font-size: calc(20px * var(--zmail-text-scale, 1));
  font-weight: 600;
}
.kv { display: flex; gap: 8px; align-items: baseline; margin-top: 4px; font-size: calc(13px * var(--zmail-text-scale, 1)); }
.kv .k { width: 36px; flex-shrink: 0; font-size: calc(12px * var(--zmail-text-scale, 1)); font-weight: 600; color: var(--text-2); }

.attach-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 8px 0;
  margin: -8px 0 8px;
}
.attach-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--surface-raised);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  max-width: 280px;
}
.attach-chip .name { overflow: hidden; text-overflow: ellipsis; }
.attach-chip .size { font-size: 11px; font-variant-numeric: tabular-nums; color: var(--text-2); font-weight: 400; }
.attach-chip svg { width: 14px; height: 14px; flex-shrink: 0; }
.attach-chip.pdf { color: var(--pdf); background: color-mix(in srgb, var(--pdf) 8%, var(--surface-raised)); }
.attach-chip.image { color: var(--image); background: color-mix(in srgb, var(--image) 8%, var(--surface-raised)); }
.attach-chip.sheet { color: var(--sheet); background: color-mix(in srgb, var(--sheet) 8%, var(--surface-raised)); }
.attach-chip.document { color: var(--document); background: color-mix(in srgb, var(--document) 8%, var(--surface-raised)); }
.attach-chip.other { color: var(--other); background: color-mix(in srgb, var(--other) 8%, var(--surface-raised)); }
.attach-chip .name, .attach-chip .size { color: var(--text); }

.thumb-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 14px;
}
.thumb {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--surface-raised);
  border: 1px solid var(--hairline);
  flex-shrink: 0;
  cursor: pointer;
}
.thumb-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  align-self: center;
  margin-left: 4px;
}

.show-images {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  background: var(--surface-raised);
  padding: 6px 10px;
  border-radius: 999px;
}

.mail-frame {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  min-height: 120px;
  overflow: hidden;
}
.plain-body {
  font-size: calc(16px * var(--zmail-text-scale, 1));
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.seg {
  display: flex;
  gap: 0;
  margin: 0 16px 8px;
  background: var(--surface-raised);
  border-radius: 9px;
  padding: 2px;
}
.seg button {
  flex: 1;
  padding: 6px 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  border-radius: 7px;
}
.seg button.on { background: var(--surface); color: var(--text); }

/* —— Lightbox —— */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: #000;
  display: flex;
  flex-direction: column;
  color: #fff;
}
.lightbox-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  flex-shrink: 0;
}
.lightbox-bar .title { flex: 1; font-size: 14px; font-weight: 600; }
.lightbox-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  overflow: hidden;
  position: relative;
}
.lightbox-stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  cursor: grab;
}
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.14);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-nav.prev { left: 16px; }
.lightbox-nav.next { right: 16px; }
.lightbox-nav:disabled { opacity: 0.3; }

/* —— Compose / settings / sign-in overlays —— */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(11, 12, 14, 0.46);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fade var(--motion) ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.sheet {
  width: min(720px, 100%);
  max-height: 100%;
  overflow: auto;
  background: var(--bg);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.35);
  animation: pop var(--motion) ease;
}
@keyframes pop {
  from { transform: translateY(8px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.sheet-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--hairline);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 1;
}
.sheet-head h2 { flex: 1; margin: 0; font-size: 16px; font-weight: 600; text-align: center; }
.sheet-body { padding: 8px 16px 20px; }
.field {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--hairline);
}
.field label {
  width: 52px;
  flex-shrink: 0;
  padding-top: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}
.field .control { flex: 1; min-width: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--surface-raised);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 13px;
}
.chip button { color: var(--text-2); display: inline-flex; }
.chip-input {
  flex: 1;
  min-width: 140px;
  border: 0;
  background: transparent;
  outline: none;
  padding: 6px 0;
  font-size: 14px;
}
.subject-input, .body-input {
  width: 100%;
  border: 0;
  background: transparent;
  outline: none;
  padding: 6px 0;
  font-size: 15px;
  resize: vertical;
}
.body-input { min-height: 220px; line-height: 1.45; }
.send-btn {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: var(--brand);
  padding: 6px 14px;
  border-radius: 999px;
}
.cancel-btn { font-size: 15px; font-weight: 500; color: var(--brand); }

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--hairline);
}
.settings-row h3 { margin: 0 0 4px; font-size: 15px; font-weight: 600; }
.settings-row p { margin: 0; font-size: 13px; color: var(--text-2); }
.danger-btn { color: var(--danger); font-weight: 600; font-size: 15px; }

.toggle {
  width: 46px;
  height: 28px;
  border-radius: 999px;
  background: var(--surface-raised);
  border: 1px solid var(--hairline);
  position: relative;
  flex-shrink: 0;
}
.toggle.on { background: var(--brand); border-color: var(--brand); }
.toggle i {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  transition: transform var(--motion) ease;
}
.toggle.on i { transform: translateX(18px); }

/* Sign-in */
.signin {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}
.signin-card {
  width: min(420px, calc(100% - 32px));
  padding: 32px 28px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  text-align: center;
}
.signin-card .wordmark { justify-content: center; margin-bottom: 18px; }
.signin-card p { color: var(--text-2); font-size: 14px; line-height: 1.45; }
.demo-link {
  display: inline-block;
  margin-top: 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand);
}
.err { color: var(--danger); font-size: 13px; margin-top: 10px; }

.error-banner {
  margin: 0 16px 8px;
  padding: 10px;
  background: color-mix(in srgb, var(--warning) 12%, transparent);
  border-radius: 10px;
  font-size: 13px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.error-banner button { font-size: 12px; font-weight: 600; color: var(--brand); margin-left: auto; }

.hidden { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

@media (max-width: 800px) {
  .pane-left { width: 100%; max-width: none; min-width: 0; flex: 1; }
  .pane-right { display: none; }
  .app.reading .pane-left { display: none; }
  .app.reading .pane-right { display: flex; border-left: 0; }
}

.signin-form { display: flex; flex-direction: column; gap: 12px; margin: 18px 0 8px; }
.signin-form input[type=password] {
  appearance: none; border: 1px solid var(--hairline); background: var(--surface);
  color: var(--text); border-radius: 10px; padding: 12px 14px; font: inherit; font-size: 16px;
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

.settings-note { color: var(--text-2); font-size: 13px; line-height: 1.45; margin: 12px 0 0; }

.settings-section { padding: 8px 0 0; border-bottom: 1px solid var(--hairline); }
.settings-section > .section-label { margin: 8px 0 0; }
.settings-block { padding: 12px 0 16px; }
.settings-block h3 { margin: 0 0 8px; font-size: 15px; font-weight: 600; }
.choice-list {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  overflow: hidden;
}
.choice-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  text-align: left;
  font-size: 15px;
  color: var(--text);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--hairline);
}
.choice-row:last-child { border-bottom: 0; }
.choice-row .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.choice-row .muted { color: var(--text-2); }
.choice-row.selected { background: var(--surface-raised); }
.choice-row svg { width: 15px; height: 15px; color: var(--brand); flex-shrink: 0; }

.trust-card {
  margin: 8px 0 12px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--brand) 35%, var(--hairline));
  border-radius: 14px;
}
.trust-card h3 { margin: 0 0 8px; font-size: 16px; font-weight: 600; }
.trust-name { font-size: 14px; font-weight: 500; }
.trust-addr { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; margin: 2px 0 8px; }
.trust-card p { margin: 0 0 12px; font-size: 13px; color: var(--text-2); line-height: 1.45; }
.trust-actions { display: flex; gap: 10px; }
.trust-actions button {
  flex: 1;
  min-height: 40px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  background: var(--surface-raised);
  color: var(--text);
}
.trust-actions .trust-yes { background: var(--brand); color: #fff; }

.about-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 0;
  color: var(--text);
}
.about-link strong { display: block; font-size: 15px; font-weight: 600; }
.about-link-meta { display: block; margin-top: 4px; font-size: 13px; font-weight: 400; color: var(--text-2); }
.about-link svg { flex-shrink: 0; color: var(--text-2); }

.about-sheet { max-width: 420px; }
.about-body { text-align: center; padding-bottom: 28px; }
.about-body .wordmark { justify-content: center; margin: 8px 0 12px; }
.about-body h3 { margin: 0 0 6px; font-size: 20px; font-weight: 600; }
.about-version { margin: 0 0 24px; font-size: 13px; color: var(--text-2); }
.about-znorx {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}
.znorx-mark { width: min(280px, 100%); height: auto; display: block; color: var(--text); }
.about-znorx-text { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.about-body .wordmark-mail,
.about-znorx {
  font-family: var(--znorx-type);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.about-znorx-name { font-size: 18px; font-weight: 400; letter-spacing: 0.18em; }
.about-znorx-tag { font-size: 12px; font-weight: 400; letter-spacing: 0.28em; text-transform: uppercase; color: var(--text-2); }
.about-znorx-domain { display: inline-flex; align-items: center; gap: 0; font-size: 13px; letter-spacing: 0.16em; color: var(--text); }
.about-znorx-domain .dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 5px;
  border-radius: 50%;
  background: #C4453A;
  letter-spacing: 0;
}

/* Text size slider — mirrors the native General > Text size control. */
.text-size-block { padding-top: 4px; }
.text-size-preview {
  position: relative;
  margin: 0 0 12px;
  background: var(--bg);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  overflow: hidden;
}
.text-size-preview .msg-row { pointer-events: none; cursor: default; }
.text-size-slider {
  display: flex;
  align-items: center;
  gap: 10px;
}
.text-size-min, .text-size-max {
  font-weight: 600;
  color: var(--text-2);
  line-height: 1;
  flex-shrink: 0;
}
.text-size-min { font-size: 12px; }
.text-size-max { font-size: 22px; }
.text-size-input {
  flex: 1;
  min-width: 0;
  height: 32px;
  margin: 0;
  accent-color: var(--brand);
  cursor: pointer;
}
