/* Demand Call Market - demo web app. One stylesheet for laptop and phone. */

:root {
  --bg: #0a0d12;
  --bg-2: #0d1117;
  --panel: #11161e;
  --panel-2: #161c26;
  --line: #1e2631;
  --line-2: #2a3442;
  --text: #e7ecf2;
  --text-2: #b3bdca;
  --muted: #8592a3;
  --faint: #5e6a7b;
  --buy: #27c07d;
  --buy-text: #5fe0a4;
  --buy-dim: rgba(39, 192, 125, 0.17);
  --sell: #f0525a;
  --sell-text: #ff8a90;
  --sell-dim: rgba(240, 82, 90, 0.17);
  --live: #f2b33d;
  --live-text: #f5c86e;
  --live-dim: rgba(242, 179, 61, 0.14);
  --accent: #4f8ff7;
  --accent-text: #a9c8ff;
  --accent-dim: rgba(79, 143, 247, 0.17);
  --radius: 10px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 var(--font);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
b { font-weight: 650; }
.muted { color: var(--muted); }
.buy { color: var(--buy-text); }
.sell { color: var(--sell-text); }
.pos { color: var(--buy-text); }
.neg { color: var(--sell-text); }
.num { text-align: right; }

/* ---------- buttons, inputs, chips ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 13px;
  border: 1px solid var(--line-2); border-radius: 8px;
  background: var(--panel-2); color: var(--text);
  font-weight: 600; font-size: 13px; cursor: pointer;
  transition: background .12s, border-color .12s, opacity .12s;
}
.btn:hover:not(:disabled) { background: #1c2430; border-color: #364254; }
.btn:focus-visible, .seg button:focus-visible, .quick button:focus-visible, .call-sum:focus-visible,
.tabbar button:focus-visible, .icon-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn-lg { height: 44px; font-size: 15px; }
.btn-xl { height: 48px; font-size: 15px; font-weight: 700; letter-spacing: .01em; }
.btn-block { width: 100%; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: rgba(255,255,255,.05); border-color: transparent; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: #5d99fb; border-color: #5d99fb; }
.btn-sell { background: var(--sell); border-color: var(--sell); color: #fff; }
.btn-sell:hover:not(:disabled) { background: #f4646b; border-color: #f4646b; }
.btn-buy { background: var(--buy); border-color: var(--buy); color: #04170e; }
.btn-buy:hover:not(:disabled) { background: #33cc89; border-color: #33cc89; }
.btn-danger { background: var(--sell-dim); border-color: rgba(240,82,90,.45); color: var(--sell-text); }
.btn:disabled { background: #19202a; border-color: #222b37; color: #5b6676; cursor: not-allowed; }
.icon-btn {
  width: 28px; height: 28px; border-radius: 7px; border: 1px solid transparent;
  background: transparent; color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer;
}
.icon-btn:hover { background: rgba(255,255,255,.06); color: var(--text); }

.inp {
  width: 100%; height: 42px; padding: 0 12px;
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 8px;
  color: var(--text); font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums;
  outline: none; transition: border-color .12s, box-shadow .12s;
}
.inp:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
select.inp {
  appearance: none; -webkit-appearance: none; font-size: 15px; padding-right: 32px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 18px, calc(100% - 12px) 18px;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
select.inp option { background: var(--panel); color: var(--text); }

.chip {
  display: inline-flex; align-items: center; height: 20px; padding: 0 7px;
  border-radius: 5px; font-size: 10.5px; font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase; white-space: nowrap; background: rgba(255,255,255,.07); color: var(--text-2);
}
.side-sell { background: var(--sell-dim); color: var(--sell-text); }
.side-buy { background: var(--buy-dim); color: var(--buy-text); }
.st-sent { background: var(--accent-dim); color: var(--accent-text); }
.st-live { background: var(--live-dim); color: var(--live-text); }
.st-auction { background: transparent; color: var(--live-text); box-shadow: inset 0 0 0 1px rgba(242,179,61,.55); }
.st-filled { background: rgba(231,236,242,.11); color: var(--text); }
.st-partial { background: var(--live-dim); color: var(--live-text); }
.st-cancelled { background: rgba(255,255,255,.05); color: var(--muted); }
.st-rejected { background: var(--sell-dim); color: var(--sell-text); }
.out-UnderwriterWon { background: rgba(231,236,242,.11); color: var(--text); }
.out-NaturalsStand { background: var(--accent-dim); color: var(--accent-text); }
.out-HostRequirementNotMet, .out-CapExpired { background: var(--live-dim); color: var(--live-text); }
.yours { background: var(--accent); color: #fff; }

.spinner {
  display: inline-block; width: 12px; height: 12px; flex: none;
  border: 2px solid rgba(255,255,255,.18); border-top-color: currentColor; border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }

/* ---------- brand ---------- */
.brand { display: flex; align-items: center; gap: 9px; min-width: 0; flex: none; }
.mark { width: 24px; height: 24px; flex: none; }
.wordmark { font-size: 15px; font-weight: 700; letter-spacing: .005em; white-space: nowrap; }
.badge-demo {
  font-size: 9.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
  padding: 3px 6px 2px; border-radius: 4px; background: var(--text); color: var(--bg); line-height: 1.2;
}

/* ---------- sign in ---------- */
.login { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.login-card {
  width: 100%; max-width: 380px; padding: 28px 24px 22px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,.45);
}
.brand-lg .mark { width: 30px; height: 30px; }
.brand-lg .wordmark { font-size: 18px; }
.login-sub { margin: 10px 0 22px; color: var(--muted); font-size: 13px; }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; margin-bottom: 6px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.field input {
  width: 100%; height: 44px; padding: 0 12px; background: var(--bg-2); border: 1px solid var(--line-2);
  border-radius: 8px; font-size: 16px; outline: none;
}
.field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.login-error { margin: -2px 0 12px; color: var(--sell-text); font-size: 13px; }
.login-note { margin: 16px 0 0; color: var(--faint); font-size: 12px; text-align: center; line-height: 1.5; }

/* ---------- top bar, banner, call flag ---------- */
.top-sticky { position: sticky; top: 0; z-index: 20; background: var(--bg); padding-top: env(safe-area-inset-top); }
.topbar {
  height: 52px; padding: 0 16px; display: flex; align-items: center; gap: 18px;
  background: #0c1016; border-bottom: 1px solid var(--line);
}
.replay-label { flex: 1; min-width: 0; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { display: flex; align-items: center; gap: 16px; flex: none; margin-left: auto; }
.tape { display: flex; align-items: baseline; gap: 5px; }
.tape-clock { font-family: var(--mono); font-size: 15px; font-weight: 600; letter-spacing: .02em; }
.tape-tz { font-size: 10.5px; color: var(--muted); font-weight: 700; letter-spacing: .06em; }
.tape-loop { margin-left: 6px; font-size: 11px; color: var(--faint); }
.conn { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.conn .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sell); box-shadow: 0 0 0 3px rgba(240,82,90,.18); }
.conn[data-state="ok"] .dot { background: var(--buy); box-shadow: 0 0 0 3px rgba(39,192,125,.18); }
.conn[data-state="warn"] .dot { background: var(--live); box-shadow: 0 0 0 3px rgba(242,179,61,.18); }
.conn[data-state="bad"] .dot { animation: pulse 1.2s ease-in-out infinite; }
.user { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); }
.user-name { font-weight: 600; }

