/* app.css — the page's look: a dense, quiet mail client in the system font, in the cosmos (jae, his mail room 11, 2026-10-12: "make the theme cosmos like, like gno.world... just make sure it isn't too transparent"): a near-black deep-blue sky with faint stars behind, panels of dark glass at nine tenths, cool lines, a blue-white accent — the globe site's night, not a white office. */
*, *::before, *::after { box-sizing: border-box }
:root {
  color-scheme: dark;
  --sky: #060912; --bg: rgba(10, 14, 26, .92); --fg: #e6ebf5; --muted: #8f9bb3; --line: #273047; --nav: rgba(12, 17, 31, .94); --hover: rgba(40, 52, 84, .55); --sel: rgba(58, 84, 140, .55);
  --accent: #8ab4ff; --accent-fg: #0b1a33; --read: rgba(14, 19, 34, .9); --chip: #233052; --danger: #f28b82; --star: #ffd84f; --ok: #5fd38d;
  --shadow: 0 1px 3px rgba(0,0,0,.6), 0 8px 24px rgba(0,0,0,.5); --radius: 8px;
  --c-primary: #9aa4bd; --c-social: #8ab4ff; --c-promotions: #5fd38d; --c-updates: #fcad70; --c-forums: #c58af9; --c-spam: #f28b82;
}
/* the sky: a deep blue-black with faint stars, drawn by the page itself (no picture to fetch) */
html { background: var(--sky) }
body { background: radial-gradient(1.2px 1.2px at 12% 18%, rgba(255,255,255,.55) 50%, transparent 51%), radial-gradient(1px 1px at 33% 71%, rgba(255,255,255,.45) 50%, transparent 51%), radial-gradient(1.4px 1.4px at 57% 29%, rgba(200,220,255,.6) 50%, transparent 51%), radial-gradient(1px 1px at 78% 83%, rgba(255,255,255,.4) 50%, transparent 51%), radial-gradient(1px 1px at 88% 12%, rgba(255,255,255,.5) 50%, transparent 51%), radial-gradient(1.6px 1.6px at 44% 92%, rgba(255,230,200,.55) 50%, transparent 51%), radial-gradient(1px 1px at 66% 52%, rgba(255,255,255,.35) 50%, transparent 51%), radial-gradient(1px 1px at 22% 46%, rgba(255,255,255,.35) 50%, transparent 51%), radial-gradient(ellipse 60% 40% at 70% 0%, rgba(40, 60, 120, .35), transparent 70%), radial-gradient(ellipse 50% 50% at 10% 100%, rgba(80, 30, 90, .25), transparent 70%), var(--sky) !important }
html, body { margin: 0; height: 100% }
body { font: 14px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; color: var(--fg); overflow: hidden }
a { color: var(--accent); text-decoration: none }
button, input, textarea, select { font: inherit; color: inherit }
input, textarea, select { background-color: var(--bg) } /* an explicit colour in every state, so no field ever shows the browser's own white between paints (jae, 2026-10-12: "when i send an email, sometimes the text fields flash white") */
button { cursor: pointer }
.muted { color: var(--muted) }
.spacer { flex: 1 }
[hidden] { display: none !important }
h1, h2, h3 { font-weight: 500; margin: 0 }

/* --- appearance (Settings → Appearance): dark is the cosmos above; light for daylight; "system" follows the device.
   The page's <html data-theme> is set before anything paints (app.js), from the account's setting. */
