/* 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(--text); 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); color: var(--on-positive); border-color: var(--positive); font-weight: 600; }
.moc-page .moc-primary:hover:not(:disabled) { background: var(--positive-soft); border-color: var(--positive-soft); 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-link { font-size: .8125rem; font-weight: 500; color: var(--text-soft); text-decoration: none; }
.moc-pane-link:hover { color: var(--text); text-decoration: underline; }
.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: ""; 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); }
.moc-market-bar .moc-oracle, .moc-stat { display: flex; flex-direction: column; justify-content: flex-end; 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: flex; gap: 32px; }
.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); }
.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-access-panel { display: flex; flex-direction: column; align-items: center; margin: 0; padding: 48px var(--pane-x) 36px; border-bottom: 1px solid var(--terminal-rule); text-align: center; }
.moc-access-panel > svg { color: var(--rule-bright); margin-bottom: 16px; }
.moc-access-panel h2 { margin: 0; font-size: 1rem; }
.moc-access-panel p { margin: 10px 0 20px; max-width: 42ch; color: var(--text-muted); font-size: .8125rem; line-height: 1.55; }
.moc-access-panel .btn { min-width: 200px; }

/* ---------- 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-wallet .ab-heading { display: flex; align-items: center; justify-content: space-between; min-height: 44px; margin: 0 0 8px; padding: 0; border-bottom: 1px solid var(--terminal-rule); }
.moc-side .ab-caption { min-height: 0; margin: 0 0 4px; }
.moc-side .ab-row { padding: 12px 0; }
.moc-side .ab-amount { font-size: 1rem; }
.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-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 0 0 12px; padding: 4px; border: 0; border-radius: 4px; background: var(--terminal-inset); }
.moc-side-btn { position: relative; display: flex; align-items: center; justify-content: center; min-height: 40px; border: 1px solid transparent; border-radius: 3px; color: var(--text-muted); font-size: .8125rem; font-weight: 500; letter-spacing: .01em; cursor: pointer; transition: color 150ms ease-out, background-color 150ms ease-out, border-color 150ms ease-out; }
.moc-side-btn input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; appearance: none; -webkit-appearance: none; opacity: 0; cursor: pointer; }
.moc-side-btn:hover { color: var(--text); }
.moc-side-btn--buy:has(input:checked) { background: rgb(var(--positive-rgb) / .12); border-color: rgb(var(--positive-rgb) / .5); color: var(--focus); }
.moc-side-btn--sell:has(input:checked) { background: rgb(var(--danger-soft-rgb) / .09); border-color: #934653; color: var(--danger-soft); }
.moc-side-btn:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: -2px; }
.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), .moc-price-input:hover, .moc-amount-input:hover { border-color: var(--rule-bright); }
.moc-field input:focus-visible, .moc-field select:focus-visible { border-color: var(--focus); 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; }
.moc-price-input { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 0; border: 1px solid var(--rule-strong); border-radius: 4px; background: var(--terminal-control); }
.moc-price-input > span:first-child { padding-left: 12px; color: var(--text-muted); font-family: var(--fontfam-term); }
.moc-price-input input { border: 0; background: transparent; padding-left: 6px; }
.moc-price-input:focus-within { border-color: var(--focus); }
.moc-price-input input:focus-visible { outline: 0; border: 0; }
/* Oracle and the amount currency use the shared in-field controls (board.css). */
:is(.moc-price-input, .moc-amount-input) > :is(.input-suffix-action, .input-suffix-select) { margin-right: 4px; }
.moc-amount-input { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; border: 1px solid var(--rule-strong); border-radius: 4px; background: var(--terminal-control); }
.moc-amount-input:focus-within { border-color: var(--focus); }
#moc-page.moc-page .moc-amount-input input { width: 100%; min-width: 0; 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); }
.moc-page input[type="range"] { width: 100%; height: 36px; margin: 0; cursor: pointer; }
.moc-range-ends { display: flex; justify-content: space-between; gap: 12px; margin-top: -4px; color: var(--text-muted); font: .6875rem/1.4 var(--fontfam-term); }
.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); border-color: var(--danger-soft); color: #250c12; }
#moc-page.moc-page #moc-place-button[data-side="sell"]:not(:disabled):hover { background: #ffa0ab; border-color: #ffa0ab; }
#moc-order-gate { margin: 12px 0 0; min-height: 0; font-size: .75rem; }
#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-flow-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 0; margin: 0 0 16px; list-style: none; }
.moc-flow-steps li { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; color: var(--text-muted); font: var(--colhead); letter-spacing: .04em; text-transform: uppercase; line-height: 1.4; }
.moc-flow-marker { display: grid; place-items: center; width: 22px; height: 22px; border: 1px solid var(--rule-bright); border-radius: 2px; font-variant-numeric: tabular-nums; }
.moc-flow-marker svg { display: none; width: 14px; height: 14px; }
.moc-flow-steps [data-state="current"] { color: var(--text); }
.moc-flow-steps [data-state="current"] .moc-flow-marker { color: var(--on-positive); border-color: var(--positive); background: var(--positive); }
.moc-flow-steps [data-state="done"] .moc-flow-marker { color: var(--positive); border-color: var(--positive); }
.moc-flow-steps [data-state="done"] .moc-flow-marker span { display: none; }
.moc-flow-steps [data-state="done"] .moc-flow-marker svg { display: block; }
.moc-order-progress h3 { display: flex; align-items: baseline; gap: 8px; margin: 0; font-size: .9375rem; }
.moc-order-progress[data-status="active"] h3::before { content: ""; flex: 0 0 6px; height: 6px; border-radius: 50%; background: var(--positive); animation: moc-working 1.5s ease-in-out infinite; }
.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; }
.aera-review-flow { color: var(--text-soft); font-size: .875rem; line-height: 1.6; margin: 8px 0 20px; }
@keyframes moc-working { 50% { opacity: .35; } }
.moc-transaction-recovery { max-width: 640px; margin-block: 20px 8px; }
.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; }
.moc-orders-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 44px; padding: 0; margin: 0; border-bottom: 1px solid var(--terminal-rule); font: var(--colhead); letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.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); }
.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 beneath the list. */
.moc-order-inspector { padding: 0 var(--pane-x) 32px; border-top: 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-top: 0; padding-top: 4px; }
#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-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; }
.moc-transfer-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; list-style: none; margin: 12px 0; padding: 0; }
.moc-transfer-steps li { border-top: 3px solid var(--terminal-rule); padding-top: 8px; color: var(--text-muted); font: var(--colhead); letter-spacing: .04em; text-transform: uppercase; }
.moc-transfer-steps li[data-state="done"] { border-color: var(--positive); color: var(--text-soft); }
.moc-transfer-steps li[data-state="current"] { color: var(--text); }
.is-stale .moc-transfer-steps li[data-state="done"] { border-color: var(--text-muted); }

