/* Hero + full-bleed 3D viewer. Minimal chrome over the canvas; settings live in one panel
   (right drawer on desktop, bottom sheet on mobile). */
.immersive-hero { background: var(--bg); color: var(--ink); }
.immersive-hero .hero-content { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: end; gap: var(--s3) var(--s8); padding: var(--s10) var(--inline) var(--s6); }
.immersive-hero .hero-content .eyebrow { grid-column: 1 / -1; margin-bottom: 0; }
.immersive-hero h1 { font-size: clamp(34px, 4vw, 60px); line-height: 1.15; letter-spacing: -.02em; font-weight: 600; text-wrap: balance; }
.hero-intro { display: grid; gap: var(--s3); justify-items: start; padding-bottom: 6px; }
.hero-description { font-size: 18px; line-height: 1.7; color: var(--muted); max-width: 26em; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1) var(--s3); }
.hero-primary { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 var(--s4); border-radius: 999px; background: var(--accent); color: var(--white); font-size: 16px; font-weight: 500; transition: background .15s; }
.hero-primary:hover { background: var(--accent-hover); }
.hero-secondary { display: inline-flex; align-items: center; gap: 6px; min-height: 48px; font-size: 16px; font-weight: 500; color: var(--accent); }
.hero-secondary span { font-size: 20px; line-height: 1; transition: transform .2s var(--ease); }
.hero-secondary:hover span { transform: translateX(3px); }