:root[data-theme=light] { color-scheme: light; --sky: #f3f5fa; --bg: rgba(255, 255, 255, .94); --fg: #1b2230; --muted: #5d6677; --line: #d7dce7; --nav: rgba(247, 249, 253, .96); --hover: rgba(36, 86, 199, .08); --sel: rgba(36, 86, 199, .14); --accent: #2456c7; --accent-fg: #ffffff; --read: rgba(246, 248, 252, .9); --chip: #e4e9f4; --danger: #c5221f; --star: #e3a008; --ok: #188038; --shadow: 0 1px 3px rgba(0,0,0,.14), 0 8px 24px rgba(0,0,0,.12); --c-primary: #5f6b85; --c-social: #2456c7; --c-promotions: #188038; --c-updates: #c2641a; --c-forums: #7b3fbf; --c-spam: #c5221f; }
:root[data-theme=light] body { background: var(--sky) } /* a day sky has no stars */
@media (prefers-color-scheme: light) {
  :root[data-theme=system] { color-scheme: light; --sky: #f3f5fa; --bg: rgba(255, 255, 255, .94); --fg: #1b2230; --muted: #5d6677; --line: #d7dce7; --nav: rgba(247, 249, 253, .96); --hover: rgba(36, 86, 199, .08); --sel: rgba(36, 86, 199, .14); --accent: #2456c7; --accent-fg: #ffffff; --read: rgba(246, 248, 252, .9); --chip: #e4e9f4; --danger: #c5221f; --star: #e3a008; --ok: #188038; --shadow: 0 1px 3px rgba(0,0,0,.14), 0 8px 24px rgba(0,0,0,.12); --c-primary: #5f6b85; --c-social: #2456c7; --c-promotions: #188038; --c-updates: #c2641a; --c-forums: #7b3fbf; --c-spam: #c5221f; }
  :root[data-theme=system] body { background: var(--sky) }
}

/* --- the reading pane (Settings → Reading): the list keeps a column, the conversation opens to its right */
.split { flex: 1; display: flex; min-height: 0 }
.split .pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden }
.split .pane.list { flex: none; width: 420px; border-right: 1px solid var(--line) }
.split .pane.reading { flex: 1 }
.split .pane.reading .nothing { margin: auto; color: var(--muted) }
.row.open { background: var(--sel) }

/* --- density (Settings → Appearance): compact rows for a long list */
:root[data-density=compact] .row { height: 32px; font-size: 13px }
:root[data-density=compact] .row .star { font-size: 15px; width: 24px; height: 24px }
:root[data-density=compact] .row .hover .icon { width: 24px; height: 24px; font-size: 13px }
:root[data-density=compact] .tab { padding: 7px 14px }

/* --- print (the message menu's Print): the conversation alone, every message open, no chrome */
@media print {
  .nav, .listhead, .tabs, #dock, #toasts, .threadbar, .threadfoot, .split .pane.list, .row .hover, .ai-out, .msg .more, .msg .star { display: none !important }
  html, body, .shell, .main, .thread, .split, .split .pane.reading { overflow: visible !important; height: auto !important; background: #fff !important; color: #000 !important }
  .msg { break-inside: avoid; border: 0; border-top: 1px solid #ccc }
  .msg .msgbody iframe { color-scheme: light }
}

/* --- a calendar invite's card (thread.js inviteEl) */
.invite { margin: 8px 14px; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; background: var(--nav) }
.invite .ititle { font-weight: 600 } .invite .iwhen, .invite .iwhere { margin-top: 2px }
.invite .ibtns { margin-top: 8px; display: flex; gap: 6px } .invite .ibtns .chosen { background: var(--sel) }

/* --- buttons */
.btn { border: 1px solid var(--line); background: var(--bg); border-radius: 18px; padding: 6px 14px; line-height: 1.2 }
.btn:hover { background: var(--hover) }
.btn.primary { background: var(--accent); color: var(--accent-fg); border-color: transparent }
.btn.primary:hover { filter: brightness(1.08) }
.btn.small { padding: 3px 10px; font-size: 13px }
.btn.danger { color: var(--danger) }
.icon { border: 0; background: none; border-radius: 50%; width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; font-size: 16px; color: var(--muted) }
.icon:hover { background: var(--hover); color: var(--fg) }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=number], input:not([type]), textarea, select {
  border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; background: var(--bg); color: var(--fg); min-width: 0 }
textarea { width: 100%; resize: vertical; font: inherit }
input:focus, textarea:focus, select:focus { outline: 2px solid color-mix(in srgb, var(--accent) 50%, transparent); outline-offset: 0 }
.chip { display: inline-block; background: var(--chip); border-radius: 4px; padding: 0 6px; font-size: 11px; line-height: 18px; margin-right: 4px; font-weight: 500; color: var(--fg); cursor: pointer; vertical-align: middle }
.err { color: var(--danger); min-height: 1.2em; margin: 6px 0 0 }

/* --- login */
.login { height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--nav) }
.login-box { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 32px; width: 340px; max-width: 92vw; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow) }
.login-box h1 { font-size: 28px; margin-bottom: 4px }
.login-box input { padding: 10px }
.login-box .adena { padding: 12px; font-size: 15px }
.login-box .wrow { display: flex; align-items: center; gap: 6px; flex-wrap: wrap }
.login-box .wrow .wname { flex: 1; min-width: 120px; padding: 8px }
.login-box .pwlink, .login-box .step, .login-box .gw { font-size: 13px; text-align: center }
.login-box .pwform { display: flex; flex-direction: column; gap: 10px }
.apppw code.pw, code.wallet { font-size: 14px; word-break: break-all; user-select: all }

