.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 390px);
  gap: 22px;
  align-items: stretch;
  padding: 26px;
}

.hero-copy h2 {
  margin: 8px 0 0;
  color: #0f172a;
  font-size: clamp(34px, 4.6vw, 54px);
  line-height: 1.05;
  letter-spacing: 0;
}

.hero-subtitle {
  max-width: 780px;
  margin: 14px 0 0;
  color: #475569;
  font-size: 17px;
  line-height: 1.7;
}

.capability-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.capability-tags span {
  padding: 8px 11px;
  border: 1px solid rgba(37, 99, 235, 0.14);
  border-radius: 999px;
  color: #1e40af;
  background: rgba(219, 234, 254, 0.68);
  font-size: 13px;
  font-weight: 700;
}

.model-status-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 210px;
  padding: 22px;
}

.card-kicker {
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
}

.model-status-card strong {
  margin-top: 10px;
  color: #0f172a;
  font-size: 32px;
  letter-spacing: 0;
}

.model-status-card p {
  margin: 10px 0 0;
  color: #334155;
  line-height: 1.7;
}

.model-status-card small {
  margin-top: 18px;
  color: #047481;
  font-weight: 800;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.metric-card {
  min-width: 0;
  min-height: 138px;
  padding: 18px;
}

.metric-card span,
.metric-card strong,
.metric-card small {
  display: block;
}

.metric-card span {
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
}

.metric-card strong {
  margin-top: 12px;
  color: #0f172a;
  font-size: 32px;
  line-height: 1;
  letter-spacing: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.metric-card small {
  margin-top: 14px;
  color: #64748b;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.dashboard-grid {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.dashboard-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dashboard-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-grid-wide {
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, 0.75fr);
}

.panel {
  min-width: 0;
  padding: 20px;
}

.protocol-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-content: flex-start;
  min-height: 142px;
}

.rank-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 44px;
  gap: 12px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid rgba(87, 116, 161, 0.12);
  border-radius: 8px;
  background: rgba(248, 251, 255, 0.72);
}

.rank-row span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  color: #1d4ed8;
  background: rgba(219, 234, 254, 0.9);
  font-size: 12px;
  font-weight: 900;
}

.rank-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #0f172a;
  font-size: 14px;
}

.rank-row b {
  color: #2563eb;
  text-align: right;
}

.alert-mini-row {
  display: grid;
  grid-template-columns: 82px minmax(120px, 1fr) minmax(160px, 1.35fr) 70px 52px;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(87, 116, 161, 0.12);
  border-radius: 8px;
  background: rgba(248, 251, 255, 0.72);
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.alert-mini-row:hover {
  border-color: rgba(37, 99, 235, 0.3);
  transform: translateY(-1px);
}

.alert-mini-row strong,
.alert-mini-row small,
.alert-mini-row em,
.alert-mini-row b {
  min-width: 0;
}

.alert-mini-row strong {
  color: #0f172a;
  overflow-wrap: anywhere;
}

.alert-mini-row small {
  color: #64748b;
  overflow-wrap: anywhere;
}

.alert-mini-row em {
  color: #0e7490;
  font-style: normal;
  font-weight: 800;
  text-transform: uppercase;
}

.alert-mini-row b {
  color: #dc2626;
  text-align: right;
}

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

.experiment-stats div,
.metadata-grid div {
  min-height: 86px;
  padding: 14px;
  border: 1px solid rgba(87, 116, 161, 0.12);
  border-radius: 8px;
  background: rgba(248, 251, 255, 0.72);
}

.experiment-stats span,
.metadata-grid span {
  display: block;
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
}

.experiment-stats strong,
.metadata-grid strong {
  display: block;
  margin-top: 8px;
  color: #0f172a;
  font-size: 24px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.evidence-line {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-radius: 8px;
  color: #075985;
  background: rgba(219, 234, 254, 0.78);
  line-height: 1.6;
  font-weight: 700;
}

.metadata-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.metadata-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.metadata-columns h4 {
  margin: 0 0 10px;
  color: #334155;
}

.metadata-columns ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.metadata-columns li {
  padding: 9px 10px;
  border-radius: 8px;
  color: #1e3a8a;
  background: rgba(219, 234, 254, 0.62);
  font-size: 13px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.capability-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
}

.capability-card {
  min-width: 0;
  min-height: 114px;
  padding: 14px;
  border: 1px solid rgba(37, 99, 235, 0.14);
  background: rgba(248, 251, 255, 0.76);
}

.capability-card span {
  color: #2563eb;
  font-size: 12px;
  font-weight: 900;
}

.capability-card strong,
.capability-card small {
  display: block;
}

.capability-card strong {
  margin-top: 8px;
  color: #0f172a;
  line-height: 1.35;
  min-width: 0;
  overflow-wrap: anywhere;
}

.capability-card small {
  margin-top: 8px;
  color: #64748b;
  line-height: 1.5;
  min-width: 0;
  overflow-wrap: anywhere;
}

.dashboard-error {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: 360px;
  padding: 12px 14px;
  border: 1px solid rgba(239, 68, 68, 0.22);
  border-radius: 8px;
  color: #991b1b;
  background: rgba(254, 242, 242, 0.95);
  box-shadow: 0 18px 38px rgba(153, 27, 27, 0.12);
  font-size: 14px;
  font-weight: 700;
}

.page-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 24px;
}

.page-hero > * {
  min-width: 0;
}

.page-hero h2 {
  margin: 6px 0 0;
  color: #0f172a;
  font-size: 34px;
  line-height: 1.1;
  letter-spacing: 0;
}

.page-hero p {
  max-width: 820px;
  margin: 10px 0 0;
  color: #475569;
  line-height: 1.7;
}

.page-hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.action-status-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: -4px 0 18px;
  padding: 16px 18px;
}

