/* Dash webmail: a desktop-mail layout (top bar, folders, list, reading pane) in the panel's look, light and dark. */
/* Inter (SIL Open Font License, Inter-OFL.txt), served from here: the page's CSP allows no font hosts */
@font-face { font-family: "Inter"; src: url("/static/Inter-latin.woff2") format("woff2"); font-weight: 100 900; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; src: url("/static/Inter-latin-ext.woff2") format("woff2"); font-weight: 100 900; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
/* the panel's look: white, forest text accents, lime only for the main action and what is chosen
   (--blue is the accent's old name, kept so every rule below follows it) */
:root {
  --blue: #163300; --blue-2: #2b5a07; --blue-soft: #f3faee; --blue-sel: #eef8e7; --blue-ring: rgba(159, 232, 112, .35);
  --lime: #9fe870; --lime-2: #8ad85a; --lime-soft: #e2f6d5; --lime-line: #d3efbf;
  --ink: #0e0f0c; --ink-2: #4a4c49; --muted: #73756f; --faint: #a3a59f;
  --line: #e8eae5; --line-2: #f0f1ee; --bg: #ffffff; --pane: #ffffff; --hover: #f4f5f2; --input: #ffffff;
  --red: #c4382b; --red-soft: #fdecea; --green: #2b7a0b; --amber: #b8650a;
  --top: 60px; --side: 240px; --list: 400px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --shadow: 0 12px 32px rgba(14, 15, 12, .12), 0 1px 3px rgba(14, 15, 12, .06);
  color-scheme: light;
}
:root.dark {
  --blue: #9fe870; --blue-2: #b6ef8f; --blue-soft: #1c2617; --blue-sel: #223018; --blue-ring: rgba(159, 232, 112, .3);
  --lime-soft: #223018; --lime-line: #35502a;
  --ink: #eef0ec; --ink-2: #c9ccc5; --muted: #9a9d96; --faint: #6f726b;
  --line: #2c2f2a; --line-2: #242722; --bg: #161815; --pane: #161815; --hover: #20231f; --input: #1d201c;
  --red: #f0857a; --red-soft: #3a1d1a; --green: #8fdc63; --amber: #f2a14a;
  --shadow: 0 12px 32px rgba(0, 0, 0, .55);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.45 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; overflow: hidden; }
body.booting #app { visibility: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--blue); }
[hidden] { display: none !important; }
svg.i { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- buttons and fields ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 1px solid var(--line); border-radius: 4px;
  background: var(--bg); color: var(--ink); font-weight: 600; font-size: 14px; white-space: nowrap; }
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-2); border-color: var(--blue-2); }
.btn:disabled { opacity: .5; cursor: default; }
.tb { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 9px; border: 0; border-radius: 4px; background: none; color: var(--ink); font-size: 13.5px; white-space: nowrap; }
.tb svg.i { color: var(--blue); }
.tb:hover:not(:disabled) { background: var(--hover); }
.tb:disabled { opacity: .45; cursor: default; }
.tb.danger svg.i { color: var(--red); }
.ib { display: inline-grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 4px; background: none; color: var(--muted); }
.ib:hover { background: var(--hover); color: var(--ink); }
.field { width: 100%; height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 4px; background: var(--input); outline: none; }
.field:focus { border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue-ring); }
.sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; flex: none; }

/* ---------- sign in ---------- */
.login { position: fixed; inset: 0; overflow: auto; background: linear-gradient(180deg, var(--blue) 0, var(--blue) 40vh, var(--pane) 40vh);
  display: flex; flex-direction: column; align-items: center; padding: 10vh 16px 32px; }
