/* Tradion FX. Type scale 11 / 12 / 13 / 14 / 16 / 20, spacing on a 4px grid. */
:root {
  --font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  --up: #22ab94; --down: #f23645; --accent: #3d7bfa; --accent-2: #2f6ae6; --warn: #f0a04b;
  --r: 6px; --r-lg: 10px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --top-h: 52px; --st-h: 28px; --tools-w: 46px; --watch-w: 300px;
}
body.dark {
  --bg-0: #0b0e14; --bg-1: #11151c; --bg-2: #171c25; --bg-3: #1e2430; --line: #222936; --line-2: #2c3444;
  --text: #e6e9ef; --text-2: #9aa4b2; --text-3: #687283; --shadow: 0 12px 32px rgba(0, 0, 0, .45), 0 2px 6px rgba(0, 0, 0, .3);
  --sk: #1a202a; --sk-hi: #242b37; --up-bg: rgba(34, 171, 148, .14); --down-bg: rgba(242, 54, 69, .14); --accent-bg: rgba(61, 123, 250, .14);
  color-scheme: dark;
}
body:not(.dark) {
  --bg-0: #f3f5f8; --bg-1: #ffffff; --bg-2: #f1f3f7; --bg-3: #e8ebf1; --line: #e3e7ee; --line-2: #d5dbe5;
  --text: #131722; --text-2: #556070; --text-3: #8a93a3; --shadow: 0 12px 32px rgba(16, 24, 40, .14), 0 2px 6px rgba(16, 24, 40, .06);
  --sk: #eceff4; --sk-hi: #f7f8fa; --up-bg: rgba(34, 171, 148, .1); --down-bg: rgba(242, 54, 69, .1); --accent-bg: rgba(61, 123, 250, .1);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  font: 13px/1.4 var(--font); color: var(--text); background: var(--bg-0);
  -webkit-font-smoothing: antialiased; font-feature-settings: "tnum" 1, "cv11" 1;
  display: flex; flex-direction: column; height: 100dvh;
  transition: background-color .25s var(--ease), color .25s var(--ease);
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.muted { color: var(--text-3); }
.sm { font-size: 11px; }
.grow { flex: 1; }
.ic { width: 20px; height: 20px; display: block; flex: none; }
.ic-wrap { display: inline-flex; align-items: center; justify-content: center; }
.ic-wrap.sm .ic { width: 16px; height: 16px; }
.up { color: var(--up); } .down { color: var(--down); }
::selection { background: var(--accent-bg); }

/* ---------------------------------------------------------------- top bar */
#top {
  height: var(--top-h); flex: none; display: flex; align-items: center; gap: 4px; padding: 0 10px 0 12px;
  background: var(--bg-1); border-bottom: 1px solid var(--line); position: relative; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--text); margin-right: 10px; }
