:root {
  --bg-dark: #0f1117;
  --bg-panel: #181a20;
  --bg-card: #1e2028;
  --bg-hover: #252830;
  --border: #2a2d37;
  --text: #e1e3e8;
  --text-dim: #8b8fa3;
  --accent: #3b82f6;
  --accent-dim: #1d4ed8;
  --green: #22c55e;
  --green-dim: #166534;
  --red: #ef4444;
  --red-dim: #991b1b;
  --yellow: #eab308;
  --yellow-dim: #854d0e;
  --orange: #f97316;
  --cyan: #06b6d4;
  --purple: #a855f7;
  --radius: 8px;
  --font: 'SF Mono', 'Cascadia Code', 'JetBrains Mono', 'Fira Code', monospace;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: var(--font); background: var(--bg-dark); color: var(--text); font-size: 13px; line-height: 1.5; }
.topbar { display: flex; align-items: center; justify-content: space-between; height: 48px; padding: 0 20px; background: var(--bg-panel); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.topbar-left { display: flex; align-items: center; gap: 16px; }
.logo { font-size: 15px; font-weight: 700; letter-spacing: -0.5px; }
.logo span { color: var(--accent); }
.conn-status { display: flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.conn-status.connected { background: var(--green-dim); color: var(--green); }
.conn-status.disconnected { background: var(--red-dim); color: var(--red); }
.conn-dot { width: 7px; height: 7px; border-radius: 50%; animation: pulse 2s infinite; }
.conn-status.connected .conn-dot { background: var(--green); }
.conn-status.disconnected .conn-dot { background: var(--red); }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-info { font-size: 11px; color: var(--text-dim); padding: 4px 10px; background: var(--bg-card); border-radius: 4px; }
.tabs { display: flex; background: var(--bg-panel); border-bottom: 1px solid var(--border); padding: 0 20px; }
.tab { padding: 10px 20px; cursor: pointer; color: var(--text-dim); font-size: 12px; font-weight: 600; border-bottom: 2px solid transparent; transition: all 0.15s; letter-spacing: 0.3px; text-transform: uppercase; user-select: none; }
.tab:hover { color: var(--text); background: var(--bg-hover); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.page { display: none; padding: 20px; }
.page.active { display: block; }
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.card-header { padding: 12px 16px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card-body { padding: 16px; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; }
.stat-label { font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.stat-value { font-size: 28px; font-weight: 700; }
.stat-value.green { color: var(--green); }
.stat-value.blue { color: var(--accent); }
.stat-value.yellow { color: var(--yellow); }
.feed { max-height: 400px; overflow-y: auto; }
.feed-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 12px; }
.feed-item:last-child { border-bottom: none; }
.feed-time { color: var(--text-dim); white-space: nowrap; min-width: 70px; }
.feed-dir { font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 3px; min-width: 28px; text-align: center; }
.feed-dir.tx { background: var(--accent-dim); color: var(--accent); }
.feed-dir.rx { background: var(--green-dim); color: var(--green); }
.feed-sf { color: var(--cyan); font-weight: 600; min-width: 50px; }
.feed-desc { color: var(--text-dim); flex: 1; }
.feed-badge { font-size: 10px; padding: 1px 6px; border-radius: 3px; font-weight: 600; white-space: nowrap; }
.feed-badge.pass { background: var(--green-dim); color: var(--green); }
.feed-badge.fail { background: var(--red-dim); color: var(--red); }
.feed-badge.warn { background: var(--yellow-dim); color: var(--yellow); }
.btn { padding: 8px 20px; border: none; border-radius: var(--radius); font-family: var(--font); font-size: 12px; font-weight: 600; cursor: pointer; transition: all 0.15s; }
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: #2563eb; }
.btn-ghost { background: var(--bg-card); color: var(--text-dim); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text); }
.btn-sm { padding: 6px 12px; font-size: 11px; }
.send-status { margin-top: 12px; padding: 8px 12px; border-radius: var(--radius); font-size: 12px; min-height: 16px; font-family: var(--font); }
.send-status.success { background: var(--green-dim); color: var(--green); }
.send-status.error { background: var(--red-dim); color: var(--red); }
.send-status.info { background: rgba(96, 165, 250, 0.12); color: var(--accent); }
.sim-send-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .sim-send-grid { grid-template-columns: 1fr; } }
.sim-send-controls textarea.editor { min-height: 160px; }
.sim-feed { padding: 12px; background: var(--bg-dark); border: 1px solid var(--border); border-radius: var(--radius); max-height: 420px; min-height: 280px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.sim-msg { padding: 8px 12px; border-radius: var(--radius); max-width: 85%; font-size: 11px; }
.sim-msg.tx { align-self: flex-end; background: var(--accent-dim); border: 1px solid var(--accent); }
.sim-msg.rx { align-self: flex-start; background: var(--green-dim); border: 1px solid var(--green); }
.sim-msg-meta { display: flex; justify-content: space-between; gap: 12px; font-size: 10px; margin-bottom: 4px; font-weight: 700; }
.sim-msg.tx .sim-msg-meta { color: var(--accent); }
.sim-msg.rx .sim-msg-meta { color: var(--green); }
.sim-msg-time { color: var(--text-dim); font-weight: 400; }
.sim-msg-body { color: var(--text); white-space: pre-wrap; word-break: break-all; line-height: 1.4; }
.sim-msg-body-empty { color: var(--text-dim); font-style: italic; font-size: 10px; opacity: 0.7; }
.quick-btns { display: flex; flex-direction: column; gap: 4px; }
.quick-btn { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 8px 12px; background: none; border: none; color: var(--text); cursor: pointer; font-size: 12px; font-family: var(--font); border-radius: 4px; transition: background 0.1s; }
.quick-btn:hover { background: var(--bg-hover); }
.quick-btn.active { background: var(--accent-dim); border: 1px solid var(--accent); }
.quick-btn .sf { color: var(--cyan); font-weight: 600; min-width: 48px; }
.sim-feed-wrap { display: flex; flex-direction: column; min-height: 0; }
.sim-feed-header { display: flex; align-items: center; justify-content: space-between; padding: 6px 10px; background: var(--bg-dark); border: 1px solid var(--border); border-bottom: none; border-radius: var(--radius) var(--radius) 0 0; gap: 12px; flex-wrap: wrap; }
.sim-feed-counts { display: flex; gap: 8px; font-size: 11px; font-family: var(--font); }
.sim-feed-count { padding: 2px 8px; border-radius: 10px; font-weight: 600; }
.sim-feed-count.tx { background: var(--accent-dim); color: var(--accent); }
.sim-feed-count.rx { background: var(--green-dim); color: var(--green); }
.sim-feed-filters { display: flex; gap: 4px; align-items: center; }
.sim-filter-btn { background: transparent; border: 1px solid var(--border); color: var(--text-dim); padding: 2px 8px; border-radius: 10px; font-size: 11px; cursor: pointer; font-family: var(--font); transition: all 0.1s; }
.sim-filter-btn:hover { color: var(--text); }
.sim-filter-btn.active { background: var(--bg-hover); color: var(--text); border-color: var(--text-dim); }
.sim-feed-clear { background: transparent; border: 1px solid var(--border); color: var(--text-dim); padding: 2px 10px; border-radius: 10px; font-size: 11px; cursor: pointer; font-family: var(--font); margin-left: 8px; }
.sim-feed-clear:hover { color: var(--red); border-color: var(--red); }
.sim-feed-wrap .sim-feed { border-radius: 0 0 var(--radius) var(--radius); border-top: none; }
.sim-layout { display: grid; grid-template-columns: 260px 1fr; gap: 16px; }
@media (max-width: 640px) {
  .sim-layout { grid-template-columns: 1fr; }
  .topbar { padding: 0 12px; height: 44px; }
  .topbar-left { gap: 8px; }
  .topbar-info { display: none; }
  .conn-status { padding: 3px 8px; font-size: 10px; }
  .logo { font-size: 14px; }
  .lang-switch { padding: 1px; }
  .lang-btn { padding: 3px 6px; font-size: 9px; }
  .tabs { padding: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { padding: 10px 14px; font-size: 11px; flex-shrink: 0; }
  .page { padding: 12px; }
  .stat-grid { grid-template-columns: 1fr; gap: 8px; margin-bottom: 12px; }
}
.sim-sidebar { display: flex; flex-direction: column; gap: 12px; }
.fault-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fault-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 12px; background: var(--bg-dark); border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; transition: all 0.15s; font-family: var(--font); color: var(--text); }
.fault-btn:hover { border-color: var(--red); background: var(--red-dim); }
.fault-btn .fault-name { font-size: 12px; font-weight: 600; }
.fault-btn .fault-desc { font-size: 10px; color: var(--text-dim); }
.editor-area { background: var(--bg-dark); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; min-height: 200px; font-size: 13px; color: var(--cyan); line-height: 1.8; white-space: pre-wrap; }
textarea.editor { width: 100%; min-height: 200px; background: var(--bg-dark); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; font-family: var(--font); font-size: 13px; color: var(--cyan); resize: vertical; outline: none; }
textarea.editor:focus { border-color: var(--accent); }
.send-bar { display: flex; gap: 8px; margin-top: 12px; }
.val-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.check-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 12px; }
.check-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex: 1; min-width: 0; }
.val-stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; padding: 16px; border-bottom: 1px solid var(--border); }
.val-stat { background: var(--bg-dark); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; }
.val-stat-num { font-size: 26px; font-weight: 700; line-height: 1.1; }
.val-stat-label { font-size: 10px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 4px; }
.val-stat.pass .val-stat-num { color: var(--green); }
.val-stat.warn .val-stat-num { color: var(--yellow); }
.val-stat.fail .val-stat-num { color: var(--red); }
.val-stat.total .val-stat-num { color: var(--accent); }
.val-count { display: inline-block; padding: 2px 8px; background: var(--bg-hover); color: var(--text-dim); font-size: 10px; border-radius: 10px; font-weight: 700; flex-shrink: 0; }
@media (max-width: 640px) { .val-stat-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 10px; } .val-stat-num { font-size: 22px; } }
.check-item:last-child { border-bottom: none; }
.check-icon { width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; flex-shrink: 0; }
.check-icon.pass { background: var(--green-dim); color: var(--green); }
.check-icon.fail { background: var(--red-dim); color: var(--red); }
.check-icon.warn { background: var(--yellow-dim); color: var(--yellow); }
.check-text { flex: 1; }
.check-detail { color: var(--text-dim); font-size: 11px; }
.report-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.report-stat { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; text-align: center; }
.report-stat .num { font-size: 36px; font-weight: 700; }
.report-stat .label { font-size: 11px; color: var(--text-dim); margin-top: 4px; }
.coverage-bar-container { margin-bottom: 12px; }
.coverage-label { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 4px; }
.coverage-bar { height: 8px; background: var(--bg-dark); border-radius: 4px; overflow: hidden; }
.coverage-fill { height: 100%; border-radius: 4px; transition: width 0.5s ease; }
.sf-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.sf-table th { text-align: left; padding: 8px 12px; font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-dim); border-bottom: 1px solid var(--border); }
.sf-table td { padding: 8px 12px; border-bottom: 1px solid var(--border); }
.sf-table tr:hover { background: var(--bg-hover); }
.impl-badge { font-size: 10px; padding: 2px 8px; border-radius: 3px; font-weight: 600; }
.impl-badge.full { background: var(--green-dim); color: var(--green); }
.impl-badge.partial { background: var(--yellow-dim); color: var(--yellow); }
.impl-badge.none { background: var(--bg-dark); color: var(--text-dim); }
.empty-state { text-align: center; padding: 40px; color: var(--text-dim); }
.disclaimer { padding: 20px; text-align: center; font-size: 10px; color: var(--text-dim); border-top: 1px solid var(--border); margin-top: 20px; }
.tab-badge { display: inline-block; margin-left: 6px; padding: 1px 6px; background: linear-gradient(135deg, var(--purple), var(--cyan)); color: white; border-radius: 8px; font-size: 9px; font-weight: 700; letter-spacing: 0.5px; vertical-align: middle; }
.lang-switch { display: flex; gap: 1px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 4px; padding: 2px; }
.lang-btn { padding: 3px 8px; background: transparent; border: none; color: var(--text-dim); font-size: 10px; font-weight: 700; cursor: pointer; border-radius: 3px; font-family: var(--font); letter-spacing: 0.5px; transition: all 0.15s; }
.lang-btn:hover { color: var(--text); }
.lang-btn.active { background: var(--accent); color: white; }
.chat-block { display: flex; flex-direction: column; gap: 8px; }
.chat-body { padding: 0; display: flex; flex-direction: column; }
.chat-suggestions { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.chat-chip { padding: 6px 12px; background: var(--bg-dark); border: 1px solid var(--border); border-radius: 16px; color: var(--text); font-family: var(--font); font-size: 11px; cursor: pointer; transition: all 0.15s; }
.chat-chip:hover { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }
.chat-feed { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.chat-msg { display: flex; gap: 10px; align-items: flex-start; }
.chat-msg.user { flex-direction: row-reverse; }
.chat-avatar { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; flex-shrink: 0; letter-spacing: 0.3px; }
.chat-avatar.user { background: var(--accent-dim); color: var(--accent); border: 1px solid var(--accent); }
.chat-avatar.bot { background: linear-gradient(135deg, var(--purple), var(--cyan)); color: white; box-shadow: 0 0 12px rgba(168, 85, 247, 0.3); }
.chat-bubble { padding: 10px 14px; border-radius: 12px; max-width: 78%; font-size: 12px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; background: var(--bg-dark); border: 1px solid var(--border); }
.chat-msg.user .chat-bubble { background: var(--accent-dim); border-color: var(--accent); }
.chat-msg.bot .chat-bubble.chat-success { border-color: var(--green); background: rgba(34, 197, 94, 0.06); }
.chat-msg.bot .chat-bubble.chat-error { border-color: var(--red); background: rgba(239, 68, 68, 0.06); }
.chat-bubble.streaming::after { content: '▌'; color: var(--accent); animation: chat-blink 1s infinite; margin-left: 2px; }
.chat-bubble.thinking { color: var(--text-dim); font-style: italic; }
@keyframes chat-blink { 0%, 50% { opacity: 1; } 50.01%, 100% { opacity: 0; } }
.chat-input-bar { display: flex; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
#chat-input { flex: 1; padding: 9px 12px; background: var(--bg-dark); border: 1px solid var(--border); color: var(--text); border-radius: var(--radius); font-family: var(--font); font-size: 13px; }
#chat-input:focus { outline: none; border-color: var(--accent); }
#chat-input:disabled { opacity: 0.5; }
#chat-send-btn:disabled { opacity: 0.5; cursor: not-allowed; }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #3a3d47; }

.dash-scenarios { display: flex; align-items: center; gap: 8px; padding: 12px 14px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 12px; flex-wrap: wrap; }
.dash-scenarios-label { color: var(--text-dim); font-size: 12px; font-weight: 600; margin-right: 4px; }
.scenario-btn { background: var(--bg-dark); color: var(--text); border: 1px solid var(--border); padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; cursor: pointer; font-family: var(--font); transition: all 0.15s; }
.scenario-btn:hover:not(:disabled) { transform: translateY(-1px); }
.scenario-btn.happy:hover:not(:disabled) { border-color: var(--green); color: var(--green); box-shadow: 0 2px 8px rgba(34, 197, 94, 0.25); }
.scenario-btn.pause:hover:not(:disabled) { border-color: var(--yellow); color: var(--yellow); box-shadow: 0 2px 8px rgba(234, 179, 8, 0.25); }
.scenario-btn.abort:hover:not(:disabled) { border-color: var(--red); color: var(--red); box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25); }
.scenario-btn.running { background: var(--accent-dim); border-color: var(--accent); color: white; }
.scenario-btn:disabled { opacity: 0.5; cursor: progress; }
.scenario-status { color: var(--text-dim); font-size: 11px; font-style: italic; margin-left: auto; }

/* Dashboard equipment-state visualization */
.state-row { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; }
.state-pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; background: var(--bg-dark); border: 1px solid var(--border); border-radius: 999px; font-size: 12px; }
.state-pill .state-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--text-dim); flex-shrink: 0; }
.state-pill .state-label { color: var(--text-dim); font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; }
.state-pill .state-value { color: var(--text); font-weight: 600; font-family: var(--font); }
.state-process-idle .state-dot { background: var(--text-dim); }
.state-process-executing .state-dot { background: var(--green); box-shadow: 0 0 8px rgba(34, 197, 94, 0.6); }
.state-process-pause .state-dot { background: var(--yellow); }
.state-process-executing { border-color: var(--green); }
.state-process-pause { border-color: var(--yellow); }
.state-online .state-dot { background: var(--green); box-shadow: 0 0 6px rgba(34, 197, 94, 0.5); }
.state-offline .state-dot { background: var(--red); }
.state-alarm-active { border-color: var(--red); }
.state-alarm-active .state-dot { background: var(--red); box-shadow: 0 0 8px rgba(239, 68, 68, 0.6); }
.state-alarm-clear .state-dot { background: var(--green); }
#state-recipe { border-color: var(--accent); }