/* --- the shell */
#app { height: 100vh; display: flex; flex-direction: column }
.top { height: 56px; flex: none; display: flex; align-items: center; gap: 10px; padding: 0 12px; border-bottom: 1px solid var(--line); background: var(--nav) }
.logo { font-size: 20px; font-weight: 500; color: var(--fg); padding: 0 6px; display: inline-flex; align-items: center; gap: 8px; letter-spacing: .2px }
.logo-ico { width: 22px; height: 22px; display: block }
.menu-btn { display: none }
.search { display: flex; align-items: center; background: var(--nav); border-radius: 24px; padding: 2px 4px 2px 12px; width: 560px; max-width: 48vw }
.search input { flex: 1; border: 0; background: none; padding: 8px 4px }
.search input:focus { outline: none }
.account { position: relative }
.acct-btn { border: 0; background: none; padding: 6px 10px; border-radius: 16px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.acct-btn:hover { background: var(--hover) }
.account .menu { position: absolute; right: 0; top: 40px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); min-width: 160px; z-index: 30; padding: 4px 0 }
.account .menu a { display: block; padding: 8px 14px; color: var(--fg) }
.account .menu a:hover { background: var(--hover) }
.shell { flex: 1; display: flex; min-height: 0 }
.nav { width: 232px; flex: none; background: var(--nav); overflow-y: auto; padding: 8px 8px 20px }
.compose-btn { width: 100%; padding: 12px; border-radius: 16px; font-weight: 500; margin: 4px 0 12px; box-shadow: var(--shadow); border: 0; background: var(--bg) }
.compose-btn:hover { background: var(--hover) }
.navitem { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 0 16px 16px 0; color: var(--fg); margin-right: 8px }
.navitem:hover { background: var(--hover) }
.navitem.active { background: var(--sel); font-weight: 600 }
.navitem .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.navitem .count { font-size: 12px; font-weight: 600 }
.navitem .count.total { font-weight: 400; color: var(--muted) }
.navitem.small { font-size: 13px; color: var(--muted) }
.dot { width: 10px; height: 10px; border-radius: 3px; background: var(--chip); display: inline-block; flex: none }
.navhead { font-size: 12px; color: var(--muted); padding: 14px 12px 4px; text-transform: uppercase; letter-spacing: .04em }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden }
.loading, .empty { padding: 40px; text-align: center; color: var(--muted) }

