/* anonymuse agent page. Same palette and type as the main site (styles.css). */
:root {
  --bg: #0a0a0a;
  --surface: #0f0f0f;
  --surface-2: #161616;
  --surface-3: #1c1c1c;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #ededed;
  --text-2: #a1a1a1;
  --text-3: #6b6b6b;
  --accent: #45d483;
  --amber: #f5a524;
  --red: #f2555a;
  --font: "Geist", "Inter", system-ui, -apple-system, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.6 var(--font);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: inherit; }
button, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.mono { font-family: var(--mono); }

.boot { min-height: 100dvh; display: grid; place-content: center; justify-items: center; gap: 14px; color: var(--text-2); }
.boot img { border-radius: 10px; opacity: 0.9; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid transparent;
  font-size: 13.5px; font-weight: 500; white-space: nowrap; cursor: pointer;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.2s, opacity 0.15s;
}
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-primary { background: var(--text); color: #0a0a0a; box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.1); }
.btn-primary:not(:disabled):hover { background: #fff; box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.08); }
.btn-ghost { background: transparent; border-color: var(--line-strong); }
.btn-ghost:not(:disabled):hover { background: var(--surface-2); }
:is(button, a, textarea):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Layout ---------- */
.app { height: 100dvh; display: flex; flex-direction: column; }
.bar {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  height: 60px; padding: 0 max(16px, env(safe-area-inset-left));
  border-bottom: 1px solid var(--line); background: rgba(10, 10, 10, 0.85); backdrop-filter: blur(12px);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; letter-spacing: -0.01em; min-width: 0; }
.brand img { border-radius: 7px; flex: none; }
.tag {
  font: 500 11px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--accent); border: 1px solid rgba(69, 212, 131, 0.3); border-radius: 999px; padding: 4px 8px;
}
.wallet-chip {
  display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 6px 0 12px;
  border: 1px solid var(--line-strong); border-radius: 999px; font-size: 13px;
}
.wallet-chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px rgba(69, 212, 131, 0.15); }
.chip-x {
  width: 24px; height: 24px; border-radius: 50%; border: 0; background: transparent; color: var(--text-2);
  font-size: 18px; line-height: 1; cursor: pointer;
}
.chip-x:hover { background: var(--surface-3); color: var(--text); }

.chat { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 16px; }
.dock { flex: none; padding: 10px 16px max(12px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--bg); }

/* ---------- Intro ---------- */
.intro { max-width: 760px; margin: 0 auto; padding: 40px 0 24px; text-align: center; }
.intro-mascot { width: 112px; height: auto; margin-bottom: 18px; filter: drop-shadow(0 18px 40px rgba(69, 212, 131, 0.12)); }
.intro h1 { font-size: clamp(30px, 6vw, 44px); line-height: 1.08; letter-spacing: -0.035em; font-weight: 600; }
.intro-lead { max-width: 520px; margin: 14px auto 0; color: var(--text-2); }
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 32px; text-align: left; }
.feature { padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.feature h2 { font-size: 14.5px; font-weight: 600; letter-spacing: -0.01em; }
.feature h2::before {
  content: ""; display: inline-block; width: 7px; height: 7px; margin: 0 9px 2px 0; border-radius: 2px; background: var(--accent);
}
.feature p { margin-top: 6px; font-size: 13.5px; line-height: 1.55; color: var(--text-2); }
.suggestions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 24px; }
.suggestions button {
  padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface);
  font-size: 13.5px; cursor: pointer; transition: background 0.15s, border-color 0.15s;
}
.suggestions button:hover { background: var(--surface-2); border-color: rgba(255, 255, 255, 0.24); }