.brand .mark svg { width: 28px; height: 28px; display: block; }
.brand .word { font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.brand .word b { font-weight: 700; color: var(--accent); margin-left: 2px; }
.sym { display: flex; flex-direction: column; align-items: flex-start; padding: 4px 10px; border-radius: var(--r); min-width: 132px; transition: background .15s; }
.sym:hover { background: var(--bg-2); }
.sym-main { display: flex; align-items: center; gap: 4px; font-size: 15px; font-weight: 650; letter-spacing: -.01em; }
.sym-main .ic { width: 16px; height: 16px; color: var(--text-3); }
.sym-sub { font-size: 11px; color: var(--text-3); white-space: nowrap; }
.quote { display: flex; flex-direction: column; justify-content: center; min-width: 118px; padding: 0 8px; }
.qprice { font: 600 17px/1.15 var(--font); letter-spacing: -.01em; display: inline-flex; align-items: baseline; }
.qchg { font-size: 11px; font-weight: 500; color: var(--text-3); min-height: 15px; }
.vsep { width: 1px; height: 24px; background: var(--line); margin: 0 6px; flex: none; }
.tfs { display: flex; gap: 2px; }
.tfs button { height: 30px; min-width: 34px; padding: 0 8px; border-radius: var(--r); color: var(--text-2); font-weight: 550; font-size: 12.5px; position: relative; transition: color .15s, background .15s; }
.tfs button:hover { background: var(--bg-2); color: var(--text); }
.tfs button.on { color: var(--accent); background: var(--accent-bg); }
.tb { height: 32px; display: inline-flex; align-items: center; gap: 6px; padding: 0 9px; border-radius: var(--r); color: var(--text-2); font-weight: 500; white-space: nowrap; transition: color .15s, background .15s; }
.tb:hover { background: var(--bg-2); color: var(--text); }
.tb.on { color: var(--accent); }
.tb.on .lbl { color: var(--text); }
.tb.icon { width: 32px; padding: 0; justify-content: center; }
.tb .ic { width: 19px; height: 19px; }
.tb.acct.in { color: var(--text); }
.avatar { width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.tf-mobile, .show-m { display: none !important; }

/* price digits: big figure, pips emphasised, pipette small */
.px { display: inline-flex; align-items: baseline; white-space: nowrap; }
.px .pp { font-size: 1.18em; font-weight: 700; }
.px .pt { font-size: .72em; vertical-align: super; margin-left: 1px; position: relative; top: -.38em; }
.px .ch { display: inline-block; }
.px .ch.ru { animation: rollUp .42s var(--ease); color: var(--up); }
.px .ch.rd { animation: rollDown .42s var(--ease); color: var(--down); }
@keyframes rollUp { 0% { transform: translateY(55%); opacity: 0; } 60% { opacity: 1; } 100% { transform: none; } }
@keyframes rollDown { 0% { transform: translateY(-55%); opacity: 0; } 60% { opacity: 1; } 100% { transform: none; } }
.qprice.tick-up { color: var(--up); } .qprice.tick-down { color: var(--down); }
.qprice { transition: color .6s var(--ease); }

/* ---------------------------------------------------------------- main area */
#main { flex: 1; display: flex; min-height: 0; position: relative; }
#tools {
  width: var(--tools-w); flex: none; background: var(--bg-1); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; padding: 6px 0; gap: 2px; overflow-y: auto; scrollbar-width: none;
}
#tools::-webkit-scrollbar { display: none; }
.tool { width: 36px; height: 34px; flex: none; border-radius: var(--r); display: flex; align-items: center; justify-content: center; color: var(--text-2); position: relative; transition: background .15s, color .15s; }
.tool:hover { background: var(--bg-2); color: var(--text); }
.tool.on { background: var(--accent-bg); color: var(--accent); }
.tool.dim { opacity: .35; pointer-events: none; }
.tool .ic { width: 20px; height: 20px; }
.tool-sep { width: 24px; height: 1px; background: var(--line); margin: 5px 0; flex: none; }
.tip {
  position: fixed; z-index: 90; pointer-events: none; background: #131722; color: #fff; font-size: 12px; padding: 5px 9px; border-radius: 5px;
  white-space: nowrap; opacity: 0; transform: translateX(-4px); transition: opacity .12s, transform .12s var(--ease); box-shadow: 0 4px 12px rgba(0, 0, 0, .25);
}
.tip.show { opacity: 1; transform: none; }
.tip kbd { font: 11px var(--font); color: #9aa4b2; margin-left: 8px; }

#stage { flex: 1; position: relative; min-width: 0; background: var(--bg-1); }
#chart { position: absolute; inset: 0; }
.legend {
  position: absolute; left: 12px; top: 8px; z-index: 5; pointer-events: none; display: flex; flex-direction: column; gap: 3px; max-width: calc(100% - 90px);
}
.lg-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12px; }
.lg-title { font-weight: 650; font-size: 13px; color: var(--text); }
.lg-title .muted { font-weight: 500; }
.lg-ohlc { display: flex; gap: 9px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.lg-ohlc b { font-weight: 500; margin-left: 3px; }
.lg-meta { display: flex; gap: 8px; align-items: center; color: var(--text-3); font-size: 11.5px; }
.pill { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 7px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); color: var(--text-2); font-size: 11px; font-weight: 550; white-space: nowrap; }
.pill .ic { width: 13px; height: 13px; }
.pill.live { color: var(--up); }
.pill.closed { color: var(--warn); }
.pill .pdot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.live .pdot { animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(34, 171, 148, .55); } 70% { box-shadow: 0 0 0 6px rgba(34, 171, 148, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 171, 148, 0); } }
.lg-ind { display: flex; flex-direction: column; gap: 2px; }

