.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.panel.focused-panel {
  border-color: rgba(145, 169, 211, 0.44);
  box-shadow:
    inset 4px 0 0 rgba(121, 153, 214, 0.72),
    0 0 0 2px rgba(121, 153, 214, 0.1),
    var(--shadow-soft);
  animation: panelFocusPulse 900ms ease;
}

@keyframes panelFocusPulse {
  0% {
    transform: translateY(0);
    box-shadow:
      inset 4px 0 0 rgba(121, 153, 214, 0),
      0 0 0 0 rgba(121, 153, 214, 0),
      var(--shadow-soft);
  }
  35% {
    transform: translateY(-1px);
    box-shadow:
      inset 4px 0 0 rgba(121, 153, 214, 0.72),
      0 0 0 4px rgba(121, 153, 214, 0.08),
      var(--shadow-soft);
  }
  100% {
    transform: translateY(0);
    box-shadow:
      inset 4px 0 0 rgba(121, 153, 214, 0.72),
      0 0 0 2px rgba(121, 153, 214, 0.1),
      var(--shadow-soft);
  }
}

.card {
  padding: 20px 18px;
}

.summary-card {
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.summary-card:hover {
  transform: translateY(-1px);
  border-color: rgba(145, 169, 211, 0.28);
  background: rgba(13, 22, 36, 0.98);
}

.summary-card.active {
  border-color: rgba(145, 169, 211, 0.34);
  background: rgba(15, 25, 41, 0.98);
  box-shadow:
    inset 4px 0 0 rgba(121, 153, 214, 0.68),
    var(--shadow-soft);
}

.summary-card:focus-visible {
  outline: 0;
  border-color: rgba(145, 169, 211, 0.46);
  box-shadow: 0 0 0 3px rgba(121, 153, 214, 0.1), var(--shadow-soft);
}

.card-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.card-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(19, 30, 47, 0.82);
  border: 1px solid rgba(105, 126, 161, 0.16);
}

.card-value {
  font-size: 34px;
  line-height: 1;
  font-weight: 700;
}

.card-label {
  color: #d7e1f5;
  font-size: 14px;
}

.card-metric {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.card-sub {
  color: #dce8ff;
  font-size: 12px;
  line-height: 1.45;
}

.card-sub strong {
  color: #9fc0ff;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-right: 6px;
}

.panel-header {
  padding: 18px 18px 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.panel-header.has-actions {
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 10px;
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
  min-width: 0;
}

.panel-header.has-actions .panel-title {
  width: 100%;
}

.panel-title-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  white-space: nowrap;
}

.panel-header-actions {
  min-width: 0;
  display: flex;
  justify-content: flex-end;
}

.panel-header.has-actions .panel-header-actions {
  justify-content: center;
  width: 100%;
}

.panel-title svg {
  width: 18px;
  height: 18px;
  color: #79a5ff;
}

.panel-help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid rgba(114, 144, 204, 0.24);
  background: rgba(17, 29, 49, 0.82);
  color: #9cb8f0;
  font-size: 11px;
  font-weight: 700;
  cursor: help;
  flex: 0 0 auto;
}

.panel-help:hover {
  background: rgba(27, 42, 68, 0.92);
  color: #d7e6ff;
}

.help-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(5, 10, 18, 0.68);
  backdrop-filter: blur(8px);
}

.help-dialog {
  width: min(560px, 100%);
  border-radius: 22px;
  border: 1px solid rgba(102, 127, 176, 0.24);
  background: rgba(10, 18, 31, 0.99);
  box-shadow: 0 24px 58px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.help-dialog-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid rgba(90, 116, 161, 0.16);
}

.help-dialog-title {
  margin: 0;
  color: #e7efff;
  font-size: 20px;
}

.help-dialog-subtitle {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.5;
}

.help-dialog-body {
  display: grid;
  gap: 14px;
  padding: 18px 20px 20px;
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 20px 20px;
}

