/* MoC is a terminal like Trading: a market bar, then the main pane (your orders, or the
   execution balance) beside a persistent 360px action column holding the order ticket,
   the wallet balances and the execution funds. Loaded after board.css. */

.panel.moc-page { display: block; padding: 0; min-width: 0; background: var(--ground-fill); border-radius: 0; }
.moc-page[hidden], .moc-page [hidden] { display: none !important; }
.moc-workspace { max-width: none; margin: 0; min-width: 0; font-size: .875rem; line-height: 1.5; }
.moc-page h2 { margin: 0; font-size: .9375rem; font-weight: 500; line-height: 1.4; }
.moc-page h3 { margin: 20px 0 10px; font-size: .875rem; font-weight: 500; }
.moc-page h4 { margin: 20px 0 8px; font-size: .8125rem; font-weight: 500; }
.moc-help { margin: 8px 0; max-width: 64ch; color: var(--text-muted); font-size: .8125rem; line-height: 1.55; }
.moc-positive { color: var(--positive); }
.moc-warning { color: var(--network-label); }
.moc-sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.moc-page fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.moc-page ::selection { color: var(--on-selection); background: var(--selection); }
.moc-page a { text-underline-offset: 3px; }
.moc-page button, .moc-page a:not(.aera-prose-link) { transition: color 150ms ease-out, background-color 150ms ease-out, border-color 150ms ease-out; }
.moc-page .btn { min-height: 44px; padding-inline: 16px; font-weight: 500; white-space: normal; }
.moc-page .btn:focus-visible { border-color: var(--focus); outline: none; box-shadow: none; }
.moc-page a:not(.aera-page-nav-link, .aera-prose-link):focus-visible, .moc-page summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.moc-page .moc-primary { background: var(--positive-fill); color: var(--on-positive); border-color: var(--positive-fill); font-weight: 600; }
.moc-page .moc-primary:hover:not(:disabled) { background: var(--positive-fill-hover); border-color: var(--positive-fill-hover); color: var(--on-positive); }
.moc-page .moc-primary:disabled { background: var(--terminal-control); color: var(--text-muted); border-color: var(--rule-strong); opacity: 1; }

/* ---------- Pane grammar ---------- */
.moc-pane-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; margin: 0 0 12px; border-bottom: 1px solid var(--terminal-rule); }
.moc-pane-head h2 { margin: 0; }
.moc-pane-note, .moc-pane-head .moc-help { margin: 0; font: var(--colhead); letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); text-align: right; }
.moc-pane-head .moc-back-order { min-height: 44px; padding-inline: 14px; font-size: .8125rem; }
.moc-pane-head h2[tabindex="-1"]:focus { outline: none; }
.moc-deposit-need { margin: 8px 0 0; font-size: .8125rem; }
.moc-deposit-need[hidden] { display: none; }
#moc-orders-page-label:focus { outline: none; }
.moc-metrics { margin: 0; min-width: 0; }
.moc-metrics > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--terminal-rule); }
.moc-metrics dt { color: var(--text-soft); font-size: .8125rem; }
.moc-metrics dd { margin: 0; max-width: 66%; text-align: right; color: var(--text); font: .8125rem/1.5 var(--fontfam-term); font-variant-numeric: tabular-nums slashed-zero; overflow-wrap: anywhere; }
.moc-disclosure { border-top: 1px solid var(--terminal-rule); }
.moc-disclosure > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding: 0; cursor: pointer; color: var(--text); font-size: .8125rem; font-weight: 500; list-style: none; }
.moc-disclosure > summary::-webkit-details-marker { display: none; }
.moc-disclosure > summary::after { content: ''; flex: 0 0 6px; width: 6px; height: 6px; margin-left: auto; border-right: 1px solid var(--text-muted); border-bottom: 1px solid var(--text-muted); transform: rotate(45deg) translateY(-2px); }
.moc-disclosure[open] > summary::after { transform: rotate(225deg); }
.moc-disclosure[open] { padding-bottom: 12px; }
.moc-error, .moc-notice { padding: 14px 0; margin: 0 0 16px; border-bottom: 1px solid var(--terminal-rule); overflow-wrap: anywhere; }
.moc-error { color: var(--danger); }
.moc-notice { color: var(--text-soft); }
.moc-notice h3 { margin-top: 0; }
.moc-notice .btn { margin: 0 10px 8px 0; }
.moc-hash { font: .75rem/1.5 var(--fontfam-term); color: var(--text-muted); overflow-wrap: anywhere; }
.moc-tx { display: inline-block; margin: 8px 12px 0 0; font-size: .8125rem; }
.moc-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.moc-table-scroll { max-width: 100%; overflow-x: auto; scrollbar-width: thin; scrollbar-color: var(--rule-strong) transparent; }
.moc-page table { border-collapse: collapse; width: 100%; text-align: left; font-size: .8125rem; }
.moc-page th { padding: 0 12px 10px 0; border-bottom: 1px solid var(--rule-strong); white-space: nowrap; }
.moc-page td { padding: 12px 12px 12px 0; border-bottom: 1px solid var(--terminal-rule); vertical-align: top; }
.moc-page td small { display: block; margin-top: 5px; color: var(--text-muted); white-space: nowrap; }
.moc-page td:nth-child(2) { font-family: var(--fontfam-term); font-variant-numeric: tabular-nums; }
.moc-order-label { color: var(--text-muted); font: var(--colhead); letter-spacing: .06em; text-transform: uppercase; }
.moc-order-number { font: .8125rem/1.4 var(--fontfam-term); font-variant-numeric: tabular-nums slashed-zero; color: var(--text); overflow-wrap: anywhere; }
.moc-order-status { display: inline-flex; align-items: center; gap: 6px; font: var(--colhead); letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; color: var(--text-soft); }
.moc-order-status::before { content: ""; flex: none; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.moc-order-status--positive { color: var(--positive); }
.moc-order-status--warning { color: var(--network-label); }

/* ---------- Market bar ---------- */
.moc-market-bar { border-bottom: 1px solid var(--terminal-rule); }
/* The oracle and the stats are one row of cells: every label on one line, every value on the next. A cell's
   secondary line (an oracle notice) hangs below without moving its neighbours. */
.moc-market-figures { display: flex; align-items: flex-start; gap: 32px; min-width: 0; }
.moc-market-bar .moc-oracle, .moc-stat { display: flex; flex-direction: column; justify-content: flex-start; gap: 4px; min-width: 0; text-align: left; }
.moc-market-bar .moc-oracle > span:first-child, .moc-stat-label { font: var(--colhead); letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); white-space: nowrap; }
.moc-market-bar .moc-oracle strong, .moc-stat-value { font: 700 .875rem/1.4 var(--fontfam-term); letter-spacing: 0; color: var(--text); font-variant-numeric: tabular-nums slashed-zero; white-space: nowrap; }
.moc-stat-value { font-weight: 400; }
.moc-market-bar .moc-oracle > span:last-child:not(:first-child) { font-size: .6875rem; line-height: 1.3; }
.moc-market-stats { display: contents; }
.moc-stat[data-tone="positive"] .moc-stat-value { color: var(--positive); }
.moc-stat[data-tone="warning"] .moc-stat-value { color: var(--network-label); }
.moc-stat[data-tone] .moc-stat-value::before { content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; background: currentColor; vertical-align: 1px; }

