:root {
  --bg: #e7edf1;
  --bg-panel: #f8fbfc;
  --bg-panel-strong: #ffffff;
  --ink: #16212b;
  --muted: #5f7284;
  --line: #cfdae3;
  --line-strong: #b7c6d2;
  --accent: #0a6d74;
  --accent-soft: rgba(10, 109, 116, 0.12);
  --accent-strong: #074c53;
  --ok: #1a7f43;
  --ok-soft: rgba(26, 127, 67, 0.12);
  --warn: #b76a12;
  --warn-soft: rgba(183, 106, 18, 0.14);
  --danger: #be3e35;
  --danger-soft: rgba(190, 62, 53, 0.13);
  --shadow: 0 18px 36px rgba(27, 48, 67, 0.08);
  background:
    linear-gradient(180deg, rgba(10, 109, 116, 0.08), transparent 220px),
    linear-gradient(135deg, #eef3f6 0%, #e3eaef 100%);
  color: var(--ink);
  font-family:
    'IBM Plex Sans', 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

pre {
  margin: 0;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.monitor-shell {
  margin: 0 auto;
  max-width: 1580px;
  padding: 32px 20px 56px;
}

.monitor-header,
.toolbar-panel,
.selection-summary,
.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.monitor-header > *,
.toolbar-panel > *,
.selection-summary > *,
.card-header > * {
  min-width: 0;
}

.monitor-header {
  margin-bottom: 22px;
}

.monitor-kicker,
.section-eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  font-family: 'IBM Plex Mono', 'SFMono-Regular', Consolas, monospace;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.monitor-title,
.toolbar-panel h2,
.section-header h2 {
  margin: 0;
}

.monitor-title {
  font-size: clamp(2rem, 3vw, 2.8rem);
  line-height: 1;
}

.panel {
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(248, 251, 252, 0.95));
  box-shadow: var(--shadow);
  padding: 20px;
}

.hero-panel {
  display: grid;
  gap: 16px;
}

.lead-copy,
.muted-copy {
  margin: 0;
}

.muted-copy {
  color: var(--muted);
}

.error-copy {
  color: var(--danger);
}

.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
}

.button-primary {
  background: var(--accent);
  color: #fff;
}

.button-primary:hover {
  background: var(--accent-strong);
}

.button-secondary {
  background: var(--bg-panel-strong);
  border-color: var(--line-strong);
  color: var(--ink);
}

.filters-form {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.filters-form label {
  display: grid;
  gap: 8px;
  font-size: 0.94rem;
}

.filters-form input,
.filters-form select {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--bg-panel-strong);
  color: var(--ink);
}

.section-header {
  margin-bottom: 14px;
}

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg-panel-strong);
}

.monitor-table {
  width: 100%;
  min-width: 1440px;
  border-collapse: separate;
  border-spacing: 0;
}

.monitor-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eef4f7;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.monitor-table th,
.monitor-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.monitor-table tbody tr:last-child td {
  border-bottom: 0;
}

.table-row-selectable {
  cursor: pointer;
}

.table-row-selectable:hover td,
.table-row-selectable:focus td,
.table-row-selectable.is-selected td {
  background: var(--accent-soft);
}

.table-row-selectable:focus {
  outline: none;
}

.feedback-cell {
  min-width: 240px;
}

.status-cell {
  display: grid;
  gap: 6px;
  min-width: 112px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.status-dot-green {
  background: var(--ok);
  box-shadow: 0 0 0 6px var(--ok-soft);
}

.status-dot-yellow {
  background: var(--warn);
  box-shadow: 0 0 0 6px var(--warn-soft);
}

.status-dot-red {
  background: var(--danger);
  box-shadow: 0 0 0 6px var(--danger-soft);
}

.table-subvalue,
.mono-inline {
  font-family: 'IBM Plex Mono', 'SFMono-Regular', Consolas, monospace;
  font-size: 0.8rem;
}

.mono-inline {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
  white-space: normal;
  word-break: break-word;
}

.flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  min-width: 50px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.flag-yes {
  background: var(--ok-soft);
  color: var(--ok);
}

.flag-no {
  background: rgba(95, 114, 132, 0.12);
  color: var(--muted);
}

.selection-summary {
  margin-bottom: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f2f7f9;
}

.selection-summary h3 {
  margin: 0 0 6px;
}

.selection-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.definition-grid,
.card-grid {
  display: grid;
  gap: 14px;
}

.definition-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}

.definition-item {
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg-panel-strong);
}

.definition-item dt {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.84rem;
}

.definition-item dd {
  margin: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
  white-space: normal;
  word-break: break-word;
}

.card-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
}

.info-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--bg-panel-strong);
}

.info-card h3 {
  margin: 0 0 10px;
}

.simple-list {
  margin: 0;
  padding-left: 18px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.raw-block {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.raw-block summary {
  cursor: pointer;
  font-weight: 700;
}

.empty-state,
.empty-cell {
  color: var(--muted);
  text-align: center;
}

@media (max-width: 960px) {
  .monitor-shell {
    padding: 24px 14px 48px;
  }

  .monitor-header,
  .toolbar-panel,
  .selection-summary,
  .card-header {
    flex-direction: column;
  }

  .monitor-table {
    min-width: 1120px;
  }
}