/* Workspace */
.scene-workspace { --viewer-h: clamp(560px, 82svh, 880px); --scene-bottom-height: 96px; --chrome-inset: max(16px, calc((100% - var(--max)) / 2)); position: relative; isolation: isolate; height: var(--viewer-h); background: #dfe4e2; overflow: hidden; scroll-margin-top: var(--header-height); outline: none; }
.scene-workspace:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.immersive-hero .farm-canvas, .immersive-hero .hero-image { position: absolute; inset: 0 0 auto; width: 100%; height: calc(100% - var(--scene-bottom-height)); }
.immersive-hero .hero-image { object-fit: cover; z-index: 0; opacity: 1; transition: opacity .6s; }
.immersive-hero.scene-ready .hero-image { opacity: 0; }
.immersive-hero.scene-failed .hero-image { opacity: 1; }
.farm-canvas { z-index: 1; opacity: 0; transition: opacity .8s; }
.farm-canvas canvas { display: block; width: 100%; height: 100%; cursor: grab; }
.farm-canvas canvas:active { cursor: grabbing; }
.scene-ready .farm-canvas { opacity: 1; }
.scene-failed .farm-canvas { display: none; }
.scene-camera-transition { position: absolute; inset: 0; background: #dfe4e2; opacity: 0; pointer-events: none; z-index: 2; }
.scene-workspace summary { list-style: none; cursor: pointer; }
.scene-workspace summary::-webkit-details-marker { display: none; }

/* Floating chrome */
.viewer-bar { position: absolute; z-index: 12; top: var(--s2); left: var(--chrome-inset); right: var(--chrome-inset); display: flex; align-items: flex-start; gap: var(--s1); pointer-events: none; }
.viewer-bar > * { pointer-events: auto; }
.chip, .crop-menu > summary, .viewer-settings > summary, #scene-fullscreen, .scene-topline, .crop-cultivation { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 var(--s2); border-radius: 999px; background: rgb(255 255 255 / .9); -webkit-backdrop-filter: blur(14px) saturate(160%); backdrop-filter: blur(14px) saturate(160%); border: 1px solid rgb(16 24 20 / .08); box-shadow: var(--shadow-1); font-size: 14px; font-weight: 500; color: var(--ink); white-space: nowrap; }
.crop-menu > summary:hover, .viewer-settings > summary:hover, #scene-fullscreen:hover { background: var(--white); }
.viewer-settings[open] > summary, .crop-menu[open] > summary { background: var(--ink); color: var(--white); border-color: var(--ink); }
.scene-summary { position: relative; display: flex; align-items: center; gap: var(--s1); min-width: 0; }
.crop-heading { display: none; }
.chip-label { font-size: 12px; font-weight: 500; color: var(--muted); }
.crop-menu[open] .chip-label { color: #c4ccc7; }
.chevron { width: 8px; height: 8px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); margin-left: 2px; transition: transform .2s; }
.crop-menu[open] .chevron { transform: translateY(2px) rotate(-135deg); }
.crop-menu { position: relative; }
.crop-menu:not([open]) > .crop-switch { display: none; }
.crop-switch { position: absolute; top: calc(100% + 8px); left: 0; z-index: 20; width: 220px; display: grid; gap: 2px; padding: 6px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-2); }
.crop-switch button { display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: 0 12px; border-radius: 8px; text-align: left; font-size: 15px; color: var(--ink-2); }
.crop-switch button:hover { background: var(--bg-soft); color: var(--ink); }
.crop-switch button.active { color: var(--accent-ink); font-weight: 600; background: var(--accent-soft); }
.crop-switch button.active::after { content: ""; width: 10px; height: 5px; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(-45deg); }
.crop-cultivation { font-size: 13px; color: var(--muted); font-weight: 400; }
.scene-topline { gap: 8px; font-size: 13px; font-weight: 400; color: var(--ink-2); min-width: 0; max-width: 340px; }
.live-dot { width: 7px; height: 7px; flex-shrink: 0; border-radius: 50%; background: #3f8f63; box-shadow: 0 0 0 3px rgb(63 143 99 / .18); }
.scene-failed .live-dot { background: #b3741e; box-shadow: 0 0 0 3px rgb(179 116 30 / .18); }
#scene-status { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scene-label { display: none; }
.viewer-settings { margin-left: auto; }
#scene-fullscreen { cursor: pointer; }
#scene-fullscreen svg, .viewer-settings > summary svg { flex-shrink: 0; }

/* Settings panel: right drawer */
.viewer-settings:not([open]) > .viewer-settings-body { display: none; }
.viewer-settings-body { position: absolute; z-index: 25; top: 56px; right: 0; width: 400px; max-height: calc(var(--viewer-h) - var(--scene-bottom-height) - 88px); display: flex; flex-direction: column; background: var(--bg); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-2); overflow: hidden; overscroll-behavior: contain; animation: panel-in .18s var(--ease); }
@keyframes panel-in { from { opacity: 0; transform: translateY(-4px); } }
.viewer-settings-heading { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); padding: var(--s2) var(--s2) var(--s1) var(--s3); }
.viewer-settings-heading strong { font-size: 17px; font-weight: 600; }
#viewer-settings-close { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; font-size: 22px; line-height: 1; color: var(--muted); }
#viewer-settings-close:hover { background: var(--bg-soft); color: var(--ink); }
.settings-tabs { --tab-pad: 4px; position: relative; flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; margin: 0 var(--s2); padding-top: 56px; }
.settings-tabs::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 44px; border-radius: 10px; background: var(--bg-sunk); }
.settings-tab { position: absolute; top: var(--tab-pad); height: calc(44px - 2 * var(--tab-pad)); display: flex; align-items: center; justify-content: center; border-radius: 7px; font-size: 13px; font-weight: 500; color: var(--muted); white-space: nowrap; cursor: pointer; transition: background .15s, color .15s, box-shadow .15s; }
.settings-tab:hover { color: var(--ink); }
.settings-route-tab { left: var(--tab-pad); width: calc((100% - 2 * var(--tab-pad)) * .25); }
.scene-more > .settings-tab { left: calc(var(--tab-pad) + (100% - 2 * var(--tab-pad)) * .25); width: calc((100% - 2 * var(--tab-pad)) * .17); }
.facility-panel > .settings-tab { left: calc(var(--tab-pad) + (100% - 2 * var(--tab-pad)) * .42); width: calc((100% - 2 * var(--tab-pad)) * .35); }
.scene-options > .settings-tab { left: calc(var(--tab-pad) + (100% - 2 * var(--tab-pad)) * .77); width: calc((100% - 2 * var(--tab-pad)) * .23); }
.settings-tab-panel[open] > .settings-tab, .settings-tabs:not(:has(details[open])) .settings-route-tab { background: var(--bg); color: var(--ink); box-shadow: 0 1px 3px rgb(16 24 20 / .12); }
.settings-tabs:has(details[open]) .settings-route { display: none; }
.scene-more:not([open]) > .scene-more-body, .facility-panel:not([open]) > .facility-panel-body, .scene-options:not([open]) > .scene-options-body { display: none; }
.scene-controls { display: contents; }
.settings-pane { padding: 0 0 var(--s3); }
.pane-lead { font-size: 13px; line-height: 1.6; color: var(--muted); margin-bottom: 12px; }
.viewer-help { padding: 12px var(--s3); border-top: 1px solid var(--line); font-size: 12px; line-height: 1.6; color: var(--muted); background: var(--bg-soft); }

