:root {
  color-scheme: dark;
}

body {
  --color-bg: #061425;
  --color-bg-accent:
    radial-gradient(
      circle at top left,
      rgba(0, 255, 245, 0.08),
      transparent 60%
    ),
    radial-gradient(
      circle at bottom right,
      rgba(14, 165, 233, 0.08),
      transparent 55%
    ),
    #061425;
  --color-card: rgba(9, 20, 35, 0.9);
  --color-card-border: rgba(0, 255, 245, 0.12);
  --color-text: #e8f7ff;
  --color-muted: rgba(203, 213, 225, 0.72);
  --color-subtle: rgba(148, 163, 184, 0.65);
  --color-accent: #00fff5;
  --color-accent-soft: rgba(0, 255, 245, 0.16);
  --color-success: #34d399;
  --color-warning: #fcd34d;
  --color-danger: #f87171;
  --color-cyan-glow:
    0 0 0 1px rgba(0, 255, 245, 0.45), 0 0 18px rgba(0, 255, 245, 0.35);
  --glow-cyan:
    0 0 0 1px rgba(34, 211, 238, 0.35), 0 0 18px rgba(34, 211, 238, 0.28);
  --glow-amber:
    0 0 0 1px rgba(251, 191, 36, 0.32), 0 0 18px rgba(251, 191, 36, 0.26);
  --glow-red:
    0 0 0 1px rgba(248, 113, 113, 0.38), 0 0 20px rgba(248, 113, 113, 0.3);
  --glow-slate:
    0 0 0 1px rgba(148, 163, 184, 0.3), 0 0 18px rgba(148, 163, 184, 0.22);
  --shadow-card: 0 22px 45px rgba(4, 12, 25, 0.55);
  --card-radius: 18px;
  --gap: 1rem;
  --card-padding: 1rem;
  --transition-speed: 0.3s;

  margin: 0;
  min-height: 100vh;
  font-family:
    "Inter",
    "Segoe UI",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  background: var(--color-bg-accent);
  color: var(--color-text);
  display: flex;
  justify-content: center;
  padding: 1.5rem 1.25rem 2.5rem;
  transition:
    background-color var(--transition-speed) ease,
    color var(--transition-speed) ease;

  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.5) transparent;
}

body::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

*::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

body::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

body::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.4);
  border-radius: 999px;
  box-shadow:
    inset 0 0 0 1px rgba(34, 211, 238, 0.2),
    0 0 12px rgba(148, 163, 184, 0.35);
}

*::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.4);
  border-radius: 999px;
  box-shadow:
    inset 0 0 0 1px rgba(34, 211, 238, 0.2),
    0 0 12px rgba(148, 163, 184, 0.35);
}

body::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.55);
}

*::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.55);
}

body.has-modal {
  overflow: hidden;
}

body[data-theme="light"] {
  color-scheme: light;
  --color-bg: #f4f7ff;
  --color-bg-accent:
    radial-gradient(
      circle at top left,
      rgba(14, 165, 233, 0.08),
      transparent 60%
    ),
    radial-gradient(
      circle at bottom right,
      rgba(45, 212, 191, 0.08),
      transparent 50%
    ),
    #f4f7ff;
  --color-card: rgba(255, 255, 255, 0.92);
  --color-card-border: rgba(14, 165, 233, 0.12);
  --color-text: #102140;
  --color-muted: rgba(71, 85, 105, 0.75);
  --color-subtle: rgba(100, 116, 139, 0.65);
  --color-accent: #0f766e;
  --color-accent-soft: rgba(15, 118, 110, 0.12);
  --color-success: #0f9f8e;
  --color-warning: #f97316;
  --color-danger: #dc2626;
  --shadow-card: 0 16px 30px rgba(15, 23, 42, 0.12);
  --color-cyan-glow:
    0 0 0 1px rgba(15, 118, 110, 0.4), 0 0 16px rgba(15, 118, 110, 0.32);
  --glow-cyan:
    0 0 0 1px rgba(14, 165, 233, 0.32), 0 0 16px rgba(14, 165, 233, 0.24);
  --glow-amber:
    0 0 0 1px rgba(249, 115, 22, 0.3), 0 0 16px rgba(249, 115, 22, 0.22);
  --glow-red:
    0 0 0 1px rgba(220, 38, 38, 0.34), 0 0 18px rgba(248, 113, 113, 0.24);
  --glow-slate:
    0 0 0 1px rgba(100, 116, 139, 0.26), 0 0 16px rgba(148, 163, 184, 0.2);
}

