.employee-office-page {
    --office-night: #071927;
    --office-wall: #102c3c;
    --office-wood: #b9793e;
    --office-wood-light: #e1a45d;
    --office-cyan: #71ddec;
}

/* Game chrome keeps the office map visually separate from the administration pages around it. */
.office-game-hud {
    overflow: hidden;
    margin-bottom: .65rem;
    color: #edf4f7;
    background: linear-gradient(135deg, #102b3b 0%, #142235 70%, #211b35 100%);
    border: 1px solid rgba(123, 199, 211, .28);
    border-radius: 12px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, .25), inset 0 1px rgba(255, 255, 255, .05);
}

.office-game-titlebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .7rem 1rem .55rem;
    border-bottom: 1px solid rgba(155, 190, 203, .16);
}

.office-game-eyebrow {
    color: #73deeb;
    font: 700 .7rem/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
    letter-spacing: .16em;
}

.office-game-titlebar h1 {
    margin: .35rem 0 .15rem;
    font-size: clamp(1.35rem, 2.4vw, 1.8rem);
    line-height: 1.1;
    font-weight: 800;
}

.office-game-titlebar p {
    margin: 0;
    color: #b8c9d0;
    font-size: .8rem;
}

.office-game-actions { display: flex; gap: .65rem; flex-shrink: 0; }

/* RTS-style resources stay first in the HUD, with source and asset kept explicit. */
.office-resource-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: .45rem;
    padding: .7rem 1rem .2rem;
}

.office-resource-card {
    display: flex;
    min-width: 170px;
    align-items: center;
    gap: .5rem;
    padding: .35rem .6rem;
    background: linear-gradient(135deg, rgba(4, 16, 28, .76), rgba(8, 27, 39, .55));
    border: 1px solid rgba(124, 165, 181, .2);
    border-radius: 10px;
}