/* ---------- Frame: main pane beside the action column ---------- */
.moc-frame { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 1px; background: var(--terminal-rule); min-height: calc(100dvh - var(--aera-sticky-height, 56px) - var(--status-h, 30px) - 65px); }
.moc-frame > * { min-width: 0; background: var(--ground-fill); }
/* The action column comes first in the document, so reading and keyboard order match the phone's stacked order;
   on wide screens it sits in the right-hand column. */
.moc-frame > .moc-side { grid-column: 2; grid-row: 1; }
.moc-frame > .moc-main { grid-column: 1; grid-row: 1; }
.moc-frame > :is(#moc-side, #moc-main):focus { outline: none; }
.moc-frame > :is(#moc-side, #moc-main):focus-visible { outline: 2px solid var(--text-muted); outline-offset: -2px; }
.moc-main { display: flex; flex-direction: column; min-width: 0; }
.moc-main > section { flex: 1 0 auto; min-width: 0; }
.moc-main > #moc-pending:not(:empty) { padding: 16px var(--pane-x) 0; }

/* Tab strip: the main pane's views. */
.moc-page .aera-page-nav.moc-tabs { display: flex; flex-direction: row; gap: 4px; width: auto; margin: 0; padding: 0 calc(var(--pane-x) - 12px); border: 0; border-bottom: 1px solid var(--terminal-rule); background: transparent; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.moc-page .aera-page-nav.moc-tabs::-webkit-scrollbar { display: none; }
.moc-page .moc-tabs .aera-page-nav-link { flex: 0 0 auto; width: auto; min-width: 0; min-height: 48px; padding: 0 12px; border-radius: 4px 4px 0 0; gap: 8px; font-size: .8125rem; font-weight: 500; white-space: nowrap; }
.moc-page .moc-tabs .aera-page-nav-link::before { display: none; }
.moc-page .moc-tabs .aera-page-nav-link svg { width: 16px; height: 16px; flex: 0 0 16px; }
.moc-page .moc-tabs .aera-page-nav-link:is([aria-current="page"])::after { left: 12px; right: 12px; bottom: -1px; }

/* Access: the main pane's empty state leads with the unlock action. */
.moc-start { margin: 0; padding: 40px var(--pane-x) 36px; border-bottom: 1px solid var(--terminal-rule); }
.moc-start h2 { margin: 0; font-size: 1rem; }
.moc-start-lead { max-width: 52ch; margin: 8px 0 24px; color: var(--text-soft); font-size: .875rem; line-height: 1.55; }
.moc-start-steps { max-width: 52ch; }
.moc-start-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.moc-start-actions .btn { min-width: 200px; }
.moc-start-actions .btn[hidden] { display: none; }
#moc-start-gate { margin: 12px 0 0; font-size: .75rem; }
.moc-orders-workspace[data-start="true"] .moc-orders-browser { display: none; }

/* ---------- Action column ---------- */
.moc-side { display: flex; flex-direction: column; padding: 4px 20px 24px; }
.moc-side > * + * { margin-top: 28px; }
.moc-side > #moc-funds-ticket[hidden] + * { margin-top: 0; }
.moc-side .moc-pane-head { margin-bottom: 16px; }
.moc-side .moc-ticket { padding: 0; border: 0; border-radius: 0; background: transparent; }
.moc-side .moc-funding .moc-metrics > div { padding-block: 9px; }
#moc-credit-reference:empty { display: none; }
#moc-credit-reference .moc-warning { margin: 10px 0 0; font-size: .75rem; line-height: 1.55; }
#moc-new-funding-progress:empty { display: none; }
.moc-funds-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.moc-funds-actions .btn { min-height: 40px; padding-inline: 12px; font-size: .8125rem; }
.moc-funding > .moc-help { margin: 12px 0 0; font-size: .75rem; }
.moc-doc > summary { color: var(--text-soft); }
.moc-doc .moc-help { font-size: .8125rem; }
.moc-doc a { display: inline-block; color: var(--text-soft); font-size: .8125rem; line-height: 1.6; padding-block: 5px; }

/* ---------- Order ticket ---------- */
.moc-side-note { margin: 0 0 16px; font-size: .75rem; }
.moc-field { display: flex; flex-direction: column; gap: 8px; min-width: 0; color: var(--text-soft); font-size: .8125rem; }
.moc-field > span, .moc-field > label > span { display: flex; justify-content: space-between; gap: 8px; }
.moc-field > span > span:last-child:not(:first-child) { color: var(--text-muted); font-family: var(--fontfam-term); font-size: .75rem; }
.moc-field input, .moc-field select { width: 100%; min-width: 0; min-height: 48px; padding: 10px 12px; border: 1px solid var(--rule-strong); border-radius: 4px; color: var(--text); background: var(--terminal-control); font-size: 1rem; }
.moc-field input { font-family: var(--fontfam-term); font-variant-numeric: tabular-nums slashed-zero; caret-color: var(--positive); }
.moc-field input::placeholder { color: var(--text-muted); opacity: 1; }
.moc-field input:hover:not(:disabled):not(:read-only):not(:focus) { border-color: var(--rule-bright); }
.moc-field input:focus-visible, .moc-field select:focus-visible { border-color: var(--positive); outline: none; box-shadow: none; }
.moc-field input:read-only { background: transparent; border-color: var(--terminal-rule); }
.moc-field input:disabled, .moc-field select:disabled { opacity: .65; }
.moc-trigger-field { margin-bottom: 16px; }
/* Trigger price and amounts are shared field groups (board.css `.aera-infield`): USD leads, Oracle, Max and the currency are keys. */
.moc-price-input input { padding-left: 6px; }
/* Oracle, the amount currency and withdrawal Max use the shared in-field controls (board.css). */
#moc-page.moc-page .moc-amount-input input { min-height: 48px; padding: 10px 8px 10px 12px; border: 0; border-radius: 0; background: transparent; color: var(--text); font: 1rem/1.5 var(--fontfam-term); font-stretch: 100%; font-weight: 400; letter-spacing: 0; font-variant-numeric: tabular-nums slashed-zero; caret-color: var(--positive); }
#moc-page.moc-page .moc-amount-input input:focus-visible { outline: 0; border: 0; box-shadow: none; }
.moc-trade-balances { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 8px 0 0; }
.moc-trade-balances .moc-help { margin: 0; font-size: .75rem; }
.moc-balance-line { font-family: var(--fontfam-term); font-variant-numeric: tabular-nums; }
.moc-estimates { margin: 12px 0 0; padding: 0; }
.moc-estimates > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--terminal-rule); font-size: .75rem; line-height: 1.5; color: var(--text-soft); }
.moc-estimates dt, .moc-estimates dd { margin: 0; }
.moc-estimates dd { max-width: 60%; text-align: right; color: var(--text); font-family: var(--fontfam-term); font-variant-numeric: tabular-nums slashed-zero; overflow-wrap: anywhere; }
#moc-reference-fees > .moc-help { margin: 10px 0 0; font-size: .75rem; }
#moc-reference-fees > .moc-help:first-child + .moc-disclosure { margin-top: 6px; }
#moc-reference-fees .moc-disclosure { border-top: 0; }
.moc-fees > summary { color: var(--text-soft); font-weight: 500; }
#moc-reference-fees:has(.moc-disclosure) + .moc-advanced, .moc-estimates + .moc-advanced { margin-top: 0; }
.moc-advanced { margin-top: 0; border-bottom: 1px solid var(--terminal-rule); }
.moc-advanced-summary { max-width: 60%; margin-left: auto; text-align: right; color: var(--text-muted); font-size: .6875rem; font-weight: 400; }
.moc-advanced > summary::after { margin-left: 8px; }
.moc-advanced[open] { padding-bottom: 20px; }
.moc-advanced > .moc-help { font-size: .75rem; }
.moc-minimum { padding-top: 4px; }
.moc-minimum-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 6px 0 0; font-size: .8125rem; }
.moc-minimum-heading label { color: var(--text-soft); }
.moc-minimum-heading output { font-family: var(--fontfam-term); font-variant-numeric: tabular-nums; color: var(--text); }
/* The tolerance rule: ticks hang from the range's hairline, under its thumb, at whole and half percents. */
.moc-minimum input[type="range"] { position: relative; z-index: 1; }
.moc-scale { display: flex; justify-content: space-between; margin-top: -21px; padding: 0 calc(var(--range-thumb) / 2); pointer-events: none; }
.moc-scale > span { position: relative; display: flex; justify-content: center; width: 0; padding-top: 12px; color: var(--text-muted); font: .6875rem/1.4 var(--fontfam-term); font-variant-numeric: tabular-nums; white-space: nowrap; }
.moc-scale > span::before { content: ""; position: absolute; top: 0; left: -.5px; width: 1px; height: 3px; background: var(--rule-strong); }
.moc-scale > span:nth-child(odd)::before { height: 6px; background: var(--rule-bright); }
.moc-scale > span:first-child { justify-content: flex-start; }
.moc-scale > span:last-child { justify-content: flex-end; }
.moc-minimum:has(input:disabled) .moc-scale { opacity: .5; }
.moc-minimum .moc-help { margin: 8px 0 0; font-size: .75rem; }
.moc-expiry-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.moc-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.moc-fields input, .moc-expiry-row input, .moc-expiry-row select { min-height: 44px; font-size: .875rem; }
.moc-ticket-note { margin: 12px 0 0; font-size: .75rem; }
#moc-place-button { width: 100%; min-height: 48px; margin-top: 16px; font-size: .9375rem; }
#moc-page.moc-page #moc-place-button[data-side="sell"]:not(:disabled) { background: var(--danger-soft-fill); border-color: var(--danger-soft-fill); color: var(--on-danger-soft); }
#moc-page.moc-page #moc-place-button[data-side="sell"]:not(:disabled):hover { background: var(--danger-soft-hover); border-color: var(--danger-soft-hover); }
#moc-order-gate { margin: 12px 0 0; min-height: 0; font-size: .75rem; }
.moc-trigger-field:has(+ .moc-trigger-distance:not([hidden])) { margin-bottom: 0; }
.moc-trigger-distance { margin: 8px 0 16px; font-size: .75rem; }
.moc-trigger-distance[hidden] { display: none; }
#moc-order-gate:empty { display: none; }
/* Order flow tracker. */
.moc-order-progress { scroll-margin-block: 90px; margin: 16px 0 0; padding-top: 16px; border-top: 1px solid var(--terminal-rule); }
.moc-order-progress .aera-journey { margin-bottom: 18px; }
.moc-order-progress h3 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: .9375rem; }
.moc-flow-wait { display: contents; }
.moc-order-progress:is([data-status="error"], [data-status="paused"], [data-status="pending"]) h3 { color: var(--network-label); }
.moc-order-progress[data-status="complete"] h3 { color: var(--positive); }
.moc-order-progress .moc-help { margin: 6px 0 0; }
#moc-flow-transaction .btn { margin-top: 10px; }
.moc-order-progress[data-status="paused"][data-funding="ready"] h3 { color: var(--text); }
.moc-funding-gate { display: grid; justify-items: start; gap: 10px; margin-top: 16px; }
.moc-funding-gate[hidden] { display: none; }
.moc-funding-gate .moc-warning { margin: 0; font-size: .8125rem; line-height: 1.55; }
.moc-transaction-recovery { max-width: 640px; margin-block: 20px 8px; }
.moc-cancel-recovery { margin-top: 12px; }
.moc-cancel-recovery .moc-help { margin: 0 0 10px; }
.moc-transaction-recovery .moc-actions { margin-top: 12px; }
.moc-transaction-recovery .moc-actions .btn { margin: 0; display: inline-flex; align-items: center; gap: 8px; }
.moc-history-gap { font-size: .8125rem; }