* {
  box-sizing: border-box;
  scrollbar-width: inherit;
  scrollbar-color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell {
  width: 100%;
  max-width: 1240px;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--gap);
  padding: var(--card-padding);
  background: var(--color-card);
  border: 1px solid var(--color-card-border);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-logo {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  box-shadow: 0 0 14px rgba(0, 255, 245, 0.35);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3rem;
}

.brand-meta {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
}

.brand-name {
  margin: 0;
  font-size: 1.6rem;
  letter-spacing: 0.04em;
}

.brand-version {
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-accent);
}

.brand-tagline {
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-subtle);
}

.topbar-center {
  justify-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
}

.status-capsule {
  --status-glow: 0 0 0 1px rgba(56, 189, 248, 0.2), 0 0 14px rgba(14, 165, 233, 0.18);
  --status-capsule-width: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.48rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(56, 189, 248, 0.28);
  background: rgba(8, 31, 51, 0.72);
  box-shadow: var(--status-glow);
  transition:
    border-color 0.3s ease,
    background 0.3s ease,
    box-shadow 0.4s ease;
  backdrop-filter: blur(6px);
  width: var(--status-capsule-width);
  max-width: 100%;
  min-width: 0;
  flex: 0 0 auto;
  text-align: center;
  margin: 0 auto;
}

.status-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: 1rem;
  flex-wrap: nowrap;
}

.status-capsule--compact .status-grid {
  gap: 0.75rem;
}

.status-capsule--compressed .status-grid {
  gap: 0.6rem;
}

.status-segment {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.24rem;
  padding: 0.18rem 0.4rem;
  min-width: 0;
  white-space: nowrap;
  flex: 1 1 0;
}

.status-capsule--compact .status-segment {
  padding: 0.16rem 0.34rem;
}

.status-capsule--compressed .status-segment {
  padding: 0.14rem 0.3rem;
}

.status-label,
.status-value,
.status-divider {
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont,
    sans-serif;
  font-size: 0.55rem;
  line-height: 1.15;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.status-capsule--compact .status-label,
.status-capsule--compact .status-value,
.status-capsule--compact .status-divider {
  font-size: 0.51rem;
  letter-spacing: 0.13em;
}

.status-capsule--compressed .status-label,
.status-capsule--compressed .status-value,
.status-capsule--compressed .status-divider {
  font-size: 0.47rem;
  letter-spacing: 0.11em;
}

.status-label {
  font-weight: 600;
  color: #fff;
  opacity: 0.92;
}

.status-value {
  font-weight: 700;
  text-align: center;
  transition: color 0.3s ease;
}

.status-divider {
  opacity: 0.82;
}

.status-color--positive {
  color: #00ff9d;
}

.status-color--warning {
  color: #fbbf24;
}

.status-color--negative {
  color: #ef4444;
}

.status-color--muted {
  color: rgba(148, 163, 184, 0.85);
}

.status-capsule[data-state="success"] {
  border-color: rgba(56, 189, 248, 0.3);
  background: rgba(8, 31, 51, 0.78);
  --status-glow: 0 0 0 1px rgba(56, 189, 248, 0.22), 0 0 12px rgba(56, 189, 248, 0.18);
}

.status-capsule[data-state="slow"] {
  border-color: rgba(251, 191, 36, 0.32);
  background: rgba(66, 32, 0, 0.35);
  --status-glow: 0 0 0 1px rgba(251, 191, 36, 0.22), 0 0 12px rgba(251, 191, 36, 0.18);
}

.status-capsule[data-state="timeout"],
.status-capsule[data-state="lost"] {
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(75, 16, 16, 0.35);
  --status-glow: 0 0 0 1px rgba(239, 68, 68, 0.25), 0 0 12px rgba(239, 68, 68, 0.2);
}

.status-capsule[data-state="paused"] {
  border-color: rgba(148, 163, 184, 0.38);
  background: rgba(30, 41, 59, 0.48);
  --status-glow: 0 0 0 1px rgba(148, 163, 184, 0.22), 0 0 10px rgba(148, 163, 184, 0.18);
}

.status-capsule--pulse-positive {
  animation: statusPulsePositive 0.6s ease;
}

.status-capsule--pulse-negative {
  animation: statusPulseNegative 0.6s ease;
}

@keyframes statusPulsePositive {
  0% {
    box-shadow: var(--status-glow);
  }
  50% {
    box-shadow: 0 0 0 1px rgba(0, 255, 157, 0.4),
      0 0 20px rgba(0, 255, 157, 0.35);
  }
  100% {
    box-shadow: var(--status-glow);
  }
}

@keyframes statusPulseNegative {
  0% {
    box-shadow: var(--status-glow);
  }
  50% {
    box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.45),
      0 0 20px rgba(239, 68, 68, 0.35);
  }
  100% {
    box-shadow: var(--status-glow);
  }
}

