:root {
  --bg: #000000;
  --text: #ffffff;
  --muted: #9a9a9a;
  --stat: #d8d8d8;
  --border: rgba(255, 255, 255, 0.16);
  --border-soft: rgba(255, 255, 255, 0.12);
  --panel: rgba(255, 255, 255, 0.025);
  --ok: #7ee2a8;
  --warn: #f2c46b;
  --bad: #ff7a7a;
  --info: #a9c4ff;

  --ui: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: "Instrument Serif", "Times New Roman", Times, serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: #000000; background: var(--bg, #000000); color: #ffffff; color: var(--text, #ffffff); }
html { scroll-behavior: smooth; }
body {
  font-family: var(--ui);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
code { font-family: var(--mono); font-size: 0.92em; color: #d8d8d8; }
[hidden] { display: none !important; }

.grain {
  position: fixed; inset: 0; z-index: 100; pointer-events: none; opacity: 0.06; mix-blend-mode: overlay;
  background-image:
    repeating-radial-gradient(circle at 17% 32%, rgba(255,255,255,0.5) 0 0.5px, transparent 0.5px 2px),
    repeating-radial-gradient(circle at 73% 68%, rgba(255,255,255,0.4) 0 0.5px, transparent 0.5px 3px);
}
.glow {
  position: fixed; inset: -20% -10% auto; height: 70vh; z-index: 0; pointer-events: none;
  background: radial-gradient(ellipse at 50% 0%, rgba(160, 185, 230, 0.10), transparent 60%);
}

/* ---------- Header ---------- */
.header {
  position: sticky; top: 0; z-index: 50;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 18px 40px 14px;
  background: linear-gradient(180deg, rgba(0,0,0,0.85), rgba(0,0,0,0.55));
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.logo {
  display: inline-flex; align-items: center; gap: 9px; justify-self: start;
  font-size: 15.5px; font-weight: 600; letter-spacing: -0.03em;
}
.logo svg { width: 22px; height: 22px; flex: none; }
.logo-suffix { font-weight: 400; }
.logo-tag {
  margin-left: 4px; padding: 3px 7px; border-radius: 4px; font-size: 11px; font-weight: 500;
  color: #cfcfcf; border: 1px solid var(--border-soft); letter-spacing: 0;
}

#site-nav { display: flex; align-items: center; gap: 8px; justify-self: center; }
#site-nav a {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 16px; border-radius: 7px;
  border: 1px solid rgba(198, 198, 198, 0.35);
  background: linear-gradient(105deg, #050505 0%, #1c1c1c 48%, #2e2e2e 100%);
  color: #cfcfcf; font-size: 13.5px; font-weight: 400; letter-spacing: -0.01em; white-space: nowrap;
  transition: background 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease, color 0.35s ease;
}
#site-nav a::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,0.16) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform 0.6s ease;
}
#site-nav a:hover, #site-nav a.is-active {
  color: #f3f3f3;
  border-color: rgba(235, 235, 235, 0.9);
  background: linear-gradient(105deg, #111 0%, #3a3a3a 45%, #6a6a6a 100%);
  box-shadow: 0 0 18px rgba(200, 210, 230, 0.18);
}
#site-nav a:hover::before { transform: translateX(120%); }
.nav-count {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  display: inline-grid; place-items: center; font-size: 11px; font-weight: 600;
  background: #fff; color: #111;
}

.header-right { justify-self: end; display: inline-flex; align-items: center; gap: 10px; }
.api-chip {
  display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 11px; border-radius: 15px;
  border: 1px solid var(--border-soft); color: #cfcfcf; font-size: 12px; white-space: nowrap;
}
.api-chip i { width: 7px; height: 7px; border-radius: 50%; background: #666; }
.api-chip.is-online i { background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.api-chip.is-offline i { background: var(--bad); box-shadow: 0 0 10px var(--bad); }

.burger {
  display: none; place-items: center; align-content: center; gap: 5px;
  width: 42px; height: 42px; border-radius: 6px; border: 1px solid var(--border);
  background: rgba(8, 8, 8, 0.55); cursor: pointer; position: relative; z-index: 60;
}
.burger span { display: block; width: 16px; height: 1.5px; border-radius: 1px; background: #fff; transition: transform 0.25s ease, opacity 0.2s ease; }
body.menu-open .burger span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
body.menu-open .burger span:nth-child(2) { opacity: 0; }
body.menu-open .burger span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }
.menu-backdrop { display: none; }

/* ---------- Buttons ---------- */
.btn {
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 6px;
  font-size: 13.5px; font-weight: 500; letter-spacing: -0.02em; line-height: 1; white-space: nowrap; cursor: pointer;
  transition: background 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease, color 0.35s ease, filter 0.35s ease, opacity 0.2s ease;
}
.btn::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(115deg, transparent 20%, rgba(255,255,255,0.45) 48%, transparent 76%);
  transform: translateX(-130%); transition: transform 0.65s ease;
}
.btn:hover::after { transform: translateX(130%); }
.btn-solid {
  background: linear-gradient(180deg, #ffffff 0%, #e7e7e7 48%, #cfcfcf 100%);
  color: #111; border: 1px solid #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,0.95);
}
.btn-solid:hover {
  background: linear-gradient(180deg, #fff 0%, #f3f6ff 42%, #d5def2 100%); border-color: #f2f6ff;
  box-shadow: inset 0 1px 0 #fff, 0 0 22px rgba(186,208,255,0.35), 0 8px 18px rgba(255,255,255,0.12);
}
.btn-ghost {
  background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(0,0,0,0.45) 50%, rgba(160,175,200,0.08));
  color: #fff; border: 1px solid rgba(198,198,198,0.45); box-shadow: inset 0 1px 0 rgba(255,255,255,0.12);
}
.btn-ghost:hover {
  background: linear-gradient(135deg, rgba(210,225,255,0.18), rgba(0,0,0,0.35) 48%, rgba(180,195,220,0.16));
  border-color: rgba(220,230,255,0.75);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.22), 0 0 20px rgba(170,200,255,0.22);
}
.btn-danger { color: #ffd0d0; border-color: rgba(255,122,122,0.45); }
.btn-danger:hover { border-color: rgba(255,150,150,0.85); box-shadow: 0 0 18px rgba(255,122,122,0.22); }
.btn-sm { height: 30px; padding: 0 11px; font-size: 12.5px; }
.btn[disabled] { opacity: 0.55; cursor: progress; }
.btn.is-loading::before {
  content: ""; width: 12px; height: 12px; border-radius: 50%;
  border: 1.6px solid currentColor; border-right-color: transparent; animation: spin 0.7s linear infinite;
}

/* ---------- Layout ---------- */
.console { position: relative; z-index: 1; max-width: 1200px; margin: 0 auto; padding: 40px 32px 80px; }
.tab { animation: in-soft 0.7s var(--ease) both; }

.tab-head { display: flex; flex-direction: column; align-items: center; text-align: center; margin: 12px auto 36px; max-width: 760px; }
.tab-head--left { align-items: flex-start; text-align: left; margin-left: 0; max-width: none; }
.tab-head--row { flex-direction: row; justify-content: space-between; align-items: flex-end; gap: 16px; }
.tab-head h1 { font-size: 40px; font-weight: 500; letter-spacing: -0.045em; line-height: 1.12; }
.tab-head h1 em { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 1.08em; letter-spacing: -0.03em; color: #9a9a9a; }
.lede { margin-top: 12px; color: var(--muted); font-size: 15px; line-height: 1.55; letter-spacing: -0.015em; max-width: 560px; }

.badge {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 18px; padding: 8px 14px; border-radius: 5px;
  background: linear-gradient(90deg, #7d7d7d 0%, #2a2a2a 52%, #0a0a0a 100%); color: #f2f2f2; font-size: 12.5px;
}
.badge-star { width: 16px; height: 18px; filter: drop-shadow(0 0 3px rgba(255,255,255,0.45)); }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-side { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 16px; align-items: start; }

.panel {
  position: relative; padding: 22px; border-radius: 12px;
  border: 1px solid var(--border-soft);
  background: linear-gradient(160deg, rgba(255,255,255,0.045), rgba(255,255,255,0.01) 40%, rgba(160,175,200,0.02));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}
.panel--flush { padding: 0; overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.panel-head h2 { font-size: 15px; font-weight: 500; letter-spacing: -0.02em; }

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.kpi { padding: 18px 20px; border-radius: 12px; border: 1px solid var(--border-soft); background: var(--panel); display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.kpi-label { font-size: 12px; color: var(--muted); }
.kpi-value { font-size: 18px; font-weight: 500; letter-spacing: -0.03em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Phases / contracts ---------- */
.phases { list-style: none; display: grid; gap: 14px; }
.phases li { display: flex; gap: 14px; align-items: flex-start; }
.phase-n {
  flex: none; width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center;
  font-family: var(--serif); font-style: italic; font-size: 17px;
  border: 1px solid rgba(198,198,198,0.4); background: linear-gradient(105deg, #050505, #2a2a2a 60%, #4a4a4a);
}
.phases strong { display: block; font-weight: 500; font-size: 14px; margin-bottom: 3px; }
.phases p { color: var(--muted); font-size: 13px; line-height: 1.5; }

.contracts { list-style: none; display: grid; gap: 8px; }
.contracts li {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.07); background: rgba(255,255,255,0.02);
}
.contracts .name { font-size: 13px; color: #e8e8e8; }
.contracts .addr { display: inline-flex; align-items: center; gap: 6px; }
.empty { color: var(--muted); font-size: 13px; padding: 12px; text-align: center; }

.addr-link { font-family: var(--mono); font-size: 12px; color: #cfcfcf; border-bottom: 1px dashed rgba(255,255,255,0.2); }
.addr-link:hover { color: #fff; border-bottom-color: #fff; }
.copy {
  width: 24px; height: 24px; border-radius: 5px; border: 1px solid transparent; background: transparent; color: #9a9a9a;
  display: inline-grid; place-items: center; cursor: pointer;
}
.copy:hover { color: #fff; border-color: var(--border-soft); }
.copy svg { width: 13px; height: 13px; }

/* ---------- Forms ---------- */
form.panel, .panel form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; flex: 1; }
.field-row { display: flex; gap: 12px; }
label { font-size: 12.5px; color: #cfcfcf; }
input:not([type="checkbox"]), textarea {
  width: 100%; height: 40px; padding: 0 12px; border-radius: 7px;
  border: 1px solid var(--border); background: rgba(0,0,0,0.5); color: #fff;
  font: inherit; font-size: 13.5px; letter-spacing: -0.01em; outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
textarea { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: #5f5f5f; }
input:focus, textarea:focus { border-color: rgba(220,230,255,0.7); box-shadow: 0 0 0 3px rgba(170,200,255,0.12); }
input.mono { font-family: var(--mono); font-size: 12.5px; }
input:user-invalid { border-color: rgba(255,122,122,0.6); }
.input-suffix { display: flex; align-items: stretch; }
.input-suffix input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.suffix {
  display: inline-flex; align-items: center; padding: 0 12px; border: 1px solid var(--border); border-left: 0;
  border-radius: 0 7px 7px 0; color: var(--muted); font-size: 13px; background: rgba(255,255,255,0.03); white-space: nowrap;
}
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.hint { font-size: 12px; color: #7d7d7d; line-height: 1.5; }

.toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13px; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle span { width: 34px; height: 20px; border-radius: 10px; background: #2a2a2a; border: 1px solid var(--border); position: relative; transition: background 0.2s ease; }
.toggle span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #9a9a9a; transition: transform 0.2s ease, background 0.2s ease; }
.toggle input:checked + span { background: #d8d8d8; }
.toggle input:checked + span::after { transform: translateX(14px); background: #111; }
.toggle input:focus-visible + span { box-shadow: 0 0 0 3px rgba(170,200,255,0.25); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button {
  height: 26px; padding: 0 10px; border-radius: 13px; border: 1px solid var(--border-soft);
  background: transparent; color: #cfcfcf; font-size: 12px; cursor: pointer;
}
.chips button:hover { border-color: rgba(255,255,255,0.4); color: #fff; }

/* ---------- Results ---------- */
.result {
  border-radius: 9px; padding: 14px; font-size: 13px; line-height: 1.5;
  border: 1px solid rgba(255,255,255,0.08); background: rgba(255,255,255,0.025);
  animation: in-soft 0.5s var(--ease) both;
}
.result.is-ok { border-color: rgba(126,226,168,0.3); background: rgba(126,226,168,0.05); }
.result.is-err { border-color: rgba(255,122,122,0.35); background: rgba(255,122,122,0.06); color: #ffd0d0; }
.result-title { font-weight: 500; margin-bottom: 8px; }

.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 7px 16px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { min-width: 0; overflow-wrap: anywhere; }

/* ---------- Proposal ---------- */
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 48px 20px; color: var(--muted); text-align: center; }
.empty-state svg { width: 28px; height: 28px; color: #5f5f5f; }
.empty-state p { max-width: 320px; font-size: 13px; line-height: 1.5; }

.route {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 18px; border-radius: 10px; margin-bottom: 16px;
  background: linear-gradient(105deg, rgba(255,255,255,0.05), rgba(255,255,255,0.01));
  border: 1px solid rgba(255,255,255,0.08);
}
.route-side { display: flex; flex-direction: column; gap: 4px; }
.route-side:last-child { text-align: right; }
.route-amt { font-size: 22px; font-weight: 500; letter-spacing: -0.03em; }
.route-sym { font-size: 12px; color: var(--muted); }
.route-arrow { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent); position: relative; }
.route-arrow::after { content: "›"; position: absolute; right: 45%; top: -11px; font-size: 18px; color: #cfcfcf; }

.ops { list-style: none; display: grid; gap: 8px; margin-top: 16px; }
.ops li {
  display: grid; grid-template-columns: 52px minmax(0,1fr) auto; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.07); background: rgba(255,255,255,0.02);
}
.op-code { font-family: var(--mono); font-size: 12px; color: #111; background: #e8e8e8; border-radius: 4px; padding: 3px 6px; text-align: center; }
.op-name { font-size: 13px; }
.op-name small { display: block; color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.op-amt { font-family: var(--mono); font-size: 11.5px; color: #cfcfcf; text-align: right; }

.status-pill {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 12px;
  font-size: 11.5px; font-weight: 500; letter-spacing: 0; white-space: nowrap;
  border: 1px solid currentColor; background: transparent;
}
.status-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.s-executed, .s-ok { color: var(--ok); }
.s-pending, .s-warn { color: var(--warn); }
.s-verified { color: var(--info); }
.s-cancelled, .s-err { color: var(--bad); }

/* ---------- Pipeline ---------- */
.pipeline { list-style: none; display: grid; gap: 0; }
.pipeline li { display: flex; gap: 14px; position: relative; padding-bottom: 20px; }
.pipeline li:last-child { padding-bottom: 4px; }
.pipeline li:not(:last-child)::before {
  content: ""; position: absolute; left: 7px; top: 20px; bottom: 0; width: 1px; background: rgba(255,255,255,0.12);
}
.pipeline .dot {
  flex: none; width: 15px; height: 15px; margin-top: 2px; border-radius: 50%;
  border: 1.5px solid #4a4a4a; background: #000; position: relative; z-index: 1; transition: all 0.3s ease;
}
.pipeline strong { display: block; font-weight: 500; font-size: 14px; color: #9a9a9a; transition: color 0.3s ease; }
.pipeline p { color: #6a6a6a; font-size: 12.5px; margin-top: 2px; }
.pipeline li.is-active .dot { border-color: #fff; box-shadow: 0 0 0 4px rgba(255,255,255,0.08); animation: pulse 1.2s ease-in-out infinite; }
.pipeline li.is-active strong { color: #fff; }
.pipeline li.is-done .dot { border-color: var(--ok); background: var(--ok); }
.pipeline li.is-done strong { color: #fff; }
.pipeline li.is-wait .dot { border-color: var(--warn); background: var(--warn); animation: pulse 1.2s ease-in-out infinite; }
.pipeline li.is-wait strong { color: var(--warn); }
.pipeline li.is-fail .dot { border-color: var(--bad); background: var(--bad); }
.pipeline li.is-fail strong { color: var(--bad); }
.pipeline li.is-skip strong { color: #6a6a6a; text-decoration: line-through; }
#exec-result { margin-top: 16px; }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left; font-weight: 500; font-size: 12px; color: var(--muted);
  padding: 14px 16px; border-bottom: 1px solid var(--border-soft); white-space: nowrap;
}
.table td { padding: 13px 16px; border-bottom: 1px solid rgba(255,255,255,0.06); white-space: nowrap; vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: rgba(255,255,255,0.02); }
.table td.empty { text-align: center; padding: 40px 16px; }
.table .mono { font-family: var(--mono); font-size: 12px; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 20px; }
.modal-scrim { position: absolute; inset: 0; background: rgba(0,0,0,0.6); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); animation: fade 0.3s ease both; }
.modal-card {
  position: relative; width: min(480px, 100%); padding: 30px 28px 26px; border-radius: 16px; text-align: center;
  border: 1px solid rgba(255,255,255,0.14);
  background: linear-gradient(165deg, #151515, #070707 60%, #0b0d12);
  box-shadow: 0 30px 80px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.08);
  animation: in-pop 0.5s var(--ease) both;
}
.modal-card h2 { font-size: 20px; font-weight: 500; letter-spacing: -0.03em; margin: 16px 0 10px; }
.modal-prompt { color: #bdbdbd; font-size: 13.5px; line-height: 1.55; }
.modal-card .kv { text-align: left; margin: 18px 0 14px; padding: 14px; border-radius: 10px; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.07); }
.modal-card .hint { text-align: left; }
.modal-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.modal-actions .btn { width: 100%; height: 44px; }
.modal-x { position: absolute; top: 12px; right: 14px; width: 30px; height: 30px; border: 0; background: transparent; color: #9a9a9a; font-size: 22px; cursor: pointer; border-radius: 6px; }
.modal-x:hover { color: #fff; background: rgba(255,255,255,0.06); }
.wid-orb {
  width: 72px; height: 72px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, #3a3a3a, #0a0a0a 70%);
  border: 1px solid rgba(255,255,255,0.2); box-shadow: 0 0 40px rgba(170,200,255,0.18);
}
.wid-orb svg { width: 38px; height: 38px; }
.modal.is-scanning .wid-orb { animation: pulse 1s ease-in-out infinite; }
.modal.is-scanning .wid-orb svg { animation: spin 2.4s linear infinite; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 95; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 40px)); }
.toast {
  padding: 12px 14px; border-radius: 9px; font-size: 13px; line-height: 1.45;
  background: rgba(18,18,18,0.92); border: 1px solid var(--border); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.5); animation: in-side 0.4s var(--ease) both;
}
.toast.is-err { border-color: rgba(255,122,122,0.5); color: #ffd0d0; }
.toast.is-ok { border-color: rgba(126,226,168,0.4); }
.toast.is-out { opacity: 0; transform: translateX(12px); transition: all 0.3s ease; }

/* ---------- Motion ---------- */
@keyframes in-soft { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes in-side { from { opacity: 0; transform: translateX(22px); } to { opacity: 1; transform: none; } }
@keyframes in-pop { 0% { opacity: 0; transform: scale(0.9); } 70% { opacity: 1; transform: scale(1.03); } 100% { opacity: 1; transform: scale(1); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(255,255,255,0.04), 0 0 30px rgba(170,200,255,0.25); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-side { grid-template-columns: minmax(0, 1fr); }
  .api-chip span { display: none; }
  .api-chip { padding: 0 10px; }
}

@media (max-width: 900px) {
  .header { grid-template-columns: 1fr auto auto; gap: 8px; padding: max(14px, env(safe-area-inset-top)) 18px 12px; }
  .logo, .header-right, .burger { position: relative; z-index: 80; }
  .burger { display: grid; }
  #wallet-btn { height: 38px; padding: 0 12px; }

  .menu-backdrop {
    display: block; position: fixed; inset: 0; z-index: 40; background: rgba(8,8,8,0.42);
    opacity: 0; visibility: hidden; transition: opacity 0.28s ease, visibility 0.28s ease;
  }
  body.menu-open .menu-backdrop { opacity: 1; visibility: visible; -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px); }
  #site-nav {
    position: fixed; inset: 0; z-index: 45; flex-direction: column; justify-content: center; gap: 12px;
    padding: 96px 22px 32px; padding-top: max(96px, calc(env(safe-area-inset-top) + 88px));
    opacity: 0; visibility: hidden; transition: opacity 0.28s ease, visibility 0.28s ease;
  }
  body.menu-open #site-nav { opacity: 1; visibility: visible; }
  #site-nav a { width: 100%; height: 56px; font-size: 19px; border-radius: 10px; }
  body.menu-open { overflow: hidden; }

  .console { padding: 28px 18px 64px; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .tab-head h1 { font-size: 32px; }
  .tab-head--row { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 560px) {
  .logo-tag { display: none; }
  .kpis { grid-template-columns: minmax(0, 1fr); }
  .field-row { flex-direction: column; }
  .tab-head h1 { font-size: 28px; }
  .form-actions .btn { flex: 1; }
  .contracts li { flex-direction: column; align-items: flex-start; }
  .ops li { grid-template-columns: 44px minmax(0,1fr); }
  .op-amt { grid-column: 2; text-align: left; }
}

/* ---------- Agent runner / mode / rationale ---------- */
.runner {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 16px;
  padding: 18px 20px; border-radius: 12px; border: 1px solid rgba(169,196,255,0.25);
  background: linear-gradient(105deg, rgba(169,196,255,0.06), rgba(255,255,255,0.01));
}
.runner > div { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.runner-addr { font-family: var(--mono); font-size: 14px; overflow-wrap: anywhere; }
.mode-pill { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 4px; font-size: 11px; font-weight: 500; border: 1px solid var(--border-soft); color: #cfcfcf; }
.mode-pill.is-onchain { color: #111; background: #e8e8e8; border-color: #e8e8e8; }
.note { margin-top: 10px; font-size: 12.5px; line-height: 1.5; color: var(--warn); }
.note.is-err { color: var(--bad); }
.rationale { list-style: none; display: grid; gap: 6px; margin: 14px 0 0; font-size: 12.5px; color: #bdbdbd; line-height: 1.5; }
.rationale li::before { content: "→ "; color: #6a6a6a; }
@media (max-width: 560px) { .runner { flex-direction: column; align-items: flex-start; } }

/* =====================================================================
   Dashboard
   ===================================================================== */
.explain {
  margin-top: 14px; max-width: 640px; padding: 12px 14px; border-radius: 9px;
  font-size: 13.5px; line-height: 1.55; color: #cfcfcf;
  border: 1px solid rgba(169,196,255,0.22); background: rgba(169,196,255,0.05);
}
.explain strong { color: #fff; font-weight: 500; }

.dash-hero { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: end; margin: 8px 0 28px; }
.dash-hero h1 { font-size: 40px; font-weight: 500; letter-spacing: -0.045em; line-height: 1.12; }
.dash-hero h1 em { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 1.08em; color: #9a9a9a; }

.wallet-card {
  display: flex; flex-direction: column; gap: 14px; padding: 20px; border-radius: 14px;
  border: 1px solid var(--border-soft);
  background: linear-gradient(160deg, rgba(255,255,255,0.06), rgba(255,255,255,0.01) 50%, rgba(160,175,200,0.03));
}
.wallet-card-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.wallet-card-title { font-size: 18px; font-weight: 500; letter-spacing: -0.03em; overflow-wrap: anywhere; }
.wallet-card-title.mono { font-family: var(--mono); font-size: 15px; }
.wallet-card-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.net-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #cfcfcf; }
.net-badge i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.net-badge.is-wrong { color: var(--warn); }
.net-badge.is-wrong i { background: var(--warn); box-shadow: 0 0 8px var(--warn); }

#wallet-btn.is-connected { gap: 8px; font-family: var(--mono); font-size: 12.5px; }
#wallet-btn.is-connected::before {
  content: ""; position: static; transform: none; width: 7px; height: 7px; border-radius: 50%;
  background: var(--ok); box-shadow: 0 0 8px var(--ok); animation: none;
}
#wallet-btn.is-wrong-net::before { background: var(--warn); box-shadow: 0 0 8px var(--warn); }

/* The idea in 30 seconds */
.idea { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr) auto minmax(0,1fr); gap: 12px; align-items: stretch; margin-bottom: 16px; }
.idea-card { padding: 20px; border-radius: 12px; border: 1px solid var(--border-soft); background: var(--panel); }
.idea-card--result { border-color: rgba(126,226,168,0.25); background: rgba(126,226,168,0.04); }
.idea-n { display: block; font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 10px; }
.idea-card h3 { font-size: 16px; font-weight: 500; letter-spacing: -0.02em; margin-bottom: 8px; }
.idea-card p { font-size: 13.5px; line-height: 1.6; color: #bdbdbd; }
.idea-card p strong { color: #fff; font-weight: 500; }
.idea-arrow { display: grid; place-items: center; color: #5f5f5f; font-size: 20px; }
.idea-list { list-style: none; display: grid; gap: 8px; font-size: 13.5px; color: #e8e8e8; }
.idea-list span { margin-right: 6px; }

/* Guided demo */
.demo { margin-bottom: 16px; }
.demo-head { align-items: flex-start; }
.demo-head .hint { margin-top: 4px; }
.mode-switch { display: inline-flex; padding: 3px; border-radius: 9px; border: 1px solid var(--border-soft); background: rgba(0,0,0,0.4); flex: none; }
.mode-switch button {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 7px 12px; border-radius: 7px;
  border: 0; background: transparent; color: #9a9a9a; font: inherit; font-size: 13px; font-weight: 500; cursor: pointer;
}
.mode-switch button small { font-size: 10.5px; font-weight: 400; color: #6a6a6a; }
.mode-switch button.is-on { background: linear-gradient(180deg, #fff, #dcdcdc); color: #111; }
.mode-switch button.is-on small { color: #444; }
#mode-note { margin: 0 0 14px; }
#mode-note:empty { display: none; }

.steps-demo { list-style: none; display: grid; gap: 8px; counter-reset: sd; }
.steps-demo li {
  counter-increment: sd;
  display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 14px; align-items: center;
  padding: 14px 16px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.07); background: rgba(255,255,255,0.02);
  transition: border-color 0.3s ease, background 0.3s ease;
}
.sd-check {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  border: 1.5px solid #4a4a4a; font-size: 13px; color: #9a9a9a;
}
.sd-check::before { content: counter(sd); }
.sd-body strong { display: block; font-size: 14.5px; font-weight: 500; letter-spacing: -0.02em; }
.sd-body p { margin-top: 3px; font-size: 13px; line-height: 1.5; color: var(--muted); }
.sd-body code { color: #d8d8d8; }
.steps-demo li.is-done { border-color: rgba(126,226,168,0.28); background: rgba(126,226,168,0.035); }
.steps-demo li.is-done .sd-check { border-color: var(--ok); background: var(--ok); color: #0a2a18; }
.steps-demo li.is-done .sd-check::before { content: "✓"; font-weight: 700; }
.steps-demo li.is-skip { opacity: 0.55; }
.steps-demo li.is-skip .sd-check::before { content: "–"; }
.steps-demo li.is-next { border-color: rgba(220,230,255,0.4); box-shadow: 0 0 24px rgba(170,200,255,0.08); }
.steps-demo li.is-next .sd-check { border-color: #fff; color: #fff; }

/* My agent + approvals */
.agent-limit { margin-top: 14px; }
.agent-limit-top { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.bar { height: 6px; border-radius: 3px; background: rgba(255,255,255,0.08); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #cfcfcf, #fff); }
.stat-row { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px; margin-bottom: 14px; }
.stat-box { padding: 10px 12px; border-radius: 9px; border: 1px solid rgba(255,255,255,0.07); background: rgba(255,255,255,0.02); }
.stat-box b { display: block; font-size: 20px; font-weight: 500; letter-spacing: -0.03em; }
.stat-box span { font-size: 11.5px; color: var(--muted); }
.approvals { list-style: none; display: grid; gap: 8px; }
.approvals li {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; border-radius: 9px; border: 1px solid rgba(242,196,107,0.3); background: rgba(242,196,107,0.05);
}
.approvals li.empty { border: 1px dashed rgba(255,255,255,0.1); background: transparent; justify-content: center; }
.approvals .ap-main strong { display: block; font-size: 15px; font-weight: 500; }
.approvals .ap-main span { font-size: 12px; color: var(--muted); }

/* Use cases */
.section-label { margin: 36px 0 14px; }
.section-label h2 { font-size: 22px; font-weight: 500; letter-spacing: -0.03em; }
.section-label .hint { margin-top: 4px; }
.usecases { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; margin-bottom: 32px; }
.usecase { display: flex; flex-direction: column; gap: 10px; padding: 22px; border-radius: 12px; border: 1px solid var(--border-soft); background: var(--panel); }
.usecase h3 { font-size: 16px; font-weight: 500; letter-spacing: -0.02em; }
.usecase p { font-size: 13.5px; line-height: 1.6; color: #bdbdbd; flex: 1; }
.usecase .btn { align-self: flex-start; }
.uc-tag { display: inline-flex; align-self: flex-start; height: 22px; align-items: center; padding: 0 9px; border-radius: 11px; font-size: 11.5px; font-weight: 500; border: 1px solid currentColor; }

/* Under the hood */
.under-hood { border-top: 1px solid rgba(255,255,255,0.07); padding-top: 18px; }
.under-hood > summary {
  cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 10px;
  font-size: 14px; color: #cfcfcf; margin-bottom: 16px;
}
.under-hood > summary::-webkit-details-marker { display: none; }
.under-hood > summary::before { content: "+"; width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; border: 1px solid var(--border-soft); transition: transform 0.3s var(--ease); }
.under-hood[open] > summary::before { transform: rotate(45deg); }

@media (max-width: 1100px) {
  .idea { grid-template-columns: minmax(0,1fr); }
  .idea-arrow { transform: rotate(90deg); height: 18px; }
  .usecases { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 900px) {
  .dash-hero { grid-template-columns: minmax(0,1fr); }
  .dash-hero h1 { font-size: 32px; }
  .demo-head { flex-direction: column; }
}
@media (max-width: 560px) {
  .steps-demo li { grid-template-columns: 30px minmax(0,1fr); }
  .steps-demo li > .btn { grid-column: 2; justify-self: start; }
  .stat-row { grid-template-columns: repeat(2, minmax(0,1fr)); }
  #wallet-btn { max-width: 150px; }
}

/* =====================================================================
   Real onchain flow
   ===================================================================== */
.guard {
  position: relative; z-index: 2; max-width: 1200px; margin: 18px auto 0; padding: 12px 16px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  border-radius: 10px; font-size: 13.5px; color: #f2e6c8;
  border: 1px solid rgba(242,196,107,0.35); background: rgba(242,196,107,0.07);
}
.guard strong { color: #fff; font-weight: 500; }
@media (max-width: 1264px) { .guard { margin-left: 32px; margin-right: 32px; } }
@media (max-width: 900px) { .guard { margin-left: 18px; margin-right: 18px; } }

.tx-steps { list-style: none; display: grid; gap: 6px; margin: 4px 0 0; }
.tx-steps li {
  display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.08); background: rgba(255,255,255,0.02); font-size: 12.5px; text-align: left;
}
.tx-steps li strong { font-weight: 500; font-size: 13px; }
.tx-steps li span { color: var(--muted); }
.tx-steps li.is-sign, .tx-steps li.is-pending { border-color: rgba(220,230,255,0.35); }
.tx-steps li.is-sign strong::before, .tx-steps li.is-pending strong::before {
  content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 8px; vertical-align: -1px;
  border-radius: 50%; border: 1.5px solid currentColor; border-right-color: transparent; animation: spin 0.7s linear infinite;
}
.tx-steps li.is-mined { border-color: rgba(126,226,168,0.3); }
.tx-steps li.is-mined strong::before { content: "✓ "; color: var(--ok); }
.tx-steps li.is-failed { border-color: rgba(255,122,122,0.4); }
.tx-steps li.is-failed span { color: #ffd0d0; }
.modal-card .tx-steps { margin: 4px 0 12px; }

.agent-list { list-style: none; display: grid; gap: 8px; }
.agent-list li {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; border-radius: 9px; border: 1px solid rgba(255,255,255,0.07); background: rgba(255,255,255,0.02);
}
.agent-list li.empty { justify-content: center; border-style: dashed; background: transparent; }
.agent-list li > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.agent-list strong { font-weight: 500; font-size: 14.5px; }
.agent-list .status-pill { align-self: flex-start; }

.plan-summary { font-size: 15px; line-height: 1.55; margin-bottom: 16px; color: #e8e8e8; }
.plan-summary .mode-pill { margin-right: 6px; vertical-align: 1px; }
.risk { margin-top: 14px; padding: 12px 14px; border-radius: 9px; border: 1px solid rgba(242,196,107,0.3); background: rgba(242,196,107,0.05); }
.risk strong { font-size: 12.5px; font-weight: 500; color: var(--warn); }
.risk .rationale { margin-top: 6px; }

.activity-tools { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.table td .addr-link + .addr-link { margin-left: 2px; }
