/* iPhone / browser build: the bottom bar stays put.
   Root cause of the bar "scrolling up with the content": the whole document was the scroll container, so on iOS
   (Safari, the home-screen app and the WKWebView) rubber-banding, the keyboard panning the page and the toolbar
   resizing all move the document, and position:fixed bars ride along with it.
   Fix: the page itself never scrolls (html/body fixed, overflow hidden, no overscroll). The content (main.app) is
   the only scroll container, the nav / fab / composer / sheets are fixed to the viewport outside of it.
   Only when web-native.js sets html.pinned (iPhone, browser); the Android WebView keeps its own layout. */
html.pinned, html.pinned body {
  position: fixed; inset: 0; width: 100%; height: 100%; margin: 0;
  overflow: hidden; overscroll-behavior: none;
}
html.pinned #root { height: 100%; }
html.pinned main.app {
  position: fixed; top: 0; bottom: 0; left: 0; right: 0; margin: 0 auto;
  min-height: 0; box-sizing: border-box;
  overflow-x: hidden; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-y: contain;
}
/* the nav and the composer: never part of the scrolling content (the input row of Today and the chat sits on the nav) */
html.pinned .nav, html.pinned .composer, html.pinned .focus-bar { position: fixed; bottom: 0; transform: translateZ(0); }
html.pinned .composer, html.pinned .focus-bar { bottom: calc(var(--nav-h) + var(--safe-b)); }
html.pinned.typing .composer, html.pinned.typing .focus-bar { bottom: 0; }
/* the "how to bring WhatsApp messages in" answer has line breaks */
html.pinned .msg.guide .ai-row p { white-space: pre-line; }
/* the chat scrolls to its end: leave room for the composer that is fixed over the bottom */
html.pinned .chat-log > div:last-child { scroll-margin-bottom: calc(var(--safe-b) + 8.5rem); }
/* "One at a time": its action bar is fixed above the nav (app.css .focus-bar), the card keeps room for it. */
/* The keyboard is open (web-native.js sets --kb to its height): the composer and the sheets sit right above it,
   the content keeps room for them, and the bottom nav (under the keys anyway) steps aside. */
html.pinned.kb-open .composer, html.pinned.kb-open .focus-bar { bottom: var(--kb, 0px); padding-bottom: var(--s3); }
/* (the sheet's top - its X and title - stays below the status bar / Dynamic Island: 100dvh starts under it) */
html.pinned.kb-open .sheet { bottom: var(--kb, 0px); max-height: calc(100dvh - var(--kb, 0px) - var(--safe-t, 0px) - 12px); }
/* a message ("Marked as done · Undo") shown while typing sits above the keys, not under them */
html.pinned.kb-open .toast { bottom: calc(var(--kb, 0px) + 12px); }
html.pinned.kb-open main.app { bottom: var(--kb, 0px); }
html.pinned.kb-open .nav, html.pinned.kb-open .fab { display: none; }
/* A sheet opened from inside a screen lives in main.app (its own layer under the nav): the nav and the + button step
   aside while a sheet is open, so the sheet's last buttons are never under them (iPhone, 23.11). */
html.pinned.sheet-open .nav, html.pinned.sheet-open .fab { visibility: hidden; }
/* A task's "Later" button next to "Done" wrapped to two lines ("אחר / כך", "あと / で") on 375-390pt iPhones: it takes
   the width of its label and "Done" takes the rest (a very large system font still wraps, as everywhere). */
html.pinned .sheet-actions:not(.one) { grid-template-columns: minmax(0, 1fr) auto; }
/* The tab bar: four equal tabs (review 24.11). A label longer than its tab ran into the next one on a 375pt iPhone;
   web-native.js draws all the labels a little smaller then (--nav-fs, like an iOS tab bar). */
html.pinned .nav-in { grid-template-columns: repeat(4, minmax(0, 1fr)); }
html.pinned .nav a { min-width: 0; font-size: var(--nav-fs, .8125rem); }
html.pinned .nav .cnt { font-size: calc(var(--nav-fs, .8125rem) * .92); }
/* The Focus card's side-by-side buttons ("Open chat" / "Later"): a little less side padding, so a longer label
   ("チャットを開く", "Abrir conversa") stays on one line on a 390pt iPhone. */
html.pinned .focus-row .btn { padding-inline: var(--s3); }
/* The phone side of QR pairing opened in Safari (see app.js Lnk): the note sits between the text and the buttons. */
html.pinned .lnk-safari { margin-top: var(--s3); }
/* The chat's header sticks to the top of main.app (the scroll container here), below its top padding: that strip is
   filled, or the messages showed through above the header while scrolling (iPhone review, 23.11). */
html.pinned .chat-top::before { content: ""; position: absolute; inset-inline: calc(-1 * var(--s5)); bottom: 100%;
  height: calc(var(--safe-t) + var(--s2) + 2px); background: var(--paper); }
/* Editing a card's text (a WhatsApp / email draft, a number to call) with the keyboard open: the chat box steps aside,
   or it covered the very field being edited (web-native.js scrolls the field into view). */
html.pinned.kb-open .chat:has(.act textarea:focus, .act input:focus) .composer { display: none; }
/* Review B (24.11): Safari on the iPhone, not yet on the Home Screen: a small strip at the top says how to add it
   (web-native.js); the content starts below it. */
.ios-strip { position: fixed; top: 0; inset-inline: 0; z-index: 40; display: flex; align-items: center; gap: var(--s2); min-height: 40px;
  padding: 4px var(--s2) 4px var(--s5); background: var(--ink); color: var(--on-ink); font-size: .875rem; font-weight: 500; }
.ios-strip span { flex: 1; }
.ios-strip button { width: 40px; height: 40px; flex: none; font-size: 1.375rem; line-height: 1; color: inherit; }
html.pinned.has-strip main.app { top: 40px; }
html.has-strip:not(.pinned) body { padding-top: 40px; }
/* The first visit's "Add to Home Screen" sheet (web-native.js, Itamar 24.11): over "Today", once. */
.a2hs-bg { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.45); }
.a2hs { position: fixed; inset-inline: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 61; background: var(--paper, #fff); color: var(--ink, #111);
  border-radius: 20px; padding: 22px 20px 18px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.a2hs h3 { margin: 0 0 6px; font-size: 1.3rem; }
.a2hs p { margin: 0 0 12px; color: var(--ink-2, #555); }
.a2hs ol { margin: 0 0 16px; padding-inline-start: 1.3em; display: grid; gap: 6px; font-size: 1.05rem; }