.action-status-card span,
.action-status-card strong,
.action-status-card small {
  display: block;
}

.action-status-card span {
  color: #2563eb;
  font-size: 12px;
  font-weight: 900;
}

.action-status-card strong {
  margin-top: 6px;
  color: #0f172a;
  font-size: 18px;
  line-height: 1.35;
}

.action-status-card small {
  margin-top: 6px;
  color: #64748b;
  font-weight: 700;
  line-height: 1.45;
}

.filter-toolbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
  padding: 16px;
}

.filter-toolbar label {
  display: grid;
  gap: 7px;
}

.filter-toolbar label span {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.filter-toolbar select,
.filter-toolbar input {
  width: 100%;
  min-height: 38px;
  border: 1px solid rgba(87, 116, 161, 0.18);
  border-radius: 8px;
  padding: 8px 10px;
  color: #0f172a;
  background: rgba(255, 255, 255, 0.82);
  outline: none;
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
}

.table-scroll-hint {
  display: none;
  margin: -4px 0 10px;
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
}

.data-table {
  width: 100%;
  min-width: 1120px;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th,
.data-table td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(87, 116, 161, 0.12);
  text-align: left;
  vertical-align: top;
}

.data-table th {
  color: #475569;
  background: rgba(219, 234, 254, 0.52);
  font-size: 12px;
  font-weight: 900;
}

.data-table td {
  color: #334155;
  overflow-wrap: anywhere;
}

.alerts-table {
  min-width: 1080px;
  table-layout: fixed;
}

.alerts-table .time-col {
  width: 190px;
}

.alerts-table .ip-col {
  width: 118px;
}

.alerts-table .behavior-col {
  width: 138px;
}

.alerts-table .severity-col {
  width: 112px;
}

.alerts-table .risk-score-col {
  width: 86px;
}

.alerts-table .confidence-col {
  width: 98px;
}

.alerts-table .action-col {
  width: 88px;
}

.alerts-table th,
.alerts-table td {
  overflow-wrap: normal;
  word-break: normal;
}

.alerts-table .score-cell,
.alerts-table .confidence-cell,
.alerts-table .timestamp-cell,
.alerts-table .action-cell {
  white-space: nowrap;
  vertical-align: middle;
}

.alerts-table .recommendation-cell {
  overflow-wrap: anywhere;
}

.alerts-table .table-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  white-space: nowrap;
}

.severity-row.severity-critical {
  background: rgba(254, 242, 242, 0.62);
}

.severity-row.severity-high {
  background: rgba(255, 247, 237, 0.58);
}

.score-tile,
.model-state-panel {
  min-width: 210px;
  padding: 18px;
  border: 1px solid rgba(37, 99, 235, 0.15);
  background: rgba(248, 251, 255, 0.78);
}

.score-tile span,
.score-tile strong,
.score-tile small,
.model-state-panel span,
.model-state-panel strong,
.model-state-panel small {
  display: block;
}

.score-tile span,
.model-state-panel span {
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
}

.score-tile strong,
.model-state-panel strong {
  margin-top: 8px;
  color: #0f172a;
  font-size: 32px;
  line-height: 1;
}

.score-tile small,
.model-state-panel small {
  margin-top: 10px;
  color: #1e40af;
  font-weight: 800;
}

.detail-list,
.feature-grid {
  display: grid;
  gap: 10px;
  margin: 0;
}

.detail-list div,
.feature-grid div {
  display: grid;
  grid-template-columns: minmax(140px, 0.42fr) minmax(0, 1fr);
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid rgba(87, 116, 161, 0.12);
  border-radius: 8px;
  background: rgba(248, 251, 255, 0.72);
}

