/* NEXUS v2 — mobile layout */
:root { --nx-css-shell: 1; } /* boot guard marker */
.m-app { position: relative; max-width: 480px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; overflow-x: clip; }
.m-hd { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 10px; height: 64px; padding: 0 16px; background: linear-gradient(var(--bg) 62%, color-mix(in srgb, var(--bg) 0%, transparent)); }
.m-hd .wm { position: absolute; left: 50%; transform: translateX(-50%); font-size: 27px; }
.m-title { position: absolute; left: 50%; transform: translateX(-50%); font-size: 15px; font-weight: 600; }
.m-hd-r { display: flex; align-items: center; gap: 8px; }
.m-main { position: relative; z-index: 1; flex: 1; padding: 0 16px calc(118px + env(safe-area-inset-bottom)); animation: fadeUp .55s var(--ease) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } }
.m-main--chat { padding-bottom: calc(96px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; height: calc(100dvh - 64px); }
.m-chat { flex: 1; min-height: 0; overflow: hidden; border-radius: 28px; display: flex; flex-direction: column; }
.m-chat .cw-wave { display: none; }

.m-tabbar {
  position: fixed; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 30;
  display: flex; gap: 2px; padding: 5px; border-radius: 999px; width: min(calc(100% - 28px), 452px);
}
.m-tab { flex: 1; height: 54px; border-radius: 999px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 10.5px; font-weight: 500; color: var(--ink-3); transition: color .2s, background .2s; }
.m-tab.on { color: var(--ink); background: color-mix(in srgb, var(--ink) 11%, transparent); }
[data-theme="light"] .m-tab.on { background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }

/* drawer */
.scrim { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .5); opacity: 0; pointer-events: none; transition: opacity .3s; }
.scrim.on { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 10px; bottom: 10px; left: 10px; z-index: 61; width: min(340px, calc(100vw - 48px)); border-radius: 30px; display: flex; flex-direction: column; transform: translateX(calc(-100% - 20px)); transition: transform .38s var(--ease); background: color-mix(in srgb, var(--bg) 82%, transparent); }
.drawer.on { transform: none; }
.dw-top { display: flex; align-items: center; justify-content: space-between; padding: 18px 16px 10px 22px; }
.dw-top .wm { font-size: 30px; }
.dw-prof { display: flex; align-items: center; gap: 12px; padding: 8px 20px 16px; border-bottom: 1px solid var(--line); }
.dw-prof div { display: flex; flex-direction: column; line-height: 1.35; }
.dw-prof b { font-size: 16px; font-weight: 600; }
.dw-prof span { font-size: 12.5px; color: var(--ink-3); }
.dw-scroll { flex: 1; overflow-y: auto; padding: 14px 12px 20px; display: flex; flex-direction: column; gap: 10px; }
.dw-scroll .cap { padding: 8px 8px 0; }
.dw-scroll .list { padding: 0; }
.dw-scroll .dw-links { margin-top: 8px; }

/* home */
.m-home { display: flex; flex-direction: column; gap: 14px; }
.m-lead { display: flex; flex-direction: column; gap: 10px; padding: 4px 2px 0; animation: fadeUp .6s var(--ease) both; }
.m-wx { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-2); }
.m-wx b { color: var(--ink); font-weight: 600; }
.m-wx .sep { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-3); }
.m-msg { font-size: 25px; line-height: 1.32; font-weight: 300; letter-spacing: -.025em; text-wrap: pretty; }
.m-stage { position: relative; height: 300px; margin: 0 -16px; touch-action: pan-y; }
.m-prev, .m-next { position: absolute; top: 46%; z-index: 3; width: 38px; height: 38px; }
.m-prev { left: 14px; }
.m-next { right: 14px; }
.m-name { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-top: -8px; position: relative; z-index: 2; }
.m-name-tx { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; min-width: 0; }
.m-name-tx .pill { height: 24px; font-size: 11px; font-weight: 600; letter-spacing: .04em; }
.display { font-weight: 300; letter-spacing: -.035em; line-height: 1; }
.display--m { font-size: 36px; }
.dots { display: flex; gap: 6px; padding-bottom: 8px; }
.dt { width: 7px; height: 7px; border-radius: 999px; background: var(--ink-4); transition: width .3s var(--ease), background .3s; }
.dt.on { width: 22px; background: var(--ink); }
.m-modebar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.m-home .ctrl-panel .card-hd { row-gap: 10px; }
.m-home .tile { min-height: 88px; padding: 12px 11px 10px; }
.m-home .tile-st { top: 12px; right: 10px; }
.m-home .tile-lb { font-size: 13px; }
.m-home .tiles { gap: 8px; }
.m-home .fam { grid-template-columns: 1fr 1fr; gap: 10px; }
.m-home .fam-tile { height: 98px; border-radius: 22px; }
.m-home .fam-tags { top: 9px; left: 9px; }
.m-home .fam-tx { left: 13px; right: 46px; bottom: 11px; }
.m-home .fam-tx b { font-size: 14px; }
.m-home .fam-tx em { font-size: 9.5px; letter-spacing: .08em; }
.m-home .fam-go { width: 30px; height: 30px; right: 10px; bottom: 10px; }

/* network */
.m-net { display: flex; flex-direction: column; gap: 16px; }
.m-net .view-hd h1 { font-size: 32px; }
.m-scene { position: relative; height: 380px; overflow: hidden; border-radius: 28px; }
.m-scene, .m-scene.glass { --ink: #F3F4F6; --ink-2: rgba(243, 244, 246, .68); --line: rgba(255, 255, 255, .08); color: var(--ink); border: 0;
  background: radial-gradient(70% 130% at 100% 0%, color-mix(in srgb, var(--acc) 26%, transparent), transparent 62%), linear-gradient(165deg, #1D2027 0%, #0C0E12 100%);
  -webkit-backdrop-filter: none; backdrop-filter: none; }
.m-scene .scene { position: absolute; inset: 0; }
.m-scene-hd { position: absolute; left: 14px; right: 14px; top: 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; pointer-events: none; }

/* shared views on mobile */
.view-hd h1 { font-size: 34px; }
.life .metrics { gap: 14px 22px; flex-wrap: nowrap; }
.m-main .tl-pop { left: 0 !important; right: 0; transform: none; width: auto; max-width: none; }
.m-main .tl { height: 156px; }
.stage--compact.stage--plan .stage-plate { width: 50%; }
.stage--compact.stage--object .dc, .stage--compact.stage--object .stage-obj img { height: 68%; max-width: 70%; bottom: 29.5%; }
.stage--compact.stage--vehicle .dc, .stage--compact.stage--vehicle .stage-obj img { width: 74%; bottom: 26.5%; }
.stage--compact .hud-chip { height: 28px; font-size: 11.5px; }
.life-cols { grid-template-columns: 1fr; }
.tl-pop { max-width: 230px; }
.my--m .my-head { flex-direction: column; align-items: flex-start; gap: 16px; }
.my--m .my-id h1 { font-size: 38px; }
.my--m .inst { grid-template-columns: 1fr; }
.my--m .inst-card { min-height: 170px; }
.catalog--m .cat-grid { grid-template-columns: 1fr; }
.settings--m .set-cols { grid-template-columns: 1fr; }
.settings--m .set-row { flex-wrap: wrap; }
.m-main .view { display: flex; flex-direction: column; gap: 18px; padding-top: 4px; }
