/* CycleWright ERP - Email part 3 (round 24): send later, undo send, follow-up reminders (maillater.js). Light and dark
   through the theme's variables; on a phone: 44 px targets, 16 px inputs, the menus as bottom sheets. */

/* the Send button and its arrow, one piece */
.mcw-send:has(+ .mcw-later) { border-top-right-radius: 0; border-bottom-right-radius: 0; min-width: 88px; }
.mcw-later { width: 34px; padding: 0; justify-content: center; margin-left: -6px; border-top-left-radius: 0; border-bottom-left-radius: 0;
  border-left: 1px solid rgba(255, 255, 255, .35); }

/* in the compose window: "Scheduled for ..." and "Remind me if nobody answers" */
.ml-cbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 8px; padding: 7px 10px; border-radius: 8px;
  background: var(--accent-soft); border: 1px solid var(--border); font-size: 13px; }
.ml-cbar[hidden] { display: none; }
.ml-cbar-t { display: flex; align-items: center; gap: 6px; flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; }
.ml-cbar-t svg { color: var(--accent); flex: none; }
.ml-cbar-t.bad, .ml-cbar-t.bad svg { color: var(--bad); }
.ml-cbar-b { display: flex; gap: 6px; flex-wrap: wrap; }
.mlf-compose { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 0 0 8px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.mlf-compose svg { color: var(--text-3); }
.mlf-compose .mlf-days { width: 54px; height: 28px; padding: 0 6px; text-align: center; }

/* the toasts' countdown */
.ml-count { font-variant-numeric: tabular-nums; }

/* the Scheduled and Follow up lists */
.ml-sched, .mlf-list { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.ml-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ml-head h2 { margin: 0; font-size: 18px; }
.ml-head .spacer { flex: 1; }
.ml-group { display: flex; flex-direction: column; gap: 8px; }
.ml-group-h { font-size: 11px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.ml-group.bad .ml-group-h { color: var(--bad); }
.ml-item { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r, 10px);
  background: var(--surface); }
.ml-item.failed, .ml-item.over { border-left: 4px solid var(--bad); }
.ml-item.closed { opacity: .75; }
.ml-item-main { flex: 1; min-width: 0; cursor: default; }
.ml-sched .ml-item-main { cursor: pointer; }
.ml-item-top { display: flex; align-items: baseline; gap: 10px; }
.ml-to, .mlf-subj { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; text-align: left; }
.mlf-subj.link { font-weight: 650; padding: 0; }
.ml-when { display: inline-flex; align-items: center; gap: 5px; flex: none; font-size: 13px; color: var(--text-2); }
.ml-when.bad { color: var(--bad); font-weight: 650; }
.ml-subj { margin-top: 2px; overflow-wrap: anywhere; }
.ml-snip { margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ml-err { margin-top: 6px; padding: 6px 8px; border-radius: 6px; background: var(--bad-soft); color: var(--bad); font-size: 13px; overflow-wrap: anywhere; }
.ml-err.soft { background: var(--warn-soft); color: var(--text); }
.mlf-note { margin-top: 4px; color: var(--text-2); overflow-wrap: anywhere; }
.ml-acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; max-width: 52%; }
.ml-dialog { min-height: 120px; }

/* the row's flag chip */
.mlf-chip { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 999px; font-size: 11.5px;
  white-space: nowrap; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); }
.mlf-chip svg { color: var(--accent); }
.mlf-chip.over { background: var(--bad-soft); border-color: transparent; color: var(--bad); }
.mlf-chip.over svg { color: var(--bad); }

/* the follow-up notice (calendar.css's .cal-rem look, its own place) */
.mlf-rem { border-left-color: var(--warn); }
.mlf-rem .cal-rem-h svg { color: var(--warn); }

.ml-pick-in { width: 100%; }
.ml-pick-words { min-height: 18px; margin-top: 4px; }

@media (max-width: 760px) {
  .ml-item { flex-direction: column; gap: 8px; }
  .ml-acts { max-width: none; justify-content: flex-start; }
  .ml-acts button, .ml-cbar-b button, .mlf-compose { min-height: 44px; }
  .mlf-compose .mlf-days { height: 40px; font-size: 16px; }
  .mlf-compose .mlf-cb { width: 22px; height: 22px; }
  .ml-pick-in { font-size: 16px; min-height: 44px; }
  .mcw-later { width: 44px; }
  .ml-head .ghost { min-height: 44px; }
  .mlf-subj.link { min-height: 44px; }
  /* the menus: a bottom sheet */
  .mail-menu.ml-menu { left: 0 !important; right: 0; top: auto !important; bottom: 0; max-width: none; width: 100%; max-height: 70vh;
    border-radius: 14px 14px 0 0; padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); }
  .mail-menu.ml-menu button { height: 48px; }
}
@media print { .mlf-rem, .ml-cbar, .mlf-compose { display: none !important; } }