:root.dark .login { background: linear-gradient(180deg, #0c3b5e 0, #0c3b5e 40vh, var(--pane) 40vh); }
.login-brand { display: flex; align-items: center; gap: 12px; color: #fff; font-size: 26px; font-weight: 600; margin-bottom: 24px; }
.login-brand img { width: 44px; height: 44px; border-radius: 9px; }
.login-card { width: 100%; max-width: 380px; background: var(--bg); border-radius: 8px; box-shadow: var(--shadow); padding: 28px; display: grid; gap: 14px; }
.login-card h1 { margin: 0; font-size: 22px; font-weight: 600; }
.login-card p { margin: -8px 0 4px; color: var(--muted); font-size: 13.5px; }
.login-card label { display: grid; gap: 5px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.login-card .field { height: 40px; font-size: 15px; }
.login-card .btn { height: 40px; justify-content: center; font-size: 15px; }
.err { color: var(--red); font-size: 13px; min-height: 18px; margin: 0; }

/* ---------- shell ---------- */
.top { position: fixed; top: 0; left: 0; right: 0; height: var(--top); background: var(--blue); color: #fff; display: flex; align-items: center; gap: 12px; padding: 0 10px; z-index: 30; }
:root.dark .top { background: #0c3b5e; }
.brand { display: flex; align-items: center; gap: 9px; width: calc(var(--side) - 10px); color: #fff; text-decoration: none; font-weight: 600; font-size: 16px; flex: none; }
.brand img { width: 26px; height: 26px; border-radius: 5px; }
.top .ib { color: #fff; }
.top .ib:hover { background: rgba(255, 255, 255, .16); color: #fff; }
.search { flex: 1; max-width: 600px; position: relative; }
.search svg.i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--blue); pointer-events: none; }
.search input { width: 100%; height: 32px; border: 0; border-radius: 4px; padding: 0 30px 0 34px; background: #fff; color: #242424; outline: none; }
:root.dark .search input { background: #2b2b2b; color: #f0f0f0; }
.search input:focus { box-shadow: 0 0 0 2px rgba(255, 255, 255, .6); }
.search .clear { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; color: var(--muted); }
.me { margin-left: auto; display: flex; align-items: center; gap: 4px; flex: none; }
.me-name { font-size: 13px; margin: 0 6px 0 8px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me .av { width: 30px; height: 30px; font-size: 12px; box-shadow: 0 0 0 2px rgba(255, 255, 255, .7); }
.tag-admin { background: rgba(255, 255, 255, .2); border-radius: 3px; font-size: 11px; font-weight: 700; padding: 2px 6px; letter-spacing: .03em; }
.logout { color: #fff; border: 1px solid rgba(255, 255, 255, .4); background: none; border-radius: 4px; height: 30px; padding: 0 10px; font-weight: 600; font-size: 13px; }
.logout:hover { background: rgba(255, 255, 255, .16); }

.main { position: fixed; top: var(--top); left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: var(--side) var(--list) minmax(0, 1fr); }

/* folders */
.side { background: var(--pane); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.compose-btn { margin: 12px 12px 8px; height: 34px; justify-content: center; }
.folders { flex: 1; overflow: auto; padding: 4px 6px; }
.folder { display: flex; align-items: center; gap: 10px; width: 100%; height: 34px; padding: 0 10px; border: 0; border-radius: 4px; background: none; text-align: left; color: var(--ink); position: relative; }
.folder svg.i { color: var(--muted); }
.folder:hover { background: var(--hover); }
.folder.on { background: var(--blue-sel); font-weight: 600; }
.folder.on svg.i { color: var(--blue); }
.folder.on:before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 2px; background: var(--blue); }
.folder .fname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder .count { color: var(--blue); font-weight: 700; font-size: 12.5px; }
.folder.drop { outline: 2px dashed var(--blue); outline-offset: -2px; }
.side-foot { padding: 10px 14px 12px; border-top: 1px solid var(--line); display: grid; gap: 8px; font-size: 12px; color: var(--muted); }
.side-foot .linkbtn { justify-self: start; }
.quota-bar { height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.quota-bar span { display: block; height: 100%; background: var(--blue); }
.quota-bar.full span { background: var(--red); }
.linkbtn { border: 0; background: none; color: var(--blue); padding: 0; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.linkbtn:hover { text-decoration: underline; }

/* list */
.list { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: var(--bg); }
.list-head { padding: 10px 12px 0; border-bottom: 1px solid var(--line); }
.list-title { display: flex; align-items: center; gap: 8px; min-height: 32px; }
.list-title h2 { margin: 0; font-size: 18px; font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filters { display: flex; gap: 2px; margin-top: 4px; }
.filters button { border: 0; background: none; padding: 8px 10px; font-size: 13.5px; color: var(--muted); position: relative; }
.filters button.on { color: var(--ink); font-weight: 600; }
.filters button.on:after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--blue); }
.bulk { display: flex; align-items: center; gap: 2px; padding: 6px 8px; border-bottom: 1px solid var(--line); background: var(--blue-soft); flex-wrap: wrap; }
.bulk b { font-size: 13px; margin: 0 8px 0 4px; }
.items { flex: 1; overflow: auto; }
.item { display: grid; grid-template-columns: 22px 34px minmax(0, 1fr); gap: 0 10px; align-items: start; padding: 10px 12px 10px 8px; border-bottom: 1px solid var(--line-2);
  cursor: pointer; position: relative; background: var(--bg); }
.item:hover { background: var(--hover); }
.item.sel { background: var(--blue-sel); }
.item.unread:before, .item.sel:before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--blue); }
.item .chk { width: 16px; height: 16px; margin: 9px 0 0 3px; accent-color: var(--blue); opacity: 0; }
.item:hover .chk, .item .chk:checked, .items.selecting .chk { opacity: 1; }
.av { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: #fff; font-size: 12.5px; font-weight: 600; flex: none; letter-spacing: .02em; }
.item-body { min-width: 0; display: grid; gap: 1px; }
.row1 { display: flex; align-items: baseline; gap: 8px; }
.who { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.when { color: var(--muted); font-size: 12px; white-space: nowrap; }
.row2 { display: flex; align-items: center; gap: 6px; }
.subj { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; color: var(--ink-2); }
.snip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; color: var(--muted); }
.item.unread .who { font-weight: 700; }
.item.unread .subj { color: var(--blue); font-weight: 600; }
.item.unread .when { color: var(--blue); font-weight: 600; }
.marks { display: inline-flex; gap: 2px; color: var(--muted); }
.marks svg.i { width: 14px; height: 14px; }
.flagbtn { border: 0; background: none; padding: 0; color: var(--faint); display: inline-grid; opacity: 0; }
.item:hover .flagbtn, .flagbtn.on { opacity: 1; }
.flagbtn.on { color: var(--red); }
.flagbtn.on svg.i { fill: currentColor; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); }
.empty svg.i { width: 40px; height: 40px; color: var(--faint); stroke-width: 1.3; margin-bottom: 6px; }

/* reading pane */
.reader { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--bg); }
.rtools { display: flex; align-items: center; gap: 2px; padding: 6px 8px; border-bottom: 1px solid var(--line); flex-wrap: wrap; min-height: 45px; }
.rbody { flex: 1; overflow: auto; display: flex; flex-direction: column; min-height: 0; }
.rhead { padding: 16px 20px 10px; }
.rhead h1 { margin: 0 0 14px; font-size: 20px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.sender { display: flex; gap: 12px; align-items: flex-start; }
.sender .av { width: 40px; height: 40px; font-size: 14px; }
.sender-info { flex: 1; min-width: 0; display: grid; gap: 1px; }
.sender-info b { font-weight: 600; }
.sender-info .addr { color: var(--muted); font-weight: 400; }
.sender-info small { color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.rdate { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.notice { margin: 4px 20px 0; padding: 8px 12px; border-radius: 4px; background: var(--blue-soft); font-size: 13px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.atts { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 20px 4px; }
.att { display: inline-flex; align-items: center; gap: 8px; max-width: 280px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 4px; text-decoration: none; color: var(--ink); background: var(--bg); }
.att:hover { background: var(--hover); }
.att svg.i { color: var(--blue); }
.att span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.att small { color: var(--muted); font-size: 12px; white-space: nowrap; }
.mailframe { flex: 1; width: 100%; min-height: 300px; border: 0; background: #fff; display: block; }
.plain { padding: 8px 20px 24px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.6; }
.placeholder { margin: auto; text-align: center; color: var(--muted); display: grid; gap: 10px; justify-items: center; padding: 40px; }
.placeholder img { width: 64px; height: 64px; opacity: .18; filter: grayscale(1); }

/* composer */
.composer { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.cbar { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.cbar .grow { flex: 1; }
.cfields { padding: 4px 16px; border-bottom: 1px solid var(--line); }
.cfield { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line-2); }
.cfield:last-child { border-bottom: 0; }
.cfield label { width: 56px; color: var(--muted); font-size: 13.5px; flex: none; }
.cfield input { flex: 1; height: 38px; border: 0; outline: none; background: none; min-width: 0; }
.cfield .linkbtn { font-size: 13px; }
.etools { display: flex; gap: 2px; padding: 4px 10px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.etools .ib { width: 30px; height: 30px; }
.editor { flex: 1; overflow: auto; padding: 14px 18px 28px; outline: none; font-size: 14px; line-height: 1.55; min-height: 200px; overflow-wrap: anywhere; }
.editor:empty:before { content: attr(data-placeholder); color: var(--faint); }
.editor blockquote { margin: 0 0 0 .6em; padding-left: .8em; border-left: 3px solid var(--line); color: var(--muted); }
.cfiles { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 16px; border-top: 1px solid var(--line); }
.cfiles:empty { display: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px; border: 1px solid var(--line); border-radius: 4px; font-size: 13px; max-width: 260px; }
.chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip small { color: var(--muted); }
.chip .ib { width: 22px; height: 22px; }
.chip.busy { opacity: .6; }

/* menus, dialogs, toasts */
.menu { position: fixed; z-index: 60; min-width: 200px; max-height: 60vh; overflow: auto; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; box-shadow: var(--shadow); padding: 4px; }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; height: 32px; padding: 0 10px; border: 0; border-radius: 4px; background: none; text-align: left; font-size: 13.5px; }
.menu button:hover { background: var(--hover); }
.menu button svg.i { color: var(--muted); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.dlg-back { position: fixed; inset: 0; z-index: 70; background: rgba(0, 0, 0, .4); display: grid; place-items: center; padding: 16px; }
.dlg { width: min(420px, 100%); background: var(--bg); border-radius: 8px; box-shadow: var(--shadow); padding: 20px; display: grid; gap: 12px; }
.dlg h3 { margin: 0; font-size: 17px; font-weight: 600; }
.dlg p { margin: 0; color: var(--ink-2); }
.dlg .acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 80; display: grid; gap: 8px; justify-items: center; }
.toast { background: #323130; color: #fff; padding: 10px 16px; border-radius: 6px; box-shadow: var(--shadow); font-size: 13.5px; display: flex; gap: 14px; align-items: center; }
.toast.bad { background: var(--red); }
.toast button { border: 0; background: none; color: #9cc9f5; font-weight: 700; padding: 0; }
.loading { padding: 30px; text-align: center; color: var(--muted); }

/* ---------- smaller screens: one pane at a time ---------- */
@media (max-width: 1200px) { :root { --list: 340px; --side: 210px; } }
@media (max-width: 900px) {
  .brand span, .me-name, .tag-admin { display: none; }
  .brand { width: auto; }
  .main { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; top: var(--top); left: 0; bottom: 0; width: 270px; z-index: 40; transform: translateX(-100%); transition: transform .18s; }
  body.nav-open .side { box-shadow: var(--shadow); }
  body.nav-open .side { transform: none; }
  body.nav-open .scrim { display: block; }
  .reader { display: none; }
  body.reading .list { display: none; }
  body.reading .reader { display: flex; }
}
@media (min-width: 901px) { .menu-btn, .back-btn { display: none !important; } }
.scrim { display: none; position: fixed; inset: var(--top) 0 0 0; background: rgba(0, 0, 0, .35); z-index: 35; }
@media (max-width: 520px) {
  .top { gap: 6px; }
  .logout { display: none; }
  .rtools .tb span, .cbar .tb span { display: none; }
}
.ib.flag-on { color: var(--red); }
.ib.flag-on svg.i { fill: currentColor; }
.rtools .ib svg.i { color: var(--blue); }
.rtools .ib.flag-on svg.i { color: var(--red); }

/* ================= the panel's look (over the layout above) ================= */
body { font-size: 14px; letter-spacing: -.003em; }
::selection { background: var(--lime); color: #163300; }
.btn { height: 36px; padding: 0 14px; border-radius: 999px; border-color: var(--line); font-weight: 600; }
.btn.primary { background: var(--lime); border-color: var(--lime); color: #163300; }
.btn.primary:hover { background: var(--lime-2); border-color: var(--lime-2); }
.tb, .ib { border-radius: 8px; }
.tb svg.i, .rtools .ib svg.i { color: var(--ink-2); }
.field { height: 38px; border-radius: 10px; }
.field:focus { border-color: var(--lime-2); box-shadow: 0 0 0 3px var(--blue-ring); }

/* sign in: a white page, the card in its middle */
.login, :root.dark .login { background: var(--bg); justify-content: center; padding: 32px 16px; }
.login-brand { color: var(--ink); font-size: 22px; margin-bottom: 20px; gap: 10px; }
.login-card { max-width: 400px; border: 1px solid var(--line); border-radius: 18px; box-shadow: none; padding: 32px; gap: 16px; }
.login-card h1 { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.login-card p { font-size: 14px; }
.login-card label { font-size: 13px; color: var(--ink-2); }
.login-card .field { height: 44px; font-size: 15px; }
.login-card .btn { height: 44px; font-size: 15px; }

/* the logo, as the panel's: "dash." and the app's name */
.logo { font-weight: 800; font-size: 22px; letter-spacing: -.065em; color: var(--ink); line-height: 1; }
.logo i { font-style: normal; color: var(--lime-2); }
.login-brand .logo { font-size: 30px; }
.app-name { font-weight: 500; color: var(--muted); font-size: 15px; letter-spacing: -.01em; padding-left: 10px; border-left: 1px solid var(--line); }

/* the top bar: white, a line under it */
.top, :root.dark .top { background: var(--bg); color: var(--ink); border-bottom: 1px solid var(--line); padding: 0 16px; gap: 16px; }
.brand { color: var(--ink); gap: 10px; width: calc(var(--side) - 16px); }
.top .ib { color: var(--ink-2); }
.top .ib:hover { background: var(--hover); color: var(--ink); }
.search svg.i { color: var(--muted); }
.search input, :root.dark .search input { height: 38px; border: 1px solid var(--line); border-radius: 999px; background: var(--hover); color: var(--ink); }
.search input:focus { background: var(--bg); border-color: var(--lime-2); box-shadow: 0 0 0 3px var(--blue-ring); }
.me-name { color: var(--ink-2); }
.me .av { box-shadow: none; }
.tag-admin { background: var(--lime-soft); color: #163300; border-radius: 999px; padding: 3px 8px; }
.logout { color: var(--ink); border: 1px solid var(--line); border-radius: 999px; height: 34px; padding: 0 14px; }
.logout:hover { background: var(--hover); }

/* folders */
.side { background: var(--bg); }
.compose-btn { margin: 16px 14px 10px; height: 40px; }
.folders { padding: 4px 8px; }
.folder { height: 38px; border-radius: 10px; gap: 12px; color: var(--ink-2); }
.folder.on { background: var(--lime-soft); color: var(--ink); }
.folder.on svg.i { color: var(--blue); }
.folder.on:before { display: none; }
.folder .count { color: var(--blue); background: var(--lime-soft); border-radius: 999px; padding: 1px 8px; font-size: 12px; }
.folder.on .count { background: var(--bg); }
.folder.drop { outline-color: var(--lime-2); }
.side-foot { padding: 14px 16px; }
.quota-bar { height: 6px; border-radius: 999px; }
.quota-bar span { background: var(--lime-2); border-radius: 999px; }
.linkbtn { color: var(--blue); font-weight: 600; }

/* list */
.list-head { padding: 14px 16px 0; }
.list-title h2 { font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.filters { gap: 4px; margin: 8px 0 10px; }
.filters button { padding: 5px 12px; border-radius: 999px; font-size: 13px; }
.filters button:hover { background: var(--hover); }
.filters button.on { background: var(--ink); color: var(--bg); }
.filters button.on:after { display: none; }
.bulk { background: var(--blue-soft); }
.item { padding: 12px 14px 12px 10px; border-bottom-color: var(--line-2); }
.item.sel { background: var(--blue-sel); }
.item.unread:before { background: var(--lime-2); width: 3px; }
.item.sel:before { background: var(--blue); }
.item .chk { accent-color: #5aa834; }
.av { background: var(--lime-soft) !important; color: #163300; font-weight: 650; }
:root.dark .av { color: var(--blue); }
.item.unread .subj, .item.unread .when { color: var(--ink); font-weight: 650; }
.flagbtn.on, .ib.flag-on, .rtools .ib.flag-on svg.i { color: var(--amber); }

/* reading pane */
.rtools { padding: 8px 12px; min-height: 53px; }
.rhead { padding: 22px 28px 12px; }
.rhead h1 { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.notice { margin: 4px 28px 0; border-radius: 10px; background: var(--blue-soft); border: 1px solid var(--lime-line); }
.atts { padding: 8px 28px 4px; }
.att { border-radius: 10px; }
.att:hover { border-color: var(--lime-line); background: var(--blue-soft); }
.att svg.i { color: var(--ink-2); }
.plain { padding: 10px 28px 28px; font-size: 14.5px; line-height: 1.65; }
.placeholder .logo { font-size: 44px; opacity: .14; }

/* composer, menus, dialogs, toasts */
.cbar { padding: 10px 14px; }
.cfields { padding: 4px 20px; }
.editor { padding: 16px 20px 28px; }
.chip { border-radius: 999px; }
.menu { border-radius: 12px; padding: 6px; }
.menu button { border-radius: 8px; height: 34px; }
.dlg-back { background: rgba(14, 15, 12, .35); }
.dlg { border-radius: 18px; padding: 24px; }
.dlg h3 { font-size: 18px; font-weight: 700; }
.toast { background: var(--ink); color: var(--bg); border-radius: 999px; padding: 10px 18px; }
:root.dark .toast { background: #eef0ec; color: #161815; }
.toast button { color: var(--lime); }
:root.dark .toast button { color: #2b5a07; }
@media (max-width: 900px) { .app-name { display: none; } .top { padding: 0 10px; gap: 10px; } }

/* ================= sign in: the form on the left, a quiet picture of the mailbox on the right ================= */
html.i18n-wait body > * { visibility: hidden; }
.login, :root.dark .login { display: block; padding: 0; background: var(--bg); }
.lg-main { display: flex; flex-direction: column; min-height: 100vh; max-width: 1200px; margin: 0 auto; padding: 24px 32px; }
.lg-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.lg-brand { display: flex; align-items: center; gap: 10px; }
.lg-brand .logo { font-size: 26px; }
.login .login-card { margin: auto; width: 100%; max-width: 380px; padding: 40px 0; border: 0; border-radius: 0; background: none; gap: 18px; }
.lg-head h1 { margin: 0; font-size: 30px; font-weight: 750; letter-spacing: -.03em; }
.lg-head p { margin: 8px 0 0; color: var(--muted); font-size: 15px; }
.login-card label { display: grid; gap: 7px; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.lg-field { position: relative; display: block; }
.lg-field > svg.i { position: absolute; left: 15px; top: 50%; width: 17px; height: 17px; margin-top: -8.5px; color: var(--muted); pointer-events: none; }
.login-card .lg-field .field { height: 48px; padding-left: 44px; border-color: transparent; border-radius: 14px; background: var(--hover); font-size: 15px; }
.login-card .lg-field .field:focus { background: var(--bg); border-color: var(--lime-2); }
.login-card .lg-field:focus-within > svg.i { color: var(--ink); }
.login-card .btn.primary { height: 48px; font-size: 15px; justify-content: center; }
.login .err:empty { display: none; }
.login .err { margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--red-soft); }
.lg-hint { margin: 0 !important; color: var(--muted); font-size: 13px !important; text-align: center; line-height: 1.5; }
.lg-foot { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--muted); font-size: 12.5px; }
.lg-foot svg.i { width: 14px; height: 14px; }
@media (max-width: 900px) {
  .lg-main { padding: 20px 20px 24px; }
  .login .login-card { padding: 32px 0; }
  .lg-head h1 { font-size: 26px; }
}

/* the language menu (i18n.js draws it): sign-in screen and the top bar */
.login-lang { position: relative; }
.login-lang[hidden] { display: none !important; }
.ll-trigger { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px 0 4px; border: 0; border-radius: 999px; background: var(--hover);
  color: var(--ink); font-size: 13px; font-weight: 600; cursor: pointer; }
.ll-trigger:hover, .login-lang.open .ll-trigger { background: var(--line); }
.ll-badge { display: grid; place-items: center; min-width: 28px; height: 28px; padding: 0 6px; border-radius: 999px; background: var(--lime); color: #163300; font-size: 11px; font-weight: 800; letter-spacing: .04em; }
.ll-trigger svg { width: 14px; height: 14px; color: var(--muted); fill: none; transition: transform .15s; }
.login-lang.open .ll-trigger svg { transform: rotate(180deg); }
.ll-menu { position: absolute; top: calc(100% + 8px); right: 0; z-index: 60; display: grid; gap: 2px; min-width: 200px; max-height: 300px; overflow: auto; padding: 6px;
  border-radius: 14px; background: var(--bg); box-shadow: 0 0 0 1px var(--line), var(--shadow); }
.ll-menu[hidden] { display: none; }
.ll-opt { display: flex; align-items: center; gap: 10px; width: 100%; height: 38px; padding: 0 10px 0 5px; border: 0; border-radius: 10px; background: none; color: var(--ink-2); font-size: 14px; text-align: left; }
.ll-opt .ll-badge { min-width: 30px; height: 26px; background: var(--hover); color: var(--ink-2); font-size: 10.5px; }
.ll-opt:hover, .ll-opt:focus-visible { background: var(--hover); color: var(--ink); outline: none; }
.ll-opt.on { background: var(--blue-soft); color: var(--ink); font-weight: 650; }
.ll-opt.on .ll-badge { background: var(--lime); color: #163300; }
.ll-name { flex: 1; }
.ll-opt svg { width: 16px; height: 16px; color: #5aa834; fill: none; }
.wm-lang .ll-trigger { background: none; height: 34px; }
.wm-lang .ll-trigger:hover, .wm-lang.open .ll-trigger { background: var(--hover); }
@media (max-width: 900px) { .wm-lang .ll-trigger > span, .wm-lang .ll-trigger > svg { display: none; } .wm-lang .ll-trigger { padding: 0 3px; } }

/* an attachment chip: the name shortens, the size and the remove button stay on one line */
.chip { gap: 6px; padding: 4px 4px 4px 12px; height: 34px; max-width: 300px; }
.chip > svg.i { color: var(--muted); }
.chip > span { min-width: 0; }
.chip small { flex: none; white-space: nowrap; font-size: 12px; }
.chip .ib { flex: none; width: 26px; height: 26px; border-radius: 999px; }
.chip .ib:hover { background: var(--red-soft); color: var(--red); }

/* sign in: one column, the form in the middle of the page */
.lg-head { text-align: center; display: grid; justify-items: center; }
.lg-badge { display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 18px; border-radius: 18px; background: var(--lime-soft); color: #163300; }
:root.dark .lg-badge { color: var(--blue); }
.lg-badge svg.i { width: 26px; height: 26px; stroke-width: 1.7; }
.login .login-card { max-width: 400px; }

/* sign in, not bare: the home page's soft green glow and grid behind the form, a badge with a new-mail dot, what the webmail offers below */
.login { position: relative; isolation: isolate; overflow-x: hidden; }
.login::before { content: ""; position: absolute; inset: 0 0 auto; height: 720px; z-index: -1; pointer-events: none;
  background: radial-gradient(55% 60% at 50% 18%, #eefae4 0%, rgba(238, 250, 228, 0) 70%); }
.login::after { content: ""; position: absolute; inset: 0 0 auto; height: 680px; z-index: -1; pointer-events: none; opacity: .6;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(45% 55% at 50% 30%, #000 0%, transparent 80%); mask-image: radial-gradient(45% 55% at 50% 30%, #000 0%, transparent 80%); }
:root.dark .login::before { background: radial-gradient(55% 60% at 50% 18%, #1f2b18 0%, rgba(31, 43, 24, 0) 70%); }
.lg-badge { position: relative; width: 64px; height: 64px; border-radius: 20px; background: var(--bg); box-shadow: 0 0 0 1px var(--line), 0 10px 30px -14px rgba(22, 51, 0, .35); }
.lg-badge svg.i { width: 28px; height: 28px; }
.lg-badge i { position: absolute; top: -4px; right: -4px; width: 16px; height: 16px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 3px var(--bg); }
.login .field { background: var(--bg) !important; }
.login-card .lg-field .field { background: var(--bg); border-color: var(--line); }
.lg-points { list-style: none; margin: 4px auto 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 640px; }
.lg-points li { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px 0 6px; border-radius: 999px; background: var(--bg);
  box-shadow: 0 0 0 1px var(--line); color: var(--ink-2); font-size: 13px; }
.lg-points svg.i { width: 22px; height: 22px; padding: 4px; border-radius: 50%; background: var(--lime-soft); color: #163300; }
:root.dark .lg-points svg.i { color: var(--blue); }
.login .login-card { margin: auto auto 28px; }
.lg-main > .lg-points { margin-bottom: auto; }
.lg-points { width: 100%; max-width: 720px; }

/* the profile, as on the website: avatar, name and a chevron; its menu opens on hover or a tap */
.wm-me { position: relative; }
.me-btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px 0 5px; border: 0; border-radius: 999px; background: none; color: var(--ink); font-weight: 600; font-size: 14px; }
.wm-me:hover .me-btn, .wm-me:focus-within .me-btn { background: var(--hover); }
.me-btn .me-name { margin: 0; max-width: 180px; color: var(--ink); }
.me .av { background: var(--lime) !important; color: #163300; box-shadow: none; }
.me-btn .av { width: 30px; height: 30px; font-size: 11.5px; font-weight: 800; }
.me-chev { width: 15px !important; height: 15px !important; color: var(--muted); transition: transform .2s; }
.wm-me:hover .me-chev, .wm-me:focus-within .me-chev { transform: rotate(180deg); }
.me-panel { position: absolute; top: 100%; right: 0; z-index: 50; width: 300px; margin-top: 10px; padding: 8px; border-radius: 20px; background: var(--bg);
  box-shadow: 0 0 0 1px var(--line), 0 24px 60px -24px rgba(14, 15, 12, .3); opacity: 0; visibility: hidden; transform: translateY(6px) scale(.98); transform-origin: top right;
  transition: opacity .12s, transform .12s, visibility 0s .12s; }
.me-panel::before { content: ""; position: absolute; left: 0; right: 0; top: -14px; height: 14px; }
.wm-me:hover .me-panel, .wm-me:focus-within .me-panel { opacity: 1; visibility: visible; transform: none; transition: opacity .16s, transform .16s, visibility 0s; }
.me-head { display: flex; align-items: center; gap: 12px; padding: 10px 12px 12px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.me-head .av.big { width: 38px; height: 38px; font-size: 13px; font-weight: 800; }
.me-head > span { min-width: 0; display: grid; gap: 1px; }
.me-head b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-head small { color: var(--muted); font-size: 12px; }
.me-item, .me-lang-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 12px; border: 0; border-radius: 14px; background: none; text-align: left; color: var(--ink); }
.me-item:hover, .me-item:focus-visible { background: var(--blue-soft); outline: none; }
.me-ic { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 12px; background: var(--lime-soft); color: #163300; }
:root.dark .me-ic { color: var(--blue); }
.me-ic svg.i { width: 18px; height: 18px; }
.me-t { flex: 1; min-width: 0; } .me-t b { font-size: 14px; font-weight: 600; }
.me-item.out .me-ic { background: var(--red-soft); color: var(--red); }
.me-langs:not([hidden]) { display: flex; gap: 2px; padding: 2px; border-radius: 999px; background: var(--hover); }
.me-lang-btn { height: 28px; padding: 0 10px; border: 0; border-radius: 999px; background: none; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.me-lang-btn:hover { color: var(--ink); }
.me-lang-btn.on { background: var(--bg); color: var(--ink); box-shadow: 0 1px 2px rgba(14, 15, 12, .12); }
.me-lang-row:has(.me-langs[hidden]) { display: none; }
@media (max-width: 900px) { .me-btn .me-name, .me-chev { display: none; } .me-btn { padding: 0 5px; } }

/* the profile menu: the mailbox on top, then its settings, the way back to the panel and signing out */
.me-head b { display: block; } .me-head small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.me-item { text-decoration: none; }
.me-t { display: grid; gap: 1px; } .me-t small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-item.out { margin-top: 4px; position: relative; }
.me-item.out::before { content: ""; position: absolute; left: 12px; right: 12px; top: -4px; border-top: 1px solid var(--line); }
.me-panel { width: 320px; }

/* the settings window */
.dlg.prefs { width: min(520px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 22px 24px; gap: 0; }
.prefs-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.prefs-head h3 { font-size: 20px; }
.prefs-head .ib { border-radius: 999px; background: var(--hover); }
.prefs section { display: grid; gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.prefs section:last-of-type { border-bottom: 0; }
.prefs h4 { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.prefs label { display: grid; gap: 7px; font-size: 13.5px; font-weight: 600; }
.prefs label small { color: var(--muted); font-size: 12.5px; font-weight: 400; }
.prefs label small b { color: var(--ink-2); font-weight: 600; }
.prefs .field { height: 42px; border-radius: 12px; font-size: 14px; font-weight: 400; }
.prefs textarea.field { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.5; font-family: inherit; }
.prefs-note { margin: 0; color: var(--ink-2); font-size: 13.5px; }
.prefs-note a { color: var(--blue); font-weight: 600; }
.prefs-lang:has(#meLang[hidden]) { display: none !important; }
.seg, .prefs .me-langs:not([hidden]) { display: inline-flex; justify-self: start; gap: 2px; padding: 3px; border-radius: 999px; background: var(--hover); }
.seg button, .prefs .me-lang-btn { height: 32px; padding: 0 16px; border: 0; border-radius: 999px; background: none; color: var(--muted); font-size: 13.5px; font-weight: 600; }
.seg button:hover, .prefs .me-lang-btn:hover { color: var(--ink); }
.seg button.on, .prefs .me-lang-btn.on { background: var(--bg); color: var(--ink); box-shadow: 0 1px 3px rgba(14, 15, 12, .14); }
.prefs .acts { margin-top: 6px; }
.wm-sig { color: var(--muted); }
.prefs-link { justify-self: start; display: inline-flex; align-items: center; gap: 8px; color: var(--blue); font-weight: 600; font-size: 13.5px; text-decoration: none; }
.prefs-link:hover { text-decoration: underline; }

/* the settings page: in place of the list and the reading pane, the folders stay on the left */
.prefs-page { display: none; }
body.prefs-open .list, body.prefs-open .reader { display: none !important; }
body.prefs-open .prefs-page { display: block; grid-column: 2 / -1; min-width: 0; overflow: auto; background: var(--bg); }
.prefs-page .prefs { max-width: 920px; margin: 0 auto; padding: 32px 40px 64px; display: block; }
.prefs-top { display: flex; align-items: flex-start; gap: 12px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.prefs-top h1 { margin: 0; font-size: 26px; font-weight: 750; letter-spacing: -.025em; }
.prefs-top p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.prefs-top p b { color: var(--ink-2); font-weight: 600; }
.prefs-page section { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 32px; padding: 28px 0; border-bottom: 1px solid var(--line); }
.prefs-page section:last-child { border-bottom: 0; }
.prefs-side h2 { margin: 0; font-size: 15px; font-weight: 650; }
.prefs-side p { margin: 6px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.prefs-body { display: grid; gap: 18px; align-content: start; min-width: 0; }
.prefs-page label { display: grid; gap: 7px; font-size: 13.5px; font-weight: 600; }
.prefs-page label small { color: var(--muted); font-size: 12.5px; font-weight: 400; }
.prefs-page label small b { color: var(--ink-2); font-weight: 600; }
.prefs-page .field { height: 42px; border-radius: 12px; font-size: 14px; font-weight: 400; }
.prefs-page textarea.field { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.5; font-family: inherit; }
.prefs-acts { display: flex; justify-content: flex-start; }
.prefs-page .btn { justify-self: start; }
.prefs-page .btn svg.i { color: var(--ink-2); }
.prefs-quota { display: grid; gap: 8px; max-width: 360px; font-size: 13px; color: var(--ink-2); }
.prefs-page .prefs-lang:has(#meLang[hidden]) { display: none; }
.prefs-page .me-langs:not([hidden]) { display: inline-flex; justify-self: start; gap: 2px; padding: 3px; border-radius: 999px; background: var(--hover); }
.prefs-page .me-lang-btn { height: 32px; padding: 0 16px; border: 0; border-radius: 999px; background: none; color: var(--muted); font-size: 13.5px; font-weight: 600; }
.prefs-page .me-lang-btn:hover { color: var(--ink); }
.prefs-page .me-lang-btn.on { background: var(--bg); color: var(--ink); box-shadow: 0 1px 3px rgba(14, 15, 12, .14); }
@media (max-width: 900px) {
  body.prefs-open .prefs-page { grid-column: 1 / -1; }
  .prefs-page .prefs { padding: 20px 16px 48px; }
  .prefs-page section { grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 22px 0; }
}

/* two-word brand: stacked, about the size of a one-word logo */
.bw { display: inline-grid; font-size: .8em; line-height: .88; letter-spacing: -.035em; text-align: left; vertical-align: middle; }
.bw > span + span { font-weight: 600; color: color-mix(in srgb, currentColor 70%, transparent); }
.bw i { font-size: 1.25em; line-height: 0; }
