:root {
  color-scheme: light;
  --primary: #150f23;
  --ink-deep: #1f1633;
  --on-primary: #ffffff;
  --lime: #c2ef4e;
  --pink: #fa7faa;
  --violet: #6a5fc1;
  --violet-deep: #422082;
  --violet-mid: #79628c;
  --night: #150f23;
  --dark-canvas: #1f1633;
  --press: #efefef;
  --hairline-violet: #362d59;
  --hairline-cool: #cfcfdb;
  --hairline-cloud: #e5e7eb;
  --dark-muted: rgba(255, 255, 255, 0.72);
  --dark-faint: rgba(255, 255, 255, 0.18);
  --ok: #c2ef4e;
  --warn: #fa7faa;
  --bad: #ff6b6b;
  --pending: #bdb8c0;
  --focus: rgba(157, 193, 245, 0.5);
  --shadow-light: rgba(0, 0, 0, 0.1) 0 10px 15px -3px, rgba(0, 0, 0, 0.1) 0 4px 6px -4px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--dark-canvas);
  color: var(--ink-deep);
  font-family: Rubik, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  background-image:
    radial-gradient(circle at 12% 18%, rgba(255, 255, 255, 0.55) 0 1px, transparent 1px),
    radial-gradient(circle at 76% 11%, rgba(255, 255, 255, 0.4) 0 1px, transparent 1px),
    radial-gradient(circle at 28% 64%, rgba(194, 239, 78, 0.45) 0 1px, transparent 1px),
    radial-gradient(circle at 86% 72%, rgba(250, 127, 170, 0.38) 0 1px, transparent 1px);
  background-size: 180px 160px, 220px 190px, 260px 210px, 300px 240px;
  opacity: 0.34;
}

button,
input {
  font: inherit;
}

button {
  min-height: 44px;
  border: 0;
  cursor: pointer;
  letter-spacing: 0.2px;
  text-transform: uppercase;
  transition: background 150ms ease, color 150ms ease, transform 150ms ease;
}

button:active {
  transform: translateY(1px);
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

h1,
h2,
p {
  margin: 0;
}

.app-shell {
  width: 100%;
  min-height: 100vh;
  margin: 0;
  padding: 24px;
}

.hero-panel {
  position: relative;
  overflow: hidden;
  min-height: 430px;
  border: 1px solid var(--hairline-violet);
  border-radius: 18px;
  padding: 24px;
  background: var(--dark-canvas);
  color: var(--on-primary);
}

.hero-panel::after {
  position: absolute;
  right: 34px;
  bottom: 28px;
  width: 118px;
  height: 78px;
  border: 3px solid var(--pink);
  border-radius: 18px 18px 26px 18px;
  content: "";
  transform: rotate(-6deg);
  opacity: 0.7;
}

.hero-panel::before {
  position: absolute;
  right: 74px;
  bottom: 54px;
  width: 50px;
  height: 16px;
  border-top: 5px solid var(--lime);
  border-bottom: 5px solid var(--lime);
  content: "";
  transform: rotate(-6deg);
  opacity: 0.8;
}

.topbar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--hairline-violet);
  border-radius: 12px;
  background: var(--night);
  color: var(--lime);
  font: 700 14px/1 Monaco, Menlo, monospace;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--on-primary);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.2px;
  line-height: 1.4;
  text-transform: uppercase;
}

.brand-subtitle,
.hero-text,
.sync-time,
.console-card p {
  color: var(--dark-muted);
}

.brand-subtitle {
  font-size: 14px;
  line-height: 1.43;
}

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

.connection-panel {
  display: grid;
  justify-items: end;
  gap: 6px;
}

.socket-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  border: 1px solid var(--hairline-violet);
  border-radius: 12px;
  padding: 8px 16px;
  background: var(--violet-mid);
  color: var(--on-primary);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.2px;
  white-space: nowrap;
  text-transform: uppercase;
}

.socket-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.socket-connected {
  background: var(--lime);
  color: var(--ink-deep);
}

.socket-connected .socket-pulse,
.status-checking .status-dot {
  animation: pulse 1.4s ease-out infinite;
}

.socket-degraded,
.socket-connecting {
  background: var(--violet-mid);
  color: var(--on-primary);
}

.socket-disconnected {
  background: var(--pink);
  color: var(--ink-deep);
}

