@font-face {
  font-family: "Golos Text";
  src: url("./assets/golos.ttf") format("truetype");
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #edf1ed;
  --surface: #fff;
  --surface-quiet: #f5f7f3;
  --ink: #1a2a23;
  --soft: #465c51;
  --muted: #52665c;
  --line: #dbe5dd;
  --line-deep: #cbd9ce;
  --accent: #21694e;
  --accent-hover: #194f3c;
  --accent-soft: #dfece2;
  --gain: #216d52;
  --loss: #a44c41;
  --loss-soft: #f6e8e4;
  --radius: 12px;
  --focus: #447d64;
  font: 400 15px/1.45 "Golos Text", Arial, sans-serif;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums lining-nums;
}

* { box-sizing: border-box; }
html { background: var(--bg); scroll-padding-bottom: 90px; }
body { margin: 0; color: var(--ink); min-width: 320px; }
button, select, input { font: inherit; color: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: default; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
main:focus { outline: none; }
:where(h1,h2,h3,p,dl,dd) { margin: 0; }
strong, b { font-weight: 650; }
[hidden] { display: none !important; }
.icon { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.icon-library, .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; clip-path: inset(50%); overflow: hidden; white-space: nowrap; border: 0; }
.skip { position: fixed; z-index: 20; left: 12px; top: 8px; padding: 10px 14px; background: var(--surface); }
.skip:not(:focus) { clip-path: inset(50%); }
.gain { color: var(--gain); }
.loss { color: var(--loss); }
.neutral { color: var(--ink); }

.topbar { background: var(--surface-quiet); border-bottom: 1px solid var(--line); }
.topbar-inner { width: min(100% - 80px, 1312px); height: 68px; margin: auto; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 22px; }
.brand { display: inline-flex; gap: 9px; width: max-content; align-items: center; color: var(--ink); font-size: 24px; font-weight: 790; line-height: 1; }
.brand img { flex: 0 0 auto; }
.desktop-nav, .mobile-nav { display: flex; align-items: center; }
.desktop-nav { gap: 6px; }
.desktop-nav a { min-height: 42px; display: inline-flex; gap: 7px; align-items: center; padding: 0 12px; border-radius: 7px; color: var(--soft); font-weight: 520; font-size: 14px; }
.desktop-nav a:hover, .desktop-nav a[aria-current] { color: var(--accent-hover); background: var(--accent-soft); }
.desktop-nav .icon { width: 17px; height: 17px; }
.mode-label { justify-self: end; display: inline-flex; align-items: center; gap: 7px; color: var(--soft); font-size: 12px; font-weight: 580; white-space: nowrap; }
.status-dot { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: #4a8d6a; }
.status-dot.is-idle { background: #a6a69a; }
.mobile-nav { display: none; }

.page { margin: 0 auto; width: min(100% - 80px, 1312px); padding: 32px 0 55px; }
.page-head { min-height: 52px; display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; }
h1 { font-size: 38px; line-height: 1.12; font-weight: 720; }
h2 { font-size: 22px; line-height: 1.2; font-weight: 670; }
h3 { font-size: 18px; font-weight: 660; }
.quiet-label, .subline { color: var(--muted); font-size: 13px; }
.subline { margin: 14px 0 16px; }
.section-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.section-head h2 { font-size: 20px; }
.section-head p { color: var(--muted); margin-top: 5px; font-size: 13px; }
.section-head .button { flex: 0 0 auto; }
.button { appearance: none; border: 1px solid transparent; background: transparent; padding: 8px 13px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; font-size: 13px; font-weight: 630; line-height: 1.16; white-space: nowrap; transition: background-color .15s, border-color .15s; }
.button:hover { background-color: var(--accent-soft); }
.button-primary { color: #fff; background: var(--accent); border-color: var(--accent); }
.button-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.button-sell { color: white; background: #974d43; border-color: #974d43; }
.button-sell:hover { background: #803b32; border-color: #803b32; }
.button-stroke { color: var(--soft); border-color: var(--line-deep); background: var(--surface); }
.button-link { color: var(--accent); padding-inline: 8px; }
.button-quiet { color: var(--soft); }
.button[aria-pressed=true]:not(:disabled) { background: var(--accent-soft); color: var(--accent-hover); }
.button:disabled { color: var(--muted); background: var(--surface-quiet); border-color: var(--line); }
.square { min-width: 40px; padding: 8px; }
.segmented { display: inline-flex; background: var(--surface-quiet); border-radius: 8px; padding: 3px; gap: 2px; align-items: center; align-self: flex-start; }
.segmented .button { min-height: 34px; padding-inline: 11px; color: var(--soft); }
.segmented .button:hover { background: var(--accent-soft); }
.segmented .button[aria-pressed=true] { border-color: var(--line); color: var(--accent-hover); background: var(--surface); box-shadow: 0 1px 2px #1a2a2310; }
.select { position: relative; display: flex; flex-direction: column; min-width: 0; gap: 4px; }
.select .field-name, .input-label, .metric-label { color: var(--muted); font-size: 13px; font-weight: 510; }
.select select, input:not([type=checkbox]) { min-height: 42px; min-width: 0; border: 1px solid var(--line-deep); border-radius: 7px; background: var(--surface); padding: 9px 11px; }
.select select { appearance: none; width: 100%; padding-right: 35px; }
.select > .icon { position: absolute; bottom: 12px; right: 11px; pointer-events: none; }
.page-head .select { min-width: 209px; flex-direction: row; align-items: center; gap: 9px; }
.page-head .select .field-name { white-space: nowrap; }
.search { position: relative; display: flex; align-items: center; }
.search .icon { position: absolute; margin-left: 11px; color: var(--muted); pointer-events: none; }
.search input:not([type=checkbox]) { width: 100%; padding-left: 36px; }
input::placeholder { color: var(--muted); }
.status-dot + span { margin-left: 1px; }

.home-board { display: grid; grid-template-columns: minmax(0,1.04fr) minmax(0,1fr); grid-template-areas: "scene capital" "team activity"; gap: 22px 16px; align-items: start; }
.bot-scene { grid-area: scene; align-self: stretch; }
.capital-panel { grid-area: capital; align-self: stretch; }
.home-team { grid-area: team; }
.home-feed { grid-area: activity; }
.bot-scene {
  display: grid; grid-template-rows: auto 1fr auto;
  min-width: 0; min-height: 355px; padding: 22px 24px 18px; border-radius: 14px; color: #f2f7f1;
  background: #203d31; background-image: linear-gradient(119deg, #193229 4%, #203e33 60%, #28473a 100%);
}
.scene-top, .scene-bottom { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 13px; }
.scene-status, .scene-market { font-size: 13px; font-weight: 630; }
.scene-status { display: flex; gap: 8px; align-items: center; }
.bot-scene .status-dot { background: #9acda6; }
.bot-scene .status-dot.is-idle { background: #afa890; }
.scene-market { display: inline-flex; gap: 3px; padding: 5px 9px; border: 1px solid #507364; border-radius: 5px; }
.scene-market span { color: #bfd2c5; }
.scene-body { display: grid; grid-template-columns: minmax(0,1.05fr) minmax(0,1fr); align-items: center; min-height: 202px; position: relative; }
.scene-copy { z-index: 1; }
.scene-copy h2 { font-size: 61px; font-weight: 740; line-height: 1.02; margin: 6px 0 9px; }
.scene-copy h2 a:hover { color: #cbebd4; }
.scene-strategy { color: #e1ece1; font-size: 16px; font-weight: 580; }
.scene-action { color: #b7cfc0; font-size: 13px; margin-top: 15px; }
.scene-art { position: absolute; inset: -4px 4px -3px 51%; display: grid; place-items: center; pointer-events: none; overflow: hidden; }
.scene-art::before {
  content: ""; position: absolute; width: 85%; height: 78%; top: 10%; left: 7%;
  background: radial-gradient(ellipse at center, color-mix(in srgb, var(--bot-color) 20%, transparent), transparent 68%);
}
.scene-art::after {
  content: ""; position: absolute; width: 78%; aspect-ratio: 1.62; border: 1px solid #a3c4b135;
  border-radius: 50%; bottom: 18%; transform: rotate(-12deg);
}
.bot-image { object-fit: contain; display: block; position: relative; }
.scene-art .bot-image { width: min(100%, 286px); height: auto; transform: scale(1.05); z-index: 1; }
.scene-bottom { border-top: 1px solid #a3c4b141; padding-top: 15px; align-items: flex-end; }
.metrics { display: grid; gap: 12px 18px; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
.metric { min-width: 0; display: flex; flex-direction: column; justify-content: space-between; gap: 4px; }
.metric span { font-size: 12px; color: var(--muted); }
.metric strong { font-size: 17px; font-weight: 680; white-space: nowrap; }
.scene-bottom .metrics { grid-auto-columns: auto; column-gap: 22px; }
.scene-bottom .metric span { color: #bfd4c6; }
.scene-bottom .metric strong { font-size: 18px; color: #f4f8f2; }
.scene-bottom .metric .gain { color: #c7e5bf; }
.scene-bottom .metric .loss { color: #ffc0ad; }
.scene-controls { display: flex; gap: 6px; align-items: center; }
.scene-controls .button { color: #ecf5ed; border-color: #759082; }
.scene-controls .button:hover { background: #3a5b4c; }
.scene-controls .scene-detail { width: 40px; padding: 8px; background: #d8ead8; border-color: #d8ead8; color: #214635; }
.scene-controls .scene-detail:hover { background: #edf6ec; }
.bot-scene :focus-visible { outline-color: #e1fae5; }

.capital-panel { min-width: 0; display: grid; grid-template-rows: auto auto minmax(192px,1fr) auto; background: var(--surface); border-radius: 14px; padding: 18px 20px; border: 1px solid var(--line); }
.capital-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.capital-top .segmented { margin-top: 1px; }
.capital-number { display: block; font-size: 39px; line-height: 1.16; margin: 2px 0 4px; font-weight: 710; white-space: nowrap; }
.capital-delta { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 8px; font-size: 13px; color: var(--muted); }
.capital-delta strong span { margin-left: 3px; }
.chart-read { display: flex; align-items: center; min-height: 21px; margin-top: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font-size: 11px; }
.chart-read.crosshair-read { color: var(--accent-hover); font-weight: 610; }
.chart-box { position: relative; min-width: 0; width: 100%; }
.capital-chart { min-height: 192px; }
.capital-metrics { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 7px; }
.capital-metrics .metric strong { font-size: 16px; }
.home-team, .home-feed { min-width: 0; }
.live-status { display: inline-flex; gap: 6px; align-items: center; }
.live-status .status-dot { width: 6px; height: 6px; }
.team-row { width: 100%; background: var(--surface-quiet); border: 1px solid transparent; border-bottom-color: var(--line); text-align: left; display: grid; grid-template-columns: 45px minmax(0,1fr) auto 16px; gap: 11px; align-items: center; min-height: 61px; padding: 5px 12px; }
.team-row:first-child { border-radius: 9px 9px 0 0; }
.team-row:last-child { border-radius: 0 0 9px 9px; border-bottom-color: transparent; }
.team-row:only-child { border-radius: 9px; }
.team-row:hover, .team-row[aria-pressed=true] { background: var(--accent-soft); border-color: var(--line-deep); }
.bot-thumb { width: 45px; height: 45px; background: color-mix(in srgb, var(--bot-color) 36%, var(--surface-quiet)); border-radius: 7px; display: grid; place-items: center; flex: 0 0 auto; overflow: hidden; }
.bot-thumb .bot-image { width: 122%; height: auto; max-width: none; }
.team-name, .fill-name, .fill-amount { display: flex; flex-direction: column; min-width: 0; }
.team-name small, .fill-name small, .fill-amount small { color: var(--muted); font-size: 12px; }
.team-value { white-space: nowrap; font-size: 14px; }
.team-row > .icon, .fill-row > .icon { width: 16px; color: var(--muted); }
.feed { background: var(--surface-quiet); border-radius: 9px; }
.fill-row { display: grid; grid-template-columns: 34px minmax(0,1fr) max-content 16px; align-items: center; text-align: left; gap: 10px; width: 100%; padding: 8px 12px; min-height: 57px; background: transparent; border: 0; border-bottom: 1px solid var(--line); }
.fill-row:first-child { border-radius: 9px 9px 0 0; }
.fill-row:last-child { border-bottom-color: transparent; border-radius: 0 0 9px 9px; }
.fill-row:hover { background: var(--accent-soft); }
.fill-name strong, .fill-amount strong { font-size: 14px; }
.fill-name small > span { margin-inline: 1px; }
.fill-amount { text-align: right; white-space: nowrap; }
.fill-icon { width: 34px; height: 34px; display: grid; place-items: center; background: var(--accent-soft); color: var(--gain); border-radius: 7px; }
.fill-sell .fill-icon { background: var(--loss-soft); color: var(--loss); }
.empty { padding: 19px 14px; color: var(--muted); font-size: 14px; }
.empty p { margin-bottom: 10px; }

.market-grid { display: grid; grid-template-columns: 218px minmax(0,1fr) 275px; gap: 16px; align-items: start; }
.watchlist, .market-chart-panel, .trade-side, .detail-chart-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; }
.watch-head { display: grid; gap: 10px; padding: 14px 13px 10px; }
.watch-head h2 { font-size: 17px; }
.watch-rows { max-height: 425px; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; padding: 0 7px 7px; }
.instrument-row { min-height: 51px; padding: 5px 6px; display: grid; grid-template-columns: 31px minmax(0,1fr) auto; gap: 6px; align-items: center; border-bottom: 1px solid var(--line); }
.instrument-row:hover, .instrument-row[aria-current=true] { background: var(--accent-soft); color: var(--accent-hover); border-radius: 6px; }
.instrument-row > strong { white-space: nowrap; font-size: 11px; }
.asset-badge { height: 31px; width: 31px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 7px; color: var(--ink); background: color-mix(in srgb, var(--asset-color) 62%, var(--surface-quiet)); font-size: 15px; font-weight: 730; }
.instrument-name { display: flex; flex-direction: column; overflow: hidden; }
.instrument-name strong { font-size: 13px; }
.instrument-name small { font-size: 10px; color: var(--muted); text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }
.market-chart-panel { padding: 16px 16px 8px; }
.market-quote { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 13px; }
.quote-name { display: flex; align-items: center; gap: 9px; }
.quote-name .asset-badge { width: 42px; height: 42px; font-size: 19px; }
.quote-name h2 { font-size: 23px; }
.quote-name p { color: var(--muted); font-size: 12px; margin-top: 1px; }
.quote-price { display: flex; align-items: flex-end; flex-direction: column; min-width: 0; white-space: nowrap; }
.quote-price strong { font-size: 27px; font-weight: 710; }
.quote-price span { font-size: 12px; }
.chart-toolbar { display: flex; gap: 6px; justify-content: space-between; align-items: center; }
.chart-toolbar .button { min-height: 37px; }
.chart-toolbar .segmented .button { min-height: 32px; }
.market-chart { height: 332px; }
.market-read { margin-top: 4px; }
.market-feed { margin-top: 21px; }
.mobile-assets, .mobile-trade { display: none; }
.trade-side { position: sticky; top: 16px; }
.order-form { padding: 16px; display: grid; gap: 10px; }
.order-form h2 { font-size: 18px; margin-bottom: 3px; }
.order-form .segmented { width: 100%; }
.order-form .segmented .button { flex: 1; }
.order-balance { color: var(--muted); font-size: 13px; }
.quantity-input { position: relative; display: flex; align-items: center; }
.quantity-input .button { position: absolute; right: 4px; min-height: 34px; }
.quantity-input input:not([type=checkbox]) { width: 100%; padding-right: 64px; }
.order-preview, .results-list { display: grid; }
.order-preview div, .results-list div { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.order-preview dt, .results-list dt { color: var(--muted); font-size: 13px; }
.order-preview dd, .results-list dd { font-weight: 650; white-space: nowrap; text-align: right; }
.form-error { color: var(--loss); font-size: 13px; min-height: 16px; }
.form-error:empty { display: none; }
.submit-order { width: 100%; min-height: 44px; margin-top: 2px; }

.route-tabs { display: flex; gap: 16px; border-bottom: 1px solid var(--line-deep); margin-bottom: 17px; }
.route-tabs a { margin-bottom: -1px; padding: 8px 3px 12px; font-weight: 630; color: var(--muted); border-bottom: 2px solid transparent; }
.route-tabs a[aria-current=true] { color: var(--accent-hover); border-color: var(--accent); }
.route-tabs a span { padding: 1px 5px; margin-left: 2px; color: var(--accent-hover); background: var(--accent-soft); border-radius: 4px; font-size: 12px; }
.owned-grid, .catalog-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.owned-bot { padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; }
.owned-head { display: grid; grid-template-columns: 55px minmax(0,1fr) auto; align-items: center; gap: 9px; }
.owned-head .bot-thumb { width: 55px; height: 55px; }
.owned-head h2 { font-size: 19px; }
.owned-head h2 a:hover, .catalog-name h2 a:hover { color: var(--accent); }
.owned-head p, .catalog-body p { font-size: 13px; color: var(--muted); margin-top: 3px; }
.owned-status { display: inline-flex; gap: 6px; align-items: center; color: var(--soft); font-size: 12px; font-weight: 600; }
.owned-action { font-size: 13px; color: var(--muted); margin: 13px 0 11px; }
.owned-bot .metrics { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 11px 0; }
.owned-controls { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; }
.catalog-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
.catalog-card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.catalog-portrait { position: relative; display: grid; place-items: center; height: 138px; overflow: hidden; background: color-mix(in srgb, var(--bot-color) 42%, var(--surface-quiet)); }
.catalog-portrait .bot-image { width: 185px; height: auto; position: absolute; }
.catalog-symbol { position: absolute; top: 10px; right: 11px; font-weight: 650; font-size: 12px; }
.catalog-body { padding: 13px; }
.catalog-name { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 2px 8px; }
.catalog-name h2 { font-size: 18px; }
.catalog-name strong { font-size: 14px; }
.catalog-actions { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 14px; }

.back-link { display: inline-flex; gap: 6px; align-items: center; color: var(--accent-hover); font-weight: 580; min-height: 35px; margin-bottom: 9px; }
.detail-head { display: grid; grid-template-columns: 197px minmax(0,1fr); align-items: center; gap: 24px; margin-bottom: 17px; }
.detail-portrait { background: color-mix(in srgb, var(--bot-color) 41%, var(--accent-soft)); border-radius: 10px; height: 160px; display: grid; place-items: center; overflow: hidden; }
.detail-portrait .bot-image { width: 210px; height: auto; margin-block: -25px; }
.detail-title h1 { margin: 4px 0 5px; }
.detail-title > p:not(.owned-status) { color: var(--muted); font-size: 14px; }
.detail-buttons { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 11px; }
.detail-metrics, .detail-financial { padding: 14px 16px; margin-bottom: 16px; background: var(--surface-quiet); border-radius: 9px; }
.detail-chart-panel { padding: 14px 16px 6px; margin-bottom: 16px; }
.bot-chart { height: 245px; }
.bot-position, .bot-history { margin-top: 18px; }

.portfolio-hero { padding: 18px 21px; background: var(--surface-quiet); border: 1px solid var(--line); border-radius: var(--radius); }
.portfolio-primary { display: flex; flex-wrap: wrap; gap: 6px 28px; align-items: flex-end; margin-bottom: 12px; }
.portfolio-delta { display: block; margin-top: 4px; font-size: 23px; line-height: 1.3; }
.portfolio-hero .metrics { border-top: 1px solid var(--line); padding-top: 13px; }
.portfolio-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 17px; margin-top: 17px; }
.allocation, .portfolio-results { background: var(--surface-quiet); border-radius: var(--radius); padding: 16px; }
.allocation-bar { display: flex; width: 100%; height: 14px; border-radius: 4px; overflow: hidden; margin-bottom: 11px; }
.allocation-bar span { height: 100%; }
.allocation-legend > div { display: grid; grid-template-columns: 11px minmax(36px,1fr) max-content max-content; align-items: baseline; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.allocation-legend small { color: var(--muted); }
.swatch { width: 8px; height: 8px; border-radius: 2px; }
.open-positions { margin-top: 25px; }
.position-list { background: var(--surface-quiet); border-radius: 9px; }
.position-row { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) auto; align-items: center; gap: 11px; border-bottom: 1px solid var(--line); padding: 9px 12px; }
.position-row:last-child { border-bottom: 0; }
.position-identity { display: flex; align-items: center; gap: 8px; }
.position-identity > span:last-child, .position-metric { display: flex; flex-direction: column; min-width: 0; }
.position-identity small, .position-metric small { color: var(--muted); font-size: 12px; }
.position-metric :is(strong,span) { white-space: nowrap; }

.history-filters { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin-bottom: 14px; }
.history-layout { max-width: 1030px; }
.result-count { color: var(--muted); font-size: 13px; margin: 0 0 12px; }
.result-count strong { margin-left: 5px; color: var(--ink); }
.history-day { margin-bottom: 16px; }
.history-day h2 { font-size: 14px; color: var(--soft); margin: 0 0 6px 2px; }
.more-history { margin-bottom: 15px; }

.profile-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 16px; }
.profile-settings, .referral-panel { min-width: 0; padding: 19px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.profile-form { display: grid; gap: 5px; }
.profile-name { display: flex; align-items: stretch; gap: 7px; }
.profile-name input { flex: 1; }
.settings-list { margin: 12px 0; }
.settings-list label { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.settings-list small { display: block; color: var(--muted); margin-top: 2px; }
.switch { appearance: none; flex: 0 0 auto; width: 42px; height: 25px; border-radius: 14px; border: 1px solid var(--line-deep); background: var(--line); padding: 2px; cursor: pointer; }
.switch::before { content: ""; display: block; width: 19px; height: 19px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px #152b2440; transition: transform .16s; }
.switch:checked { background: var(--accent); border-color: var(--accent); }
.switch:checked::before { transform: translateX(17px); }
.profile-totals .metrics { grid-auto-columns: minmax(0,1fr); }
.profile-totals .metric strong { font-size: 14px; white-space: normal; }
.profile-totals .metric strong span { color: inherit; font-size: inherit; }
.referral-amount { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 11px; margin-bottom: 15px; padding: 11px 13px; background: var(--accent-soft); border-radius: 7px; color: var(--gain); }
.referral-amount .icon { width: 25px; height: 25px; }
.referral-amount strong { font-size: 32px; }
.referral-amount span { max-width: 225px; font-size: 13px; }
.referral-input { margin-top: 4px; }
.referral-foot { display: flex; align-items: center; gap: 6px; justify-content: space-between; margin-top: 7px; }
.referral-foot > span { color: var(--muted); font-size: 13px; }

.toast { position: fixed; z-index: 19; right: 23px; bottom: 23px; max-width: calc(100vw - 46px); pointer-events: none; opacity: 0; transform: translateY(3px); transition: opacity .16s, transform .16s; padding: 11px 15px; border-radius: 8px; background: #203d31; color: #fff; font-size: 14px; }
.toast.is-visible { opacity: 1; transform: translateY(0); }
dialog { width: min(100% - 28px, 535px); max-height: min(88dvh, 700px); padding: 0; border: 1px solid var(--line); border-radius: 13px; color: var(--ink); box-shadow: 0 16px 52px #16312635; overflow: auto; }
dialog::backdrop { background: #162d2673; }
dialog[open] { animation: dialog-in .18s ease-out; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
#dialog-content { padding: 17px 18px 19px; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.dialog-head h2 { font-size: 21px; }
.dialog-note { font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 15px; }
#dialog .order-form, #dialog .watch-head { padding: 0; }
#dialog .watch-rows { padding-inline: 0; margin-top: 7px; max-height: min(383px, 47dvh); }
#dialog .instrument-row > strong { font-size: 13px; }
.compare-selects, .compare-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 10px; }
.compare-grid { margin-top: 12px; }
.compare-col { padding: 9px; border: 1px solid var(--line); border-radius: 8px; }
.compare-col h3 { margin-top: 3px; }
.compare-col .results-list { font-size: 13px; margin-bottom: 10px; }
.compare-col dt { font-size: 12px; }
.compare-col .results-list div { gap: 6px; }

@media (max-width: 1130px) {
  .topbar-inner, .page { width: calc(100% - 48px); }
  .desktop-nav { gap: 1px; }
  .desktop-nav a { padding-inline: 9px; }
  .market-grid { grid-template-columns: 176px minmax(0,1fr) 226px; gap: 12px; }
  .watch-head { padding-inline: 9px; }
  .watch-head .segmented .button { padding-inline: 7px; }
  .watch-rows { padding-inline: 4px; }
  .instrument-row { grid-template-columns: 23px minmax(0,1fr) auto; gap: 4px; padding-inline: 5px; }
  .instrument-row .asset-badge { width: 23px; height: 23px; font-size: 13px; }
  .order-form { padding: 13px; }
  .scene-copy h2 { font-size: 52px; }
}
@media (max-width: 950px) {
  .topbar-inner { gap: 11px; }
  .desktop-nav a { padding-inline: 7px; font-size: 13px; }
  .desktop-nav .icon { display: none; }
  .bot-scene { padding-inline: 17px; }
  .scene-bottom .metrics { column-gap: 11px; }
  .scene-copy h2 { font-size: 47px; }
  .scene-controls .button { gap: 4px; padding-inline: 7px; }
  .capital-panel { padding-inline: 14px; }
  .capital-top .segmented .button { padding-inline: 8px; }
  .capital-number { font-size: 34px; }
  .owned-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .catalog-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .market-grid { grid-template-columns: minmax(0,1fr) 232px; }
  .market-grid .watchlist { display: none; }
  .mobile-assets { display: inline-flex; }
}

@media (max-width: 760px) {
  html { scroll-padding-bottom: calc(83px + env(safe-area-inset-bottom, 0px)); }
  .topbar-inner, .page { width: calc(100% - 30px); }
  .topbar-inner { height: 56px; grid-template-columns: 1fr auto; }
  .brand { font-size: 21px; gap: 7px; }
  .brand img { width: 28px; height: 28px; }
  .mode-label { font-size: 11px; gap: 5px; }
  .mode-label .status-dot { width: 6px; height: 6px; }
  .desktop-nav { display: none; }
  .mobile-nav { position: fixed; z-index: 15; width: 100%; inset: auto 0 0; display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); background: var(--surface-quiet); border-top: 1px solid var(--line-deep); padding: 4px 3px calc(5px + env(safe-area-inset-bottom, 0px)); }
  .mobile-nav a { display: flex; flex-direction: column; justify-content: center; align-items: center; min-height: 49px; padding: 4px 1px; color: var(--soft); font-size: 10px; gap: 4px; border-radius: 6px; white-space: nowrap; }
  .mobile-nav a[aria-current] { background: var(--accent-soft); color: var(--accent-hover); font-weight: 700; }
  .mobile-nav .icon { width: 20px; height: 20px; }
  .page { padding: 16px 0 calc(81px + env(safe-area-inset-bottom, 0px)); }
  .page-head { min-height: 43px; margin-bottom: 13px; gap: 9px; }
  h1 { font-size: 29px; }
  h2 { font-size: 19px; }
  .page-head .select { width: min(48%, 192px); min-width: 0; }
  .page-head .select .field-name { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }
  .page-head .select select { font-size: 13px; }
  .button { min-height: 42px; }
  .section-head { margin-bottom: 9px; }
  .section-head h2 { font-size: 18px; }
  .section-head p { font-size: 12px; margin-top: 4px; }
  .bot-scene { min-height: 239px; padding: 12px 14px 13px; border-radius: 11px; }
  .scene-body { min-height: 136px; grid-template-columns: minmax(0,1.25fr) minmax(0,1fr); }
  .scene-copy h2 { font-size: 44px; margin: 3px 0 5px; }
  .scene-strategy { font-size: 13px; }
  .scene-action { font-size: 12px; margin-top: 10px; }
  .scene-art { inset: -3px -4px -1px 52%; }
  .scene-art .bot-image { transform: scale(1.17); }
  .scene-art::after { bottom: 12%; }
  .scene-bottom { padding-top: 9px; gap: 7px; }
  .scene-bottom .metric strong { font-size: 15px; }
  .scene-bottom .metric span { font-size: 10px; }
  .scene-bottom .metrics { gap: 6px 8px; }
  .scene-controls .button { min-height: 36px; font-size: 12px; }
  .scene-controls .scene-detail { width: 32px; }
  .scene-controls .icon { width: 15px; height: 15px; }
  .scene-market, .scene-status { font-size: 11px; }
  .capital-panel { grid-template-rows: auto auto 196px auto; padding: 11px 12px 12px; border-radius: 11px; }
  .capital-number { font-size: 32px; }
  .capital-delta { font-size: 12px; }
  .capital-chart { min-height: 196px; }
  .capital-metrics { padding-top: 7px; margin-top: 3px; }
  .capital-metrics .metrics { gap: 8px; }
  .capital-metrics .metric { gap: 1px; }
  .capital-metrics .metric span { font-size: 10px; }
  .capital-metrics .metric strong { font-size: 13px; }
  .chart-read { margin-top: 4px; font-size: 10px; }
  .team-row, .fill-row { padding-inline: 9px; }
  .market-grid { display: block; }
  .market-chart-panel { padding: 12px 11px 10px; }
  .market-chart { height: 285px; }
  .quote-name .asset-badge { width: 30px; height: 30px; font-size: 16px; }
  .quote-name { gap: 6px; }
  .quote-name h2 { font-size: 17px; }
  .quote-name p { font-size: 11px; }
  .quote-price strong { font-size: 21px; }
  .quote-price span { font-size: 11px; }
  .chart-toolbar .button { padding-inline: 6px; font-size: 11px; min-height: 37px; gap: 4px; }
  .chart-toolbar .icon { width: 15px; height: 15px; }
  .market-quote { margin-bottom: 9px; }
  .market-feed { margin-top: 16px; }
  .trade-side { display: none; }
  .mobile-trade { display: flex; gap: 7px; margin-top: 7px; }
  .mobile-trade .button { flex: 1; min-height: 44px; }
  .owned-grid, .portfolio-grid, .profile-grid { grid-template-columns: minmax(0,1fr); gap: 11px; }
  .catalog-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
  .catalog-portrait { height: 111px; }
  .catalog-portrait .bot-image { width: 153px; }
  .catalog-body { padding: 9px; }
  .catalog-name h2 { font-size: 16px; }
  .catalog-name strong { font-size: 12px; }
  .catalog-body p { font-size: 12px; min-height: 2.5em; }
  .catalog-actions { gap: 4px; margin-top: 8px; }
  .catalog-actions .button { font-size: 11px; min-width: 0; padding-inline: 6px; }
  .catalog-actions .square { min-width: 30px; }
  .catalog-actions .icon { width: 15px; height: 15px; }
  .owned-head { gap: 7px; grid-template-columns: 46px minmax(0,1fr) auto; }
  .owned-head .bot-thumb { width: 46px; height: 46px; }
  .owned-head p { font-size: 12px; }
  .route-tabs { margin-bottom: 12px; }
  .detail-head { grid-template-columns: 95px minmax(0,1fr); gap: 11px; margin-bottom: 12px; }
  .detail-portrait { height: 115px; }
  .detail-portrait .bot-image { width: 136px; }
  .detail-title > p:not(.owned-status) { font-size: 12px; }
  .detail-buttons .button { padding-inline: 5px; gap: 4px; font-size: 11px; }
  .detail-buttons .icon { width: 15px; height: 15px; }
  .detail-metrics, .detail-financial { padding: 11px; margin-bottom: 11px; }
  .detail-metrics .metrics, .portfolio-hero .metrics { grid-auto-flow: row; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .detail-financial .metric strong { font-size: 14px; }
  .detail-chart-panel { padding: 11px 10px 6px; }
  .bot-chart { height: 200px; }
  .portfolio-hero, .allocation, .portfolio-results, .profile-settings, .referral-panel { padding: 13px; }
  .portfolio-delta { font-size: 18px; }
  .portfolio-primary { gap: 6px 17px; }
  .position-row { grid-template-columns: minmax(0,1fr) minmax(0,1fr) auto; gap: 6px; padding: 10px 8px; }
  .position-row > :first-child { grid-column: span 2; }
  .position-row > .button { grid-column: 3; grid-row: 1; font-size: 11px; min-height: 34px; padding-inline: 6px; }
  .position-metric { padding-left: 1px; font-size: 13px; }
  .position-metric small { font-size: 11px; }
  .open-positions .segmented { align-self: flex-start; }
  .open-positions .segmented .button { padding-inline: 6px; min-height: 34px; font-size: 11px; }
  .history-filters { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
  .history-filters .select select { font-size: 13px; }
  .toast { right: 12px; bottom: calc(69px + env(safe-area-inset-bottom,0px)); max-width: calc(100% - 24px); }
  dialog { margin: auto auto 0; max-height: min(88dvh, 710px); width: 100%; max-width: 620px; border-radius: 14px 14px 0 0; }
  #dialog-content { padding: 13px 13px calc(14px + env(safe-area-inset-bottom, 0px)); }
  .dialog-head h2 { font-size: 19px; }
}
@media (max-width: 374px) {
  .topbar-inner, .page { width: calc(100% - 22px); }
  .scene-copy h2 { font-size: 38px; }
  .scene-controls .button:not(.scene-detail) .icon { display: none; }
  .scene-bottom .metric span { font-size: 9px; }
  .capital-top .segmented .button { padding-inline: 5px; }
  .capital-number { font-size: 29px; }
  .owned-head { grid-template-columns: 44px minmax(0,1fr); }
  .owned-status { grid-column: 2; }
  .market-quote .quote-name p > span { display: none; }
  .chart-toolbar .mobile-assets .icon { display: none; }
  .chart-toolbar .marker-toggle .icon { display: none; }
  .market-quote .quote-price strong { font-size: 19px; }
  .open-positions .section-head { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; }
}

/* Keep the chart and its readout in the same workspace. */
.capital-panel { position: relative; grid-template-rows: auto minmax(192px,1fr) auto; gap: 7px; }
.capital-panel > .chart-read { position: absolute; z-index: 2; top: 105px; left: 20px; margin: 0; padding: 3px 6px; background: var(--surface); border-radius: 4px; pointer-events: none; }
.capital-panel > .chart-read:not(.crosshair-read) { display: none; }
.owned-workspace { display: grid; grid-template-columns: minmax(0,1.58fr) minmax(0,1fr); align-items: start; gap: 20px; }
.owned-workspace .owned-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
.team-activity { min-width: 0; padding: 14px; border-left: 1px solid var(--line-deep); }
.team-activity .section-head h2 { font-size: 19px; }
.team-activity-metrics { padding: 8px 0 12px; }

@media (max-width: 1060px) and (min-width: 761px) {
  .owned-workspace .owned-grid { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 760px) {
  .bot-scene { min-height: 225px; }
  .scene-body { min-height: 123px; }
  .capital-panel { grid-template-rows: auto 196px auto; gap: 5px; }
  .capital-panel > .chart-read { top: 91px; left: 12px; }
  .capital-metrics .metric span { font-size: 11px; }
  .owned-workspace, .owned-workspace .owned-grid { grid-template-columns: minmax(0,1fr); gap: 12px; }
  .team-activity { padding: 6px 0 0; border-left: 0; }
}

.chart-context { min-height: 23px; display: flex; justify-content: space-between; gap: 7px; align-items: baseline; }
.chart-context .chart-read { min-width: 0; display: block; padding-block: 4px; }
.market-legend { flex: 0 0 auto; display: flex; gap: 8px; align-items: center; font-size: 11px; font-weight: 580; }
.compare-strategy { color: var(--muted); font-size: 12px; min-height: 2.8em; margin: 3px 0; }

@media (max-width: 760px) {
  .home-board { display: flex; flex-direction: column; align-items: stretch; gap: 11px; }
  .home-feed { margin-top: 5px; }
  .home-team .section-head { margin-bottom: 5px; align-items: center; }
  .home-team .section-head h2 { font-size: 17px; }
  .home-team .section-head p { margin-top: 1px; }
  .home-team .section-head .button { min-height: 37px; }
  #team-list { display: flex; gap: 6px; overflow-x: auto; overscroll-behavior-inline: contain; scroll-snap-type: x proximity; padding-bottom: 3px; scrollbar-width: thin; }
  #team-list .team-row { flex: 0 0 max(calc((100% - 20px) / 2), 150px); min-height: 45px; grid-template-columns: 31px minmax(0,1fr) auto; grid-template-rows: auto auto; column-gap: 5px; row-gap: 0; padding: 5px 6px; border: 1px solid var(--line); border-radius: 7px; scroll-snap-align: start; }
  #team-list .team-row:only-child { flex-basis: 100%; }
  #team-list .team-row[aria-pressed=true] { border-color: #bfd1c2; }
  #team-list .team-row .bot-thumb { width: 31px; height: 31px; grid-row: span 2; }
  #team-list .team-row .team-name { display: contents; }
  #team-list .team-row .team-name strong { grid-row: 1; grid-column: 2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; align-self: end; }
  #team-list .team-row .team-name small { grid-row: 2; grid-column: 2 / span 2; font-size: 11px; align-self: start; }
  #team-list .team-row .team-value { grid-row: 1; grid-column: 3; align-self: end; font-size: 11px; }
  #team-list .team-row > .icon { display: none; }
  .market-legend { font-size: 10px; gap: 4px; }
}

/* V5 retains the V4 workspace and adds density where the bot collection needs it. */
:root { --muted: var(--soft); --soft: var(--soft); }
a[href]:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible { outline-offset: 3px; }
.brand { color: var(--ink); }
.desktop-nav a[aria-current] { box-shadow: inset 0 -2px #377657; }
.chart-read { font-size: 12px; }
.quiet-label { font-weight: 520; }
.instrument-name small { font-size: 11px; }
.instrument-row > strong { font-size: 12px; }

.bot-scene { padding-top: 20px; overflow: clip; }
.scene-body { min-height: 232px; grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
.scene-copy { padding: 5px 0 7px; }
.scene-copy h2 { margin: 0 0 7px; }
.scene-copy-long h2 { font-size: 49px; }
.scene-status { font-weight: 640; }
.scene-market { padding: 6px 9px; }
.scene-market:hover { background: #e0eee51f; }
.scene-action { margin-top: 5px; font-size: 14px; color: #d3e2d7; }
.scene-art { inset: -7px 0 0 48%; overflow: visible; }
.scene-art::after { bottom: 12%; }
.scene-art .bot-image { width: 100%; height: 100%; max-height: 254px; transform: translateY(-8px) scale(1.15); }
.scene-recent {
  border: 0; border-radius: 6px; background: #ffffff10; color: #eff7ee; min-height: 42px;
  padding: 4px 8px; margin-top: 11px; display: inline-flex; gap: 7px; align-items: center;
  font-size: 13px; white-space: nowrap; text-align: left;
}
.scene-recent:hover { background: #ffffff1f; }
.scene-recent-empty { color: #d3e2d7; padding-inline: 0 6px; background: transparent; }
.scene-recent-empty:hover { background: transparent; }
.scene-recent-icon { display: grid; place-items: center; width: 22px; color: #b6d5bd; }
.recent-description { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 6px; }
.recent-description small { color: #c9ded1; font-size: 12px; }
.scene-recent > .icon { width: 14px; height: 14px; color: #c9ded1; }
.scene-bottom .metric span { font-size: 13px; color: #d1e4d6; }
.scene-bottom .metric strong { font-size: 20px; }
.scene-controls { gap: 8px; }
.scene-controls .button { min-height: 43px; }
.scene-controls .scene-detail { width: auto; padding-inline: 11px; }
#team-list:has(.team-row:nth-child(4)) { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 5px; }
#team-list:has(.team-row:nth-child(4)) .team-row { border-radius: 7px; border-bottom-color: var(--line); }
.team-row .bot-thumb .bot-image { height: 110%; width: 110%; }

.team-tools { display: flex; align-items: flex-end; justify-content: space-between; gap: 9px; margin-bottom: 12px; }
.team-tools .segmented { align-self: flex-end; }
.team-tools select { width: auto; min-width: 154px; }
.owned-workspace { align-items: start; gap: 22px; }
.owned-workspace .owned-grid { grid-template-columns: minmax(0,1fr); gap: 7px; }
.owned-bot { padding: 12px; }
.owned-bot .owned-head { grid-template-columns: 55px minmax(0,1fr); gap: 11px; }
.owned-bot .owned-status { margin-top: 3px; font-size: 12px; }
.owned-name { min-width: 0; }
.owned-bot .owned-head p { font-size: 13px; }
.owned-bot .metrics { margin-top: 9px; }
.owned-bot .metric span { font-size: 12px; }
.owned-bot .owned-controls { margin-top: 7px; }
.owned-bot .owned-detail { padding-inline: 11px; min-width: 43px; }
.team-activity { border-left-color: var(--line-deep); padding-top: 9px; }

.shop-bar { display: flex; justify-content: space-between; gap: 10px 20px; align-items: center; padding: 0 0 10px; }
.shop-bar .segmented { align-self: center; }
.shop-status { display: flex; align-items: center; gap: 12px 21px; min-width: 0; }
.shop-status > div:not(.shop-next) { display: flex; flex-direction: column; min-width: 0; }
.shop-status strong { font-size: 18px; white-space: nowrap; }
.shop-next { border-left: 1px solid var(--line-deep); padding-left: 17px; font-size: 13px; color: var(--muted); }
.shop-next a { color: var(--accent-hover); font-weight: 670; text-decoration: underline; text-underline-offset: 3px; }
.shop-notice { color: var(--muted); margin: 1px 0 12px; font-size: 13px; }
.catalog-card { display: flex; flex-direction: column; overflow: clip; }
.catalog-compared { box-shadow: inset 0 0 0 1px #669580; border-color: #669580; }
.catalog-portrait { height: 163px; }
.catalog-portrait:focus-visible { outline-offset: -3px; }
.catalog-portrait .bot-image { height: 100%; width: 100%; transform: scale(1.09); transition: transform .18s ease-out; }
.catalog-portrait:hover .bot-image { transform: scale(1.15); }
.catalog-symbol { font-size: 12px; background: var(--surface); padding: 3px 6px; border-radius: 4px; top: 9px; right: 9px; }
.catalog-body { display: flex; flex-direction: column; flex: 1; padding: 13px; }
.catalog-name h2 { font-size: 19px; line-height: 1.15; }
.catalog-name strong { color: var(--ink); white-space: nowrap; font-size: 15px; }
.catalog-body p { margin-block: 4px 9px; min-height: 22px; }
.catalog-specs { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; border-top: 1px solid var(--line); padding-top: 8px; margin-bottom: 9px; }
.catalog-specs dt { font-size: 12px; color: var(--muted); }
.catalog-specs dd { font-weight: 650; margin-top: 1px; }
.catalog-actions { gap: 6px; justify-content: space-between; margin: auto 0 0; }
.catalog-actions .button { min-height: 41px; }
.catalog-state { color: var(--muted); margin-top: 6px; font-size: 12px; }
.catalog-actions .button:disabled { border-color: var(--line); }
.compare-table { width: 100%; table-layout: fixed; border-collapse: collapse; margin: 11px 0 5px; font-size: 14px; }
.compare-table th, .compare-table td { text-align: left; vertical-align: middle; padding: 8px 7px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.compare-table tbody th { color: var(--muted); font-weight: 550; }
.compare-table tbody td { font-weight: 590; }
.compare-table thead th { font-size: 13px; color: var(--soft); }
.compare-table thead th strong { display: block; margin-top: 4px; color: var(--ink); }
.compare-table thead th:first-child { width: 32%; }
.compare-table .bot-thumb { width: 55px; height: 45px; }
.compare-table .bot-thumb .bot-image { width: 54px; }
.compare-table .button { padding-inline: 0; min-height: 32px; }
.compare-table tr:last-child > * { border-bottom: 0; }
.compare-note { color: var(--muted); font-size: 12px; padding: 0 7px; }

.history-layout { max-width: none; }
.history-workspace > div { min-width: 0; }
.history-progress { min-height: 37px; display: flex; align-items: center; gap: 8px; justify-content: space-between; margin: 0 0 8px; }
.history-progress .result-count { margin: 0; }
.history-progress .button { min-height: 35px; }
.history-columns, .history-time, .history-owner, .history-inspector { display: none; }
.history-line { grid-template-columns: minmax(0,1fr) max-content 16px; }
.history-operation { display: flex; min-width: 0; align-items: center; gap: 7px; }
.history-operation .fill-icon { flex: 0 0 auto; }
.history-operation .fill-name strong { white-space: nowrap; }
.history-line .history-gross, .history-line .history-result { text-align: right; white-space: nowrap; font-size: 14px; }
.history-line.fill-buy .history-result, .history-line.fill-sell .history-gross { display: none; }
.inspector-title { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.history-inspector .detail-list dt { min-width: 90px; }
.history-inspector .dialog-actions .button { padding-inline: 9px; }
.history-inspector .empty { padding: 12px 0; }
.history-day h2 { margin-block: 5px 7px; }

.profile-grid { max-width: 1080px; align-items: start; gap: 18px; grid-template-columns: minmax(0,1.1fr) minmax(0,1fr); }
.profile-form { grid-template-columns: minmax(0,1fr); }
.profile-name input { flex: 1 1 0; width: 0; }
.profile-settings, .referral-panel { padding: 19px 21px; }
.profile-settings .section-head, .referral-panel .section-head { margin-bottom: 15px; }
.settings-list label { min-height: 65px; padding-block: 10px; }
.settings-list small { font-size: 13px; }
.referral-amount { gap: 14px; padding: 12px 14px; }
.referral-amount > div { display: flex; flex-direction: column; }
.referral-amount .icon { width: 26px; height: 26px; }
.referral-amount strong { font-size: 28px; line-height: 1.25; }
.referral-amount span { display: block; font-size: 13px; }
.referral-input input:not([type=checkbox]) { width: 100%; font-size: 13px; }
.referral-controls { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 7px; margin-top: 9px; }
.referral-origin { color: var(--muted); font-size: 13px; margin-top: 7px; }

@media (min-width: 1080px) {
  .owned-workspace { grid-template-columns: minmax(0,1.85fr) minmax(300px,1fr); }
  .owned-bot { display: grid; grid-template-columns: minmax(200px,1.48fr) minmax(154px,1fr) auto; align-items: center; gap: 16px; }
  .owned-bot .metrics { border: 0; margin: 0; padding-block: 0; gap: 13px; }
  .owned-bot .owned-controls { margin: 0; }
  .owned-controls .button-quiet { border: 1px solid var(--line-deep); }
  .team-activity, .history-inspector { position: sticky; top: 14px; }
  .history-workspace { display: grid; grid-template-columns: minmax(0,1fr) minmax(290px,26%); align-items: start; gap: 20px; }
  .history-inspector { display: block; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 11px; }
  .history-columns, .history-line { display: grid; grid-template-columns: 58px minmax(79px, .76fr) minmax(126px,1.2fr) minmax(83px,.72fr) minmax(83px,.72fr) 16px; align-items: center; gap: 8px; padding-inline: 12px; }
  .history-columns { margin: 0 0 7px; font-size: 12px; color: var(--muted); }
  .history-columns span:nth-child(n+4) { text-align: right; }
  .history-time, .history-owner { display: block; font-size: 13px; color: var(--soft); white-space: nowrap; }
  .history-mobile-meta { display: none; }
  .history-line.fill-buy .history-result, .history-line.fill-sell .history-gross { display: block; }
  .history-line[aria-pressed=true] { background: var(--accent-soft); box-shadow: inset 3px 0 #408563; }
}
@media (min-width: 761px) and (max-width: 1080px) {
  .shop-next { display: none; }
  .scene-controls .scene-detail span { display: none; }
  .scene-copy-long h2 { font-size: 38px; }
}
@media (max-width: 760px) {
  .mobile-nav a { font-size: 11px; }
  .mobile-nav a[aria-current] { box-shadow: inset 0 2px #39815f; }
  .bot-scene { min-height: 221px; padding: 11px 14px 10px; }
  .scene-copy h2 { font-size: 42px; margin-bottom: 3px; }
  .scene-copy-long h2 { font-size: 29px; }
  .scene-body { min-height: 117px; }
  .scene-action { font-size: 12px; margin-top: 2px; }
  .scene-copy { padding-block: 2px; }
  .scene-art { inset: -10px 0 -3px 48%; }
  .scene-art .bot-image { transform: translate(-1px,-10px) scale(1.20); max-height: 179px; }
  .scene-recent { position: relative; min-height: 36px; margin-top: 5px; padding: 4px 6px; gap: 5px; font-size: 12px; }
  button.scene-recent::before { content: ''; position: absolute; inset: -4px 0; }
  .scene-recent .recent-description { gap: 0 5px; }
  .scene-recent .recent-description small { font-size: 11px; }
  .scene-recent-icon { width: 15px; }
  .scene-recent .icon { width: 14px; }
  .scene-bottom { padding-top: 7px; }
  .scene-bottom .metric span { font-size: 11px; }
  .scene-bottom .metric strong { font-size: 16px; }
  .scene-controls { gap: 5px; }
  .scene-controls .button { min-height: 44px; }
  .scene-controls .scene-detail { min-width: 44px; padding-inline: 8px; }
  .scene-controls .scene-detail span { display: none; }
  #team-list:has(.team-row:nth-child(4)) { display: flex; }
  #team-list .team-row .bot-thumb { width: 31px; height: 31px; }
  .chart-read { font-size: 11px; }
  .market-legend { font-size: 11px; }
  .team-tools { justify-content: space-between; }
  .team-tools .button { padding-inline: 7px; font-size: 12px; }
  .team-tools .select select { min-width: 130px; font-size: 12px; }
  .owned-bot .owned-head { grid-template-columns: 46px minmax(0,1fr); gap: 8px; }
  .owned-bot .owned-head p { font-size: 12px; }
  .owned-bot { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: 0 9px; }
  .owned-bot .owned-head { grid-column: 1 / -1; }
  .owned-bot .metrics { border: 0; padding-block: 0; gap: 7px; }
  .owned-bot .metric span { font-size: 11px; }
  .owned-bot .metric strong { font-size: 15px; }
  .owned-bot .owned-controls { justify-content: flex-end; gap: 4px; }
  .owned-bot .owned-controls .button { min-height: 44px; padding-inline: 8px; font-size: 12px; }
  .team-activity { padding-top: 8px; }
  .shop-bar { flex-direction: column; align-items: flex-start; gap: 8px; }
  .shop-bar .segmented { align-self: flex-start; }
  .shop-status { width: 100%; flex-wrap: wrap; gap: 7px 13px; }
  .shop-status strong { font-size: 16px; }
  .shop-next { padding-left: 9px; font-size: 12px; flex: 1; }
  .shop-notice { font-size: 12px; margin-bottom: 10px; }
  .catalog-portrait { height: 122px; }
  .catalog-body { padding: 9px; }
  .catalog-body p { margin-block: 4px 8px; min-height: 34px; }
  .catalog-name h2 { font-size: 17px; }
  .catalog-name strong { font-size: 13px; }
  .catalog-specs { gap: 4px; padding-top: 6px; margin-bottom: 7px; }
  .catalog-specs dt { font-size: 11px; }
  .catalog-specs dd { font-size: 13px; }
  .catalog-actions .button { min-height: 44px; padding-inline: 5px; font-size: 11px; gap: 3px; }
  .catalog-actions .icon { display: none; }
  .compare-table { font-size: 12px; }
  .compare-table th, .compare-table td { padding-inline: 4px; }
  .compare-table .button { padding: 0; min-height: 42px; font-size: 12px; }
  .compare-table .button .icon { width: 14px; }
  .history-progress .button { font-size: 12px; }
  .profile-grid { grid-template-columns: minmax(0,1fr); gap: 12px; }
  .profile-settings, .referral-panel { padding: 14px; }
  .settings-list label { min-height: 60px; }
  .referral-controls .button { min-height: 44px; }
}
@media (max-width: 374px) {
  .mobile-nav a { font-size: 10px; }
  .scene-copy h2 { font-size: 38px; }
  .scene-copy-long h2 { font-size: 28px; }
  .scene-bottom .metrics { gap: 8px; }
  .scene-bottom .metric span { font-size: 10px; }
  .scene-bottom .metric strong { font-size: 14px; }
  .scene-recent { min-height: 38px; }
  .scene-recent .recent-description { flex-direction: column; line-height: 1.12; }
  .team-tools { flex-wrap: wrap; }
  .catalog-actions { flex-wrap: wrap; }
}

body[data-page=profile] .page { max-width: 1080px; }
.history-line .history-amount-meta { display: block; color: var(--muted); font-size: 11px; font-weight: 450; }
@media (min-width: 1080px) {
  .history-line .history-amount-meta { display: none; }
}