.banner {
  display: flex; align-items: center; justify-content: center; gap: 8px; padding: 6px 12px;
  background: var(--live-dim); color: var(--live-text); font-size: 12.5px; border-bottom: 1px solid rgba(242,179,61,.28);
}

.flag {
  position: relative; overflow: hidden; margin: 12px 16px 0; padding: 11px 14px 12px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel);
  transition: border-color .2s, background .2s; cursor: default;
}
.flag-inner { display: flex; align-items: center; gap: 12px; min-height: 28px; }
.flag-pill {
  flex: none; display: inline-flex; align-items: center; gap: 7px; height: 24px; padding: 0 9px;
  border-radius: 6px; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  background: #1a212b; color: var(--muted);
}
.flag-mine { flex: none; }
.flag-mine { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 5px; background: var(--accent); color: #fff; font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.flag-text { min-width: 0; font-size: 14px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flag-count { flex: none; font-size: 13px; color: var(--muted); white-space: nowrap; }
.flag-timer { flex: none; margin-left: auto; font-family: var(--mono); font-size: 22px; font-weight: 700; color: var(--live-text); letter-spacing: .02em; }
.flag-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: transparent; }
.flag-bar { height: 100%; width: 0; background: var(--live); transition: width .25s linear; }
.flag[data-state="off"] .flag-text { color: var(--text-2); font-weight: 500; }
.flag[data-state="off"] .flag-count { color: var(--faint); }
.flag[data-state="live"] {
  border-color: rgba(242,179,61,.5);
  background: linear-gradient(90deg, rgba(242,179,61,.13), rgba(242,179,61,.04) 55%, var(--panel));
}
.flag[data-state="live"] .flag-pill { background: var(--live); color: #1d1404; }
.flag[data-state="live"] .flag-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #1d1404; animation: pulse 1s ease-in-out infinite; }
.flag[data-state="live"] .flag-count { color: var(--live-text); }
.flag[data-state="auction"] { border-color: rgba(242,179,61,.5); background: linear-gradient(90deg, rgba(242,179,61,.09), var(--panel) 60%); }
.flag[data-state="auction"] .flag-pill { background: transparent; color: var(--live-text); box-shadow: inset 0 0 0 1px var(--live); animation: pulse .9s ease-in-out infinite; }
.flag[data-state="auction"] .flag-count { color: var(--live-text); }
.flag[data-state="done"] { border-color: rgba(79,143,247,.4); background: linear-gradient(90deg, rgba(79,143,247,.10), var(--panel) 60%); }
.flag[data-state="done"] .flag-pill { background: var(--accent-dim); color: var(--accent-text); }
.flag[data-state="done"] .flag-bar, .flag[data-state="off"] .flag-bar { width: 0 !important; }

/* ---------- layout ---------- */
.grid {
  display: grid; gap: 12px; padding: 12px 16px 8px; align-items: start;
  grid-template-columns: minmax(300px, .95fr) minmax(400px, 1.3fr) minmax(340px, 1.05fr);
  max-width: 1760px; margin: 0 auto;
}
.col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px 16px; min-width: 0;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; min-height: 22px; }
.panel-head h2 {
  margin: 0; font-size: 11.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted);
  display: flex; align-items: baseline; gap: 8px; min-width: 0;
}
.panel-meta { font-size: 11.5px; color: var(--faint); white-space: nowrap; display: inline-flex; align-items: center; }
.empty { margin: 4px 0; color: var(--faint); font-size: 13px; line-height: 1.5; }
.footer { padding: 6px 16px 26px; text-align: center; font-size: 11.5px; color: var(--faint); }
.tabbar { display: none; }