.substrate-journey { padding: 12px 8px; background: var(--bg-dark); border: 1px solid var(--border); border-radius: var(--radius); }
.substrate-title { color: var(--text-dim); font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 16px; padding-left: 4px; }
.journey-track { display: flex; align-items: center; gap: 6px; padding: 0 8px; }
.journey-stop { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 70px; flex: 0 0 auto; }
.journey-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--bg-card); border: 2px solid var(--border); transition: all 0.3s; }
.journey-stop.reached .journey-dot { background: var(--green); border-color: var(--green); }
.journey-stop.active .journey-dot { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 12px rgba(59, 130, 246, 0.6); transform: scale(1.3); }
.journey-label { color: var(--text-dim); font-size: 11px; }
.journey-stop.active .journey-label { color: var(--accent); font-weight: 600; }
.journey-stop.reached .journey-label { color: var(--green); }
.journey-line { flex: 1; height: 2px; background: var(--border); margin-top: -20px; }

.jobs-tree { font-family: var(--font); font-size: 12px; min-height: 80px; }
.job-cj { padding: 8px 10px; background: var(--accent-dim); border: 1px solid var(--accent); border-radius: var(--radius); margin-bottom: 8px; }
.job-children { margin-top: 8px; padding-left: 16px; border-left: 2px dashed var(--accent); }
.job-pj { padding: 6px 10px; background: rgba(34, 197, 94, 0.08); border: 1px solid var(--green); border-radius: var(--radius); margin-top: 4px; display: inline-block; margin-right: 4px; }
.job-icon { background: var(--accent); color: white; padding: 2px 6px; border-radius: 4px; font-size: 10px; font-weight: 700; margin-right: 8px; }
.job-icon.pj { background: var(--green); }
.job-id { color: var(--text); font-weight: 600; }
.job-orphan-hint { color: var(--yellow); font-size: 11px; margin-top: 8px; padding: 6px 10px; background: rgba(234, 179, 8, 0.08); border-left: 3px solid var(--yellow); }