/* --- the list */
.listhead { display: flex; align-items: center; gap: 4px; padding: 6px 12px; border-bottom: 1px solid var(--line); min-height: 48px; flex: none }
.listhead .chk { display: inline-flex; padding: 6px }
.listhead .pager { color: var(--muted); font-size: 12px; white-space: nowrap; margin: 0 4px }
.viewtitle { font-weight: 500; padding: 0 8px }
.bulk { display: flex; gap: 2px; align-items: center }
.tabs { display: flex; border-bottom: 1px solid var(--line); flex: none; overflow-x: auto }
.tab { padding: 10px 18px; color: var(--muted); border-bottom: 3px solid transparent; white-space: nowrap; display: flex; gap: 8px; align-items: center; min-width: 120px }
.tab:hover { background: var(--hover) }
.tab.active { color: var(--fg); font-weight: 600 }
.tab[data-cat=primary].active { border-color: var(--c-primary) } .tab[data-cat=social].active { border-color: var(--c-social) }
.tab[data-cat=promotions].active { border-color: var(--c-promotions) } .tab[data-cat=updates].active { border-color: var(--c-updates) } .tab[data-cat=forums].active { border-color: var(--c-forums) }
.tab .count { font-size: 12px; background: var(--chip); border-radius: 10px; padding: 0 7px; font-weight: 600 }
.rows { flex: 1; overflow-y: auto; outline: none }
.row { display: flex; align-items: center; gap: 6px; padding: 0 8px 0 12px; height: 40px; border-bottom: 1px solid var(--line); cursor: pointer; background: var(--read); position: relative; touch-action: pan-y; transition: transform .15s, background .15s }
.row.swiping { transition: none }
.row[data-swipe="archive"] { background: color-mix(in srgb, var(--ok) 22%, var(--read)) }
.row[data-swipe="trash"] { background: color-mix(in srgb, var(--danger) 22%, var(--read)) }
.row.unread { background: var(--bg); font-weight: 600 }
.row:hover { box-shadow: inset 0 -1px 0 var(--line), 0 1px 3px rgba(0,0,0,.25); z-index: 1 }
.row.cursor { box-shadow: inset 3px 0 0 var(--accent) }
.row .hover { display: none; position: absolute; right: 6px; top: 0; bottom: 0; align-items: center; padding-left: 8px; background: inherit }
.row:hover .hover { display: inline-flex }
.row:hover .date, .row:hover .clip { visibility: hidden }
.row .hover .icon { width: 28px; height: 28px; font-size: 14px; color: var(--muted) }
.row .hover .icon:hover { color: var(--fg) }
.row.selected { background: var(--sel) }
.row .chk { display: inline-flex; padding: 6px }
.row .star { border: 0; background: none; color: var(--muted); font-size: 18px; width: 28px; height: 28px; border-radius: 50%; opacity: .55 }
.row .star.on, .msg .star.on { color: var(--star); opacity: 1 }
.row .star:hover { opacity: 1; background: var(--hover) }
.row .from { width: 190px; flex: none; overflow: hidden; white-space: nowrap; text-overflow: ellipsis }
.row .from .n { color: var(--muted); font-weight: 400; font-size: 12px }
.row .imp { color: var(--c-updates); font-size: 16px; width: 12px; opacity: 0 }
.row .imp.on { opacity: 1 }
.row .text { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis }
.row .snippet { color: var(--muted); font-weight: 400 }
.row .needs { width: 8px; height: 8px; border-radius: 50%; background: var(--c-social); flex: none; margin-right: 2px }
.row .clip { color: var(--muted); font-size: 13px; width: 16px; flex: none }
.row .date { flex: none; width: 76px; text-align: right; font-size: 12px; white-space: nowrap }
.row:hover::after { content: attr(data-catname); position: absolute; right: 150px; top: 11px; font-size: 11px; color: var(--muted); font-weight: 400; display: none }
.row[data-cat]:hover::after { display: block }
.row.draft .from { color: var(--danger) }
.sentinel { height: 1px }