.sync-time {
  font-size: 14px;
  line-height: 1.43;
  white-space: nowrap;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--on-primary);
  color: var(--ink-deep);
  font-weight: 800;
  box-shadow: rgb(21, 15, 35) 0 0 8px 6px;
}

.icon-button:hover {
  background: var(--press);
}

.hero-content {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 32px;
  align-items: end;
  min-height: 300px;
  padding-top: 48px;
}

.hero-copy {
  max-width: 720px;
}

.hero-copy h1 {
  max-width: 780px;
  font-family: "Arial Black", Rubik, system-ui, sans-serif;
  font-size: clamp(48px, 8vw, 88px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: 0;
  word-break: keep-all;
}

.hero-copy h1 span {
  display: inline-block;
  border-radius: 4px;
  padding: 0 12px;
  background: var(--lime);
  color: var(--ink-deep);
}

.hero-text {
  max-width: 560px;
  margin-top: 24px;
  font-size: 16px;
  line-height: 2;
}

.console-card {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
  border: 1px solid var(--hairline-violet);
  border-radius: 18px;
  padding: 24px;
  background: var(--night);
  color: var(--on-primary);
  transform: rotate(1.5deg);
}

.console-dots {
  display: flex;
  gap: 6px;
}

.console-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--dark-faint);
}

.console-dots span:nth-child(1) {
  background: var(--pink);
}

.console-dots span:nth-child(2) {
  background: var(--lime);
}

.console-dots span:nth-child(3) {
  background: var(--violet);
}

.console-card code {
  color: var(--lime);
  font: 400 16px/1.5 Monaco, Menlo, Ubuntu Mono, monospace;
}

.console-card strong {
  font-size: 24px;
  font-weight: 500;
  line-height: 1.25;
}

.console-card p {
  font-size: 14px;
  line-height: 1.43;
}

.dashboard-panel {
  margin-top: 24px;
  border-radius: 18px;
  padding: 24px;
  background: var(--on-primary);
  color: var(--ink-deep);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.metric {
  min-height: 120px;
  border: 1px solid var(--hairline-cloud);
  border-radius: 12px;
  padding: 20px;
  background: var(--on-primary);
  box-shadow: var(--shadow-light);
}

.metric-label {
  color: var(--ink-deep);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.25px;
  line-height: 1.8;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 14px;
  font-family: "Arial Black", Rubik, system-ui, sans-serif;
  font-size: 52px;
  line-height: 1;
}

.metric-total,
.metric-checking {
  background: var(--night);
  color: var(--on-primary);
}

.metric-total .metric-label,
.metric-checking .metric-label {
  color: var(--dark-muted);
}

.metric-up strong {
  color: #5f7d00;
}

.metric-checking strong {
  color: var(--lime);
}

.metric-warn strong {
  color: #a44770;
}

.metric-down strong {
  color: #c53030;
}

.toolbar {
  display: flex;
  align-items: end;
  gap: 12px;
  margin-bottom: 16px;
  border-radius: 12px;
  padding: 16px;
  background: var(--ink-deep);
  color: var(--on-primary);
}

.token-field {
  display: grid;
  flex: 1;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
}

.token-field input {
  min-height: 44px;
  width: 100%;
  border: 1px solid var(--hairline-cool);
  border-radius: 6px;
  padding: 8px 12px;
  background: var(--on-primary);
  color: var(--ink-deep);
  outline: none;
}

.token-field input:focus {
  box-shadow: rgba(0, 0, 0, 0.15) 0 2px 10px inset;
}

.token-field small {
  color: var(--dark-muted);
  font-size: 14px;
  font-weight: 400;
}

.primary-button {
  border-radius: 8px;
  padding: 12px 16px;
  background: var(--on-primary);
  color: var(--ink-deep);
  font-size: 14px;
  font-weight: 800;
}

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

.ghost-button {
  border-radius: 12px;
  padding: 8px 16px;
  background: var(--dark-faint);
  color: var(--on-primary);
  font-size: 14px;
  font-weight: 600;
}

.ghost-button:hover {
  background: var(--violet-mid);
}

.monitor-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr));
  gap: 16px;
}

.check-card {
  display: grid;
  gap: 18px;
  min-height: 270px;
  border: 1px solid var(--hairline-cloud);
  border-radius: 12px;
  padding: 24px;
  background: var(--on-primary);
  box-shadow: var(--shadow-light);
}