/* ---------- quote and signal ---------- */
.sym { font-size: 15px; letter-spacing: .04em; color: var(--text); font-weight: 800; }
.sym-name { text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 12.5px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qstate { font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 3px 7px; border-radius: 5px; background: rgba(255,255,255,.06); color: var(--muted); }
.qstate[data-state="Locked"], .qstate[data-state="Crossed"], .qstate[data-state="NoBid"], .qstate[data-state="NoOffer"], .qstate[data-state="NoQuote"] { background: var(--live-dim); color: var(--live-text); }
.quote { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 8px; }
.q-label { font-size: 10.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--faint); margin-bottom: 2px; }
.q-px { font-size: 34px; line-height: 1.1; font-weight: 650; letter-spacing: -.01em; }
.q-bid .q-px { color: var(--buy-text); }
.q-ask { text-align: right; }
.q-ask .q-px { color: var(--sell-text); }
.q-sz { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.q-mid { text-align: center; padding-bottom: 4px; }
.q-midpx { font-size: 18px; font-weight: 600; }
.q-spread { font-size: 11px; color: var(--faint); margin-top: 1px; white-space: nowrap; }

.signal { margin-top: 14px; padding: 11px 12px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-2); }
.signal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.signal-title { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--text-2); }
.signal-avail { font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 2px 7px; border-radius: 5px; background: rgba(255,255,255,.06); color: var(--muted); }
.signal[data-avail="true"] .signal-avail { background: var(--accent-dim); color: var(--accent-text); }
.signal[data-avail="false"] .signal-avail { background: var(--live-dim); color: var(--live-text); }
.signal-text { margin: 0 0 10px; font-size: 13.5px; line-height: 1.55; color: var(--text-2); }
.signal-text b { color: var(--text); }
.signal-text b.sell { color: var(--sell-text); letter-spacing: .03em; }
.signal-text b.buy { color: var(--buy-text); letter-spacing: .03em; }
.signal-text .sep { color: var(--faint); margin: 0 3px; }
.signal-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0; }
.signal-grid div { min-width: 0; }
.signal-grid dt { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); margin-bottom: 2px; }
.signal-grid dd { margin: 0; font-size: 16px; font-weight: 650; }
.signal[data-avail="false"] .signal-grid dd { color: var(--faint); }
.replay-note { display: none; margin: 10px 0 0; font-size: 12px; color: var(--faint); line-height: 1.45; }

