:root {
  --ink: #22212a;
  --muted: #6d6a78;
  --paper: #ffffff;
  --surface: #f4f4f4;
  --line: #e5e5e5;
  --nav: #181725;
  --nav2: #29273b;
  --brand: #4f38f4;
  --brand-dark: #3b26d3;
  --brand-pale: #f4f3ff;
  --long: #e13922;
  --short: #264fea;
}
body { background: #f4f4f4; color: var(--ink); font-family: "Noto Sans Korean", "Malgun Gothic", Dotum, sans-serif; }
.topbar { height: 66px; background: #ffffff; color: #22212a; border-bottom-color: #dddddd; box-shadow: 0 2px 10px rgba(40, 35, 80, .05); grid-template-columns: 220px minmax(600px, 1fr) auto; }
.wordmark b { color: var(--brand); }
.wordmark span, .market-clock span, .top-account span { color: #777481; }
.source-global-nav { display: flex; align-self: stretch; align-items: stretch; gap: 4px; }
.source-global-nav button { position: relative; min-width: 92px; padding: 0 15px; border: 0; background: transparent; color: #444; font-weight: 600; }
.source-global-nav button:hover, .source-global-nav button:focus-visible { color: var(--brand); outline: none; }
.source-global-nav button:first-child { color: var(--brand); }
.source-global-nav button:first-child::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 0; height: 3px; background: var(--brand); }
.top-account b { color: #292637; }
.status-dot { background: var(--brand); }
.app-shell { display: block; min-height: calc(100vh - 66px); }
.sidebar { display: none; }
.sidebar-toggle { background: #242236; border-color: #3c3955; }
.nav-group p { color: #8e89a6; }
.nav-group button { color: #d8d5e4; border-radius: 4px; font-weight: 500; }
.nav-group button:hover, .nav-group button:focus-visible { background: var(--nav2); color: #ffffff; }
.nav-group button.active { background: var(--brand); color: #ffffff; }
.simulation-box { border-top-color: #3c3955; }
.simulation-box button { background: #2b2940; border-color: #494662; }
.view { width: min(100%, 1260px); margin: 0 auto; padding: 20px 0 28px; }
.view-head h1 { font-size: 1.35rem; font-weight: 600; }
.view-head { margin-bottom: 12px; }
.panel, .metric-strip { border-color: var(--line); border-radius: 6px; overflow: hidden; }
.panel-head { background: #ffffff; border-bottom-color: var(--line); }
.panel-head h2 { font-weight: 600; }
.metric { border-right-color: var(--line); }
.metric-strip { border-radius: 0; border: 0; background: #4f38f4; color: #fff; }
.metric span { color: #dcd8ff; }
.metric { padding: 10px 15px; border-color: #7160f5; }
.metric b { color: #fff; }
.metric b, .book-price, .book-quantity b, .book-current b, .data-table td { font-variant-numeric: tabular-nums; }
.button { border-color: #d8d6df; border-radius: 4px; font-weight: 500; }
.button.primary { background: var(--brand); border-color: var(--brand); }
.button.primary:hover, .button.primary:focus-visible { background: var(--brand-dark); border-color: var(--brand-dark); }
.data-table th, .book-head { background: #ffffff; color: #514e5e; font-weight: 500; border-top: 2px solid #222; }
.data-table tbody tr:nth-child(even) { background: #fafafa; }
.data-table tbody tr:hover { background: var(--brand-pale); }
.mini-button { border-color: #d8d6df; border-radius: 4px; font-weight: 500; }
.mini-button:hover, .mini-button:focus-visible { border-color: var(--brand); color: var(--brand); }
.position-actions { display: flex; justify-content: flex-end; gap: 4px; }
.position-actions .mini-button:last-child { color: var(--long); border-color: #e5b5ae; }
.close-presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: -4px; }
.close-presets button { height: 30px; border: 1px solid #d8d6df; background: #ffffff; color: #514e5e; border-radius: 3px; font-size: .72rem; font-weight: 600; }
.close-presets button:hover, .close-presets button:focus-visible { border-color: var(--brand); color: var(--brand); outline: none; }
.book-row { height: 24px; background: #ECF3FA; border-color: #ffffff; }
.book-row.bid { background: #FBF1EF; }
.book-row:hover, .book-row:focus-visible { outline-color: var(--brand); }
.book-quantity i { background: #cce0f4; }
.book-row.bid .book-quantity i { background: #f5e4e1; }
.book-current { background: #ffffff; }
.book-current.trade-up { background: #ffe3df; box-shadow: inset 4px 0 var(--long); }
.book-current.trade-down { background: #e3e8ff; box-shadow: inset 4px 0 var(--short); }
.segmented button { background: #f6f6f6; }
.field input, .field select { border-color: #d7d5dd; border-radius: 4px; }
.field input:focus, .field select:focus { border-color: var(--brand); outline: 2px solid #e6e2ff; }
.ticket-summary { background: var(--brand-pale); }
.ticket-submit { border-radius: 4px; }
.ticket-submit.long { background: var(--long); }
.ticket-submit.short { background: var(--short); }
.instrument-summary { display: flex; justify-content: space-between; align-items: center; min-height: 105px; padding: 15px 20px; margin-bottom: 14px; background: #fff; border: 1px solid #e5e5e5; }
.instrument-summary h2 { margin: 0 0 8px; font-size: 1.25rem; font-weight: 600; }
.instrument-summary h2 em { margin-left: 7px; color: #666; font-size: .78rem; font-style: normal; font-weight: 400; }
.instrument-summary h2 span { margin-left: 12px; padding: 0 10px; border-left: 1px solid #aaa; border-right: 1px solid #aaa; font-size: .68rem; font-weight: 400; }
.instrument-summary strong { display: inline-block; margin-right: 14px; font-size: 1.45rem; }
.instrument-summary small { color: #666; }
.instrument-summary dl { display: grid; grid-template-columns: auto auto; gap: 8px 18px; min-width: 260px; margin: 0; padding: 10px 0; border-top: 1px solid #ddd; border-bottom: 1px solid #ddd; }
.instrument-summary dt { font-size: .72rem; font-weight: 500; }
.instrument-summary dd { margin: 0; text-align: right; font-size: .74rem; font-weight: 600; }
.trade-workspace { grid-template-columns: 280px minmax(410px, 1fr) 330px; gap: 12px; }
.trade-workspace .panel { border-radius: 0; }
.trade-workspace .panel-head { min-height: 42px; }
.trade-workspace .chart { height: 534px; }
.trade-symbol-list { height: 534px; overflow-y: auto; }
.trade-symbol-list .trade-symbol-select { width: 100%; min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; border: 0; border-bottom: 1px solid #e5e5e5; background: #fff; text-align: left; }
.trade-symbol-list .trade-symbol-select:hover, .trade-symbol-list .trade-symbol-select:focus-visible { background: #f7f6ff; outline: none; }
.trade-symbol-list .trade-symbol-select > span, .trade-symbol-list strong { display: grid; gap: 3px; }
.trade-symbol-list small, .trade-symbol-list em { color: #777; font-size: .65rem; font-style: normal; font-weight: 400; }
.trade-symbol-list strong { text-align: right; font-size: .78rem; }
.order-ticket { padding: 12px 15px 15px; }
.segmented { margin: -12px -15px 14px; }
.segmented button { height: 42px; border-width: 0 0 1px; background: #fff; color: #666; }
.segmented button.active { position: relative; background: #fff !important; }
.segmented button.active::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; background: currentColor; }
.segmented button.active.long { color: var(--long); }
.segmented button.active.short { color: var(--short); }
.field { grid-template-columns: 82px 1fr; align-items: center; gap: 6px; margin-bottom: 8px; }
.field input, .field select { height: 32px; }
.field-label { color: var(--muted); font-size: .69rem; font-weight: 800; }
.order-type-buttons { display: grid; grid-template-columns: 1fr 1fr; }
.order-type-buttons button { height: 32px; border: 1px solid #d7d5dd; background: #ffffff; color: #666; font-size: .74rem; font-weight: 600; }
.order-type-buttons button + button { border-left: 0; }
.order-type-buttons button.active { position: relative; z-index: 1; border-color: var(--brand); background: #f4f3ff; color: var(--brand); }
.order-type-buttons button:focus-visible { position: relative; z-index: 2; outline: 2px solid #e6e2ff; }
.ticket-summary { margin: 10px 0; }
.ticket-submit { height: 44px; }
.book-ladder { scrollbar-color: #909399 #ececf1; }
.book-ladder::-webkit-scrollbar { width: 5px; }
.book-ladder::-webkit-scrollbar-thumb { background: #909399; border-radius: 5px; }
.book-ladder::-webkit-scrollbar-track { background: #ececf1; }
#toast { background: #302d43; }
@media (max-width: 720px) {
  .topbar { background: #ffffff; }
  .mobile-menu { color: var(--brand); }
  .source-global-nav { display: none; }
  .topbar { height: 58px; grid-template-columns: auto 1fr auto; }
  .app-shell { display: block; min-height: calc(100vh - 58px); }
  .sidebar { display: none; }
  .sidebar.open { display: block; }
  .view { width: 100%; padding: 12px; }
  .instrument-summary { align-items: flex-start; flex-direction: column; gap: 12px; }
  .instrument-summary dl { width: 100%; }
  .trade-workspace { grid-template-columns: 1fr; }
}
