/* AutoPilot — OPN Chain */

:root {
  --bg: #0a0d12;
  --panel: #11161e;
  --panel-2: #161d27;
  --line: #222c3a;
  --ink: #e8edf5;
  --ink-dim: #8b98ab;
  --ink-faint: #5b6779;
  --accent: #4ade9b;
  --accent-dim: #1d7d55;
  --warn: #f5b544;
  --danger: #f2707c;
  --radius: 12px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 ui-sans-serif, -apple-system, "Segoe UI", Roboto, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  background-image:
    radial-gradient(900px 500px at 78% -8%, rgba(74, 222, 155, 0.10), transparent 60%),
    radial-gradient(700px 420px at 8% 0%, rgba(80, 140, 255, 0.07), transparent 55%);
  background-repeat: no-repeat;
  min-height: 100vh;
}

code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12.5px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.hidden { display: none !important; }

/* ---------------- header ---------------- */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: rgba(10, 13, 18, 0.82);
  backdrop-filter: blur(10px);
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 640;
  letter-spacing: -0.01em;
  font-size: 16px;
}

.mark {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: linear-gradient(140deg, var(--accent), var(--accent-dim));
  color: #06231a;
  font-weight: 800;
}

.top-right { display: flex; align-items: center; gap: 12px; }

.chip {
  font-size: 12px;
  color: var(--ink-dim);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 11px;
  white-space: nowrap;
}

/* ---------------- layout ---------------- */

main {
  max-width: 860px;
  margin: 0 auto;
  padding: 40px 20px 72px;
}

.hero { margin-bottom: 40px; }

.hero h1 {
  font-size: clamp(28px, 5vw, 42px);
  line-height: 1.12;
  letter-spacing: -0.025em;
  margin: 0 0 16px;
  font-weight: 660;
}

.lede {
  color: var(--ink-dim);
  max-width: 62ch;
  margin: 0 0 28px;
  font-size: 15.5px;
}

.hero-points {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}

.hero-points > div {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  background: var(--panel);
}

.hero-points strong { display: block; font-size: 14px; margin-bottom: 5px; }
.hero-points span { color: var(--ink-faint); font-size: 13px; line-height: 1.5; }

/* ---------------- cards ---------------- */

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 20px;
  margin-bottom: 18px;
}

.card.center { text-align: center; color: var(--ink-dim); }

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.card-head h2 {
  font-size: 15px;
  margin: 0;
  font-weight: 620;
  letter-spacing: -0.01em;
}

.badge {
  font-size: 11.5px;
  text-transform: lowercase;
  color: var(--ink-faint);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
}

.badge.ok { color: var(--accent); border-color: var(--accent-dim); }
.badge.warn { color: var(--warn); border-color: #6b5220; }

/* ---------------- rows ---------------- */

.rows { display: flex; flex-direction: column; gap: 1px; background: var(--line); border-radius: 9px; overflow: hidden; }

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 14px;
  background: var(--panel-2);
  font-size: 13.5px;
}

.row > span { color: var(--ink-faint); }
.row > b { font-weight: 560; }
.row code { color: var(--ink-dim); word-break: break-all; }

.hint {
  color: var(--ink-faint);
  font-size: 12.5px;
  line-height: 1.5;
  margin: 12px 0 0;
  max-width: 68ch;
}

/* ---------------- buttons ---------------- */

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--ink);
  border-radius: 9px;
  padding: 9px 16px;
  font-size: 13.5px;
  font-weight: 540;
  cursor: pointer;
  font-family: inherit;
  transition: background 120ms ease, border-color 120ms ease, opacity 120ms ease;
}

.btn:hover:not(:disabled) { background: #1c2532; border-color: #2e3a4b; }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #06231a;
  font-weight: 640;
}

.btn-primary:hover:not(:disabled) { background: #63e8ac; border-color: #63e8ac; }

.btn-ghost { background: transparent; color: var(--ink-dim); }
.btn-ghost:hover:not(:disabled) { color: var(--danger); border-color: #5d2b33; background: transparent; }

.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---------------- form ---------------- */

.fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.fields label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 12.5px;
  color: var(--ink-dim);
}

.input-wrap {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel-2);
  padding: 0 12px;
}

.input-wrap:focus-within { border-color: var(--accent-dim); }

.input-wrap input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  padding: 10px 0;
}

.input-wrap span { color: var(--ink-faint); font-size: 12px; padding-left: 8px; }

/* ---------------- countdown ---------------- */

.countdown { display: flex; align-items: center; gap: 12px; margin-top: 16px; }

.countdown-bar {
  flex: 1;
  height: 5px;
  background: var(--panel-2);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.countdown-bar > div {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent));
  transition: width 400ms linear;
}

#cdLabel { font-size: 12.5px; color: var(--ink-dim); min-width: 128px; text-align: right; }

/* ---------------- feed ---------------- */

.feed { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow-y: auto; }

.feed-empty, .feed-item {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 13px;
  background: var(--panel-2);
  font-size: 13px;
}

.feed-empty { color: var(--ink-faint); text-align: center; }

.feed-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.feed-item .who { color: var(--ink-dim); }
.feed-item .amt { color: var(--accent); font-weight: 560; white-space: nowrap; }
.feed-item code { color: var(--ink-faint); }

/* ---------------- footer ---------------- */

footer {
  border-top: 1px solid var(--line);
  padding: 22px 24px 40px;
  color: var(--ink-faint);
  font-size: 12.5px;
  text-align: center;
}

.deployed { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 8px; }

/* ---------------- toast ---------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 18px;
  font-size: 13.5px;
  z-index: 60;
  max-width: min(90vw, 560px);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5);
}

.toast.err { border-color: #5d2b33; color: var(--danger); }
.toast.ok { border-color: var(--accent-dim); color: var(--accent); }

@media (max-width: 560px) {
  .top { padding: 14px 16px; }
  main { padding: 28px 14px 56px; }
  .row { flex-direction: column; align-items: flex-start; gap: 4px; }
}
