:root {
  color-scheme: dark;
  --bg: #000000;
  --text: #f4f4f4;
  --muted: #b8b8b8;
  --brand-blue: #078dfb;
  --panel: #060606;
  --border: #1f1f1f;
  --border-accent: #123252;
  --input-bg: #0b0b0b;
  --input-border: #2d2d2d;
  --ok: #6dce8a;
  --err: #ff8f8f;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(7, 141, 251, 0.12), transparent 55%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 16px 64px;
}

h1, h2, h3 {
  margin: 0 0 8px;
}

p, li {
  color: var(--muted);
}

a {
  color: var(--text);
}

strong {
  color: var(--text);
  font-weight: 700;
}

.hero {
  text-align: center;
  margin-bottom: 28px;
}

.logo-link {
  display: inline-block;
}

.logo {
  width: min(220px, 58vw);
  max-height: 132px;
  object-fit: contain;
  margin-bottom: 12px;
}

.hero h1 {
  font-size: clamp(1.55rem, 4vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

.hero-lead {
  margin: 0 auto;
  max-width: 34em;
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--muted);
}

/* How it works strip */
.overview {
  margin-bottom: 22px;
}

.overview-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.overview-step {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 14px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.overview-step strong {
  display: block;
  font-size: 14px;
  margin-bottom: 2px;
}

.overview-step p {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
}

.overview-num {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  background: #121212;
  border: 1px solid #2a2a2a;
  color: var(--muted);
}

.overview-step.is-current {
  border-color: var(--border-accent);
  background: #070b10;
}

.overview-step.is-current .overview-num {
  background: rgba(7, 141, 251, 0.2);
  border-color: rgba(7, 141, 251, 0.55);
  color: #d9efff;
}

.overview-step.is-done .overview-num {
  background: rgba(109, 206, 138, 0.15);
  border-color: rgba(109, 206, 138, 0.45);
  color: var(--ok);
}

.overview-note {
  margin: 12px 0 0;
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
}

.overview-note em {
  font-style: normal;
  color: #d9efff;
}

/* Cards / steps */
.card {
  padding: 18px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 16px;
}

.card-accent {
  border-color: var(--border-accent);
}

.flow-card.is-active {
  box-shadow: 0 0 0 1px rgba(7, 141, 251, 0.2);
}

.card-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.step-label {
  margin: 0;
  color: var(--brand-blue);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}

.card-head h2 {
  font-size: 1.25rem;
  margin: 0;
}

.card-desc {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}

label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: var(--text);
  font-size: 14px;
}

textarea,
input[type="text"],
input[type="number"] {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text);
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
}

textarea {
  min-height: 200px;
  resize: vertical;
  line-height: 1.45;
}

textarea:focus,
input:focus {
  outline: 2px solid rgba(7, 141, 251, 0.55);
  outline-offset: 1px;
}

/* Paste / upload tabs */
.input-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  border-radius: 10px;
  background: #0a0a0a;
  border: 1px solid #1a1a1a;
}

.input-tab {
  border: 0;
  border-radius: 8px;
  min-height: 38px;
  background: transparent;
  color: var(--muted);
  font-weight: 650;
  font-size: 14px;
  cursor: pointer;
}

.input-tab.is-active {
  background: #1a1a1a;
  color: var(--text);
}

.tab-panel {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 160px;
  padding: 24px 16px;
  border: 1px dashed #3a3a3a;
  border-radius: 12px;
  background: #080808;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.dropzone:hover,
.dropzone.is-dragover {
  border-color: rgba(7, 141, 251, 0.7);
  background: #0a1016;
}

.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.dropzone-title {
  color: var(--text);
  font-weight: 700;
  font-size: 15px;
}

.dropzone-sub {
  color: var(--muted);
  font-size: 13px;
}

.dropzone-file {
  margin-top: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(7, 141, 251, 0.45);
  background: rgba(7, 141, 251, 0.12);
  color: #d9efff;
  font-size: 12px;
  font-weight: 650;
}

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

.row-actions-end {
  justify-content: flex-end;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid #ffffff;
  font-weight: 700;
  font-size: 14px;
  background: #1f1f1f;
  color: #ffffff;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover:not(:disabled) {
  background: #2b2b2b;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-primary {
  border: none;
  border-radius: 9999px;
  background-color: #03a9f4;
  color: #fff;
  font-weight: 600;
  padding: 10px 24px;
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.06);
  background-color: #03a9f4;
  box-shadow: none;
  transform: none;
}