/* skeleton while a chart loads */
.skeleton { position: absolute; inset: 0; z-index: 6; background: var(--bg-1); display: flex; align-items: flex-end; padding: 70px 64px 40px 24px; opacity: 1; transition: opacity .35s var(--ease); }
.skeleton.gone { opacity: 0; pointer-events: none; }
.sk-bars { flex: 1; height: 100%; display: flex; align-items: center; gap: 4px; }
.sk-bars i { flex: 1; border-radius: 2px; background: var(--sk); position: relative; overflow: hidden; }
.sk, .sk-bars i::after { background: linear-gradient(90deg, transparent, var(--sk-hi), transparent); }
.sk-bars i::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); animation: shimmer 1.4s infinite; }
.sk { display: inline-block; height: 1em; border-radius: 4px; background-color: var(--sk); background-size: 200% 100%; animation: shimmerBg 1.4s infinite; }
.sk-text { height: 14px; }
@keyframes shimmer { to { transform: translateX(100%); } }
@keyframes shimmerBg { 0% { background-position: 150% 0; } 100% { background-position: -50% 0; } }
.sk-label { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; gap: 10px; align-items: center; color: var(--text-2); background: var(--bg-1); border: 1px solid var(--line); padding: 8px 14px; border-radius: 20px; box-shadow: var(--shadow); font-weight: 500; }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.closed-banner {
  position: absolute; z-index: 5; left: 50%; top: 12px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px;
  background: var(--bg-1); border: 1px solid var(--line-2); border-radius: 22px; padding: 6px 8px 6px 14px; box-shadow: var(--shadow); font-size: 12.5px;
  animation: dropIn .4s var(--ease);
}
.closed-banner .ic { width: 16px; height: 16px; color: var(--warn); }
.closed-banner b { font-weight: 650; }
.closed-banner .cd { font-variant-numeric: tabular-nums; color: var(--text-2); background: var(--bg-2); border-radius: 12px; padding: 2px 9px; }
@keyframes dropIn { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }
.chip-btn { position: absolute; z-index: 5; right: 72px; bottom: 34px; height: 24px; padding: 0 10px; border-radius: 12px; background: var(--bg-1); border: 1px solid var(--line-2); color: var(--text-2); font-size: 11px; font-weight: 600; box-shadow: var(--shadow); }
.fab-live { position: absolute; z-index: 5; right: 74px; bottom: 64px; width: 30px; height: 30px; border-radius: 50%; background: var(--bg-1); border: 1px solid var(--line-2); display: flex; align-items: center; justify-content: center; color: var(--text-2); box-shadow: var(--shadow); animation: fadeIn .2s; }
.fab-live .ic { width: 16px; height: 16px; }

/* edit bar for the selected drawing */
.editbar {
  position: absolute; z-index: 8; top: 56px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 2px; padding: 4px;
  background: var(--bg-1); border: 1px solid var(--line-2); border-radius: 8px; box-shadow: var(--shadow); animation: dropIn .22s var(--ease);
}
.editbar button { height: 30px; min-width: 30px; padding: 0 6px; border-radius: 5px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; color: var(--text-2); }
.editbar button:hover { background: var(--bg-2); color: var(--text); }
.editbar button.on { color: var(--accent); }
.editbar .ic { width: 18px; height: 18px; }
.editbar .sw { width: 16px; height: 16px; border-radius: 4px; border: 1px solid rgba(127, 127, 127, .35); }
.editbar .wv { font-size: 11px; font-weight: 600; }
.editbar .sep { width: 1px; height: 18px; background: var(--line); margin: 0 3px; }
.editbar .danger:hover { color: var(--down); }

