/* Scoped Stage A surfaces reuse the existing Simulator typography and palette. */
.paper-panel { position: relative; direction: rtl; width: var(--paper-width, 380px); min-width: 320px; max-width: 55%; flex-shrink: 0; min-height: 0; display: flex; flex-direction: column; border-left: 1px solid #202630; background: #0c0f14; }
.paper-panel header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; gap: 8px; border-bottom: 1px solid #202630; }
.paper-panel h2 { margin: 0; font-size: 14px; font-weight: 400; }
.paper-panel header span, .paper-panel p { color: #a7adb6; font-size: 11px; }
.paper-panel-body { padding: 16px; overflow: auto; min-height: 0; }
.paper-panel button, .paper-list-toolbar button, .paper-pagination button { min-height: 30px; padding: 4px 10px; }
.paper-panel dl { margin: 16px 0; }
.paper-panel dl > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid #202630; }
.paper-panel dt { color: #a7adb6; }
.paper-panel dd { margin: 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.paper-notice { border-inline-start: 2px solid #0067ff; padding-inline-start: 10px; }
.paper-list-toolbar, .paper-pagination { display: flex; align-items: center; gap: 12px; padding: 8px 16px; }
.paper-list-toolbar { justify-content: space-between; }
#paperStatus { margin: 8px 16px; color: #a7adb6; }
#paperStatus[data-error="true"] { color: var(--ui-error-text, #ff969e); }
#paperTableScroll { flex-shrink: 0; }
#paperRows td { padding: 10px 16px; border-bottom: 1px solid #202630; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.paper-pagination { justify-content: flex-end; margin-top: auto; }
.journal-open .paper-panel { display: none; }
.paper-panel[data-resize-overlay="true"] { position: fixed; inset: 0 0 0 auto; top: var(--paper-visible-top, 0px); height: var(--paper-visible-height, 100dvh); width: min(380px, 100%); min-width: 0; max-width: 100%; z-index: 19; box-shadow: -12px 0 32px #0008; }
@media (max-width: 768px) { .paper-panel { min-width: 0; position: fixed; inset: 0 0 0 auto; top: var(--paper-visible-top, 0px); height: var(--paper-visible-height, 100dvh); width: min(380px, 100%); max-width: 100%; z-index: 19; box-shadow: -12px 0 32px #0008; } }
/* Figma 1:353 ticket: existing dark surfaces, 34px controls, 12px rhythm. */
.paper-panel header { min-height: 50px; padding-block: 8px; }
.paper-panel-body { display: flex; flex-direction: column; gap: 12px; }
.paper-panel-body > p { margin: 0; }
.paper-ticket-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.paper-ticket-heading bdi { font: 13px ui-monospace, monospace; }
.paper-ticket-heading span { color: #a7adb6; font-size: 10px; }
#paperEntryForm fieldset { display: flex; flex-direction: column; gap: 12px; border: 0; padding: 0; margin: 0; min-width: 0; }
.paper-panel label, .paper-dialog label { display: flex; flex-direction: column; gap: 6px; color: #a7adb6; font-size: 10px; }
.paper-panel input:not([type=radio]), .paper-panel select, .paper-dialog input, .paper-history-filters input { min-width: 0; width: 100%; height: 34px; padding: 6px 10px; border: 1px solid #303844; border-radius: 5px; background: #07090c; color: #f9f9f9; font: inherit; font-size: 12px; }
.paper-panel :is(input,select):focus-visible, .paper-dialog input:focus-visible, .paper-history-filters input:focus-visible { outline: 2px solid #0067ff; outline-offset: 2px; }
.paper-input-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 10px; }
.paper-field-title { margin: 0 0 7px; }
.paper-segments.paper-sizing-modes { position: relative; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 4px; }
.paper-sizing-option { position: relative; display: flex; align-items: center; min-width: 0; }
.paper-sizing-option label { min-width: 0; }
.paper-panel .paper-sizing-tooltip { position: absolute; z-index: 5; top: calc(100% + 10px); width: calc(200% + 4px); box-sizing: border-box; margin: 0; padding: 12px 14px; border: 1px solid #34465b; border-radius: 8px; background: #19212d; color: #d4dce7; font-size: 11px; line-height: 1.9; box-shadow: 0 10px 28px #0008; visibility: hidden; pointer-events: none; }
.paper-sizing-option:nth-child(odd) > .paper-sizing-tooltip { right: 0; }
.paper-sizing-option:nth-child(even) > .paper-sizing-tooltip { left: 0; }
.paper-sizing-tooltip::before { content: ''; position: absolute; top: -6px; left: 13px; width: 10px; height: 10px; border-top: 1px solid #34465b; border-left: 1px solid #34465b; background: #19212d; transform: rotate(45deg); }
.paper-sizing-option:nth-child(odd) > .paper-sizing-tooltip::before { left: calc(50% + 15px); }
.paper-sizing-tooltip strong { display: block; margin-bottom: 4px; color: #f4f7fc; font-size: 12px; font-weight: 500; }
.paper-panel .paper-sizing-tooltip p { margin: 0; color: inherit; font-size: inherit; }
.paper-sizing-option:has(.paper-sizing-info:is(:hover,:focus-visible)) > .paper-sizing-tooltip { visibility: visible; }
.paper-sizing-info { position: relative; z-index: 2; display: grid; place-items: center; flex: 0 0 18px; width: 18px; height: 18px; box-sizing: border-box; margin-inline-start: auto; border: 1px solid #566373; border-radius: 50%; font: 500 12px/1 ui-serif,serif; color: #a7adb6; cursor: help; }
.paper-sizing-info:is(:hover,:focus-visible) { color: #9ccaff; border-color: #609deb; background: #112642; outline: none; }
.paper-sizing-option label > span { padding-inline: 9px; }
.paper-sizing-modes span { gap: 6px; font-size: 11px; }
.paper-sizing-modes small { font-size: 10px; opacity: .7; }
.paper-sizing-modes input:checked + span { box-shadow: inset 0 0 0 1px #46556d; }
.paper-sizing-entry { display: grid; grid-template-columns: minmax(0,1fr) 80px; gap: 10px; }
.paper-input-unit { position: relative; display: flex; align-items: center; }
.paper-panel .paper-input-unit input { padding-right: 54px; }
.paper-input-unit > span { position: absolute; right: 10px; color: #a7adb6; font-size: 10px; pointer-events: none; }
.paper-protection { border-top: 1px solid #202630; padding-top: 12px; }
.paper-protection h3 { margin: 0 0 10px; color: #f9f9f9; font-size: 11px; font-weight: 400; }
.paper-protection small { color: #a7adb6; font-size: 9px; }
#paperSLRequired[data-required=true] { color: #f0bd70; }
.paper-segments { display: flex; gap: 3px; background: #07090c; padding: 3px; border-radius: 5px; }
.paper-segments label { flex: 1; position: relative; cursor: pointer; color: #a7adb6; }
.paper-segments input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.paper-segments span { min-height: 30px; display: flex; align-items: center; justify-content: center; border-radius: 3px; }
.paper-segments input:checked + span { background: #161b23; color: #f9f9f9; }
.paper-directions input[value=long]:checked + span { background: #0e3025; color: #2ecf8b; }
.paper-directions input[value=short]:checked + span { background: #321820; color: #ff5b68; }
.paper-segments input:focus-visible + span { outline: 2px solid #0067ff; }
.paper-segments input:disabled + span { opacity: .45; }
.paper-panel details summary { cursor: pointer; color: #a7adb6; font-size: 11px; }
.paper-panel details[open] > summary { margin-bottom: 12px; }
.paper-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.paper-estimate-status { display: flex; align-items: center; gap: 8px; }
.paper-estimate-status p { flex: 1; }
.paper-panel #paperPreviewRetry { flex-shrink: 0; min-height: 28px; padding: 2px 6px; border: 0; background: transparent; color: #9ccaff; font-size: 10px; text-decoration: underline; text-underline-offset: 3px; }
.simulator-page .paper-primary { background: #0067ff; border-color: #0067ff; min-height: 34px; }
.paper-panel .paper-hint, #paperPreviewStatus { font-size: 10px; color: #a7adb6; line-height: 1.8; margin: 0; }
.paper-panel dl:empty { display: none; }
.paper-panel dl { margin: 0; }
.paper-panel dl > div { padding-block: 5px; }
.paper-recovery { padding: 12px; border: 1px solid #9b7544; border-radius: 5px; background: #231e16; }
.paper-recovery h3 { margin: 0 0 8px; font-size: 12px; }
#paperFormError, #paperMutationStatus[data-error=true], #paperEligibility[data-error=true], #paperPreviewStatus[data-error=true] { color: var(--ui-error-text, #ff969e); }
.paper-dialog { width: min(620px,calc(100vw - 24px)); }
.paper-dialog dl > div, .paper-report-values > div { display: grid; grid-template-columns: minmax(100px,1fr) minmax(0,2fr); gap: 12px; padding: 6px 0; border-bottom: 1px solid #202630; }
.paper-dialog :is(dd,dt) { margin: 0; overflow-wrap: anywhere; }
.paper-dialog dt { color: #a7adb6; }
.paper-dialog h3 { margin: 16px 0 8px; }
.paper-dialog .paper-input-grid { margin-block: 16px; }
.paper-history-filters { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; padding: 0 16px 8px; }
.paper-history-filters label { display: flex; flex-direction: column; gap: 4px; }
.paper-history-filters input { direction: ltr; width: 200px; }
.paper-report-values { padding: 0 16px; display: grid; grid-template-columns: repeat(auto-fit,minmax(260px,1fr)); gap: 4px 20px; }
#paperRows td { min-width: 100px; }
#paperTableScroll table { table-layout: auto; }
#paperTableScroll :is(th, td) { text-align: center; }
.paper-row-actions { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.paper-row-actions button { min-height: 30px; padding-inline: 8px; }
.paper-profit { color: #2ecf8b; } .paper-loss { color: #ff5b68; }
@media(max-width:768px) { .paper-panel-body { padding: 12px; } .paper-history-filters { align-items: stretch; } .paper-history-filters label { flex: 1; min-width: 150px; } .paper-history-filters input { width: 100%; } }

#paperPlace { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }

.paper-history-filters select { min-height: 34px; padding-inline: 8px; }
#paperHistoryAdvanced > summary { cursor: pointer; }

.simulator-metric > [data-paper-metric] { overflow-wrap: anywhere; white-space: normal; }

.paper-panel :is(input,select)[aria-invalid="true"] { border-color: var(--ui-error-text, #ff969e); }

/* The action sits outside the scroll area so it never overlays ticket fields. */
.paper-panel-body { flex: 1 1 auto; }
.paper-submit-footer { flex: 0 0 auto; padding: 8px 12px max(8px, env(safe-area-inset-bottom)); border-top: 1px solid #303844; background: #0c0f14; }
.paper-submit-footer p { margin: 0 0 6px; line-height: 1.5; }
.paper-submit-footer button { width: 100%; min-height: 42px; }
.paper-panel label, .paper-panel .paper-hint, #paperPreviewStatus { font-size: 12px; color: #c2cad5; }
.paper-panel input:not([type=radio]), .paper-panel select { height: 40px; font-size: 16px; }
.paper-panel .paper-segments label > span { min-height: 38px; font-size: 12px; }
.paper-sizing-info { flex-basis: 18px; }
#paperSLRequired[data-required=true] { font-size: 11px; }
#paperDraftSummary:not(:empty) { padding: 6px 10px; border: 1px solid #303844; border-radius: 6px; background: #111720; }
[data-pnl="profit"] { color: #2ecf8b; }
[data-pnl="loss"] { color: #ff5b68; }
#paperOrderHistoryTab, #openJournal { border-inline-start: 1px solid #303844; }
#paperRows td:first-child { font-weight: 600; }
#paperRows td[data-pnl] { white-space: nowrap; font-weight: 600; }