.btn-danger {
  border-color: #5a2020;
  background: #1a0c0c;
}

.btn-ghost {
  border-color: #333;
  background: transparent;
  font-weight: 600;
}

.status-line {
  min-height: 1.25em;
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
}

.status-ok {
  color: var(--ok);
}

.status-err {
  color: var(--err);
}

.name-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
}

.meta-line {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.checklist {
  margin: 0;
  padding: 0 0 0 1.15em;
  display: grid;
  gap: 6px;
}

.checklist li {
  font-size: 14px;
  line-height: 1.4;
  color: var(--text);
}

.stages {
  display: grid;
  gap: 12px;
}

.stage-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #050505;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.stage-head h3 {
  margin: 0;
  font-size: 16px;
}

.target-table {
  width: 100%;
  border-collapse: collapse;
}

.target-table th {
  text-align: left;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand-blue);
  font-weight: 700;
  padding: 0 8px 8px 0;
}

.target-table td {
  padding: 4px 8px 4px 0;
  vertical-align: middle;
}

.target-table th:last-child,
.target-table td:last-child {
  padding-right: 0;
  width: 44px;
  text-align: right;
}

.target-table input[type="number"] {
  padding: 8px 10px;
  font-variant-numeric: tabular-nums;
}

.icon-btn {
  width: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid #333;
  background: #121212;
  color: var(--muted);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

.icon-btn:hover:not(:disabled) {
  color: var(--text);
  border-color: #555;
}

.preview-empty {
  padding: 28px 12px;
  text-align: center;
  border: 1px dashed #2a2a2a;
  border-radius: 10px;
  color: var(--muted);
}

.json-details {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #050505;
  padding: 12px 14px;
}

.json-details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--muted);
  font-size: 13px;
}

.json-details pre {
  margin: 12px 0 0;
  padding: 12px;
  border-radius: 8px;
  background: #0a0a0a;
  border: 1px solid #1a1a1a;
  overflow: auto;
  font-size: 12px;
  line-height: 1.45;
  color: #d9efff;
  max-height: 280px;
}

.help-card details summary {
  cursor: pointer;
  font-weight: 650;
  color: var(--text);
  font-size: 15px;
}

.help-list {
  margin: 12px 0 0;
  padding-left: 1.15em;
  display: grid;
  gap: 10px;
}

.help-list li {
  font-size: 14px;
  line-height: 1.45;
}

.port-token {
  display: inline-block;
  padding: 0.12em 0.45em;
  border-radius: 999px;
  border: 1px solid rgba(7, 141, 251, 0.7);
  background: rgba(7, 141, 251, 0.16);
  color: #d9efff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.92em;
  font-weight: 700;
}

.hidden {
  display: none !important;
}

@media (max-width: 720px) {
  .overview-steps {
    grid-template-columns: 1fr;
  }

  .name-row {
    grid-template-columns: 1fr;
  }

  .row-actions-end {
    justify-content: stretch;
  }

  .row-actions-end .btn {
    flex: 1;
  }

  .target-table thead {
    display: none;
  }

  .target-table,
  .target-table tbody,
  .target-table tr,
  .target-table td {
    display: block;
    width: 100%;
  }

  .target-table tr {
    border: 1px solid #1a1a1a;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 8px;
  }

  .target-table td {
    padding: 6px 0;
  }

  .target-table td::before {
    content: attr(data-label);
    display: block;
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--brand-blue);
    font-weight: 700;
    margin-bottom: 4px;
  }

  .target-table td:last-child {
    text-align: left;
    width: 100%;
  }
}