/* ---------------------------------------------------------------- watchlist */
#watch { width: var(--watch-w); flex: none; background: var(--bg-1); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.w-head { padding: 12px 12px 8px; display: flex; flex-direction: column; gap: 10px; }
.w-title { font-size: 12px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--text-2); }
.w-title.sm { font-size: 11px; display: flex; justify-content: space-between; text-transform: uppercase; }
.w-title .muted { text-transform: none; letter-spacing: 0; font-weight: 500; }
.seg { display: flex; background: var(--bg-2); border-radius: 7px; padding: 2px; gap: 2px; }
.seg button { flex: 1; height: 26px; border-radius: 5px; font-size: 12px; font-weight: 550; color: var(--text-2); transition: background .15s, color .15s, box-shadow .15s; }
.seg button.on { background: var(--bg-1); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .18); }
body.dark .seg button.on { background: var(--bg-3); }
.seg.pad { margin: 0 16px 8px; }
.seg.mini button { height: 24px; min-width: 38px; flex: none; }
.w-cols { display: grid; grid-template-columns: 1fr 96px 62px; padding: 0 14px 6px; font-size: 11px; color: var(--text-3); border-bottom: 1px solid var(--line); }
.w-cols span:not(:first-child) { text-align: right; }
.w-list { flex: 1; overflow-y: auto; min-height: 80px; }
.w-row { display: grid; grid-template-columns: 1fr 96px 62px; align-items: center; width: 100%; padding: 7px 14px; text-align: left; border-left: 2px solid transparent; transition: background .2s; position: relative; }
.w-row:hover { background: var(--bg-2); }
.w-row.on { background: var(--accent-bg); border-left-color: var(--accent); }
.w-row .nm { display: flex; flex-direction: column; min-width: 0; }
.w-row .nm b { font-weight: 600; font-size: 12.5px; }
.w-row .nm span { font-size: 10.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-row .bid { text-align: right; font-size: 12.5px; }
.w-row .chg { text-align: right; font-size: 11.5px; font-weight: 550; }
.w-row.fl-up { animation: flUp .7s var(--ease); }
.w-row.fl-down { animation: flDown .7s var(--ease); }
@keyframes flUp { from { background: var(--up-bg); } }
@keyframes flDown { from { background: var(--down-bg); } }
.w-row .chg .badge { display: inline-block; min-width: 54px; padding: 2px 5px; border-radius: 4px; text-align: center; }
.w-row .chg .badge.up { background: var(--up-bg); } .w-row .chg .badge.down { background: var(--down-bg); }
.w-sess { border-top: 1px solid var(--line); padding: 12px 14px 12px; display: flex; flex-direction: column; gap: 8px; }
.sess-row { display: grid; grid-template-columns: 10px 1fr auto; gap: 8px; align-items: center; font-size: 12px; }
.sess-row .sw { width: 8px; height: 8px; border-radius: 2px; }
.sess-row .nm b { font-weight: 600; }
.sess-row .nm span { color: var(--text-3); font-size: 11px; margin-left: 6px; }
.sess-row .stt { font-size: 11px; color: var(--text-3); text-align: right; font-variant-numeric: tabular-nums; }
.sess-row .stt.open { color: var(--up); font-weight: 600; }
.sess-bar { grid-column: 2 / 4; height: 3px; border-radius: 2px; background: var(--bg-3); overflow: hidden; margin-top: -3px; }
.sess-bar i { display: block; height: 100%; border-radius: 2px; transition: width 1s linear; }

/* ---------------------------------------------------------------- status bar */
#status { height: var(--st-h); flex: none; display: flex; align-items: center; gap: 10px; padding: 0 12px; background: var(--bg-1); border-top: 1px solid var(--line); font-size: 11.5px; color: var(--text-2); }
.st-item { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.st-item .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); }
.st-item.open .dot { background: var(--up); animation: pulse 1.6s infinite; }
.st-item.closed .dot { background: var(--warn); }
.st-item b { color: var(--text); font-weight: 600; }
.st-sep { width: 1px; height: 14px; background: var(--line); }
.st-btn { height: 22px; padding: 0 8px; border-radius: 5px; font-variant-numeric: tabular-nums; }
.st-btn:hover { background: var(--bg-2); color: var(--text); }
.st-btn .ic { width: 14px; height: 14px; }

