/* Phone landscape only: the existing portrait/desktop layout and controls remain intact. */
@media (orientation: landscape) and (min-width: 480px) and (max-width: 1100px) and (max-height: 600px) and (pointer: coarse) {
  :root { --landscape-nav: calc(48px + env(safe-area-inset-bottom)); --landscape-right: 26%; }
  html, body { height: 100%; min-height: 0; overflow: hidden; letter-spacing: 0; -webkit-text-size-adjust: 100%; }
  .orientation-guard, .topbar, .radio-shadow, .key-strip, .product-credit,
  .serial, .speaker-grille, .desktop-channel-occupancy { display: none !important; }
  html .app-shell, html.ios-browser .app-shell { width: 100%; min-height: 0; height: calc(100dvh - var(--landscape-nav)); padding: max(6px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 4px max(12px, env(safe-area-inset-left)); }
  .workspace, .radio-wrap { display: block; padding: 0; margin: 0; height: 100%; min-width: 0; }
  .radio {
    display: grid; width: 100%; height: 100%; min-width: 0;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(154px, var(--landscape-right));
    grid-template-rows: 44px minmax(0, 1fr) 98px 19px;
    grid-template-areas: "head head head" "meter channel ptt" "controls controls ptt" "foot foot foot";
    column-gap: 12px; border-radius: 6px;
  }
  .radio-main { display: contents; }
  .radio-topline, .radio-topline.private-channels-available, .radio-topline.admin-ptt-controls { grid-area: head; height: 44px; padding: 4px 14px; grid-template-columns: 88px minmax(0, 1fr) auto; grid-template-rows: 1fr; gap: 14px; }
  .radio-topline .radio-brand-burn { grid-column: 1; grid-row: 1; width: 82px; height: 29px; margin: 0; }
  .radio-topline .radio-transmitter { grid-column: 2; grid-row: 1; height: 30px; font-size: 12px; line-height: 30px; }
  .radio-transmitter-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .radio-topline .radio-topline-actions { grid-column: 3; grid-row: 1; }
  .member-status-controls { height: 36px; gap: 7px; }
  .member-status-controls button { width: 36px; height: 36px; flex-basis: 36px; }
  .member-status-controls button svg { width: 20px; height: 20px; }
  .meter-section { grid-area: meter; min-height: 0; height: 100%; margin: 0 0 0 14px; padding: 10px 0 4px; display: grid; grid-template-rows: minmax(0, 1fr) 24px; align-self: stretch; container-type: normal; }
  .meter-bezel { min-height: 0; height: 100%; padding: 5px; display: grid; grid-template-rows: minmax(0, 1fr) 23px; }
  .horizontal-meter-face { min-height: 0; height: auto; padding: 8px 10px 9px; gap: 6px; display: grid; align-content: space-evenly; }
  .line-meter-row { min-width: 0; }
  .line-meter-heading { grid-template-columns: 40px minmax(0, 1fr); gap: 8px; }
  .line-meter-heading strong { font-size: 12px; }
  .line-meter-scale { font-size: 10px; }
  .line-meter-track { margin-left: 48px; }
  .network-readout { min-width: 0; min-height: 0; flex-wrap: nowrap; padding: 0 5px; gap: 6px; font-size: 9px; }
  .network-readout > span { gap: 3px; }
  .network-status { margin-left: auto; }
  .indicator-row { margin: 0; padding-top: 5px; gap: 10px; justify-content: center; font-size: 10px; }
  .indicator-row > div { gap: 4px; }
  .display-section { grid-area: channel; min-height: 0; height: 100%; padding: 10px 0 6px; gap: 8px; grid-template-rows: minmax(0, 1fr) 43px; align-items: center; }
  .channel-selection { display: grid; width: 100%; height: 100%; grid-template-columns: minmax(94px, 1fr) auto; grid-template-rows: 1fr; gap: 10px; align-items: center; }
  .channel-display { width: 100%; height: 100%; min-height: 0; max-height: 121px; border-width: 5px; grid-template-rows: 10px minmax(0, 1fr) 18px; }
  .display-label { font-size: 10px; }
  .channel-controls { grid-column: 2; grid-row: 1; display: grid; grid-template-columns: 36px 36px; gap: 6px; }
  .channel-knob { grid-column: 1 / -1; grid-row: 2; justify-self: center; }
  .channel-knob, .knob-face { width: 48px; height: 48px; }
  .knob-face { box-shadow: inset 0 0 0 5px #24271f, inset 0 0 0 7px #090a08, 0 3px 4px #080908; }
  .knob-face i { height: 12px; }
  .step-button { width: 36px; height: 34px; font-size: 22px; }
  .control-caption { display: none; }
  .seven-segment-display { transform: scale(.8); transform-origin: center; height: 48px; max-height: 100%; }
  .channel-details { height: 18px; padding: 0 1px; gap: 5px; }
  .channel-tag, .channel-tag.channel-frequency, .channel-dw { font-size: 9px; }
  .channel-shortcuts { width: 100%; height: 43px; grid-template-columns: minmax(0, 4fr) minmax(42px, 1fr); gap: 5px; }
  .channel-presets { width: 100%; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; margin: 0; }
  .preset-button { width: 100%; min-width: 0; height: 43px; gap: 4px; }
  .preset-button strong { font-size: 16px; }
  .preset-button span { font-size: 8px; }
  .scan-button { width: 100%; min-width: 0; height: 43px; grid-template-columns: 1fr; grid-template-rows: 8px 13px; justify-items: center; align-content: center; gap: 3px; padding: 0 2px; }
  .scan-button strong { font-size: 9px; }
  .scan-button small { display: none; }
  .ptt-section { grid-area: ptt; height: 100%; min-height: 0; min-width: 0; padding: 8px 12px 8px 0; border: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 14px; }
  body:not(.ptt-classic) .ptt-button { flex: 0 0 auto; width: min(100%, 198px, calc(100dvh - 180px)); height: auto; aspect-ratio: 1; margin: 0; }
  .ptt-round-label strong { font-size: 42px; }
  .ptt-round-label small { font-size: 10px; }
  .ptt-round-status, .ptt-round-mode { font-size: 9px; }
  .speaker-actions { flex: 0 0 auto; width: 100%; max-width: 202px; gap: 6px; padding: 6px; justify-content: space-around; }
  .speaker-actions .friend-button, .speaker-actions .mute-button, .speaker-actions .joker-nominate, .speaker-actions .stealth-button { width: 34px; height: 34px; flex: 0 0 34px; padding: 3px; }
  .speaker-actions button svg { width: 19px; height: 19px; }
  .speaker-actions .joker-nominate img { width: 25px; height: 25px; }
  .radio-controls { grid-area: controls; height: 98px; min-width: 0; padding: 10px 0 9px 14px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(130px, 1.9fr) 48px; gap: 12px; background: transparent; align-items: start; }
  .dial-control { grid-column: auto; gap: 7px; }
  .dial-label, .squelch-control .dial-label { width: 100%; max-width: 68px; flex-direction: row; align-items: center; gap: 2px; font-size: 10px; }
  .squelch-control .dial-label output { font-size: 10px; }
  .rotary-knob, .rotary-face { width: 46px; height: 46px; }
  .rotary-face { box-shadow: inset 0 0 0 5px #292c24, inset 0 0 0 7px #0b0c0a, 0 3px 4px #080908; }
  .rotary-face i { height: 12px; top: 4px; }
  .gain-dual-knob .vox-delay-input, .vox-delay-face { inset: -3px; width: 52px; height: 52px; }
  .gain-dual-knob #gain, .gain-inner-face { inset: 7px; width: 32px; height: 32px; }
  .gain-inner-face { box-shadow: inset 0 0 0 3px #292c24, inset 0 0 0 5px #0b0c0a; }
  .gain-inner-face i { height: 8px; top: 3px; }
  .vox-delay-caption { top: 53px; font-size: 8px; }
  .switch-bank { grid-column: auto; width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 8px; }
  .switch-bank .switch-control, .switch-bank .switch-control:nth-child(odd) { justify-self: stretch; justify-items: center; gap: 3px; min-height: 34px; font-size: 9px; white-space: nowrap; }
  .switch-control i { width: 40px; height: 20px; }
  .switch-control i::after { width: 16px; height: 14px; }
  .switch-control input:checked + i::after { transform: translateX(16px); }
  .modulation-control i::after { width: 7px; transform: translateX(calc(var(--quality-position) * 13px)); }
  .defaults-control { grid-column: auto; gap: 8px; font-size: 8px; }
  .reset-defaults-button { width: 48px; min-width: 0; height: 45px; min-height: 0; padding: 0 2px; font-size: 9px; }
  .radio-footer { grid-area: foot; padding: 3px 14px; gap: 8px; font-size: 8px; height: 19px; align-items: center; }
  .radio-footer span:first-child { display: inline; }
  .mobile-menu { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); height: var(--landscape-nav); padding: 2px max(12px, env(safe-area-inset-right)) max(2px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); position: fixed; inset: auto 0 0; background: #151813; border-top: 1px solid #44483b; gap: 2px; box-shadow: none; transform: none; }
  .mobile-menu-button { display: flex; position: relative; align-items: center; justify-content: center; min-height: 40px; height: 40px; gap: 7px; padding: 0 4px; border: 0; background: transparent; color: #d1ccb7; font: 700 11px/1 Arial, sans-serif; text-transform: uppercase; }
  .mobile-menu-icon { width: 24px; height: 24px; color: var(--amber); display: grid; place-items: center; font-size: 21px; }
  .mobile-menu-badge { top: 2px; left: 20%; }
  .traffic-panel { display: none; }
  body.mobile-log-open:not(:has(dialog[open]))::before { display: none; }
  .traffic-panel.mobile-log-open { position: fixed; display: flex; z-index: 101; inset: calc(48px + max(6px, env(safe-area-inset-top))) calc(max(154px, var(--landscape-right)) + max(12px, env(safe-area-inset-right)) + 12px) calc(var(--landscape-nav) + 25px) calc(12px + max(12px, env(safe-area-inset-left))); padding: 0 12px 8px; min-height: 0; max-height: none; background: #171d18; border: 1px solid #666b55; border-radius: 4px; overflow: hidden; flex-direction: column; }
  .traffic-panel.mobile-log-open .panel-heading { padding: 8px 0; align-items: center; flex: 0 0 auto; }
  .panel-heading h2 { font-size: 17px; margin: 0; }
  .panel-heading .eyebrow { font-size: 9px; }
  .mobile-log-close { display: block; width: 32px; height: 32px; }
  .traffic-tabs { margin: 0 0 4px; flex: 0 0 auto; }
  .traffic-tabs button { min-height: 32px; font-size: 10px; }
  .channel-members-scroll, .traffic-log, .scribbles-view { overflow: auto; max-height: none; }
  .channel-member { padding: 7px 5px; grid-template-columns: 32px minmax(0, 1fr); }
  .channel-member-copy strong { font-size: 13px; }
  .channel-member-copy small { font-size: 10px; }
  .channel-member .message-actions { display: flex; gap: 8px; }
  .channel-member .message-actions button { width: 30px; height: 30px; }
  dialog { width: min(840px, calc(100vw - 28px)) !important; max-width: none; max-height: calc(100dvh - 20px) !important; margin: auto !important; overflow-y: auto; }
  .media-access { padding: 8px max(14px, env(safe-area-inset-right)) 8px max(14px, env(safe-area-inset-left)); }
  .media-access-panel { max-height: calc(100dvh - 16px); overflow-y: auto; padding: 16px 24px; }
  .media-access-panel img { width: 110px; }
  .registration-head, .online-head, .help-head { padding: 12px 18px; }
  .registration-head h2, .online-head h2, .help-head h2 { font-size: 22px; }
  .profile-tabs, .online-tabs { position: sticky; top: 0; z-index: 3; background: #171b14; }
  .profile-settings-panel { padding: 14px 18px; }
  .setup-audio { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reset-defaults-dialog, .channel-preset-dialog { width: min(500px, calc(100vw - 24px)) !important; }
  .reset-defaults-panel { padding: 18px 22px; }
  .digital-meter { padding: 7px 8px; gap: 4px; grid-template-rows: 10px minmax(0,1fr) minmax(0,1fr); }
  .digital-audio, .digital-link { gap: 2px; }
  .digital-link { padding-top: 3px; }
  .digital-heading output { font-size: 11px; }
  .digital-heading { font-size: 10px; }
  .radio[data-meter] .bronze-meter { grid-template-rows: minmax(23px, 1fr) minmax(23px, 1fr) 29px 10px 7px; gap: 2px; padding: 2px 6px; border-width: 2px; overflow: auto; overscroll-behavior: contain; }
  .radio .bronze-meter .bronze-header { display: none; }
  .radio .bronze-meter .bronze-clock time { font-size: 18px; }
  .radio .bronze-meter #bronzeDate { font-size: 7px; }
  .radio .bronze-meter .bronze-weather > div { min-height: 18px; }
  .radio .bronze-meter .bronze-weather img { width: 18px; height: 18px; flex-basis: 18px; }
  .radio .bronze-meter .bronze-weather output { font-size: 15px; }
  .radio .bronze-meter #bronzePlace { font-size: 8px; }
  .radio .bronze-meter .bronze-forecast { padding-top: 1px; font-size: 8px; }
  .radio .bronze-meter .bronze-forecast p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .radio .bronze-meter #bronzeWeatherDetails { display: none; }
  .radio .bronze-meter .bronze-source { font-size: 6px; }
  body.ptt-classic .ptt-button { width: min(100%, 184px); margin: 0; }
}
@media (orientation: landscape) and (min-width: 480px) and (max-width: 720px) and (max-height: 600px) and (pointer: coarse) {
  .radio { column-gap: 8px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 154px; }
  .radio-topline, .radio-topline.private-channels-available, .radio-topline.admin-ptt-controls { grid-template-columns: 66px minmax(0, 1fr) auto; padding-inline: 10px; gap: 8px; }
  .radio-topline .radio-brand-burn { width: 64px; }
  .radio-topline .radio-transmitter { font-size: 10px; }
  .member-status-controls { gap: 4px; }
  .member-status-controls button { width: 32px; height: 34px; flex-basis: 32px; }
  .meter-section { margin-left: 10px; }
  .channel-selection { grid-template-columns: minmax(88px, 1fr) 62px; gap: 6px; }
  .channel-controls { grid-template-columns: 29px 29px; gap: 4px; }
  .step-button { width: 29px; height: 32px; }
  .channel-knob, .knob-face { width: 42px; height: 42px; }
  .channel-tag, .channel-tag.channel-frequency, .channel-dw { font-size: 8px; }
  .preset-button span { font-size: 7px; }
  .speaker-actions { gap: 1px; padding: 5px 3px; }
  .speaker-actions .friend-button, .speaker-actions .mute-button, .speaker-actions .joker-nominate, .speaker-actions .stealth-button { width: 30px; height: 34px; flex-basis: 30px; }
  .radio-controls { padding-left: 10px; grid-template-columns: repeat(4, minmax(0, 1fr)) 112px 42px; gap: 7px; }
  .dial-label, .squelch-control .dial-label { font-size: 9px; }
  .switch-bank .switch-control { font-size: 8px; }
  .reset-defaults-button { width: 42px; }
  .ptt-round-label strong { font-size: 34px; }
  .ptt-round-status, .ptt-round-mode, .ptt-round-label small { font-size: 8px; }
  .mobile-menu-button { font-size: 10px; gap: 5px; }
  .network-readout { font-size: 8px; gap: 4px; }
  .horizontal-meter-face { padding-inline: 6px; }
  .bronze-rx-scale span:nth-child(6), .bronze-rx-scale span:nth-child(7) { visibility: hidden; }
}
@media (orientation: landscape) and (min-width: 480px) and (max-width: 1100px) and (max-height: 345px) and (pointer: coarse) {
  :root { --landscape-nav: calc(42px + env(safe-area-inset-bottom)); }
  .radio { grid-template-rows: 40px minmax(0, 1fr) 87px 17px; }
  .radio-topline, .radio-topline.private-channels-available, .radio-topline.admin-ptt-controls { height: 40px; }
  .radio-controls { height: 87px; padding-top: 7px; }
  .radio-footer { height: 17px; }
  .horizontal-meter-face { padding-block: 6px; gap: 7px; }
  .meter-section { grid-template-rows: minmax(0, 1fr) 20px; padding-bottom: 0; }
  .meter-bezel { grid-template-rows: minmax(0, 1fr) 20px; }
  .line-meter-row { gap: 3px; }
  .line-meter-heading strong { font-size: 11px; }
  .line-meter-track { height: 5px; }
  .line-meter-indicator { height: 12px; }
  .channel-display { min-height: 0; height: 64px; border-width: 4px; grid-template-rows: 9px 32px 15px; }
  .channel-details { height: 15px; }
  .seven-segment-display { transform: scale(.55); height: 32px; }
  .channel-knob, .knob-face { width: 29px; height: 29px; }
  .knob-face { box-shadow: inset 0 0 0 3px #24271f, inset 0 0 0 4px #090a08; }
  .knob-face i { top: 3px; height: 8px; }
  .channel-controls { gap: 3px; }
  .channel-selection { align-items: start; }
  .display-section, .meter-section { padding-top: 5px; }
  .display-section { grid-template-rows: minmax(0, 1fr) 39px; gap: 6px; padding-bottom: 4px; }
  .channel-shortcuts, .preset-button, .scan-button { height: 39px; }
  .ptt-section { gap: 10px; }
  body:not(.ptt-classic) .ptt-round-face { gap: 2px; }
  .ptt-round-channel-count { width: 18px; height: 18px; flex-basis: 18px; }
  .ptt-round-label strong { font-size: 30px; }
  .ptt-round-mode { font-size: 7px; }
  .mobile-menu, .mobile-menu-button { min-height: 0; }
  .mobile-menu-button { height: 36px; }
  .radio[data-meter] .bronze-meter { grid-template-rows: minmax(16px, 1fr) minmax(16px, 1fr) 27px 10px 6px; }
  .radio .bronze-meter .bronze-signal { grid-template-rows: 10px minmax(5px, 1fr); gap: 1px; }
  .radio .bronze-meter .bronze-scale { display: none; }
  .radio .bronze-meter .bronze-clock time { font-size: 16px; }
}
@media (orientation: landscape) and (min-width: 480px) and (max-width: 600px) and (max-height: 600px) and (pointer: coarse) {
  .preset-button [data-landscape-short] { font-size: 0; }
  .preset-button [data-landscape-short]::after { content: attr(data-landscape-short); font-size: 7px; }
}
