/* Umbrela Mail. Colours from the Umbrela logo: charcoal, cream, rain blue. */
@font-face { font-family: "Outfit"; src: url("/outfit.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }

:root, [data-theme="dark"] {
  --bg: #0f100f; --panel: #151615; --panel-2: #1b1c1b; --raise: #222321; --line: rgba(243,236,228,.08); --line-2: rgba(243,236,228,.15);
  --fg: #f3ece4; --fg-2: rgba(243,236,228,.7); --fg-3: rgba(243,236,228,.46); --unread: #fcf5f0;
  --accent: #87c6fa; --accent-2: #5aa9f0; --on-accent: #08131d; --accent-soft: rgba(135,198,250,.13);
  --hover: rgba(243,236,228,.045); --sel: rgba(135,198,250,.1); --active: rgba(135,198,250,.16);
  --ok: #5fd08b; --warn: #f2c26b; --danger: #f08a7a; --shadow: 0 24px 70px rgba(0,0,0,.55), 0 2px 10px rgba(0,0,0,.4);
  --star: #f5c350;
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #f4f2ee; --panel: #ffffff; --panel-2: #f7f5f1; --raise: #ffffff; --line: rgba(20,21,20,.08); --line-2: rgba(20,21,20,.15);
  --fg: #1a1b1a; --fg-2: rgba(26,27,26,.7); --fg-3: rgba(26,27,26,.48); --unread: #0d0e0d;
  --accent: #2a78cf; --accent-2: #1f65b4; --on-accent: #ffffff; --accent-soft: rgba(42,120,207,.1);
  --hover: rgba(20,21,20,.035); --sel: rgba(42,120,207,.07); --active: rgba(42,120,207,.12);
  --ok: #238a4f; --warn: #a86c00; --danger: #c0392b; --shadow: 0 24px 70px rgba(20,20,20,.18), 0 2px 10px rgba(20,20,20,.08);
  --star: #e0a100;
  color-scheme: light;
}
:root { --ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; --brand: "Outfit", var(--ui); --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace; --r: 12px; --rowpad: 12px; }
[data-density="compact"] { --rowpad: 7px; }

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--fg); font: 14px/1.45 var(--ui); -webkit-font-smoothing: antialiased; overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: var(--accent); }
img, svg { display: block; }
.i { flex: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--accent); color: var(--on-accent); }
kbd { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 5px; background: var(--hover); box-shadow: inset 0 0 0 1px var(--line-2); font: 500 11px/1 var(--mono); color: var(--fg-2); }
.grow { flex: 1; }
.muted { color: var(--fg-3); }
.boot { height: 100dvh; display: grid; place-items: center; }
.boot img { animation: breathe 1.6s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .45; transform: scale(.94); } }
.noscript { padding: 40px; text-align: center; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 999px; background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line-2); font-weight: 500; white-space: nowrap; transition: background .15s, box-shadow .15s, transform .15s; }
.btn:hover { background: var(--hover); box-shadow: inset 0 0 0 1px var(--fg-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: default; }
.btn--primary { background: var(--accent); color: var(--on-accent); box-shadow: none; font-weight: 600; }
.btn--primary:hover { background: var(--accent-2); box-shadow: 0 0 0 4px var(--accent-soft); }
.btn--danger { background: var(--danger); color: #fff; box-shadow: none; }
.btn--quiet { background: none; box-shadow: none; color: var(--fg-2); }
.btn--quiet:hover { color: var(--danger); background: none; box-shadow: none; }
.btn--small { height: 30px; padding: 0 11px; font-size: 13px; }
.btn--block { width: 100%; height: 44px; font-size: 15px; }
.iconbtn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 999px; color: var(--fg-2); transition: background .15s, color .15s; }
.iconbtn:hover { background: var(--hover); color: var(--fg); }
.iconbtn--sm { width: 28px; height: 28px; }
.iconbtn--danger:hover { color: var(--danger); }
.iconbtn.star.is-on, .row__star.is-on { color: var(--star); }
.iconbtn.star.is-on svg, .row__star.is-on svg { fill: currentColor; }
.linkish { color: var(--accent); font-weight: 500; }
.linkish:hover { text-decoration: underline; }

/* ---------- sign in ---------- */
.login { position: relative; height: 100dvh; overflow-y: auto; display: grid; place-items: center; padding: 24px 16px 60px; background: radial-gradient(90% 70% at 80% 0%, rgba(245,176,106,.12), transparent 60%), radial-gradient(70% 60% at 0% 100%, rgba(135,198,250,.12), transparent 60%), var(--bg); }
.login__glow { position: fixed; left: 50%; top: 42%; width: min(620px, 120vw); aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgba(135,198,250,.15), transparent 62%); transform: translate(-50%, -50%); pointer-events: none; animation: drift 14s ease-in-out infinite alternate; }
@keyframes drift { to { transform: translate(-46%, -54%) scale(1.1); } }
.login__card { position: relative; width: min(400px, 100%); padding: 34px 30px 26px; border-radius: 22px; background: var(--panel); box-shadow: var(--shadow), inset 0 0 0 1px var(--line); display: grid; gap: 14px; }
.login__brand { display: flex; align-items: center; gap: 10px; font: 600 21px/1 var(--brand); letter-spacing: -.02em; margin-bottom: 6px; }
.login__brand em, .top__brand em { font-style: normal; font-weight: 400; color: var(--accent); }
.login h1 { margin: 6px 0 0; font: 600 24px/1.2 var(--brand); letter-spacing: -.02em; }
.login__sub { margin: -6px 0 4px; color: var(--fg-2); }
.login__note { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); color: var(--fg); }
.login__error { margin: 0; padding: 10px 12px; border-radius: 10px; background: rgba(240,138,122,.12); color: var(--danger); }
.login__links { display: flex; justify-content: center; }
.login__foot { position: absolute; bottom: 16px; left: 0; right: 0; margin: 0; text-align: center; font-size: 12px; color: var(--fg-3); }
.login__qr { display: grid; justify-items: center; gap: 8px; }
.qr { width: 196px; height: 196px; padding: 10px; border-radius: 14px; background: #fff; }
.qr svg { width: 100%; height: 100%; }
.login__qr details { font-size: 13px; color: var(--fg-2); text-align: center; }
.login__qr summary { cursor: pointer; color: var(--accent); }
.secret { display: block; margin-top: 6px; padding: 8px 10px; border-radius: 8px; background: var(--panel-2); font: 13px/1.4 var(--mono); letter-spacing: .06em; word-break: break-all; user-select: all; }

.field { display: grid; gap: 6px; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--fg-2); }
.field input, .field select, .field textarea, .addrin input, .addrin select { width: 100%; height: 42px; padding: 0 12px; border-radius: 10px; border: 0; background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line-2); outline: none; transition: box-shadow .15s; }
.field input:focus, .field select:focus, .addrin input:focus, .addrin select:focus { box-shadow: inset 0 0 0 2px var(--accent); }
.field small { color: var(--fg-3); }
.field--inline { grid-template-columns: auto 1fr; align-items: center; gap: 10px; }
.field--inline select { height: 34px; }

