/* Sotto app. Same brand tokens as site.css. */
:root {
  --bg: #09090b;
  --bg-2: #0e0e12;
  --panel: #121217;
  --panel-2: #17171d;
  --line: #24242c;
  --line-strong: #383842;
  --grid: rgba(236, 235, 242, 0.03);
  --text: #ecebf2;
  --text-2: #a4a2b0;
  --text-3: #6d6b79;
  --accent: #a585ff;
  --accent-hot: #c4b0ff;
  --accent-dim: rgba(165, 133, 255, 0.13);
  --accent-line: rgba(165, 133, 255, 0.42);
  --amber: #ffb547;
  --amber-dim: rgba(255, 181, 71, 0.12);
  --bad: #ff5d6c;
  --bad-dim: rgba(255, 93, 108, 0.12);
  --sans: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--text); font: 400 15px/1.55 var(--sans); -webkit-font-smoothing: antialiased;
  background-color: var(--bg);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 48px 48px;
}
h1, h2, p, dl, dd, ol, ul { margin: 0; }
h1, h2 { font-weight: 600; }
em { font-style: normal; color: var(--accent); }
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }
svg { display: block; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
::selection { background: var(--accent); color: var(--bg); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px;
  border-radius: 4px; border: 1px solid transparent; cursor: pointer; white-space: nowrap; text-decoration: none;
  font: 500 12px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase;
  transition: background-color 0.2s, border-color 0.2s, box-shadow 0.2s, color 0.2s, opacity 0.2s;
}
.btn-ink { background: var(--accent); color: var(--bg); }
.btn-ink:hover:not(:disabled) { background: var(--accent-hot); box-shadow: 0 0 0 4px var(--accent-dim); }
.btn-ghost { background: transparent; border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn:disabled { cursor: not-allowed; opacity: 0.4; }
.btn-block { width: 100%; height: 48px; font-size: 13px; }

.tag { display: inline-flex; align-items: center; gap: 6px; height: 21px; padding: 0 7px; border-radius: 2px; font: 500 10px/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; flex: none; }
.tag::before { content: ""; width: 5px; height: 5px; background: currentColor; }
.tag-live { background: var(--accent-dim); color: var(--accent); }
.tag-preview { background: var(--amber-dim); color: var(--amber); }
.dot { width: 7px; height: 7px; border-radius: 1px; display: inline-block; }
.dot-live { background: var(--accent); box-shadow: 0 0 10px var(--accent); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.4; } }

/* Shell */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px;
  padding: 20px 14px; border-right: 1px solid var(--line); background: var(--bg-2);
}
.brand { display: inline-flex; align-items: center; gap: 10px; padding: 4px 10px 24px; text-decoration: none; font: 600 19px/1 var(--sans); letter-spacing: -0.02em; }
.mark { width: 24px; height: 24px; color: var(--text); }
.side-label { padding: 0 10px 8px; font: 500 10px/1 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-3); }
.side-label::before { content: "// "; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav button {
  position: relative; display: flex; align-items: center; gap: 11px; width: 100%; height: 40px; padding: 0 10px; border: 0; border-radius: 3px;
  background: transparent; cursor: pointer; text-align: left; color: var(--text-2); font-size: 14px; transition: background-color 0.2s, color 0.2s;
}
.side-nav svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; flex: none; }
.side-nav svg .fill { fill: currentColor; stroke: none; opacity: 0.6; }
.side-nav button:hover { background: var(--panel); color: var(--text); }
.side-nav button.active { background: var(--accent-dim); color: var(--text); }
.side-nav button.active::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 2px; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.side-nav button.active svg { color: var(--accent); }
.mini-tag { margin-left: auto; font: 500 9px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; padding: 4px 5px; border-radius: 2px; background: var(--amber-dim); color: var(--amber); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; padding: 0 10px; font: 400 12px/1.4 var(--mono); color: var(--text-3); }
.net { display: flex; align-items: center; gap: 9px; font: 500 10.5px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-2); }
.back { text-decoration: none; }
.back:hover { color: var(--accent); }
.socials { display: flex; gap: 6px; }
.social { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 3px; border: 1px solid var(--line); color: var(--text-2); }
.social svg { width: 13px; height: 13px; }
.social:hover { border-color: var(--accent); color: var(--accent); }
.social.pending { opacity: 0.35; pointer-events: none; }

