:root {
  --red: #D93025; --red-d: #A50E0E; --red-soft: #fce8e6; --red-tint: #fdf3f2;
  --ink: #1f1f1f; --mute: #5f6368; --faint: #80868b; --line: #e9e6e1; --paper: #FFFDF7; --white: #fff;
  --side: 240px; --list: 420px; --bar: 60px; --shadow: 0 1px 2px rgba(60,64,67,.08), 0 2px 8px rgba(60,64,67,.06);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--paper); color: var(--ink);
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
button, select, input { font: inherit; color: inherit; }
svg { width: 18px; height: 18px; fill: currentColor; flex: none; }

/* ---------- sign-in ---------- */
.signin { min-height: 100%; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(1200px 520px at 50% -120px, #e8483d 0%, var(--red) 45%, var(--red-d) 100%) top / 100% 46% no-repeat, var(--paper); }
.card { background: var(--white); border-radius: 20px; padding: 36px 32px 28px; max-width: 400px; width: 100%; text-align: center;
  box-shadow: 0 24px 60px rgba(90, 10, 10, .18), 0 2px 6px rgba(0,0,0,.06); }
.orb { width: 76px; height: 76px; border-radius: 50%; box-shadow: 0 8px 24px rgba(217,48,37,.35); }
.card h1 { margin: 14px 0 6px; font-size: 25px; letter-spacing: -.2px; }
.lead { color: var(--mute); margin: 0 0 22px; }
.btn { display: block; background: var(--red); color: #fff; text-decoration: none; padding: 13px 16px; border-radius: 12px; font-weight: 600; }
.btn:hover { background: #c5281e; } .btn:active { background: var(--red-d); }
.fine { color: var(--faint); font-size: 12px; margin: 16px 0 0; }
.msg { margin: 14px 0 0; color: var(--red-d); font-size: 13px; }
.msg a { color: var(--red); font-weight: 600; white-space: nowrap; }
.door { display: grid; gap: 10px; }
.door input { border: 1px solid #dadce0; border-radius: 12px; padding: 13px 14px; font-size: 16px; text-align: center; outline: none; }
.door input:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(217,48,37,.15); }
.door .btn { border: 0; width: 100%; cursor: pointer; font-size: 15px; }

/* ---------- shell ---------- */
.app { height: 100%; display: flex; flex-direction: column; }
.bar { height: calc(var(--bar) + var(--top)); display: flex; align-items: center; gap: 12px;
  background: var(--red); color: #fff; padding: var(--top) 14px 0; flex: none; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.bar-orb { width: 32px; height: 32px; border-radius: 50%; }
.bar-title { font-weight: 700; font-size: 17px; white-space: nowrap; letter-spacing: -.1px; }
.box { max-width: 220px; min-width: 0; border: 0; border-radius: 10px; padding: 7px 10px; background: rgba(255,255,255,.18); color: #fff; }
.box option { color: var(--ink); }
.search { flex: 1; min-width: 0; position: relative; display: flex; align-items: center; }
.search-ico { position: absolute; left: 12px; color: var(--faint); pointer-events: none; }
.search input { width: 100%; border: 0; border-radius: 12px; padding: 10px 14px 10px 38px; background: #fff; color: var(--ink); outline: none; }
.search input:focus { box-shadow: 0 0 0 3px rgba(255,255,255,.35); }
.me { width: 36px; height: 36px; border-radius: 50%; border: 2px solid rgba(255,255,255,.75); background: var(--red-d); color: #fff;
  font-weight: 700; cursor: pointer; flex: none; margin-left: auto; }
.menu { position: absolute; right: 12px; top: calc(var(--bar) + var(--top) - 4px); background: #fff; border-radius: 14px;
  box-shadow: 0 10px 34px rgba(0,0,0,.18); padding: 16px 18px; z-index: 10; min-width: 240px; }
.menu-name { font-weight: 600; } .menu-email { color: var(--mute); font-size: 12px; margin-bottom: 12px; }
.menu-link { color: var(--red); text-decoration: none; font-weight: 600; }
.tabs { display: flex; gap: 4px; padding: 8px 10px; border-bottom: 1px solid var(--line); background: #fff; flex: none; }
.tabs button { border: 0; background: none; padding: 7px 14px; border-radius: 18px; color: var(--mute); cursor: pointer; }
.tabs button.on { background: var(--red-soft); color: var(--red-d); font-weight: 600; }

.panes { flex: 1; min-height: 0; display: grid; grid-template-columns: var(--listw, minmax(0, 2fr)) 0 minmax(0, 3fr); }   /* 0 = the list / email divider (.split) */
.side { display: none; }
.listcol { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: #fff; border-right: 1px solid var(--line); }
.list-head { display: none; }
.list { flex: 1; overflow-y: auto; }
.reader { overflow-y: auto; background: var(--paper); min-width: 0; }
.empty { color: var(--faint); padding: 40px 20px; text-align: center; display: grid; justify-items: center; gap: 12px; }
.reader > .empty { margin: auto; }
.empty img { width: 56px; height: 56px; border-radius: 50%; opacity: .35; filter: grayscale(.3); }

/* ---------- message list ---------- */
.row { position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; padding: 12px 16px; border-bottom: 1px solid #f1efeb; cursor: pointer; }
.row:hover { background: #faf8f5; }
.row.on { background: var(--red-tint); }
.row.fresh { animation: fresh 3s ease-out; }   /* just arrived (poll in app.js) */
@keyframes fresh { from { background: var(--red-soft); } }
.row.on::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--red); }
.av { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 16px; }
.line1 { display: flex; align-items: baseline; gap: 8px; }
.who { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.when { color: var(--faint); font-size: 12px; white-space: nowrap; flex: none; }
.subj { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.line3 { display: flex; align-items: center; gap: 8px; margin-top: 2px; min-width: 0; }
.snip { color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; flex: 1; min-width: 0; }
.clip { color: var(--faint); flex: none; } .clip svg { width: 15px; height: 15px; }
.chip { display: inline-block; background: #f1f3f4; color: var(--mute); border-radius: 10px; padding: 1px 8px; font-size: 11px; white-space: nowrap; }
.more { display: block; margin: 14px auto 26px; border: 1px solid var(--line); background: #fff; border-radius: 18px; padding: 8px 20px; cursor: pointer; color: var(--mute); }
.more:hover { border-color: #cfccc6; color: var(--ink); }
.note { color: var(--faint); text-align: center; padding: 28px 12px; }
.spam-intro, .search-note { padding: 12px 16px; font-size: 13px; line-height: 1.45; color: #5c4a12; background: #fff8e1; border-bottom: 1px solid var(--line); }
.spam-sec { padding: 12px 16px 6px; font-size: 12px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--faint); border-bottom: 1px solid var(--line); }

/* ---------- reader ---------- */
.rwrap { min-height: 100%; display: flex; flex-direction: column; }
.rhead { background: #fff; padding: 18px 22px 14px; border-bottom: 1px solid var(--line); }
.back { display: none; border: 0; background: none; color: var(--red); font-weight: 600; padding: 0 0 10px; cursor: pointer; }
.rsubj { font-size: 21px; font-weight: 600; margin: 0 0 14px; line-height: 1.3; word-wrap: break-word; letter-spacing: -.1px; }
.sender { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.sender > div { min-width: 0; }
.sline { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sname { font-weight: 600; } .saddr { color: var(--mute); font-weight: 400; }
.sto { color: var(--mute); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sdate { color: var(--faint); font-size: 12px; white-space: nowrap; }
.rtools { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.rtools button { border: 1px solid var(--line); background: #fff; border-radius: 16px; padding: 5px 14px; font-size: 13px; cursor: pointer; color: var(--ink); }
.rtools button:hover { border-color: #cfccc6; color: var(--ink); }
.strip { display: flex; gap: 8px; padding: 10px 22px; background: #fff; border-bottom: 1px solid var(--line); overflow-x: auto; }
.strip-h { color: var(--faint); font-size: 12px; align-self: center; white-space: nowrap; }
.trow { border: 1px solid var(--line); border-radius: 12px; padding: 5px 10px; background: #fff; cursor: pointer; font-size: 12px; white-space: nowrap; color: var(--mute); }
.trow b { color: var(--ink); font-weight: 600; } .trow.cur { border-color: var(--red); background: var(--red-tint); }
.atts { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 22px; background: #fff; border-bottom: 1px solid var(--line); }
.att { display: inline-flex; gap: 8px; align-items: center; border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 7px 12px; text-decoration: none; color: var(--ink); font-size: 13px; max-width: 100%; }
.att:hover { border-color: #cfccc6; background: #faf8f5; }
.att span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; } .att small { color: var(--faint); }
.rbody { flex: 1; display: flex; background: #fff; min-height: 420px; }
.body-frame { flex: 1; width: 100%; border: 0; background: #fff; display: block; min-height: 420px; }
.body-text { flex: 1; white-space: pre-wrap; word-wrap: break-word; padding: 18px 22px; margin: 0; font: inherit; background: #fff; }

/* ---------- computer screens: menu | list | reader ---------- */
@media (min-width: 1100px) {
  .brand { width: calc(var(--side) - 14px); }
  .box, .tabs { display: none !important; }
  .search { flex: 0 1 680px; margin: 0 auto; }
  .me { margin-left: 0; }
  .panes { grid-template-columns: var(--side) 0 var(--listw, var(--list)) 0 minmax(0, 1fr); }   /* 0 = the two dividers (.split) */
  .side { display: flex; flex-direction: column; gap: 6px; background: var(--paper); padding: 14px 10px; overflow-y: auto; border-right: 1px solid var(--line); }
  .side-nav { display: grid; gap: 2px; }
  .side-nav button { display: flex; align-items: center; gap: 14px; border: 0; background: none; text-align: left; padding: 9px 14px; border-radius: 0 20px 20px 0;
    margin-left: -10px; padding-left: 24px; cursor: pointer; color: var(--ink); }
  .side-nav button:hover { background: #f3efe9; }
  .side-nav button.on { background: var(--red-soft); color: var(--red-d); font-weight: 600; }
  .side-boxes { margin-top: 12px; }
  .side-h { color: var(--faint); font-size: 11px; text-transform: uppercase; letter-spacing: .6px; padding: 6px 14px; }
  .side-box { display: flex; justify-content: space-between; gap: 8px; width: 100%; border: 0; background: none; text-align: left; padding: 6px 14px;
    border-radius: 10px; cursor: pointer; color: var(--mute); font-size: 13px; }
  .side-box span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .side-box small { color: var(--faint); flex: none; }
  .side-box:hover { background: #f3efe9; color: var(--ink); } .side-box.on { background: var(--red-soft); color: var(--red-d); font-weight: 600; }
  .list-head { display: flex; align-items: baseline; justify-content: space-between; padding: 14px 16px 10px; border-bottom: 1px solid var(--line); }
  .list-head b { font-size: 17px; } .list-head span { color: var(--faint); font-size: 12px; }
  .reader { overflow: hidden; display: flex; }
  .rwrap { flex: 1; height: 100%; min-height: 0; overflow: auto; }
  .rhead { padding: 22px 28px 16px; } .strip, .atts { padding-left: 28px; padding-right: 28px; }
  .body-text { padding: 20px 28px; }
}
@media (min-width: 1600px) { :root { --list: 460px; } }

/* ---------- phone: one pane at a time ---------- */
@media (max-width: 760px) {
  .bar-title { display: none; } .box { max-width: 120px; }
  .panes { grid-template-columns: 1fr; }
  .split { display: none !important; }
  .reader { display: none; } .reading .reader { display: block; } .reading .listcol { display: none; }
  .back { display: inline-block; }
  .rhead { padding: 14px 16px 12px; } .rsubj { font-size: 18px; }
  .sender { grid-template-columns: 40px minmax(0, 1fr); row-gap: 2px; } .sdate { grid-column: 2; } .strip, .atts { padding-left: 16px; padding-right: 16px; }
}

/* ---------- writing: new email, reply, forward ---------- */
.newmail { display: none; }
.fab { position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom)); width: 56px; height: 56px; border-radius: 18px; border: 0;
  background: var(--red); color: #fff; box-shadow: 0 6px 18px rgba(217,48,37,.35); cursor: pointer; display: grid; place-items: center; z-index: 5; }
.fab svg { width: 22px; height: 22px; }
.reading .fab { display: none; }
.ract { display: inline-flex; align-items: center; gap: 6px; }
.compose { position: fixed; z-index: 20; background: #fff; display: flex; flex-direction: column; inset: 0; }
.c-head { display: flex; justify-content: space-between; align-items: center; padding: calc(12px + var(--top)) 16px 12px; background: #3c3c3c; color: #fff; }
.c-head button { border: 0; background: none; color: #fff; font-size: 16px; cursor: pointer; padding: 2px 6px; }
.c-acts { display: flex; align-items: center; gap: 2px; }
.c-head button svg { width: 18px; height: 18px; display: block; }
.ic-unfull { display: none !important; } .compose.full .ic-full { display: none !important; } .compose.full .ic-unfull { display: block !important; }
#c-full, #c-pop { display: none; }
#c-form { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.c-row { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); padding: 6px 16px; }
.c-row span { color: var(--faint); width: 40px; flex: none; font-size: 13px; }
.c-row input, .c-row select { flex: 1; min-width: 0; border: 0; padding: 7px 0; outline: none; background: none; font-size: 15px; }
.c-link { border: 0; background: none; color: var(--mute); cursor: pointer; font-size: 12px; white-space: nowrap; }
.c-subject { border: 0; border-bottom: 1px solid var(--line); padding: 12px 16px; outline: none; font-size: 15px; font-weight: 600; }
.c-body { flex: 1; min-height: 160px; overflow-y: auto; padding: 14px 16px; outline: none; background: #fff; color: #1f1f1f;
  font: 14px/1.5 Arial, Helvetica, sans-serif; word-wrap: break-word; }
.c-keep { margin: 0 16px 8px; color: var(--mute); font-size: 13px; display: flex; gap: 8px; align-items: center; }
.c-files { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px; }
.c-file { display: inline-flex; align-items: center; gap: 6px; background: #f1f3f4; border-radius: 10px; padding: 2px 4px 2px 10px; font-size: 12px; color: var(--mute); max-width: 100%; }
.c-file-name, .c-file-label { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.c-file-name { border: 0; background: none; padding: 0; font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.c-file-x { border: 0; background: none; cursor: pointer; color: var(--mute); font-size: 13px; line-height: 1; padding: 4px 6px; border-radius: 8px; }
.c-file-x:hover { background: rgba(127,127,127,.2); color: var(--red-d); }
.c-foot { display: flex; align-items: center; gap: 12px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.c-send { width: auto; padding: 10px 26px; border: 0; cursor: pointer; font-size: 15px; }
.c-send:disabled { background: #e6b3ae; cursor: not-allowed; }
.c-msg { color: var(--mute); font-size: 12px; flex: 1; text-align: right; }
.c-msg.err { color: var(--red-d); }
.c-fixaddr { margin-left: 8px; border: 1px solid var(--red-d); background: var(--white); color: var(--red-d); border-radius: 6px; padding: 2px 10px; font: inherit; font-weight: 600; cursor: pointer; }
.c-fixaddr:hover { background: var(--red-soft); }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: #323232; color: #fff; padding: 10px 18px; border-radius: 10px; z-index: 30; font-size: 14px; }
.undo { display: flex; align-items: center; gap: 18px; white-space: nowrap; }
.undo button { background: none; border: 0; padding: 2px 4px; color: #8ab4f8; font: inherit; font-weight: 700; cursor: pointer; }
@media (min-width: 1100px) {
  .fab { display: none; }
  .newmail { display: inline-flex; align-items: center; gap: 12px; margin: 2px 0 10px; padding: 14px 22px; border: 0; border-radius: 16px; background: #fff;
    box-shadow: var(--shadow); cursor: pointer; font-weight: 600; color: var(--ink); width: fit-content; }
  .newmail:hover { box-shadow: 0 2px 6px rgba(60,64,67,.18), 0 4px 14px rgba(60,64,67,.12); }
  .newmail svg { color: var(--red); }
  .compose { inset: auto 24px 0 auto; width: 740px; height: min(640px, calc(100vh - 90px)); border-radius: 14px 14px 0 0;
    box-shadow: 0 8px 40px rgba(0,0,0,.25); overflow: hidden; }
  .c-head { padding: 11px 16px; }
  #c-min, #c-full, #c-pop { display: block; }
  /* maximized = the whole browser window, as a maximized Outlook window (staff 15 Nov); a moved or resized window
     keeps its own place (app.js WM.place) */
  .compose.full { inset: 0; margin: 0; width: auto; height: auto; border-radius: 0; box-shadow: none; }
  .compose.free { inset: auto; border-radius: 12px; }
  .c-head { cursor: move; user-select: none; }
  .compose.full .c-head { cursor: default; }
  .compose.moving, .compose.moving * { user-select: none; }
  .compose.min { height: auto; width: 340px; }
  .compose.min #c-form { display: none; }
  .compose.min .c-head { cursor: pointer; }
}

/* ---------- formatting toolbar + editable text (editor.js) ---------- */
.c-tools { display: flex; align-items: center; gap: 2px; padding: 5px 10px; border-bottom: 1px solid var(--line); background: var(--white);
  flex-wrap: wrap; flex: none; }
.t-btn { width: 28px; height: 28px; border: 0; border-radius: 8px; background: none; color: var(--mute); cursor: pointer; display: grid; place-items: center; padding: 0; }
.t-btn:hover { background: rgba(127,127,127,.14); color: var(--ink); }
.t-btn.on { background: var(--red-soft); color: var(--red-d); }
.t-btn svg { width: 19px; height: 19px; }
.t-sel { border: 0; background: none; color: var(--ink); font-size: 13px; padding: 5px 2px; border-radius: 8px; cursor: pointer; max-width: 104px; }
.t-sel:hover { background: rgba(127,127,127,.14); }
.t-sep { width: 1px; height: 20px; background: var(--line); margin: 0 3px; }
.pop { position: fixed; z-index: 60; background: var(--white); border-radius: 12px; box-shadow: 0 8px 28px rgba(0,0,0,.22); padding: 8px; }
.t-pop { display: flex; flex-wrap: wrap; gap: 2px; max-width: 236px; }
.t-pop-h { width: 100%; font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: .5px; padding: 4px 4px 2px; }
.t-swatches { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; padding: 2px 4px 6px; }
.t-swatch { width: 28px; height: 28px; border-radius: 50%; border: 1px solid rgba(0,0,0,.18); cursor: pointer; padding: 0; }
.t-swatch:hover { transform: scale(1.12); }
.c-body blockquote, .sig-body blockquote { margin: 4px 0 4px 8px; border-left: 3px solid #d0d0d0; padding-left: 10px; color: #555; }
.c-body img, .sig-body img { max-width: 100%; height: auto; }
.c-body a[href], .sig-body a[href] { color: #1a73e8; }
.c-body ul, .c-body ol { padding-left: 28px; }
.mm-sig { margin-top: 6px; }
.c-ico { width: 36px; height: 36px; border: 0; border-radius: 10px; background: none; color: var(--mute); cursor: pointer; display: grid; place-items: center;
  padding: 0; flex: none; }
.c-ico:hover { background: rgba(127,127,127,.14); color: var(--ink); }
.c-ico svg { width: 21px; height: 21px; }
.c-aa { font: 600 15px/1 Georgia, serif; } .c-aa.on { background: var(--red-soft); color: var(--red-d); }
.c-foot { gap: 4px; }
.c-foot .c-send { margin-right: 8px; }
.pop-item { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 9px 14px; border-radius: 8px; cursor: pointer; color: var(--ink);
  font-size: 14px; white-space: nowrap; }
.pop-item:hover { background: rgba(127,127,127,.14); } .pop-item.on { font-weight: 700; color: var(--red-d); }
#c-sigmenu { min-width: 220px; max-height: 60vh; overflow-y: auto; }
@media (max-width: 760px) {
  .c-tools { flex-wrap: nowrap; overflow-x: auto; }
  .c-body { font-size: 15px; }
  .c-ico { width: 34px; }
}

/* ---------- account menu items ---------- */
.menu-item { display: flex; align-items: center; gap: 10px; width: calc(100% + 16px); margin: 0 -8px 4px; padding: 9px 8px; border: 0; background: none;
  border-radius: 10px; cursor: pointer; color: var(--ink); text-align: left; }
.menu-item:hover { background: rgba(127,127,127,.12); }
.menu-item svg { color: var(--mute); }
.menu-item span { flex: 1; }
.menu-state { font-size: 12px; color: var(--mute); }
.menu .menu-link { display: inline-block; margin-top: 8px; }

/* ---------- Signatures sheet (sigs.js) ---------- */
.sheet { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.42); display: grid; place-items: center; padding: 20px; }
.sheet-card { background: var(--white); border-radius: 16px; width: min(920px, 100%); max-height: calc(100vh - 40px); overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.3);
  display: flex; flex-direction: column; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); font-size: 17px; }
.sheet-head button { border: 0; background: none; font-size: 18px; cursor: pointer; color: var(--mute); }
.sig-grid { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 300px; }
.sig-list { border-right: 1px solid var(--line); padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.sig-item { border: 0; background: none; text-align: left; padding: 9px 12px; border-radius: 10px; cursor: pointer; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sig-item:hover { background: rgba(127,127,127,.12); } .sig-item.on { background: var(--red-soft); color: var(--red-d); font-weight: 600; }
.sig-none { color: var(--faint); font-size: 13px; padding: 8px 4px; }
.sig-newbtn.sig-import { color: var(--mute); border-style: solid; margin-top: 4px; font-weight: 500; }
.sig-newbtn { margin-top: 8px; border: 1px dashed var(--line); background: none; border-radius: 10px; padding: 9px 12px; cursor: pointer; color: var(--red); font-weight: 600; text-align: left; }
.sig-edit { padding: 14px 18px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.sig-name { border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; outline: none; background: none; }
.sig-name:focus { border-color: var(--red); }
.sig-edit .c-tools { border: 1px solid var(--line); border-radius: 10px 10px 0 0; margin-bottom: -10px; }
.sig-body { min-height: 160px; max-height: 340px; overflow-y: auto; border: 1px solid var(--line); border-radius: 0 0 10px 10px; padding: 12px 14px; outline: none;
  background: #fff; color: #1f1f1f; font: 14px/1.5 Arial, Helvetica, sans-serif; word-wrap: break-word; }
.sig-actions { display: flex; align-items: center; gap: 10px; }
.sig-save { width: auto; border: 0; padding: 9px 24px; cursor: pointer; font-size: 14px; }
.sig-del { border: 0; background: none; color: var(--red-d); cursor: pointer; }
.sig-defaults { border-top: 1px solid var(--line); padding: 14px 20px 18px; display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: end; }
.sig-dh { width: 100%; font-weight: 700; }
.sig-defaults label { display: grid; gap: 4px; font-size: 12px; color: var(--mute); }
.sig-defaults select { min-width: 210px; max-width: 280px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); color: var(--ink); font-size: 14px; }
@media (max-width: 760px) {
  .sheet { padding: 0; } .sheet-card { border-radius: 0; height: 100%; max-height: none; }
  .sheet-head { padding-top: calc(16px + var(--top)); }
  .sig-grid { grid-template-columns: 1fr; } .sig-list { border-right: 0; border-bottom: 1px solid var(--line); flex-direction: row; flex-wrap: wrap; }
  .sig-newbtn { margin-top: 0; }
}

/* ---------- Night mode (theme.js sets data-theme on <html>) ----------
   The email itself stays on white paper, when reading and when writing: emails are made for a light background,
   and dark text on a dark editor would vanish. Everything around it turns dark. */
[data-theme="dark"] {
  --ink: #e8eaed; --mute: #bdc1c6; --faint: #9aa0a6; --line: #3c4043; --paper: #18191b; --white: #26272a;
  --red-soft: #4a2420; --red-tint: #2e201f; --red-d: #f28b82; --shadow: 0 1px 2px rgba(0,0,0,.5), 0 2px 8px rgba(0,0,0,.35);
  color-scheme: dark;
}
[data-theme="dark"] .bar { background: #26272a; border-bottom: 1px solid var(--line); }
[data-theme="dark"] .me { background: var(--red); border-color: rgba(255,255,255,.5); }
[data-theme="dark"] .box { background: #3c4043; }
[data-theme="dark"] .search input { background: #3c4043; color: var(--ink); }
[data-theme="dark"] .listcol, [data-theme="dark"] .tabs, [data-theme="dark"] .rhead, [data-theme="dark"] .strip, [data-theme="dark"] .atts,
[data-theme="dark"] .compose, [data-theme="dark"] .menu, [data-theme="dark"] .newmail, [data-theme="dark"] .more, [data-theme="dark"] .card,
[data-theme="dark"] .rtools button, [data-theme="dark"] .trow, [data-theme="dark"] .att, [data-theme="dark"] .body-text { background: var(--white); }
[data-theme="dark"] .row { border-bottom-color: #2f3134; }
[data-theme="dark"] .row:hover, [data-theme="dark"] .att:hover, [data-theme="dark"] .side-nav button:hover, [data-theme="dark"] .side-box:hover { background: #303235; }
[data-theme="dark"] .chip, [data-theme="dark"] .c-file { background: #3c4043; color: var(--mute); }
[data-theme="dark"] .spam-intro, [data-theme="dark"] .search-note { background: #332b14; color: #e6d9b0; }
[data-theme="dark"] .rbody { background: var(--paper); padding: 10px 12px 14px; }
[data-theme="dark"] .body-frame { border-radius: 10px; }
[data-theme="dark"] .c-head { background: #3c4043; }
[data-theme="dark"] .c-subject, [data-theme="dark"] .c-row input, [data-theme="dark"] .c-row select { color: var(--ink); background: none; }
[data-theme="dark"] .c-body { border-radius: 10px; margin: 8px 10px; }
[data-theme="dark"] .c-send:disabled { background: #5b2b27; color: #c9a19c; }
[data-theme="dark"] .door input { background: #3c4043; border-color: #5f6368; color: var(--ink); }
[data-theme="dark"] .toast { background: #e8eaed; color: #202124; }
[data-theme="dark"] .undo button { color: #1a73e8; }
[data-theme="dark"] .empty img { opacity: .5; }

/* ---------- Starred / Trash ---------- */
.star { border: 0; background: none; padding: 0 2px; margin-left: 2px; cursor: pointer; color: var(--faint); display: grid; place-items: center; flex: none; }
.star svg { width: 18px; height: 18px; }
.star:hover { color: #f4b400; } .star.on { color: #f4b400; }
.rstar.on { color: #b06000; border-color: #f4b400 !important; }
.tabs { overflow-x: auto; scrollbar-width: none; } .tabs::-webkit-scrollbar { display: none; }
.tabs button { white-space: nowrap; flex: none; }

/* ---------- Drafts ---------- */
.draft-chip { color: var(--red-d); font-weight: 700; flex: none; }
.c-saved { color: var(--faint); font-size: 12px; white-space: nowrap; }

/* ---------- unread + filters ---------- */
.row.unread .who, .row.unread .subj { font-weight: 700; color: var(--ink); }
.row.unread::after { content: ""; position: absolute; left: 6px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: var(--red); }
.nav-count { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--red-d); padding-right: 6px; }
.list-head { align-items: center; gap: 8px; }
.list-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.filter-btn, .tab-filter { border: 0; background: none; color: var(--mute); cursor: pointer; border-radius: 8px; padding: 4px; display: grid; place-items: center; }
.filter-btn:hover, .tab-filter:hover { background: rgba(127,127,127,.14); }
.filter-btn.on, .tab-filter.on { color: var(--red-d); background: var(--red-soft); }
.filter-chip { border: 0; background: var(--red-soft); color: var(--red-d); border-radius: 12px; padding: 2px 10px; font-size: 12px; font-weight: 600; cursor: pointer; }
#filter-menu { min-width: 220px; }
@media (min-width: 1100px) { .tab-filter { display: none; } }
.att.att-dl { padding: 7px 10px; font-weight: 700; margin-left: -4px; }   /* the Download button next to a previewed attachment */
/* categories (coloured labels) + custom folders (labels.js) */
.side-h { display: flex; align-items: center; justify-content: space-between; }
.side-act { border: 0; background: none; color: var(--red-d); font-size: 11px; font-weight: 600; cursor: pointer; padding: 2px 4px; text-transform: none; letter-spacing: 0; }
.side-act:hover { text-decoration: underline; }
.side-more { visibility: hidden; color: var(--mute); padding: 0 4px; border-radius: 6px; }
.side-box:hover .side-more { visibility: visible; } .side-more:hover { background: rgba(127,127,127,.18); }
.side-empty { color: var(--faint); font-size: 12px; padding: 4px 14px 8px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: -1px; flex: none; }
.cats { display: inline-flex; gap: 4px; flex: none; max-width: 60%; overflow: hidden; }
.cat { --c: #5f6368; display: inline-block; font-size: 11px; line-height: 16px; padding: 0 7px; border-radius: 8px; white-space: nowrap;
  max-width: 120px; overflow: hidden; text-overflow: ellipsis; color: var(--ink); border-left: 3px solid var(--c);
  background: color-mix(in srgb, var(--c) 16%, transparent); }
.cat.more { border-left-color: transparent; background: rgba(127,127,127,.14); }
.rcats { display: flex; flex-wrap: wrap; max-width: none; margin: -6px 0 12px; } .rcats .cat { font-size: 12px; line-height: 20px; max-width: 220px; }
.rcats:empty { display: none; }
.pop-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.pop-item .pop-check { display: inline-block; width: 18px; color: var(--red-d); font-weight: 700; }
.cats-card { width: min(560px, 100%); }
.cats-items { padding: 10px 20px; display: grid; gap: 10px; }
.cat-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cat-row input { flex: 1 1 180px; min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; font: inherit; background: var(--white); color: var(--ink); }
.swatches { display: flex; gap: 5px; flex-wrap: wrap; }
.swatch { width: 20px; height: 20px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; }
.swatch.on { border-color: var(--ink); box-shadow: 0 0 0 2px var(--white) inset; }
.cat-del { border: 0; background: none; color: var(--mute); cursor: pointer; font-size: 15px; padding: 4px 6px; border-radius: 6px; }
.cat-del:hover { background: rgba(127,127,127,.16); color: var(--red-d); }
.cats-foot { display: flex; align-items: center; gap: 12px; padding: 4px 20px 18px; }
/* Highlight split button (editor.js) */
.t-btn.t-caret { width: 14px; margin-left: -4px; } .t-btn.t-caret svg { width: 14px; height: 14px; }
.t-none { display: block; width: 100%; margin-top: 6px; border: 1px solid var(--line); background: none; border-radius: 8px; padding: 6px; cursor: pointer; color: var(--ink); font: inherit; font-size: 13px; }
.t-none:hover { background: rgba(127,127,127,.14); }
/* the whole conversation in the reader (loadThread / expandConv in app.js) */
.conv { background: var(--white); border-bottom: 1px solid var(--line); padding: 4px 0 6px; max-height: 300px; overflow: auto; flex: none; }   /* never squeezed by the email below it (16 Nov: opened earlier emails were cut to ~200 px) */
.conv.open { max-height: none; }
.conv-h { display: flex; align-items: center; gap: 10px; padding: 6px 22px; font-size: 13px; }
.conv-note { color: var(--faint); font-size: 12px; }
.conv-all { margin-left: auto; border: 1px solid var(--line); background: none; border-radius: 14px; padding: 3px 12px; cursor: pointer; font-size: 12px; color: var(--ink); }
.conv-top { display: grid; grid-template-columns: 26px minmax(90px, 190px) minmax(0, 1fr) auto; gap: 10px; align-items: center; width: 100%; border: 0;
  background: none; text-align: left; padding: 6px 22px; cursor: pointer; color: var(--ink); font: inherit; font-size: 13px; }
.conv-top:hover { background: rgba(127,127,127,.08); } .conv-item.cur .conv-top { background: var(--red-tint); }
.conv-who { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-snip { color: var(--mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-when { color: var(--faint); font-size: 12px; white-space: nowrap; }
.conv-body { padding: 4px 22px 14px 58px; display: flex; flex-direction: column; gap: 8px; }
.conv-body .atts { padding: 0; background: none; border: 0; }
.conv-meta { white-space: pre-line; font-size: 12px; color: var(--mute); line-height: 1.5; }
.conv-frame { min-height: 380px; border: 1px solid var(--line); border-radius: 8px; }
.conv-open { align-self: flex-start; }
@media (max-width: 760px) { .conv-top { grid-template-columns: 26px minmax(0, 1fr) auto; } .conv-snip { display: none; } .conv-body { padding-left: 22px; } }
.compose.dropping { outline: 3px dashed var(--red); outline-offset: -6px; }   /* files dragged over the email window */
/* address suggestions under To / Cc / Bcc (app.js AC, contacts.py) */
.ac { padding: 4px; z-index: 70; max-height: 60vh; overflow: auto; }
.ac-item { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 7px 10px; border-radius: 8px; cursor: pointer; color: var(--ink); font: inherit; }
.ac-item.on, .ac-item:hover { background: var(--red-soft); }
.ac-top { display: flex; gap: 8px; align-items: baseline; font-size: 13px; }
.ac-label { color: var(--mute); font-size: 12px; } .ac-top .ac-label:last-child { margin-left: auto; color: var(--faint); font-size: 11px; }
.ac-addr { color: var(--mute); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.print-frame { position: fixed; right: 0; bottom: 0; width: 1px; height: 1px; border: 0; opacity: .01; pointer-events: none; }   /* Print (app.js printAttachment) */
/* preview of an attached file before sending (app.js previewFile) */
.pv { z-index: 80; }
.pv-card { width: min(1000px, 100%); height: min(88vh, 1100px); display: flex; flex-direction: column; overflow: hidden; }
.pv-acts { display: flex; align-items: center; gap: 14px; font-size: 13px; } .pv-acts a { color: var(--red-d); }
.pv-body { flex: 1; min-height: 0; display: grid; place-items: center; background: #525659; }
.pv-body iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.pv-body img { max-width: 100%; max-height: 100%; object-fit: contain; background: #fff; }
.c-file-pv { border: 1px solid var(--line); background: var(--white); color: var(--red-d); border-radius: 8px; padding: 1px 8px; font: inherit; font-size: 12px; cursor: pointer; }
.c-file-pv:hover { background: var(--red-soft); }
/* pop-up menus (labels.js): a right-click menu is denser; an item with its own menu (›) opens it beside it */
#pop-menu, #pop-sub { min-width: 220px; max-height: calc(100vh - 16px); overflow: auto; }
.pop.dense .pop-item { padding: 7px 14px; }
.pop-item.has-sub { position: relative; padding-right: 34px; }
.pop-arrow { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 17px; color: var(--faint); }
.pop-item.open { background: rgba(127,127,127,.14); }
.row.ctx { background: rgba(127,127,127,.16); }   /* the email a right-click menu is open on */
/* the browser's own Print (app.js beforeprint): the open email alone; Print / Ctrl+P use the formatted print page */
#print-root { display: none; }
@media print {
  html.printing-mail, html.printing-mail body { height: auto !important; overflow: visible !important; background: #fff !important; }
  html.printing-mail body > *:not(#print-root) { display: none !important; }
  html.printing-mail #print-root { display: block; color: #000; font: 14px/1.45 Calibri, Carlito, "Segoe UI", Arial, sans-serif; }
  .pr-who { font-weight: 700; font-size: 20px; border-bottom: 3px solid #000; padding-bottom: 4px; margin-bottom: 10px; }
  .pr-meta { border-collapse: collapse; margin-bottom: 18px; }
  .pr-meta th { text-align: left; vertical-align: top; padding: 1px 16px 1px 0; white-space: nowrap; }
  .pr-meta td { padding: 1px 0; }
  .pr-text { white-space: pre-wrap; word-wrap: break-word; }
}

/* ---------- several emails open at once (staff 15 Nov, "like Outlook or Focus"): the minimized ones wait in a bar at the
   bottom (app.js WM); on computers the window moves by its title bar and resizes from any edge or corner ---------- */
.dock { position: fixed; right: 24px; bottom: 0; z-index: 19; display: flex; gap: 8px; align-items: flex-end; max-width: calc(100vw - 48px);
  overflow-x: auto; scrollbar-width: none; }
.dock::-webkit-scrollbar { display: none; }
.dock-chip { flex: none; display: flex; align-items: stretch; width: 250px; background: #3c3c3c; color: #fff; border-radius: 10px 10px 0 0;
  box-shadow: 0 2px 12px rgba(0,0,0,.28); }
.dock-chip.pop { background: #5f6368; }
.dock-title { flex: 1; min-width: 0; border: 0; background: none; color: inherit; text-align: left; padding: 8px 12px; cursor: pointer; font: inherit;
  border-radius: 10px 0 0 0; }
.dock-title span, .dock-title small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dock-title span { font-size: 13px; font-weight: 600; }
.dock-title small { font-size: 11px; opacity: .78; margin-top: 1px; }
.dock-x { flex: none; border: 0; background: none; color: #fff; cursor: pointer; padding: 0 12px; font-size: 14px; opacity: .8; border-radius: 0 10px 0 0; }
.dock-title:hover, .dock-x:hover { background: rgba(255,255,255,.1); opacity: 1; }
.rz { display: none; position: absolute; z-index: 3; }
@media (max-width: 1099px) {
  .dock { left: 8px; right: 84px; max-width: none; bottom: env(safe-area-inset-bottom); }   /* clear of the round New email button */
  .dock-chip { width: 172px; }
}
@media (min-width: 1100px) {
  .compose:not(.full) .rz { display: block; }
  .rz-n, .rz-s { left: 12px; right: 12px; height: 5px; cursor: ns-resize; } .rz-n { top: 0; } .rz-s { bottom: 0; }
  .rz-e, .rz-w { top: 12px; bottom: 12px; width: 5px; cursor: ew-resize; } .rz-e { right: 0; } .rz-w { left: 0; }
  .rz-ne, .rz-nw, .rz-se, .rz-sw { width: 14px; height: 14px; }
  .rz-ne { top: 0; right: 0; cursor: nesw-resize; } .rz-sw { bottom: 0; left: 0; cursor: nesw-resize; }
  .rz-nw { top: 0; left: 0; cursor: nwse-resize; } .rz-se { bottom: 0; right: 0; cursor: nwse-resize; }
}
/* an email in its own browser window (⧉ Open in its own window): only the email, filling that window */
html.popout .bar, html.popout .tabs, html.popout .panes, html.popout .fab, html.popout .dock { display: none !important; }
html.popout .compose { inset: 0 !important; width: auto !important; height: auto !important; border-radius: 0 !important; box-shadow: none !important; }
html.popout #c-pop, html.popout #c-min, html.popout #c-full, html.popout .rz { display: none !important; }
html.popout .c-head { cursor: default; }
/* an attachment in an email can be dragged out (to the desktop, a folder, or an email being written) */
.atts a.att[draggable="true"] { cursor: pointer; }
.atts a.att.dragging { opacity: .55; }

/* the title bar: kind + subject, cut short with … so the buttons always fit */
#c-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-right: 12px; }
.c-acts { flex: none; }

/* ---------- 15 Nov (2): attachments dragged out, Excel / Word previews ---------- */
body.att-drag iframe { pointer-events: none; }   /* a file dragged over an email's text: the page decides, not the frame */
#act { bottom: 84px; max-width: calc(100vw - 32px); white-space: normal; }   /* "Save as…" after a refused drop, above the Undo bar */
.pv-body.doc { display: flex; flex-direction: column; align-items: stretch; justify-items: stretch; background: #fff; }
.pv-tabs { display: flex; gap: 4px; padding: 6px 10px; border-bottom: 1px solid var(--line); overflow-x: auto; flex: none; background: #f8f9fa; }
.pv-tabs button { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 4px 12px; cursor: pointer; font: inherit; font-size: 12px; white-space: nowrap; color: var(--ink); }
.pv-tabs button.on { background: var(--red-soft); color: var(--red-d); border-color: transparent; font-weight: 600; }
.pv-doc { flex: 1; min-height: 0; }
.pv-doc iframe { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.pv-note { padding: 28px; color: var(--mute); text-align: center; }
.pv-cut { padding: 6px 14px; font-size: 12px; color: var(--mute); background: #fff8e1; border-bottom: 1px solid var(--line); flex: none; }
/* an email full screen, opened with a double-click in the list, as in Outlook (app.js setFullRead) */
.fr-close { display: none; }
@media (min-width: 760px) {
  #app.fullread .reader { position: fixed; inset: 0; z-index: 15; display: flex; overflow: hidden; }
  #app.fullread .rwrap { flex: 1; height: 100%; min-height: 0; overflow: auto; }
  #app.fullread .rhead { padding-right: 80px; }
  #app.fullread .fr-close { display: grid; place-items: center; position: fixed; top: 14px; right: 20px; z-index: 16; width: 42px; height: 42px;
    border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--ink); font-size: 18px; cursor: pointer; box-shadow: var(--shadow); }
  #app.fullread .fr-close:hover { background: var(--red-soft); color: var(--red-d); }
  [data-theme="dark"] #app.fullread .fr-close { background: var(--white); }
}
/* the reader's Full screen button: computers only (on a phone an open email fills the screen already) */
@media (max-width: 759px) { .rtools .rfull { display: none; } }

/* ---------- 16 Nov: the previous emails under the email being written (app.js histShow), the conversation grip in the
   reader (convGrip), Word's fonts and sizes (editor.js) ---------- */
.c-hist { flex: none; display: flex; flex-direction: column; min-height: 0; border-top: 1px solid var(--line); background: #fff; }
.c-hist.closed { height: auto !important; }
.c-hist.closed .c-hist-frame { display: none; }
.c-hist-bar { flex: none; display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px 0 6px; background: #f6f7f9; border-bottom: 1px solid var(--line);
  cursor: ns-resize; user-select: none; touch-action: none; }
.c-hist.closed .c-hist-bar { cursor: default; border-bottom: 0; }
.c-hist-toggle { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 6px; border: 0; background: none; padding: 4px 6px; border-radius: 8px;
  color: var(--mute); font: inherit; font-size: 12.5px; cursor: pointer; text-align: left; }
.c-hist-toggle:hover { background: rgba(127,127,127,.14); }
#c-hist-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-hist-arrow { display: inline-block; transition: transform .15s; }
.c-hist.closed .c-hist-arrow { transform: rotate(-90deg); }
.c-hist-grip { flex: none; width: 36px; height: 10px; border-top: 2px solid #c4c7cc; border-bottom: 2px solid #c4c7cc; opacity: .9; }
.c-hist.closed .c-hist-grip { visibility: hidden; }
.c-hist-big { flex: none; border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 8px; padding: 3px 10px; font: inherit; font-size: 12px; cursor: pointer; }
.c-hist-big:hover { background: var(--red-soft); color: var(--red-d); }
.c-hist-frame { flex: 1; min-height: 0; width: 100%; border: 0; background: #fff; }
.c-hist.dragging .c-hist-frame { pointer-events: none; }
[data-theme="dark"] .c-hist-bar { background: #2b2c2f; }
[data-theme="dark"] .c-hist-big { background: var(--white); }
.conv-grip { height: 12px; display: grid; place-items: center; cursor: ns-resize; background: var(--white); border-bottom: 1px solid var(--line); touch-action: none; user-select: none; }
.conv-grip:hover { background: #f3efe9; }
.conv-grip-bar { width: 40px; height: 6px; border-top: 2px solid #c4c7cc; border-bottom: 2px solid #c4c7cc; }
[data-theme="dark"] .conv-grip:hover { background: #303235; }
.t-sel.t-font { max-width: 106px; } .t-sel.t-size { max-width: 58px; }   /* the toolbar stays on one row in the 740 px window */

/* ---------- split pane dividers, as in Outlook (staff 16 Nov; app.js SPLIT): an 8 px grab zone on each column line,
   a thin red line while hovered or dragged; the folder-menu divider only where the menu shows (computers) ---------- */
.split { position: relative; z-index: 6; width: 8px; margin-left: -1px; cursor: col-resize; touch-action: none; user-select: none; outline: none; }
.split::after { content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 2px; background: transparent; transition: background .12s; }
.split:hover::after, .split.on::after, .split:focus-visible::after { background: var(--red); }
#split-side { display: none; }
@media (min-width: 1100px) { #split-side { display: block; } }
body.col-drag, body.col-drag * { cursor: col-resize !important; user-select: none !important; }
#app.fullread .split { display: none; }

/* Notifications window (notify.js) */
.nt-card { width: min(480px, 100%); }
.nt-body { padding: 4px 20px 18px; }
.nt-lead { color: var(--mute); font-size: 13px; margin: 10px 0 4px; }
.nt-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.nt-row input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--red); flex: none; }
.nt-row input:disabled + span { opacity: .6; }
.nt-row b { display: block; font-size: 14px; }
.nt-row small { display: block; color: var(--mute); font-size: 12px; margin-top: 2px; }
.nt-boxes-head { font-size: 12px; color: var(--mute); text-transform: uppercase; letter-spacing: .04em; margin: 14px 0 6px; }
#nt-boxes { max-height: 180px; overflow: auto; }
.nt-box { display: flex; gap: 10px; align-items: center; padding: 5px 0; font-size: 13px; cursor: pointer; }
.nt-box input { accent-color: var(--red); }
.nt-foot { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.nt-test { border: 1px solid var(--line); background: var(--white); color: var(--ink); border-radius: 8px; padding: 7px 14px; font: inherit; cursor: pointer; }
.nt-test:hover { background: rgba(127,127,127,.1); }
.nt-msg { font-size: 12px; color: var(--mute); }

/* the preview window's Close: a real button, not a bare ✕ (Jacob 16 Nov: "I don't know how to close a PDF") */
.sheet-head .pv-close { border: 1px solid var(--line); border-radius: 8px; padding: 5px 12px; background: var(--white); color: var(--ink); font: inherit; font-size: 13px; font-weight: 600; }
.sheet-head .pv-close:hover { background: var(--red-soft); color: var(--red-d); border-color: transparent; }

/* The email fills the reading area once scrolled to, never a small box at the bottom (Jacob 16 Nov; --readh = app.js readHeight):
   computers when a conversation list stands above it, earlier emails opened in the conversation, phones always.
   On a phone the conversation list starts folded to its title line ("Show"), so the email comes right under the buttons. */
.rwrap:has(> .conv:not([hidden])) > .rbody > .body-frame { min-height: max(420px, calc(var(--readh, 600px) - 16px)); }
.conv-frame { min-height: max(380px, calc(var(--readh, 600px) - 60px)); }
.conv-show { margin-left: auto; } .conv-show + .conv-all { margin-left: 8px; }
@media (max-width: 760px) {
  .body-frame { min-height: max(420px, calc(var(--readh, 100vh) - 8px)); }
  .conv.folded > .conv-item, .conv.folded + .conv-grip, .conv.folded .conv-all:not(.conv-show), .conv.folded .conv-note { display: none; }
}

/* iOS 26 colours the strips behind the clock and the home bar from the page's own background (theme-color is no longer
   read there): the page's background is the bar's colour, and the app covers it everywhere else (Jacob 16 Nov, iPhone:
   "its not fully red, better fully red" / "below part is white") */
html, body { background-color: var(--red); }
html[data-theme="dark"], html[data-theme="dark"] body { background-color: #26272a; }
/* on a phone the less-used reader buttons wait in "More" (app.js), so the email starts higher (Jacob 16 Nov) */
.rtools .rmore { display: none; }
@media (max-width: 760px) { .rtools.has-more .rsec { display: none; } .rtools .rmore { display: inline-block; } .rtools .chip { order: 1; } }   /* the mailbox chip last: 2 rows */

/* --top: how far the page keeps clear of the top of the screen. In the iPhone app iOS 26+ lays its own frosted glass over
   the clock strip and a little below it, and blurs whatever reaches in (the white search box glowed up into the red):
   there the bar's buttons sit 20 px lower (Jacob 16 Nov: "above part is still blurry"). Other screens: unchanged. */
:root { --top: env(safe-area-inset-top); }
@supports (-webkit-touch-callout: none) { @media (display-mode: standalone) { :root { --top: calc(env(safe-area-inset-top) + 20px); } } }

/* an email being dragged out of the list (app.js emailDragStart) */
.row.dragging { opacity: .55; }

/* tables in the email being written (tables.js): the Table button's grid and its changes; a column edge to drag */
.t-pop.t-tblpop { max-width: none; width: 380px; }   /* the general .t-pop is capped at 236 px */
.t-tblacts { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 0 4px; }
.t-tblacts .t-pop-item { padding: 5px 8px; }
.t-tblgrid { display: grid; grid-template-columns: repeat(8, 20px); gap: 3px; padding: 4px 2px; }
.t-tblgrid button { width: 20px; height: 20px; border: 1px solid var(--line); background: var(--white); border-radius: 3px; cursor: pointer; padding: 0; }
.t-tblgrid button.on { background: var(--red-soft); border-color: var(--red); }
.t-tbllabel { font-size: 12px; color: var(--mute); padding: 2px 4px 6px; }
.t-pop-item { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 6px 8px; border-radius: 6px; font: inherit; font-size: 13px; cursor: pointer; color: var(--ink); }
.t-pop-item:hover { background: rgba(127,127,127,.12); }
.t-pop-sep { height: 1px; background: var(--line); margin: 4px 0; }
.t-colresize, .t-colresize td, .t-colresize th { cursor: col-resize; }
#c-body table td, #c-body table th { min-width: 24px; }
#c-tools .t-btn { width: 26px; }   /* the Table button still fits on the one row of the 740 px email window */