/* ---------- app frame ---------- */
.app { display: grid; grid-template-columns: 250px minmax(0, 1fr); grid-template-rows: 58px minmax(0, 1fr); height: 100dvh; }
.top { grid-column: 1 / -1; display: flex; align-items: center; gap: 16px; padding: 0 16px 0 18px; border-bottom: 1px solid var(--line); background: var(--panel); }
.top__menu { display: none; }
.top__brand { display: flex; align-items: center; gap: 9px; width: 216px; flex: none; color: var(--fg); text-decoration: none; font: 600 19px/1 var(--brand); letter-spacing: -.02em; }
.search { flex: 1; min-width: 0; max-width: 720px; display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px 0 14px; border-radius: 12px; background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); color: var(--fg-3); transition: box-shadow .15s, background .15s; }
.search:focus-within { background: var(--raise); box-shadow: inset 0 0 0 1px var(--accent), 0 0 0 4px var(--accent-soft); }
.search input { flex: 1; width: 100%; min-width: 0; border: 0; background: none; outline: none; color: var(--fg); font-size: 14.5px; }
.search input::-webkit-search-cancel-button { filter: grayscale(1); }
.top__right { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.top__compose { display: none; }
.menuwrap { position: relative; }
.avatar { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 50%; color: #0c0d0c; font: 700 13px/1 var(--ui); letter-spacing: .02em; }
.avatar--btn { cursor: pointer; }
.avatar--sm { width: 26px; height: 26px; font-size: 10.5px; }
.pop { position: absolute; top: calc(100% + 8px); right: 0; z-index: 40; min-width: 230px; padding: 6px; border-radius: 14px; background: var(--raise); box-shadow: var(--shadow), inset 0 0 0 1px var(--line); display: grid; animation: pop .14s ease-out; }
.pop--left { right: auto; left: 0; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } }
.pop a, .pop button { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; color: var(--fg); text-decoration: none; text-align: left; }
.pop a:hover, .pop button:hover { background: var(--hover); }
.pop__head { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; display: grid; }
.pop__head small { color: var(--fg-3); }

/* sidebar */
.side { display: flex; flex-direction: column; gap: 2px; padding: 14px 10px 10px; overflow-y: auto; border-right: 1px solid var(--line); background: var(--panel); }
.side__compose { height: 44px; margin: 0 4px 12px; font-size: 14.5px; justify-content: flex-start; padding: 0 18px; border-radius: 14px; }
.box { display: grid; }
.box__head { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: 10px; color: var(--fg); text-decoration: none; font-weight: 600; }
.box__head:hover { background: var(--hover); }
.box__head.is-current { background: var(--hover); }
.box__head span:nth-child(2) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { display: inline-block; width: 9px; height: 9px; flex: none; border-radius: 50%; }
.dot--lg { width: 12px; height: 12px; }
.dot--all { background: conic-gradient(#87c6fa, #f5b06a, #5fd08b, #c49bfa, #87c6fa); }
.box__folders { display: grid; gap: 1px; padding: 2px 0 8px 8px; }
.folder { display: flex; align-items: center; gap: 12px; height: 32px; padding: 0 10px; border-radius: 9px; color: var(--fg-2); text-decoration: none; }
.folder:hover { background: var(--hover); color: var(--fg); }
.folder.is-active { background: var(--active); color: var(--fg); font-weight: 600; }
.folder.is-active .i { color: var(--accent); }
.folder span { flex: 1; }
.count { min-width: 20px; padding: 0 6px; border-radius: 999px; text-align: center; font: 700 11.5px/19px var(--ui); color: var(--fg); }
.folder.is-active .count, .box__head .count { background: var(--accent); color: var(--on-accent); }
.box__addrs { margin: 4px 0 0; padding: 0 10px; display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: 11.5px; color: var(--fg-3); }
.side__empty { padding: 10px; color: var(--fg-3); }
.side__foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); display: grid; gap: 1px; }
.side__foot a { display: flex; align-items: center; gap: 12px; height: 34px; padding: 0 10px; border-radius: 9px; color: var(--fg-2); text-decoration: none; }
.side__foot a:hover, .side__foot a.is-active { background: var(--hover); color: var(--fg); }
.scrim { display: none; }

.main { min-width: 0; min-height: 0; overflow: hidden; }
.mail { display: grid; grid-template-columns: minmax(330px, 420px) minmax(0, 1fr); height: 100%; }

/* ---------- list ---------- */
.list { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: var(--panel); }
.list__head { display: flex; align-items: center; gap: 8px; min-height: 56px; padding: 8px 10px 8px 14px; border-bottom: 1px solid var(--line); }
.list__title { flex: 1; min-width: 0; }
.list__title h1 { margin: 0; font: 600 17px/1.2 var(--brand); letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list__title small { color: var(--fg-3); font-size: 12px; }
.list__body { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.list__more { padding: 16px; text-align: center; }
.group { position: sticky; top: 0; z-index: 2; padding: 10px 16px 6px; background: var(--panel); color: var(--fg-3); font: 600 11px/1 var(--ui); letter-spacing: .12em; text-transform: uppercase; }
.row { position: relative; display: grid; grid-template-columns: 22px 36px 1fr 26px; gap: 10px; align-items: start; padding: var(--rowpad) 10px var(--rowpad) 10px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .1s; }
.row:hover { background: var(--hover); }
.row.is-selected { background: var(--sel); }
.row.is-active { background: var(--active); }
.row.is-active::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); }
.row__check { display: grid; place-items: center; height: 36px; cursor: pointer; }
.row__check input, .list__all input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; opacity: .55; }
.row:hover .row__check input, .row__check input:checked { opacity: 1; }
.row__avatar { margin-top: 1px; }
[data-density="compact"] .row { grid-template-columns: 22px 1fr 26px; }
[data-density="compact"] .row__avatar { display: none; }
[data-density="compact"] .row__snippet { display: none; }
.row__main { min-width: 0; display: grid; gap: 1px; }
.row__top { display: flex; align-items: baseline; gap: 8px; }
.row__from { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--fg-2); font-size: 14px; }
.row__draft { font-style: normal; color: var(--danger); }
.row__date { flex: none; color: var(--fg-3); font-size: 12px; }
.row__subject { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--fg-2); }
.row__snippet { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--fg-3); font-size: 13px; }
.row.is-unread .row__from, .row.is-unread .row__subject { color: var(--unread); font-weight: 650; }
.row.is-unread .row__date { color: var(--accent); font-weight: 600; }
.row.is-unread::after { content: ""; position: absolute; left: 4px; top: calc(var(--rowpad) + 14px); width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.row.is-unread .row__check input { visibility: hidden; }
.row.is-unread:hover .row__check input, .row.is-unread .row__check input:checked { visibility: visible; }
.row.is-unread:hover::after, .row.is-unread.is-selected::after { display: none; }
.row__tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.tag { display: inline-flex; align-items: center; gap: 5px; height: 21px; padding: 0 8px; border-radius: 999px; background: var(--hover); box-shadow: inset 0 0 0 1px var(--line); color: var(--fg-2); font-size: 11.5px; white-space: nowrap; }
.tag--alias { color: var(--accent); background: var(--accent-soft); box-shadow: none; }
.tag--warn { color: var(--danger); background: rgba(240,138,122,.12); box-shadow: none; }
.row__star { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; color: var(--fg-3); opacity: 0; transition: opacity .1s; }
.row:hover .row__star, .row__star.is-on { opacity: 1; }
.row__star:hover { color: var(--star); }
.bulk { flex: 1; display: flex; align-items: center; gap: 2px; }
.bulk__n { margin-right: 8px; font-weight: 600; }
.empty { display: grid; justify-items: center; gap: 12px; padding: 60px 24px; text-align: center; color: var(--fg-3); }
.empty img { opacity: .5; }
.skeleton__row { display: grid; grid-template-columns: 36px 1fr; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.skeleton__row i, .skeleton__row b, .skeleton__row span, .skeleton__lines span { display: block; border-radius: 6px; background: linear-gradient(90deg, var(--hover), var(--line-2), var(--hover)); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.skeleton__row i { width: 36px; height: 36px; border-radius: 50%; }
.skeleton__row div { display: grid; gap: 7px; }
.skeleton__row b { height: 12px; width: 45%; }
.skeleton__row span { height: 10px; }
.skeleton__row span:last-child { width: 70%; }
.skeleton__lines { display: grid; gap: 12px; padding: 24px; }
.skeleton__lines span { height: 12px; }
.skeleton__lines span:nth-child(2) { width: 80%; } .skeleton__lines span:nth-child(3) { width: 60%; }
.skeleton__lines--big span:first-child { height: 26px; width: 55%; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- reader ---------- */
.reader { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); }
.reader--empty { display: grid; place-items: center; }
.reader__blank { display: grid; justify-items: center; gap: 10px; color: var(--fg-3); text-align: center; padding: 24px; }
.reader__blank img { opacity: .35; }
.reader__bar { display: flex; align-items: center; gap: 2px; min-height: 56px; padding: 8px 14px; border-bottom: 1px solid var(--line); background: var(--panel); }
.reader__back { display: none; }
.reader__scroll { flex: 1; overflow-y: auto; padding: 22px clamp(14px, 3vw, 36px) 60px; }
.reader__subject { margin: 0 0 8px; font: 600 clamp(20px, 2vw, 26px)/1.25 var(--brand); letter-spacing: -.02em; overflow-wrap: anywhere; }
.reader__meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 18px; }
.reader__loading { padding: 16px; }
.card { display: block; width: 100%; margin: 0 0 12px; border-radius: 16px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); text-align: left; overflow: hidden; }
.card--folded { display: flex; align-items: center; gap: 10px; padding: 12px 16px; color: var(--fg-2); }
.card--folded:hover { background: var(--panel-2); }
.card--folded b { color: var(--fg); font-weight: 600; flex: none; }
.card__snip { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--fg-3); }
.card--folded time { color: var(--fg-3); font-size: 12px; }
.card__head { display: flex; align-items: flex-start; gap: 12px; padding: 16px 16px 10px; }
.card__who { flex: 1; min-width: 0; }
.card__who b { font-weight: 650; }
.card__addr { color: var(--fg-3); font-size: 13px; }
.card__to { display: inline-flex; align-items: center; gap: 4px; color: var(--fg-3); font-weight: 400; font-size: 13px; }
.card__details { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin: 8px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--panel-2); font-size: 12.5px; }
.card__details dt { color: var(--fg-3); }
.card__details dd { margin: 0; overflow-wrap: anywhere; }
.card__date { flex: none; color: var(--fg-3); font-size: 12.5px; padding-top: 2px; }
.card__actions { display: flex; flex: none; margin: -4px -6px 0 0; }
.card__body { padding: 0 16px 16px; }
.mailframe { display: block; width: 100%; min-height: 48px; border: 0; border-radius: 12px; background: #fff; color-scheme: light; box-shadow: 0 0 0 1px var(--line); }
.plain { padding: 2px 2px 6px; font-size: 15px; line-height: 1.6; white-space: normal; overflow-wrap: anywhere; }
.card__foot { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 16px 18px; }
.banner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 0 16px 12px; padding: 10px 12px; border-radius: 10px; font-size: 13.5px; }
.banner--info { background: var(--accent-soft); }
.banner--warn { background: rgba(242,194,107,.14); color: var(--warn); }
.banner--danger { background: rgba(240,138,122,.13); color: var(--danger); }
.page .banner { margin: 0 0 16px; }
.atts { display: flex; flex-wrap: wrap; gap: 10px; padding: 0 16px 16px; }
.att { display: flex; align-items: center; gap: 10px; width: 240px; max-width: 100%; padding: 8px 12px 8px 8px; border-radius: 12px; background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); color: var(--fg); text-decoration: none; }
.att:hover { box-shadow: inset 0 0 0 1px var(--accent); }
.att__thumb { width: 42px; height: 42px; object-fit: cover; border-radius: 8px; flex: none; background: #fff; }
.att__icon { display: grid; place-items: center; width: 42px; height: 42px; flex: none; border-radius: 8px; background: var(--raise); color: var(--fg-2); font: 700 10px/1 var(--ui); letter-spacing: .04em; }
.att__icon--pdf { background: #e5534b; color: #fff; } .att__icon--doc { background: #2b6cb0; color: #fff; } .att__icon--sheet { background: #2f855a; color: #fff; } .att__icon--slides { background: #dd6b20; color: #fff; } .att__icon--archive { background: #6b46c1; color: #fff; }
.att__meta { flex: 1; min-width: 0; display: grid; }
.att__meta b { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att__meta small { color: var(--fg-3); }

/* ---------- composer ---------- */
.composer { position: fixed; right: 24px; bottom: 0; z-index: 30; width: min(620px, calc(100vw - 32px)); height: min(640px, calc(100dvh - 80px)); display: flex; flex-direction: column; border-radius: 16px 16px 0 0; background: var(--raise); box-shadow: var(--shadow), inset 0 0 0 1px var(--line-2); animation: rise .2s ease-out; }
@keyframes rise { from { transform: translateY(30px); opacity: 0; } }
.composer.is-min { height: auto; width: 320px; }
.composer.is-drag { box-shadow: var(--shadow), inset 0 0 0 2px var(--accent); }
.composer__head { display: flex; align-items: center; gap: 6px; height: 46px; padding: 0 8px 0 16px; border-radius: 16px 16px 0 0; background: var(--panel-2); cursor: default; }
.composer.is-min .composer__head { cursor: pointer; }
.composer__head b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.composer__saving { color: var(--fg-3); font-size: 12px; }
.composer__body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.composer__fields { position: relative; padding: 0 16px; }
.rcpt { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 5px; min-height: 42px; padding: 5px 0; border-bottom: 1px solid var(--line); cursor: text; }
.rcpt__label { width: 44px; flex: none; color: var(--fg-3); font-size: 13px; }
.rcpt input { flex: 1; min-width: 140px; height: 30px; border: 0; background: none; outline: none; }
.rcpt--from select { flex: 1; min-width: 0; height: 32px; border: 0; background: none; outline: none; cursor: pointer; }
.rcpt--from select option { background: var(--raise); color: var(--fg); }
.composer__cc { position: absolute; right: 16px; top: 52px; font-size: 13px; }
.composer__subject { width: 100%; height: 44px; border: 0; border-bottom: 1px solid var(--line); background: none; outline: none; font-size: 15px; font-weight: 500; }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 4px 0 10px; border-radius: 999px; background: var(--accent-soft); color: var(--fg); font-size: 13px; max-width: 100%; }
.chip button { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; color: var(--fg-2); }
.chip button:hover { background: var(--hover); color: var(--fg); }
.chip--bad { background: rgba(240,138,122,.15); color: var(--danger); }
.chip--file { background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); position: relative; overflow: hidden; padding-left: 8px; }
.chip--file small { color: var(--fg-3); }
.chip--file.is-uploading i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent-soft); }
.suggest { position: absolute; top: 100%; left: 44px; z-index: 5; width: min(360px, 90%); margin: 2px 0 0; padding: 5px; list-style: none; border-radius: 12px; background: var(--raise); box-shadow: var(--shadow), inset 0 0 0 1px var(--line-2); }
.suggest li { display: grid; padding: 7px 10px; border-radius: 8px; cursor: pointer; }
.suggest li small { color: var(--fg-3); }
.suggest li.is-hi, .suggest li:hover { background: var(--active); }
.composer__tools { display: flex; gap: 2px; padding: 6px 12px; border-bottom: 1px solid var(--line); }
.composer__editor { flex: 1; overflow-y: auto; padding: 14px 16px; outline: none; font-size: 15px; line-height: 1.6; overflow-wrap: anywhere; }
.composer__editor blockquote, .sig__editor blockquote { margin: 8px 0; padding-left: 12px; border-left: 3px solid var(--line-2); color: var(--fg-2); }
.composer__editor .umbrela-quote { color: var(--fg-2); }
.composer__editor img { max-width: 100%; height: auto; }
.composer__atts { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 16px; border-top: 1px solid var(--line); }
.composer__err { margin: 0; padding: 8px 16px; color: var(--danger); }
.composer__foot { display: flex; align-items: center; gap: 6px; padding: 10px 12px 12px 16px; border-top: 1px solid var(--line); }
.composer__hint { color: var(--fg-3); font-size: 12px; margin-right: 6px; }

