:root {
  --bg: #050816;
  --bg-soft: rgba(10, 16, 34, 0.82);
  --panel: rgba(10, 14, 30, 0.92);
  --line: rgba(130, 180, 255, 0.14);
  --brand: #00d8ff;
  --brand-2: #7d7cff;
  --good: #2ee59d;
  --warn: #ffbe5c;
  --bad: #ff557d;
  --text: #edf4ff;
  --muted: rgba(237, 244, 255, 0.64);
  --shadow: 0 26px 90px rgba(0, 0, 0, 0.52);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(0, 216, 255, 0.18), transparent 36%),
    radial-gradient(circle at bottom right, rgba(125, 124, 255, 0.16), transparent 34%),
    linear-gradient(180deg, #040711 0%, #08101f 100%);
  color: var(--text);
  font-family: "Segoe UI", "Inter", system-ui, sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 32px 32px;
  opacity: 0.3;
  pointer-events: none;
}

.page-shell {
  max-width: 1360px;
  margin: 0 auto;
  padding: 32px 24px 56px;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  padding: 28px;
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(9, 18, 42, 0.92), rgba(11, 16, 28, 0.88));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.eyebrow,
.panel-kicker {
  margin: 0 0 10px;
  color: var(--brand);
  font-size: 12px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
}

.hero h1,
.panel h2 {
  margin: 0;
  letter-spacing: -0.03em;
}

.hero h1 {
  font-size: clamp(32px, 5vw, 56px);
}

.hero-copy {
  max-width: 760px;
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.tool-links {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.tool-link {
  display: inline-flex;
  align-items: center;
  padding: 10px 16px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.2s;
}

.tool-link:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.5);
  transform: translateY(-2px);
}

.hero-link,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 14px;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  font-weight: 700;
}

.hero-link,
.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #041019;
  box-shadow: 0 18px 44px rgba(0, 216, 255, 0.25);
}

.hero-link.secondary,
.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.hero-link:hover,
.btn:hover {
  transform: translateY(-2px);
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(320px, 0.95fr);
  gap: 22px;
  margin-top: 24px;
}

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

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.panel-head.compact {
  margin-bottom: 18px;
}

.state-badge {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.state-badge.idle { color: var(--muted); }
.state-badge.running { color: var(--brand); border-color: rgba(0, 216, 255, 0.3); }
.state-badge.done { color: var(--good); border-color: rgba(46, 229, 157, 0.3); }
.state-badge.failed { color: var(--bad); border-color: rgba(255, 85, 125, 0.3); }

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

.stat-card {
  padding: 18px;
  border-radius: 18px;
  background: var(--bg-soft);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.stat-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.stat-value {
  display: block;
  margin-top: 10px;
  font-size: 22px;
  font-weight: 800;
}

.stat-value.small {
  font-size: 15px;
  line-height: 1.5;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.progress-shell {
  margin-top: 22px;
  padding: 20px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}

.progress-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.progress-side {
  color: var(--muted);
  text-align: right;
  font-size: 14px;
}

.progress-track {
  margin-top: 14px;
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--brand-2), var(--good));
  box-shadow: 0 0 26px rgba(0, 216, 255, 0.35);
  transition: width 0.35s ease;
}

.progress-current {
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
  word-break: break-word;
}

.notice {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  line-height: 1.6;
}

.notice.success { border-color: rgba(46, 229, 157, 0.24); color: #dfffee; }
.notice.error { border-color: rgba(255, 85, 125, 0.24); color: #ffe4ea; }

.tag-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag-item {
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 13px;
}

.panel-note {
  margin-top: 18px;
  color: var(--muted);
  line-height: 1.7;
}

.history-panel {
  grid-column: 1 / -1;
}

.snapshot-list {
  display: grid;
  gap: 14px;
}

.snapshot-item,
.empty-state {
  padding: 18px;
  border-radius: 18px;
  background: var(--bg-soft);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.snapshot-item {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) repeat(3, minmax(120px, 0.55fr));
  gap: 14px;
  align-items: center;
}

.snapshot-name {
  font-weight: 800;
  font-size: 16px;
}

.snapshot-path {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  word-break: break-word;
}

.snapshot-meta {
  display: grid;
  gap: 6px;
}

.snapshot-meta span {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.snapshot-meta strong {
  font-size: 14px;
}

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

  .history-panel {
    grid-column: auto;
  }
}

@media (max-width: 720px) {
  .page-shell {
    padding: 20px 14px 40px;
  }

  .hero,
  .panel {
    padding: 18px;
    border-radius: 20px;
  }

  .hero {
    flex-direction: column;
  }

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

  .snapshot-item {
    grid-template-columns: 1fr;
  }

  .progress-meta {
    flex-direction: column;
    align-items: flex-start;
  }

  .progress-side {
    text-align: left;
  }
}