body[data-theme="light"] .status-capsule {
  border-color: rgba(56, 189, 248, 0.26);
  background: rgba(224, 248, 255, 0.72);
  --status-glow: 0 0 0 1px rgba(56, 189, 248, 0.2), 0 0 12px rgba(56, 189, 248, 0.16);
}

body[data-theme="light"] .status-capsule[data-state="success"] {
  background: rgba(224, 255, 255, 0.78);
}

body[data-theme="light"] .status-capsule[data-state="slow"] {
  background: rgba(255, 243, 219, 0.82);
  border-color: rgba(251, 191, 36, 0.35);
  --status-glow: 0 0 0 1px rgba(251, 191, 36, 0.24), 0 0 12px rgba(251, 191, 36, 0.18);
}

body[data-theme="light"] .status-capsule[data-state="timeout"],
body[data-theme="light"] .status-capsule[data-state="lost"] {
  background: rgba(255, 231, 231, 0.86);
  border-color: rgba(239, 68, 68, 0.36);
  --status-glow: 0 0 0 1px rgba(239, 68, 68, 0.24), 0 0 12px rgba(239, 68, 68, 0.18);
}

body[data-theme="light"] .status-capsule[data-state="paused"] {
  background: rgba(226, 232, 240, 0.76);
}

@media (max-width: 900px) {
  .status-capsule {
    padding: 0.48rem 0.95rem;
    --status-capsule-width: 420px;
  }

  .status-grid {
    gap: 0.5rem;
  }
}

@media (max-width: 640px) {
  .status-capsule {
    padding: 0.42rem 0.85rem;
    --status-capsule-width: 360px;
  }

  .status-grid {
    flex-direction: column;
    align-items: stretch;
    gap: 0.45rem;
  }

  .status-segment {
    flex: 0 0 auto;
    width: 100%;
    justify-content: center;
  }

  .status-label,
  .status-value,
  .status-divider {
    font-size: 0.66rem;
    letter-spacing: 0.13em;
  }
}

@media (max-width: 480px) {
  .status-capsule {
    padding: 0.38rem 0.75rem;
    --status-capsule-width: 300px;
  }

  .status-grid {
    gap: 0.35rem;
  }

  .status-label,
  .status-value,
  .status-divider {
    font-size: 0.62rem;
    letter-spacing: 0.12em;
  }
}

