html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: #c0c0c0;
  font-family: "MS Sans Serif", "Tahoma", "Geneva", sans-serif;
  font-size: 13px;
  color: #000;
}

a { color: #0000ee; text-decoration: none; }
a:hover { text-decoration: underline; }
a:visited { color: #551a8b; }

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

.title-bar {
  background: #000080;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 10px;
  font-weight: bold;
}

.title-bar-status {
  display: flex;
  gap: 8px;
  align-items: center;
  font-weight: normal;
}

.menu-bar, .toolbar-strip, .status-bar {
  background: #c0c0c0;
  border-top: 1px solid #fff;
  border-bottom: 1px solid #808080;
  padding: 4px 8px;
  display: flex;
  gap: 12px;
  align-items: center;
}

.menu-bar a {
  color: #000;
  font-weight: bold;
}

.toolbar-strip {
  gap: 6px;
}

.tool-button, button {
  font-family: inherit;
  font-size: 12px;
  background: #c0c0c0;
  color: #000;
  border: 1px outset #c0c0c0;
  padding: 2px 8px;
  cursor: pointer;
  text-decoration: none;
}
.tool-button:hover, button:hover { text-decoration: none; }
.tool-button:active, button:active { border: 1px inset #c0c0c0; }
.link-button:visited { color: #000; }

.body-shell {
  flex: 1;
  display: flex;
  gap: 4px;
  padding: 4px;
  box-sizing: border-box;
  min-height: 0;
}

.nav-pane {
  width: 280px;
  background: #fff;
  border: 2px inset #c0c0c0;
  padding: 8px;
  overflow-y: auto;
  box-sizing: border-box;
}

.content-pane {
  flex: 1;
  min-width: 0;
  background: #fff;
  border: 2px inset #c0c0c0;
  padding: 16px 18px;
  overflow: auto;
  box-sizing: border-box;
}

.tree-section { margin-bottom: 12px; }
.tree-heading { font-weight: bold; color: #000080; margin-bottom: 4px; }
.tree-list { list-style: none; margin: 0; padding-left: 10px; }
.tree-list li { margin: 2px 0; }
.tree-list a { color: #000; display: inline-flex; justify-content: space-between; gap: 8px; width: 100%; padding: 1px 2px; box-sizing: border-box; }
.tree-list a:hover { background: #000080; color: #fff; text-decoration: none; }
.tree-list a.current { background: #000080; color: #fff; text-decoration: none; font-weight: bold; }
.tree-list .count { color: #404040; }
.tree-list a:hover .count, .tree-list a.current .count { color: #fff; }
.small-text { font-size: 12px; }

h1 {
  font-size: 18px;
  color: #000080;
  margin: 0 0 6px 0;
  border-bottom: 2px solid #000080;
  padding-bottom: 4px;
}

h2 {
  font-size: 15px;
  color: #800000;
  margin: 20px 0 6px 0;
}

p, li { line-height: 1.4; }
.lede { margin-top: 4px; }
.section-label { color: #800000; font-weight: bold; margin-bottom: 8px; }

.toolbar-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0 12px 0;
  padding: 8px;
  background: #c0c0c0;
  border: 2px inset #c0c0c0;
}

.toolbar-form label {
  font-size: 12px;
}

input[type="text"], select {
  font-family: inherit;
  font-size: 12px;
  min-width: 140px;
  padding: 2px 4px;
  border: 2px inset #c0c0c0;
  background: #fff;
}

.toolbar-buttons {
  display: flex;
  gap: 6px;
  align-items: end;
}

.records-table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0;
  background: #fff;
}

.records-table th, .records-table td {
  border: 1px solid #808080;
  padding: 4px 6px;
  font-size: 12px;
  vertical-align: top;
}

.records-table th {
  background: #c0c0c0;
  text-align: left;
}
.records-table th a { color: #000; }
.records-table tbody tr:hover { background: #d0e0ff; }

.summary-cell { min-width: 220px; }
.signal-cell {
  white-space: nowrap;
}
.signal-days {
  display: inline-block;
  min-width: 2.8em;
}
.signal-inline {
  margin-left: 4px;
  vertical-align: middle;
}
.table-meta, .pagination, .detail-header {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 8px 0;
}
.pagination { justify-content: space-between; }

.badge {
  display: inline-block;
  padding: 1px 6px;
  border: 1px solid #808080;
  color: #fff;
  font-size: 11px;
  font-weight: bold;
  white-space: nowrap;
}
.badge-open { background: #cc0000; }
.badge-ack, .badge-acknowledged { background: #cc6600; }
.badge-closed { background: #006600; }
.badge-archived { background: #606060; }
.badge-signal { background: #800000; }
.badge-stale { background: #404040; }
.badge-run-success { background: #006600; }
.badge-run-error, .badge-run-failed { background: #cc0000; }
.badge-run-interrupted, .badge-run-running { background: #cc6600; }

.note, .warn, .tip {
  border: 1px solid #808080;
  padding: 8px 10px 8px 14px;
  margin: 10px 0;
  background: #ffffe1;
  font-size: 12px;
}
.warn { background: #fff0f0; border-color: #800000; }
.description-box {
  border: 1px solid #808080;
  background: #ffffe1;
  padding: 10px;
  white-space: pre-wrap;
}
.detail-table td:first-child, .detail-table td:nth-child(3), .detail-table th {
  font-weight: bold;
}
.raw-json summary { cursor: pointer; font-weight: bold; }
pre, code, .mono {
  font-family: "Courier New", "Lucida Console", monospace;
  font-size: 12px;
}
pre {
  background: #ffffe1;
  border: 1px solid #808080;
  padding: 8px;
  overflow-x: auto;
}
.empty-state { text-align: center; color: #404040; }

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 14px;
}
.dashboard-panel {
  border: 2px inset #c0c0c0;
  padding: 10px;
  background: #fff;
}

.help-shell {
  display: flex;
  gap: 4px;
  min-height: 70vh;
}
.help-toc {
  width: 230px;
  background: #fff;
  border: 2px inset #c0c0c0;
  padding: 8px;
  box-sizing: border-box;
}
.help-toc ul { list-style: none; margin: 0; padding-left: 6px; }
.help-toc li { margin: 3px 0; }
.help-toc a { color: #000; display: block; padding: 2px 4px; }
.help-toc a:hover, .help-toc .current a { background: #000080; color: #fff; text-decoration: none; }

.quickstart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 12px;
  margin: 12px 0;
}

.quickstart-panel {
  border: 2px inset #c0c0c0;
  background: #fff;
  padding: 10px;
}

.quick-links {
  list-style: square;
  padding-left: 18px;
}
.help-content {
  flex: 1;
  background: #fff;
  border: 2px inset #c0c0c0;
  padding: 14px 18px;
}

.status-bar {
  justify-content: space-between;
  font-size: 12px;
}

@media (max-width: 1100px) {
  .body-shell { flex-direction: column; }
  .nav-pane { width: auto; max-height: 250px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .help-shell { flex-direction: column; }
  .help-toc { width: auto; }
  .quickstart-grid { grid-template-columns: 1fr; }
}