.main { min-width: 0; padding: 0 40px 64px; }
.top {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  height: 64px; margin: 0 -40px; padding: 0 40px; background: rgba(9, 9, 11, 0.94); border-bottom: 1px solid var(--line);
}
#wallet { text-transform: none; letter-spacing: 0.02em; } /* addresses are case-sensitive */
.crumb { font: 400 11.5px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
.crumb span { margin: 0 6px; }
.crumb strong { color: var(--accent); font-weight: 500; }

/* Views */
.view { display: none; padding-top: 40px; animation: fade 0.3s ease; }
.view.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }
.view-head { max-width: 660px; margin-bottom: 30px; }
.kicker { font: 500 11px/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; }
.kicker::before { content: "// "; color: var(--text-3); }
.view-head h1 { font: 600 clamp(34px, 4.2vw, 52px)/1 var(--sans); letter-spacing: -0.045em; }
.view-head > p:last-child { margin-top: 14px; color: var(--text-2); font-size: 15.5px; }

.panel { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 2px; padding: 22px; min-width: 0; }
.panel::before { content: ""; position: absolute; top: -1px; left: -1px; width: 10px; height: 10px; border-top: 1px solid var(--accent-line); border-left: 1px solid var(--accent-line); pointer-events: none; }
.panel-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.label { font: 500 10.5px/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-3); }
.hint { color: var(--text-3); font-size: 13px; margin-top: 8px; }
.hint-inline { font: 400 11px/1 var(--mono); color: var(--text-3); letter-spacing: 0.04em; }
.big { font: 600 50px/1 var(--sans); letter-spacing: -0.045em; font-variant-numeric: tabular-nums; }
.big small { font: 500 13px/1 var(--mono); letter-spacing: 0.08em; color: var(--text-3); margin-left: 6px; }
.big.muted { color: var(--text-3); }
.panel-foot { display: flex; align-items: center; gap: 10px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.addr { font: 400 12px/1 var(--mono); color: var(--text-2); background: var(--bg); border: 1px solid var(--line); padding: 8px 10px; border-radius: 2px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link { font: 400 12px/1 var(--mono); color: var(--accent); text-decoration: none; white-space: nowrap; }
.link:hover { color: var(--accent-hot); }
.icon-btn { margin-left: auto; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 3px; border: 1px solid var(--line); background: transparent; cursor: pointer; flex: none; color: var(--text-2); }
.icon-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.icon-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:disabled { opacity: 0.35; cursor: default; }
.icon-btn.spin svg { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 14px; }
.quiet-panel { background: radial-gradient(120% 90% at 100% 100%, rgba(124, 92, 255, 0.16), transparent 60%), var(--panel); }
.exposure { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.exposure div { padding: 14px; border-radius: 2px; background: var(--bg-2); border: 1px solid var(--line); }
.exposure dt { font: 400 10.5px/1.3 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); }
.exposure dd { margin-top: 8px; font: 600 21px/1.15 var(--sans); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.ask-title { font: 600 21px/1.2 var(--sans); letter-spacing: -0.03em; margin-bottom: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 9px 12px; border-radius: 2px; border: 1px solid var(--line); background: var(--bg-2);
  cursor: pointer; font-size: 13.5px; text-align: left; transition: border-color 0.2s, background-color 0.2s;
}
.chip::before { content: "> "; font-family: var(--mono); color: var(--accent); }
.chip:hover { border-color: var(--accent-line); background: var(--accent-dim); }

/* Vault preview */
.vault-layout { display: grid; grid-template-columns: 1.3fr 1fr; gap: 14px; align-items: start; }
.vault-form { display: flex; flex-direction: column; gap: 18px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; padding: 3px; border-radius: 3px; background: var(--bg); border: 1px solid var(--line); }
.seg button { height: 36px; border: 0; border-radius: 2px; background: transparent; cursor: pointer; font: 500 12px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
.seg button.on { background: var(--panel-2); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent-line); }
.route { display: grid; grid-template-columns: 1fr 64px 1fr; align-items: center; }
.route-end { padding: 14px; border-radius: 2px; border: 1px solid var(--line-strong); background: var(--bg-2); }
.route-end.quiet { border-style: dashed; border-color: var(--accent-line); background: var(--accent-dim); }
.route-label { display: block; font: 500 10px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-3); margin-bottom: 8px; }
.route-end strong { font: 600 17px/1.15 var(--sans); letter-spacing: -0.02em; }
.route-end.quiet strong { color: var(--accent); }
.route-line { position: relative; height: 1px; margin: 0 8px; background: var(--line-strong); }
.route-line i { position: absolute; top: -2px; left: 0; width: 5px; height: 5px; background: var(--accent); box-shadow: 0 0 10px var(--accent); animation: travel 2s linear infinite; }
@keyframes travel { 0% { left: 0; opacity: 0; } 15%, 85% { opacity: 1; } 100% { left: calc(100% - 5px); opacity: 0; } }
.field { display: flex; flex-direction: column; gap: 8px; }
.field-top { display: flex; justify-content: space-between; gap: 10px; font: 400 11px/1.3 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
.avail strong { color: var(--text); font-weight: 500; font-variant-numeric: tabular-nums; }
.input-row { display: flex; align-items: center; gap: 8px; height: 54px; padding: 0 8px 0 16px; border-radius: 3px; border: 1px solid var(--line-strong); background: var(--bg); transition: border-color 0.2s, box-shadow 0.2s; }
.input-row:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.input-row input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; outline: none; font: 600 22px/1 var(--sans); letter-spacing: -0.02em; }
.input-row input::placeholder { color: var(--text-3); }
#recipient { font: 400 14px/1 var(--mono); letter-spacing: 0; }
.input-row input::-webkit-outer-spin-button, .input-row input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.input-row input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.unit { font: 500 12px/1 var(--mono); letter-spacing: 0.08em; color: var(--text-3); }
.max { height: 32px; padding: 0 10px; border-radius: 2px; border: 1px solid var(--line-strong); background: var(--panel-2); cursor: pointer; font: 500 11px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.max:hover { border-color: var(--accent); }
.form-msg { min-height: 20px; font: 400 12.5px/1.4 var(--mono); color: var(--bad); }
.form-msg.ok { color: var(--text-3); }
.vault-side { display: flex; flex-direction: column; gap: 16px; }
.mini-steps { padding-left: 0; list-style: none; counter-reset: s; display: flex; flex-direction: column; gap: 12px; color: var(--text-2); }
.mini-steps li { counter-increment: s; position: relative; padding-left: 30px; }
.mini-steps li::before { content: "0" counter(s); position: absolute; left: 0; top: 0; font: 500 11px/2 var(--mono); color: var(--accent); }
.mini-steps strong { color: var(--text); font-weight: 600; }
.preview-note { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 2px; border: 1px solid rgba(255, 181, 71, 0.28); background: var(--amber-dim); }
.preview-note p { font-size: 13.5px; color: var(--text-2); }

/* Assistant */
.chat { display: flex; flex-direction: column; gap: 14px; max-width: 860px; padding: 0; overflow: hidden; }
.chat::after { content: ""; position: absolute; bottom: -1px; right: -1px; width: 10px; height: 10px; border-bottom: 1px solid var(--accent-line); border-right: 1px solid var(--accent-line); pointer-events: none; }
.chat-log { display: flex; flex-direction: column; gap: 12px; height: min(52vh, 520px); overflow-y: auto; padding: 22px 22px 4px; scroll-behavior: smooth; }
.msg { max-width: 82%; padding: 12px 15px; border-radius: 3px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg p { font-size: 15px; }
.msg.bot { align-self: flex-start; background: var(--bg-2); border: 1px solid var(--line); border-left: 2px solid var(--accent); }
.msg.user { align-self: flex-end; background: var(--accent-dim); border: 1px solid var(--accent-line); }
.msg.err { border-left-color: var(--bad); color: var(--bad); }
.msg.typing p { font-family: var(--mono); font-size: 13px; color: var(--text-3); }
.msg.typing p::after { content: "▍"; color: var(--accent); margin-left: 4px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.chat-chips { padding: 0 22px; }
.chat-form { display: flex; flex-direction: column; gap: 10px; padding: 14px 22px 22px; border-top: 1px solid var(--line); }
.share { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.share input { accent-color: var(--accent); width: 15px; height: 15px; }
.share small { font-family: var(--mono); font-size: 11px; color: var(--text-3); }
.chat-input { display: flex; align-items: flex-end; gap: 8px; padding: 6px 6px 6px 14px; border-radius: 3px; border: 1px solid var(--line-strong); background: var(--bg); transition: border-color 0.2s, box-shadow 0.2s; }
.chat-input::before { content: ">"; align-self: center; font-family: var(--mono); color: var(--accent); }
.chat-input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.chat-input textarea { flex: 1; min-width: 0; resize: none; border: 0; outline: none; background: transparent; padding: 9px 0; max-height: 140px; font-size: 15px; line-height: 1.45; }
.chat-input textarea::placeholder { color: var(--text-3); }
.send { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 3px; border: 0; background: var(--accent); color: var(--bg); cursor: pointer; flex: none; }
.send:hover:not(:disabled) { background: var(--accent-hot); }
.send svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.send:disabled { opacity: 0.4; cursor: default; }

/* Activity */
.tx-list { list-style: none; padding: 0; }
.tx-list li { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 16px; padding: 13px 4px; border-bottom: 1px solid var(--line); }
.tx-list li:last-child { border-bottom: 0; }
.tx-list li:hover:not(.empty) { background: var(--bg-2); }
.tx-list li.empty { display: block; color: var(--text-3); padding: 18px 4px; font: 400 13px/1.5 var(--mono); }
.tx-status { font: 500 10px/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; padding: 5px 7px; border-radius: 2px; background: var(--accent-dim); color: var(--accent); }
.tx-status.fail { background: var(--bad-dim); color: var(--bad); }
.tx-sig { font: 400 12.5px/1 var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; color: var(--text-2); }
.tx-time { font: 400 12px/1 var(--mono); color: var(--text-3); white-space: nowrap; }

/* Modals */
.modal { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 16px; background: rgba(5, 5, 8, 0.72); animation: fade 0.2s ease; }
.modal-card { position: relative; width: min(460px, 100%); background: var(--panel); border: 1px solid var(--line-strong); border-radius: 2px; padding: 26px; box-shadow: 0 40px 120px -30px rgba(124, 92, 255, 0.35); }
.modal-card::before { content: ""; position: absolute; top: -1px; left: -1px; right: -1px; height: 2px; background: var(--accent); box-shadow: 0 0 16px var(--accent); }
.modal-card h2 { font: 600 30px/1.05 var(--sans); letter-spacing: -0.04em; margin-bottom: 18px; }
.modal-card.small h2 { font-size: 24px; margin-bottom: 10px; }
.modal-card > p { color: var(--text-2); }
.review-rows { display: flex; flex-direction: column; margin-bottom: 18px; }
.review-rows div { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px dashed var(--line-strong); }
.review-rows dt { font: 400 11px/1.6 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
.review-rows dd { font-weight: 500; text-align: right; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; flex-wrap: wrap; }

.tabbar { display: none; }

@media (max-width: 1100px) {
  .grid, .vault-layout { grid-template-columns: minmax(0, 1fr); }
  .exposure { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .main { padding: 0 16px 96px; }
  .top { margin: 0 -16px; padding: 0 16px; height: 58px; }
  .view { padding-top: 28px; }
  .tabbar {
    display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 10px; right: 10px; bottom: 10px; z-index: 10;
    padding: 4px; border-radius: 4px; background: rgba(18, 18, 23, 0.96); border: 1px solid var(--line-strong);
    box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.8);
  }
  .tabbar button { height: 40px; border: 0; border-radius: 2px; background: transparent; color: var(--text-3); font: 500 10.5px/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; cursor: pointer; }
  .tabbar button.active { background: var(--accent-dim); color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); }
  .big { font-size: 42px; }
  .msg { max-width: 92%; }
  .chat-log { height: 50vh; padding: 16px 16px 4px; }
  .chat-chips { padding: 0 16px; }
  .chat-form { padding: 12px 16px 16px; }
}
@media (max-width: 480px) {
  .exposure { grid-template-columns: 1fr 1fr; gap: 8px; }
  .exposure dd { font-size: 18px; }
  .route { grid-template-columns: 1fr 32px 1fr; }
  .route-end strong { font-size: 14.5px; }
  .tx-list li { grid-template-columns: auto 1fr auto; }
  .tx-list .link { display: none; }
  .crumb { font-size: 10.5px; }
  .top .btn { padding: 0 10px; font-size: 10.5px; letter-spacing: 0.04em; }
}
@media (prefers-reduced-motion: reduce) {
  .view, .modal { animation: none; }
  .route-line i { animation: none; left: 50%; }
  .dot-live, .msg.typing p::after { animation: none; }
  .chat-log { scroll-behavior: auto; }
}