.compact-list div {
  grid-template-columns: minmax(80px, 0.45fr) minmax(0, 1fr);
}

.detail-list dt,
.feature-grid dt {
  color: #64748b;
  font-weight: 800;
}

.detail-list dd,
.feature-grid dd {
  margin: 0;
  color: #0f172a;
  overflow-wrap: anywhere;
}

.json-card {
  margin-top: 12px;
}

.json-card h4,
.related-columns h4 {
  margin: 0 0 8px;
  color: #334155;
}

.json-card pre {
  overflow-x: auto;
  margin: 0;
  padding: 12px;
  border-radius: 8px;
  color: #0f172a;
  background: rgba(241, 245, 249, 0.86);
  font-size: 12px;
}

.stack-list,
.evidence-list,
.metadata-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.evidence-list li,
.metadata-list li,
.info-card {
  padding: 10px 12px;
  border: 1px solid rgba(87, 116, 161, 0.12);
  border-radius: 8px;
  background: rgba(248, 251, 255, 0.72);
  color: #334155;
  line-height: 1.55;
}

.info-card strong,
.info-card small {
  display: block;
}

.info-card strong {
  color: #0f172a;
}

.info-card small {
  margin-top: 6px;
  color: #64748b;
}

.related-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.related-link {
  display: block;
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  color: #1d4ed8;
  background: rgba(219, 234, 254, 0.56);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.chain-node-graph {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px minmax(0, 1fr) 38px minmax(0, 1fr) 38px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.chain-node-graph span {
  display: grid;
  place-items: center;
  min-height: 74px;
  padding: 12px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 8px;
  color: #1e3a8a;
  background: rgba(219, 234, 254, 0.64);
  font-weight: 900;
  text-align: center;
}

.chain-node-graph i {
  height: 2px;
  background: linear-gradient(90deg, #2563eb, #06b6d4);
}

.chain-timeline {
  display: grid;
  gap: 14px;
}

.chain-card {
  padding: 14px;
  border: 1px solid rgba(87, 116, 161, 0.12);
  border-radius: 8px;
  background: rgba(248, 251, 255, 0.72);
}

.chain-card-head {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr) 52px;
  gap: 12px;
  align-items: center;
}

.chain-card-head strong {
  color: #0f172a;
  overflow-wrap: anywhere;
}

.chain-card-head b {
  color: #dc2626;
  text-align: right;
}

.chain-card p {
  margin: 12px 0;
  color: #475569;
  font-weight: 800;
}

.chain-card ol {
  margin: 0 0 12px;
  padding-left: 20px;
  color: #475569;
}

.state-card {
  min-height: 126px;
}

.state-card strong,
.state-card span {
  display: block;
}

.state-card strong {
  color: #0f172a;
  font-size: 20px;
}

.state-card span {
  margin-top: 10px;
  color: #64748b;
  line-height: 1.55;
}

.active-state {
  border-color: rgba(6, 182, 212, 0.26);
  background: rgba(207, 250, 254, 0.48);
}

.metadata-list-inline {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.upload-form {
  display: grid;
  gap: 14px;
}

.upload-form label {
  display: grid;
  gap: 8px;
}

.upload-form label span {
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
}

.upload-form select,
.upload-form input[type="file"] {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(87, 116, 161, 0.18);
  border-radius: 8px;
  padding: 9px 10px;
  color: #0f172a;
  background: rgba(255, 255, 255, 0.86);
}

.upload-check-panel {
  margin-bottom: 18px;
}

.inline-upload-form {
  grid-template-columns: minmax(260px, 1fr) auto;
  align-items: end;
}

.progress-line {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(14, 165, 233, 0.18);
  border-radius: 8px;
  color: #075985;
  background: rgba(240, 249, 255, 0.82);
  font-weight: 800;
}

.upload-result-card {
  display: grid;
  gap: 7px;
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(22, 163, 74, 0.18);
  border-radius: 8px;
  background: rgba(240, 253, 244, 0.78);
}

.upload-result-card strong {
  color: #14532d;
}

.upload-result-card small {
  color: #166534;
  line-height: 1.55;
  font-weight: 700;
}

.upload-result-card a {
  color: #1d4ed8;
  font-weight: 900;
}

.file-drop {
  padding: 14px;
  border: 1px dashed rgba(37, 99, 235, 0.28);
  border-radius: 8px;
  background: rgba(239, 246, 255, 0.68);
}

.file-drop small {
  color: #64748b;
  line-height: 1.5;
}

.progress-panel {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.progress-panel span {
  color: #475569;
  font-size: 13px;
  font-weight: 800;
}

.progress-track {
  height: 11px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(219, 234, 254, 0.9);
}

.demo-route-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
  color: #334155;
  line-height: 1.55;
}

button:disabled,
.secondary-action:disabled,
.primary-action:disabled,
.table-action:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.progress-track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #06b6d4);
  transition: width 0.25s ease;
}

.inline-error {
  position: static;
  max-width: none;
  margin-top: 14px;
}

.result-actions {
  justify-content: flex-start;
  margin-top: 16px;
}

.risk-distribution-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.risk-distribution-list div {
  align-items: center;
  min-height: 62px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.zero-risk-state {
  margin-top: 12px;
}

.model-chart-panel {
  min-height: auto;
}

.confusion-matrix-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 360px;
  padding: 18px;
  border: 1px solid rgba(87, 116, 161, 0.14);
  border-radius: 8px;
  background: rgba(248, 251, 255, 0.72);
}

.confusion-matrix-wrap img {
  width: min(620px, 100%);
  max-height: 620px;
  object-fit: contain;
  image-rendering: auto;
}

.compact-table {
  min-width: 760px;
}

.warm-pill {
  color: #9a3412;
  border-color: rgba(249, 115, 22, 0.18);
  background: rgba(255, 237, 213, 0.78);
}

.comparison-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.comparison-item {
  padding: 14px;
  border: 1px solid rgba(87, 116, 161, 0.12);
  border-radius: 8px;
  background: rgba(248, 251, 255, 0.72);
}

.comparison-item strong {
  display: block;
  margin-bottom: 12px;
  color: #0f172a;
}

.dual-bars {
  display: grid;
  gap: 8px;
}

.dual-bars span {
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
}

.dual-bars i {
  display: block;
  min-width: 4%;
  height: 10px;
  border-radius: 999px;
}

.bar-normal {
  background: linear-gradient(90deg, #10b981, #06b6d4);
}

.bar-suspicious {
  background: linear-gradient(90deg, #f97316, #ef4444);
}

.report-paths {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.report-paths span {
  padding: 8px 10px;
  border: 1px solid rgba(37, 99, 235, 0.14);
  border-radius: 8px;
  color: #1e40af;
  background: rgba(219, 234, 254, 0.64);
  font-size: 13px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.small-strong {
  font-size: 20px !important;
  line-height: 1.2 !important;
  overflow-wrap: anywhere;
}

.threshold-list li {
  font-weight: 900;
}

@media (max-width: 1280px) {
  .metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-grid-3,
  .dashboard-grid-wide {
    grid-template-columns: 1fr;
  }

  .filter-toolbar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .dashboard-hero,
  .page-hero,
  .dashboard-grid-2,
  .comparison-grid,
  .metadata-grid,
  .metadata-columns,
  .experiment-stats,
  .capability-grid,
  .related-columns {
    grid-template-columns: 1fr;
  }

  .page-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .page-hero-actions {
    justify-content: flex-start;
  }

  .page-hero-actions > * {
    max-width: 100%;
  }

  .filter-toolbar {
    grid-template-columns: 1fr;
  }

  .action-status-card,
  .inline-upload-form,
  .risk-distribution-list {
    grid-template-columns: 1fr;
  }

  .action-status-card {
    align-items: stretch;
    flex-direction: column;
  }

  .chain-node-graph {
    grid-template-columns: 1fr;
  }

  .chain-node-graph i {
    width: 2px;
    height: 22px;
    justify-self: center;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .alert-mini-row {
    grid-template-columns: 1fr;
  }

  .alert-mini-row b {
    text-align: left;
  }

  .detail-list div,
  .feature-grid div,
  .chain-card-head {
    grid-template-columns: 1fr;
  }

  .chain-card-head b {
    text-align: left;
  }
}

@media (max-width: 560px) {
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-hero,
  .panel,
  .page-hero {
    padding: 16px;
  }

  .page-hero h2 {
    font-size: 30px;
    overflow-wrap: anywhere;
  }

  .page-hero-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .page-hero-actions .primary-action,
  .page-hero-actions .secondary-action {
    width: 100%;
    min-height: 42px;
    text-align: center;
    white-space: normal;
  }

  .data-table {
    min-width: 900px;
    table-layout: auto;
  }

  .alerts-table {
    min-width: 1080px;
    table-layout: fixed;
  }

  .compact-table {
    min-width: 760px;
    table-layout: auto;
  }

  .data-table th,
  .data-table td {
    padding: 10px 8px;
    overflow-wrap: anywhere;
    word-break: normal;
  }

  .table-scroll-hint {
    display: block;
  }

  .table-action {
    width: 100%;
    min-width: 0;
    white-space: normal;
  }

  .hero-copy h2 {
    font-size: 34px;
  }
}