.activity-list { display: flex; flex-direction: column; gap: 4px; max-height: 320px; overflow-y: auto; font-family: var(--font); }
.ev-row { display: flex; align-items: center; gap: 10px; padding: 6px 10px; background: var(--bg-dark); border-radius: 4px; font-size: 12px; }
.ev-time { color: var(--text-dim); font-size: 10px; min-width: 60px; }
.ev-type { font-weight: 700; padding: 2px 8px; border-radius: 4px; font-size: 10px; }
.ev-processstart, .ev-processresume { background: var(--green-dim); color: var(--green); }
.ev-processstop, .ev-processpause { background: var(--yellow-dim, rgba(234, 179, 8, 0.18)); color: var(--yellow); }
.ev-processabort, .ev-alarmraised { background: var(--red-dim); color: var(--red); }
.ev-controljobcreate, .ev-processjobcreate, .ev-carrierbound { background: var(--accent-dim); color: var(--accent); }
.ev-recipeselect, .ev-clocksync, .ev-collectionevent, .ev-alarmacked, .ev-controlstatechange { background: var(--bg-card); color: var(--text-dim); }
.ev-detail { color: var(--text-dim); font-size: 11px; }

.dash-action-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; }
.dash-action-row .dash-chat-card { display: flex; flex-direction: column; min-height: 480px; }
.dash-action-row .dash-chat-card .card-body.chat-body { flex: 1; min-height: 0; padding: 0; display: flex; flex-direction: column; }
.dash-action-row .chat-suggestions { padding: 10px 14px; max-height: 110px; overflow-y: auto; }
.dash-action-row .chat-feed { flex: 1; min-height: 200px; }
.dash-side-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.dash-side-col .card { flex: 1; }

