/* axi0 Mail (/mail/): the axi0 family look, as on Notes and AI. True black, Instrument Sans, the orange core as the one
   accent. No inline styles in the markup (the page runs under style-src 'self'). */
@font-face {
  font-family: "Instrument Sans";
  src: url(/axi0/fonts/instrument-sans-latin-var.woff2) format("woff2");
  font-weight: 400 700;
  font-display: optional;
}
:root {
  --bg: #000; --panel: #0a0a0c; --panel2: #0d0d10; --field: #050506; --hover: #141418; --raise: #18181d;
  --line: #1c1c21; --line1b: #1d1d23; --line2: #2a2a31; --line3b: #33333b; --line3: #3a3a42; --field-line: #2a2a31;
  --head: #fff; --ink: #f5f5f7; --ink2: #f1f1f4; --text: #d6d6dc; --text2: #c4c4cc; --icon: #b9b9c2; --soft: #b4b4bd; --soft2: #a9a9b3;
  --lede: #a3a3ad; --soft4: #9a9aa4; --mute: #8e8e98; --faint: #868692; --place: #7c7c87;
  --core: #f6a04d; --core-ink: #f6a04d; --core-hover: #ffb26a; --on-core: #000;
  --danger: #ff8f78; --danger-line: rgba(255, 143, 120, .4);
  --uline: rgba(196, 196, 204, .45);
  color-scheme: dark;
}
html[data-axi0-theme="light"] {
  --bg: #f6f2ea; --panel: #fffdf9; --panel2: #fffdf9; --field: #fffdf9; --hover: #efe8dc; --raise: #ece5d8;
  --line: #e6dfd3; --line1b: #e6dfd3; --line2: #d3cabb; --line3b: #b9ae9c; --line3: #8a8174; --field-line: #8a8174;
  --head: #17140f; --ink: #17140f; --ink2: #1f1b16; --text: #2c2823; --text2: #3d3730; --icon: #4f4940; --soft: #4a433b; --soft2: #50483f;
  --lede: #4f4940; --soft4: #5d554b; --mute: #675f54; --faint: #675f54; --place: #6f665a;
  --core-ink: #9a4a0a; --danger: #b3261e; --danger-line: rgba(179, 38, 30, .4);
  --uline: rgba(61, 55, 48, .45);
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  html:not([data-axi0-theme="dark"]) {
    --bg: #f6f2ea; --panel: #fffdf9; --panel2: #fffdf9; --field: #fffdf9; --hover: #efe8dc; --raise: #ece5d8;
    --line: #e6dfd3; --line1b: #e6dfd3; --line2: #d3cabb; --line3b: #b9ae9c; --line3: #8a8174; --field-line: #8a8174;
    --head: #17140f; --ink: #17140f; --ink2: #1f1b16; --text: #2c2823; --text2: #3d3730; --icon: #4f4940; --soft: #4a433b; --soft2: #50483f;
    --lede: #4f4940; --soft4: #5d554b; --mute: #675f54; --faint: #675f54; --place: #6f665a;
    --core-ink: #9a4a0a; --danger: #b3261e; --danger-line: rgba(179, 38, 30, .4);
    --uline: rgba(61, 55, 48, .45);
    color-scheme: light;
  }
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0; min-height: 100vh; color: var(--text); background: var(--bg);
  font: 15px/1.55 "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased;
}
a { color: var(--core-ink); text-underline-offset: 3px; }
::selection { background: rgba(246, 160, 77, .35); }
[hidden] { display: none !important; }
.sr { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 10; padding: 8px 14px; border-radius: 999px; background: var(--core); color: var(--on-core); font-weight: 600; text-decoration: none; }
.skip:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--core-ink); outline-offset: 2px; }