/* 参观路线 */
.journey-routes { display: grid; gap: var(--s1); }
.journey-routes button { position: relative; display: grid; gap: 2px; min-height: 60px; padding: 10px 44px 10px var(--s2); text-align: left; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); transition: border-color .15s, background .15s; }
.journey-routes button b { font-size: 15px; font-weight: 600; color: var(--ink); }
.journey-routes button small { font-size: 12px; color: var(--muted); }
.journey-routes button:hover { border-color: var(--line-strong); background: var(--bg-soft); }
.journey-routes button::after { content: ""; position: absolute; right: var(--s2); top: 50%; width: 18px; height: 18px; margin-top: -9px; border-radius: 50%; border: 1.5px solid var(--line-strong); box-sizing: border-box; }
.journey-routes button.active, .journey-routes button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.journey-routes button.active::after, .journey-routes button[aria-pressed="true"]::after { border: 5px solid var(--accent); background: var(--white); }
.journey-routes button:disabled { opacity: .45; }
.journey-actions { margin-top: var(--s2); display: grid; gap: 12px; }
.journey-framing, .setting-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); min-height: 44px; font-size: 14px; color: var(--ink-2); }
.journey-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s1); }
.journey-buttons button, .setting-reset, #scene-pause { min-height: 44px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 10px; font-size: 14px; font-weight: 500; color: var(--ink); background: var(--bg); transition: background .15s, border-color .15s; }
.journey-buttons button:hover:not(:disabled), .setting-reset:hover, #scene-pause:hover { background: var(--bg-soft); border-color: var(--ink-2); }
#journey-follow[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }
.scene-workspace select { appearance: none; -webkit-appearance: none; min-width: 148px; height: 40px; padding: 0 36px 0 12px; border: 1px solid var(--line-strong); border-radius: 10px; font-size: 14px; color: var(--ink); cursor: pointer; background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%235b6760' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 12px center; }
.scene-workspace select:hover { border-color: var(--ink-2); }
.scene-workspace option { background: var(--bg); color: var(--ink); }

/* 视角 */
.scene-tabs { display: grid; gap: 0; }
.view-group { display: grid; grid-template-columns: 48px minmax(0, 1fr); align-items: start; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.view-group:last-child { border-bottom: 0; }
.view-group-label { padding-top: 8px; font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .04em; }
.view-group > div { display: flex; flex-wrap: wrap; gap: var(--s1); }
.scene-tabs button { min-height: 36px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: 14px; color: var(--ink-2); background: var(--bg); transition: background .15s, border-color .15s, color .15s; }
.scene-tabs button:hover { border-color: var(--ink-2); color: var(--ink); }
.scene-tabs button.active, .scene-tabs button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--white); }

