/* Shared online console; compact navigation and a single mounted editor. */
.mobile-device-button { display: none; }
.mobile-gateway-trigger { display: none; }
.gateway-picker-dialog { position: fixed; inset: auto; margin: 0; padding: 14px; box-sizing: border-box; max-width: calc(100vw - 24px); overflow: auto; overscroll-behavior: contain; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: #fffdf6; box-shadow: 0 8px 28px #0003; font: inherit; }
.gateway-picker-dialog::backdrop { background: #182b2233; }
.gateway-picker-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.gateway-picker-header h2 { font-size: 18px; margin: 0; }
.gateway-picker-header button { min-height: 44px; }
.gateway-picker-options { display: grid; gap: 6px; }
.gateway-picker-options .gateway-choice { width: 100%; min-height: 48px; padding: 10px 12px; white-space: normal; text-align: left; overflow-wrap: anywhere; font-size: 16px; }
.gateway-picker-options .gateway-choice[aria-pressed="true"] { border-color: #24543d; background: #24543d; color: #fff; }
.canvas-workspace[hidden], .canvas-workspace [hidden] { display: none !important; }
.editing-canvas { overflow: hidden; }
.editing-canvas > .app-shell { visibility: hidden; }
.canvas-workspace { position: fixed; inset: 0; z-index: 1100; display: grid; grid-template-rows: auto minmax(0,1fr) auto auto; background: #f7f5ed; padding-top: env(safe-area-inset-top); height: 100dvh; }
.canvas-workspace-header { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--line); background: #fffdf6; }
.canvas-workspace-title { flex: 1; min-width: 0; }
.canvas-workspace-title label { display: block; font-size: 11px; }
.canvas-workspace-title input { display: block; width: 100%; min-width: 0; font-size: 16px; border: 0; background: transparent; color: var(--ink); }
.canvas-workspace-title .section-meta { display: block; font-size: 10px; overflow-wrap: anywhere; }
.canvas-viewport { position: relative; min-height: 0; overflow: hidden; touch-action: none; background: #e6ebe7; }
.canvas-viewport .screen-canvas { position: absolute; inset: 0 auto auto 0; width: 568px; height: 760px; max-width: none; aspect-ratio: auto; transform-origin: 0 0; border: 0; }
.canvas-viewport .screen-element .resize-handle { width: var(--handle-size,44px); height: var(--handle-size,44px); background: transparent; border: 0; }
.canvas-viewport .resize-handle::after { content: ""; position: absolute; width: 40%; height: 40%; right: 0; bottom: 0; background: #007e77; border: 2px solid white; }
.canvas-view-controls { position: absolute; z-index: 10001; top: 6px; left: 8px; display: flex; align-items: center; gap: 4px; background: #fffdf6ed; border-radius: 8px; padding: 3px; box-shadow: 0 2px 8px #0001; }
.canvas-view-controls button { padding: 5px 8px; font-size: 12px; }
.canvas-view-controls output { padding: 0 5px; font-size: 12px; }
.canvas-workspace-tools { display: flex; gap: 4px; padding: 6px max(5px,env(safe-area-inset-right)) 6px max(5px,env(safe-area-inset-left)); border-top: 1px solid var(--line); background: #fffdf6; }
.canvas-workspace-tools > button { min-width: 0; flex: 1; padding: 5px 2px; font-size: 12px; white-space: normal; }
.canvas-workspace-tools > .active { background: #d9e8df; border-color: #397758; }
.canvas-workspace-panels { padding-bottom: env(safe-area-inset-bottom); }
.canvas-workspace-panels > section { max-height: min(42dvh,calc(var(--workspace-height,100dvh) * .45)); overflow: auto; padding: 12px; overscroll-behavior: contain; border-top: 1px solid var(--line); }
.canvas-workspace-panels .screen-toolbox { display: flex; flex-wrap: wrap; border: 0; padding: 0; }
.canvas-workspace-panels .screen-toolbox h3 { flex-basis: 100%; }
.canvas-workspace-panels .screen-variable-picker, .canvas-workspace-panels .screen-content-block-picker { flex: 1 1 180px; }
.canvas-workspace-panels .screen-layers { max-height: none; }
.canvas-workspace button, .canvas-workspace select, .canvas-workspace input:not([type="checkbox"]), .workspace-preview-dialog button, .template-crop-dialog button { min-height: 44px; }
.canvas-workspace input, .canvas-workspace select, .canvas-workspace textarea { font-size: 16px; }
.workspace-preview-dialog, .template-crop-dialog { width: min(96vw,860px); max-height: 94dvh; padding: 16px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: #fffdf6; }
.workspace-preview-dialog header, .workspace-preview-dialog footer, .template-crop-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.workspace-preview-dialog header { justify-content: space-between; }
.workspace-preview-dialog footer label { display: grid; gap: 5px; }
.workspace-preview-body { max-height: 65dvh; overflow: auto; }
.workspace-preview-dialog .screen-preview { margin: 0; }
.template-crop-stage { height: min(56dvh,480px); margin-bottom: 12px; }
.template-crop-stage img { display: block; max-width: 100%; }
.pwa-panel { border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-top: 20px; background: #fffdf6; }
.pwa-panel h3 { margin-top: 0; }
.pwa-panel .button { margin: 4px; }
.pwa-check-status { margin: 12px 0 0; padding: 10px 12px; border-left: 3px solid #397758; border-radius: 6px; background: #edf3ed; }
.pwa-update-banner { position: fixed; z-index: 1600; bottom: max(16px,env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); width: min(92vw,450px); padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff9de; box-shadow: 0 4px 30px #0003; }
.pwa-update-banner p { margin: 0 0 8px; }
.preview-switch { display: flex; gap: 6px; margin: 8px 0; }
.preview-switch .button.active { background: #d9e8df; }
.preview-switch { display: none; }
.preview-zoom-dialog { width: min(96vw,1000px); max-height: 94dvh; padding: 12px; border-radius: 10px; }
.preview-zoom-dialog img { display: block; max-width: 100%; height: auto; }
@media (max-width: 700px), (max-height: 500px) and (pointer: coarse) {
  html { scroll-padding-top: 110px; }
  body { overflow-wrap: anywhere; }
  .sidebar { min-height: 0; height: 0; padding: 0; border: 0; position: static; }
  .sidebar > .brand, .sidebar > .topbar-caption { display: none; }
  .side-nav { position: fixed; z-index: 100; bottom: 0; left: 0; right: 0; display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); width: auto; margin: 0; padding: 5px 4px calc(5px + env(safe-area-inset-bottom)); gap: 2px; overflow: visible; border-top: 1px solid #b8c4b9; background: #1b2922; }
  .side-nav .nav-link { display: flex; align-items: center; justify-content: center; min-height: 48px; padding: 3px 1px; font-size: 11px; white-space: normal; text-align: center; }
  .main-content, .workspace-active .main-content { padding: 0 12px calc(90px + env(safe-area-inset-bottom)); min-width: 0; }
  .page-header { position: sticky; top: 0; z-index: 90; margin: 0 -12px 14px; padding: calc(8px + env(safe-area-inset-top)) 12px 8px; background: #f7f5ed; border-bottom: 1px solid var(--line); }
  .page-header .eyebrow, .page-subtitle { display: none; }
  .page-header h1 { font-size: 22px; line-height: 1.3; margin: 0; }
  .header-actions { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 5px; justify-content: flex-start; }
  .header-actions .button { padding: 5px 8px; }
  .mobile-device-button { display: block; margin-top: 7px; width: 100%; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .gateway-picker .mobile-native-gateway-select { display: none; }
  .gateway-picker .mobile-gateway-trigger { display: block; grid-column: 1 / -1; width: 100%; min-width: 0; min-height: 47px; padding: 10px 12px; text-align: left; border: 2px solid var(--ink); border-radius: 3px; background: #fffdf6; color: var(--ink); font: inherit; font-size: 16px; font-weight: 700; white-space: normal; overflow-wrap: anywhere; }
  .view-heading { display: none; }
  button, .button, select, summary { min-height: 44px; }
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea { font-size: 16px !important; min-height: 44px; max-width: 100%; }
  label:has(input[type="checkbox"]), label:has(input[type="radio"]) { min-height: 44px; display: inline-flex; align-items: center; }
  .card-panel { padding: 16px; }
  .section-heading { gap: 8px; flex-wrap: wrap; }
  .section-heading h2 { font-size: 20px; }
  .task-center { top: auto; bottom: calc(74px + env(safe-area-inset-bottom)); right: 12px; z-index: 120; }
  .task-center.expanded { width: calc(100vw - 24px); max-width: 450px; }
  .task-center-panel { max-height: 62dvh; overflow: auto; }
  .task-center-toggle { min-height: 44px; }
  .display-tabs { display: flex; gap: 6px; overflow-x: auto; margin: 10px 0; padding-bottom: 3px; }
  .display-tab { flex: 0 0 auto; width: auto; min-height: 44px; padding: 8px 12px; }
  .display-tab span, .display-subtab span { display: none; }
  #display .display-subtabs { display: flex; flex-wrap: nowrap; width: 100%; overflow-x: auto; gap: 5px; }
  #display .display-subtab { flex: 0 0 auto; min-height: 44px; }
  .display-intro { display: none; }
  .plan-overview { padding: 12px; margin: 8px 0; }
  .plan-overview .eyebrow, .plan-choice { display: none; }
  .plan-overview h3 { font-size: 13px; margin: 0; }
  .gateway-art { display: none; }
  .gateway-panel { min-height: 0; }
  #screenDisplay .screen-template-main { width: 100%; min-width: 0; flex-basis: 100%; }
  #screenDisplay .screen-template-manage, #screenDisplay .screen-template-quick { min-width: 0; max-width: 100%; }
  .screen-topbar #screenName { width: 100%; }
  #screenDisplay:not(.desktop-editor-visible) > .screen-editor, #screenDisplay:not(.desktop-editor-visible) > .screen-actions, #screenDisplay:not(.desktop-editor-visible) > #screenPreview { display: none; }
  #screenEnterWorkspace { width: 100%; margin: 10px 0; min-height: 48px; background: #24543d; color: white; }
  .dc-field { flex: 1 1 100% !important; width: 100% !important; }
  .dc-fields-grid { gap: 10px; }
  .dc-city-search { grid-template-columns: minmax(0,1fr) auto; }
  .screen-schedule-form > label, .display-content-toolbar > label { min-width: 0; max-width: 100%; }
  .screen-template-manage > div { flex-wrap: wrap; }
  dialog { max-width: calc(100vw - 16px); max-height: calc(100dvh - 24px); overflow: auto; padding: 14px; }
  .crop-dialog, .image-preview-dialog { width: calc(100vw - 16px); }
  .crop-stage { height: 42dvh; min-height: 150px; }
  .rename-dialog-actions, .crop-toolbar { flex-wrap: wrap; }
  .preview-comparison, .almanac-preview, .screen-preview { display: block; }
  .preview-comparison figure, .almanac-preview figure, .screen-preview figure { width: 100%; max-width: none; }
  .preview-switch figure { width: 100%; }
  .preview-switch { display: flex; }
  .phone-preview .preview-alternate { display: none !important; }
  .toast, .processing-status { bottom: calc(85px + env(safe-area-inset-bottom)); max-width: calc(100vw - 24px); }
  .pwa-update-banner { bottom: calc(80px + env(safe-area-inset-bottom)); }
  .screen-properties .row { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .canvas-workspace-panels .screen-properties label { font-size: 12px; }
}

.account-security-header-link { display: none; }
@media (max-width: 700px), (max-height: 500px) and (pointer: coarse) {
  .side-nav #accountSecurityNav { display: none; }
  .header-actions .account-security-header-link:not([hidden]) {
    display: inline-flex; min-height: 44px; padding: 5px 8px;
    border: 1px solid var(--line); border-radius: 4px; color: var(--teal-dark);
    background: #fffdf6; font-size: 12px; white-space: nowrap; text-decoration: none;
  }
}
