/* Email, built like Gmail: Inbox frame with folders (.ml-shell, .ml-nav, .ml-f), toolbar (.ml-bar), list of conversations (.ml-r-*),
   scheduled emails (.ml-s-*), conversation reader (.ml-th-*, .ml-m-*), composer (.ml-cmp-*), floating windows (.ml-dock, .ml-win-*),
   menus (.ml-menu-*), scheduled email panel (.ml-sp-*), templates panel (.ml-tm-*), Emails section of the deal drawer (.ml-dl-*), Settings (.ml-st-*). */

/* ---------- shared ---------- */
.ml-text { white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; line-height: 1.55; }
.ml-hint { font-size: 12.5px; color: var(--muted); margin: 0; }
.ml-clip { width: 15px; height: 15px; }
.ml-ic { width: 16px; height: 16px; }
.ml-alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-card); background: var(--warn-bg); color: var(--text); margin-bottom: 14px; }
.ml-alert svg { width: 16px; height: 16px; flex: none; color: var(--warn); margin-top: 2px; }
.ml-alert.is-bad { background: var(--bad-bg); }
.ml-alert.is-bad svg { color: var(--bad); }
.ml-alert-fix { color: var(--muted); margin-top: 4px; }
.ml-alert code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.ml-av { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); font-size: 12px; font-weight: 650; }
.ml-av.is-me { background: var(--ink); color: var(--surface); border-color: transparent; }
.ml-lbl { font-size: 12px; padding: 0 7px; border-radius: 4px; line-height: 1.6; }
.ml-cb { width: 16px; height: 16px; margin: 0; cursor: pointer; accent-color: var(--ink); }

/* ---------- Inbox frame: folders on the left, like Gmail ---------- */
.ml-shell { display: grid; grid-template-columns: 212px minmax(0, 1fr); gap: 0 22px; align-items: start; }
.ml-nav { position: sticky; top: 78px; display: flex; flex-direction: column; gap: 14px;
  max-height: calc(100vh - 90px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; padding-bottom: 12px; } /* scrolls on its own when the screen is short (Greg, 07/11/2026) */
.ml-compose { align-self: flex-start; min-height: 54px; padding: 0 26px 0 18px; border-radius: 16px; font-size: 15px; gap: 12px; box-shadow: var(--shadow); }
.ml-compose svg, .ml-fab svg { width: 20px; height: 20px; }
.ml-folders { display: flex; flex-direction: column; gap: 1px; }
.ml-f { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 36px; padding: 0 14px 0 16px; border: 0; border-radius: 999px; background: none; color: var(--text); cursor: pointer; text-align: left; font-weight: 500; }
.ml-f:hover { background: color-mix(in srgb, var(--text) 6%, transparent); }
.ml-f.is-on { background: color-mix(in srgb, var(--text) 11%, transparent); font-weight: 650; }
.ml-f.is-bold .ml-f-l, .ml-f.is-bold .ml-f-n { font-weight: 700; }
.ml-f svg { width: 18px; height: 18px; flex: none; color: var(--muted); }
.ml-f.is-on svg { color: var(--text); }
.ml-f-l { position: relative; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ml-f-n { font-size: 12.5px; color: var(--muted); }
.ml-f.is-bold .ml-f-n { color: var(--text); }
.ml-f-sep { display: block; height: 1px; background: var(--line-soft); margin: 8px 14px; }
.ml-fab { display: none; }
.ml-pane { min-width: 0; }

/* ---------- list head and toolbar ---------- */
.ml-head { margin-bottom: 8px; align-items: center; }
.ml-status { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 13px; }
.ml-demo { font-weight: 500; }
.ml-search { position: relative; width: 340px; max-width: 100%; }
.ml-search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--faint); pointer-events: none; }
.ml-search .input { padding-left: 32px; min-height: 38px; }
.ml-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; min-height: 44px; padding: 2px 4px 2px 5px; margin-bottom: 4px; }
.ml-bar-cb { margin-right: 2px; }
.ml-bar-btn { min-height: 36px; color: var(--muted); }
.ml-bar-btn:hover { color: var(--text); }
.ml-bar-sel { font-size: 13px; color: var(--text); font-weight: 560; margin: 0 6px 0 8px; }
.ml-bar-range { font-size: 12.5px; color: var(--muted); margin-right: 6px; white-space: nowrap; }
.ml-bar-pg { min-width: 36px; min-height: 36px; justify-content: center; }
.ml-keys { margin: 10px 2px 0; font-size: 12.5px; color: var(--faint); }

/* ---------- list of conversations ---------- */
.ml-rows { list-style: none; margin: 0; padding: 0; overflow: hidden; }
.ml-r { position: relative; display: grid; grid-template-columns: 36px 10px 168px auto minmax(0, 1fr) 16px 84px; grid-template-areas: "cb biz who deal line att end";
  align-items: center; column-gap: 10px; min-height: 42px; padding: 0 10px 0 4px; border-bottom: 1px solid var(--line-soft);
  background: color-mix(in srgb, var(--surface-2) 75%, var(--surface)); }
