/* Mobile layout is layered after the desktop shell. */
.aux-toggle {display:none}
@media(max-width:949px) {
    .app {min-height:100dvh;overflow:visible}
    header {height:72px;padding:10px max(12px,env(safe-area-inset-right)) 10px max(12px,env(safe-area-inset-left));gap:8px}
    .brand img {width:clamp(105px,30vw,150px)}
    .header-right {gap:6px}
    .view-switch button {min-height:44px;padding:6px 10px;font-size:12px}
    .help-button {height:44px;padding:0 8px;font-size:12px}
    .workspace,body[data-page="1"] .workspace {display:flex;flex-direction:column;height:auto;min-height:calc(100dvh - 72px)}
    aside {width:100%;padding:4px 12px;border-bottom:1px solid var(--line)}
    nav {flex-direction:row;justify-content:space-around;gap:8px;align-items:center}
    .step {flex:1;min-width:0;min-height:44px;flex-direction:row;justify-content:center;gap:6px;font-size:13px}
    .step .number {width:28px;height:28px;font-size:14px;flex-shrink:0}
    .step>span:not(.number) {display:inline;font-size:12px}
    .step:after {display:none}
    main,body[data-page="1"] main {width:100%;min-width:0;min-height:0;flex:1;padding:0 max(12px,env(safe-area-inset-right)) 0 max(12px,env(safe-area-inset-left))}
    .topline {height:44px;flex-shrink:0}
    .status {min-height:44px}
    #content {padding:8px 0 20px;min-width:0}
    body[data-page="1"] #content {flex:1;min-height:240px}
    body[data-page="1"] .hero {height:clamp(240px,48dvh,480px)}
    footer {position:sticky;bottom:0;z-index:4;flex-shrink:0;min-height:72px;padding:12px 0 calc(12px + env(safe-area-inset-bottom));gap:10px;background:#fffffff5;backdrop-filter:blur(8px);margin-top:auto}
    footer .primary {min-width:0;min-height:48px;padding:12px 20px;font-size:15px}
    footer .secondary,footer .disconnect-button {min-height:44px;min-width:0;padding:12px 14px;font-size:13px}
    .receiver-calibration {display:flex;flex-direction:column;gap:16px}
    .receiver-calibration>section {width:100%;min-width:0}
    .calibration-photo {height:clamp(200px,30dvh,300px);aspect-ratio:auto}
    .level-instructions {padding:10px;font-size:12px;flex-wrap:wrap;gap:6px}
    .calibration-controls {display:flex;flex-direction:column}
    .receiver-calibration .action-stack {order:0;display:grid;grid-template-columns:1fr;gap:10px;margin:0 0 12px}
    .receiver-calibration .action-stack button {display:grid;grid-template-columns:30px 80px;column-gap:14px;justify-content:center;align-items:center;min-height:48px;font-size:16px;font-weight:700;padding:12px}
    .receiver-calibration .action-stack button .action-label {font-size:16px;line-height:24px;text-align:left;justify-self:start}
    .receiver-binding-result,.calibration-feedback {order:1}
    .receiver-calibration .channels {order:2;padding:14px}
    .receiver-channel-list {max-height:none;overflow:visible}
    .receiver-channel-list:not(.aux-expanded) .channel:nth-child(n+5) {display:none}
    .receiver-calibration .channel {min-height:28px;margin:6px 0}
    .aux-toggle {display:block;min-height:44px;width:100%;margin-top:10px;border:1px solid var(--line);border-radius:10px;background:#f4f5f7;color:var(--ink);font-size:14px}
    .flight-gallery h1 {font-size:24px}
    .mode-preview {width:100%;height:clamp(180px,27dvh,260px);margin-top:0}
    .flight-caption h2 {font-size:22px;margin:8px 0;padding-bottom:6px}
    .flight-caption p {font-size:13px;margin:8px 0 16px}
    .flight-cards {grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:0 0 20px}
    .flight-card {min-width:0;min-height:104px;padding:12px 6px;font-size:14px;overflow-wrap:anywhere}
    .flight-card small {font-size:12px}
    dialog {max-height:calc(100dvh - 32px);overflow:auto;padding:28px 20px}
    #expert-panel {height:calc(100dvh - 72px)}
    .tour-tip {max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px);overflow:auto}
}
@media(max-width:380px) {
    .header-right {gap:4px}
    .view-switch button {padding:6px 7px;font-size:11px}
    .help-button {font-size:11px;padding:0 6px}
    .step>span:not(.number) {font-size:11px}
}
@media(max-width:949px) and (max-height:500px) and (orientation:landscape) {
    body[data-page="1"] .hero {height:240px}
    .mode-preview,.calibration-photo {height:200px}
    .flight-cards {grid-template-columns:repeat(3,minmax(0,1fr))}
    footer {position:static}
}

@media(max-width:949px) {.tour-actions button,.tour-exit {min-height:44px}.tour-exit {min-width:44px}}
