/* YFS Mail: a copy of MASC Mail (Apps/MASC/mail) in the Your Future Site night world: YFS ground, YFS blue accent, Barlow. */
@font-face { font-family: 'Barlow'; font-weight: 400; font-display: swap; src: url('../fonts/barlow-400.woff2') format('woff2'); }
@font-face { font-family: 'Barlow'; font-weight: 500; font-display: swap; src: url('../fonts/barlow-500.woff2') format('woff2'); }
@font-face { font-family: 'Barlow'; font-weight: 600; font-display: swap; src: url('../fonts/barlow-600.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 700; font-display: swap; src: url('../fonts/barlow-condensed-700.woff2') format('woff2'); }

:root {
  color-scheme: dark;
  --bg: #07090C; --surface: #121419; --raised: #1A1D24;
  --line: rgba(255,255,255,.065); --line-2: rgba(255,255,255,.13);
  --text: #F2F4F7; --text-2: #A7AFBC; --text-3: #808898;
  --mint: #3B93FF; --mint-12: rgba(59,147,255,.12); --mint-30: rgba(59,147,255,.3); /* YFS blue (website/styles.css --blue); the name is kept from MASC Mail so the two stay one codebase */
  --amber: #FFB547; --red: #FF6B6B; --ink: #0B0D11;
  --r: 18px; --r-sm: 12px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --body: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ag-bg: var(--bg); --ag-ink: var(--text); --ag-muted: var(--text-3); --ag-muted-2: var(--text-2); --ag-btn: var(--mint); --ag-btn-ink: var(--ink); --ag-warn: #6b4a00; --ag-font: var(--body);
  accent-color: var(--mint); caret-color: var(--mint);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 var(--body); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: var(--mint); }
h1, h2, h3, p { margin: 0; }
h1, h2 { text-wrap: balance; }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; border-radius: 8px; }
.icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sm .icon, .icon.sm { width: 18px; height: 18px; }

/* ---- shell ---- */
.app { min-height: 100%; display: grid; grid-template-columns: 1fr; }
@media (min-width: 900px) { .app.in { grid-template-columns: 280px 1fr; } }
.side { display: none; border-right: 1px solid var(--line); padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow: auto; }
@media (min-width: 900px) { .app.in .side { display: block; } .app.in .menu-btn { display: none; } }
.main { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px; padding: calc(10px + env(safe-area-inset-top, 0px)) 12px 10px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.bar h1 { font: 700 22px/1.1 var(--display); text-transform: uppercase; letter-spacing: .02em; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar .sub { display: block; font: 500 13px/1.2 var(--body); color: var(--text-3); text-transform: none; letter-spacing: 0; overflow: hidden; text-overflow: ellipsis; }
.iconbtn { width: 44px; height: 44px; display: grid; place-items: center; border: 0; background: transparent; border-radius: 12px; color: var(--text-2); flex: none; position: relative; }
.iconbtn:hover, .iconbtn:active { background: var(--raised); color: var(--text); }
.content { flex: 1; padding: 8px 12px calc(100px + env(safe-area-inset-bottom, 0px)); width: 100%; max-width: 860px; margin: 0 auto; }

.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 16px; font: 700 22px/1 var(--display); letter-spacing: .06em; }
.brand img { width: 28px; height: 28px; }
.boxlist { display: grid; gap: 2px; }
.boxlink { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 12px; border-radius: 12px; color: var(--text-2); text-decoration: none; border: 0; background: transparent; width: 100%; text-align: left; }
.boxlink b { flex: 1; min-width: 0; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.boxlink small { display: block; font-size: 12px; color: var(--text-3); font-weight: 400; overflow: hidden; text-overflow: ellipsis; }
.boxlink[aria-current="page"] { background: var(--mint-12); }
.boxlink[aria-current="page"] b { color: var(--mint); }
.side-sep { height: 1px; background: var(--line); margin: 10px 8px; }
.side-label { font: 600 11px/1 var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); padding: 10px 12px 6px; }

/* notification-badge: a count, capped at 99+, pinned so the row never moves */
.count { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--mint); color: var(--ink); font: 700 12px/22px var(--body); text-align: center; font-variant-numeric: tabular-nums; flex: none; }
.iconbtn .count { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; line-height: 18px; font-size: 11px; padding: 0 5px; }

/* ---- thread list ---- */
.threads { list-style: none; margin: 0; padding: 0; display: grid; }
.thread { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 14px 12px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--text-2); border-radius: 10px; }
.thread:hover { background: var(--surface); }
.thread .who { font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread .when { font-size: 13px; color: var(--text-3); font-variant-numeric: tabular-nums; text-align: right; }
.thread .subj { grid-column: 1 / -1; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread .snip { grid-column: 1 / -1; font-size: 14px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread.unread .who, .thread.unread .subj { font-weight: 700; }
.thread.unread .who::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--mint); margin-right: 8px; vertical-align: 2px; }
.thread .n { color: var(--text-3); font-weight: 400; margin-left: 4px; }
.tabs { display: flex; gap: 6px; padding: 6px 0 10px; }
.tab { display: inline-flex; align-items: center; text-decoration: none; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--text-2); font-size: 14px; }
.tab[aria-pressed="true"] { background: var(--mint-12); border-color: var(--mint-30); color: var(--mint); }