/* --- the thread */
.thread { flex: 1; overflow-y: auto; padding-bottom: 40px }
.threadbar { display: flex; align-items: center; gap: 2px; padding: 6px 12px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); z-index: 2 }
.thread .subject { font-size: 22px; padding: 16px 24px 8px; font-weight: 400 }
.thread .subject .chip { font-size: 12px; vertical-align: middle }
.msgs { padding: 0 8px }
.msg { border: 1px solid var(--line); border-radius: 8px; margin: 8px 8px; background: var(--bg) }
.msg.collapsed .msgbody, .msg.collapsed .atts, .msg.collapsed .ailine, .msg.collapsed .to { display: none }
.msg.collapsed .msghead { cursor: pointer }
.msg.collapsed .snip { display: inline }
.msghead { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px }
.msghead .snip { display: none; flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--muted); padding-top: 2px }
.avatar { width: 36px; height: 36px; border-radius: 50%; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; flex: none }
.who { flex: 1; min-width: 0 }
.who .addr { font-size: 12px }
.who .to { font-size: 12px }
.msgdate { font-size: 12px; white-space: nowrap; padding-top: 2px }
.msg .star { border: 0; background: none; font-size: 18px; color: var(--muted); width: 28px; height: 28px; opacity: .55 }
.ailine { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 0 14px 8px 60px; font-size: 12px; color: var(--muted) }
.ailine .cat { font-weight: 600; text-transform: uppercase; letter-spacing: .03em; font-size: 11px }
.cat-primary { color: var(--c-primary) } .cat-social { color: var(--c-social) } .cat-promotions { color: var(--c-promotions) } .cat-updates { color: var(--c-updates) } .cat-forums { color: var(--c-forums) } .cat-spam { color: var(--c-spam) }
.ailine .needs { color: var(--c-social); font-weight: 600 }
.ailine .movecat { font-size: 12px; padding: 2px 6px; border-radius: 12px; margin-left: auto }
.ailine .summary { width: 100%; font-style: italic }
.msgbody { padding: 0 14px 8px 60px }
.msgbody iframe { width: 100%; border: 0; height: 80px; display: block; background: transparent; color-scheme: light dark; border-radius: 4px } /* no colour of its own: the page's card shows through until the frame paints itself, so dark mode never flashes white (jae, 2026-10-12) */
.btn-images { margin-top: 6px }
.atts { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 14px 14px 60px }
.atts .att { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; color: var(--fg); font-size: 13px; display: inline-flex; gap: 8px; align-items: center }
.atts .att:hover { background: var(--hover) }
.atts .att .sz { color: var(--muted); font-size: 12px }
.ai-out { margin: 8px 24px; padding: 12px 16px; background: var(--nav); border-radius: 8px; font-size: 14px }
.ai-out ul { margin: 6px 0 0; padding-left: 18px }
.ai-out .rchip { margin: 6px 6px 0 0; padding: 6px 12px; border-radius: 16px; border: 1px solid var(--line); background: var(--bg); text-align: left }
.ai-out .rchip:hover { background: var(--hover) }
.threadfoot { padding: 8px 24px }
.replybtns { display: flex; gap: 8px; padding: 8px 0 }

