/* Order panel (app/order-panel.js), docked in the right column; shares app/alerts.css, trading.css and paper.css */

.order-panel { position: relative; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.op-head { flex: none; display: flex; align-items: center; gap: 8px; padding: 12px 8px 8px 14px; }
.op-sym { font-size: 15px; }
.op-close { margin-left: auto; }
.op-tabs { flex: none; margin: 0 12px 10px; }
.op-body { flex: 1; min-height: 0; overflow-y: auto; padding: 0 12px 12px; }

/* Sell | spread | Buy */
.op-quote { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; margin-bottom: 12px; }
.op-q {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 9px 12px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.op-q.is-sell { border-radius: 10px 0 0 10px; }
.op-q.is-buy { border-radius: 0 10px 10px 0; text-align: right; align-items: flex-end; }
.op-q-label { font-size: 13px; font-weight: 600; }
.op-q-price { font-size: 17px; font-variant-numeric: tabular-nums; }
.op-q.is-sell[aria-pressed="true"] { border-color: #ef4444; background: #ef4444; color: #fff; }
.op-q.is-buy[aria-pressed="true"] { border-color: #2962ff; background: #2962ff; color: #fff; }
.op-spread {
    position: absolute;
    left: 50%;
    top: 8px;
    transform: translateX(-50%);
    padding: 2px 6px;
    border-radius: 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    pointer-events: none;
}

/* Market | Limit | Stop */
.op-types { display: flex; margin-bottom: 12px; border-bottom: 1px solid var(--border); }
.op-type {
    flex: 1;
    position: relative;
    padding: 9px 0 10px;
    border: 0;
    background: none;
    color: var(--text-muted);
    font: 500 14px/1 -apple-system, BlinkMacSystemFont, Inter, "Segoe UI", sans-serif;
    cursor: pointer;
}
.op-type:hover { color: var(--text); }
.op-type[aria-selected="true"] { color: var(--text); }
.op-type[aria-selected="true"]::after { content: ""; position: absolute; left: 18%; right: 18%; bottom: -1px; height: 2px; border-radius: 2px; background: var(--text); }

.op-label { display: flex; align-items: center; gap: 6px; margin: 10px 0 6px; padding: 0; border: 0; background: none; color: var(--text-muted); font: 13px -apple-system, BlinkMacSystemFont, Inter, "Segoe UI", sans-serif; }
.op-unit { cursor: pointer; }
.op-unit:hover { color: var(--text); }
.op-swap { display: grid; width: 15px; height: 15px; }
.op-swap svg { width: 15px; height: 15px; }
.op-field { position: relative; display: flex; align-items: center; }
.op-input {
    width: 100%;
    height: 40px;
    box-sizing: border-box;
    padding: 0 110px 0 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font: 15px -apple-system, BlinkMacSystemFont, Inter, "Segoe UI", sans-serif;
    font-variant-numeric: tabular-nums;
    outline: none;
}
.op-input:focus { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.op-input:disabled { opacity: .5; }
.op-hint { position: absolute; right: 12px; color: var(--text-muted); font-size: 12.5px; pointer-events: none; font-variant-numeric: tabular-nums; }
.op-field.is-off .op-hint { opacity: .5; }
.op-info { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: 13px; }
.op-info-row { display: flex; justify-content: space-between; color: var(--text-muted); }
.op-info-val { color: var(--text); font-variant-numeric: tabular-nums; }

.op-section { margin-top: 6px; border-top: 1px solid var(--border); }
.op-section-head { display: flex; align-items: center; width: 100%; padding: 12px 0; border: 0; background: none; color: var(--text); font: 600 14px -apple-system, BlinkMacSystemFont, Inter, "Segoe UI", sans-serif; cursor: pointer; }
.op-section-head span:first-child { flex: 1; text-align: left; }
.op-chev { display: grid; width: 18px; height: 18px; color: var(--text-muted); transition: transform .15s; transform: rotate(180deg); }
.op-chev svg { width: 18px; height: 18px; }
.op-section.is-open .op-chev { transform: none; }
.op-section-body { display: none; padding-bottom: 8px; }
.op-section.is-open .op-section-body { display: block; }
.op-exit-head { display: flex; align-items: center; justify-content: space-between; }
.op-exit-head .op-label { margin: 8px 0 6px; }
.op-exit-pnl { min-height: 14px; margin: 4px 2px 6px; font-size: 12px; font-variant-numeric: tabular-nums; }
.op-exit-pnl.is-up { color: #26a69a; }
.op-exit-pnl.is-down { color: #ef4444; }
.op-select { width: 100%; box-sizing: border-box; }
.op-note { margin: 6px 0 0; color: var(--text-muted); font-size: 12.5px; }
.op-err { margin: 8px 0 0; }
.op-err:empty { display: none; }

.op-foot { flex: none; padding: 10px 12px 12px; border-top: 1px solid var(--border); }
.op-go {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    width: 100%;
    padding: 9px 10px;
    border: 0;
    border-radius: 10px;
    color: #fff;
    font: inherit;
    cursor: pointer;
}
.op-go.is-buy { background: #2962ff; }
.op-go.is-sell { background: #ef4444; }
.op-go:hover { filter: brightness(1.08); }
.op-go:disabled { opacity: .6; cursor: default; }
.op-go-main { font-size: 16px; font-weight: 600; }
.op-go-sub { font-size: 12.5px; opacity: .9; font-variant-numeric: tabular-nums; }

/* DOM */
.op-dom-head, .op-row { display: grid; grid-template-columns: 1fr 1.1fr 1fr; }
.op-dom-head { padding: 0 2px 6px; color: var(--text-muted); font-size: 12px; text-align: center; }
.op-ladder { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.op-row { height: 22px; border-top: 1px solid var(--border); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.op-row:first-child { border-top: 0; }
.op-row.is-pos { box-shadow: inset 0 -2px 0 #2962ff; }
.op-cell {
    position: relative;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 6px;
    border: 0;
    background: none;
    color: var(--text);
    font: inherit;
    cursor: pointer;
}
.op-cell.is-bid { justify-content: flex-end; background: linear-gradient(270deg, rgba(41, 98, 255, 0.22) var(--fill, 0%), transparent var(--fill, 0%)); }
.op-cell.is-ask { justify-content: flex-start; background: linear-gradient(90deg, rgba(239, 68, 68, 0.22) var(--fill, 0%), transparent var(--fill, 0%)); }
.op-cell:hover { outline: 1px solid var(--text-muted); outline-offset: -1px; }
.op-price { display: grid; place-items: center; border-left: 1px solid var(--border); border-right: 1px solid var(--border); color: var(--text-muted); }
.op-price.is-ask { color: #ef4444; }
.op-price.is-bid { color: #26a69a; }
.op-mine { padding: 0 5px; border-radius: 4px; color: #fff; font-size: 11px; line-height: 16px; }
.op-mine.is-buy { background: #2962ff; }
.op-mine.is-sell { background: #ef4444; }
.op-dom-pos { margin: 8px 2px; color: var(--text-muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.op-dom-pos.is-up { color: #26a69a; }
.op-dom-pos.is-down { color: #ef4444; }
.op-dom-ctl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 8px; }
.op-dom-ctl .al-btn { padding: 0 6px; }
.op-dom-mkt { display: grid; grid-template-columns: 1fr 84px 1fr; gap: 6px; }
.op-dom-go { height: 38px; border: 0; border-radius: 8px; color: #fff; font: 600 14px -apple-system, BlinkMacSystemFont, Inter, "Segoe UI", sans-serif; cursor: pointer; }
.op-dom-go.is-buy { background: #2962ff; }
.op-dom-go.is-sell { background: #ef4444; }
.op-dom-qty { padding: 0 8px; text-align: center; }
