:root {
  --bg: #0b0d10;
  --bg-soft: #101318;
  --panel: #12161c;
  --panel-2: #161b23;
  --line: #232a35;
  --line-soft: #1b212b;
  --text: #e8edf4;
  --text-dim: #9aa7b8;
  --text-faint: #5d6b7e;
  --accent: #f6821f;
  --accent-soft: rgba(246, 130, 31, 0.14);
  --accent-line: rgba(246, 130, 31, 0.4);
  --ok: #3ecf8e;
  --ok-soft: rgba(62, 207, 142, 0.12);
  --err: #f0564a;
  --err-soft: rgba(240, 86, 74, 0.12);
  --warn: #f2c14e;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --radius: 10px;
  --radius-sm: 7px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* subtle blueprint grid — the "harness" motif */
.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 44px 44px;
  opacity: 0.35;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, black 30%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, black 30%, transparent 78%);
  z-index: 0;
}

/* ---------- top bar ---------- */
.topbar {
  position: relative;
  z-index: 2;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 13, 16, 0.85);
  backdrop-filter: blur(6px);
}
.topbar__inner {
  max-width: 880px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand { display: flex; align-items: center; gap: 11px; color: var(--accent); }
.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__name {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.02em;
  color: var(--text);
}
.brand__sub {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.topbar__status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  border: 1px solid var(--line);
  background: var(--bg-soft);
  padding: 6px 12px;
  border-radius: 999px;
}
.topbar__status .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--text-faint);
  transition: background 0.2s, box-shadow 0.2s;
}
.topbar__status[data-state="busy"] .dot { background: var(--warn); box-shadow: 0 0 8px var(--warn); }
.topbar__status[data-state="ok"] .dot { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.topbar__status[data-state="err"] .dot { background: var(--err); box-shadow: 0 0 8px var(--err); }

/* ---------- console layout ---------- */
.console {
  position: relative;
  z-index: 1;
  flex: 1;
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 34px 24px 48px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 28px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.02) inset, 0 12px 32px rgba(0,0,0,0.35);
}
.panel__head { margin-bottom: 20px; }
.panel__head h2 {
  margin: 10px 0 6px;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.panel__hint {
  margin: 0;
  color: var(--text-dim);
  font-size: 13.5px;
  max-width: 60ch;
}

.step-badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--accent);
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  padding: 3px 9px;
  border-radius: 4px;
}

/* ---------- fields ---------- */
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field--wide { grid-column: 1 / -1; }
.field label, .field__label {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.field input[type="text"],
.field input[type="password"] {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--text);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input::placeholder { color: var(--text-faint); }
.field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field input[aria-invalid="true"] {
  border-color: var(--err);
  box-shadow: 0 0 0 3px var(--err-soft);
}
.field__inputwrap { position: relative; }
.field__inputwrap input { padding-right: 42px; }
.field__toggle {
  position: absolute;
  right: 8px; top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  padding: 6px;
  border-radius: 5px;
  display: grid;
  place-items: center;
}
.field__toggle:hover { color: var(--text-dim); background: var(--line-soft); }
.field__toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.field__error {
  margin: 0;
  font-size: 12.5px;
  color: var(--err);
  font-family: var(--mono);
}
.field__hint-inline {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-faint);
}
.field__hint-inline code {
  font-family: var(--mono);
  font-size: 11.5px;
  background: var(--line-soft);
  padding: 1px 5px;
  border-radius: 4px;
  color: var(--text-dim);
}

/* ---------- source / dropzone ---------- */
.source { display: flex; flex-direction: column; gap: 10px; }
.source__drop {
  border: 1.5px dashed var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  padding: 26px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  text-align: center;
  color: var(--text-faint);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.source__drop:hover, .source__drop:focus-visible {
  border-color: var(--accent-line);
  color: var(--text-dim);
  outline: none;
}
.source__drop:focus-visible { box-shadow: 0 0 0 3px var(--accent-soft); }
.source__drop.is-dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text);
}
.source__drop.has-files {
  border-style: solid;
  border-color: var(--ok);
  background: var(--ok-soft);
  color: var(--text);
}
.source__drop-title { font-weight: 600; font-size: 14.5px; color: var(--text-dim); }
.source__drop.has-files .source__drop-title { color: var(--ok); }
.source__drop-sub { font-size: 12.5px; }
.source__drop-sub code {
  font-family: var(--mono);
  font-size: 11.5px;
  background: var(--line-soft);
  padding: 1px 5px;
  border-radius: 4px;
}
.linklike { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

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

/* ---------- buttons ---------- */
.btn {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  border-radius: var(--radius-sm);
  padding: 11px 20px;
  cursor: pointer;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.05s;
  position: relative;
}
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #14100a;
}
.btn--primary:hover:not(:disabled) { background: #ff9438; border-color: #ff9438; }

.btn--ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text-dim);
}
.btn--ghost:hover:not(:disabled) { border-color: var(--text-faint); color: var(--text); background: var(--line-soft); }