.office-resource-icon {
    display: grid;
    width: 29px;
    height: 29px;
    flex: 0 0 29px;
    place-items: center;
    color: #201706;
    background: radial-gradient(circle at 35% 28%, #fff1ad, #e2a842 62%, #92602a);
    border: 2px solid #f3cf75;
    border-radius: 50%;
    box-shadow: inset 0 0 0 2px rgba(97, 58, 12, .32), 0 2px 8px rgba(0, 0, 0, .3);
    font: 900 1rem/1 Georgia, serif;
}

.resource-mexc .office-resource-icon { color: #071c25; background: linear-gradient(145deg, #b6f4eb, #55b7ae 65%, #247b80); border-color: #8ae3da; }
.resource-other .office-resource-icon { color: #241533; background: linear-gradient(145deg, #e5c5ff, #ad76e8 65%, #6641a5); border-color: #c89cff; }
.office-resource-copy { display: grid; min-width: 0; gap: .03rem; }
.office-resource-copy > span { color: #bacbd1; font: 700 .63rem/1.1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .09em; text-transform: uppercase; }
.office-resource-copy strong { color: #fff0b1; font-size: 1.03rem; line-height: 1.15; font-variant-numeric: tabular-nums; }
.resource-mexc .office-resource-copy strong { color: #a9eee4; }
.resource-other .office-resource-copy strong { color: #d8baff; }
.office-resource-copy small { color: #829ba5; font-size: .65rem; }

.office-game-stats {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: .65rem;
    padding: .35rem .75rem .4rem;
}

.office-game-stat {
    display: grid;
    min-height: 60px;
    align-content: center;
    gap: .12rem;
    padding: .4rem .65rem;
    background: rgba(4, 16, 28, .54);
    border: 1px solid rgba(124, 165, 181, .18);
    border-radius: 12px;
}

.office-game-stat span {
    color: #b8c9d0;
    font: 700 .68rem/1.1 ui-monospace, SFMono-Regular, Menlo, monospace;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.office-game-stat strong { color: #f1f5f7; font-size: 1.28rem; line-height: 1.05; font-variant-numeric: tabular-nums; }
.office-game-stat small { color: #839da8; font-size: .65rem; }
.office-game-stat.stat-working strong { color: #6fe1bd; }
.office-game-stat.stat-queue strong { color: #ffd16d; }
.office-game-stat.stat-failed strong { color: #ff8c83; }
.office-game-stat.stat-success strong { color: #83e3a2; }

.office-game-footnote {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: .2rem .85rem .55rem;
    color: #90a7b1;
    font-size: .72rem;
}

.office-live-state { color: #ffc56c; font-weight: 700; text-transform: capitalize; }
.office-live-state.is-live { color: #81e0aa; }

/* The map frame gives the isometric office a fixed game viewport instead of growing the page with its world. */
.employee-office-game-frame {
    overflow: hidden;
    background: #071927;
    border: 1px solid rgba(104, 183, 197, .4);
    border-radius: 16px;
    box-shadow: 0 18px 48px rgba(0, 0, 0, .32), inset 0 1px rgba(255, 255, 255, .04);
}

.office-map-titlebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 42px;
    padding: .4rem .9rem;
    color: #d9e7eb;
    background: linear-gradient(90deg, #123448, #17263b);
    border-bottom: 1px solid rgba(104, 183, 197, .25);
    font: 700 .72rem/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.office-map-titlebar > span:first-child { display: flex; align-items: center; gap: .5rem; }
.office-map-titlebar .mud-icon-root { width: 18px; height: 18px; color: #74deeb; }
.office-map-hint { color: #7f9ba7; font-size: .62rem; }
.office-map-hint i { padding: 0 .35rem; color: #d39a57; font-style: normal; }
.office-map-tools, .office-camera-controls { display: flex; align-items: center; gap: .3rem; }
.office-camera-controls { padding: .1rem .25rem; background: rgba(4, 16, 28, .42); border: 1px solid rgba(104, 183, 197, .2); border-radius: 8px; }
.office-camera-controls .mud-icon-button { color: #b9d5dc; }

.employee-office-pan {
    position: relative;
    display: grid;
    place-items: center;
    width: 100%;
    height: min(78dvh, 900px);
    min-height: 500px;
    overflow: hidden;
    overscroll-behavior: contain;
    touch-action: none;
    cursor: grab;
    user-select: none;
    background-color: #071927;
}

.employee-office-pan.is-panning { cursor: grabbing; }
.employee-office-pan:focus-visible { outline: 2px solid #71ddec; outline-offset: -3px; }
.employee-office-pan svg { user-select: none; }
.employee-office-pan .office-desk { cursor: pointer; }

.employee-office-scene {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    image-rendering: auto;
}

.employee-office-scene > svg > image { image-rendering: auto; }

/* The renderer uses a fixed orthographic scale; the same canvas owns grid, walls, sprites, and picking. */
.employee-office-engine { display: block; width: 100%; height: 100%; image-rendering: pixelated; touch-action: none; cursor: grab; }
.employee-office-engine:active { cursor: grabbing; }
.employee-office-engine:focus-visible { outline: 2px solid #71ddec; outline-offset: -4px; }
.office-room-editor {
    position: absolute;
    z-index: 4;
    top: 82px;
    left: 50%;
    display: flex;
    align-items: center;
    gap: .55rem;
    max-width: calc(100vw - 24px);
    padding: .45rem .65rem;
    color: #eaf4f2;
    background: rgba(6, 23, 32, .95);
    border: 1px solid rgba(113, 221, 236, .45);
    border-radius: 10px;
    transform: translateX(-50%);
}
.office-editor-hint { color: #a8c0c8; font-size: .72rem; }
.office-room-editor { flex-wrap: wrap; justify-content: center; }
.office-editor-plant-select { min-width: 165px; max-width: 210px; }
.office-game-screen.is-editing .employee-office-pan { inset-block-start: 132px; }

/* Reveal the first scene only after layout data and sprites are ready. */
.office-map-loading {
    position: absolute;
    z-index: 4;
    inset: 78px 0 92px;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 10px;
    color: #eaf4f2;
    background: radial-gradient(ellipse at 50% 48%, #123243 0%, #071c28 62%, #04131c 100%);
    text-align: center;
}
.office-map-loading strong { font-size: 1rem; letter-spacing: .03em; }
.office-map-loading small { color: #9ab7c0; font-size: .78rem; }
.office-map-loading-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(113, 221, 236, .24);
    border-top-color: #71ddec;
    border-radius: 50%;
    animation: office-map-loading-spin .8s linear infinite;
}
@keyframes office-map-loading-spin { to { transform: rotate(360deg); } }

/* The floor grid is a placement lattice, not a second floor texture; keep it readable but let desks own the foreground. */
.office-room-grid {
    fill: none;
    stroke: rgba(113, 221, 236, .34);
    stroke-width: 1.25;
    stroke-dasharray: 3 3;
    pointer-events: none;
}

.office-desk-snap-cell {
    fill: rgba(113, 221, 236, .07);
    stroke: rgba(113, 221, 236, .48);
    stroke-width: 1.5;
    pointer-events: none;
}

/* Native SVG avoids foreignObject compositor failures and shares the room's clipping and scale rules. */
.office-worker-sprite-window { overflow: hidden; pointer-events: none; }
.office-worker-sprite-sheet {
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    transform-box: fill-box;
    transform-origin: 0 0;
    animation: office-atlas-loop 1.2s steps(5, end) infinite;
}
.sprite-idle .office-worker-sprite-sheet, .sprite-waiting .office-worker-sprite-sheet,
.sprite-thinking .office-worker-sprite-sheet, .sprite-sleeping .office-worker-sprite-sheet,
.sprite-offline .office-worker-sprite-sheet { animation: none; }
.sprite-research .office-worker-sprite-sheet { animation-duration: 1.8s; }
.sprite-failed .office-worker-sprite-sheet, .sprite-success .office-worker-sprite-sheet { animation-duration: 1.8s; }
@keyframes office-atlas-loop { from { transform: translateX(0); } to { transform: translateX(-83.333333%); } }
@media (prefers-reduced-motion: reduce) { .office-worker-sprite-sheet { animation: none !important; transform: none; } }

.office-plant-cell { fill: rgba(113, 221, 236, .04); stroke: rgba(113, 221, 236, .18); stroke-width: 1; pointer-events: none; }
.office-plant-sprite { pointer-events: none; image-rendering: auto; }

/* Idle/rest motion belongs to steam and Zs, not a full-body atlas shuffle. */
.office-coffee-steam { fill: none; stroke: #fff2d5; stroke-width: 2.5; stroke-linecap: round; opacity: 0; animation: office-steam-rise 1.8s ease-out infinite; }
.office-coffee-steam path:nth-child(2) { animation: office-steam-rise 1.8s .8s ease-out infinite; }
@keyframes office-steam-rise { 0% { opacity: 0; transform: translateY(5px) scale(.8); } 25% { opacity: .9; } 100% { opacity: 0; transform: translateY(-12px) scale(1.15); } }

.office-trash-wrap { position: relative; width: 100%; height: 100%; }
.office-trash-sprite {
    position: absolute;
    inset: 0;
    background-repeat: no-repeat;
    background-size: 300% 200%;
    background-position: var(--trash-frame-x, 0%) var(--trash-frame-y, 0%);
    image-rendering: auto;
}
.office-trash-sprite {
    width: 100%;
    height: 100%;
    background-image: url("../../images/agent-office/trashcan-states.png");
}
.office-trash-unknown { position: absolute; right: -1px; bottom: 0; display: grid; width: 16px; height: 16px; place-items: center; color: #071927; background: #f0c66f; border: 1px solid #fff0bd; border-radius: 50%; font: 900 11px/1 ui-monospace, monospace; }

.office-success-sparkles { fill: #a6f1ad; stroke: #153d35; stroke-width: 1.2; paint-order: stroke; font: bold 16px monospace; }
.office-success-sparkles path { fill: none; stroke: #a6f1ad; stroke-width: 2; }

.office-desk {
    cursor: pointer;
    outline: none;
}

.office-desk:focus .office-worker-sprite-sheet,
.office-desk:hover .office-worker-sprite-sheet {
    filter: drop-shadow(0 0 6px #f7d68d) drop-shadow(1px 3px 2px rgba(0, 0, 0, .38));
}

.office-selected .office-desk-snap-cell { fill: rgba(249, 209, 119, .17); stroke: #f9d177; stroke-width: 3; }

/* A small live badge keeps queue health readable without drawing fake furniture around the sprites. */
.office-job-tally rect {
    fill: #102534;
    stroke: #d39a57;
    stroke-width: 1.5;
}

.office-job-tally text {
    font: bold 11px monospace;
}

.office-tally-queue { fill: #ffd26f; }
.office-tally-failed { fill: #ff8d7e; }
.office-tally-success { fill: #92e5a1; }

.office-thought-bitmap { image-rendering: pixelated; image-rendering: crisp-edges; pointer-events: none; }
.office-thought-bubble text { fill: #17202a; font: 900 13px ui-monospace, monospace; }

.office-person-label {
    fill: #fff0c9;
    stroke: #112a36;
    stroke-width: 3px;
    paint-order: stroke;
    font: bold 14px monospace;
}

/* Details float over the map without stealing the camera or closing the floor underneath. */
.office-selection-panel {
    position: absolute;
    z-index: 3;
    top: 1rem;
    right: 1rem;
    display: grid;
    width: min(390px, calc(100% - 2rem));
    max-height: calc(100% - 2rem);
    gap: .9rem;
    overflow: auto;
    padding: 1rem;
    color: #edf4f7;
    background: rgba(12, 29, 43, .97);
    border: 1px solid rgba(113, 221, 236, .48);
    border-radius: 14px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .45);
}

.office-selection-head { display: flex; align-items: center; gap: .7rem; }
.office-selection-head .mud-avatar { width: 48px; height: 48px; min-width: 48px; flex: 0 0 48px; }
.office-selection-head .mud-avatar img { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
.office-selection-head > div { display: grid; min-width: 0; flex: 1; }
.office-selection-head strong { font-size: 1rem; }
.office-selection-head span, .office-selection-current p { color: #a9bec8; font-size: .82rem; }
.office-selection-current { display: grid; gap: .3rem; padding: .8rem; background: rgba(4, 16, 28, .58); border-radius: 10px; }
.office-selection-current > span { color: #70ddeb; font: 700 .65rem ui-monospace, monospace; letter-spacing: .12em; }
.office-selection-current > strong { font-size: .95rem; }
.office-selection-current p { margin: 0; }
.office-selection-metrics { display: flex; flex-wrap: wrap; gap: .5rem; color: #b9cbd2; font-size: .77rem; }
.office-selection-metrics span { display: flex; gap: .3rem; align-items: center; padding: .35rem .5rem; background: rgba(4, 16, 28, .55); border-radius: 7px; }
.office-selection-metrics b { color: #fff; }

.employee-office-roster { overflow: hidden; }

.employee-office-roster img,
.employee-office-dialog-head img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    image-rendering: pixelated;
}

.employee-office-dialog .mud-dialog-content {
    max-height: min(76dvh, 900px);
    overflow-y: auto;
}

/* Job history is a real audit table; keep its task column readable inside the wide dialog. */
.mud-dialog.employee-office-dialog {
    width: min(960px, calc(100vw - 32px));
    max-width: calc(100vw - 32px);
}
.employee-office-jobs-table-desktop { display: block; }
.employee-office-jobs-mobile { display: none; }
.employee-office-jobs-table .mud-table-container { overflow-x: auto; }
.employee-office-jobs-table .mud-table-root { min-width: 760px; table-layout: fixed; }
.employee-office-jobs-table th:nth-child(1), .employee-office-jobs-table td:nth-child(1) { width: 150px; }
.employee-office-jobs-table th:nth-child(2), .employee-office-jobs-table td:nth-child(2) {
    width: 42%;
    overflow-wrap: break-word;
    word-break: normal;
}
.employee-office-jobs-table th:nth-child(3), .employee-office-jobs-table td:nth-child(3) { width: 100px; }
.employee-office-jobs-table th:nth-child(4), .employee-office-jobs-table td:nth-child(4) { width: 90px; }
.employee-office-jobs-table th:nth-child(5), .employee-office-jobs-table td:nth-child(5) { width: 96px; }

/* The desktop table keeps its audit columns; narrow dialogs use complete stacked records. */
@media (max-width: 700px) {
    .employee-office-jobs-table-desktop { display: none; }
    .employee-office-jobs-mobile { display: grid; gap: .55rem; }
    .employee-office-job-card {
        min-width: 0;
        padding: .7rem;
        border: 1px solid rgba(127, 155, 168, .35);
        border-radius: .65rem;
        background: rgba(4, 16, 28, .45);
    }
    .employee-office-job-card header,
    .employee-office-job-card footer {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: .5rem;
    }
    .employee-office-job-card header { color: #b9cbd2; font-size: .78rem; }
    .employee-office-job-card p {
        margin: .6rem 0;
        overflow-wrap: anywhere;
        line-height: 1.35;
    }
    .employee-office-job-card footer { font-size: .8rem; }
}

.employee-office-dialog-head {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(127, 155, 168, .25);
}

.employee-office-log {
    max-height: 55dvh;
    overflow: auto;
    padding: .75rem;
    border: 1px solid rgba(127, 155, 168, .25);
    border-radius: .75rem;
}

.employee-office-log-entry {
    display: grid;
    gap: .35rem;
    margin: .6rem 0;
    padding: .7rem;
    border-left: 3px solid #43adba;
    background: rgba(80, 140, 150, .08);
}

.employee-office-log-entry time {
    color: #8caab2;
    font-size: .78rem;
}

.employee-office-log-entry pre {
    max-height: 260px;
    overflow: auto;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

@media (max-width: 1000px) {
    .office-game-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}


/* The employee office is an immersive game route, so the app's admin gutters and navigation must get out of the world. */
.shell-drawer-container:has(.employee-office-page) .vscode-sidebar,
.shell-drawer-container:has(.employee-office-page) .shell-mobile-menu-bar { display: none !important; }
.shell-main:has(.employee-office-page) .shell-main-atmosphere { display: none; }
.shell-main .content:has(.employee-office-page) {
    width: 100%;
    max-width: none;
    height: 100%;
    min-height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden !important;
    box-shadow: none;
}
.employee-office-page { width: 100%; height: 100%; min-height: 0; padding: 0; background: #061722; }

/* This route is a game, not a card inside the admin shell. Fixed viewport ownership avoids
   percentage-height collapse in MudMainContent and lets the camera use every screen pixel. */
.office-game-screen {
    position: fixed;
    z-index: 1000;
    inset: 0;
    isolation: isolate;
    width: 100vw;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
    background: radial-gradient(ellipse at 50% 48%, #123243 0%, #071c28 62%, #04131c 100%);
}
.employee-office-pan {
    position: absolute;
    z-index: 0;
    /* Keep all map art visible while the RTS HUD and command dock float above it. */
    inset: 78px 0 92px;
    display: block;
    width: auto;
    height: auto;
    min-height: 0;
    /* Floor grid appears only in editor mode and follows the room's isometric projection. */
}
.employee-office-scene { width: 100%; height: 100%; max-width: none; }

/* RTS chrome is pinned above the map: resources at left, world actions at right. */
.office-rts-hud {
    position: absolute;
    z-index: 5;
    inset: 12px 16px auto;
    display: flex;
    min-height: 62px;
    align-items: center;
    gap: 14px;
    padding: 8px 12px;
    color: #eaf4f2;
    background: linear-gradient(100deg, rgba(7, 24, 34, .94), rgba(14, 34, 48, .91));
    border: 1px solid rgba(117, 186, 191, .48);
    border-radius: 12px;
    box-shadow: 0 8px 26px rgba(0, 0, 0, .42), inset 0 1px rgba(255, 255, 255, .09);
    backdrop-filter: blur(12px);
}
.office-game-brand { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; color: #b8e6e5; font: 800 .7rem/1 ui-monospace, monospace; letter-spacing: .12em; white-space: nowrap; }
.office-game-brand .mud-icon-root { color: #72d4da; font-size: 21px; }
.office-live-dot { width: 8px; height: 8px; border-radius: 50%; background: #d99d52; box-shadow: 0 0 9px currentColor; }
.office-live-dot.is-live { color: #62dfa9; background: currentColor; }
.office-resource-strip { display: flex; min-width: 0; flex: 1 1 auto; flex-wrap: nowrap; align-items: center; gap: 5px; overflow-x: auto; scrollbar-width: none; }
.office-resource { display: flex; min-width: 88px; align-items: center; gap: 7px; padding: 3px 8px; border-right: 1px solid rgba(149, 185, 191, .15); }
.office-resource > span:last-child { display: grid; gap: 1px; }
.resource-tao { min-width: 190px; }
.office-tao-value { display: grid; min-width: 0; gap: 2px; }
.office-tao-value strong { font-size: .76rem; }
.office-tao-value small { font-size: .5rem; }
.resource-emblem { display: grid; width: 30px; height: 30px; flex: 0 0 30px; place-items: center; color: #342409; background: radial-gradient(circle at 32% 28%, #fff3bc, #e8b84f 60%, #a46c29); border: 2px solid #f2d178; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(90, 53, 11, .28), 0 2px 8px #0008; font: 900 1rem Georgia, serif; }
.resource-mexc .resource-emblem { color: #092c30; background: radial-gradient(circle at 32% 28%, #c9fff4, #52c6b8 62%, #247d7b); border-color: #9aeee1; }
.resource-other .resource-emblem { color: #291439; background: radial-gradient(circle at 32% 28%, #f1ddff, #b988e8 62%, #6c43a8); border-color: #d8b7ff; }
.office-resource small { color: #91aeb5; font: 800 .58rem/1 ui-monospace, monospace; letter-spacing: .1em; }
.office-resource strong { color: #fff0b2; font: 800 1rem/1.1 ui-monospace, monospace; }
.resource-mexc strong { color: #a7eee1; }
.resource-other strong { color: #d4b2f5; }
.office-resource-divider { width: 1px; height: 34px; flex: 0 0 1px; margin: 0 6px; background: rgba(149, 185, 191, .25); }
.office-population { display: flex; align-items: center; gap: 5px; padding: 0 9px; color: #9ee9d2; font: 800 1rem ui-monospace, monospace; }
.office-population .mud-icon-root { font-size: 21px; }
.office-live-state { padding-inline: 8px; color: #e1b269; font: 700 .62rem ui-monospace, monospace; text-transform: uppercase; }
.office-live-state.is-live { color: #77dfa5; }
.office-game-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 2px; }
.office-game-actions .mud-icon-button { width: 42px; height: 42px; color: #d7e8e8; }
.office-game-actions .mud-icon-button:hover { color: #fff3bd; background: rgba(255, 255, 255, .08); }
.office-game-actions .mud-icon-button:first-child { color: #fff; background: linear-gradient(135deg, #8842ec, #4d68ef); border: 1px solid rgba(209, 168, 255, .68); border-radius: 10px; }

/* The error is a small recoverable toast; it no longer pushes the map down or becomes a page banner. */
.office-error-toast { position: absolute; z-index: 6; top: 88px; left: 50%; display: flex; max-width: min(720px, calc(100% - 32px)); align-items: center; gap: 8px; transform: translateX(-50%); padding: 5px 10px; color: #ffd5d0; background: rgba(68, 27, 34, .94); border: 1px solid #b95560; border-radius: 9px; box-shadow: 0 5px 18px #0008; font-size: .78rem; }
.office-error-toast > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.office-error-toast .mud-icon-root { color: #ff8e86; }
.office-error-toast .mud-icon-button { width: 32px; height: 32px; margin-left: auto; color: #ffd5d0; }
.office-empty-state { position: absolute; z-index: 4; inset: 50% auto auto 50%; display: grid; justify-items: center; gap: 10px; transform: translate(-50%, -50%); padding: 24px 30px; color: #eaf4f2; background: #0b202deF; border: 1px solid #4f939b; border-radius: 14px; box-shadow: 0 16px 36px #0009; text-align: center; }
.office-empty-state > .mud-icon-root { color: #75dce1; font-size: 36px; }
.office-empty-state > span { color: #a7bdc3; }

/* Job details and employee selection behave like game panels, not more page sections. */
.office-selection-panel { top: 88px; right: 16px; width: min(370px, calc(100% - 32px)); max-height: calc(100% - 184px); }
.office-roster-panel { position: absolute; z-index: 7; top: 84px; left: 16px; display: grid; width: min(320px, calc(100% - 32px)); max-height: calc(100% - 180px); gap: 4px; overflow: auto; padding: 10px; color: #eef5f3; background: rgba(9, 27, 38, .97); border: 1px solid rgba(117, 186, 191, .55); border-radius: 12px; box-shadow: 0 12px 36px #0009; }
.office-roster-panel > header { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 7px 8px; border-bottom: 1px solid rgba(149, 185, 191, .2); }
.office-roster-entry { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; color: inherit; background: transparent; border: 1px solid transparent; border-radius: 8px; text-align: left; }
.office-roster-entry:hover, .office-roster-entry.is-selected { background: rgba(94, 164, 175, .16); border-color: rgba(117, 186, 191, .4); }
.office-roster-entry img { width: 38px; height: 38px; object-fit: contain; image-rendering: pixelated; border-radius: 8px; }
.office-roster-entry span { display: grid; min-width: 0; flex: 1; gap: 2px; }
.office-roster-entry small { overflow: hidden; color: #a8bdc2; text-overflow: ellipsis; white-space: nowrap; }
.office-roster-entry i, .office-command-person i { width: 8px; height: 8px; border-radius: 50%; background: #9aabb1; }
.office-roster-entry i.is-working, .office-command-person i.is-working { background: #62dfa9; box-shadow: 0 0 8px #62dfa9; }

/* Bottom dock carries selection and status without consuming a second dashboard row. */
.office-command-dock { position: absolute; z-index: 5; inset: auto 16px 12px; display: flex; min-height: 70px; align-items: center; gap: 14px; padding: 8px 12px; color: #eaf4f2; background: linear-gradient(100deg, rgba(7, 24, 34, .95), rgba(14, 34, 48, .93)); border: 1px solid rgba(117, 186, 191, .45); border-radius: 12px; box-shadow: 0 8px 26px #0008, inset 0 1px #ffffff12; backdrop-filter: blur(12px); }
.office-command-employees { display: flex; flex: 0 0 auto; align-items: center; gap: 6px; padding-right: 10px; border-right: 1px solid rgba(149, 185, 191, .2); }
.office-command-person { position: relative; width: 44px; height: 44px; padding: 2px; overflow: visible; background: #142e3b; border: 1px solid #456674; border-radius: 8px; }
.office-command-person.is-selected { border: 2px solid #e9c56d; box-shadow: 0 0 12px #e9c56d55; }
.office-command-person img { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; border-radius: 5px; }
.office-command-person i { position: absolute; right: -3px; bottom: -3px; border: 1px solid #102a34; }
.office-command-status { display: grid; min-width: 0; flex: 1 1 auto; gap: 3px; }
.office-command-status strong { overflow: hidden; font-size: .85rem; text-overflow: ellipsis; white-space: nowrap; }
.office-command-status strong span, .office-command-status small { color: #9ab2b8; }
.office-command-status small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.office-camera-controls { display: flex; flex: 0 0 auto; align-items: center; gap: 0; padding: 2px; background: rgba(3, 15, 24, .62); border: 1px solid rgba(117, 186, 191, .28); border-radius: 9px; }
.office-camera-controls .mud-icon-button { width: 34px; height: 34px; color: #c6dfe0; }
.office-updated-time { padding: 0 6px; color: #83a0a8; font: .65rem ui-monospace, monospace; }

@media (max-width: 1199.98px) {
    .shell-main .content:has(.employee-office-page) { padding-top: 0 !important; }
}
@media (max-width: 900px) {
    .employee-office-pan { inset: 68px 0 78px; }
    /* A three-column HUD prevents MudTooltip wrappers from stretching the action row
       and stealing the resource rail at phone widths. */
    .office-rts-hud { inset: 8px 8px auto; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; min-height: 56px; gap: 5px; padding: 5px 7px; }
    .office-game-brand span, .office-live-state, .office-resource-divider, .office-population { display: none; }
    .office-game-brand { gap: 3px; }
    /* Keep the resource cards on one horizontal rail; wrapping made the HUD taller than its controls on narrow phones. */
    .office-resource-strip { min-width: 0; flex: initial; flex-wrap: nowrap; gap: 2px; overflow-x: auto; }
    .office-resource { min-width: 48px; gap: 3px; padding: 2px 3px; }
    .resource-tao { min-width: 138px; gap: 3px; }
    .office-tao-value strong { font-size: .64rem; }
    .office-tao-value small { font-size: .45rem; }
    .resource-emblem { width: 25px; height: 25px; flex-basis: 25px; }
    .office-resource strong { font-size: .82rem; }
    .office-game-actions { width: auto; min-width: max-content; flex: initial; justify-content: flex-end; gap: 0; }
    .office-game-actions > * { width: 35px; min-width: 35px; flex: 0 0 35px; }
    .office-game-actions .mud-icon-button { width: 35px; min-width: 35px; height: 38px; padding: 0; }
    .office-error-toast { top: 72px; }
    .office-command-dock { inset: auto 8px 8px; min-height: 62px; gap: 7px; padding: 6px; }
    .office-command-person { width: 37px; height: 37px; }
    .office-command-employees { gap: 4px; padding-right: 5px; }
    .office-camera-controls .mud-icon-button { width: 30px; height: 32px; }
    .office-updated-time { display: none; }
    .office-selection-panel { top: 72px; right: 8px; max-height: calc(100% - 150px); }
    .office-roster-panel { top: 72px; left: 8px; max-height: calc(100% - 148px); }
    .office-map-loading { inset: 68px 0 78px; }
}

@media (max-width: 720px) {
    /* Six RTS actions and three live balances cannot share a row on compact phones.
       Separate the rails so the last resource never sits underneath a tooltip button. */
    .employee-office-pan { inset: 104px 0 78px; }
    .office-rts-hud {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: 38px 34px;
        min-height: 82px;
        gap: 2px;
        padding: 4px 6px;
    }
    .office-game-brand { display: none; }
    .office-game-actions { grid-row: 1; grid-column: 1; justify-content: flex-end; }
    .office-resource-strip { grid-row: 2; grid-column: 1; width: 100%; overflow: hidden; }
    .resource-tao { min-width: 138px; flex: 0 1 138px; }
    .office-resource { flex: 0 1 88px; }
}

@media (max-width: 520px) {
    .office-rts-hud { gap: 2px; padding-inline: 5px; }
    .office-game-actions > * { width: 31px; min-width: 31px; flex-basis: 31px; }
    .office-game-actions .mud-icon-button { width: 31px; min-width: 31px; }
    /* Keep all balances visible without shrinking labels to unreadable 5px text. */
    .office-resource-strip {
        display: grid;
        grid-template-columns: minmax(132px, 1.45fr) repeat(2, minmax(78px, .8fr));
        gap: 3px;
        overflow: hidden;
        padding-inline: 0;
    }
    .office-resource { min-width: 0; gap: 3px; padding: 2px 3px; }
    .resource-tao { min-width: 0; }
    .resource-emblem { width: 18px; height: 18px; flex-basis: 18px; border-width: 1px; font-size: .68rem; }
    .office-tao-value { gap: 0; }
    .office-tao-value small,
    .office-resource:not(.resource-tao) small { font-size: 9px; line-height: 1.1; letter-spacing: 0; }
    .office-tao-value strong { font-size: 11px; line-height: 1.1; letter-spacing: -.03em; }
    .office-resource:not(.resource-tao) strong { font-size: 11px; }
    .office-room-editor {
        top: 88px;
        left: 6px;
        right: 6px;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        justify-content: stretch;
        gap: .3rem;
        max-width: none;
        padding: .35rem;
        transform: none;
    }
    /* Hide only helper copy on narrow screens; MudButton wraps its visible label in a span too. */
    .office-editor-hint { display: none; }
    .office-room-editor > strong { grid-column: 1 / -1; }
    .office-room-editor .mud-button-root { width: 100%; min-width: 0; padding-inline: .35rem; white-space: normal; line-height: 1.15; }
    .office-editor-plant-select { width: 100%; min-width: 0; }
    .office-editor-plant-select .mud-input-control { width: 100%; min-width: 0; }
    .office-game-screen.is-editing .employee-office-pan { inset-block-start: 244px; }
    .office-map-loading { inset: 104px 0 78px; }
    .office-game-screen.is-editing .office-map-loading { inset-block-start: 244px; }
}

@media (max-height: 520px) {
    .office-command-dock { min-height: 50px; padding-block: 4px; }
    .office-room-editor { top: 72px; }
    .office-game-screen.is-editing .employee-office-pan { inset-block-start: 224px; }
    .office-game-screen.is-editing .office-map-loading { inset-block-start: 224px; }
}

@media (prefers-reduced-motion: reduce) {
    .office-map-loading-spinner { animation-duration: 2s; }
}

/* The new pastel-pixel art uses solid game panels; glossy chrome made it look like a different game. */
.employee-office-page {
    --office-plum: #251f35;
    --office-outline: #3e304d;
    --office-violet: #a58dc0;
    --office-cream: #f2e1cf;
    --office-aqua: #85bdc5;
    --office-coral: #c27063;
    --office-ink: #251f35;
    color: var(--office-cream);
}
.office-game-screen,
.employee-office-pan,
.employee-office-game-frame {
    background: var(--office-plum);
    background-image: none;
    box-shadow: none;
}
.office-game-hud,
.office-rts-hud,
.office-command-dock,
.office-roster-panel,
.office-selection-panel,
.office-room-editor,
.office-camera-controls,
.office-resource,
.office-resource-card,
.office-game-stat,
.office-empty-state,
.office-map-loading {
    color: var(--office-cream);
    background: var(--office-outline);
    background-image: none;
    border-color: var(--office-violet);
    border-radius: 4px;
    box-shadow: none;
    backdrop-filter: none;
}
.office-game-titlebar,
.office-map-titlebar {
    color: var(--office-cream);
    background: var(--office-plum);
    border-color: var(--office-violet);
}
.office-game-eyebrow,
.office-game-brand,
.office-game-brand .mud-icon-root,
.office-map-titlebar .mud-icon-root,
.office-room-editor .mud-icon-root { color: var(--office-aqua); }
.office-live-dot { background: #91b869; box-shadow: none; }
.office-resource-strip { background: transparent; }
.office-resource-emblem,
.resource-emblem,
.office-resource-icon {
    color: var(--office-plum);
    background: #dfc065;
    border: 2px solid var(--office-plum);
    border-radius: 0;
    box-shadow: none;
}
.resource-mexc .resource-emblem,
.resource-mexc .office-resource-icon { color: var(--office-plum); background: var(--office-aqua); border-color: var(--office-plum); }
.resource-other .resource-emblem,
.resource-other .office-resource-icon { color: var(--office-plum); background: var(--office-violet); border-color: var(--office-plum); }
.office-resource strong,
.office-resource-copy strong,
.resource-mexc strong,
.resource-other strong { color: var(--office-cream); }
.office-resource small,
.office-resource-copy small,
.office-game-stat small,
.office-command-status small,
.office-updated-time { color: #d2c1da; }
.office-game-actions .mud-icon-button,
.office-game-actions .mud-icon-button:first-child,
.office-camera-controls .mud-icon-button {
    color: var(--office-cream);
    background: var(--office-violet);
    border: 2px solid var(--office-plum);
    border-radius: 3px;
}
.office-game-actions .mud-icon-button:hover { color: var(--office-plum); background: var(--office-cream); }
.office-command-person,
.office-camera-controls,
.office-roster-entry:hover,
.office-roster-entry.is-selected { background: #67527b; border-color: var(--office-violet); }
.office-command-person.is-selected { border: 2px solid #dfc065; box-shadow: none; }
.office-job-tally rect { fill: var(--office-plum); stroke: var(--office-cream); }
.office-tally-queue { fill: #dfc065; }
.office-tally-failed { fill: var(--office-coral); }
.office-tally-success { fill: #91b869; }
.office-error-toast { color: var(--office-cream); background: var(--office-coral); border-color: var(--office-plum); box-shadow: none; }
.office-empty-state { color: var(--office-plum); background: var(--office-cream); }
.office-selection-panel,
.office-roster-panel { background: var(--office-outline); }
.office-game-stat strong.stat-working,
.office-game-stat.stat-working strong { color: #91b869; }
.office-game-stat.stat-queue strong { color: #dfc065; }
.office-game-stat.stat-failed strong { color: var(--office-coral); }
.office-game-stat.stat-success strong { color: #91b869; }
.office-rts-hud .office-resource-divider,
.office-command-employees { border-color: var(--office-violet); }
.office-desk:focus .office-worker-sprite-sheet,
.office-desk:hover .office-worker-sprite-sheet { filter: none; }
.office-worker-sprite-sheet,
.office-plant-sprite,
.office-trash-sprite,
.office-thought-bitmap { image-rendering: pixelated; image-rendering: crisp-edges; }