/* skeleton-loading: shaped like the real rows */
.skel { padding: 16px 12px; border-bottom: 1px solid var(--line); display: grid; gap: 8px; }
.skel i { display: block; height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--surface), var(--raised), var(--surface)); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
.skel i:nth-child(1) { width: 40%; } .skel i:nth-child(2) { width: 75%; } .skel i:nth-child(3) { width: 90%; height: 10px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* empty-states: icon, a human line, the real next action */
.empty { text-align: center; padding: 64px 20px; display: grid; justify-items: center; gap: 10px; color: var(--text-2); }
.empty .ring { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--mint-12); color: var(--mint); margin-bottom: 6px; }
.empty h2 { font: 700 24px/1.1 var(--display); text-transform: uppercase; color: var(--text); }
.empty p { max-width: 34ch; }

/* ---- message view ---- */
.msg { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); margin: 12px 0; overflow: hidden; }
.msg-head { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--raised); color: var(--text); font: 700 16px/1 var(--display); flex: none; }
.avatar.out { background: var(--mint-12); color: var(--mint); }
.msg-meta { flex: 1; min-width: 0; }
.msg-meta b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-meta small { display: block; color: var(--text-3); font-size: 13px; overflow-wrap: anywhere; }
.msg-body { padding: 0 16px 16px; overflow-wrap: anywhere; }
.msg-body pre { white-space: pre-wrap; font: inherit; margin: 0; }
.msg-body iframe { width: 100%; border: 0; border-radius: 12px; background: #fff; min-height: 120px; display: block; }
.msg.folded .msg-body, .msg.folded .atts { display: none; }
.msg.folded .msg-head { cursor: pointer; }
.imgs-note { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; margin: 0 16px 10px; border-radius: 10px; background: var(--raised); font-size: 14px; color: var(--text-2); }
.atts { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 16px; }
.att { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 12px; border-radius: 10px; border: 1px solid var(--line-2); color: var(--text); text-decoration: none; font-size: 14px; max-width: 100%; }
.att span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; padding: 4px 0 20px; }

/* ---- buttons (perfect-button, disabled-buttons, double-submit-guard) ---- */
.btn { min-height: 48px; padding: 0 18px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--raised); color: var(--text); font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: transform 120ms var(--ease), background-color 150ms; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--mint); border-color: var(--mint); color: var(--ink); }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; }
.btn.danger { background: transparent; border-color: rgba(255,107,107,.45); color: var(--red); }
.btn[aria-disabled="true"], .btn:disabled { opacity: .55; cursor: not-allowed; }
.btn .spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; display: none; }
.btn[data-state="busy"] .spin { display: inline-block; }
.btn[data-state="busy"] .lab { opacity: .7; }
@keyframes spin { to { transform: rotate(360deg); } }
.fab { position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 30; min-height: 56px; padding: 0 22px; border-radius: 18px; border: 0; background: var(--mint); color: var(--ink); font-weight: 700; display: inline-flex; align-items: center; gap: 8px; box-shadow: 0 12px 30px -10px rgba(91,228,155,.55); }
.link { border: 0; background: transparent; color: var(--mint); font-weight: 600; padding: 10px 4px; min-height: 44px; }