.help-card {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(15, 27, 47, 0.68);
  border: 1px solid rgba(92, 118, 164, 0.14);
}

.help-card strong {
  display: block;
  margin-bottom: 6px;
  color: #dce8ff;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.empty-state {
  position: relative;
  overflow: hidden;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(94, 123, 181, 0.16);
  background: rgba(12, 21, 35, 0.66);
  color: var(--muted);
  display: grid;
  gap: 7px;
}

.empty-state-glow {
  display: none;
}

.empty-state-title {
  position: relative;
  color: #e5efff;
  font-weight: 800;
}

.empty-state-detail,
.empty-state-hint {
  position: relative;
  line-height: 1.45;
}

.empty-state-hint {
  color: #95b5f6;
  font-size: 12px;
}

.panel-subactions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
}

.inline-stack-gap-8 {
  margin-top: 8px;
}

.inline-stack-gap-10 {
  margin-top: 10px;
}

.stack-grid-gap-8 {
  display: grid;
  gap: 8px;
}

.top-output {
  padding: 16px 16px 14px;
  border-radius: 18px;
  background: rgba(12, 21, 37, 0.8);
  border: 1px solid rgba(92, 118, 164, 0.18);
}

.top-output-summary {
  padding-bottom: 16px;
}

.top-output-summary.success {
  border-color: rgba(89, 219, 136, 0.24);
  background: rgba(16, 30, 31, 0.78);
}

.top-output-summary.warning {
  border-color: rgba(240, 191, 75, 0.24);
  background: rgba(36, 28, 15, 0.78);
}

.top-output-summary.error {
  border-color: rgba(242, 110, 128, 0.28);
  background: rgba(45, 21, 31, 0.78);
}

.top-output-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.top-output-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #d8e5ff;
  font-size: 14px;
  font-weight: 600;
}

.top-output-title svg {
  width: 16px;
  height: 16px;
  color: #79a5ff;
}

.top-output-note {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 10px;
}

.top-output pre {
  margin: 0;
  max-height: 260px;
  overflow: auto;
  padding: 14px;
  border-radius: 14px;
  background: rgba(8, 16, 29, 0.9);
  border: 1px solid rgba(91, 117, 162, 0.14);
  color: #cfe0ff;
  font-family: "Berkeley Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
}

.text-link {
  color: #8fb3ff;
  font-size: 13px;
}

.top-output-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.top-output-dismiss {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.top-output-status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.top-output-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.top-output-status-pill.success {
  color: #d8ffe7;
  background: rgba(34, 123, 76, 0.38);
  border: 1px solid rgba(89, 219, 136, 0.22);
}

.top-output-status-pill.warning {
  color: #ffe7ae;
  background: rgba(114, 84, 15, 0.34);
  border: 1px solid rgba(240, 191, 75, 0.22);
}

.top-output-status-pill.error {
  color: #ffd7de;
  background: rgba(125, 42, 61, 0.36);
  border: 1px solid rgba(242, 110, 128, 0.24);
}

.top-output-status-meta {
  color: var(--muted);
  font-size: 12px;
}

.tabs {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  padding: 4px;
  border-radius: 12px;
  background: rgba(18, 30, 50, 0.7);
  border: 1px solid rgba(92, 119, 168, 0.18);
}

.tab {
  padding: 8px 12px;
  border-radius: 10px;
  color: #c7d4ef;
}

.tab.active {
  background: rgba(61, 85, 148, 0.7);
  color: white;
  box-shadow: inset 0 0 0 1px rgba(152, 176, 225, 0.12);
}

.section-body { padding: 0 18px 18px; }

.panel-notes {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.panel-note {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(92, 118, 164, 0.16);
  background: rgba(15, 27, 47, 0.48);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.panel-note strong {
  display: block;
  color: #d9e4fb;
  font-size: 12px;
  margin-bottom: 2px;
}