/* --- popups, toasts, sheets */
.popup { position: absolute; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); z-index: 40; min-width: 180px; max-height: 60vh; overflow-y: auto; padding: 4px 0 }
.popup .mitem { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px 14px }
.popup .mitem:hover { background: var(--hover) }
.popup .mhead { padding: 6px 14px; font-size: 12px; color: var(--muted) }
.popup .mrow { padding: 6px 10px }
.popup hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0 }
#toasts { position: fixed; left: 24px; bottom: 24px; z-index: 50; display: flex; flex-direction: column; gap: 8px }
.toast { background: #202124; color: #fff; border-radius: 8px; padding: 10px 8px 10px 16px; display: flex; align-items: center; gap: 12px; box-shadow: var(--shadow); max-width: 420px }
.toast .taction { border: 0; background: none; color: #8ab4f8; font-weight: 600; padding: 4px 8px }
.toast .tclose { color: #ccc; width: 26px; height: 26px }
.sheet-back { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 45; display: flex; align-items: center; justify-content: center }
.sheet { background: var(--bg); border-radius: 12px; padding: 20px 24px; width: 560px; max-width: 94vw; max-height: 85vh; overflow: auto; box-shadow: var(--shadow) }
.sheet h2 { margin-bottom: 10px }
.sheet table { border-collapse: collapse; width: 100% }
.sheet td { padding: 3px 8px; border-bottom: 1px solid var(--line) }
.sheet kbd { background: var(--chip); border-radius: 4px; padding: 1px 6px; font-family: inherit; font-size: 12px; margin-right: 2px }

/* --- the composer */
#dock { position: fixed; right: 24px; bottom: 0; display: flex; gap: 12px; align-items: flex-end; z-index: 35 }
.composer { width: 540px; max-width: 96vw; background: var(--bg); border: 1px solid var(--line); border-radius: 8px 8px 0 0; box-shadow: var(--shadow); display: flex; flex-direction: column; max-height: 85vh }
.composer.inline { width: auto; max-width: none; border-radius: 8px; box-shadow: none; margin-top: 4px }
.chead { display: flex; align-items: center; padding: 6px 8px 6px 14px; background: var(--nav); border-radius: 8px 8px 0 0; font-weight: 500 }
.composer.inline .chead { background: var(--nav) }
.frow { display: flex; align-items: center; gap: 8px; padding: 4px 14px; border-bottom: 1px solid var(--line); position: relative }
.frow .flabel { color: var(--muted); width: 54px; flex: none; font-size: 13px }
.frow input { flex: 1; border: 0; background: none; padding: 6px 0 }
.frow input:focus { outline: none }
.frow .reveals { font-size: 13px }
.composer .ctools { display: flex; align-items: center; gap: 2px; padding: 2px 8px; border-bottom: 1px solid var(--line) }
.composer .ctools .fmt { width: 26px; height: 24px; font-size: 13px }
.composer .fmthint { font-size: 11px; margin-left: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.composer .body { flex: 1; border: 0; border-radius: 0; min-height: 180px; padding: 10px 14px; resize: none }
.composer .body:focus { outline: none }
.catts { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px }
.catt { border: 1px solid var(--line); border-radius: 6px; padding: 3px 8px; font-size: 12px; display: inline-flex; gap: 6px; align-items: center }
.catt button { border: 0; background: none; color: var(--muted); padding: 0 }
.cfoot { display: flex; align-items: center; gap: 8px; padding: 10px 14px }
.cfoot .status { font-size: 12px; color: var(--muted); margin-left: auto }
.ac { position: absolute; left: 70px; top: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); z-index: 60; min-width: 260px; padding: 4px 0 }
.acitem { padding: 8px 12px; cursor: pointer }
.acitem.active, .acitem:hover { background: var(--sel) }

/* --- settings and admin */
.page { flex: 1; overflow-y: auto; padding: 16px 32px 60px; max-width: 920px }
.page h1 { font-size: 22px; padding: 8px 0 16px }
.page h2 { font-size: 16px; padding: 24px 0 8px; border-bottom: 1px solid var(--line); margin-bottom: 12px }
.srow { display: flex; gap: 16px; padding: 8px 0; align-items: flex-start }
.srow .slabel { width: 200px; flex: none; padding-top: 6px; color: var(--muted) }
.srow .sfield { flex: 1; min-width: 0 }
.srow .sfield input:not([type=checkbox]), .srow .sfield select { width: 100%; max-width: 420px }
.hint { font-size: 12px; margin-top: 4px }
.rule { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line) }
.rule .desc { flex: 1 }
.rule .rtext { display: block; font-size: 12px }
.rule.off .desc { color: var(--muted); text-decoration: line-through }
.addrule { display: flex; gap: 8px; margin: 12px 0 }
.addrule input { flex: 1 }
.rulepreview, .ruleform { background: var(--nav); border-radius: 8px; padding: 12px 16px; margin: 8px 0 }
.ruleform .grid { display: grid; grid-template-columns: 120px 1fr; gap: 6px 10px; align-items: center; margin-top: 8px }
.ruleform .grid input[type=text], .ruleform .grid select { width: 100% }
.ruleform .acts { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px }
.ruleform .acts label { display: inline-flex; gap: 4px; align-items: center }
.ruleform .fbtns { display: flex; gap: 8px; margin-top: 12px }
.explain { font-style: italic; margin-bottom: 6px }
table.plain { border-collapse: collapse; width: 100% }
table.plain th, table.plain td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top }
table.plain th { color: var(--muted); font-weight: 500; font-size: 12px }
.rec.ok .st { color: var(--ok) } .rec.missing .st { color: var(--danger) }
.rec .val { font-family: ui-monospace, Menlo, monospace; font-size: 12px; word-break: break-all; max-width: 420px }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px }
.stat { background: var(--nav); border-radius: 8px; padding: 10px 12px }
.stat b { display: block; font-size: 20px; font-weight: 500 }
.stat span { font-size: 12px; color: var(--muted) }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0 }
.labels-list .lrow { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line) }