/* ---- header (the geometry is launcher.css's header.top) --------------------------------------------------------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; max-width: 1080px; margin: 0 auto; padding: 22px 20px 8px; }
.mark { display: inline-flex; align-items: baseline; gap: .12em; color: var(--head); text-decoration: none; font-size: 26px; font-weight: 600; letter-spacing: -.045em; white-space: nowrap; }
.mark-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--core); box-shadow: 0 0 9px var(--core); transform: translateY(-2px); }
.mark-s { color: var(--mute); font-weight: 500; }
.top-right { display: flex; align-items: center; gap: 14px; }
.me-slot { position: relative; flex: none; width: 36px; height: 36px; }
.me-slot:empty { display: none; }

/* ---- states: which blocks show. The first paint (body.s-boot) follows html.has-key (mail-boot.js) --------------- */
.card.when-nokey, .facts.when-nokey, .card.when-choose, .app.when-ready, .locker.when-ready, .card.when-error { display: none; }
html:not(.has-key) body.s-boot .card.when-nokey, body.s-nokey .card.when-nokey, body.s-error .card.when-error { display: block; }
html:not(.has-key) body.s-boot .facts.when-nokey, body.s-nokey .facts.when-nokey { display: grid; }
html.has-key body.s-boot .card.when-choose, body.s-choose .card.when-choose, body.s-opening .card.when-choose { display: block; }
html.has-key body.s-boot #choose-form, body.s-opening #choose-form { opacity: .55; pointer-events: none; }
body.s-ready .app.when-ready { display: grid; }
body.s-ready .locker.when-ready { display: block; }
body.s-ready .lede, body.s-ready .intro noscript { display: none; }

