/* Ultraviolet app surfaces (launchpad + Spectrometer explorer).
   All colour/type values come from brand tokens: apps/shared/brand/tokens.css,
   a copy of "Solana L2/brand/tokens.css". Re-copy it when the brand changes. */
@import url("/shared/brand/tokens.css");

:root {
  /* App aliases onto brand tokens */
  --panel: var(--surface); --panel-2: var(--surface-2); --line: var(--border);
  --muted: var(--text-2); --accent: var(--brand); --link: var(--brand-text);
  --buy: var(--signal); --sell: var(--uv-red); --warn: var(--uv-amber);
  --mono: var(--font-mono); --radius: var(--radius-0);
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font-sans); font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
body { overflow-x: hidden; }
a { color: var(--brand-text); text-decoration: none; }
a:hover { color: var(--text); }
::selection { background: var(--brand); color: var(--on-brand); }
:focus-visible { outline: 1px solid var(--brand-text); outline-offset: 3px; }
code, .mono, pre { font-family: var(--font-mono); font-size: 0.9em; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
pre { white-space: pre-wrap; margin: 0; color: var(--text-2); }
h1, h2, h3 { font-weight: 540; letter-spacing: var(--tracking-head); line-height: var(--lh-head); margin: 0 0 14px; }
h1 { font-family: var(--font-display); font-stretch: var(--stretch-display); font-variation-settings: "wdth" 125; font-weight: 650; text-transform: uppercase; letter-spacing: -0.015em; line-height: .95; font-size: clamp(1.6rem, 3.6vw, 2.6rem); }
h2 { font-size: 1.5rem; } h3 { font-family: var(--font-mono); font-weight: 500; font-size: 0.75rem; letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--text-3); }
h3 a { letter-spacing: 0.08em; }
.muted { color: var(--text-2); }
.wrap { max-width: 1320px; margin: 0 auto; padding: 0 max(24px, env(safe-area-inset-left, 0px)); }

/* ---- Instrument chrome ---- */
.frame { position: fixed; z-index: 60; pointer-events: none; inset: 10px; }
.frame i { position: absolute; width: 14px; height: 14px; border: 0 solid var(--text-3); opacity: .7; }
.frame i:nth-child(1) { top: 0; left: 0; border-top-width: 1px; border-left-width: 1px; }
.frame i:nth-child(2) { top: 0; right: 0; border-top-width: 1px; border-right-width: 1px; }
.frame i:nth-child(3) { bottom: 0; left: 0; border-bottom-width: 1px; border-left-width: 1px; }
.frame i:nth-child(4) { bottom: 0; right: 0; border-bottom-width: 1px; border-right-width: 1px; }
.grain { position: fixed; inset: 0; z-index: 70; pointer-events: none; opacity: .035; background-image: var(--tex-grain); }

/* ---- Nav ---- */
header.top { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 72%, transparent); backdrop-filter: blur(14px) saturate(150%); -webkit-backdrop-filter: blur(14px) saturate(150%); border-bottom: var(--hairline); }
header.top::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: var(--grad-spectrum); opacity: .7; }
header.top .wrap { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); }
.brand img { height: 22px; width: auto; display: block; }
.brand .product { font-family: var(--font-mono); font-size: .6875rem; letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--text-3); padding-left: 12px; border-left: var(--hairline); }
nav.links { display: flex; gap: 22px; flex: 1; }
nav.links a { color: var(--text-2); font-size: .875rem; padding: 4px 0; border-bottom: 1px solid transparent; }
nav.links a.active, nav.links a:hover { color: var(--text); border-bottom-color: var(--brand-text); }

/* ---- Buttons / pills ---- */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .6em; appearance: none; font-family: var(--font-mono); font-size: .75rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; padding: 12px 18px; border-radius: var(--radius-1); border: 1px solid var(--border-strong); background: rgba(5, 4, 10, .4); color: var(--text); cursor: pointer; white-space: nowrap; overflow: hidden; transition: background var(--dur-base) var(--ease-out), border-color var(--dur-base), color var(--dur-base), box-shadow var(--dur-base); }
.btn:hover { border-color: var(--brand-text); color: var(--brand-text); text-decoration: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary, .btn.buy { background: var(--brand); color: var(--on-brand); border-color: transparent; box-shadow: 0 0 0 1px rgba(182, 156, 255, .25) inset; }
.btn.primary::after, .btn.buy::after { content: ""; position: absolute; inset: 0; transform: translateX(-120%); background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .28) 50%, transparent 70%); }
.btn.primary:hover, .btn.buy:hover { background: var(--uv-deep); color: var(--on-brand); box-shadow: inset 0 0 0 1px var(--brand-text), 0 0 40px -6px var(--brand); }
.btn.primary:hover::after, .btn.buy:hover::after { transform: translateX(120%); transition: transform 700ms var(--ease-out); }
.btn.sell { background: transparent; color: var(--uv-red); border-color: var(--uv-red); }
.btn.sell:hover { background: rgba(255, 84, 112, .1); color: var(--uv-red); }
.btn.block { width: 100%; }
.px { width: 7px; height: 7px; background: var(--signal); display: inline-block; flex: none; box-shadow: 0 0 10px rgba(210, 255, 61, .6); animation: blink 2.4s steps(1) infinite; }
@keyframes blink { 0%, 86% { opacity: 1; } 87%, 100% { opacity: .2; } }