/* ---------- Funds ticket ---------- */
.moc-mode-count { margin-left: 8px; font: .75rem/1.5 var(--fontfam-term); color: var(--text-muted); }
.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-amount { display: flex; align-items: stretch; gap: 8px; margin-top: 8px; }
.moc-fund-amount input { flex: 1; 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: 1rem/1.5 var(--fontfam-term); caret-color: var(--positive); }
.moc-fund-amount input::placeholder { color: var(--text-muted); opacity: 1; }
.moc-fund-amount input:focus-visible { border-color: var(--focus); outline: none; box-shadow: none; }
.moc-fund-amount .btn { min-width: 56px; }
.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-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-stats { 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-side { order: -1; 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-stats { gap: 20px; }
}
@media (max-width: 760px) {
  .moc-market-stats { 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. */
  .moc-orders-columns { display: flex; gap: 8px; padding: 12px 0 16px; overflow-x: auto; scrollbar-width: none; }
  .moc-orders-columns > span { display: none; }
  .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-top: 0; }
  .moc-when-narrow { display: inline-flex; }
  .moc-when-wide { display: none; }
  .moc-order-body { grid-template-columns: minmax(0, 1fr); }
  .moc-access-panel { padding: 40px var(--pane-x) 32px; }
  .moc-fields, .moc-expiry-row { grid-template-columns: minmax(0, 1fr); }
  .moc-flow-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .moc-transfer-row > summary { gap: 8px; }
  .moc-transfer-label { max-width: 16ch; }
  #moc-section-orders { scroll-margin-top: 20px; }
}
@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, .moc-side-btn { transition: none; }
  .moc-order-progress[data-status="active"] h3::before { animation: none; }
}