/* ---------- toast, modal ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 60; transform: translateX(-50%); display: flex; align-items: center; gap: 14px; max-width: calc(100vw - 24px); padding: 10px 10px 10px 18px; border-radius: 12px; background: var(--fg); color: var(--bg); box-shadow: var(--shadow); animation: toastin .2s ease-out; }
@keyframes toastin { from { opacity: 0; transform: translate(-50%, 10px); } }
.toast button { font-weight: 700; color: var(--accent-2); padding: 4px 6px; border-radius: 6px; }
[data-theme="dark"] .toast button { color: #1f65b4; }
.toast__x { color: inherit !important; opacity: .6; }
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(5,6,6,.55); backdrop-filter: blur(3px); animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal__box { width: min(640px, 100%); max-height: 86dvh; overflow-y: auto; padding: 22px 24px 24px; border-radius: 18px; background: var(--raise); box-shadow: var(--shadow), inset 0 0 0 1px var(--line); display: grid; gap: 14px; }
.modal__box--narrow { width: min(470px, 100%); }
.modal__head { display: flex; align-items: center; gap: 10px; }
.modal__head h2 { flex: 1; margin: 0; font: 600 19px/1.25 var(--brand); }
.modal__box p { margin: 0; color: var(--fg-2); line-height: 1.55; }
.modal__foot { display: flex; justify-content: flex-end; gap: 8px; }
.keys { display: grid; gap: 8px; margin: 0; }
.keys div { display: flex; justify-content: space-between; gap: 16px; }
.keys dt { display: flex; gap: 4px; align-items: center; }
.keys dd { margin: 0; color: var(--fg-2); text-align: right; }

/* ---------- pages: settings, admin ---------- */
.page { height: 100%; overflow-y: auto; }
.page__inner { width: min(760px, 100% - 32px); margin: 0 auto; padding: 30px 0 80px; }
.page--wide .page__inner { width: min(1160px, 100% - 32px); }
.page h1 { display: flex; align-items: center; gap: 12px; margin: 0 0 4px; font: 600 28px/1.2 var(--brand); letter-spacing: -.02em; }
.page__sub { margin: 0 0 24px; color: var(--fg-3); }
.panel { margin: 0 0 16px; padding: 20px 22px; border-radius: 18px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); display: grid; gap: 14px; }
.panel h2 { margin: 0; font: 600 17px/1.2 var(--brand); }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--line); }
.panel h2 + .setting { border-top: 0; padding-top: 0; }
.setting > div:first-child { display: grid; gap: 2px; }
.setting small { color: var(--fg-3); }
.setting--col { flex-direction: column; align-items: stretch; }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); }
.seg button { height: 30px; padding: 0 14px; border-radius: 999px; color: var(--fg-2); font-weight: 500; font-size: 13px; }
.seg button.is-on { background: var(--accent); color: var(--on-accent); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips--edit { align-items: center; min-height: 38px; padding: 4px 6px; border-radius: 10px; background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line-2); }
.chips--edit input, .field .chips--edit input { flex: 1; width: auto; min-width: 120px; height: 28px; padding: 0 4px; border: 0; background: none; box-shadow: none; outline: none; }
.sig { display: grid; gap: 6px; }
.sig__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 30px; }
.sig__editor { min-height: 70px; padding: 10px 12px; border-radius: 10px; background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line-2); outline: none; }
.sig__editor:focus { box-shadow: inset 0 0 0 2px var(--accent); }
.pwform { display: grid; gap: 10px; }
.pwform__row { display: flex; align-items: center; gap: 12px; }
.pwform__row small { color: var(--fg-2); }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--accent); animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 14px 0 20px; padding: 4px; border-radius: 14px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); width: fit-content; max-width: 100%; }
.tabs a { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 10px; color: var(--fg-2); text-decoration: none; font-weight: 500; }
.tabs a:hover { color: var(--fg); background: var(--hover); }
.tabs a.is-on { background: var(--active); color: var(--fg); }
.tabs a.is-on .i { color: var(--accent); }
.admin__intro { grid-column: 1 / -1; margin: 0 0 4px; color: var(--fg-2); max-width: 75ch; }
.admin__note { margin: 4px 0 0; font-size: 13px; }
.admin__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.admin__stack { display: grid; gap: 14px; }
.admin__stack .panel { margin: 0; }
.pill { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.pill--ok { background: rgba(95,208,139,.14); color: var(--ok); }
.pill--warn { background: rgba(242,194,107,.15); color: var(--warn); }
.pill--muted { background: var(--hover); color: var(--fg-2); box-shadow: inset 0 0 0 1px var(--line); }
.dcard, .mcard { display: grid; gap: 12px; align-content: start; padding: 18px; border-radius: 16px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); }
.dcard header, .mcard header { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.dcard h3 { margin: 0 auto 0 0; font: 600 17px/1.2 var(--brand); }
.dns { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; font-size: 12.5px; }
.dns dt { color: var(--fg-3); font-weight: 600; }
.dns dd { margin: 0; font-family: var(--mono); font-size: 11.5px; overflow-wrap: anywhere; color: var(--fg-2); }
.dcard footer, .mcard footer { display: flex; gap: 8px; justify-content: flex-end; }
.mcard__name { flex: 1; min-width: 0; height: 34px; padding: 0 8px; border: 0; border-radius: 8px; background: none; font: 600 17px/1 var(--brand); outline: none; }
.mcard__name:hover, .mcard__name:focus { background: var(--panel-2); }
.mcard__sec { display: grid; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.mcard__sec h4 { margin: 0; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--fg-3); }
.mcard__sec small { font-size: 12px; }
.mcard--new h3 { margin: 0; font: 600 17px/1.2 var(--brand); }
.alist { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; }
.alist li { display: flex; align-items: center; gap: 8px; min-height: 30px; }
.alist li > span:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-family: var(--mono); font-size: 12.5px; }
.alist__catch span:first-child { color: var(--fg-3); }
.inline-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.addrin { display: flex; align-items: center; gap: 4px; flex: 1; min-width: 220px; }
.addrin input { flex: 1; min-width: 60px; height: 36px; }
.addrin select { width: auto; max-width: 55%; height: 36px; }
.addrin span { color: var(--fg-3); }
.people { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.addr-new__row { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.addr-new .btn, .panel > .btn { justify-self: start; }
.atable { display: grid; }
.atable__row { display: grid; grid-template-columns: minmax(180px, 1.2fr) minmax(140px, .8fr) minmax(200px, 1.4fr) 36px; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.atable__row--head { border-top: 0; color: var(--fg-3); font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.atable__addr { font-family: var(--mono); font-size: 12.5px; overflow-wrap: anywhere; }
.atable select { width: 100%; height: 34px; padding: 0 8px; border: 0; border-radius: 8px; background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); }
.atable .chips--edit { min-height: 34px; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.checks label, .check { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.checks input, .check input { width: 16px; height: 16px; accent-color: var(--accent); }
.person { display: grid; grid-template-columns: minmax(200px, 1.1fr) auto minmax(200px, 1.5fr) auto; gap: 14px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.person__who { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.person__who small { width: 100%; color: var(--fg-3); order: 3; }
.person__act { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }

/* ---------- smaller screens ---------- */
@media (max-width: 1180px) {
  .mail { grid-template-columns: minmax(300px, 360px) minmax(0, 1fr); }
  .app { grid-template-columns: 224px minmax(0, 1fr); }
  .top__brand { width: 190px; }
}
@media (max-width: 900px) {
  body { overflow: hidden; }
  .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: 56px minmax(0, 1fr); }
  .top { gap: 8px; padding: 0 10px; }
  .top__menu { display: grid; }
  .top__brand { width: auto; }
  .top__brand span { display: none; }
  .search { height: 38px; }
  .search kbd { display: none; }
  .top__compose { display: inline-flex; width: 40px; padding: 0; }
  .top__compose span { display: none; }
  .side { position: fixed; z-index: 45; top: 0; bottom: 0; left: 0; width: min(300px, 86vw); padding-top: 18px; transform: translateX(-102%); transition: transform .22s ease; box-shadow: var(--shadow); }
  .side.is-open { transform: none; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 44; background: rgba(0,0,0,.45); }
  .mail { grid-template-columns: minmax(0, 1fr); }
  .mail .reader { display: none; }
  .mail.has-message .list { display: none; }
  .mail.has-message .reader { display: flex; }
  .reader__back { display: grid; }
  .reader__scroll { padding: 16px 10px 80px; }
  .card__head { padding: 14px 12px 8px; }
  .card__body, .atts, .card__foot { padding-left: 12px; padding-right: 12px; }
  .banner { margin-left: 12px; margin-right: 12px; }
  .composer { inset: 0; right: 0; width: 100%; height: 100dvh; border-radius: 0; }
  .composer.is-min { inset: auto 8px 8px auto; width: 250px; height: auto; border-radius: 14px; }
  .composer__head { border-radius: 0; }
  .composer__hint { display: none; }
  .atable__row { grid-template-columns: 1fr; gap: 6px; }
  .atable__row--head { display: none; }
  .atable__act { justify-self: end; }
  .person { grid-template-columns: 1fr; gap: 8px; }
  .person__act { justify-content: flex-start; }
  .page__inner { padding-top: 20px; }
}
@media (hover: none) {
  .row__check input { opacity: 1; }
  .row__star { opacity: 1; }
}
@media print {
  .top, .side, .list, .reader__bar, .card__actions, .card__foot, .composer, .toast { display: none !important; }
  body { overflow: visible; background: #fff; color: #000; }
  .app, .mail { display: block; height: auto; }
  .reader__scroll { overflow: visible; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; } }