/* ---------- depth ---------- */
.depth { font-size: 13px; }
.dl-head, .dl-row { display: grid; grid-template-columns: 1fr 66px 66px 1fr; }
.dl-head { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); padding-bottom: 6px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.dl-head span { padding: 0 8px; }
.dl-head span:nth-child(1), .dl-head span:nth-child(2) { text-align: right; }
.dl-row { height: 25px; }
.dl-c { position: relative; display: flex; align-items: center; padding: 0 8px; min-width: 0; white-space: nowrap; }
.dl-bsz { justify-content: flex-end; }
.dl-bpx { justify-content: flex-end; color: var(--buy-text); font-weight: 600; }
.dl-apx { justify-content: flex-start; color: var(--sell-text); font-weight: 600; border-left: 1px solid var(--line); }
.dl-asz { justify-content: flex-start; }
.dl-bar { position: absolute; top: 3px; bottom: 3px; width: 0; border-radius: 3px; transition: width .2s; }
.dl-bsz .dl-bar { right: 0; background: var(--buy-dim); }
.dl-asz .dl-bar { left: 0; background: var(--sell-dim); }
.dl-n { position: relative; color: var(--text); }
.dl-row:first-child .dl-c { font-weight: 700; }
.dl-row:first-child { background: rgba(255,255,255,.025); border-radius: 4px; }
.dl-c.est .dl-n, .dl-bpx.est, .dl-apx.est { opacity: .58; font-weight: 500; }
.dl-bsz.est .dl-bar { background: repeating-linear-gradient(135deg, rgba(39,192,125,.20) 0 4px, rgba(39,192,125,.07) 4px 8px); }
.dl-asz.est .dl-bar { background: repeating-linear-gradient(135deg, rgba(240,82,90,.20) 0 4px, rgba(240,82,90,.07) 4px 8px); }
.legend { margin: 10px 0 0; font-size: 11.5px; color: var(--faint); line-height: 1.6; }
.lg { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin: 0 5px -1px 0; }
.lg + * { margin-right: 0; }
.legend .lg:not(:first-child), .panel-meta .lg:not(:first-child) { margin-left: 12px; }
.lg-real { background: rgba(39,192,125,.35); }
.lg-est { background: repeating-linear-gradient(135deg, rgba(231,236,242,.35) 0 2px, rgba(231,236,242,.08) 2px 4px); }
.lg-call { background: rgba(242,179,61,.45); }
.lg-mine { background: rgba(79,143,247,.6); }
.legend-note { margin-left: 4px; }

