:root {
  /* Palette read from meteora.ag: background, border, orange and violet button tints. */
  --bg: #0d0d13; --panel: #14141e; --panel-2: #1c1c2a; --line: #2a2a3c; --line-2: #3b3b52; --deep: #0a0a0f;
  --ink: #f4f4f8; --muted: #9c9cb3; --faint: #8686a2;
  --paper: #f1eee6; --paper-line: #d3cfc4; --paper-ink: #14141c; --paper-muted: #6a6878;
  --accent: #f55800; --accent-ink: #0d0d13; --accent-edge: #b23f00; --accent-hover: #ff6d1f;
  --accent-tint: #321710; --accent-text: #f76727;
  --violet-tint: #1d1639; --violet-tint-2: #271e4b; --violet-line: #33295f; --violet-text: #9e83ff;
  --ok: #5fd896; --no: #ff5f83; --no-bg: #2c1320; --no-line: #6b2440; --no-text: #ff9db3; --ok-bg: #11251d;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --sans: var(--mono);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.6 var(--mono); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
code, .mono { font-family: var(--mono); font-size: .92em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 0; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 28px; }

/* Brand */
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; }
.brand img { display: block; width: 40px; height: auto; flex: none; }
.chip { font: 500 11px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; padding: 6px 8px; border: 1px solid var(--line-2); border-radius: 0; color: var(--muted); white-space: nowrap; }
.chip.live { color: var(--accent-text); background: var(--accent-tint); border-color: #5b2a14; }

/* Buttons */
.btn::before { content: '> '; white-space: pre; opacity: .65; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border-radius: 0; border: 1px solid var(--violet-line); background: var(--violet-tint); color: var(--violet-text); font: 500 14px/1 var(--mono); text-decoration: none; cursor: pointer; transition: transform .08s, background .15s, border-color .15s; }
.btn:hover { background: var(--violet-tint-2); border-color: #463a7c; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.danger { background: var(--no-bg); border-color: var(--no-line); color: var(--no-text); }
.btn.danger:hover { background: #3b1a2b; border-color: #8a2f53; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* Top bar */
.top { display: flex; align-items: center; gap: 26px; height: 68px; }
.top nav { display: flex; gap: 22px; margin-left: 8px; }
.top nav a { color: var(--muted); text-decoration: none; font-size: 14.5px; }
.top nav a:hover { color: var(--ink); }
.top .right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

/* Hero */
.hero { padding: 40px 0 0; }
.hero-head { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) 236px; gap: 40px; align-items: end; }
/* The mascot stands on the session panel, overlapping its top edge. */
.mascot { display: block; width: 236px; height: auto; margin-bottom: -68px; position: relative; z-index: 2; pointer-events: none; }
.hero h1 { font-size: clamp(26px, 2.9vw, 40px); line-height: 1.08; letter-spacing: -.055em; font-weight: 500; }
.hero-side p { color: #c6c6d6; font-size: 14.5px; text-wrap: pretty; }
.hero-actions { display: flex; align-items: center; gap: 20px; margin-top: 20px; flex-wrap: wrap; }
.textlink { color: var(--ink); font-size: 14px; text-underline-offset: 4px; text-decoration-color: var(--line-2); }
.textlink:hover { text-decoration-color: var(--accent); }
.caret { display: inline-block; width: .56em; height: 1em; margin-left: .08em; vertical-align: -.12em; background: var(--accent); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* Panels titled on their border, like a fieldset legend */
.frame { position: relative; border: 1px solid var(--line-2); background: var(--panel); }
.frame > .legend { position: absolute; top: -.72em; left: 12px; padding: 0 8px; background: var(--bg); color: var(--accent-text); font: 500 12px/1.4 var(--mono); }

/* Desk: limits and the agent session */
.desk { margin-top: 44px; display: grid; grid-template-columns: minmax(310px, 400px) minmax(0, 1fr); gap: 20px; align-items: stretch; }
.limits-panel { padding: 22px 18px 16px; display: flex; flex-direction: column; font-size: 13px; }
.term-label { color: var(--faint); margin: 15px 0 5px; font-size: 12px; }
.term-label:first-of-type { margin-top: 0; }
.limits-panel p { line-height: 1.5; }
.limit { padding: 10px 0; border-top: 1px solid var(--line); }
.limit-row { display: flex; justify-content: space-between; gap: 12px; }
.limit-row small { color: var(--muted); font-size: 11.5px; text-align: right; }
.signature { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; color: var(--faint); font-size: 11.5px; }
.signature b { display: block; color: var(--ink); font-weight: 400; font-size: 12.5px; }

/* Segmented meter, reads like a block character bar and scales with its container */
.seg { height: 10px; margin-top: 7px; background: repeating-linear-gradient(90deg, var(--line) 0 7px, transparent 7px 9px); position: relative; }
.seg i { position: absolute; inset: 0 auto 0 0; width: 0; min-width: 0; background: repeating-linear-gradient(90deg, var(--accent) 0 7px, transparent 7px 9px); transition: width .5s steps(8); }

.session { display: flex; flex-direction: column; min-width: 0; }
.term { flex: none; height: 500px; overflow-y: auto; padding: 22px 16px 10px; font-size: 13px; line-height: 1.55; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.line { display: flex; gap: 8px; min-height: 1.55em; }
.line + .line { margin-top: 1px; }
.cmd-line { margin-top: 12px; color: var(--ink); }
.cmd-line:first-child { margin-top: 0; }
.who { flex: none; }
.who.agent { color: var(--violet-text); }
.who.owner { color: var(--accent-text); }
.typed { min-width: 0; overflow-wrap: break-word; }
.term .caret { flex: none; align-self: center; height: 1.05em; margin: 0; }
.line.res { display: block; padding-left: 2ch; overflow-wrap: anywhere; }
.res .ok { color: var(--ok); }
.res .no { color: var(--no); }
.res .spin { color: var(--muted); }
.res a { color: var(--muted); text-underline-offset: 3px; }
.res a:hover { color: var(--ink); }
.res small { color: var(--faint); font-size: 12px; }
.statusline { display: flex; justify-content: space-between; gap: 14px; padding: 8px 16px; border-top: 1px solid var(--line-2); color: var(--muted); font-size: 12px; }
.statusline .dot { display: inline-block; width: 7px; height: 7px; margin-right: 7px; background: var(--faint); vertical-align: 1px; }
.statusline.busy .dot { background: var(--violet-text); animation: blink .7s steps(1) infinite; }
.statusline .replay { color: var(--faint); text-align: right; }

/* Activity rows in the console */
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 14px; align-items: center; min-height: 44px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.rows .what { font-size: 13.5px; line-height: 1.35; min-width: 0; }
.rows .detail { font-size: 12px; color: var(--faint); text-align: right; white-space: nowrap; }
.rows .detail a { color: var(--muted); text-underline-offset: 3px; }
.rows .detail a:hover { color: var(--ink); }
.rows .err { color: var(--no); }
.tag { font: 600 10.5px/1 var(--mono); letter-spacing: .05em; padding: 5px 0; width: 70px; text-align: center; }
.tag.ok { color: var(--ok); background: var(--ok-bg); }
.tag.no { color: var(--no); background: var(--no-bg); }
.tag.owner { color: var(--violet-text); background: var(--violet-tint); }

/* Section art */
.title-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 28px; }
.side-art { display: block; width: 210px; height: auto; flex: none; margin-bottom: -14px; position: relative; z-index: 1; }
.side-art.study { margin-bottom: -34px; }
.scout { width: 74px; height: auto; margin-left: auto; }

/* Sections */
section.block { padding: 88px 0 0; }
.block h2.title { font-size: clamp(22px, 2.5vw, 32px); line-height: 1.2; letter-spacing: -.045em; font-weight: 500; max-width: 26em; }
.block h2.title::before { content: '# '; color: var(--accent); }
.block .lead { color: var(--muted); margin-top: 12px; max-width: 42em; text-wrap: pretty; }
table.data { width: 100%; border-collapse: collapse; margin-top: 30px; }
table.data th { text-align: left; font: 500 11.5px var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding: 0 12px 11px 0; border-bottom: 1px solid var(--line-2); }
table.data td { padding: 13px 12px 13px 0; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 14px; }
table.data td.code { font: 400 13px var(--mono); color: var(--no); white-space: nowrap; }
.note { display: block; color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.mark { display: inline-block; font: 500 11px var(--mono); padding: 3px 6px; border-radius: 0; background: var(--accent-tint); color: var(--accent-text); white-space: nowrap; }

.venues td, .venues th { text-align: center; }
.venues td:first-child, .venues th:first-child { text-align: left; }
.yes { color: var(--ok); font-family: var(--mono); font-size: 14px; }
.nope { color: var(--faint); font-family: var(--mono); font-size: 14px; }

.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin-top: 34px; border-top: 1px solid var(--line-2); }
.step { padding: 20px 26px 0 0; }
.step + .step { padding-left: 26px; border-left: 1px solid var(--line); }
.step h3 { font-size: 15px; font-weight: 500; letter-spacing: -.01em; margin-bottom: 8px; }
.step .n { font: 500 12px var(--mono); color: var(--accent); margin-bottom: 26px; display: block; }
.step p { color: var(--muted); font-size: 13.5px; text-wrap: pretty; }
pre.cmd { margin: 16px 0 0; padding: 13px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 0; font: 400 12.5px/1.6 var(--mono); color: #d2d2df; overflow-x: auto; }

.limits-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 34px; margin-top: 30px; }
.limits-grid h3 { font-size: 15px; font-weight: 500; margin-bottom: 7px; }
.limits-grid p { color: var(--muted); font-size: 13.5px; text-wrap: pretty; }

footer.site { margin-top: 96px; border-top: 1px solid var(--line); padding: 26px 0 44px; color: var(--muted); font-size: 12.5px; display: flex; justify-content: space-between; gap: 28px; flex-wrap: wrap; }
footer.site code { color: var(--ink); word-break: break-all; }

/* Console */
.app { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.side { border-right: 1px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column; gap: 22px; position: sticky; top: 0; height: 100vh; background: var(--deep); }
.side .brand { padding: 0 8px; font-size: 15px; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a { display: flex; align-items: center; min-height: 40px; padding: 0 10px; border-radius: 0; text-decoration: none; color: var(--muted); font-size: 14.5px; }
.side nav a:hover { color: var(--ink); background: var(--panel); }
.side nav a::before { content: '  '; white-space: pre; color: var(--accent); }
.side nav a[aria-current='page'] { background: var(--panel-2); color: var(--ink); }
.side nav a[aria-current='page']::before { content: '> '; }
.side .foot { margin-top: auto; padding: 0 8px; font-size: 12.5px; color: var(--muted); }
.side .foot code { display: block; color: var(--ink); margin-top: 3px; }
.main { min-width: 0; padding: 0 34px 60px; }
.preview-note { margin: 0 -34px; padding: 9px 34px; background: #1d1009; border-bottom: 1px solid #47210f; color: #f7a678; font-size: 13px; }
.status { display: flex; align-items: center; gap: 18px; padding: 24px 0; flex-wrap: wrap; }
.status h1 { font-size: 21px; font-weight: 500; letter-spacing: -.04em; }
.status h1 .path { color: var(--faint); }
.state { display: inline-flex; align-items: center; gap: 7px; font: 500 12.5px var(--mono); }
.state::before { content: ''; width: 8px; height: 8px; background: var(--ok); animation: blink 1.6s steps(1) infinite; }
.state.off { color: var(--no); }
.state.off::before { background: var(--no); animation: none; }
.status .right { margin-left: auto; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, 1fr); gap: 20px; align-items: start; }
.view { padding-top: 6px; }
.card { position: relative; background: var(--panel); border: 1px solid var(--line-2); padding: 22px 18px 14px; }
.card + .card { margin-top: 26px; }
.card h2 { position: absolute; top: -.72em; left: 12px; margin: 0; padding: 0 8px; background: var(--bg); color: var(--accent-text); font-size: 12px; font-weight: 500; line-height: 1.4; }
.card .sub { color: var(--muted); font-size: 12.5px; margin-bottom: 12px; }
.meter { padding: 13px 0; border-top: 1px solid var(--line); }
.meter-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.meter-top b { font-weight: 500; }
.meter-top span { font: 400 13px var(--mono); color: var(--muted); }
.bar { height: 7px; background: var(--line); margin-top: 9px; border-radius: 1px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); }
.meter small { display: block; margin-top: 7px; color: var(--faint); font: 400 12px var(--mono); }
.kv { display: flex; justify-content: space-between; gap: 14px; padding: 11px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
.kv span:first-child { color: var(--muted); }
.kv .v { font-family: var(--mono); font-size: 13px; text-align: right; word-break: break-all; }
.form-row { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: end; padding: 13px 0; border-top: 1px solid var(--line); }
label { display: block; font-size: 13px; color: var(--muted); }
input[type='text'] { display: block; width: 100%; min-height: 42px; margin-top: 5px; padding: 0 11px; background: var(--deep); border: 1px solid var(--line-2); border-radius: 0; color: var(--ink); font: 400 14px var(--mono); }
input[type='text']:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 48px; padding: 8px 0; border-top: 1px solid var(--line); color: var(--ink); font-size: 14.5px; cursor: pointer; }
.toggle input { appearance: none; flex: none; width: 38px; height: 22px; margin: 0; background: var(--line-2); position: relative; cursor: pointer; transition: background .15s; }
.toggle input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; background: var(--ink); transition: transform .15s; }
.toggle input:checked { background: var(--accent); }
.toggle input:checked::after { transform: translateX(16px); background: var(--accent-ink); }
.actions { display: flex; align-items: center; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.actions span { color: var(--muted); font-size: 13.5px; }
.view[hidden] { display: none; }
.scroll-x { overflow-x: auto; }
.card .rows { border-top: 0; }
.card .rows li:last-child { border-bottom: 0; }

@media (max-width: 980px) {
  .hero-head { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .mascot { width: 150px; margin: -6px 0 -50px auto; }
  .side-art { width: 130px; }
  .side-art.study { margin-bottom: -10px; }
  .desk { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .term { height: 430px; }
  .steps, .limits-grid { grid-template-columns: minmax(0, 1fr); }
  .step, .step + .step { padding: 18px 0 24px; border-left: 0; border-bottom: 1px solid var(--line); }
  .step .n { margin-bottom: 10px; }
  .top nav { display: none; }
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { min-width: 0; position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 14px 16px 8px; gap: 12px; }
  .side nav { flex-direction: row; overflow-x: auto; margin: 0 -16px; padding: 0 16px; }
  .side nav a { white-space: nowrap; min-height: 44px; }
  .side .foot { display: none; }
  .main { padding: 0 16px 44px; }
  .preview-note { margin: 0 -16px; padding: 9px 16px; }
}
@media (max-width: 620px) {
  .wrap { padding: 0 16px; }
  .top { gap: 10px; }
  .top .chip { display: none; }
  .hero { padding-top: 22px; }
  section.block { padding-top: 62px; }
  .rows li { grid-template-columns: 70px minmax(0, 1fr); gap: 8px 12px; }
  .rows .detail { grid-column: 2; text-align: left; white-space: normal; word-break: break-word; }
  .tag { width: 64px; }
  table.data td.code { white-space: normal; word-break: break-word; }
  .form-row { grid-template-columns: 1fr 1fr; }
  .form-row > :first-child { grid-column: 1 / -1; }
  .statusline { flex-direction: column; gap: 2px; }
  .statusline .replay { text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* Rows in the console arrive one after another */
.view:not([hidden]) .rows li { animation: arrive .3s both; animation-delay: calc(var(--i, 0) * 45ms); }
@keyframes arrive { from { opacity: 0; transform: translateX(-4px); } }

/* Console wallet states */
[hidden] { display: none !important; }
.gate { max-width: 560px; margin: 0 auto; padding: 72px 24px; display: flex; flex-direction: column; gap: 18px; }
.gate h1 { font-size: 27px; font-weight: 500; line-height: 1.2; letter-spacing: -.03em; }
.gate p { color: var(--muted); }
.gate .sub { font-size: 13px; }
.gate .sub[role='alert'] { color: var(--no); }
.wallet-list { display: flex; flex-direction: column; gap: 10px; }
.wallet-list .btn { justify-content: flex-start; gap: 10px; }
.wallet-list img { width: 22px; height: 22px; }
.txline { margin-bottom: 16px; padding: 10px 14px; background: var(--panel); border: 1px solid var(--line-2); font-size: 13.5px; }
.txline.bad { color: var(--no-text, var(--no)); border-color: var(--no-line); background: var(--no-bg); }
.txline.good { color: var(--ok); }
.txline a { color: inherit; }
.linkish { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; font-size: 12.5px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.linkish:hover { color: var(--ink); }
.btn:disabled { opacity: .55; cursor: wait; }
select { display: block; width: 100%; min-height: 42px; margin-top: 5px; padding: 0 11px; background: var(--deep); border: 1px solid var(--line-2); color: var(--ink); font: 400 14px var(--mono); }
label.inline { display: inline-flex; align-items: center; gap: 8px; }
label.inline select { margin: 0; min-height: 36px; width: auto; max-width: 190px; }
#mcp-env { white-space: pre-wrap; word-break: break-all; }
.card + .grid2 { margin-top: 26px; }
.next-steps { margin: 0; padding-left: 20px; color: var(--muted); font-size: 14px; line-height: 1.9; }
.next-steps a { color: var(--ink); }
.field-remove { min-height: 42px; }
.form-row.with-remove { grid-template-columns: minmax(110px, 1fr) minmax(0, 1fr) minmax(0, 1fr) auto; }
.pick-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.pick-row code { word-break: break-all; }