.ml-r:last-child { border-bottom: 0; }
.ml-r.is-unread { background: var(--surface); }
.ml-r:hover { box-shadow: inset 0 0 0 1px var(--line), 0 1px 3px rgba(21, 33, 43, .08); z-index: 1; }
.ml-r.is-sel { box-shadow: inset 3px 0 0 var(--text); }
.ml-r.is-checked { background: color-mix(in srgb, var(--text) 8%, var(--surface)); }
.ml-r-cb { grid-area: cb; position: relative; z-index: 1; display: grid; place-items: center; width: 36px; height: 36px; cursor: pointer; border-radius: 50%; }
.ml-r-cb:hover { background: color-mix(in srgb, var(--text) 7%, transparent); }
.ml-r-biz { grid-area: biz; display: flex; }
.ml-r-who { grid-area: who; color: var(--text); }
.ml-r-who b { font-weight: 700; }
.ml-r-n { color: var(--muted); font-size: 12px; margin-left: 2px; }
.ml-r-link { grid-area: line; display: block; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: inherit; text-decoration: none; }
button.ml-r-link { padding: 0; border: 0; background: none; text-align: left; font: inherit; cursor: pointer; }
.ml-r-link::after { content: ''; position: absolute; inset: 0; }
.ml-r-link:focus-visible { outline: none; }
.ml-r-link:focus-visible::after { outline: 2px solid var(--focus); outline-offset: -2px; border-radius: 4px; }
.ml-r-subj { color: var(--text); }
.ml-r-prev { color: var(--muted); margin-left: 8px; }
.ml-r.is-unread .ml-r-subj { font-weight: 700; }
.ml-r-att { grid-area: att; display: flex; color: var(--muted); }
.ml-r-deal { grid-area: deal; display: flex; min-width: 0; max-width: 150px; }
.ml-r-chip { position: relative; z-index: 1; display: inline-flex; align-items: center; min-height: 32px; max-width: 100%; padding: 0; border: 0; background: none; cursor: pointer; color: inherit; border-radius: var(--r-chip); }
.ml-r-chip .chip { max-width: 100%; color: var(--text); }
.ml-r-chip:hover .chip { border-color: var(--line); background: var(--surface); }
.ml-r-chip .chip.bad, .ml-r-chip .chip.good { color: inherit; }
.ml-r-stage { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font-weight: 500; }
.ml-r-chip .chip.bad .ml-r-stage { color: var(--bad); }
.ml-r-chip .chip.good .ml-r-stage { color: var(--good); }
.ml-r-nodeal { color: var(--faint); }
.ml-r-end { grid-area: end; display: flex; justify-content: flex-end; align-items: center; }
.ml-r-when { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.ml-r.is-unread .ml-r-when { color: var(--text); font-weight: 650; }
.ml-r-acts { display: none; gap: 2px; }
.ml-r-acts .btn { position: relative; z-index: 1; padding: 6px; min-height: 36px; min-width: 36px; justify-content: center; }
@media (hover: hover) and (min-width: 861px) {
  .ml-r:hover .ml-r-acts, .ml-r:focus-within .ml-r-acts { display: flex; }
  .ml-r:hover .ml-r-when, .ml-r:focus-within .ml-r-when { display: none; }
}

/* ---------- scheduled emails ---------- */
.ml-s { grid-template-columns: 10px 190px minmax(0, 1fr) auto; grid-template-areas: "biz who line end" "alert alert alert alert"; padding: 0 14px; background: var(--surface); }
.ml-s .ml-r-subj { font-weight: 560; }
.ml-s .chip { margin-right: 8px; font-size: 12px; padding: 0 7px; }
.ml-s-when { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.ml-s.is-alert .ml-s-when { color: var(--text); font-weight: 600; }
.ml-s-alert { grid-area: alert; position: relative; z-index: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 10px; padding: 8px 10px; border-radius: var(--r-ctl); background: var(--warn-bg); font-size: 13px; }
.ml-s.is-failed .ml-s-alert { background: var(--bad-bg); }
.ml-s-alert > svg { width: 15px; height: 15px; flex: none; color: var(--warn); }
.ml-s.is-failed .ml-s-alert > svg { color: var(--bad); }
.ml-s-why { flex: 1 1 260px; min-width: 0; }
.ml-s-acts { display: flex; gap: 6px; }
.ml-s-acts .btn { min-height: 36px; }

/* ---------- conversation reader ---------- */
.ml-th { max-width: 1000px; }
.ml-th-bar { display: flex; align-items: center; gap: 6px; margin: -6px 0 8px; }
.ml-th-bar .btn { min-height: 36px; }
.ml-back svg { transform: scaleX(-1); }
.ml-th-mreply { display: none; }
.ml-th-head { padding: 2px 0 14px; }
.ml-th-subj { font-size: 22px; line-height: 1.25; overflow-wrap: anywhere; }
.ml-th-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 8px; }
.ml-th-box { display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; color: var(--muted); font-size: 13px; }
.ml-th-deal { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; max-width: 100%; padding: 4px 10px 4px 6px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--surface); color: inherit; cursor: pointer; }
.ml-th-deal:hover { background: var(--surface-2); }
.ml-th-dealname { font-weight: 600; min-width: 0; }
.ml-th-unl { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ml-th-unl .btn { min-height: 36px; }
.ml-th-link { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.ml-th-linkh { font-size: 14px; }
.ml-th-link .input, .ml-th-link .btn { min-height: 36px; }
.ml-th-results { list-style: none; margin: 0 0 6px; padding: 0; border: 1px solid var(--line-soft); border-radius: var(--r-ctl); overflow: hidden; }
.ml-th-results li + li { border-top: 1px solid var(--line-soft); }
.ml-th-result { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 7px 10px; background: var(--surface); border: 0; text-align: left; cursor: pointer; color: inherit; }
.ml-th-result:hover { background: var(--surface-2); }
.ml-th-rmain { display: flex; flex-direction: column; min-width: 0; }
.ml-th-none { margin: 0; }

.ml-msgs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-card); box-shadow: var(--shadow); overflow: hidden; }
.ml-msgs > li + li { border-top: 1px solid var(--line-soft); }
.ml-m-row { display: grid; grid-template-columns: 32px minmax(0, 170px) minmax(0, 1fr) auto auto; grid-template-areas: "av name snip att date"; align-items: center; gap: 12px;
  width: 100%; min-height: 52px; padding: 10px 16px; background: none; border: 0; text-align: left; cursor: pointer; color: inherit; }