/* ---------- Orders: the main pane ---------- */
.moc-orders-workspace { display: block; }
.moc-orders-browser { padding: 4px var(--pane-x) 24px; }
/* The status filter (the shared quiet key) leads; the page label and its state sit at the right in column-head type. */
.moc-orders-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0 16px; min-height: 44px; padding: 0; margin: 0; border-bottom: 1px solid var(--terminal-rule); }
.moc-orders-page { display: flex; align-items: center; gap: 12px; min-height: 44px; margin-left: auto; }
.moc-orders-columns, .moc-order-row { display: grid; grid-template-columns: 104px 60px minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, 1fr) 92px 92px 20px; gap: 12px; align-items: center; }
.moc-orders-columns { padding: 12px 12px 10px; border-bottom: 1px solid var(--rule-strong); font: var(--colhead); letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
/* Column heads sort the loaded page with Trading's sort control; numeric heads keep their label on the right edge. */
.moc-orders-columns .table-sort-btn { justify-self: start; letter-spacing: inherit; text-transform: inherit; }
.moc-orders-columns .table-sort-btn.moc-sort-numeric { justify-self: end; flex-direction: row-reverse; }
.moc-orders-workspace:has(#moc-orders:empty) .moc-orders-columns, .moc-orders-workspace:has(.moc-orders-empty) .moc-orders-columns { display: none; }
.moc-order-list { list-style: none; padding: 0; margin: 0; max-height: 720px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--rule-strong) transparent; }
.moc-order-list li { margin: 0; padding: 0; }
.moc-order-row { min-height: 52px; width: 100%; padding: 10px 12px; margin: 0; border: 0; border-bottom: 1px solid var(--terminal-rule); border-radius: 0; background: transparent; color: var(--text); font: inherit; text-align: left; text-decoration: none; cursor: pointer; transition: background-color 150ms ease-out, box-shadow 150ms ease-out; }
.moc-order-row:hover { background: var(--terminal-control); box-shadow: inset 2px 0 0 var(--rule-bright); }
.moc-order-row[aria-current="page"] { background: var(--terminal-selected); box-shadow: inset 2px 0 0 var(--positive-fill); }
.moc-order-row:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.moc-order-cell { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.moc-order-numeric { align-items: flex-end; text-align: right; }
.moc-order-side { align-items: flex-start; }
.moc-cell-label { display: none; }
.moc-order-date { font: .6875rem/1.4 var(--fontfam-term); color: var(--text-muted); }
.moc-order-condition { color: var(--text-muted); }
.moc-order-chevron { color: var(--text-muted); justify-self: end; }
.moc-order-chevron svg { display: block; }
.moc-order-direction { color: var(--text-muted); display: inline-block; margin-inline: 4px; }
.moc-orders-pagination { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; }
.moc-orders-pagination > span { flex: 1 1 100%; color: var(--text-muted); font: .75rem/1.5 var(--fontfam-term); }
.moc-orders-pagination > span:empty { display: none; }
.moc-orders-pagination > .btn { padding-inline: 16px; }
.moc-orders-empty { padding: 56px 20px; text-align: center; }
.moc-orders-empty > svg { color: var(--rule-bright); margin-bottom: 16px; }
.moc-orders-empty h3 { margin: 0; font-size: 1rem; font-weight: 500; }
.moc-orders-empty .moc-help { max-width: 42ch; margin: 10px auto 20px; }
.moc-order-skeleton { height: 52px; background: var(--terminal-control); border-radius: 4px; margin-top: 12px; }
/* Selected order: a detail pane above the list, so a long list never pushes it out of view. */
.moc-order-inspector { padding: 4px var(--pane-x) 28px; border-bottom: 1px solid var(--terminal-rule); }
.moc-orders-workspace[data-selected="false"] .moc-order-inspector, .moc-orders-workspace[data-empty="true"]:not([data-selected="true"]) .moc-order-inspector { display: none; }
/* Before access is unlocked the access panel is the main pane's empty state. */
.moc-orders-workspace[data-locked="true"] .moc-orders-browser { display: none; }
.moc-orders-workspace[data-locked="true"] .moc-order-inspector { border-bottom: 0; }
#moc-page.moc-page .moc-orders-workspace .moc-order-ticket { padding: 0; border: 0; border-radius: 0; background: transparent; }
.moc-order-ticket-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 44px; margin: 0 0 20px; border-bottom: 1px solid var(--terminal-rule); }
.moc-order-back { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; color: var(--text-muted); min-height: 44px; padding: 0; font: 500 .75rem/1.5 var(--font-sans); cursor: pointer; text-decoration: none; }
.moc-order-back:hover:not(:disabled) { color: var(--text); }
.moc-order-back:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.moc-when-narrow { display: none; }
.moc-order-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0; }
.moc-order-primary { padding-right: 40px; min-width: 0; }
.moc-order-secondary { padding-left: 40px; border-left: 1px solid var(--terminal-rule); min-width: 0; }
.moc-order-ticket-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; }
.moc-order-ticket-heading h3 { display: flex; align-items: center; gap: 10px; margin: 0; font-family: var(--font-display); font-weight: 650; font-size: 1.375rem; letter-spacing: -.015em; }
.moc-order-ticket-heading h3:focus { outline: none; }
.moc-order-amounts { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin: 0 0 16px; }
.moc-order-amounts dt { margin-bottom: 6px; }
.moc-order-amounts dd { margin: 0; font-family: var(--font-display); font-stretch: 72%; font-weight: 600; font-size: 1.5rem; line-height: 1.1; letter-spacing: -.005em; font-feature-settings: "tnum" 1, "lnum" 1; overflow-wrap: anywhere; }
.moc-order-trigger { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px 16px; padding-block: 12px; border-block: 1px solid var(--terminal-rule); }
.moc-order-trigger strong { font: 700 .9375rem/1.5 var(--fontfam-term); overflow-wrap: anywhere; }
.moc-order-ticket .moc-metrics > div { padding-block: 10px; }
.moc-order-ticket h4 { font-size: .875rem; font-weight: 500; margin: 20px 0 10px; }
.moc-order-secondary > section:first-child > h4 { margin-top: 0; }
.moc-order-management .moc-actions { margin-top: 0; gap: 8px; }
.moc-order-management .moc-actions > .btn { flex: 1 1 100%; font-size: .8125rem; }
.moc-order-management .moc-order-cancel { border-color: var(--rule-bright); }
.moc-order-management .moc-order-cancel:hover:not(:disabled) { color: var(--danger); border-color: var(--danger); background: transparent; }
.moc-order-explanation { font-size: .8125rem; line-height: 1.6; margin-block: 16px; }
.moc-order-terms { margin-top: 20px; }
.moc-order-terms > .moc-order-label { margin: 12px 0 6px; }
.moc-order-attempts h4 { display: flex; align-items: center; justify-content: space-between; }
.moc-order-attempts h4 > span { color: var(--text-muted); font-family: var(--fontfam-term); font-variant-numeric: tabular-nums; }
.moc-attempt { padding-block: 14px; border-bottom: 1px solid var(--terminal-rule); }
.moc-attempt strong { font-weight: 500; }
.moc-order-attempts .moc-attempt:last-child { border-bottom: 0; padding-bottom: 0; }
.moc-attempt-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; font-size: .8125rem; margin-bottom: 6px; }
.moc-attempt-heading > span { color: var(--text-muted); }
.moc-order-ticket .moc-tx { max-width: 100%; overflow-wrap: anywhere; }
.moc-order-placeholder { min-height: 200px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 32px 0; }
.moc-order-placeholder h3 { margin: 0; font-weight: 500; font-size: 1rem; }
.moc-order-placeholder .moc-help { max-width: 32ch; }
.moc-order-inspector #moc-retry-form { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--terminal-rule); max-width: 560px; }
.moc-order-inspector #moc-retry-form h3 { margin-top: 0; }

