/* Expanded camera hot bar and its Camera/Stream menus share one button shape.
   Loaded after every shell sheet: it owns button appearance only; the shell
   sheets keep placement of the dock, caption and panels. */
html[data-ui-shell] .tile:is(.expanded, :fullscreen) {
    --hotbar-height: 36px;
    --hotbar-face: rgba(255, 255, 255, .07);
    --hotbar-face-hover: rgba(255, 255, 255, .13);
    --hotbar-edge: rgba(255, 255, 255, .16);
    --hotbar-on-face: #126749;
    --hotbar-on-edge: #5ce4ad;
    --hotbar-on-text: #effff8;
}

/* One shape for the bar and every menu action. */
html[data-ui-shell] .tile:is(.expanded, :fullscreen) :is(.expanded-control-launchers, .expanded-control-panel) :is(button, a) {
    box-sizing: border-box;
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: auto;
    min-width: var(--hotbar-height);
    height: var(--hotbar-height);
    min-height: var(--hotbar-height);
    margin: 0;
    padding: 0 13px;
    color: var(--text);
    background: var(--hotbar-face);
    border: 1px solid var(--hotbar-edge);
    border-radius: 10px;
    box-shadow: none;
    font: 700 11px/1 system-ui, sans-serif;
    letter-spacing: .07em;
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 140ms ease-out, border-color 140ms ease-out, color 140ms ease-out;
}
html[data-ui-shell] .tile:is(.expanded, :fullscreen) :is(.expanded-control-launchers, .expanded-control-panel) :is(button, a):hover:not(:disabled) {
    background: var(--hotbar-face-hover);
}
html[data-ui-shell] .tile:is(.expanded, :fullscreen) .expanded-control-panel .rewind-button { text-transform: none; }
html[data-ui-shell] .tile:is(.expanded, :fullscreen) :is(.expanded-control-launchers, .expanded-control-panel) button:disabled {
    opacity: .5;
    cursor: default;
}
html[data-ui-shell] .tile:is(.expanded, :fullscreen) :is(.expanded-control-launchers, .expanded-control-panel) [hidden] {
    display: none !important;
}
html[data-ui-shell] .tile:is(.expanded, :fullscreen) :is(.expanded-control-launchers, .expanded-control-panel) button svg {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Icon-only buttons are square. */
html[data-ui-shell] .tile:is(.expanded, :fullscreen) :is(.expanded-control-launchers, .expanded-control-panel) :is(.fullscreen-toggle, .audio-toggle) {
    width: var(--hotbar-height);
    padding: 0;
    font-size: 17px;
}

/* Open menus and pressed modes use one highlighted state. */
html[data-ui-shell] .tile:is(.expanded, :fullscreen) :is(.expanded-control-launchers, .expanded-control-panel) :is(.is-open, [aria-pressed="true"]),
html[data-ui-shell] .tile:is(.expanded, :fullscreen) :is(.expanded-control-launchers, .expanded-control-panel) :is(.is-open, [aria-pressed="true"]):hover {
    color: var(--hotbar-on-text);
    background: var(--hotbar-on-face);
    border-color: var(--hotbar-on-edge);
}
html[data-ui-shell] .tile:is(.expanded, :fullscreen) .ptz-toggle::after { display: none; }

/* The bar itself: one rounded strip; PTZ mode extends it with its own group. */
html[data-ui-shell] .tile:is(.expanded, :fullscreen) .expanded-control-launchers {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 4px;
    padding: 4px;
    background: rgba(6, 10, 15, .74);
    border: 1px solid rgba(202, 230, 255, .18);
    border-radius: 14px;
    box-shadow: 0 10px 32px rgba(0, 0, 0, .45);
    backdrop-filter: blur(18px) saturate(1.2);
}
html[data-ui-shell] .tile:is(.expanded, :fullscreen) .expanded-control-launchers .expanded-controls-toggle {
    min-width: 0;
    border-color: transparent;
    background: transparent;
}
html[data-ui-shell] .tile:is(.expanded, :fullscreen) .expanded-control-launchers .expanded-controls-toggle:hover:not(.is-open) {
    background: var(--hotbar-face-hover);
}
html[data-ui-shell] .tile:is(.expanded, :fullscreen) .expanded-control-launchers .expanded-controls-toggle.is-open {
    background: var(--hotbar-on-face);
    border-color: var(--hotbar-on-edge);
}
html[data-ui-shell] .tile:is(.expanded, :fullscreen) .expanded-control-launchers .expanded-controls-toggle span { display: inline; }
html[data-ui-shell] .tile:is(.expanded, :fullscreen) .expanded-control-launchers .fullscreen-toggle {
    border-color: transparent;
    background: transparent;
}
html[data-ui-shell] .tile:is(.expanded, :fullscreen) .hotbar-ptz {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 2px;
    padding-left: 6px;
    border-left: 1px solid rgba(202, 230, 255, .18);
}
html[data-ui-shell] .tile:is(.expanded, :fullscreen) .hotbar-ptz[hidden] { display: none; }

/* Phones: PTZ mode keeps the bar on screen by showing Camera and Stream as icons. */
html[data-ui-shell="phone"] .tile:is(.expanded, :fullscreen) .expanded-control-launchers { justify-self: center; max-width: calc(100vw - 16px); }
html[data-ui-shell="phone"] .tile.ptz-hotbar .expanded-control-launchers .expanded-controls-toggle { width: var(--hotbar-height); padding: 0; }
html[data-ui-shell="phone"] .tile.ptz-hotbar .expanded-control-launchers .expanded-controls-toggle span { display: none; }
html[data-ui-shell="phone"] .tile.ptz-hotbar .hotbar-ptz button { gap: 5px; padding: 0 8px; font-size: 10px; letter-spacing: .04em; }
html[data-ui-shell="phone"] .tile.ptz-hotbar .hotbar-ptz { margin-left: 0; padding-left: 4px; }

/* Menu sections: consistent spacing and headings. */
html[data-ui-shell] .tile:is(.expanded, :fullscreen) .expanded-control-panel :is(.expanded-media-actions, .live-ptz-panel, .live-light-actions) {
    display: flex;
    flex-flow: row wrap;
    align-items: center;
    gap: 6px;
}
html[data-ui-shell] .tile:is(.expanded, :fullscreen) .expanded-control-panel .live-light button { flex: 0 0 auto; }
html[data-ui-shell] .tile:is(.expanded, :fullscreen) .expanded-control-panel .expanded-control-section { background: transparent; border-left: 0; padding-left: 0; }
html[data-ui-shell] .tile:is(.expanded, :fullscreen) .expanded-control-panel .desktop-audio-volume {
    min-height: var(--hotbar-height);
    border-radius: 10px;
}
html[data-ui-shell] .tile:is(.expanded, :fullscreen) .expanded-control-panel .ptz-journey,
html[data-ui-shell] .tile:is(.expanded, :fullscreen) .expanded-control-panel .ptz-journey.is-running {
    min-height: var(--hotbar-height) !important;
}

/* An open menu sits above the picture clock instead of underneath it. */
html[data-ui-shell] .tile:is(.expanded, :fullscreen):has(
    .expanded-control-panel:not([hidden]),
    .stream-control-panel:not([hidden])
) .frame-clock { visibility: hidden; }
html[data-ui-shell] .tile:is(.expanded, :fullscreen) :is(.expanded-control-panel, .stream-control-panel) { z-index: 30; }
