/* yAI as a phone app (2026-10-21, Claude Design "yAI Mobile App"). Everything is scoped to body.m-app, which
   mobile.js sets on phones (up to 700 px) when signed in, so desktop is unchanged. Uses styles.css's tokens, so light
   and dark follow the theme. The tab bar part is also used by the other pages (side.js). */

#mChatTop, #mGreet, #mPills, #mPrevSeg, #mPrevBar, #mPrevCode { display: none; }

/* ---------- frame ---------- */
body.m-app { overscroll-behavior: none; -webkit-tap-highlight-color: transparent; }
body.m-app .rail, body.m-app .sidebar, body.m-app .side-backdrop, body.m-app .topbar, body.m-app .fineprint { display: none !important; }
body.m-app:not([data-mview="chat"]) #shell { display: none; }
body.m-app[data-mview="chat"] #mApp, body.m-app[data-mview="chat"] #mTabs { display: none; }
#mApp { position: fixed; inset: 0 0 calc(58px + env(safe-area-inset-bottom)); overflow: hidden; background: var(--bg); color: var(--text); font-size: 15px; }
.m-view { display: none; position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain; padding-top: env(safe-area-inset-top); -webkit-overflow-scrolling: touch; }
body[data-mview="home"] #mHome, body[data-mview="projects"] #mProjects, body[data-mview="project"] #mProject,
body[data-mview="you"] #mYou, body[data-mview="settings"] #mSettings { display: block; }
body.m-app #mProject, body.m-app #mSettings { z-index: 2; background: var(--bg); }
@keyframes mIn { from { transform: translateX(28%); opacity: 0.4; } to { transform: none; opacity: 1; } }
@keyframes mBack { from { transform: translateX(-8%); opacity: 0.5; } to { transform: none; opacity: 1; } }
.m-in { animation: mIn 0.3s cubic-bezier(0.32, 0.72, 0, 1); }
.m-back { animation: mBack 0.26s cubic-bezier(0.32, 0.72, 0, 1); }
body.m-dragging[data-mview="chat"] #app, body.m-dragging[data-mview="project"] #mProject, body.m-dragging[data-mview="settings"] #mSettings {
  transform: translateX(var(--m-drag, 0)); box-shadow: -12px 0 32px rgba(0, 0, 0, 0.12);
}

/* ---------- tab bar ---------- */
#mTabs { display: none; }
body.m-app #mTabs, body.m-page #mTabs {
  display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; height: calc(58px + env(safe-area-inset-bottom));
  padding: 4px 8px env(safe-area-inset-bottom); border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 86%, transparent); -webkit-backdrop-filter: blur(18px) saturate(1.5); backdrop-filter: blur(18px) saturate(1.5);
}
#mTabs > * { flex: 1; height: 50px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; background: none; color: var(--muted); font: 500 11px var(--sans); text-decoration: none; }
#mTabs > .on { color: var(--acc-ink); font-weight: 600; }
#mTabs > *:active { transform: scale(0.94); }
body.m-page { padding-bottom: calc(58px + env(safe-area-inset-bottom)); }
body.m-page .shell { height: calc(100dvh - 58px - env(safe-area-inset-bottom)); }