/* ---------- Execution balance: the main pane's funds view ---------- */
.moc-funds-main { padding: 4px var(--pane-x) 32px; }
.moc-funds-lead { display: flex; flex-direction: column; gap: 6px; padding: 12px 0 20px; border-bottom: 1px solid var(--terminal-rule); }
.moc-funds-figure { display: flex; align-items: baseline; gap: 10px; }
#moc-funds-figure { font-family: var(--font-display); font-stretch: 72%; font-weight: 600; font-size: 2.5rem; line-height: 1; letter-spacing: -.01em; font-feature-settings: "tnum" 1, "lnum" 1; }
.moc-funds-unit { font: 400 .8125rem/1.5 var(--fontfam-term); color: var(--text-soft); }
.moc-amount-usd { text-align: right; }
#moc-funds-figure-meta { margin: 2px 0 0; font-family: var(--fontfam-term); font-size: .75rem; font-variant-numeric: tabular-nums; }
.moc-funds-main .moc-fund-history { padding: 8px 0 0; }
.moc-funds-main .moc-fund-history h3 { display: flex; align-items: center; min-height: 44px; margin: 0 0 4px; border-bottom: 1px solid var(--terminal-rule); font-size: .9375rem; }
.moc-funds-main > details.moc-disclosure { margin-top: 12px; }
.moc-funds-main .moc-disclosure > .moc-help:first-of-type { margin-top: 0; }
.moc-fund-empty { margin: 0; padding: 16px 0; }
.moc-transfer-list { list-style: none; margin: 0; padding: 0; }
.moc-transfer-list > li { border-bottom: 1px solid var(--terminal-rule); }
.moc-transfer-row > summary { display: grid; grid-template-columns: minmax(0, 1fr) auto 16px; align-items: center; gap: 12px; min-height: 52px; padding: 10px 0; cursor: pointer; list-style: none; }
.moc-transfer-row > summary::-webkit-details-marker { display: none; }
.moc-transfer-row > summary::marker { content: ""; }
.moc-transfer-row > summary strong { font: .875rem/1.5 var(--fontfam-term); font-variant-numeric: tabular-nums; color: var(--text); overflow-wrap: anywhere; }
.moc-transfer-row > summary svg { width: 16px; height: 16px; color: var(--text-muted); }
.moc-transfer-row[open] > summary svg { transform: rotate(180deg); }
.moc-transfer-row > summary:hover { color: var(--text); }
.moc-transfer-row > summary:focus-visible { outline: 1px solid var(--focus); outline-offset: 4px; border-radius: 0; }
.moc-transfer-label { max-width: 20ch; font: var(--colhead); letter-spacing: .04em; text-transform: uppercase; text-align: right; color: var(--text-soft); }
.moc-transfer-label.moc-positive { color: var(--positive); }
.moc-transfer-label.moc-warning { color: var(--danger); }
.moc-transfer-detail { padding: 0 0 16px; max-width: 560px; }
.moc-transfer-detail .moc-metrics { margin-top: 0; }
.moc-transfer-detail .moc-tx { display: inline-block; margin: 0 16px 0 0; }
.moc-transfer-recipient { overflow-wrap: anywhere; }
.moc-transfer-more { border-top: 0; }

