/* Aibou. Night desk: near-black, one amber light, green and red only for money.
   Young Serif (Jeff Kellem), Rethink Sans (Hans Thiessen), Azeret Mono (Displaay): SIL Open Font License 1.1 (google/fonts). */
@font-face { font-family: 'Young Serif'; font-style: normal; font-weight: 400; font-display: swap; src: url(/assets/fonts/young-serif-400.woff2) format('woff2'); }
@font-face { font-family: 'Rethink Sans'; font-style: normal; font-weight: 400 800; font-display: swap; src: url(/assets/fonts/rethink-sans-400-800.woff2) format('woff2'); }
@font-face { font-family: 'Azeret Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url(/assets/fonts/azeret-mono-400.woff2) format('woff2'); }

:root {
  --bg: #09090b; --bg2: #0e0e11; --panel: #121215; --panel2: #17171b; --line: #222228; --line2: #2c2c33;
  --text: #f3efe6; --soft: #c9c4ba; --muted: #8e8a83; --faint: #5d5a55;
  --amber: #ffb23f; --amber2: #ffc874; --amber-ink: #1a1206; --glow: rgba(255, 178, 63, .16);
  --up: #3ddc84; --down: #ff5a5f; --upbg: rgba(61, 220, 132, .1); --downbg: rgba(255, 90, 95, .1);
  --serif: 'Young Serif', Georgia, serif; --sans: 'Rethink Sans', system-ui, sans-serif; --mono: 'Azeret Mono', ui-monospace, monospace;
  --r: 18px; --r2: 12px; --rail: 248px; --side: 340px; --gut: 18px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 15px/1.45 var(--sans); -webkit-font-smoothing: antialiased; }
body { overflow: hidden; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
[hidden] { display: none !important; }
.up { color: var(--up); } .down { color: var(--down); }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; border-radius: 8px; }
[data-ico] { display: inline-grid; place-items: center; width: 18px; height: 18px; flex: none; }
[data-ico] svg { width: 100%; height: 100%; }

/* the warm light behind everything */
body::before { content: ''; position: fixed; inset: -20% -10% auto auto; width: 70vw; height: 80vh; pointer-events: none;
  background: radial-gradient(closest-side, rgba(255, 178, 63, .07), transparent 70%); z-index: 0; }

.app { position: relative; z-index: 1; display: grid; grid-template-columns: var(--rail) 1fr; height: 100%; }

/* ---------------------------------------------------------------- rail */
.rail { display: flex; flex-direction: column; gap: 14px; padding: 22px 16px 18px; border-right: 1px solid var(--line); background: linear-gradient(180deg, #0c0c0f, #09090b); overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 11px; padding: 2px 8px 6px; }
.mark { width: 34px; height: 34px; border-radius: 11px; background: #15151a url(/mark.svg) center / 100% no-repeat; box-shadow: inset 0 0 0 1px var(--line2); flex: none; }
.word { font: 26px/1 var(--serif); letter-spacing: -.01em; }
.coin-ca { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 12px; background: var(--glow); border: 1px solid rgba(255, 178, 63, .28); text-align: left; }
.coin-ca .k { font-weight: 700; color: var(--amber); font-size: 13px; }
.coin-ca .v { flex: 1; font: 12px var(--mono); color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.coin-ca .ico { color: var(--amber); width: 15px; height: 15px; }
.nav { display: grid; gap: 2px; margin-top: 4px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--muted); font-weight: 560; transition: background .2s, color .2s; }
.nav a:hover { color: var(--text); background: var(--panel); }
.nav a.on { color: var(--text); background: var(--panel2); box-shadow: inset 2px 0 0 var(--amber); }
.nav a b { flex: 1; font-weight: inherit; }
.nav a em { font-style: normal; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.nav a.on [data-ico] { color: var(--amber); }
.rail-h { margin: 10px 12px 0; font-size: 12px; color: var(--faint); font-weight: 600; }
.wallets { display: grid; gap: 4px; }
.wal { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 12px; color: var(--soft); text-align: left; }
.wal:hover { background: var(--panel); }
.wal.on { background: var(--panel2); color: var(--text); }
.wal .dot { width: 22px; height: 22px; border-radius: 8px; flex: none; }
.wal .dot.add { display: grid; place-items: center; border: 1px dashed var(--line2); color: var(--muted); }
.wal .dot.add [data-ico] { width: 14px; height: 14px; }
.wal b { flex: 1; font-weight: 520; font-size: 14px; font-family: var(--mono); font-size: 12.5px; }
.wal .tag { font-size: 11px; color: var(--amber); font-family: var(--sans); }
.rail-foot { margin-top: auto; display: grid; gap: 14px; }
.mood { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; padding: 12px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); }
.mood-l { font-size: 12px; color: var(--muted); }
.mood-v { font-size: 12px; color: var(--amber); text-align: right; }
.mood-bar { grid-column: 1 / -1; height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.mood-bar i { display: block; height: 100%; width: 50%; background: linear-gradient(90deg, #8a5a1a, var(--amber)); border-radius: 4px; transition: width .8s; }
.fine { margin: 0 6px; font-size: 11.5px; line-height: 1.5; color: var(--faint); }

/* ---------------------------------------------------------------- top bar */
.main { display: flex; flex-direction: column; min-width: 0; height: 100%; }
.top { display: flex; align-items: center; gap: 16px; padding: 18px var(--gut) 14px; }
.top-l { min-width: 0; flex: 1; }
.crumb { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.title { margin: 2px 0 0; font: 30px/1.05 var(--serif); font-weight: 400; letter-spacing: -.01em; }
.title.swap { animation: titleIn .35s ease; }
@keyframes titleIn { from { opacity: 0; transform: translateY(5px); } }
.search { display: flex; align-items: center; gap: 9px; width: min(360px, 34vw); padding: 0 12px; height: 40px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); color: var(--muted); }
.search:focus-within { border-color: rgba(255, 178, 63, .45); }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--text); font-size: 14px; }
.search input::placeholder { color: var(--faint); }
.search kbd { font: 11px var(--mono); padding: 2px 6px; border-radius: 6px; border: 1px solid var(--line2); color: var(--faint); }
.top-r { display: flex; align-items: center; gap: 8px; }
.round { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); color: var(--soft); }
.round:hover { color: var(--text); border-color: var(--line2); }
.round.sm { width: 32px; height: 32px; border-radius: 10px; }
.round.sm [data-ico] { width: 15px; height: 15px; }
.pill-btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 15px; border-radius: 12px; background: var(--amber); color: var(--amber-ink); font-weight: 700; }
.pill-btn:hover { background: var(--amber2); }
.pill-btn [data-ico] { width: 16px; height: 16px; }
.ca { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border-radius: 12px; background: var(--panel); border: 1px solid rgba(255, 178, 63, .3); font: 12.5px var(--mono); color: var(--soft); }
.ca [data-ico] { width: 15px; height: 15px; color: var(--amber); }

/* ---------------------------------------------------------------- stage */
.stage { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr; gap: var(--gut); padding: 0 var(--gut) var(--gut); }
.stage.with-side { grid-template-columns: 1fr var(--side); }
.views { position: relative; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line2) transparent; }
.view { display: none; }
.view.on { display: block; animation: viewIn .32s ease; }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } }
.card { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.card-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-h h3 { margin: 0; font-size: 15px; font-weight: 650; }
.card-h p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.card-h .more { font-size: 12.5px; color: var(--amber); white-space: nowrap; }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--bg2); border: 1px solid var(--line); }
.seg button { padding: 5px 10px; border-radius: 7px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.seg button.on { background: var(--panel2); color: var(--text); box-shadow: 0 0 0 1px var(--line2); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; background: var(--bg2); border: 1px solid var(--line); font-size: 12px; color: var(--soft); font-variant-numeric: tabular-nums; white-space: nowrap; }
.chip.x { color: var(--amber); border-color: rgba(255, 178, 63, .35); }
.chip.x [data-ico] { width: 13px; height: 13px; }
.big { font: 46px/1 var(--serif); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.big small { font: 600 15px var(--sans); color: var(--muted); margin-left: 6px; letter-spacing: 0; }
.big.sm { font-size: 34px; }
.cap { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.eyebrow { font-size: 12.5px; color: var(--amber); font-weight: 650; }

/* ---------------------------------------------------------------- Desk */
.desk { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, .8fr); grid-template-rows: auto auto auto; gap: var(--gut); }
.hero { grid-row: span 2; min-height: 560px; display: flex; flex-direction: column; overflow: hidden;
  background: radial-gradient(120% 70% at 50% 100%, rgba(255, 178, 63, .1), transparent 60%), linear-gradient(180deg, #131317, #0f0f12); }
.hero::after { content: ''; position: absolute; left: 8%; right: 8%; bottom: 92px; height: 1px; background: linear-gradient(90deg, transparent, rgba(255, 178, 63, .35), transparent); }
.hero-txt { position: relative; z-index: 2; }
.hero .sub { margin: 8px 0 0; color: var(--muted); font-size: 13.5px; }
.spot { position: relative; flex: 1; min-height: 200px; }
.hero .spot { position: absolute; inset: 112px 0 76px 0; }
.chat-slot { position: relative; z-index: 3; margin-top: auto; }
.pnl { grid-column: 2 / 4; }
.pnl-v { font: 32px/1 var(--serif); font-variant-numeric: tabular-nums; margin: 2px 0 10px; }
.pnl-v small { font: 600 14px var(--sans); color: var(--muted); margin-left: 6px; }
.plot { position: relative; height: 150px; }
.plot svg { width: 100%; height: 100%; overflow: visible; }
.plot .ln { fill: none; stroke: var(--amber); stroke-width: 2; vector-effect: non-scaling-stroke; }
.plot .zero { stroke: var(--line2); stroke-dasharray: 3 4; vector-effect: non-scaling-stroke; }
.plot-dot { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 4px var(--glow); opacity: 0; pointer-events: none; }
.plot-tip { position: absolute; top: -6px; transform: translate(-50%, -100%); padding: 4px 8px; border-radius: 8px; background: var(--panel2); border: 1px solid var(--line2); font-size: 12px; white-space: nowrap; opacity: 0; pointer-events: none; font-variant-numeric: tabular-nums; }
.plot.hov .plot-dot, .plot.hov .plot-tip { opacity: 1; }
.rate { display: flex; flex-direction: column; }
.ring { position: relative; width: 150px; height: 150px; margin: 4px auto 0; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 9; }
.ring .trk { stroke: var(--line); }
.ring .arc { stroke: var(--amber); stroke-linecap: round; stroke-dasharray: 314.16; stroke-dashoffset: 314.16; transition: stroke-dashoffset 1s cubic-bezier(.3, .8, .3, 1); }
.ring-v { position: absolute; inset: 0; display: grid; place-items: center; font: 34px var(--serif); }
.rate .cap { text-align: center; }
.bags-mini { grid-column: 2 / 3; }
.tape { grid-column: 3 / 4; }
.tape-rows { display: grid; gap: 6px; max-height: 250px; overflow-y: auto; }
.tp { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 7px 4px; border-bottom: 1px solid var(--line); font-size: 13px; }
.tp:last-child { border-bottom: 0; }
.tp .side { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px; }
.tp .side.buy { background: var(--glow); color: var(--amber); }
.tp .side.sell { background: var(--bg2); color: var(--soft); }
.tp .when { color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; }
.tp.fresh { animation: fresh 1.6s ease; }
@keyframes fresh { 0% { background: var(--glow); } 100% { background: transparent; } }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); margin-top: 5px; }
.live-dot.ok { background: var(--up); box-shadow: 0 0 0 0 rgba(61, 220, 132, .5); animation: ping 2.4s infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(61, 220, 132, .45); } 70% { box-shadow: 0 0 0 9px rgba(61, 220, 132, 0); } 100% { box-shadow: 0 0 0 0 rgba(61, 220, 132, 0); } }

/* ---------------------------------------------------------------- rows (bags, trades) */
.rows { display: grid; }
.row { display: grid; align-items: center; gap: 12px; width: 100%; padding: 11px 6px; border-bottom: 1px solid var(--line); text-align: left; border-radius: 10px; }
.row:last-child { border-bottom: 0; }
button.row:hover { background: var(--panel2); }
.coin { display: flex; align-items: center; gap: 10px; min-width: 0; }
.coin .nm { min-width: 0; }
.coin b { display: block; font-weight: 650; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.coin span { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.num { text-align: right; font-variant-numeric: tabular-nums; font-size: 14px; white-space: nowrap; }
.num small { display: block; font-size: 11.5px; color: var(--muted); }
.num.up small, .num.down small { color: inherit; opacity: .75; }
.r { text-align: right; }
.thead { display: grid; gap: 12px; padding: 0 6px 8px; font-size: 12px; color: var(--faint); border-bottom: 1px solid var(--line); }
.thead.t, .row.t { grid-template-columns: minmax(0, 1fr) 64px 80px 120px 80px; }
.thead.b, .row.b { grid-template-columns: minmax(0, 1fr) 110px 120px 90px 80px; }
.row.m3 { grid-template-columns: minmax(0, 1fr) auto auto; }
.tag { justify-self: start; font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: 7px; }
.tag.win { background: var(--upbg); color: var(--up); } .tag.loss { background: var(--downbg); color: var(--down); } .tag.flat { background: var(--bg2); color: var(--muted); }
.cell { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.empty { padding: 36px 10px; text-align: center; color: var(--muted); font-size: 14px; }
.empty b { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }
.note { padding: 12px 6px 2px; font-size: 12px; color: var(--faint); text-align: center; }
.list { min-height: 100%; }
.tools { display: flex; align-items: center; gap: 8px; }

/* coin pictures: the coin's own image over a tile cut from its address */
.pic { position: relative; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; overflow: hidden; flex: none; background: var(--g, #1c1c22); color: rgba(255, 255, 255, .85); font-weight: 700; font-size: 14px; }
.pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .3s; }
.pic img.ok { opacity: 1; }
.pic.lg { width: 46px; height: 46px; border-radius: 14px; font-size: 18px; }
.pic.sm { width: 26px; height: 26px; border-radius: 8px; font-size: 11px; }

/* ---------------------------------------------------------------- Live */
.live { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--gut); }
.live-main { display: flex; flex-direction: column; gap: 12px; }
.coin-h { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.coin-t h2 { margin: 0; font: 26px/1.05 var(--serif); font-weight: 400; }
.coin-t p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.coin-tabs { display: flex; gap: 6px; flex: 1; justify-content: center; flex-wrap: wrap; }
.coin-tabs button { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px 4px 4px; border-radius: 10px; border: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.coin-tabs button.on { color: var(--text); border-color: rgba(255, 178, 63, .45); background: var(--glow); }
.coin-tools { display: flex; align-items: center; gap: 6px; }
.chart-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.chart-read { flex: 1; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chart { position: relative; height: min(52vh, 480px); min-height: 280px; border-radius: 14px; background: var(--bg2); border: 1px solid var(--line); overflow: hidden; touch-action: none; }
.chart canvas { width: 100%; height: 100%; display: block; cursor: crosshair; }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; text-align: center; color: var(--muted); font-size: 14px; }
.story { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; padding: 12px 14px; border-radius: 14px; background: var(--bg2); border: 1px solid var(--line); }
.st-l { font-size: 12px; color: var(--amber); font-weight: 700; padding-top: 2px; }
.story p { margin: 0; font-size: 14px; color: var(--soft); }
.st-links { grid-column: 2; display: flex; gap: 8px; flex-wrap: wrap; }
.st-links a { font-size: 12.5px; color: var(--amber); border-bottom: 1px solid rgba(255, 178, 63, .3); }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; margin: 14px 0 0; font-size: 13.5px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.pos .big.up, .pos .big.down { }

/* ---------------------------------------------------------------- Calendar */
.cal-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--gut); }
.cal-nav { display: flex; gap: 6px; }
.cal-nav button { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; border: 1px solid var(--line); color: var(--soft); }
.cal-nav button:disabled { opacity: .3; cursor: default; }
.cal-head, .wk { display: grid; grid-template-columns: 64px repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-head { font-size: 12px; color: var(--faint); padding-bottom: 8px; }
.cal-head div { text-align: center; }
.cal-head .now { color: var(--amber); }
.cal-body { display: grid; gap: 6px; }
.wk-l { display: flex; flex-direction: column; justify-content: center; font-size: 11.5px; color: var(--faint); }
.wk-l b { font-weight: 600; font-size: 12px; font-variant-numeric: tabular-nums; }
.day { display: flex; flex-direction: column; justify-content: space-between; gap: 6px; min-height: 76px; padding: 8px 9px; border-radius: 12px; background: var(--bg2); border: 1px solid var(--line); text-align: left; }
.day .dn { font-size: 12px; color: var(--muted); }
.day .dn .today { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 7px; background: var(--amber); color: var(--amber-ink); font-weight: 700; }
.day .dp { font-size: 14px; font-weight: 650; font-variant-numeric: tabular-nums; }
.day .dt { font-size: 11px; color: var(--muted); }
.day.none { opacity: .55; }
.day.fut { opacity: .25; }
.day.g { background: linear-gradient(180deg, rgba(61, 220, 132, .12), var(--bg2)); border-color: rgba(61, 220, 132, .25); }
.day.r { background: linear-gradient(180deg, rgba(255, 90, 95, .12), var(--bg2)); border-color: rgba(255, 90, 95, .25); }
.day.sel { box-shadow: 0 0 0 2px var(--amber); }
button.day:hover { border-color: var(--line2); }

/* ---------------------------------------------------------------- his column (all pages but the Desk) */
.side { display: none; flex-direction: column; padding: 14px; overflow: hidden; background: radial-gradient(130% 60% at 50% 100%, rgba(255, 178, 63, .09), transparent 60%), var(--panel); }
.stage.with-side .side { display: flex; }
.side .spot { flex: 1; min-height: 260px; }

/* him */
.buddy { position: fixed; left: 0; top: 0; width: 10px; height: 10px; z-index: 20; pointer-events: none; transition: opacity .25s; }
.buddy.away { opacity: 0; }
.buddy canvas, .buddy-still { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: 50% 100%; }
.bubble { position: absolute; left: 50%; bottom: 100%; transform: translate(-50%, 0); max-width: min(320px, 90vw); width: max-content; padding: 10px 14px; border-radius: 16px; background: #f3efe6; color: #17150f; font-size: 14px; line-height: 1.4; box-shadow: 0 10px 30px rgba(0, 0, 0, .45); pointer-events: auto; animation: pop .28s cubic-bezier(.3, 1.4, .5, 1); }
.bubble::after { content: ''; position: absolute; left: 50%; top: 100%; width: 14px; height: 14px; background: inherit; transform: translate(-50%, -8px) rotate(45deg); border-radius: 3px; }
.bubble.thinking { color: #6b665c; }
@keyframes pop { from { opacity: 0; transform: translate(-50%, 8px) scale(.94); } }

/* the chat bar */
.chat { display: flex; align-items: center; gap: 6px; width: 100%; height: 50px; padding: 0 6px 0 6px; border-radius: 16px; background: rgba(9, 9, 11, .82); border: 1px solid var(--line2); backdrop-filter: blur(10px); box-shadow: 0 8px 30px rgba(0, 0, 0, .35); }
.chat:focus-within { border-color: rgba(255, 178, 63, .5); }
.chat input { flex: 1; min-width: 0; height: 100%; background: none; border: 0; outline: 0; padding: 0 6px; font-size: 14.5px; }
.chat input::placeholder { color: var(--faint); }
.chat .mic, .chat .ico { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; color: var(--muted); }
.chat .mic:hover, .chat .ico:hover { color: var(--text); background: var(--panel2); }
.chat .mic.on { color: var(--amber-ink); background: var(--amber); }
.chat .ico.off { color: var(--faint); }
.chat .send { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: var(--amber); color: var(--amber-ink); }
.chat .send:disabled { background: var(--panel2); color: var(--faint); cursor: default; }
.chat.busy .send { animation: busy 1s infinite alternate; }
@keyframes busy { to { opacity: .5; } }
.said { position: fixed; z-index: 30; transform: translateX(-50%); max-width: min(420px, 90vw); padding: 8px 12px; border-radius: 12px; background: var(--amber); color: var(--amber-ink); font-size: 13.5px; font-weight: 560; pointer-events: none; animation: pop .25s ease; }
.said.go { opacity: 0; transform: translate(-50%, -10px); transition: .4s; }

/* menus and toasts */
.layer { position: fixed; inset: 0; pointer-events: none; z-index: 40; }
.menu { position: fixed; min-width: 260px; max-width: min(360px, 92vw); padding: 8px; border-radius: 16px; background: var(--panel2); border: 1px solid var(--line2); box-shadow: 0 20px 50px rgba(0, 0, 0, .55); pointer-events: auto; animation: menuIn .16s ease; }
.menu.out { opacity: 0; transition: opacity .14s; }
@keyframes menuIn { from { opacity: 0; transform: translateY(-4px); } }
.m-label { padding: 6px 10px 4px; font-size: 12px; color: var(--faint); font-weight: 600; }
.m-i { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 10px; text-align: left; font-size: 14px; color: var(--soft); }
.m-i:hover, .m-i.hl { background: var(--panel); color: var(--text); }
.m-i b { flex: 1; font-weight: 520; }
.m-i em { font-style: normal; font-size: 12.5px; color: var(--muted); }
.m-i .x { color: var(--faint); }
.m-i .x:hover { color: var(--down); }
.m-sep { height: 1px; margin: 6px 4px; background: var(--line2); }
.m-note { padding: 6px 10px 8px; font-size: 12.5px; color: var(--muted); }
.m-note.bad { color: var(--down); }
.m-add { display: flex; gap: 6px; padding: 4px; }
.m-add input { flex: 1; min-width: 0; height: 36px; padding: 0 10px; border-radius: 10px; background: var(--bg2); border: 1px solid var(--line2); outline: 0; font: 12.5px var(--mono); }
.m-add input.bad { border-color: var(--down); }
.m-add button { height: 36px; padding: 0 12px; border-radius: 10px; background: var(--amber); color: var(--amber-ink); font-weight: 700; }
.sw { position: relative; width: 34px; height: 20px; border-radius: 20px; background: var(--line2); flex: none; transition: background .2s; }
.sw::after { content: ''; position: absolute; left: 3px; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); transition: transform .2s, background .2s; }
.sw.on { background: rgba(255, 178, 63, .35); } .sw.on::after { transform: translateX(14px); background: var(--amber); }
.convo { width: min(420px, 92vw); }
.convo-b { max-height: 46vh; overflow-y: auto; display: grid; gap: 6px; padding: 4px; }
.msg { max-width: 85%; padding: 8px 11px; border-radius: 12px; font-size: 13.5px; }
.msg.u { justify-self: end; background: var(--amber); color: var(--amber-ink); }
.msg.y { justify-self: start; background: var(--panel); }
.msg.n { justify-self: start; background: transparent; border: 1px dashed var(--line2); color: var(--soft); }
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 50; display: grid; gap: 8px; }
.toast { display: flex; align-items: center; gap: 10px; min-width: 240px; max-width: 360px; padding: 11px 14px; border-radius: 14px; background: var(--panel2); border: 1px solid var(--line2); box-shadow: 0 16px 40px rgba(0, 0, 0, .5); animation: pop .25s ease; }
.toast.bad { border-color: rgba(255, 90, 95, .45); }
.toast.out { opacity: 0; transform: translateY(6px); transition: .26s; }
.toast b { display: block; font-size: 14px; }
.toast span { display: block; font-size: 12.5px; color: var(--muted); word-break: break-all; }
.toast .ti { color: var(--amber); }

.tabs { display: none; }

/* ---------------------------------------------------------------- widths */
@media (max-width: 1320px) {
  .desk { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
  .pnl { grid-column: 2; }
  .rate { grid-column: 2; }
  .hero { grid-row: span 2; }
  .bags-mini { grid-column: 1; } .tape { grid-column: 2; }
  :root { --side: 300px; }
}
@media (max-width: 1080px) {
  :root { --rail: 76px; }
  .word, .rail-h, .wal b, .wal .tag, .nav a b, .nav a em, .rail-foot, .coin-ca { display: none; }
  .rail { align-items: center; padding: 18px 10px; }
  .nav a { justify-content: center; padding: 12px; }
  .wal { justify-content: center; padding: 8px; }
  .stage.with-side { grid-template-columns: 1fr 270px; }
  .cal-wrap { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  body { overflow: auto; }
  :root { --gut: 12px; }
  .app { display: block; height: auto; padding-bottom: 76px; }
  .rail { display: none; }
  .main { height: auto; }
  .top { flex-wrap: wrap; padding: 14px var(--gut) 10px; }
  .top-l { flex: 1 1 0; }
  .search { order: 3; width: 100%; }
  .title { font-size: 26px; }
  .pill-btn { padding: 0 12px; } .pill-btn [data-ico] { display: none; }
  .stage, .stage.with-side { display: block; padding-bottom: 0; }
  .views { overflow: visible; }
  .desk { grid-template-columns: 1fr; }
  .hero, .pnl, .rate, .bags-mini, .tape { grid-column: auto; grid-row: auto; }
  .hero { min-height: 540px; }
  .side, .stage.with-side .side { display: flex; position: sticky; top: 0; height: 270px; margin-bottom: var(--gut); z-index: 4; }
  .card { padding: 14px; }
  .big { font-size: 38px; }
  .thead.t, .row.t { grid-template-columns: minmax(0, 1fr) 54px 104px; }
  .thead.b, .row.b { grid-template-columns: minmax(0, 1fr) 84px 96px; }
  .thead .m, .row .m { display: none; }
  .cal-head, .wk { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
  .wk-l, .cal-head .wl { display: none; }
  .day { min-height: 58px; padding: 6px; } .day .dt { display: none; } .day .dp { font-size: 11.5px; }
  .coin-tabs { order: 4; flex-basis: 100%; justify-content: flex-start; }
  .tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; display: grid; grid-template-columns: repeat(5, 1fr); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: rgba(9, 9, 11, .94); border-top: 1px solid var(--line); backdrop-filter: blur(10px); }
  .tabs a { display: grid; justify-items: center; gap: 3px; padding: 6px 0; font-size: 11px; color: var(--muted); }
  .tabs a.on { color: var(--amber); }
  .toasts { left: 12px; right: 12px; bottom: 86px; }
  .toast { min-width: 0; max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