/* ---------- Messages ---------- */
.messages { list-style: none; max-width: 760px; margin: 0 auto; padding: 24px 0 8px; display: flex; flex-direction: column; gap: 18px; }
.msg { display: flex; gap: 12px; align-items: flex-start; min-width: 0; }
.msg.user { justify-content: flex-end; }
.avatar { flex: none; border-radius: 7px; margin-top: 2px; }
.bubble { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.msg.user .bubble { max-width: 85%; padding: 10px 14px; border-radius: 14px 14px 4px 14px; background: var(--surface-3); border: 1px solid var(--line); }
.msg.assistant .bubble { flex: 1; padding-top: 3px; }
.msg.error .bubble { color: var(--red); }
.msg.note { padding-left: 38px; }
.msg.note .bubble { font-size: 13px; color: var(--accent); font-family: var(--mono); }
.bubble p + p, .bubble p + ul, .bubble p + ol, .bubble ul + p, .bubble ol + p { margin-top: 10px; }
.bubble ul, .bubble ol { padding-left: 20px; }
.bubble li + li { margin-top: 4px; }
.bubble strong { font-weight: 600; }
.bubble code { font: 12.5px var(--mono); padding: 1px 5px; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--line); }
.end { height: 1px; }

.typing { display: flex; gap: 5px; padding-top: 12px !important; }
.typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); animation: blink 1.2s infinite ease-in-out; }
.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-2px); } }

/* ---------- Swap card ---------- */
.swap { margin-top: 14px; padding: 16px; border-radius: 14px; border: 1px solid var(--line-strong); background: var(--surface); }
.swap.caution { border-color: rgba(245, 165, 36, 0.4); }
.swap-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.swap-title { font-weight: 600; font-size: 14px; }
.badge { font: 500 11.5px/1 var(--mono); padding: 5px 8px; border-radius: 999px; border: 1px solid; }
.badge.ok { color: var(--accent); border-color: rgba(69, 212, 131, 0.35); background: rgba(69, 212, 131, 0.08); }
.badge.caution { color: var(--amber); border-color: rgba(245, 165, 36, 0.35); background: rgba(245, 165, 36, 0.08); }
.swap-rows { margin-top: 12px; display: grid; gap: 8px; }
.swap-rows > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); }
.swap-rows dt { font-size: 13px; color: var(--text-2); }
.swap-rows dd { text-align: right; min-width: 0; }
.swap-rows dd b { font-weight: 600; }
.swap-rows dd span { display: block; font-size: 12px; color: var(--text-3); }
.swap-meta { margin-top: 10px; font-size: 12.5px; color: var(--text-2); }
.swap-reasons { margin-top: 10px; padding-left: 18px; font-size: 13px; color: var(--amber); }
.swap-notes { margin-top: 10px; font-size: 12.5px; color: var(--text-2); }
.swap-notes summary { cursor: pointer; color: var(--text); }
.swap-notes p { margin-top: 6px; }
.swap-status { margin-top: 12px; font-size: 13px; color: var(--text-2); }
.swap-status.ok { color: var(--accent); }
.swap-status.bad { color: var(--red); }
.swap-status a { color: var(--text); }
.swap-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }

/* ---------- Composer ---------- */
.composer {
  max-width: 760px; margin: 0 auto; display: flex; align-items: flex-end; gap: 8px;
  padding: 8px 8px 8px 14px; border-radius: 16px; border: 1px solid var(--line-strong); background: var(--surface);
  transition: border-color 0.15s;
}
.composer:focus-within { border-color: rgba(255, 255, 255, 0.28); }
.composer textarea {
  flex: 1; min-width: 0; resize: none; border: 0; outline: 0; background: transparent;
  font-size: 16px; line-height: 1.5; padding: 6px 0; max-height: 160px;
}
.composer textarea::placeholder { color: var(--text-3); }
.composer textarea:focus-visible { outline: none; }
.send {
  flex: none; width: 36px; height: 36px; border-radius: 10px; border: 0; cursor: pointer;
  display: grid; place-items: center; background: var(--text); color: #0a0a0a; transition: opacity 0.15s, background 0.15s;
}
.send:disabled { opacity: 0.3; cursor: default; }
.send:not(:disabled):hover { background: #fff; }
.fineprint { max-width: 760px; margin: 8px auto 0; font-size: 11.5px; line-height: 1.5; color: var(--text-3); text-align: center; }

@media (max-width: 720px) {
  .features { grid-template-columns: minmax(0, 1fr); }
  .intro { padding-top: 28px; }
  .intro-mascot { width: 92px; }
}
@media (max-width: 380px) {
  .tag { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .typing span { animation: none; opacity: 0.6; }
}
