:root {
  --bg: #050806;
  --card: #0c120f;
  --card-2: #101914;
  --text: #ecfff5;
  --muted: #97ad9f;
  --line: rgba(0, 255, 128, .18);
  --green: #00ff80;
  --green-2: #00c868;
  --red: #ff5f73;
  --yellow: #ffd166;
  --shadow: 0 20px 70px rgba(0, 0, 0, .35);
  --radius: 20px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 0%, rgba(0, 255, 128, .14), transparent 34%),
    radial-gradient(circle at 90% 10%, rgba(0, 200, 104, .10), transparent 30%),
    var(--bg);
}

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

.app-shell {
  width: min(1240px, calc(100% - 32px));
  margin: 32px auto;
}

.card {
  background: linear-gradient(180deg, rgba(16, 25, 20, .92), rgba(9, 14, 11, .96));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero {
  padding: 30px;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, .8fr);
  gap: 24px;
  align-items: center;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--green);
  letter-spacing: .12em;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 800;
}

h1, h2 { margin: 0; }

h1 {
  font-size: clamp(34px, 6vw, 64px);
  line-height: .95;
  letter-spacing: -0.05em;
}

h2 {
  font-size: 22px;
  letter-spacing: -0.02em;
}

.subtitle {
  max-width: 820px;
  color: var(--muted);
  line-height: 1.7;
  margin: 18px 0 0;
}

.subtitle strong { color: var(--text); }

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

.hero-stats div {
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, .22);
  border-radius: 16px;
  padding: 18px;
}

.hero-stats span {
  display: block;
  color: var(--green);
  font-size: 34px;
  font-weight: 900;
}

.hero-stats small {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr);
  gap: 20px;
  margin-top: 20px;
}

.input-card, .guide-card, .result-card { padding: 24px; }

label {
  display: block;
  margin-bottom: 10px;
  color: var(--text);
  font-weight: 800;
}

textarea {
  width: 100%;
  min-height: 280px;
  resize: vertical;
  border: 1px solid var(--line);
  outline: none;
  border-radius: 16px;
  padding: 16px;
  color: var(--green);
  background: #040705;
  line-height: 1.55;
}

textarea:focus, select:focus {
  border-color: rgba(0, 255, 128, .72);
  box-shadow: 0 0 0 4px rgba(0, 255, 128, .08);
}

.hint-row {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
}

.controls, .result-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.controls { margin-top: 18px; }

button {
  border: 0;
  border-radius: 12px;
  padding: 12px 16px;
  cursor: pointer;
  background: linear-gradient(135deg, var(--green), var(--green-2));
  color: #001409;
  font-weight: 900;
}

button:hover { transform: translateY(-1px); }
button:disabled { opacity: .55; cursor: not-allowed; transform: none; }

button.secondary, button.ghost {
  color: var(--text);
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--line);
}

button.ghost {
  padding: 8px 12px;
  font-size: 13px;
}

.options {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.checkline {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 0;
  color: var(--muted);
  font-weight: 600;
}

.checkline input { accent-color: var(--green); }

.progress-wrap {
  height: 12px;
  overflow: hidden;
  margin-top: 20px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .04);
}

.progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--green-2));
  transition: width .25s ease;
}

.status-line {
  min-height: 22px;
  margin: 12px 0 0;
  color: var(--muted);
}

.guide-card p {
  color: var(--muted);
  line-height: 1.65;
}

pre {
  overflow: auto;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #040705;
  padding: 16px;
  color: var(--green);
}

.small-note { font-size: 14px; }

.result-card { margin-top: 20px; }

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

#resultInfo { color: var(--muted); margin: 8px 0 0; }

select {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 14px;
  background: #040705;
  color: var(--text);
  outline: none;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 920px;
}

th, td {
  padding: 13px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(0, 255, 128, .10);
  vertical-align: top;
}

th {
  color: var(--muted);
  background: rgba(0, 255, 128, .05);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .06em;
}

td { color: #dfffee; }

a { color: var(--green); word-break: break-all; }

.empty {
  text-align: center;
  color: var(--muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .04em;
}

.badge.index { color: #001409; background: var(--green); }
.badge.not { color: #210006; background: var(--red); }
.badge.unknown { color: #231700; background: var(--yellow); }
.badge.cache { color: var(--green); border: 1px solid var(--line); background: rgba(0, 255, 128, .06); }

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(420px, calc(100% - 36px));
  z-index: 50;
  padding: 14px 16px;
  border-radius: 14px;
  color: var(--text);
  background: #0f1913;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

@media (max-width: 900px) {
  .hero, .grid { grid-template-columns: 1fr; }
  .result-head { flex-direction: column; }
  .result-actions { width: 100%; }
  .result-actions button, .result-actions select { flex: 1 1 auto; }
}

@media (max-width: 560px) {
  .app-shell { width: min(100% - 18px, 1240px); margin: 10px auto; }
  .hero, .input-card, .guide-card, .result-card { padding: 18px; }
  .hero-stats { grid-template-columns: 1fr; }
  textarea { min-height: 220px; }
}