/* ---- forms (form-field-states, password-field-ux, otp-input) ---- */
.form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field > span { font-size: 14px; font-weight: 600; color: var(--text-2); }
.input { width: 100%; min-height: 50px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface); font-size: 16px; }
.input:focus { border-color: var(--mint); outline: none; box-shadow: 0 0 0 3px var(--mint-12); }
.input[aria-invalid="true"] { border-color: var(--red); }
textarea.input { min-height: 220px; resize: vertical; line-height: 1.5; }
.hint { font-size: 13px; color: var(--text-3); }
.err { font-size: 14px; color: var(--red); min-height: 0; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 52px; }
.pw-wrap .iconbtn { position: absolute; right: 3px; top: 3px; }
.meter { height: 6px; border-radius: 3px; background: var(--raised); overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: var(--red); transition: width 250ms var(--ease), background-color 250ms; }
.otp { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.otp input { min-height: 56px; text-align: center; font: 700 26px/1 var(--display); border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); font-variant-numeric: tabular-nums; width: 100%; min-width: 0; }
.otp input:focus { border-color: var(--mint); outline: none; box-shadow: 0 0 0 3px var(--mint-12); }
.otp.shake { animation: shake 360ms; }
.otp.ok input { border-color: var(--mint); color: var(--mint); }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

/* ---- auth screens ---- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 400px; display: grid; gap: 22px; }
.auth-card .mark { width: 52px; height: 52px; }
.auth-card h1 { font: 700 34px/1 var(--display); text-transform: uppercase; }
.auth-card p.lede { color: var(--text-2); }
.qr { background: #fff; border-radius: 16px; padding: 14px; width: 220px; max-width: 100%; justify-self: center; }
.qr svg { width: 100%; height: auto; display: block; }
.secret { font: 600 15px/1.4 ui-monospace, Menlo, Consolas, monospace; letter-spacing: .08em; word-break: break-all; background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; padding: 10px 12px; }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 8px; color: var(--text-2); }
.steps b { color: var(--text); }

/* ---- compose ---- */
.from-row { display: flex; align-items: center; gap: 8px; }
.from-row select { flex: 1; }
.attach-list { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 4px 6px 4px 12px; border-radius: 999px; background: var(--raised); font-size: 14px; max-width: 100%; }
.chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip button { width: 28px; height: 28px; border: 0; border-radius: 50%; background: transparent; color: var(--text-2); }

/* ---- admin (responsive-table: cards on phones, rows on wide screens) ---- */
.section { margin: 18px 0 28px; display: grid; gap: 12px; }
.section h2 { font: 700 22px/1.1 var(--display); text-transform: uppercase; }
.section .hint { margin-top: -6px; }
.rows { display: grid; gap: 10px; }
.row { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 14px; display: grid; gap: 10px; }
.row-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-top b { font-weight: 600; }
.row-top small { color: var(--text-3); }
.pill { display: inline-flex; align-items: center; min-height: 24px; padding: 0 10px; border-radius: 999px; font: 600 12px/1 var(--body); background: var(--raised); color: var(--text-2); }
.pill.mint { background: var(--mint-12); color: var(--mint); }
.pill.amber { background: rgba(255,181,71,.12); color: var(--amber); }
.pill.red { background: rgba(255,107,107,.12); color: var(--red); }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.row-actions .btn { min-height: 40px; padding: 0 14px; font-size: 14px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.check { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2); font-size: 14px; }
.check input { width: 18px; height: 18px; }
.log { list-style: none; margin: 0; padding: 0; display: grid; }
.log li { padding: 10px 2px; border-bottom: 1px solid var(--line); font-size: 14px; color: var(--text-2); }
.log time { color: var(--text-3); font-variant-numeric: tabular-nums; margin-right: 8px; }
.danger-zone { border: 1px solid rgba(255,107,107,.3); border-radius: var(--r-sm); padding: 14px; display: grid; gap: 10px; }
.copyline { display: flex; gap: 8px; align-items: stretch; }
.copyline .input { flex: 1; min-width: 0; font-size: 14px; }

