/* messages.css - Messages (105): the inbox (To do-style rows), bubbles like texting, the people picker, the announcement form, the
   Must read lock, a department tablet's Announcements. Tokens only (styles.css); mine = the brand's red fill under white text, theirs =
   the second surface; no blue. Sizes in rem, 44 px targets, inputs at 16 px or more, dark mode through the tokens. */

.mg { display: grid; gap: 4px; }
.mg-acts { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 10px; margin: 0 0 6px; }
.mg-acts .btn.big { width: auto; text-decoration: none; }
.mg-acts .btn svg, .mg-send svg, .mg-cam svg, .mg-ph svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mg-h { font-size: var(--fs-xl); margin: 18px 0 8px; }   /* review 2 C2: the one in-page section heading (ux.css .ux-box > h2) */
.mg-sub { margin: 0 0 8px; color: var(--muted); font-size: var(--fs-md); }
.mg-mk { margin: 14px 0; } .mg-mk a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; }

/* ---- the list rows (conversations, people): the name, one small line, the time / count on the right ---------------------------- */
.mg-list, .mg-plist, .mg-anns, .mg-whos { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.mg-row, .mg-p { display: grid; grid-template-columns: 2.75rem minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; width: 100%; min-height: 4.25rem; padding: 10px 14px; border: 1px solid var(--line); border-radius: 16px;
  background: var(--surface); color: var(--ink); text-decoration: none; text-align: left; cursor: pointer; font: inherit; box-shadow: var(--shadow); -webkit-tap-highlight-color: transparent; }
.mg-p { box-shadow: none; min-height: 3.75rem; }
/* 2026-10-27: a person row with no avatar (Tasks' Who has it) - the name was squeezed into the avatar's 2.75rem column */
.mg-p:not(:has(> .mg-av)) { grid-template-columns: minmax(0, 1fr) auto; }
@media (hover: hover) { .mg-row:hover, .mg-p:hover, .mg-ann:hover { border-color: var(--line-strong); } }
.mg-row:active, .mg-p:active { transform: scale(.99); }
.mg-row.unread { border-left: 5px solid var(--ink); }   /* review 2 C3: red is for late / worse; unread = ink edge + bold + the count */
.mg-row.unread .mg-main b { font-weight: 800; }
.mg-av { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 50%; background: var(--surface-2); color: var(--ink); font-weight: 800; font-size: var(--fs-md); letter-spacing: .02em; }
.mg-av.grp svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mg-main { min-width: 0; display: grid; gap: 2px; }
.mg-main b { font-size: var(--fs-lg); line-height: 1.25; overflow-wrap: anywhere; }
.mg-main small { font-size: var(--fs-md); color: var(--muted); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.mg-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.mg-side { display: grid; justify-items: end; gap: 4px; }
.mg-side small { font-size: var(--fs-sm); color: var(--muted); white-space: nowrap; }
.mg-un { min-width: 1.5rem; height: 1.5rem; padding: 0 7px; border-radius: 99px; background: var(--red-btn); color: var(--red-ink); font-size: var(--fs-sm); font-weight: 800; line-height: 1.5rem; text-align: center; }
.mg-p.on { border-color: var(--red); background: var(--red-soft); }
.mg-p.tok .mg-main b { font-weight: 800; }
.mg-check { width: 1.75rem; height: 1.75rem; border-radius: 50%; border: 2px solid var(--line-strong); display: grid; place-items: center; font-weight: 800; color: var(--bg); }
.mg-p.on .mg-check { background: var(--red-btn); border-color: var(--red-btn); color: var(--red-ink); }
.mg-q { width: 100%; min-height: 48px; font-size: var(--fs-lg); padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); }
.mg-to { margin: 10px 0 4px; font-size: var(--fs-md); color: var(--muted); }
.mg-to b { color: var(--ink); }

/* ---- announcements: a pinned card each, Must read first ---------------------------------------------------------------------- */
.mg-ann { display: grid; gap: 4px; width: 100%; text-align: left; padding: 12px 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; min-height: 56px; box-shadow: var(--shadow); }
.mg-ann.must { border-left: 5px solid var(--bad); }
.mg-ann.new { border-left: 5px solid var(--ink); }
.mg-ann b { font-size: var(--fs-lg); }
.mg-ann-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; }
.mg-ann-top small { color: var(--muted); font-size: var(--fs-sm); margin-left: auto; }
.mg-ann-b { color: var(--muted); font-size: var(--fs-md); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mg-ann-n { font-weight: 700; color: var(--red); font-size: var(--fs-md); }
.mg-ann-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: var(--fs-lg); line-height: 1.45; margin: 6px 0 10px; }
.mg-big-n { font-size: var(--fs-lg); margin: 4px 0 8px; } .mg-big-n b { font-family: var(--display); font-size: var(--fs-hero); }
.mg-who { display: flex; justify-content: space-between; gap: 10px; align-items: center; min-height: 48px; padding: 6px 2px; border-bottom: 1px solid var(--line); }
.mg-who small { display: block; color: var(--muted); font-size: var(--fs-md); }
.mg-when { color: var(--muted); font-size: var(--fs-md); white-space: nowrap; }
.mg-sheet h3 small { color: var(--muted); font-weight: 600; }