/* ---------- Funds ticket ---------- */
.moc-funds-ticket .moc-fund-modes { margin-bottom: 20px; }
.moc-funds-ticket form h3 { margin: 0 0 6px; font-size: 1rem; }
.moc-funds-ticket form > .moc-help:first-of-type { margin: 0 0 16px; }
.moc-funds-ticket form > .moc-primary { width: 100%; margin-top: 16px; min-height: 48px; }
.moc-funds-ticket form > .moc-field { margin-top: 4px; }
.moc-fund-footnote { margin: 12px 0 0; font-size: .75rem; }
.moc-funding-tracker { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--terminal-rule); }
.moc-funding-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; }
.moc-funding-heading strong, .moc-deposit-list strong { font: .8125rem/1.5 var(--fontfam-term); color: var(--text); }
.moc-funding-state { margin: 8px 0; color: var(--text-soft); font-size: .8125rem; }
.moc-funding-tracker .aera-steps { margin: 12px 0; }
.moc-funding-meter { display: block; appearance: none; width: 100%; height: 3px; overflow: hidden; border: 0; border-radius: 0; background: var(--terminal-rule); color: var(--positive); }
.moc-funding-meter::-webkit-progress-bar { background: var(--terminal-rule); }
.moc-funding-meter::-webkit-progress-value { background: var(--positive); }
.moc-funding-meter::-moz-progress-bar { background: var(--positive); }
.is-stale .moc-funding-meter { color: var(--text-muted); }
.is-stale .moc-funding-meter::-webkit-progress-value { background: var(--text-muted); }
.is-stale .moc-funding-meter::-moz-progress-bar { background: var(--text-muted); }
.moc-funding-explanation { margin: 10px 0 0; font-size: .75rem; }
.moc-deposit-list { list-style: none; margin: 0; padding: 0; }
.moc-deposit-list li { padding: 12px 0; border-top: 1px solid var(--terminal-rule); }
.moc-deposit-list li > div { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; }
.moc-deposit-list .moc-tx { display: inline-block; margin-top: 8px; }
#moc-deposit-recovery { display: grid; gap: 12px; }
#moc-deposit-recovery:empty { display: none; }
#moc-deposit-status, #moc-withdraw-status { margin: 16px 0 0; }
#moc-withdraw-recovery:empty { display: none; }
#moc-withdraw-recovery { margin-top: 16px; }
#moc-deposit-button, #moc-funding-progress, #moc-withdraw-button, #moc-withdraw-progress { scroll-margin-bottom: calc(var(--activity-clearance, 80px) + 16px); }
#moc-withdraw-capacity { margin-top: 16px; }
#moc-withdraw-capacity .moc-warning { font-size: .8125rem; }
.moc-withdraw-review { border-top: 1px solid var(--terminal-rule); margin-top: 24px; padding-top: 20px; }
.moc-withdraw-review > h3 { margin-top: 0; }
.moc-funds-ticket:has(#moc-withdraw-form[hidden]) .moc-withdraw-review { border-top: 0; margin-top: 0; padding-top: 0; }
.moc-withdraw-review > .moc-help { overflow-wrap: anywhere; }
.moc-withdraw-review .moc-actions > .btn { flex: 1 1 100%; }

/* ---------- Footer ---------- */
.moc-footer { margin: 0; padding: 12px var(--pane-x) 20px; border-top: 1px solid var(--terminal-rule); font-size: .75rem; color: var(--text-muted); }
.moc-footer > p { margin: 0; }
.moc-footer .moc-disclosure { border: 0; margin: 0; }
.moc-footer .moc-disclosure > summary { min-height: 40px; color: var(--text-soft); }
.moc-service { max-width: 720px; }

/* ---------- Responsive ---------- */
@media (max-width: 1240px) {
  .moc-frame { grid-template-columns: minmax(0, 1fr) 340px; }
  .moc-market-figures { gap: 24px; }
  .moc-orders-columns, .moc-order-row { grid-template-columns: 96px 56px minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, 1fr) 88px 88px 20px; gap: 10px; }
}
@media (max-width: 1100px) {
  .moc-order-body { grid-template-columns: minmax(0, 1fr); }
  .moc-order-primary { padding-right: 0; }
  .moc-order-secondary { margin-top: 24px; padding: 20px 0 0; border-left: 0; border-top: 1px solid var(--terminal-rule); }
  .moc-order-secondary > section:first-child > h4 { margin-top: 0; }
}
@media (max-width: 960px) {
  .moc-frame { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .moc-frame > .moc-side, .moc-frame > .moc-main { grid-column: auto; grid-row: auto; }
  .moc-side { padding: 4px var(--pane-x) 28px; }
  .moc-side .aera-balances { container-type: inline-size; }
  .moc-market-bar { gap: 12px 24px; }
  .moc-market-heading { flex: 1 1 100%; }
  .moc-market-figures { gap: 20px; }
}
@media (max-width: 760px) {
  .moc-market-figures { flex-wrap: wrap; gap: 12px 20px; }
  /* Cell labels replace the column heads on phones, so the heads become a scrollable row of sort controls, as on Trading. */
  /* Positioned, so the screen-reader sort states inside the scrolling chips stay clipped by it instead of widening the page. */
  .moc-orders-columns { position: relative; display: flex; gap: 8px; padding: 12px 0 16px; overflow-x: auto; scrollbar-width: none; }
  .moc-orders-columns > span { display: none; }
  /* The filter strip takes the full width and scrolls sideways; the page label sits beneath it. */
  .moc-orders-toolbar { flex-direction: column; align-items: stretch; }
  .moc-orders-page { margin-left: 0; }
  .moc-orders-columns .table-sort-btn, .moc-orders-columns .table-sort-btn.moc-sort-numeric { flex: none; flex-direction: row; min-height: 44px; padding: 0 12px; border: 1px solid var(--terminal-rule); border-radius: 6px; white-space: nowrap; font: .75rem/1.5 Geist, sans-serif; color: var(--text-soft); }
  .moc-orders-columns .table-sort-btn.active { border-color: var(--text-muted); color: var(--text); }
  .moc-orders-columns .table-sort-btn:focus-visible { outline-offset: -2px; }
  .moc-order-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; padding: 16px 8px; align-items: start; }
  .moc-order-row .moc-order-cell { gap: 4px; }
  .moc-order-numeric { align-items: flex-start; text-align: left; }
  .moc-cell-label { display: block; font: var(--colhead); letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
  .moc-order-chevron { display: none; }
  .moc-order-list { max-height: none; }
  .moc-orders-workspace[data-selected="false"] .moc-order-inspector,
  .moc-orders-workspace[data-selected="true"] .moc-orders-browser { display: none; }
  .moc-order-inspector { border-bottom: 0; }
  .moc-when-narrow { display: inline-flex; }
  .moc-when-wide { display: none; }
  .moc-order-body { grid-template-columns: minmax(0, 1fr); }
  .moc-start { padding: 32px var(--pane-x) 28px; }
  .moc-start-actions .btn { flex: 1 1 100%; min-width: 0; }
  .moc-fields, .moc-expiry-row { grid-template-columns: minmax(0, 1fr); }
  .moc-transfer-row > summary { gap: 8px; }
  .moc-transfer-label { max-width: 16ch; }
  #moc-section-orders { scroll-margin-top: 20px; }
}
/* The shared section-jump bar (Trading's), with two destinations here. */
@media (max-width: 768px) {
  .moc-page .moc-jump-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .moc-frame > :is(#moc-side, #moc-main) { scroll-margin-top: calc(var(--aera-sticky-height, 56px) + 48px); }
}
@media (max-width: 440px) {
  .moc-metrics > div { flex-wrap: wrap; gap: 4px 12px; }
  .moc-metrics dd { max-width: 100%; }
  .moc-actions > .btn { flex: 1 1 auto; }
  .moc-page .moc-tabs .aera-page-nav-link svg { display: none; }
  #moc-funds-figure { font-size: 2rem; }
}
@media (prefers-reduced-motion: reduce) {
  .moc-page button, .moc-page a, .moc-order-row, .moc-price-input { transition: none; }
}