/* ---- sheet (bottom on phones) ---- */
.scrim { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.55); display: grid; align-items: end; justify-items: center; }
@media (min-width: 700px) { .scrim { align-items: center; } }
.sheet { width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; background: var(--surface); border: 1px solid var(--line-2); border-radius: 22px 22px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 14px; animation: up 260ms var(--ease); }
@media (min-width: 700px) { .sheet { border-radius: 22px; } }
.sheet h2 { font: 700 24px/1.1 var(--display); text-transform: uppercase; }
@keyframes up { from { transform: translateY(24px); opacity: 0; } }

/* ---- toast ---- */
.toasts { position: fixed; left: 0; right: 0; bottom: calc(90px + env(safe-area-inset-bottom, 0px)); z-index: 80; display: grid; justify-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast { pointer-events: auto; max-width: 440px; display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 14px; background: var(--raised); border: 1px solid var(--line-2); box-shadow: 0 16px 36px -18px rgba(0,0,0,.9); animation: up 220ms var(--ease); font-size: 15px; }
.toast.bad { border-color: rgba(255,107,107,.45); }
.toast button { border: 0; background: transparent; color: var(--mint); font-weight: 700; min-height: 36px; }

.center-note { color: var(--text-3); text-align: center; padding: 16px; font-size: 14px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* =================== v2 (10 Oct 2026): Gmail-grade shell =================== */
/* top search bar, view chips, rows with avatar + star, swipe, selection bar, full-screen compose */
.bar.search-bar { gap: 6px; }
.searchbox { flex: 1; min-width: 0; display: flex; align-items: center; gap: 4px; min-height: 48px; padding: 0 6px 0 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line-2); }
.searchbox input { flex: 1; min-width: 0; border: 0; background: transparent; font-size: 16px; padding: 0 4px; outline: none; }
.searchbox input::placeholder { color: var(--text-3); }
.searchbox:focus-within { border-color: var(--mint-30); box-shadow: 0 0 0 3px var(--mint-12); }
.me-btn { width: 36px; height: 36px; border-radius: 50%; border: 0; display: grid; place-items: center; font: 700 14px/1 var(--display); color: var(--ink); background: var(--mint); flex: none; text-decoration: none; }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 10px 0 6px; margin: 0 -12px; padding-left: 12px; padding-right: 12px; }
.chips::-webkit-scrollbar { display: none; }
.chip-v { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--text-2); text-decoration: none; font-size: 14px; font-weight: 500; }
.chip-v[aria-current="page"] { background: var(--mint-12); border-color: var(--mint-30); color: var(--mint); }
.chip-v .count { min-width: 20px; height: 20px; line-height: 20px; font-size: 11px; }
.box-title { display: flex; align-items: baseline; gap: 8px; padding: 6px 2px 0; }
.box-title b { font: 700 13px/1 var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }
.box-title small { color: var(--text-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.rows-list { list-style: none; margin: 0; padding: 0; }
.trow { position: relative; overflow: hidden; border-radius: 14px; }
.trow .swipe-bg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: space-between; padding: 0 22px; font-weight: 700; color: var(--ink); }
.trow .swipe-bg.arch { background: var(--mint); }
.trow .swipe-bg.del { background: var(--red); justify-content: flex-end; color: #fff; }
.tline { position: relative; display: grid; grid-template-columns: 44px 1fr auto; gap: 0 12px; align-items: start; padding: 12px 8px 12px 10px; background: var(--bg); text-decoration: none; color: var(--text-2); touch-action: pan-y; transition: transform 200ms var(--ease), background-color 150ms; }
.tline:hover { background: var(--surface); }
.trow.selected .tline { background: var(--mint-12); }
.av { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font: 700 16px/1 var(--display); color: #0b0d11; border: 0; padding: 0; margin-top: 2px; }
.trow.selected .av { background: var(--mint) !important; }
.tmain { min-width: 0; display: grid; gap: 1px; }
.ttop { display: flex; align-items: baseline; gap: 8px; }
.ttop .who { flex: 1; min-width: 0; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15.5px; }
.ttop .when { font-size: 12.5px; color: var(--text-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tsubj { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14.5px; }
.tsnip { color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.trow.unread .who, .trow.unread .tsubj, .trow.unread .when { font-weight: 700; color: var(--text); }
.trow.unread .when { color: var(--mint); }
.tside { display: grid; justify-items: end; gap: 6px; padding-top: 20px; }
.star { width: 36px; height: 36px; margin: -8px -6px 0 0; border: 0; background: transparent; color: var(--text-3); display: grid; place-items: center; border-radius: 50%; }
.star svg { width: 20px; height: 20px; }
.star.on { color: #F7C948; }
.star.on svg { fill: #F7C948; }
.boxtag { font-size: 11px; color: var(--text-3); border: 1px solid var(--line-2); border-radius: 6px; padding: 0 5px; margin-left: 6px; white-space: nowrap; }

.selbar { position: sticky; top: 0; z-index: 25; display: flex; align-items: center; gap: 4px; padding: calc(10px + env(safe-area-inset-top, 0px)) 8px 10px; background: var(--raised); border-bottom: 1px solid var(--line-2); }
.selbar b { flex: 1; font: 700 20px/1 var(--display); }

.ptr { height: 0; overflow: hidden; display: grid; place-items: center; color: var(--mint); transition: height 200ms var(--ease); }
.ptr.on { height: 54px; }
.ptr svg { width: 24px; height: 24px; }
.ptr.spin svg { animation: spin .8s linear infinite; }

/* thread page */
.th-subj { display: flex; gap: 10px; align-items: flex-start; padding: 14px 4px 4px; }
.th-subj h2 { flex: 1; font: 600 22px/1.25 var(--body); text-wrap: pretty; overflow-wrap: anywhere; }
.th-label { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 6px; background: var(--raised); color: var(--text-2); vertical-align: 3px; margin-left: 6px; }
.msg { border-radius: 16px; }
.msg-head .ago { color: var(--text-3); font-size: 12.5px; white-space: nowrap; }
.msg-head .iconbtn { width: 40px; height: 40px; margin: -6px -8px 0 0; }
.msg.folded .msg-meta small.to { display: none; }
.msg-snip { display: none; color: var(--text-3); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg.folded .msg-snip { display: block; }
.reply-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 6px 0 24px; }
.reply-row .btn { border-radius: 999px; min-height: 46px; }
blockquote.q { margin: 10px 0 0; padding-left: 12px; border-left: 3px solid var(--line-2); color: var(--text-3); }

/* compose: full screen on phones, a big card on desktop */
.compose { position: fixed; inset: 0; z-index: 70; background: var(--bg); display: flex; flex-direction: column; animation: up 220ms var(--ease); }
@media (min-width: 900px) { .compose { inset: auto 24px 0 auto; width: 620px; height: min(80vh, 760px); border: 1px solid var(--line-2); border-radius: 18px 18px 0 0; box-shadow: 0 30px 80px -20px rgba(0,0,0,.9); } }
.compose-head { display: flex; align-items: center; gap: 6px; padding: calc(8px + env(safe-area-inset-top, 0px)) 8px 8px; border-bottom: 1px solid var(--line); }
.compose-head h2 { flex: 1; font: 700 20px/1 var(--display); text-transform: uppercase; }
.compose-body { flex: 1; overflow: auto; display: flex; flex-direction: column; }
.cfield { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 14px; border-bottom: 1px solid var(--line); position: relative; }
.cfield > span { color: var(--text-3); font-size: 15px; width: 56px; flex: none; }
.cfield input, .cfield select { flex: 1; min-width: 0; border: 0; background: transparent; font-size: 16px; padding: 12px 0; outline: none; }
.cfield select option { background: var(--surface); }
.cfield .link { padding: 6px; min-height: 40px; font-size: 14px; }
.suggest { position: absolute; left: 70px; right: 8px; top: 100%; z-index: 5; background: var(--raised); border: 1px solid var(--line-2); border-radius: 12px; overflow: hidden; box-shadow: 0 16px 40px -16px rgba(0,0,0,.9); }
.suggest button { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 10px 14px; min-height: 48px; }
.suggest button:hover, .suggest button[aria-selected="true"] { background: var(--mint-12); }
.suggest small { display: block; color: var(--text-3); font-size: 13px; }
.toolbar { display: flex; gap: 2px; padding: 6px 8px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.toolbar button { min-width: 40px; height: 40px; border: 0; border-radius: 10px; background: transparent; color: var(--text-2); font-weight: 700; display: grid; place-items: center; }
.toolbar button:hover, .toolbar button[aria-pressed="true"] { background: var(--raised); color: var(--text); }
.editor { flex: 1; min-height: 240px; padding: 14px 14px 40px; outline: none; font-size: 16px; line-height: 1.55; overflow-wrap: anywhere; }
.editor:empty::before { content: attr(data-placeholder); color: var(--text-3); }
.editor a { color: var(--mint); }
.editor blockquote { margin: 10px 0; padding-left: 12px; border-left: 3px solid var(--line-2); color: var(--text-2); }
.editor .sig { color: var(--text-2); }
.compose-foot { padding: 8px 12px calc(10px + env(safe-area-inset-bottom, 0px)); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; border-top: 1px solid var(--line); }
.compose-foot .err { flex-basis: 100%; }
.draft-note { color: var(--text-3); font-size: 13px; margin-left: auto; }
.btn.send { border-radius: 999px; padding: 0 20px; min-height: 44px; }

/* settings */
.toggle { width: 52px; height: 32px; border-radius: 999px; border: 0; background: var(--raised); position: relative; flex: none; }
.toggle::after { content: ""; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: var(--text-2); transition: transform 200ms var(--ease), background-color 200ms; }
.toggle[aria-checked="true"] { background: var(--mint-30); }
.toggle[aria-checked="true"]::after { transform: translateX(20px); background: var(--mint); }
.setrow { display: flex; align-items: center; gap: 14px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); }
.setrow > div { flex: 1; min-width: 0; }
.setrow small { display: block; color: var(--text-3); font-size: 13px; }
kbd { font: 600 12px/1 ui-monospace, Consolas, monospace; padding: 3px 6px; border-radius: 6px; background: var(--raised); border: 1px solid var(--line-2); }
.shortcuts { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; align-items: center; font-size: 14px; color: var(--text-2); }
.reply-row .btn { white-space: nowrap; padding: 0 10px; font-size: 15px; gap: 6px; }
.msg-body iframe { background: transparent; color-scheme: dark; border-radius: 0; }
.msg-body iframe.designed { border-radius: 12px; }

/* passwords (10 Oct 2026): the chip, the lock bar, the list of logins and the reveal sheet */
.chip-v.chip-key { border-color: var(--mint-30); }
.chip-v.chip-key .icon { color: var(--mint); }
.vbar { display: flex; align-items: center; gap: 8px; margin: 4px 0 12px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--mint-12); color: var(--text-2, #b8bdc7); font-size: 13px; }
.vbar .icon { color: var(--mint); flex: none; }
.vbar span { flex: 1; }
.vlist { display: grid; gap: 8px; }
.vrow { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 10px 12px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface, #14171d); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.vrow:active { transform: scale(.985); }
.vrow .av { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #0B0D11; font-weight: 700; }
.vtxt { display: grid; gap: 2px; min-width: 0; }
.vtxt small { color: var(--text-3, #8a909c); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vrow > .icon { color: var(--text-3, #8a909c); }
.vfield { display: grid; gap: 6px; margin-bottom: 12px; }
.vfield small { color: var(--text-3, #8a909c); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.vpw { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .04em; }
.vnotes { margin: 0; white-space: pre-wrap; }
.sheet a.btn { text-decoration: none; }
