:root {
  --bg: #ffffff; --fg: #1d1d1f; --muted: #6e6e73; --line: #e5e5ea; --panel: #f5f5f7;
  --accent: #0a66d8; --err: #c4281c; --mine: #eef4ff; --ask: #c25e00; --ok: #2e7d32;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #121214; --fg: #ececf0; --muted: #9a9aa2; --line: #2c2c31; --panel: #1c1c20;
          --accent: #5aa2ff; --err: #ff6b5e; --mine: #1a2433;
          --ask: #b85a00; --ok: #2e7d32; }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
/* The document never scrolls (only #log does): with the keyboard up, iOS pans the visual viewport and blurs
   whatever slides under the status bar. app.js pins body to the visual viewport (height + translateY). */
html { overflow: hidden; background: var(--panel); }
/* Bar 43 h: the page never pinch-zooms; only the picture viewer does (its own touch handling) */
body { background: var(--bg); color: var(--fg); font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
       display: flex; flex-direction: column; position: fixed; top: 0; left: 0; right: 0; overflow: hidden;
       height: 100vh; height: 100dvh; }   /* v13c: the size with the keyboard down; fitViewport pins it only while typing */
header { display: flex; align-items: center; gap: 5px; padding: 8px max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left));
         padding-top: max(8px, env(safe-area-inset-top));
         border-bottom: 1px solid var(--line); background: var(--panel);
         position: sticky; top: 0; z-index: 2; }   /* iOS 26 blurs the top unless an opaque fixed/sticky bar covers it */
#chunread { font: inherit; font-size: 12px; font-weight: 700; color: var(--bg); background: var(--accent); border: 0; border-radius: 9px; padding: 1px 7px; white-space: nowrap;
            max-width: 22vw; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
#chunread:empty { display: none; }
header select { font: inherit; font-weight: 600; background: transparent; color: var(--fg); border: 0; padding: 4px 0;
                width: auto; max-width: 26vw; text-overflow: ellipsis; flex-shrink: 0; }
/* 390 px phones: the needs button and the name give way first (ellipsis); switcher, marker and bell stay */
#asksbtn { white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; flex-shrink: 1; }
#bellbtn { flex-shrink: 0; }
#chunread { flex-shrink: 1; min-width: 3.2em; }
#asksbtn { flex-shrink: 0; }   /* v14: the owner's open-question count never gives way; only the pill does */   /* v14: 🔍 + 🧵 joined the header; the pill gives way (ellipsis) */
#status { color: var(--muted); font-size: 13px; flex: 1; }
#me { flex-shrink: 0; display: inline-flex; margin-left: auto; }   /* v25b: the avatar is always at the bar's right edge */
main { flex: 1; overflow-y: auto; padding: 8px max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left));
       -webkit-overflow-scrolling: touch; overscroll-behavior: contain; overflow-anchor: none; }   /* v19: app.js keeps the place */
.start { text-align: center; color: var(--muted); font-size: 12px; margin: 8px 0 4px; }   /* v19 Bar 58: first message shown */
.day { text-align: center; color: var(--muted); font-size: 12px; margin: 12px 0 4px; }
/* One message group per sender: the sender line is the strongest thing in it. */
.msg { padding: 8px 8px 6px; border-radius: 8px; margin: 10px 0 0; border-top: 1px solid var(--line);
       min-width: 0; max-width: 100%; overflow-wrap: anywhere; }   /* long unbroken text never widens the page */
.msg.cont { margin-top: 0; border-top: 0; padding-top: 2px; }
.day + .msg { border-top: 0; }
.msg.mine { background: var(--mine); }
.meta { display: flex; align-items: center; flex-wrap: wrap; gap: 0 6px; margin-bottom: 2px; }
.avatar { flex: none; width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center;
          justify-content: center; font-size: 13px; font-weight: 700; background: var(--mc); color: var(--on-mc); }
