:root {
  color-scheme: light;
  --bg: #fff;
  --surface: #fff;
  --surface-raised: #f9fafb;
  --border: #edf0f3;
  --muted: #8b95a1;
  --text: #333d4b;
  --blue: #3182f6;
  --blue-dark: #1b64da;
  --blue-soft: #eef5ff;
  --green: #15966b;
  --green-dark: #edf9f3;
  --red: #e5484d;
  --red-dark: #fff0f1;
  --amber: #a66b11;
  --amber-dark: #fff8e8;
  --radius: 6px;
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Segoe UI", sans-serif;
  font-size: 13px;
  font-synthesis: none;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: -.2px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
body { margin: 0; }
button, input, select { font: inherit; letter-spacing: inherit; }
button, a, input, select, summary { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; transition: background .14s ease, color .14s ease, border-color .14s ease; }
button:disabled { cursor: not-allowed; opacity: .45; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 20px; font-weight: 700; line-height: 1.4; letter-spacing: -.5px; color: #191f28; }
h2 { font-size: 14px; font-weight: 650; letter-spacing: -.2px; color: #191f28; }
h3 { font-size: 13px; font-weight: 600; color: #333d4b; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
input, select {
  width: 100%; min-height: 32px; padding: 5px 9px;
  border: 1px solid #e5e8eb; border-radius: 6px;
  color: var(--text); background: #fff; outline: none;
  transition: border-color .14s ease, background .14s ease, box-shadow .14s ease;
}
input::placeholder { color: #aeb5bd; }
input:hover:not(:disabled), select:hover:not(:disabled) { border-color: #c9cfd6; }
input:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px #3182f61a; }
input:disabled, select:disabled { cursor: not-allowed; color: #8b95a1; background: #f9fafb; }
input[type=radio] { width: 15px; height: 15px; min-height: 0; accent-color: var(--blue); flex-shrink: 0; box-shadow: none; }
input[type=number] { font-variant-numeric: tabular-nums; }
label { font-size: 13px; font-weight: 500; }
pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font: 12px/1.8 ui-monospace, SFMono-Regular, Menlo, monospace; color: #6b7684; }
fieldset { padding: 0; margin: 0; border: 0; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th { padding: 7px 10px; background: #f9fafb; color: #6b7684; font-size: 12px; font-weight: 500; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--border); }
td { padding: 8px 10px; font-size: 13px; border-bottom: 1px solid var(--border); white-space: nowrap; }
tbody tr:hover { background: #fafbfc; }
tbody tr:last-child td { border-bottom: 0; }
td strong { font-weight: 600; }
td small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
[hidden] { display: none !important; }
.align-right { text-align: right; }
.muted { color: var(--muted); }
.positive { color: var(--green) !important; }
.negative { color: var(--red) !important; }
.warning-text { color: var(--amber) !important; }
.eyebrow { display: block; color: var(--muted); font-size: 11px; font-weight: 500; letter-spacing: .5px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: -60px; left: 16px; padding: 10px 16px; background: var(--blue); color: #fff; border-radius: 8px; z-index: 100; }
.skip-link:focus { top: 8px; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 30px; padding: 5px 10px; border: 0; border-radius: 5px; font-size: 12px; font-weight: 600; line-height: 1.5; white-space: nowrap; }
.button.primary { color: #fff; background: var(--blue); }
.button.primary:hover:not(:disabled) { background: var(--blue-dark); }
.button.secondary { color: #4e5968; background: #f2f4f6; }
.button.secondary:hover:not(:disabled) { background: #e8ebee; }
.button.quiet { color: #8b95a1; background: transparent; }
.button.quiet:hover:not(:disabled) { color: #4e5968; background: #f2f4f6; }
.button.danger { color: var(--red); background: var(--red-dark); }
.button.danger:hover:not(:disabled) { background: #ffe0e3; }
.button.small { min-height: 24px; padding: 3px 7px; font-size: 12px; border-radius: 4px; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 5px; color: #8b95a1; background: transparent; font-size: 18px; flex-shrink: 0; }
.icon-button:hover:not(:disabled) { color: var(--text); background: #f2f4f6; }
.icon-button svg { width: 16px; height: 16px; }
.text-link { color: #6b7684; font-size: 12px; white-space: nowrap; }
.text-link:hover { color: var(--blue); }
.pill { display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 1px 5px; border-radius: 4px; font-size: 11px; font-weight: 500; line-height: 1.5; white-space: nowrap; }
.pill.positive { background: var(--green-dark); }
.pill.negative { background: var(--red-dark); }
.pill.warning { color: var(--amber); background: var(--amber-dark); }
.pill.neutral { color: #8b95a1; background: #f2f4f6; }
.pill.info { color: var(--blue); background: var(--blue-soft); }
.subtle-tag { display: inline-flex; color: #8b95a1; font-size: 11px; font-weight: 400; white-space: nowrap; }
.status-dot { display: inline-block; width: 6px; height: 6px; background: #b0b8c1; border-radius: 50%; flex-shrink: 0; }
.status-dot.accent { background: #20b984; }
.status-dot.warning { background: #e5a746; }
.status-dot.error { background: var(--red); }

.brand { display: inline-flex; align-items: center; gap: 7px; color: #191f28; font-size: 18px; font-weight: 750; line-height: 1; letter-spacing: -.5px; }
.brand-mark { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 23px; height: 24px; border-radius: 6px; background: var(--blue); color: #fff; font-size: 17px; font-weight: 750; letter-spacing: -1px; }
.brand-mark span { display: none; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 10; width: 172px; padding: 17px 10px 12px; background: #f9fafb; border-right: 1px solid var(--border); display: flex; flex-direction: column; }
.sidebar .brand { margin: 0 8px 22px; font-size: 15px; white-space: nowrap; }
.nav-label { margin: 0 12px 12px; font-size: 10px; letter-spacing: .8px; color: #aeb5bd; }
.main-nav { display: flex; flex-direction: column; gap: 3px; }
.nav-link { display: flex; align-items: center; gap: 8px; position: relative; padding: 7px 9px; min-height: 34px; color: #6b7684; border-radius: 5px; font-size: 13px; font-weight: 500; white-space: nowrap; }
.nav-link:hover { color: #333d4b; background: #f0f2f5; }
.nav-link.active { color: var(--blue); background: #eaf2ff; font-weight: 600; }
.nav-link>span:first-child:not(.nav-count) { width: 20px; text-align: center; font-size: 19px; line-height: 1; }
.nav-icon { width: 16px; height: 16px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav-count { margin-left: auto; min-width: 16px; padding: 0 4px; color: var(--blue); background: #dceaff; border-radius: 4px; font-size: 10px; text-align: center; }
.sidebar-bottom { margin-top: auto; }
.market-home-link { display: flex; align-items: center; gap: 8px; min-height: 36px; margin-bottom: 12px; color: #6b7684; font-size: 13px; }
.server-indicator { display: flex; align-items: center; gap: 6px; padding: 9px 8px; margin-bottom: 8px; border-bottom: 1px solid #e9edf1; }
.server-indicator strong { display: block; color: #8b95a1; font-size: 11px; font-weight: 400; }
.server-indicator div>span { display: block; margin-top: 3px; color: #b0b8c1; font-size: 9px; letter-spacing: .5px; }
.admin-account { display: flex; align-items: center; gap: 7px; padding: 0 5px; }
.avatar { display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; color: #6b7684; background: #e9edf1; border-radius: 50%; font-size: 11px; }
.admin-account>div, .admin-account>strong { flex: 1; min-width: 0; }
.admin-account strong { display: block; overflow: hidden; text-overflow: ellipsis; font-size: 12px; font-weight: 500; }
.admin-account div>span { color: #a2aab4; font-size: 10px; }
.app-shell { margin-left: 172px; min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: 0 20px; gap: 12px; border-bottom: 1px solid var(--border); }
.breadcrumb { display: flex; align-items: center; gap: 12px; color: #a2aab4; font-size: 12px; }
.breadcrumb>span { color: #d1d6db; }
.breadcrumb>strong { color: #6b7684; font-weight: 400; }
.topbar>strong { color: #8b95a1; font-size: 13px; font-weight: 400; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.environment-badge { padding: 3px 7px; border-radius: 5px; color: #6b7684; background: #f2f4f6; font-size: 11px; }
.refresh-status { display: flex; align-items: center; gap: 7px; color: #a2aab4; font-size: 11px; }
main#main { max-width: none; margin: 0 auto; padding: 16px 20px 24px; outline: none; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; min-height: 28px; }
.page-heading>div { min-width: 0; }
.page-heading .eyebrow { margin-bottom: 6px; }
.page-heading p.muted { margin-top: 8px; color: #8b95a1; font-size: 13px; }
.page-heading h1 { display: flex; align-items: center; gap: 6px; }
.heading-dot { display: none; }
.count { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; padding: 0 4px; color: #8b95a1; background: #f2f4f6; border-radius: 4px; font-size: 11px; font-weight: 500; line-height: 1.5; letter-spacing: 0; }
#signals-count { color: #8b95a1; background: transparent; font-size: 13px; padding: 0; }
.execution-strip { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; padding: 7px 10px; border-radius: 5px; background: #f9fafb; }
.execution-status { display: flex; align-items: center; gap: 7px; min-width: 0; color: #6b7684; font-size: 12px; }
.execution-status strong { color: #4e5968; font-weight: 500; white-space: nowrap; }
.execution-status>span:last-child { color: #8b95a1; }
.divider { width: 1px; height: 12px; display: inline-block; margin: 0 4px; background: #e5e8eb; }
.metric-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 0; margin: 0 0 20px; padding: 0 0 14px; border-bottom: 1px solid var(--border); }
.metric-card { position: relative; min-width: 0; padding: 3px 16px 0; border-right: 1px solid var(--border); }
.metric-card:first-child { padding-left: 0; }
.metric-card:last-child { padding-right: 0; border-right: 0; }
.metric-label { display: flex; align-items: center; justify-content: space-between; gap: 5px; color: #8b95a1; font-size: 12px; }
.metric-unit { color: #aeb5bd; font-size: 10px; }
.metric-value { margin-top: 5px; color: #191f28; font-size: 24px; font-weight: 650; line-height: 1.4; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.metric-value .unit { margin-left: 6px; color: #8b95a1; font-size: 13px; font-weight: 400; letter-spacing: 0; }
.metric-card p { margin-top: 3px; color: #a2aab4; font-size: 11px; }
.metric-card p .text-link { font-size: 11px; }
.panel { min-width: 0; margin-bottom: 20px; background: #fff; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 26px; padding: 0 0 7px; }
.section-title { display: flex; align-items: center; gap: 6px; }
.panel-note { color: #a2aab4; font-size: 11px; white-space: nowrap; }
.table-wrap { width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }
.empty-state { padding: 24px 12px; color: #a2aab4; text-align: center; white-space: normal; }
.empty-state .empty-icon { display: none; }
.empty-state strong { display: block; color: #8b95a1; font-size: 13px; font-weight: 400; }
.empty-state p { margin-top: 7px; color: #aeb5bd; font-size: 12px; }
.empty-state.compact { padding: 20px 12px; }
.product-cell { display: flex; align-items: center; gap: 6px; }
.asset-icon { display: none; align-items: center; justify-content: center; width: 30px; height: 30px; flex-shrink: 0; color: #6b7684; background: #f2f4f6; border-radius: 50%; font-size: 14px; font-weight: 600; }
.product-text { display: flex; flex-direction: row; gap: 7px; align-items: center; flex-wrap: wrap; }
.product-name { color: #333d4b; font-size: 13px; font-weight: 600; }
.product-meta { display: flex; align-items: center; gap: 5px; color: #a2aab4; font-size: 11px; }
.product-cell .pill { padding: 1px 4px; font-size: 10px; }
.overview-bottom { display: grid; grid-template-columns: minmax(0,1.85fr) minmax(260px,1fr); gap: 24px; }
.connection-row { display: flex; align-items: center; gap: 8px; padding: 7px 0; }
.connection-row+.connection-row { border-top: 1px solid var(--border); }
.service-logo { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; background: #f2f4f6; color: #6b7684; border-radius: 8px; font-size: 19px; }
.telegram-logo { color: #3182f6; background: #eef5ff; }
.connection-row>div:first-child { flex: 1; }
.connection-row strong { display: block; font-size: 13px; font-weight: 500; }
.connection-row div>span { display: block; margin-top: 2px; color: #a2aab4; font-size: 11px; }
.connection-footer { margin-top: 3px; padding: 7px 0 0; border-top: 1px solid var(--border); color: #a2aab4; font-size: 11px; }
.connection-footer p { margin-bottom: 4px; line-height: 1.5; overflow-wrap: anywhere; }
.connection-footer>span { display: flex; justify-content: space-between; gap: 8px; }
.connection-footer strong { color: #8b95a1; font-weight: 400; }

/* Compact navigation and editable tables keep the focus on the data. */
.signals-header { display: flex; align-items: center; gap: 24px; margin-bottom: 10px; }
.signals-header .page-heading { flex-shrink: 0; margin-bottom: 0; }
.signals-header h1 { white-space: nowrap; }
.signal-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 0; flex: 1; min-width: 0; }
.tabs { display: flex; flex-wrap: wrap; gap: 2px; }
.tab { min-height: 28px; padding: 4px 9px; color: #8b95a1; background: transparent; border: 0; border-radius: 5px; font-size: 12px; font-weight: 500; }
.tab.active { color: var(--blue); background: var(--blue-soft); font-weight: 600; }
.tab:hover:not(.active) { color: #4e5968; background: #f9fafb; }
.search-field { display: flex; align-items: center; gap: 4px; width: 210px; min-height: 28px; padding-left: 8px; color: #8b95a1; background: #f9fafb; border: 1px solid transparent; border-radius: 5px; flex-shrink: 0; }
.search-field>svg { width: 16px; height: 16px; flex-shrink: 0; }
.search-field input { min-width: 0; min-height: 26px; padding: 3px 6px; color: #4e5968; background: transparent; border: 0; box-shadow: none; font-size: 12px; }
.search-field:focus-within { border-color: #9fc6fc; background: #fff; }
.signal-hint { margin: 0 0 8px; color: #8b95a1; font-size: 11px; line-height: 1.5; }
.signal-table-wrap { max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); scrollbar-width: thin; scrollbar-color: #d1d6db #f9fafb; }
.signal-table { width: 100%; min-width: 1122px; table-layout: fixed; }
.signal-table th { padding: 7px 8px; color: #6b7684; background: #fafbfc; font-size: 12px; }
.signal-table th:nth-child(1) { width: 96px; padding-left: 10px; }
.signal-table th:nth-child(2) { width: 106px; }
.signal-table th:nth-child(3) { width: 66px; }
.signal-table th:nth-child(4) { width: 60px; }
.signal-table th:nth-child(5) { width: 68px; }
.signal-table th:nth-child(6), .signal-table th:nth-child(7), .signal-table th:nth-child(10) { width: 100px; }
.signal-table th:nth-child(8) { width: 58px; }
.signal-table th:nth-child(9) { width: 66px; }
.signal-table th:nth-child(11) { width: 70px; }
.signal-table th:nth-child(12) { width: 96px; }
.signal-table th:nth-child(13) { width: 106px; text-align: right; padding-right: 8px; }
.signal-table th:last-child { position: sticky; right: 0; z-index: 2; background: #fafbfc; }
.signal-row>td { height: 36px; padding: 3px 6px; font-size: 13px; vertical-align: middle; background: #fff; transition: background .14s ease; }
.signal-row>td:first-child { padding-left: 10px; }
.signal-row>td:last-child { position: sticky; right: 0; z-index: 1; padding-right: 8px; background: #fff; }
.signal-row:hover>td { background: #fafbfc; }
.signal-row.is-dirty>td { background: #f8fbff; }
.signal-row.is-dirty>td:first-child { box-shadow: inset 2px 0 var(--blue); }
.signal-row.is-expanded>td { border-bottom-color: transparent; }
.signal-row.is-busy { cursor: progress; }
.signal-row.is-busy .cell-input { opacity: .6; }
.signal-time { color: #8b95a1; font-size: 12px; font-variant-numeric: tabular-nums; line-height: 1.7; }
.signal-time small, .signal-time span { display: block; margin: 0; color: #a2aab4; font-size: 10px; }
.signal-time time { display: block; }
.signal-symbol { font-weight: 600; color: #333d4b; }
.cell-field { display: flex; align-items: center; min-width: 0; min-height: 28px; position: relative; border-radius: 4px; }
.cell-input { display: block; width: 100%; min-width: 0; min-height: 28px; height: 28px; padding: 3px 5px; border: 1px solid transparent; border-radius: 4px; outline: none; background: transparent; color: #4e5968; font-size: 13px; line-height: 18px; font-variant-numeric: tabular-nums; }
.cell-input:hover:not(:disabled) { background: #f0f3f7; border-color: transparent; }
.cell-input:focus { color: #191f28; background: #fff; border-color: var(--blue); box-shadow: 0 0 0 2px #3182f615; }
.cell-input:disabled { color: #6b7684; background: transparent; cursor: default; opacity: 1; }
.cell-input::placeholder { color: #b0b8c1; opacity: 1; }
.cell-input[aria-invalid=true] { border-color: #f5b2b5; background: #fff7f7; }
input.cell-input[type=number] { appearance: textfield; -moz-appearance: textfield; }
input.cell-input::-webkit-inner-spin-button, input.cell-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
select.cell-input { padding-right: 2px; cursor: pointer; }
.cell-unit { color: #a2aab4; font-size: 11px; padding-right: 4px; flex-shrink: 0; }
.cell-field:has(.cell-unit) .cell-input { padding-right: 1px; }
.signal-table td:nth-child(2) .cell-input { font-weight: 600; color: #333d4b; }
.signal-table td:nth-child(4) .cell-input, .signal-table td:nth-child(5) .cell-input, .signal-table td:nth-child(8) .cell-input { text-align: right; }
.signal-table td.signal-actions { display: table-cell; text-align: right; white-space: nowrap; }
.signal-table td.signal-actions .button+.button { margin-left: 4px; }
.signal-actions .button.small { padding: 3px 7px; min-height: 24px; font-size: 12px; }
.signal-actions .button.quiet { padding-left: 6px; padding-right: 6px; }
.signal-table td.signal-status { display: table-cell; padding-left: 10px; vertical-align: middle; font-size: 10px; }
.signal-status .pill { padding: 1px 5px; font-size: 11px; }
.draft-marker { display: inline-block; margin: 0 0 1px 4px; color: var(--blue); font-size: 0; font-weight: 400; width: 5px; height: 5px; background: var(--blue); border-radius: 50%; vertical-align: middle; }
.row-more { min-width: 24px; font-size: 15px !important; letter-spacing: 1px; }
.signal-detail-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.signal-detail>.button { margin-bottom: 8px; }
.signal-detail .saved-plan { margin-top: 12px; }
.signal-table .field-inst_id { font-weight: 600; }
.signal-row>td.field-inst_id:not(.editable-cell), .signal-row>td.field-direction:not(.editable-cell), .signal-row>td.field-price:not(.editable-cell), .signal-row>td.field-price_end:not(.editable-cell), .signal-row>td.field-sl:not(.editable-cell), .signal-row>td.field-margin_mode:not(.editable-cell) { padding-left: 12px; }
.signal-table .field-leverage, .signal-table .field-allocation_pct, .signal-table .field-split_count { text-align: right; padding-right: 10px; }
.signal-plan-summary { margin-top: 3px; color: #8b95a1; font-size: 10px; }
.row-error { display: block; margin-top: 5px; max-width: 210px; color: var(--red); font-size: 11px; line-height: 1.5; white-space: normal; overflow-wrap: anywhere; }
.signal-detail-row>td { padding: 0 10px 10px; background: #fafbfc; white-space: normal; border-bottom: 1px solid var(--border); }
.signal-detail { padding: 12px; max-width: 1160px; color: #6b7684; background: #f5f7fa; border-radius: 5px; }
.signal-detail h3 { margin-bottom: 8px; font-size: 13px; }
.signal-detail>p { margin: 6px 0; color: #8b95a1; font-size: 12px; line-height: 1.5; }
.signal-detail .raw-details { margin-bottom: 0; background: transparent; }
.signal-detail .order-preview { margin-top: 14px; background: #fff; }
.signal-detail pre { max-height: 240px; overflow-y: auto; }
.signal-detail .banner { margin-bottom: 12px; }
.signal-detail .row-error { max-width: none; }
.signal-list, .recent-signal-list { min-height: 72px; }
.recent-signal-row { display: grid; grid-template-columns: minmax(110px,1fr) 50px minmax(100px,1fr) 100px 75px; align-items: center; gap: 14px; padding: 8px 0; border-bottom: 1px solid var(--border); color: #6b7684; font-size: 13px; }
.recent-signal-row:last-child { border-bottom: 0; }
.recent-signal-row strong { color: #333d4b; font-weight: 600; }
.recent-signal-row>.pill { justify-self: start; }
.recent-signal-row time { font-size: 11px; text-align: right; }
.recent-signal-price { font-variant-numeric: tabular-nums; }
.recent-signal-row:hover { background: #fafbfc; }
.history-pagination { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; font-size: 11px; }
.history-pagination .button { min-height: 26px; font-size: 11px; }

.audit-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.audit-item:first-child { border-top: 1px solid var(--border); }
.audit-item:last-child { border-bottom: 0; }
.audit-dot { width: 6px; height: 6px; margin-top: 7px; border-radius: 50%; background: #c2c8d0; flex-shrink: 0; }
.audit-item>div { flex: 1; min-width: 0; }
.audit-item strong { display: block; font-size: 13px; font-weight: 500; }
.audit-item p { margin-top: 3px; color: #8b95a1; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.audit-item time { color: #a2aab4; font-size: 11px; white-space: nowrap; }
.settings-layout { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(240px,1fr); align-items: start; gap: 32px; max-width: 940px; }
.settings-panel { padding: 0; }
.settings-panel .panel-heading { padding-bottom: 10px; }
.mode-options { display: grid; flex-direction: column; gap: 8px; grid-template-columns: 1fr 1fr; }
.distribution-options { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mode-option { display: flex; align-items: flex-start; gap: 8px; padding: 10px; border: 1px solid #edf0f3; border-radius: 6px; background: #fff; cursor: pointer; }
.mode-option:hover { background: #fafbfc; }
.mode-option:has(input:checked) { border-color: #a9cdff; background: #f8fbff; }
.mode-option input { margin: 2px 0 0; }
.option-content { display: flex; flex-direction: column; gap: 3px; }
.option-content>strong { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.option-content>span { color: #8b95a1; font-size: 12px; font-weight: 400; line-height: 1.5; }
.settings-help { margin-top: 7px; color: #8b95a1; font-size: 12px; line-height: 1.6; }
.settings-divider { height: 1px; margin: 17px 0; background: var(--border); }
.settings-panel h3 { margin-bottom: 7px; }
.settings-panel select { font-size: 13px; }
.settings-panel input[name=default_split_count] { max-width: 100px; }
.settings-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--border); }
.settings-actions>span { font-size: 12px; }
.settings-aside .panel { margin-bottom: 18px; }
.note-panel { padding: 0; }
.note-panel h3 { margin-bottom: 7px; }
.note-panel .eyebrow { margin-bottom: 10px; font-size: 10px; }
.note-panel p { margin-top: 6px; color: #8b95a1; font-size: 12px; line-height: 1.6; }
.settings-details { padding: 10px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.settings-details summary { color: #6b7684; cursor: pointer; font-size: 13px; font-weight: 500; }
.settings-details[open] summary { margin-bottom: 12px; }
.settings-details p { margin-top: 6px; color: #8b95a1; font-size: 12px; line-height: 1.6; }
.server-details { margin: 0; }
.server-details>div { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 12px; }
.server-details dt { color: #8b95a1; }
.server-details dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.banner { margin-bottom: 12px; padding: 8px 10px; border: 0; border-radius: 5px; font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.banner.warning { color: var(--amber); background: var(--amber-dark); }
.banner.info { color: #4e7bbb; background: var(--blue-soft); }
.inline-error { padding: 7px 10px; color: var(--red); background: var(--red-dark); border: 0; border-radius: 5px; font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.app-footer { display: flex; justify-content: space-between; gap: 15px; padding: 23px 0 0; margin-top: 12px; color: #b0b8c1; border-top: 1px solid var(--border); font-size: 10px; }
.footer-separator { margin: 0 9px; color: #d1d6db; }

.modal { width: calc(100% - 32px); max-width: 500px; max-height: calc(100dvh - 48px); padding: 0; overflow: auto; color: var(--text); background: #fff; border: 0; border-radius: 10px; box-shadow: 0 16px 64px #191f2826; }
.modal::backdrop { background: #191f2860; }
.modal-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 12px; }
.modal-heading .eyebrow { margin-bottom: 5px; }
.modal-heading h2 { font-size: 17px; }
.modal-body { padding: 0 20px 16px; }
.modal-body>.banner { margin-bottom: 20px; }
.modal-body>.inline-error { margin-top: 16px; }
.modal-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 20px 18px; }
.modal-footer>div { display: flex; gap: 8px; }
.raw-details { margin-bottom: 12px; border: 0; border-radius: 5px; background: #f9fafb; }
.raw-details summary { padding: 7px 9px; color: #8b95a1; font-size: 12px; cursor: pointer; }
.raw-details pre { max-height: 180px; padding: 0 9px 9px; overflow: auto; }
.order-preview { margin-top: 12px; padding: 12px; border: 0; border-radius: 5px; background: #f8fbff; }
.order-preview h3 { margin-bottom: 8px; color: #4e7bbb; font-size: 13px; }
.preview-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; }
.preview-grid>div { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; color: #8b95a1; font-size: 11px; }
.preview-grid strong { color: #4e5968; font-weight: 500; white-space: nowrap; }
.order-preview>p { margin-top: 8px; color: #8b95a1; font-size: 11px; line-height: 1.6; }
.order-preview .preview-grid { margin-bottom: 5px; }
.saved-plan { background: #f9fafb; }
.saved-plan h3 { color: #4e5968; }
.plan-summary { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.split-preview-count { margin: 0 0 13px !important; font-size: 12px; }
.split-orders-wrap { max-height: 320px; margin-top: 10px; overflow: auto; overscroll-behavior: contain; border: 1px solid var(--border); border-radius: 5px; }
.split-orders-table th { position: sticky; top: 0; z-index: 1; padding: 7px 9px; background: #f5f7fa; font-size: 11px; text-align: right; }
.split-orders-table td { padding: 7px 9px; background: #fff; font-size: 12px; text-align: right; }
.split-orders-table th:first-child, .split-orders-table td:first-child { color: #8b95a1; text-align: left; }
.split-orders-table .split-order-status { min-width: 135px; max-width: 230px; text-align: left; white-space: normal; }
.split-order-status small { font-size: 10px; overflow-wrap: anywhere; }
.split-order-id { color: #a2aab4; }
.confirm-modal { max-width: 380px; }
.confirm-modal .modal-heading h2 { font-size: 17px; }
.confirm-modal .modal-body>p { color: #6b7684; font-size: 13px; line-height: 1.7; white-space: pre-line; }
.confirm-modal .modal-footer { justify-content: flex-end; }
.toast-region { position: fixed; right: 24px; bottom: 24px; z-index: 100; width: calc(100% - 48px); max-width: 430px; pointer-events: none; }
.toast { padding: 10px 14px; color: #fff; background: #333d4b; border-radius: 6px; box-shadow: 0 6px 20px #191f2814; font-size: 12px; line-height: 1.6; animation: toast-in .18s ease-out; }
.toast.error { background: #a33239; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.login-page { min-height: 100dvh; background: #fff; }
.login-shell { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 100dvh; padding: 28px 20px; }
.login-card { width: 100%; max-width: 300px; margin: 0 auto; padding: 0; background: #fff; }
.login-card>.brand { margin-bottom: 24px; }
.login-card>.eyebrow { margin-bottom: 10px; }
.login-card h1, .login-card h2 { color: #191f28; font-size: 22px; font-weight: 700; line-height: 1.4; letter-spacing: -.5px; }
.login-card>p { margin-top: 10px; color: #8b95a1; font-size: 14px; }
.login-card form { margin-top: 20px; }
.login-card label { display: block; margin-bottom: 6px; color: #4e5968; font-size: 12px; }
.login-card input { min-height: 36px; padding: 7px 10px; font-size: 13px; }
.login-card form>input { margin-bottom: 14px; }
.password-field { position: relative; }
.password-field input { padding-right: 60px; }
.password-toggle { position: absolute; top: 4px; right: 5px; height: 28px; padding: 0 8px; color: #8b95a1; background: transparent; border: 0; border-radius: 4px; font-size: 12px; }
.password-toggle:hover { background: #f2f4f6; }
.login-submit { width: 100%; min-height: 36px; margin-top: 18px; font-size: 13px; }
.login-submit>span:last-child:not(:first-child) { margin-left: auto; font-size: 18px; font-weight: 400; }
.login-card .inline-error { margin-top: 18px; }
.login-security { display: flex; gap: 10px; margin-top: 25px; color: #a2aab4; }
.login-security>span { font-size: 19px; }
.login-security>p { font-size: 11px; line-height: 1.8; }
.login-note { margin-top: 22px; color: #a2aab4; font-size: 12px; text-align: center; }

@media (max-width: 1100px) {
  .signals-header { flex-wrap: wrap; gap: 10px 18px; }
  .signals-header .signal-toolbar { flex-basis: 100%; }
  .overview-bottom { gap: 18px; grid-template-columns: minmax(0,1.6fr) minmax(230px,1fr); }
  .settings-layout { gap: 24px; }
  .metric-card { padding-left: 12px; padding-right: 12px; }
  .metric-label .subtle-tag { display: none; }
}
@media (max-width: 900px) {
  .overview-bottom { grid-template-columns: minmax(0,1fr); gap: 0; }
  .connection-panel { display: grid; grid-template-columns: 1fr 1fr; column-gap: 24px; }
  .connection-panel .panel-heading, .connection-panel .connection-footer { grid-column: 1/-1; }
  .connection-row+.connection-row { border-top: 0; }
  .metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px 0; }
  .metric-card:nth-child(2) { border-right: 0; padding-right: 0; }
  .metric-card:nth-child(3) { padding-left: 0; }
  .settings-layout { grid-template-columns: minmax(0,1fr); gap: 6px; }
  .settings-aside { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
  .execution-status>span:last-child { display: none; }
}
/* The same navigation, fields and actions are rearranged only on phones. */
.mobile-action-label { display: none; }
@media (max-width: 760px) {
  :root { --mobile-nav-height: 68px; }
  html { scroll-padding-bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom) + 20px); }
  body:not(.login-page) { background: #f5f7fa; }
  .sidebar { position: relative; inset: auto; width: 100%; min-height: 64px; padding: calc(16px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 16px max(16px, env(safe-area-inset-left)); background: #fff; border-right: 0; border-bottom: 1px solid var(--border); }
  .sidebar .brand { margin: 4px 0; font-size: 17px; align-self: flex-start; }
  .nav-label { display: none; }
  .main-nav { position: fixed; inset: auto 0 0; z-index: 30; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; min-height: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom)); margin: 0; padding: 6px max(8px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); background: #fff; border-top: 1px solid #e5e8eb; box-shadow: 0 -4px 20px #191f2808; }
  .main-nav .nav-link { flex-direction: column; justify-content: center; gap: 4px; min-width: 0; min-height: 55px; padding: 6px 0; border: 0; border-radius: 10px; font-size: 11px; line-height: 1.4; }
  .main-nav .nav-link.active { background: var(--blue-soft); }
  .main-nav .nav-icon { width: 22px; height: 22px; }
  .nav-count { position: absolute; top: 1px; left: calc(50% + 7px); margin: 0; min-width: 17px; max-width: 36px; padding: 1px 4px; border: 2px solid #fff; border-radius: 10px; background: var(--blue); color: #fff; font-size: 10px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; }
  .sidebar-bottom { position: absolute; top: calc(10px + env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); display: flex; align-items: center; gap: 8px; margin: 0; }
  .market-home-link { min-height: 44px; margin-bottom: 0; font-size: 12px; }
  .sidebar-bottom .server-indicator, .admin-account>div, .admin-account>strong, .admin-account .avatar { display: none; }
  .admin-account { padding: 0; }
  .app-shell { margin-left: 0; }
  .topbar { min-height: 48px; padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left)); gap: 8px; background: #fff; }
  .topbar>strong { font-size: 12px; }
  .topbar-right { gap: 6px; }
  .refresh-status { gap: 4px; font-size: 10px; }
  .environment-badge { font-size: 11px; }
  main#main { padding: 20px max(16px, env(safe-area-inset-right)) calc(var(--mobile-nav-height) + env(safe-area-inset-bottom) + 24px) max(16px, env(safe-area-inset-left)); }
  h1 { font-size: 22px; }
  h2 { font-size: 15px; }
  .button, .button.small, .signal-actions .button.small, .history-pagination .button { min-height: 44px; padding: 10px 14px; font-size: 13px; border-radius: 9px; }
  .icon-button { width: 44px; height: 44px; border-radius: 10px; }
  .icon-button svg { width: 20px; height: 20px; }
  input, select, .settings-panel select, .cell-input, .search-field input, .assets-filter select { min-height: 44px; font-size: 16px; }
  input, select { scroll-margin-block: 80px; }
  input[type=radio] { min-height: 0; width: 18px; height: 18px; }
  .text-link { display: inline-flex; align-items: center; min-height: 44px; font-size: 12px; }
  .page-heading { gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
  .page-heading>.button { margin-left: auto; }
  .execution-strip { align-items: flex-start; padding: 12px 14px; margin-bottom: 14px; background: #fff; border-radius: 12px; }
  .execution-status { display: grid; grid-template-columns: 6px minmax(0, 1fr); gap: 6px 8px; padding-top: 4px; font-size: 12px; }
  .execution-status>span:last-child { display: block; grid-column: 2; font-size: 12px; line-height: 1.6; }
  .execution-status .status-dot { align-self: center; }
  .execution-strip>.text-link { margin-top: -4px; }
  .metric-grid { gap: 10px; margin-bottom: 20px; padding: 0; border: 0; }
  .metric-grid .metric-card { padding: 14px 12px; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
  .metric-label { align-items: flex-start; flex-wrap: wrap; justify-content: flex-start; gap: 2px 6px; color: #6b7684; font-size: 12px; }
  .metric-label .subtle-tag { display: inline-flex; }
  .metric-unit { font-size: 10px; }
  .metric-value { font-size: clamp(20px, 5.8vw, 26px); overflow-wrap: anywhere; }
  .metric-card p { font-size: 11px; }
  .metric-card p .text-link { min-height: 28px; }
  .panel { padding: 14px; margin-bottom: 16px; border: 1px solid var(--border); border-radius: 14px; }
  .panel-heading { padding-bottom: 12px; flex-wrap: wrap; }
  .panel-note { white-space: normal; }
  .empty-state { padding: 24px 12px; }
  .empty-state strong { line-height: 1.6; }
  .signals-header { gap: 12px; margin-bottom: 12px; }
  .signals-header .page-heading { flex: 1; margin: 0; }
  .signals-header .signal-toolbar { display: flex; flex-direction: column; gap: 12px; }
  .signals-header .search-field { order: -1; width: 100%; min-height: 46px; padding-left: 12px; background: #fff; border-color: #e5e8eb; border-radius: 10px; }
  .search-field input { padding: 8px; }
  .tabs { gap: 4px; }
  .tab { min-height: 44px; padding: 9px 12px; font-size: 13px; border-radius: 9px; }
  .signals-header .tabs { width: 100%; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px; padding: 4px; background: #e9edf2; border-radius: 12px; }
  .signals-header .tab { padding-inline: 2px; font-size: 12px; }
  .signals-header .tab.active { background: #fff; box-shadow: 0 1px 3px #191f2810; }
  .signal-hint { margin-bottom: 14px; font-size: 12px; line-height: 1.7; }
  #page-signals>.panel { padding: 0; background: transparent; border: 0; }
  .signal-table-wrap { width: 100%; max-width: 100%; margin: 0; overflow: visible; border: 0; }
  .recent-signal-row { grid-template-columns: minmax(0, 1fr) auto auto; gap: 7px 10px; padding: 12px 0; font-size: 13px; }
  .recent-signal-row .recent-signal-price { grid-row: 2; grid-column: 1 / 3; }
  .recent-signal-row time { display: block; grid-row: 2; grid-column: 3; }
  .recent-signal-row>.pill { justify-self: end; font-size: 11px; }
  .history-pagination { flex-wrap: wrap; padding: 12px 0; }
  .history-pagination .button { width: 100%; }
  .connection-panel { display: block; }
  .connection-row { gap: 10px; padding: 12px 0; }
  .connection-row+.connection-row { border-top: 1px solid var(--border); }
  .connection-row div>span { font-size: 12px; }
  .connection-footer { padding-top: 12px; font-size: 12px; }
  .settings-layout { gap: 0; }
  .settings-panel { padding: 16px; }
  .mode-options { grid-template-columns: minmax(0, 1fr); }
  .mode-option { padding: 14px; border-radius: 10px; }
  .option-content>strong { font-size: 14px; }
  .settings-help, .option-content>span, .note-panel p, .settings-details p { font-size: 13px; line-height: 1.7; }
  .settings-actions { flex-wrap: wrap; }
  .settings-actions .button { width: 100%; }
  .settings-aside { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .settings-details summary, .raw-details summary { min-height: 44px; padding-block: 12px; }
  .audit-item { display: grid; grid-template-columns: 6px minmax(0, 1fr); gap: 4px 10px; padding: 14px 0; }
  .audit-item time { grid-column: 2; font-size: 11px; }
  .audit-item p { font-size: 13px; line-height: 1.7; }
  .modal { width: calc(100% - 24px); max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); border-radius: 16px; }
  .modal-heading { padding: 12px 16px; }
  .modal-body { padding: 0 16px 16px; }
  .modal-footer { padding: 12px 16px 16px; flex-wrap: wrap; }
  .modal-footer .button { flex: 1; white-space: normal; }
  .preview-grid { grid-template-columns: minmax(0, 1fr); }
  .preview-grid>div { flex-wrap: wrap; }
  .preview-grid strong { white-space: normal; overflow-wrap: anywhere; }
  .split-orders-wrap { max-height: 270px; }
  .toast-region { right: max(16px, env(safe-area-inset-right)); bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom) + 12px); width: calc(100% - 32px); }
  .login-shell { padding: 24px; }
  .login-card input { min-height: 48px; font-size: 16px; }
  .password-toggle { top: 2px; height: 44px; }
  .login-submit { min-height: 48px; }

  /* Keep one set of table cells and controls, including their event handlers. */
  .mobile-card-table { display: block; min-width: 0; table-layout: auto; }
  .mobile-card-table>thead { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .mobile-card-table>tbody { display: block; width: 100%; }
  .mobile-card-table>tbody>tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); }
  .mobile-card-table>tbody>tr:last-child { border-bottom: 0; }
  .mobile-card-table>tbody>tr:hover { background: transparent; }
  .mobile-card-table>tbody>tr>td { display: block; position: static; min-width: 0; height: auto; padding: 0; border: 0; background: transparent; text-align: left; white-space: normal; overflow-wrap: anywhere; font-size: 14px; }
  .mobile-card-table>tbody>tr>td::before { content: attr(data-label); display: block; margin-bottom: 5px; color: #8b95a1; font-size: 11px; font-weight: 400; }
  .mobile-card-table>tbody>tr>td:first-child, .mobile-card-table>tbody>tr>td[colspan], .mobile-card-table>tbody>tr>td[data-label="관리"] { grid-column: 1 / -1; }
  .mobile-card-table>tbody>tr>td[colspan]::before, .mobile-card-table>tbody>tr>td[data-label="관리"]::before { display: none; }
  .mobile-card-table td[data-label="관리"]>.button { width: 100%; }
  .mobile-card-table .product-name { font-size: 15px; }
  .mobile-card-table td small { font-size: 12px; }
  .signal-table>tbody>.signal-row { gap: 12px 14px; margin-bottom: 12px; padding: 14px; background: #fff; border: 1px solid #e5e8eb; border-radius: 14px; }
  .signal-table>tbody>.signal-row.is-dirty { border-color: #aacfff; }
  .signal-table .signal-row>td[class] { position: static; padding: 0; text-align: left; background: transparent; }
  .signal-table>tbody>.signal-row>td:first-child { grid-column: auto; box-shadow: none; }
  .signal-table>tbody>.signal-row>.field-margin_mode { grid-column: 1 / -1; }
  .signal-table>tbody>.signal-row>.signal-time { order: -2; align-self: center; font-size: 11px; }
  .signal-table>tbody>.signal-row>.signal-status { order: -1; align-self: center; text-align: right; }
  .signal-table>tbody>.signal-row>.signal-time::before, .signal-table>tbody>.signal-row>.signal-status::before { display: none; }
  .signal-status .pill { padding: 4px 7px; font-size: 11px; }
  .cell-field { min-height: 44px; background: #f5f7fa; }
  .cell-input { height: 44px; padding: 8px 10px; background: #f5f7fa; border-color: #edf0f3; border-radius: 7px; line-height: 1.5; }
  .cell-input:disabled { background: #f5f7fa; }
  .cell-unit { padding-right: 8px; font-size: 12px; }
  .signal-table .cell-input { text-align: left !important; }
  .signal-table>tbody>.signal-row>.signal-actions { display: flex; gap: 8px; padding-top: 12px; border-top: 1px solid var(--border); }
  .signal-table td.signal-actions .button+.button { margin-left: 0; }
  .signal-table td.signal-actions .button { flex: 1; width: auto; }
  .signal-actions .button.quiet { padding-inline: 10px; color: #4e5968; background: #f2f4f6; }
  .row-more { font-size: 13px !important; letter-spacing: 0; }
  .desktop-action-label { display: none; }
  .mobile-action-label { display: inline; }
  .signal-row:has(+ .signal-detail-row:not([hidden])) { margin-bottom: 0; border-bottom: 0; border-radius: 14px 14px 0 0; }
  .signal-table>tbody>.signal-detail-row { display: block; margin-bottom: 12px; padding: 0 14px 14px; border: 1px solid #e5e8eb; border-top: 0; border-radius: 0 0 14px 14px; background: #fff; }
  .signal-detail { position: static; width: auto; max-width: 100%; padding: 12px; border-radius: 8px; }
  .signal-detail-actions { gap: 8px; }
  .signal-detail-actions .button { flex: 1 1 auto; }
  .signal-detail .order-preview { padding: 10px; }
  .signal-detail>p { font-size: 13px; }
  .assets-ledger>tbody>tr>td:nth-child(2) { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

.assets-heading { align-items: center; gap: 16px; }
.assets-heading p { margin-top: 5px; font-size: 12px; }
.assets-heading .tabs { flex-shrink: 0; }
.assets-sync { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: -2px 0 18px; color: var(--muted); font-size: 11px; }
.assets-metrics { margin-top: 20px; margin-bottom: 26px; }
.assets-metrics .metric-value { font-variant-numeric: tabular-nums; font-size: clamp(21px, 2.1vw, 30px); overflow-wrap: anywhere; }
.assets-analysis { display: grid; grid-template-columns: minmax(0, 2.6fr) minmax(240px, 1fr); gap: 24px; margin-bottom: 24px; }
.assets-analysis .panel { margin-bottom: 0; padding: 18px 20px; border: 1px solid var(--border); border-radius: 10px; }
.assets-analysis .panel-heading { padding-top: 0; margin-bottom: 15px; border: 0; }
.assets-chart-summary { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; font-size: 11px; }
.assets-chart-summary>div { display: flex; flex-direction: column; gap: 4px; }
.assets-chart-summary strong { font-size: 23px; font-weight: 650; letter-spacing: -.6px; font-variant-numeric: tabular-nums; }
.assets-chart { min-height: 225px; position: relative; }
.assets-chart>.empty-state { min-height: 225px; display: flex; flex-direction: column; justify-content: center; }
.assets-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.assets-grid-line { stroke: #edf0f3; stroke-dasharray: 4 5; }
.assets-axis { fill: #8b95a1; font-size: 12px; font-variant-numeric: tabular-nums; }
.assets-line { fill: none; stroke: #3182f6; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.assets-chart-single { position: absolute; right: 10px; bottom: 35px; font-size: 11px; }
.assets-chart-inspector { display: flex; align-items: center; gap: 10px; min-height: 30px; font-size: 10px; color: var(--muted); }
.assets-chart-inspector input { flex: 1; min-width: 45px; width: auto; min-height: 24px; padding: 0; accent-color: var(--blue); border: 0; }
.assets-chart-inspector label, .assets-chart-inspector output { white-space: nowrap; }
.assets-chart-inspector output { color: #4e5968; font-variant-numeric: tabular-nums; }
.assets-note { color: var(--muted); font-size: 11px; line-height: 1.8; margin-top: 12px; }
.assets-breakdown-list { margin: 18px 0; }
.assets-breakdown-list>div { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 11px 0; font-size: 12px; }
.assets-breakdown-list dt { color: #6b7684; }
.assets-breakdown-list dd { margin: 0; font-weight: 500; font-variant-numeric: tabular-nums; }
.assets-breakdown-list .assets-breakdown-total { margin: 6px 0; padding: 15px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.assets-breakdown-total dd { font-size: 17px; font-weight: 600; }
.assets-filter select { min-height: 30px; font-size: 12px; padding: 4px 28px 4px 9px; }
.assets-ledger td:nth-child(n+4), .assets-ledger th:nth-child(n+4) { text-align: right; font-variant-numeric: tabular-nums; }
.assets-coverage { max-width: 950px; padding-top: 10px; border-top: 1px solid var(--border); }
@media (max-width: 1100px) {
  .assets-analysis { gap: 16px; grid-template-columns: minmax(0, 2fr) minmax(215px, 1fr); }
  .assets-analysis .panel { padding: 15px; }
  .assets-chart-inspector { flex-wrap: wrap; gap: 2px 10px; }
  .assets-chart-inspector output { flex-basis: 100%; text-align: right; }
}
@media (max-width: 900px) {
  .assets-analysis { grid-template-columns: minmax(0, 1fr); }
  .assets-chart { min-height: 200px; }
  .assets-breakdown-list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 28px; margin: 0; }
  .assets-breakdown-list .assets-breakdown-total { margin: 0; padding: 11px 0; border: 0; }
}
@media (max-width: 760px) {
  .assets-heading { flex-wrap: wrap; gap: 14px; }
  .assets-heading .tabs { width: 100%; }
  .assets-heading .tab { flex: 1; padding-inline: 6px; white-space: nowrap; }
  .assets-sync { margin-top: 0; margin-bottom: 12px; }
  .assets-analysis .panel { padding: 14px 12px; }
  .assets-analysis .panel-heading { gap: 8px; }
  .assets-chart { min-height: 155px; }
  .assets-chart svg { min-height: 155px; }
  .assets-chart-summary { flex-wrap: wrap; }
  .assets-chart-summary>span { font-size: 10px; }
  .assets-chart-inspector { margin-top: 8px; }
  .assets-chart-single { position: static; text-align: center; }
  .assets-breakdown-list { column-gap: 16px; }
  .assets-breakdown-list>div { flex-wrap: wrap; gap: 5px; }
  .assets-breakdown-list dd { margin-left: auto; overflow-wrap: anywhere; }
  .assets-breakdown-list { grid-template-columns: minmax(0, 1fr); }
  .assets-sync { align-items: flex-start; line-height: 1.7; }
  .assets-sync>span { min-width: 0; }
  .assets-sync .button { flex-shrink: 0; }
  .assets-analysis .panel-heading { flex-wrap: wrap; }
  .assets-chart-inspector input { min-height: 44px; }
  .assets-chart-inspector output { white-space: normal; overflow-wrap: anywhere; font-size: 12px; }
  .assets-ledger-heading { align-items: flex-start; }
  .assets-filter { width: 100%; }
  .assets-filter select { min-height: 44px; font-size: 16px; }
  .assets-note { font-size: 12px; }
}
/* Position protection editor */
.protection-fields { display: grid; gap: 18px; margin: 24px 0; }
.protection-fields label { display: grid; gap: 8px; font-weight: 600; }
.protection-fields input { width: 100%; box-sizing: border-box; padding: 12px; border: 1px solid var(--border); border-radius: 8px; font: inherit; background: var(--surface); color: inherit; }
.position-product { padding: 0; text-align: left; }
#positions-body .align-right .button + .button { margin-top: 6px; }

/* Completed exits retain a readable result in the history row and detail. */
.exit-result-summary { display: block; max-width: 22rem; margin-top: .45rem; white-space: normal; line-height: 1.5; }
.exit-result-card { padding: 1rem; border: 1px solid var(--border); border-radius: 12px; }
.exit-result-card h3 { margin: 0 0 .5rem; }
.exit-result-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1rem; }
.exit-result-grid dt { font-size: .8rem; opacity: .7; }
.exit-result-grid dd { margin: .3rem 0 0; font-weight: 600; font-variant-numeric: tabular-nums; }