/* ---- one conversation: bubbles ------------------------------------------------------------------------------------------- */
.mg-conv { display: grid; }
.mg-bubbles { display: grid; gap: 2px; padding: 4px 0 12px; }
.mg-day { justify-self: center; margin: 12px 0 6px; font-size: var(--fs-sm); font-weight: 700; color: var(--muted); }
.mg-sys { justify-self: center; text-align: center; max-width: 90%; margin: 6px 0; padding: 6px 12px; border-radius: 99px; background: var(--surface-2); color: var(--muted); font-size: var(--fs-md); overflow-wrap: anywhere; }
.mg-msg { display: grid; max-width: min(80%, 34rem); }
.mg-msg.start { margin-top: 6px; }
.mg-msg.mine { justify-self: end; justify-items: end; }
.mg-msg.theirs { justify-self: start; justify-items: start; }
.mg-name { font-size: var(--fs-sm); font-weight: 700; color: var(--muted); margin: 0 12px 2px; }
.mg-b { padding: 9px 14px; border-radius: 16px; font-size: var(--fs-lg); line-height: 1.35; min-height: 44px; display: grid; align-content: center; gap: 6px; cursor: default; user-select: text; -webkit-touch-callout: none; overflow-wrap: anywhere; }
.mg-msg.mine .mg-b { background: var(--red-btn); color: var(--red-ink); border-bottom-right-radius: 6px; }
.mg-msg.theirs .mg-b { background: var(--surface-2); color: var(--ink); border-bottom-left-radius: 6px; }
.mg-b.del { background: none !important; color: var(--muted) !important; border: 1px dashed var(--line-strong); }
.mg-b:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }
/* S8: on a touch screen a long press is the app's menu, not text selection (Copy is in that menu); ⋯ is the tap way to it */
@media (pointer: coarse) { .mg-b { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; } }
.mg-line { display: flex; align-items: center; gap: 2px; }
.mg-msg.mine .mg-line { justify-content: flex-end; }
.mg-line .mg-b { min-width: 0; }
.mg-dots { flex: none; width: 44px; height: 44px; border: 0; background: none; color: var(--muted); font-size: var(--fs-xl); line-height: 1; border-radius: 50%; cursor: pointer; }
.mg-dots:focus-visible { outline: 3px solid var(--red); }
@media (hover: hover) { .mg-dots:hover { background: var(--surface-2); color: var(--ink); } }
/* review 2 C6: on a computer the ⋯ shows on hover or focus (it keeps its 44 px place); on a touch screen it is always there */
@media (hover: hover) and (pointer: fine) { .mg-dots { opacity: 0; } .mg-msg:hover .mg-dots, .mg-msg:focus-within .mg-dots, .mg-dots:focus-visible { opacity: 1; } }
.mg-cut { margin: 6px 2px 0; color: var(--muted); font-size: var(--fs-md); font-weight: 700; list-style: none; }
.mg-t { white-space: pre-wrap; }
.mg-time { font-size: var(--fs-xs); color: var(--muted); margin: 2px 10px 0; }
.mg-rc { font-size: var(--fs-sm); color: var(--muted); margin: 0 8px; font-weight: 700; }
button.mg-rc { min-height: 44px; padding: 0 6px; color: var(--red); }
.mg-older { justify-self: center; margin: 0 0 8px; }
.mg-photos { display: flex; flex-wrap: wrap; gap: 6px; }
.mg-ph { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; min-width: 44px; padding: 6px 12px; border-radius: var(--radius); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; }
.mg-ph.got { padding: 0; border: 0; background: none; overflow: hidden; }
.mg-ph img { display: block; max-width: 14rem; max-height: 14rem; border-radius: var(--radius); }
.mg-ph-demo { display: inline-flex; align-items: center; gap: 6px; padding: 18px 22px; border-radius: var(--radius); background: var(--surface); color: var(--muted); border: 1px dashed var(--line-strong); }
.mg-ph-demo svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; }
img.mg-big { width: 100%; height: auto; border-radius: var(--radius); }
.mg-claim { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 10px 14px; margin: 0 0 8px; border-radius: var(--radius); background: var(--warn-soft); color: var(--ink); border-left: 5px solid var(--warn); }
.mg-claim small { display: block; color: var(--muted); font-size: var(--fs-md); }
.mg-claim.got { background: var(--good-soft); border-left-color: var(--good); justify-content: flex-start; }
.mg-claim.got svg { width: 20px; height: 20px; fill: none; stroke: var(--good); stroke-width: 2; }
.mg-claim .btn { min-height: 48px; }
.mg-quote { padding: 10px 14px; border-radius: var(--radius); background: var(--surface-2); white-space: pre-wrap; overflow-wrap: anywhere; margin: 4px 0 8px; }
.mg-ctx .mg-msg { max-width: 100%; }
.mg-ctx .mg-msg.rep .mg-b { outline: 3px solid var(--bad); }

