/* READY LAUNCH MAIL CENTER. Layout after Cloud Residents (left menu, address card, stat tiles, mail rows with
   envelope thumbnails). LIGHT MODE (Joel, 2026-10-16) = Cloud Residents' warm paper palette (off-white #f6f5f1
   page, warm lines and greys) with Ready Launch's blue as the accent. DARK MODE = Ready Launch's portal tokens.
   The Dark mode row in the menu switches instantly, like Home Service Leads Fast. */
:root {
  --blue: #0866f5; --blue-hover: #0054d5; --blue-light: #eaf1fd; --blue-border: #c6d8f7; --navy: #123c8c;
  --ink: #1c1b18; --text: #2a2824; --muted: #77726a; --line: #e4e0d6; --line-2: #ece9e1;
  --bg: #f6f5f1; --surface: #ffffff; --surface-2: #faf9f6; --chip: #efece5; --hover: #faf8f3;
  --green: #059669; --green-light: #e9fbf2; --green-border: #a7f3d0;
  --orange: #b86b00; --orange-light: #fff8e9; --orange-border: #f5d38c;
  --red: #dc2626; --red-light: #fef2f2; --red-border: #fecaca;
  --btn-dark: #1c1b18; --btn-dark-hover: #3a3833; --btn-dark-ink: #ffffff;
  --addr-a: #0b3a8f; --addr-b: #0866f5; --logo: #1c1b18;
  --shadow: 0 1px 2px rgba(40, 35, 25, .04), 0 1px 3px rgba(40, 35, 25, .05);
  --radius: 12px; --side: 248px;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --blue: #3b82f6; --blue-hover: #60a5fa; --blue-light: #16284a; --blue-border: #274472; --navy: #93b4f0;
    --ink: #f1f5f9; --text: #e2e8f0; --muted: #94a3b8; --line: #283244; --line-2: #222b3a;
    --bg: #0d1117; --surface: #161b24; --surface-2: #1b2230; --chip: #232b3a; --hover: #1a2436;
    --green: #34d399; --green-light: #0f2a20; --green-border: #1f5b44;
    --orange: #fbbf24; --orange-light: #2a2010; --orange-border: #6b4e14;
    --red: #f87171; --red-light: #2c1416; --red-border: #7f2a2a;
    --btn-dark: #e2e8f0; --btn-dark-hover: #cbd5e1; --btn-dark-ink: #0d1117;
    --addr-a: #0f2a5c; --addr-b: #1d4ed8; --logo: #ffffff; --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --blue: #3b82f6; --blue-hover: #60a5fa; --blue-light: #16284a; --blue-border: #274472; --navy: #93b4f0;
  --ink: #f1f5f9; --text: #e2e8f0; --muted: #94a3b8; --line: #283244; --line-2: #222b3a;
  --bg: #0d1117; --surface: #161b24; --surface-2: #1b2230; --chip: #232b3a; --hover: #1a2436;
  --green: #34d399; --green-light: #0f2a20; --green-border: #1f5b44;
  --orange: #fbbf24; --orange-light: #2a2010; --orange-border: #6b4e14;
  --red: #f87171; --red-light: #2c1416; --red-border: #7f2a2a;
  --btn-dark: #e2e8f0; --btn-dark-hover: #cbd5e1; --btn-dark-ink: #0d1117;
  --addr-a: #0f2a5c; --addr-b: #1d4ed8; --logo: #ffffff; --shadow: none; color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
svg { flex: none; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------------------------------------------------------------- app frame */
.app { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100svh; }
.side { position: sticky; top: 0; height: 100svh; display: flex; flex-direction: column; gap: 4px; padding: 18px 14px;
  background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.brand-logo { width: 118px; height: 21px; background: var(--logo); -webkit-mask: url(/_rlc/logo.svg) no-repeat left center / contain; mask: url(/_rlc/logo.svg) no-repeat left center / contain; }
.brand-tag { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--blue);
  background: var(--blue-light); border-radius: 999px; padding: 2px 8px; }
.nav-h { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 14px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; color: var(--text); font-weight: 500;
  border: 2px solid transparent; }
.nav a:hover { border-color: var(--line); }
.nav a[aria-current="page"] { background: var(--blue-light); color: var(--blue); }
.nav a .count { margin-left: auto; min-width: 22px; text-align: center; font-size: 12px; font-weight: 600; padding: 0 7px; border-radius: 999px;
  background: var(--blue); color: #fff; }
.side-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 12px; display: grid; gap: 8px; }
.who { display: flex; align-items: center; gap: 10px; padding: 4px 8px; }
.avatar { width: 32px; height: 32px; border-radius: 999px; display: grid; place-items: center; background: var(--chip); font-weight: 600; font-size: 13px; }
.who-name { font-weight: 600; font-size: 13px; line-height: 1.2; }
.who-mail { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 160px; }
.main { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px; padding: 16px 32px; min-height: 72px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line-2); }
.page-title { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.01em; color: var(--ink); }
.page-sub { color: var(--muted); font-size: 13px; }
.topbar .right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.page { padding: 26px 32px 60px; max-width: 1180px; }
.btn.menu-btn { display: none; }
.scrim { display: none; }
.preview-bar { background: var(--orange-light); border-bottom: 1px solid var(--orange-border); color: var(--orange); padding: 8px 32px; font-size: 13px; }

/* ---------------------------------------------------------------- building blocks */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 22px 24px; }
.section-h { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.section-h h2 { margin: 0; font-size: 16px; font-weight: 650; color: var(--ink); }
.section-h .right { margin-left: auto; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 22px; }
.rgrid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stack { display: grid; gap: 22px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); font: 500 14px var(--sans); cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--muted); }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-hover); border-color: var(--blue-hover); }
.btn-dark { background: var(--btn-dark); border-color: var(--btn-dark); color: var(--btn-dark-ink); }
.btn-dark:hover { background: var(--btn-dark-hover); }
.btn-danger { color: var(--red); }
.btn-danger:hover { border-color: var(--red); }
.btn-sm { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 9px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.link { color: var(--blue); font-weight: 500; }
.link:hover { text-decoration: underline; }
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 550;
  border: 1px solid var(--blue-border); background: var(--blue-light); color: var(--blue); white-space: nowrap; }