/* ---------- shared pieces ---------- */
.m-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px 0 20px; }
.m-head-big { padding: 24px 16px 16px 20px; align-items: flex-end; }
.m-head-big .m-big { padding: 0; }
.m-logo { display: flex; align-items: center; gap: 1px; font-size: 22px; letter-spacing: -0.04em; color: var(--text); }
.m-logo span { font-weight: 400; } .m-logo b { font-weight: 700; }
.m-logo i { width: 6px; height: 6px; border-radius: 50%; background: var(--acc); margin: 8px 0 0 4px; }
.m-avatar { width: 32px; height: 32px; margin: 6px; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--ink); color: var(--on-ink); font: 600 12px var(--sans); }
.m-avatar-big { width: 52px; height: 52px; margin: 0; font-size: 18px; }
.m-big { margin: 0; padding: 6px 20px 14px; font-size: 32px; font-weight: 600; letter-spacing: -0.035em; line-height: 1.1; }
.m-round { width: 40px; height: 40px; flex: none; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--surface-2); color: var(--text); }
.m-searchbar { display: flex; align-items: center; gap: 10px; width: calc(100% - 32px); height: 42px; margin: 0 16px 16px; padding: 0 14px; border: 0; border-radius: 12px; background: var(--surface-2); color: var(--muted); font: 400 15px var(--sans); text-align: left; }
.m-chips { display: flex; gap: 8px; padding: 0 16px 20px; overflow-x: auto; scrollbar-width: none; }
.m-chips::-webkit-scrollbar { display: none; }
.m-chips button span, .m-bigbtn span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-chips button { max-width: 72vw; }
.m-bigbtn { padding: 0 18px; }
.m-chips button { height: 36px; flex: none; display: flex; align-items: center; gap: 8px; padding: 0 14px 0 12px; border-radius: 999px; border: 1px solid var(--border-strong); background: none; color: var(--text-2); font: 400 14px var(--sans); }
.m-label { padding: 0 20px 4px; font-size: 13px; font-weight: 500; color: var(--muted); }
.m-sections .m-label { padding: 0 6px 6px; }
.m-group { display: flex; flex-direction: column; margin-bottom: 18px; }
.m-row { display: flex; flex-direction: column; gap: 3px; width: 100%; padding: 11px 20px; border: 0; border-bottom: 1px solid var(--border); background: none; color: var(--text); text-align: left; font: inherit; }
.m-row:active, .m-card:active, .m-set:active, .m-tool:active, .m-model:active, .m-action:active { background: var(--hover); }
.m-row-top { display: flex; justify-content: space-between; gap: 12px; min-width: 0; }
.m-row-top b { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-row-top small { flex: none; font-size: 13px; color: var(--muted); }
.m-row-sub { display: flex; align-items: center; gap: 5px; font-size: 13.5px; color: var(--text-2); }
.m-row-flat { padding: 12px 4px; }
.m-empty { padding: 24px 20px; color: var(--muted); font-size: 14.5px; line-height: 1.5; margin: 0; }
.m-list { padding-bottom: 100px; }
.m-fab {
  position: fixed; right: 16px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 30; height: 52px; display: flex; align-items: center; gap: 8px;
  padding: 0 20px 0 16px; border: 0; border-radius: 999px; background: var(--acc); color: var(--acc-on); font: 600 15px var(--sans);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--acc) 40%, transparent);
}
.m-fab:active, .m-bigbtn:active, .m-round:active { transform: scale(0.96); }
.m-nav { height: 52px; display: flex; align-items: center; justify-content: space-between; padding: 0 8px; position: relative; }
.m-nav-center b { position: absolute; left: 0; right: 0; text-align: center; font-weight: 600; pointer-events: none; }
.m-backlink { height: 44px; display: flex; align-items: center; gap: 2px; padding-right: 8px; border: 0; background: none; color: var(--text-2); font: 400 15px var(--sans); }
.m-link { height: 44px; padding: 0 12px; border: 0; background: none; color: var(--acc-ink); font: 500 15px var(--sans); }
.m-sections { display: flex; flex-direction: column; gap: 22px; padding: 4px 16px 120px; }
.m-box, .m-panel { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; }
.m-box { padding: 12px 14px; font-size: 14px; line-height: 1.55; color: var(--text-2); white-space: pre-wrap; }
.m-clamp { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.m-switch { width: 46px; height: 28px; flex: none; border-radius: 14px; background: var(--border-strong); padding: 3px; display: flex; transition: background 0.18s; }
.m-switch i { width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); transition: transform 0.18s; }
.m-switch.on { background: var(--acc); }
.m-switch.on i { transform: translateX(18px); }
.m-seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--surface-2); }
.m-seg button { height: 36px; padding: 0 14px; border: 0; border-radius: 7px; background: none; color: var(--text-2); font: 400 13px var(--sans); }
.m-seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); font-weight: 500; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }

/* ---------- projects ---------- */
.m-cards { display: flex; flex-direction: column; gap: 10px; padding: 0 16px 100px; }
.m-card { display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); color: var(--text); text-align: left; font: inherit; }
.m-card-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.m-card-top b { flex: 1; font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-card-top small { font-size: 13px; color: var(--muted); }
.m-card-ic { width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); }
.m-card-meta { font-size: 13px; color: var(--muted); }
.m-proj-head { display: flex; flex-direction: column; gap: 4px; padding: 4px 20px 18px; }
.m-proj-head h1 { margin: 0; font-size: 28px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.15; overflow-wrap: anywhere; }
.m-proj-head small { font-size: 14px; color: var(--muted); }
.m-files { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin-right: -16px; padding-right: 16px; }
.m-file { width: 128px; flex: none; display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-file i { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); font: 600 8.5px var(--mono); font-style: normal; }
.m-bigbtn { position: fixed; left: 16px; right: 16px; bottom: calc(74px + env(safe-area-inset-bottom)); z-index: 3; height: 52px; display: flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 16px; background: var(--acc); color: var(--acc-on); font: 600 15px var(--sans); }

/* ---------- you and settings ---------- */
.m-me { display: flex; align-items: center; gap: 12px; padding: 20px 20px 18px; }
.m-me > div { flex: 1; display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.m-me b { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; }
.m-me small { font-size: 13px; color: var(--muted); }
.m-today { margin: 0 16px 12px; padding: 14px 16px; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.m-today > div:first-child { display: flex; flex-direction: column; gap: 4px; }
.m-today span { font-size: 13px; color: var(--text-2); }
.m-today b { font-size: 30px; font-weight: 600; letter-spacing: -0.03em; line-height: 1; }
.m-spark { flex: 1; max-width: 160px; height: 44px; display: flex; align-items: flex-end; gap: 3px; }
.m-spark i { flex: 1; background: var(--border-strong); border-radius: 2px 2px 0 0; }
.m-spark i.now { background: var(--acc); }
.m-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 16px 12px; }
.m-tile { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.m-tile-top { display: flex; justify-content: space-between; gap: 6px; font-size: 13px; color: var(--text-2); }
.m-tile-top span:last-child { font-size: 12px; color: var(--muted); }
.m-tile.warn .m-tile-top span:last-child { color: var(--acc-ink); font-weight: 600; }
.m-tile-val { display: flex; align-items: baseline; gap: 5px; }
.m-tile-val b { font-size: 22px; font-weight: 600; letter-spacing: -0.03em; line-height: 1; }
.m-tile-val span { font-size: 12.5px; color: var(--muted); }
.m-meter { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.m-meter i { display: block; height: 100%; border-radius: 3px; background: var(--text); }
.m-tile.warn .m-meter i { background: var(--acc); }
.m-linkrow { margin: 0 16px 100px; padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; color: var(--text); text-decoration: none; }
.m-group-box { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.m-set { width: 100%; min-height: 50px; display: flex; align-items: center; gap: 12px; padding: 0 14px; border: 0; border-bottom: 1px solid var(--border); background: none; color: var(--text); font: 400 15px var(--sans); text-align: left; }
.m-set:last-child { border-bottom: 0; }
.m-set > span:first-child { flex: 1; }
.m-set em { font-style: normal; color: var(--muted); font-size: 14px; }
.m-set svg { color: var(--faint); }
.m-danger, .m-danger span { color: var(--bad) !important; font-weight: 500; }
.m-foot { text-align: center; font-size: 12.5px; color: var(--muted); margin: 0; }

/* ---------- the chat screen ---------- */
body.m-app #app { height: 100dvh; }
body.m-app #mChatTop {
  display: flex; align-items: center; gap: 4px; flex: none; height: calc(56px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 8px 0;
  border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(1.5); backdrop-filter: blur(18px) saturate(1.5); z-index: 20;
}
.m-icon { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border: 0; border-radius: 12px; background: none; color: var(--text-2); }
.m-icon:active { background: var(--hover); }
.m-title { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 1px; border: 0; background: none; color: var(--text); font: inherit; line-height: 1.25; padding: 2px 0; }
.m-title b { font-weight: 600; font-size: 15px; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-title span { display: flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--muted); }
.m-title span i { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
.m-title em { font-style: normal; }
body.m-app .messages { padding: 18px 16px 12px; }
body.m-app .msg.user .bubble { border-radius: 20px 20px 6px 20px; padding: 10px 14px; font-size: 16px; }
body.m-app .content { font-size: 15.5px; line-height: 1.62; }
/* new chat: the greeting and three suggestions, just above the composer */
body.m-app .welcome { min-height: 100%; display: flex; flex-direction: column; justify-content: flex-end; padding: 0 20px 20px; max-width: none; }
body.m-app #welcome > :not(#mGreet) { display: none !important; }
body.m-app #mGreet { display: flex; flex-direction: column; gap: 22px; }
#mGreet h2 { margin: 0 0 -16px; font-size: 30px; font-weight: 600; letter-spacing: -0.035em; line-height: 1.15; }
#mGreet p { margin: 0; font-size: 16px; color: var(--text-2); }
.m-suggest { display: flex; flex-direction: column; gap: 8px; }
.m-suggest button { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); color: var(--text); text-align: left; font: inherit; }
.m-suggest button > span { width: 32px; height: 32px; flex: none; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); }
.m-suggest div { display: flex; flex-direction: column; line-height: 1.35; }
.m-suggest b { font-weight: 500; font-size: 14.5px; }
.m-suggest small { font-size: 13px; color: var(--muted); }
/* composer: + (tools sheet), active tools, mic, send */
body.m-app .composer-wrap { padding: 0 10px calc(10px + env(safe-area-inset-bottom)); }
body.m-app .composer { border-radius: 24px; padding: 10px 8px 8px 12px; border-color: var(--border-strong); }
body.m-app .composer textarea { font-size: 16px; max-height: 140px; }
body.m-app #webMode, body.m-app #researchMode, body.m-app .tools, body.m-app #imageMode, body.m-app #videoMode,
body.m-app #aspectPick, body.m-app #voiceBtn, body.m-app .composer-hint { display: none !important; }
body.m-app #attach { width: 38px; height: 38px; border: 1px solid var(--border); }
body.m-app #mPills { display: contents; }
.m-pill { height: 36px; display: flex; align-items: center; gap: 6px; padding: 0 10px 0 11px; border: 0; border-radius: 999px; background: var(--acc-soft); color: var(--acc-ink); font: 500 13.5px var(--sans); }
body.m-app .tool-pill span { display: inline !important; }
body.m-app .tool-pill { width: auto !important; padding: 0 11px !important; height: 36px; }
body.m-app .composer-bar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
body.m-app .mic-btn { margin-left: auto; width: 38px; height: 38px; }
body.m-app .send { width: 38px; height: 38px; margin-left: 2px; }
body.m-app .canvas { inset: 0; }

/* ---------- bottom sheets ---------- */
#mSheet { position: fixed; inset: 0; z-index: 80; display: flex; flex-direction: column; justify-content: flex-end; }
#mSheet[hidden] { display: none; }
.m-scrim { position: absolute; inset: 0; border: 0; padding: 0; background: var(--scrim); animation: mFade 0.2s ease; }
.m-sheet {
  position: relative; max-height: 86dvh; overflow-y: auto; background: var(--surface); border-radius: 26px 26px 0 0;
  padding: 8px 0 calc(20px + env(safe-area-inset-bottom)); box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2);
  animation: mUp 0.3s cubic-bezier(0.32, 0.72, 0, 1); transition: transform 0.2s;
}
#mSheet.m-closing .m-sheet { transform: translateY(100%) !important; transition: transform 0.18s ease-in; }
#mSheet.m-closing .m-scrim { opacity: 0; transition: opacity 0.18s; }
@keyframes mUp { from { transform: translateY(100%); } to { transform: none; } }
@keyframes mFade { from { opacity: 0; } to { opacity: 1; } }
.m-grab { display: block; width: 36px; height: 5px; border-radius: 3px; background: var(--border-strong); margin: 0 auto 10px; }
.m-sheet-title { padding: 4px 20px 10px; font-size: 19px; font-weight: 600; letter-spacing: -0.02em; }
.m-model { display: flex; align-items: center; gap: 14px; width: calc(100% - 20px); margin: 0 10px 4px; padding: 12px; border: 0; border-radius: 14px; background: none; color: var(--text); text-align: left; font: inherit; }
.m-model.on { background: var(--acc-soft); }
.m-model[disabled] { opacity: 0.45; }
.m-model-text { flex: 1; display: flex; flex-direction: column; gap: 2px; line-height: 1.3; min-width: 0; }
.m-model-text b { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.m-model-text em { font-style: normal; font-size: 11px; font-weight: 500; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--border-strong); color: var(--muted); }
.m-model-text small { font-size: 13.5px; color: var(--text-2); }
.m-radio { width: 22px; height: 22px; flex: none; border-radius: 50%; border: 1.5px solid var(--border-strong); display: grid; place-items: center; color: transparent; }
.m-model.on .m-radio { border: 0; background: var(--acc); color: var(--acc-on); }
.m-attach { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 4px 16px 10px; }
.m-attach button { height: 78px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 16px; background: var(--surface-2); color: var(--text); font: 500 13.5px var(--sans); }
.m-attach button:active { transform: scale(0.96); }
.m-tool { display: flex; align-items: center; gap: 14px; width: calc(100% - 32px); margin: 0 16px; padding: 12px 4px; border: 0; border-bottom: 1px solid var(--border); background: none; color: var(--text); text-align: left; font: inherit; }
.m-tool-ic { width: 36px; height: 36px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); }
.m-tool.on .m-tool-ic { background: var(--acc-soft); color: var(--acc-ink); }
.m-tool-text { flex: 1; display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.m-tool-text b { font-weight: 500; }
.m-tool-text small { font-size: 13px; color: var(--muted); }
.m-tool > svg { color: var(--faint); }
.m-ratios { display: flex; gap: 6px; padding: 10px 20px 14px 70px; border-bottom: 1px solid var(--border); margin: 0 16px; }
.m-ratio { height: 32px; display: flex; align-items: center; gap: 6px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--border-strong); background: none; color: var(--text-2); font: 500 13px var(--sans); }
.m-ratio.on { background: var(--acc-soft); color: var(--acc-ink); border-color: transparent; }
.m-ratio i { border: 1.5px solid currentColor; border-radius: 2px; }
.r1x1 { width: 11px; height: 11px; } .r16x9 { width: 15px; height: 9px; } .r9x16 { width: 9px; height: 15px; }
.m-action { display: flex; align-items: center; gap: 14px; width: calc(100% - 20px); margin: 0 10px; padding: 14px 12px; border: 0; border-radius: 12px; background: none; color: var(--text); font: 400 16px var(--sans); text-align: left; }
.m-action svg { color: var(--text-2); }
.m-action.m-danger svg { color: var(--bad); }

/* ---------- live preview, full screen ---------- */
body.m-app .preview-dialog { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; border: 0; border-radius: 0; background: var(--side); }
body.m-app .preview-head { height: calc(56px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 8px 0 16px; border: 0; background: var(--side); }
body.m-app #previewWide { display: none; }
body.m-app #previewReload { display: none; }
body.m-app #mPrevSeg { display: inline-flex; margin-left: auto; }
body.m-app .preview-stage { margin: 0 12px; border-radius: 16px; overflow: hidden; border: 1px solid var(--border); background: #fff; }
body.m-app .preview-dialog.m-code .preview-stage { display: none; }
body.m-app #mPrevCode:not([hidden]) { display: block; flex: 1; min-height: 0; overflow: auto; margin: 0 12px; padding: 14px; border-radius: 16px; border: 1px solid var(--border); background: var(--code-bg); font: 12px/1.6 var(--mono); white-space: pre; }
body.m-app #mPrevBar { display: flex; gap: 8px; padding: 12px 12px calc(12px + env(safe-area-inset-bottom)); }
#mPrevBar button { flex: 1; height: 48px; display: flex; align-items: center; justify-content: center; gap: 8px; border-radius: 14px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: 500 15px var(--sans); }
#mPrevBar .m-primary { border: 0; background: var(--acc); color: var(--acc-on); font-weight: 600; }

/* ---------- App feel: the page itself never moves (2026-10-21) ----------
   On a phone only the content areas scroll (the chat, the lists, sheets). The document is pinned, so pulling up or
   down doesn't bounce the whole page or trigger pull-to-refresh, and nothing can push it sideways. Areas that need to
   scroll sideways (code blocks, tables, chips, sources) still do, inside themselves. */
html:has(> body.m-app), html:has(> body.m-page) { height: 100%; overflow: hidden; overscroll-behavior: none; }
body.m-app, body.m-page {
  position: fixed; inset: 0; width: 100%; height: 100%; overflow: hidden; overscroll-behavior: none;
  touch-action: manipulation; -webkit-text-size-adjust: 100%; -webkit-user-select: none; user-select: none;
}
body.m-app :is(input, textarea, [contenteditable], .content, .bubble, pre, code, .cv-text),
body.m-page :is(input, textarea, .stage) { -webkit-user-select: text; user-select: text; }
body.m-app #shell, body.m-app #app, body.m-app #mApp { max-width: 100vw; overflow: hidden; }
body.m-app .scroller, .m-view, .m-sheet, body.m-page .stage, body.m-page .app { overflow-x: hidden; overscroll-behavior: contain; }
body.m-app .scroller, .m-view, body.m-page .stage { overflow-y: auto; -webkit-overflow-scrolling: touch; }
body.m-app .messages, body.m-app .msg, body.m-app .body, body.m-app .content { min-width: 0; max-width: 100%; }
body.m-app .content, body.m-app .bubble, body.m-app .m-row b, body.m-app .cc-text b { overflow-wrap: anywhere; }
body.m-app :is(.code, .table, .math, .katex-display, .sources ol, .m-chips, .m-files) { max-width: 100%; overscroll-behavior-x: contain; }
body.m-app :is(img, video, iframe, canvas) { max-width: 100%; }

/* ---------- Opening: the logo first (2026-10-21) ----------
   On a phone the app opens on the yAI logo, which settles in while the chats load, then fades into the app. */
#mSplash { display: none; }
@media (max-width: 700px) {
  #mSplash { position: fixed; inset: 0; z-index: 10000; display: grid; place-items: center; background: var(--bg); transition: opacity 0.35s ease, visibility 0.35s; }
  #mSplash.out { opacity: 0; visibility: hidden; }
  .m-splash-logo { display: flex; align-items: flex-end; font-size: 64px; letter-spacing: -0.05em; color: var(--text); line-height: 1; animation: m-splash-in 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
  .m-splash-logo span { font-weight: 400; } .m-splash-logo b { font-weight: 700; }
  .m-splash-logo i { width: 14px; height: 14px; border-radius: 50%; background: var(--acc); margin: 0 0 9px 7px; animation: m-splash-dot 0.5s 0.35s cubic-bezier(0.3, 1.6, 0.5, 1) both; }
  @keyframes m-splash-in { from { opacity: 0; transform: scale(0.92); } }
  @keyframes m-splash-dot { from { transform: scale(0); } }
}
@media (prefers-reduced-motion: reduce) { .m-splash-logo, .m-splash-logo i { animation: none; } }