/* ---- the composer: stays at the bottom, above the phone's tab bar -------------------------------------------------------------- */
.mg-compose { position: sticky; bottom: 0; z-index: 5; background: var(--bg); padding: 8px 0 10px; border-top: 1px solid var(--line); margin-top: 6px; }
@media (max-width: 899px) { .mg-compose { bottom: calc(var(--tabbar) + env(safe-area-inset-bottom, 0px)); } }
.mg-row-in { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 8px; align-items: end; }
.mg-row-in textarea { width: 100%; min-height: 48px; max-height: 180px; resize: none; font-size: var(--fs-lg); line-height: 1.35; padding: 11px 14px; border: 1px solid var(--line-strong); border-radius: 99px; background: var(--surface); }
.mg-cam { display: grid; place-items: center; width: 44px; height: 48px; border-radius: 50%; color: var(--ink); cursor: pointer; }
.mg-cam:focus-within, .mg-file:focus-visible + .mg-cam { outline: 3px solid var(--red); }
.mg-file { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.mg-send { min-height: 48px; border-radius: 99px; padding: 0 16px; }
@media (max-width: 420px) { .mg-send span { display: none; } .mg-send { width: 48px; padding: 0; } }
.mg-pend { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px 52px; }
.mg-pp { position: relative; width: 64px; height: 64px; border-radius: 8px; overflow: hidden; background: var(--surface-2); }
.mg-pp img { width: 100%; height: 100%; object-fit: cover; }
.mg-pp.up img { opacity: .5; } .mg-pp.err { outline: 2px solid var(--bad); }
.mg-pp button { position: absolute; top: 0; right: 0; width: 28px; height: 28px; border: 0; border-radius: 0 0 0 8px; background: var(--ink); color: var(--bg); font-weight: 800; cursor: pointer; }
.mg-pp button::after { content: ""; position: absolute; inset: -8px; }

/* ---- the escalation sheet: two big buttons, each with the names it reaches ---------------------------------------------------- */
.mg-esc .btn.big { display: grid; justify-items: start; text-align: left; white-space: normal; min-height: 72px; }
.mg-esc .btn.big b { display: block; font-size: var(--fs-lg); }
.mg-esc .btn.big small { display: block; font-weight: 500; font-size: var(--fs-md); opacity: .9; }
.mg-steps { margin: 6px 0 12px; padding-left: 1.4rem; display: grid; gap: 10px; font-size: var(--fs-lg); }
.mg-steps span { display: block; color: var(--muted); font-size: var(--fs-md); }

/* ---- the announcement form ------------------------------------------------------------------------------------------------ */
.mg-annf input:not([type=checkbox]):not([type=file]), .mg-annf textarea, .mg-pick input#mggname { width: 100%; min-height: 48px; font-size: var(--fs-lg); padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); }
.mg-annf .tk-lbl small, .mg-annf span.tk-lbl small { font-weight: 500; color: var(--muted); }
/* review 2 C1: the pick-several chips are ux.css .ux-chips (one look with the repeat chooser and the Overview) */
.mg-annf .tk-tog { margin-top: 10px; }
.mg-must:has(input:checked) { border-color: var(--bad) !important; }   /* review 2 C7: red only while it is on */
.mg-save { position: sticky; bottom: calc(var(--tabbar) + env(safe-area-inset-bottom, 0px)); background: var(--bg); padding: 6px 0; }
@media (min-width: 900px) { .mg-save { bottom: 0; } }

/* ---- Must read: full screen over everything until Got it ------------------------------------------------------------------- */
body.mr-on { overflow: hidden; }
.mr-lock { position: fixed; inset: 0; z-index: 2000; background: var(--bg); overflow-y: auto; padding: calc(18px + env(safe-area-inset-top, 0px)) var(--gutter) calc(18px + env(safe-area-inset-bottom, 0px)); display: grid; align-content: start; justify-items: center; }
.mr-lock::before { content: ""; position: fixed; top: 0; left: 0; right: 0; height: 4px; background: var(--dots); }
.mr-card { width: 100%; max-width: 40rem; display: grid; gap: 10px; padding-top: 12px; }
.mr-pill { display: flex; align-items: center; gap: 10px; margin: 0; }
.mr-pill .pill { font-size: var(--fs-md); padding: 4px 12px; }
.mr-more { color: var(--muted); font-size: var(--fs-md); }
.mr-card h1 { font-size: var(--fs-hero); line-height: 1.15; margin: 4px 0 0; overflow-wrap: anywhere; }
.mr-from { margin: 0; color: var(--muted); }
.mr-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: var(--fs-xl); line-height: 1.5; }
.mr-ok { margin-top: 12px; min-height: 64px; font-size: var(--fs-xl); }