/* ---- layout ----------------------------------------------------------------------------------------------------- */
main { max-width: 1080px; margin: 0 auto; padding: 4px 20px 24px; }
body.s-ready main { max-width: 1480px; }
h1 { margin: 22px 0 8px; color: var(--head); font-size: clamp(32px, 5vw, 44px); font-weight: 600; letter-spacing: -.035em; line-height: 1.1; }
body.s-ready h1 { margin: 6px 0 10px; font-size: 24px; }
.lede { max-width: 46em; margin: 0; color: var(--lede); }
.card { margin-top: 18px; padding: 22px 24px 24px; border: 1px solid var(--line); border-radius: 20px; background: var(--panel); }
h2 { margin: 0 0 12px; color: var(--head); font-size: 19px; font-weight: 600; letter-spacing: -.01em; }
.card > p { margin: 0 0 10px; }
.facts { display: grid; grid-template-columns: 1fr; gap: 12px; margin: 18px 0 0; padding: 0; list-style: none; color: var(--lede); font-size: 14px; }
.facts li { padding: 16px 18px; border: 1px solid var(--line); border-radius: 16px; }
.facts strong { display: block; margin-bottom: 4px; color: var(--head); font-weight: 600; }
@media (min-width: 860px) { .facts { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---- form controls ---------------------------------------------------------------------------------------------- */
label { display: block; margin: 16px 0 6px; color: var(--head); font-size: 14px; }
input[type="text"], input[type="search"], textarea, select {
  width: 100%; min-height: 42px; padding: 9px 13px; border: 1px solid var(--field-line); border-radius: 12px;
  background: var(--field); color: var(--head); font: inherit; font-size: 15px;
}
select { width: auto; min-width: 120px; }
input::placeholder, textarea::placeholder { color: var(--place); }
input[type="text"]:focus, input[type="search"]:focus, textarea:focus, select:focus { outline: none; border-color: var(--core); box-shadow: 0 0 0 3px rgba(246, 160, 77, .18); }
.hint { margin: 6px 0 0; color: var(--mute); font-size: 13px; }
.hint.inline { display: inline; margin: 0; }
.error { margin: 6px 0 0; color: var(--danger); font-size: 13px; }
.error:empty, .note:empty { display: none; }
.note { margin: 8px 0 0; color: var(--core-ink); font-size: 13px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 16px; margin: 0;
  border: 1px solid var(--line2); border-radius: 999px; background: var(--panel); color: var(--head); font: inherit; font-size: 14px;
  white-space: nowrap; cursor: pointer; text-decoration: none; transition: border-color .15s, background .15s;
}
.btn:hover { border-color: rgba(246, 160, 77, .7); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { border-color: var(--core); background: var(--core); color: var(--on-core); font-weight: 600; }
.btn.primary:hover { background: var(--core-hover); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { border-color: var(--danger); }
.btn.small { min-height: 32px; padding: 0 12px; font-size: 13px; }
.btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn.file { position: relative; overflow: hidden; }
.btn.file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.btn.file:focus-within { outline: 2px solid var(--core-ink); outline-offset: 2px; }
.icon { display: grid; place-items: center; flex: none; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--soft2); cursor: pointer; }
.icon:hover { background: var(--hover); color: var(--head); }
.icon:disabled { opacity: .35; cursor: default; background: none; }
.icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon[aria-pressed="true"] { color: var(--core-ink); }
.link-btn { padding: 0; border: 0; background: none; color: var(--core-ink); font: inherit; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* ---- choose your address ---------------------------------------------------------------------------------------- */
.addr { display: flex; align-items: center; gap: 0; max-width: 420px; }
.addr input { flex: 1 1 auto; min-width: 0; border-radius: 12px 0 0 12px; }
.addr .at { flex: none; min-height: 42px; padding: 9px 13px; border: 1px solid var(--field-line); border-left: 0; border-radius: 0 12px 12px 0; background: var(--raise); color: var(--soft); font-size: 15px; line-height: 22px; white-space: nowrap; }
.addr input.is-bad { border-color: var(--danger); }
.addr input.is-ok { border-color: var(--core); }

/* ---- the app: mailboxes | threads | message ----------------------------------------------------------------------- */
.app { grid-template-columns: 220px 360px minmax(0, 1fr); gap: 12px; height: calc(100vh - 190px); min-height: 520px; margin-top: 8px; }
.boxes, .list, .msg { min-width: 0; min-height: 0; border: 1px solid var(--line); border-radius: 20px; background: var(--panel); }
.boxes { display: flex; flex-direction: column; padding: 12px 10px; }
.boxes-top { padding: 2px 2px 10px; }
.compose-btn { width: 100%; }
.box-list { flex: 1 1 auto; margin: 0; padding: 0; overflow-y: auto; list-style: none; }
.box-btn {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 38px; padding: 6px 12px; border: 0; border-radius: 12px; background: none;
  color: var(--text); font: inherit; font-size: 14px; text-align: left; cursor: pointer;
}
.box-btn:hover { background: var(--hover); }
.box-btn[aria-current="true"] { background: rgba(246, 160, 77, .1); box-shadow: inset 2px 0 0 var(--core); color: var(--head); }
.box-name { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.box-n { flex: none; min-width: 22px; padding: 0 6px; border-radius: 999px; background: var(--raise); color: var(--head); font-size: 12px; font-weight: 600; line-height: 20px; text-align: center; }
.box-n:empty { display: none; }
.boxes-foot { padding: 10px 6px 2px; border-top: 1px solid var(--line); color: var(--mute); font-size: 12.5px; }
.boxes-foot p { margin: 0 0 6px; overflow-wrap: anywhere; }
.me-addr { color: var(--text); }
.meter { display: inline-flex; align-items: center; gap: 8px; }
.meter-bar { display: inline-block; width: 90px; height: 6px; overflow: hidden; border-radius: 999px; background: var(--line1b); }
.meter-fill { display: block; width: 0; height: 100%; border-radius: 999px; background: var(--core); }

.list { display: flex; flex-direction: column; padding: 12px 10px; }
.list-top { display: flex; align-items: center; gap: 10px; padding: 0 4px 10px; border-bottom: 1px solid var(--line); }
.list-h { flex: 1 1 auto; margin: 0; overflow: hidden; font-size: 17px; text-overflow: ellipsis; white-space: nowrap; }
#find { flex: 0 1 170px; min-width: 0; min-height: 36px; padding: 6px 12px; font-size: 14px; }
.threads { flex: 1 1 auto; margin: 6px 0 0; padding: 0; overflow-y: auto; list-style: none; }
.th {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1px 8px; width: 100%; padding: 9px 12px 9px 22px; border: 0; border-radius: 12px; background: none;
  color: var(--text); font: inherit; text-align: left; cursor: pointer; position: relative;
}
.th:hover { background: var(--hover); }
.th[aria-current="true"] { background: rgba(246, 160, 77, .1); box-shadow: inset 2px 0 0 var(--core); }
.th.is-unread::before { content: ""; position: absolute; left: 9px; top: 16px; width: 7px; height: 7px; border-radius: 50%; background: var(--core); }
.th-from { overflow: hidden; color: var(--head); font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.th.is-unread .th-from, .th.is-unread .th-subj { font-weight: 600; }
.th-when { color: var(--mute); font-size: 12.5px; white-space: nowrap; }
.th-subj { grid-column: 1 / -1; overflow: hidden; color: var(--ink2); font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.th-prev { grid-column: 1 / -1; overflow: hidden; color: var(--mute); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.th-marks { display: inline-flex; gap: 6px; align-items: center; color: var(--mute); font-size: 12px; }
.th-marks .n { padding: 0 6px; border-radius: 999px; background: var(--raise); color: var(--head); font-weight: 600; line-height: 18px; }
.th-marks svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.th-marks .flag { color: var(--core-ink); }
.empty { margin: 14px 8px 0; color: var(--mute); font-size: 14px; }
.list-foot { display: flex; align-items: center; gap: 10px; padding: 10px 4px 0; color: var(--mute); font-size: 12.5px; }
.list-foot .btn { min-height: 34px; font-size: 13px; }
.count { margin-left: auto; }

.msg { display: flex; flex-direction: column; padding: 10px 14px 14px; }
.msg-bar { display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 2px 8px; border-bottom: 1px solid var(--line); }
.msg-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }
.sep { width: 1px; height: 22px; margin: 0 6px; background: var(--line2); }
.move { min-height: 34px; min-width: 0; padding: 4px 10px; font-size: 13px; border-radius: 10px; }
.back { display: none; }
.message { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; padding: 12px 4px 0; }
.m-subject { flex: none; margin: 0 0 8px; font-size: 20px; line-height: 1.25; overflow-wrap: anywhere; }
.m-head { flex: none; margin-bottom: 10px; color: var(--soft); font-size: 13.5px; }
.m-head p { margin: 0 0 2px; overflow-wrap: anywhere; }
.m-from strong { color: var(--head); font-weight: 600; }
.m-head .lbl { color: var(--mute); }
.thread-strip { flex: none; display: flex; gap: 6px; margin: 0 0 10px; padding: 0 0 10px; overflow-x: auto; list-style: none; border-bottom: 1px solid var(--line); }
.strip-btn { display: flex; flex-direction: column; gap: 1px; min-width: 150px; max-width: 220px; padding: 6px 10px; border: 1px solid var(--line2); border-radius: 12px; background: none; color: var(--text); font: inherit; font-size: 12.5px; text-align: left; cursor: pointer; }
.strip-btn:hover { border-color: rgba(246, 160, 77, .7); }
.strip-btn[aria-current="true"] { border-color: var(--core); color: var(--head); }
.strip-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.strip-btn .w { color: var(--mute); }
.m-notice { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 10px; padding: 8px 12px; border: 1px dashed var(--line3b); border-radius: 12px; color: var(--soft); font-size: 13px; }
.m-body { flex: 1 1 auto; min-height: 160px; overflow: auto; color: var(--ink2); font-size: 15px; line-height: 1.6; }
.m-body.is-text { padding: 2px 4px 8px; overflow-wrap: anywhere; }
.m-body p { margin: 0 0 1em; }
.m-body blockquote { margin: 0 0 1em; padding: 0 0 0 12px; border-left: 2px solid var(--line3b); color: var(--soft); }
.m-body blockquote blockquote { border-left-color: var(--line2); }
.m-body iframe { display: block; width: 100%; height: 100%; min-height: 160px; border: 0; background: transparent; color-scheme: light dark; }
.attachments { flex: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; padding: 10px 0 0; border-top: 1px solid var(--line); list-style: none; }
.att { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; min-height: 36px; padding: 0 12px 0 10px; border: 1px solid var(--line2); border-radius: 999px; background: none; color: var(--head); font: inherit; font-size: 13px; cursor: pointer; }
.att:hover { border-color: rgba(246, 160, 77, .7); }
.att svg { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.att .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att .sz { color: var(--mute); }
.links { flex: none; margin: 10px 0 0; color: var(--soft); font-size: 13px; }
.links summary { cursor: pointer; color: var(--text); }
.links ul { margin: 6px 0 0; padding: 0 0 0 18px; }
.links li { margin: 2px 0; overflow-wrap: anywhere; }
.links .lt { color: var(--mute); }
.hello { margin: 18px 6px; color: var(--mute); font-size: 14px; }
body.has-open .hello { display: none; }

/* ---- status, footer ----------------------------------------------------------------------------------------------- */
.sync { display: flex; align-items: center; gap: 8px; min-height: 22px; margin: 12px 0 0; color: var(--mute); font-size: 13px; }
.sync::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--line3); flex: none; }
.sync:empty::before { display: none; }
.sync.is-ok::before { background: var(--core); box-shadow: 0 0 7px rgba(246, 160, 77, .8); }
.sync.is-busy::before { background: var(--icon); }
.sync.is-bad { color: var(--danger); }
.sync.is-bad::before { background: var(--danger); }
.foot { max-width: 1080px; margin: 0 auto; padding: 4px 20px 44px; color: var(--faint); font-size: 12.5px; }
body.s-ready .foot { max-width: 1480px; }
.foot p { margin: 0 0 6px; max-width: 70em; }
.foot a { color: var(--text2); text-decoration: underline; text-decoration-color: var(--uline); }
.foot a:hover { text-decoration-color: currentColor; }
.locker { margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.locker .row { margin-top: 8px; }
.locker .btn { min-height: 36px; font-size: 13px; }

/* ---- compose ------------------------------------------------------------------------------------------------------ */
.dlg { width: min(720px, 94vw); max-height: 92vh; padding: 20px 22px 22px; border: 1px solid var(--line2); border-radius: 20px; background: var(--panel); color: var(--text); overflow: auto; }
.dlg::backdrop { background: rgba(0, 0, 0, .55); }
.dlg-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dlg-top h2 { margin: 0; }
.dlg label { margin-top: 12px; }
.cc-row { margin-top: 6px; }
#c-text { min-height: 200px; line-height: 1.5; resize: vertical; }
.c-files { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; padding: 0; list-style: none; }
.c-files:empty { display: none; }
.c-file { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; min-height: 34px; padding: 0 6px 0 12px; border: 1px solid var(--line2); border-radius: 999px; font-size: 13px; color: var(--head); }
.c-file .sz { color: var(--mute); }
.c-file .rm { display: grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--mute); font: inherit; font-size: 16px; line-height: 1; cursor: pointer; }
.c-file .rm:hover { background: var(--hover); color: var(--head); }
.c-file.is-up { opacity: .6; }
.c-acts { margin-top: 16px; }

/* ---- phones and narrow windows: two levels (list, then the message) ---------------------------------------------- */
@media (max-width: 1000px) { .app { grid-template-columns: 200px minmax(0, 1fr); } .msg { grid-column: 1 / -1; } .app { height: auto; } .list, .boxes { max-height: 50vh; } .msg { min-height: 60vh; } }
@media (max-width: 760px) {
  .app { display: block; height: auto; }
  body.s-ready .app.when-ready { display: block; }
  .boxes { display: flex; flex-direction: row; align-items: center; gap: 8px; max-height: none; padding: 8px; }
  .boxes-top { flex: none; padding: 0; }
  .compose-btn { width: auto; min-height: 36px; padding: 0 12px; font-size: 13px; }
  .box-list { display: flex; flex: 1 1 auto; gap: 4px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
  .box-list li { flex: none; }
  .box-btn { min-height: 36px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line2); }
  .box-btn[aria-current="true"] { box-shadow: none; border-color: var(--core); background: rgba(246, 160, 77, .1); }
  .boxes-foot { display: none; }
  .list { margin-top: 10px; max-height: none; min-height: 50vh; }
  .msg { display: none; min-height: 70vh; margin-top: 10px; }
  body.is-reading .boxes, body.is-reading .list { display: none; }
  body.is-reading .msg { display: flex; }
  .back { display: grid; }
  .msg-bar { flex-wrap: nowrap; }
  .msg-acts { flex: 1 1 auto; flex-wrap: nowrap; min-width: 0; overflow-x: auto; scrollbar-width: none; }   /* one row that scrolls sideways */
  .msg-acts .icon { width: 36px; height: 36px; }
  .sep { margin: 0 2px; }
  .move { flex: none; max-width: 96px; min-width: 0; padding: 4px 6px; }
  .m-subject { font-size: 18px; }
  .dlg { width: 100vw; max-width: none; height: 100dvh; max-height: none; margin: 0; border: 0; border-radius: 0; padding: 14px 16px 20px; }
  #c-text { min-height: 40vh; }
  .move { max-width: 110px; }
}
@media (max-width: 600px) {
  .top { padding: 16px 16px 4px; }
  .mark { font-size: 22px; }
  main { padding: 0 14px 20px; }
  .card { padding: 18px 16px 20px; border-radius: 18px; }
  .addr { max-width: none; }
  .foot { padding: 4px 16px 36px; }
  #find { flex-basis: 120px; }
}
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } }
