/* Phone layout for the exact same hub screens. Only sizes and positions change. */
:root { --safe-t: env(safe-area-inset-top); --safe-b: env(safe-area-inset-bottom); }
html, body { height: 100%; overscroll-behavior: none; -webkit-text-size-adjust: 100%; }
input, select, textarea { font-size: 16px !important; } /* stops iPhone zooming in on tap */
.titlebar, #lock, .lock-only { display: none !important; }
.shell { display: block; height: 100dvh; }
.main { height: 100dvh; }
.sidebar { position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 35; height: auto; padding: 6px 4px calc(var(--safe-b) + 4px); flex-direction: row; border-right: 0; border-top: 1px solid var(--line); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.sidebar .brand, .sidebar .side-foot { display: none; }
#nav { display: flex; width: 100%; justify-content: space-around; gap: 0; }
#nav a { flex: 1; flex-direction: column; gap: 3px; padding: 6px 0 4px; font-size: 10.5px; font-weight: 600; border-radius: 10px; justify-content: center; text-align: center; }
#nav a svg { width: 23px; height: 23px; }
#nav a.active { background: none; color: #fff; }
#nav a.active svg { color: var(--accent); }
#nav a.active::before { display: none; }
#nav a em { position: absolute; top: 0; left: 55%; margin: 0; font-size: 9.5px; padding: 0 5px; }
#nav a em#navEmotes, #nav a em#navPacks { display: none; }
.topbar { padding: calc(var(--safe-t) + 10px) 16px 10px; flex-direction: column; align-items: stretch; gap: 10px; }
.topbar h2 { font-size: 28px; }
.topbar > div:first-child { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.top-actions { width: 100%; }
.search { width: 100%; }
.views { padding: 0 14px calc(var(--safe-b) + 84px); -webkit-overflow-scrolling: touch; }
.m-sync { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.m-sync i { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.m-sync.on i { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
#viewSub { display: none; }
/* grids stack */
.grid-stats, .grid-stats.six { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px; }
.grid-stats .stat, .grid-stats.six .stat { padding: 13px; }
.grid-stats .stat .v, .grid-stats.six .stat .v { font-size: 21px !important; }
.split, .rev-split { grid-template-columns: 1fr !important; }
.sheet-hero { grid-template-columns: 1fr; }
.rev-head { flex-wrap: wrap; gap: 8px; }
.rbx-card { padding: 14px 12px 10px; }
.rbx-card-h { flex-direction: column; align-items: stretch; gap: 8px; }
.rbx-card-h .seg { overflow-x: auto; }
.metric-tabs button b { font-size: 19px !important; }
.legend.rbx-legend { gap: 6px 12px; }
/* tables keep every column, they just scroll sideways */
.views table.table { display: block; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
.sheet-wrap table.table { display: table; overflow: visible; }
.sheet-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.toolbar { flex-wrap: nowrap; overflow-x: auto; margin: 0 -14px 12px; padding: 0 14px; }
.toolbar kbd, .toolbar .spacer + .muted { display: none; }
.chip { flex: none; }
/* settings: section menu becomes a scrolling row */
.settings { grid-template-columns: 1fr; gap: 10px; }
.settings .s-nav { position: sticky; top: 0; z-index: 3; display: flex; overflow-x: auto; gap: 6px; background: var(--bg); padding: 4px 0 8px; margin: 0 -14px; padding-left: 14px; padding-right: 14px; }
.s-nav a { flex: none; white-space: nowrap; background: var(--panel); }
.s-sec { padding: 16px 14px; }
.s-row { grid-template-columns: 1fr; gap: 8px; }
.s-row > select, .s-row > input, .s-row > input[type=url] { max-width: none; width: 100%; }
.s-row .inline { flex-wrap: wrap; }
.s-row .inline input { max-width: none; }
.iphone-box { flex-direction: column; align-items: flex-start; }
#lockNow2, #pwChange { } /* kept: they talk to your PC */
/* preview drawer: full screen, stacked */
.detail { inset: 0 !important; overflow-y: auto; padding-bottom: calc(var(--safe-b) + 10px); }
.detail-head { padding: calc(var(--safe-t) + 8px) 12px 10px; position: sticky; top: 0; z-index: 4; background: rgba(9, 11, 17, .96); }
.detail-title h3 { font-size: 17px; }
.detail-body { display: flex; flex-direction: column; padding: 12px; gap: 12px; flex: none; }
.stage-row { display: flex; flex-direction: column; flex: none; }
.stage { height: 52vh; min-height: 300px; flex: none; }
.ref { width: 100% !important; }
.ref video { max-height: 50vh; }
.ref-empty { padding: 14px; }
.transport { flex-wrap: wrap; }
.speeds { width: 100%; justify-content: space-between; }
.cam-bar { flex-wrap: wrap; max-width: calc(100% - 20px); }
.info-col { overflow: visible; }
.toast { bottom: calc(var(--safe-b) + 84px); max-width: 88vw; text-align: center; }
.upd-bar { display: none !important; }
/* first-run screens (pairing / Add to Home Screen) */
.m-ob { position: fixed; inset: 0; z-index: 60; overflow-y: auto; background: var(--bg, #000); padding: calc(var(--safe-t) + 32px) 18px calc(var(--safe-b) + 24px); color: var(--text, #fff); font: 15px/1.45 var(--font, -apple-system, system-ui, sans-serif); }
.m-ob .wrap { max-width: 440px; margin: 0 auto; }
.m-ob .logo { width: 84px; height: 84px; border-radius: 21px; display: block; margin: 0 auto 12px; object-fit: cover; box-shadow: 0 14px 44px rgba(124, 92, 255, .35); }
.m-ob h1 { text-align: center; font: 700 26px var(--display, inherit); margin: 0 0 4px; }
.m-ob .sub { text-align: center; color: var(--muted, #999); margin: 0 0 22px; }
.m-ob .card { background: var(--panel, #111); border: 1px solid var(--line, #222); border-radius: 18px; padding: 16px; margin-bottom: 14px; }
.m-ob h2 { font-size: 17px; margin: 0 0 8px; }
.m-ob ol { margin: 0; padding-left: 22px; } .m-ob li { margin: 8px 0; }
.m-ob .lbl2 { display: block; font-size: 12px; color: var(--muted, #999); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; margin: 12px 2px 6px; }
.m-ob input.txt { width: 100%; padding: 13px; border-radius: 12px; border: 1px solid var(--line, #222); background: #08080a; color: #fff; }
.m-ob input.code { width: 100%; font: 600 26px/1 ui-monospace, Menlo, monospace !important; letter-spacing: .22em; text-transform: uppercase; text-align: center; padding: 15px; border-radius: 14px; border: 1px solid var(--line, #222); background: #08080a; color: #fff; }
.m-ob .btn { width: 100%; justify-content: center; padding: 14px; font-size: 16px; margin-top: 12px; }
.m-ob .row2 { display: flex; align-items: center; gap: 10px; }
.m-ob .row2 img { width: 60px; height: 60px; border-radius: 14px; object-fit: cover; border: 1px solid var(--line, #222); }
.m-ob .row2 .btn { width: auto; margin: 0; padding: 10px 14px; font-size: 14px; }
.m-ob .msg { margin-top: 12px; text-align: center; color: var(--muted, #999); min-height: 22px; }
.m-ob .msg.ok { color: var(--ok, #3fd68a); } .m-ob .msg.bad { color: var(--bad, #ff5b4f); }
.m-ob .tiny { text-align: center; font-size: 12.5px; color: var(--muted, #999); }
.m-load { position: fixed; inset: 0; z-index: 55; display: grid; place-items: center; background: var(--bg, #000); color: var(--muted, #999); text-align: center; padding: 30px; }
.m-load b { display: block; color: var(--text, #fff); font-size: 18px; margin: 14px 0 4px; }
.m-load .bar { width: 220px; height: 6px; border-radius: 6px; background: #1b1b20; overflow: hidden; margin: 16px auto 0; }
.m-load .bar i { display: block; height: 100%; width: 30%; background: var(--grad, #7c5cff); border-radius: 6px; animation: mload 1.2s ease-in-out infinite; }
@keyframes mload { 0% { transform: translateX(-100%); } 100% { transform: translateX(330%); } }
body:has(#detail:not(.hidden)) .sidebar { display: none; }
.ref { display: none !important; } /* reference videos live on your PC */
