:root {
  --bg: #0f1714;
  --bg-soft: #16221d;
  --panel: #1a2923;
  --line: #2c4037;
  --text: #e8f0eb;
  --muted: #93a89c;
  --accent: #3dba7a;
  --accent-2: #1f8f5a;
  --danger: #e26a5a;
  --warn: #e0b35a;
  --ok: #3dba7a;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --radius: 16px;
  --font: "DM Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.45;
}

.bg-mesh {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 500px at 10% -10%, rgba(61, 186, 122, 0.18), transparent 60%),
    radial-gradient(700px 400px at 90% 0%, rgba(40, 110, 90, 0.22), transparent 55%),
    linear-gradient(180deg, #0c1311 0%, #0f1714 40%, #121c18 100%);
}

a { color: var(--accent); }
code, .mono { font-family: var(--mono); font-size: 0.9em; }

.topbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--line);
  background: rgba(15, 23, 20, 0.75);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand { display: flex; gap: 0.85rem; align-items: center; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, var(--accent), var(--accent-2));
  color: #062216; font-weight: 700; letter-spacing: 0.02em;
}
.brand strong { display: block; font-size: 1rem; }
.brand span { color: var(--muted); font-size: 0.85rem; }

.steps { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.step {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.8rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid transparent;
}
.step.is-done { color: var(--text); border-color: var(--line); }
.step.is-active {
  color: #062216;
  background: var(--accent);
  font-weight: 600;
}

.shell {
  width: min(980px, calc(100% - 2rem));
  margin: 1.5rem auto 3rem;
}

.panel {
  background: linear-gradient(180deg, rgba(32, 48, 41, 0.95), rgba(22, 34, 29, 0.98));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

.panel-head h1 {
  margin: 0 0 0.4rem;
  font-size: clamp(1.35rem, 2.4vw, 1.8rem);
  letter-spacing: -0.02em;
}
.panel-head p { margin: 0 0 1.25rem; color: var(--muted); }

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.form-grid label { display: flex; flex-direction: column; gap: 0.4rem; font-size: 0.92rem; }
.form-grid label span em { color: var(--danger); font-style: normal; }
.full { grid-column: 1 / -1; }

input, select, textarea, button {
  font: inherit;
}
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #101a16;
  color: var(--text);
  border-radius: 10px;
  padding: 0.7rem 0.85rem;
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(61, 186, 122, 0.18);
}
textarea { resize: vertical; min-height: 110px; }
small, .muted { color: var(--muted); font-size: 0.85rem; }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: flex-end;
  margin-top: 0.5rem;
}
.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: #15201b;
  color: var(--text);
  border-radius: 999px;
  padding: 0.65rem 1.1rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  transition: transform 0.15s ease, background 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  color: #062216;
}
.btn.danger {
  background: linear-gradient(135deg, #e88778, var(--danger));
  border-color: transparent;
  color: #2a0d09;
}
.btn.ghost { background: transparent; }
.btn.sm { padding: 0.35rem 0.7rem; font-size: 0.85rem; }

.alert {
  padding: 0.85rem 1rem;
  border-radius: 12px;
  margin-bottom: 1rem;
  border: 1px solid var(--line);
}
.alert-success { background: rgba(61, 186, 122, 0.12); border-color: rgba(61, 186, 122, 0.35); }
.alert-error { background: rgba(226, 106, 90, 0.12); border-color: rgba(226, 106, 90, 0.35); }
.warn { color: var(--warn); }

.upload-box { display: grid; gap: 1rem; }
.dropzone {
  display: grid;
  place-items: center;
  gap: 0.35rem;
  min-height: 180px;
  border: 1.5px dashed var(--line);
  border-radius: 14px;
  background: rgba(16, 26, 22, 0.7);
  cursor: pointer;
  text-align: center;
  padding: 1.5rem;
}
.dropzone input { display: none; }
.dropzone-title { font-weight: 600; font-size: 1.05rem; }
.dropzone-hint { color: var(--muted); font-size: 0.9rem; }

.hint-card {
  margin-top: 1.25rem;
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.18);
}
.hint-card h3 { margin: 0 0 0.6rem; font-size: 1rem; }

.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { padding: 0.65rem 0.8rem; border-bottom: 1px solid var(--line); text-align: left; }
th { background: rgba(0, 0, 0, 0.25); color: var(--muted); font-weight: 600; }
.mini-table { width: auto; }
.row-ok td:nth-child(4) { color: var(--ok); }
.row-bad td:nth-child(4) { color: var(--danger); }
.detail { max-width: 360px; word-break: break-word; color: var(--muted); font-size: 0.85rem; }

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.8rem;
  margin-bottom: 1.2rem;
}
.stat {
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.2);
}
.stat span { display: block; color: var(--muted); font-size: 0.82rem; margin-bottom: 0.25rem; }
.stat strong { font-size: 1.25rem; word-break: break-all; }
.stat.ok strong { color: var(--ok); }
.stat.bad strong { color: var(--danger); }

.map-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.map-head h3 { margin: 0; }
.map-rows { display: grid; gap: 0.55rem; margin-top: 0.6rem; }
.map-row { display: grid; grid-template-columns: 1fr auto 1fr; gap: 0.5rem; align-items: center; }

.console, .code-block {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 12px;
  background: #0a100e;
  border: 1px solid var(--line);
  overflow: auto;
  font-family: var(--mono);
  font-size: 0.8rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 0 1rem 2rem;
}

@media (max-width: 720px) {
  .form-grid { grid-template-columns: 1fr; }
  .map-row { grid-template-columns: 1fr; }
  .actions { justify-content: stretch; }
  .btn { width: 100%; }
}
