:root { color-scheme: dark; }
* { box-sizing: border-box; }
body { font-family: Arial, sans-serif; margin: 1rem; background: #111827; color: #f9fafb; }
h1, h2 { margin: 0.4rem 0; overflow-wrap: anywhere; }
.header { margin-bottom: 1rem; }
.controls { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }
button, .button-link { padding: 0.45rem 0.75rem; border-radius: 6px; border: 1px solid #4b5563; background: #1f2937; color: #f9fafb; cursor: pointer; }
.checkbox-row { font-size: 0.9rem; }
.meta { color: #9ca3af; font-size: 0.9rem; }
.meta.health { font-weight: 700; color: #d1d5db; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 0.75rem; align-items: start; }
.panel { min-width: 0; background: #1f2937; border: 1px solid #374151; border-left-width: 6px; border-radius: 8px; padding: 0.75rem; overflow: hidden; position: relative; }
.panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.35rem; cursor: default; }
.panel-header h2 { min-width: 0; flex: 1 1 auto; }
.panel-toggle { flex: 0 0 auto; padding: 0.25rem 0.55rem; font-size: 0.78rem; }
.panel-preview { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.panel-collapsed .panel-preview { max-height: 22rem; overflow: auto; padding-right: 0.25rem; }
.panel-collapsed::after { content: ""; pointer-events: none; position: absolute; left: 0.75rem; right: 0.75rem; bottom: 0.75rem; height: 2.2rem; border-radius: 0 0 8px 8px; background: linear-gradient(to bottom, rgba(31, 41, 55, 0), #1f2937 85%); }
.panel-expanded .panel-preview { max-height: none; overflow: visible; }
.panel-badges, .summary-badges { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.4rem; }
.pill, .severity-pill { display: inline-flex; align-items: center; max-width: 100%; padding: 0.12rem 0.45rem; border-radius: 999px; border: 1px solid #4b5563; font-size: 0.78rem; margin-right: 0.35rem; margin-bottom: 0.35rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-pill { background: #111827; }
.severity-critical { border-left-color: #ef4444; background: #2c1417; }
.severity-warning { border-left-color: #f59e0b; background: #2b2416; }
.severity-ok { border-left-color: #22c55e; }
.severity-info { border-left-color: #38bdf8; }
.severity-unknown { border-left-color: #9ca3af; }
.severity-pill.severity-critical { color: #fecaca; }
.severity-pill.severity-warning { color: #fde68a; }
.severity-pill.severity-ok { color: #bbf7d0; }
.severity-pill.severity-info { color: #bae6fd; }
.severity-pill.severity-unknown { color: #d1d5db; }
.table-wrap { overflow: auto; max-width: 100%; }
.panel-collapsed .table-wrap { max-height: 14rem; }
table { width: 100%; border-collapse: collapse; margin-top: 0.4rem; table-layout: fixed; min-width: min(760px, 100%); }
th, td { border-top: 1px solid #374151; padding: 0.35rem; vertical-align: top; font-size: 0.88rem; text-align: left; white-space: normal; overflow-wrap: anywhere; }
td { max-width: 26rem; }
.cell-main { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; overflow-wrap: anywhere; vertical-align: top; }
.cell-muted { display: block; color: #9ca3af; font-size: 0.76rem; letter-spacing: 0.01em; text-transform: none; }
.panel-details, .row-details { margin-top: 0.45rem; }
.panel-details summary, .row-details summary { cursor: pointer; color: #93c5fd; }
.small { font-size: 0.82rem; }
.debug { overflow-wrap: anywhere; }
.muted { color: #9ca3af; }
.empty { color: #d1d5db; font-style: italic; }
.operator-list, .lane-card-grid { display: grid; gap: 0.55rem; margin-top: 0.5rem; min-width: 0; }
.panel-collapsed .operator-list, .panel-collapsed .lane-card-grid, .panel-collapsed .status-card-grid, .panel-collapsed .action-card-grid { max-height: 14rem; overflow: auto; padding-right: 0.25rem; }
.lane-card-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.operator-card, .lane-card { min-width: 0; border: 1px solid #374151; border-left-width: 5px; border-radius: 8px; background: #172033; padding: 0.65rem; overflow: hidden; }
.card-topline { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 0.45rem; }
.card-topline strong { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 0.45rem; }
.lane-detail-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.card-reason, .card-action { margin: 0.45rem 0 0; overflow-wrap: anywhere; }
pre { max-width: 100%; white-space: pre-wrap; word-break: break-word; background: #111827; border: 1px solid #374151; border-radius: 6px; padding: 0.6rem; overflow: auto; }
@media (min-width: 1800px) {
  .grid { grid-template-columns: repeat(auto-fit, minmax(520px, 1fr)); }
  .lane-card-grid { grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); }
}
.status-card-grid, .action-card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 0.55rem; margin-top: 0.5rem; min-width: 0; }
.status-card { min-width: 0; border: 1px solid #374151; border-left-width: 5px; border-radius: 8px; background: #172033; padding: 0.65rem; overflow: hidden; }
.status-card .detail-grid { margin-top: 0.45rem; }
.copy-status { margin-left: 0.35rem; }

.snapshot-status { min-width: 8rem; }
.deploy-status { min-width: min(100%, 18rem); overflow-wrap: anywhere; }
.update-link:disabled { opacity: 0.6; cursor: wait; }
.snapshot-note { border: 1px solid #374151; border-left: 5px solid #38bdf8; background: #172033; border-radius: 8px; padding: 0.65rem; margin: 0.6rem 0; }
@media print {
  body { background: #fff; color: #111827; }
  .panel, .operator-card, .lane-card, .status-card, pre, .snapshot-note { background: #fff; color: #111827; border-color: #9ca3af; }
  button, .button-link, .checkbox-row { display: none !important; }
  .grid { display: block; }
  .panel { break-inside: avoid; margin-bottom: 0.75rem; }
  .panel-collapsed .panel-preview { max-height: none; overflow: visible; }
  .panel-collapsed::after { display: none; }
}

.update-link { display: inline-flex; align-items: center; text-decoration: none; }

.command-help-grid { display: grid; gap: 0.75rem; margin-top: 0.6rem; }
.command-help-category { border: 1px solid #374151; border-left: 5px solid #38bdf8; border-radius: 8px; background: #172033; padding: 0.7rem; min-width: 0; }
.command-help-category h3 { margin-bottom: 0.35rem; }
.command-help-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 0.55rem; margin-top: 0.55rem; }
.command-help-card { min-width: 0; border: 1px solid #4b5563; border-radius: 8px; background: #111827; padding: 0.6rem; }
.command-help-card-top { display: flex; align-items: center; gap: 0.45rem; flex-wrap: wrap; margin-bottom: 0.45rem; }
.command-help-card-top strong { flex: 1 1 12rem; min-width: 0; overflow-wrap: anywhere; }
.command-help-card pre { margin: 0; max-height: 16rem; }
.command-help-warning { color: #fde68a; }
@media print {
  .command-help-category, .command-help-card { background: #fff; color: #111827; border-color: #9ca3af; }
}


.smoke-legend { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.55rem 0; }
.smoke-status { display: inline-flex; align-items: center; justify-content: center; min-width: 4.8rem; padding: 0.12rem 0.45rem; border-radius: 999px; border: 1px solid #4b5563; font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; white-space: nowrap; }
.smoke-status-unknown { color: #d1d5db; border-color: #6b7280; background: #111827; }
.smoke-status-pending { color: #fde68a; border-color: #f59e0b; background: #2b2416; }
.smoke-status-pass { color: #bbf7d0; border-color: #22c55e; background: #10251a; }
.smoke-status-partial { color: #bfdbfe; border-color: #60a5fa; background: #16233d; }
.smoke-status-fail { color: #fecaca; border-color: #ef4444; background: #2c1417; }
.smoke-queue-table th:nth-child(1), .smoke-queue-table td:nth-child(1) { width: 8rem; }
.smoke-queue-table th:nth-child(3), .smoke-queue-table td:nth-child(3),
.smoke-queue-table th:nth-child(4), .smoke-queue-table td:nth-child(4),
.smoke-queue-table th:nth-child(5), .smoke-queue-table td:nth-child(5),
.smoke-queue-table th:nth-child(6), .smoke-queue-table td:nth-child(6) { width: 8.5rem; }
@media print {
  .smoke-status-unknown, .smoke-status-pending, .smoke-status-pass, .smoke-status-partial, .smoke-status-fail { background: #fff; color: #111827; border-color: #9ca3af; }
}