/* ---------------------------------------------------------------- menu, dialogs, drawer, sheet */
.menu {
  position: fixed; z-index: 70; min-width: 200px; max-height: 70vh; overflow-y: auto; padding: 5px; background: var(--bg-1); border: 1px solid var(--line-2);
  border-radius: 9px; box-shadow: var(--shadow); opacity: 0; transform: translateY(-4px) scale(.98); transform-origin: top left; pointer-events: none;
  transition: opacity .14s var(--ease), transform .14s var(--ease);
}
.menu.open { opacity: 1; transform: none; pointer-events: auto; }
.mhead { font-size: 11px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); padding: 8px 10px 4px; }
.mitem { width: 100%; display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 6px; text-align: left; color: var(--text); font-size: 13px; }
.mitem:hover { background: var(--bg-2); }
.mitem .ic { width: 18px; height: 18px; color: var(--text-2); }
.mitem .r { margin-left: auto; color: var(--text-3); font-size: 11.5px; }
.mitem .ck { margin-left: auto; color: var(--accent); opacity: 0; }
.mitem.on .ck { opacity: 1; }
.mitem.on { color: var(--accent); }
.mitem.on .ic { color: var(--accent); }
.msep { height: 1px; background: var(--line); margin: 5px 4px; }
.swatches { display: grid; grid-template-columns: repeat(8, 22px); gap: 6px; padding: 8px; }
.swatches button { width: 22px; height: 22px; border-radius: 5px; border: 1px solid rgba(127, 127, 127, .3); transition: transform .12s; }
.swatches button:hover { transform: scale(1.12); }
.swatches button.on { box-shadow: 0 0 0 2px var(--bg-1), 0 0 0 3.5px var(--accent); }
.toggle { margin-left: auto; width: 30px; height: 18px; border-radius: 9px; background: var(--line-2); position: relative; transition: background .18s; flex: none; }
.toggle::after { content: ""; position: absolute; left: 2px; top: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .18s var(--ease); box-shadow: 0 1px 2px rgba(0, 0, 0, .3); }
.on > .toggle, .toggle.on { background: var(--accent); }
.on > .toggle::after, .toggle.on::after { transform: translateX(12px); }

.scrim { position: fixed; inset: 0; z-index: 60; background: rgba(5, 8, 14, .5); opacity: 0; pointer-events: none; transition: opacity .2s var(--ease); }
.scrim.open { opacity: 1; pointer-events: auto; }
.dlg { position: fixed; inset: 0; z-index: 80; display: flex; align-items: flex-start; justify-content: center; padding: 9vh 16px 16px; background: rgba(5, 8, 14, .5); opacity: 0; pointer-events: none; transition: opacity .2s var(--ease); }
.dlg.open { opacity: 1; pointer-events: auto; }
.dlg-card { width: 460px; max-width: 100%; max-height: 78vh; display: flex; flex-direction: column; background: var(--bg-1); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow); transform: translateY(10px) scale(.985); transition: transform .24s var(--ease); overflow: hidden; }
.dlg.open .dlg-card { transform: none; }
.dlg-card.wide { width: 560px; }
.dlg-card.narrow { width: 380px; }
.dlg-head { display: flex; align-items: center; padding: 16px 16px 12px 20px; }
.dlg-head h2, .dr-head h2 { margin: 0; font-size: 16px; font-weight: 650; letter-spacing: -.01em; flex: 1; }
.x { width: 30px; height: 30px; border-radius: 6px; display: flex; align-items: center; justify-content: center; color: var(--text-2); }
.x:hover { background: var(--bg-2); color: var(--text); }
.x .ic { width: 18px; height: 18px; }
.dlg-foot { display: flex; gap: 8px; padding: 12px 16px 16px; border-top: 1px solid var(--line); }
.search { display: flex; align-items: center; gap: 8px; margin: 0 16px 12px; padding: 0 12px; height: 38px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--bg-0); transition: border-color .15s, box-shadow .15s; }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.search .ic { width: 18px; height: 18px; color: var(--text-3); }
.search input { flex: 1; border: 0; outline: 0; background: none; font-size: 14px; }
.sym-list { overflow-y: auto; padding: 0 8px 10px; }
.sym-row { display: grid; grid-template-columns: 34px 1fr auto 70px; gap: 12px; align-items: center; width: 100%; padding: 9px 10px; border-radius: 7px; text-align: left; transition: background .12s; }
.sym-row:hover, .sym-row.kb { background: var(--bg-2); }
.sym-row.on { background: var(--accent-bg); }
.ccy { width: 34px; height: 34px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; letter-spacing: .02em; color: #fff; position: relative; overflow: hidden; }
.ccy i { position: absolute; inset: 0; font-style: normal; display: flex; align-items: flex-start; justify-content: flex-start; padding: 4px 0 0 4px; }
.ccy i + i { align-items: flex-end; justify-content: flex-end; padding: 0 4px 4px 0; }
.sym-row .nm b { display: block; font-weight: 650; font-size: 13.5px; }
.sym-row .nm span { font-size: 11.5px; color: var(--text-3); }
.sym-row .bid { font-size: 13px; text-align: right; }
.sym-row .chg { text-align: right; font-size: 12px; font-weight: 550; }
.empty { padding: 30px; text-align: center; color: var(--text-3); }

.ind-list { overflow-y: auto; padding: 0 8px 12px; }
.ind-sec { font-size: 11px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); padding: 10px 12px 6px; }
.ind-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 12px; border-radius: 7px; text-align: left; }
.ind-row:hover { background: var(--bg-2); }
.ind-row .nm { flex: 1; }
.ind-row .nm b { font-weight: 600; }
.ind-row .nm span { display: block; font-size: 11.5px; color: var(--text-3); }
.ind-row .cog { width: 28px; height: 28px; border-radius: 6px; display: flex; align-items: center; justify-content: center; color: var(--text-3); }
.ind-row .cog:hover { background: var(--bg-3); color: var(--text); }
.ind-row .cog .ic { width: 17px; height: 17px; }