@media (max-width: 380px) {
  .status-capsule {
    padding: 0.34rem 0.7rem;
  }

  .status-grid {
    gap: 0.32rem;
  }

  .status-label,
  .status-value,
  .status-divider {
    font-size: 0.58rem;
    letter-spacing: 0.11em;
  }
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.action-buttons {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.action-button,
.primary-button,
.secondary-button {
  border-radius: 10px;
  border: 1px solid var(--color-card-border);
  padding: 0.45rem 1rem;
  background: rgba(0, 0, 0, 0.12);
  color: var(--color-accent);
  cursor: pointer;
  letter-spacing: 0.05em;
  transition:
    background-color var(--transition-speed) ease,
    color var(--transition-speed) ease,
    border-color var(--transition-speed) ease,
    box-shadow var(--transition-speed) ease;
}

.icon-button {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid rgba(34, 211, 238, 0.32);
  background: rgba(15, 23, 42, 0.55);
  color: #67e8f9;
  box-shadow: var(--glow-cyan);
  transition: all 0.2s ease;
  cursor: pointer;
}

.icon-button .icon {
  width: 18px;
  height: 18px;
}

.action-button:hover,
.action-button:focus-visible,
.primary-button:hover,
.primary-button:focus-visible,
.secondary-button:hover,
.secondary-button:focus-visible {
  background: rgba(51, 65, 85, 0.6);
  border-color: rgba(34, 211, 238, 0.55);
  box-shadow: var(--color-cyan-glow);
}

.icon-button:hover,
.icon-button:focus-visible {
  background: rgba(51, 65, 85, 0.6);
  border-color: rgba(34, 211, 238, 0.55);
  box-shadow: var(--glow-cyan);
}

.icon-button:active {
  background: rgba(8, 145, 178, 0.3);
  box-shadow: var(--glow-cyan);
}

.icon-button:focus-visible {
  outline: 2px solid rgba(165, 243, 252, 0.35);
  outline-offset: 2px;
}

.primary-button {
  background: var(--color-accent);
  color: #041322;
  border-color: rgba(0, 255, 245, 0.4);
  box-shadow: 0 14px 34px rgba(6, 182, 212, 0.2);
}

.primary-button:hover,
.primary-button:focus-visible {
  box-shadow:
    var(--color-cyan-glow),
    0 18px 46px rgba(6, 182, 212, 0.28);
}

.secondary-button {
  color: var(--color-text);
  background: var(--color-accent-soft);
}

.action-button:hover,
.action-button:focus-visible,
.secondary-button:hover,
.secondary-button:focus-visible {
  box-shadow: var(--color-cyan-glow);
  border-color: rgba(0, 255, 245, 0.35);
}

.action-button:focus-visible,
.primary-button:focus-visible,
.secondary-button:focus-visible,
.profile-toggle:focus-visible {
  outline: none;
}

.dashboard-grid {
  display: grid;
  gap: var(--gap);
  grid-auto-rows: minmax(0, auto);
  grid-auto-flow: row;
  align-items: stretch;
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 640px) {
  .dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1180px) {
  .dashboard-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.card {
  background: var(--color-card);
  border: 1px solid var(--color-card-border);
  border-radius: var(--card-radius);
  padding: var(--card-padding);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
  isolation: isolate;
  min-width: 0;
  transition:
    background-color var(--transition-speed) ease,
    border-color var(--transition-speed) ease,
    box-shadow var(--transition-speed) ease;
}

.card.is-highlighted {
  border-color: rgba(0, 255, 245, 0.5);
  box-shadow: var(--color-cyan-glow);
}

.card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.card-header h2 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.card-header h3 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.card-subtitle {
  font-size: 0.8rem;
  color: var(--color-subtle);
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
}

.summary-matrix {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

@media (max-width: 520px) {
  .summary-matrix {
    grid-template-columns: minmax(0, 1fr);
  }
}

.summary-tile {
  background: rgba(0, 0, 0, 0.16);
  border-radius: 12px;
  border: 1px solid rgba(0, 255, 245, 0.12);
  padding: 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 100%;
}

.summary-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-muted);
}

.summary-value {
  font-size: 1.15rem;
  font-weight: 600;
}

.status-line {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.75rem;
  border-radius: 12px;
  border: 1px solid rgba(0, 255, 245, 0.18);
  background: rgba(0, 0, 0, 0.18);
  font-size: 0.95rem;
  flex-wrap: wrap;
}

.status-line[data-state="ok"] {
  border-color: rgba(52, 211, 153, 0.4);
}

.status-line[data-state="slow"] {
  border-color: rgba(252, 211, 77, 0.4);
}

.status-line[data-state="alert"] {
  border-color: rgba(248, 113, 113, 0.5);
}

.status-line[data-state="timeout"] {
  border-color: rgba(248, 113, 113, 0.6);
}

.divider {
  opacity: 0.4;
}

.failure-indicator {
  display: none;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  border: 1px solid rgba(248, 113, 113, 0.45);
  background: rgba(248, 113, 113, 0.16);
  color: var(--color-danger);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.failure-indicator.is-visible {
  display: inline-flex;
}

.status-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem;
  font-size: 0.85rem;
}

.status-meta dt {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-muted);
}

.status-meta dd {
  margin: 0.15rem 0 0;
  font-weight: 600;
}

.alerts {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.alerts[data-has-alerts="false"] {
  display: none;
}

.alert-pill {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: baseline;
  border-radius: 10px;
  border: 1px solid rgba(252, 211, 77, 0.3);
  background: rgba(252, 211, 77, 0.12);
  padding: 0.4rem 0.65rem;
  font-size: 0.85rem;
  color: var(--color-warning);
}

.alert-pill__tag {
  font-weight: 600;
}

.alert-pill__timestamp {
  color: var(--color-text);
  opacity: 0.85;
}

.alert-pill__message {
  color: var(--color-text);
  opacity: 0.75;
}

.placeholder {
  margin: 0;
  font-size: 0.85rem;
  color: var(--color-subtle);
}

.chart-area {
  position: relative;
  min-height: 220px;
  height: 220px;
  max-height: 220px;
  border-radius: 14px;
  border: 1px solid rgba(0, 255, 245, 0.1);
  background: rgba(0, 0, 0, 0.16);
  padding: 0.5rem;
  overflow-x: hidden;
  max-width: 100%;
}

canvas {
  width: 100% !important;
  height: 100% !important;
}

.log-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
}

.log-entry {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  border-radius: 12px;
  border: 1px solid rgba(0, 255, 245, 0.12);
  background: rgba(0, 0, 0, 0.18);
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  line-height: 1.25;
}

.log-entry[data-state="alert"],
.log-entry[data-state="timeout"] {
  border-color: rgba(248, 113, 113, 0.4);
}

.log-entry[data-state="slow"] {
  border-color: rgba(252, 211, 77, 0.32);
}


.log-entry__main {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
}

.log-latency {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: var(--color-muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.log-entry .log-state {
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  color: var(--color-muted);
}

.targets-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.targets-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.targets-head h3 {
  margin: 0;
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.target-count {
  font-size: 0.8rem;
  color: var(--color-subtle);
}

.target-input {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.target-input input {
  flex: 1 1 220px;
  border-radius: 10px;
  border: 1px solid rgba(0, 255, 245, 0.2);
  background: rgba(0, 0, 0, 0.14);
  padding: 0.5rem 0.75rem;
  transition:
    border-color var(--transition-speed) ease,
    background-color var(--transition-speed) ease;
}

.target-input input:focus {
  outline: none;
  border-color: rgba(0, 255, 245, 0.5);
  box-shadow: var(--color-cyan-glow);
}

.target-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  max-height: 220px;
  overflow-y: auto;
}

.target-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  border-radius: 12px;
  border: 1px solid rgba(0, 255, 245, 0.12);
  background: rgba(0, 0, 0, 0.16);
  padding: 0.55rem 0.75rem;
}

.target-item.is-active {
  border-color: rgba(0, 255, 245, 0.45);
  box-shadow: var(--color-cyan-glow);
}

.target-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.target-actions {
  display: inline-flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.target-actions button {
  border-radius: 8px;
  border: 1px solid rgba(0, 255, 245, 0.16);
  background: rgba(0, 0, 0, 0.12);
  padding: 0.35rem 0.6rem;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    background-color var(--transition-speed) ease,
    border-color var(--transition-speed) ease;
}

.target-actions button:hover,
.target-actions button:focus-visible {
  border-color: rgba(0, 255, 245, 0.35);
  box-shadow: var(--color-cyan-glow);
  outline: none;
}

.settings-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
}

.settings-form .form-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.settings-form label {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.settings-form input,
.settings-form select {
  border-radius: 10px;
  border: 1px solid rgba(0, 255, 245, 0.2);
  background: rgba(0, 0, 0, 0.14);
  padding: 0.55rem 0.7rem;
  transition:
    border-color var(--transition-speed) ease,
    background-color var(--transition-speed) ease;
}

.settings-form select {
  appearance: none;
}

.settings-form input:focus,
.settings-form select:focus {
  outline: none;
  border-color: rgba(0, 255, 245, 0.5);
  box-shadow: var(--color-cyan-glow);
}

.settings-form > .primary-button {
  grid-column: 1 / -1;
  justify-self: center;
  align-self: center;
}

.settings-form .profiles-section {
  grid-column: 1 / -1;
}

.card-profiles {
  gap: clamp(0.65rem, 2.4vw, 1rem);
  padding: clamp(0.75rem, 2.8vw, 1.25rem);
  background: rgba(10, 26, 44, 0.82);
  border: 1px solid rgba(34, 211, 238, 0.22);
  box-shadow: var(--color-cyan-glow);
}

body[data-theme="light"] .card-profiles {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(14, 165, 233, 0.24);
}

.profiles-modes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(0.4rem, 2vw, 0.6rem);
}

@media (max-width: 520px) {
  .profiles-modes {
    grid-template-columns: minmax(0, 1fr);
  }
}

.profile-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  border-radius: 999px;
  border: 1px solid rgba(0, 255, 245, 0.24);
  background: rgba(0, 0, 0, 0.12);
  color: var(--color-text);
  padding: clamp(0.35rem, 1.4vw + 0.2rem, 0.6rem)
    clamp(0.75rem, 3vw, 1.1rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: clamp(0.7rem, 2.5vw, 0.85rem);
  cursor: pointer;
  transition:
    background-color var(--transition-speed) ease,
    border-color var(--transition-speed) ease,
    box-shadow var(--transition-speed) ease;
}

.profile-toggle.is-active {
  border-color: rgba(0, 255, 245, 0.5);
  background: rgba(0, 255, 245, 0.12);
  box-shadow: var(--color-cyan-glow);
}

.profile-options {
  display: flex;
  flex-direction: column;
  gap: clamp(0.5rem, 2.2vw, 0.75rem);
  margin-top: 0.4rem;
}

.profile-options.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.profile-options .form-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.profile-options .form-row:first-child {
  padding-top: 0.2rem;
}

.profile-options label {
  font-size: clamp(0.68rem, 1.8vw, 0.75rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.profile-options select {
  border-radius: 10px;
  border: 1px solid rgba(0, 255, 245, 0.2);
  background: rgba(0, 0, 0, 0.14);
  padding: 0.45rem 0.6rem;
  min-width: 0;
}

@media (max-width: 640px) {
  .card-profiles {
    padding: 0.75rem;
  }

  .profile-options .form-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
  }

  .profile-options select,
  .profile-options span {
    width: 100%;
  }

  .profile-toggle {
    padding: 0.45rem 0.9rem;
  }
}

.modal-host {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 4vw, 2.5rem);
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 1100;
}

.modal-host.is-active {
  opacity: 1;
  pointer-events: auto;
}

.modal-window {
  width: min(800px, 100%);
  max-height: min(90vh, 720px);
  background: rgba(6, 14, 28, 0.94);
  border-radius: 24px;
  border: 1px solid rgba(34, 211, 238, 0.28);
  box-shadow: 0 32px 80px rgba(2, 12, 30, 0.75);
  padding: clamp(1.25rem, 3vw, 1.85rem);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  overflow: hidden;
  opacity: 0;
  transform: scale(0.95);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.modal-window.is-visible {
  opacity: 1;
  transform: scale(1);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.modal-header__titles {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.modal-header__titles h2 {
  margin: 0;
  font-size: 1.15rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.modal-subtitle {
  margin: 0;
  font-size: 0.95rem;
  color: var(--color-muted);
  letter-spacing: 0.02em;
}

.modal-close {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(71, 85, 105, 0.45);
  background: rgba(51, 65, 85, 0.35);
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s ease;
}

.modal-close:hover,
.modal-close:focus-visible {
  background: rgba(71, 85, 105, 0.55);
  border-color: rgba(34, 211, 238, 0.4);
  box-shadow: 0 0 16px rgba(34, 211, 238, 0.3);
  outline: none;
}

.modal-close span {
  font-size: 1.5rem;
  line-height: 1;
}

.modal-body {
  display: grid;
  gap: 1.25rem;
  flex: 1;
  overflow-y: auto;
  padding-right: 0.25rem;
  padding-bottom: 0.75rem;
}

.modal-body::-webkit-scrollbar {
  width: 8px;
}

.modal-body::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3);
  border-radius: 999px;
}

.modal-panel {
  background: rgba(4, 16, 30, 0.72);
  border-radius: 18px;
  border: 1px solid rgba(34, 211, 238, 0.16);
  box-shadow: inset 0 0 0 1px rgba(2, 132, 199, 0.12);
  padding: 1.1rem 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.settings-modal .settings-form {
  padding: 0;
  gap: 1rem;
}

.settings-modal .settings-form .form-row {
  gap: 0.5rem;
}

.settings-modal .targets-section {
  gap: 1rem;
}

.settings-modal .target-list {
  max-height: 240px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translate(-50%, 18px);
  background: rgba(15, 118, 110, 0.92);
  color: #ecfeff;
  padding: 0.6rem 1.25rem;
  border-radius: 999px;
  border: 1px solid rgba(45, 212, 191, 0.42);
  box-shadow: var(--glow-cyan);
  opacity: 0;
  pointer-events: none;
  z-index: 1300;
  transition:
    opacity 0.28s ease,
    transform 0.32s ease;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (min-width: 1100px) {
  .dashboard-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-rows: auto;
  }

  .card-logs--primary {
    grid-column: 1;
    grid-row: 1;
  }

  .card-summary {
    grid-column: 2;
    grid-row: 1;
  }

  .card-chart {
    grid-column: 3;
    grid-row: 1 / span 2;
  }

  .card-failures {
    grid-column: 4;
    grid-row: 1;
  }
}

@media (max-width: 900px) {
  body {
    padding: 1.25rem 1rem 2rem;
  }

  .topbar {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 1rem;
  }

  .topbar-center {
    width: auto;
  }

  .topbar-actions {
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .brand {
    justify-content: center;
  }

  .brand-copy {
    flex-direction: column;
    align-items: center;
  }

  .brand-meta {
    justify-content: center;
  }

  .brand-tagline {
    text-align: center;
  }

  .brand-name {
    text-align: center;
  }

  .brand-status {
    align-items: center;
  }

  .topbar-actions {
    flex-direction: column;
  }

  .action-buttons {
    width: 100%;
    justify-content: center;
  }

  .modal-window {
    padding: 1.1rem;
    border-radius: 18px;
  }

  .modal-close {
    width: 38px;
    height: 38px;
  }

  .modal-subtitle {
    font-size: 0.9rem;
  }

  .modal-host {
    align-items: flex-start;
    padding-top: 3.5rem;
  }

  .settings-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .settings-form > .primary-button {
    width: 100%;
    justify-self: stretch;
  }
}