.badge-green { border-color: var(--green-border); background: var(--green-light); color: var(--green); }
.badge-orange { border-color: var(--orange-border); background: var(--orange-light); color: var(--orange); }
.badge-red { border-color: var(--red-border); background: var(--red-light); color: var(--red); }
.badge-gray { border-color: var(--line); background: var(--chip); color: var(--muted); }
.banner { border-radius: 10px; padding: 11px 14px; margin-bottom: 18px; border: 1px solid var(--blue-border); background: var(--blue-light); color: var(--text); }
.banner-ok { border-color: var(--green-border); background: var(--green-light); }
.banner-error { border-color: var(--red-border); background: var(--red-light); }
.banner-warn { border-color: var(--orange-border); background: var(--orange-light); }
.empty { text-align: center; padding: 46px 20px; color: var(--muted); display: grid; justify-items: center; gap: 6px; }
.empty .ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--chip); color: var(--muted); margin-bottom: 6px; }
.empty b { color: var(--ink); font-size: 15px; }
.kv { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line-2); }
.kv:first-of-type { border-top: 0; }
.kv-l { flex: 1; min-width: 0; }
.kv-k { font-size: 12px; color: var(--muted); }
.kv-v { font-weight: 550; color: var(--ink); overflow-wrap: anywhere; }
.input, select.input { width: 100%; height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; background: var(--surface);
  color: var(--text); font: 14px var(--sans); }
