/* Lock and Lay — mobile client. Builds on the notebook tokens in /css/style.css. */
html, body.mobile { height: 100%; overflow: hidden; background: var(--paper); }
body.mobile { display: flex; flex-direction: column; -webkit-tap-highlight-color: transparent; }
body.mobile .auth-card { width: min(460px, 100vw); min-height: 100%; padding: max(28px, env(safe-area-inset-top)) 24px 32px; box-shadow: none; border-top: 0; justify-content: center; }
body.mobile .overlay { align-items: stretch; }

#top { display: flex; align-items: stretch; background: var(--paper); background-image: var(--grain); border-bottom: 1px solid var(--ink); padding-top: env(safe-area-inset-top); flex: none; }
#top .stat { flex: 1; padding: 8px 10px; border-right: 1px solid var(--rule); line-height: 1.1; display: flex; flex-direction: column; }
#top .stat b { font-size: 15px; font-weight: 500; }
#top .stat.right { border-right: 0; text-align: right; align-items: flex-end; }

body.mobile #view { position: static; inset: auto; flex: 1; min-height: 0; overflow: auto; -webkit-overflow-scrolling: touch; padding: 12px 14px 24px; background: var(--paper); background-image: var(--grain); }
#view h2 { font-size: 24px; margin: 6px 0 10px; }
#view h3 { font-size: 17px; margin: 14px 0 6px; }

#tabs { display: flex; flex: none; border-top: 1px solid var(--ink); background: var(--paper-2); padding-bottom: env(safe-area-inset-bottom); }
#tabs button { flex: 1; border: 0; border-radius: 0; background: transparent; padding: 8px 0 7px; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10px; letter-spacing: .04em; color: var(--ink-3); position: relative; }
#tabs button:hover { background: transparent; color: var(--ink); }
#tabs button.on { color: var(--ink); box-shadow: inset 0 2px 0 var(--moss); }
#tabs svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
#tabs button.on svg { stroke: var(--moss); }
#tabs .badge { position: absolute; top: 4px; right: calc(50% - 18px); }

/* room scene */
.roomwrap { overflow-x: auto; overflow-y: hidden; border: 1px solid var(--ink); background: #1a1815; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.roomwrap canvas { display: block; }
.tublist { margin: 6px 0 12px; } .tublist summary { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); cursor: pointer; padding: 6px 0; }
#modal2 { z-index: 55; align-items: flex-end; } #modalBox2 { max-height: 80vh; border-top: 1px solid var(--ink); }
.presets { display: flex; gap: 6px; margin: 4px 0 8px; flex-wrap: wrap; }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 60; }
.egg canvas { width: 100%; height: 100%; display: block; }
.egg { background: linear-gradient(#d8ccb0, #c3b592); }
.egg.open canvas { height: 68px; }
/* room */
.rack-card { background: #fff; border: 1px solid var(--rule-2); margin-bottom: 12px; box-shadow: 2px 2px 0 var(--paper-3); }
:root[data-theme="dark"] .rack-card { background: #15130f; box-shadow: 2px 2px 0 #0e0d0b; }
.rack-head { display: flex; justify-content: space-between; align-items: baseline; padding: 8px 10px; border-bottom: 1px solid var(--rule); }
.rack-head b { color: var(--moss); }
.tubgrid { display: grid; gap: 4px; padding: 8px; }
.tub { min-height: 42px; border: 1px solid var(--rule-2); border-radius: 3px; padding: 4px 6px; font-size: 11px; line-height: 1.2; display: flex; flex-direction: column; justify-content: center; background: var(--paper); position: relative; overflow: hidden; }
.tub.empty { color: var(--ink-3); border-style: dashed; background: transparent; justify-content: center; align-items: center; }
.tub .n { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tub .w { color: var(--ink-3); font-family: var(--mono); font-size: 10px; }
.tub .dot { position: absolute; top: 4px; right: 4px; width: 7px; height: 7px; border-radius: 50%; }
.dot.good { background: var(--moss); } .dot.bad { background: var(--brick); } .dot.warn { background: var(--amber); } .dot.info { background: var(--sky); }
.tub .idx { position: absolute; bottom: 2px; right: 5px; font-size: 9px; color: var(--ink-3); font-family: var(--mono); }

/* lists */
.row-card { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--rule); }
.row-card canvas { width: 78px; height: 45px; flex: none; border: 1px solid var(--rule); background: linear-gradient(#f5f1e9, #e8e1d3); }
:root[data-theme="dark"] .row-card canvas { background: linear-gradient(#2a2722, #1a1815); }
.row-card .body { flex: 1; min-width: 0; }
.row-card .t { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-card .m { font-size: 12px; color: var(--ink-2); }
.row-card .v { font-family: var(--mono); font-size: 13px; text-align: right; flex: none; }
.tags { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 3px; }
.tags .tag { margin: 0; font-size: 10px; padding: 0 5px; }
.toolbar { display: flex; gap: 6px; margin-bottom: 8px; align-items: center; }
.toolbar input, .toolbar select { flex: 1; min-width: 0; padding: 7px 9px; font-size: 14px; }
.tabs { overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
.tabs button { flex: none; }
.grid { grid-template-columns: 1fr; }
@media (min-width: 560px) { .grid { grid-template-columns: 1fr 1fr; } }
.specimen canvas { aspect-ratio: 52 / 26; }
.specimen dl { grid-template-columns: auto 1fr; }
select, input { font-size: 16px; } /* stops iOS zoom */

/* sheet */
#sheet { position: fixed; inset: 0; background: rgba(12, 10, 8, .55); z-index: 40; display: flex; align-items: flex-end; }
.sheet-box { width: 100%; max-height: 88vh; overflow: auto; background: var(--paper); background-image: var(--grain); border-top: 1px solid var(--ink); border-radius: 14px 14px 0 0; padding: 8px 16px calc(20px + env(safe-area-inset-bottom)); }
.grip { width: 40px; height: 4px; border-radius: 2px; background: var(--rule-2); margin: 2px auto 10px; }
.sheet-box .name { font-family: var(--serif); font-size: 22px; }
.sheet-box canvas.big { width: 100%; aspect-ratio: 52 / 30; border: 1px solid var(--rule); background: linear-gradient(#f5f1e9, #e8e1d3); margin: 8px 0; }
:root[data-theme="dark"] .sheet-box canvas.big { background: linear-gradient(#2a2722, #1a1815); }
.sheet-box .actions button { flex: 1 1 45%; padding: 10px 8px; }
.sheet-box .stats { margin: 8px 0; }

/* modal + toasts on phone */
.modal { width: 100vw; max-height: 100vh; padding: 20px 18px calc(20px + env(safe-area-inset-bottom)); border: 0; }
.eggs { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.egg { height: 130px; }
#toasts { left: 10px; right: 10px; bottom: calc(64px + env(safe-area-inset-bottom)); width: auto; }
.toast { font-size: 13px; }
.phone-nav-m { display: flex; border-bottom: 1px solid var(--rule-2); margin-bottom: 8px; }
.phone-nav-m button { flex: 1; border: 0; border-radius: 0; padding: 8px 0; font-size: 12px; color: var(--ink-3); position: relative; }
.phone-nav-m button.on { color: var(--ink); box-shadow: inset 0 -2px 0 var(--ink); }
.post canvas { aspect-ratio: 52 / 26; }
.more-list button { display: block; width: 100%; text-align: left; padding: 12px; margin-bottom: 8px; }
.odds { font-size: 12px; }
.bar { margin-top: 3px; }
