/* Mobile first, shared building blocks (Blanco, 17 Nov 2026) – only under html.mf (prototype: ?m=1 on a phone).
   Palette: lime #d6fb00, white, greys, signal red #ff4d4f. Inter for text, JetBrains Mono for labels and numbers. */
html.mf { --mf-bar-h: 64px; --mf-safe: env(safe-area-inset-bottom); --mf-lime: #d6fb00; --mf-red: #ff4d4f; }
html.mf body { -webkit-text-size-adjust: 100%; }
/* everything tappable at least 44 px; fields 16 px so the iPhone does not zoom in */
html.mf :is(button, .btn, [role="button"], select, a.btn):not(.mf-keep) { min-height: 44px; } /* .mf-keep: a small button on top of something keeps its size */
html.mf :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea) { font-size: 16px !important; min-height: 44px; }
/* room for the bar at the bottom */
html.mf.mf-has-bar body { padding-bottom: calc(var(--mf-bar-h) + var(--mf-safe) + 12px) !important; }

/* ---------- bottom action bar ---------- */
html:not(.mf) .mf-bar { display: none !important; }
.mf-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; gap: 8px; align-items: center;
  padding: 10px 14px calc(10px + var(--mf-safe)); background: #0a0a0a; border-top: 1px solid #1b1b1b;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.mf-btn { flex: 1 1 0; min-width: 0; height: 44px; border-radius: 22px; border: 1px solid #2a2a2a; background: none; color: #f4f4f2;
  font: 500 11px/1 "JetBrains Mono", ui-monospace, Menlo, monospace; letter-spacing: .08em; text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 14px; cursor: pointer; touch-action: manipulation; }
