/* Phone interface: one column, no page scrolling. Tokens, fonts and control styles come
   from app.css; this file only lays the page out and enlarges tap targets. */
html, body.phone { height: 100%; overflow: hidden; }
body.phone { height: 100dvh; display: flex; flex-direction: column; }
.ph-bar { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; height: calc(50px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 12px 0; border-bottom: 1px solid var(--line); }
.ph-bar .brand h1 { font-size: 21px; }
.ph-actions { display: flex; align-items: center; gap: 8px; }
.ph-actions .chip { min-height: 34px; padding: 0 10px; }
.ph-actions .enable { min-height: 34px; padding: 0 14px; font-size: 14px; }
.ph { flex: 1; min-height: 0; display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; gap: 10px; padding: 10px 12px calc(8px + env(safe-area-inset-bottom)); }
.ph-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.ph-tab { min-height: 42px; padding: 6px 4px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: 600 11px/1.15 var(--font); letter-spacing: .08em; text-transform: uppercase; }
.ph-tab.on { border-color: var(--accent); color: var(--accent); background: var(--surface2); }
.ph-preview { position: relative; aspect-ratio: 16 / 9; max-height: 34vh; justify-self: center; width: 100%; max-width: calc(34vh * 16 / 9); background: #000; border: 1px solid var(--line); }
.ph-preview canvas { display: block; width: 100%; height: 100%; }
.ph-prevtap { position: absolute; inset: 0; background: transparent; border: 0; }
.ph-controls { min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; align-content: start; }
.phone .controls { gap: 5px; }
.phone .ctl { grid-template-columns: 96px minmax(0, 1fr); min-height: 34px; }
.phone .ctl-info, .phone .ctl-button, .phone .ctl-note, .phone .ctl-buttons { grid-template-columns: 1fr; }
.phone .segb, .phone .nb, .phone .btn, .phone .switch, .phone .sel, .phone .ti, .phone .ni { min-height: 32px; }
.phone .rng input[type=range] { height: 34px; }
.phone .note { font-size: 13px; line-height: 1.4; }
.ph-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 11.5px; color: var(--dim); line-height: 1.3; }
.ph-foot a { color: var(--accent); white-space: nowrap; }
.ph-foot b { color: var(--text); }
@media (orientation: landscape) and (max-height: 520px) {
  .ph { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; }
  .ph-tabs { grid-column: 1 / -1; }
  .ph-preview { grid-row: 2; max-height: none; max-width: none; align-self: start; }
  .ph-controls { grid-row: 2; }
  .ph-foot { grid-column: 1 / -1; }
}
/* Full-screen show view: the phone is the display */
.ph-showview { position: fixed; inset: 0; z-index: 40; background: #000; }
.ph-showview canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.ph-exit { position: absolute; top: calc(10px + env(safe-area-inset-top)); right: 12px; padding: 6px 10px; background: rgba(11,12,16,.75); border: 1px solid var(--line); color: var(--dim); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; pointer-events: none; transition: opacity .4s; }
.ph-showview.calm .ph-exit { opacity: 0; }