.ml-m-row:hover { background: var(--surface-2); }
.ml-m-row .ml-av { grid-area: av; }
.ml-m-rowname { grid-area: name; font-weight: 600; }
.ml-m-snip { grid-area: snip; color: var(--muted); }
.ml-m-att { grid-area: att; display: inline-flex; color: var(--muted); }
.ml-m-rowdate { grid-area: date; color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.ml-m.is-unread .ml-m-rowname, .ml-m.is-unread .ml-m-name b { font-weight: 750; }
.ml-m-older { display: flex; }
.ml-m-olderbtn { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 6px 16px; background: var(--surface-2); border: 0; text-align: left; cursor: pointer; color: var(--muted); font-weight: 560; }
.ml-m-olderbtn:hover { color: var(--text); }
.ml-m-oldern { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: 13px; }

.ml-m.is-open { padding: 14px 16px 16px; }
.ml-m-head { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 12px; align-items: start; }
.ml-m-who { min-width: 0; }
.ml-m-name { display: block; min-width: 0; overflow-wrap: anywhere; line-height: 1.35; padding-top: 2px; }
.ml-m-namebtn { padding: 2px 0 0; border: 0; background: none; text-align: left; cursor: pointer; color: inherit; font: inherit; }
.ml-m-addr { color: var(--muted); font-size: 13px; font-weight: 450; }
.ml-m-mdate { display: none; }
.ml-m-to { display: flex; align-items: center; gap: 2px; min-width: 0; color: var(--muted); font-size: 13px; }
.ml-m-detbtn { display: inline-grid; place-items: center; flex: none; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer; }
.ml-m-detbtn:hover { background: var(--surface-2); color: var(--text); }
.ml-m-detbtn svg { width: 14px; height: 14px; transform: rotate(90deg); }
.ml-m-detbtn[aria-expanded="true"] svg { transform: rotate(-90deg); }
.ml-m-side { display: flex; align-items: center; gap: 2px; }
.ml-m-date { margin-right: 6px; color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.ml-m-side .btn { min-width: 36px; min-height: 36px; justify-content: center; }
.ml-m-det { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 3px 10px; margin: 10px 0 0 44px; padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: var(--r-ctl); background: var(--surface-2); font-size: 13px; }
.ml-m-det dt { color: var(--muted); }
.ml-m-det dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.ml-m-body { margin: 12px 0 0 44px; }
.ml-m-text { font-size: 14.5px; }
.ml-m-dots { margin-top: 8px; min-width: 36px; min-height: 26px; padding: 0 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); color: var(--muted); font-weight: 700; line-height: 1; cursor: pointer; }
.ml-m-dots:hover { color: var(--text); }
.ml-m-quote { margin-top: 8px; padding-left: 12px; border-left: 2px solid var(--line); color: var(--muted); font-size: 13.5px; }
.ml-m-atts { margin: 14px 0 0 44px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.ml-atts { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.ml-att { display: flex; align-items: center; gap: 10px; width: 230px; max-width: 100%; min-height: 52px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--surface); color: inherit; text-decoration: none; }
.ml-att:hover { background: var(--surface-2); }
.ml-att-ic { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 6px; background: var(--surface-2); color: var(--muted); }
.ml-att-ic svg { width: 16px; height: 16px; }
.ml-att-main { display: flex; flex-direction: column; min-width: 0; }
.ml-att-name { font-weight: 560; }
.ml-att-meta { font-size: 12px; color: var(--muted); }

/* emails scheduled on this deal, under the conversation */
.ml-th-scheds { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ml-th-sched { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 14px; border: 1px dashed var(--line); border-radius: var(--r-card); background: var(--surface); }
.ml-th-sched.is-alert { border: 1px solid transparent; background: var(--warn-bg); }
.ml-th-sched.is-failed { background: var(--bad-bg); }
.ml-th-schedic { display: flex; color: var(--muted); }
.ml-th-schedic svg { width: 18px; height: 18px; }
.ml-th-sched.is-alert .ml-th-schedic { color: var(--warn); }
.ml-th-sched.is-failed .ml-th-schedic { color: var(--bad); }
.ml-th-schedmain { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.ml-th-schedwhy { font-size: 13px; }
.ml-th-schedacts { display: flex; flex-wrap: wrap; gap: 6px; }
.ml-th-schedacts .btn { min-height: 36px; }

.ml-th-reply { margin-top: 14px; }
.ml-th-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ml-th-actions .btn { min-height: 38px; padding: 8px 18px; border-radius: 999px; }
.ml-cmp-wait { height: 240px; border-radius: var(--r-card); }

/* ---------- composer: rows like Gmail, Send with an arrow for Schedule send ---------- */
.ml-cmp { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.ml-cmp-scroll { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.ml-cmp.is-inline { padding: 10px 16px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow); }
.ml-cmp-head { display: flex; align-items: center; gap: 8px; }
.ml-cmp-title { flex: 1; min-width: 0; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ml-cmp-head .btn { min-height: 36px; }
.ml-cmp-note { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.ml-cmp-nodeal { display: flex; gap: 8px; align-items: flex-start; margin: 8px 0; padding: 10px 12px; border-radius: var(--r-ctl); background: var(--warn-bg); }
.ml-cmp-nodeal > svg { width: 16px; height: 16px; flex: none; color: var(--warn); margin-top: 2px; }
.ml-cmp-nodeal-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.ml-cmp-nodeal-acts .btn { min-height: 36px; }
.ml-cmp-fields { display: flex; flex-direction: column; }
.ml-cmp-f { display: grid; grid-template-columns: 52px minmax(0, 1fr); align-items: center; gap: 6px; min-height: 40px; padding: 2px 0; border-bottom: 1px solid var(--line-soft); }
.ml-cmp-f > label, .ml-cmp-flabel { font-size: 13.5px; color: var(--muted); }
.ml-cmp-subjf { grid-template-columns: minmax(0, 1fr); }
.ml-cmp-fv { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; min-width: 0; }
.ml-cmp-fv .input, .ml-cmp-fv .select { flex: 1 1 200px; min-width: 0; min-height: 36px; padding: 6px 4px; border-color: transparent; background: transparent; }
.ml-cmp-fv .input:focus, .ml-cmp-fv .select:focus { outline-offset: -2px; }
.ml-cmp-fv .ml-hint { flex-basis: 100%; padding: 0 4px 4px; }
.ml-cmp-deal .ml-cmp-fv { flex-wrap: nowrap; gap: 8px; padding: 0 4px; }
.ml-cmp-tobtns { display: flex; gap: 0; }
.ml-cmp-tobtns .btn { min-height: 36px; padding: 5px 8px; color: var(--muted); }
.ml-cmp-tobtns .btn:hover { color: var(--text); }
.ml-cmp-pick { padding: 4px 0 6px; border-bottom: 1px solid var(--line-soft); }
.ml-cmp-dres { list-style: none; margin: 0 0 4px; padding: 0; }
.ml-cmp-dres:empty { display: none; }
.ml-cmp-dbtn { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 6px 8px; border: 0; border-radius: var(--r-ctl); background: none; text-align: left; cursor: pointer; color: inherit; }
.ml-cmp-dbtn:hover { background: var(--surface-2); }
.ml-cmp-dnone { padding: 6px 8px; font-size: 13px; }
.ml-cmp-body { min-height: 140px; padding: 10px 4px; border-color: transparent; background: transparent; line-height: 1.55; }
.ml-cmp-body:focus { outline-offset: -2px; }
.ml-cmp-tplnote { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 13px; color: var(--muted); }
.ml-cmp-tplnote .btn { min-height: 32px; }
.ml-cmp-warn { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.ml-cmp-warn:empty { display: none; }
.ml-cmp-warn li { display: flex; gap: 6px; align-items: flex-start; color: var(--warn); font-size: 13px; font-weight: 520; }
.ml-cmp-warn svg { width: 14px; height: 14px; flex: none; margin-top: 2px; }
.ml-cmp-sig { border: 1px solid var(--line-soft); border-radius: var(--r-ctl); padding: 0 12px; background: var(--surface-2); }
.ml-cmp-sig summary { cursor: pointer; padding: 9px 0; color: var(--muted); font-size: 13px; min-height: 36px; }
.ml-cmp-sig[open] { padding-bottom: 10px; }
.ml-cmp-sigtext { font-size: 13px; color: var(--muted); max-height: 160px; overflow: auto; }
.ml-cmp-sig p { margin: 0; font-size: 13px; }
.ml-cmp-err { margin: 0; padding: 10px 12px; border-radius: var(--r-ctl); background: var(--bad-bg); color: var(--bad); font-weight: 560; }
.ml-cmp-foot { display: flex; align-items: center; gap: 4px; padding-top: 4px; }
.ml-split { display: inline-flex; flex: none; margin-right: 6px; }
.ml-split .btn { min-height: 38px; }
.ml-split-main { padding: 8px 20px; border-radius: 999px 0 0 999px; }
.ml-split-more { min-width: 36px; justify-content: center; padding: 8px 10px 8px 8px; border-radius: 0 999px 999px 0; border-left-color: color-mix(in srgb, var(--plate-ink) 30%, var(--plate)); }
.ml-split-more svg { width: 16px; height: 16px; }
.ml-cmp-ic { min-width: 38px; min-height: 38px; justify-content: center; color: var(--muted); }
.ml-cmp-ic:hover { color: var(--text); }
.ml-cmp-ic svg { width: 18px; height: 18px; }
.ml-cmp-kbd { margin-left: 6px; }
.ml-cmp-trash { margin-left: auto; }

/* inside a floating window: fields on top, the text takes the room, the bar stays at the bottom */
.ml-cmp.is-float { flex: 1; gap: 0; }
.ml-cmp.is-float .ml-cmp-scroll { flex: 1; overflow-y: auto; padding: 0 16px 10px; gap: 8px; }
.ml-cmp.is-float .ml-cmp-body { flex: 1 0 160px; resize: none; }
.ml-cmp.is-float .ml-cmp-foot { padding: 10px 12px 12px 16px; border-top: 1px solid var(--line-soft); }
.ml-cmp.is-float .ml-cmp-kbd { display: none; }

/* ---------- floating New message windows, bottom right ---------- */
.ml-dock { position: fixed; right: 16px; bottom: 0; z-index: 65; display: flex; flex-direction: row-reverse; align-items: flex-end; gap: 12px; max-width: calc(100vw - 32px); pointer-events: none; }
.ml-win { pointer-events: auto; display: flex; flex-direction: column; width: 540px; max-width: calc(100vw - 32px); height: min(520px, calc(100vh - 72px)); overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-bottom: 0; border-radius: 10px 10px 0 0; box-shadow: var(--shadow-pop); }
.ml-win-bar { display: flex; align-items: center; gap: 2px; flex: none; min-height: 40px; padding: 2px 4px 2px 6px; background: var(--chrome); color: #fff; }
.ml-win-title { display: flex; align-items: center; flex: 1; min-width: 0; min-height: 36px; padding: 0 8px; border: 0; border-radius: 6px; background: none; color: inherit; font-weight: 600; text-align: left; cursor: pointer; }
.ml-win-btn { display: grid; place-items: center; flex: none; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 6px; background: none; color: #c4d0da; cursor: pointer; }
.ml-win-btn:hover, .ml-win-title:hover { background: #ffffff1a; color: #fff; }
.ml-win-btn svg { width: 16px; height: 16px; }
.ml-win-bar :focus-visible { outline-color: #fff; outline-offset: -2px; }
.ml-win-body { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.ml-win-body > .ml-cmp-wait { flex: 1; height: auto; margin: 16px; }
.ml-win.is-min { width: 280px; height: auto; }
.ml-win.is-min .ml-win-body { display: none; }
.ml-win.is-max { position: fixed; left: 50%; top: 5vh; transform: translateX(-50%); width: min(1040px, calc(100vw - 48px)); max-width: none; height: 90vh;
  border-bottom: 1px solid var(--line); border-radius: 10px; box-shadow: 0 0 0 100vmax rgba(10, 18, 25, .45), var(--shadow-pop); }

/* ---------- menus (Schedule send, templates) ---------- */
.ml-menu { z-index: 89; min-width: 270px; max-width: min(360px, calc(100vw - 16px)); }
.ml-menu-head { padding: 8px 10px 4px; font-size: 12.5px; font-weight: 560; color: var(--muted); }
.ml-menu button { justify-content: space-between; gap: 16px; min-height: 38px; }
.ml-menu-l { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ml-menu-sub { flex: none; font-size: 12.5px; color: var(--muted); }
.ml-menu-note { margin: 4px 10px 6px; font-size: 12px; line-height: 1.4; color: var(--muted); }

/* toast with Undo */
.ml-toast { display: flex; align-items: center; gap: 12px; }
.ml-toast-btn { min-height: 36px; padding: 0 10px; border: 0; border-radius: 6px; background: none; color: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.ml-toast-btn:hover { background: #ffffff1f; }

/* ---------- scheduled email panel ---------- */
.ml-sp { display: flex; flex-direction: column; gap: 14px; }
.ml-sp .ml-alert { margin: 0; }
.ml-sp-when { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 15px; }
.ml-sp-when svg { width: 18px; height: 18px; flex: none; color: var(--muted); }
.ml-sp-deal { align-self: flex-start; }
.ml-sp-from { margin: 0; font-size: 13px; }
.ml-sp .input { min-height: 36px; }
.ml-sp-body { min-height: 200px; line-height: 1.5; }
.ml-sp-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.ml-sp-acts .btn { min-height: 38px; }
.ml-sp-read { padding: 12px 14px; border: 1px solid var(--line-soft); border-radius: var(--r-ctl); background: var(--surface); }
.ml-sp-read p { margin: 0 0 8px; }

/* ---------- templates panel ---------- */
.ml-tm { display: flex; flex-direction: column; gap: 14px; }
.ml-tm-intro { margin: 0; }
.ml-tm .btn { min-height: 36px; }
.ml-tm-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-card); overflow: hidden; }
.ml-tm-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; }
.ml-tm-item + .ml-tm-item { border-top: 1px solid var(--line-soft); }
.ml-tm-main { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.ml-tm-title { overflow-wrap: anywhere; }
.ml-tm-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0 6px; font-size: 12.5px; color: var(--muted); }
.ml-tm-subj { overflow-wrap: anywhere; }
.ml-tm-prev { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.ml-tm-acts { display: flex; gap: 4px; flex: none; }
.ml-tm-acts .btn-icon { min-width: 36px; justify-content: center; }

/* ---------- Emails section in the deal drawer ---------- */
.ml-dl .dl-right .btn { min-height: 32px; }
.ml-dl-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line-soft); border-radius: var(--r-ctl); overflow: hidden; }
.ml-dl-item + .ml-dl-item { border-top: 1px solid var(--line-soft); }
.ml-dl-row { display: flex; flex-direction: column; gap: 2px; width: 100%; min-height: 52px; padding: 8px 12px; background: color-mix(in srgb, var(--surface-2) 75%, var(--surface)); border: 0; text-align: left; cursor: pointer; color: inherit; }
.ml-dl-item.is-unread .ml-dl-row { background: var(--surface); }
.ml-dl-row:hover { background: var(--surface-2); }
.ml-dl-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ml-dl-who { flex: 1; min-width: 0; font-weight: 560; }
.ml-dl-n { color: var(--muted); font-weight: 450; font-size: 12.5px; }
.ml-dl-att { display: inline-flex; color: var(--muted); }
.ml-dl-when { flex: none; font-size: 12.5px; color: var(--muted); }
.ml-dl-line { display: block; min-width: 0; }
.ml-dl-subj { color: var(--text); }
.ml-dl-prev { color: var(--muted); margin-left: 8px; }
.ml-dl-item.is-unread .ml-dl-who, .ml-dl-item.is-unread .ml-dl-subj { font-weight: 700; }
.ml-dl-item.is-unread .ml-dl-when { color: var(--text); font-weight: 650; }
.ml-dl-evlink { display: block; width: 100%; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; color: inherit; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; min-height: 24px; }
.ml-dl-evlink:hover { text-decoration-color: currentColor; }

/* ---------- Settings: Email ---------- */
.ml-st-boxes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ml-st-boxes li { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.ml-st-check { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.ml-st-check .btn { min-height: 36px; }
.ml-st-sigrow { max-width: 320px; }
.ml-st-sigrow .select { min-height: 36px; }
.ml-st-sig { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; min-height: 130px; }
.ml-st-prev { border: 1px solid var(--line-soft); border-radius: var(--r-ctl); background: var(--surface-2); padding: 10px 12px; }
.ml-st-prev .ml-text { font-size: 13px; margin-top: 4px; max-height: 180px; overflow: auto; }
.ml-st .btn { min-height: 36px; }
.ml-st-tbody { min-height: 200px; line-height: 1.5; }

/* ---------- narrower than 1100 px: folders in a row on top, Compose as a round button ---------- */
@media (max-width: 1099px) {
  .ml-shell { grid-template-columns: minmax(0, 1fr); }
  .ml-nav { position: static; margin-bottom: 12px; max-height: none; overflow: visible; padding-bottom: 0; }
  .ml-compose { display: none; }
  .ml-folders { flex-direction: row; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 1px; }
  .ml-f { flex: none; width: auto; gap: 8px; padding: 0 12px; border: 1px solid var(--line); background: var(--surface); }
  .ml-f:hover { background: var(--surface-2); }
  .ml-f.is-on { background: var(--ink); border-color: var(--ink); color: var(--surface); }
  .ml-f.is-on svg, .ml-f.is-on .ml-f-n { color: inherit; }
  .ml-f-sep { flex: none; width: 1px; height: auto; margin: 6px 2px; }
  .ml-fab { display: inline-flex; position: fixed; right: 20px; bottom: 24px; z-index: 25; min-height: 54px; padding: 0 22px 0 16px; border-radius: 16px; gap: 10px; font-size: 15px; box-shadow: var(--shadow-pop); }
  .ml-pane { padding-bottom: 64px; }
  .ml-shell.is-thread .ml-nav, .ml-shell.is-thread .ml-fab { display: none; }
  .ml-r { grid-template-columns: 36px 10px 130px auto minmax(0, 1fr) 16px 70px; }
  .ml-s { grid-template-columns: 10px 150px minmax(0, 1fr) auto; }
}

/* ---------- phone ---------- */
@media (max-width: 860px) {
  .ml-head .tools { margin-left: 0; width: 100%; }
  .ml-search { width: 100%; }
  .ml-keys, .ml-cmp-kbd, .ml-bar-btn [data-lbl] { display: none; }
  .ml-fab { right: 14px; bottom: calc(76px + env(safe-area-inset-bottom)); }

  /* two-line rows: people, label and date on top; subject and preview below. The whole row opens the conversation. */
  .ml-r { grid-template-columns: 36px 10px minmax(0, 1fr) auto minmax(0, max-content) auto; grid-template-areas: "cb biz who att deal end" "cb biz line line line line";
    row-gap: 3px; column-gap: 8px; min-height: 60px; padding: 8px 12px 8px 2px; }
  .ml-r-cb { align-self: center; }
  .ml-r-biz { align-self: start; padding-top: 5px; }
  .ml-r-deal { max-width: 120px; }
  .ml-r-chip { pointer-events: none; min-height: 0; }
  .ml-r-chip .chip, .ml-r-nodeal { font-size: 12px; padding: 1px 6px; }
  .ml-r-acts { display: none; }
  .ml-r.is-sel { box-shadow: none; }
  .ml-s { grid-template-columns: 10px minmax(0, 1fr) auto; grid-template-areas: "biz who end" "biz line line" "alert alert alert"; padding: 9px 12px; row-gap: 3px; }
  .ml-s-alert { margin: 6px 0 2px; }

  /* reading: full page with a bar on top */
  .ml-th-bar { position: sticky; top: 0; z-index: 25; margin: -16px -14px 10px; padding: 8px 10px; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line-soft); }
  .ml-th-mreply { display: inline-flex; }
  .ml-th-subj { font-size: 19px; }
  .ml-msgs { margin: 0 -14px; border-radius: 0; border-left: 0; border-right: 0; }
  .ml-m-row { grid-template-columns: 32px minmax(0, 1fr) auto auto; grid-template-areas: "av name att date" "av snip snip snip"; row-gap: 1px; padding: 10px 14px; }
  .ml-m-row .ml-av { align-self: start; }
  .ml-m.is-open { padding: 12px 14px 14px; }
  .ml-m-date { display: none; }
  .ml-m-mdate { display: block; float: right; margin-left: 8px; color: var(--muted); font-size: 12.5px; }
  .ml-m-det, .ml-m-body, .ml-m-atts { margin-left: 0; }
  .ml-att { width: 100%; }
  .ml-th-actions .btn { flex: 1 1 auto; justify-content: center; }

  /* the reply in the page opens full screen */
  .ml-cmp.is-inline { position: fixed; inset: 0; z-index: 66; overflow-y: auto; padding: 0 14px calc(12px + env(safe-area-inset-bottom)); border: 0; border-radius: 0; box-shadow: none; }
  .ml-cmp.is-inline .ml-cmp-head { position: sticky; top: 0; z-index: 1; margin: 0 -14px; padding: 10px 10px 10px 14px; background: var(--surface); border-bottom: 1px solid var(--line-soft); }
  .ml-cmp.is-inline .ml-cmp-foot { position: sticky; bottom: 0; margin: 0 -14px; padding: 8px 14px; background: var(--surface); border-top: 1px solid var(--line-soft); }
  .ml-cmp-f { grid-template-columns: 46px minmax(0, 1fr); }
  .ml-cmp-subjf { grid-template-columns: minmax(0, 1fr); }

  /* windows: full screen; minimised ones sit above the tab bar */
  .ml-dock { left: 0; right: 0; bottom: calc(64px + env(safe-area-inset-bottom)); max-width: none; padding: 0 8px; gap: 8px; }
  .ml-win:not(.is-min) { position: fixed; inset: 0; z-index: 66; width: auto; max-width: none; height: auto; border: 0; border-radius: 0; box-shadow: none; transform: none; }
  .ml-win:not(.is-min) .ml-win-bar { padding-top: calc(2px + env(safe-area-inset-top)); }
  .ml-win.is-min { flex: 0 1 260px; width: auto; border-radius: 10px; border-bottom: 1px solid var(--line); }
  .ml-win-maxbtn { display: none; }
  .ml-cmp.is-float .ml-cmp-foot { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
}

/* attachments in the composer */
.ml-cmp-atts { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.ml-cmp-atts:empty { display: none; }
.ml-cmp-att { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 3px 4px 3px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); font-size: 13px; }
.ml-cmp-att svg { width: 14px; height: 14px; flex: none; }
.ml-cmp-att .btn-icon { width: 26px; height: 26px; }

/* attachment templates (Greg, 07/11/2026) */
.ml-tm-sec { display: flex; flex-direction: column; gap: 10px; }
.ml-tm-sec + .ml-tm-sec { padding-top: 14px; border-top: 1px solid var(--line-soft); }
.ml-tm-sec h3 { margin: 0; font-size: 15px; }
.ml-tm-fname { all: unset; cursor: pointer; font-weight: 600; overflow-wrap: anywhere; }
.ml-tm-fname:hover { text-decoration: underline; }
.ml-tm-fname:focus-visible { outline: 2px solid var(--focus, currentColor); outline-offset: 2px; }
.ml-tm-meta svg { width: 13px; height: 13px; vertical-align: -2px; margin-right: 2px; }
.ml-t-atts { list-style: none; margin: 4px 0 8px; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.ml-t-att { display: flex; align-items: center; gap: 8px; min-height: 32px; cursor: pointer; }
.ml-t-att .clip { flex: 1; min-width: 0; }

/* Trash and Spam (Greg, 07/11/2026) */
.ml-bin-read .ml-text { white-space: pre-wrap; max-height: 55vh; overflow: auto; padding: 12px; border: 1px solid var(--line-soft); border-radius: var(--r-ctl); background: var(--surface-2); }

/* Gmail-like rows (Greg, 07/11/2026, from a Gmail screenshot): box, star, mailbox dot, sender, "subject - preview", date */
.ml-r { grid-template-columns: 36px 32px 10px 190px minmax(0, 1fr) 16px 84px; grid-template-areas: "cb star biz who line att end"; column-gap: 8px; min-height: 40px; }
.ml-r-star { grid-area: star; position: relative; z-index: 1; display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--faint); cursor: pointer; }
.ml-r-star svg { width: 18px; height: 18px; }
.ml-r-star:hover { background: color-mix(in srgb, var(--text) 7%, transparent); color: var(--muted); }
.ml-r-star.on { color: #e6b400; }
.ml-r-star.on svg { stroke: #a37f00; }
.ml-r-prev { margin-left: 0; }
.ml-bar-selm { min-width: 24px !important; margin-left: -6px; }
.ml-bar-selm svg { width: 14px; height: 14px; }
@media (max-width: 1180px) and (min-width: 861px) { .ml-r { grid-template-columns: 36px 32px 10px 140px minmax(0, 1fr) 16px 70px; } }
@media (max-width: 860px) {
  .ml-r { grid-template-columns: 36px 10px minmax(0, 1fr) auto auto 32px; grid-template-areas: "cb biz who att end star" "cb biz line line line star"; }
}


/* visual editor (rich.js) and signatures, like Gmail (Greg, 07/11/2026) */
.rt { border: 1px solid var(--line); border-radius: var(--r-ctl); background: #fff; overflow: hidden; }
.rt-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 1px; padding: 3px 4px; border-bottom: 1px solid var(--line-soft); background: var(--surface-2); }
.rt-b { display: inline-grid; place-items: center; width: 30px; height: 28px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer; }
.rt-b:hover { background: color-mix(in srgb, var(--text) 8%, transparent); color: var(--text); }
.rt-b svg { width: 17px; height: 17px; }
.rt-sep { width: 1px; height: 18px; margin: 0 4px; background: var(--line); }
.rt-area { display: block; width: 100%; min-height: 120px; border: 0; background: #fff; }
.rt-sw { display: inline-block; width: 14px; height: 14px; border-radius: 3px; margin-right: 8px; vertical-align: -2px; }
.rt-prev { display: block; width: 100%; border: 0; background: transparent; min-height: 20px; }
.ml-sg-card { padding: 12px 14px; border: 1px solid var(--line-soft); border-radius: var(--r-card); background: #fff; }
.ml-sg-def { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 8px 12px; align-items: center; }
.ml-sg-def .label { font-size: 12px; }
.ml-cmp-sigbox { margin-top: 6px; padding: 8px 10px; border-top: 1px dashed var(--line); }
.ml-cmp-sighead { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.ml-cmp-sighead .btn { min-height: 28px; }
@media (max-width: 700px) { .ml-sg-def { grid-template-columns: 1fr; } }
.ml-draft { color: var(--bad); font-weight: 600; margin-right: 4px; }
.ml-sug { z-index: 89; max-width: 420px; }
.ml-sug button { flex-direction: column; align-items: flex-start; gap: 0; }
.ml-sug button .muted { font-size: 12px; }
.ml-sug button.is-on { background: var(--surface-2); }
/* the message editor inside the composer */
.ml-cmp-body { min-height: 0; padding: 6px 0 0; border: 0; background: none; }
.ml-cmp-body .rt { border-color: var(--line-soft); }
.ml-cmp.is-float .ml-cmp-body { flex: 1 0 auto; }

/* supplier mailbox (12/11/2026): its own group in the folder column, the customer chip on the row, the link line in a conversation */
.ml-f-group { display: grid; }
.ml-f-h { display: block; padding: 6px 14px 4px; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.ml-f-note { display: block; padding: 0 14px 4px; font-size: 12.5px; color: var(--muted); }
.ml-r-cust { margin-right: 8px; }
.ml-r-cust .chip { display: inline-block; max-width: 180px; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.ml-th-why { font-size: 12.5px; }

/* email lock (Greg, 12/11/2026): second password for emails, until midnight UK time */
.ml-lockbox { margin-top: 12px; }
.ml-lockbtn { width: auto; }
.ml-locked { max-width: 440px; margin: 48px auto; text-align: center; display: grid; gap: 12px; justify-items: center; }
.ml-locked h1 { margin: 0; font-size: 22px; }
.ml-locked p { margin: 0; }
.ml-locked-ic svg { width: 36px; height: 36px; }
.ml-locked-form { display: flex; gap: 8px; width: 100%; }
.ml-locked-form .input { flex: 1; min-width: 0; }
.ml-locked-err:empty { display: none; }
.dl-none svg { width: 14px; height: 14px; vertical-align: -2px; }

/* narrow window: the supplier folders stay in the same row as the others (they were stacked and stretched every folder into a tall oval) */
@media (max-width: 1099px) {
  .ml-folders { align-items: center; }
  .ml-f-group { display: flex; flex: none; align-items: center; gap: 6px; }
  .ml-f-group .ml-f-h, .ml-f-group .ml-f-note { margin: 0; padding: 0 2px; white-space: nowrap; }
  .ml-folders .ml-f-sep { align-self: stretch; }
}

/* right-click menu on emails, like Gmail (Greg, 25/11/2026) */
.menu.ml-ctx { min-width: 260px; max-width: min(360px, calc(100vw - 16px)); max-height: calc(100vh - 16px); padding: 6px; }
.menu.ml-ctx .menu-title { padding: 6px 10px 8px; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-bottom: 1px solid var(--line-soft); margin-bottom: 4px; }
.menu.ml-ctx button { padding: 6px 10px; gap: 10px; min-height: 32px; font-size: 14px; }
.menu.ml-ctx button:focus-visible { background: var(--surface-2); outline-offset: -2px; }
.menu.ml-ctx hr { margin: 4px 0; }
.ml-ctx-ic { display: inline-flex; width: 17px; flex: none; justify-content: center; color: var(--muted); }
.ml-ctx-ic svg { width: 17px; height: 17px; }
.menu.ml-ctx .danger .ml-ctx-ic { color: inherit; }
.ml-ctx-t { display: grid; flex: 1; min-width: 0; line-height: 1.3; }
.ml-ctx-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ml-ctx-k { font: inherit; font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; flex: none; }
@media (max-width: 640px) { .menu.ml-ctx button { min-height: 40px; } }