/* 播放 */
.scene-options-body { display: grid; gap: var(--s1); }
.setting-toggles { display: grid; gap: 0; margin: var(--s1) 0; border-top: 1px solid var(--line); }
.setting-toggles .toggle { position: relative; display: flex; align-items: center; min-height: 52px; padding: 0 60px 0 0; text-align: left; font-size: 14px; color: var(--ink-2); border-bottom: 1px solid var(--line); }
.setting-toggles .toggle::before { content: ""; position: absolute; right: 0; top: 50%; width: 40px; height: 24px; margin-top: -12px; border-radius: 999px; background: var(--line-strong); transition: background .2s; }
.setting-toggles .toggle::after { content: ""; position: absolute; right: 18px; top: 50%; width: 20px; height: 20px; margin-top: -10px; border-radius: 50%; background: var(--white); box-shadow: 0 1px 2px rgb(0 0 0 / .2); transition: transform .2s var(--ease); }
.setting-toggles .toggle[aria-pressed="true"]::before { background: var(--accent); }
.setting-toggles .toggle[aria-pressed="true"]::after { transform: translateX(16px); }
.setting-actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s1); margin-top: var(--s1); }
#scene-pause[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }

/* Bottom strip: progress + stage */
.scene-bottom { position: absolute; z-index: 10; inset: auto 0 0; display: flex; align-items: center; gap: var(--s5); min-height: var(--scene-bottom-height); padding: var(--s2) var(--chrome-inset); background: var(--bg); border-top: 1px solid var(--line); }
.scene-timeline { position: absolute; top: -1px; left: 0; right: 0; height: 2px; overflow: hidden; background: transparent; }
.scene-timeline i { display: block; height: 100%; background: var(--accent); opacity: .5; transform-origin: left; transform: scaleX(0); }
.scene-heading { flex: 0 1 400px; min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: var(--s2); }
.scene-heading h2 { font-size: 16px; font-weight: 600; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scene-heading p { margin-top: 2px; font-size: 13px; line-height: 1.5; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.scene-heading > div { min-width: 0; }
.scene-hint { display: none; }
.journey-playback { flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--s3); }
#journey-play { flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-width: 132px; height: 44px; padding: 0 20px 0 16px; border-radius: 999px; background: var(--accent); color: var(--white); font-size: 15px; font-weight: 500; transition: background .15s; }
#journey-play:hover:not(:disabled) { background: var(--accent-hover); }
#journey-play::before { content: ""; width: 0; height: 0; border-style: solid; border-width: 6px 0 6px 10px; border-color: transparent transparent transparent currentColor; }
#journey-play[aria-pressed="true"]::before { width: 10px; height: 12px; border: 0; border-inline: 3px solid currentColor; box-sizing: border-box; }
.playback-main { flex: 1; min-width: 0; }
.playback-track { display: block; }
#journey-seek { display: block; width: 100%; height: 20px; margin: 0; accent-color: var(--accent); cursor: pointer; }
#journey-seek:disabled { cursor: default; opacity: .55; }
.playback-heading { display: flex; align-items: center; gap: 12px; margin-top: 2px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
#journey-current { flex: 1; min-width: 0; font-weight: 500; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#journey-percent { min-width: 36px; text-align: right; }
.scene-workspace .sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip-path: inset(50%) !important; white-space: nowrap !important; border: 0 !important; }
#viewer-resume { position: absolute; z-index: 11; right: var(--chrome-inset); bottom: calc(var(--scene-bottom-height) + var(--s2)); height: 40px; padding: 0 var(--s2); border-radius: 999px; background: var(--ink); color: var(--white); font-size: 14px; font-weight: 500; box-shadow: var(--shadow-2); }
#scene-retry { position: absolute; z-index: 11; left: 50%; top: calc((100% - var(--scene-bottom-height)) / 2); transform: translate(-50%, -50%); height: 48px; padding: 0 var(--s3); border-radius: 999px; background: var(--accent); color: var(--white); font-size: 15px; font-weight: 500; box-shadow: var(--shadow-2); }
.immersive-hero > .concept-caption { padding: var(--s2) var(--inline) 0; max-width: none; }

/* Fullscreen / expanded */
.scene-workspace:fullscreen, .scene-workspace.is-expanded { --viewer-h: 100dvh; height: 100dvh; width: 100%; }
.scene-workspace.is-expanded { position: fixed; inset: 0; z-index: 70; }
.scene-workspace:fullscreen .crop-cultivation, .scene-workspace.is-expanded .crop-cultivation { display: inline-flex; }

@media (max-width: 1100px) {
  .crop-cultivation { display: none; }
  .scene-heading { flex-basis: 300px; }
}
@media (max-width: 900px) {
  .immersive-hero .hero-content { grid-template-columns: 1fr; padding-top: var(--s8); padding-bottom: var(--s4); }
  .scene-topline { display: none; }
}
@media (max-width: 760px) {
  .immersive-hero .hero-content { padding-top: var(--s5); gap: var(--s2); }
  .immersive-hero h1 { font-size: 32px; line-height: 1.2; }
  .hero-intro { gap: var(--s2); }
  .hero-description { font-size: 15px; }
  .hero-primary { min-height: 44px; padding: 0 var(--s3); font-size: 15px; }
  .hero-secondary { min-height: 44px; font-size: 15px; }
  .scene-workspace { --viewer-h: clamp(540px, 80svh, 720px); --scene-bottom-height: 140px; --chrome-inset: 12px; }
  .viewer-bar { top: 12px; gap: 6px; }
  .crop-menu > summary, .viewer-settings > summary, #scene-fullscreen { height: 44px; padding: 0 14px; font-size: 14px; }
  .chip-label { display: none; }
  #scene-fullscreen { width: 44px; padding: 0; justify-content: center; font-size: 0; gap: 0; }
  .scene-bottom { flex-direction: column; align-items: stretch; gap: 10px; padding: 12px var(--chrome-inset) 14px; }
  .scene-heading { flex: none; }
  .scene-heading h2 { font-size: 15px; }
  .scene-heading p { font-size: 12px; -webkit-line-clamp: 1; }
  .journey-playback { gap: 12px; }
  #journey-play { min-width: 0; height: 44px; padding: 0 16px 0 14px; font-size: 14px; }
  .playback-heading { font-size: 12px; gap: 8px; }
  #journey-percent { display: none; }
  /* Bottom sheet */
  .viewer-settings-body { position: fixed; z-index: 80; inset: auto 0 0 0; top: auto; width: 100%; max-height: min(78dvh, calc(100dvh - 72px)); border-radius: 20px 20px 0 0; border-width: 1px 0 0; animation: sheet-in .22s var(--ease); padding-bottom: env(safe-area-inset-bottom); }
  .viewer-settings-body::before { content: ""; display: block; width: 36px; height: 4px; margin: 8px auto 0; border-radius: 4px; background: var(--line-strong); }
  .immersive-hero:has(.viewer-settings[open]), .scene-workspace:has(.viewer-settings[open]) { z-index: 40; }
  .viewer-settings[open]::after { content: ""; position: fixed; inset: 0; z-index: 79; background: rgb(10 16 13 / .32); }
  .viewer-settings-heading { padding-top: var(--s1); }
  .settings-tab { font-size: 13px; }
  .journey-routes button, .scene-tabs button, .journey-buttons button { min-height: 44px; }
  .crop-switch { width: min(240px, calc(100vw - 24px)); }
  .crop-switch button { min-height: 48px; }
}
@keyframes sheet-in { from { transform: translateY(24px); opacity: 0; } }
@media (max-height: 560px) {
  .scene-workspace:fullscreen, .scene-workspace.is-expanded { --scene-bottom-height: 72px; }
  .scene-workspace:fullscreen .scene-heading, .scene-workspace.is-expanded .scene-heading { display: none; }
  .scene-workspace:fullscreen .scene-bottom, .scene-workspace.is-expanded .scene-bottom { flex-direction: row; padding-block: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .farm-canvas, .immersive-hero .hero-image { transition: none; }
  .viewer-settings-body { animation: none; }
}

/* AI dispatch console: fleet KPIs, unit status and the fault/self-repair log. */
.ai-console { position: absolute; z-index: 4; left: var(--chrome-inset); bottom: calc(var(--scene-bottom-height) + 16px); width: min(340px, calc(100% - 2 * var(--chrome-inset))); max-height: calc(var(--viewer-h) - var(--scene-bottom-height) - 96px); display: flex; flex-direction: column; background: rgba(255,255,255,.9); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid rgba(23,43,37,.1); border-radius: 14px; box-shadow: 0 12px 32px rgba(18,38,32,.14); font-size: 12px; color: #1d2b27; overflow: hidden; }
.ai-head { display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px 14px; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.ai-head:focus-visible { outline: 2px solid #2f6f5b; outline-offset: -2px; border-radius: 14px; }
.ai-head strong { font-size: 13px; }
.ai-head #ai-summary { margin-left: auto; color: #5c6b66; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 170px; }
.ai-dot { width: 8px; height: 8px; border-radius: 50%; background: #2f8a5b; box-shadow: 0 0 0 3px rgba(47,138,91,.18); flex: none; }
.ai-console[data-alert="true"] .ai-dot { background: #c9772d; box-shadow: 0 0 0 3px rgba(201,119,45,.2); }
.ai-body { padding: 0 14px 12px; overflow: auto; }
.ai-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 0 0 10px; }
.ai-kpis div { background: #f2f5f3; border-radius: 8px; padding: 6px 8px; }
.ai-kpis dt { color: #6b7a75; font-size: 11px; }
.ai-kpis dd { margin: 2px 0 0; font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums; }
.ai-units { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 4px; }
.ai-units li { display: grid; grid-template-columns: 64px 1fr; gap: 8px; align-items: baseline; }
.ai-units b { font-weight: 600; color: #26473d; }
.ai-units span { color: #44524e; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-log { list-style: none; margin: 0; padding: 8px 0 0; border-top: 1px solid rgba(23,43,37,.08); display: grid; gap: 4px; }
.ai-log li { display: grid; grid-template-columns: 38px 34px 1fr; gap: 6px; line-height: 1.4; color: #3a4844; }
.ai-log time { color: #8a9893; font-variant-numeric: tabular-nums; }
.ai-log em { font-style: normal; font-weight: 600; border-radius: 4px; text-align: center; font-size: 11px; padding: 0 2px; }
.ai-log [data-kind="故障"] em, .ai-log [data-kind="Fault"] em { color: #b3402b; background: #fbe9e5; }
.ai-log [data-kind="自愈"] em, .ai-log [data-kind="Self-recovery"] em { color: #9a5b12; background: #fbf0dc; }
.ai-log [data-kind="恢复"] em, .ai-log [data-kind="Recovered"] em { color: #23784c; background: #e3f3ea; }
.ai-log [data-kind="避让"] em, .ai-log [data-kind="Yielding"] em { color: #2a6a8f; background: #e3eef6; }
.ai-log [data-kind="调度"] em, .ai-log [data-kind="Dispatch"] em { color: #4d5c57; background: #edf1ef; }
.scene-failed .ai-console { display: none; }
.ai-console[data-collapsed="true"] .ai-body { display: none; }
@media (max-width: 760px) {
  .ai-console { width: auto; right: var(--chrome-inset); bottom: calc(var(--scene-bottom-height) + 10px); max-height: 46%; }
  .ai-console[data-collapsed="true"] { right: auto; }
  .ai-kpis { grid-template-columns: repeat(3, 1fr); }
}