/* ---------- chart ---------- */
.chart-box { position: relative; height: 196px; }
.chart-box canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* ---------- order ticket ---------- */
.ticket { display: flex; flex-direction: column; gap: 13px; }
.seg { display: inline-flex; padding: 3px; gap: 3px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 9px; }
.seg button {
  border: 0; background: transparent; color: var(--muted); font-weight: 650; font-size: 13px;
  height: 30px; padding: 0 12px; border-radius: 6px; cursor: pointer; white-space: nowrap;
}
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--panel-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.seg-side { display: grid; grid-template-columns: 1fr 1fr; }
.seg-side button { height: 38px; font-size: 14px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.seg-side button.on[data-side="sell"] { background: var(--sell); color: #fff; box-shadow: none; }
.seg-side button.on[data-side="buy"] { background: var(--buy); color: #04170e; box-shadow: none; }
.t-field > label { display: block; margin-bottom: 6px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.quick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 7px; }
.quick button {
  height: 26px; padding: 0 9px; border-radius: 6px; border: 1px solid var(--line-2); background: transparent;
  color: var(--text-2); font-size: 12px; font-weight: 650; cursor: pointer;
}
.quick button:hover { border-color: #3b4859; color: var(--text); }
.quick button.on { border-color: rgba(79,143,247,.7); background: var(--accent-dim); color: var(--accent-text); }
.quick-note { font-size: 11.5px; color: var(--faint); margin-left: 2px; }
.t-grid2 { display: grid; grid-template-columns: minmax(120px, .8fr) 1.4fr; gap: 12px; }
.t-grid2.t-sl { grid-template-columns: 1fr 1fr; }
.t-limnote { display: block; margin: 6px 0 0 1px; }
.fillreq { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.seg-fill button { height: 34px; padding: 0 10px; }
.pct-wrap { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-weight: 600; }
.inp-pct { width: 58px; height: 40px; text-align: right; padding: 0 8px; font-size: 16px; }

.checks { list-style: none; margin: 0; padding: 9px 12px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; }
.ck { display: flex; align-items: center; gap: 9px; padding: 3px 0; font-size: 13px; color: var(--text-2); }
.ck-i {
  flex: none; width: 17px; height: 17px; border-radius: 50%; display: inline-grid; place-items: center;
  font-size: 10.5px; font-weight: 900; line-height: 1;
}
.ck-ok .ck-i { background: var(--buy-dim); color: var(--buy-text); }
.ck-ok .ck-i::before { content: "\2713"; }
.ck-bad { color: var(--text); }
.ck-bad .ck-i { background: var(--sell-dim); color: var(--sell-text); }
.ck-bad .ck-i::before { content: "\2715"; }
.ck-todo .ck-i, .ck-wait .ck-i { box-shadow: inset 0 0 0 1.5px var(--line-2); }
.ck-todo, .ck-wait { color: var(--muted); }
.preview { font-size: 12.5px; line-height: 1.5; color: var(--text-2); min-height: 0; }
.preview:empty { display: none; }
.preview em, .cmp em { color: var(--faint); font-style: normal; }
.pv-i { display: inline-block; width: 16px; color: var(--faint); font-weight: 700; }
.t-reason { margin: -4px 0 0; min-height: 17px; font-size: 12px; color: var(--muted); text-align: center; }

/* ---------- your call ---------- */
.mycall-body { font-size: 13px; }
.mc-order { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; color: var(--text-2); }
.mc-order .chip:last-child { margin-left: auto; }
.mc-wait { display: flex; align-items: center; gap: 9px; margin-top: 14px; color: var(--text-2); }
.mc-rej { margin-top: 12px; padding: 10px 12px; border-radius: 8px; background: rgba(240,82,90,.08); border: 1px solid rgba(240,82,90,.25); color: var(--text); }
.reasons { margin: 6px 0 0; padding-left: 18px; color: var(--text-2); }
.reasons li { margin: 2px 0; }
.mc-live { margin-top: 12px; }
.mc-cd { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; }
.mc-cd-label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.mc-cd-val { font-family: var(--mono); font-size: 34px; font-weight: 700; color: var(--live-text); line-height: 1.1; }
.mc-cd-end { color: var(--faint); font-size: 12px; }
.mc-prog { height: 6px; margin: 8px 0 12px; border-radius: 3px; background: #1a212b; overflow: hidden; }
.mc-bar { height: 100%; width: 0; background: var(--live); transition: width .25s linear; }
.mc-kv { display: flex; justify-content: space-between; align-items: baseline; padding: 6px 0; border-top: 1px solid var(--line); }
.mc-kv span { color: var(--muted); }
.mc-kv b { font-size: 15px; }
.mc-hint { margin: 8px 0 0; color: var(--faint); font-size: 12px; line-height: 1.5; }
.mc-auction { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; color: var(--live-text); font-weight: 600; }
.mc-sum { margin-top: 12px; color: var(--text-2); }
.res-outcome { margin: 12px 0 10px; font-size: 15px; font-weight: 700; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.kpi { padding: 9px 10px; border-radius: 8px; background: var(--bg-2); border: 1px solid var(--line); min-width: 0; }
.kpi span { display: block; font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); margin-bottom: 3px; }
.kpi b { font-size: 18px; white-space: nowrap; }
.kpi small { display: block; margin-top: 1px; font-size: 11.5px; color: var(--faint); font-weight: 500; }
.cmp { margin-top: 12px; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg-2); }
.cmp-row { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; color: var(--text-2); }
.cmp-row > span:first-child { color: var(--muted); }
.cmp-row > span:last-child { text-align: right; }
.cmp-save { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); font-weight: 600; color: var(--text-2); }
.cmp-save.pos { color: var(--buy-text); }
.cmp-save.neg { color: var(--sell-text); }
.res-meta { margin-top: 10px; font-size: 11.5px; color: var(--faint); line-height: 1.5; }

/* ---------- tables ---------- */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { padding: 6px 6px; font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl th.num { text-align: right; }
.tbl td { padding: 6px 6px; border-bottom: 1px solid rgba(255,255,255,.045); white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.tot td { font-weight: 700; border-top: 1px solid var(--line-2); }
.tbl td:first-child, .tbl th:first-child { padding-left: 0; }
.tbl td:last-child, .tbl th:last-child { padding-right: 0; }
.empty-cell { color: var(--faint); text-align: center !important; padding: 12px 0 !important; }
.src { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; vertical-align: 1px; background: var(--muted); }
.src-naturals { background: #7fb2ff; }
.src-sweep { background: #a7b0bc; }
.src-underwriter { background: var(--live); }
.src-reverse-slippage { background: #b993ff; }

/* ---------- portfolio ---------- */
.pf-top { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 10px; }
.pf-label { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin-bottom: 2px; }
.pf-big { font-size: 22px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; }
.pf-sub { font-size: 11.5px; color: var(--faint); margin-top: 1px; }
.pf-rows { margin: 0 0 10px; }
.pf-rows div { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px solid rgba(255,255,255,.045); font-size: 13px; }
.pf-rows dt { color: var(--muted); }
.pf-rows dd { margin: 0; font-weight: 600; }
.tbl-wrap { overflow-x: auto; margin-top: 4px; }
#p-portfolio { container-type: inline-size; }
.pos-sub { display: none; }
@container (max-width: 480px) { .col-last { display: none; } }
@container (max-width: 400px) {
  .col-avg { display: none; }
  .pos-sub { display: block; font-size: 11px; color: var(--faint); font-weight: 500; }
}
.pf-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.confirm { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); }
.pf-session { display: none; }

/* ---------- orders ---------- */
.orders { max-height: 330px; overflow-y: auto; margin: -4px 0; }
.order { padding: 10px 0; border-bottom: 1px solid var(--line); }
.order:last-child { border-bottom: 0; }
.o-line { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 9px; font-size: 13px; }
.o-time { font-family: var(--mono); font-size: 12px; color: var(--faint); }
.o-qty { font-weight: 700; }
.o-lim { color: var(--text-2); }
.o-meta { font-size: 12px; color: var(--muted); }
.o-line .chip:last-child { margin-left: auto; }
.o-detail { margin-top: 5px; font-size: 12.5px; color: var(--text-2); }
.o-detail.bad { color: var(--sell-text); }
.o-detail.bad .reasons { color: var(--text-2); }
.fills { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; font-size: 12px; color: var(--text-2); }
.fill b { color: var(--text); }

/* ---------- calls feed ---------- */
.calls { max-height: 460px; overflow-y: auto; margin: -4px 0; }
.call { border-bottom: 1px solid var(--line); }
.call:last-child { border-bottom: 0; }
.call-sum {
  width: 100%; display: grid; align-items: center; column-gap: 12px; row-gap: 3px; padding: 9px 2px;
  grid-template-columns: 66px minmax(0, 1fr) auto 12px;
  grid-template-areas: "a b w k" "a c w k";
  background: none; border: 0; color: var(--text); text-align: left; cursor: pointer; font-size: 13px; border-radius: 6px;
}
.call-sum:hover { background: rgba(255,255,255,.025); }
.c-a { grid-area: a; display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.c-b { grid-area: b; display: flex; align-items: center; gap: 6px; min-width: 0; flex-wrap: wrap; }
.c-c { grid-area: c; display: flex; align-items: baseline; gap: 10px; min-width: 0; line-height: 1.3; }
.c-win { grid-area: w; }
.c-caret { grid-area: k; }
.c-time { font-family: var(--mono); font-size: 12.5px; color: var(--text-2); }
.c-len { font-size: 11.5px; color: var(--faint); }
.c-sh { font-weight: 650; white-space: nowrap; }
.c-win { color: var(--text-2); white-space: nowrap; min-width: 48px; text-align: right; }
.c-nat { color: var(--faint); font-size: 11.5px; white-space: nowrap; }
.c-caret { width: 7px; height: 7px; border-right: 1.5px solid var(--faint); border-bottom: 1.5px solid var(--faint); transform: rotate(-45deg); justify-self: center; transition: transform .15s; }
.call.open .c-caret { transform: rotate(45deg); }
.call.is-live .chip { animation: pulse 1.4s ease-in-out infinite; }
.call-detail { padding: 2px 2px 14px; font-size: 12.5px; color: var(--text-2); }
.cd-line { margin: 4px 0 8px; color: var(--muted); line-height: 1.5; }
.cd-line b { color: var(--text); }
.cd-sub { margin: 10px 0 4px; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.cd-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ---------- toasts ---------- */
.toasts { position: fixed; top: 64px; right: 16px; z-index: 60; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  max-width: 380px; padding: 10px 13px; border-radius: 8px; background: #19212d; border: 1px solid var(--line-2);
  border-left: 3px solid var(--accent); box-shadow: 0 10px 30px rgba(0,0,0,.4); font-size: 13px; color: var(--text);
  animation: toast-in .2s ease-out; transition: opacity .3s, transform .3s; pointer-events: auto;
}
.toast-error { border-left-color: var(--sell); }
.toast-warn { border-left-color: var(--live); }
.toast.out { opacity: 0; transform: translateY(-6px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ---------- medium screens: two columns ---------- */
@media (max-width: 1179px) and (min-width: 761px) {
  .grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); }
  .col-3 { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
  #p-calls { grid-column: 1 / -1; }
  .replay-label { display: none; }
}

/* ---------- phone ---------- */
@media (max-width: 760px) {
  body { font-size: 14px; }
  .topbar { height: 50px; padding: 0 12px; gap: 10px; }
  .wordmark { font-size: 14px; }
  .mark { width: 22px; height: 22px; }
  .replay-label, .user, .conn-text, .tape-loop { display: none; }
  .topbar-right { gap: 12px; }
  .tape-clock { font-size: 14px; }
  .flag { margin: 8px 10px 0; padding: 8px 10px 10px; }
  .flag-inner { gap: 8px; min-height: 26px; flex-wrap: nowrap; }
  .flag-pill { height: 22px; padding: 0 7px; font-size: 10px; }
  .flag-mine { height: 20px; padding: 0 6px; font-size: 9.5px; }
  .flag-text { font-size: 13px; flex: 1; }
  .flag-count { display: none; }
  .flag[data-state="live"] .flag-count, .flag[data-state="auction"] .flag-count { display: none; }
  .flag-timer { font-size: 18px; }
  .flag[data-state="off"] .flag-text { font-size: 12.5px; }

  .grid { display: flex; flex-direction: column; align-items: stretch; gap: 10px; padding: 10px 10px calc(78px + env(safe-area-inset-bottom)); }
  .col { display: contents; }
  .panel { display: none; padding: 13px 13px 15px; }
  body[data-tab="market"] .panel[data-tab="market"],
  body[data-tab="trade"] .panel[data-tab="trade"],
  body[data-tab="portfolio"] .panel[data-tab="portfolio"],
  body[data-tab="calls"] .panel[data-tab="calls"] { display: block; }
  body[data-tab="trade"] #p-mycall.is-empty { display: none; }
  #p-quote { order: 1; } #p-chart { order: 2; } #p-depth { order: 3; }
  #p-mycall { order: 4; } #p-ticket { order: 5; } #p-orders { order: 6; }
  #p-portfolio { order: 7; } #p-calls { order: 8; }
  .footer { display: none; }
  .replay-note { display: block; }
  .q-px { font-size: 30px; }
  .chart-box { height: 196px; }
  .dl-head, .dl-row { grid-template-columns: 1fr 58px 58px 1fr; }
  .dl-row { height: 24px; }
  .t-grid2, .t-grid2.t-sl { grid-template-columns: 1fr; }
  .orders, .calls { max-height: none; overflow: visible; }
  .call-sum { grid-template-columns: 62px minmax(0, 1fr) auto 12px; column-gap: 10px; }
  .cd-cols { grid-template-columns: 1fr; gap: 4px; }
  .kpi b { font-size: 16px; }
  .col-last { display: none; }
  .pf-pos td, .pf-pos th { font-size: 12.5px; padding-left: 4px; padding-right: 4px; }
  .pf-session { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
  .toasts { top: calc(env(safe-area-inset-top) + 104px); left: 10px; right: 10px; align-items: stretch; }
  .toast { max-width: none; }

  .tabbar {
    display: grid; grid-template-columns: repeat(4, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    height: calc(60px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: rgba(11, 14, 19, .96); border-top: 1px solid var(--line);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  }
  .tabbar button {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    border: 0; background: none; color: var(--faint); font-size: 10.5px; font-weight: 650; cursor: pointer;
  }
  .tabbar svg { width: 23px; height: 23px; }
  .tabbar button.on { color: var(--text); }
  .tabbar button.on::before { content: ""; position: absolute; top: 0; left: 50%; width: 26px; height: 2px; margin-left: -13px; border-radius: 0 0 2px 2px; background: var(--accent); }
  .tab-dot { position: absolute; top: 9px; left: calc(50% + 9px); width: 8px; height: 8px; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 2px var(--bg); animation: pulse 1s ease-in-out infinite; }
}

/* ---------- v0.2: more stocks, order kinds, overlapping-call notes, fees ---------- */
.symbar { display: flex; align-items: center; gap: 6px; padding: 10px 16px 0; overflow-x: auto; scrollbar-width: none; }
.symbar::-webkit-scrollbar { display: none; }
.symbar button {
  position: relative; flex: none; display: inline-flex; align-items: center; gap: 8px;
  height: 32px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line-2);
  background: var(--panel); color: var(--text-2); cursor: pointer; font-size: 13px;
}
.symbar button:hover { border-color: #3b4859; color: var(--text); }
.symbar button.on { border-color: rgba(79,143,247,.75); background: var(--accent-dim); color: var(--text); }
.sb-sym { font-weight: 800; letter-spacing: .04em; }
.sb-px { font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.symbar button.on .sb-px { color: var(--text-2); }
.sb-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--live); animation: pulse 1s ease-in-out infinite; }
.sb-dot.mine { background: var(--accent); }

.flag-more {
  flex: none; display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 5px;
  font-size: 11px; font-weight: 700; white-space: nowrap; background: rgba(255,255,255,.07); color: var(--text-2);
}
.flag[data-state="live"] .flag-more, .flag[data-state="auction"] .flag-more { background: rgba(242,179,61,.16); color: var(--live-text); }

.seg-kind { display: grid; grid-template-columns: 1fr 1fr; }
.seg-kind button { height: 32px; font-size: 12.5px; font-weight: 700; letter-spacing: .03em; }
.seg-kind button.on { background: var(--accent-dim); color: var(--accent-text); box-shadow: inset 0 0 0 1px rgba(79,143,247,.55); }
.t-note { margin: 0; padding: 8px 11px; border-radius: 8px; font-size: 12.5px; line-height: 1.5; background: var(--bg-2); border: 1px solid var(--line); color: var(--text-2); }
.t-note[data-tone="live"] { background: rgba(242,179,61,.07); border-color: rgba(242,179,61,.32); color: var(--live-text); }

.src-host-to-host { background: #3fc9c1; }
.src-dealer, .src-on-demand-dealer, .src-on-demand { background: #e27fd0; }
.leg-call { margin-left: 6px; font-size: 11px; color: var(--faint); font-family: var(--mono); }
.out-FilledHostToHost { background: rgba(63,201,193,.15); color: #7fe3dc; }
.chip.early { background: transparent; color: var(--text-2); box-shadow: inset 0 0 0 1px var(--line-2); }
.chip.kind-od { background: rgba(226,127,208,.14); color: #f0a6e2; }
.out-od-NoQuote, .out-od-CapExpired { background: var(--live-dim); color: var(--live-text); }
.res-outcome .chip { margin-left: 8px; vertical-align: 2px; }
.od-line { margin: 0 0 10px; font-size: 12.5px; color: var(--muted); }
.o-sym { font-weight: 800; letter-spacing: .03em; font-size: 12px; color: var(--text-2); }

#p-calls { container-type: inline-size; }
@container (max-width: 560px) { .cd-cols { grid-template-columns: 1fr; gap: 4px; } }
.cmp-tbl { font-size: 13px; }
.cmp-tbl th { padding-top: 0; }
.cmp-tbl td { vertical-align: top; padding-top: 7px; padding-bottom: 7px; color: var(--text-2); }
.cmp-tbl td:first-child { white-space: normal; }
.cmp-tbl td small { display: block; font-size: 11px; color: var(--faint); font-weight: 500; }
.cmp-tbl td.num b { font-size: 14px; color: var(--text); }
.cmp-tbl tr.tot td { color: var(--text); }
.cmp-tbl tr.tot td.pos, .cmp-tbl tr.tot td.pos small { color: var(--buy-text); }
.cmp-tbl tr.tot td.neg, .cmp-tbl tr.tot td.neg small { color: var(--sell-text); }
.cmp-lead { margin: 8px 0 0; padding-top: 8px; border-top: 1px solid var(--line); font-weight: 650; color: var(--text-2); }
.cmp-lead.pos { color: var(--buy-text); }
.cmp-lead.neg { color: var(--sell-text); }
.cmp-fees, .cmp-credit { margin: 6px 0 0; font-size: 11.5px; color: var(--faint); line-height: 1.5; }
.cmp-credit { color: var(--accent-text); }

@media (max-width: 760px) {
  .symbar { padding: 7px 10px 0; gap: 5px; }
  .symbar button { height: 30px; padding: 0 10px; font-size: 12.5px; gap: 6px; }
  .flag-more { height: 18px; padding: 0 5px; font-size: 10px; }
  .cmp-tbl { font-size: 12.5px; }
  .cmp-tbl td.num b { font-size: 13.5px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
