:root {
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #172033;
    background: #f4f7fb;
    /* Shared operating-state palette. Keep pies, bars, split bars, and timeline bands aligned. */
    --state-active-color: #2bb478;
    --state-idle-color: #d94c5b;
    --state-no-net-color: #9aa5b5;
    --state-active-band: rgba(43,180,120,.75);
    --state-idle-band: rgba(217,76,91,.76);
    --state-no-net-band: rgba(154,165,181,.72);
    font-synthesis: none;
    text-rendering: optimizeLegibility;
}

/* Keep the static Blazor boot screen safe before the application has mounted. */
#app { min-height: 100vh; }
.loading-screen, .auth-boot-loading {
    min-height: 100vh;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 10px;
    background: #f4f7fb;
    color: #718096;
    font-size: 12px;
}
.loading-progress-text { color: #718096; font-size: 12px; text-align: center; }

.loading-progress {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 42px;
    height: 42px;
    transform: translate(-50%, -50%);
}
.loading-progress circle {
    fill: none;
    stroke: #dce7f5;
    stroke-width: 5;
}
.loading-progress circle:last-child {
    stroke: #1f6feb;
    stroke-linecap: round;
    stroke-dasharray: 65 200;
    animation: boot-spin 1s linear infinite;
    transform-origin: 50% 50%;
}
.loading-progress-text {
    position: fixed;
    top: calc(50% + 38px);
    left: 0;
    width: 100%;
    color: #718096;
    font-size: 12px;
    text-align: center;
}
@keyframes boot-spin { to { transform: rotate(360deg); } }

* { box-sizing: border-box; }

body {
    margin: 0;
    min-width: 320px;
    background: #f4f7fb;
}

a { color: inherit; }

button, input { font: inherit; }

button { cursor: pointer; }

button:disabled { cursor: wait; opacity: .65; }

/* FocusOnNavigate focuses the page heading for screen-reader context. Keep that
   programmatic focus from drawing a browser-default black rectangle around titles. */
:focus { outline: none; }
:focus-visible { outline: 2px solid #93baf0; outline-offset: 2px; }

.app-shell { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
    height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5vw;
    background: #fff;
    border-bottom: 1px solid #e4e9f1;
}

.brand { display: flex; gap: 12px; align-items: center; text-decoration: none; }
.brand-mark {
    width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
    background: #1f6feb; color: white; font-weight: 800; font-size: 20px;
    box-shadow: 0 7px 18px rgba(31, 111, 235, .25);
}
.brand strong { display: block; font-size: 16px; letter-spacing: .01em; }
.brand small { display: block; color: #7a879d; font-size: 11px; margin-top: 2px; }

nav a { color: #607089; text-decoration: none; font-size: 13px; font-weight: 650; padding: 10px 14px; border-radius: 9px; }
nav a.active, nav a:hover { color: #1f6feb; background: #edf4ff; }
.topbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.sign-out-button { border: 1px solid #d7e1ef; border-radius: 8px; padding: 8px 10px; color: #5b6d84; background: #f8faff; font-size: 11px; font-weight: 750; white-space: nowrap; }
.sign-out-button:hover { color: #1f6feb; border-color: #b9d3f6; background: #edf4ff; }

.content-shell { width: min(1320px, 90vw); margin: 0 auto; flex: 1; padding: 48px 0 70px; }
.site-footer { display: flex; justify-content: space-between; gap: 16px; padding: 18px 5vw; color: #8792a5; font-size: 11px; border-top: 1px solid #e4e9f1; background: #fff; }

.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin-bottom: 32px; }
.detail-heading { align-items: flex-start; }
.eyebrow { color: #6e7d95; font-size: 10px; font-weight: 800; letter-spacing: .16em; margin: 0 0 8px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(30px, 4vw, 46px); line-height: 1.05; letter-spacing: -.035em; color: #121b2c; }
h2 { margin-bottom: 0; font-size: 19px; letter-spacing: -.02em; color: #172033; }
.subtitle { margin-bottom: 0; color: #728097; font-size: 14px; }
.source-pill { display: inline-flex; align-items: center; gap: 8px; border: 1px solid #d8e4f5; background: #f8fbff; border-radius: 999px; padding: 9px 13px; color: #416187; font-size: 12px; font-weight: 700; white-space: nowrap; }
.source-dot { width: 7px; height: 7px; background: #27ae72; border-radius: 50%; box-shadow: 0 0 0 4px #ddf5e9; }
.back-link { display: inline-block; color: #3977c7; font-size: 12px; font-weight: 700; text-decoration: none; margin-bottom: 22px; }
.back-link:hover, .machine-link:hover { text-decoration: underline; }

.card { background: white; border: 1px solid #e3e9f2; border-radius: 16px; box-shadow: 0 8px 25px rgba(36, 55, 84, .045); }
.connect-card { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; padding: 28px; margin-bottom: 26px; }
.connect-card h2 { margin-bottom: 7px; }
.muted { color: #8490a4; font-size: 12px; }
.connect-form label { display: block; color: #52627b; font-size: 11px; font-weight: 750; margin-bottom: 7px; }
.token-row { display: flex; gap: 10px; }
input { min-width: 0; width: 100%; border: 1px solid #d4dce8; border-radius: 9px; padding: 11px 12px; color: #172033; background: #fbfcfe; outline: none; }
input:focus { border-color: #5793e8; box-shadow: 0 0 0 3px #e6f0ff; }
.primary-button, .secondary-button, .text-button { border: 0; border-radius: 9px; padding: 10px 14px; font-size: 12px; font-weight: 750; white-space: nowrap; }
.primary-button { color: white; background: #1f6feb; box-shadow: 0 6px 15px rgba(31, 111, 235, .2); }
.primary-button:hover { background: #155bc5; }
.secondary-button { color: #355e91; border: 1px solid #cbdcf4; background: #f5f9ff; }
.secondary-button:hover { background: #eaf3ff; }
.text-button { color: #748198; background: transparent; padding-left: 5px; padding-right: 5px; }
.text-button:hover { color: #1f6feb; }
.inline-button { display: inline-block; text-decoration: none; }
.error-text, .error-card { color: #ae3f45; }
.error-text { margin: 8px 0 0; font-size: 12px; }
.error-card { padding: 22px; }
.error-card p { margin: 7px 0 14px; color: #7a4c54; font-size: 13px; }

.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin: 5px 0 18px; }
.last-updated { color: #8792a5; font-size: 12px; }
.last-updated strong { color: #4a5d78; }
.toolbar-actions { display: flex; align-items: center; gap: 12px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 26px; }
.metric-card { position: relative; overflow: hidden; min-height: 125px; padding: 22px; display: flex; flex-direction: column; }
.metric-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: #a3b2c7; }
.metric-card span { color: #738198; font-size: 11px; font-weight: 700; }
.metric-card strong { margin: 11px 0 3px; color: #162239; font-size: 29px; letter-spacing: -.04em; }
.metric-card small { color: #9aa5b5; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.accent-blue::before { background: #4689ee; }
.accent-green::before { background: #2bb478; }
.accent-amber::before { background: #eca83e; }
.accent-red::before { background: #e66d72; }
.accent-purple::before { background: #8d74e8; }

.table-card { padding: 25px 0 10px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding: 0 25px 20px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 700px; }
th { padding: 10px 25px; color: #99a4b5; font-size: 10px; font-weight: 800; letter-spacing: .1em; text-align: left; text-transform: uppercase; border-top: 1px solid #edf0f5; border-bottom: 1px solid #edf0f5; }
td { padding: 14px 25px; color: #4b5d76; font-size: 12px; border-bottom: 1px solid #f0f3f7; vertical-align: middle; }
tbody tr:hover { background: #fafcff; }
.machine-link { color: #1e63bd; font-size: 13px; font-weight: 800; text-decoration: none; }
.cell-subtitle { display: block; color: #a0aaba; font-size: 10px; margin-top: 4px; }
.status-badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 999px; font-size: 10px; font-weight: 800; text-transform: capitalize; }
.status-badge > span { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-green { color: #18885a; background: #e7f8ef; }
.status-amber { color: #ad711e; background: #fff5df; }
.status-red { color: #bc4b51; background: #ffebed; }
.status-grey { color: #718096; background: #eef2f6; }
.disk-warning { color: #bc4b51; font-weight: 800; }
.empty-state { padding: 28px 25px; color: #8995a7; font-size: 13px; }
.loading-card { min-height: 105px; display: flex; align-items: center; justify-content: center; gap: 12px; color: #718096; font-size: 13px; }
.spinner { width: 18px; height: 18px; border: 2px solid #d5e3f7; border-top-color: #347de1; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.detail-metrics { grid-template-columns: repeat(4, 1fr); }
.detail-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 18px; }
.detail-card { min-width: 0; padding: 25px 0 10px; }
.value-list { margin: 0; }
.value-list > div { display: flex; justify-content: space-between; gap: 18px; padding: 11px 25px; border-top: 1px solid #f0f3f7; }
.value-list dt { color: #8792a5; font-size: 12px; }
.value-list dd { margin: 0; color: #304461; font-size: 12px; font-weight: 750; text-align: right; }
.compact-table table { min-width: 500px; }
.compact-table th, .compact-table td { padding-left: 18px; padding-right: 18px; }

.trend-section { margin-top: 28px; }
.trend-section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 0 0 18px; }
.trend-section-heading .muted { max-width: 620px; margin: 7px 0 0; line-height: 1.45; }
.range-picker { display: inline-flex; gap: 5px; padding: 4px; border: 1px solid #dce5f1; border-radius: 11px; background: #fff; flex-wrap: wrap; justify-content: flex-end; }
.range-button { border: 0; border-radius: 7px; padding: 7px 9px; color: #70809a; background: transparent; font-size: 11px; font-weight: 800; }
.range-button:hover { color: #356db7; background: #edf4ff; }
.range-active { color: #fff; background: #2d78d8; box-shadow: 0 3px 8px rgba(45, 120, 216, .2); }
.range-active:hover { color: #fff; background: #236ac6; }
.trend-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.trend-card { min-width: 0; padding: 20px; }
.trend-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.trend-heading .eyebrow { margin-bottom: 5px; font-size: 9px; }
.trend-heading h2 { font-size: 16px; }
.trend-current { color: #286cc2; font-size: 18px; font-weight: 800; letter-spacing: -.04em; white-space: nowrap; }
.chart-frame { height: 168px; padding: 10px 0 0; }
.trend-svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart-grid-line { stroke: #e9eef6; stroke-width: .45; vector-effect: non-scaling-stroke; }
.chart-line { fill: none; stroke: #397fdf; stroke-width: 1.35; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.chart-scale { display: flex; justify-content: space-between; gap: 10px; color: #8794a7; font-size: 10px; }
.chart-caption { margin: 9px 0 0; color: #9aa5b5; font-size: 10px; }
.chart-caption span { padding: 0 4px; color: #c1c9d4; }
.chart-empty { min-height: 190px; display: grid; place-items: center; color: #97a3b4; font-size: 12px; text-align: center; }

/* TV presentation routes. They intentionally use a separate layout so they fill a landscape
   display without the normal application chrome. The cloud API remains the only data source. */
.tv-shell { min-height: 100vh; background: #06090d; color: #edf5ff; overflow-x: hidden; }
.tv-page { min-height: 100vh; padding: 10px 14px 14px; background: radial-gradient(circle at 50% -30%, #15314c 0, #080d13 36%, #050709 82%); }
.tv-topline { min-height: 52px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; padding: 0 5px 11px; border-bottom: 1px solid #263441; }
.tv-brand { color: #75c7ff; font-size: 14px; font-weight: 900; letter-spacing: .08em; text-decoration: none; }
.tv-brand span { color: #7f8c9b; font-weight: 700; }
.tv-title-block { display: grid; gap: 3px; text-align: center; }
.tv-title-block strong { color: #f7fbff; font-size: 16px; }
.tv-title-block small { color: #91a4b8; font-size: 10px; }
.tv-topline-right { justify-self: end; display: inline-flex; align-items: center; gap: 8px; color: #9cb0c4; font-size: 11px; font-variant-numeric: tabular-nums; }
.tv-live-dot, .tv-status-dot { width: 8px; height: 8px; border-radius: 50%; background: #34dc82; box-shadow: 0 0 9px #34dc82; flex: 0 0 auto; }
.tv-not-connected { min-height: calc(100vh - 90px); display: grid; align-content: center; justify-items: center; gap: 12px; text-align: center; }
.tv-not-connected h1 { color: #f6fbff; font-size: clamp(25px, 3.5vw, 48px); }
.tv-not-connected p { max-width: 650px; margin: 0; color: #97aabc; line-height: 1.55; }
.tv-not-connected a { padding: 10px 14px; border: 1px solid #3a90d1; border-radius: 7px; color: #aee1ff; text-decoration: none; font-size: 12px; font-weight: 800; }
.tv-connect-row { display: flex; width: min(620px, 90vw); gap: 8px; }
.tv-token-input { border-color: #2d4e66; background: #09141d; color: #e7f5ff; box-shadow: none; }
.tv-token-input:focus { border-color: #5ec9ff; box-shadow: 0 0 0 3px rgba(94, 201, 255, .15); }
.tv-connect-button { border: 0; border-radius: 7px; padding: 10px 16px; color: #051117; background: #5ec9ff; font-size: 11px; font-weight: 900; letter-spacing: .06em; }
.tv-connect-error { color: #ff9b9b !important; font-size: 11px; }

.tv-machine-wall { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: minmax(200px, 1fr); gap: 10px; min-height: calc(100vh - 78px); padding-top: 10px; }
.tv-machine-card { position: relative; display: flex; flex-direction: column; min-width: 0; padding: 16px; color: #eaf4ff; text-decoration: none; background: linear-gradient(145deg, rgba(17, 26, 35, .98), rgba(7, 11, 16, .99)); border: 1px solid #273948; border-radius: 8px; box-shadow: inset 0 1px rgba(255,255,255,.03); transition: border-color .15s ease, transform .15s ease; }
.tv-machine-card:hover { border-color: #5eaee8; transform: translateY(-1px); }
.tv-card-heading { display: flex; align-items: center; gap: 8px; }
.tv-card-heading strong { color: #fff; font-size: 17px; }
.tv-card-heading em { margin-left: auto; color: #71dc9d; font-size: 10px; font-style: normal; font-weight: 800; text-transform: uppercase; }
.tv-card-location { min-height: 31px; margin: 8px 0; color: #8fa3b6; font-size: 11px; line-height: 1.35; }
.tv-card-primary { display: flex; align-items: baseline; gap: 8px; margin: auto 0 13px; }
.tv-card-primary strong { color: #e7fbff; font-size: clamp(31px, 3vw, 55px); letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.tv-card-primary span { color: #8da2b5; font-size: 10px; }
.tv-card-meta { display: flex; justify-content: space-between; gap: 12px; margin-top: 5px; color: #8da2b5; font-size: 11px; }
.tv-card-meta strong { color: #d9e6f0; font-weight: 700; font-variant-numeric: tabular-nums; }
.tv-card-footer { display: flex; justify-content: space-between; margin-top: 13px; padding-top: 10px; color: #74c8ff; font-size: 11px; font-weight: 800; border-top: 1px solid #1d2a35; }
.tv-idle .tv-status-dot { background: #f2b84b; box-shadow: 0 0 9px #f2b84b; }
.tv-idle .tv-card-heading em { color: #f3c368; }
.tv-attention .tv-status-dot { background: #f05d63; box-shadow: 0 0 9px #f05d63; }
.tv-attention .tv-card-heading em { color: #fa898d; }
.tv-unknown .tv-status-dot { background: #8da0b3; box-shadow: none; }
.tv-unknown .tv-card-heading em { color: #a5b0bb; }

.tv-machine-page { min-width: 1180px; }
.tv-machine-summary { display: grid; grid-template-columns: 1.4fr repeat(7, minmax(0, 1fr)); gap: 7px; padding: 10px 0 8px; }
.tv-state-box, .tv-metric { min-width: 0; min-height: 79px; padding: 11px 12px; background: rgba(11, 18, 25, .86); border: 1px solid #233542; border-radius: 6px; }
.tv-state-box { display: grid; align-content: center; border-left: 4px solid #74899d; }
.tv-state-running { border-left-color: #35d985; }
.tv-state-idle { border-left-color: #e7ae4c; }
.tv-state-box span, .tv-metric span { color: #8197aa; font-size: 9px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.tv-state-box strong { color: #eafeef; font-size: 19px; letter-spacing: .04em; }
.tv-state-box small, .tv-metric small { overflow: hidden; color: #8da1b4; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.tv-metric { display: grid; align-content: center; gap: 3px; }
.tv-metric strong { overflow: hidden; color: #f0f8ff; font-size: clamp(18px, 2vw, 29px); letter-spacing: -.04em; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.tv-controls { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 2px 0 7px; }
.tv-controls > div:first-child { display: grid; gap: 3px; }
.tv-controls strong { color: #e5f1fb; font-size: 12px; }
.tv-controls span { color: #8ba0b3; font-size: 10px; }
.tv-range-picker { display: flex; gap: 4px; padding: 3px; border: 1px solid #2d4354; border-radius: 6px; background: #0c151e; }
.tv-range-picker button { border: 0; border-radius: 4px; padding: 6px 9px; color: #91a5b8; background: transparent; font-size: 9px; font-weight: 900; letter-spacing: .05em; }
.tv-range-picker button:hover { color: #cceaff; background: #172a3a; }
.tv-range-picker .tv-range-active { color: #041017; background: #57c4ff; }
.tv-chart-card { padding: 10px 11px 7px; background: rgba(7, 12, 17, .92); border: 1px solid #263b4a; border-radius: 7px; box-shadow: 0 10px 28px rgba(0,0,0,.25); }
.tv-chart-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; padding: 0 2px 8px; }
.tv-kicker { margin: 0 0 3px; color: #74c9ff; font-size: 9px; font-weight: 900; letter-spacing: .1em; }
.tv-chart-heading h2 { color: #f2f9ff; font-size: 15px; }
.tv-chart-heading > p { max-width: 430px; margin: 0; color: #8097aa; font-size: 10px; line-height: 1.35; text-align: right; }
.tv-chart-scroll { max-height: calc(100vh - 245px); overflow: auto; border: 1px solid #182732; background: #060a0e; }
.tv-all-values-svg { display: block; min-width: 1180px; width: 100%; }
.tv-chart-time-grid { stroke: #1e3545; stroke-width: 1; vector-effect: non-scaling-stroke; }
.tv-chart-row-grid { stroke: #172731; stroke-width: 1; vector-effect: non-scaling-stroke; }
.tv-chart-time-label { fill: #73899b; font-size: 14px; font-family: Inter, ui-sans-serif, system-ui, sans-serif; }
.tv-chart-series-label { font-size: 14px; font-family: Inter, ui-sans-serif, system-ui, sans-serif; font-weight: 800; }
.tv-chart-series-value { fill: #7890a2; font-size: 11px; font-family: Inter, ui-sans-serif, system-ui, sans-serif; }
.tv-chart-series-line { stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.tv-chart-caption { margin: 7px 2px 0; color: #72899b; font-size: 10px; text-align: right; font-variant-numeric: tabular-nums; }
.tv-chart-empty { min-height: 300px; display: grid; place-items: center; color: #859caf; font-size: 12px; }

/* PHP-inspired factory wall.  The visual language follows the established monitor screen, while
   all data is supplied by the authenticated C# cloud API rather than browser-side JSON files. */
.php-inspired-wall { padding-top: 7px; }
.php-tv-header { min-height: 58px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; padding: 0 6px 9px; border-bottom: 1px solid #2b333a; }
.php-hq-time { display: grid; gap: 2px; color: #42e98a; font-variant-numeric: tabular-nums; }
.php-hq-time small, .php-kicker { color: #7d91a2; font-size: 9px; font-weight: 900; letter-spacing: .08em; }
.php-hq-time strong { font-size: 12px; }
.php-factory-title { display: grid; gap: 2px; justify-items: center; text-align: center; }
.php-factory-title > strong { color: #fff; font-size: 16px; text-transform: uppercase; }
.php-factory-title small { color: #8aa0b4; font-size: 10px; }
.php-header-actions { justify-self: end; display: flex; align-items: center; flex-wrap: wrap; justify-content: end; gap: 6px; }
.php-date-chip, .php-shift-chip, .php-source-label { border: 1px solid #2d4354; border-radius: 3px; padding: 4px 6px; color: #b6c8d6; background: #0c141a; font-size: 9px; font-weight: 800; letter-spacing: .04em; }
.php-shift-ready { color: #73e9a6; border-color: #266144; }
.php-shift-missing { color: #f4be67; border-color: #70552e; }
.php-source-label { color: #93a8b8; }
.php-source-label.php-live { color: #39e888; border-color: #237d4b; box-shadow: 0 0 10px rgba(52,220,130,.15); }
.php-machine-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: minmax(295px, 1fr); gap: 8px; min-height: calc(100vh - 83px); padding-top: 8px; }
.php-machine-card { display: flex; min-width: 0; flex-direction: column; padding: 7px; color: #e8f2fa; text-decoration: none; background: linear-gradient(145deg, #10171d, #070b0e); border: 1px solid #2b3740; border-radius: 7px; box-shadow: inset 0 1px rgba(255,255,255,.025); }
.php-machine-card:hover { border-color: #50b8ef; box-shadow: 0 0 0 1px rgba(80,184,239,.12), 0 10px 22px rgba(0,0,0,.2); }
.php-card-titlebar { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; min-height: 22px; padding: 0 2px; }
.php-card-titlebar strong { justify-self: center; overflow: hidden; color: #fff; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.php-window-dots { display: inline-flex; gap: 4px; }
.php-window-dots i { width: 7px; height: 7px; border-radius: 50%; background: #65717b; }
.php-window-dots .led-good { background: #35d986; box-shadow: 0 0 6px rgba(53,217,134,.7); }
.php-window-dots .led-bad { background: #f05146; box-shadow: 0 0 6px rgba(240,81,70,.6); }
.php-window-dots .led-dim { background: #9da4aa; }
.php-expand { color: #67c9ff; font-size: 8px; font-weight: 900; }
.php-card-shiftbar { display: flex; align-items: center; justify-content: space-between; gap: 7px; min-height: 22px; padding-top: 2px; }
.php-shift-label { overflow: hidden; max-width: 66%; color: #cfdce5; font-size: 8px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.php-card-shiftbar .php-source-label { padding: 2px 4px; font-size: 8px; }
.php-card-location { overflow: hidden; min-height: 16px; margin: 0 0 5px; color: #7d96a9; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.php-card-main { display: grid; grid-template-columns: 1.05fr .95fr; min-height: 116px; gap: 8px; }
.php-values-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; gap: 3px; margin: 0; }
.php-values-grid div { min-width: 0; min-height: 27px; padding: 3px 5px; border: 1px solid #25313a; border-radius: 2px; background: rgba(6,10,13,.55); }
.php-values-grid dt { overflow: hidden; color: #778c9d; font-size: 7px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.php-values-grid dd { overflow: hidden; margin: 2px 0 0; color: #dff6ff; font-size: 9px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.php-shift-visual { display: grid; grid-template-columns: 79px 1fr; align-items: center; gap: 7px; min-width: 0; }
.php-pie { width: 76px; aspect-ratio: 1; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(255,255,255,.1), 0 1px 9px rgba(0,0,0,.45); }
.php-pie::after { display: block; width: 42%; height: 42%; margin: 29%; border-radius: 50%; background: #0d151b; content: ""; }
.php-pie-legend { display: grid; gap: 5px; color: #aebfcb; font-size: 8px; font-variant-numeric: tabular-nums; }
.php-pie-legend span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.php-pie-legend i { display: inline-block; width: 7px; height: 7px; margin-right: 3px; border-radius: 1px; }
.state-active { background: #30d17b; }.state-idle { background: #f15143; }.state-nonet { background: #8f97a1; }
.php-empty-pie { display: grid; min-height: 76px; place-items: center; padding: 5px; border: 1px dashed #40505c; border-radius: 50%; color: #8295a5; font-size: 8px; text-align: center; }
.php-shift-counters { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-top: 6px; }
.php-counter-block { display: grid; grid-template-columns: auto 1fr; column-gap: 5px; row-gap: 2px; min-width: 0; padding: 4px 5px; border: 1px solid #25323a; background: #090f13; color: #91a4b3; font-size: 7px; }
.php-counter-block strong { grid-column: 1 / -1; color: #e8f5fb; font-size: 8px; }
.php-counter-block span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.php-counter-block b { color: #9ef4c4; font-weight: 800; }.php-counter-empty { grid-template-columns: 1fr; color: #728697; }
.php-card-bottom { display: flex; justify-content: space-between; gap: 8px; margin-top: auto; padding: 5px 1px 0; color: #8197a7; font-size: 8px; font-variant-numeric: tabular-nums; border-top: 1px solid #1e2a31; }
.php-card-bottom span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.php-card-live { border-color: #247d4b; }.php-card-idle { border-color: #6c5a35; }.php-card-attention { border-color: #62363a; }.php-card-unknown { border-color: #3e4b55; }
.php-shift-notice { margin: 7px 2px 0; color: #dbb66d; font-size: 10px; text-align: center; }

.php-expanded-machine { min-width: 1180px; }
.php-expanded-summary { display: grid; grid-template-columns: 1.35fr .95fr 1fr; min-height: 166px; gap: 8px; padding: 8px 0; }
.php-expanded-values, .php-expanded-state, .php-expanded-shifts { min-width: 0; padding: 8px; border: 1px solid #263541; background: rgba(6,11,15,.86); }
.php-expanded-values .php-values-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.php-expanded-state { display: grid; grid-template-columns: 120px 1fr; align-items: center; column-gap: 10px; }
.php-expanded-state .php-kicker { grid-column: 1 / -1; margin: 0 0 3px; }.php-pie-large { width: 112px; }
.php-empty-pie-large { min-height: 112px; }.php-expanded-shifts { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; align-content: start; }
.php-expanded-meta { grid-column: 1 / -1; margin: 2px 0 0; color: #8296a6; font-size: 9px; line-height: 1.45; }
.php-expanded-controls { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 1px 0 7px; }
.php-expanded-controls > div:first-child { display: grid; gap: 3px; }.php-expanded-controls strong { color: #e5f1fb; font-size: 11px; }.php-expanded-controls span { color: #8ba0b3; font-size: 9px; }


#blazor-error-ui { color-scheme: light only; background: #fff1d6; bottom: 0; box-shadow: 0 -1px 2px rgba(0, 0, 0, .15); box-sizing: border-box; display: none; left: 0; padding: .7rem 1.2rem; position: fixed; width: 100%; z-index: 1000; color: #654914; font-size: 12px; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .55rem; }

@media (max-width: 850px) {
    .content-shell { width: min(94vw, 700px); padding-top: 32px; }
    .topbar { padding: 0 3vw; }
    .page-heading, .toolbar { align-items: flex-start; flex-direction: column; }
    .source-pill { align-self: flex-start; }
    .connect-card, .detail-grid { grid-template-columns: 1fr; }
    .metric-grid, .detail-metrics { grid-template-columns: repeat(2, 1fr); }
    .trend-grid { grid-template-columns: repeat(2, 1fr); }
    .trend-section-heading { align-items: flex-start; flex-direction: column; }
    .range-picker { justify-content: flex-start; }
    .toolbar-actions { width: 100%; justify-content: flex-start; }
    .site-footer { padding: 16px 3vw; flex-direction: column; }
    .tv-machine-wall { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 480px) {
    .metric-grid, .detail-metrics, .trend-grid { grid-template-columns: 1fr; }
    .connect-card { padding: 20px; }
    .token-row { flex-direction: column; }
    .tv-machine-wall { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------------------------
   Factory operator TV. This deliberately follows the proven PHP wall: a fixed
   3x3 landscape canvas and a full-screen in-place machine expansion.
   -------------------------------------------------------------------------- */
.tv-shell { height: 100vh; min-height: 0; overflow: hidden; background: #050505; }
.operator-wall, .operator-expanded { height: 100vh; min-width: 1180px; overflow: hidden; color: #e9eef4; background: #070707; font-family: "Segoe UI", Arial, sans-serif; }
.operator-wall button, .operator-wall input, .operator-expanded button, .operator-expanded select { border-radius: 2px; font: inherit; }
.operator-header { height: 60px; display: grid; grid-template-columns: 170px 150px 1fr auto; align-items: center; gap: 10px; padding: 5px 9px; border-bottom: 1px solid #303030; background: #0b0b0b; }
.operator-header nav { align-self: start; display: flex; gap: 4px; }
.operator-header nav a { padding: 3px 6px; border: 1px solid #333; border-radius: 2px; color: #b4bec8; background: #141414; font-size: 9px; text-decoration: none; }
.operator-header nav a.active { color: #4df29a; border-color: #275b41; background: #0b1b12; }
.operator-clock { display: grid; gap: 2px; color: #00ff88; font-size: 10px; font-variant-numeric: tabular-nums; }.operator-clock span { font-size: 8px; }.operator-clock strong { font-size: 13px; }
.operator-title { display: grid; justify-items: center; gap: 2px; color: #fff; }.operator-title strong { font-size: 16px; }.operator-title small { color: #8290a0; font-size: 8px; letter-spacing: .08em; text-transform: uppercase; }
.operator-header-controls { justify-self: end; display: flex; align-items: center; gap: 4px; font-size: 9px; }
.operator-header-controls > span, .operator-header-controls button { height: 26px; display: inline-flex; align-items: center; padding: 0 8px; border: 1px solid #343434; color: #e4ebf2; background: #171717; font-weight: 700; }
.operator-header-controls button:not(:disabled):hover, .operator-header-controls button.selected { color: #07110c; background: #35dd87; border-color: #35dd87; }.operator-header-controls button:disabled { cursor: not-allowed; color: #79818a; opacity: .8; }
.operator-date { font-variant-numeric: tabular-nums; }
.operator-connect { height: calc(100vh - 60px); display: grid; place-content: center; justify-items: center; gap: 12px; text-align: center; background: radial-gradient(circle, #15212b 0, #070707 54%); }
.operator-connect h1 { margin: 0; color: #fff; font-size: 25px; }.operator-connect p { max-width: 650px; margin: 0; color: #9ca8b3; font-size: 12px; }.operator-connect > div { display: flex; width: 580px; gap: 7px; }.operator-connect input { padding: 9px; color: #fff; background: #0e1318; border: 1px solid #34424f; }.operator-connect button, .operator-connect a { padding: 9px 16px; border: 1px solid #287e50; color: #fff; background: #169557; font-size: 11px; font-weight: 800; text-decoration: none; }.operator-error { color: #ff6b67 !important; }
.operator-grid { height: calc(100vh - 60px); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 6px; overflow: hidden; }
.operator-tile { min-width: 0; min-height: 0; display: flex; flex-direction: column; padding: 5px; border: 1px solid #2b2b2b; border-radius: 6px; background: #111; box-shadow: inset 0 0 0 1px rgba(255,255,255,.015); overflow: hidden; }.operator-tile.printing { border-color: #24603f; }.operator-tile.offline { border-color: #5a2929; }
.operator-tile-title { height: 21px; display: grid; grid-template-columns: 55px 1fr 26px; align-items: center; }.operator-tile-title > strong { overflow: hidden; color: #fff; font-size: 12px; text-align: center; text-overflow: ellipsis; white-space: nowrap; }.operator-tile-title > a { color: #55c9ff; font-size: 16px; line-height: 1; text-align: center; text-decoration: none; }.operator-tile-title > a:hover { color: #fff; }
.operator-lights { display: inline-flex; align-items: center; gap: 4px; }.operator-lights i { width: 8px; height: 8px; border-radius: 50%; background: #ed4b42; box-shadow: 0 0 4px rgba(237,75,66,.4); }.operator-lights i.on { background: #2bd17d; box-shadow: 0 0 5px rgba(43,209,125,.65); }
.operator-shift-row { height: 20px; display: grid; grid-template-columns: minmax(80px, auto) 1fr auto; align-items: center; gap: 5px; font-size: 7px; }.shift-alert { overflow: hidden; padding: 2px 4px; border: 1px solid #2b4f3a; border-radius: 999px; color: #59e398; background: #0d1712; text-overflow: ellipsis; white-space: nowrap; }.shift-alert.no-shift { color: #ff6d62; border-color: #5c2f2d; background: #170d0d; }.operator-location { overflow: hidden; color: #33b8ff; font-size: 8px; font-weight: 800; text-align: right; text-overflow: ellipsis; white-space: nowrap; }.operator-shift-row time { color: #7d8792; font-variant-numeric: tabular-nums; white-space: nowrap; }
.operator-tile progress, .expanded-values-pane progress { width: 100%; height: 4px; margin: 1px 0 4px; border: 0; background: #242424; accent-color: #2cbd74; }.operator-tile progress::-webkit-progress-bar, .expanded-values-pane progress::-webkit-progress-bar { background: #242424; }.operator-tile progress::-webkit-progress-value, .expanded-values-pane progress::-webkit-progress-value { background: #2cbd74; }
.operator-tile-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 23% 42% 35%; gap: 5px; overflow: hidden; }
.operator-left-data { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.operator-values { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 2px; margin: 0; }.operator-values > div { min-width: 0; min-height: 24px; padding: 3px 4px; border: 1px solid #292929; background: #0b0b0b; }.operator-values dt { overflow: hidden; color: #70808e; font-size: 6px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }.operator-values dd { overflow: hidden; margin: 2px 0 0; color: #d8f2ff; font-size: 8px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.operator-dual-counters { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; margin-top: auto; }.operator-dual-counters .php-counter-block { padding: 2px 3px; border-color: #292929; background: #090909; font-size: 6px; }.operator-dual-counters .php-counter-block strong { font-size: 6px; }.operator-starts { display: block; padding-top: 2px; color: #d9e4eb; font-size: 7px; text-align: center; }
.operator-state-visuals { min-width: 0; min-height: 0; display: grid; grid-template-columns: 47% 53%; border-left: 1px solid #242424; border-right: 1px solid #242424; }.operator-pie-column, .operator-bars-column { min-width: 0; min-height: 0; display: flex; flex-direction: column; align-items: center; }.operator-pie-column > small, .operator-bars-column > small, .expanded-pie-pane > small, .expanded-bars-pane > small { overflow: hidden; width: 100%; height: 16px; color: #8d99a5; font-size: 7px; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.operator-pie { width: min(83px, 66%); aspect-ratio: 1; margin-top: 3px; border-radius: 50%; background: conic-gradient(#858585 0 100%); box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }.operator-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 5px; margin-top: 4px; color: #7f8b95; font-size: 6px; }.operator-legend span { white-space: nowrap; }.operator-legend i { display: inline-block; width: 6px; height: 6px; margin-right: 2px; }.operator-legend i.active, .operator-bars i.active { background: #2dcc7b; }.operator-legend i.idle, .operator-bars i.idle { background: #ef4c3d; }.operator-legend i.no-net, .operator-bars i.no-net { background: #8a8d90; }
.operator-bars { flex: 1; width: 100%; display: flex; align-items: end; justify-content: space-around; gap: 5px; padding: 8px 4px 2px; border-bottom: 1px solid #333; }.operator-bars > span { position: relative; height: 100%; flex: 1; display: flex; align-items: end; justify-content: center; }.operator-bars i { display: block; width: 55%; min-height: 2px; max-height: 100%; }.operator-bars b { position: absolute; top: -7px; color: #84909a; font-size: 6px; font-weight: 500; white-space: nowrap; }.operator-bars em { position: absolute; bottom: -12px; color: #727b83; font-size: 6px; font-style: normal; white-space: nowrap; }
.operator-files-card { min-width: 0; min-height: 0; display: flex; flex-direction: column; padding-left: 2px; color: #94a3b0; }.operator-files-card h4, .expanded-events-card h4 { margin: 0; color: #b7c8d5; font-size: 9px; }.operator-files-card > p, .expanded-events-card > p { margin: 2px 0 3px; color: #71808c; font-size: 6px; }.operator-table-scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; border: 1px solid #202830; background: #080b0e; scrollbar-width: thin; }.operator-table-scroll table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 6px; }.operator-table-scroll th, .operator-table-scroll td { overflow: hidden; padding: 3px; border-bottom: 1px solid #171e24; text-align: left; text-overflow: ellipsis; white-space: nowrap; }.operator-table-scroll th { position: sticky; top: 0; color: #88a0b2; background: #0c1116; }.operator-table-scroll th:first-child, .operator-table-scroll td:first-child { width: 52%; }.operator-files-card footer, .expanded-events-card footer { padding-top: 3px; color: #87a9be; font-size: 6px; }
.operator-empty-slot { border-style: dashed; border-color: #252b30; background: repeating-linear-gradient(135deg,#090b0d,#090b0d 12px,#0b0e10 12px,#0b0e10 24px); }.operator-empty-slot > div:last-child { flex: 1; display: grid; place-content: center; justify-items: center; gap: 5px; padding: 20px; text-align: center; }.operator-empty-slot > div:last-child strong { color: #596976; font-size: 10px; }.operator-empty-slot > div:last-child span { max-width: 250px; color: #43515d; font-size: 8px; line-height: 1.4; }
.shift-manager-backdrop { position: fixed; z-index: 20; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.82); backdrop-filter: blur(2px); }.shift-manager-panel { width: min(720px,80vw); padding: 12px; border: 1px solid #34434f; border-radius: 6px; background: #0d1115; box-shadow: 0 24px 80px rgba(0,0,0,.75); }.shift-manager-panel header { display: flex; align-items: center; justify-content: space-between; padding-bottom: 9px; border-bottom: 1px solid #28323a; }.shift-manager-panel header strong { color: #fff; font-size: 13px; }.shift-manager-panel header button { padding: 5px 9px; border: 1px solid #81423d; color: #fff; background: #d64b42; font-size: 9px; font-weight: 800; }.shift-manager-status { display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; padding: 12px 0; }.shift-manager-status span { display: grid; gap: 5px; padding: 10px; border: 1px solid #28333c; color: #82909c; background: #090c0f; font-size: 8px; }.shift-manager-status strong { color: #dce8f0; font-size: 16px; }.shift-manager-panel p { margin: 0 0 8px; color: #9aa9b5; font-size: 10px; line-height: 1.55; }.shift-manager-panel .shift-manager-warning { margin-bottom: 0; padding: 8px; border-left: 3px solid #cf9c45; color: #e0bd7c; background: #17130c; }

/* Expanded machine view */
.operator-expanded:focus { outline: none; }
.expanded-header { height: 42px; display: grid; grid-template-columns: 38px 86px 1fr auto minmax(200px,auto); align-items: center; gap: 8px; padding: 4px 7px; border-top: 6px solid #19343a; border-bottom: 1px solid #272727; background: #080808; }.expanded-header > strong { color: #fff; font-size: 13px; text-align: center; }.expanded-close { padding: 5px 8px; border-radius: 3px; color: #fff; background: #e74d43; font-size: 9px; font-weight: 900; text-decoration: none; white-space: nowrap; }.expanded-close:hover { background: #ff655b; }.expanded-shifts { display: flex; gap: 3px; }.expanded-shifts span { padding: 2px 5px; border: 1px solid #333; border-radius: 999px; color: #8b9299; font-size: 7px; }.expanded-shifts span.active { color: #65d7ff; border-color: #316076; background: #101b21; }.expanded-location { overflow: hidden; color: #32baff; font-size: 11px; font-weight: 800; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.expanded-overview { height: 31vh; min-height: 195px; display: grid; grid-template-columns: 145px 270px 1fr 285px; gap: 8px; padding: 7px; border-bottom: 1px solid #272727; overflow: hidden; }.expanded-values-pane, .expanded-pie-pane, .expanded-bars-pane { min-width: 0; min-height: 0; }.expanded-values-pane { display: flex; flex-direction: column; }.expanded-values-pane .operator-values > div { min-height: 26px; }.expanded-values-pane .operator-dual-counters { margin-top: 5px; }.expanded-pie-pane { display: grid; grid-template-columns: 145px 1fr; align-items: center; }.expanded-pie-pane > small { grid-column: 1 / -1; }.expanded-pie { width: 130px; margin: 0 auto; }.expanded-pie-pane .operator-legend { display: grid; font-size: 8px; }.expanded-bars-pane { display: flex; flex-direction: column; }.expanded-bars { padding: 18px 20px 16px; }.expanded-bars b { top: -13px; color: #a4adb5; font-size: 8px; }.expanded-bars em { bottom: -14px; font-size: 8px; }.expanded-overview > .operator-files-card { padding: 7px; border: 1px solid #202830; background: #080b0e; }.expanded-overview .operator-files-card h4 { font-size: 10px; }.expanded-overview .operator-files-card > p, .expanded-overview .operator-files-card footer { font-size: 8px; }.expanded-overview .operator-table-scroll table { font-size: 8px; }
.expanded-chart-panel { height: calc(69vh - 42px); min-height: 0; padding: 5px 7px 7px; display: flex; flex-direction: column; }.expanded-chart-controls { min-height: 28px; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 3px 6px; border: 1px solid #242a30; background: #0b0d0f; color: #a5afb8; font-size: 8px; }.expanded-chart-controls label { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }.expanded-chart-controls input { width: auto; margin: 0; padding: 0; }.expanded-chart-controls select, .expanded-chart-controls button { padding: 2px 5px; border: 1px solid #34404a; color: #fff; background: #11161b; font-size: 8px; }.expanded-chart-controls button:hover { border-color: #2dcc7b; }.cloud-chip { color: #fff; font-weight: 800; }.chart-threshold { color: #8f9caa; }.chart-stats { margin-left: auto; color: #a9c9dc; font-variant-numeric: tabular-nums; }
.expanded-chart-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0,1fr) 210px; gap: 6px; padding-top: 5px; }.expanded-plot { min-width: 0; min-height: 0; position: relative; border: 1px solid #1b2228; background: #050607; }.operator-series-legend { position: absolute; z-index: 2; top: 5px; left: 50%; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; transform: translateX(-50%); color: #c4ccd3; font-size: 7px; }.operator-series-legend span::before { display: inline-block; width: 14px; height: 2px; margin-right: 3px; vertical-align: middle; content: ""; }.operator-series-legend .print::before { background:#31d887; }.operator-series-legend .hopper::before { background:#00d8ff; }.operator-series-legend .mix::before { background:#f2d33c; }.operator-series-legend .hopper-torque::before { background:#ff9f2f; }.operator-series-legend .mix-torque::before { background:#ef466f; }.operator-series-legend .temp::before { background:#b666d2; }.operator-series-legend .robot::before { background:#7f8cff; }
.operator-trend-wrap { width: 100%; height: 100%; min-height: 0; }.operator-trend-svg { display: block; width: 100%; height: 100%; }.operator-grid-line { stroke: #263039; stroke-width: 1; vector-effect: non-scaling-stroke; }.operator-grid-line.horizontal { stroke: #171d22; }.operator-axis-label { fill: #77828d; font-size: 11px; font-family: "Segoe UI",Arial,sans-serif; }.operator-series-line { stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }.operator-state-band.active { fill: rgba(45,204,123,.75); }.operator-state-band.idle { fill: rgba(239,76,61,.76); }.operator-state-band.no-net { fill: rgba(138,141,144,.72); }.operator-state-text { fill: #edf6f0; font-size: 10px; font-weight: 700; }.operator-event-line { stroke: #00c9ff; stroke-width: 1; stroke-dasharray: 3 3; opacity: .65; vector-effect: non-scaling-stroke; }.operator-event-line.selected { stroke: #fff; stroke-width: 3; opacity: 1; }.operator-event-label { fill: #62d9f5; font-size: 8px; }.operator-chart-empty { height: 100%; display: grid; place-items: center; color: #71808c; font-size: 11px; }
.expanded-events-card { min-width: 0; min-height: 0; display: flex; flex-direction: column; padding: 6px; border: 1px solid #202830; background: #080b0e; }.expanded-events-card h4 { font-size: 10px; }.expanded-events-card > p, .expanded-events-card footer { font-size: 7px; }.expanded-events-card .operator-table-scroll table { font-size: 7px; }.expanded-events-card .operator-table-scroll th:first-child, .expanded-events-card .operator-table-scroll td:first-child { width: 27%; }.expanded-events-card .operator-table-scroll th:nth-child(2), .expanded-events-card .operator-table-scroll td:nth-child(2) { width: 35%; }.expanded-events-card tbody tr { cursor: pointer; }.expanded-events-card tbody tr:hover, .expanded-events-card tbody tr.selected { background: rgba(40,142,210,.18); }.expanded-events-card td.effective { color: #43df91; }.expanded-events-card td.dry { color: #ff7369; }

@media (max-height: 800px) {
    .operator-grid { gap: 4px; padding: 4px; }.operator-tile { padding: 3px; }.operator-values > div { min-height: 19px; padding: 2px 3px; }.operator-pie { width: 60px; }.operator-files-card > p { display: none; }.expanded-overview { height: 30vh; min-height: 170px; }.expanded-chart-panel { height: calc(70vh - 42px); }.expanded-pie { width: 105px; }
}

/* Administrator Shift Manager. Dense configuration cards keep the light fleet style while
   allowing real factory calendars, machine assignments and weather overrides to be edited. */
.admin-login-card { display: grid; grid-template-columns: 1.1fr .9fr; gap: 28px; align-items: center; padding: 24px; margin-bottom: 22px; }.admin-login-card h2 { margin: 5px 0 0; color: #172033; font-size: 22px; }.admin-login-card p { margin: 8px 0 0; line-height: 1.5; }.form-help { margin: 8px 0 12px; color: #7b899e; font-size: 11px; line-height: 1.45; }.admin-toolbar { margin-bottom: 16px; }.admin-toolbar .cell-subtitle { display: block; margin-top: 4px; }.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 20px; }.admin-panel { min-width: 0; padding: 20px; }.admin-panel .section-heading { margin-bottom: 14px; }.admin-panel h2 { font-size: 17px; }.admin-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; margin-bottom: 12px; }.admin-form-grid label, .checkbox-line, .weekday-picker { display: grid; gap: 5px; color: #68788f; font-size: 10px; font-weight: 750; }.admin-form-grid input, .admin-form-grid select { width: 100%; min-width: 0; padding: 8px 9px; border: 1px solid #d5deea; border-radius: 7px; color: #304461; background: #f8faff; font: inherit; }.compact-form { grid-template-columns: repeat(3, minmax(0, 1fr)); }.weekday-picker { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 5px 0 12px; }.weekday-picker > span { margin-right: 4px; }.weekday-picker label, .checkbox-line { display: inline-flex; align-items: center; gap: 5px; color: #596b83; font-size: 10px; font-weight: 650; }.weekday-picker input, .checkbox-line input { width: auto; margin: 0; accent-color: #1f6feb; }.admin-panel > .primary-button, .admin-panel > .secondary-button { margin: 4px 5px 14px 0; }.admin-table-scroll { max-height: 240px; overflow: auto; border: 1px solid #e2e8f0; border-radius: 8px; background: #fff; }.admin-table-scroll table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 10px; }.admin-table-scroll th, .admin-table-scroll td { padding: 8px 9px; border-bottom: 1px solid #edf1f6; color: #4b5d76; text-align: left; vertical-align: top; white-space: nowrap; }.admin-table-scroll th { position: sticky; top: 0; z-index: 1; color: #7e8ca0; background: #f3f7fb; font-size: 9px; text-transform: uppercase; letter-spacing: .04em; }.admin-table-scroll tbody tr:last-child td { border-bottom: 0; }.admin-table-scroll strong { color: #304461; }.danger-link { color: #bc4b51; }.success-card { padding: 14px 18px; margin-bottom: 18px; border: 1px solid #ccebdc; border-radius: 10px; color: #18885a; background: #eaf8f1; }.success-card p { display: inline; margin-left: 5px; color: #4e8069; font-size: 12px; }.admin-audit-card { margin-bottom: 20px; }.admin-audit-card .table-scroll { max-height: 260px; }

.live-wall-selection-panel { grid-column: 1 / -1; }.live-wall-machine-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 12px 0; }.live-wall-machine-option { display: flex; align-items: center; gap: 9px; min-width: 0; padding: 10px 11px; border: 1px solid #e2e8f0; border-radius: 9px; background: #f8faff; color: #596b83; cursor: pointer; }.live-wall-machine-option input { flex: 0 0 auto; accent-color: #1f6feb; }.live-wall-machine-option span { display: grid; gap: 3px; min-width: 0; }.live-wall-machine-option strong { color: #304461; font-size: 12px; }.live-wall-machine-option small { overflow: hidden; color: #7b899e; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }.live-wall-machine-option em { margin-left: auto; color: #18885a; font-size: 10px; font-style: normal; font-weight: 750; }.live-wall-machine-option:not(:has(input:checked)) em { color: #8996a8; }.live-wall-machine-option:has(input:checked) { border-color: #b9d4ff; background: #f2f7ff; }

/* The global input rule gives every input width: 100%.  Override it for the
   machine selector so the checkbox does not push the label text outside the
   selection card. */
.live-wall-machine-option input { width: auto; margin: 0; flex: 0 0 auto; }
.live-wall-machine-option span { flex: 1 1 auto; }
.live-wall-slot-select { flex: 0 0 104px; width: 104px; min-width: 104px; padding: 6px 7px; border: 1px solid #d5deea; border-radius: 7px; color: #304461; background: #fff; font: inherit; font-size: 10px; }
.live-wall-slot-select:disabled { color: #9aa7b8; background: #f0f4f9; }

.camera-setup-panel { grid-column: 1 / -1; }
.camera-setup-block + .camera-setup-block { margin-top: 22px; padding-top: 20px; border-top: 1px solid #e4eaf2; }
.camera-setup-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; color: #304461; font-size: 12px; }
.camera-setup-heading .text-button { margin: 0; }
.camera-admin-table { max-height: 220px; }
.camera-admin-table table { min-width: 760px; }
.camera-admin-table td:last-child { white-space: normal; }
.camera-admin-table .table-action + .table-action { margin-left: 4px; }

html[data-theme="dark"] .camera-setup-block + .camera-setup-block { border-top-color: var(--theme-border-soft); }
html[data-theme="dark"] .camera-setup-heading { color: var(--theme-heading); }

@media (min-width: 1400px) {
    .content-shell:has(.admin-grid) { width: min(1760px, 92vw); }
    .content-shell:has(.admin-grid) .live-wall-machine-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1050px) {
    .admin-grid, .admin-login-card { grid-template-columns: 1fr; }
}

@media (max-width: 650px) {
    .admin-form-grid, .compact-form, .live-wall-machine-list { grid-template-columns: 1fr; }.admin-panel { padding: 15px; }.admin-table-scroll { margin-left: -2px; margin-right: -2px; }
}

.workspace-login { display: grid; gap: 8px; margin-top: 18px; padding-top: 16px; border-top: 1px solid #e4eaf2; color: #68788f; font-size: 11px; font-weight: 700; }.workspace-login > div { min-height: 42px; }

/* --------------------------------------------------------------------------
   Live wall redesign

   The original PHP wall tried to show the full expanded machine experience in
   every 3 x 3 tile.  That made a landscape TV use 6-8px text.  These modes
   keep the same cloud data and production semantics, but give each density a
   deliberate job: minimal fleet status, normal operations, or one expanded
   machine with its full history.
   -------------------------------------------------------------------------- */
.live-app-shell { min-height: 100vh; background: #f4f7fb; }
.live-topbar { position: relative; z-index: 3; }
.live-content-shell { min-width: 0; padding: 0; }
.live-wall-page { width: min(1760px, calc(100vw - 56px)); height: calc(100vh - 76px); min-height: 0; display: flex; flex-direction: column; gap: 16px; margin: 0 auto; padding: 26px 0 20px; }
.live-wall-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; flex: 0 0 auto; }
.live-wall-heading .eyebrow { margin: 0 0 8px; }
.live-wall-heading h1 { margin: 0; color: #172033; font-size: clamp(30px, 2.35vw, 43px); line-height: 1; letter-spacing: -.045em; }
.live-wall-subtitle { margin: 10px 0 0; color: #6e7e96; font-size: 13px; }
.live-heading-status { display: flex; align-items: center; gap: 16px; padding-bottom: 3px; }
.live-clock { display: grid; gap: 2px; min-width: 86px; color: #1c8a61; font-variant-numeric: tabular-nums; }
.live-clock span, .live-toolbar-label { color: #8593a7; font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.live-clock strong { font-size: 17px; letter-spacing: -.02em; }
.live-wall-toolbar { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 22px; padding: 13px 16px; flex: 0 0 auto; }
.live-toolbar-copy { display: grid; gap: 3px; min-width: 250px; }
.live-toolbar-copy strong { color: #263a58; font-size: 14px; }
.live-toolbar-copy small { color: #78889e; font-size: 11px; }
.live-toolbar-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.live-mode-picker { display: inline-flex; gap: 3px; padding: 3px; border: 1px solid #dce5f1; border-radius: 9px; background: #f7faff; }
.live-mode-button { border: 0; border-radius: 6px; padding: 7px 11px; color: #60708a; background: transparent; font: inherit; font-size: 11px; font-weight: 800; cursor: pointer; }
.live-mode-button:hover { color: #1f6feb; background: #edf4ff; }
.live-mode-button.is-active { color: #fff; background: #1f6feb; box-shadow: 0 2px 6px rgba(31,111,235,.2); }
.live-page-status { color: #718198; font-size: 10px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.live-page-button, .live-auto-button { min-height: 33px; padding: 7px 10px; font-size: 10px; }
.live-auto-button.is-active { color: #18885a; border-color: #bde7d0; background: #eaf8f1; }
.live-connect-card { width: min(680px, 100%); display: grid; gap: 12px; place-self: center; margin: auto; padding: 28px; }
.live-connect-card h1 { margin: 0; color: #172033; font-size: 25px; }.live-connect-card p { max-width: 600px; margin: 0; color: #718096; font-size: 13px; line-height: 1.5; }
.live-connect-row { display: flex; gap: 8px; margin-top: 4px; }.live-connect-row input { min-width: 0; flex: 1; padding: 10px 11px; border: 1px solid #d5deea; border-radius: 7px; color: #263a58; background: #fff; font: inherit; }
.live-machine-grid { min-height: 0; flex: 1; display: grid; gap: 16px; }
.live-minimal-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(3, minmax(0, 1fr)); }
.live-normal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); }
.live-machine-card { min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; padding: 15px; border: 1px solid #dce5ef; border-radius: 15px; color: #42546d; background: #fff; box-shadow: 0 8px 24px rgba(36,55,84,.06); }
.live-machine-card.live-machine-navigate { cursor: pointer; }
.live-machine-card.live-machine-navigate:focus-visible { outline: 2px solid var(--theme-focus, #1f6feb); outline-offset: 3px; }
.live-machine-card.printing { border-color: #b9e8cf; box-shadow: 0 8px 24px rgba(34,140,91,.09); }.live-machine-card.idle { border-color: #f0d79d; }.live-machine-card.offline { border-color: #efcbd0; }
.live-machine-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; min-width: 0; }
.live-machine-identity { display: flex; align-items: center; min-width: 0; gap: 9px; }.live-machine-identity > div { min-width: 0; }.live-machine-identity h2 { overflow: hidden; margin: 0; color: #1c2d47; font-size: 15px; line-height: 1.15; text-overflow: ellipsis; white-space: nowrap; }.live-machine-identity span:not(.live-state-dot) { display: block; overflow: hidden; margin-top: 3px; color: #8795a9; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.live-state-dot { width: 10px; height: 10px; flex: 0 0 auto; border-radius: 50%; background: #9aa5b5; box-shadow: 0 0 0 4px rgba(154,165,181,.12); }.live-state-dot.printing { background: #2bb478; box-shadow: 0 0 0 4px rgba(43,180,120,.13); }.live-state-dot.idle { background: #eca83e; box-shadow: 0 0 0 4px rgba(236,168,62,.14); }.live-state-dot.offline { background: #d45b66; box-shadow: 0 0 0 4px rgba(212,91,102,.13); }
.live-card-actions { display: flex; align-items: center; justify-content: end; flex-wrap: wrap; gap: 8px; }.live-card-actions .table-action { white-space: nowrap; }
.status-badge.idle { color: #8a641f; border-color: #f0d79d; background: #fff7e7; }.status-badge.unreachable { color: #b64f58; border-color: #efcbd0; background: #fff1f2; }.status-badge.collecting { color: #18885a; border-color: #ccebdc; background: #eaf8f1; }

/* Minimal: a compact fleet scan using current and previous shift state charts. */
.live-minimal-card { gap: 4px; padding: 8px 10px; }.live-minimal-card .table-action { align-self: center; }.live-status-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; }.live-status-line time { overflow: hidden; color: #7d8ca0; font-size: 9px; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.live-minimal-visuals { display: grid; flex: 0 0 54px; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: 5px; min-width: 0; height: 54px; margin-top: auto; }.live-minimal-chart { min-width: 0; height: 54px; min-height: 0; padding: 4px 5px; border: 1px solid #e6ecf3; border-radius: 7px; background: #f8faff; }.live-minimal-pie-card { display: grid; grid-template-columns: 35px minmax(0, 1fr); align-items: center; gap: 5px; }.live-minimal-pie { width: 34px; }.live-minimal-chart-copy { display: grid; gap: 0; min-width: 0; line-height: 1; }.live-minimal-chart-copy span, .live-minimal-chart-label { overflow: hidden; color: #8795a8; font-size: 7px; font-weight: 800; letter-spacing: .07em; line-height: 1; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }.live-minimal-chart-copy strong { overflow: hidden; color: #294361; font-size: 8px; font-variant-numeric: tabular-nums; line-height: 1.1; text-overflow: ellipsis; white-space: nowrap; }.live-minimal-chart-copy small { overflow: hidden; color: #8996a8; font-size: 6px; line-height: 1.1; text-overflow: ellipsis; white-space: nowrap; }.live-minimal-bar-card { display: grid; align-content: center; gap: 3px; }.live-minimal-bars { gap: 2px; }.live-minimal-bars > span { grid-template-columns: 38px minmax(22px, 1fr) 34px; gap: 3px; line-height: 1; }.live-minimal-bars small { font-size: 6px; line-height: 1; }.live-minimal-bars i { height: 4px; }.live-minimal-bars strong { font-size: 6px; line-height: 1; }
.live-minimal-shifts { display: grid; flex: 0 0 27px; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; min-width: 0; height: 27px; }.live-minimal-shifts > span { display: grid; gap: 0; min-width: 0; min-height: 0; padding: 3px 5px; border-left: 2px solid #d6e6fb; background: #fbfcfe; line-height: 1; }.live-minimal-shifts > span:last-child { border-left-color: #e5d8f7; }.live-minimal-shifts small { overflow: hidden; color: #8997a9; font-size: 6px; font-weight: 800; letter-spacing: .04em; line-height: 1.05; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }.live-minimal-shifts strong { overflow: hidden; color: #365272; font-size: 8px; font-variant-numeric: tabular-nums; line-height: 1.05; text-overflow: ellipsis; white-space: nowrap; }.live-minimal-shifts em { overflow: hidden; color: #8593a5; font-size: 6px; font-style: normal; line-height: 1.05; text-overflow: ellipsis; white-space: nowrap; }.live-minimal-card footer { display: flex; flex: 0 0 8px; justify-content: space-between; gap: 8px; min-width: 0; height: 8px; padding-top: 0; color: #7e8da1; font-size: 7px; line-height: 1; }.live-minimal-card footer span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Normal: production context without forcing an expanded graph into every tile. */
.live-normal-card { gap: 9px; padding: 15px 16px 11px; }.live-normal-job-row { display: flex; align-items: end; justify-content: space-between; gap: 12px; min-width: 0; }.live-current-job { display: grid; gap: 2px; min-width: 0; }.live-current-job span, .live-progress-copy span { color: #8795a8; font-size: 9px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }.live-current-job strong { overflow: hidden; color: #294361; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }.live-current-job small { overflow: hidden; color: #8291a5; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }.live-progress-copy { display: grid; justify-items: end; gap: 2px; flex: 0 0 auto; }.live-progress-copy strong { color: #1f6feb; font-size: 16px; font-variant-numeric: tabular-nums; }
.live-progress { width: 100%; height: 5px; overflow: hidden; border: 0; border-radius: 999px; background: #e8eef6; }.live-progress::-webkit-progress-bar { background: #e8eef6; }.live-progress::-webkit-progress-value { background: linear-gradient(90deg,#1f6feb,#36a3f7); border-radius: 999px; }.live-progress::-moz-progress-bar { background: linear-gradient(90deg,#1f6feb,#36a3f7); border-radius: 999px; }
.live-normal-details { display: grid; grid-template-columns: minmax(0, 1.22fr) minmax(235px, .9fr); gap: 12px; min-height: 0; }.live-values-panel { display: grid; gap: 7px; min-width: 0; }.live-values-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }.live-values-grid > span { display: grid; gap: 2px; min-width: 0; padding: 6px 7px; border: 1px solid #e7edf4; border-radius: 7px; background: #fafcff; }.live-values-grid small { overflow: hidden; color: #8a98aa; font-size: 8px; font-weight: 800; letter-spacing: .05em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }.live-values-grid strong { overflow: hidden; color: #3b506c; font-size: 11px; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.live-shift-counters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }.live-shift-counters > span { display: grid; gap: 2px; min-width: 0; padding: 7px; border-left: 3px solid #d6e6fb; background: #f8faff; }.live-shift-counters small { overflow: hidden; color: #8997a9; font-size: 8px; font-weight: 800; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }.live-shift-counters strong { overflow: hidden; color: #365272; font-size: 10px; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }.live-shift-counters em { overflow: hidden; color: #8593a5; font-size: 8px; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.live-state-panel { display: grid; grid-template-columns: 104px minmax(0, 1fr); align-items: center; gap: 11px; min-width: 0; padding: 8px 10px; border: 1px solid #e6ecf3; border-radius: 10px; background: #fbfcfe; }.live-pie-wrap { display: grid; justify-items: center; gap: 4px; min-width: 0; text-align: center; }.live-pie { width: 58px; aspect-ratio: 1; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(255,255,255,.9), 0 3px 10px rgba(47,65,88,.11); }.live-pie::after { display: block; width: 44%; height: 44%; margin: 28%; border-radius: 50%; background: #fbfcfe; content: ""; }.live-pie-wrap div:last-child { display: grid; gap: 1px; min-width: 0; }.live-pie-wrap span { color: #8695a8; font-size: 8px; font-weight: 800; text-transform: uppercase; }.live-pie-wrap strong { overflow: hidden; color: #3b506c; font-size: 9px; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }.live-pie-wrap small { overflow: hidden; color: #8996a8; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.live-state-bars { display: grid; gap: 8px; min-width: 0; }.live-state-bars > span { display: grid; grid-template-columns: 58px minmax(40px, 1fr) 43px; align-items: center; gap: 6px; min-width: 0; }.live-state-bars small { overflow: hidden; color: #7f8ea0; font-size: 8px; font-weight: 800; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }.live-state-bars i { display: block; height: 7px; overflow: hidden; border-radius: 999px; background: #e6ecf3; }.live-state-bars b { display: block; height: 100%; min-width: 0; border-radius: inherit; }.live-state-bars b.active { background: #2bb478; }.live-state-bars b.idle { background: #eca83e; }.live-state-bars b.no-net { background: #9aa5b5; }.live-state-bars strong { overflow: hidden; color: #65758b; font-size: 9px; font-variant-numeric: tabular-nums; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.live-normal-card .operator-files-card { min-height: 0; display: flex; flex: 1 1 66px; flex-direction: column; padding: 7px 0 0; color: #63748b; }.live-normal-card .operator-files-card h4 { margin: 0; color: #344d6d; font-size: 10px; }.live-normal-card .operator-files-card > p { display: none; }.live-normal-card .operator-table-scroll { flex: 1; min-height: 0; margin-top: 4px; overflow: hidden; border: 1px solid #e4eaf2; border-radius: 7px; background: #fff; }.live-normal-card .operator-table-scroll table { width: 100%; border-collapse: collapse; font-size: 9px; }.live-normal-card .operator-table-scroll th, .live-normal-card .operator-table-scroll td { overflow: hidden; padding: 4px 6px; color: #587089; text-align: left; text-overflow: ellipsis; white-space: nowrap; }.live-normal-card .operator-table-scroll th { color: #8190a5; background: #f3f7fb; font-size: 8px; letter-spacing: .04em; text-transform: uppercase; }.live-normal-card .operator-files-card footer { overflow: hidden; padding-top: 4px; color: #8492a4; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }.live-normal-footer { display: flex; justify-content: space-between; gap: 12px; min-width: 0; color: #8190a4; font-size: 9px; font-variant-numeric: tabular-nums; }.live-normal-footer span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.live-empty-slot { align-items: center; justify-content: center; gap: 7px; border-style: dashed; background: repeating-linear-gradient(135deg,#fafcff,#fafcff 12px,#f4f7fb 12px,#f4f7fb 24px); text-align: center; }.live-slot-number { color: #91a0b3; font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }.live-empty-slot strong { color: #5e718c; font-size: 14px; }.live-empty-slot p { max-width: 280px; margin: 0; color: #9aa6b6; font-size: 10px; line-height: 1.45; }

/* Expanded: the same full live graph/event experience, framed as a Fleet page. */
.live-expanded-page { height: calc(100vh - 76px); min-width: 0; display: flex; flex-direction: column; overflow: hidden; color: #42546d; background: #f4f7fb; }.live-expanded-page:focus { outline: none; }
.live-expanded-page .expanded-header { height: 64px; min-height: 64px; display: grid; grid-template-columns: 38px 112px minmax(160px, 1fr) auto minmax(230px, auto); gap: 10px; padding: 9px 28px; border-top: 0; border-bottom: 1px solid #dce5ef; background: #fff; box-shadow: 0 4px 14px rgba(36,55,84,.04); }.live-expanded-page .operator-lights { align-self: center; }.live-expanded-page .operator-lights i { width: 9px; height: 9px; background: #d45b66; box-shadow: 0 0 0 3px rgba(212,91,102,.1); }.live-expanded-page .operator-lights i.on { background: #2bb478; box-shadow: 0 0 0 3px rgba(43,180,120,.12); }.live-expanded-page .expanded-close { align-self: center; padding: 8px 10px; border: 1px solid #d5deea; border-radius: 7px; color: #45617f; background: #f8faff; font-size: 10px; font-weight: 800; text-align: center; }.live-expanded-page .expanded-close:hover { color: #1f6feb; border-color: #b9d3f6; background: #edf4ff; }.live-expanded-page .expanded-header > strong { overflow: hidden; align-self: center; color: #1c2d47; font-size: 19px; text-align: left; text-overflow: ellipsis; white-space: nowrap; }.live-expanded-page .expanded-shifts { align-self: center; }.live-expanded-page .expanded-shifts span { padding: 5px 8px; color: #8a641f; border-color: #f0d79d; background: #fff7e7; font-size: 9px; font-weight: 800; }.live-expanded-page .expanded-shifts span.active { color: #18885a; border-color: #ccebdc; background: #eaf8f1; }.live-expanded-page .expanded-location { align-self: center; color: #3977c7; font-size: 12px; text-align: right; }
.live-expanded-overview { height: clamp(206px, 28vh, 270px); min-height: 206px; flex: 0 0 auto; grid-template-columns: 255px minmax(245px, .92fr) minmax(260px, 1fr) minmax(310px, 1.06fr); gap: 14px; padding: 14px 28px; border-bottom: 1px solid #dfe6ef; background: #f4f7fb; }.live-expanded-overview > section, .live-expanded-overview > .operator-files-card { min-width: 0; overflow: hidden; padding: 11px; border: 1px solid #dfe6ef; border-radius: 11px; background: #fff; box-shadow: 0 5px 16px rgba(36,55,84,.045); }.live-expanded-overview .expanded-values-pane { gap: 7px; }.live-expanded-overview .expanded-values-pane progress { flex: 0 0 5px; width: 100%; height: 5px; border: 0; border-radius: 999px; background: #e8eef6; }.live-expanded-overview .expanded-values-pane progress::-webkit-progress-bar { background: #e8eef6; }.live-expanded-overview .expanded-values-pane progress::-webkit-progress-value { background: #1f6feb; }.live-expanded-overview .operator-values { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }.live-expanded-overview .operator-values > div { min-width: 0; min-height: 0; padding: 4px 5px; border: 1px solid #e7edf4; border-radius: 5px; background: #fafcff; }.live-expanded-overview .operator-values dt { overflow: hidden; color: #8997a9; font-size: 7px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }.live-expanded-overview .operator-values dd { overflow: hidden; margin: 2px 0 0; color: #3b506c; font-size: 10px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }.live-expanded-overview .operator-dual-counters { margin-top: auto; gap: 5px; }.live-expanded-overview .php-counter-block { padding: 4px 5px; border-color: #e4eaf2; background: #f8faff; color: #8390a1; font-size: 7px; }.live-expanded-overview .php-counter-block strong { color: #526680; font-size: 8px; }.live-expanded-overview .php-counter-block b { color: #18885a; }.live-expanded-overview .operator-starts { padding-top: 3px; color: #61748e; font-size: 9px; }
.live-expanded-overview .expanded-pie-pane { grid-template-columns: 110px minmax(0, 1fr); gap: 8px; align-content: center; }.live-expanded-overview .expanded-pie-pane > small, .live-expanded-overview .expanded-bars-pane > small { margin-bottom: 3px; color: #7d8da1; font-size: 9px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }.live-expanded-overview .expanded-pie { width: 100px; }.live-expanded-overview .operator-pie::after { background: #fff; }.live-expanded-overview .operator-legend { gap: 7px; color: #62758e; font-size: 9px; }.live-expanded-overview .operator-legend i { width: 8px; height: 8px; }.live-expanded-overview .operator-legend .active { background: #2bb478; }.live-expanded-overview .operator-legend .idle { background: #eca83e; }.live-expanded-overview .operator-legend .no-net { background: #9aa5b5; }
.live-expanded-overview .expanded-bars-pane { display: flex; flex-direction: column; }.live-expanded-overview .expanded-bars { flex: 1; min-height: 0; padding: 17px 18px 18px; border-bottom-color: #dce5ef; }.live-expanded-overview .expanded-bars b { color: #5e718b; font-size: 9px; }.live-expanded-overview .expanded-bars em { color: #7f8ea0; font-size: 9px; }.live-expanded-overview .operator-bars i.active { background: #2bb478; }.live-expanded-overview .operator-bars i.idle { background: #eca83e; }.live-expanded-overview .operator-bars i.no-net { background: #9aa5b5; }.live-expanded-overview > .operator-files-card { display: flex; flex-direction: column; color: #65768d; }.live-expanded-overview .operator-files-card h4 { margin: 0; color: #344d6d; font-size: 12px; }.live-expanded-overview .operator-files-card > p { margin: 3px 0 6px; color: #8a97a9; font-size: 9px; }.live-expanded-overview .operator-table-scroll { flex: 1; min-height: 0; border-color: #e2e8f0; border-radius: 6px; }.live-expanded-overview .operator-table-scroll table { font-size: 9px; }.live-expanded-overview .operator-table-scroll th, .live-expanded-overview .operator-table-scroll td { padding: 4px 6px; }.live-expanded-overview .operator-files-card footer { overflow: hidden; padding-top: 5px; color: #8190a4; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.live-expanded-chart { height: auto; min-height: 0; flex: 1; padding: 12px 28px 18px; background: #f4f7fb; }.live-expanded-chart .expanded-chart-controls { min-height: 39px; gap: 9px; padding: 6px 9px; border-color: #dbe4ee; border-radius: 9px; color: #66778e; background: #fff; font-size: 10px; }.live-expanded-chart .expanded-chart-controls select, .live-expanded-chart .expanded-chart-controls button, .live-expanded-chart .operator-date-input { padding: 5px 7px; border-color: #d5deea; border-radius: 5px; color: #465f7c; background: #f8faff; font-size: 9px; }.live-expanded-chart .expanded-chart-controls button:hover { color: #1f6feb; border-color: #a9c8ef; background: #edf4ff; }.live-expanded-chart .chart-stats { color: #416187; font-size: 10px; }.live-expanded-chart .expanded-chart-body { grid-template-columns: minmax(0, 1fr) 280px; gap: 14px; padding-top: 12px; }.live-expanded-chart .expanded-plot, .live-expanded-chart .expanded-events-card { border-color: #dfe6ef; border-radius: 11px; background: #fff; box-shadow: 0 5px 16px rgba(36,55,84,.045); }.live-expanded-chart .expanded-plot { overflow: hidden; }.live-expanded-chart .operator-series-legend { top: 9px; gap: 12px; color: #5d6e85; font-size: 9px; }.live-expanded-chart .expanded-events-card { padding: 10px; }.live-expanded-chart .expanded-events-card h4 { margin: 0; color: #344d6d; font-size: 12px; }.live-expanded-chart .expanded-events-card > p { margin: 4px 0 7px; color: #8a97a9; font-size: 9px; line-height: 1.4; }.live-expanded-chart .expanded-events-card .operator-table-scroll { border-color: #e2e8f0; }.live-expanded-chart .expanded-events-card .operator-table-scroll table { font-size: 9px; }.live-expanded-chart .expanded-events-card .operator-table-scroll th, .live-expanded-chart .expanded-events-card .operator-table-scroll td { padding: 5px 6px; }.live-expanded-chart .expanded-events-card footer { padding-top: 6px; color: #8190a4; font-size: 9px; }.live-expanded-chart .operator-grid-line { stroke: #dfe6ef; }.live-expanded-chart .operator-grid-line.horizontal { stroke: #edf1f6; }.live-expanded-chart .operator-axis-label { fill: #77879d; }.live-expanded-chart .operator-event-label { fill: #1477a7; }

@media (max-width: 1250px) {
    .live-wall-page { width: min(96vw, 1760px); }.live-wall-toolbar { align-items: flex-start; flex-direction: column; }.live-toolbar-actions { justify-content: flex-start; }.live-normal-details { grid-template-columns: 1fr; }.live-normal-card { overflow: auto; }.live-expanded-page { overflow: auto; height: auto; min-height: calc(100vh - 76px); }.live-expanded-page .expanded-header { grid-template-columns: 38px 112px minmax(140px,1fr) auto; }.live-expanded-page .expanded-location { display: none; }.live-expanded-overview { height: auto; grid-template-columns: repeat(2, minmax(0, 1fr)); }.live-expanded-chart { min-height: 600px; }.live-expanded-chart .expanded-chart-body { grid-template-columns: minmax(0,1fr) 250px; min-height: 520px; }
}

/* Compact landscape wall.  A laptop with a 1440x900 physical display can expose a smaller CSS
   viewport after browser chrome and display scaling.  Keep the nine-card Minimal wall usable in
   that range instead of stacking the toolbar and shrinking every card to a clipped strip. */
@media (min-width: 901px) and (max-width: 1250px) {
    .live-wall-page { gap: 10px; padding-top: 12px; padding-bottom: 10px; }
    .live-wall-heading .eyebrow { margin-bottom: 5px; }
    .live-wall-heading h1 { font-size: 31px; }
    .live-wall-subtitle { margin-top: 6px; font-size: 11px; }
    .live-wall-toolbar { min-height: 62px; align-items: center; flex-direction: row; gap: 12px; padding: 9px 12px; }
    .live-toolbar-copy { min-width: 0; flex: 1 1 auto; }
    .live-toolbar-copy small { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
    .live-toolbar-actions { flex: 0 0 auto; justify-content: flex-end; gap: 6px; }
    .live-mode-button { padding: 6px 9px; }
    .live-page-button, .live-auto-button { min-height: 29px; padding: 6px 8px; }
    .live-page-status { font-size: 9px; }
    .live-machine-grid { gap: 10px; }
    .live-machine-card { border-radius: 11px; }
    .live-minimal-card { gap: 4px; padding: 8px; }
    .live-minimal-visuals { flex-basis: 50px; gap: 4px; height: 50px; }
    .live-minimal-chart { height: 50px; padding: 3px 4px; }
    .live-minimal-pie-card { grid-template-columns: 31px minmax(0, 1fr); gap: 4px; }
    .live-minimal-pie { width: 30px; }
    .live-minimal-chart-copy span, .live-minimal-chart-label { font-size: 6px; }
    .live-minimal-chart-copy strong { font-size: 7px; }
    .live-minimal-chart-copy small { font-size: 6px; }
    .live-minimal-bar-card { gap: 2px; }
    .live-minimal-bars { gap: 1px; }
    .live-minimal-bars > span { grid-template-columns: 33px minmax(20px, 1fr) 29px; gap: 2px; }
    .live-minimal-bars small { font-size: 5px; }
    .live-minimal-bars i { height: 4px; }
    .live-minimal-bars strong { font-size: 6px; }
    .live-minimal-shifts { flex-basis: 25px; gap: 4px; height: 25px; }
    .live-minimal-shifts > span { padding: 2px 4px; }
    .live-minimal-shifts small { font-size: 5px; }
    .live-minimal-shifts strong { font-size: 7px; }
    .live-minimal-shifts em { font-size: 5px; }
    .live-minimal-card footer { padding-top: 0; font-size: 8px; }
    .live-empty-slot { padding: 10px; }
    .live-empty-slot strong { font-size: 12px; }
    .live-empty-slot p { font-size: 9px; }
}

@media (max-height: 850px) and (min-width: 1251px) {
    .live-wall-page { gap: 10px; padding-top: 13px; padding-bottom: 12px; }.live-wall-heading .eyebrow { margin-bottom: 5px; }.live-wall-heading h1 { font-size: 31px; }.live-wall-subtitle { margin-top: 6px; font-size: 11px; }.live-wall-toolbar { min-height: 62px; padding: 9px 12px; }.live-toolbar-copy small { font-size: 10px; }.live-machine-grid { gap: 10px; }.live-machine-card { border-radius: 11px; }.live-minimal-card { gap: 7px; padding: 11px; }.live-normal-card { gap: 6px; padding: 10px 12px 8px; }.live-normal-details { gap: 8px; }.live-values-grid { gap: 4px; }.live-values-grid > span { padding: 4px 5px; }.live-state-panel { padding: 6px 8px; }.live-state-bars { gap: 5px; }.live-normal-card .operator-table-scroll th, .live-normal-card .operator-table-scroll td { padding-top: 3px; padding-bottom: 3px; }.live-expanded-page .expanded-header { height: 52px; min-height: 52px; padding-top: 5px; padding-bottom: 5px; }.live-expanded-overview { height: clamp(176px, 27vh, 230px); min-height: 176px; padding-top: 8px; padding-bottom: 8px; }.live-expanded-overview > section, .live-expanded-overview > .operator-files-card { padding: 7px; }.live-expanded-overview .expanded-pie { width: 75px; }.live-expanded-chart { padding-top: 7px; padding-bottom: 10px; }.live-expanded-chart .expanded-chart-body { padding-top: 7px; }
}

@media (max-width: 760px) {
    .live-wall-page { width: min(94vw, 600px); height: auto; min-height: calc(100vh - 76px); }.live-wall-heading, .live-heading-status { align-items: flex-start; flex-direction: column; }.live-minimal-grid, .live-normal-grid { grid-template-columns: 1fr; grid-template-rows: none; }.live-machine-card { min-height: 220px; }.live-expanded-page .expanded-header { height: auto; grid-template-columns: 32px 1fr; padding: 12px 3vw; }.live-expanded-page .expanded-close, .live-expanded-page .expanded-shifts { grid-row: 2; }.live-expanded-page .expanded-header > strong { font-size: 16px; }.live-expanded-overview { grid-template-columns: 1fr; }.live-expanded-chart .expanded-chart-controls { align-items: flex-start; }.live-expanded-chart .expanded-chart-body { grid-template-columns: 1fr; min-height: 760px; }.live-expanded-chart .expanded-events-card { min-height: 240px; }
}

/* Keep the TV wall heading useful without letting it consume the first machine row. */
@media (min-width: 901px) {
    .live-wall-page { gap: 12px; padding-top: 14px; }
    .live-wall-heading { align-items: center; gap: 16px; }
    .live-wall-heading .eyebrow { margin-bottom: 4px; font-size: 8px; }
    .live-wall-heading h1 { font-size: clamp(27px, 2vw, 34px); }
    .live-wall-subtitle { display: none; }
    .live-heading-status { gap: 12px; padding-bottom: 0; }
    .live-clock strong { font-size: 15px; }
}

/* Unified operator design system. The TV routes keep the compact PHP-inspired information
   density, while using the same light canvas, white cards and restrained status colours as the
   fleet overview. This block intentionally overrides the older dark presentation rules above. */
.tv-shell { background: #f4f7fb; color: #172033; }
.operator-wall, .operator-expanded { color: #27364d; background: #f4f7fb; }
.operator-header { border-bottom-color: #dfe6f0; background: #fff; box-shadow: 0 4px 16px rgba(36,55,84,.05); }
.operator-header nav { min-width: 245px; }
.operator-header nav a { color: #607089; border-color: transparent; background: transparent; }
.operator-header nav a.active, .operator-header nav a:hover { color: #1f6feb; border-color: #dce9fb; background: #edf4ff; }
.operator-clock { color: #18885a; }
.operator-title { color: #172033; }.operator-title strong { color: #172033; }.operator-title small { color: #8996a9; }
.operator-header-controls > span, .operator-header-controls button, .operator-header-link { height: 26px; display: inline-flex; align-items: center; padding: 0 8px; border: 1px solid #dce4ef; border-radius: 5px !important; color: #53657e; background: #f8faff; font-weight: 750; text-decoration: none; }
.operator-header-controls button:not(:disabled):hover, .operator-header-controls button.selected, .operator-header-link:hover { color: #fff; border-color: #1f6feb; background: #1f6feb; }
.operator-connect { background: radial-gradient(circle, #fff 0, #f4f7fb 58%); }.operator-connect h1 { color: #172033; }.operator-connect p { color: #718096; }.operator-connect input { color: #172033; border-color: #d4dce8; background: #fff; }.operator-connect button, .operator-connect a { color: #fff; border-color: #1f6feb; background: #1f6feb; }
.operator-grid { background: #edf2f8; }
.operator-tile { border-color: #dce4ee; background: #fff; box-shadow: 0 5px 18px rgba(36,55,84,.055); }.operator-tile.printing { border-color: #8ad9b5; }.operator-tile.offline { border-color: #efb8bb; }
.operator-tile-title > strong { color: #172033; }.operator-tile-title > a { color: #3977c7; }.operator-tile-title > a:hover { color: #1f6feb; }
.operator-shift-row time { color: #919daf; }.shift-alert { color: #18885a; border-color: #ccebdc; background: #eaf8f1; }.shift-alert.no-shift { color: #bc4b51; border-color: #f1ccd0; background: #fff0f1; }.operator-location { color: #3977c7; }
.operator-tile progress, .expanded-values-pane progress { background: #e8edf3; }.operator-tile progress::-webkit-progress-bar, .expanded-values-pane progress::-webkit-progress-bar { background: #e8edf3; }
.operator-state-visuals { border-color: #e5eaf1; }
.operator-values > div { border-color: #e8edf3; background: #f9fbfd; }.operator-values dt { color: #8996a9; }.operator-values dd { color: #304461; }
.operator-dual-counters .php-counter-block { border-color: #e3e9f1; background: #f8fafd; }.operator-starts { color: #4a5d78; }
.operator-pie-column > small, .operator-bars-column > small, .expanded-pie-pane > small, .expanded-bars-pane > small { color: #7b899e; }
.operator-legend { color: #6d7b8e; }.operator-bars { border-bottom-color: #d9e1ec; }.operator-bars b { color: #64748a; }.operator-bars em { color: #8290a2; }
.operator-files-card { color: #64748a; }.operator-files-card h4, .expanded-events-card h4 { color: #304461; }.operator-files-card > p, .expanded-events-card > p { color: #8b97a9; }
.operator-table-scroll { border-color: #e2e8f0; background: #fff; }.operator-table-scroll th { color: #7e8ca0; background: #f3f7fb; }.operator-table-scroll th, .operator-table-scroll td { color: #4b5d76; border-bottom-color: #edf1f6; }.operator-files-card footer, .expanded-events-card footer { color: #72839a; }
.operator-table-scroll table { min-width: 0; }
.operator-empty-slot { border-color: #dce3ec; background: repeating-linear-gradient(135deg,#f8fafc,#f8fafc 12px,#f2f6fa 12px,#f2f6fa 24px); }.operator-empty-slot > div:last-child strong { color: #7f8da1; }.operator-empty-slot > div:last-child span { color: #a0aaba; }
.shift-manager-backdrop { background: rgba(35,49,68,.45); }.shift-manager-panel { border-color: #d7e0eb; background: #fff; box-shadow: 0 24px 80px rgba(30,45,68,.25); }.shift-manager-panel header { border-bottom-color: #e4eaf2; }.shift-manager-panel header strong { color: #172033; }.shift-manager-status span { color: #7f8da2; border-color: #e4eaf2; background: #f8fafc; }.shift-manager-status strong { color: #304461; }.shift-manager-panel p { color: #68788e; }.shift-manager-panel .shift-manager-warning { color: #8b641f; background: #fff8e8; }
.expanded-header { border-top-color: #d5e6fb; border-bottom-color: #dfe6ef; background: #fff; }.expanded-header > strong { color: #172033; }.expanded-shifts span { color: #78869a; border-color: #dce3ec; }.expanded-shifts span.active { color: #1f6feb; border-color: #cbdcf4; background: #edf4ff; }.expanded-location { color: #3977c7; }
.expanded-overview { border-bottom-color: #dfe6ef; background: #f4f7fb; }.expanded-overview > .operator-files-card, .expanded-events-card { border-color: #dfe6ef; background: #fff; box-shadow: 0 5px 18px rgba(36,55,84,.04); }
.expanded-chart-body { grid-template-columns: minmax(0,1fr) 250px; }
.expanded-chart-panel { background: #f4f7fb; }.expanded-chart-controls { color: #607089; border-color: #dbe3ed; background: #fff; }.expanded-chart-controls select, .expanded-chart-controls button, .operator-date-input { color: #43556f; border-color: #d5deea; background: #f8faff; }.expanded-chart-controls button:hover { color: #1f6feb; border-color: #77a8e8; }.cloud-chip { color: #286cc2; }.chart-threshold { color: #718096; }.chart-stats { color: #416187; }
.expanded-plot { border-color: #dfe6ef; background: #fff; box-shadow: 0 5px 18px rgba(36,55,84,.04); }.operator-series-legend { color: #52627b; }.operator-grid-line { stroke: #dfe6ef; }.operator-grid-line.horizontal { stroke: #edf1f6; }.operator-axis-label { fill: #728097; }.operator-state-text { fill: #fff; }.operator-event-line.selected { stroke: #172033; }.operator-event-label { fill: #1477a7; }.operator-chart-empty { color: #8794a7; }
.expanded-events-card tbody tr:hover, .expanded-events-card tbody tr.selected { background: #edf4ff; }.expanded-events-card td.effective { color: #18885a; }.expanded-events-card td.dry { color: #bc4b51; }

/* Analytics, alerts and shift-manager application pages. */
.data-toolbar { display: flex; align-items: end; flex-wrap: wrap; gap: 10px; padding: 14px; margin-bottom: 20px; }.data-toolbar label { display: grid; gap: 5px; color: #68788f; font-size: 10px; font-weight: 750; }.data-toolbar input { width: 150px; padding: 8px 9px; }.quick-ranges { display: flex; gap: 4px; padding: 4px; border: 1px solid #dce5f1; border-radius: 9px; background: #f8faff; }
.analytics-table table { min-width: 1050px; }.analytics-table td, .analytics-table th { padding-left: 14px; padding-right: 14px; }.state-split { width: 150px; height: 9px; display: flex; overflow: hidden; border-radius: 999px; background: #e8edf3; }.state-split i { display: block; height: 100%; }.state-split .active { background: #2bb478; }.state-split .idle { background: #eca83e; }.state-split .no-net { background: #9aa5b5; }.good-number { color: #18885a; font-weight: 800; }.bad-number { color: #bc4b51; font-weight: 800; }.table-action { color: #1f6feb; font-size: 11px; font-weight: 750; text-decoration: none; }.table-action:hover { text-decoration: underline; }.success-state { color: #18885a; }
.analytics-usage-panel { margin-top: 22px; padding: 24px 0 0; overflow: hidden; }
.analytics-usage-heading { align-items: flex-start; margin: 0; padding-bottom: 16px; }
.analytics-usage-description { max-width: 680px; margin: 7px 0 0; line-height: 1.45; }
.analytics-machine-picker { display: grid; gap: 6px; min-width: 180px; color: #68788f; font-size: 10px; font-weight: 750; }
.analytics-machine-picker select { width: 180px; padding: 8px 9px; border: 1px solid #d4dce8; border-radius: 9px; color: #172033; background: #fbfcfe; }
.analytics-usage-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0 25px 16px; }
.analytics-usage-summary > div { display: grid; gap: 4px; min-width: 0; padding: 12px 14px; border-left: 3px solid #4689ee; background: #f7faff; }
.analytics-usage-summary > div:nth-child(2) { border-left-color: #2bb478; }
.analytics-usage-summary > div:nth-child(3) { border-left-color: #8d74e8; }
.analytics-usage-summary span { color: #7b8ba1; font-size: 10px; font-weight: 750; }
.analytics-usage-summary strong { overflow: hidden; color: #243b5b; font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
.analytics-usage-chart-shell { min-height: 270px; padding: 0 25px 20px; }
.analytics-usage-chart { height: 220px; min-width: 0; }
.analytics-usage-chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.analytics-chart-grid-line { stroke: #e5ebf3; stroke-width: .45; vector-effect: non-scaling-stroke; }
.analytics-chart-axis-line { stroke: #b8c7d9; stroke-width: .8; vector-effect: non-scaling-stroke; }
.analytics-chart-axis-label { fill: #7b8ba1; font-size: 2.5px; font-weight: 750; }
.analytics-chart-date-label { fill: #7b8ba1; font-size: 2.5px; font-weight: 750; }
.analytics-usage-bar { fill: #397fdf; opacity: .86; }
.analytics-usage-bar:hover { fill: #1f6feb; opacity: 1; }
.analytics-usage-legend { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 8px; color: #74849a; font-size: 10px; }
.analytics-usage-legend span { display: inline-flex; align-items: center; gap: 6px; font-weight: 750; }
.analytics-usage-legend i { width: 12px; height: 8px; display: inline-block; border-radius: 2px; background: #397fdf; }
.analytics-usage-legend small { color: #9aa5b5; font-size: 10px; }
.analytics-compare-panel { margin-bottom: 22px; padding: 24px 0 18px; overflow: hidden; }
.analytics-compare-heading { align-items: flex-start; margin: 0; padding: 0 25px 16px; }
.analytics-compare-heading p.muted { max-width: 720px; margin: 7px 0 0; line-height: 1.45; }
.analytics-state-legend { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; color: #74849a; font-size: 10px; font-weight: 750; }
.analytics-state-legend span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.analytics-state-legend i { width: 9px; height: 9px; display: inline-block; border-radius: 2px; }
.analytics-state-legend i.active { background: var(--state-active-color); }
.analytics-state-legend i.idle { background: var(--state-idle-color); }
.analytics-state-legend i.no-net { background: var(--state-no-net-color); }
.analytics-compare-list { display: grid; gap: 11px; padding: 0 25px; }
.analytics-compare-row { display: grid; grid-template-columns: 100px minmax(150px, 1fr) minmax(210px, .55fr); align-items: center; gap: 12px; min-width: 0; }
.analytics-compare-track { display: flex; height: 12px; min-width: 0; overflow: hidden; border-radius: 999px; background: #e8edf3; }
.analytics-compare-track i { display: block; height: 100%; min-width: 2px; }
.analytics-compare-track i.active { background: var(--state-active-color); }
.analytics-compare-track i.idle { background: var(--state-idle-color); }
.analytics-compare-track i.no-net { background: var(--state-no-net-color); }
.analytics-compare-values { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; min-width: 0; color: #657892; font-size: 10px; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.analytics-compare-values .active-text { color: var(--state-active-color); }
.analytics-compare-values .idle-text { color: var(--state-idle-color); }
.analytics-compare-values .no-net-text { color: #7e8da1; }
.analytics-compare-filters { display: grid; grid-template-columns: minmax(160px, .25fr) minmax(0, 1fr); gap: 16px; margin: 0 25px 18px; padding: 14px 16px; border: 1px solid #dce5f1; border-radius: 12px; background: #f8fbff; }
.analytics-filter-field { display: grid; align-content: start; gap: 6px; color: #68788f; font-size: 10px; font-weight: 750; }
.analytics-filter-field select { width: 100%; min-height: 34px; padding: 7px 9px; border: 1px solid #d4dce8; border-radius: 9px; color: #172033; background: #fff; }
.analytics-machine-selection { display: grid; gap: 8px; min-width: 0; }
.analytics-machine-selection-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; color: #68788f; font-size: 10px; font-weight: 750; }
.analytics-select-all { padding: 0; border: 0; color: #1f6feb; background: transparent; font: inherit; cursor: pointer; }
.analytics-select-all:hover { text-decoration: underline; }
.analytics-selection-count { margin-left: auto; color: #8a99ad; font-size: 10px; font-weight: 650; }
.analytics-machine-options { display: flex; flex-wrap: wrap; gap: 7px; min-width: 0; }
.analytics-machine-option { display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; border: 1px solid #d8e3f0; border-radius: 8px; color: #314968; background: #fff; font-size: 11px; font-weight: 750; cursor: pointer; }
.analytics-machine-option:has(input:checked) { border-color: #8ab6f5; color: #1f6feb; background: #edf5ff; }
.analytics-machine-option input { accent-color: #1f6feb; }
.analytics-compare-filters small { display: block; line-height: 1.4; }
.analytics-shift-breakdown { margin-top: 20px; border-top: 1px solid #e1e8f2; padding-top: 18px; }
.analytics-shift-breakdown-heading { align-items: baseline; margin: 0; padding: 0 25px 12px; }
.analytics-shift-breakdown-heading h3 { margin: 0; color: #243b5b; font-size: 15px; }
.analytics-shift-table-scroll { max-height: 390px; margin: 0 25px; border: 1px solid #e0e7f0; border-radius: 10px; }
.analytics-shift-table-scroll table { min-width: 850px; }
.analytics-shift-table-scroll td, .analytics-shift-table-scroll th { padding: 10px 12px; }
.analytics-shift-table-scroll .cell-subtitle { display: block; }
.analytics-shift-table-scroll .active-text { color: var(--state-active-color); font-weight: 750; }
.analytics-shift-table-scroll .idle-text { color: var(--state-idle-color); font-weight: 750; }
.analytics-shift-table-scroll .no-net-text { color: var(--state-no-net-color); font-weight: 750; }
.manager-card { display: grid; grid-template-columns: 1.2fr .8fr; gap: 30px; align-items: center; padding: 26px; margin-bottom: 22px; }.manager-card p { margin: 8px 0 0; color: #718096; font-size: 13px; line-height: 1.55; }.manager-callout { display: grid; gap: 6px; padding: 16px; border: 1px solid #d6e4f7; border-radius: 12px; color: #355e91; background: #f2f7ff; }.manager-callout strong { font-size: 12px; }.manager-callout span { color: #687c98; font-size: 11px; line-height: 1.45; }

.admin-form-grid select[multiple] { min-height: 76px; padding: 5px 6px; }

/* Google Workspace authentication. Dashboard credentials never appear in the page. */
.auth-shell { min-height: 100vh; display: grid; grid-template-rows: auto 1fr auto; padding: 28px 5vw 24px; background: #f4f7fb; }
.auth-brand { display: inline-flex; align-items: center; gap: 12px; width: fit-content; color: #172033; text-decoration: none; }
.auth-brand strong { display: block; font-size: 16px; }.auth-brand small { display: block; margin-top: 2px; color: #7a879d; font-size: 11px; }
.auth-content { display: grid; place-items: center; padding: 30px 0; }
.auth-card { width: min(460px, 100%); padding: 38px 36px 30px; text-align: center; }
.auth-card-mark { width: 48px; height: 48px; display: grid; place-items: center; margin: 0 auto 20px; border-radius: 14px; color: #fff; background: #1f6feb; box-shadow: 0 8px 18px rgba(31,111,235,.22); font-size: 24px; font-weight: 850; }
.auth-card .eyebrow { margin-bottom: 10px; }.auth-card h1 { margin-bottom: 10px; font-size: clamp(28px, 4vw, 38px); }.auth-subtitle { margin: 0 auto; max-width: 330px; color: #728097; font-size: 13px; line-height: 1.5; }
.google-login-panel { display: grid; justify-items: center; gap: 13px; margin-top: 28px; padding: 22px 14px; border: 1px solid #dce7f5; border-radius: 12px; background: #fbfdff; }
.google-button-host { min-height: 44px; }.auth-help { max-width: 300px; margin: 0; color: #8390a4; font-size: 11px; line-height: 1.45; }
.auth-unavailable { margin-top: 28px; padding: 17px; border: 1px solid #f0ddb2; border-radius: 11px; color: #8a641f; background: #fff8e8; font-size: 12px; line-height: 1.45; }.auth-unavailable p { margin: 6px 0 0; color: #8d7750; }
.auth-error { margin: 14px 0 0; }.auth-domain-note { margin: 24px 0 0; color: #98a3b2; font-size: 10px; line-height: 1.45; }.auth-loading { display: flex; align-items: center; justify-content: center; gap: 10px; color: #718096; font-size: 12px; min-height: 90px; margin-top: 18px; }.auth-redirect { min-height: 100vh; display: grid; place-items: center; color: #718096; background: #f4f7fb; font-size: 13px; }.auth-footer { display: grid; gap: 4px; margin: 0; color: #98a3b2; font-size: 10px; line-height: 1.35; text-align: center; }.auth-copyright { color: #728097; font-size: 10px; }
.tv-pair-entry { display: grid; justify-items: center; gap: 7px; margin-top: 18px; padding-top: 18px; border-top: 1px solid #e4ebf4; }.tv-pair-entry p { max-width: 290px; margin: 0; color: #8995a7; font-size: 10px; line-height: 1.45; }.tv-pair-card { width: min(520px, 100%); }.tv-pair-card h1 { font-size: clamp(26px, 4vw, 34px); }.tv-pair-tv-panel { display: grid; justify-items: center; gap: 10px; margin-top: 26px; padding: 24px 18px; border-radius: 14px; background: #f5f9ff; }.tv-pair-label { color: #71809a; font-size: 11px; font-weight: 750; }.tv-pair-code { color: #164c91; font-size: clamp(34px, 8vw, 54px); letter-spacing: .18em; line-height: 1; }.tv-pair-expiry { color: #8390a4; font-size: 11px; }.tv-pair-instructions { display: grid; gap: 5px; width: 100%; margin-top: 8px; padding: 13px; border-radius: 9px; color: #516784; background: #fff; font-size: 11px; line-height: 1.45; text-align: center; }.tv-pair-instructions b { color: #286cc2; overflow-wrap: anywhere; }.tv-pair-waiting { display: flex; align-items: center; gap: 8px; margin-top: 4px; color: #6c7d95; font-size: 11px; }.tv-pair-waiting .spinner { width: 14px; height: 14px; }.tv-pair-google-panel { margin-top: 26px; }.tv-pair-code-entry { display: grid; gap: 9px; margin-top: 26px; text-align: left; }.tv-pair-code-entry label { color: #61738c; font-size: 11px; font-weight: 750; }.tv-pair-code-entry input { text-align: center; font-size: 24px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }.tv-pair-code-entry button { justify-self: center; margin-top: 4px; }.tv-pair-confirmed { display: grid; gap: 7px; margin-top: 26px; padding: 18px; border-radius: 11px; color: #1a8b61; background: #e9f8f0; font-size: 12px; }.tv-pair-confirmed span { color: #53856f; font-size: 11px; }.tv-pair-back { display: block; margin: 24px 0 0; text-align: center; }
.tv-pair-qr-section { display: grid; justify-items: center; gap: 7px; margin-top: 8px; }.tv-pair-qr-frame { display: grid; place-items: center; width: 184px; height: 184px; padding: 10px; border-radius: 12px; background: #fff; box-shadow: 0 8px 22px rgba(30, 73, 125, .12); }.tv-pair-qr-frame svg { display: block; width: 100%; height: 100%; }.tv-pair-qr-caption { color: #71809a; font-size: 10px; text-align: center; }

@media (max-width: 1050px) {
    .topbar { height: auto; min-height: 76px; gap: 16px; padding-top: 12px; padding-bottom: 12px; }.topbar-actions { align-items: flex-end; flex-direction: column; gap: 5px; }.topbar nav { display: flex; flex-wrap: wrap; justify-content: flex-end; }.manager-card { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    .topbar { align-items: flex-start; }.topbar-actions { align-items: flex-end; }.auth-shell { padding: 20px 5vw; }.auth-card { padding: 30px 22px 24px; }
}

/* Final normal-wall sizing pass.  Keep the printed-file table in its own
   allocated band instead of allowing a flex-shrunk table to paint over the
   shift summary on a 16:9 TV. */
.live-normal-card { gap: 6px; }
.live-normal-details { height: 104px; flex: 0 0 104px; }
.live-values-panel { grid-template-rows: 70px 27px; }
.live-values-grid { grid-auto-rows: 33px; }
.live-values-grid > span { padding: 4px 6px; }
.live-shift-counters > span { min-height: 27px; display: flex; align-items: center; gap: 5px; padding: 4px 6px; }
.live-shift-counters small { flex: 0 0 auto; }.live-shift-counters strong { font-size: 9px; }.live-shift-counters em { display: none; }
.live-state-panel { height: 104px; padding: 6px 9px; }
.live-normal-card .operator-files-card { flex: 0 0 49px; min-height: 49px; padding-top: 3px; }
.live-normal-card .operator-files-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-width: 0; }
.live-normal-card .operator-files-heading p { overflow: hidden; margin: 0; color: #8795a8; font-size: 7px; text-overflow: ellipsis; white-space: nowrap; }
.live-normal-card .operator-files-card h4 { font-size: 9px; line-height: 11px; }
.live-normal-card .operator-table-scroll { min-height: 30px; margin-top: 2px; }
.live-normal-card .operator-table-scroll th, .live-normal-card .operator-table-scroll td { padding-top: 2px; padding-bottom: 2px; }
.live-normal-card .operator-files-card footer { display: none; }
.live-normal-footer { min-height: 11px; font-size: 8px; }

/* Normal-card telemetry affordance. Keep the tile calm until an operator hovers or
   keyboard-focuses a changing value, then place a small shift chart above the grid. */
.live-normal-card.metric-popover-open { position: relative; z-index: 20; }
.live-normal-card .live-metric-hover { position: relative; min-width: 0; }
.live-normal-card .live-values-grid > .live-metric-hover { display: block; min-height: 0; }
.live-normal-card .live-values-grid > .live-metric-hover:focus-within { z-index: 60; }
.live-normal-card .live-metric-trigger { display: grid; grid-template-rows: auto auto; align-content: center; width: 100%; height: 100%; min-width: 0; padding: 4px 6px; border: 1px solid #e7edf4; border-radius: 7px; color: inherit; background: #fafcff; font: inherit; text-align: left; cursor: help; }
.live-normal-card .live-metric-trigger:hover, .live-normal-card .live-metric-trigger:focus-visible { border-color: #a9c8ef; outline: 2px solid rgba(31,111,235,.16); outline-offset: 1px; background: #f2f7ff; }
.live-normal-card .live-metric-trigger small { overflow: hidden; color: #8a98aa; font-size: 8px; font-weight: 800; letter-spacing: .05em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.live-normal-card .live-metric-trigger strong { overflow: hidden; color: #3b506c; font-size: 11px; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.live-normal-card .live-progress-hover { display: grid; justify-items: end; }
.live-normal-card .live-progress-trigger { width: auto; height: auto; min-width: 64px; padding: 2px 5px; border-color: transparent; background: transparent; justify-items: end; }
.live-normal-card .live-progress-trigger strong { color: #1f6feb; font-size: 16px; }
.live-normal-card .live-progress-trigger span { color: #8795a8; font-size: 9px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.live-normal-card .live-progress-trigger:hover, .live-normal-card .live-progress-trigger:focus-visible { border-color: #a9c8ef; background: #f2f7ff; }
.live-normal-card .live-metric-hover .metric-popover { top: calc(100% + 8px); }
.live-normal-card .live-progress-hover .metric-popover { right: 0; left: auto; transform: none; }
.metric-popover { position: absolute; top: calc(100% + 8px); left: 50%; z-index: 70; width: min(270px, calc(100vw - 28px)); transform: translateX(-50%); padding: 11px; border: 1px solid #cbdcf1; border-radius: 11px; color: #4c607b; background: rgba(255,255,255,.98); box-shadow: 0 14px 32px rgba(26,52,87,.2); pointer-events: auto; }
.metric-popover-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-bottom: 7px; border-bottom: 1px solid #e7edf4; }
.metric-popover-heading > div { display: grid; gap: 2px; min-width: 0; }
.metric-popover-eyebrow { color: #8091a7; font-size: 7px; font-weight: 800; letter-spacing: .1em; }
.metric-popover-heading strong { overflow: hidden; color: #263d5d; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.metric-popover-heading small { overflow: hidden; color: #8190a4; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.metric-popover-heading b { flex: 0 0 auto; color: #1f6feb; font-size: 14px; font-variant-numeric: tabular-nums; }
.metric-popover-chart { height: 82px; margin-top: 7px; padding: 4px 2px 2px; border: 1px solid #edf1f6; border-radius: 7px; background: #f8faff; }
.metric-popover-chart svg { display: block; width: 100%; height: 100%; }
.metric-chart-grid-line { stroke: #dfe8f3; stroke-width: 1; stroke-dasharray: 3 3; }
.metric-chart-line { fill: none; stroke: #1f83e2; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.5; }
.metric-popover-scale, .metric-popover-footer { display: flex; justify-content: space-between; gap: 8px; min-width: 0; color: #8291a5; font-size: 8px; font-variant-numeric: tabular-nums; }
.metric-popover-scale { padding-top: 3px; color: #5f7594; font-weight: 800; }
.metric-popover-footer { padding-top: 6px; font-size: 7px; }
.metric-popover-loading { display: flex; align-items: center; gap: 7px; min-height: 92px; color: #6f819a; font-size: 9px; }
.metric-popover-loading .spinner { width: 13px; height: 13px; flex: 0 0 auto; border-width: 2px; }
.metric-popover-message { margin: 0; padding: 22px 5px; color: #7d8ca0; font-size: 9px; line-height: 1.4; text-align: center; }

/* The file list is deliberately bounded. More files produce a scrollbar inside the
   tile instead of pushing the shift summary or painting over the footer. */
.live-normal-card .operator-table-scroll { overflow-x: hidden; overflow-y: auto; scrollbar-color: #b8c9df #f2f6fb; scrollbar-width: thin; scrollbar-gutter: stable; }
.live-normal-card .operator-table-scroll::-webkit-scrollbar { width: 7px; }
.live-normal-card .operator-table-scroll::-webkit-scrollbar-track { background: #f2f6fb; border-radius: 999px; }
.live-normal-card .operator-table-scroll::-webkit-scrollbar-thumb { background: #b8c9df; border: 2px solid #f2f6fb; border-radius: 999px; }

@media (min-width: 1251px) {
    .live-normal-card { overflow: visible; }
}

@media (max-height: 850px) and (min-width: 1251px) {
    .live-normal-details { height: 89px; flex-basis: 89px; }.live-values-panel { grid-template-rows: 59px 24px; }.live-values-grid { grid-auto-rows: 28px; }.live-values-grid > span { padding: 3px 4px; }.live-shift-counters > span { min-height: 24px; padding: 3px 4px; }.live-state-panel { height: 89px; }.live-normal-card .operator-files-card { flex-basis: 43px; min-height: 43px; }.live-normal-card .operator-table-scroll { min-height: 24px; }
}

/* Final Minimal readability pass. The generic .live-pie rule is declared later than the
   first Minimal rules, so keep the TV-wall pie size and readable text here at the end. */
.live-minimal-card { gap: 3px; padding: 6px 10px; }
.live-minimal-card .live-machine-card-header { min-height: 30px; }
.live-minimal-card .live-machine-identity { gap: 7px; }
.live-minimal-card .live-machine-identity h2 { font-size: 14px; }
.live-minimal-card .live-machine-identity span:not(.live-state-dot) { margin-top: 2px; font-size: 9px; }
.live-minimal-card .live-status-line { min-height: 20px; }
.live-minimal-card .live-status-line time { font-size: 10px; }
.live-minimal-visuals { flex-basis: 61px; grid-template-columns: minmax(0, .86fr) minmax(0, 1.14fr); gap: 8px; height: 61px; margin-top: auto; }
.live-minimal-chart { height: 61px; padding: 6px 8px; border-radius: 9px; }
.live-minimal-pie-card { grid-template-columns: 50px minmax(0, 1fr); gap: 7px; }
.live-minimal-pie { width: 46px !important; }
.live-minimal-chart-copy { gap: 2px; line-height: 1.05; }
.live-minimal-chart-copy span, .live-minimal-chart-label { font-size: 8px; line-height: 1.05; }
.live-minimal-chart-copy strong { font-size: 10px; line-height: 1.1; }
.live-minimal-chart-copy small { font-size: 8px; line-height: 1.1; }
.live-minimal-bar-card { gap: 5px; }
.live-minimal-bars { gap: 4px; }
.live-minimal-bars > span { grid-template-columns: 56px minmax(45px, 1fr) 50px; gap: 5px; line-height: normal; }
.live-minimal-bars small { font-size: 8px; line-height: normal; }
.live-minimal-bars i { height: 6px; }
.live-minimal-bars strong { font-size: 8px; line-height: normal; }
.live-minimal-shifts { flex-basis: 29px; gap: 7px; height: 29px; }
.live-minimal-shifts > span { padding: 4px 7px; }
.live-minimal-shifts small { font-size: 8px; line-height: 1.05; }
.live-minimal-shifts strong { font-size: 9px; line-height: 1.05; }
.live-minimal-shifts em { font-size: 7px; line-height: 1.05; }
.live-minimal-card footer { flex-basis: 8px; height: 8px; font-size: 8px; }

@media (min-width: 901px) and (max-width: 1250px) {
    .live-minimal-card { gap: 3px; padding: 5px 8px; }
    .live-minimal-card .live-machine-card-header { min-height: 27px; }
    .live-minimal-card .live-machine-identity h2 { font-size: 13px; }
    .live-minimal-card .live-machine-identity span:not(.live-state-dot) { font-size: 8px; }
    .live-minimal-card .live-status-line { min-height: 18px; }
    .live-minimal-card .live-status-line time { font-size: 8px; }
    .live-minimal-visuals { flex-basis: 55px; gap: 5px; height: 55px; }
    .live-minimal-chart { height: 55px; padding: 4px 5px; }
    .live-minimal-pie-card { grid-template-columns: 43px minmax(0, 1fr); gap: 5px; }
    .live-minimal-pie { width: 40px !important; }
    .live-minimal-chart-copy { gap: 1px; }
    .live-minimal-chart-copy span, .live-minimal-chart-label { font-size: 7px; }
    .live-minimal-chart-copy strong { font-size: 8px; }
    .live-minimal-chart-copy small { font-size: 7px; }
    .live-minimal-bar-card { gap: 3px; }
    .live-minimal-bars { gap: 2px; }
    .live-minimal-bars > span { grid-template-columns: 46px minmax(30px, 1fr) 42px; gap: 3px; }
    .live-minimal-bars small, .live-minimal-bars strong { font-size: 7px; }
    .live-minimal-bars i { height: 5px; }
    .live-minimal-shifts { flex-basis: 26px; gap: 4px; height: 26px; }
    .live-minimal-shifts > span { padding: 3px 5px; }
    .live-minimal-shifts small { font-size: 7px; }
    .live-minimal-shifts strong { font-size: 8px; }
    .live-minimal-shifts em { font-size: 6px; }
    .live-minimal-card footer { flex-basis: 7px; height: 7px; font-size: 7px; }
}

/* Shift summary correction. Each summary has three lines, so reserve a real text band instead
   of allowing the two columns to overflow their earlier 29px height. */
.live-minimal-card .live-machine-card-header { flex: 0 0 30px; min-height: 30px; }
.live-minimal-card .live-status-line { flex: 0 0 20px; height: 20px; min-height: 20px; }
.live-minimal-card .live-minimal-visuals { flex: 1 1 auto; height: auto; min-height: 0; margin: 3px 0; }
.live-minimal-card .live-minimal-chart { height: auto; min-height: 0; padding: 10px 12px; }
.live-minimal-card footer { flex: 0 0 8px; height: 8px; }

@media (min-width: 901px) and (max-width: 1250px) {
    .live-minimal-card .live-machine-card-header { flex-basis: 27px; min-height: 27px; }
    .live-minimal-card .live-status-line { flex-basis: 18px; height: 18px; min-height: 18px; }
    .live-minimal-card .live-minimal-visuals { flex-basis: auto; margin: 3px 0; }
    .live-minimal-card .live-minimal-chart { height: auto; min-height: 0; padding: 8px 9px; }
    .live-minimal-card footer { flex-basis: 7px; height: 7px; }
}

/* Administrator operations. Keep fleet status, alerts and PC diagnostics in one workspace. */
.admin-operations-grid { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr); gap: 18px; margin: 0 0 18px; }
.admin-operations-panel { min-width: 0; padding: 20px; }
.admin-operations-panel .section-heading { align-items: flex-start; padding: 0 0 14px; margin-bottom: 0; }
.admin-panel-subtitle { margin: 6px 0 0; color: #7b899e; font-size: 11px; line-height: 1.45; }
.admin-operations-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0 0 16px; }
.admin-operations-metrics .metric-card { min-height: 94px; padding: 16px; }
.admin-operations-metrics .metric-card strong { margin: 8px 0 2px; font-size: 24px; }
.admin-fleet-table { min-width: 1120px; }
.admin-alert-table { min-width: 840px; }
.admin-pc-table { min-width: 1500px; }
.admin-pc-table td, .admin-pc-table th { vertical-align: top; }
.diag-stack { display: grid; gap: 4px; min-width: 0; }
.diag-stack strong { color: #304461; font-size: 11px; }
.diag-line, .diag-label { display: block; color: #65768d; font-size: 10px; line-height: 1.4; }
.admin-route-redirect { display: grid; place-items: center; min-height: 220px; gap: 10px; color: #718096; }

@media (max-width: 1050px) {
    .admin-operations-grid { grid-template-columns: 1fr; }
    .admin-operations-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Normal card cleanup. Keep the information, remove repeated bands and let each
   section own a predictable amount of the compact landscape tile. */
.live-normal-card { gap: 5px; padding: 10px 12px 8px; }
.live-normal-card .live-machine-identity > div { display: flex; align-items: baseline; gap: 7px; }
.live-normal-card .live-machine-identity span:not(.live-state-dot) { margin-top: 0; }
.live-normal-job-row { min-height: 24px; align-items: center; gap: 8px; }
.live-current-job { display: flex; align-items: baseline; gap: 7px; min-width: 0; }
.live-current-job span, .live-progress-copy span { flex: 0 0 auto; font-size: 8px; letter-spacing: .06em; }
.live-current-job strong { font-size: 12px; }
.live-current-job small { font-size: 8px; }
.live-progress-copy { gap: 1px; }
.live-progress-copy strong { font-size: 14px; line-height: 1; }
.live-progress { height: 4px; }

.live-normal-details { height: 86px; flex: 0 0 86px; grid-template-columns: minmax(0, 1.08fr) minmax(220px, .92fr); gap: 8px; }
.live-values-panel { display: block; min-width: 0; }
.live-values-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 25px; gap: 0; overflow: hidden; border: 1px solid #e1e9f3; border-radius: 8px; background: #fafcff; }
.live-values-grid > span, .live-values-grid > .live-metric-hover { display: block; min-height: 0; padding: 0; border: 0; border-right: 1px solid #e1e9f3; border-bottom: 1px solid #e1e9f3; border-radius: 0; background: transparent; }
.live-values-grid > :nth-child(3n) { border-right: 0; }
.live-values-grid > :nth-last-child(-n + 3) { border-bottom: 0; }
.live-values-grid > span { padding: 4px 6px; }
.live-values-grid small { font-size: 7px; letter-spacing: .04em; }
.live-values-grid strong { font-size: 10px; }
.live-normal-card .live-metric-trigger { padding: 4px 6px; border: 0; border-radius: 0; background: transparent; }
.live-normal-card .live-metric-trigger:hover, .live-normal-card .live-metric-trigger:focus-visible { border: 0; outline: 2px solid rgba(31,111,235,.2); outline-offset: -2px; background: #f0f6ff; }

.live-state-panel { height: 86px; grid-template-columns: 98px minmax(0, 1fr); gap: 8px; padding: 5px 8px; }
.live-pie-wrap { gap: 2px; }
.live-pie { width: 50px; }
.live-pie-wrap span { font-size: 7px; }
.live-pie-wrap strong { font-size: 8px; }
.live-pie-wrap small { font-size: 7px; }
.live-state-bars { gap: 3px; }
.live-state-bars-heading { display: grid; gap: 1px; min-width: 0; padding-bottom: 3px; border-bottom: 1px solid #e6ecf3; }
.live-state-bars-heading span { overflow: hidden; color: #7f8ea0; font-size: 7px; font-weight: 800; letter-spacing: .05em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.live-state-bars-heading small { overflow: hidden; color: #7c8ba0; font-size: 7px; text-overflow: ellipsis; white-space: nowrap; }
.live-state-bars > span { grid-template-columns: 50px minmax(35px, 1fr) 38px; gap: 4px; }
.live-state-bars small { font-size: 7px; }
.live-state-bars i { height: 5px; }
.live-state-bars strong { font-size: 8px; }

.live-normal-card .operator-files-card { flex: 0 0 52px; min-height: 52px; padding-top: 1px; }
.live-normal-card .operator-files-heading p { font-size: 7px; }
.live-normal-card .operator-files-card h4 { font-size: 8px; line-height: 10px; }
.live-normal-card .operator-table-scroll { min-height: 34px; margin-top: 2px; }
.live-normal-card .operator-table-scroll th, .live-normal-card .operator-table-scroll td { padding: 1px 5px; font-size: 8px; line-height: 13px; }
.live-normal-card .operator-table-scroll th { font-size: 7px; line-height: 11px; }
.live-normal-card .operator-table-scroll.is-empty { display: block; overflow: hidden; }
.live-normal-card .operator-table-scroll.is-empty table { height: 100%; }
.live-normal-card .operator-table-scroll.is-empty thead { height: 22px; }
.live-normal-card .operator-table-scroll.is-empty tbody { height: calc(100% - 22px); }
.live-normal-card .operator-table-scroll.is-empty tbody tr { height: 100%; }
.live-normal-card .operator-files-empty { width: 100%; overflow: hidden; padding: 3px 6px; color: #71839a; font-size: 8px; line-height: 14px; text-align: center; text-overflow: ellipsis; vertical-align: middle; white-space: nowrap; }
.live-normal-footer { min-height: 9px; font-size: 7px; }

@media (max-width: 1250px) and (min-width: 761px) {
    .live-normal-card { gap: 4px; padding: 8px 9px 7px; }
    .live-normal-details { height: 80px; flex-basis: 80px; grid-template-columns: 1fr; }
    .live-state-panel { height: 80px; }
    .live-normal-card .operator-files-card { flex-basis: 48px; min-height: 48px; }
}

/* Final normal-card readability pass. Keep every value as a deliberate two-line
   label/value cell, and let the file panel use the remaining card height. */
.live-values-grid { grid-auto-rows: 28px; overflow: visible; }
.live-values-grid > span { display: grid; align-content: center; gap: 1px; padding: 3px 6px; }
.live-values-grid small, .live-values-grid strong { display: block; line-height: 1.05; }
.live-normal-card .live-metric-trigger { grid-template-rows: 9px 11px; align-content: center; padding: 2px 6px; line-height: 1; }
.live-normal-card .live-metric-trigger small, .live-normal-card .live-metric-trigger strong { line-height: 1; }
.live-normal-details { height: 92px; flex-basis: 92px; }
.live-state-panel { height: 92px; }
.live-normal-card .operator-files-card { flex: 1 1 52px; min-height: 52px; }

/* Keep the legacy ten-value operator summary readable in two balanced rows:
   the name and print time live in Current work, while these eight cells carry
   the layer, speed, auger and mixing values. */
.live-values-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.live-values-grid > :nth-child(3n) { border-right: 1px solid #e1e9f3; }
.live-values-grid > :nth-child(4n) { border-right: 0; }
.live-values-grid > :nth-last-child(-n + 3) { border-bottom: 1px solid #e1e9f3; }
.live-values-grid > :nth-last-child(-n + 4) { border-bottom: 0; }

/* Final operator details pass. Keep empty file history invisible, preserve the
   scrollable table when rows exist, and keep the operator marker and weather
   context visible in both wall modes. */
.live-window-dots { display: inline-flex !important; align-items: center; justify-content: flex-start; gap: 3px; width: 21px; min-width: 21px; flex: 0 0 21px; margin-top: 0 !important; color: transparent; }
.live-window-dots i { display: block; width: 6px; height: 6px; margin: 0; border-radius: 50%; background: #d45b66; box-shadow: 0 0 0 2px rgba(212,91,102,.1); }
.live-window-dots.printing i { background: #2bb478; box-shadow: 0 0 0 2px rgba(43,180,120,.11); }
.live-window-dots.idle i { background: #eca83e; box-shadow: 0 0 0 2px rgba(236,168,62,.11); }
.live-card-actions { align-items: center; gap: 7px; min-width: 0; }
.live-weather-inline { display: inline-block; max-width: 120px; overflow: hidden; color: #5f7594; font-size: 8px; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.live-normal-card .live-progress-copy { display: flex; align-items: baseline; justify-content: flex-end; gap: 4px; }
.live-normal-card .live-progress-copy span { font-size: 8px; letter-spacing: .06em; }
.live-normal-card .live-normal-footer { margin-top: auto; }
.live-minimal-card .live-machine-identity > div { display: flex; align-items: baseline; gap: 7px; }
.live-minimal-card .live-machine-identity span:not(.live-state-dot) { margin-top: 0; }
.live-minimal-card .live-card-actions { flex: 0 0 auto; }
.live-minimal-card .live-weather-inline { max-width: 105px; }

/* Expanded machine readability. Keep the legacy ten-field operator block intact, but give it
   an explicit heading and a flexible five-row grid so the last row cannot disappear. */
.live-expanded-overview { height: clamp(250px, 32vh, 310px); min-height: 250px; }
.live-expanded-overview .expanded-values-pane { overflow: hidden; gap: 6px; }
.expanded-progress-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-width: 0; }
.expanded-progress-heading h3, .expanded-pane-heading, .expanded-panel-heading h3 { margin: 0; color: #304461; font-size: 10px; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.expanded-progress-heading strong { color: #1f6feb; font-size: 11px; font-variant-numeric: tabular-nums; }
.live-expanded-overview .expanded-pane-heading { padding-top: 1px; color: #718096; font-size: 8px; }
.live-expanded-overview .expanded-values-pane .operator-values { flex: 1 1 auto; min-height: 0; grid-auto-rows: minmax(24px, 1fr); align-content: stretch; }
.live-expanded-overview .expanded-values-pane .operator-values > div { display: grid; align-content: center; min-height: 0; }
.live-expanded-overview .expanded-panel-heading { grid-column: 1 / -1; display: grid; gap: 2px; min-width: 0; }
.live-expanded-overview .expanded-panel-heading small { overflow: hidden; color: #8997a9; font-size: 8px; font-weight: 700; letter-spacing: .03em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.live-expanded-overview .expanded-pie-pane { grid-template-rows: auto minmax(0, 1fr); align-content: stretch; }
.live-expanded-overview .expanded-pie-pane .expanded-pie { align-self: center; }
.live-expanded-overview .expanded-bars-pane { gap: 4px; }
.live-expanded-overview .expanded-bars-pane .expanded-bars { min-height: 0; padding-top: 12px; }
.live-expanded-overview .expanded-bars-pane .expanded-bars b { top: -10px; }
.live-expanded-overview .expanded-bars-pane .expanded-bars em { bottom: -11px; }

/* Expanded lower-panel tabs keep the graph, future RTSP camera and consolidated event history
   separate without adding another always-visible column to the operator layout. */
.expanded-view-tabs { display: flex; flex: 0 0 auto; align-items: center; gap: 5px; min-height: 35px; padding: 0 2px; border-bottom: 1px solid #dbe4ee; }
.expanded-view-tabs button { padding: 7px 11px; border: 1px solid transparent; border-radius: 7px 7px 0 0; color: #6b7b91; background: transparent; font: inherit; font-size: 10px; font-weight: 800; cursor: pointer; }
.expanded-view-tabs button:hover { color: #1f6feb; background: #edf4ff; }
.expanded-view-tabs button.active { color: #1f6feb; border-color: #d5e3f7; border-bottom-color: #fff; background: #fff; }
.expanded-chart-tab-content { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; padding-top: 9px; }
.expanded-weather-chip { overflow: hidden; max-width: min(360px, 32vw); color: #18885a; font-size: 9px; font-variant-numeric: tabular-nums; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.expanded-tab-content { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; padding: 14px 2px 2px; }
.expanded-tab-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 3px 4px 13px; }
.expanded-tab-heading h3 { margin: 3px 0 0; color: #304461; font-size: 16px; }
.expanded-tab-heading p { margin: 5px 0 0; color: #8190a4; font-size: 10px; line-height: 1.4; }
.expanded-tab-eyebrow { color: #8190a4; font-size: 8px; font-weight: 850; letter-spacing: .12em; }
.expanded-tab-status { flex: 0 0 auto; padding: 5px 8px; border: 1px solid #dce8f5; border-radius: 999px; color: #55708f; background: #f7faff; font-size: 9px; font-weight: 800; }
.expanded-camera-frame { display: grid; flex: 1 1 auto; place-items: center; align-content: center; gap: 9px; min-height: 180px; border: 1px dashed #b9cbe0; border-radius: 11px; background: repeating-linear-gradient(135deg,#f8fbff,#f8fbff 14px,#f1f6fc 14px,#f1f6fc 28px); text-align: center; }
.expanded-camera-frame strong { color: #526b88; font-size: 15px; }
.expanded-camera-frame span { color: #8999ad; font-size: 10px; }
.expanded-camera-mark { display: grid; width: 44px; height: 34px; place-items: center; border: 2px solid #8ea6c0; border-radius: 8px; color: #6e86a1; font-size: 9px; font-weight: 900; letter-spacing: .08em; }
.expanded-consolidated-table { flex: 1 1 auto; min-height: 0; overflow: auto; border-color: #e1e8f1; border-radius: 8px; }
.expanded-consolidated-table table { min-width: 760px; font-size: 10px; }
.expanded-consolidated-table th, .expanded-consolidated-table td { padding: 8px 10px; }
.expanded-consolidated-table tbody tr { cursor: pointer; }

/* SVG chart labels are deliberately larger than the compact wall cards. */
.live-expanded-chart .operator-series-legend { font-size: 10px; font-weight: 700; }
.live-expanded-chart .operator-series-legend span::before { width: 18px; height: 2px; }
.operator-series-legend .hopper-set::before { background:#54d8bd; }.operator-series-legend .hopper::before { background:#00d8ff; }.operator-series-legend .mix-set::before { background:#de9dff; }.operator-series-legend .mix::before { background:#f2d33c; }.operator-series-legend .plc-hopper-speed::before { background:#14b8a6; }.operator-series-legend .plc-hopper-torque::before { background:#f97316; }.operator-series-legend .plc-mix-speed::before { background:#8b5cf6; }.operator-series-legend .plc-mix-torque::before { background:#e11d48; }.operator-series-legend .plc-hopper-temp::before { background:#0891b2; }.operator-series-legend .plc-mix-temp::before { background:#a16207; }
.live-expanded-chart .operator-axis-label { font-family: "Segoe UI", Arial, sans-serif; font-size: 12px; font-weight: 600; }
.live-expanded-chart .operator-state-text { font-size: 10px; font-weight: 800; }
.live-expanded-chart .operator-event-label { font-size: 9px; font-weight: 700; }

@media (max-height: 850px) and (min-width: 1251px) {
    .live-expanded-overview { height: clamp(225px, 30vh, 270px); min-height: 225px; }
    .live-expanded-overview .expanded-values-pane .operator-values { grid-auto-rows: minmax(21px, 1fr); }
    .live-expanded-overview .expanded-pane-heading, .expanded-progress-heading h3, .expanded-panel-heading h3 { font-size: 9px; }
    .expanded-tab-heading { padding-bottom: 8px; }
}

@media (max-width: 1250px) {
    .expanded-weather-chip { max-width: 100%; flex-basis: 100%; }
    .expanded-tab-content { min-height: 520px; }
}

/* Final expanded operator readability pass. At a 1280 CSS-pixel landscape viewport the ten
   fields need a little more horizontal room and explicit line height so every label and value is
   readable without relying on a hover or a clipped overflow region. */
@media (min-width: 1251px) {
    .live-expanded-overview { grid-template-columns: 286px minmax(235px, .88fr) minmax(255px, 1fr) minmax(300px, 1.04fr); }
}
.live-expanded-overview .expanded-values-pane .operator-values dt { font-size: 8px; line-height: 1.2; }
.live-expanded-overview .expanded-values-pane .operator-values dd { margin-top: 2px; font-size: 11px; line-height: 1.2; }
.live-expanded-overview .expanded-values-pane .operator-values > div { padding: 4px 6px; }

/* Expanded parameter de-clutter pass. Keep the complete ten-field contract, but present each
   field as a quiet label/value row instead of ten nested cards. This gives the operator's eye
   one consistent reading line per parameter and leaves the surrounding panels as the visual
   hierarchy. */
.live-expanded-overview .expanded-values-pane .operator-values {
    column-gap: 16px;
    row-gap: 0;
    padding: 1px 2px;
    border-top: 1px solid #e1e8f1;
    border-bottom: 1px solid #e1e8f1;
}
.live-expanded-overview .expanded-values-pane .operator-values > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 28px;
    padding: 5px 4px;
    border: 0;
    border-bottom: 1px solid #edf1f6;
    border-radius: 0;
    background: transparent;
}
.live-expanded-overview .expanded-values-pane .operator-values > div:nth-child(even) {
    padding-left: 12px;
}
.live-expanded-overview .expanded-values-pane .operator-values > div:nth-last-child(-n + 2) {
    border-bottom: 0;
}
.live-expanded-overview .expanded-values-pane .operator-values dt {
    flex: 0 0 auto;
    font-size: 8px;
    line-height: 1;
}
.live-expanded-overview .expanded-values-pane .operator-values dd {
    min-width: 0;
    margin: 0;
    font-size: 11px;
    line-height: 1;
    text-align: right;
}
.live-expanded-overview .expanded-values-pane .operator-starts {
    margin-top: auto;
    padding-top: 4px;
    border-top: 1px solid #e1e8f1;
}

/* Extended timeline interaction pass. The legend is a compact control bar so the
   operator can hide noisy series and inspect exact values without leaving the graph. */
.live-expanded-chart .operator-trend-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    height: 100%;
    min-height: 0;
}
.live-expanded-chart .operator-series-toolbar {
    display: flex;
    flex: 0 0 auto;
    align-items: flex-start;
    gap: 10px;
    min-height: 0;
    padding: 6px 8px;
    border: 1px solid #e1e8f1;
    border-radius: 8px;
    background: #f9fbfe;
}
.live-expanded-chart .operator-series-toolbar-heading {
    display: grid;
    flex: 0 0 112px;
    gap: 2px;
    padding-top: 2px;
}
.live-expanded-chart .operator-series-toolbar-heading span {
    color: #344d6d;
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.live-expanded-chart .operator-series-toolbar-heading small {
    color: #8a97a9;
    font-size: 8px;
    line-height: 1.25;
}
.live-expanded-chart .operator-series-legend {
    position: static;
    display: flex;
    flex: 1 1 auto;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
    min-width: 0;
    transform: none;
    color: #52627b;
    font-size: 9px;
}
.live-expanded-chart .operator-series-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 23px;
    padding: 3px 7px;
    border: 1px solid #dbe5f0;
    border-radius: 999px;
    color: #536883;
    background: #fff;
    font: inherit;
    font-size: 9px;
    font-weight: 750;
    line-height: 1;
    cursor: pointer;
    transition: background .12s ease, border-color .12s ease, color .12s ease, opacity .12s ease;
}
.live-expanded-chart .operator-series-toggle:hover,
.live-expanded-chart .operator-series-toggle:focus-visible {
    border-color: #8ab7ef;
    color: #1f6feb;
    background: #edf4ff;
    outline: 0;
}
.live-expanded-chart .operator-series-toggle.is-hidden {
    opacity: .48;
    background: #f4f7fa;
}
.live-expanded-chart .operator-series-swatch {
    width: 15px;
    height: 3px;
    flex: 0 0 15px;
    border-radius: 999px;
    background: var(--series-color);
}
.live-expanded-chart .operator-series-toggle.is-hidden .operator-series-swatch {
    border: 1px dashed var(--series-color);
    background: transparent;
}
.live-expanded-chart .operator-series-toggle > span::before {
    display: none;
    content: none;
}
.live-expanded-chart .operator-chart-canvas {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
}
.live-expanded-chart .operator-chart-canvas .operator-trend-svg {
    width: 100%;
    height: 100%;
}
.operator-series-hit {
    fill: transparent;
    stroke: transparent;
    pointer-events: all;
    cursor: crosshair;
}
.operator-chart-tooltip {
    position: absolute;
    z-index: 5;
    display: grid;
    min-width: 145px;
    gap: 2px;
    padding: 7px 9px;
    border: 1px solid #cbdcf0;
    border-radius: 8px;
    color: #344d6d;
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 8px 22px rgba(36, 55, 84, .16);
    pointer-events: none;
    transform: translate(-50%, -112%);
}
.operator-chart-tooltip span { color: #52708f; font-size: 9px; font-weight: 800; }
.operator-chart-tooltip strong { color: #1f6feb; font-size: 13px; font-variant-numeric: tabular-nums; }
.operator-chart-tooltip small { color: #7d8da1; font-size: 8px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.live-expanded-chart .chart-window-context {
    display: grid;
    flex: 0 1 auto;
    gap: 1px;
    min-width: 150px;
    margin-left: auto;
    padding-left: 8px;
    border-left: 1px solid #e1e8f1;
}
.chart-window-context span { color: #8492a4; font-size: 8px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.chart-window-context strong { color: #344d6d; font-size: 9px; }
.chart-window-context small { color: #8190a4; font-size: 8px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.live-expanded-overview .current-shift-state-pane { grid-template-rows: auto minmax(0, 1fr) auto; }
.live-expanded-overview .current-shift-state-pane .expanded-pie { align-self: center; }

@media (max-width: 1250px) {
    .live-expanded-chart .operator-series-toolbar { display: block; }
    .live-expanded-chart .operator-series-toolbar-heading { margin-bottom: 5px; }
    .live-expanded-chart .chart-window-context {
        margin: 3px 0 0;
        padding: 5px 0 0;
        border-top: 1px solid #e1e8f1;
        border-left: 0;
    }
}

/* -------------------------------------------------------------------------
   Dashboard theme system. The default is dark. Light mode remains available
   as an explicit local preference and as an administrator-selected default.
   Keep this block last so it wins over the legacy light presentation pass.
   ------------------------------------------------------------------------- */
html[data-theme="dark"] {
    color-scheme: dark;
    --theme-page: #0b1118;
    --theme-surface: #121c27;
    --theme-surface-raised: #172534;
    --theme-surface-soft: #0f1923;
    --theme-border: #2a4053;
    --theme-border-soft: #213546;
    --theme-text: #e7eef6;
    --theme-heading: #f3f7fb;
    --theme-muted: #91a6ba;
    --theme-link: #78bfff;
    --theme-blue-soft: #17324a;
    --theme-green-soft: #12382c;
    --theme-amber-soft: #3d2d17;
    --camera-surface: #101b28;
    --camera-text: #dbe9f8;
    --camera-slot: #8ea9c5;
    --camera-action-text: #b9d8fc;
    --camera-action-surface: #1a3047;
    --camera-focus: #68afff;
    --camera-picture-surface: #070c12;
    --camera-no-signal-glow: radial-gradient(circle at 30% 30%, #304b64 0, #182b3c 32%, #071019 76%);
    --camera-no-signal-text: #d4e4f3;
    --camera-no-signal-overlay: rgba(4, 10, 16, .42);
    --camera-unconfigured-surface: #0d1823;
    --camera-no-signal-muted: #93abc0;
    --camera-footer-text: #94aec8;
}

html[data-theme="light"] {
    color-scheme: light;
    --camera-surface: #ffffff;
    --camera-text: #304461;
    --camera-slot: #6f8298;
    --camera-action-text: #2f5f8c;
    --camera-action-surface: #edf4ff;
    --camera-focus: #1f6feb;
    --camera-picture-surface: #e8eef5;
    --camera-no-signal-glow: radial-gradient(circle at 30% 30%, #d9e8f4 0, #c9dbe9 32%, #b8c9d8 76%);
    --camera-no-signal-text: #304461;
    --camera-no-signal-overlay: rgba(244, 247, 251, .72);
    --camera-unconfigured-surface: #f8fbff;
    --camera-no-signal-muted: #7b899e;
    --camera-footer-text: #6f8298;
}

html[data-theme="dark"] body,
html[data-theme="dark"] #app,
html[data-theme="dark"] .app-shell,
html[data-theme="dark"] .live-content-shell {
    color: var(--theme-text);
    background: var(--theme-page);
}

html[data-theme="dark"] .topbar,
html[data-theme="dark"] .site-footer {
    background: #101923;
    border-color: var(--theme-border-soft);
}

html[data-theme="dark"] .brand strong,
html[data-theme="dark"] .auth-brand,
html[data-theme="dark"] .auth-brand strong,
html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] .metric-card strong,
html[data-theme="dark"] .auth-card h1 {
    color: var(--theme-heading);
}

html[data-theme="dark"] .brand small,
html[data-theme="dark"] .auth-brand small,
html[data-theme="dark"] .subtitle,
html[data-theme="dark"] .muted,
html[data-theme="dark"] .eyebrow,
html[data-theme="dark"] .site-footer,
html[data-theme="dark"] .last-updated,
html[data-theme="dark"] .form-help,
html[data-theme="dark"] .cell-subtitle,
html[data-theme="dark"] .metric-card span,
html[data-theme="dark"] .metric-card small,
html[data-theme="dark"] .auth-subtitle,
html[data-theme="dark"] .auth-footer,
html[data-theme="dark"] .auth-help,
html[data-theme="dark"] .auth-domain-note {
    color: var(--theme-muted);
}

html[data-theme="dark"] nav a,
html[data-theme="dark"] .text-button {
    color: #a7b9ca;
}

html[data-theme="dark"] nav a.active,
html[data-theme="dark"] nav a:hover,
html[data-theme="dark"] .text-button:hover {
    color: var(--theme-link);
    background: #182c3f;
}

html[data-theme="dark"] .card,
html[data-theme="dark"] .metric-card,
html[data-theme="dark"] .manager-card,
html[data-theme="dark"] .admin-panel,
html[data-theme="dark"] .table-card,
html[data-theme="dark"] .connect-card,
html[data-theme="dark"] .auth-card {
    background: var(--theme-surface);
    border-color: var(--theme-border);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .22);
}

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .secondary-button,
html[data-theme="dark"] .sign-out-button {
    color: var(--theme-text);
    background: #0d1822;
    border-color: #315069;
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
    color: #71879b;
}

html[data-theme="dark"] input:focus,
html[data-theme="dark"] select:focus,
html[data-theme="dark"] textarea:focus {
    border-color: #5da9ec;
    box-shadow: 0 0 0 3px rgba(93, 169, 236, .18);
}

html[data-theme="dark"] .secondary-button:hover,
html[data-theme="dark"] .sign-out-button:hover {
    color: #dff1ff;
    border-color: #5b9ed1;
    background: #17324a;
}

html[data-theme="dark"] .primary-button {
    background: #2c83dc;
    box-shadow: 0 7px 18px rgba(0, 0, 0, .25);
}

html[data-theme="dark"] .primary-button:hover {
    background: #4399eb;
}

html[data-theme="dark"] table th {
    color: #91a9bc;
    background: #172634;
    border-color: var(--theme-border-soft);
}

html[data-theme="dark"] table td {
    color: #b7c8d6;
    border-color: var(--theme-border-soft);
}

html[data-theme="dark"] tbody tr:hover {
    background: #182d40;
}

html[data-theme="dark"] .machine-link,
html[data-theme="dark"] .back-link {
    color: var(--theme-link);
}

html[data-theme="dark"] .source-pill {
    color: #b9dcf5;
    background: #112b3d;
    border-color: #315b75;
}

html[data-theme="dark"] .status-green { color: #5be0a3; background: var(--theme-green-soft); }
html[data-theme="dark"] .status-amber { color: #f3c76d; background: var(--theme-amber-soft); }
html[data-theme="dark"] .status-red { color: #ff8d99; background: #3d1d27; }
html[data-theme="dark"] .status-grey { color: #a8bacb; background: #253544; }
html[data-theme="dark"] .error-card { color: #ff9ca5; background: #301d27; border-color: #6a3442; }
html[data-theme="dark"] .error-card p { color: #d99aa6; }
html[data-theme="dark"] .success-card { color: #77e2ad; background: #12382c; border-color: #2f7056; }
html[data-theme="dark"] .loading-card,
html[data-theme="dark"] .loading-screen,
html[data-theme="dark"] .auth-boot-loading,
html[data-theme="dark"] .auth-redirect { color: var(--theme-muted); background: var(--theme-page); }
html[data-theme="dark"] .loading-progress circle { stroke: #264157; }
html[data-theme="dark"] .loading-progress circle:last-child { stroke: #66b8ff; }
html[data-theme="dark"] .spinner { border-color: #29445c; border-top-color: #66b8ff; }

/* The machine route uses this while its cloud snapshot is loading. Keep the
   first painted state on the selected dark theme instead of falling through
   to the later light presentation rules. */
html[data-theme="dark"] .operator-connect {
    color: var(--theme-text);
    background: radial-gradient(circle, #15212b 0, #070d13 58%);
}
html[data-theme="dark"] .operator-connect h1 { color: var(--theme-heading); }
html[data-theme="dark"] .operator-connect p { color: var(--theme-muted); }
html[data-theme="dark"] .operator-connect input { color: var(--theme-text); border-color: var(--theme-border-soft); background: #0d1822; }
html[data-theme="dark"] .operator-connect button,
html[data-theme="dark"] .operator-connect a { color: #fff; border-color: #287e50; background: #169557; }

html[data-theme="dark"] .live-wall-heading h1,
html[data-theme="dark"] .live-wall-subtitle,
html[data-theme="dark"] .live-toolbar-copy h2,
html[data-theme="dark"] .live-toolbar-copy small,
html[data-theme="dark"] .live-machine-card h2,
html[data-theme="dark"] .live-machine-identity h2 {
    color: var(--theme-heading);
}

html[data-theme="dark"] .live-wall-toolbar,
html[data-theme="dark"] .live-machine-card,
html[data-theme="dark"] .live-minimal-chart,
html[data-theme="dark"] .live-state-panel,
html[data-theme="dark"] .live-values-grid,
html[data-theme="dark"] .live-normal-card .operator-files-card,
html[data-theme="dark"] .live-normal-card .operator-table-scroll,
html[data-theme="dark"] .live-normal-shift-tile {
    color: var(--theme-text);
    background: var(--theme-surface);
    border-color: var(--theme-border);
}

/* Keep the Live Wall canvas and its tile gaps darker than the machine tiles.
   Occupied and empty slots remain on the shared raised tile surface. */
html[data-theme="dark"] .live-wall-page {
    color: var(--theme-text);
    background: var(--theme-page);
}

html[data-theme="dark"] .live-empty-slot {
    background: var(--theme-surface);
    background-image: none;
    border-color: var(--theme-border);
}

html[data-theme="dark"] .live-empty-slot strong,
html[data-theme="dark"] .live-empty-slot p,
html[data-theme="dark"] .live-slot-number,
html[data-theme="dark"] .live-machine-context,
html[data-theme="dark"] .live-weather-inline,
html[data-theme="dark"] .live-normal-card .operator-files-card,
html[data-theme="dark"] .live-normal-card .operator-files-empty,
html[data-theme="dark"] .live-normal-footer,
html[data-theme="dark"] .live-minimal-chart-heading small,
html[data-theme="dark"] .live-minimal-shift-detail {
    color: var(--theme-muted);
}

html[data-theme="dark"] .live-minimal-shift-card,
html[data-theme="dark"] .live-normal-details,
html[data-theme="dark"] .live-values-grid > span,
html[data-theme="dark"] .live-values-grid > .live-metric-hover,
html[data-theme="dark"] .live-normal-card .live-metric-trigger,
html[data-theme="dark"] .live-normal-card .live-metric-trigger:hover,
html[data-theme="dark"] .live-normal-card .live-metric-trigger:focus-visible {
    background: var(--theme-surface-soft);
    border-color: var(--theme-border-soft);
}

html[data-theme="dark"] .live-normal-card .operator-table-scroll th,
html[data-theme="dark"] .live-normal-card .operator-table-scroll td {
    color: #a9bfce;
    border-color: var(--theme-border-soft);
}

html[data-theme="dark"] .live-normal-card .operator-table-scroll th {
    background: #172634;
}

html[data-theme="dark"] .live-normal-card .live-metric-trigger small,
html[data-theme="dark"] .live-values-grid small,
html[data-theme="dark"] .live-state-bars small,
html[data-theme="dark"] .live-state-bars-heading span,
html[data-theme="dark"] .live-state-bars-heading small {
    color: #8ea6b8;
}

html[data-theme="dark"] .live-normal-card .live-metric-trigger strong,
html[data-theme="dark"] .live-values-grid strong,
html[data-theme="dark"] .live-state-bars strong,
html[data-theme="dark"] .live-current-job strong {
    color: #e5f1f9;
}

html[data-theme="dark"] .metric-popover {
    color: var(--theme-text);
    background: #142331;
    border-color: #35556e;
    box-shadow: 0 16px 35px rgba(0, 0, 0, .42);
}

html[data-theme="dark"] .metric-popover-heading,
html[data-theme="dark"] .metric-popover-chart {
    border-color: var(--theme-border-soft);
}

html[data-theme="dark"] .metric-popover-heading strong { color: var(--theme-heading); }
html[data-theme="dark"] .metric-popover-heading small,
html[data-theme="dark"] .metric-popover-eyebrow,
html[data-theme="dark"] .metric-popover-scale,
html[data-theme="dark"] .metric-popover-footer,
html[data-theme="dark"] .metric-popover-message,
html[data-theme="dark"] .metric-popover-loading { color: var(--theme-muted); }
html[data-theme="dark"] .metric-popover-chart { background: #0d1822; }
html[data-theme="dark"] .metric-chart-grid-line { stroke: #294254; }

/* Keep the expanded machine canvas and the spacing between its panels on the
   same dark surface as the Live Wall. Inner cards remain raised for legibility. */
html[data-theme="dark"] .live-expanded-page,
html[data-theme="dark"] .live-expanded-overview,
html[data-theme="dark"] .live-expanded-chart {
    color: var(--theme-text);
    background: var(--theme-page);
    border-color: var(--theme-border-soft);
}

html[data-theme="dark"] .live-expanded-page .expanded-header,
html[data-theme="dark"] .live-expanded-overview > section,
html[data-theme="dark"] .live-expanded-overview > .operator-files-card,
html[data-theme="dark"] .live-expanded-chart .expanded-chart-controls,
html[data-theme="dark"] .live-expanded-chart .expanded-plot,
html[data-theme="dark"] .live-expanded-chart .expanded-events-card,
html[data-theme="dark"] .expanded-shift-summary,
html[data-theme="dark"] .expanded-shift-summary.current {
    color: var(--theme-text);
    background: var(--theme-surface);
    border-color: var(--theme-border);
}

html[data-theme="dark"] .live-expanded-chart .expanded-view-tabs {
    border-color: var(--theme-border-soft);
}

html[data-theme="dark"] .live-expanded-chart .expanded-view-tabs button {
    color: var(--theme-muted);
}

html[data-theme="dark"] .live-expanded-chart .expanded-view-tabs button:hover {
    color: #8acbff;
    background: #102337;
}

html[data-theme="dark"] .live-expanded-chart .expanded-view-tabs button.active {
    color: var(--theme-heading);
    border-color: var(--theme-border);
    border-bottom-color: var(--theme-surface);
    background: var(--theme-surface);
}

/* Remove the extra nested dividers from the expanded parameter and shift
   summaries. The main machine and comparison boundaries remain visible. */
html[data-theme="dark"] .live-expanded-overview .expanded-values-pane .operator-values {
    border-top: 0;
    border-bottom: 0;
}

html[data-theme="dark"] .live-expanded-overview .expanded-values-pane .operator-starts {
    border-top: 0;
}

html[data-theme="dark"] .expanded-shift-summary,
html[data-theme="dark"] .expanded-shift-summary.current {
    border: 0;
}

html[data-theme="dark"] .live-expanded-page .expanded-header > strong,
html[data-theme="dark"] .expanded-tab-heading h3,
html[data-theme="dark"] .expanded-shift-summary .expanded-panel-heading h3,
html[data-theme="dark"] .live-expanded-chart .expanded-events-card h4 {
    color: var(--theme-heading);
}

html[data-theme="dark"] .expanded-close,
html[data-theme="dark"] .live-expanded-chart .expanded-chart-controls select,
html[data-theme="dark"] .live-expanded-chart .expanded-chart-controls button,
html[data-theme="dark"] .live-expanded-chart .operator-date-input,
html[data-theme="dark"] .expanded-tab-status {
    color: #b6d9f3;
    background: #102337;
    border-color: #31516a;
}

html[data-theme="dark"] .live-expanded-overview .operator-values > div,
html[data-theme="dark"] .live-expanded-overview .php-counter-block,
html[data-theme="dark"] .expanded-chart-controls,
html[data-theme="dark"] .expanded-events-card .operator-table-scroll,
html[data-theme="dark"] .operator-table-scroll {
    background: #0d1822;
    border-color: var(--theme-border-soft);
}

html[data-theme="dark"] .live-expanded-overview .operator-values dt,
html[data-theme="dark"] .expanded-pane-heading,
html[data-theme="dark"] .expanded-panel-heading small,
html[data-theme="dark"] .expanded-tab-heading p,
html[data-theme="dark"] .expanded-tab-eyebrow,
html[data-theme="dark"] .expanded-chart-controls,
html[data-theme="dark"] .chart-threshold,
html[data-theme="dark"] .chart-window-context small,
html[data-theme="dark"] .expanded-events-card > p,
html[data-theme="dark"] .expanded-events-card footer {
    color: var(--theme-muted);
}

html[data-theme="dark"] .live-expanded-overview .operator-values dd,
html[data-theme="dark"] .expanded-shift-comparison-heading h3,
html[data-theme="dark"] .expanded-shift-summary .expanded-panel-heading h3,
html[data-theme="dark"] .expanded-shift-summary .expanded-panel-heading small {
    color: #c2d4e2;
}

html[data-theme="dark"] .operator-series-legend,
html[data-theme="dark"] .operator-series-toggle,
html[data-theme="dark"] .operator-series-toolbar-heading span,
html[data-theme="dark"] .operator-series-toolbar-heading small {
    color: #b8ccdc;
}

html[data-theme="dark"] .live-expanded-chart .operator-series-toolbar {
    border-color: var(--theme-border-soft);
    background: #0f1923;
}

html[data-theme="dark"] .live-expanded-chart .operator-series-toggle {
    color: #c1d4e2;
    border-color: #31516a;
    background: #152638;
}

html[data-theme="dark"] .live-expanded-chart .operator-series-toggle:hover,
html[data-theme="dark"] .live-expanded-chart .operator-series-toggle:focus-visible {
    color: #eaf6ff;
    border-color: #66b8ff;
    background: #1b3b58;
}

html[data-theme="dark"] .live-expanded-chart .operator-series-toggle.is-hidden {
    background: #0c141d;
}

html[data-theme="dark"] .operator-chart-tooltip {
    color: #dbeaf5;
    border-color: #35556e;
    background: rgba(15, 27, 38, .98);
    box-shadow: 0 12px 28px rgba(0, 0, 0, .42);
}

html[data-theme="dark"] .operator-chart-tooltip span,
html[data-theme="dark"] .operator-chart-tooltip small,
html[data-theme="dark"] .chart-window-context span,
html[data-theme="dark"] .chart-window-context small {
    color: var(--theme-muted);
}

html[data-theme="dark"] .operator-chart-tooltip strong,
html[data-theme="dark"] .chart-window-context strong {
    color: #8acbff;
}

html[data-theme="dark"] .live-expanded-chart .chart-window-context {
    border-left-color: var(--theme-border-soft);
}

html[data-theme="dark"] .live-expanded-chart .operator-grid-line { stroke: #2b4558; }
html[data-theme="dark"] .live-expanded-chart .operator-grid-line.horizontal { stroke: #1f3545; }
html[data-theme="dark"] .live-expanded-chart .operator-axis-label { fill: #a7bdce; }
html[data-theme="dark"] .live-expanded-chart .operator-axis-line { stroke: #527087; }

html[data-theme="dark"] .auth-shell {
    background: var(--theme-page);
}

html[data-theme="dark"] .google-login-panel {
    background: #0f1b26;
    border-color: var(--theme-border);
}

html[data-theme="dark"] .google-button-host {
    padding: 2px;
    border-radius: 8px;
    background: #0b1118;
}

html[data-theme="dark"] .auth-brand,
html[data-theme="dark"] .auth-card h1,
html[data-theme="dark"] .auth-card .eyebrow {
    color: var(--theme-heading);
}

html[data-theme="dark"] .auth-subtitle,
html[data-theme="dark"] .auth-help,
html[data-theme="dark"] .auth-domain-note,
html[data-theme="dark"] .tv-pair-entry p,
html[data-theme="dark"] .tv-pair-label,
html[data-theme="dark"] .tv-pair-expiry,
html[data-theme="dark"] .tv-pair-waiting,
html[data-theme="dark"] .tv-pair-code-entry label {
    color: var(--theme-muted);
}

html[data-theme="dark"] .tv-pair-entry {
    border-top-color: var(--theme-border-soft);
}

html[data-theme="dark"] .tv-pair-tv-panel {
    background: var(--theme-surface-soft);
}

html[data-theme="dark"] .tv-pair-code {
    color: var(--theme-link);
}

html[data-theme="dark"] .tv-pair-instructions {
    color: var(--theme-muted);
    background: var(--theme-surface-raised);
}

html[data-theme="dark"] .tv-pair-instructions b {
    color: var(--theme-link);
}

html[data-theme="dark"] .tv-pair-qr-frame {
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .28);
}

html[data-theme="dark"] .tv-pair-qr-caption {
    color: var(--theme-muted);
}

html[data-theme="dark"] .tv-pair-confirmed {
    color: #7ee6b8;
    background: #12382c;
}

html[data-theme="dark"] .tv-pair-confirmed span {
    color: #9acdb5;
}

html[data-theme="dark"] .theme-toggle-button {
    color: #d7e8f5;
    background: #172b3d;
    border-color: #35556d;
}

html[data-theme="light"] .theme-toggle-button {
    color: #4e6580;
    background: #f5f9ff;
    border-color: #d5e1ef;
}

.theme-toggle-button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 30px;
    padding: 4px 9px 4px 5px;
    border: 1px solid #d5e1ef;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .02em;
    white-space: nowrap;
    transition: border-color .16s ease, background .16s ease, color .16s ease;
}

.theme-toggle-button:hover,
.theme-toggle-button:focus-visible {
    border-color: #78aee0;
}

.theme-toggle-track {
    position: relative;
    display: inline-block;
    width: 31px;
    height: 18px;
    flex: 0 0 31px;
    border-radius: 999px;
    background: #b9c9d8;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .13);
}

.theme-toggle-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, .25);
    transition: transform .18s ease, background .18s ease;
}

.theme-toggle-button.is-dark .theme-toggle-track {
    background: #286da4;
}

.theme-toggle-button.is-dark .theme-toggle-thumb {
    transform: translateX(13px);
    background: #d9f0ff;
}

.theme-toggle-button.is-light .theme-toggle-track {
    background: #d1dce7;
}

.theme-default-panel { grid-column: 1 / -1; }
.theme-default-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 12px 0 14px; }
.theme-choice { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 12px; border: 1px solid #e1e8f1; border-radius: 11px; background: #fafcff; cursor: pointer; }
.theme-choice input { width: auto; margin: 0; accent-color: #1f6feb; }
.theme-choice > span:last-child { display: grid; gap: 3px; min-width: 0; }
.theme-choice strong { color: #304461; font-size: 12px; }
.theme-choice small { color: #7b899e; font-size: 10px; }
.theme-choice.selected { border-color: #8bbaf2; background: #f1f7ff; box-shadow: 0 0 0 2px rgba(31,111,235,.08); }
.theme-choice-swatch { width: 35px; height: 23px; flex: 0 0 35px; border-radius: 7px; border: 1px solid #d5deea; }
.theme-choice-swatch-dark { background: linear-gradient(135deg, #0b1118 0 50%, #2c83dc 50% 100%); border-color: #34536c; }
.theme-choice-swatch-light { background: linear-gradient(135deg, #f4f7fb 0 50%, #1f6feb 50% 100%); }

html[data-theme="dark"] .theme-choice { background: #0f1b26; border-color: var(--theme-border); }
html[data-theme="dark"] .theme-choice strong { color: var(--theme-heading); }
html[data-theme="dark"] .theme-choice small { color: var(--theme-muted); }
html[data-theme="dark"] .theme-choice.selected { background: #163149; border-color: #4d92c8; box-shadow: 0 0 0 2px rgba(102,184,255,.12); }

@media (max-width: 760px) {
    .theme-default-picker { grid-template-columns: 1fr; }
    .theme-toggle-label { display: none; }
    .theme-toggle-button { padding-right: 5px; }
}

/* Final dark overrides for the Live Wall controls and the vertically stacked
   Normal-view shift comparison tiles. These selectors appear after the legacy
   responsive layout rules so the dark palette wins at every desktop width. */
html[data-theme="dark"] .live-mode-picker {
    border-color: var(--theme-border);
    background: #0f1923;
}

html[data-theme="dark"] .live-mode-button {
    color: #abc0d1;
}

html[data-theme="dark"] .live-mode-button:hover {
    color: #8acbff;
    background: #183249;
}

html[data-theme="dark"] .live-mode-button.is-active {
    color: #f5fbff;
    background: #287ed0;
}

html[data-theme="dark"] .live-normal-details > .live-state-panel .live-normal-shift-tile {
    color: var(--theme-text);
    border-color: var(--theme-border-soft);
    background: #0f1923;
}

html[data-theme="dark"] .live-normal-details > .live-state-panel .live-state-bars-heading {
    border-bottom-color: var(--theme-border-soft);
}

html[data-theme="dark"] .live-normal-details > .live-state-panel .live-state-bars-heading span,
html[data-theme="dark"] .live-normal-details > .live-state-panel .live-state-bars-heading small,
html[data-theme="dark"] .live-normal-details > .live-state-panel .live-state-bars-heading em,
html[data-theme="dark"] .live-normal-details > .live-state-panel .live-state-bars small {
    color: #91aabd;
}

html[data-theme="dark"] .live-normal-details > .live-state-panel .live-state-bars strong {
    color: #d3e4ef;
}

html[data-theme="dark"] .live-normal-details > .live-state-panel .live-state-bars i {
    background: #263b4d;
}

/* Minimal and Normal use the same cloud-derived shift comparison. Minimal keeps the
   two complete shift tiles side by side inside each compact machine card. */
.live-minimal-shift-comparison {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.live-minimal-shift-card {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    align-content: stretch;
    gap: 4px;
}
.live-minimal-shift-card .live-minimal-chart-heading small {
    max-width: 55%;
}
.live-minimal-shift-card .live-minimal-shift-detail {
    min-width: 0;
    overflow: hidden;
    color: #718198;
    font-size: 6px;
    font-variant-numeric: tabular-nums;
    line-height: 1.05;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.live-minimal-shift-card .live-minimal-state-content {
    grid-template-columns: 39px minmax(0, 1fr);
    align-items: center;
    gap: 5px;
}
.live-minimal-shift-card .live-minimal-current-pie {
    width: 36px;
}
.live-minimal-shift-card .live-minimal-bars {
    gap: 3px;
}
.live-minimal-shift-card .live-minimal-bars > span {
    grid-template-columns: 38px minmax(14px, 1fr) 38px;
    gap: 3px;
}
.live-minimal-shift-card .live-minimal-bars small,
.live-minimal-shift-card .live-minimal-bars strong {
    font-size: 6px;
}

@media (min-width: 761px) and (max-width: 900px) {
    .live-normal-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: repeat(3, minmax(0, 1fr));
    }
    .live-normal-details {
        grid-template-columns: 1fr;
        grid-template-rows: 52px 96px minmax(0, 1fr);
        height: 208px;
        flex: 0 0 208px;
    }
    .live-normal-details > .live-state-panel {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: 1fr;
    }
}

/* Expanded shift comparison and chart readability pass, 2026-08-16. */
.live-expanded-overview {
    grid-template-columns: minmax(245px, .82fr) minmax(490px, 1.48fr) minmax(300px, 1fr);
}
.expanded-shift-comparison {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    overflow: hidden;
}
.expanded-shift-comparison-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
}
.expanded-shift-comparison-heading > div { min-width: 0; }
.expanded-shift-comparison-heading h3 { margin: 0; color: #304461; font-size: 10px; font-weight: 850; text-transform: uppercase; }
.expanded-shift-comparison-heading small { display: block; margin-top: 2px; color: #8997a9; font-size: 8px; line-height: 1.25; }
.expanded-shift-comparison-heading > span { flex: 0 0 auto; padding: 3px 6px; border: 1px solid #ccebdc; border-radius: 999px; color: #18885a; background: #eaf8f1; font-size: 7px; font-weight: 800; white-space: nowrap; }
.expanded-shift-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; min-width: 0; min-height: 0; flex: 1; }
.expanded-shift-summary { display: flex; flex-direction: column; gap: 6px; min-width: 0; min-height: 0; padding: 8px; border: 1px solid #e7edf4; border-radius: 8px; background: #fbfcfe; }
.expanded-shift-summary.current { background: #f7fbff; }
.expanded-shift-summary .expanded-panel-heading { display: grid; gap: 2px; min-width: 0; }
.expanded-shift-summary .expanded-panel-heading h3 { overflow: hidden; color: #526b88; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.expanded-shift-summary .expanded-panel-heading small { overflow: hidden; color: #8997a9; font-size: 8px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; text-transform: none; }
.expanded-shift-summary-body { display: grid; grid-template-columns: 76px minmax(0, 1fr); align-items: center; gap: 9px; min-width: 0; min-height: 0; flex: 1; }
.expanded-shift-summary .expanded-pie { width: 70px; margin: 0 auto; }
.expanded-state-bars { display: grid; gap: 7px; min-width: 0; }
.expanded-state-bars > div { display: grid; grid-template-columns: 48px minmax(0, 1fr) 58px; align-items: center; gap: 6px; min-width: 0; }
.expanded-state-bars span { color: #74849a; font-size: 8px; font-weight: 850; }
.expanded-state-bars i { height: 8px; overflow: hidden; border-radius: 999px; background: #e8eef5; }
.expanded-state-bars b { display: block; height: 100%; min-width: 2px; border-radius: inherit; }
.expanded-state-bars b.active { background: #2bb478; }
.expanded-state-bars b.idle { background: #d94c5b; }
.expanded-state-bars b.no-net { background: #8f9bab; }
.expanded-state-bars strong { color: #4d6480; font-size: 9px; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.live-expanded-overview .operator-bars i.idle { background: #d94c5b; }
.chart-live-button.is-live { color: #fff !important; border-color: #18885a !important; background: #18885a !important; box-shadow: 0 2px 6px rgba(24,136,90,.2); }
.live-expanded-chart .operator-axis-label { fill: #4f6380; font-size: 15px; font-weight: 700; }
.live-expanded-chart .operator-axis-line { stroke: #b8c8da; stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.live-expanded-chart .operator-weather-axis-line { stroke: #aac9d2; stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.live-expanded-chart .operator-weather-axis-label { fill: #1b788a; font-size: 13px; font-weight: 750; }
.live-expanded-chart .operator-weather-axis-title { fill: #1b788a; font-size: 11px; font-weight: 850; letter-spacing: .05em; }
.live-expanded-chart .operator-weather-reference { stroke: #2b9caf; stroke-width: 2; stroke-dasharray: 8 5; opacity: .78; vector-effect: non-scaling-stroke; }
.live-expanded-chart .operator-weather-reference-label { fill: #1b788a; font-size: 11px; font-weight: 800; }
.live-expanded-chart .operator-weather-series-line { stroke-width: 2.5; stroke-dasharray: 3 6; stroke-linecap: round; opacity: .9; }
.live-expanded-chart .operator-weather-temperature-axis-label { fill: #8a4fa6; font-size: 13px; font-weight: 800; }
.live-expanded-chart .operator-weather-humidity-axis-label { fill: #1b788a; font-size: 13px; font-weight: 800; }
.live-expanded-chart .operator-weather-pressure-axis-label { fill: #b45309; font-size: 13px; font-weight: 800; }
.live-expanded-chart .operator-grid-line { stroke: #cbd8e6; stroke-width: 1; vector-effect: non-scaling-stroke; }
.live-expanded-chart .operator-grid-line.horizontal { stroke: #dce6f0; stroke-width: 1; }
.live-expanded-chart .operator-state-text { font-size: 12px; font-weight: 850; }
.live-expanded-chart .operator-event-label { font-size: 10px; font-weight: 750; }
.live-expanded-chart .expanded-chart-controls > label { font-size: 10px; }
.live-expanded-chart .chart-window-context { min-width: 185px; }
.live-expanded-chart .operator-chart-canvas { min-height: 270px; }

@media (max-width: 1250px) {
    .live-expanded-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .expanded-shift-columns { gap: 6px; }
    .expanded-shift-summary-body { grid-template-columns: 62px minmax(0, 1fr); gap: 6px; }
    .expanded-shift-summary .expanded-pie { width: 56px; }
}

@media (max-width: 760px) {
    .live-expanded-overview { grid-template-columns: 1fr; height: auto; min-height: 0; overflow: visible; }
    .expanded-shift-columns { grid-template-columns: 1fr; }
}

/* Live Wall state-display and shift-context pass. Keep the approved Pie + bars
   presentation fixed while preserving the compact nine-card layout. */
.live-machine-identity .live-machine-context {
    display: inline-flex !important;
    align-items: baseline;
    gap: 4px;
    max-width: 100%;
    margin-top: 2px !important;
    color: #8795a9;
    font-size: 9px;
    line-height: 1.1;
    white-space: nowrap;
}
.live-machine-identity .live-machine-context > span {
    display: inline;
    min-width: 0;
    margin: 0 !important;
    overflow: hidden;
    color: inherit;
    font-size: inherit;
    line-height: inherit;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.live-machine-identity .live-machine-context > span:first-child {
    max-width: 48%;
}
.live-machine-identity .live-machine-context > i {
    flex: 0 0 auto;
    color: #b4c0cf;
    font-size: 9px;
    font-style: normal;
}
.live-machine-identity .live-machine-context .live-shift-inline {
    max-width: 52%;
    color: #1f6feb;
    font-weight: 750;
}
.live-minimal-current-state {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    align-content: stretch;
    gap: 4px;
}
.live-minimal-chart-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 5px;
    min-width: 0;
}
.live-minimal-chart-heading span {
    overflow: hidden;
    color: #8795a8;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .07em;
    line-height: 1.05;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}
.live-minimal-chart-heading small {
    overflow: hidden;
    color: #1f6feb;
    font-size: 7px;
    font-weight: 750;
    line-height: 1.05;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.live-minimal-state-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
    min-width: 0;
    min-height: 0;
}
.live-minimal-current-state.with-pie .live-minimal-state-content {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 5px;
}
.live-minimal-current-pie {
    width: 32px;
    justify-self: center;
}
.live-minimal-current-state .live-minimal-bars {
    min-width: 0;
}
.live-minimal-current-state.with-pie .live-minimal-bars > span {
    grid-template-columns: 34px minmax(18px, 1fr) 35px;
    gap: 3px;
}
.live-minimal-current-state.with-pie .live-minimal-bars small,
.live-minimal-current-state.with-pie .live-minimal-bars strong {
    font-size: 6px;
}

@media (min-width: 901px) and (max-width: 1250px) {
    .live-machine-identity .live-machine-context { font-size: 8px; }
    .live-minimal-current-state.with-pie .live-minimal-state-content {
        grid-template-columns: 29px minmax(0, 1fr);
        gap: 4px;
    }
    .live-minimal-current-pie { width: 28px; }
    .live-minimal-current-state.with-pie .live-minimal-bars > span {
        grid-template-columns: 30px minmax(14px, 1fr) 31px;
        gap: 2px;
    }
}

/* Canonical operating-state palette. These selectors intentionally sit at the end so
   legacy light and dark dashboard passes cannot make pie, bar, split-bar, and timeline
   representations disagree. Machine connectivity/status dots keep their own semantics. */
.operator-legend i.active,
.operator-bars i.active,
.live-state-bars b.active,
.expanded-state-bars b.active,
.state-split .active,
.state-active,
.live-expanded-overview .operator-legend .active,
.live-expanded-overview .operator-bars i.active { background: var(--state-active-color); }
.operator-legend i.idle,
.operator-bars i.idle,
.live-state-bars b.idle,
.expanded-state-bars b.idle,
.state-split .idle,
.state-idle,
.live-expanded-overview .operator-legend .idle,
.live-expanded-overview .operator-bars i.idle { background: var(--state-idle-color); }
.operator-legend i.no-net,
.operator-bars i.no-net,
.live-state-bars b.no-net,
.expanded-state-bars b.no-net,
.state-split .no-net,
.state-nonet,
.live-expanded-overview .operator-legend .no-net,
.live-expanded-overview .operator-bars i.no-net { background: var(--state-no-net-color); }
.operator-state-band.active { fill: var(--state-active-band); }
.operator-state-band.idle { fill: var(--state-idle-band); }
.operator-state-band.no-net { fill: var(--state-no-net-band); }

/* Live Wall shift context. Keep the cloud shift type, local date and schedule visible
   without expanding the nine-card layout into a second page. */
.live-shift-summary-copy {
    min-width: 0;
    line-height: 1.05;
}
.live-shift-summary-copy span,
.live-shift-summary-copy strong,
.live-shift-summary-copy small,
.live-shift-summary-copy em {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.live-shift-summary-copy span {
    color: #8795a8;
    font-size: 7px;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
}
.live-shift-summary-copy strong {
    color: #365272;
    font-size: 8px;
    font-variant-numeric: tabular-nums;
}
.live-shift-summary-copy small {
    color: #718198;
    font-size: 7px;
    font-variant-numeric: tabular-nums;
}
.live-shift-summary-copy em {
    color: #8593a5;
    font-size: 7px;
    font-style: normal;
    font-variant-numeric: tabular-nums;
}
.live-minimal-current-state {
    grid-template-rows: auto auto minmax(0, 1fr);
}
.live-minimal-shift-detail {
    min-width: 0;
    overflow: hidden;
    color: #718198;
    font-size: 7px;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.live-state-bars-heading em {
    display: block;
    min-width: 0;
    overflow: hidden;
    color: #7c8ba0;
    font-size: 7px;
    font-style: normal;
    font-variant-numeric: tabular-nums;
    line-height: 1.05;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.live-normal-card .live-pie-wrap .live-shift-summary-copy {
    width: 100%;
    text-align: left;
}
.live-normal-card .live-state-panel {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
}
.live-normal-card .live-pie-wrap {
    grid-template-columns: 50px minmax(0, 1fr);
    align-items: center;
    justify-items: stretch;
    gap: 6px;
    text-align: left;
}
.live-normal-card .live-pie-wrap > .live-pie {
    justify-self: center;
}
.live-normal-card .live-pie-wrap .live-shift-summary-copy strong {
    font-size: 8px;
}
.live-normal-card .live-pie-wrap .live-shift-summary-copy small,
.live-normal-card .live-pie-wrap .live-shift-summary-copy em {
    font-size: 7px;
}

@media (min-width: 901px) and (max-width: 1250px) {
    .live-shift-summary-copy span { font-size: 6px; }
    .live-shift-summary-copy strong { font-size: 7px; }
    .live-shift-summary-copy small,
    .live-shift-summary-copy em,
    .live-minimal-shift-detail,
    .live-state-bars-heading em { font-size: 6px; }
}

/* Normal live wall layout. Six cards form a two-row, three-column wall. Within each
   card the machine parameters, shift comparison and printed files stack vertically. */
@media (min-width: 901px) {
    .live-normal-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        grid-template-rows: repeat(2, minmax(0, 1fr));
    }
    .live-normal-details {
        grid-template-columns: 1fr;
        grid-template-rows: 52px 96px minmax(0, 1fr);
        height: 208px;
        flex: 0 0 208px;
        gap: 6px;
    }
    .live-normal-details > .live-values-panel,
    .live-normal-details > .live-state-panel,
    .live-normal-details > .operator-files-card {
        min-width: 0;
        min-height: 0;
        height: auto;
        align-self: stretch;
    }
    .live-normal-details > .live-values-panel {
        display: block;
        height: 52px;
    }
    .live-normal-details > .live-values-panel .live-values-grid {
        height: 100%;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        grid-auto-rows: 1fr;
    }
    .live-normal-details > .live-state-panel {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: 1fr;
        gap: 7px;
        padding: 5px 6px;
    }
    .live-normal-details > .live-state-panel .live-normal-shift-tile {
        min-width: 0;
        min-height: 0;
        display: grid;
        grid-template-rows: auto minmax(0, 1fr);
        gap: 4px;
        padding: 4px 6px;
        border: 1px solid #e6ecf3;
        border-radius: 7px;
        background: #fff;
    }
    .live-normal-details > .live-state-panel .live-normal-shift-body {
        display: grid;
        grid-template-columns: 43px minmax(0, 1fr);
        align-items: center;
        gap: 6px;
        min-width: 0;
        min-height: 0;
    }
    .live-normal-details > .live-state-panel .live-normal-shift-body > .live-pie {
        width: 40px;
        justify-self: center;
    }
    .live-normal-details > .live-state-panel .live-normal-shift-body .live-state-bars {
        gap: 4px;
    }
    .live-normal-details > .live-state-panel .live-normal-shift-body .live-state-bars > span {
        grid-template-columns: 52px minmax(18px, 1fr) 42px;
        gap: 3px;
    }
    .live-normal-details > .live-state-panel .live-normal-shift-body .live-state-bars small,
    .live-normal-details > .live-state-panel .live-normal-shift-body .live-state-bars strong {
        font-size: 6px;
    }
    .live-normal-details > .live-state-panel .live-state-bars-heading {
        padding-bottom: 2px;
    }
    .live-normal-details > .live-state-panel .live-state-bars-heading span,
    .live-normal-details > .live-state-panel .live-state-bars-heading small,
    .live-normal-details > .live-state-panel .live-state-bars-heading em {
        font-size: 6px;
    }
    .live-normal-details > .operator-files-card {
        flex: none;
        padding-top: 1px;
    }
    .live-normal-details > .operator-files-card .operator-table-scroll {
        min-height: 0;
    }
}

@media (max-width: 760px) {
    .live-normal-grid {
        grid-template-columns: 1fr;
        grid-template-rows: none;
    }
    .live-normal-details {
        grid-template-columns: 1fr;
        height: auto;
        flex: 0 0 auto;
    }
    .live-normal-details > .live-values-panel,
    .live-normal-details > .live-state-panel,
    .live-normal-details > .operator-files-card {
        height: auto;
        min-height: 92px;
    }
}

/* Use a solid pie for the Live Wall shift summaries. The Expanded view already uses
   a solid conic chart. Removing the inset ring and center cutout keeps Minimal and
   Normal visually consistent with that chart in both themes. */
.live-pie {
    box-shadow: none;
}
.live-pie::after {
    display: none;
    content: none;
}

/* Hikvision HTTPS MJPEG relay. Keep the camera surface readable in both
   themes without exposing the upstream camera page or credentials. */
.expanded-camera-frame.is-live {
    position: relative;
    overflow: hidden;
    padding: 0;
    border-style: solid;
    border-color: #2c536b;
    background: #05090d;
}
.expanded-camera-stream {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 280px;
    object-fit: contain;
    background: #05090d;
}
.expanded-camera-overlay {
    position: absolute;
    top: 10px;
    left: 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    border: 1px solid rgba(132, 190, 220, .35);
    border-radius: 999px;
    color: #d7f4ff;
    background: rgba(5, 15, 22, .78);
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .08em;
}
.expanded-camera-heading-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}
.expanded-camera-live-button {
    display: inline-flex;
    min-height: 28px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 6px 11px;
    border: 1px solid #16865b;
    border-radius: 999px;
    color: #ffffff;
    background: #16865b;
    box-shadow: 0 3px 8px rgba(22, 134, 91, .2);
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .07em;
    cursor: pointer;
}
.expanded-camera-live-button:hover:not(:disabled) {
    border-color: #0e6d49;
    background: #0e6d49;
}
.expanded-camera-live-button:focus-visible {
    outline: 2px solid #69bcf2;
    outline-offset: 2px;
}
.expanded-camera-live-button:disabled {
    cursor: wait;
    opacity: .72;
}
.expanded-camera-live-button .expanded-camera-live-dot {
    width: 6px;
    height: 6px;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, .16);
}
.expanded-camera-player-error {
    position: absolute;
    right: 12px;
    bottom: 12px;
    left: 12px;
    padding: 8px 10px;
    border: 1px solid rgba(255, 126, 126, .42);
    border-radius: 7px;
    color: #ffe1e1;
    background: rgba(82, 20, 24, .86);
    font-size: 10px;
    font-weight: 700;
    text-align: center;
}
.expanded-camera-live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #43dfa0;
    box-shadow: 0 0 0 3px rgba(67, 223, 160, .16);
}
.expanded-camera-retry {
    padding: 7px 10px;
    border: 1px solid #bfd3e8;
    border-radius: 7px;
    color: #2167b5;
    background: #f7fbff;
    font-size: 9px;
    font-weight: 800;
    cursor: pointer;
}
.expanded-camera-retry:hover {
    border-color: #6fa8dc;
    background: #edf6ff;
}
html[data-theme="dark"] .expanded-tab-heading h3 {
    color: var(--theme-heading);
}
html[data-theme="dark"] .expanded-tab-heading p,
html[data-theme="dark"] .expanded-tab-eyebrow,
html[data-theme="dark"] .expanded-camera-frame span {
    color: var(--theme-muted);
}
html[data-theme="dark"] .expanded-tab-status {
    color: #b9d4e7;
    border-color: var(--theme-border-soft);
    background: #162737;
}
html[data-theme="dark"] .expanded-camera-frame:not(.is-live) {
    border-color: #31536a;
    background: repeating-linear-gradient(135deg, #101b25, #101b25 14px, #132331 14px, #132331 28px);
}
html[data-theme="dark"] .expanded-camera-frame strong {
    color: #c7dbe9;
}
html[data-theme="dark"] .expanded-camera-mark {
    border-color: #5b829e;
    color: #9dc3dc;
}
html[data-theme="dark"] .expanded-camera-retry {
    color: #c7e5fb;
    border-color: #416783;
    background: #152a3b;
}
html[data-theme="dark"] .expanded-camera-retry:hover {
    border-color: #6fa8dc;
    background: #1c3b55;
}
html[data-theme="dark"] .expanded-camera-live-button {
    border-color: #259c6b;
    background: #166b4d;
    box-shadow: 0 3px 9px rgba(0, 0, 0, .25);
}
html[data-theme="dark"] .expanded-camera-live-button:hover:not(:disabled) {
    border-color: #4fce90;
    background: #1b805a;
}

/* Live wall surface cleanup, 2026-08-16. Keep the outer machine tile as the
   structural frame. Inner panels use spacing, labels, and status color instead
   of nested borders. Focus outlines remain available for keyboard users. */
.live-minimal-card .live-minimal-shift-comparison > .live-minimal-shift-card,
.live-normal-card .live-normal-details > .live-values-panel .live-values-grid,
.live-normal-card .live-normal-details > .live-state-panel,
.live-normal-card .live-normal-details > .live-state-panel .live-normal-shift-tile,
.live-normal-card .operator-table-scroll {
    border: 0;
    border-radius: 0;
}

.live-minimal-card .live-minimal-shift-comparison > .live-minimal-shift-card,
.live-normal-card .live-normal-details > .live-values-panel .live-values-grid,
.live-normal-card .live-normal-details > .live-state-panel .live-normal-shift-tile,
.live-normal-card .operator-table-scroll {
    background: transparent;
}

.live-normal-card .live-values-grid > span,
.live-normal-card .live-values-grid > .live-metric-hover,
.live-normal-card .live-values-grid > :nth-child(3n),
.live-normal-card .live-values-grid > :nth-child(4n),
.live-normal-card .live-values-grid > :nth-last-child(-n + 3),
.live-normal-card .live-values-grid > :nth-last-child(-n + 4),
.live-normal-card .live-state-bars-heading,
.live-normal-card .operator-table-scroll th,
.live-normal-card .operator-table-scroll td,
.live-normal-card .live-shift-counters > span,
.live-minimal-card .live-minimal-shifts > span {
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
}

.live-normal-card .live-state-bars-heading {
    border-top: 0;
}

html[data-theme="dark"] .live-minimal-card .live-minimal-shift-comparison > .live-minimal-shift-card,
html[data-theme="dark"] .live-normal-card .live-normal-details > .live-values-panel .live-values-grid,
html[data-theme="dark"] .live-normal-card .live-normal-details > .live-state-panel,
html[data-theme="dark"] .live-normal-card .live-normal-details > .live-state-panel .live-normal-shift-tile,
html[data-theme="dark"] .live-normal-card .operator-table-scroll {
    background: transparent;
    border-color: transparent;
}

html[data-theme="dark"] .live-normal-card .live-values-grid > span,
html[data-theme="dark"] .live-normal-card .live-values-grid > .live-metric-hover,
html[data-theme="dark"] .live-normal-card .live-normal-details > .live-state-panel,
html[data-theme="dark"] .live-normal-card .live-normal-details > .live-state-panel .live-normal-shift-tile,
html[data-theme="dark"] .live-normal-card .operator-table-scroll th,
html[data-theme="dark"] .live-normal-card .operator-table-scroll td {
    border-color: transparent;
}

/* Graph focus mode, 2026-08-16. The SVG timeline becomes the page surface while
   its range, visibility, weather and LIVE controls remain available. Escape or
   NORMAL VIEW returns to the normal expanded machine page. */
.live-expanded-page.graph-maximized {
    position: fixed;
    z-index: 2000;
    inset: 0;
    width: 100vw;
    height: 100vh;
    min-height: 100vh;
    overflow: hidden;
    background: #f4f7fb;
}

.live-expanded-page.graph-maximized > .expanded-header,
.live-expanded-page.graph-maximized > .live-expanded-overview {
    display: none;
}

.live-expanded-page.graph-maximized > .live-expanded-chart {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
    padding: 16px 20px 20px;
    background: #f4f7fb;
}

.live-expanded-page.graph-maximized .expanded-view-tabs {
    display: none;
}

.live-expanded-page.graph-maximized .expanded-chart-controls {
    min-height: 46px;
}

.live-expanded-page.graph-maximized .expanded-chart-body {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding-top: 12px;
}

.live-expanded-page.graph-maximized .expanded-plot {
    min-height: 0;
    border-radius: 14px;
}

.live-expanded-page.graph-maximized .expanded-events-card {
    display: none;
}

.live-expanded-page.graph-maximized .operator-series-toolbar {
    padding: 8px 10px;
}

.live-expanded-page.graph-maximized .operator-chart-canvas {
    min-height: 0;
}

.live-expanded-page.graph-maximized .graph-fullscreen-button {
    color: #fff;
    border-color: #1f6feb;
    background: #1f6feb;
}

.live-expanded-page.graph-maximized .graph-fullscreen-button:hover,
.live-expanded-page.graph-maximized .graph-fullscreen-button:focus-visible {
    color: #fff;
    border-color: #1558bd;
    background: #1558bd;
}

html[data-theme="dark"] .live-expanded-page.graph-maximized,
html[data-theme="dark"] .live-expanded-page.graph-maximized > .live-expanded-chart {
    background: #09131c;
}

html[data-theme="dark"] .live-expanded-page.graph-maximized .expanded-plot {
    border-color: #31516a;
    background: #0b1722;
    box-shadow: 0 10px 32px rgba(0, 0, 0, .28);
}

html[data-theme="dark"] .live-expanded-page.graph-maximized .graph-fullscreen-button,
html[data-theme="dark"] .live-expanded-page.graph-maximized .graph-fullscreen-button:hover,
html[data-theme="dark"] .live-expanded-page.graph-maximized .graph-fullscreen-button:focus-visible {
    color: #07121c;
    border-color: #71c5ff;
    background: #71c5ff;
}

@media (max-width: 700px) {
    .live-expanded-page.graph-maximized > .live-expanded-chart {
        padding: 10px;
    }

    .live-expanded-page.graph-maximized .expanded-chart-controls {
        align-items: flex-start;
    }
}

html[data-theme="dark"] .analytics-usage-panel,
html[data-theme="dark"] .analytics-compare-panel {
    background: var(--theme-surface);
    border-color: var(--theme-border);
}

html[data-theme="dark"] .analytics-machine-picker,
html[data-theme="dark"] .analytics-state-legend,
html[data-theme="dark"] .analytics-usage-legend,
html[data-theme="dark"] .analytics-compare-values {
    color: var(--theme-muted);
}

html[data-theme="dark"] .analytics-machine-picker select,
html[data-theme="dark"] .analytics-usage-summary > div {
    color: var(--theme-text);
    background: var(--theme-surface-soft);
    border-color: var(--theme-border-soft);
}

html[data-theme="dark"] .analytics-usage-summary span,
html[data-theme="dark"] .analytics-usage-legend small {
    color: var(--theme-muted);
}

html[data-theme="dark"] .analytics-usage-summary strong {
    color: var(--theme-heading);
}

html[data-theme="dark"] .analytics-compare-track {
    background: #243746;
}

html[data-theme="dark"] .analytics-compare-filters,
html[data-theme="dark"] .analytics-shift-table-scroll {
    background: var(--theme-surface-soft);
    border-color: var(--theme-border-soft);
}

html[data-theme="dark"] .analytics-filter-field,
html[data-theme="dark"] .analytics-machine-selection-heading,
html[data-theme="dark"] .analytics-selection-count {
    color: var(--theme-muted);
}

html[data-theme="dark"] .analytics-filter-field select,
html[data-theme="dark"] .analytics-machine-option {
    color: var(--theme-text);
    background: var(--theme-surface);
    border-color: var(--theme-border-soft);
}

html[data-theme="dark"] .analytics-machine-option:has(input:checked) {
    color: var(--theme-heading);
    background: #12314b;
    border-color: #3475ac;
}

html[data-theme="dark"] .analytics-shift-breakdown {
    border-top-color: var(--theme-border-soft);
}

html[data-theme="dark"] .analytics-shift-breakdown-heading h3 {
    color: var(--theme-heading);
}

html[data-theme="dark"] .analytics-chart-grid-line {
    stroke: #294254;
}

html[data-theme="dark"] .analytics-chart-axis-line {
    stroke: #577087;
}

html[data-theme="dark"] .analytics-chart-axis-label,
html[data-theme="dark"] .analytics-chart-date-label {
    fill: #9bb0c3;
}

@media (max-width: 760px) {
    .analytics-usage-summary { grid-template-columns: 1fr; }
    .analytics-usage-heading { gap: 14px; }
    .analytics-machine-picker,
    .analytics-machine-picker select { width: 100%; }
    .analytics-compare-filters { grid-template-columns: 1fr; margin-left: 16px; margin-right: 16px; }
    .analytics-selection-count { margin-left: 0; }
    .analytics-shift-breakdown-heading { padding-left: 16px; padding-right: 16px; }
    .analytics-shift-table-scroll { margin-left: 16px; margin-right: 16px; }
    .analytics-compare-row { grid-template-columns: 1fr; gap: 7px; }
    .analytics-compare-values { text-align: left; }
}

/* Shared telemetry graph system. Keep the plot quiet, make signal choice
   explicit, and reserve the strongest contrast for the data itself. */
.live-expanded-chart {
    --graph-surface: #fbfdff;
    --graph-surface-soft: #f4f8fc;
    --graph-surface-raised: #ffffff;
    --graph-border: #dbe5ef;
    --graph-grid: #d8e3ee;
    --graph-grid-soft: #edf2f7;
    --graph-axis: #91a4b8;
    --graph-text: #3d5673;
    --graph-muted: #8091a5;
    --graph-rail: #e9eff5;
    --graph-active: #2bb478;
    --graph-idle: #eca83e;
    --graph-no-net: #9aa5b5;
}

.live-expanded-chart .expanded-chart-body {
    align-items: stretch;
    gap: 12px;
}

.live-expanded-chart .expanded-plot {
    overflow: visible;
    border: 0;
    border-radius: 12px;
    background: transparent;
    box-shadow: none;
}

.live-expanded-chart .operator-trend-wrap {
    display: flex;
    flex-direction: column;
    gap: 7px;
    width: 100%;
    height: 100%;
    min-height: 0;
}

.live-expanded-chart .operator-series-toolbar {
    display: grid;
    grid-template-columns: minmax(145px, .75fr) minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 7px 9px;
    border: 0;
    border-bottom: 1px solid var(--graph-border);
    border-radius: 0;
    background: var(--graph-surface-raised);
}

.live-expanded-chart .operator-series-toolbar-heading {
    display: grid;
    gap: 2px;
    min-width: 0;
    padding: 0;
}

.live-expanded-chart .operator-series-toolbar-heading span {
    overflow: hidden;
    color: var(--graph-text);
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .06em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.live-expanded-chart .operator-series-toolbar-heading small {
    color: var(--graph-muted);
    font-size: 9px;
    line-height: 1.2;
}

.live-expanded-chart .operator-series-groups {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: thin;
}

.live-expanded-chart .operator-series-group,
.live-expanded-chart .operator-series-reset {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 25px;
    padding: 4px 8px;
    border: 1px solid var(--graph-border);
    border-radius: 999px;
    color: var(--graph-text);
    background: var(--graph-surface-soft);
    font: inherit;
    font-size: 9px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: color .12s ease, background .12s ease, border-color .12s ease, opacity .12s ease;
}

.live-expanded-chart .operator-series-group:hover,
.live-expanded-chart .operator-series-group:focus-visible,
.live-expanded-chart .operator-series-reset:hover,
.live-expanded-chart .operator-series-reset:focus-visible {
    outline: 0;
    border-color: var(--series-color, #69a8e8);
    color: var(--graph-text);
    background: var(--graph-surface-raised);
}

.live-expanded-chart .operator-series-group.is-hidden {
    opacity: .55;
}

.live-expanded-chart .operator-series-group.is-partial {
    border-color: var(--group-color);
    background: color-mix(in srgb, var(--group-color) 10%, var(--graph-surface-raised));
}

.live-expanded-chart .operator-series-group.is-visible {
    border-color: color-mix(in srgb, var(--group-color) 42%, var(--graph-border));
}

.live-expanded-chart .operator-series-group-dot {
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    border-radius: 50%;
    background: var(--group-color);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--group-color) 16%, transparent);
}

.live-expanded-chart .operator-series-group small {
    color: var(--graph-muted);
    font-size: 8px;
    font-variant-numeric: tabular-nums;
}

.live-expanded-chart .operator-series-reset {
    color: #246fc1;
    background: transparent;
}

.live-expanded-chart .operator-series-legend {
    position: static;
    display: flex;
    flex: 0 0 auto;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
    min-width: 0;
    max-height: 32px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 2px 3px;
    transform: none;
    color: var(--graph-text);
    font-size: 9px;
    scrollbar-width: thin;
}

.live-expanded-chart .operator-series-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 24px;
    flex: 0 0 auto;
    padding: 4px 8px;
    border: 0;
    border-radius: 6px;
    color: var(--graph-text);
    background: transparent;
    font: inherit;
    font-size: 9px;
    font-weight: 750;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: color .12s ease, background .12s ease, opacity .12s ease;
}

.live-expanded-chart .operator-series-toggle:hover,
.live-expanded-chart .operator-series-toggle:focus-visible {
    outline: 0;
    color: var(--graph-text);
    background: var(--graph-surface-soft);
}

.live-expanded-chart .operator-series-toggle.is-hidden {
    opacity: .42;
}

.live-expanded-chart .operator-series-swatch {
    width: 18px;
    height: 3px;
    flex: 0 0 18px;
    border-radius: 999px;
    background: var(--series-color);
}

.live-expanded-chart .operator-series-toggle.is-hidden .operator-series-swatch {
    border: 1px dashed var(--series-color);
    background: transparent;
}

.live-expanded-chart .operator-series-toggle > span::before {
    display: none;
    content: none;
}

.live-expanded-chart .operator-chart-canvas {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    overflow: visible;
    border-radius: 10px;
    background: var(--graph-surface);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--graph-border) 60%, transparent);
}

.live-expanded-chart .operator-chart-canvas .operator-trend-svg {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
    shape-rendering: geometricPrecision;
}

.live-expanded-chart .operator-grid-line {
    stroke: var(--graph-grid);
    stroke-width: 1;
    vector-effect: non-scaling-stroke;
}

.live-expanded-chart .operator-grid-line.horizontal {
    stroke: var(--graph-grid-soft);
}

.live-expanded-chart .operator-axis-line {
    stroke: var(--graph-axis);
    stroke-width: 1.2;
    vector-effect: non-scaling-stroke;
}

.live-expanded-chart .operator-axis-label,
.live-expanded-chart .operator-weather-temperature-axis-label,
.live-expanded-chart .operator-weather-humidity-axis-label,
.live-expanded-chart .operator-weather-pressure-axis-label {
    font-family: "Segoe UI", Arial, sans-serif;
    font-size: 12px;
    font-weight: 650;
}

.live-expanded-chart .operator-axis-label { fill: var(--graph-muted); }
.live-expanded-chart .operator-weather-temperature-axis-label { fill: #a25ec0; }
.live-expanded-chart .operator-weather-humidity-axis-label { fill: #16899b; }
.live-expanded-chart .operator-weather-pressure-axis-label { fill: #b96b09; }
.live-expanded-chart .operator-weather-axis-line { stroke: color-mix(in srgb, #16899b 48%, var(--graph-border)); stroke-width: 1; vector-effect: non-scaling-stroke; }

.live-expanded-chart .operator-series-line {
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}

.live-expanded-chart .operator-weather-series-line {
    stroke-width: 2.6;
    stroke-dasharray: 3 6;
    stroke-linecap: round;
    opacity: .9;
}

.live-expanded-chart .operator-series-line.is-dimmed {
    opacity: .13;
}

.live-expanded-chart .operator-state-band.active { fill: color-mix(in srgb, var(--graph-active) 78%, transparent); }
.live-expanded-chart .operator-state-band.idle { fill: color-mix(in srgb, var(--graph-idle) 82%, transparent); }
.live-expanded-chart .operator-state-band.no-net { fill: color-mix(in srgb, var(--graph-no-net) 82%, transparent); }
.live-expanded-chart .operator-state-text { fill: #ffffff; font-size: 11px; font-weight: 850; letter-spacing: .02em; }
.live-expanded-chart .operator-event-line { stroke: #28b7dc; stroke-width: 1.2; stroke-dasharray: 3 4; opacity: .72; vector-effect: non-scaling-stroke; }
.live-expanded-chart .operator-event-line.selected { stroke: #f59e0b; stroke-width: 2.4; opacity: 1; }
.live-expanded-chart .operator-event-marker { fill: var(--graph-surface-raised); stroke: #28b7dc; stroke-width: 2; vector-effect: non-scaling-stroke; }
.live-expanded-chart .operator-event-marker.selected { fill: #f59e0b; stroke: #ffffff; }
.live-expanded-chart .operator-event-label { fill: var(--graph-text); font-size: 10px; font-weight: 750; }
.live-expanded-chart .operator-crosshair { stroke: #f59e0b; stroke-width: 1.2; stroke-dasharray: 4 4; opacity: .9; vector-effect: non-scaling-stroke; pointer-events: none; }
.live-expanded-chart .operator-series-hit,
.live-expanded-chart .operator-series-hit-layer { fill: transparent; stroke: transparent; pointer-events: all; cursor: crosshair; }
.live-expanded-chart .operator-series-line.is-hidden { display: none; }

.live-expanded-chart .operator-chart-tooltip {
    position: absolute;
    z-index: 20;
    display: grid;
    min-width: 225px;
    max-width: min(340px, 42vw);
    max-height: min(310px, calc(100% - 14px));
    gap: 6px;
    overflow: auto;
    padding: 9px 10px;
    border: 1px solid var(--graph-border);
    border-radius: 10px;
    color: var(--graph-text);
    background: color-mix(in srgb, var(--graph-surface-raised) 96%, transparent);
    box-shadow: 0 12px 30px rgba(20, 45, 70, .16);
    pointer-events: none;
    transform: translate(-50%, -112%);
}

.live-expanded-chart .operator-chart-tooltip.is-right { transform: translate(-100%, -112%); }
.live-expanded-chart .operator-chart-tooltip.is-left { transform: translate(0, -112%); }
.live-expanded-chart .operator-chart-tooltip header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.live-expanded-chart .operator-chart-tooltip header strong { color: var(--graph-text); font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.live-expanded-chart .operator-chart-tooltip header span { overflow: hidden; color: var(--graph-muted); font-size: 9px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.live-expanded-chart .operator-chart-tooltip-values { display: grid; gap: 3px; }
.live-expanded-chart .operator-chart-tooltip-values > div { display: grid; grid-template-columns: 9px minmax(0, 1fr) auto; align-items: center; gap: 5px; min-width: 0; }
.live-expanded-chart .operator-chart-tooltip-values i { width: 7px; height: 7px; border-radius: 50%; background: var(--series-color); }
.live-expanded-chart .operator-chart-tooltip-values span { overflow: hidden; color: var(--graph-muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.live-expanded-chart .operator-chart-tooltip-values b { color: var(--graph-text); font-size: 9px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.live-expanded-chart .operator-chart-tooltip > small { color: var(--graph-muted); font-size: 8px; font-variant-numeric: tabular-nums; }

.live-expanded-chart .expanded-events-card {
    border: 0;
    border-left: 1px solid var(--graph-border);
    border-radius: 0;
    background: var(--graph-surface-raised);
    box-shadow: none;
}

.live-expanded-chart .expanded-events-card h4 { color: var(--graph-text); font-size: 12px; }
.live-expanded-chart .expanded-events-card > p { color: var(--graph-muted); }
.live-expanded-chart .expanded-events-card .operator-table-scroll { border-color: var(--graph-border); background: var(--graph-surface); }
.live-expanded-chart .expanded-events-card footer { color: var(--graph-muted); }

/* The maximized graph keeps the same hierarchy, but gives the plot the full
   viewport and removes secondary chrome. */
.live-expanded-page.graph-maximized > .live-expanded-chart {
    padding: 13px 18px 18px;
    background: var(--graph-surface-soft);
}

.live-expanded-page.graph-maximized .expanded-chart-body {
    padding-top: 9px;
}

.live-expanded-page.graph-maximized .expanded-plot {
    border-radius: 12px;
}

.live-expanded-page.graph-maximized .operator-chart-canvas {
    min-height: 0;
    border-radius: 12px;
}

/* Apply the same surface, grid, and state language to the Analytics chart. */
.analytics-usage-chart-shell {
    --graph-surface: #fbfdff;
    --graph-grid: #d8e3ee;
    --graph-axis: #91a4b8;
    --graph-text: #3d5673;
    --graph-muted: #8091a5;
    background: var(--graph-surface);
}

.analytics-usage-chart {
    padding: 4px 0;
}

.analytics-chart-grid-line { stroke: var(--graph-grid); }
.analytics-chart-axis-line { stroke: var(--graph-axis); }
.analytics-chart-axis-label,
.analytics-chart-date-label { fill: var(--graph-muted); font-family: "Segoe UI", Arial, sans-serif; font-weight: 700; }
.analytics-usage-bar { fill: #31d887; opacity: .88; }
.analytics-usage-bar:hover { fill: #1fba76; opacity: 1; }

html[data-theme="dark"] .live-expanded-chart {
    --graph-surface: #0d1823;
    --graph-surface-soft: #0a141e;
    --graph-surface-raised: #111f2d;
    --graph-border: #29465c;
    --graph-grid: #294253;
    --graph-grid-soft: #1c303f;
    --graph-axis: #66839a;
    --graph-text: #dcebf6;
    --graph-muted: #8ea9bd;
    --graph-rail: #1d3444;
    --graph-active: #31d887;
    --graph-idle: #eca83e;
    --graph-no-net: #9aa5b5;
}

html[data-theme="dark"] .live-expanded-chart .operator-series-toolbar,
html[data-theme="dark"] .live-expanded-chart .operator-chart-canvas,
html[data-theme="dark"] .live-expanded-chart .expanded-events-card {
    color: var(--graph-text);
}

html[data-theme="dark"] .live-expanded-chart .operator-series-reset { color: #8acbff; }
html[data-theme="dark"] .live-expanded-chart .operator-series-group:hover,
html[data-theme="dark"] .live-expanded-chart .operator-series-group:focus-visible,
html[data-theme="dark"] .live-expanded-chart .operator-series-reset:hover,
html[data-theme="dark"] .live-expanded-chart .operator-series-reset:focus-visible,
html[data-theme="dark"] .live-expanded-chart .operator-series-toggle:hover,
html[data-theme="dark"] .live-expanded-chart .operator-series-toggle:focus-visible {
    background: #173047;
}

html[data-theme="dark"] .live-expanded-chart .operator-chart-tooltip {
    border-color: #3b617c;
    background: rgba(17, 31, 45, .98);
    box-shadow: 0 14px 30px rgba(0, 0, 0, .34);
}

html[data-theme="dark"] .live-expanded-chart .operator-event-marker { fill: #111f2d; stroke: #61d2ee; }
html[data-theme="dark"] .live-expanded-chart .operator-event-marker.selected { fill: #f59e0b; stroke: #fff3d6; }
html[data-theme="dark"] .live-expanded-page.graph-maximized > .live-expanded-chart { background: #09131c; }

html[data-theme="dark"] .analytics-usage-chart-shell {
    --graph-surface: #0d1823;
    --graph-grid: #294253;
    --graph-axis: #66839a;
    --graph-text: #dcebf6;
    --graph-muted: #8ea9bd;
    background: var(--graph-surface);
}

html[data-theme="dark"] .analytics-usage-bar { fill: #31d887; }
html[data-theme="dark"] .analytics-usage-bar:hover { fill: #63e7a7; }

@media (max-width: 1250px) {
    .live-expanded-chart .operator-series-toolbar {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .live-expanded-chart .operator-series-groups {
        grid-column: 1 / -1;
        grid-row: 2;
        justify-content: flex-start;
    }

    .live-expanded-chart .operator-series-legend { max-height: 34px; }
}

@media (max-width: 760px) {
    .live-expanded-chart .operator-series-toolbar {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .live-expanded-chart .expanded-chart-body { grid-template-columns: minmax(0, 1fr); }
    .live-expanded-chart .expanded-events-card { display: none; }
    .live-expanded-chart .operator-chart-tooltip { max-width: 78vw; }
}

/* Analytics comparison workspace. Keep the scenario controls compact and let
   the result cards carry the visual weight of the comparison. */
.analytics-page-heading { margin-bottom: 22px; }
.analytics-scenario-builder { margin-bottom: 24px; padding: 24px 0 17px; overflow: hidden; }
.analytics-builder-heading { align-items: flex-start; margin: 0; padding-bottom: 18px; }
.analytics-builder-heading h2 { margin-bottom: 6px; }
.analytics-builder-heading p.muted { max-width: 680px; margin-bottom: 0; line-height: 1.45; }
.analytics-builder-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.analytics-scenario-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 0 25px; }
.analytics-scenario-card { min-width: 0; padding: 15px; border: 1px solid #dce5ef; border-radius: 12px; background: #f8fbff; }
.analytics-scenario-card > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 13px; }
.analytics-scenario-card h3 { margin: 3px 0 0; color: #1d3554; font-size: 17px; }
.analytics-scenario-number { display: block; color: #6482a3; font-size: 9px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.analytics-remove-scenario { padding: 3px 0; border: 0; color: #b44c58; background: transparent; font-size: 10px; font-weight: 800; cursor: pointer; }
.analytics-remove-scenario:hover { text-decoration: underline; }
.analytics-scenario-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.analytics-scenario-fields label { display: grid; gap: 5px; min-width: 0; color: #68788f; font-size: 10px; font-weight: 800; }
.analytics-scenario-fields input,
.analytics-scenario-fields select { width: 100%; min-width: 0; min-height: 34px; padding: 7px 9px; border: 1px solid #d4dfe9; border-radius: 8px; color: #253d5d; background: #fff; font: inherit; }
.analytics-scenario-fields input:focus,
.analytics-scenario-fields select:focus { border-color: #77aef0; outline: 0; box-shadow: 0 0 0 3px rgba(74, 143, 231, .14); }
.analytics-scenario-field-note { align-self: end; padding: 9px 0; color: #8795a8; font-size: 10px; }
.analytics-scenario-card footer { margin-top: 13px; padding-top: 10px; border-top: 1px solid #e3eaf2; color: #718198; font-size: 10px; font-weight: 700; }
.analytics-builder-footnote { margin: 15px 25px 0; color: #8795a8; font-size: 10px; }
.analytics-comparison-results { min-width: 0; }
.analytics-results-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.analytics-results-heading h2 { margin-bottom: 5px; }
.analytics-results-heading p.muted { margin-bottom: 0; line-height: 1.45; }
.analytics-scenario-notices { display: grid; gap: 8px; margin-bottom: 14px; }
.analytics-scenario-notice { display: flex; gap: 9px; padding: 11px 13px; border: 1px solid #f0d7b1; border-radius: 10px; color: #866226; background: #fffaf0; font-size: 11px; }
.analytics-scenario-notice strong { color: #7a5110; }
.analytics-result-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.analytics-result-card { min-width: 0; overflow: hidden; border: 1px solid #d7e1ec; border-radius: 15px; background: #fff; box-shadow: 0 8px 25px rgba(36, 55, 84, .045); }
.analytics-result-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 18px 10px; }
.analytics-result-header h3 { margin: 3px 0 2px; color: #152e4f; font-size: 21px; }
.analytics-result-header p { margin: 0; color: #71839a; font-size: 11px; }
.analytics-result-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; padding: 0 18px 15px; color: #637a95; font-size: 10px; font-weight: 750; }
.analytics-result-meta span { padding: 5px 8px; border-radius: 999px; background: #f1f6fb; }
.analytics-parameters-panel,
.analytics-scenario-chart,
.analytics-weather-panel,
.analytics-state-pie-panel,
.analytics-models-panel { min-width: 0; padding: 15px; background: #f7fafd; }
.analytics-parameters-panel { margin: 0 12px 12px; border-radius: 10px; }
.analytics-panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 11px; }
.analytics-panel-heading .eyebrow { margin-bottom: 4px; font-size: 8px; }
.analytics-panel-heading h4 { margin: 0; color: #203b5d; font-size: 13px; }
.analytics-panel-window { max-width: 52%; color: #8191a5; font-size: 9px; font-weight: 750; text-align: right; }
.analytics-parameter-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
.analytics-parameter-grid > div { min-width: 0; padding: 7px 8px; border-radius: 6px; background: #fff; }
.analytics-parameter-grid span { display: block; overflow: hidden; color: #8291a5; font-size: 8px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; text-transform: uppercase; }
.analytics-parameter-grid strong { display: block; overflow: hidden; margin-top: 3px; color: #274463; font-size: 11px; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.analytics-result-charts { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 12px; padding: 0 12px 12px; }
.analytics-scenario-chart,
.analytics-weather-panel { border-radius: 10px; }
.analytics-scenario-chart .analytics-panel-heading,
.analytics-weather-panel .analytics-panel-heading { padding: 0 1px; }
.analytics-scenario-chart .operator-trend-wrap { min-height: 318px; }
.analytics-scenario-chart .operator-series-toolbar { display: block; min-height: 0; padding: 7px; border: 0; border-radius: 7px; background: #edf3f8; }
.analytics-scenario-chart .operator-series-toolbar-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; width: auto; padding: 0; }
.analytics-scenario-chart .operator-series-toolbar-heading span { color: #526b86; font-size: 8px; }
.analytics-scenario-chart .operator-series-toolbar-heading small { font-size: 8px; }
.analytics-scenario-chart .operator-series-groups { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.analytics-scenario-chart .operator-series-group { min-height: 21px; padding: 3px 6px; font-size: 8px; }
.analytics-scenario-chart .operator-series-reset { display: none; }
.analytics-scenario-chart .operator-series-legend { position: static; display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; transform: none; color: #607792; font-size: 8px; }
.analytics-scenario-chart .operator-series-toggle { min-height: 20px; padding: 3px 5px; font-size: 8px; }
.analytics-scenario-chart .operator-chart-canvas { min-height: 238px; margin-top: 6px; border-radius: 8px; background: #fff; }
.analytics-scenario-chart .operator-axis-label { font-size: 10px; }
.analytics-weather-legend { display: flex; flex-wrap: wrap; gap: 8px; margin: -2px 0 8px; color: #647993; font-size: 9px; font-weight: 750; }
.analytics-weather-legend span { display: inline-flex; align-items: center; gap: 4px; }
.analytics-weather-legend i { width: 15px; height: 3px; display: inline-block; border-radius: 999px; }
.analytics-weather-legend i.temperature { background: #b666d2; }
.analytics-weather-legend i.humidity { background: #1b9aaa; }
.analytics-weather-legend i.pressure { background: #d97706; }
.analytics-weather-canvas { height: 294px; border-radius: 8px; background: #fff; }
.analytics-weather-canvas svg { display: block; width: 100%; height: 100%; }
.analytics-weather-grid { stroke: #dbe5ef; stroke-width: 1; vector-effect: non-scaling-stroke; }
.analytics-weather-axis { stroke: #9fb0c2; stroke-width: 1; vector-effect: non-scaling-stroke; }
.analytics-weather-axis-label,
.analytics-weather-time-label { fill: #71859e; font-family: "Segoe UI", Arial, sans-serif; font-size: 12px; font-weight: 700; }
.analytics-weather-axis-label.humidity-label { fill: #1b8291; }
.analytics-weather-line { fill: none; stroke-width: 3; stroke-dasharray: 7 6; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.analytics-weather-line.temperature,
.analytics-weather-point.temperature { stroke: #b666d2; fill: #b666d2; }
.analytics-weather-line.humidity,
.analytics-weather-point.humidity { stroke: #1b9aaa; fill: #1b9aaa; }
.analytics-weather-line.pressure,
.analytics-weather-point.pressure { stroke: #d97706; fill: #d97706; }
.analytics-weather-point { stroke-width: 1; vector-effect: non-scaling-stroke; }
.analytics-chart-empty { display: grid; min-height: 180px; place-items: center; color: #8191a5; font-size: 10px; }
.analytics-result-lower-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); gap: 12px; padding: 0 12px 12px; }
.analytics-state-pie-content { display: flex; align-items: center; gap: 13px; min-height: 137px; }
.analytics-state-pie { width: 112px; height: 112px; flex: 0 0 112px; display: grid; place-items: center; border-radius: 50%; background: var(--pie-background); }
.analytics-state-pie span { color: #2a4260; font-size: 16px; font-weight: 850; }
.analytics-state-pie-legend { display: grid; flex: 1 1 auto; gap: 8px; min-width: 0; }
.analytics-state-pie-legend > div { display: grid; grid-template-columns: 9px minmax(0, 1fr) auto; align-items: center; gap: 6px; color: #637a95; font-size: 9px; }
.analytics-state-pie-legend i { width: 9px; height: 9px; display: block; border-radius: 2px; }
.analytics-state-pie-legend i.active { background: var(--state-active-color); }
.analytics-state-pie-legend i.idle { background: var(--state-idle-color); }
.analytics-state-pie-legend i.no-net { background: var(--state-no-net-color); }
.analytics-state-pie-legend strong { color: #304b6b; font-size: 9px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.analytics-model-table-scroll { max-height: 150px; overflow: auto; border-radius: 7px; background: #fff; }
.analytics-model-table-scroll table { width: 100%; min-width: 320px; border-collapse: collapse; }
.analytics-model-table-scroll th { padding: 7px 8px; color: #8493a6; background: #eef4f9; font-size: 8px; }
.analytics-model-table-scroll td { padding: 8px; color: #566f8a; font-size: 9px; border-bottom: 1px solid #edf2f6; }
.analytics-model-table-scroll td:first-child { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.analytics-model-table-scroll .analytics-model-empty { color: #8191a5; text-align: center; }
.analytics-models-panel footer { margin-top: 8px; color: #8797a9; font-size: 8px; }

html[data-theme="dark"] .analytics-scenario-card,
html[data-theme="dark"] .analytics-scenario-notice,
html[data-theme="dark"] .analytics-result-card,
html[data-theme="dark"] .analytics-parameters-panel,
html[data-theme="dark"] .analytics-scenario-chart,
html[data-theme="dark"] .analytics-weather-panel,
html[data-theme="dark"] .analytics-state-pie-panel,
html[data-theme="dark"] .analytics-models-panel {
    color: var(--theme-text);
    background: var(--theme-surface);
    border-color: var(--theme-border);
}
html[data-theme="dark"] .analytics-scenario-card,
html[data-theme="dark"] .analytics-parameters-panel,
html[data-theme="dark"] .analytics-scenario-chart,
html[data-theme="dark"] .analytics-weather-panel,
html[data-theme="dark"] .analytics-state-pie-panel,
html[data-theme="dark"] .analytics-models-panel { background: var(--theme-surface-soft); }
html[data-theme="dark"] .analytics-scenario-card h3,
html[data-theme="dark"] .analytics-result-header h3,
html[data-theme="dark"] .analytics-panel-heading h4,
html[data-theme="dark"] .analytics-parameter-grid strong,
html[data-theme="dark"] .analytics-state-pie-legend strong { color: var(--theme-heading); }
html[data-theme="dark"] .analytics-scenario-fields input,
html[data-theme="dark"] .analytics-scenario-fields select,
html[data-theme="dark"] .analytics-parameter-grid > div,
html[data-theme="dark"] .analytics-scenario-chart .operator-chart-canvas,
html[data-theme="dark"] .analytics-weather-canvas,
html[data-theme="dark"] .analytics-model-table-scroll { color: var(--theme-text); background: #0d1822; border-color: var(--theme-border-soft); }
html[data-theme="dark"] .analytics-scenario-card footer { border-top-color: var(--theme-border-soft); }
html[data-theme="dark"] .analytics-result-card { box-shadow: 0 12px 30px rgba(0, 0, 0, .22); }
html[data-theme="dark"] .analytics-result-meta span { background: #172c3d; color: #a9c0d2; }
html[data-theme="dark"] .analytics-scenario-chart .operator-series-toolbar { background: #132536; }
html[data-theme="dark"] .analytics-scenario-chart .operator-series-toolbar-heading span { color: #c0d5e5; }
html[data-theme="dark"] .analytics-weather-grid { stroke: #294254; }
html[data-theme="dark"] .analytics-weather-axis { stroke: #66839a; }
html[data-theme="dark"] .analytics-weather-axis-label,
html[data-theme="dark"] .analytics-weather-time-label { fill: #9bb0c3; }
html[data-theme="dark"] .analytics-weather-axis-label.humidity-label { fill: #59c5d3; }
html[data-theme="dark"] .analytics-state-pie span { color: #d8e8f5; }
html[data-theme="dark"] .analytics-model-table-scroll th { color: #9bb0c3; background: #172634; }
html[data-theme="dark"] .analytics-model-table-scroll td { color: #b7c8d6; border-bottom-color: var(--theme-border-soft); }
html[data-theme="dark"] .analytics-scenario-notice { color: #e6c776; background: #342914; border-color: #755c29; }
html[data-theme="dark"] .analytics-scenario-notice strong { color: #f2d487; }

@media (max-width: 1100px) {
    .analytics-scenario-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .analytics-result-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    .analytics-builder-heading,
    .analytics-results-heading { align-items: flex-start; flex-direction: column; }
    .analytics-builder-actions { justify-content: flex-start; }
    .analytics-scenario-list { grid-template-columns: 1fr; padding-left: 16px; padding-right: 16px; }
    .analytics-builder-footnote { margin-left: 16px; margin-right: 16px; }
    .analytics-result-charts,
    .analytics-result-lower-grid { grid-template-columns: 1fr; padding-left: 8px; padding-right: 8px; }
    .analytics-parameter-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Analytics comparison workspace. Keep the trend graph dominant, with weather and
   production details following it in the reading order. */
.analytics-analysis-shell { min-width: 0; }
.analytics-results-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.analytics-result-charts { grid-template-columns: 1fr; }
.analytics-scenario-chart { min-width: 0; }
.analytics-scenario-chart .operator-trend-wrap { min-height: 560px; }
.analytics-scenario-chart .operator-chart-canvas { min-height: 440px; }
.analytics-weather-panel { min-height: 370px; }
.analytics-weather-canvas { height: 340px; }

.analytics-merged-panel {
    min-width: 0;
    margin: 0 0 18px;
    padding: 18px;
    border: 1px solid #d7e1ec;
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 8px 25px rgba(36, 55, 84, .045);
}
.analytics-merged-controls { display: grid; gap: 13px; padding: 12px; border-radius: 10px; background: #f7fafd; }
.analytics-merged-control-group { display: grid; gap: 7px; }
.analytics-merged-control-group > span { color: #687b94; font-size: 9px; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.analytics-merged-chip-list { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.analytics-merged-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    padding: 5px 9px;
    border: 1px solid #d7e2ed;
    border-radius: 999px;
    color: #35516e;
    background: #fff;
    font-size: 10px;
    font-weight: 750;
    cursor: pointer;
}
.analytics-merged-chip i { width: 9px; height: 9px; flex: 0 0 9px; border-radius: 50%; background: var(--scenario-color); }
.analytics-merged-chip.parameter-chip i { border-radius: 2px; background: var(--parameter-color); }
.analytics-merged-chip.is-hidden { opacity: .42; }
.analytics-merged-chip.is-visible { border-color: #83b0ec; box-shadow: 0 0 0 2px rgba(47, 128, 237, .08); }
.analytics-merged-chip:focus-visible { outline: 2px solid #2f80ed; outline-offset: 2px; }
.analytics-merged-legend { display: flex; flex-wrap: wrap; gap: 8px 13px; margin: 13px 2px 0; color: #607792; font-size: 10px; font-weight: 750; }
.analytics-merged-legend span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.analytics-merged-legend i { width: 15px; height: 3px; display: inline-block; border-radius: 999px; background: var(--scenario-color); }
.analytics-merged-legend i.parameter-legend { background: transparent; border-top: 3px dashed var(--parameter-color); border-radius: 0; }
.analytics-merged-canvas { position: relative; min-height: 520px; margin-top: 12px; overflow: hidden; border: 1px solid #dce6f0; border-radius: 11px; background: #fff; }
.analytics-merged-canvas svg { display: block; width: 100%; height: 100%; min-height: 520px; }
.analytics-merged-grid { stroke: #dfe7f0; stroke-width: 1; vector-effect: non-scaling-stroke; }
.analytics-merged-grid.horizontal { stroke: #edf2f7; }
.analytics-merged-axis { stroke: #9eafc1; stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.analytics-merged-axis-label { fill: #71839a; font-family: "Segoe UI", Arial, sans-serif; font-size: 12px; font-weight: 700; }
.analytics-merged-line { fill: none; stroke: var(--scenario-color); stroke-width: 2.5; stroke-dasharray: var(--parameter-dash); stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.analytics-merged-hit,
.analytics-merged-hit-layer { fill: transparent; stroke: transparent; pointer-events: all; cursor: crosshair; }
.analytics-merged-hit:hover { fill: var(--scenario-color); fill-opacity: .12; stroke: var(--scenario-color); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.analytics-merged-crosshair { stroke: #f59e0b; stroke-width: 1.1; stroke-dasharray: 4 4; opacity: .9; vector-effect: non-scaling-stroke; pointer-events: none; }
.analytics-merged-tooltip { position: absolute; z-index: 2; display: grid; gap: 5px; min-width: 210px; max-width: min(350px, 42vw); padding: 9px 11px; border: 1px solid #284461; border-radius: 9px; color: #eff7ff; background: #102337; box-shadow: 0 8px 22px rgba(22, 45, 73, .22); font-size: 10px; transform: translate(-50%, -100%); }
.analytics-merged-tooltip strong { color: #b9d9f6; font-size: 9px; }
.analytics-merged-tooltip span { color: #9cb2c7; }
.analytics-merged-tooltip b { color: #fff; font-size: 12px; }
.analytics-merged-tooltip .chart-client-tooltip-values { display: grid; gap: 3px; }
.analytics-merged-tooltip .chart-client-tooltip-values > div { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; align-items: center; gap: 5px; min-width: 0; }
.analytics-merged-tooltip .chart-client-tooltip-values i { width: 7px; height: 7px; border-radius: 50%; background: var(--series-color); }
.analytics-merged-tooltip .chart-client-tooltip-values span { overflow: hidden; color: #c0d2e2; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.analytics-merged-tooltip .chart-client-tooltip-values b { color: #fff; font-size: 9px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.analytics-merged-note { margin: 10px 2px 0; color: #8191a5; font-size: 10px; line-height: 1.4; }
.analytics-analysis-shell:fullscreen { width: 100vw; height: 100vh; overflow: auto; padding: 28px; background: var(--theme-page, #f4f7fb); }
.analytics-analysis-shell:fullscreen .analytics-result-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.analytics-analysis-shell:fullscreen .analytics-scenario-chart .operator-trend-wrap { min-height: 640px; }
.analytics-analysis-shell:fullscreen .analytics-scenario-chart .operator-chart-canvas { min-height: 520px; }

html[data-theme="dark"] .analytics-merged-panel {
    color: var(--theme-text);
    border-color: var(--theme-border);
    background: var(--theme-surface);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .22);
}
html[data-theme="dark"] .analytics-merged-controls { background: var(--theme-surface-soft); }
html[data-theme="dark"] .analytics-merged-chip { color: #c7d9e9; border-color: var(--theme-border-soft); background: var(--theme-surface-raised); }
html[data-theme="dark"] .analytics-merged-chip.is-visible { border-color: #4e88c5; box-shadow: 0 0 0 2px rgba(120, 191, 255, .09); }
html[data-theme="dark"] .analytics-merged-control-group > span,
html[data-theme="dark"] .analytics-merged-legend { color: var(--theme-muted); }
html[data-theme="dark"] .analytics-merged-canvas { border-color: var(--theme-border); background: #0d1822; }
html[data-theme="dark"] .analytics-merged-grid { stroke: #2a4355; }
html[data-theme="dark"] .analytics-merged-grid.horizontal { stroke: #1d3344; }
html[data-theme="dark"] .analytics-merged-axis { stroke: #6e8aa1; }
html[data-theme="dark"] .analytics-merged-axis-label { fill: #a9bfd1; }
html[data-theme="dark"] .analytics-merged-note { color: var(--theme-muted); }
html[data-theme="dark"] .analytics-analysis-shell:fullscreen { background: var(--theme-page); }

@media (max-width: 760px) {
    .analytics-results-actions { justify-content: flex-start; }
    .analytics-merged-panel { padding: 13px; }
    .analytics-merged-canvas,
    .analytics-merged-canvas svg { min-height: 380px; }
    .analytics-scenario-chart .operator-trend-wrap { min-height: 450px; }
    .analytics-scenario-chart .operator-chart-canvas { min-height: 340px; }
    .analytics-weather-canvas { height: 280px; }
    .analytics-analysis-shell:fullscreen { padding: 16px; }
}

/* Chart hover feedback is rendered in the browser. Keeping the layer hidden
   with the native attribute prevents a Blazor rerender from being required for
   every pointer movement across a graph. */
.chart-client-tooltip[hidden],
.chart-client-crosshair[hidden] {
    display: none !important;
}
.chart-client-tooltip {
    pointer-events: auto;
    max-height: min(310px, calc(100% - 14px));
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-color: #6f9abb transparent;
    scrollbar-width: thin;
    touch-action: auto;
}
.chart-client-tooltip::-webkit-scrollbar { width: 8px; height: 8px; }
.chart-client-tooltip::-webkit-scrollbar-track { background: transparent; }
.chart-client-tooltip::-webkit-scrollbar-thumb { border: 2px solid transparent; border-radius: 999px; background-clip: padding-box; background-color: #6f9abb; }
.live-expanded-chart .operator-chart-tooltip.chart-client-tooltip,
.analytics-merged-tooltip.chart-client-tooltip { pointer-events: auto; }
.analytics-merged-tooltip.is-right { transform: translate(-100%, -100%); }
.analytics-merged-tooltip.is-left { transform: translate(0, -100%); }
.analytics-merged-tooltip.chart-client-tooltip { pointer-events: auto; }
.analytics-merged-tooltip small {
    color: #9cb2c7;
    font-size: 9px;
    line-height: 1.35;
}
.analytics-weather-canvas,
.analytics-usage-chart {
    position: relative;
}
.analytics-weather-canvas {
    overflow: hidden;
}
html[data-theme="dark"] .analytics-merged-tooltip {
    border-color: #34536d;
    color: #eff7ff;
    background: #102337;
}

/* Analytics comparison uses one merged workspace for parameters and weather.
   Scenario cards below it retain state and printed-model evidence without
   competing with the primary charts. */
.analytics-comparison-details { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; margin-top: 18px; }
.analytics-comparison-detail-card { min-width: 0; overflow: hidden; border: 1px solid #d7e1ec; border-radius: 13px; background: #fff; box-shadow: 0 8px 25px rgba(36, 55, 84, .045); }
.analytics-comparison-detail-card .analytics-result-header { padding: 14px 15px 8px; }
.analytics-comparison-detail-card .analytics-result-header h3 { font-size: 17px; }
.analytics-comparison-detail-card .analytics-result-meta { padding: 0 15px 11px; }
.analytics-comparison-detail-card .analytics-result-lower-grid { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); padding: 0 10px 10px; }
.analytics-comparison-detail-card .analytics-state-pie-panel,
.analytics-comparison-detail-card .analytics-models-panel { padding: 12px; border-radius: 9px; }
.analytics-comparison-detail-card .analytics-state-pie-content { min-height: 122px; }
.analytics-comparison-detail-card .analytics-state-pie { width: 92px; height: 92px; flex-basis: 92px; }
.analytics-comparison-detail-card .analytics-model-table-scroll { max-height: 132px; }
.analytics-merged-weather-canvas { min-height: 460px; }
.analytics-merged-weather-canvas svg { min-height: 460px; }
.analytics-merged-weather-line { fill: none; stroke: var(--parameter-color); stroke-width: 2.7; stroke-dasharray: var(--scenario-dash); stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.analytics-merged-weather-panel .analytics-merged-legend i.scenario-dash-legend { background: transparent; border-top: 3px dashed var(--scenario-color); border-radius: 0; }
.analytics-merged-weather-panel .analytics-merged-axis-label.humidity-axis-label { fill: #1b8291; }
.analytics-analysis-shell:fullscreen .analytics-comparison-details { grid-template-columns: repeat(2, minmax(0, 1fr)); }

html[data-theme="dark"] .analytics-comparison-detail-card { color: var(--theme-text); border-color: var(--theme-border); background: var(--theme-surface); box-shadow: 0 12px 30px rgba(0, 0, 0, .22); }
html[data-theme="dark"] .analytics-comparison-detail-card .analytics-state-pie-panel,
html[data-theme="dark"] .analytics-comparison-detail-card .analytics-models-panel { background: var(--theme-surface-soft); }
html[data-theme="dark"] .analytics-merged-weather-panel .analytics-merged-axis-label.humidity-axis-label { fill: #59c5d3; }

@media (max-width: 760px) {
    .analytics-comparison-details,
    .analytics-analysis-shell:fullscreen .analytics-comparison-details { grid-template-columns: 1fr; }
    .analytics-comparison-detail-card .analytics-result-lower-grid { grid-template-columns: 1fr; }
    .analytics-merged-weather-canvas,
    .analytics-merged-weather-canvas svg { min-height: 360px; }
}

/* Shift Manager dark surfaces. Keep the light-mode swatch as a preview, but
   do not let legacy admin controls reintroduce white data surfaces into the
   active dark workspace. */
html[data-theme="dark"] .content-shell:has(.admin-grid) .live-wall-machine-option {
    color: #c7d9e9;
    border-color: var(--theme-border);
    background: var(--theme-surface-soft);
}

html[data-theme="dark"] .content-shell:has(.admin-grid) .live-wall-machine-option strong {
    color: var(--theme-heading);
}

html[data-theme="dark"] .content-shell:has(.admin-grid) .live-wall-machine-option small {
    color: var(--theme-muted);
}

html[data-theme="dark"] .content-shell:has(.admin-grid) .live-wall-machine-option em {
    color: #71dda9;
}

html[data-theme="dark"] .content-shell:has(.admin-grid) .live-wall-machine-option:not(:has(input:checked)) em {
    color: #8298aa;
}

html[data-theme="dark"] .content-shell:has(.admin-grid) .live-wall-machine-option:has(input:checked) {
    border-color: #4d92c8;
    background: #163149;
}

html[data-theme="dark"] .content-shell:has(.admin-grid) .admin-table-scroll {
    border-color: var(--theme-border);
    background: var(--theme-surface-soft);
}

html[data-theme="dark"] .content-shell:has(.admin-grid) .admin-table-scroll th {
    background: var(--theme-surface-raised);
    border-bottom-color: var(--theme-border-soft);
}

html[data-theme="dark"] .content-shell:has(.admin-grid) .admin-table-scroll td {
    border-bottom-color: var(--theme-border-soft);
}

html[data-theme="dark"] .content-shell:has(.admin-grid) .admin-table-scroll strong {
    color: var(--theme-heading);
}

html[data-theme="dark"] .content-shell:has(.admin-grid) .admin-table-scroll .cell-subtitle,
html[data-theme="dark"] .content-shell:has(.admin-grid) .admin-table-scroll small {
    color: var(--theme-muted);
}

html[data-theme="dark"] .content-shell:has(.admin-grid) .table-action {
    appearance: none;
    border: 0;
    border-radius: 6px;
    padding: 4px 6px;
    color: var(--theme-link);
    background: transparent;
}

html[data-theme="dark"] .content-shell:has(.admin-grid) .table-action:hover {
    color: #dff1ff;
    background: #17324a;
    text-decoration: none;
}

/* Minimal shift comparison surface, 2026-08-17. Keep the comparison close to
   the page canvas and leave the outer machine tile as its only frame. */
html[data-theme="dark"] .live-minimal-card .live-minimal-shift-comparison,
html[data-theme="dark"] .live-minimal-card .live-minimal-shift-comparison > .live-minimal-shift-card {
    background: var(--theme-page);
    border: 0;
    border-color: transparent;
    border-radius: 0;
}

/* Authenticated dashboard tab presence. The panel is administrator-only and intentionally
   shows operational counts and route metadata, never email addresses or principal hashes. */
.viewer-presence-panel { margin: 0 0 20px; }
.viewer-presence-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0 0 14px; }
.viewer-presence-stat { min-width: 0; padding: 13px 14px; border-radius: 10px; background: #f6f9fc; }
.viewer-presence-stat span, .viewer-presence-stat small { display: block; color: #7c8da2; font-size: 10px; }
.viewer-presence-stat strong { display: block; margin: 5px 0 2px; color: #1b3657; font-size: 22px; line-height: 1.1; }
.viewer-presence-empty { margin: 0; }
.viewer-presence-table { max-height: 230px; }
.viewer-revoke-button { padding: 7px 10px; color: #ae3f45; border-color: #efc5c8; background: #fff7f7; }
.viewer-revoke-button:hover { color: #8f2930; border-color: #e39da2; background: #ffedef; }
html[data-theme="dark"] .viewer-presence-stat { background: var(--theme-surface-soft); }
html[data-theme="dark"] .viewer-presence-stat span, html[data-theme="dark"] .viewer-presence-stat small { color: var(--theme-muted); }
html[data-theme="dark"] .viewer-presence-stat strong { color: var(--theme-heading); }
html[data-theme="dark"] .viewer-revoke-button { color: #ffb4b8; border-color: #704148; background: #2a171b; }
html[data-theme="dark"] .viewer-revoke-button:hover { color: #ffd7da; border-color: #a35b64; background: #3a1c22; }
.account-block-panel { margin: 0 0 20px; }
.account-block-panel .panel-help { max-width: 920px; margin: -4px 0 16px; color: #68788f; font-size: 12px; line-height: 1.5; }
.account-block-form { display: grid; grid-template-columns: minmax(180px, .9fr) minmax(220px, 1.4fr) auto; gap: 12px; align-items: end; margin-bottom: 16px; }
.account-block-form label { display: grid; gap: 5px; color: #68788f; font-size: 10px; font-weight: 750; }
.account-block-form input { width: 100%; min-width: 0; padding: 9px 10px; border: 1px solid #d5deea; border-radius: 7px; color: #304461; background: #f8faff; font: inherit; }
.account-block-form small { color: #8996a8; font-weight: 600; }
.danger-button { appearance: none; border: 1px solid #e0a4a9; border-radius: 7px; padding: 9px 13px; color: #a6323b; background: #fff4f5; font: inherit; font-size: 11px; font-weight: 750; cursor: pointer; white-space: nowrap; }
.danger-button:hover { color: #8d222b; border-color: #c9787f; background: #ffeaec; }
.danger-button:disabled { opacity: .55; cursor: not-allowed; }
.account-block-table { max-height: 250px; }
.account-block-table td { white-space: normal; }
.account-block-table td:first-child { min-width: 190px; white-space: nowrap; }
.account-block-empty { margin: 0; }
html[data-theme="dark"] .account-block-panel .panel-help { color: var(--theme-muted); }
html[data-theme="dark"] .account-block-form label { color: var(--theme-muted); }
html[data-theme="dark"] .account-block-form input { border-color: var(--theme-border); color: var(--theme-heading); background: var(--theme-surface-soft); }
html[data-theme="dark"] .danger-button { color: #ffb4b8; border-color: #704148; background: #2a171b; }
html[data-theme="dark"] .danger-button:hover { color: #ffd7da; border-color: #a35b64; background: #3a1c22; }
@media (max-width: 760px) {
    .viewer-presence-summary { grid-template-columns: 1fr; }
    .account-block-form { grid-template-columns: 1fr; align-items: stretch; }
}
