:root {
  --bg: #131722; --panel: #1e222d; --panel2: #2a2e39; --hover: rgba(255,255,255,.075); --line: #2a2e39; --text: #d1d4dc; --muted: #787b86;
  --gold: #2962ff; --gold2: #5b84ff; --up: #089981; --down: #f23645; --blue: #2962ff; --chartbg: #131722; --charttext: #d1d4dc;
  --font: -apple-system, BlinkMacSystemFont, "Trebuchet MS", Roboto, Ubuntu, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 13px/1.35 var(--font); }
body { display: flex; flex-direction: column; overflow: hidden; -webkit-font-smoothing: antialiased; }
button, select, input, textarea { font: inherit; color: var(--text); }
button { background: transparent; border: 0; border-radius: 6px; cursor: pointer; color: var(--text); }
button:disabled { opacity: .35; cursor: default; }
button:focus-visible, a:focus-visible, select:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
i[data-ic], .m-ic, .tg button { display: inline-flex; align-items: center; justify-content: center; }
svg { display: block; flex-shrink: 0; }
select, input:not([type=checkbox]):not([type=color]):not([type=range]), textarea {
  background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; outline: none; }
select:focus, input:focus, textarea:focus { border-color: var(--blue); }
input[type=color] { width: 30px; height: 26px; padding: 1px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel2); cursor: pointer; }
.muted { color: var(--muted); } .small { font-size: 12px; } .pad { padding: 10px 12px; }
.up { color: var(--up) !important; } .dn { color: var(--down) !important; }
.spacer { flex: 1; }
.vsep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; flex-shrink: 0; }
button.primary { background: var(--blue); color: #fff; padding: 8px 16px; font-weight: 600; }
button.primary:hover { background: #1e53e5; }
button.primary.danger { background: var(--down); }
button.wide { width: 100%; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 9px; border: 1px solid var(--line); }
button.wide.primary { border: 0; }

/* ---------------- top bar ---------------- */
#topbar { height: 44px; display: flex; align-items: center; gap: 2px; padding: 0 6px; background: var(--panel); border-bottom: 1px solid var(--line);
  overflow-x: auto; overflow-y: hidden; scrollbar-width: none; flex-shrink: 0; }
#topbar::-webkit-scrollbar { display: none; }
.brand { display: flex; align-items: center; margin-right: 4px; text-decoration: none; flex-shrink: 0; }
.logo { background: linear-gradient(135deg, var(--gold), var(--gold2)); color: #1a1405; font-weight: 900; padding: 4px 7px; border-radius: 7px; letter-spacing: .5px; font-size: 12px; }
.tb { height: 34px; min-width: 34px; padding: 0 8px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; border-radius: 6px; white-space: nowrap; flex-shrink: 0; text-decoration: none; color: var(--text); }
.tb:hover:not(:disabled) { background: var(--hover); }
.tb:active:not(:disabled), .bb:active { background: rgba(41,98,255,.16); }
.tb.on, .tb.caret.on { color: var(--gold); }
.tb.sym { font-weight: 700; font-size: 14px; padding: 0 10px 0 6px; }
.tb.sym b { letter-spacing: .3px; }
.tb.caret svg:last-child { opacity: .6; margin-left: -2px; }
.tfb { min-width: 34px; font-weight: 600; padding: 0 7px; }
.tfb.on { color: var(--gold); background: rgba(242,182,54,.1); }
.grp { display: flex; align-items: center; gap: 1px; }
.tb.user { color: var(--muted); border: 1px solid var(--line); margin-left: 4px; font-size: 12px; }
#btnReplay.on { color: #9bb6ff; background: rgba(41,98,255,.15); }

/* ---------------- layout ---------------- */
#main { flex: 1; display: flex; min-height: 0; position: relative; }
#center { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--chartbg); }
#chartWrap { position: relative; flex: 1; min-height: 0; }
#chart { position: absolute; inset: 0; }
#overlay { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 3; }
/* Pine Script tables (Bot A Scanner, ATA Structure) - same look as on TradingView */
#indTables { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 3; }
.pine-tbl { position: absolute; border-collapse: separate; border-spacing: 1px; font: 400 10px -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--charttext); }
.pine-tbl td { padding: 2px 5px; text-align: center; white-space: nowrap; font-size: inherit; color: inherit; }
.pine-tbl td.l { text-align: left; }
.pine-tbl td.sm { font-size: 12px; }
.pine-tbl.gray { background: rgba(120,123,134,.15); }
.pine-tbl.white { background: #fff; color: #000; font-size: 12px; border-spacing: 0; }
.pine-tbl.white td { border: 1px solid rgba(120,123,134,.3); padding: 3px 7px; }
.pine-tbl.white td.bias { color: #fff; }
.pine-tbl.pos-top-right { top: 30px; right: 10px; }
.pine-tbl.pos-middle-right { top: 50%; right: 10px; transform: translateY(-50%); }
.pine-tbl.pos-bottom-right { bottom: 10px; right: 10px; }
.pine-tbl.pos-top-center { top: 30px; left: 50%; transform: translateX(-50%); }
.pine-tbl.pos-bottom-center { bottom: 10px; left: 50%; transform: translateX(-50%); }
.pine-tbl.pos-top-left { top: 96px; left: 10px; }
.pine-tbl.pos-bottom-left { bottom: 10px; left: 10px; }
.pine-tbl.pos-top-right ~ .pine-tbl.pos-top-right { top: auto; bottom: 10px; }
.lg-toggle { pointer-events: auto; width: fit-content; display: inline-flex; align-items: center; gap: 3px; height: 20px; padding: 0 6px; margin-top: 2px; border-radius: 4px;
  border: 1px solid color-mix(in srgb, var(--charttext) 25%, transparent); color: var(--charttext); background: var(--chartbg); font-size: 11px; opacity: .8; }
.lg-toggle:hover { opacity: 1; }
.lg-toggle svg { width: 9px; height: 9px; }
.lg-toggle .up svg { transform: rotate(180deg); }
/* floating drawing toolbar (TradingView style) */
#drawbar .db-drag { cursor: grab; color: var(--muted); font-size: 12px; letter-spacing: -2px; padding: 0 6px 0 3px; user-select: none; }
#drawbar .db-c { position: relative; flex-direction: column; gap: 1px; }
#drawbar .db-c svg { width: 16px; height: 16px; }
#drawbar .db-c i { width: 16px; height: 3px; border-radius: 1px; border: 1px solid rgba(128,128,128,.35); }
#drawbar .db-txt { width: auto; padding: 0 8px; font-size: 12px; color: var(--text); }
#drawbar .db-ls { padding: 0 8px; }
#drawbar .db-ls i, .ds-lw i { display: block; width: 18px; border-top: 2px solid var(--text); }
#drawbar .db-ls i.ls-dashed, .ds-lw i.ls-dashed { border-top-style: dashed; } #drawbar .db-ls i.ls-dotted, .ds-lw i.ls-dotted { border-top-style: dotted; }
/* drawing settings */
.ds-line { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 8px; border: 1px solid var(--line); border-radius: 6px; }
.ds-lc { width: 22px; height: 22px; border-radius: 4px; border: 1px solid rgba(128,128,128,.3); }
.ds-levels { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px; }
.ds-lv { display: flex; align-items: center; gap: 8px; }
.ds-lv input[type=checkbox] { width: 16px; height: 16px; accent-color: #2962ff; }
.ds-lv input[type=number] { width: 76px; padding: 5px 7px; }
.ds-lv .st-swatch { width: 26px; height: 26px; }
.ds-tog { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 6px; }
.ds-tog.on { background: rgba(41,98,255,.18); border-color: #2962ff; }
#dsText { width: 100%; margin-top: 6px; min-height: 90px; }
.st-body label.st-row.st-bool { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; color: var(--text); font-size: 13px; cursor: pointer; }
.st-body label.st-row.st-bool input, .st-body .st-row.st-bool input[type=checkbox] { width: 16px; height: 16px; margin: 0; accent-color: #2962ff; flex: none; }
.st-body .st-row.st-bool label.st-bool { display: flex; align-items: center; gap: 12px; margin: 0; color: var(--text); font-size: 13px; min-width: 150px; }
#dsTpl, #stDefaults, #setTpl { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
#dsTpl svg { width: 9px; height: 9px; }
.st-body input.ds-bar { width: 70px; }
/* favourite drawing tools toolbar (floating, draggable) */
#favbar.vert { flex-direction: column; padding: 3px; }
#favbar.vert button { width: 34px; height: 34px; }
#favbar.vert .fb-drag { padding: 0 0 2px; letter-spacing: 0; font-size: 16px; line-height: 10px; }
#favbar .fb-drag { touch-action: none; }
#favbar { position: fixed; z-index: 60; display: flex; align-items: center; gap: 1px; padding: 3px 4px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,.25); }
#favbar button { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 6px; color: var(--text); }
#favbar button:hover { background: var(--hover); }
#favbar button.on { background: rgba(41,98,255,.18); color: #9bb6ff; }
#favbar svg { width: 20px; height: 20px; }
.fb-drag { cursor: grab; color: var(--muted); font-size: 12px; letter-spacing: -2px; padding: 0 5px 0 2px; user-select: none; }
#toolbar .tspacer { flex: 1; }
/* TradingView colour picker */
#cpop { position: fixed; z-index: 200; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.45); width: 252px; user-select: none; }
.cp-row { display: flex; gap: 4px; margin-bottom: 4px; }
.cp-row.gap { margin-bottom: 10px; }
.cp-sw { width: 20px; height: 20px; padding: 0; border-radius: 4px; border: 1px solid rgba(128,128,128,.25); flex: none; }
.cp-sw:hover { transform: scale(1.15); }
.cp-sw.on { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px #2962ff; }
.cp-sep { height: 1px; background: var(--line); margin: 10px 0; }
.cp-custom { flex-wrap: wrap; position: relative; }
.cp-add { width: 20px; height: 20px; padding: 0; border-radius: 4px; font: 400 18px/18px sans-serif; color: var(--text); }
.cp-add:hover { background: var(--hover); }
#cpNative { position: absolute; width: 0; height: 0; opacity: 0; pointer-events: none; }
.cp-lbl { font-size: 12px; color: var(--muted); margin: 4px 0 6px; }
.cp-opts { display: flex; gap: 6px; margin-bottom: 8px; }
.cp-opts button { flex: 1; height: 30px; border: 1px solid var(--line); border-radius: 6px; display: flex; align-items: center; justify-content: center; padding: 0 8px; }
.cp-opts button.on { border-color: #2962ff; background: rgba(41,98,255,.12); }
.cp-opts button i { display: block; width: 100%; background: var(--text); border-radius: 1px; }
.cp-opts i.ls-solid { height: 2px; } .cp-opts i.ls-dashed { height: 0; background: none; border-top: 2px dashed var(--text); } .cp-opts i.ls-dotted { height: 0; background: none; border-top: 2px dotted var(--text); }
.cp-op { display: flex; align-items: center; gap: 10px; }
.cp-op input[type=range] { flex: 1; accent-color: #2962ff; height: 16px; }
.cp-pct { display: inline-flex; align-items: center; gap: 2px; font-size: 13px; color: var(--text); }
.cp-pct input { width: 58px; padding: 4px 6px; text-align: right; }
.ind-link { padding: 14px 18px; font-size: 13px; color: var(--text); border-bottom: 1px solid var(--line); line-height: 1.5; }
/* status line settings */
body.sl-no-title .lg-main .ttl, body.sl-no-ohlc .lg-main .o, body.sl-no-change .lg-main .chg, body.sl-no-indvalues .lg-row .vals { display: none; }
/* countdown to bar close (under the last price label) */
#countdown { position: absolute; z-index: 5; pointer-events: none; font: 500 11px -apple-system, "Segoe UI", Roboto, sans-serif; color: #fff; text-align: center; padding: 1px 0; border-radius: 2px; font-variant-numeric: tabular-nums; }
/* TradingView "Settings" window */
#modal.set-modal { width: 720px; max-height: 88vh; padding: 0; background: var(--panel); }
.set-wrap { display: flex; flex-direction: column; min-height: 520px; max-height: 88vh; }
.set-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 16px 10px 24px; }
.set-head b { font-size: 20px; font-weight: 600; }
.set-main { display: flex; flex: 1; min-height: 0; }
.set-nav { width: 220px; flex: none; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.set-nav button { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; font-size: 15px; color: var(--text); text-align: left; }
.set-nav button:hover { background: var(--hover); }
.set-nav button.on { background: var(--hover); font-weight: 600; }
.set-nav .si svg { width: 22px; height: 22px; opacity: .85; }
.set-body { flex: 1; overflow-y: auto; padding: 14px 24px 14px 10px; }
.set-body .st-group:first-child { margin-top: 6px; }
.set-body .st-row { margin-bottom: 14px; font-size: 14px; }
.set-body .st-bool input { width: 18px; height: 18px; }
.set-body .st-bool > label:not(.st-swatch) { display: flex; align-items: center; gap: 12px; cursor: pointer; min-width: 170px; }
.set-body .st-row.st-bool { justify-content: flex-start; gap: 18px; }
.set-body .st-swatch { flex: none; }
.st-range { width: 180px !important; height: 18px; padding: 0 !important; border: 0 !important; background: transparent !important; accent-color: #2962ff; }
.set-foot { display: flex; align-items: center; gap: 10px; padding: 16px 20px; }
.set-foot #setTpl { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 8px; }
.set-foot #setCancel { padding: 8px 18px; border: 1px solid var(--text); border-radius: 8px; }
.set-foot .primary { padding: 8px 18px; border-radius: 8px; }
@media (max-width: 640px) {
  #modal.set-modal { width: 100%; max-height: 100%; }
  .set-wrap { max-height: 100vh; min-height: 100vh; }
  .set-main { flex-direction: column; }
  .set-nav { width: auto; flex-direction: row; overflow-x: auto; padding: 4px 10px; scrollbar-width: none; }
  .set-nav button { padding: 8px 10px; font-size: 13px; white-space: nowrap; }
  .set-nav .si { display: none; }
  .set-body { padding: 10px 16px; }
}
/* AG FX - Watermark */
.agfx { position: absolute; left: 50%; transform: translateX(-50%); text-align: center; white-space: nowrap; letter-spacing: .4px; line-height: 1.5; }
.agfx.top { top: 4px; }
.agfx.bot { bottom: 4px; }
.agfx .sub { letter-spacing: .3px; }
@media (max-width: 1250px) { .agfx.top { top: 46px; } }
@media (max-width: 700px) { .agfx .sub { display: none; } }
/* indicator settings - TradingView layout */
#modal.st-modal { width: 520px; }
.st-tabs { padding: 0 18px; gap: 18px; border-bottom: 1px solid var(--line); }
.st-tabs button { border-radius: 0; padding: 12px 0 10px; background: none !important; border-bottom: 2px solid transparent; color: var(--muted); }
.st-tabs button.on { color: var(--text); border-bottom-color: var(--text); }
.st-body { min-height: 260px; max-height: 58vh; }
.st-group { font-size: 11px; letter-spacing: .6px; color: var(--muted); margin: 16px 0 6px; }
.st-group:first-child { margin-top: 2px; }
.st-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 0 0 10px; font-size: 13px; color: var(--text); }
.st-row .st-lbl { flex: 1; line-height: 1.35; }
.st-row .st-ctl { display: flex; align-items: center; gap: 8px; flex: none; }
.st-row .st-ctl select, .st-row .st-ctl input[type=number], .st-row .st-ctl input[type=text] { width: 170px; margin: 0; }
.st-row .st-ctl input[type=number] { width: 96px; }
.st-bool { justify-content: flex-start; cursor: pointer; }
.st-bool input { width: 16px; height: 16px; margin: 0; flex: none; accent-color: #2962ff; }
.st-tip { display: inline-flex; align-items: center; justify-content: center; width: 15px; height: 15px; margin-left: 6px; border-radius: 50%; border: 1px solid var(--muted); color: var(--muted); font: 600 10px/1 Georgia, serif; cursor: help; vertical-align: 1px; }
.st-swatch { display: inline-block; width: 28px; height: 28px; border-radius: 4px; border: 1px solid var(--line); position: relative; cursor: pointer; margin: 0; }
.st-swatch input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
#stDefaults { display: inline-flex; align-items: center; gap: 6px; }
@media (max-width: 600px) {
  .st-row { flex-wrap: wrap; }
  .st-row .st-ctl select, .st-row .st-ctl input[type=text] { width: 150px; }
  .pine-tbl { font-size: 9px; }
}

/* ---------------- left toolbar ---------------- */
#toolbar { width: 52px; background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; overflow-y: auto; scrollbar-width: none; flex-shrink: 0; }
#toolbar::-webkit-scrollbar { display: none; }
.tg { position: relative; display: flex; align-items: center; width: 46px; height: 38px; border-radius: 7px; }
.tg:hover { background: var(--hover); }
.tg .tg-main { width: 36px; height: 38px; color: var(--text); border-radius: 7px; }
.tg .tg-more { position: absolute; right: 0; top: 0; bottom: 0; width: 12px; opacity: 0; color: var(--muted); border-radius: 0 7px 7px 0; }
.tg:hover .tg-more { opacity: 1; }
.tg .tg-more:hover { background: var(--hover); color: var(--text); }
.tg.active .tg-main { color: var(--gold); }
.tg.active { background: rgba(41,98,255,.12); }
.tg.active .tg-main { color: #8aaaff; }
.tsep { width: 30px; height: 1px; background: var(--line); margin: 5px 0; flex-shrink: 0; }

/* ---------------- legends ---------------- */
#legends { position: absolute; left: 0; top: 0; right: 70px; z-index: 4; pointer-events: none; }
.lg { position: absolute; left: 10px; display: flex; flex-direction: column; gap: 2px; max-width: calc(100% - 20px); }
.lg-main { color: var(--charttext); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lg-main .t { font-weight: 700; font-size: 15px; margin-right: 6px; color: var(--charttext); }
.lg-main .sub { opacity: .75; margin-right: 10px; } .lg-main em { color: #9bb6ff; font-style: normal; font-weight: 700; }
.lg-main .o b { margin: 0 8px 0 2px; font-weight: 600; }
.lg-main b.up, .vals b.up { color: var(--up); } .lg-main b.dn { color: var(--down); }
.lg-row.study { display: flex; align-items: center; gap: 8px; padding: 1px 6px 1px 0; border-radius: 4px; pointer-events: auto; width: fit-content; color: var(--charttext); font-variant-numeric: tabular-nums; }
.lg-row.study:hover { background: color-mix(in srgb, var(--chartbg) 80%, #fff 20%); }
.lg-row.study .nm { opacity: .9; }
.lg-row.study.off { opacity: .45; }
.lg-row .vals b { font-weight: 600; margin-right: 4px; }
.lg-btns { display: none; gap: 1px; }
.lg-row.study:hover .lg-btns { display: inline-flex; }
.lg-btns button { width: 22px; height: 20px; color: var(--charttext); }
.lg-btns button:hover { background: var(--hover); }
.lg-btns svg { width: 15px; height: 15px; }
body.chart-light .lg-row.study:hover { background: #eef1f6; }
body.no-legend .lg-main { display: none; }
body.no-ind-legend .lg-row.study { display: none; }

/* ---------------- floating drawing toolbar ---------------- */
#drawbar { position: absolute; top: 46px; z-index: 6; display: flex; align-items: center; gap: 2px; padding: 4px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.35); }
#drawbar .db-name { padding: 0 8px; color: var(--muted); font-size: 12px; white-space: nowrap; }
#drawbar button { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; }
#drawbar button:hover { background: var(--hover); }
#drawbar svg { width: 17px; height: 17px; }
#drawbar select { padding: 4px 4px; height: 30px; border: 0; background: transparent; }
#drawbar select:hover { background: var(--hover); }
.db-col { position: relative; width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; border-radius: 6px; }
.db-col:hover { background: var(--hover); }
.db-col input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.db-col i { width: 16px; height: 16px; border-radius: 4px; border: 1px solid rgba(255,255,255,.3); }

#hint { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); z-index: 7; background: #1c2752; border: 1px solid var(--blue); padding: 6px 14px; border-radius: 8px; white-space: nowrap; }
#toast { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 9; background: #1d2740; border: 1px solid #34406a; color: #fff; padding: 10px 16px; border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,.4); max-width: 90%; text-align: center; }

/* ---------------- replay + bottom bar ---------------- */
#replayBar { display: flex; align-items: center; gap: 2px; min-height: 38px; padding: 4px 10px; background: var(--panel); border-top: 1px solid var(--line); flex-wrap: wrap; }
#replayBar #rbSelect, #replayBar #rbRealtime { font-weight: 500; }
#replayBar #rbSelect svg:last-child { width: 9px; height: 9px; }
#replayBar #rbSpeed { min-width: 48px; justify-content: center; font-weight: 600; }
#replayBar #rbInterval .muted { font-size: 12px; }
#replayBar #rbPlay { color: #2962ff; }
@media (max-width: 700px) { #replayBar #rbInterval .muted, #replayBar #rbRealtime span, #replayBar #rbSelect span { display: none; } }
#replayBar button { height: 30px; padding: 0 10px; display: inline-flex; align-items: center; gap: 5px; border-radius: 6px; }
#replayBar button:hover { background: var(--hover); }
#replayBar button.danger { color: #ff8a96; }
#replayBar svg { width: 17px; height: 17px; }
.rb-title { color: #9bb6ff; font-weight: 700; display: inline-flex; align-items: center; gap: 5px; margin-right: 6px; }
#rbInfo { font-variant-numeric: tabular-nums; margin-left: 6px; min-width: 150px; color: var(--text); }
#bottombar { height: 34px; display: flex; align-items: center; gap: 2px; padding: 0 8px; background: var(--panel); border-top: 1px solid var(--line); flex-shrink: 0; overflow-x: auto; scrollbar-width: none; }
#bottombar::-webkit-scrollbar { display: none; }
.bb { height: 26px; padding: 0 8px; border-radius: 5px; font-size: 12px; display: inline-flex; align-items: center; color: var(--text); flex-shrink: 0; }
.bb:hover { background: var(--hover); } .bb.on { color: var(--gold); }
.bb svg { width: 16px; height: 16px; }
#bottombar select { height: 26px; padding: 0 6px; font-size: 12px; border: 0; background: transparent; }
#bottombar select:hover { background: var(--hover); }
#clock { font-variant-numeric: tabular-nums; font-size: 12px; margin-right: 4px; }

/* ---------------- right strip + panel ---------------- */
#rstrip { width: 46px; background: var(--panel); border-left: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 0; flex-shrink: 0; }
.rs { width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); position: relative; border-radius: 7px; }
.rs:hover { background: var(--hover); color: var(--text); }
.rs.on { color: var(--gold); background: rgba(242,182,54,.1); }
#alertDot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--down); }
#rpanel { width: 300px; background: var(--panel); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; flex-shrink: 0; }
.rp-head { display: flex; align-items: center; height: 40px; padding: 0 6px 0 12px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.rp-head b { font-size: 14px; }
#rpBody { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }
.wl-head, .wl-row { display: grid; grid-template-columns: 1fr 86px 66px; align-items: center; padding: 0 12px; }
.wl-head { color: var(--muted); font-size: 11px; height: 26px; border-bottom: 1px solid var(--line); }
.wl-head span:not(:first-child), .wl-row .l, .wl-row .c { text-align: right; }
.wl { flex: 1; overflow-y: auto; min-height: 120px; }
.wl-grp { width: 100%; text-align: left; padding: 8px 12px 4px; color: var(--gold); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; }
.wl-row { width: 100%; height: 32px; font-variant-numeric: tabular-nums; border-radius: 0; }
.wl-row:hover { background: var(--hover); }
/* live tick flash (like TradingView): the price briefly turns green / red when it moves */
@keyframes tickUp { from { color: #089981; background: rgba(8,153,129,.18); } to { color: inherit; background: transparent; } }
@keyframes tickDn { from { color: #f23645; background: rgba(242,54,69,.18); } to { color: inherit; background: transparent; } }
.wl-row .l.tick-up { animation: tickUp .9s ease-out; border-radius: 3px; }
.wl-row .l.tick-dn { animation: tickDn .9s ease-out; border-radius: 3px; }
.wl-row.sel { background: rgba(41,98,255,.14); }
.wl-row .n { display: flex; align-items: center; gap: 7px; font-weight: 600; text-align: left; }
.wl-row .bell { font-size: 10px; }
.wl-row { position: relative; cursor: pointer; }
.wl-row .wl-x { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; border-radius: 4px; display: none; color: var(--muted); font-size: 16px; line-height: 20px; background: var(--panel); }
.wl-row:hover .wl-x { display: block; } .wl-row .wl-x:hover { color: var(--text); background: var(--hover); }
.wl-bar { display: flex; align-items: center; gap: 2px; padding: 4px 6px 4px 8px; border-bottom: 1px solid var(--line); }
.wl-name { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 6px; font-weight: 600; font-size: 13px; max-width: 190px; overflow: hidden; white-space: nowrap; }
.wl-name:hover { background: var(--hover); } .wl-name svg { width: 9px; height: 9px; flex: none; }
.wl-bar .tb svg { width: 17px; height: 17px; }
.sym-ic { width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 800; font-style: normal; color: #fff; background: #3b4a75; flex-shrink: 0; }
.sym-ic.g-Forex { background: #2962ff; } .sym-ic.g-Metals { background: #c9a227; } .sym-ic.g-Energy { background: #333; } .sym-ic.g-Indices { background: #7e57c2; } .sym-ic.g-Crypto { background: #f7931a; }
#details { border-top: 1px solid var(--line); flex-shrink: 0; }
.dt { padding: 12px; }
.dt-sym { display: flex; gap: 10px; align-items: center; }
.dt-sym .sym-ic { width: 32px; height: 32px; font-size: 14px; }
.dt-price { font-size: 24px; font-weight: 700; margin: 10px 0 8px; font-variant-numeric: tabular-nums; }
.dt-price span { font-size: 14px; font-weight: 600; }
.dt-grid { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; font-size: 12px; font-variant-numeric: tabular-nums; }
.dt-grid span { color: var(--muted); }
.al-row, .ob-row { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.al-row > div { flex: 1; }
.al-row.triggered { background: rgba(31,179,138,.07); }
.ob-row .n { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ob-row .ob-ic { color: var(--muted); } .ob-row .ob-ic svg { width: 18px; height: 18px; }
.ob-row .tb { height: 26px; min-width: 26px; padding: 0 4px; } .ob-row .tb svg { width: 16px; height: 16px; }
.ob-row.sel { background: rgba(41,98,255,.12); } .ob-row[data-did] { cursor: pointer; }
#rpBody h5 { margin: 0; padding: 12px 12px 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); }
.bstats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 12px; }
.bstats div { background: var(--panel2); border-radius: 8px; padding: 8px 10px; }
.bstats span { display: block; font-size: 11px; color: var(--muted); }
.bstats b { font-size: 17px; }
.btable { width: 100%; border-collapse: collapse; font-size: 12px; }
.btable th, .btable td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.btable th { color: var(--muted); font-weight: 600; }

/* ---------------- menus ---------------- */
#menu { position: fixed; z-index: 100; min-width: 220px; max-height: 80vh; overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 5px 0; box-shadow: 0 14px 40px rgba(0,0,0,.5); }
.m-item, .tb, .bb, .rs, .tg button { transition: background-color .12s ease, color .12s ease; }
.m-item.on { color: #8aaaff; background: rgba(41,98,255,.1); }
.m-head { padding-top: 9px; }
.m-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 14px 7px 10px; text-align: left; border-radius: 0; }
.m-item:hover:not(:disabled) { background: var(--hover); }
.m-item.on { color: var(--gold); }
.m-item:disabled { opacity: .55; }
.m-ic { width: 22px; color: var(--muted); } .m-item.on .m-ic { color: var(--gold); }
.m-ic svg { width: 18px; height: 18px; }
.m-lbl { flex: 1; white-space: nowrap; }
.m-hint { color: var(--muted); font-size: 11px; margin-left: 14px; }
.m-star { margin-left: 8px; color: var(--muted); display: inline-flex; } .m-star svg { width: 16px; height: 16px; }
.m-sep { height: 1px; background: var(--line); margin: 5px 0; }
.m-head { padding: 6px 14px 4px; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }

/* ---------------- modal dialogs ---------------- */
#modalBack { position: fixed; inset: 0; z-index: 90; background: rgba(4,7,14,.6); display: flex; align-items: flex-start; justify-content: center; padding: 8vh 12px 12px; }
#modal { width: 560px; max-width: 100%; max-height: 84vh; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 30px 80px rgba(0,0,0,.6); overflow: hidden; }
#modal.wide { width: 760px; }
#modal.small { width: 420px; }
.md-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 10px 12px 18px; border-bottom: 1px solid var(--line); }
.md-head b { font-size: 16px; }
.md-body { padding: 14px 18px; overflow-y: auto; }
.md-body label { display: block; margin: 0 0 10px; color: var(--muted); font-size: 12px; }
.md-body label > input:not([type=checkbox]):not([type=color]), .md-body label > select, .md-body textarea { width: 100%; margin-top: 4px; color: var(--text); }
.md-body h4 { margin: 14px 0 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); }
.md-body h4:first-child { margin-top: 0; }
.md-body .row { display: flex; gap: 8px; align-items: center; margin-top: 4px; flex-wrap: wrap; }
.md-body .row > * { flex: 1; }
.md-body .two { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 24px; }
.md-body .crow { display: flex; justify-content: space-between; align-items: center; gap: 10px; color: var(--text); font-size: 13px; margin: 6px 0; }
.md-body .crow input[type=number], .md-body .crow select { width: 110px; margin: 0; }
.md-body .chk, .chk { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 13px; margin: 8px 0; cursor: pointer; }
.md-foot { display: flex; align-items: center; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); }
.md-foot button:not(.primary) { padding: 8px 14px; border: 1px solid var(--line); }
.md-foot button:not(.primary):hover { background: var(--hover); }
.md-search { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--line); color: var(--muted); }
.md-search input { flex: 1; border: 0 !important; background: transparent !important; font-size: 16px; padding: 4px 0 !important; color: var(--text); }
.md-tabs { display: flex; gap: 4px; padding: 8px 14px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.md-tabs button, .ind-cats button { padding: 5px 12px; border-radius: 16px; white-space: nowrap; color: var(--muted); }
.md-tabs button:hover, .ind-cats button:hover { background: var(--hover); color: var(--text); }
.md-tabs button.on { background: rgba(41,98,255,.18); color: #9bb6ff; }
.md-list { overflow-y: auto; flex: 1; min-height: 200px; }
.sym-row { display: grid; grid-template-columns: 28px 90px 1fr auto 70px; gap: 10px; align-items: center; width: 100%; padding: 9px 16px; text-align: left; border-radius: 0; }
.sym-row:hover, .sym-row.sel { background: var(--hover); }
.sym-row.cur b { color: var(--gold); }
.sym-row .desc { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sym-row .grp, .ind-row .grp { color: var(--muted); font-size: 11px; text-align: right; }
.sym-row .chg { font-variant-numeric: tabular-nums; font-size: 12px; }
.ind-wrap { display: flex; min-height: 0; flex: 1; }
.ind-cats { width: 210px; padding: 10px 8px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; flex-shrink: 0; }
.ind-cats button { text-align: left; border-radius: 6px; }
.ind-cats button.on { background: rgba(41,98,255,.18); color: #9bb6ff; }
.ind-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 16px; text-align: left; border-radius: 0; }
.ind-row:hover { background: var(--hover); }
.ind-ic { width: 30px; height: 30px; border-radius: 8px; background: var(--panel2); display: inline-flex; align-items: center; justify-content: center; color: var(--gold); font-size: 10px; font-weight: 900; flex-shrink: 0; }
.ind-txt { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.ind-txt .desc { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ind-row .added { color: var(--up); font-size: 11px; font-weight: 700; }
.presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.preset { display: flex; align-items: center; gap: 8px; padding: 10px; border: 1px solid var(--line) !important; border-radius: 8px; font-weight: 600; }
.preset span { display: inline-flex; gap: 2px; } .preset i { width: 7px; height: 16px; border-radius: 2px; display: inline-block; }

/* ---------------- responsive ---------------- */
@media (max-width: 1150px) { .lbl { display: none; } }
@media (max-width: 900px) { #rpanel { position: absolute; right: 46px; top: 0; bottom: 0; z-index: 20; box-shadow: -10px 0 30px rgba(0,0,0,.4); } }
@media (max-width: 760px) {
  #main { flex-direction: column; }
  #toolbar { order: 3; width: auto; height: 46px; flex-direction: row; border-right: 0; border-top: 1px solid var(--line); padding: 0 6px; overflow-x: auto; overflow-y: hidden; }
  .tg { width: 42px; } .tg .tg-more { opacity: .7; }
  .tsep { width: 1px; height: 26px; margin: 0 4px; }
  #rstrip { order: 4; width: auto; height: 44px; flex-direction: row; justify-content: space-around; border-left: 0; border-top: 1px solid var(--line); padding: 0 8px; }
  #rpanel { position: absolute; left: 0; right: 0; top: 0; bottom: 90px; width: auto; z-index: 20; }
  #center { order: 1; }
  #favTfs .tfb:nth-child(n+4) { display: none; }
  .tb.user, #btnFull, #btnUndo, #btnRedo { display: none; }
  #modalBack { padding: 0; align-items: stretch; }
  #modal, #modal.wide, #modal.small { width: 100%; max-height: 100%; border-radius: 0; }
  .ind-wrap { flex-direction: column; } .ind-cats { width: auto; flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .sym-row { grid-template-columns: 28px 80px 1fr auto; } .sym-row .grp { display: none; }
  .md-body .two { grid-template-columns: 1fr; }
  .presets { grid-template-columns: 1fr 1fr; }
  #drawbar { top: 40px; max-width: calc(100% - 16px); overflow-x: auto; }
  /* simpler phone view: the full tool row stays folded away (open it with "All tools" in the favourites column) */
  body:not(.tools-open) #toolbar { display: none; }
  #bottombar #tz { display: inline-flex; }
  #clock { display: inline; }
  .pine-tbl, .pine-tbl.white { font-size: 9px; }
  .pine-tbl.white td { padding: 2px 4px; }
  .agfx.top { top: 30px; font-size: 11px !important; }
  .agfx.bot { display: none; }
  #legends .lg-main .chg { display: none; }
}
@media (max-width: 760px) {
  #topbar { height: 42px; gap: 1px; padding: 0 4px; }
  #topbar .vsep { margin: 0 2px; height: 18px; }
  .tb { min-width: 32px; height: 32px; padding: 0 6px; }
  .tb.sym { font-size: 13px; }
  #favTfs { gap: 0; }
  #favTfs .tfb { min-width: 29px; padding: 0 5px; }
  #bottombar { height: 36px; padding: 0 5px; }
  #bottombar .bb { padding: 0 6px; }
  #menu { max-width: calc(100vw - 12px); max-height: 72vh; }
  .wl-head, .wl-row { grid-template-columns: 1fr 78px 58px; }
}
#favbar .fb-more { color: var(--muted); }
#favbar .fb-more.on { color: #9bb6ff; }

/* OANDA server-feed markets (own watchlist) */
em.feed { font-style: normal; font-size: 9px; font-weight: 700; letter-spacing: .3px; color: #8fa3ff; background: rgba(41, 98, 255, .16); border-radius: 3px; padding: 1px 4px; margin-left: 6px; vertical-align: 1px; }

/* =====================================================================================
   TradingView-style skin (Nov 2026). Our own CSS written to match TradingView's look:
   its dark and light palettes, system fonts, 4px panel gaps, compact header, flat menus.
   The whole interface turns light when the chart theme is light (body.ui-light).
   ===================================================================================== */
:root {
  --bg: #131722; --panel: #131722; --panel2: #1e222d; --pop: #1e222d; --popline: #363a45; --hover: #2a2e39; --hover2: #363a45;
  --line: #2a2e39; --gapc: #2a2e39; --inline: #434651; --text: #d1d4dc; --strong: #f0f3fa; --muted: #787b86; --muted2: #b2b5be;
  --gold: #2962ff; --gold2: #1e53e5; --blue: #2962ff; --acc-text: #2962ff; --sel: #142e61; --selhover: #1c3a75;
  --up: #089981; --down: #f23645; --shadow: 0 2px 4px rgba(0,0,0,.2), 0 8px 24px rgba(0,0,0,.45); --backdrop: rgba(0,0,0,.6);
  --font: -apple-system, BlinkMacSystemFont, "Trebuchet MS", Roboto, Ubuntu, sans-serif;
}
body.ui-light {
  --bg: #ffffff; --panel: #ffffff; --panel2: #f0f3fa; --pop: #ffffff; --popline: #e0e3eb; --hover: #f0f3fa; --hover2: #e0e3eb;
  --line: #e0e3eb; --gapc: #e0e3eb; --inline: #d1d4dc; --text: #131722; --strong: #131722; --muted: #787b86; --muted2: #6a6d78;
  --acc-text: #2962ff; --sel: #e3effd; --selhover: #d7e6fb; --shadow: 0 2px 4px rgba(0,0,0,.06), 0 8px 24px rgba(0,0,0,.14); --backdrop: rgba(19,23,34,.35);
  color-scheme: light;
}
body { color-scheme: dark; }
html, body { background: var(--gapc); }
body.ui-light html { background: var(--gapc); }
select, input:not([type=checkbox]):not([type=color]):not([type=range]), textarea { background: var(--bg); border-color: var(--inline); border-radius: 4px; }
select:hover, input:not([type=checkbox]):not([type=color]):not([type=range]):hover, textarea:hover { border-color: var(--muted); }
select:focus, input:focus, textarea:focus { border-color: var(--blue) !important; }
input[type=color] { background: var(--bg); border-color: var(--inline); }
button { border-radius: 4px; }
button.primary { background: var(--blue); border-radius: 4px; font-weight: 600; }
button.primary:hover { background: var(--gold2); }
button.wide { border-color: var(--inline); }
.vsep { height: 20px; background: var(--line); margin: 0 3px; }
::-webkit-scrollbar { width: 8px; height: 8px; } ::-webkit-scrollbar-thumb { background: var(--hover2); border-radius: 4px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* layout: panels on a gap colour, like TradingView's 4px separators */
#topbar { height: 38px; background: var(--panel); border-bottom: 0; margin-bottom: 4px; padding: 0 4px; gap: 1px; }
#main { gap: 4px; background: var(--gapc); }
#toolbar { width: 52px; background: var(--panel); border-right: 0; padding: 4px 0; gap: 0; }
#center { background: var(--chartbg); gap: 0; }
#bottombar { height: 34px; background: var(--panel); border-top: 4px solid var(--gapc); padding: 0 6px; }
#replayBar { background: var(--panel); border-top: 4px solid var(--gapc); }
#rpanel { width: 340px; background: var(--panel); border-left: 0; }
#rstrip { width: 46px; background: var(--panel); border-left: 0; padding: 6px 0; gap: 2px; }

/* header */
.brand { margin: 0 6px 0 4px; }
.logo { background: transparent; color: var(--strong); border: 2px solid var(--strong); border-radius: 6px; font-size: 11px; font-weight: 800; padding: 2px 4px; letter-spacing: .4px; }
.tb { height: 32px; min-width: 32px; padding: 0 7px; border-radius: 4px; gap: 4px; color: var(--text); }
.tb:hover:not(:disabled) { background: var(--hover); }
.tb:active:not(:disabled), .bb:active { background: var(--hover2); }
.tb.on, .tb.caret.on { color: var(--acc-text); }
.tb svg { width: 20px; height: 20px; }
.tb.caret svg:last-child { width: 9px; height: 9px; opacity: .8; margin-left: 0; }
.tb.sym { font-size: 14px; font-weight: 600; padding: 0 8px 0 5px; gap: 7px; text-transform: uppercase; }
.tb.sym b { letter-spacing: 0; font-weight: 600; }
.tb.sym .sym-q svg, .tb.sym > i[data-ic=search] svg { width: 16px; height: 16px; color: var(--muted2); }
#symIc .sym-ic { width: 20px; height: 20px; }
.tfb { min-width: 30px; padding: 0 6px; font-weight: 400; font-size: 14px; }
.tfb.on { color: var(--acc-text); background: transparent; font-weight: 600; }
.tfb.on:hover { background: var(--hover) !important; }
#btnReplay.on { color: var(--acc-text); background: transparent; }
.tb.user { border: 0; color: var(--text); font-size: 13px; padding: 0 10px; margin-left: 2px; background: var(--hover); border-radius: 16px; height: 28px; }
.tb.user:hover { background: var(--hover2) !important; }

/* left drawing toolbar with grouped flyouts */
.tg { width: 48px; height: 36px; border-radius: 4px; margin: 1px 0; }
.tg:hover { background: transparent; }
.tg .tg-main { width: 36px; height: 36px; margin-left: 4px; border-radius: 4px; color: var(--text); }
.tg .tg-main:hover { background: var(--hover); }
.tg .tg-main svg { width: 28px; height: 28px; }
.tg .tg-more { width: 10px; right: 0; border-radius: 3px; opacity: 0; }
.tg .tg-more svg { width: 7px; height: 7px; }
.tg:hover .tg-more { opacity: 1; }
.tg .tg-more:hover { background: var(--hover); }
.tg.active { background: transparent; }
.tg.active .tg-main { color: var(--acc-text); background: color-mix(in srgb, var(--blue) 14%, transparent); }
.tsep { width: 32px; margin: 6px 0; background: var(--line); }

/* right sidebar (widget bar) */
.rs { width: 38px; height: 38px; border-radius: 4px; color: var(--text); }
.rs svg { width: 24px; height: 24px; }
.rs:hover { background: var(--hover); color: var(--text); }
.rs.on { color: var(--acc-text); background: color-mix(in srgb, var(--blue) 14%, transparent); }
#alertDot { top: 5px; right: 5px; width: 7px; height: 7px; box-shadow: 0 0 0 2px var(--panel); }
.rp-head { height: 38px; border-bottom: 1px solid var(--line); padding: 0 4px 0 14px; }
.rp-head b { font-size: 14px; font-weight: 600; }

/* watchlist: Symbol / Last / Chg / Chg% */
.wl-bar { height: 38px; padding: 0 4px 0 6px; border-bottom: 1px solid var(--line); }
.wl-name { font-size: 14px; font-weight: 600; border-radius: 4px; padding: 5px 8px; color: var(--strong); }
.wl-bar .tb { height: 28px; min-width: 28px; padding: 0 4px; }
.wl-head, .wl-row { grid-template-columns: minmax(0, 1fr) 74px 66px 58px; column-gap: 6px; padding: 0 10px 0 12px; }
.wl-head { height: 26px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line); }
.wl-head span:not(:first-child), .wl-row .l, .wl-row .c, .wl-row .ch { text-align: right; }
.wl-row { height: 32px; font-size: 13px; color: var(--text); border-radius: 0; }
.wl-row .l, .wl-row .ch, .wl-row .c { font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; }
.wl-row .l { color: var(--strong); }
.wl-row:hover { background: var(--hover); }
.wl-row.sel { background: var(--sel); }
.wl-row.sel:hover { background: var(--selhover); }
.wl-row .n { font-weight: 600; gap: 8px; min-width: 0; color: var(--strong); }
.wl-row .n .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wl-row .wl-x { background: var(--pop); right: 4px; }
.wl-grp { display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .6px; border-radius: 0; }
.wl-grp:hover { color: var(--text); background: var(--hover); }
.wl-grp .wg-c svg { width: 9px; height: 9px; transition: transform .15s; }
.wl-grp.shut .wg-c svg { transform: rotate(-90deg); }
#details { border-top: 4px solid var(--gapc); }
.dt { padding: 14px; }
.dt-sym b { font-size: 15px; color: var(--strong); }
.dt-price { font-size: 26px; color: var(--strong); }

/* symbol icons ("flags") */
.sym-ic { width: 18px; height: 18px; background: transparent !important; border-radius: 50%; position: relative; overflow: visible; font-style: normal; }
.sym-ic .si { position: absolute; inset: 0; border-radius: 50%; overflow: hidden; display: block; box-shadow: 0 0 0 1px rgba(128,128,128,.25); }
.sym-ic .si svg { width: 100%; height: 100%; }
.sym-ic .si-l { display: flex; align-items: center; justify-content: center; color: #fff; font-size: 9px; font-weight: 700; }
.sym-ic.pair { width: 22px; }
.sym-ic.pair .si { width: 15px; height: 15px; }
.sym-ic.pair .si.a { left: 0; top: 0; right: auto; bottom: auto; z-index: 1; }
.sym-ic.pair .si.b { left: auto; top: auto; right: 0; bottom: 0; box-shadow: 0 0 0 1.5px var(--panel); }
.sym-row .sym-ic.pair .si.b, #modal .sym-ic.pair .si.b { box-shadow: 0 0 0 1.5px var(--pop); }
.dt-sym .sym-ic { width: 30px; height: 30px; }
.dt-sym .sym-ic.pair { width: 36px; height: 30px; } .dt-sym .sym-ic.pair .si { width: 24px; height: 24px; }

/* menus and popovers */
#menu, #cpop, #drawbar, #favbar { background: var(--pop); border: 1px solid var(--popline); box-shadow: var(--shadow); }
#menu { border-radius: 6px; padding: 6px 0; min-width: 200px; }
#drawbar { border-radius: 4px; }
.m-item { padding: 0 16px 0 12px; height: 34px; font-size: 14px; color: var(--text); }
.m-item:hover:not(:disabled) { background: var(--hover); }
.m-item.on, .m-item.on .m-ic { color: var(--acc-text); background: transparent; }
.m-item.on:hover:not(:disabled) { background: var(--hover); }
.m-ic { color: var(--text); width: 28px; } .m-ic svg { width: 20px; height: 20px; }
.m-hint { color: var(--muted); font-size: 12px; }
.m-head { color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .5px; padding: 8px 16px 4px; }
.m-sep { background: var(--line); margin: 6px 0; }
.cp-sw { border-color: var(--popline); }

/* dialogs */
#modalBack { background: var(--backdrop); }
#modal { background: var(--pop); border: 0; border-radius: 6px; box-shadow: var(--shadow); }
#modal.set-modal { background: var(--pop); }
.md-head { padding: 16px 12px 16px 20px; border-bottom: 1px solid var(--line); }
.md-head b { font-size: 20px; font-weight: 600; color: var(--strong); }
.md-foot { border-top: 1px solid var(--line); padding: 16px 20px; justify-content: flex-end; }
.md-foot button:not(.primary) { border: 1px solid var(--inline); border-radius: 4px; padding: 8px 16px; }
.md-search { padding: 12px 20px; border-bottom: 1px solid var(--line); }
.md-search input { font-size: 16px; text-transform: uppercase; }
.md-search input::placeholder { text-transform: none; }
.md-tabs { padding: 10px 18px; gap: 6px; }
.md-tabs button, .ind-cats button { border-radius: 16px; padding: 5px 12px; color: var(--text); font-size: 13px; }
.md-tabs button:not(.on) { background: var(--panel2); }
.md-tabs button.on { background: var(--strong); color: var(--pop); }
.sym-row { grid-template-columns: 26px 110px 1fr auto 90px; padding: 0 20px; height: 40px; border-bottom: 1px solid var(--line); font-size: 13px; }
.sym-row b { color: var(--strong); font-weight: 600; }
.sym-row:hover, .sym-row.sel { background: var(--hover); }
.sym-row.cur b { color: var(--acc-text); }
.ind-cats { border-right: 1px solid var(--line); }
.ind-cats button.on { background: var(--hover); color: var(--strong); font-weight: 600; }
.ind-row { border-bottom: 1px solid var(--line); padding: 9px 20px; }
.ind-ic { background: var(--panel2); color: var(--acc-text); border-radius: 4px; }
.preset { border-color: var(--inline) !important; border-radius: 4px; }

/* chart settings (Symbol / Status line / Scales and lines / Canvas / Trading / Alerts / Events) */
#modal.set-modal { width: 680px; }
.set-head { padding: 20px 16px 14px 20px; border-bottom: 1px solid var(--line); }
.set-head b { font-size: 20px; color: var(--strong); }
.set-nav { width: 200px; padding: 8px 0; gap: 0; border-right: 1px solid var(--line); }
.set-nav button { border-radius: 0; padding: 0 16px; height: 40px; font-size: 14px; gap: 12px; color: var(--text); }
.set-nav button:hover { background: var(--hover); }
.set-nav button.on { background: var(--hover); color: var(--strong); font-weight: 600; box-shadow: inset 3px 0 0 var(--blue); }
.set-nav .si svg { width: 22px; height: 22px; }
.set-body { padding: 16px 20px; }
.set-body .st-row { font-size: 14px; }
.st-group { color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; }
.set-foot { border-top: 1px solid var(--line); padding: 16px 20px; }
.set-foot #setTpl { border: 1px solid var(--inline); border-radius: 4px; padding: 7px 12px; }
.set-foot #setCancel { border: 1px solid var(--inline); border-radius: 4px; }
.set-foot .primary { border-radius: 4px; }
.st-body input[type=checkbox], .set-body input[type=checkbox], .md-body input[type=checkbox] { accent-color: var(--blue); }
.st-tabs button.on { color: var(--strong); box-shadow: inset 0 -2px 0 var(--strong); }

/* bottom bar */
.bb { height: 26px; padding: 0 7px; font-size: 13px; border-radius: 4px; color: var(--text); }
.bb:hover { background: var(--hover); }
.bb.on { color: var(--acc-text); }
#ranges .bb { font-size: 13px; }
#clock { color: var(--text); font-size: 13px; }
#bottombar select { font-size: 13px; color: var(--text); }

/* replay bar, hints, toasts */
#replayBar button { border-radius: 4px; }
#hint { background: var(--pop); color: var(--text); border: 1px solid var(--popline); border-radius: 6px; box-shadow: var(--shadow); }
#toast { background: var(--pop); color: var(--text); border: 1px solid var(--popline); border-radius: 6px; box-shadow: var(--shadow); }
em.feed { color: var(--acc-text); background: color-mix(in srgb, var(--blue) 15%, transparent); }
.md-tabs button.on:hover { color: var(--pop); }
.lg-main .t { font-weight: 600; font-size: 16px; }
.lg-main em { color: var(--acc-text); }
.lg-btns button { border-radius: 3px; }

@media (max-width: 900px) { #rpanel { right: 50px; box-shadow: var(--shadow); } }
@media (max-width: 760px) {
  #topbar { height: 42px; margin-bottom: 0; border-bottom: 1px solid var(--line); }
  #main { gap: 0; }
  #toolbar { border-top: 1px solid var(--line); height: 46px; padding: 0 4px; }
  .tg { height: 40px; width: 44px; } .tg .tg-main { margin-left: 2px; }
  #rstrip { border-top: 1px solid var(--line); }
  #bottombar { border-top: 1px solid var(--line); }
  #details { border-top: 1px solid var(--line); }
  .wl-head, .wl-row { grid-template-columns: minmax(0, 1fr) 80px 70px 60px; } .wl-row { height: 40px; }
  .wl-head { height: 28px; }
  .sym-row { grid-template-columns: 26px 90px 1fr auto; height: 44px; padding: 0 14px; }
  .md-head b { font-size: 17px; }
  .set-nav { width: auto; border-right: 0; }
}

/* =====================================================================================
   Round 3 (Nov 2026): TradingView sizes - 28px icons in 34-38px buttons, avatar menu with the
   Dark theme switch, multi-chart layouts (#grid), embedded panes (body.embed).
   ===================================================================================== */
#topbar { height: 40px; padding: 0 6px 0 4px; gap: 0; }
.tb { height: 34px; min-width: 34px; padding: 0 6px; gap: 4px; font-size: 14px; }
.tb svg { width: 28px; height: 28px; }
.tb i[data-ic=caret] svg, .tb.caret svg:last-child { width: 8px; height: 8px; opacity: .9; }
.tb .lbl { font-size: 14px; }
#btnInd .lbl, #btnAlert .lbl, #btnReplay .lbl { margin-right: 2px; }
.tb.sym { gap: 6px; padding: 0 10px 0 6px; font-size: 15px; font-weight: 600; }
.tb.sym .sym-q svg { width: 22px; height: 22px; color: var(--text); }
.tfb { min-width: 28px; padding: 0 5px; font-size: 14px; font-weight: 400; color: var(--text); }
#favTfs { gap: 0; }
.vsep { height: 24px; margin: 0 4px; }
.tb.avatar { width: 34px; padding: 0; margin-right: 2px; }
.av { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px;
  color: #fff; background: linear-gradient(135deg, #2962ff, #7b3ff2); }
.av.big { width: 40px; height: 40px; font-size: 17px; }
#topbar .brand { margin: 0 0 0 4px; }
#topbar .brand .logo { font-size: 10px; padding: 2px 4px; }
#btnTheme svg { width: 26px; height: 26px; }

/* left drawing toolbar: thin 28px icons in 38px squares, flyout arrow on hover */
#toolbar { width: 52px; padding: 4px 0; }
.tg { width: 52px; height: 38px; margin: 1px 0; justify-content: center; }
.tg .tg-main { width: 38px; height: 38px; margin: 0; }
.tg .tg-main svg { width: 28px; height: 28px; }
.tg .tg-more { width: 9px; right: 1px; top: 9px; bottom: 9px; display: inline-flex; align-items: center; justify-content: center; }
.tg .tg-more svg { width: 4px; height: 8px; }
.tsep { width: 34px; margin: 4px 0; }
body.tools-hidden #toolbar { display: none; }

/* right widget bar */
#rstrip { width: 48px; padding: 6px 0; gap: 4px; }
.rs { width: 40px; height: 40px; }
.rs svg { width: 28px; height: 28px; }

/* bottom bar */
#bottombar { height: 36px; }
.bb { height: 28px; font-size: 13px; padding: 0 8px; }
.bb svg { width: 20px; height: 20px; }

/* legend like TradingView: lighter title */
.lg-main .t { font-size: 14px; font-weight: 500; }
.lg-main { font-size: 13px; }

/* menus: switches, user menu, layout picker */
.m-sw { margin-left: 18px; width: 34px; height: 20px; border-radius: 10px; background: var(--hover2); position: relative; flex: none; transition: background .15s; }
.m-sw i { position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.m-sw.on { background: var(--blue); } .m-sw.on i { transform: translateX(14px); }
#menu.user-menu { min-width: 270px; }
.m-user { display: flex; align-items: center; gap: 12px; padding: 10px 16px 8px; }
.m-user b { display: block; font-size: 15px; color: var(--strong); } .m-user span:not(.av) { display: block; color: var(--muted); font-size: 12px; }
#menu.grid-menu { min-width: 250px; }
.gl-menu { padding: 6px 10px 2px; }
.gl-row { display: flex; align-items: center; gap: 2px; margin-bottom: 2px; }
.gl-n { width: 22px; color: var(--muted); font-size: 13px; text-align: center; }
.gl-btn { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; color: var(--text); border-radius: 4px; }
.gl-btn:hover { background: var(--hover); } .gl-btn.on { color: var(--acc-text); background: color-mix(in srgb, var(--blue) 14%, transparent); }
.gl-sync { justify-content: space-between; }
.kb-tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.kb-tbl td { padding: 7px 4px; border-bottom: 1px solid var(--line); } .kb-tbl td:last-child { text-align: right; }
kbd { font: 12px var(--font); padding: 2px 6px; border: 1px solid var(--inline); border-radius: 4px; background: var(--panel2); }

/* multi-chart grid */
#grid { flex: 1; min-height: 0; display: grid; gap: 4px; background: var(--gapc); }
#grid > #chartWrap, #grid > .gcell { min-width: 0; min-height: 0; position: relative; background: var(--chartbg); }
#grid > .gcell iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; background: var(--chartbg); }
body.multi #grid > .pane-on { box-shadow: inset 0 0 0 1px var(--blue); }
body.multi #grid > .pane-on::after { content: ''; position: absolute; inset: 0; border: 1px solid var(--blue); pointer-events: none; z-index: 8; }

/* an extra pane inside its iframe: just the chart and its legend (the main page's toolbars drive it) */
body.embed #topbar, body.embed #toolbar, body.embed #rstrip, body.embed #rpanel, body.embed #bottombar, body.embed #replayBar, body.embed #favbar { display: none !important; }
body.embed #main { gap: 0; }
body.embed, body.embed html { background: var(--chartbg); }

@media (max-width: 1500px) { #btnInd .lbl, #btnAlert .lbl, #btnReplay .lbl { display: none; } #layoutName { display: none; } }
@media (max-width: 1500px) { #favTfs .tfb:is([data-tf="2"], [data-tf="3"], [data-tf="10"], [data-tf="45"], [data-tf="180"], [data-tf="480"], [data-tf="2D"], [data-tf="3D"]) { display: none; } }
@media (max-width: 1100px) { #favTfs .tfb:is([data-tf="1"], [data-tf="30"], [data-tf="120"], [data-tf="720"], [data-tf="M"]) { display: none; } }
@media (max-width: 760px) {
  #topbar { height: 44px; }
  .tb svg { width: 24px; height: 24px; }
  #btnGrid, #btnTheme { display: none; }
  .tg { width: 44px; } .tg .tg-main svg { width: 26px; height: 26px; }
  #rstrip { width: auto; }
}
.tb.caret svg:last-child { width: 28px; height: 28px; opacity: 1; }
.tb > i[data-ic=caret] svg, .tb.caret > i:last-child svg { width: 8px; height: 8px; opacity: .9; }
@media (max-width: 760px) {
  #favTfs .tfb { display: none; }
  #favTfs .tfb:is([data-tf="15"], [data-tf="60"], [data-tf="240"], [data-tf="D"]) { display: inline-flex; }
}

/* ===================================================================== Round 4 (TradingView parity: theme, favourites, flyouts, chart types, settings, bars) */
/* floating favourites toolbar: a pill with a drag handle */
#favbar { background: var(--pop); border: 1px solid var(--popline); border-radius: 8px; padding: 2px 4px 2px 2px; gap: 0; box-shadow: 0 2px 10px rgba(0,0,0,.35); }
#favbar .fb-drag { width: 14px; height: 32px; display: flex; align-items: center; justify-content: center; color: var(--muted); cursor: grab; font-size: 11px; letter-spacing: -2px; user-select: none; }
#favbar .fb-drag:active { cursor: grabbing; }
#favbar button { width: 34px; height: 34px; border-radius: 4px; }
#favbar svg { width: 28px; height: 28px; }
#favbar button.on { background: var(--sel, rgba(41,98,255,.18)); color: var(--acc-text, #9bb6ff); }
/* drawing tool flyouts: dark custom menus with an icon per tool, section headers, star on hover (filled star stays) */
#menu.tool-menu { min-width: 250px; padding: 6px 0; }
#menu.tool-menu .m-head { font-size: 11px; letter-spacing: .4px; color: var(--muted); padding: 10px 16px 4px; text-transform: uppercase; }
#menu.tool-menu .m-item { height: 36px; }
#menu.tool-menu .m-ic { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; color: var(--text); }
#menu.tool-menu .m-ic svg { width: 28px; height: 28px; }
#menu.tool-menu .m-item.on .m-ic { color: var(--acc-text); }
#menu .m-lbl { flex: 1; }
.m-star { margin-left: auto; padding-left: 10px; opacity: 0; color: var(--muted); transition: opacity .1s; }
.m-item:hover .m-star { opacity: 1; }
.m-star.on { opacity: 1; color: #f7a600; }
.m-star:hover { color: #f7a600; }
#menu.tool-menu .m-hint { margin-left: 12px; }
#menu.ct-menu .m-item:disabled .m-hint { font-size: 11px; }
/* favourite chart types next to the chart-type button */
#favCtypes { display: inline-flex; gap: 0; }
#favCtypes[hidden] { display: none; }
#favCtypes .fct { width: 34px; padding: 0; justify-content: center; }
#favCtypes .fct svg { width: 28px; height: 28px; }
#favCtypes .fct.on { color: var(--acc-text); }
#btnIndTpl { width: 34px; padding: 0; justify-content: center; }
/* navigation buttons on the chart (Settings > Canvas > Buttons) */
#navBtns { position: absolute; left: 50%; bottom: 46px; transform: translateX(-50%); display: flex; gap: 4px; z-index: 6; opacity: 0; pointer-events: none; transition: opacity .15s; }
#navBtns button { width: 30px; height: 30px; border-radius: 50%; background: var(--pop); border: 1px solid var(--popline); color: var(--text); display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
#navBtns button:hover { background: var(--hover); }
#navBtns svg { width: 22px; height: 22px; }
body.nav-hover #chartWrap:hover #navBtns, body.nav-always #navBtns { opacity: 1; pointer-events: auto; }
body.nav-hidden #navBtns { display: none; }
body.panebtn-always .lg-row.study .lg-btns { display: inline-flex; }
body.panebtn-hidden .lg-row.study .lg-btns, body.panebtn-hidden .lg-row.study:hover .lg-btns { display: none; }
body:not(.sl-nobg) .lg-main, body:not(.sl-nobg) .lg-row.study { background: color-mix(in srgb, var(--chartbg) 72%, transparent); border-radius: 4px; }
.lg-main { display: flex; align-items: center; gap: 0; }
.lg-main .ttl { display: inline-flex; align-items: center; }
/* round 5: TradingView status line - full-contrast title, green Open pill, SELL/BUY boxes (display only) */
.lg-main .t { opacity: 1; }
.lg-status { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 8px; margin: 0 10px 0 8px; border-radius: 10px; font-size: 12px; font-weight: 500; }
.lg-status i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.lg-status.open { color: #22ab94; background: rgba(34, 171, 148, .16); }
.lg-status.closed { color: #787b86; background: rgba(120, 123, 134, .16); }
.lg-trade { display: flex; align-items: center; gap: 0; margin: 4px 0 2px; pointer-events: auto; width: fit-content; }
.lg-trade .tb { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-width: 76px; height: 40px; padding: 0 8px; border: 1px solid; border-radius: 6px;
  background: var(--chartbg); font-variant-numeric: tabular-nums; cursor: default; line-height: 1.15; }
.lg-trade .tb b { font-size: 14px; font-weight: 600; } .lg-trade .tb small { font-size: 12px; letter-spacing: .3px; }
.lg-trade .sell { color: #f23645; border-color: #f23645; } .lg-trade .buy { color: #2962ff; border-color: #2962ff; }
.lg-trade .sp { min-width: 26px; text-align: center; font-size: 11px; color: var(--charttext); }
.lg-logo { display: inline-flex; margin-right: 6px; }
.sym-row .ex-add { color: #2962ff; font-weight: 600; margin-left: 10px; white-space: nowrap; }
.sym-row .grp { white-space: nowrap; } .lg-logo svg, .lg-logo .si { width: 18px; height: 18px; }
/* settings: number inputs with units, TradingView spacing */
.st-num { width: 74px; }
.st-unit { color: var(--muted); margin-left: 8px; min-width: 28px; }
.st-ctl select + .st-swatch, .st-ctl .st-swatch + .st-swatch, .st-ctl .st-swatch + select { margin-left: 8px; }
/* theme question */
#modal.theme-ask { width: 420px; }
#modal.theme-ask .md-body p { line-height: 1.5; margin: 4px 0 8px; }
/* bottom bar: clock + time zone in one button, separators */
#clock { font-variant-numeric: tabular-nums; }
.bsep { width: 1px; height: 18px; background: var(--line); margin: 0 4px; flex-shrink: 0; }
/* right rail */
#rstrip .rs-sep { width: 26px; height: 1px; background: var(--line); margin: 4px 0; flex-shrink: 0; }
#rstrip .rs-spacer { flex: 1; }
#rstrip .rs { color: var(--text); }
#rstrip .rs:hover { color: var(--strong); }
#rstrip .rs.on { color: var(--acc-text); }
table.dw { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; margin-bottom: 6px; }
table.dw td { padding: 4px 12px; color: var(--text); } table.dw td:first-child { color: var(--muted); } table.dw td:last-child { text-align: right; }
.hl .wl-row { display: flex; justify-content: space-between; padding: 6px 12px; cursor: pointer; }
.hl .wl-row:hover { background: var(--hover); }
.hl .up { color: var(--up, #089981); } .hl .dn { color: var(--down, #f23645); }
.cal-row { display: grid; grid-template-columns: 110px 40px 1fr; gap: 6px; padding: 6px 12px; font-size: 12px; border-left: 3px solid transparent; }
.cal-row.imp-high { border-left-color: #f23645; } .cal-row.imp-medium { border-left-color: #ff9800; } .cal-row.imp-low { border-left-color: #f7d64a; }
.cal-t { color: var(--muted); }
@media (max-width: 760px) { #rstrip .rs-sep, #rstrip .rs-spacer, #rstrip [data-panel="hotlist"], #rstrip [data-panel="calendar"], #rstrip [data-panel="notifs"], #rstrip [data-panel="help"] { display: none; } #favCtypes, #btnIndTpl { display: none; } #navBtns { display: none; } }
body.creating #drawbar { display: none !important; }
/* settings rows: labels in one column, controls lined up after them (TradingView layout) */
.set-body .st-row { justify-content: flex-start; gap: 14px; }
.set-body .st-row .st-lbl { flex: 0 0 196px; }
.set-body .st-row.st-bool { gap: 14px; }
.set-body .st-bool > label:not(.st-swatch) { flex: 0 0 196px; min-width: 196px; }
.set-body .st-row .st-ctl select { width: 190px; }
/* Round 8: TradingView dialog tabs (Inputs / Style / Visibility) are plain text with a straight 2px underline - no pills, and the
   active tab keeps its dark text on hover (the pill hover rule turned it white-on-white) */
.md-tabs.st-tabs button, .md-tabs.st-tabs button:not(.on) { border-radius: 0; background: none !important; padding: 12px 0 10px; color: var(--muted); }
.md-tabs.st-tabs button.on, .md-tabs.st-tabs button.on:hover { color: var(--strong); box-shadow: inset 0 -2px 0 var(--strong); }
.md-tabs.st-tabs button:not(.on):hover { color: var(--text); }
.md-tabs.st-tabs { gap: 18px; padding: 0 18px; }
/* Round 8b: TradingView floating toolbar - "— 1px" width button */
#drawbar .db-txt .db-wl { display: inline-block; width: 14px; border-top: 1px solid currentColor; margin-right: 6px; vertical-align: middle; }
#drawbar button svg { width: 22px; height: 22px; }
#drawbar .db-c svg { width: 18px; height: 18px; }
body.drawdrag #drawbar { visibility: hidden; }

/* ================= Round 9a: TradingView drawing toolbar, menus, settings window, emoji picker ================= */
/* checkered colour swatches (transparent colours show the checkerboard, like TradingView) */
#drawbar .db-c i, .st-swatch, .ds-lc { background: linear-gradient(var(--c), var(--c)), repeating-conic-gradient(#c8c8c8 0 25%, #fff 0 50%) 0 0 / 6px 6px; }
#drawbar .db-c i { width: 18px; height: 4px; border-radius: 1px; border: 0; box-shadow: inset 0 0 0 1px rgba(128,128,128,.25); }
#drawbar .db-c i.rb { background: var(--rb); }
#drawbar button.on { background: var(--hover); color: var(--acc-text, #2962ff); }
#drawbar .db-fs { min-width: 34px; font-size: 13px; }
/* width / style glyphs in the toolbar dropdowns */
.m-lw { display: block; width: 26px; border-top: 1px solid var(--text); }
.m-ls { display: block; width: 26px; border-top: 2px solid var(--text); }
.m-ls.ls-dashed { border-top-style: dashed; } .m-ls.ls-dotted { border-top-style: dotted; }
#menu .m-ck { width: 18px; display: inline-flex; color: var(--text); } #menu .m-ck svg { width: 16px; height: 16px; }
.m-arr { margin-left: auto; padding-left: 12px; color: var(--muted); display: inline-flex; } .m-arr svg { width: 14px; height: 14px; transform: rotate(-90deg); }
#menu2 { position: fixed; z-index: 101; min-width: 200px; max-height: 80vh; overflow-y: auto; background: var(--pop); border: 1px solid var(--popline); border-radius: 6px; padding: 6px 0; box-shadow: var(--shadow); }
#menu2 .m-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 0 16px; height: 34px; text-align: left; color: var(--text); font-size: 14px; }
#menu2 .m-item:hover { background: var(--hover); } #menu2 .m-sep { height: 1px; background: var(--line); margin: 6px 0; }
#menu2 .m-head { font-size: 11px; color: var(--muted); padding: 8px 16px 4px; text-transform: uppercase; letter-spacing: .4px; }
/* settings window: TradingView proportions (narrow; fib wider), swatch buttons, line buttons, spinners, range sliders */
#modal.st-modal { width: 400px; }
#modal.st-modal.st-wide { width: 500px; }
.md-head .md-ren { margin-right: auto; margin-left: 8px; color: var(--muted); display: inline-flex; } .md-head .md-ren svg { width: 18px; height: 18px; }
.st-body .st-row .st-lbl { flex: 0 0 120px; }
.st-body .st-row { justify-content: flex-start; }
.st-swatch { width: 28px; height: 28px; border-radius: 4px; border: 1px solid var(--line); padding: 0; flex: none; }
.ds-line { gap: 6px; padding: 0 6px; height: 30px; }
.ds-line .ds-lc { width: 18px; height: 18px; border-radius: 3px; display: inline-block; }
.ds-line .ds-lw i { width: 22px; }
.ds-line.ds-sq { margin-left: 6px; }
.ds-lwide i { display: block; width: 40px; border-top: 1px solid var(--text); }
.ds-end { width: 34px; height: 30px; border: 1px solid var(--line); border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; margin-left: 6px; }
.ds-end svg { width: 22px; height: 22px; }
.st-body .st-row.off > :not(label):not(input[type=checkbox]) { opacity: .45; }
.ds-chl { gap: 10px; } .ds-chl input[type=number] { width: 80px; } .ds-chl .ds-nochk { width: 16px; flex: none; }
.ds-chl input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--strong, #131722); }
.ds-font { gap: 8px; } .ds-font select { width: 70px !important; }
#dsText { width: 100%; box-sizing: border-box; min-height: 92px; resize: vertical; margin: 0 0 14px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: transparent; color: var(--text); font: 14px -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif; }
.st-body .st-row .st-ctl select + select { margin-left: 8px; width: 110px; }
.ds-spin { position: relative; display: inline-flex; }
.ds-spin input { width: 120px !important; padding-right: 22px; }
.ds-spin i { position: absolute; right: 4px; width: 14px; height: 12px; cursor: pointer; color: var(--muted); display: flex; align-items: center; justify-content: center; }
.ds-spin i[data-up] { top: 3px; transform: rotate(180deg); } .ds-spin i[data-dn] { bottom: 3px; } .ds-spin i svg { width: 10px; height: 10px; }
.ds-bar { width: 80px !important; margin-left: 8px !important; }
.ds-vis { gap: 10px; } .ds-vis label.st-bool { flex: 0 0 96px !important; min-width: 96px !important; }
.ds-vis input[type=number] { width: 52px !important; padding: 4px 6px; text-align: center; }
.ds-rng { position: relative; flex: 1; height: 4px; border-radius: 2px; background: var(--line); margin: 0 8px; }
.ds-rng .ds-rf { position: absolute; top: 0; bottom: 0; background: var(--strong, #131722); border-radius: 2px; }
.ds-rng b { position: absolute; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--pop, #fff); border: 2px solid var(--strong, #131722); cursor: ew-resize; box-sizing: border-box; }
.ds-tplbtn { display: inline-flex; align-items: center; gap: 6px; } .ds-tplbtn svg { width: 12px; height: 12px; }
.st-op { width: 120px; accent-color: var(--strong, #131722); }
/* emoji picker (TradingView: category tabs, sections, 9-column grid, Emojis / Stickers / Icons) */
#emojiPop { position: fixed; z-index: 102; width: 340px; height: 400px; display: flex; flex-direction: column; background: var(--pop); border: 1px solid var(--popline); border-radius: 6px; box-shadow: var(--shadow); }
#emojiPop .ep-tabs { display: flex; justify-content: space-between; padding: 6px 8px; border-bottom: 1px solid var(--line); }
#emojiPop .ep-tabs button { width: 30px; height: 30px; border-radius: 4px; font-size: 16px; filter: grayscale(1); opacity: .7; }
#emojiPop .ep-tabs button.on { background: var(--hover); filter: none; opacity: 1; }
#emojiPop .ep-body { flex: 1; overflow-y: auto; padding: 0 8px 8px; }
#emojiPop .ep-head { font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); padding: 10px 4px 6px; position: sticky; top: 0; background: var(--pop); }
#emojiPop .ep-grid { display: grid; grid-template-columns: repeat(9, 1fr); gap: 2px; }
#emojiPop .ep-grid button { height: 34px; font-size: 22px; border-radius: 4px; line-height: 1; }
#emojiPop .ep-grid.stickers button { height: 60px; font-size: 40px; } #emojiPop .ep-grid.stickers { grid-template-columns: repeat(5, 1fr); }
#emojiPop .ep-grid.icons button { font-size: 18px; color: var(--text); }
#emojiPop .ep-grid button:hover { background: var(--hover); }
#emojiPop .ep-kinds { display: flex; gap: 4px; padding: 6px 8px; border-top: 1px solid var(--line); }
#emojiPop .ep-kinds button { flex: 1; height: 30px; border-radius: 4px; font-size: 13px; color: var(--text); }
#emojiPop .ep-kinds button.on { background: var(--strong); color: var(--pop); }
/* Round 9a: TradingView proportions of the floating toolbar (T_*_toolbar at 1:1): 38px pitch, 26px glyphs, 22x4 colour bars */
#drawbar { border: 0; border-radius: 8px; padding: 3px 6px; gap: 2px; box-shadow: 0 2px 8px rgba(0,0,0,.18), 0 0 0 1px rgba(0,0,0,.04); }
#drawbar button { width: 36px; height: 36px; border-radius: 4px; }
#drawbar button svg { width: 26px; height: 26px; }
#drawbar .db-c { gap: 0; }
#drawbar .db-c svg { width: 24px; height: 22px; }
#drawbar .db-c i { width: 22px; height: 4px; border-radius: 2px; margin-top: 1px; }
#drawbar .db-txt { width: auto; padding: 0 8px; font-size: 15px; }
#drawbar .db-ls { width: 40px; } #drawbar .db-ls i { width: 22px; border-top-width: 1.5px; }
#drawbar .db-drag { color: #b2b5be; font-size: 14px; padding: 0 4px 0 2px; }
/* Round 9a: TradingView settings window proportions (T_*_settings_* at 1:1): 384px+, 22px title, 16px tabs on a grey rail,
   50px rows, 106px label column, dark Ok + outlined Cancel, no header / footer rules */
#modal.st-modal { width: auto; min-width: 384px; max-width: 560px; }
#modal.st-modal.st-wide { min-width: 460px; }
#modal.st-modal .md-head { border: 0; padding: 22px 16px 6px 22px; }
#modal.st-modal .md-head b { font-size: 22px; font-weight: 700; color: var(--strong); }
#modal.st-modal .md-head .md-ren { color: var(--strong); margin-left: 12px; } #modal.st-modal .md-head .md-ren svg { width: 22px; height: 22px; }
#modal.st-modal .md-tabs.st-tabs { gap: 24px; margin: 0 22px; padding: 0; border: 0; box-shadow: inset 0 -4px 0 var(--panel2, #f0f3fa); }
#modal.st-modal .md-tabs.st-tabs button, #modal.st-modal .md-tabs.st-tabs button:not(.on) { font-size: 16px; font-weight: 600; color: var(--strong); padding: 10px 0 12px; }
#modal.st-modal .md-tabs.st-tabs button.on { box-shadow: inset 0 -4px 0 var(--strong); }
#modal.st-modal .md-body { padding: 18px 22px 8px; }
#modal.st-modal .st-row { min-height: 40px; margin: 0 0 10px; font-size: 15px; gap: 8px; }
#modal.st-modal .st-row .st-lbl { flex: 0 0 98px; }
#modal.st-modal label.st-bool, #modal.st-modal .st-row.st-bool label.st-bool { gap: 10px; font-size: 15px; min-width: 0; flex: none; margin: 0; }
#modal.st-modal .st-row.st-bool label.st-bool { min-width: 106px; }
#modal.st-modal input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--strong); }
#modal.st-modal .st-group { font-size: 11px; font-weight: 500; margin: 8px 0 6px; color: var(--muted); }
#modal.st-modal select, #modal.st-modal input[type=number], #modal.st-modal input[type=text] { height: 34px; border: 1px solid var(--inline, #e0e3eb); border-radius: 6px; background: transparent; color: var(--text); font-size: 15px; padding: 0 10px; }
#modal.st-modal .st-row .st-ctl select { width: 180px; -webkit-appearance: none; appearance: none; padding-right: 28px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23787b86' stroke-width='1.4'/%3E%3C/svg%3E") no-repeat right 10px center; }
#modal.st-modal .st-row .st-ctl select + select { width: 120px; margin-left: 8px; }
#modal.st-modal .st-swatch { width: 34px; height: 34px; border-radius: 6px; border: 1px solid var(--inline, #e0e3eb); background-clip: content-box; padding: 5px; }
#modal.st-modal .ds-line { height: 34px; border: 1px solid var(--inline, #e0e3eb); border-radius: 6px; padding: 0 8px 0 6px; gap: 10px; }
#modal.st-modal .ds-line .ds-lc { width: 22px; height: 22px; border-radius: 2px; }
#modal.st-modal .ds-line .ds-lw i { width: 28px; border-top-width: 1px; border-top-color: var(--strong); }
#modal.st-modal .ds-end { width: 34px; height: 34px; border-color: var(--inline, #e0e3eb); margin-left: 8px; }
#modal.st-modal .md-foot { border: 0; padding: 26px 22px 22px; }
#modal.st-modal .md-foot #dsCancel { border: 1px solid var(--strong); border-radius: 8px; padding: 0 16px; height: 34px; font-size: 16px; color: var(--strong); background: transparent; }
#modal.st-modal .md-foot #dsOk { background: var(--strong); color: var(--pop); border-radius: 8px; padding: 0 14px; height: 34px; font-size: 16px; min-width: 44px; }
#modal.st-modal .md-foot .ds-tplbtn { border: 1px solid var(--inline, #e0e3eb); border-radius: 6px; padding: 0 10px; height: 34px; font-size: 15px; color: var(--strong); }
#modal.st-modal #dsText { min-height: 110px; font-size: 15px; }
#modal.st-modal .ds-tog { width: 34px; height: 34px; border-color: var(--inline, #e0e3eb); }
#modal.st-modal .ds-tog.on { background: var(--panel2, #f0f3fa); border-color: var(--strong); }
#modal.st-modal label.st-bool { display: flex; align-items: center; cursor: pointer; }
#modal.st-modal .ds-vis { gap: 14px; }
#modal.st-modal .ds-vis label.st-bool { flex: 0 0 86px !important; min-width: 86px !important; }
#modal.st-modal .ds-vis input[type=number] { width: 100px !important; text-align: left; padding: 0 10px; }
#modal.st-modal .ds-rng { flex: 0 0 88px; height: 6px; border-radius: 3px; margin: 0; background: var(--panel2); }
#modal.st-modal .ds-rng .ds-rf { border-radius: 3px; background: var(--muted2, #6a6d78); }
#modal.st-modal .ds-rng b { width: 12px; height: 12px; margin: -6px 0 0 -6px; border-width: 2px; }
/* TradingView opacity slider: checkerboard fading into the colour, round white thumb */
.cp-op input[type=range] { -webkit-appearance: none; appearance: none; height: 12px; border-radius: 6px; border: 1px solid var(--line);
  background: linear-gradient(to right, transparent, var(--c, #2962ff)), repeating-conic-gradient(#c8c8c8 0 25%, #fff 0 50%) 0 0 / 8px 8px; }
.cp-op input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 2px solid #131722; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.cp-op input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 2px solid #131722; }
.cp-op input[type=number], .cp-op #cpOpN { width: 52px; height: 30px; border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; }
.m-arr svg { transform: none; width: 6px; height: 12px; }
#menu.db-tpl .m-ic:empty { display: none; }
/* TradingView toolbar dropdowns (width / style / font size): compact, the current value filled dark */
#menu.db-menu { min-width: 0; padding: 4px 0; }
#menu.db-menu .m-item { height: 28px; padding: 0 14px 0 12px; gap: 10px; font-size: 14px; }
#menu.db-menu .m-item.on, #menu.db-menu .m-item.on:hover { background: var(--strong); color: var(--pop); }
#menu.db-menu .m-item.on .m-lw, #menu.db-menu .m-item.on .m-ls { border-top-color: var(--pop); }
#menu.db-menu .m-lw, #menu.db-menu .m-ls { width: 14px; }
#menu.db-menu .m-ic { width: 16px; height: auto; }
#menu.db-fsm .m-item { min-width: 64px; }
#menu.db-menu .m-ls { width: 20px; border-top-width: 1px; } #menu.db-menu .m-ls.ls-dotted { border-top-width: 2px; }
#modal.st-modal .ds-levels { gap: 8px 30px; margin: 4px 0 16px; }
#modal.st-modal .ds-lv { gap: 10px; }
#modal.st-modal .ds-lv input[type=number] { width: 100px; }
#modal.st-modal .ds-lv.off input[type=number] { background: var(--panel2); color: var(--muted); border-color: transparent; }
#modal.st-modal .ds-lv.off .st-swatch { opacity: .5; }
#modal.st-modal .md-body { overflow-y: auto; }
#modal.st-modal .st-group { margin: 18px 0 8px; }
#modal.st-modal .st-ctl .st-swatch + select, #modal.st-modal .st-ctl .st-swatch + select + select { width: 100px; margin-left: 8px; }
#modal.st-modal .ds-chl { gap: 10px; }
#modal.st-modal .ds-chl .ds-nochk { width: 18px; flex: none; }
#modal.st-modal .ds-chl input[type=number] { width: 100px; }
#modal.st-modal .ds-chl .ds-lw i { border-top-color: var(--lc); }
#modal.st-modal .ds-chl.off input[type=number] { background: var(--panel2); color: var(--muted); border-color: transparent; }
#modal.st-modal .ds-chl.off .ds-line { opacity: .5; }
#modal.st-modal .st-row.off > :not(label):not(input[type=checkbox]) { opacity: 1; }
#modal.st-modal .st-row:not(.ds-vis):not(.ds-chl) > .st-lbl, #modal.st-modal .st-row.st-bool:not(.ds-vis) > label.st-bool { flex: 0 0 var(--lblw, 106px) !important; min-width: var(--lblw, 106px) !important; }
#modal.st-modal .st-row, #modal.st-modal .st-row.st-bool { gap: 8px; }
#drawbar button.on, #drawbar button.on:hover { background: var(--strong); color: var(--pop); }
#menu.db-list { min-width: 0; padding: 6px 0; }
#menu.db-list .m-item { height: 32px; padding: 0 16px 0 12px; font-size: 14px; }
/* TradingView flyouts: 36px rows, a rule above every section after the first, black favourite stars */
#menu.tool-menu .m-item { height: 36px; }
#menu.tool-menu .m-head:not(:first-child) { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 12px; }
#menu .m-star.on, #menu .m-star.on:hover { color: var(--strong); }
#menu .m-star:hover { color: var(--strong); }
.m-sw.on { background: var(--strong); } .m-sw.on i { background: var(--pop); }
#menu.tool-menu { padding: 6px; }
#menu.tool-menu .m-item { border-radius: 6px; padding: 0 10px; }
#menu.tool-menu .m-item.on, #menu.tool-menu .m-item.on:hover { background: var(--strong); color: var(--pop); }
#menu.tool-menu .m-item.on .m-ic, #menu.tool-menu .m-item.on .m-star { color: var(--pop); }
#menu.tool-menu .m-head { padding-left: 10px; }
#menu.tool-menu .m-sep { margin: 6px -6px; }
#emojiPop { width: 320px; height: 600px; }
#emojiPop .ep-tabs button { filter: none; opacity: 1; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; padding: 0; }
#emojiPop .ep-tabs button svg { width: 24px; height: 24px; }
#emojiPop .ep-tabs button.on { background: none; color: var(--strong); }
#emojiPop .ep-tabs { border-bottom: 0; padding: 10px 10px 4px; }
#emojiPop .ep-grid { grid-template-columns: repeat(9, 1fr); gap: 0; }
#emojiPop .ep-grid button { padding: 0; min-width: 0; width: 100%; height: 33px; font-size: 22px; }
#emojiPop .ep-kinds { justify-content: center; gap: 22px; border-top: 1px solid var(--line); padding: 0 10px; }
#emojiPop .ep-kinds button { flex: none; height: 44px; border-radius: 0; font-size: 15px; padding: 0 2px; background: none !important; color: var(--strong) !important; }
#emojiPop .ep-kinds button.on { color: #2962ff !important; box-shadow: inset 0 -2px 0 #2962ff; }
#modal.st-modal .ds-font select { width: 100px !important; }
#modal.st-modal .ds-tog.on { background: var(--muted, #9598a1); color: #fff; border-color: transparent; }
#modal.st-modal #dsText { min-height: 170px; }
#modal.st-modal .md-body .st-row.ds-font { margin-bottom: 16px; }
#modal.st-modal .st-body { min-height: 0; max-height: calc(100vh - 230px); }
#modal.st-modal { max-height: calc(100vh - 40px); }
#modal.st-modal .ds-line .ds-lw i { border-top-color: var(--lc, var(--strong)); }
#modal.st-modal .st-row.st-bool.off > :not(label) { opacity: .45; pointer-events: none; }
#modal.st-modal select { text-overflow: ellipsis; white-space: nowrap; overflow: hidden; }
#modal.st-modal .st-row .st-ctl select:has(+ select) { width: 120px; }
#modal.st-modal #dsText { min-height: 100px; }
#modal.st-modal.st-text #dsText, #modal.st-modal.st-callout #dsText, #modal.st-modal.st-note #dsText { min-height: 170px; }
#modal.st-modal .ds-bar { width: 120px !important; }
#modal.st-modal .st-ctl > input[data-cp] { width: 120px; }
#modal.st-modal .ds-spin i { opacity: 0; } #modal.st-modal .ds-spin:hover i, #modal.st-modal .ds-spin:focus-within i { opacity: 1; }

/* ================= Round 9b: TradingView's current dark theme (W_30..W_45): pure black panels, #222 gaps, neutral greys ================= */
:root {
  --bg: #000000; --panel: #000000; --panel2: #1a1a1a; --pop: #0f0f0f; --popline: #303030; --hover: #1f1f1f; --hover2: #2e2e2e;
  --line: #222222; --gapc: #222222; --inline: #3a3a3a; --text: #dbdbdb; --strong: #f2f2f2; --muted: #8c8c8c; --muted2: #b8b8b8;
  --sel: #142e61; --selhover: #1c3a75;
}
/* watchlist like TradingView: list name as the header, Symbol / Last / Chg / Chg% columns, section rows, outlined selected row */
@media (min-width: 761px) { #rpanel.is-watch .rp-head { display: none; } }   /* phones keep the header for its close button */
.wl-bar { height: 52px; padding: 0 6px 0 14px; border-bottom: 0; }
.wl-bar .wl-name { font-size: 13px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--strong); display: inline-flex; align-items: center; gap: 6px; }
.wl-head { height: 30px; font-size: 13px; border-bottom: 0; }
.wl-grp { color: var(--muted); font-weight: 500; font-size: 11px; letter-spacing: .6px; padding: 10px 12px 6px; display: flex; align-items: center; gap: 6px; border-top: 1px solid var(--line); }
.wl-grp .wg-c svg { width: 9px; height: 9px; } .wl-grp.shut .wg-c svg { transform: rotate(-90deg); }
.wl-row { height: 34px; border-bottom: 1px solid var(--line); font-size: 14px; }
.wl-row.sel { background: transparent; box-shadow: inset 0 0 0 1px var(--muted2); border-radius: 6px; }
.wl-row .c.up, .wl-row .ch.up { color: var(--up); } .wl-row .c.dn, .wl-row .ch.dn { color: var(--down); }
/* details pane */
#details { border-top: 4px solid var(--gapc); padding: 12px 14px 24px; font-size: 13px; color: var(--text); overflow-y: auto; }
#details .dt-head { display: flex; align-items: center; gap: 10px; height: 36px; } #details .dt-head b { font-size: 15px; color: var(--strong); }
#details .dt-head .sym-ic { width: 24px; height: 24px; }
#details .dt-desc { color: var(--text); margin-top: 6px; font-size: 13px; } #details .dt-kind { color: var(--muted); font-size: 13px; margin-top: 4px; }
#details .dt-px { display: flex; align-items: baseline; gap: 8px; margin-top: 14px; font-variant-numeric: tabular-nums; }
#details .dt-big { font-size: 28px; font-weight: 600; color: var(--strong); } #details .dt-big small { font-size: 28px; color: var(--up); }
#details .dt-px span.up, #details .dt-px span.dn { font-size: 16px; font-weight: 600; }
#details .up { color: var(--up); } #details .dn { color: var(--down); }
#details .dt-mkt { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; margin-top: 4px; }
#details .dt-mkt i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); } #details .dt-mkt.on { color: var(--up); } #details .dt-mkt.on i { background: var(--up); }
#details .dt-vol { margin-top: 16px; } #details .dt-vol > div:first-child, #details .dt-vol > div:nth-child(2) { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
#details .dt-vol b { color: var(--strong); font-weight: 500; } #details .dt-vol p { color: var(--muted); font-size: 11px; margin: 4px 0 0; }
#details .dt-vbar { height: 4px; border-radius: 2px; background: var(--hover2); margin-top: 6px; overflow: hidden; } #details .dt-vbar i { display: block; height: 100%; background: #2962ff; }
#details h4 { font-size: 15px; font-weight: 600; color: var(--strong); margin: 22px 0 10px; }
#details .dt-stat { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; } #details .dt-stat span { color: var(--text); } #details .dt-stat b { color: var(--strong); font-weight: 600; font-variant-numeric: tabular-nums; }
#details .dt-perf { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
#details .dt-tile { border-radius: 4px; padding: 8px 4px; text-align: center; background: var(--hover); } #details .dt-tile b { display: block; font-size: 14px; font-weight: 600; } #details .dt-tile span { font-size: 12px; color: var(--text); }
#details .dt-tile.dn { background: rgba(242,54,69,.27); } #details .dt-tile.dn b { color: #f7525f; }
#details .dt-tile.up { background: rgba(8,153,129,.27); } #details .dt-tile.up b { color: #22ab94; }
#details .dt-seas { width: 100%; height: auto; display: block; } #details .dt-seas text { fill: var(--muted); font-size: 10px; }
#details .dt-leg { display: flex; justify-content: center; gap: 16px; font-size: 12px; margin-top: 6px; } #details .dt-leg i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }
#details .dt-tech { display: flex; flex-direction: column; align-items: center; } #details .dt-gauge { width: 200px; }
#details .dt-tech b { font-size: 20px; font-weight: 600; color: var(--strong); margin-top: -4px; } #details .dt-tech b.sell, #details .dt-tech b.buy { color: var(--strong); }
#details .dt-tech span { color: var(--muted); font-size: 12px; margin-top: 6px; }
#rpanel.is-watch #rpBody { display: flex; flex-direction: column; overflow-y: auto; }
/* TradingView splits the panel: the list and the details scroll on their own, with a 4px gap between them */
@media (min-width: 761px) {
  #rpanel.is-watch #rpBody { overflow: hidden; }
  #rpanel.is-watch #rpBody > .wl { flex: 1 1 45%; min-height: 120px; overflow-y: auto; }
  #rpanel.is-watch #details { flex: 1 1 55%; min-height: 0; overflow-y: auto; }
}
#rpanel.is-watch .wl-row { height: 30px; } #rpanel.is-watch .wl-row .nm { font-weight: 400; color: var(--strong); }
#details .dt-head { position: sticky; top: -12px; background: var(--panel); z-index: 2; margin: -12px -14px 0; padding: 12px 14px 0; height: 48px; box-sizing: border-box; }
#details .dt-prof { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 12px; } #details .dt-prof b { display: block; color: var(--strong); font-weight: 600; font-size: 14px; } #details .dt-prof span { color: var(--text); font-size: 14px; }

/* ---- alerts, built like TradingView's (Nov 2026) ---- */
#modal.al-modal { width: 520px; }
.al-tabs { display: flex; gap: 4px; padding: 0 18px; border-bottom: 1px solid var(--line); }
.al-tabs button { padding: 10px 12px; font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.al-tabs button.on { color: var(--text); border-bottom-color: #2962ff; font-weight: 600; }
.al-body { min-height: 340px; }
.al-seg { display: flex; gap: 0; margin-top: 6px; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.al-seg button { flex: 1; padding: 8px 6px; font-size: 12px; color: var(--text); border-left: 1px solid var(--line); }
.al-seg button:first-child { border-left: 0; }
.al-seg button.on { background: #2962ff; color: #fff; }
.al-hint { display: block; margin-top: 6px; font-size: 12px; color: var(--muted); }
.al-in { flex: 0 0 auto !important; color: var(--muted); font-size: 12px; }
.al-oe { flex: 0 0 auto !important; margin: 0 !important; white-space: nowrap; color: var(--text) !important; }
.al-ph { font-family: Consolas, monospace; font-size: 11px; padding: 1px 5px; border: 1px solid var(--line); border-radius: 4px; color: var(--text); margin: 2px 0; }
.al-ph:hover { border-color: #2962ff; }
#nHookUrl { width: 100%; margin: -2px 0 10px; }
#nSndRow button { flex: 0 0 34px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 6px; height: 32px; }
#nSndRow button svg { width: 16px; height: 16px; }
.al-head { display: flex; align-items: center; gap: 4px; padding: 0 6px 0 0; border-bottom: 1px solid var(--line); }
.al-head .al-tabs { border-bottom: 0; padding: 0 6px; }
.al-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #f23645; vertical-align: middle; }
.al-bar { display: flex; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.al-bar select { flex: 1; font-size: 12px; padding: 5px 6px; }
.al-row { cursor: pointer; align-items: flex-start; }
.al-row:hover { background: var(--hover); }
.al-main { flex: 1; min-width: 0; }
.al-t b { font-weight: 600; }
.al-acts { display: flex; gap: 0; opacity: 0; transition: opacity .15s; }
.al-row:hover .al-acts, .al-row:focus-within .al-acts { opacity: 1; }
@media (hover: none) { .al-acts { opacity: 1; } }
.al-acts .tb svg { width: 16px; height: 16px; }
.al-st.on { color: #22ab94; } .al-st.trig { color: #f7a600; } .al-st.off { color: var(--muted); }
.al-row.stopped, .al-row.expired { opacity: .7; }
.al-log { padding: 9px 12px; border-bottom: 1px solid var(--line); font-size: 13px; }
.al-log.new { background: rgba(41,98,255,.08); }
#alPops { position: fixed; top: 60px; left: 50%; transform: translateX(-50%); z-index: 400; display: flex; flex-direction: column; gap: 8px; width: min(420px, calc(100vw - 24px)); }
.al-pop { background: var(--panel, #1e222d); color: var(--text); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 12px 40px rgba(0,0,0,.45); padding: 12px 14px; animation: alpop .2s ease; }
@keyframes alpop { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.al-pop-h { display: flex; align-items: center; gap: 8px; }
.al-pop-h b { flex: 1; }
.al-pop-ic svg { width: 18px; height: 18px; color: #f7a600; }
.al-pop-m { margin: 8px 0 10px; font-size: 14px; line-height: 1.45; word-break: break-word; }
.al-pop-f { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.al-pop-f button { padding: 5px 12px; border-radius: 6px; border: 1px solid var(--line); }
.al-pop-f .primary { background: #2962ff; color: #fff; border-color: #2962ff; }

/* --- Static build additions (Cloudflare Pages): feed banner, footer, dual watchlists ---
   Everything above this line is the original style.css, unchanged. */
#feedBanner { flex: none; background: #3a2a12; color: #ffd479; border-bottom: 1px solid #6b4d16; padding: 8px 14px; font-size: 13px; }
#feedBanner b { color: #fff; }
#nfa { flex: none; text-align: center; color: var(--muted); font-size: 11px; padding: 5px 8px; background: var(--panel); border-top: 1px solid var(--line); }
#nfa a { color: var(--muted); }
.wl-title { font-size: 13px; font-weight: 700; padding: 5px 8px; }
.wl-sec { border-bottom: 1px solid var(--line); }
.wl-sec-h { display: flex; align-items: center; gap: 8px; padding: 10px 12px 6px; }
.wl-sec-h b { font-size: 12px; letter-spacing: .6px; text-transform: uppercase; }
.wl-st { font-size: 11px; color: var(--muted); white-space: nowrap; }
.wl-st.ok { color: var(--up); }
.wl-st.down { color: var(--down); }
.wl-sec-empty { padding: 8px 12px 12px; }
.wl-sec-act { height: 26px; min-width: 0; font-size: 11px; color: var(--muted); }
.wl-sec-act:hover { color: var(--text); }
/* The two watchlist sections are plain block sections: on a narrow screen they
   simply stack vertically, one above the other. */