/* ---- a department tablet's Announcements ----------------------------------------------------------------------------------- */
.mg-tann { padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.mg-tann.must { border-left: 5px solid var(--bad); }
.mg-tann h2 { margin: 6px 0 4px; font-size: var(--fs-xl); }
.mg-left { margin: 6px 0 8px; font-size: var(--fs-lg); } .mg-left b { color: var(--bad); font-size: var(--fs-xl); } .mg-left.good { color: var(--good); font-weight: 700; }
.tb-names { display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: 10px; margin: 8px 0; }
.tb-names .btn.big { min-height: 64px; font-size: var(--fs-xl); }
@media print { .mg-compose, .mg-acts { display: none; } }
/* S3: a closed group (the minors' rule) is read-only */
.mg-closed { margin: 12px 0 0; padding: 12px 14px; border-radius: var(--radius); background: var(--surface-2); color: var(--muted); font-size: var(--fs-md); }
/* review 2 C8: the announcement form and the pickers stop at 40rem at 1280, like the task forms */
.mg-annf, .mg-pick { max-width: 40rem; }

/* ---- 116: Ask Charley pinned first in the inbox (askcharley.css draws its thread) ------------------------------------------------ */
.ac-pinned { margin: 0 0 8px; }
.mg-av.ac-av { background: var(--red-btn); color: var(--red-ink); font-family: var(--display); font-size: var(--fs-lg); }
/* 256: announcements waiting for a store manager's OK */
.mg-askbox { margin: 0 0 14px; }
.mg-needok { color: var(--warn); }