/* --- phones */
@media (max-width: 700px) {
  .menu-btn { display: inline-flex }
  .nav { position: fixed; left: 0; top: 56px; bottom: 0; transform: translateX(-100%); transition: transform .2s; z-index: 20; box-shadow: var(--shadow); width: 260px }
  .nav.open { transform: none }
  .logo { display: none }
  .search { flex: 1; max-width: none }
  .acct-btn { max-width: 90px }
  .row { padding-left: 4px }
  .row .from { width: 110px }
  .row .date { width: 54px }
  .row .chk, .row .imp { display: none }
  .thread .subject { font-size: 18px; padding: 12px 16px 6px }
  .msgs { padding: 0 }
  .msg { margin: 6px 4px }
  .msghead { padding: 10px }
  .ailine, .msgbody, .atts { padding-left: 10px }
  .msgdate { display: none }
  .threadfoot { padding: 8px 10px }
  .tab { min-width: 0; padding: 10px 12px }
  .tab .tabname { font-size: 13px }
  .viewtitle { display: none }
  #dock { right: 0; left: 0 }
  .composer:not(.inline) { position: fixed; inset: 0; width: auto; max-width: none; max-height: none; border-radius: 0 }
  .composer:not(.inline) .body { min-height: 0 }
  .page { padding: 12px 16px 60px }
  .srow { flex-direction: column; gap: 4px }
  .srow .slabel { width: auto; padding-top: 0 }
  #toasts { left: 12px; right: 12px; bottom: 12px }
}
.sessions .session { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line) }
.sessions .session .dev { font-weight: 500 } .sessions .session .k { font-size: 12px; background: var(--chip); border-radius: 10px; padding: 0 7px }
.sessions .session .when { flex: 1 }
.row .date.snoozed { color: var(--c-updates); white-space: nowrap }
.popup .snoozeat { font: inherit; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: inherit }
.att.img { display: inline-flex; flex-direction: column; gap: 4px; align-items: flex-start }
.att .thumb { max-width: 220px; max-height: 160px; border-radius: 6px; border: 1px solid var(--line); background: var(--read); object-fit: cover }
.composer.drop { outline: 2px dashed var(--accent); outline-offset: -4px }
#contacts .csearch { width: 100%; max-width: 420px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 18px; background: var(--bg); margin: 8px 0 12px }
table.contacts { width: 100%; border-collapse: collapse; font-size: 13px }
table.contacts th { text-align: left; color: var(--muted); font-weight: 500; padding: 6px 8px; border-bottom: 1px solid var(--line) }
table.contacts td { padding: 4px 8px; border-bottom: 1px solid var(--line) } table.contacts td.n { text-align: right; width: 60px }
table.contacts .cname { width: 100%; max-width: 260px; padding: 4px 6px; border: 1px solid transparent; border-radius: 6px; background: transparent }
table.contacts .cname:hover, table.contacts .cname:focus { border-color: var(--line); background: var(--bg) }

/* the Mail apps card in Settings: the app settings as a list of pairs */
.mailapps { display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px; margin: 8px 0; }
.mailapps dt { color: var(--muted); }
.mailapps dd { margin: 0; }

/* the composer's Send later menu */
.popup .later { display: flex; flex-direction: column; gap: 6px; min-width: 240px; }
.popup .later .row { display: flex; gap: 6px; align-items: center; }
.popup .later .btn { text-align: left; }
.composer .sendlater { padding: 0 8px; }

/* the admin's users directory: a search, a sort, pages */
.dirbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 6px 0; }
.dirbar .usearch { flex: 1; min-width: 160px; }
.dirbar .sorts .btn.cur { font-weight: 600; }
.users td.n, .users td.seen { white-space: nowrap; font-variant-numeric: tabular-nums; }
.pager.muted { display: flex; gap: 8px; align-items: center; margin: 6px 0; }

/* the templates list in Settings */
.templates .trow { display: flex; gap: 8px; align-items: center; margin: 4px 0; }
.templates .tname { width: 200px; }
.templates .tsubj { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
