:root {
  --font-jakarta: var(--body-face);
  --forest: #163a2a;
  --primary: #b5e88a;
  --primary-foreground: #173021;
  --primary-hover: #c5ef9f;
  --foreground: #142a20;
  --card: #fffffd;
  --background: #f7f9f5;
  --sidebar: #eaf0e8;
  --secondary: #eaf0e6;
  --accent: #e6f0e0;
  --muted: #f1f5ef;
  --muted-foreground: #536459;
  --brand-deep: #285d3c;
  --border: #d9e1d7;
  --hairline: #e5eae2;
  --sidebar-accent: var(--secondary);
  --sidebar-foreground: var(--muted-foreground);
  --sidebar-border: var(--border);
  --input: #aebcaf;
  --popover: var(--card);
  --destructive: #a03833;
  color-scheme: light;
}
* { box-sizing: border-box; }
body { margin: 0; background: #e1e9de; color: var(--foreground); font: 400 15px/1.55 var(--body-face); font-optical-sizing: auto; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button, summary { cursor: pointer; }
button:disabled { cursor: default; }
button:is(.primary, .secondary):disabled { background-color: #e5ebe2; color: #58665a; border-color: #d4ddd2; }
button.receipt-copy:disabled { color: #636e64; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
svg { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.shell { display: grid; grid-template-columns: 14.75rem minmax(0, 1fr); min-height: 100svh; }
#sidebar { position: sticky; top: 8px; height: calc(100svh - 16px); margin: 8px; padding: 18px 10px 10px; background: var(--sidebar); border-radius: var(--folio-radius-frame); display: flex; flex-direction: column; overflow-y: auto; }
h1, h2, h3, .brand, .stats dd, .shortcut strong, .ticket-value output { font-family: var(--heading); }
.brand { display: inline-flex; align-items: center; gap: 8px; margin: 0 10px 38px; font-size: 25px; line-height: 32px; font-weight: 740; letter-spacing: -.045em; white-space: nowrap; }
.brand img { flex: none; width: 40px; height: 40px; object-fit: contain; }
#sidebar nav { display: grid; gap: 3px; }
.nav-group { margin: 24px 12px 5px; color: #526754; font-size: 12px; font-weight: 550; }
.nav-group:first-child { margin-top: 0; }
#sidebar nav a, .sidebar-docs { display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 9px 12px; border: 1px solid transparent; border-radius: var(--folio-radius-control); color: #435448; font-size: 14px; font-weight: 500; }
#sidebar nav a:hover, .sidebar-docs:hover { background: #e0e9dc; color: var(--forest); }
#sidebar nav a[aria-current=page], .sidebar-docs[aria-current=page] { background: var(--card); border-color: #d2ddce; color: var(--forest); box-shadow: 0 1px 2px #18331e08; font-weight: 645; }
#sidebar nav svg { color: #546d59; }
#sidebar nav a[aria-current=page] svg { color: var(--brand-deep); }
.shell #sidebar nav a::after { content: none; }
.sidebar-docs { flex: none; margin-top: auto; padding-block: 13px; }
.sidebar-docs .folio-icon { --body-pose: translateY(-1.5px); --detail-pose: scaleX(.65); }
main { min-width: 0; min-height: calc(100svh - 16px); margin: 8px 8px 8px 0; border: 1px solid var(--border); border-radius: var(--folio-radius-frame); background: var(--background); }
.app-header {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; gap: 14px;
  min-height: 60px; padding: 9px clamp(20px, 2vw, 34px);
  border-bottom: 1px solid var(--border);
  border-radius: calc(var(--folio-radius-frame) - 1px) calc(var(--folio-radius-frame) - 1px) 0 0;
  background: var(--background); color: var(--foreground);
}
#menu { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border: 0; border-radius: var(--folio-radius-control); color: #415849; background: transparent; }
#menu:hover { color: var(--forest); background: var(--secondary); }
.workspace-banner :focus-visible { outline-color: var(--primary); }
.breadcrumbs { display: flex; align-items: center; gap: 10px; padding-left: 18px; border-left: 1px solid var(--border); font-size: 14px; }
.crumb { color: var(--muted-foreground); }
.crumb[aria-hidden] { color: #89998c; }
.breadcrumbs strong { font-weight: 630; }
.header-actions { display: flex; align-items: center; gap: 9px; margin-left: auto; }
.app-header .mobile-workspace-link { display: none; }
.lookup-link, .primary, .secondary, .tabs button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 9px 16px; border: 1px solid var(--border); border-radius: var(--folio-radius-control); font-size: 14px; font-weight: 630; line-height: 1.35; }
.primary { background-color: var(--primary); color: var(--primary-foreground); border-color: transparent; }
.secondary { background-color: var(--card); color: var(--foreground); border-color: var(--input); }
.primary:hover:not(:disabled) { background-color: var(--primary-hover); }
.secondary:hover:not(:disabled) { background-color: var(--secondary); border-color: #839686; }
.primary:active:not(:disabled), .secondary:active:not(:disabled) { transform: translateY(1px); }
.header-actions > * { min-height: 38px; padding: 7px 16px; border-radius: 999px; }
.lookup-link { font-weight: 500; color: #46594b; background: transparent; }
.app-header .lookup-link:hover { color: var(--forest); border-color: #b4c6b4; background: var(--secondary); }
.app-header :is(.header-desk,.wallet-button:enabled) { color: #f3f8ee; border-color: var(--forest); background: var(--forest); }
.app-header :is(.header-desk,.wallet-button:enabled):hover { color: #fff; background: #255238; }
.app-header .wallet-button:disabled { color: #667267; border-color: var(--border); background: var(--secondary); }
.content { width: 100%; max-width: 84rem; margin: 0 auto; padding: 30px clamp(22px, 2.7vw, 46px) 68px; }
.docs-layout {
  display: grid;
  grid-template-columns: 14rem minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  gap: 26px clamp(30px, 4vw, 62px);
  align-items: start;
}
.docs-header { grid-column: 2; max-width: 72ch; padding-block: 8px 26px; border-bottom: 1px solid var(--border); }
.docs-header p { max-width: 54ch; margin-top: 12px; color: var(--muted-foreground); }
.docs-sidebar { position: sticky; top: 84px; grid-column: 1; grid-row: 1 / span 2; align-self: start; min-width: 0; }
.docs-toc-label { margin: 8px 0 12px 12px; color: var(--muted-foreground); font-size: 14px; font-weight: 600; }
.docs-contents summary { display: none; }
.docs-contents ol {
  counter-reset: docs-toc;
  list-style: none;
  max-height: calc(100dvh - 137px);
  margin: 0;
  padding: 0;
  overflow-y: auto;
  border-inline-start: 1px solid var(--border);
}
.docs-contents li { counter-increment: docs-toc; }
.docs-contents a {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  align-items: baseline;
  min-height: 36px;
  padding: 7px 6px 7px 11px;
  border-inline-start: 1px solid transparent;
  color: var(--muted-foreground);
  font-size: 13px;
  line-height: 1.4;
}
.docs-contents a::before { content: counter(docs-toc); font-variant-numeric: tabular-nums; color: var(--muted-foreground); }
.docs-contents a:hover { color: var(--foreground); background: var(--muted); }
.docs-contents a[aria-current] { color: var(--foreground); border-color: var(--brand); background: var(--accent); }
.docs-contents a[aria-current]::before { color: var(--brand); }
.docs-contents a:focus-visible { outline-offset: -3px; }
.docs-articles { counter-reset: docs-chapter; grid-column: 2; max-width: 72ch; min-width: 0; font-size: 15px; line-height: 1.7; }
.docs-articles article { counter-increment: docs-chapter; scroll-margin-top: 26px; }
.docs-articles article + article { margin-top: 34px; padding-top: 30px; border-top: 1px solid var(--border); }
.docs-articles h2 { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; font-size: 25px; line-height: 1.2; letter-spacing: -.035em; }
.docs-articles h2::before { content: counter(docs-chapter) "."; color: var(--brand); font-variant-numeric: tabular-nums; }
.docs-articles h3 { margin-top: 24px; font-size: 17px; line-height: 1.4; }
.docs-articles p { margin-top: 10px; }
.docs-articles ol { margin: 14px 0 0; padding-inline-start: 22px; list-style: decimal; }
.docs-articles li + li { margin-top: 8px; }
.docs-articles dl { margin-top: 14px; }
.docs-articles dt { margin-top: 12px; font-weight: 650; }
.docs-articles dd { margin-top: 2px; color: var(--muted-foreground); }
.docs-articles code { color: var(--foreground); overflow-wrap: anywhere; }
.docs-articles pre {
  margin: 12px 0;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--folio-radius-control);
  background: var(--card);
  white-space: pre-wrap;
}
.docs-articles a, .docs-inline-link { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
.docs-articles a:hover, .docs-inline-link:hover { color: var(--foreground); }
.agent-guide-link { margin-top: 14px; font-size: 14px; }
@media (max-width: 980px) {
  .docs-layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; gap: 20px; }
  .docs-header, .docs-sidebar, .docs-articles { grid-column: auto; grid-row: auto; }
  .docs-sidebar { position: static; }
  .docs-toc-label { display: none; }
  .docs-contents { border: 1px solid var(--border); border-radius: var(--folio-radius-control); background: var(--card); }
  .docs-contents summary { display: list-item; min-height: 44px; padding: 10px 14px; color: var(--foreground); }
  .docs-contents ol { max-height: 19rem; margin: 0 10px 10px; }
}
@media (max-width: 800px) {
  .docs-articles article { scroll-margin-top: 72px; }
}
@media (min-width: 801px) {
  html { scroll-padding-top: 72px; }
}
.workspace-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 124px;
  padding: 24px clamp(24px, 3vw, 44px);
  border-radius: var(--folio-radius-panel);
  background: #12291e;
  color: #f7faf5;
}
.workspace-banner--overview {
  --horizon-width: 46%;
  --horizon-height: 114px;
  --horizon-offset: 95px;
  align-items: center;
  min-height: 196px;
  padding-block: 36px;
  border-radius: var(--folio-radius-panel);
  background:
    radial-gradient(ellipse var(--horizon-width) var(--horizon-height) at 76% calc(100% + var(--horizon-offset)),
      #0d2318 97.8%, #183b27 98.9%, #93bc88 99.6%, #70a474 100.4%, #48765166 102%, transparent 118%),
    radial-gradient(ellipse 58% 116% at 76% 116%, #406544, #254632 46%, transparent 83%),
    #11271c;
}
.workspace-banner--overview h1 { text-wrap: balance; }
.workspace-banner--overview .banner-description { max-width: 52ch; }
.banner-copy { min-width: 0; }
h1, h2, h3, p, dl, dd { margin: 0; }
h1 { font-size: clamp(32px, 3vw, 42px); line-height: 1.08; font-weight: 610; letter-spacing: -.052em; }
.banner-description { max-width: 58ch; margin-top: 12px; color: #d4dfd6; font-size: 15px; line-height: 1.5; }
.banner-action { flex: none; min-height: 44px; padding-inline: 22px; border-radius: 999px; }
.workspace-banner--desk { flex-wrap: wrap; min-height: 150px; }
.desk-market { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; min-width: 0; max-width: 100%; }
.desk-quote { max-width: 100%; }
.quote-label, .quote-status { color: #becdc1; font-size: 13px; line-height: 1.35; }
.quote-label { display: block; }
.quote-value { display: inline-flex; align-items: baseline; gap: 5px; line-height: 1.25; }
.quote-number { font-family: var(--heading); font-size: 23px; font-weight: 570; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.quote-unit { color: #bacabe; font-size: 12px; font-weight: 500; }
.market-picker { position: relative; display: inline-flex; align-items: center; max-width: 100%; }
.market-picker .market-mark { position: absolute; inset-inline-start: 11px; z-index: 1; pointer-events: none; }
select option { background: var(--popover); color: var(--foreground); }
.market-mark, .asset img, .asset-monogram { flex: none; display: grid; place-items: center; width: 37px; height: 37px; border: 1px solid var(--border); border-radius: var(--folio-radius-control); background: var(--card); color: var(--foreground); font-size: 10px; font-weight: 650; object-fit: contain; }
.market-mark img { width: 80%; height: 80%; object-fit: contain; }
.market-picker .market-mark { width: 26px; height: 26px; border-radius: 50%; font-size: 8px; }
.stats { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); margin: 20px 0 12px; padding: 18px 0; border: 1px solid var(--border); border-radius: var(--folio-radius-panel); background: var(--card); }
.stats > div { min-width: 0; padding: 2px clamp(14px, 1.55vw, 28px); }
.stats > div + div { border-inline-start: 1px solid var(--border); }
dt, .subtle, .status, .asset small, .strategy-heading span, details p { color: var(--muted-foreground); }
.stats dt { font-size: 13px; font-weight: 500; }
.stats dd { margin-top: 6px; font-size: 28px; line-height: 1.15; font-weight: 590; letter-spacing: -.045em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.shortcuts { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; padding: 0 0 16px; margin-bottom: 28px; border-bottom: 1px solid var(--border); }
.shortcut { display: flex; align-items: center; gap: 13px; padding: 13px 12px; border-radius: var(--folio-radius-control); }
.shortcut:hover, .shortcut:focus-visible { background: var(--secondary); }
.shortcut-icon { display: grid; place-items: center; width: 42px; height: 42px; flex: none; background: #e4edde; border-radius: var(--folio-radius-control); color: var(--brand-deep); }
.shortcut strong { display: block; color: #193622; font-size: 15px; font-weight: 640; }
.shortcut small { display: block; margin-top: 2px; color: var(--muted-foreground); font-size: 13px; line-height: 1.4; }
.order-workspace, .strategy-workspace { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(0,1fr); gap: 20px; align-items: start; }
.workspace-page-title { margin-bottom: 24px; font-size: 2rem; }
#portfolio { max-width: 48rem; }
.lookup-panel { padding: 19px 20px; border-radius: var(--folio-radius-panel); background: #ebf1e8; }
.lookup-panel h2 { margin: 0 0 12px; font-size: 17px; letter-spacing: -.027em; }
.lookup-panel .form-row { margin: 0; }
.lookup-panel .form-row input { flex: 1; min-width: 0; border-color: #bdcbbd; }
.lookup-panel .form-row button { background: var(--forest); color: #f2f8ee; border: 1px solid transparent; }
.lookup-panel .form-row button:hover { background: #28543a; }
.portfolio-balances { margin-top: 20px; }
section, .box { min-width: 0; }
.box { background: var(--card); border: 1px solid var(--border); border-radius: var(--folio-radius-panel); }
h2, h3 { margin: 0 0 13px; font-size: 20px; line-height: 1.3; font-weight: 650; letter-spacing: -.038em; }
h3 { font-size: 16px; margin-top: 22px; }
.section-head, .market-identity, .strategy-heading, .strategy-actions { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.section-head { margin-bottom: 13px; }
.section-head h2, .market-identity h2, .strategy-heading h3 { margin: 0; }
#market { display: grid; grid-template-columns: minmax(0,1fr) minmax(15.5rem, .42fr); grid-template-areas: "title title" "tabs tabs" "form context"; align-items: start; column-gap: 18px; }
#legacy-heading { grid-area: title; margin-bottom: 8px; }
#market-controls { grid-area: form; }
.market-context { grid-area: context; padding: 22px; }
.market-identity { flex-wrap: nowrap; justify-content: start; gap: 11px; }
.market-identity > div { min-width: 0; }
.market-identity:has(#market-select:not([hidden])) #pair { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
#market-select { width: auto; max-width: 100%; font-weight: 650; }
#deployment { grid-column: 1 / -1; margin-top: 5px; white-space: nowrap; font-size: 13px; font-variant-numeric: tabular-nums; }
#deployment:empty { display: none; }
#legacy-tabs { grid-area: tabs; }
.tabs { display: flex; flex-wrap: wrap; align-items: stretch; gap: 4px; margin: 16px 0 18px; padding: 0; border-bottom: 1px solid var(--border); }
.tabs button { position: relative; justify-content: center; min-height: 45px; padding: 9px 16px; color: var(--muted-foreground); background: transparent; border: 0; border-radius: 7px 7px 0 0; font-weight: 570; }
#legacy-tabs button svg { width: 21px; height: 21px; }
.tabs button:hover { color: var(--forest); background: var(--secondary); }
.tabs button[aria-pressed=true] { color: #1a5130; background: #e2eddd; font-weight: 685; }
#legacy-tabs button[aria-pressed=true]::after { content: ""; position: absolute; inset: auto 0 -1px; height: 3px; background: #396e43; }
.trade-box, .form-stack { padding: 22px 24px; }
.trade-box > h2:first-child, .trade-box > .section-head:first-child { margin: 0 -24px 16px; padding: 0 24px 15px; border-bottom: 1px solid var(--border); }
#account-desk > .box { margin-bottom: 16px; }
.order-activity { margin-top: 18px; }
.fields, .form-stack { display: grid; gap: 15px; }
.fields { grid-template-columns: repeat(2,minmax(0,1fr)); align-items: end; margin-top: 16px; }
.fields .secondary { justify-self: start; }
.wide { grid-column: 1/-1; }
.form-row { display: flex; gap: 8px; margin-bottom: 8px; }
.form-row button { flex: none; white-space: nowrap; }
.form-stack button { justify-self: start; }
label { display: grid; gap: 6px; color: #324838; font-size: 13px; line-height: 1.45; font-weight: 610; }
input, select { width: 100%; min-width: 0; min-height: 43px; border: 1px solid var(--input); border-radius: var(--folio-radius-control); background: var(--card); color: var(--foreground); padding: 9px 13px; font-size: 15px; font-weight: 480; }
input::placeholder { color: #657568; }
input:disabled, select:disabled { background-color: #f5f7f3; }
input:focus-visible, select:focus-visible { outline: 0; border-color: var(--brand-deep); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 20%, transparent); }
.status, .subtle, details p { margin-top: 8px; font-size: 14px; overflow-wrap: anywhere; }
.status:empty, .details:empty { display: none; }
.status[data-error=true], .order-entry[data-state=rejected] summary span:last-child { color: var(--destructive); }
#state:not(:empty) { margin-top: 12px; padding-left: 10px; border-left: 2px solid var(--input); }
#trade-status:not(:empty) { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); }
.market-context .wallet-button { width: 100%; margin-top: 16px; }
.ticket-value { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 12px 0 0; border-top: 1px solid var(--border); color: var(--muted-foreground); }
.ticket-value output { font-size: 22px; color: var(--foreground); font-weight: 620; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.details { display: grid; margin: 14px 0; font-size: 14px; }
.details div { display: flex; justify-content: space-between; gap: 16px; padding: 7px 0; border-bottom: 1px solid var(--border); }
.details dd { text-align: right; overflow-wrap: anywhere; font-weight: 570; font-variant-numeric: tabular-nums; }
.receipt-copy, .details a, td a, .stats a { color: var(--brand-deep); }
.receipt-copy { border: 0; background: transparent; padding: 0; font: inherit; font-weight: 570; }
.receipt-copy:hover, .details a:hover, td a:hover, .stats a:hover, a.asset:hover b { text-decoration: underline; text-underline-offset: .18em; }
.table-wrap { overflow: auto; background: var(--card); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { padding: 10px 17px; text-align: left; }
th { color: #4b5d50; font-size: 12px; font-weight: 620; background: var(--muted); }
td { border-top: 1px solid var(--border); font-variant-numeric: tabular-nums; }
td:last-child, th:last-child, .amount { text-align: right; }
td:last-child a { font-size: 13px; font-weight: 550; }
tbody tr:hover { background: #f3f7f0; }
.asset { display: flex; align-items: center; gap: 11px; color: var(--foreground); }
.asset b { font-weight: 680; }
.asset span { min-width: 0; overflow-wrap: anywhere; }
.asset small { display: block; font-size: 12px; }
.asset img, .asset-monogram { width: 34px; height: 34px; border-radius: var(--folio-radius-control); padding: 4px; }
.asset-monogram { background: var(--secondary); color: var(--sidebar-foreground); }
#bridge-help, #session-binding, #settle, #revoke, #inspect-grant, #private-funds, .strategy-actions, #automation-deposit, #automation-authorize, #automation-submit, #automation-cancel { margin-top: 16px; }
details summary { color: var(--sidebar-foreground); }details summary:hover { color: var(--foreground); }details code { overflow-wrap: anywhere; }
#disconnect-agent { display: block; margin-top: 12px; }
#session-binding { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; }#session-binding label { grid-column: 1/-1; }
#private-controls, #market-controls { min-width: 0; margin: 0; padding: 0; border: 0; }
#private-controls:disabled :is(input, select), #market-controls:disabled :is(input, select) { cursor: default; }
select, #symbol {
  appearance: none;
  padding-right: 35px;
  --select-dot: radial-gradient(circle, currentColor 1.2px, transparent 1.5px);
  background-image: var(--select-dot), var(--select-dot), var(--select-dot);
  background-position: right 12px center, right 17px center, right 22px center;
  background-size: 3px 3px;
  background-repeat: no-repeat;
}
summary { list-style: none; }
summary::-webkit-details-marker { display: none; }
details:not(.order-entry) > summary::before { content: '+'; display: inline-block; width: 1.2em; color: var(--brand-deep); }
details[open]:not(.order-entry) > summary::before { content: '−'; }
#session-command { font-family: monospace; }
#bind-label { display: grid; gap: 5px; }
#orders > div, #settlements > div, .order-entry, .strategy-record, #order-history details, .strategy-record li { padding: 12px 0; border-top: 1px solid var(--border); overflow-wrap: anywhere; }
#orders > div, #settlements > div, .order-entry summary { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
#settlements details, #order-history details { width: 100%; min-width: 0; }.order-entry summary span:last-child { margin-left: auto; color: var(--muted-foreground); }
.order-entry summary::after { content: '+'; }.order-entry[open] summary::after { content: '−'; }
.order-entry[data-state=filled] summary span:last-child, .strategy-record[data-state=active] .strategy-heading span { color: var(--success); }
.strategy-workspace { grid-template-columns: minmax(0,1fr) minmax(0,1.1fr); }.strategy-record ol { list-style: none; padding: 0; }.strategy-record details { margin-top: 10px; }
.legacy-exits :is(#automation-form,#automation-submit,#automation-deposit,#automation-authorize) { display: none !important; }
.legacy-exits #funds-form button { grid-column: 1/-1; justify-self: start; min-width: 9rem; }
@media (prefers-reduced-motion: no-preference) {
  a, button, input, select, tr { transition: color .15s, background-color .15s, border-color .15s, box-shadow .15s, transform .15s; }
}
@media (min-width: 801px) {
  body.sidebar-collapsed .shell { grid-template-columns: minmax(0,1fr); }
  body.sidebar-collapsed #sidebar { display: none; }
  body.sidebar-collapsed main { margin-left: 8px; }
}
@media (min-width: 1101px) {
  #account-desk { display: grid; grid-template-columns: minmax(0,.92fr) minmax(0,1.15fr); align-items: start; gap: 18px; }
  #account-desk > .box { margin: 0; }
  #back-to-ticket { justify-self: start; grid-column: 1 / -1; }
  #receipts-desk { max-width: 54rem; }
}
@media (max-width: 1100px) and (min-width: 801px) {
  .shell { grid-template-columns: 12.5rem minmax(0,1fr); }
  .content { padding-inline: 20px; }
  .shortcuts { gap: 8px; }
  .shortcut { padding: 12px; }
  #market { grid-template-columns: minmax(0,1fr) minmax(13rem,.54fr); gap: 0 12px; }
  .market-context { padding: 17px; }
  .tabs button { padding-inline: 10px; }
}
@media (max-width: 800px) {
  .shell { display: block; }
  main { margin: 5px; min-height: calc(100svh - 10px); }
  #sidebar { position: fixed; inset: 0 auto auto 0; z-index: 4; width: min(16rem, calc(100vw - 16px)); box-shadow: 0 8px 32px #19392324; transform: translateX(calc(-100% - 8px)); visibility: hidden; }
  .menu-open #sidebar { visibility: visible; transform: none; }.menu-open { overflow: hidden; }
  #backdrop { position: fixed; inset: 0; z-index: 3; background: #10271a59; border: 0; }
  .app-header { padding: 8px 12px; gap: 8px; min-height: 55px; }
  .content { padding: 18px 16px 48px; }
  .app-header .mobile-workspace-link { display: inline-flex; }
  .app-header .header-actions { flex: none; }
  .app-header .breadcrumbs { min-width: 0; }
  .app-header .breadcrumbs strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .order-workspace, .strategy-workspace { grid-template-columns: minmax(0,1fr); }
  #market { grid-template-columns: minmax(0,1fr); grid-template-areas: "title" "context" "tabs" "form"; }
  .market-context { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 8px; margin-top: 14px; padding: 13px 15px; }
  .market-context .wallet-button { grid-column: 2; grid-row: 1; margin: 0; padding-inline: 11px; }
  #trade-status:not(:empty) { grid-column: 1/-1; margin: 0; padding-top: 8px; }
}
@media (max-width: 600px) {
  .content { padding: 14px 12px 40px; }
  .workspace-banner { align-items: flex-start; justify-content: center; flex-direction: column; gap: 19px; min-height: 106px; padding: 22px; border-radius: var(--folio-radius-panel); }
  .workspace-banner--overview {
    --horizon-width: 75%;
    --horizon-height: 96px;
    --horizon-offset: 82px;
    align-items: flex-start;
    padding-block: 24px 33px;
  }
  .banner-description { margin-top: 9px; font-size: 14px; }
  .workspace-banner--desk { min-height: 152px; }
  .desk-market { width: 100%; gap: 10px 14px; }
  .desk-market .quote-number { font-size: 21px; }
  .app-header .crumb, .lookup-link span { display: none; }
  .breadcrumbs { padding-left: 0; border: 0; line-height: 1.15; }
  .lookup-link { width: 40px; height: 40px; }
  .header-actions > * { padding: 7px 9px; }
  .header-actions { gap: 5px; }
  .stats { padding: 0; overflow: hidden; margin: 14px 0; }
  .stats > div { padding: 12px 9px; }
  .stats dd { font-size: 21px; }
  .tabs { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 2px; margin: 13px 0; padding: 3px; border: 1px solid var(--border); border-radius: var(--folio-radius-control); background: #eef2eb; }
  .tabs button { justify-content: start; border-radius: 7px; padding-inline: 11px; min-height: 42px; font-size: 13px; }
  .tabs button[aria-pressed=true] { box-shadow: inset 0 0 0 1px #bacfb7; }
  #legacy-tabs button[aria-pressed=true]::after { display: none; }
  .market-context { padding: 12px; }
  .market-context .wallet-button { font-size: 13px; }
  .market-identity { gap: 7px; }
  .market-identity h2 { font-size: 16px; }
  #market-select { padding-left: 6px; font-size: 14px; }
  .shortcuts { grid-template-columns: minmax(0,1fr); gap: 0; padding: 0 0 8px; margin-bottom: 18px; }
  .shortcut { padding: 11px 13px; }
  .lookup-panel { padding: 16px; }
  .trade-box, .form-stack { padding: 17px; }
  .trade-box > h2:first-child, .trade-box > .section-head:first-child { margin-inline: -17px; padding-inline: 17px; }
  .fields, #session-binding { grid-template-columns: minmax(0,1fr); }
  .primary, .secondary { white-space: normal; }
  input, select { font-size: 16px; }
  .asset { gap: 7px; }th,td { padding: 9px 10px; }.amount { overflow-wrap: anywhere; }
  table:has(td.amount) { table-layout: fixed; }table:has(td.amount) th:first-child { width: 36%; }table:has(td.amount) th:last-child { width: 31%; }
  .legacy-exits #funds-form button { justify-self: stretch; }
}

@media (prefers-reduced-motion: no-preference) {
  .tabs button { transition: color 140ms, background-color 140ms, border-color 140ms; }
}
@media (max-width: 800px) and (prefers-reduced-motion: no-preference) {
  #sidebar { transition: transform 175ms cubic-bezier(.2,.75,.3,1), visibility 0s linear 175ms; }
  .menu-open #sidebar { transition-delay: 0s; }
}

/* Single-select controls keep their original form fields as the source of truth. */
.folio-native { display: none; }
.folio-picker {
  display: inline-flex;
  align-items: center;
  justify-content: start;
  gap: 9px;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 8px 11px 8px 13px;
  border: 1px solid var(--input);
  border-radius: var(--folio-radius-control);
  background-color: var(--card);
  color: var(--forest);
  font-size: 15px;
  font-weight: 530;
  line-height: 1.35;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.folio-picker-value { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folio-picker::after {
  content: '';
  flex: none;
  width: 21px;
  height: 15px;
  margin-inline-start: auto;
  border: 1px solid #d2ded2;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 50%, currentColor 1px, transparent 1.4px),
    radial-gradient(circle at 50% 50%, currentColor 1px, transparent 1.4px),
    radial-gradient(circle at 70% 50%, currentColor 1px, transparent 1.4px) #f0f5ed;
  color: #42624b;
}
.folio-picker[aria-expanded=true] { border-color: #51745b; background-color: #f9fcf7; }
.folio-picker[aria-expanded=true]::after { color: #fff; background-color: #315540; border-color: #315540; }
.folio-picker:focus-visible { outline: 2px solid #386740; outline-offset: 2px; }
.folio-picker[aria-disabled=true] { background-color: #f3f6f1; color: #667068; cursor: default; }
.folio-picker[aria-disabled=true]::after { opacity: .55; }
.market-picker :is(#symbol, .folio-picker) {
  width: max-content;
  max-width: 100%;
  min-height: 44px;
  border: 1px solid #658172;
  border-radius: var(--folio-radius-control);
  background-color: #233d30;
  color: #f3f7f0;
  font-weight: 620;
}
.market-picker :is(#symbol:enabled:hover, .folio-picker:not([aria-disabled=true]):hover, .folio-picker[aria-expanded=true]) { background-color: #2d4a38; border-color: #86a28c; }
.market-picker :is(#symbol:disabled, .folio-picker[aria-disabled=true]) { color: #baced0; cursor: default; }
.market-picker :is(#symbol, .folio-picker):focus-visible { outline: 2px solid #c8daca; outline-offset: 3px; }
.market-picker:has(.market-mark:not([hidden])) :is(#symbol, .folio-picker) { padding-inline-start: 45px; }
.market-picker .folio-picker::after { width: 18px; margin-inline-start: 2px; background-color: transparent; border-color: transparent; color: #b7cabd; }
@media (max-width: 600px) {
  .market-picker .folio-picker { gap: 4px; padding-inline-end: 8px; font-size: 14px; }
  .market-picker .market-mark { inset-inline-start: 8px; width: 24px; height: 24px; }
  .market-picker:has(.market-mark:not([hidden])) :is(#symbol, .folio-picker) { padding-inline-start: 38px; }
  .market-picker .folio-picker::after { width: 14px; }
}
@media (min-width: 375px) and (max-width: 600px) {
  .desk-market { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; }
  .desk-market .quote-value { flex-wrap: wrap; column-gap: 4px; row-gap: 0; }
}
.market-identity .folio-picker { width: auto; max-width: 100%; font-weight: 650; }
.folio-listbox {
  position: fixed;
  z-index: 20;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px;
  border: 1px solid #b7c9b6;
  border-radius: var(--folio-radius-control);
  background: #fff;
  color: var(--forest);
  box-shadow: 0 10px 32px #17312124, 0 2px 6px #1731210c;
}
.folio-listbox [role=option] {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 8px 11px;
  border-radius: var(--folio-radius-inner);
  font-size: 15px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  cursor: pointer;
  touch-action: manipulation;
}
.folio-option-logo { flex: none; width: 24px; height: 24px; padding: 2px; border: 1px solid #d8e1d5; border-radius: var(--folio-radius-inner); background: white; object-fit: contain; }
.folio-listbox [aria-selected=true] { font-weight: 650; }
.folio-listbox [aria-selected=true]::after {
  content: '';
  flex: none;
  width: 11px;
  height: 6px;
  margin-inline: auto 3px;
  border: solid currentColor;
  border-width: 0 0 2px 2px;
  transform: rotate(-45deg);
}
.folio-listbox [data-active] { background: #e9f1e6; box-shadow: inset 2px 0 #456c4b; }
.folio-listbox [aria-disabled=true] { color: #717b73; cursor: default; }
@media (hover: hover) {
  .folio-picker:hover:not([aria-disabled=true]) { border-color: #66846c; }
  .folio-listbox [role=option]:hover:not([aria-disabled=true]) { background: #e3ede0; }
}
@media (max-width: 600px) {
  .folio-picker, .folio-listbox [role=option] { font-size: 16px; }
  .market-identity .folio-picker { font-size: 14px; padding-inline: 7px; gap: 5px; }
}
@media (prefers-reduced-motion: no-preference) {
  .folio-picker, .folio-picker::after { transition: background-color 140ms ease, border-color 140ms ease; }
  .folio-listbox { --rise: -3px; animation: folio-picker-open 125ms ease-out; }
  .folio-listbox[data-placement=above] { --rise: 3px; }
  @keyframes folio-picker-open { from { opacity: .4; transform: translateY(var(--rise)); } }
}
@media (forced-colors: active) {
  .folio-listbox [data-active] { outline: 1px solid Highlight; outline-offset: -2px; }
  .folio-picker::after { content: '•••'; line-height: 12px; text-align: center; }
}
