/*
 * css/assets.css: the assets pages (owner: assets agent): /credits, /t/:id, /stocks, /s/:symbol.
 * Lays out page sections only. Tokens from css/tokens.css; primitives (buttons, inputs, chips, tabs, sheets, the
 * stepper, the receipt, kpis, meters) from css/site.css; the shared helper bits (.ap-amt, .ap-key, .ap-txlink,
 * .ap-quick, .ap-empty-card) from css/app.css. Class prefix: as-.
 */

/* ------------------------------------------------------------------ shared */
.as-page { position: relative; }
.as-head { margin-bottom: 26px; }
.as-head h1 { max-width: 20ch; }
.as-section { margin-top: 44px; }
.as-title { align-items: flex-end; flex-wrap: wrap; gap: 10px 16px; margin-bottom: 14px; }
.as-label { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.as-big { font-size: clamp(26px, 3vw, 34px); line-height: 1.15; color: var(--ink); }
.as-big .asset-amount { font-weight: 500; letter-spacing: -0.03em; }
.as-big .ap-amt-sym { font-size: 15px; }
.as-sub { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.as-muted-note { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.as-note { display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 12px 14px; border-radius: 14px; background: rgba(6, 8, 40, 0.55); color: var(--body); font-size: 13.5px; line-height: 1.5; }
.as-note .icon { flex: none; margin-top: 2px; color: var(--ice); }
.as-back { margin: 0 0 18px; font-size: 14.5px; }
.as-back .icon { order: -1; }
.as-back:hover .icon { transform: translateX(-3px); }
.as-missing { max-width: 560px; margin: 6vh auto 0; }
.as-span { grid-column: 1 / -1; }
.as-affix { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--muted); }
.as-affix .asset-chip { font-size: 14px; }
.as-sheet-form { --gap: 16px; }
.as-sheet-form .stepper { margin: 2px 0; }
.ap-quick .chip .asset-chip { font-family: var(--mono); }

/* the connect panel for the personal parts (the public parts stay visible) */
.as-gate { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 18px 22px; padding: 22px 26px; }
.as-gate .wallet-orb { margin: 0; width: 56px; height: 56px; }
.as-gate .wallet-orb svg.mark { width: 30px; }
.as-gate h2 { margin: 0 0 4px; font-size: 20px; font-weight: 600; letter-spacing: -0.02em; }
.as-gate p { margin: 0; color: var(--muted); font-size: 14.5px; max-width: 54ch; }
@media (max-width: 760px) {
  .as-gate { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; padding: 24px 18px; }
  .as-gate .btn { width: 100%; }
}

/* change chip (24 h) */
/* the flat chip (no 24 h change yet, or 0.00%) is text in --body: --muted measured 4.16:1 on the price card's glow */
.as-chg { display: inline-flex; align-items: center; gap: 3px; height: 24px; padding: 0 8px; border-radius: var(--pill); font-family: var(--mono); font-size: 12.5px; font-weight: 600; white-space: nowrap; color: var(--body); background: var(--glass); }
.as-chg .icon { width: 13px; height: 13px; }
.as-chg.is-up { color: var(--ok); background: var(--ok-tint); }
.as-chg.is-down { color: var(--bad); background: var(--bad-tint); }
.as-chg.is-lg { height: 30px; padding: 0 11px; font-size: 14px; }
.as-chg.is-lg .icon { width: 16px; height: 16px; }

/* kind orbs */
.as-orb { --s: 44px; flex: none; width: var(--s); height: var(--s); display: grid; place-items: center; border-radius: 50%; color: #fff; background: radial-gradient(circle at 32% 28%, #5d6bff, #111bc4 72%); box-shadow: 0 0 0 5px rgba(52, 66, 255, 0.12), 0 0 24px -4px rgba(52, 66, 255, 0.75); }
.as-orb .icon { width: calc(var(--s) * 0.44); height: calc(var(--s) * 0.44); }
.as-orb.is-mcp { background: radial-gradient(circle at 32% 28%, #5ff0c6, #0b7a62 72%); box-shadow: 0 0 0 5px rgba(67, 223, 174, 0.12), 0 0 24px -4px rgba(67, 223, 174, 0.6); }
.as-orb.is-agent { background: radial-gradient(circle at 32% 28%, #b893ff, #4b25c4 72%); box-shadow: 0 0 0 5px rgba(155, 107, 255, 0.14), 0 0 24px -4px rgba(155, 107, 255, 0.65); }
.as-kind { background: rgba(52, 66, 255, 0.16); color: var(--ice); }
.as-kind.is-mcp { background: rgba(67, 223, 174, 0.13); color: #8ff0d0; }
.as-kind.is-agent { background: rgba(155, 107, 255, 0.16); color: #cdb6ff; }
.as-by { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--ice); white-space: nowrap; }
.as-by .icon { width: 14px; height: 14px; }
.as-by-addr { font-family: var(--mono); font-size: 13px; }

/* balance strip (credits) and the bucket (stocks) */
.as-balance { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 18px 32px; padding: 24px 28px; }
.as-balance.is-skel { display: block; }
.as-balance-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.as-stats { display: flex; gap: 28px; margin: 0; }
.as-stat { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.as-stat dt { font-size: 11.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.as-stat dd { margin: 0; color: var(--ink); font-size: 17px; }
.as-balance-actions { display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 1020px) {
  .as-balance { grid-template-columns: minmax(0, 1fr) auto; }
  .as-stats { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 760px) {
  .as-balance { grid-template-columns: minmax(0, 1fr); padding: 20px 18px; }
  .as-stats { grid-row: auto; justify-content: space-between; gap: 12px; }
  .as-balance-actions > .btn { flex: 1 1 0; }
}

/* ------------------------------------------------------------------ tools market (/credits) */
.as-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0 0 18px; }
.as-search { position: relative; display: flex; align-items: center; flex: 1 1 240px; max-width: 380px; min-width: 0; }
.as-search > .icon { position: absolute; left: 15px; width: 18px; height: 18px; color: var(--faint); pointer-events: none; }
.as-search > .input { padding-left: 44px; width: 100%; }
.as-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.as-chip { min-height: 40px; height: auto; padding: 0 14px; gap: 7px; }
.as-chip .icon { width: 14px; height: 14px; }
.as-chip-n { font-size: 12px; color: var(--muted); }
.as-chip-n:empty { display: none; }
.as-chip[aria-pressed="true"] .as-chip-n { color: inherit; opacity: 0.8; }

.as-tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.as-tool { position: relative; display: flex; flex-direction: column; gap: 12px; padding: 20px; min-height: 200px; color: inherit; text-decoration: none; transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
a.as-tool:hover { transform: translateY(-2px); border-color: var(--line-2); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 18px 40px -22px rgba(52, 66, 255, 0.8); }
a.as-tool:hover .as-go { transform: translateX(3px); color: #fff; }
.as-tool.is-skel { min-height: 200px; }
.as-tool-top { display: flex; align-items: center; gap: 14px; min-width: 0; }
.as-tool-id { min-width: 0; flex: 1 1 auto; }
.as-tool-name { margin: 0; font-size: 17px; font-weight: 600; color: var(--ink); letter-spacing: -0.015em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.as-tool-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 5px; }
.as-tool-about { margin: 0; flex: none; max-height: 3em; color: var(--muted); font-size: 14.5px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.as-tool-foot { margin-top: auto; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; padding-top: 12px; border-top: 1px solid rgba(170, 182, 255, 0.08); }
.as-price { display: inline-flex; align-items: baseline; gap: 6px; }
.as-price .asset-amount { align-self: center; color: var(--ink); font-size: 15px; }
.as-price small { color: var(--muted); font-size: 12.5px; }
.as-uses { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.as-uses .icon { width: 14px; height: 14px; }
.as-go { margin-left: auto; color: var(--ice); display: inline-flex; transition: transform var(--dur) var(--ease), color var(--dur) var(--ease); }
@media (max-width: 760px) {
  .as-tools { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .as-tool { min-height: 0; padding: 18px; }
  .as-search { max-width: none; flex-basis: 100%; }
  .as-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 calc(var(--gutter) * -1); padding: 0 var(--gutter); width: calc(100% + var(--gutter) * 2); }
  .as-chips::-webkit-scrollbar { display: none; }
  .as-chip { flex: none; }
}

/* my tools + history */
.as-personal { margin-top: 44px; }
.as-split { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.as-col { min-width: 0; }
@media (max-width: 1020px) { .as-split { grid-template-columns: minmax(0, 1fr); gap: 40px; } }
.as-earn { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; margin-bottom: 12px; border-radius: 20px; }
.as-earn-v { margin-top: 2px; font-size: 22px; color: var(--ink); }
.as-mytools { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.as-mytool { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px 18px; align-items: center; padding: 16px 18px; border-radius: 20px; }
.as-mytool-top { display: flex; align-items: center; gap: 12px; min-width: 0; }
.as-mytool-id { min-width: 0; }
.as-mytool-name { display: block; color: var(--ink); font-weight: 600; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.as-mytool-name:hover { color: #fff; }
.as-mytool-stats { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px 26px; margin: 0; }
.as-mytool-stats dt { font-size: 11.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.as-mytool-stats dd { margin: 2px 0 0; color: var(--ink); font-size: 14.5px; }
.as-mytool-stats .asset-amount { font-family: var(--mono); }
.as-mytool-actions { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; grid-column: 2; grid-row: 1; }
@media (max-width: 760px) {
  .as-mytool { grid-template-columns: minmax(0, 1fr); }
  .as-mytool-actions { grid-column: 1; grid-row: auto; justify-content: flex-start; margin: 0 -8px -6px; }
}

.as-hist-card { padding: 4px 8px; }
.as-hist { list-style: none; margin: 0; padding: 0; }
.as-hrow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 10px; border-bottom: 1px solid rgba(170, 182, 255, 0.07); }
.as-hrow:last-child { border-bottom: 0; }
.as-hicon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: var(--ice); background: rgba(52, 66, 255, 0.16); }
.as-hicon.is-payment, .as-hicon.is-topup, .as-hicon.is-gift, .as-hicon.is-claim { color: var(--ok); background: var(--ok-tint); }
.as-hicon.is-withdraw { color: var(--muted); background: var(--glass-2); }
.as-hmain { display: flex; flex-direction: column; min-width: 0; }
.as-hmain strong { color: var(--ink); font-size: 14.5px; font-weight: 600; }
.as-hmeta { display: flex; flex-wrap: wrap; gap: 0 6px; color: var(--muted); font-size: 12.5px; }
.as-hamt { display: flex; flex-direction: column; align-items: flex-end; gap: 0; text-align: right; }
.as-hval { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-size: 14.5px; }
.as-hval.ok { color: var(--ok); }
.as-hamt .ap-txlink { min-height: 26px; font-size: 12.5px; }
.as-hamt .asset-amount { font-family: var(--mono); color: var(--ink); font-size: 14px; }

/* list a tool sheet */
.as-preview { pointer-events: none; }
.as-preview .as-tool { min-height: 0; padding: 16px 18px; background: linear-gradient(160deg, rgba(52, 66, 255, 0.14), rgba(255, 255, 255, 0.03)); }
.as-count { float: right; padding-left: 10px; font-size: 12px; color: var(--muted); }
.as-count.bad { color: var(--bad); }
.as-done { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 18px 4px 6px; }
.as-done-badge { width: 64px; height: 64px; margin-bottom: 8px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: linear-gradient(135deg, #43dfae, #1f9f7a); box-shadow: 0 0 0 8px rgba(67, 223, 174, 0.12), 0 0 40px rgba(67, 223, 174, 0.5); }
.as-done h3 { margin: 0; font-size: 20px; }
.as-done p { margin: 0; color: var(--muted); }
.as-done-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 14px; }
.as-edit-head { display: flex; align-items: center; gap: 12px; }
.as-edit-head strong { display: block; color: var(--ink); font-size: 16px; }

/* ------------------------------------------------------------------ tool page (/t/:id) */
.as-tool-page { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr); grid-template-areas: "head side" "body side"; gap: 26px 36px; align-items: start; }
.as-tool-page.is-loading { grid-template-areas: "head side"; }
.as-thead-wrap { grid-area: head; min-width: 0; }
.as-tside { grid-area: side; position: sticky; top: calc(var(--nav-h) + 18px); display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.as-tbody { grid-area: body; display: flex; flex-direction: column; gap: 34px; min-width: 0; }
.as-thead { display: flex; align-items: center; gap: 18px; min-width: 0; }
.as-thead-text { min-width: 0; }
.as-thead .eyebrow { margin-bottom: 2px; }
.as-tname { margin: 2px 0 6px; font-size: clamp(30px, 4vw, 46px); font-weight: 600; letter-spacing: -0.035em; line-height: 1.05; overflow-wrap: anywhere; }
.as-tname-sub { display: inline-block; margin-left: 14px; font-size: 0.5em; font-weight: 300; color: var(--muted); letter-spacing: -0.01em; vertical-align: 0.18em; }
.as-tmeta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; color: var(--muted); font-size: 14px; }
.as-tabout { margin: 20px 0 0; max-width: 60ch; }
.as-tkpis { margin-top: 24px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.as-tkpis .kpi-label .icon { width: 15px; height: 15px; color: var(--ice); }
.as-tkpis .kpi-value .asset-amount { gap: 8px; }
.as-block h2 { margin: 0 0 12px; }
.as-uri-row { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 16px; border-radius: 18px; margin-bottom: 10px; }
.as-uri { flex: 1 1 auto; min-width: 0; padding: 0; background: none; font-family: var(--mono); font-size: 13.5px; color: var(--ice); overflow-wrap: anywhere; }
.as-how { list-style: none; counter-reset: how; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.as-how li { position: relative; counter-increment: how; padding-left: 42px; color: var(--muted); font-size: 15px; line-height: 1.5; min-height: 28px; }
.as-how li::before { content: counter(how); position: absolute; left: 0; top: -1px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; font-family: var(--mono); font-size: 13px; font-weight: 600; color: #fff; background: radial-gradient(circle at 35% 30%, #5d6bff, #111bc4 75%); box-shadow: 0 0 16px -4px rgba(52, 66, 255, 0.9); }
.as-how b { color: var(--ink); font-weight: 600; }
.as-params { margin-bottom: 16px; }
.as-call-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.as-code { margin: 0 0 14px; padding: 14px 16px; max-width: 100%; overflow-x: auto; border-radius: 16px; background: rgba(6, 8, 40, 0.65); border: 1px solid var(--line); font-family: var(--mono); font-size: 12.5px; line-height: 1.6; color: var(--body); white-space: pre; }
.as-code code { background: none; padding: 0; font-size: inherit; }

.as-use { display: flex; flex-direction: column; gap: 16px; }
.as-use-price { display: flex; flex-direction: column; gap: 2px; }
.as-use-rows { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 14px 0 0; border-top: 1px solid rgba(170, 182, 255, 0.1); }
.as-use-rows > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.as-use-rows dt { color: var(--muted); font-size: 14px; }
.as-use-rows dd { margin: 0; color: var(--ink); }
.as-use-rows .asset-amount { font-family: var(--mono); }
.as-use-hint { margin: -4px 0 0; color: var(--muted); font-size: 13px; text-align: center; }
/* the chain refused a use because the price rose: the new price, said once, above the button */
.as-price-note { background: rgba(255, 197, 107, 0.09); box-shadow: inset 0 0 0 1px rgba(255, 197, 107, 0.22); }
.as-price-note .icon { color: var(--warn); }
.as-qty { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.as-qty-l { color: var(--muted); font-size: 14px; font-weight: 600; }
.as-qty-ctl { display: inline-flex; align-items: center; gap: 10px; }
.as-qty-ctl .btn-icon { width: 44px; height: 44px; }
.as-qty-n { min-width: 3ch; text-align: center; font-size: 20px; color: var(--ink); }
.as-passbox:empty { display: none; }
.as-tside .receipt { max-width: none; margin: 0; }
.as-receipt .receipt-actions .btn { flex: 1 1 auto; }
.as-pass { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px; border-radius: 20px; }
.as-pass-top { display: flex; align-items: center; gap: 10px; }
.as-pass-top strong { color: var(--ink); font-size: 15px; }
.as-pass-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px var(--ok-tint), 0 0 12px var(--ok); animation: as-pulse 2.4s var(--ease) infinite; }
.as-pass-left { margin-left: auto; color: var(--muted); font-size: 13px; }
.as-pass .ap-txlink { min-height: 0; }
.as-pass-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
@keyframes as-pulse { 50% { box-shadow: 0 0 0 7px rgba(67, 223, 174, 0.04), 0 0 16px var(--ok); } }
.as-uses-list .as-hmain strong { font-family: var(--mono); font-size: 13.5px; }
@media (min-width: 761px) { .as-bar { display: none; } }
@media (max-width: 1020px) {
  .as-tool-page { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "side" "body"; gap: 22px; }
  .as-tool-page.is-loading { grid-template-areas: "head" "side"; }
  .as-tside { position: static; }
}
@media (max-width: 760px) {
  .as-thead { gap: 14px; }
  .as-thead > .as-orb, .as-thead > .logo-disc { --s: 52px; --size: 52px; }
  .as-tname-sub { display: block; margin: 4px 0 0; font-size: 0.42em; vertical-align: 0; }
  .as-tkpis { gap: 8px; }
  .as-tkpis .kpi { padding: 12px 12px; }
  .as-tkpis .kpi-value { font-size: 18px; }
  .as-tkpis .kpi-label { font-size: 12px; gap: 6px; }
  .as-tbody { gap: 28px; }
}
@media (max-width: 400px) {
  .as-tkpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .as-tkpis .kpi:last-child { grid-column: 1 / -1; }
}

/* ------------------------------------------------------------------ stocks (/stocks) */
.as-stk-top { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr); gap: 18px; align-items: start; }
@media (max-width: 1020px) { .as-stk-top { grid-template-columns: minmax(0, 1fr); } }
.as-bucket { display: flex; flex-direction: column; gap: 12px; padding: 24px 26px; min-width: 0; }
.as-bucket-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.as-bucket-chips .chip .icon { width: 12px; height: 12px; }
.as-bucket .as-balance-actions { margin-top: 4px; }
/* Buy now waits for Save while the builder shows another basket; a refused buy names the stock and the fix */
.as-buy-note { display: flex; gap: 8px; align-items: flex-start; margin: 0; color: var(--warn); font-size: 13.5px; line-height: 1.5; }
.as-buy-note .icon { flex: none; margin-top: 2px; }
.as-refused { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--warn-tint); color: var(--body); font-size: 13.5px; line-height: 1.5; }
.as-refused p { margin: 0; overflow-wrap: anywhere; }
.as-lastbuy { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; padding-top: 14px; border-top: 1px solid rgba(170, 182, 255, 0.1); }
.as-lastbuy ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.as-lastbuy li { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--body); }
.as-lastbuy li b { color: var(--ink); font-weight: 500; }
.as-lastbuy .link-quiet { align-self: flex-start; background: none; border: 0; padding: 0; font: inherit; font-size: 14px; cursor: pointer; }

.as-builder { min-width: 0; }
.as-builder.is-skel, .as-bucket.is-skel { min-height: 220px; }
.as-bhead { align-items: flex-start; margin-bottom: 12px; }
.as-bhead h2 { font-size: 20px; }
.as-bbar { margin: 0 0 10px; }
.as-brows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.as-brow { padding: 10px 0 2px; border-bottom: 1px solid rgba(170, 182, 255, 0.08); }
.as-brow-top { display: grid; grid-template-columns: 10px 30px minmax(0, 1fr) auto 40px; gap: 10px; align-items: center; }
.as-brow-dot { width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 10px -1px currentColor; }
.as-brow-name { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; cursor: default; }
.as-brow-name strong { color: var(--ink); font-size: 15px; }
.as-brow-name span { color: var(--muted); font-size: 12.5px; }
.as-brow .range-value { font-family: var(--mono); color: var(--ink); font-size: 16px; font-weight: 500; min-width: 4ch; text-align: right; }
.as-brow-x { width: 40px; height: 40px; }
.as-brow .range { height: 36px; }
.as-brow-empty p { margin: 0; padding: 4px 0 12px; color: var(--muted); font-size: 14.5px; }
.as-brow-add { padding-top: 12px; }
.as-addpill { width: 100%; min-height: 48px; display: flex; align-items: center; justify-content: center; gap: 8px; border: 1px dashed var(--line-2); border-radius: var(--pill); background: transparent; color: var(--ice); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.as-addpill:hover:not(:disabled) { background: var(--glass); border-color: var(--glow); }
.as-addpill:disabled { opacity: 0.55; cursor: default; }
.as-addpill .icon { width: 18px; height: 18px; }
.as-bset { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px 20px; margin-top: 20px; align-items: start; }
.as-bset .field-label small { margin-left: 6px; }
.as-slip { display: flex; width: 100%; }
.as-slip > button { flex: 1 1 0; min-width: 0; padding: 0 6px; font-family: var(--mono); font-size: 13px; }
.as-auto-sw { min-height: 40px; font-size: 14px; color: var(--body); }
.as-auto-amt { max-width: 240px; }
.as-bfoot { display: flex; align-items: center; justify-content: space-between; gap: 14px 20px; margin-top: 20px; }
.as-bfoot-notes { display: flex; flex-direction: column; gap: 6px; min-width: 0; max-width: 46ch; }
.as-bfoot .as-muted-note { font-size: 13px; }
.as-slip-warn { margin: 0; color: var(--warn); font-size: 13px; line-height: 1.5; }
.as-slip-lift { color: var(--ice); line-height: 1.5; }
.as-builder.is-dirty .as-bfoot .btn-primary { box-shadow: var(--glow-shadow); }
@media (max-width: 760px) {
  .as-bucket { padding: 20px 18px; }
  .as-bucket .as-balance-actions > .btn { flex: 1 1 auto; }
  .as-bset { grid-template-columns: minmax(0, 1fr); }
  .as-auto-amt { max-width: none; }
  .as-bfoot { flex-direction: column; align-items: stretch; }
  .as-bfoot-notes { max-width: none; }
  .as-bfoot .btn { width: 100%; }
}

/* stock rows: the row is the grid; the symbol link stretches over the row, the Add button sits above it */
.as-board { margin-top: 48px; }
.as-tabs { margin: 0 0 18px; }
.as-tabs [hidden] { display: none; }
.as-stoolbar { margin-bottom: 10px; }
.as-elig { flex: none; font-size: 14.5px; }
.as-sort { width: auto; flex: 0 0 auto; min-width: 170px; }
.as-slist { list-style: none; margin: 0; padding: 0; }
.as-shead, .as-srow {
  display: grid; align-items: center; gap: 14px;
  grid-template-columns: 36px minmax(0, 1.5fr) minmax(0, 0.9fr) minmax(0, 0.8fr) minmax(0, 0.8fr) minmax(0, 0.9fr) 96px;
}
.as-shead { padding: 6px 16px 10px; font-size: 11.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); }
.as-shead > span:first-child { grid-column: span 2; }
.as-shead .num, .as-sprice, .as-sdepth { text-align: right; }
.as-srow { position: relative; padding: 12px 16px; border-bottom: 1px solid rgba(170, 182, 255, 0.07); border-radius: 16px; transition: background-color var(--dur) var(--ease); }
.as-srow:hover { background: rgba(255, 255, 255, 0.035); }
.as-srow:focus-within { background: rgba(52, 66, 255, 0.08); }
.as-srow.is-skel { grid-template-columns: 36px minmax(0, 1fr); }
.as-slogo { display: inline-flex; }
.as-sname { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.as-sname strong { color: var(--ink); font-size: 15.5px; font-weight: 600; letter-spacing: -0.01em; }
.as-sname > .truncate { color: var(--muted); font-size: 13px; }
.as-srow-link { color: inherit; outline-offset: 2px; }
.as-srow-link::after { content: ''; position: absolute; inset: 0; border-radius: inherit; }
.as-sprice { color: var(--ink); font-size: 15px; }
.as-skel-num { display: inline-block; width: 70px; height: 12px; margin: 0; vertical-align: middle; }
.as-schg { display: flex; justify-content: flex-end; }
.as-smeta { display: contents; }
.as-sdepth { color: var(--body); font-size: 14px; }
.as-sm-label { display: none; }
.as-sbadge { display: flex; }
.as-inb { gap: 5px; white-space: nowrap; }
.as-inb .icon { width: 12px; height: 12px; }
.as-sact { position: relative; z-index: 1; display: flex; justify-content: flex-end; }
.as-add { min-width: 84px; }
.as-add.is-picked { color: var(--ok); }
.as-foot-note { display: flex; gap: 8px; align-items: flex-start; margin: 16px 0 0; color: var(--muted); font-size: 13px; }
.as-foot-note .icon { flex: none; margin-top: 2px; }
.as-srow-empty { list-style: none; }
@media (max-width: 1100px) {
  .as-shead, .as-srow { grid-template-columns: 36px minmax(0, 1.4fr) minmax(0, 0.9fr) minmax(0, 0.8fr) minmax(0, 0.8fr) minmax(0, 0.9fr) 52px; }
  .as-add { min-width: 0; width: 44px; height: 44px; padding: 0; border-radius: 50%; }
  .as-add-t { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
@media (max-width: 760px) {
  .as-shead { display: none; }
  .as-srow {
    grid-template-columns: 36px minmax(0, 1fr) auto 44px;
    grid-template-areas: "logo name price act" "logo meta chg act";
    gap: 2px 12px; padding: 12px 6px; border-radius: 14px;
  }
  .as-srow > .as-slogo { grid-area: logo; align-self: center; }
  .as-srow > .as-sname { grid-area: name; }
  .as-srow > .as-sprice { grid-area: price; }
  .as-srow > .as-schg { grid-area: chg; }
  .as-srow > .as-smeta { grid-area: meta; display: flex; align-items: center; gap: 8px; min-width: 0; }
  .as-sdepth { text-align: left; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
  .as-sm-label { display: inline; font-size: inherit; }
  .as-srow > .as-sact { grid-area: act; }
  .as-srow .as-sname > .truncate { display: none; }
  .as-stoolbar .as-search { flex-basis: 100%; }
  .as-sort { flex: 1 1 auto; min-width: 0; }
}

/* holdings and buys */
.as-hold-top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; margin-bottom: 14px; }
.as-hold-top .as-big { margin-top: 2px; }
.as-hold-cash { display: flex; flex-wrap: wrap; gap: 8px; }
.as-cash { display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border-radius: var(--pill); background: var(--glass); border: 1px solid var(--line); color: var(--ink); font-size: 14px; }
.as-cash .asset-amount { font-family: var(--mono); }
.as-hold { list-style: none; margin: 0; padding: 4px 8px; }
.as-hold-row { border-bottom: 1px solid rgba(170, 182, 255, 0.07); }
.as-hold-row:last-child { border-bottom: 0; }
.as-hold-link { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto minmax(90px, auto); gap: 12px; align-items: center; padding: 12px 10px; color: inherit; border-radius: 14px; }
.as-hold-link:hover { background: rgba(255, 255, 255, 0.03); }
.as-hold-bal { display: flex; flex-direction: column; align-items: flex-end; color: var(--ink); font-size: 14.5px; }
.as-hold-bal small { color: var(--muted); font-size: 12px; }
.as-hold-usd { color: var(--ink); text-align: right; font-size: 15px; }
.as-buys .as-hrow { grid-template-columns: 32px minmax(0, 1fr) auto; }
@media (max-width: 760px) {
  .as-hold-link { grid-template-columns: 32px minmax(0, 1fr) auto; row-gap: 2px; }
  .as-hold-link > .logo-disc { grid-column: 1; grid-row: 1 / span 2; }
  .as-hold-link > .as-sname { grid-column: 2; grid-row: 1; }
  .as-hold-usd { grid-column: 3; grid-row: 1; }
  .as-hold-bal { grid-column: 2 / span 2; grid-row: 2; align-items: baseline; flex-direction: row; gap: 8px; font-size: 13.5px; }
}

/* add a stock sheet */
.as-pick-wrap { --gap: 12px; }
.as-pick-wrap .as-search { max-width: none; }
.as-pick { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.as-pick-opt { width: 100%; display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 12px; align-items: center; min-height: 56px; padding: 8px 10px; border: 0; border-radius: 14px; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: background-color var(--dur) var(--ease); }
.as-pick-opt:hover, .as-pick-opt:focus-visible { background: var(--glass-2); }
.as-pick-px { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; color: var(--ink); font-size: 14px; }
.as-pick-none { padding: 18px 8px; color: var(--muted); text-align: center; }

/* ------------------------------------------------------------------ stock page (/s/:symbol) */
.as-stock-page { display: flex; flex-direction: column; gap: 24px; }
.as-sgrid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.as-scol { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
@media (max-width: 1020px) { .as-sgrid { grid-template-columns: minmax(0, 1fr); } }
.as-pc-head { align-items: flex-start; flex-wrap: wrap; }
.as-px-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.as-px { font-size: clamp(32px, 4.2vw, 46px); font-weight: 500; color: var(--ink); letter-spacing: -0.035em; line-height: 1.1; }
.as-src { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 8px 0 0; color: var(--muted); font-size: 13.5px; }
.as-range > button { min-height: 34px; padding: 0 14px; font-family: var(--mono); font-size: 13px; }
.as-chart { margin: 6px 0 8px; min-height: 200px; }
.as-pool-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.as-pool { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: center; }
.as-pair { display: inline-flex; align-items: center; }
.as-pair > :last-child { margin-left: -9px; border-radius: 50%; box-shadow: 0 0 0 2px var(--bg-2); }
.as-pool-top { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-bottom: 7px; }
.as-pool-top strong { color: var(--ink); font-size: 14.5px; }
.as-pool-depth { margin-left: auto; color: var(--ink); font-size: 14px; }
.as-elig .card-head h2 { display: inline-flex; align-items: center; }
.as-elig-icon { display: inline-grid; place-items: center; width: 30px; height: 30px; margin-right: 10px; border-radius: 50%; color: #fff; background: radial-gradient(circle at 35% 30%, #5d6bff, #111bc4 75%); box-shadow: 0 0 16px -4px rgba(52, 66, 255, 0.9); }
.as-elig .as-muted-note { margin-bottom: 14px; }
.as-elig-status { margin: 0 0 12px; color: var(--ok); font-size: 14px; font-weight: 600; }
.as-elig-status:empty { display: none; }
.as-holdline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid rgba(170, 182, 255, 0.1); font-size: 14px; color: var(--body); }
.as-holdline b { color: var(--ink); font-weight: 500; }
.as-holdline[hidden] { display: none; }
.as-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 18px 0 0; padding-top: 16px; border-top: 1px solid rgba(170, 182, 255, 0.1); }
.as-facts dt { font-size: 11.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.as-facts dd { margin: 3px 0 0; color: var(--ink); font-size: 15px; }
@media (max-width: 520px) { .as-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* the basket badge rides next to the symbol on phones (its own column on wider screens) */
.as-sname-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.as-inb-sm { display: none; }
@media (max-width: 760px) {
  .as-inb-sm { display: inline-flex; }
  .as-sbadge { display: none; }
}
@media (max-width: 360px) {
  .as-inb-sm { padding: 0 6px; }
  .as-inb-sm > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
@media (max-width: 760px) { .as-uri { font-size: 12.5px; } }

.as-src-pool { flex-basis: 100%; color: var(--muted); font-size: 13px; }
.as-stk-left { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.as-holdcard { display: flex; flex-direction: column; gap: 10px; padding: 20px 24px; }
.as-holdcard-v { font-size: 24px; color: var(--ink); letter-spacing: -0.02em; }
.as-holdmini { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.as-holdmini li { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; font-size: 14px; }
.as-holdmini b { color: var(--ink); font-weight: 600; }
.as-holdmini .num { text-align: right; color: var(--ink); }
.as-holdmini .num.muted { color: var(--muted); }
.as-linkbtn { align-self: flex-start; background: none; border: 0; padding: 0; font: inherit; font-size: 14px; cursor: pointer; }
@media (max-width: 1020px) {
  .as-stk-left { display: contents; }
  .as-holdcard { order: 3; }
}
@media (max-width: 760px) { .as-holdcard { padding: 18px; } }
.as-missing-title { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }

/* ------------------------------------------------------------------ phones: 44 px tap targets
 * SPEC section 2: every control a thumb can hit is at least 44 px. The small primitives (.btn-sm 36, .seg 38, the
 * sheet close 40, the explorer links) grow to 44 on these pages and in their sheets; layout stays as it is. */
@media (max-width: 760px) {
  .as-page .btn-sm, .as-sheet-form .btn-sm { --btn-h: 44px; }
  .as-chip { min-height: 44px; }
  .as-brow-x { width: 44px; height: 44px; }
  .as-slip > button, .as-range > button, .as-sheet-form .seg > button { min-height: 44px; }
  .as-range > button { min-width: 52px; }
  .as-auto-sw { min-height: 44px; }
  .as-back { min-height: 44px; margin-bottom: 6px; }
  .as-linkbtn { min-height: 44px; }
  .as-mytool-name { line-height: 44px; }
  .as-hrow { padding: 8px 10px 0; }
  .as-hamt .ap-txlink, .as-pass .ap-txlink { min-height: 44px; }
  .as-sheet-form .ap-quick .chip { min-height: 44px; }
  .ap-sheet .sheet-close { width: 44px; height: 44px; }
}