.form { padding: 4px 20px 16px; display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--text-2); font-weight: 500; }
.input { height: 38px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--bg-0); color: var(--text); font-size: 14px; outline: 0; width: 100%; transition: border-color .15s, box-shadow .15s; font-variant-numeric: tabular-nums; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.input.sel { text-align: left; display: flex; align-items: center; justify-content: space-between; cursor: pointer; }
.input.sel .ic { width: 16px; height: 16px; color: var(--text-3); }
.frow { display: grid; grid-template-columns: 1fr 120px; gap: 10px; align-items: center; font-size: 13px; }
.frow .cols { display: flex; gap: 6px; }
.frow .colr { width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--line-2); }
.btn { height: 36px; padding: 0 16px; border-radius: 8px; background: var(--accent); color: #fff; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: background .15s, transform .1s; }
.btn:hover { background: var(--accent-2); }
.btn:active { transform: scale(.98); }
.btn.ghost { background: transparent; color: var(--text-2); border: 1px solid var(--line-2); }
.btn.ghost:hover { background: var(--bg-2); color: var(--text); }
.btn.block { width: 100%; }

.drawer { position: fixed; z-index: 75; top: 0; right: 0; bottom: 0; width: 380px; max-width: 100%; background: var(--bg-1); border-left: 1px solid var(--line-2); box-shadow: var(--shadow); transform: translateX(104%); transition: transform .3s var(--ease); display: flex; flex-direction: column; }
.drawer.open { transform: none; }
.dr-head { display: flex; align-items: flex-start; gap: 10px; padding: 18px 16px 14px 20px; border-bottom: 1px solid var(--line); }
.dr-head h2 { margin-bottom: 2px; }
.dr-body { padding: 16px 20px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.addon { display: flex; gap: 6px; align-items: center; }
.addon .input { flex: 1; min-width: 0; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; }
.quick button { height: 26px; padding: 0 10px; border-radius: 13px; border: 1px solid var(--line-2); color: var(--text-2); font-size: 12px; font-weight: 550; }
.quick button:hover { border-color: var(--accent); color: var(--accent); }
.result { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.res-main { padding: 14px 16px; background: var(--bg-2); display: flex; align-items: flex-end; justify-content: space-between; }
.res-main .k { font-size: 11px; color: var(--text-3); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.res-main .v { font-size: 28px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.res-main .v small { font-size: 13px; font-weight: 600; color: var(--text-2); margin-left: 4px; }
.res-grid { display: grid; grid-template-columns: 1fr 1fr; }
.res-grid div { padding: 10px 16px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.res-grid div:nth-child(odd) { border-right: 1px solid var(--line); }
.res-grid span { font-size: 11px; color: var(--text-3); }
.res-grid b { font-size: 14px; font-weight: 600; }
.note { font-size: 11.5px; color: var(--text-3); line-height: 1.5; }
.note.warn { color: var(--warn); }

.sheet { position: fixed; z-index: 75; left: 0; right: 0; bottom: 0; background: var(--bg-1); border-top: 1px solid var(--line-2); border-radius: 16px 16px 0 0; box-shadow: var(--shadow); transform: translateY(104%); transition: transform .3s var(--ease); padding: 8px 12px calc(16px + env(safe-area-inset-bottom)); }
.sheet.open { transform: none; }
.sheet-grip { width: 36px; height: 4px; border-radius: 2px; background: var(--line-2); margin: 2px auto 12px; }
.sheet-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.sheet-grid button { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px; border-radius: 10px; font-size: 11.5px; color: var(--text-2); }
.sheet-grid button .ic { width: 22px; height: 22px; }
.sheet-grid button:active, .sheet-grid button:hover { background: var(--bg-2); }
.sheet-grid button.on { color: var(--accent); background: var(--accent-bg); }

.toast { position: fixed; z-index: 95; left: 50%; bottom: 46px; transform: translate(-50%, 12px); background: #131722; color: #fff; padding: 9px 16px; border-radius: 8px; font-size: 12.5px; font-weight: 500; box-shadow: 0 8px 24px rgba(0, 0, 0, .3); opacity: 0; pointer-events: none; transition: opacity .2s var(--ease), transform .2s var(--ease); max-width: calc(100% - 32px); }
body.dark .toast { background: #e6e9ef; color: #131722; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@keyframes fadeIn { from { opacity: 0; } }

/* first paint: fade the shell in */
body.booting #main, body.booting #top, body.booting #status { opacity: 0; }
#main, #top, #status { transition: opacity .35s var(--ease); }

/* ---------------------------------------------------------------- tablet: watchlist off-canvas */
@media (max-width: 1180px) {
  #watch { position: absolute; right: 0; top: 0; bottom: 0; z-index: 30; transform: translateX(100%); transition: transform .3s var(--ease); box-shadow: var(--shadow); }
  body.watch-open #watch { transform: none; }
  .tb .lbl { display: none; }
  .tb { padding: 0 7px; }
}

/* ---------------------------------------------------------------- phone */
@media (max-width: 760px) {
  :root { --top-h: 54px; --st-h: 26px; }
  #top { padding: 0 6px 0 8px; gap: 2px; }
  .brand { margin-right: 2px; }
  .brand .word { display: none; }
  .brand .mark svg { width: 26px; height: 26px; }
  .sym { min-width: 0; padding: 4px 6px; }
  .sym-main { font-size: 14px; }
  .sym-sub { display: none; }
  .quote { min-width: 0; padding: 0 4px; flex: 1; }
  .qprice { font-size: 15px; }
  .vsep, .tfs, .hide-m { display: none !important; }
  .tf-mobile { display: inline-flex !important; font-weight: 650; color: var(--text); padding: 0 6px; gap: 2px; }
  .show-m { display: inline-flex !important; }
  #main { flex-direction: column-reverse; }
  #tools { width: auto; height: 44px; flex-direction: row; border-right: 0; border-top: 1px solid var(--line); padding: 0 6px; overflow-x: auto; overflow-y: hidden; }
  .tool { width: 38px; height: 36px; }
  .tool-sep { width: 1px; height: 22px; margin: 0 4px; }
  .legend { left: 8px; top: 6px; max-width: calc(100% - 70px); }
  .lg-row { gap: 6px; font-size: 11px; }
  .lg-ohlc { gap: 6px; }
  .closed-banner { top: auto; bottom: 14px; font-size: 11.5px; white-space: nowrap; }
  .lg-meta.idle { display: none; }
  .qchg { white-space: nowrap; }
  .editbar { top: auto; bottom: 10px; max-width: calc(100% - 16px); overflow-x: auto; }
  .dlg { padding: 0; align-items: flex-end; }
  .dlg-card, .dlg-card.wide, .dlg-card.narrow { width: 100%; max-height: 88vh; border-radius: 16px 16px 0 0; transform: translateY(40px); padding-bottom: env(safe-area-inset-bottom); }
  .drawer { width: 100%; top: auto; height: 88vh; border-radius: 16px 16px 0 0; transform: translateY(104%); }
  .sym-row { grid-template-columns: 34px 1fr auto 62px; gap: 10px; }
  #status { font-size: 11px; }
  .chip-btn { right: 64px; bottom: 30px; }
  .fab-live { right: 66px; bottom: 58px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