.who { font-weight: 700; font-size: 16px; color: var(--mc); }
.time { font-size: 12px; color: var(--muted); }
.role { font-size: 11px; font-weight: 600; color: var(--muted); border: 1px solid var(--line); border-radius: 8px; padding: 0 6px; }
.msg.cont > .meta { display: none; }
.msg.cont.hasbadge > .meta { display: flex; }
.at { font-weight: 600; color: var(--mc); }
/* Member colours (by member id). Never red: red is for errors. Contrast >= 4.5:1 on the page background. */
.c0 { --mc: #0b5cad; } .c1 { --mc: #1b7a3a; } .c2 { --mc: #6a3fb5; } .c3 { --mc: #0e7280; }
.c4 { --mc: #9a5200; } .c5 { --mc: #a3288f; } .c6 { --mc: #3949ab; } .c7 { --mc: #5f6b00; }
.c0, .c1, .c2, .c3, .c4, .c5, .c6, .c7 { --on-mc: #ffffff; }
@media (prefers-color-scheme: dark) {
  .c0 { --mc: #6fb2ff; } .c1 { --mc: #5fd08a; } .c2 { --mc: #b79aff; } .c3 { --mc: #4fd0e0; }
  .c4 { --mc: #f0a64a; } .c5 { --mc: #f07ad8; } .c6 { --mc: #8f9cff; } .c7 { --mc: #c3cf4a; }
  .c0, .c1, .c2, .c3, .c4, .c5, .c6, .c7 { --on-mc: #121214; }
}
.text { white-space: pre-wrap; overflow-wrap: anywhere; min-width: 0; }
/* Formatting (Bar 41): headings are bold lines at body size; code blocks scroll sideways, nothing else does */
.text > :first-child { margin-top: 0; }
.text > :last-child { margin-bottom: 0; }
.text p { margin: 0 0 6px; }
.text .mdh { font-weight: 700; font-size: 1em; margin: 10px 0 4px; }
.text ul, .text ol { margin: 0 0 6px; padding-left: 22px; }
.text li > p { margin: 0; }
.text li > ul, .text li > ol { margin: 2px 0; }
.text code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9em; background: var(--panel);
             border: 1px solid var(--line); border-radius: 4px; padding: 0 3px; }
.text pre { margin: 0 0 6px; padding: 8px 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px;
            max-width: 100%; overflow-x: auto; white-space: pre; overflow-wrap: normal; -webkit-overflow-scrolling: touch; }
.text pre code { background: none; border: 0; padding: 0; font-size: 13px; }
.text blockquote { margin: 0 0 6px; padding-left: 10px; border-left: 3px solid var(--line); color: var(--muted); }
.text hr { border: 0; border-top: 1px solid var(--line); margin: 8px 0; }
.text.clamp { max-height: calc(25 * 1.4em); overflow: hidden;
              -webkit-mask-image: linear-gradient(#000 75%, transparent); mask-image: linear-gradient(#000 75%, transparent); }
button.more { background: transparent; color: var(--accent); padding: 4px 0 0; font-size: 14px; }
.text a { color: var(--accent); }
.file img { display: block; max-width: 100%; max-height: 320px; margin-top: 6px; border-radius: 6px; border: 1px solid var(--line); }
.file button.doc { display: inline-block; margin-top: 4px; color: var(--accent); background: transparent; padding: 2px 0;
                    font: inherit; text-align: left; text-decoration: underline; }
.file button.pic { display: block; padding: 0; background: transparent; border: 0; }
.file img.pv { height: auto; }   /* v19 Bar 60: width/height attrs keep the box; max-width shrinks it in ratio */
.file button.clip { position: relative; text-align: left; color: var(--accent); }
.file button.clip .play { position: absolute; left: 8px; top: 14px; padding: 2px 8px; border-radius: 6px;
                          background: rgba(0, 0, 0, 0.55); color: #fff; font-size: 14px; }
.file button.clip .cliplabel { display: block; margin-top: 2px; font-size: 14px; }
/* In-app file viewer: covers the whole app, opaque, keeps clear of the notch and home bar. */
/* v21 Bar 71: dark in both themes, the picture fitted to the free area (Bar 72 zooms it with a transform) */
#viewer { position: fixed; inset: 0; z-index: 10; background: #000; color: #fff; display: flex; flex-direction: column;
          padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
#viewer[hidden] { display: none; }
.viewbar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid #333; }
.viewtt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
#viewpos { font-size: 13px; color: #bbb; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#viewpos:empty { display: none; }
#viewname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
#viewsave { font-size: 14px; padding: 6px 12px; }
#viewclose { font-size: 18px; padding: 4px 12px; }
#viewbody { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
#viewbody img { display: block; flex: 1; min-height: 0; width: 100%; height: 100%; object-fit: contain;
                touch-action: none; transform-origin: 0 0; }
#viewbody video { display: block; width: 100%; max-height: 70vh; margin: 0 auto; background: #000; }
#viewbody p { padding: 8px 12px; margin: 0; }
.viewtext { flex: 1; min-height: 0; overflow: auto; -webkit-overflow-scrolling: touch; margin: 0; padding: 12px;
            white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; color: #eee; }
footer { border-top: 1px solid var(--line); background: var(--panel);
         padding: 8px max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left));
         padding-bottom: max(8px, env(safe-area-inset-bottom)); }
body.kbd footer { padding-bottom: 8px; }   /* keyboard up: the home bar is behind it, so no inset gap */
#sendform { display: flex; align-items: flex-end; gap: 8px; }
textarea { flex: 1; font: inherit; resize: none; max-height: 40vh; padding: 8px 10px; border-radius: 18px;
           border: 1px solid var(--line); background: var(--bg); color: var(--fg); }
button, .filebtn { font: inherit; border: 0; border-radius: 18px; padding: 8px 14px; background: var(--accent); color: #fff; cursor: pointer; }
.filebtn { background: transparent; color: var(--accent); font-size: 22px; padding: 4px 6px; line-height: 1; }
.filebtn input { display: none; }
#attach { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
#attach button { background: transparent; color: var(--muted); padding: 0 4px; }
.err { color: var(--err); font-size: 13px; margin: 4px 0 0; min-height: 0; }
.err:empty { display: none; }
#login { padding: 24px 16px; max-width: 420px; margin: 0 auto; }
#login input { width: 100%; font: inherit; padding: 10px; border-radius: 8px; border: 1px solid var(--line);
               background: var(--bg); color: var(--fg); margin-bottom: 8px; }
#asksbtn { font-size: 13px; padding: 4px 10px; background: var(--ask); color: #fff; }
/* Hotfix 12-05: the folded status rows' header button; green dot while all OK, the ask colour with a count if not */
#statusbtn { flex-shrink: 0; font-size: 13px; padding: 4px 8px; background: transparent; color: var(--ok);
             border: 1px solid var(--line); white-space: nowrap; }
#statusbtn.bad { background: var(--ask); color: #fff; border-color: var(--ask); }
#asksbtn.quiet { background: transparent; color: var(--muted); border: 1px solid var(--line); }
#asks { border-bottom: 1px solid var(--line); background: var(--panel); max-height: 45vh; overflow-y: auto; padding: 4px 12px; }
.askrow { display: block; width: 100%; text-align: left; background: transparent; color: var(--fg); border-radius: 6px;
          padding: 8px 4px; border-bottom: 1px solid var(--line); font-size: 15px; }
.muted { color: var(--muted); font-size: 14px; }
.badge { font-size: 12px; font-weight: 600; padding: 1px 7px; border-radius: 9px; margin-left: 6px; color: #fff; }
.badge.open { background: var(--ask); }
.badge.answered { background: var(--ok); }
.mentions, .inreply { font-size: 12px; color: var(--muted); }
button.inreply { background: transparent; padding: 0; font: inherit; font-size: 12px; color: var(--accent); text-align: left; }
.reacts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.chip { font-size: 13px; padding: 2px 8px; border-radius: 12px; background: transparent; color: var(--fg);
        border: 1px solid var(--line); }
.chip.mine { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.chip.add { color: var(--muted); }
.rpick { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; padding: 4px; border: 1px solid var(--line);
         border-radius: 10px; background: var(--panel); width: max-content; max-width: 100%; }
.rpick button { font-size: 20px; padding: 4px 6px; background: transparent; }
.acts { display: flex; gap: 14px; align-items: center; margin-top: 2px; }
.replybtn { background: transparent; color: var(--muted); font-size: 12px; padding: 2px 0; }
.threadbtn { background: transparent; color: var(--accent); font-size: 13px; font-weight: 600; padding: 2px 0; }
.threadbtn.fresh::after { content: " new"; color: var(--ask); font-weight: 700; }
/* Thread view: takes the list's place between the header and the composer. */
#threadview { flex: 1; min-height: 0; display: flex; flex-direction: column; }
#threadview[hidden] { display: none; }
.tbar { display: flex; align-items: center; gap: 8px; padding: 6px max(12px, env(safe-area-inset-right)) 6px max(12px, env(safe-area-inset-left));
        border-bottom: 1px solid var(--line); background: var(--panel); }
#threadback { font-size: 14px; padding: 4px 10px; flex-shrink: 0; }
#threadtitle { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; color: var(--muted); }
#threadlog { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
             padding: 8px max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left)); }
#threadlog .troot { border-bottom: 1px solid var(--line); padding-bottom: 8px; margin-bottom: 6px; }
.msg.flash { outline: 2px solid var(--accent); }
#reply { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
#reply button { background: transparent; color: var(--muted); padding: 0 4px; }
.opts { display: flex; gap: 14px; font-size: 14px; color: var(--muted); margin-top: 6px; }
.opts:not(:has(label:not([hidden]))) { display: none; }
#mentionlist { max-height: 40vh; overflow-y: auto; margin-bottom: 6px; border: 1px solid var(--line);
                border-radius: 10px; background: var(--bg); }
.pick { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; background: transparent;
        color: var(--fg); border-radius: 0; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.pick:last-child { border-bottom: 0; }
.pick.sel { background: var(--mine); }
.pick .id { color: var(--muted); font-size: 13px; }
#chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; font-size: 13px; }
.chip { padding: 1px 8px; border-radius: 10px; border: 1px solid var(--mc); color: var(--mc); font-weight: 600; }
#bellbtn { background: transparent; color: var(--muted); padding: 2px 4px; font-size: 18px; filter: grayscale(1); }
#bellbtn.on { filter: none; }
#notif { border-bottom: 1px solid var(--line); background: var(--panel); padding: 8px 12px; font-size: 15px; }
#notif p { margin: 4px 0 8px; }
#notif .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 6px 0; }
#notif button.plain { background: transparent; color: var(--accent); border: 1px solid var(--line); }
[hidden] { display: none !important; }
/* Bar 43 */
body { touch-action: pan-x pan-y; }   /* the page never pinch-zooms; only the picture viewer does */
footer { position: relative; }        /* holds the jump-to-latest button */
#jumpbtn { position: absolute; right: 16px; top: -48px; z-index: 3; font-size: 14px; padding: 6px 12px;
           box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3); }
#editbar { font-size: 13px; color: var(--ask); margin-bottom: 6px; }
#editbar button { background: transparent; color: var(--muted); padding: 0 4px; }
.newdiv { display: flex; align-items: center; gap: 8px; color: var(--err); font-size: 12px; font-weight: 600; margin: 12px 0 0; }
.newdiv::before, .newdiv::after { content: ""; flex: 1; border-top: 1px solid var(--err); }
.edited { font-size: 12px; color: var(--muted); }
.text.gone { font-style: italic; color: var(--muted); }
button.ownbtn { background: transparent; color: var(--muted); font-size: 13px; padding: 2px 6px; }
.msg.focus { outline: 2px solid var(--ask); outline-offset: 2px; }
.chtag { font-size: 12px; font-weight: 700; color: var(--accent); }
.askitem { border-bottom: 1px solid var(--line); padding: 2px 0 6px; }
.askitem .askrow { border-bottom: 0; }
button.markbtn { font-size: 14px; padding: 6px 12px; min-height: 44px; background: var(--ok); }
/* Hotfix 12-05 (Ben: "No reply needed" did not look like a choice): every choice is a filled, bordered button with a
   44 px tap target, under a header that says to tap one */
.answerpick { display: flex; flex-direction: column; gap: 6px; margin: 6px 0 0 4px; }
.answerpick .pickhead { margin: 0; font-size: 14px; font-weight: 600; }
button.pickans { text-align: left; font-size: 15px; padding: 10px 12px; min-height: 44px; background: var(--mine);
                 color: var(--fg); border: 2px solid var(--accent); border-radius: 8px; }
button.pickans.first { border-color: var(--ok); }

/* Bar 47: small notice, e.g. a push tap whose message could not be opened */
.toast { position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  max-width: calc(100vw - 32px); padding: 8px 14px; border-radius: 8px; background: var(--fg); color: var(--bg);
  font-size: 14px; z-index: 50; }

/* Bar 49: threads panel, Done lines */
#threadsbtn { font-size: 13px; padding: 4px 4px; background: var(--accent); color: #fff; white-space: nowrap; flex-shrink: 0; }
#threadsbtn.quiet { background: transparent; color: var(--muted); border: 0; }   /* 390 px: header fits with the pill */
#threads { border-bottom: 1px solid var(--line); background: var(--panel); max-height: 55vh; overflow-y: auto; padding: 4px 12px 8px; }
#threads[hidden] { display: none; }
.ttabs { display: flex; gap: 6px; padding: 6px 0; position: sticky; top: 0; background: var(--panel); }
.ttab { font-size: 13px; padding: 4px 10px; border-radius: 14px; background: transparent; color: var(--fg); border: 1px solid var(--line); }
.ttab.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.showdone { display: block; font-size: 13px; color: var(--muted); padding: 2px 0 6px; }
.trow { display: block; width: 100%; text-align: left; background: transparent; color: var(--fg); padding: 8px 4px;
        border-bottom: 1px solid var(--line); font-size: 15px; }
.twords { display: inline-block; max-width: calc(100% - 22px); vertical-align: bottom; overflow: hidden; text-overflow: ellipsis;
          white-space: nowrap; }
.trow.unread .twords { font-weight: 700; }
.tdot { color: var(--accent); margin-right: 6px; font-size: 11px; }
.tmeta { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.tme { color: var(--ask); font-weight: 700; font-size: 13px; }
.tdone { color: var(--ok); }
button.doneline { display: block; width: 100%; text-align: left; background: transparent; color: var(--muted); font-size: 13px;
                  padding: 6px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#donenote { font-size: 13px; color: var(--muted); white-space: nowrap; }
#donebtn { font-size: 13px; padding: 4px 10px; flex-shrink: 0; }
/* Bar 50: search */
#searchbtn { font-size: 15px; padding: 4px 2px; background: transparent; flex-shrink: 0; }
#search { border-bottom: 1px solid var(--line); background: var(--panel); max-height: 60vh; overflow-y: auto; padding: 8px 12px; }
#search[hidden] { display: none; }
#searchq { width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); }
.srow { display: block; width: 100%; text-align: left; background: transparent; color: var(--fg); padding: 8px 4px;
        border-bottom: 1px solid var(--line); }
.smeta { display: block; color: var(--muted); font-size: 12px; }
.ssnip { display: block; font-size: 15px; overflow-wrap: anywhere; }
.ssnip mark { background: color-mix(in srgb, var(--accent) 30%, transparent); color: inherit; border-radius: 3px; }
/* Bar 51: per-channel notify */
#chunread.dim { opacity: 0.55; }
.nrow { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.nrow select { padding: 4px 6px; border-radius: 6px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); }
/* v16 e: a new release is live; a tap reloads (draft kept) */
#updbar { display: block; width: 100%; border: 0; border-bottom: 1px solid var(--line); background: var(--accent);
          color: var(--bg); font: inherit; font-size: 14px; font-weight: 700; padding: 8px 12px; cursor: pointer; }
#updbar[hidden] { display: none; }

/* v18 Bar 55: status posts of this channel, a thin strip under the header (fits 375 px: rows ellipsize) */
#statusstrip { border-bottom: 1px solid var(--line); background: var(--panel); max-height: 30vh; overflow-y: auto; padding: 0 12px; }
#statusstrip[hidden] { display: none; }
#statusstrip .srow { display: block; width: 100%; text-align: left; background: transparent; color: var(--muted); padding: 4px 0;
  font-size: 12px; line-height: 1.35; border-bottom: 1px solid var(--line); border-radius: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#statusstrip .srow:last-child { border-bottom: 0; }
#statusstrip .skey { font-weight: 600; color: var(--fg); }
#statusstrip .sfull { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--fg); font-size: 13px; padding: 4px 0 2px; }
/* Bar 56: an open search/threads panel fills header -> composer; the log and "Latest" hide behind it */
body.panel-open #log, body.panel-open #jumpbtn { display: none; }
body.panel-open #search, body.panel-open #threads { flex: 1 1 auto; max-height: none; min-height: 0; }

/* v20 Bar 66: the Monitor tab (phone first: one column, 44 px taps, no sideways scroll) */
#monbtn { flex-shrink: 0; font-size: 15px; padding: 4px 2px; min-height: 36px; background: transparent; border: 0; }
/* 375 px: the words on the status button + the Monitor icon must fit the header (Bar 69 d): empty spans take no gap,
   the status button is a bit tighter, and the own avatar (decoration) steps aside on screens under 400 px */
#chunread:empty, #status:empty { display: none; }
#statusbtn { font-size: 12px; padding: 4px 5px; }
header { gap: 4px; }
#asksbtn { padding: 4px 7px; }
@media (max-width: 399px) { #me { display: none; } }
/* Lead 12-05: the word next to 📊 only where it fits (no phone at 375-402 has room); the tab shows a one-time hint */
.mword { display: none; }
@media (min-width: 480px) { .mword { display: inline; } }
#monhint { margin: 8px 12px 0; padding: 8px 10px; border-radius: 8px; background: var(--mine); color: var(--fg); font-size: 14px; }
#monhint[hidden] { display: none; }
#monitor { flex: 1; min-height: 0; display: flex; flex-direction: column; }
#monitor[hidden] { display: none; }
#monnote { color: var(--ask); font-size: 13px; margin-left: auto; }
#monbody { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 4px 12px calc(16px + env(safe-area-inset-bottom)); }
.msec { margin: 8px 0 16px; }
.mtitle { font-size: 15px; margin: 8px 0 6px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.mcard { border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 8px; padding: 8px 10px;
         margin-bottom: 8px; background: var(--panel); overflow-wrap: anywhere; min-width: 0; }
.mcard.h-red { border-left-color: var(--err); }
.mcard.h-amber { border-left-color: var(--ask); }
.mcard.h-green { border-left-color: var(--ok); }
.mhead { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.mname { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.mage { color: var(--muted); font-size: 12px; white-space: nowrap; }
.mdot { font-size: 12px; color: var(--muted); }
.h-red .mdot { color: var(--err); } .h-amber .mdot { color: var(--ask); } .h-green .mdot { color: var(--ok); }
.mline { font-size: 13px; color: var(--muted); margin-top: 2px; }
.mfold { display: block; width: 100%; min-height: 44px; text-align: left; background: transparent; color: var(--ok);
         border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; font-size: 14px; }
.mnote { color: var(--muted); font-size: 13px; padding: 6px 0; }
.mnote.mstale { color: var(--err); font-weight: 600; }

/* v22 Bars 81-83: Monitor tabs (375 px first: rows wrap, the 6 h lines take the card width, never sideways scroll) */
.mtabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.mtab { flex: 1 1 0; min-width: 0; min-height: 44px; padding: 6px 4px; border-radius: 8px; border: 1px solid var(--line);
        background: var(--panel); color: var(--fg); font-size: 14px; }
.mtab.on { background: var(--mine); border-color: var(--ok); font-weight: 600; }
.mbox, .mproj { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; background: var(--panel);
                min-width: 0; overflow-wrap: anywhere; }
.mproj { border-left: 4px solid var(--line); }
.mproj.h-red { border-left-color: var(--err); } .mproj.h-amber { border-left-color: var(--ask); } .mproj.h-green { border-left-color: var(--ok); }
.mproj .mbox { border: 0; padding: 4px 0 0; margin: 4px 0 0; background: transparent; }
.mbtitle { font-size: 13px; margin: 0 0 4px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.mrow { display: flex; flex-wrap: wrap; gap: 2px 8px; font-size: 14px; padding: 3px 0; min-width: 0; overflow-wrap: anywhere; }
.mrow .mtext { flex: 1 1 12em; min-width: 0; }
.mtag { color: var(--muted); font-size: 12px; white-space: nowrap; }
.mrow.b-done .mtext { color: var(--muted); text-decoration: line-through; }
.mrow.h-red .mdot { color: var(--err); } .mrow.h-amber .mdot { color: var(--ask); } .mrow.h-green .mdot { color: var(--ok); }
.mprob .mtext { color: var(--fg); }
.mmore { margin: 4px 0; } .mmore > .msum { min-height: 44px; display: flex; align-items: center; cursor: pointer; color: var(--muted); font-size: 14px; }
.mhist { display: flex; align-items: center; gap: 8px; min-width: 0; }
.mspark { width: 100%; height: 40px; flex: 1; min-width: 0; fill: none; stroke: var(--ok); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.mval { font-size: 13px; min-width: 3em; text-align: right; }
.mupd { font-size: 12px; margin-top: 8px; }
/* v23 (Ben 12-05 iPhone: "Too crowded at the top"): <= 430 px the channel name is shown in full (app.js sizes the
   picker to it), 🧵 ⚑ ● only while they have something, 🔍 📊 🔔 behind one ⋯ menu, the avatar stays. Wider: unchanged. */
#morebtn { display: none; flex-shrink: 0; background: transparent; color: var(--fg); border: 0; font-size: 20px; font-weight: 700;
           line-height: 1; padding: 4px 6px; min-width: 36px; min-height: 36px; }
/* v25 (Ben "tidy and organized"): the menu's right edge = the avatar's (both sit on the header's right padding), its top
   just under the bar (app.js); rows of 44 px: a 28 px icon column, the label, the value right-aligned and muted */
#moremenu { position: fixed; right: max(12px, env(safe-area-inset-right)); top: calc(max(8px, env(safe-area-inset-top)) + 46px);
            z-index: 5; display: flex; flex-direction: column; width: 260px; max-width: calc(100vw - 24px); padding: 4px 0;
            border-radius: 12px; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18); }
#moremenu[hidden] { display: none; }
.mitem { display: grid; grid-template-columns: 28px 1fr auto; column-gap: 10px; align-items: center; text-align: left;
         background: transparent; color: var(--fg); border: 0; border-radius: 0; padding: 0 14px; height: 44px; font-size: 16px; }
.mico { width: 28px; text-align: center; font-size: 18px; line-height: 1; }
.mlab { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mval { color: var(--muted); font-size: 15px; white-space: nowrap; text-align: right; }
.mdiv { height: 1px; margin: 4px 0; background: var(--line); }
@media (max-width: 430px) {
  header { gap: 12px; }   /* v25: even gaps between title, pill, ⋯ and avatar */
  #chunread { height: 21px; line-height: 21px; padding: 0 10px; border-radius: 11px; font-size: 13px; }   /* v25: the title's line box (measured 21 px), a full pill like the others */
  #morebtn, #me { width: 36px; height: 36px; min-width: 36px; min-height: 36px; padding: 0;
                  align-items: center; justify-content: center; }
  header select { max-width: none; flex-shrink: 0; }
  #chunread { max-width: none; }   /* the freed room shows the other channel's name; it still gives way (…) */
  #searchbtn, #monbtn, #bellbtn { display: none; }
  #threadsbtn.quiet, #asksbtn.quiet, #statusbtn:not(.bad) { display: none; }
  #morebtn { display: inline-flex; margin-left: auto; }   /* v25b: the spacer sits before ⋯, so ⋯ + avatar are at the right */
  #me { display: inline-flex; margin-left: 0; }
}
@media (min-width: 431px) { #moremenu { display: none; } }
/* iOS zooms into any focused control under 16px: every input, textarea and select is 16px (Bar 41) */
input, textarea, select, header select, #login input { font-size: 16px; }