/* ---- Panels: hairline instruments with corner brackets ---- */
.panel { position: relative; background: rgba(12, 10, 20, .72); border: 1px solid var(--border); border-radius: 0; padding: 18px; }
.panel.instrument { border-color: var(--border-strong); }
.panel.instrument::before { content: ""; position: absolute; inset: -5px; pointer-events: none; background: linear-gradient(var(--brand-text), var(--brand-text)) top left / 12px 1px, linear-gradient(var(--brand-text), var(--brand-text)) top left / 1px 12px, linear-gradient(var(--brand-text), var(--brand-text)) bottom right / 12px 1px, linear-gradient(var(--brand-text), var(--brand-text)) bottom right / 1px 12px; background-repeat: no-repeat; }
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: 2fr 1fr; }
.cards { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.stats { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.stat .label { font-family: var(--font-mono); color: var(--text-3); font-size: .625rem; text-transform: uppercase; letter-spacing: var(--tracking-label); }
.stat .value { font-family: var(--font-mono); font-size: 1.35rem; font-weight: 500; margin-top: 6px; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
section { margin: 24px 0; }

/* ---- Forms ---- */
input, textarea, select { width: 100%; background: var(--bg); color: var(--text); border: 1px solid var(--border-strong); border-radius: var(--radius-1); padding: 11px 12px; font: inherit; font-family: var(--font-mono); font-size: .875rem; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--brand-text); }
input::placeholder, textarea::placeholder { color: var(--text-3); }
label { display: block; font-family: var(--font-mono); font-size: .625rem; letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--text-3); margin: 14px 0 6px; }
.row { display: flex; gap: 8px; align-items: center; }
.row > * { flex: 1; }
.row > .shrink { flex: 0 0 auto; }

/* ---- Tables ---- */
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
th, td { text-align: left; padding: 10px 8px; border-bottom: var(--hairline); vertical-align: top; }
td { font-variant-numeric: tabular-nums; }
th { font-family: var(--font-mono); color: var(--text-3); font-weight: 400; font-size: .625rem; text-transform: uppercase; letter-spacing: var(--tracking-label); }
tr:last-child td { border-bottom: none; }
.table-scroll { overflow-x: auto; }

/* ---- Status ---- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; font-family: var(--font-mono); font-size: .625rem; letter-spacing: .12em; text-transform: uppercase; border: var(--hairline); color: var(--text-2); background: rgba(12, 10, 20, .6); }
.badge.finalized, .badge.ok, .badge.buy, .badge.launch { color: var(--brand-text); border-color: rgba(182, 156, 255, .4); }
.badge.finalized::before { content: ""; width: 5px; height: 5px; background: var(--signal); }
.badge.queued, .badge.received, .badge.pending { color: var(--uv-amber); border-color: rgba(255, 181, 71, .4); }
.badge.rejected, .badge.sell, .badge.error { color: var(--uv-red); border-color: rgba(255, 84, 112, .45); }
.badge.graduated { color: var(--signal); border-color: rgba(210, 255, 61, .35); }
.notice { padding: 12px 14px; border: 1px solid rgba(255, 181, 71, .4); background: rgba(255, 181, 71, .06); color: var(--text); font-size: .875rem; }
.notice.error { border-color: rgba(255, 84, 112, .5); background: rgba(255, 84, 112, .07); }
.notice.ok { border-color: rgba(182, 156, 255, .5); background: rgba(122, 60, 255, .1); }
.progress { height: 4px; background: var(--surface-2); overflow: hidden; }
.progress > div { height: 100%; background: var(--grad-spectrum-solid); }
.empty { padding: 32px; text-align: center; color: var(--text-3); font-family: var(--font-mono); font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; }
.avatar { width: 48px; height: 48px; object-fit: cover; background: var(--surface-2); border: var(--hairline); flex: 0 0 auto; display: grid; place-items: center; font-family: var(--font-mono); color: var(--brand-text); }
.avatar.lg { width: 96px; height: 96px; font-size: 1.6rem; }
.up { color: var(--signal); } .down { color: var(--uv-red); }
#toast { position: fixed; right: 20px; bottom: 20px; display: grid; gap: 8px; z-index: 80; max-width: min(420px, calc(100vw - 40px)); }
#toast > div { background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: var(--radius-2); padding: 12px 14px; font-size: .875rem; overflow-wrap: anywhere; }
footer { color: var(--text-3); font-family: var(--font-mono); font-size: .6875rem; letter-spacing: .08em; padding: 32px 0 40px; border-top: var(--hairline); margin-top: 56px; }
footer a { color: var(--text-2); }
svg.chart { width: 100%; height: 260px; display: block; }

@media (max-width: 800px) {
  .cols-2 { grid-template-columns: 1fr; }
  header.top .wrap { height: auto; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; row-gap: 8px; }
  nav.links { order: 3; flex-basis: 100%; overflow-x: auto; gap: 18px; }
  .brand .product { display: none; }
  .frame { inset: 6px; }
}
@media (prefers-reduced-motion: reduce) { .px { animation: none; } .btn::after { display: none; } }
.badge.preconfirmed { color: var(--signal); border-color: rgba(210, 255, 61, .35); }
.badge.preconfirmed::before { content: ""; width: 5px; height: 5px; background: var(--signal); }
.badge.reverting { color: var(--uv-amber); border-color: rgba(255, 181, 71, .4); }
/* Grid and flex children may shrink below their content width (prevents phone overflow). */
.grid > *, .row > *, .hero > * { min-width: 0; }
@media (max-width: 800px) {
  .row { flex-wrap: wrap; }
  .panel { padding: 14px; }
  h1 { overflow-wrap: anywhere; }
}
