:root {
  --bg: #08111a;
  --bg-2: #0d1b26;
  --panel: rgba(15, 27, 38, 0.78);
  --panel-solid: #102130;
  --panel-border: rgba(159, 189, 212, 0.18);
  --panel-border-strong: rgba(159, 189, 212, 0.3);
  --text: #e8f1f7;
  --muted: #9fb5c6;
  --soft: #7f97aa;
  --line: rgba(159, 189, 212, 0.14);
  --accent: #19a7ce;
  --accent-2: #f59e0b;
  --success: #22c55e;
  --danger: #ef4444;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  --radius: 16px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html, body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 15% 15%, rgba(25, 167, 206, 0.18), transparent 38%),
    radial-gradient(circle at 85% 12%, rgba(245, 158, 11, 0.12), transparent 45%),
    radial-gradient(circle at 50% 120%, rgba(25, 167, 206, 0.1), transparent 55%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
}

.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(159, 189, 212, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(159, 189, 212, 0.06) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: radial-gradient(circle at 50% 30%, #000 45%, transparent 100%);
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1280px, calc(100% - 32px));
  margin: 24px auto 48px;
}

.hero-panel {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 16px;
  padding: 18px;
  border-radius: calc(var(--radius) + 4px);
  border: 1px solid var(--panel-border);
  background: linear-gradient(180deg, rgba(16, 33, 48, 0.78), rgba(10, 24, 36, 0.72));
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.hero-copy {
  padding: 8px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(25, 167, 206, 0.24);
  background: rgba(25, 167, 206, 0.08);
  color: #9fdff0;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero-copy h1 {
  margin: 12px 0 10px;
  line-height: 1.02;
  letter-spacing: -0.02em;
  font-weight: 700;
  font-size: clamp(1.8rem, 3.4vw, 3.05rem);
  max-width: 18ch;
}

.hero-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  max-width: 62ch;
}

.hero-meta {
  display: grid;
  gap: 12px;
}

.meta-card {
  border: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius);
  padding: 14px;
  min-height: 112px;
  display: grid;
  align-content: start;
  gap: 6px;
}

.meta-card.accent {
  background: linear-gradient(180deg, rgba(25, 167, 206, 0.12), rgba(245, 158, 11, 0.06));
  border-color: rgba(25, 167, 206, 0.28);
}

.meta-card strong {
  font-size: 1rem;
}

.meta-card small,
.meta-card .meta-label {
  color: var(--muted);
}

.meta-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.panel {
  border-radius: var(--radius);
  border: 1px solid var(--panel-border);
  background: var(--panel);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 16px;
}

.panel-head {
  margin-bottom: 12px;
}

.panel-head h2 {
  margin: 0 0 6px;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

.panel-head p {
  margin: 0;
  color: var(--muted);
}

.panel-head.split {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

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

.upload-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.upload-head h2 {
  margin: 0 0 4px;
  font-size: 1.1rem;
}

.upload-head p {
  margin: 0;
  color: var(--muted);
}

.upload-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.dropzone {
  position: relative;
  display: grid;
  gap: 4px;
  border: 1px dashed rgba(159, 189, 212, 0.35);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01)),
    radial-gradient(circle at 8% 8%, rgba(25, 167, 206, 0.1), transparent 40%);
  border-radius: 14px;
  padding: 16px;
  cursor: pointer;
  transition: border-color 120ms ease, transform 120ms ease, background-color 120ms ease;
}

.dropzone:hover {
  border-color: rgba(25, 167, 206, 0.5);
  transform: translateY(-1px);
}

.dropzone:focus-within {
  outline: 2px solid rgba(25, 167, 206, 0.42);
  outline-offset: 2px;
}

.dropzone-title {
  font-weight: 700;
}

.dropzone-sub {
  color: var(--muted);
  font-size: 0.95rem;
}

.dropzone input[type="file"] {
  margin-top: 6px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  color: var(--text);
  background: rgba(8, 17, 26, 0.5);
}

.btn {
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 14px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 120ms ease, filter 120ms ease, border-color 120ms ease, background 120ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  color: #03131a;
  background: linear-gradient(135deg, #27d3ff, #7be3ff 55%, #f7c566 120%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.btn-ghost {
  color: var(--text);
  border-color: var(--panel-border-strong);
  background: rgba(255, 255, 255, 0.02);
}

.btn-inline {
  color: var(--text);
  border-color: rgba(25, 167, 206, 0.25);
  background: rgba(25, 167, 206, 0.07);
  padding: 7px 11px;
  font-size: 0.92rem;
}

.btn-inline.is-ok {
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.14);
}

.btn-inline.is-error {
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.14);
}