.btn--sm { padding: 9px 16px; font-size: 13px; }

.btn__spinner {
  width: 14px; height: 14px;
  border: 2px solid rgba(0,0,0,0.25);
  border-top-color: currentColor;
  border-radius: 50%;
  display: none;
  animation: spin 0.7s linear infinite;
}
.btn.is-busy .btn__spinner { display: inline-block; }
.btn.is-busy .btn__label { opacity: 0.85; }
@keyframes spin { to { transform: rotate(360deg); } }

.panel__actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
  margin-top: 6px;
  flex-wrap: wrap;
}

/* ---------- verify rows ---------- */
.verify {
  margin-top: 18px;
  border-top: 1px solid var(--line-soft);
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.verify__row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-dim);
}
.verify__icon {
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid var(--text-faint);
  flex-shrink: 0;
  position: relative;
  transition: border-color 0.2s, background 0.2s;
}
.verify__row.is-busy .verify__icon {
  border-color: var(--warn);
  border-top-color: transparent;
  animation: spin 0.7s linear infinite;
}
.verify__row.is-ok .verify__icon {
  border-color: var(--ok);
  background: var(--ok);
}
.verify__row.is-ok .verify__icon::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--panel);
  clip-path: polygon(20% 55%, 42% 75%, 80% 30%, 88% 40%, 42% 88%, 12% 58%);
}
.verify__row.is-err .verify__icon { border-color: var(--err); background: var(--err-soft); }
.verify__row.is-err { color: var(--err); }

/* ---------- deploy meta ---------- */
.deploy-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.meta-chip {
  flex: 1;
  min-width: 140px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.meta-chip__k {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.meta-chip__v {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--text);
  word-break: break-all;
}

/* ---------- progress ---------- */
.progress { margin-bottom: 18px; }
.progress__bar {
  height: 6px;
  background: var(--line-soft);
  border-radius: 999px;
  overflow: hidden;
}
.progress__fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.25s ease;
}
.progress__label {
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text-dim);
}

/* ---------- result ---------- */
.panel--result, .panel--error {
  text-align: center;
  padding: 40px 28px;
}
.result__badge {
  width: 64px; height: 64px;
  margin: 0 auto 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--ok);
  background: var(--ok-soft);
  border: 1px solid rgba(62, 207, 142, 0.35);
}
.result__badge--error {
  color: var(--err);
  background: var(--err-soft);
  border-color: rgba(240, 86, 74, 0.35);
}
.panel--result h2, .panel--error h2 {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}
.result__sub {
  color: var(--text-dim);
  margin: 0 0 22px;
  font-size: 14.5px;
}

.result__urlbox {
  display: flex;
  gap: 8px;
  max-width: 560px;
  margin: 0 auto 14px;
}
.result__urlbox input {
  flex: 1;
  min-width: 0;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--accent);
  background: var(--bg-soft);
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.result__urlbox input:focus { outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }

.result__links {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.result__detail {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-faint);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.7;
  word-break: break-all;
}

.error__pre {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--err);
  background: var(--err-soft);
  border: 1px solid rgba(240, 86, 74, 0.3);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  max-width: 560px;
  margin: 0 auto 22px;
  white-space: pre-wrap;
  word-break: break-word;
  text-align: left;
  max-height: 200px;
  overflow: auto;
}

/* ---------- footer ---------- */
.foot {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--line);
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-faint);
  max-width: 100%;
}
.foot__note { color: var(--text-faint); }

/* ---------- responsive ---------- */
@media (max-width: 640px) {
  .fields { grid-template-columns: 1fr; }
  .console { padding: 22px 16px 36px; }
  .panel { padding: 20px 18px; }
  .topbar__inner { padding: 12px 16px; }
  .topbar__status-label { display: none; }
  .result__urlbox { flex-direction: column; }
  .panel--result h2, .panel--error h2 { font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