/* the main action: lime OUTLINE + lime text, never filled (Blanco, 17 Nov 2026 – like "Slide to approve") */
.mf-btn.mf-main { flex: 2 1 0; background: none; border: 1.5px solid var(--mf-lime, #d6fb00); color: var(--mf-lime, #d6fb00); font-weight: 600; }
.mf-btn.mf-main:active { background: rgba(214, 251, 0, .08); }
.mf-btn.mf-icon { flex: 0 0 44px; width: 44px; padding: 0; display: grid; place-items: center; }
.mf-btn:active { transform: scale(.97); }

/* ---------- "…" sheet ---------- */
.mf-sheet-wrap { position: fixed; inset: 0; z-index: 2000; background: rgba(0, 0, 0, 0); transition: background .25s; display: flex; align-items: flex-end; }
.mf-sheet-wrap.open { background: rgba(0, 0, 0, .55); }
.mf-sheet { width: 100%; max-height: 80dvh; overflow-y: auto; overscroll-behavior: contain; background: #141414; border-top: 1px solid #2a2a2a;
  border-radius: 18px 18px 0 0; padding: 8px 14px calc(14px + env(safe-area-inset-bottom)); transform: translateY(100%);
  transition: transform .3s cubic-bezier(.22, 1, .36, 1); }
.mf-sheet-wrap.open .mf-sheet { transform: none; }
.mf-grab { display: block; width: 40px; height: 4px; border-radius: 2px; background: #3a3a3a; margin: 2px auto 10px; }
.mf-sheet-h { overflow-wrap: anywhere; font: 500 10px "JetBrains Mono", ui-monospace, monospace; letter-spacing: .14em; text-transform: uppercase; color: #8e8e8a; padding: 4px 4px 10px; }
.mf-sheet-list { display: flex; flex-direction: column; }
/* menus and choices in mono (Blanco, 17 Nov 2026) */
.mf-sheet-list button { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 3px; min-height: 52px; padding: 8px 6px;
  background: none; border: 0; border-top: 1px solid #1f1f1f; color: #f4f4f2; font: 500 13px/1.25 "JetBrains Mono", ui-monospace, Menlo, monospace;
  letter-spacing: .06em; text-transform: uppercase; text-align: left; cursor: pointer; }
.mf-sheet-list button:active { background: #1c1c1c; }
.mf-sheet-list button:first-child { border-top: 0; }
.mf-sheet-list button small { font: 400 11px "JetBrains Mono", ui-monospace, monospace; letter-spacing: .02em; text-transform: none; color: #8e8e8a; }
.mf-sheet-list button.danger { color: var(--mf-red, #ff4d4f); }
.mf-sheet-x { width: 100%; height: 48px; margin-top: 10px; border-radius: 24px; border: 1px solid #2a2a2a; background: none; color: #f4f4f2;
  font: 500 11px "JetBrains Mono", ui-monospace, monospace; letter-spacing: .1em; text-transform: uppercase; }

/* the floating "Project" chip lives in the sheet in the prototype; it only shows while its own menu is open */
html.mf #blanco-pick { bottom: calc(var(--mf-bar-h) + var(--mf-safe) + 12px) !important; }
html.mf.mf-has-bar:not(.mf-pick-open) #blanco-pick > button { display: none !important; }

@media (prefers-reduced-motion: reduce) { .mf-sheet, .mf-sheet-wrap { transition: none; } }

/* notes and selection bars sit above the action bar; the floating menu button lives in the bar (BlancoMF.menu()) */
html.mf.mf-has-bar :is(.toast, #toast, .selbar, .lk-bar) { bottom: calc(var(--mf-bar-h) + var(--mf-safe) + 14px) !important; }
/* the sidebar opens from "…" → Open sidebar; its floating round button is hidden in the prototype */
html.mf :is(.pr-burger, #menuButton) { display: none !important; }
.mf-sheet-list .mf-check { position: absolute; right: 10px; color: var(--mf-lime, #d6fb00); font-weight: 600; }
.mf-sheet-list button { position: relative; padding-right: 34px; }

/* choosing several: the bar's middle shows the count */
.mf-bar.mf-selecting .mf-btn:nth-child(2) { border-color: transparent; color: #8e8e8a; }

/* short notes – Review's ring style: bottom centre, small mono label on dark glass, ring left (tick / turning arc / red !) */
.mf-note { position: fixed; left: 50%; bottom: calc(var(--mf-bar-h, 64px) + env(safe-area-inset-bottom) + 18px); z-index: 1900;
  display: flex; align-items: center; gap: 10px; max-width: calc(100vw - 32px); padding: 8px 14px 8px 8px; border-radius: 22px;
  background: rgba(10, 10, 10, .88); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border: 1px solid #262626;
  color: #f4f4f2; font: 500 10px/1.3 "JetBrains Mono", ui-monospace, Menlo, monospace; letter-spacing: .1em; text-transform: uppercase;
  opacity: 0; transform: translate(-50%, 8px); pointer-events: none; transition: opacity .2s, transform .3s cubic-bezier(.22, 1, .36, 1); }
html:not(.mf-has-bar) .mf-note { bottom: calc(env(safe-area-inset-bottom) + 18px); }
.mf-note.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.mf-note span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mf-note-ring { flex: none; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid #d6fb00; position: relative; }
.mf-note-ring::after { content: ""; position: absolute; left: 7px; top: 4px; width: 5px; height: 9px; border: solid #d6fb00; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.mf-note.busy .mf-note-ring { border-color: #2a2a2a; border-top-color: #d6fb00; animation: mf-spin .9s linear infinite; }
.mf-note.busy .mf-note-ring::after { display: none; }
.mf-note.error { color: #ff4d4f; }
.mf-note.error .mf-note-ring { border-color: #ff4d4f; }
.mf-note.error .mf-note-ring::after { content: "!"; border: 0; transform: none; left: 0; right: 0; top: 2px; width: auto; height: auto; text-align: center; color: #ff4d4f; font: 700 13px "JetBrains Mono", monospace; }
.mf-note button { flex: none; min-height: 32px !important; padding: 0 4px; background: none; border: 0; color: #d6fb00; font: inherit; letter-spacing: inherit; text-transform: inherit; }
@keyframes mf-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .mf-note { transition: none; } .mf-note.busy .mf-note-ring { animation: none; } }
.mf-btn.mf-danger { border-color: var(--mf-red, #ff4d4f); color: var(--mf-red, #ff4d4f); flex: 2 1 0; }
.mf-bar > .mf-icon:only-child, .mf-bar > .mf-btn:not(.mf-icon) ~ .mf-icon:last-child { margin-left: auto; }
.mf-bar.mf-selecting .mf-btn:nth-child(2) { flex: 1 1 auto; min-width: 0; padding: 0 6px; }
.mf-note.plain .mf-note-ring { display: none; }
.mf-note.plain { padding-left: 14px; }
/* choosing bar at 375–390: Cancel never cut – it keeps its width, the count gives way */
.mf-bar.mf-selecting .mf-btn:first-child { flex: 0 0 auto; padding: 0 12px; }
/* a sheet or window is open: the page behind does not scroll or bounce (iOS) */
html.mf.mf-lock, html.mf.mf-lock body { overflow: hidden !important; overscroll-behavior: none; }
.mf-sheet-wrap { overscroll-behavior: contain; touch-action: none; }
.mf-sheet { touch-action: pan-y; }
html.mf dialog[open] { overscroll-behavior: contain; }
/* round buttons stay ROUND: the 44 px minimum made the sidebar's × an oval (Blanco, 18 Nov 2026) – give them 44 × 44 */
html.mf .pr-x { width: 44px !important; height: 44px !important; min-height: 44px !important; flex: none; }
html.mf :is(button, .btn, [role="button"]):is([class*="round"], [class*="circle"]) { min-width: 44px; }

/* the logo at the top on every phone page: a 44 px tap area; its look (mono, lower case, white + lime) comes from the
   workspace menu the worker adds to every page (Blanco, 18 Nov 2026) */
html.mf :is(header, .topbar, .top) .blanco-workspace-brand:not(.side-mark) { display: inline-flex !important; align-items: center; min-height: 44px; }

/* the sheet: the whole sheet scrolls (one scroller – iOS hit the wrong row with a list scrolling inside it), the handle
   and title stick to the top and Cancel to the bottom while the rows move (Blanco, 18 Nov 2026) */
.mf-sheet-top { position: sticky; top: -8px; z-index: 2; margin: -8px -14px 0; padding: 10px 14px 0; background: #141414; border-radius: 18px 18px 0 0; }
.mf-sheet-x { position: sticky; bottom: 0; z-index: 2; box-shadow: 0 -12px 14px #141414, 0 44px 0 26px #141414; background: #141414; }
/* group headings inside a menu */
.mf-sheet-g { font: 500 9.5px/1 "JetBrains Mono", ui-monospace, monospace; letter-spacing: .16em; text-transform: uppercase; color: #5f5f5b; padding: 18px 6px 8px; border-top: 1px solid #242424; }
.mf-sheet-g.gap { padding: 0; height: 10px; }
.mf-sheet-list > .mf-sheet-g:first-child { border-top: 0; padding-top: 4px; }
.mf-sheet-g + button { border-top: 0 !important; }

/* inside Review: the buttons are shown in Review's own bar (mobile-first.js forward) */
html.mf-forward .mf-bar { display: none !important; }
html.mf.mf-forward body { padding-top: var(--mf-host-top, 0px) !important; }