.notice-stack {
  display: grid;
  gap: 10px;
}

.notice {
  border: 1px solid rgba(245, 158, 11, 0.28);
  background: rgba(245, 158, 11, 0.08);
  color: #ffd28a;
  border-radius: 12px;
  padding: 10px 12px;
}

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

.stat-card {
  border-radius: 14px;
  border: 1px solid var(--panel-border);
  background: linear-gradient(180deg, rgba(15, 27, 38, 0.84), rgba(10, 24, 36, 0.78));
  box-shadow: var(--shadow);
  padding: 14px;
  display: grid;
  gap: 4px;
}

.stat-card span,
.stat-card small {
  color: var(--muted);
}

.stat-card strong {
  font-size: 1.5rem;
  letter-spacing: -0.02em;
}

.table-wrap {
  overflow: auto;
  border-radius: 12px;
  border: 1px solid var(--line);
}

.table-wrap.compact {
  max-height: 320px;
}

table {
  width: 100%;
  min-width: 920px;
  border-collapse: separate;
  border-spacing: 0;
  background: rgba(6, 13, 21, 0.35);
}

thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  text-align: left;
  padding: 11px 12px;
  font-size: 0.86rem;
  font-weight: 600;
  color: #b8ccda;
  background: rgba(13, 27, 38, 0.95);
  border-bottom: 1px solid var(--panel-border-strong);
  backdrop-filter: blur(6px);
}

tbody td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.012);
}

tbody tr:hover td {
  background: rgba(25, 167, 206, 0.065);
}

tbody tr:last-child td {
  border-bottom: none;
}

.bulk-output-shell {
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(6, 13, 21, 0.45);
  padding: 10px;
}

.bulk-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  border-radius: 999px;
  border: 1px solid rgba(25, 167, 206, 0.2);
  background: rgba(25, 167, 206, 0.08);
  color: #a8ebfb;
  padding: 5px 10px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

textarea {
  width: 100%;
  min-height: 220px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: rgba(8, 17, 26, 0.72);
  color: var(--text);
  font-family: "IBM Plex Mono", Consolas, monospace;
  font-size: 0.92rem;
  line-height: 1.45;
}

textarea:focus {
  outline: 2px solid rgba(25, 167, 206, 0.4);
  outline-offset: 2px;
}

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

.legend-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--soft);
  font-size: 0.88rem;
  margin-top: 6px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(25, 167, 206, 0.65);
  box-shadow: 0 0 0 4px rgba(25, 167, 206, 0.12);
}

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 8px;
  border: 1px solid rgba(25, 167, 206, 0.22);
  background: rgba(25, 167, 206, 0.08);
  color: #b9f0fb;
  line-height: 1;
}

.pill.subtle {
  color: #c8d9e5;
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(159, 189, 212, 0.2);
}

.mono {
  font-family: "IBM Plex Mono", Consolas, monospace;
  font-size: 0.9rem;
}

.dim {
  color: var(--muted);
}

.warn-text {
  color: #ffd28a;
}

.ok-text {
  color: #9de4b0;
}

code {
  font-family: "IBM Plex Mono", Consolas, monospace;
  font-size: 0.9em;
  color: #c9eef8;
  background: rgba(25, 167, 206, 0.08);
  border: 1px solid rgba(25, 167, 206, 0.18);
  border-radius: 6px;
  padding: 2px 5px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translate(-50%, 12px);
  opacity: 0;
  pointer-events: none;
  border-radius: 999px;
  border: 1px solid rgba(159, 189, 212, 0.24);
  background: rgba(11, 21, 30, 0.92);
  color: var(--text);
  padding: 10px 14px;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.35);
  transition: opacity 140ms ease, transform 140ms ease;
  backdrop-filter: blur(8px);
  z-index: 20;
}

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

.reveal {
  animation: fadeUp 380ms ease both;
}

.reveal.delay-1 { animation-delay: 70ms; }
.reveal.delay-2 { animation-delay: 130ms; }
.reveal.delay-3 { animation-delay: 190ms; }

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

  .hero-copy h1 {
    max-width: none;
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: min(1280px, calc(100% - 16px));
    margin-top: 12px;
  }

  .panel,
  .hero-panel {
    padding: 12px;
    border-radius: 14px;
  }

  .upload-head,
  .panel-head.split {
    flex-direction: column;
    align-items: stretch;
  }

  .actions {
    width: 100%;
  }

  .actions .btn,
  .upload-head .btn {
    width: 100%;
  }

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

  textarea {
    min-height: 180px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal.delay-1,
  .reveal.delay-2,
  .reveal.delay-3 {
    animation: none;
  }

  .btn,
  .dropzone,
  .toast {
    transition: none;
  }
}