textarea.input { height: auto; min-height: 90px; padding: 10px 12px; }
.input:focus { outline: 2px solid var(--blue-border); border-color: var(--blue); }
.field { display: grid; gap: 6px; margin-top: 12px; }
.field label { font-size: 13px; font-weight: 550; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check-row { display: flex; align-items: flex-start; gap: 9px; cursor: pointer; }
.check-row input { margin-top: 3px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.note { font-size: 12px; color: var(--muted); margin-top: 10px; }
.toggle { position: relative; width: 42px; height: 25px; border-radius: 999px; background: var(--line); border: 0; cursor: pointer; flex: none; }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 19px; height: 19px; border-radius: 999px; background: #fff; transition: left .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.toggle[aria-checked="true"] { background: var(--blue); }
.toggle[aria-checked="true"]::after { left: 20px; }

/* ---------------------------------------------------------------- home */
.addr-card { position: relative; overflow: hidden; border-radius: 16px; padding: 26px 28px; color: #fff;
  background: linear-gradient(135deg, var(--addr-a), var(--addr-b)); min-height: 220px; display: flex; flex-direction: column; }
.addr-card::after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 999px; background: rgba(255,255,255,.08); }
.addr-k { font-size: 12px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; opacity: .8; }
.addr-lines { margin-top: 12px; font-size: 21px; font-weight: 650; line-height: 1.35; letter-spacing: -.01em; }
.addr-lines .suite { opacity: .85; font-weight: 500; font-size: 16px; }
.addr-foot { margin-top: auto; padding-top: 18px; display: flex; gap: 10px; flex-wrap: wrap; position: relative; z-index: 1; }
.addr-card .btn { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.28); color: #fff; }
.addr-card .btn:hover { background: rgba(255,255,255,.22); }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 18px 16px; display: block; }
a.stat:hover { border: 1px solid var(--blue-border); }
.stat-k { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 500; }
.stat-v { font-size: 30px; font-weight: 700; color: var(--ink); margin-top: 6px; letter-spacing: -.02em; }
.stat-s { font-size: 12px; color: var(--muted); }
.stat-ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--blue-light); color: var(--blue); }
.stat-ic.orange { background: var(--orange-light); color: var(--orange); }
.stat-ic.red { background: var(--red-light); color: var(--red); }
.stat-ic.green { background: var(--green-light); color: var(--green); }
.mini-row { display: flex; gap: 14px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line-2); }
.mini-row:first-of-type { border-top: 0; }
.mini-row:hover .m-sender { color: var(--blue); }
.m-thumb { width: 64px; height: 44px; border-radius: 8px; object-fit: cover; border: 1px solid var(--line); background: var(--surface-2); flex: none; display: block; }
.m-mid { min-width: 0; flex: 1; }
.m-sender { font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-sub { font-size: 12px; color: var(--muted); }
.m-date { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* ---------------------------------------------------------------- mail lists */
.page-wide { max-width: 1280px; }
.search { position: relative; width: 320px; max-width: 38vw; }
.search input { padding-left: 36px; height: 40px; border-radius: 11px; }
.search svg { position: absolute; left: 12px; top: 12px; color: var(--muted); }
.filters { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 7px; margin-bottom: 18px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 13px; }
.filters a { padding: 7px 12px; border-radius: 9px; font-weight: 500; color: var(--muted); border: 2px solid transparent; }
.filters a:hover { border-color: var(--line); }
.filters a[aria-current="true"] { color: var(--ink); background: var(--chip); }
.filters a .n { margin-left: 6px; font-size: 12px; color: var(--muted); }
.filters .right { margin-left: auto; display: flex; gap: 8px; }
.mail-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.mail-row { display: flex; align-items: center; gap: 16px; padding: 14px 18px; border-top: 1px solid var(--line-2); position: relative; }
.mail-row:first-child { border-top: 0; }
.mail-row:hover { background: var(--hover); }
.mail-row.unread .mail-sender::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 999px; background: var(--blue); margin-right: 8px; vertical-align: 2px; }
.mail-check { width: 18px; height: 18px; flex: none; position: relative; z-index: 2; accent-color: var(--blue); }
.mail-thumb { width: 92px; height: 64px; border-radius: 9px; object-fit: cover; border: 1px solid var(--line); background: var(--surface-2); flex: none; display: block; }
.mail-body { min-width: 0; flex: 1; }
.mail-sender { font-weight: 650; color: var(--ink); font-size: 15px; }
.mail-meta { font-size: 13px; color: var(--muted); }
.mail-sum { font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }
.mail-side { display: grid; justify-items: end; gap: 6px; flex: none; }
.mail-date { font-size: 12px; color: var(--muted); white-space: nowrap; }
.mail-link { position: absolute; inset: 0; z-index: 1; }
.warn-line { font-size: 12px; color: var(--red); font-weight: 550; }
.bulk { position: sticky; bottom: 16px; z-index: 6; display: none; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 16px; padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 13px; box-shadow: 0 8px 24px rgba(16,24,40,.12); }
.bulk.on { display: flex; }
.bulk .n { font-weight: 600; margin-right: 8px; }

/* ---------------------------------------------------------------- one piece */
.piece { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, 1fr); gap: 22px; align-items: start; }
.viewer { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: grid; gap: 12px; }
.viewer img { width: 100%; border-radius: 9px; display: block; background: #fff; }
.viewer-tabs { display: flex; gap: 6px; }
.viewer-tabs a { padding: 6px 11px; border-radius: 8px; font-weight: 500; color: var(--muted); border: 2px solid transparent; }
.viewer-tabs a[aria-current="true"] { background: var(--surface); color: var(--ink); border-color: var(--line); }
.actions-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.actions-grid form { display: contents; }
.summary { background: var(--blue-light); border: 1px solid var(--blue-border); border-radius: 10px; padding: 12px 14px; font-size: 13px; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 500; }
.back:hover { color: var(--ink); }

/* ---------------------------------------------------------------- address, billing, referrals */
.rgrid2-aside { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
.aside { background: var(--surface-2); border-left: 1px solid var(--line); padding: 28px 30px; display: grid; gap: 14px; align-content: center; }
.addr-block { padding: 28px 30px; }
.addr-big { font-size: 22px; font-weight: 650; line-height: 1.45; color: var(--ink); margin-top: 10px; }
.copy-line { display: flex; align-items: center; gap: 8px; justify-content: space-between; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.copy-line .mono { font-size: 13px; overflow-wrap: anywhere; }
.rgrid2-bill { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.plan-card { border-radius: 16px; padding: 24px 26px; background: linear-gradient(135deg, var(--addr-a), var(--addr-b)); color: #fff; }
.plan-card .k { font-size: 12px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; opacity: .8; }
.plan-card .name { font-size: 24px; font-weight: 700; margin-top: 6px; }
.plan-card .feat { margin: 16px 0 0; padding: 0; list-style: none; display: grid; gap: 7px; font-size: 14px; }
.plan-card .feat li { display: flex; gap: 8px; align-items: center; }
.plan-card .btn { margin-top: 20px; background: #fff; color: #0b3a8f; border-color: #fff; }
.meter { height: 9px; border-radius: 999px; background: var(--chip); overflow: hidden; margin: 8px 0 18px; }
.meter > i { display: block; height: 100%; background: var(--blue); border-radius: 999px; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px 10px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.ref-hero { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 0; overflow: hidden; }
.ref-hero .l { padding: 30px; }
.ref-hero h2 { margin: 0; font-size: 24px; letter-spacing: -.01em; color: var(--ink); }
.steps { display: grid; gap: 14px; padding: 30px; background: var(--surface-2); border-left: 1px solid var(--line); }
.step { display: flex; gap: 12px; }
.step b { width: 28px; height: 28px; border-radius: 999px; display: grid; place-items: center; background: var(--blue-light); color: var(--blue); flex: none; }
.agree-text { max-height: 340px; overflow: auto; padding: 4px 16px; font-size: 12.5px; line-height: 1.6; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }

/* ---------------------------------------------------------------- sign in */
.auth { min-height: 100svh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 410px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 30px 28px; }
.auth-card .brand { justify-content: center; padding: 0 0 18px; }
.auth-card h1 { margin: 0; font-size: 20px; text-align: center; color: var(--ink); }
.auth-card .sub { text-align: center; color: var(--muted); margin: 6px 0 18px; }
.code-input { font-family: var(--mono); font-size: 26px; letter-spacing: .4em; text-align: center; height: 56px; }

/* ---------------------------------------------------------------- phone */
@media (max-width: 1000px) {
  .grid-2, .piece, .rgrid2-aside, .rgrid2-bill, .ref-hero { grid-template-columns: minmax(0, 1fr); }
  .aside, .steps { border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; z-index: 30; left: 0; top: 0; width: 270px; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px rgba(0,0,0,.2); }
  #nav-open:checked ~ .app .side { transform: none; }
  .scrim { position: fixed; inset: 0; z-index: 25; background: rgba(0,0,0,.35); }
  #nav-open:checked ~ .app .scrim { display: block; }
  .btn.menu-btn { display: inline-flex; width: 38px; padding: 0; }
  .topbar { padding: 12px 16px; min-height: 60px; flex-wrap: wrap; }
  .page { padding: 18px 16px 50px; }
  .preview-bar { padding: 8px 16px; }
  .search { width: 100%; max-width: none; order: 3; }
  .page-title { font-size: 19px; }
  .mail-row { gap: 12px; padding: 12px; }
  .mail-thumb { width: 64px; height: 46px; }
  .mail-side .badge { display: none; }
  .row-2 { grid-template-columns: 1fr; }
  .addr-lines { font-size: 18px; }
}

/* ---------------------------------------------------------------- dark mode switch (menu) */
.theme-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 9px; border: 2px solid transparent;
  background: none; color: var(--text); font: 500 14px var(--sans); cursor: pointer; text-align: left; }
.theme-row:hover { border-color: var(--line); }
.theme-row .dm-state { margin-left: auto; font-size: 12px; font-weight: 600; padding: 1px 9px; border-radius: 999px; background: var(--chip); color: var(--muted); }
.theme-row .dm-state.on { background: var(--blue); color: #fff; }

/* Passkeys and policy pages (2026-10-16). */
[hidden] { display: none !important; }
.or-line { display: flex; align-items: center; gap: 10px; margin: 14px 0 0; color: var(--muted); font-size: 12px; }
.or-line::before, .or-line::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.policy ul li { color: inherit; }

/* ---------------------------------------------------------------- phone app layout (Joel, 2026-10-16: mobile optimized) */
.cards-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.tabbar, .m-only { display: none; }
@media (max-width: 860px) {
  .cards-2 { grid-template-columns: minmax(0, 1fr); }
  .m-hide { display: none; }
  .m-only { display: block; }
  .m-badge { margin-top: 6px; }
  /* 16px stops iPhones zooming into a field when it is tapped */
  .input, select.input, textarea.input, .search input { font-size: 16px; }
  .topbar { padding-top: calc(12px + env(safe-area-inset-top)); }
  .main { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; z-index: 20; left: 0; right: 0; bottom: 0;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--surface) 94%, transparent);
    backdrop-filter: blur(10px); border-top: 1px solid var(--line); }
  .tabbar a { display: grid; justify-items: center; gap: 2px; padding: 6px 2px; min-height: 52px; font-size: 11px; font-weight: 550; color: var(--muted); border-radius: 10px; }
  .tabbar a[aria-current="page"] { color: var(--blue); }
  .tb-ic { position: relative; display: grid; place-items: center; }
  .tb-n { position: absolute; top: -5px; right: -11px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--blue); color: #fff;
    font-size: 11px; line-height: 18px; text-align: center; }
  .bulk { bottom: calc(80px + env(safe-area-inset-bottom)); }
  .filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .filters::-webkit-scrollbar { display: none; }
  .filters a, .filters .right, .filters .right span { white-space: nowrap; flex: none; }
  .mail-row { align-items: flex-start; }
  .mail-thumb { margin-top: 2px; }
  .mail-sender { font-size: 14.5px; }
  .mail-meta { font-size: 12.5px; }
  .nav a, .theme-row { min-height: 44px; }
  .btn { min-height: 40px; }
  .btn-sm { min-height: 36px; }
  .form-actions { flex-wrap: wrap; }
  .form-actions .btn { flex: 1 1 auto; }
  .actions-grid .btn { width: 100%; }
  .addr-card { min-height: 0; padding: 22px; }
  .addr-foot .btn { flex: 1 1 auto; }
  .card-pad { padding: 18px; }
  .addr-block, .aside, .ref-hero .l, .steps { padding: 20px; }
  .table { font-size: 13px; }
  .table th:nth-child(2), .table td:nth-child(2) { display: none; }
  .piece { gap: 16px; }
  .viewer { padding: 10px; }
  .page-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: calc(100vw - 90px); }
  .auth-card { padding: 24px 20px; }
}

/* Authenticator app set-up (Settings > Authenticator app): the QR code stays dark on white in both themes so every app can read it. */
.totp-qr { width: 220px; max-width: 70vw; margin: 14px auto 8px; padding: 10px; background: #fff; border-radius: 12px; border: 1px solid var(--line); }
.totp-qr svg { display: block; width: 100%; height: auto; }
.totp-key { text-align: center; font-size: 15px; letter-spacing: .06em; overflow-wrap: anywhere; margin: 4px 0 0; user-select: all; }
