/* Compact landscape switch and assistant entry, scoped to the application bar. */
.mac-topbar .theme-switch-trigger {
    --theme-travel: 42px;
    width: 80px;
    height: 38px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: #b8dfed;
    box-shadow: inset 0 1px 3px #16384838, 0 0 0 1px #24455524, 0 3px 7px #122d3a14;
}

.mac-topbar .theme-switch-trigger:hover {
    background: #b8dfed;
    box-shadow: inset 0 1px 3px #16384838, 0 0 0 1px #24455536, 0 5px 10px #122d3a20;
}

.mac-topbar .theme-switch-track {
    width: 100%;
    height: 100%;
    padding: 0;
    border-radius: inherit;
    overflow: hidden;
    background: linear-gradient(180deg, #acd7e9, #dceff3);
    box-shadow: inset 0 2px 4px #2445552b;
    isolation: isolate;
}

.theme-switch-scenery {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.theme-scene-sun { fill: #fff5c7; }
.theme-scene-clouds { fill: #ffffffc4; }
.theme-scene-ridge { fill: #78a9b7; transition: fill 0.3s ease; }
.theme-scene-hills { fill: #4f899b; transition: fill 0.3s ease; }
.theme-scene-night { opacity: 0; transition: opacity 0.3s ease; }
.theme-scene-moon { fill: #eff6f4; }
.theme-scene-stars { fill: #d8e9ec; }

.mac-topbar .theme-switch-thumb {
    top: 4px;
    left: 4px;
    width: 30px;
    height: 30px;
    border: 0;
    background: linear-gradient(145deg, #ffffff, #edf1f2);
    transform: translateX(var(--theme-travel));
    box-shadow: 0 2px 5px #071c3559, inset 0 0 0 1px #ffffff;
    transition: transform 0.3s ease;
}

body[data-theme="dark"] .mac-topbar .theme-switch-trigger,
body[data-theme="dark"] .mac-topbar .theme-switch-trigger:hover {
    background: #102b39;
    box-shadow: inset 0 1px 3px #04101766, 0 0 0 1px #a2c9d329, 0 3px 7px #020d192e;
}

body[data-theme="dark"] .mac-topbar .theme-switch-track {
    background: linear-gradient(180deg, #102b39, #1b3947);
    box-shadow: inset 0 2px 4px #04101766;
}

body[data-theme="dark"] .theme-scene-sun,
body[data-theme="dark"] .theme-scene-clouds { opacity: 0; }
body[data-theme="dark"] .theme-scene-night { opacity: 1; }
body[data-theme="dark"] .theme-scene-ridge { fill: #456273; }
body[data-theme="dark"] .theme-scene-hills { fill: #6d8794; }

body[data-theme="dark"] .mac-topbar .theme-switch-thumb {
    transform: translateX(0);
    background: linear-gradient(145deg, #ffffff, #e7edef);
    box-shadow: 0 2px 5px #020d1959, inset 0 0 0 1px #ffffff;
}

.mac-topbar .orion-assistant-launch {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    height: 38px;
    padding: 3px 11px 3px 4px;
    gap: 8px;
    border: 1px solid #173c4b;
    border-radius: 999px;
    background: radial-gradient(ellipse at 20% 0, #74bdb655, transparent 55%), linear-gradient(120deg, #163544, #286055);
    color: #f2faf8;
    font-weight: 600;
    box-shadow: inset 0 1px 0 #ffffff40, inset 0 -1px 0 #041a2633, 0 3px 7px #173b3024;
}

.mac-topbar .orion-assistant-launch:hover {
    background: radial-gradient(ellipse at 20% 0, #a4e3d866, transparent 60%), linear-gradient(120deg, #204654, #2d6b5b);
    border-color: #275666;
    box-shadow: inset 0 1px 0 #ffffff55, inset 0 -1px 0 #041a2633, 0 5px 12px #173b3033;
}

.mac-topbar .orion-assistant-launch::before { content:""; position:absolute; inset:0; z-index:-1; opacity:.65; background:radial-gradient(circle at 39% 17%,#dcf9f0 0 .6px,transparent 1px),radial-gradient(circle at 85% 76%,#b4e2dc 0 .7px,transparent 1.2px),radial-gradient(circle at 75% 18%,#dcf9f0 0 .5px,transparent 1px); }
.orion-assistant-launch-arrow { width:13px; height:13px; flex:0 0 auto; opacity:.65; transition:transform .2s ease,opacity .2s ease; }
.mac-topbar .orion-assistant-launch:hover .orion-assistant-launch-arrow { transform:translate(1px,-1px); opacity:1; }

.orion-assistant-launch-icon {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 22%, #effff7aa, #8bc8b34d 34%, #22514c 80%);
    color: #e2fff0;
    box-shadow: inset 0 1px 2px #e6fff680, inset 0 -2px 4px #092b3c66, 0 2px 4px #061e3270;
}

.orion-assistant-launch-icon svg { width: 30px; height: 30px; }
.assistant-orb-core { fill:#b1ebd522; stroke:#e4fff533; stroke-width:.6; }
.assistant-orb-ring { stroke:#c8f4e8cc; stroke-width:.8; }
.assistant-orb-spark { fill:#edfff6; }
.assistant-orb-light { fill:#effff980; }

body[data-theme="dark"] .mac-topbar .orion-assistant-launch {
    color: #e1f5f5;
    border-color: #7fa9b540;
    background: radial-gradient(ellipse at 20% 0, #579bb14d, transparent 55%),linear-gradient(120deg, #183345, #255361);
    box-shadow: inset 0 1px 0 #ffffff20, inset 0 -1px 0 #041a2640, 0 3px 7px #020d1940;
}

body[data-theme="dark"] .mac-topbar .orion-assistant-launch:hover {
    border-color: #a2d4d870;
    background: radial-gradient(ellipse at 20% 0, #79c3cf55, transparent 55%),linear-gradient(120deg, #22465a, #306574);
}

body[data-theme="dark"] .orion-assistant-launch-icon {
    color: #e0f6ff;
    background: radial-gradient(circle at 30% 22%, #deefffaa, #88c1d94d 34%, #244d66 80%);
    box-shadow: inset 0 1px 2px #e1f4ff80, inset 0 -2px 4px #09203c66, 0 2px 4px #061e3270;
}

@media (max-width: 700px) {
    .mac-topbar .theme-switch-trigger { --theme-travel: 32px; width: 66px; height: 34px; }
    .mac-topbar .theme-switch-thumb { width: 26px; height: 26px; }
    .mac-topbar .orion-assistant-launch { height: 34px; padding: 3px 10px 3px 3px; gap: 6px; }
    .orion-assistant-launch-icon { width: 26px; height: 26px; }
    .orion-assistant-launch-icon svg { width: 26px; height: 26px; }
}

@media (max-width: 420px) {
    .mac-topbar .orion-assistant-launch { font-size: 0.7rem; padding-right: 8px; gap: 5px; }
    .orion-assistant-launch-icon { width: 24px; height: 24px; }
    .orion-assistant-launch-icon svg { width: 24px; height: 24px; }
    .orion-assistant-launch-arrow { display:none; }
    .mac-topbar #server-indicator { width: 34px; padding: 0; justify-content: center; }
    .mac-topbar #server-indicator::after { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .mac-topbar .theme-switch-thumb,
    .theme-scene-night,
    .theme-scene-ridge,
    .theme-scene-hills,
    .orion-assistant-launch-arrow { transition: none; }
}