@media (max-width: 768px) {
  .state-row { gap: 8px; }
  .state-pill { padding: 6px 10px; font-size: 11px; }
  .journey-track { flex-direction: column; align-items: stretch; gap: 4px; padding: 0; }
  .journey-line { width: 2px; height: 24px; margin: 0 auto; }
  .journey-stop { min-width: 0; flex-direction: row; gap: 12px; padding: 4px 0; }
  .dash-row { grid-template-columns: 1fr !important; }
  .dash-action-row { grid-template-columns: 1fr; }
}

/* --- 後端冷啟動提示 --- */
/* Render 上的後端閒置會休眠，第一個請求要等 30 到 60 秒。沒有這個提示時
   畫面只有紅字 DISCONNECTED，使用者會以為服務掛了。 */
.cold-start-banner {
  position: fixed;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  padding: 6px 14px;
  background: rgba(30, 41, 59, 0.94);
  color: #f1f5f9;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 999px;
  font-size: 12.5px;
  line-height: 1.3;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}
.cold-start-banner[hidden] { display: none; }
.cold-start-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fbbf24;
  flex: none;
  animation: cold-start-pulse 1.2s ease-in-out infinite;
}
@keyframes cold-start-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}
@media (max-width: 640px) {
  .cold-start-banner { font-size: 12px; padding: 5px 12px; max-width: 92vw; text-align: center; }
}

/* --- 非英文首次繪製 --- */
/* lang-boot.js 在 i18n.js 換好字之前掛上這個 class，避免先畫英文再換字造成版面位移 */
html.i18n-pending body { visibility: hidden; }
