/* Dreamer UI v2 — single accent + neutral base, geometric sans,
   tabular numbers, hierarchy from whitespace and type size.
   No section is hidden by CSS; visibility follows on-chain state via JS. */
:root {
  --accent: #2563eb;
  --accent-soft: #eef2ff;
  --bg: #fafafa;
  --surface: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --faint: #9ca3af;
  --line: #e7e7eb;
  --ok: #059669;
  --ok-soft: #ecfdf5;
  --warn: #d97706;
  --warn-soft: #fffbeb;
  --bad: #dc2626;
  --bad-soft: #fef2f2;
  --radius: 14px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "Space Grotesk", "Inter", "Helvetica Neue", Arial,
    "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
.num, .mono, .kv b, td, .tnum {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}
a { color: var(--accent); }
button { font-family: inherit; }

/* ------------------------------------------------------------ header */
header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; max-width: 1120px; margin: 0 auto; padding: 20px 24px 4px;
}
.logo {
  display: flex; align-items: center; gap: 9px;
  font-size: 18px; font-weight: 700; letter-spacing: -0.02em;
  text-decoration: none; color: var(--text); white-space: nowrap;
}
.logo .mark {
  width: 26px; height: 26px; border-radius: 8px; background: var(--accent);
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700; flex: none;
}
.logo .platform-name { color: var(--text); }
nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
nav a {
  color: var(--muted); text-decoration: none; font-size: 14px;
  padding: 7px 11px; border-radius: 8px;
}
nav a:hover { color: var(--text); }
nav a.active { color: var(--text); font-weight: 600; }
#wallet-btn { margin-left: 10px; }

/* ------------------------------------------------------------ layout */
main { max-width: 1120px; margin: 0 auto; padding: 12px 24px 56px; }
h1 { font-size: 32px; font-weight: 700; letter-spacing: -0.03em; margin: 26px 0 8px; }
h2 { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; margin: 34px 0 14px; }
.sub { color: var(--muted); font-size: 15px; margin-bottom: 28px; max-width: 640px; }
footer {
  max-width: 1120px; margin: 0 auto; padding: 22px 24px 34px;
  border-top: 1px solid var(--line);
  color: var(--muted); font-size: 13px;
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
footer .mono { color: var(--faint); }

/* ------------------------------------------------------------ buttons */
button, .btn {
  background: var(--accent); color: #fff; border: 0; border-radius: 10px;
  padding: 11px 20px; font-size: 14px; font-weight: 600; cursor: pointer;
  display: inline-block; text-decoration: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
button:hover, .btn:hover { opacity: 0.88; }
button:active, .btn:active { transform: translateY(1px); }
button:disabled { opacity: 0.45; cursor: not-allowed; }
button.ghost, .btn.ghost {
  background: var(--surface); color: var(--text); border: 1px solid var(--line);
}
button.small { padding: 8px 14px; font-size: 13px; border-radius: 8px; }

/* ------------------------------------------------------------ summary line */
.sumline {
  font-size: 14px; color: var(--muted); margin: -12px 0 26px;
}
.sumline b { color: var(--text); font-weight: 700; }

/* ------------------------------------------------------------ filters */
.toolbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 18px;
}
.ftabs { display: flex; gap: 6px; flex-wrap: wrap; }
.ftab {
  background: transparent; color: var(--muted); border: 1px solid var(--line);
  padding: 7px 14px; font-size: 13px; font-weight: 500; border-radius: 999px;
}
.ftab:hover { color: var(--text); opacity: 1; }
.ftab.active { background: var(--text); color: #fff; border-color: var(--text); }
.search { margin-left: auto; }
.search input {
  width: 220px; padding: 9px 13px; border: 1px solid var(--line);
  border-radius: 999px; font-size: 13px; background: var(--surface); color: var(--text);
}

/* ------------------------------------------------------------ launch list rows */
.lhead, .lrow {
  display: grid;
  grid-template-columns: minmax(150px, 1.4fr) minmax(160px, 1.6fr) minmax(90px, 0.7fr) minmax(100px, 0.8fr);
  gap: 16px; align-items: center;
  padding: 13px 16px;
}
.lhead {
  font-size: 12px; font-weight: 600; color: var(--muted);
  padding-bottom: 6px;
}
.lrow {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; margin-bottom: 10px;
  text-decoration: none; color: var(--text);
  transition: border-color 0.15s ease, transform 0.15s ease;
  animation: rise 0.35s ease both;
}
.lrow:hover { border-color: var(--accent); transform: translateY(-1px); }
@keyframes rise {
  from { opacity: 0.85; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}
.lrow .who { min-width: 0; }
.lrow .who .nm { font-size: 15.5px; font-weight: 700; letter-spacing: -0.01em; word-break: break-word; }
.lrow .who .sm { color: var(--muted); font-size: 12.5px; margin-top: 1px; }
.lrow .prog .bar { margin: 0 0 5px; }
.lrow .prog .pt { font-size: 12.5px; color: var(--muted); }
.lrow .amt { font-size: 15px; font-weight: 700; }
.lrow .amt .of { display: block; font-size: 12px; color: var(--muted); font-weight: 400; }
.lrow .when { font-size: 13.5px; color: var(--muted); }
.lrow .when b { color: var(--text); font-weight: 600; display: block; font-size: 14px; }
.badges { display: flex; gap: 6px; flex: none; flex-wrap: wrap; }
.badge {
  display: inline-block; font-size: 12px; font-weight: 600;
  padding: 2px 9px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); white-space: nowrap;
}
.badge.tier { background: #f3f4f6; color: var(--muted); }
.badge.done { background: var(--ok-soft); color: var(--ok); }
.badge.end { background: var(--bad-soft); color: var(--bad); }
.bar { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin: 16px 0 8px; }
.bar i {
  display: block; height: 100%; background: var(--accent); border-radius: 3px;
  transition: width 0.4s ease;
}
.bar.big { height: 10px; border-radius: 5px; margin: 14px 0 10px; }
.meta {
  display: flex; justify-content: space-between; gap: 8px;
  font-size: 13px; color: var(--muted);
}
.meta b { color: var(--text); font-weight: 600; }
.empty {
  color: var(--muted); font-size: 14px; padding: 40px 0; text-align: center;
  grid-column: 1 / -1;
}

/* ------------------------------------------------------------ table */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left; font-size: 12px; font-weight: 600; color: var(--muted);
  padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
td { padding: 13px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td a { text-decoration: none; font-weight: 600; }
.rank-num { color: var(--faint); font-weight: 700; }

/* ------------------------------------------------------------ panels */
.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px; margin-bottom: 18px;
}
.panel h2 { margin-top: 0; }
.kv {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 8px 0; font-size: 14px; border-bottom: 1px solid var(--line);
}
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--muted); flex: none; }
.kv b { font-weight: 600; text-align: right; word-break: break-all; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.head-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.head-row h1 { margin: 0; }
.addr-line {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  color: var(--muted); font-size: 13px; margin: 10px 0 4px;
}
.addr-line .mono { color: var(--text); }

/* ------------------------------------------------------------ forms */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
input, select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 10px; font-size: 14px; background: var(--surface);
  color: var(--text); font-family: inherit;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent-soft); border-color: var(--accent);
}
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.check input { width: auto; }

.presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 26px; }
.preset-card {
  text-align: left; background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; cursor: pointer; width: 100%;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.preset-card:hover { opacity: 1; border-color: var(--accent); transform: translateY(-2px); }
.preset-card.active { border-color: var(--accent); background: var(--accent-soft); }
.preset-card .p-name { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.preset-card .p-raise { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; margin: 6px 0 2px; }
.preset-card .p-desc { font-size: 12.5px; color: var(--muted); font-weight: 400; line-height: 1.55; }
.summary { position: sticky; top: 18px; }
.summary .kv b { color: var(--accent); }
.summary .kv b.plain { color: var(--text); }

/* ------------------------------------------------------------ launch page */
.stepper { display: flex; align-items: stretch; gap: 8px; }
.stepper button { padding: 10px 16px; }
.stepper input { text-align: center; font-size: 16px; font-weight: 600; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; align-items: center; }
.cost-line { font-size: 14px; color: var(--muted); margin-top: 12px; }
.cost-line b { color: var(--text); font-size: 16px; }
.activity { list-style: none; }
.activity li {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13.5px;
}
.activity li:last-child { border-bottom: 0; }
.activity .a-type { font-weight: 700; flex: none; }
.activity .a-meta { color: var(--muted); text-align: right; }
#status, .status {
  font-size: 13px; color: var(--muted); margin-top: 14px;
  white-space: pre-wrap; word-break: break-all;
}

/* ------------------------------------------------------------ responsive */
@media (max-width: 760px) {
  h1 { font-size: 26px; }
  header { padding: 16px 16px 2px; }
  main { padding: 8px 16px 48px; }
  footer { padding: 20px 16px 30px; }
  .cols, .row, .presets { grid-template-columns: 1fr; }
  .summary { position: static; }
  .search { margin-left: 0; width: 100%; }
  .search input { width: 100%; }
  .lhead { display: none; }
  .lrow { grid-template-columns: 1fr 1fr; row-gap: 8px; }
  #wallet-btn { margin-left: 0; }
}