.check-card.status-up {
  border-top: 8px solid var(--lime);
}

.check-card.status-degraded {
  border-top: 8px solid var(--pink);
}

.check-card.status-down {
  border-top: 8px solid var(--bad);
}

.check-card.status-checking {
  border-top: 8px solid var(--violet);
}

.check-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.check-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.status-dot {
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--pending);
}

.status-up .status-dot {
  background: #5f7d00;
}

.status-degraded .status-dot {
  background: var(--pink);
}

.status-down .status-dot {
  background: var(--bad);
}

.status-checking .status-dot {
  background: var(--violet);
}

.check-name {
  overflow-wrap: anywhere;
  font-size: 24px;
  font-weight: 500;
  line-height: 1.25;
}

.method-pill,
.status-label {
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.25px;
  line-height: 1.8;
  text-transform: uppercase;
  white-space: nowrap;
}

.method-pill {
  background: var(--night);
  color: var(--on-primary);
}

.status-label {
  background: var(--hairline-cloud);
  color: var(--ink-deep);
}

.status-up .status-label {
  background: var(--lime);
}

.status-degraded .status-label {
  background: var(--pink);
}

.status-down .status-label {
  background: var(--night);
  color: var(--on-primary);
}

.status-checking .status-label {
  background: var(--violet-mid);
  color: var(--on-primary);
}

.check-meta {
  margin-top: 10px;
  color: #5f5867;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--hairline-cloud);
  border-radius: 8px;
}

.check-grid div {
  min-height: 76px;
  padding: 12px;
  background: #fbfbfd;
}

.check-grid div + div {
  border-left: 1px solid var(--hairline-cloud);
}

.check-grid span {
  display: block;
  color: #5f5867;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.25px;
  line-height: 1.8;
  text-transform: uppercase;
}

.check-grid strong {
  display: block;
  margin-top: 8px;
  font: 700 16px/1.5 Monaco, Menlo, Ubuntu Mono, monospace;
  overflow-wrap: anywhere;
}

.sparkline {
  display: grid;
  grid-template-columns: repeat(24, minmax(4px, 1fr));
  align-items: end;
  gap: 4px;
  height: 54px;
}

.spark-bar {
  min-height: 8px;
  border-radius: 4px 4px 0 0;
  background: var(--pending);
}

.spark-bar.status-up {
  background: #5f7d00;
}

.spark-bar.status-degraded {
  background: var(--pink);
}

.spark-bar.status-down {
  background: var(--bad);
}

.spark-bar.status-checking {
  background: var(--violet);
}

.empty-state {
  border: 1px dashed var(--hairline-cloud);
  border-radius: 12px;
  padding: 32px;
  background: var(--on-primary);
  text-align: center;
}

.empty-state h2 {
  font-size: 24px;
  font-weight: 500;
}

.empty-state p {
  margin-top: 10px;
  color: #5f5867;
  font-size: 16px;
  line-height: 1.5;
}

code {
  border-radius: 4px;
  padding: 2px 6px;
  background: var(--night);
  color: var(--on-primary);
  font-family: Monaco, Menlo, Ubuntu Mono, monospace;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 currentColor;
  }
  70% {
    box-shadow: 0 0 0 8px transparent;
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}

@media (max-width: 1040px) {
  .hero-content {
    grid-template-columns: 1fr;
  }

  .console-card {
    max-width: 520px;
    transform: rotate(0);
  }

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

@media (max-width: 900px) {
  .monitor-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: 100%;
    padding-top: 10px;
    padding-right: 10px;
    padding-left: 10px;
  }

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

  .topbar,
  .toolbar,
  .check-main {
    align-items: stretch;
    flex-direction: column;
  }

  .top-actions {
    justify-content: space-between;
  }

  .connection-panel {
    justify-items: start;
  }

  .hero-copy h1 {
    font-size: clamp(42px, 13vw, 60px);
  }

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

  .check-grid div:nth-child(3) {
    border-left: 0;
  }

  .check-grid div:nth-child(n + 3) {
    border-top: 1px solid var(--hairline-cloud);
  }

  .sync-time {
    white-space: normal;
  }
}

@media (max-width: 520px) {
  .brand-lockup {
    align-items: flex-start;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .top-actions {
    flex-wrap: wrap;
  }

  .hero-panel::before,
  .hero-panel::after {
    display: none;
  }
}
