/* Desktop terminal chrome. Market colors and the user-selected chart palette remain independent. */
:root {
  --bg: #131518;
  --panel: #191b1f;
  --line: #2e3238;
  --muted: #a0a4ae;
  --ink: #e9eaf0;
  --accent: #bcb4ef;
  --up: #72d6b7;
  --down: #ed949c;
  --surface-raised: #25282d;
  --hairline: #ffffff0f;
  --hover: #ffffff0a;
  --mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  font-family: -apple-system, BlinkMacSystemFont, Inter, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  scrollbar-color: #454952 transparent;
}
body {
  background: var(--bg);
  font-variant-numeric: tabular-nums;
}
button {
  font-weight: 500;
  touch-action: manipulation;
}
button:hover {
  background: var(--hover);
}
button:active:not(:disabled) {
  background: #ffffff12;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline-color: #c9c3ff;
  outline-offset: 2px;
}
i svg,
.icon svg {
  width: 17px;
  height: 17px;
  stroke-width: 1.7;
  shape-rendering: geometricPrecision;
}
header {
  height: 54px;
  padding: 0 20px 0 16px;
  gap: 32px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.brand {
  gap: 10px;
}
.brand img {
  width: 29px;
  height: 29px;
}
.brand b {
  font-size: 19px;
  line-height: 1.1;
  letter-spacing: -0.85px;
  font-weight: 640;
}
.brand > span {
  font-size: 11px;
  color: #989da8;
  margin-top: 2px;
}
nav {
  height: 32px;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--hairline);
}
nav button {
  gap: 7px;
  min-height: 26px;
  height: 28px;
  align-self: center;
  padding: 0 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 520;
  color: #aeb1ba;
}
nav button.nav-on {
  color: #f2f1f6;
  background: var(--surface-raised);
  box-shadow: inset 0 0 0 1px var(--hairline);
}
nav button:is([data-action='workspace'], [data-action='portfolio'], [data-action='alerts'], [data-action='news'], [data-action='liquidations']):before,
.ai-button:before {
  content: '';
  flex: none;
  width: 15px;
  height: 15px;
  background: currentColor;
  mask: var(--nav-glyph) center / contain no-repeat;
  -webkit-mask: var(--nav-glyph) center / contain no-repeat;
}
nav [data-action='workspace'] {
  --nav-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='1.55' stroke-linejoin='round' viewBox='0 0 20 20'%3E%3Crect x='2.25' y='3' width='15.5' height='14' rx='2.5'/%3E%3Cpath d='M12.8 3v14M12.9 10.2h4.8'/%3E%3C/svg%3E");
}
nav [data-action='portfolio'] {
  --nav-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 20 20'%3E%3Cpath d='M6.8 5.7V4.5c0-.9.7-1.6 1.6-1.6h3.2c.9 0 1.6.7 1.6 1.6v1.2M2.5 9.4c4.6 2.4 10.4 2.4 15 0'/%3E%3Crect x='2.4' y='5.8' width='15.2' height='10.9' rx='2.1'/%3E%3Cpath d='M9 10.6h2v2H9z'/%3E%3C/svg%3E");
}
nav [data-action='alerts'] {
  --nav-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='1.55' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 20 20'%3E%3Cpath d='M3.3 13.8c1.2-1.4 1.7-3.1 1.7-5.6a5 5 0 0 1 10 0c0 2.5.5 4.2 1.7 5.6H3.3Zm4.6 2.4c.8 1.2 3.4 1.2 4.2 0'/%3E%3C/svg%3E");
}
.header-actions {
  gap: 8px;
}
.ai-button {
  --nav-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='1.45' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 20 20'%3E%3Cpath d='M6.2 3h7.6A3.15 3.15 0 0 1 17 6.2v5.3a3.15 3.15 0 0 1-3.2 3.2H8l-3.6 2.5v-3.1A3.1 3.1 0 0 1 3 11.5V6.2A3.15 3.15 0 0 1 6.2 3Z'/%3E%3Cpath d='m6.1 10 2.5-2.5 2.1 1.9L14 6.8'/%3E%3C/svg%3E");
  min-height: 30px;
  border: 1px solid #494557;
  border-radius: 7px;
  padding: 3px 11px;
  font-size: 12px;
  color: #d9d3ef;
  background: #323039;
  white-space: nowrap;
  flex-shrink: 0;
}
.ai-button:hover {
  background: #403c49;
}
.ai-button i {
  display: none;
}
.header-actions > .iconbtn {
  width: 31px;
  height: 31px;
  min-width: 31px;
  color: #c1c2cb;
}
.controlbar {
  height: 44px;
  min-height: 44px;
  gap: 6px;
  padding: 4px 12px;
  background: #1b1d21;
  border-block: 1px solid #ffffff09;
  border-bottom-color: var(--line);
  scrollbar-width: none;
}
.controlbar::-webkit-scrollbar,
.tools::-webkit-scrollbar,
.tabset::-webkit-scrollbar {
  display: none;
}
.controlbar button {
  color: #c0c3cb;
  font-size: 12px;
  min-height: 28px;
  border-radius: 5px;
}
.controlbar button :is(.icon, i) {
  color: #aab0ba;
}
.controlbar .symbolbutton {
  gap: 8px;
  padding: 3px 14px 3px 4px;
}
.symbolbutton b {
  font-weight: 660;
  letter-spacing: 0.015em;
  font-size: 12px;
}
.symbolbutton > span {
  font-size: 11px;
}
#intervals {
  gap: 1px;
  padding-right: 10px;
}
#intervals button {
  padding: 3px 7px;
  font-size: 11.5px;
}
button.selected,
.tabset .selected,
#intervals .selected,
.tools button.selected {
  color: #d9d2ff;
  background: #373441;
  box-shadow: inset 0 0 0 1px #a89cdb25;
}
.tools {
  width: 44px;
  gap: 4px;
  padding: 8px 4px;
  background: #1b1d21;
  border-right: 1px solid #ffffff0d;
  scrollbar-width: none;
}
.tools button {
  width: 34px;
  height: 34px;
  padding: 6px;
  color: #b7bcc6;
  border-radius: 7px;
}
.tools .icon svg {
  width: 19px;
  height: 19px;
  stroke-width: 1.55;
}
.toolsep {
  width: 20px;
  background: #3a3c43;
  margin: 3px 0;
}
.pane-grid {
  gap: 1px;
  background: #42444c;
}
.pane-grid:not(.layout1) .pane.active {
  box-shadow: inset 0 0 0 1px var(--accent);
}
.panehead {
  position: relative;
  align-items: center;
  min-height: 54px;
  padding: 7px 16px 8px;
  border-bottom: 1px solid #8888881c;
}
.instrument {
  gap: 9px;
}
.instrument b {
  color: var(--chart-text);
  font-size: 15px;
  font-weight: 630;
  letter-spacing: -0.3px;
}
.instrument small,
.quote small {
  opacity: 0.91;
  font-size: 10.5px;
  line-height: 1.4;
}
.ticker-icon {
  position: relative;
  flex: none;
  overflow: hidden;
  background: #71513a;
  color: #ffe2ae;
  width: 29px;
  height: 29px;
  font-size: 17px;
  box-shadow: inset 0 0 0 1px #ffffff12;
}
.ticker-icon:has(img:not(.market-logo), img.logo-loaded) { font-size: 0; }
.ticker-icon img { position: absolute; inset: 0; width: 100%; height: 100%; }
.ticker-icon img.market-logo:not(.logo-loaded) { opacity: 0; }
.ticker-icon[data-asset='sol'] { background: #111619; }
.ticker-icon[data-asset='hype'] { background: #15362f; }
.ticker-icon.mini-ticker-icon { width: 20px; height: 20px; font-size: 10px; }
.ticker-icon.mini-ticker-icon:has(img:not(.market-logo), img.logo-loaded) { font-size: 0; }
.market-instrument { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ticker-icon:has(.icon) { background: #15362f; color: #b0f3d9; }
.quote {
  font-family: -apple-system, BlinkMacSystemFont, Inter, sans-serif;
  font-size: 20px;
  font-weight: 580;
  letter-spacing: -0.65px;
  font-variant-numeric: tabular-nums;
}
.quote > span {
  color: var(--chart-text);
}
.quote small {
  font: 10px/1.4 var(--mono);
}
.chartnote:not(:empty) {
  font:
    10px/1.45 -apple-system,
    BlinkMacSystemFont,
    Inter,
    sans-serif;
  box-shadow: 0 1px 3px #0001;
  border-color: #8886;
}
.chartnote.error {
  font-size: 12px;
}
.side,
.flow {
  background: var(--panel);
}
.side {
  border-color: #08090b;
  box-shadow: inset 1px 0 #ffffff0a;
}
.panelhead {
  height: 43px;
  min-height: 43px;
  padding: 5px 16px;
  border-color: #ffffff0a;
}
.paneltitle {
  gap: 8px;
}
.paneltitle i {
  color: #aab1bf;
}
h2 {
  font-size: 13px;
  line-height: 18px;
  font-weight: 600;
  letter-spacing: -0.12px;
}
.side .panelhead > .iconbtn {
  border: 1px solid #ffffff13;
  border-radius: 6px;
  min-width: 25px;
  width: 25px;
  height: 25px;
  min-height: 25px;
}
.side .panelhead > .iconbtn svg {
  width: 14px;
  height: 14px;
  stroke-width: 1.9;
}
.watchhead {
  padding: 8px 14px 8px 16px;
  font-size: 11px;
  line-height: 13px;
  letter-spacing: 0;
  text-transform: none;
  font-weight: 500;
  border-bottom: 1px solid #ffffff07;
  color: #a0a5af;
}
#watchRows {
  scrollbar-width: thin;
  scrollbar-color: #44474e transparent;
  overscroll-behavior: contain;
}
.watchgroup {
  background: #22252a;
  color: #acb1bc;
  box-shadow: 0 1px 0 #0002;
  padding: 5px 16px;
  font-size: 10px;
  line-height: 14px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0.015em;
}
.watchrow {
  border-left: 0;
  position: relative;
  min-height: 37px;
  background: transparent;
}
.watchrow + .watchrow::after {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: rgba(217, 222, 234, 0.11);
  pointer-events: none;
}
.watchrow.current {
  background: #2d2c36;
}
.watchrow.current:before {
  content: '';
  position: absolute;
  left: 0;
  top: 5px;
  bottom: 5px;
  width: 2px;
  border-radius: 0 2px 2px 0;
  background: var(--accent);
}
.watchrow > button:first-child {
  padding: 5px 14px 5px 16px;
  min-height: 37px;
}
.watchrow b {
  font-size: 12px;
  font-weight: 610;
  letter-spacing: 0.01em;
}
.watchrow small {
  font-size: 10px;
  line-height: 1.25;
  color: #a0a4ad;
  margin-top: 2px;
}
.watchrow.current small {
  color: #c0bdcd;
}
.watchrow .watchprice {
  font: 11.5px/1.3 var(--mono);
  color: #e0e1e9;
  letter-spacing: 0;
}
.watchrow .watchprice small {
  font: 10px/1.25 var(--mono);
}
.watchrow .remove {
  width: 19px;
  min-width: 19px;
  height: 26px;
  min-height: 26px;
  margin: 0 3px 0 0;
  border-radius: 4px;
}
@media (hover: hover) {
  .watchrow .remove {
    opacity: 0;
  }
  .watchrow:hover .remove,
  .watchrow:focus-within .remove {
    opacity: 1;
  }
  .watchrow:hover:not(.current) {
    background: #ffffff05;
  }
}
.market-detail {
  border-color: var(--line);
  margin: 0;
  padding: 12px 16px;
}
.market-detail dl {
  margin: 8px 0 0;
}
.market-detail dl > div {
  align-items: baseline;
  line-height: 15px;
  padding: 3px 0;
}
.market-detail dt {
  font-size: 11px;
  color: #a9acb5;
}
.market-detail dd {
  font: 11px/1.35 var(--mono);
  color: #e1e2e9;
}
.sidefoot {
  padding: 8px 14px 13px;
  gap: 6px;
  margin-top: 0;
}
.trade-button,
.primary,
.sai button.sai-primary {
  background: #bcb4e5;
  color: #242132;
  border: 1px solid transparent;
}
.trade-button:hover,
.primary:hover {
  background: #cdc6ef;
}
.trade-button {
  height: 33px;
  font-size: 12px;
  padding: 0 10px;
  justify-content: flex-start;
  border-radius: 6px;
  gap: 4px;
}
.trade-button i {
  margin-left: auto;
}
.secondary {
  background: #ffffff03;
  border-color: #3b3e46;
}
.sidefoot .secondary {
  font-size: 11px;
  min-height: 29px;
}
.flow {
  border-top: 1px solid #393b41;
}
.flow .panelhead {
  justify-content: flex-start;
  gap: 24px;
  background: #1d1f23;
}
.tabset {
  gap: 2px;
}
.tabset button {
  min-height: 26px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 5px;
}
.tabset button.selected {
  background: #33353d;
  color: #eeeef5;
  box-shadow: inset 0 1px 0 #ffffff09;
}
#flowBody {
  padding: 7px 14px 10px;
  scrollbar-width: thin;
}
.bookgrid {
  gap: 20px;
}
.levelrow,
.levelhead {
  padding: 2px 6px;
  min-height: 19px;
}
.levelrow .depthbar + span {
  text-align: left;
}
.levelhead,
.flowtable th {
  font-family: inherit;
  font-size: 10px;
  letter-spacing: 0;
  text-transform: none;
  color: #a4a8b2;
}
.depthbar {
  height: 82%;
  background: #57ad9240;
  border-radius: 2px 0 0 2px;
}
.ask .depthbar {
  background: #d1838c36;
}
.panel-note {
  font-size: 10.5px;
  line-height: 1.4;
  color: #a2a6ad;
}
footer {
  height: 25px;
  padding: 0 14px;
  font-size: 10px;
  background: #1b1d21;
  color: #a6aab6;
  border-top: 1px solid #ffffff0b;
}
dialog {
  background: #212328;
  border-color: #494b54;
  border-radius: 14px;
  box-shadow:
    0 18px 68px #0009,
    0 1px 0 #ffffff0f inset;
}
dialog::backdrop {
  background: #07080ac9;
  backdrop-filter: blur(3px);
}
.dialoghead {
  background: #23252aff;
  border-bottom-color: #ffffff0c;
}
.dialoghead h2 {
  font-size: 16px;
  letter-spacing: -0.3px;
}
.dialoghead .iconbtn {
  background: #ffffff07;
  border-radius: 50%;
  width: 28px;
  min-width: 28px;
  height: 28px;
  min-height: 28px;
}
.dialoghead .iconbtn svg {
  width: 14px;
  height: 14px;
}
#dialogBody :is(input, textarea, select) {
  background: #191b20;
  border-color: #444750;
  border-radius: 6px;
}
#toast {
  background: #34343f;
  color: #efedf8;
  border-color: #535462;
}
@media (min-width: 761px) {
  main {
    height: max(630px, calc(100dvh - 79px));
    min-height: 0;
    grid-template-columns: minmax(0, 1fr) clamp(240px, 21vw, 328px);
  }
  .terminal,
  .pane-grid,
  .chart-row,
  .side {
    min-height: 0;
  }
  .chart-row {
    flex: 1 1 0;
  }
  .pane-grid.layout1 .pane {
    min-height: 0;
  }
  .pane-grid:not(.layout1) .pane {
    min-height: 150px;
  }
  .side {
    max-height: 100%;
    overflow: auto;
  }
  .side .panelhead,
  .watchhead,
  .market-detail,
  .sidefoot {
    flex-shrink: 0;
  }
  #watchRows {
    flex: 1 1 auto;
    min-height: 140px;
    max-height: none;
  }
  #flowBody {
    height: clamp(128px, 19vh, 188px);
  }
}
@media (min-width: 761px) and (max-width: 1020px) {
  header {
    gap: 18px;
  }
  main {
    grid-template-columns: minmax(0, 1fr) 230px;
  }
  .controlbar {
    gap: 3px;
    padding-inline: 7px;
  }
  #intervals button {
    padding-inline: 5px;
  }
  .flow .panelhead {
    gap: 8px;
  }
  .tabset button {
    padding-inline: 7px;
  }
}
@media (max-width: 760px) {
  header {
    height: 47px;
    gap: 10px;
    padding: 0 10px;
  }
  .brand {
    gap: 6px;
  }
  .brand b {
    font-size: 16px;
    letter-spacing: -0.55px;
  }
  .brand img {
    width: 24px;
    height: 24px;
  }
  nav {
    height: 29px;
    padding: 2px;
    gap: 0;
    border-radius: 6px;
  }
  nav button {
    min-height: 25px;
    height: 25px;
    padding: 0 7px;
    font-size: 11px;
  }
  nav button:before {
    display: none;
  }
  .header-actions {
    gap: 4px;
  }
  .header-actions .ai-button {
    min-height: 28px;
    padding: 2px 7px;
    gap: 4px;
    font-size: 11px;
  }
  .header-actions > .iconbtn {
    min-width: 25px;
    width: 25px;
  }
  .controlbar {
    height: 39px;
    min-height: 39px;
    padding: 3px 7px;
    gap: 3px;
  }
  .controlbar .symbolbutton {
    padding-right: 8px;
  }
  #intervals button {
    padding-inline: 6px;
  }
  .tools {
    width: 100%;
    padding: 2px 7px;
    gap: 2px;
    height: 35px;
    border-right: 0;
    flex-wrap: nowrap;
  }
  .tools button {
    flex: none;
    width: 31px;
    min-width: 31px;
    height: 29px;
    min-height: 29px;
  }
  .tools .icon svg {
    width: 17px;
    height: 17px;
  }
  .toolsep {
    width: 1px;
    height: 16px;
    margin: 0 3px;
    flex: none;
  }
  .pane-grid.layout1 .pane {
    min-height: clamp(325px, 54dvh, 590px);
  }
  .panehead {
    min-height: 46px;
    padding: 5px 9px;
  }
  .instrument b {
    font-size: 13px;
  }
  .instrument {
    gap: 7px;
  }
  .ticker-icon {
    width: 25px;
    height: 25px;
    font-size: 15px;
  }
  .quote {
    font-size: 17px;
  }
  .flow .panelhead {
    gap: 8px;
    padding: 4px 8px;
    height: 38px;
    min-height: 38px;
  }
  .flow .paneltitle {
    flex: none;
  }
  .tabset {
    min-width: 0;
  }
  .tabset button {
    padding: 3px 6px;
    font-size: 10.5px;
    min-height: 26px;
  }
  #flowBody {
    height: 155px;
    padding: 6px 8px;
  }
  .bookgrid {
    gap: 8px;
  }
  .levelrow,
  .levelhead {
    padding: 2px 3px;
  }
  .side {
    box-shadow: none;
  }
  .side .panelhead {
    padding-inline: 12px;
  }
  .watchrow > button:first-child {
    padding-block: 5px;
  }
  .sidefoot {
    margin: 0;
    padding: 8px 12px 12px;
  }
  .trade-button {
    height: 35px;
  }
  footer {
    min-height: 25px;
    height: auto;
    padding: 4px 10px;
  }
}
@media (max-width: 455px) {
  header {
    gap: 6px;
  }
  .header-actions .ai-button span {
    display: block;
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  nav button {
    padding-inline: 6px;
  }
}

.watchrow:has(> .remove) > button:first-child {
  padding-right: 3px;
}
@media (max-width: 420px) {
  header {
    gap: 6px;
    padding-inline: 8px;
  }
  nav button {
    padding-inline: 6px;
  }
  .header-actions .ai-button {
    padding-inline: 6px;
  }
}
@media (max-width: 355px) {
  .brand {
    gap: 4px;
  }
  .brand b {
    font-size: 14px;
  }
  nav button {
    font-size: 10.5px;
    padding-inline: 5px;
  }
  .header-actions {
    gap: 2px;
  }
}

/* Drawing instruments use anchor-point symbols and a shared 24-unit grid. */
#tools [aria-label='Crosshair'] {
  --drawing-symbol: url('data:image/svg+xml,%3Csvg%20xmlns=%22http://www.w3.org/2000/svg%22%20viewBox=%220%200%2024%2024%22%20fill=%22none%22%20stroke=%22black%22%20stroke-width=%221.65%22%20stroke-linecap=%22round%22%20stroke-linejoin=%22round%22%3E%3Ccircle%20cx=%2212%22%20cy=%2212%22%20r=%223%22/%3E%3Cpath%20d=%22M12%202.5v5m0%209v5m-9.5-9.5h5m9%200h5%22/%3E%3C/svg%3E');
}
#tools [aria-label='Trendline'] {
  --drawing-symbol: url('data:image/svg+xml,%3Csvg%20xmlns=%22http://www.w3.org/2000/svg%22%20viewBox=%220%200%2024%2024%22%20fill=%22none%22%20stroke=%22black%22%20stroke-width=%221.65%22%20stroke-linecap=%22round%22%20stroke-linejoin=%22round%22%3E%3Cpath%20d=%22m6.8%2017.2%2010.4-10.4%22/%3E%3Ccircle%20cx=%225.5%22%20cy=%2218.5%22%20r=%221.8%22/%3E%3Ccircle%20cx=%2218.5%22%20cy=%225.5%22%20r=%221.8%22/%3E%3C/svg%3E');
}
#tools [aria-label='Horizontal line'] {
  --drawing-symbol: url('data:image/svg+xml,%3Csvg%20xmlns=%22http://www.w3.org/2000/svg%22%20viewBox=%220%200%2024%2024%22%20fill=%22none%22%20stroke=%22black%22%20stroke-width=%221.65%22%20stroke-linecap=%22round%22%20stroke-linejoin=%22round%22%3E%3Cpath%20d=%22M2.5%2012h7.4m4.2%200h7.4%22/%3E%3Crect%20x=%229.9%22%20y=%229.9%22%20width=%224.2%22%20height=%224.2%22%20rx=%22.7%22/%3E%3C/svg%3E');
}
#tools [aria-label='Fib retracement'] {
  --drawing-symbol: url('data:image/svg+xml,%3Csvg%20xmlns=%22http://www.w3.org/2000/svg%22%20viewBox=%220%200%2024%2024%22%20fill=%22none%22%20stroke=%22black%22%20stroke-width=%221.65%22%20stroke-linecap=%22round%22%20stroke-linejoin=%22round%22%3E%3Cpath%20d=%22M3%204.5h18M6%209.5h15M9%2014.5h12M12%2019.5h9%22/%3E%3Cpath%20d=%22m3%204.5%209%2015%22%20stroke-dasharray=%221.6%202.5%22%20stroke-opacity=%22.9%22/%3E%3C/svg%3E');
}
#tools [aria-label='Rectangle'] {
  --drawing-symbol: url('data:image/svg+xml,%3Csvg%20xmlns=%22http://www.w3.org/2000/svg%22%20viewBox=%220%200%2024%2024%22%20fill=%22none%22%20stroke=%22black%22%20stroke-width=%221.65%22%20stroke-linecap=%22round%22%20stroke-linejoin=%22round%22%3E%3Cpath%20d=%22M6.9%205.5h12.9v10.8M17.1%2018.5H4.3V7.7%22/%3E%3Crect%20x=%222.7%22%20y=%223.7%22%20width=%223.7%22%20height=%223.7%22%20rx=%22.5%22/%3E%3Crect%20x=%2217.7%22%20y=%2216.7%22%20width=%223.6%22%20height=%223.6%22%20rx=%22.5%22/%3E%3C/svg%3E');
}
[data-action='colors'] {
  --drawing-symbol: url('data:image/svg+xml,%3Csvg%20xmlns=%22http://www.w3.org/2000/svg%22%20viewBox=%220%200%2024%2024%22%20fill=%22none%22%20stroke=%22black%22%20stroke-width=%221.65%22%20stroke-linecap=%22round%22%20stroke-linejoin=%22round%22%3E%3Cpath%20d=%22M5%203v3m0%207v6M12%202v8m0%206v6M19%204v2m0%206v7%22/%3E%3Crect%20x=%223.2%22%20y=%226%22%20width=%223.6%22%20height=%227%22%20rx=%22.7%22/%3E%3Crect%20x=%2210.2%22%20y=%2210%22%20width=%223.6%22%20height=%226%22%20rx=%22.7%22/%3E%3Crect%20x=%2217.2%22%20y=%226%22%20width=%223.6%22%20height=%226%22%20rx=%22.7%22/%3E%3C/svg%3E');
}
:is(
    #tools [aria-label='Crosshair'],
    #tools [aria-label='Trendline'],
    #tools [aria-label='Horizontal line'],
    #tools [aria-label='Fib retracement'],
    #tools [aria-label='Rectangle'],
    [data-action='colors']
  )
  i
  svg {
  display: none;
}
:is(
    #tools [aria-label='Crosshair'],
    #tools [aria-label='Trendline'],
    #tools [aria-label='Horizontal line'],
    #tools [aria-label='Fib retracement'],
    #tools [aria-label='Rectangle'],
    [data-action='colors']
  )
  i:before {
  content: '';
  display: block;
  width: 19px;
  height: 19px;
  background: currentColor;
  -webkit-mask: var(--drawing-symbol) center / contain no-repeat;
  mask: var(--drawing-symbol) center / contain no-repeat;
}
/* Position tools share the same symbol in the rail, shortcuts and the library rows. */
:is(#tools button, .drawing-library .chart-menu-item) .position-tool-icon {
  width: 19px;
  height: 19px;
  flex: none;
}
:is(#tools button, .drawing-library .chart-menu-item) .position-tool-icon svg {
  width: 100%;
  height: 100%;
  stroke-width: 1.65;
}
@media (max-width: 760px) {
  :is(#tools button, .drawing-library .chart-menu-item) .position-tool-icon {
    width: 22px;
    height: 22px;
  }
}
.study-fields {
  display: grid;
}
.study-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 48%);
  align-items: center;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.study-row:first-child {
  padding-top: 0;
}
.study-field-label {
  display: grid;
  gap: 3px;
  font-size: 12px;
  color: var(--ink);
}
.study-field-label small,
.study-unit,
.study-status {
  font-size: 11px;
  line-height: 1.45;
  color: var(--muted);
}
.study-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  min-width: 0;
}
.study-controls :is(input[type='number'], select, input[type='text']) {
  width: 100%;
  min-width: 0;
}
.study-controls input[type='color'] {
  flex: none;
  width: 34px;
  height: 31px;
  padding: 2px;
  cursor: pointer;
}
.study-controls input[type='range'] {
  width: 100%;
  min-width: 40px;
  height: 22px;
  padding: 0 !important;
  accent-color: var(--accent);
}
.study-controls output {
  min-width: 35px;
  text-align: right;
  color: var(--ink);
  font: 11px var(--mono);
}
.study-controls .study-hex {
  max-width: 99px;
  font: 12px var(--mono);
}
.study-actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 16px;
}
.study-exchanges {min-inline-size:0;margin:0;padding:4px 0;border:0}
.study-exchanges legend {padding:0 0 5px;font-size:12px;color:var(--muted)}
.study-exchange {display:grid;grid-template-columns:16px 1fr auto;align-items:center;gap:8px;min-height:30px;padding:2px 8px;
  border-bottom:1px solid var(--hairline);cursor:pointer;font-size:12px}
.study-exchange:hover {background:var(--hover)}
.study-exchange input {width:15px;height:15px;margin:0;accent-color:var(--accent)}
.study-exchange .icon svg {width:14px;height:14px}
.study-exchange[data-exchange=binance] .icon {color:#f3ba2f}
.study-exchange[data-exchange=bybit] .icon {color:#e8a447}
.study-exchange[data-exchange=hyperliquid] .icon {color:#a2eee1}
.study-exchange-actions {display:flex;flex-wrap:wrap;gap:6px;margin-top:7px}
.study-exchange-actions button {min-height:25px;font-size:11px;padding:3px 7px;color:var(--muted)}
.study-exchange-actions button[aria-pressed=true] {background:var(--surface-raised);color:var(--ink)}
.study-status {
  color: var(--down);
  margin: 9px 0 0;
}
@media (max-width: 480px) {
  .study-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 48%);
    gap: 8px;
  }
  .study-controls select,
  .study-controls input[type='number'] {
    font-size: 16px;
  }
  .study-actions button {
    min-height: 36px;
  }
}

/* Drawing tools scroll independently of the three chart actions. */
#tools {
  overflow: hidden;
  min-height: 0;
}
.rail-favorites,
.rail-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: 100%;
  scrollbar-width: none;
}
.rail-favorites {
  flex: 1 1 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}
.rail-actions {
  flex: none;
  border-top: 1px solid #ffffff18;
  padding-top: 5px;
}
.rail-favorites > button,
.rail-actions > button {
  flex: none;
}
#tools .rail-more {flex:none}
#tools .rail-more[aria-expanded=true] {color:var(--accent);background:var(--hover)}
#tools.rail-editing .rail-more { outline: 1px dashed #929ba885; outline-offset: -2px; }
#tools .rail-more.rail-remove-target { color: var(--accent); background: var(--hover); outline-color: var(--accent); }
@media (max-width: 760px) {
  #tools {
    min-width: 0;
  }
  .rail-favorites,
  .rail-actions {
    flex-direction: row;
    width: auto;
    height: 100%;
    gap: 2px;
  }
  .rail-favorites {
    min-width: 0;
    overflow-y: hidden;
  }
  .rail-actions {
    border-top: 0;
    border-left: 1px solid #ffffff18;
    padding: 0 0 0 4px;
  }
}

.membership-pending { width: min(400px, calc(100vw - 32px)); padding: 18px; }
.membership-pending h2 { margin: 0 0 8px; }
.membership-pending p { margin: 0 0 14px; line-height: 1.5; }
.membership-pending::backdrop { background: #101114; }

.chart-area { isolation: isolate; }
.chart-area > .canvasChart { z-index: 0; }
.candle-countdown {
  position: absolute; z-index: 1; right: 0; min-width: 37px; height: 14px; padding: 0 3px;
  text-align: center; font: 10px/14px var(--mono); font-variant-numeric: tabular-nums;
  white-space: nowrap; pointer-events: none;
}
.candle-countdown[hidden] { display: none; }
@media (min-width: 761px) {
  #paneGrid > .pane > .panehead {
    position: absolute;
    inset: 0 0 auto;
    z-index: 1;
    min-height: 46px;
    padding: 5px 71px 5px 12px;
    border: 0;
    background: transparent;
    pointer-events: none;
    box-sizing: border-box;
    text-shadow: 0 1px 2px var(--chart-bg), 0 0 4px var(--chart-bg);
  }
  #paneGrid > .pane > .panehead .instrument { pointer-events: auto; }
  #paneGrid > .pane > .chart-area > :is(.study-legend, .chartnote.error) {
    top: calc(var(--chart-header-height, 46px) + 6px);
  }
}
.chart-navigation { display: none; }
@media (min-width: 601px) and (any-hover: hover) and (any-pointer: fine) {
  .chart-navigation {
    position: absolute;
    z-index: 3;
    transform: translate(-50%, calc(-100% - 8px));
    display: flex;
    gap: 4px;
    opacity: 0;
    pointer-events: none;
  }
  .chart-area:hover .chart-navigation,
  .chart-navigation:focus-within { opacity: 1; }
  .chart-area:hover .chart-navigation > button,
  .chart-navigation:focus-within > button { pointer-events: auto; }
  .chart-navigation > button {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    padding: 0;
    color: var(--muted);
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 5px;
    box-shadow: 0 1px 3px #0005;
  }
  .chart-navigation > button:nth-child(3),
  .chart-navigation > button:last-child { margin-inline-start: 3px; }
  .chart-navigation > button:is(:hover, :focus-visible) {
    color: var(--ink);
    background: var(--surface-raised);
  }
  .chart-navigation > button:active { background: #373a44; }
  .chart-navigation .icon svg { width: 15px; height: 15px; }
}
.liquidation-zone-band,
.liquidation-zone-tooltip {
  position: absolute;
  pointer-events: none;
}
.liquidation-zone-band {
  z-index: 1;
  border: 1px solid #a4def48c;
  background: #83cbed12;
}
.liquidation-zone-tooltip {
  z-index: 4;
  display: grid;
  gap: 4px;
  max-width: 100%;
  padding: 8px 12px;
  border: 1px solid #76b6dc55;
  border-radius: 6px;
  background: #111923;
  color: #c6dfef;
  box-shadow: 0 3px 12px #0005;
  font: 11px/1.25 var(--mono);
  font-variant-numeric: tabular-nums;
}
.liquidation-zone-tooltip[hidden] { display: none; }
.liquidation-zone-tooltip strong { color: #f1fbff; font-size: 14px; font-weight: 650; }
.liquidation-zone-tooltip small { color: #a1b7c8; font-size: 10px; }
.chart-heat-status {
  position: absolute;
  z-index: 2;
  inset: auto auto 26px 10px;
  max-width: calc(100% - 70px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 4px 7px;
  border: 1px solid var(--chart-edge);
  border-radius: 5px;
  background: var(--chart-surface);
  color: var(--chart-muted);
  font: 11px/1.25 system-ui, sans-serif;
  pointer-events: none;
}
.chart-heat-credits {
  position: absolute;
  z-index: 2;
  inset: auto auto 26px 10px;
  display: flex;
  gap: 8px;
  padding: 3px 6px;
  border-radius: 4px;
  background: var(--chart-surface);
  font: 10px/1.2 system-ui, sans-serif;
}
.chart-heat-credits[hidden], .chart-heat-credits a[hidden] { display: none; }
.chart-heat-status:not([hidden]) + .chart-heat-credits { bottom: 50px; }
.chart-heat-credits a { color: var(--chart-muted); text-underline-offset: 2px; }
.chart-heat-credits a:hover, .chart-heat-credits a:focus-visible { color: var(--chart-text); }
.liquidation-zone-tooltip small[hidden] { display: none; }
.liquidation-zone-tooltip[data-side="bids"], .liquidation-zone-band[data-side="bids"] { border-color: #22d3ee85; }
.liquidation-zone-tooltip[data-side="asks"], .liquidation-zone-band[data-side="asks"] { border-color: #fbbf2485; }
.book-levels {
  position: absolute;
  z-index: 5;
  bottom: 47px;
  left: 10px;
  width: min(328px, calc(100% - 27px));
  display: grid;
  justify-items: start;
  gap: 4px;
  color: var(--chart-text);
  pointer-events: none;
}
.book-levels[hidden], .book-levels-panel[hidden] { display: none; }
.book-levels-toggle, .book-levels-panel {
  pointer-events: auto;
  background: var(--chart-surface);
  color: var(--chart-text);
  border: 1px solid var(--chart-edge);
  border-radius: 6px;
  box-shadow: 0 3px 12px #0004;
}
.book-levels-toggle {
  grid-row: 2;
  min-height: 26px;
  padding: 3px 8px;
  font: 600 11px/1.3 system-ui, sans-serif;
}
.book-levels-toggle:is(:hover, :focus-visible), .book-levels-toggle[aria-expanded="true"] { border-color: var(--chart-muted); }
.book-levels-panel {
  grid-row: 1;
  width: 100%;
  max-height: min(300px, 45vh);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 10px;
  font: 12px/1.35 system-ui, sans-serif;
}
.book-levels-panel > strong { font-weight: 650; }
.book-levels-summary { color: var(--chart-muted); font-size: 11px; margin-top: 3px; }
.book-levels-table { display: grid; gap: 9px; margin-top: 8px; }
.book-levels-table:empty { display: none; }
.book-levels-table table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.book-levels-table caption { text-align: left; font-weight: 650; margin-bottom: 2px; }
.book-levels-table caption[data-side="asks"] { color: #fbbf24; }
.book-levels-table caption[data-side="bids"] { color: #22d3ee; }
.book-levels-table :is(th, td) { padding: 3px 0 3px 5px; text-align: right; white-space: nowrap; }
.book-levels-table :is(th, td):first-child { padding-left: 0; text-align: left; }
.book-levels-table th { font-size: 10px; color: var(--chart-muted); font-weight: 500; border-bottom: 1px solid var(--chart-edge); }
.book-levels-table td { font: 11px/1.3 var(--mono); }
@media (max-width: 760px), (hover: none) and (pointer: coarse) {
  .book-levels { display: none; }
}
.study-controls .study-unit { white-space: nowrap; }
.profile-row-tooltip {
  position: absolute; z-index: 5; pointer-events: none;
  display: grid; gap: 4px; padding: 8px 10px;
  background: var(--popup-surface); border: 1px solid var(--popup-edge); border-radius: 6px;
  box-shadow: var(--popup-shadow); color: var(--muted); font: 11px/1.3 var(--mono);
}
.profile-row-tooltip strong { color: var(--ink); }
.profile-row-tooltip[hidden], .profile-row-tooltip [hidden] { display: none; }
.study-legend {
  z-index: 2;
  position: absolute;
  inset: 7px auto auto 12px;
  max-width: calc(100% - 64px);
  max-height: calc(100% - 28px);
  color: var(--chart-text);
  font: 11px/1.5 -apple-system, BlinkMacSystemFont, sans-serif;
  pointer-events: none;
  text-shadow: 0 1px 2px var(--chart-bg), 0 0 3px var(--chart-bg);
}
.study-legend [hidden] { display: none; }
.chart-identity { display: flex; flex: 1; flex-wrap: wrap; align-items: flex-start; gap: 2px 10px; min-width: 0; }
.chart-identity .instrument { flex: none; }
.panehead .quote { flex: none; }
.legend-ohlc { display: inline-flex; flex-wrap: wrap; gap: 1px 8px; margin-top: 4px; font: 11px/1.4 var(--mono); }
.legend-ohlc[hidden] { display: none; }
.candle-stat { display: inline-flex; gap: 3px; white-space: nowrap; color: var(--chart-muted, var(--chart-text)); }
.candle-stat strong { color: var(--chart-text); font-weight: 500; }
.legend-ohlc[data-direction="up"] strong { color: var(--chart-up-text); }
.legend-ohlc[data-direction="down"] strong { color: var(--chart-down-text); }
@media (max-width: 760px) {
  .legend-ohlc { font-size: 10px; margin-top: 0; }
}
.legend-volume { margin: 2px 0; }
.legend-volume b { font-weight: 550; font-variant-numeric: tabular-nums; }
.legend-disclosure, .legend-eye { pointer-events: auto; color: inherit; padding: 0; border: 0; background: transparent; }
.legend-disclosure { font: inherit; font-size: 10px; padding: 0 4px; margin: 2px 0 1px -4px; border-radius: 3px; background: color-mix(in srgb, var(--chart-bg) 82%, transparent); }
.legend-row { width: fit-content; display: flex; gap: 5px; align-items: center; min-height: 18px; }
.legend-row.is-hidden { opacity: .62; }
.legend-eye { width: 20px; height: 18px; display: grid; place-items: center; opacity: 0; }
.legend-eye .icon { width: 13px; height: 13px; }
.study-legend:has(.legend-eye:hover) .legend-eye, .study-legend:focus-within .legend-eye,
.legend-row.is-hidden .legend-eye, .legend-eye:focus-visible, .pane:hover .legend-eye { opacity: .75; }
@media (hover: none) { .legend-eye { opacity: .8; width: 26px; min-height: 24px; } }
.chart-area > .chartnote:not(.error):not(:empty) { inset: auto 64px 24px auto; }

/* Keep search and market categories in reach while browsing long watchlists. */
dialog:has(.market-picker) {
  width: min(560px, 95vw);
}
dialog:has(.market-picker) #dialogBody {
  padding: 0;
}
.market-picker {
  display: flex;
  flex-direction: column;
  max-height: min(640px, calc(86dvh - 54px));
}
.market-search {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 14px 16px 9px;
  padding: 0 10px;
  color: var(--muted);
  background: #191b20;
  border: 1px solid #444750;
  border-radius: 6px;
}
.market-search:focus-within {
  border-color: var(--accent);
}
#dialogBody .market-search input {
  width: 100%;
  min-height: 40px;
  padding-left: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
}
.market-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  padding: 0 14px 10px;
  border-bottom: 1px solid var(--line);
}
.market-filters button {
  min-height: 30px;
  padding: 4px 8px;
  font-size: 12px;
  color: var(--muted);
}
.market-filters button[aria-pressed=true] {
  color: var(--accent);
  background: #bcb4ef19;
}
.market-results {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 14px 12px;
}
.market-group h3 {
  margin: 16px 4px 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.market-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 7px 5px;
  text-align: left;
  border-bottom: 1px solid var(--hairline);
}
.market-identity {
  display: grid;
  min-width: 0;
}
.market-identity b {
  font: 600 13px var(--mono);
}
.market-identity small, .market-source {
  color: var(--muted);
  font-size: 12px;
}
.market-source {
  text-align: right;
}
.market-source small {
  display: block;
}
.market-manual {
  margin: 12px 4px 0;
}
.market-manual summary {
  cursor: pointer;
  color: var(--accent);
  font-size: 13px;
}
.market-manual form {
  display: flex;
  gap: 10px;
  align-items: end;
  margin-top: 8px;
}
.market-manual label.field {
  margin: 0;
  flex: 1;
}
.market-message {
  color: var(--ink);
  font-size: 12px;
}
.market-message:empty {
  display: none;
}
@media (max-width: 550px) {
  .market-search { margin: 10px 10px 6px; }
  .market-filters { padding: 0 8px 6px; }
  .market-results { padding-inline: 8px; }
  .market-row { min-height: 44px; }
  .market-search input { font-size: 16px; }
}

.study-legend button { min-height: 18px; line-height: 1.4; }
.legend-settings { pointer-events: auto; font: inherit; color: inherit; padding: 0 3px; margin-left: -3px; text-shadow: inherit; gap: 3px; }
.legend-settings:hover, .legend-settings:focus-visible { color: var(--chart-text); background: color-mix(in srgb, var(--chart-bg) 74%, var(--chart-text)); }
.legend-volume { display: flex; }
@media (hover: none) { .study-legend button { min-height: 24px; } }

#modal[open] {
  position: fixed;
  inset: auto;
  margin: 0;
  max-width: var(--dialog-visible-width, 96vw);
  max-height: min(88dvh, var(--dialog-visible-height, 88dvh));
}
#modal .dialoghead {
  gap: 6px;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
#modal .dialoghead h2 { margin-right: auto; }
#modal .dialog-move { cursor: grab; }
#modal .dialoghead.moving, #modal .dialoghead.moving .dialog-move { cursor: grabbing; }

.lower-study-header {
  position:absolute; z-index:3; inset:0 3px auto 5px; min-width:0;
  display:flex; align-items:center; gap:5px; min-height:20px;
  font-size:10px; color:var(--chart-text); pointer-events:none;
}
.lower-study-name {overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
.lower-study-values,.lower-study-actions {display:flex;align-items:center;gap:6px;flex:none;white-space:nowrap}
.lower-study-values {font-variant-numeric:tabular-nums}
.lower-study-missing {color:var(--muted)}
.lower-study-header button {
  pointer-events:auto; min-height:0; height:18px; padding:0 2px; border:0;
  background:transparent; color:var(--muted); border-radius:4px;
}
.lower-study-header button:hover,.lower-study-header button:focus-visible {background:var(--surface-raised);color:var(--ink)}
.lower-study-header button svg {width:12px;height:12px}
.lower-study-header .lower-study-toggle, .chart-coverage-toggle {display:none}
.lower-study-sources {display:inline-flex;align-items:center;gap:2px;flex:none}
.lower-study-sources svg {flex:none}
.lower-study-sources[hidden] {display:none}
.lower-study-actions {gap:2px}
.lower-study-remove {opacity:.72}
.lower-study-remove:hover,.lower-study-remove:focus-visible {opacity:1}
.legend-volume-row:not([hidden]) {display:flex;align-items:center;gap:2px}
.legend-volume-row .legend-volume .icon {margin-inline-start:4px}
.controlbar .chart-capture {margin-inline-start:auto;flex:none;color:var(--muted)}
.controlbar .chart-capture:hover {color:var(--ink)}
.chart-capture .icon svg {width:15px;height:15px}
.brush-surface {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 5;
  cursor: crosshair;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.brush-color-control {
  position: absolute; z-index: 6; top: 7px; right: 56px;
  background: var(--chart-surface); color: var(--chart-text);
}
@media (min-width: 761px) {
  .brush-color-control { top: calc(var(--chart-header-height, 46px) + 8px); right: 70px; }
}
@media (pointer: coarse) {
  .brush-color-control.terminal-color-control { min-height: 44px; }
}

.study-appearance > summary {
  padding: 12px 0;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
}
.study-appearance > summary:hover,
.study-appearance > summary:focus-visible {
  color: var(--ink);
}

#tools .rail-grip {
  flex: none;
  height: 21px;
  min-height: 21px;
  cursor: grab;
  touch-action: none;
  color: var(--muted);
}
#tools .rail-grip svg { stroke-width: 3; stroke-linecap: round; }
#tools .rail-grip[aria-pressed='true'] { color: var(--accent); background: #373441; }
#tools.rail-editing [data-favorite] {
  outline: 1px dashed #929ba885;
  outline-offset: -2px;
  cursor: grab;
  touch-action: none;
}
#tools button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
#tools .rail-picked { cursor: grabbing; opacity: .65; }
#tools.rail-dragging, #tools [data-favorite], #tools .rail-grip { user-select: none; -webkit-user-select: none; }
@media (min-width: 761px) {
  #tools .rail-favorites { flex: 0 1 auto; }
  #tools .rail-grip { margin-top: var(--rail-offset, 0px); }
  #tools[data-side='right'] { order: 1; border-right: 0; border-left: 1px solid var(--line); }
}
@media (max-width: 760px) {
  #tools .rail-grip { width: 25px; min-width: 25px; height: 100%; }
  #tools[data-mobile-edge='bottom'] { order: 1; border-bottom: 0; border-top: 1px solid var(--line); }
}

.drawing-quickbar {
  position: absolute; z-index: 8; display: flex; flex-wrap: wrap; align-items: center; gap: 2px;
  max-width: calc(100% - 8px); padding: 3px; border: 1px solid #40424b;
  border-radius: 9px; background: #1b1d22; color: #d4d5dc;
  box-shadow: 0 3px 14px #0007; user-select: none; box-sizing: border-box;
}
.drawing-quickbar :is(button, label, select) {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  height: 29px; min-width: 0; margin: 0; border: 0; border-radius: 5px;
  background: transparent; color: inherit; font: inherit; cursor: pointer;
}
.drawing-quickbar :is(label,button) { width: 30px; padding: 0; }
.drawing-quickbar .drawing-grip { width: 19px; color: #828590; cursor: grab; touch-action:none; }
.drawing-quickbar :is(label,button,select):hover { background-color:#34363e; }
.drawing-quickbar :is(label,button,select):focus-within { outline: 1px solid #b9afe4; }
.drawing-quickbar .drawing-trash { color: var(--negative, #ed8793); flex: none; }
.drawing-quickbar > [hidden] { display: none; }
.drawing-quickbar button[aria-pressed='true'] { color: var(--accent); background: var(--hover); }
.drawing-selection-surface { position: absolute; inset: 0; z-index: 8; cursor: crosshair; touch-action: none; }
.drawing-selection-box { position: absolute; pointer-events: none; background: #a99ae92a; border: 1px dashed #c4b8f2; }
.drawing-area-controls {
  position: absolute;
  z-index: 8;
  inset: auto 8px 8px auto;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--chart-edge, var(--line));
  border-radius: 8px;
  background: var(--chart-surface, #242630);
  color: var(--chart-text, #dedfe7);
  box-shadow: 0 2px 8px #0003;
  user-select: none;
}
.drawing-area-count { padding-inline: 7px 4px; font-size: 11px; white-space: nowrap; }
.drawing-area-controls > button {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: inherit;
}
.drawing-area-controls > button:is(:hover, :active, :focus-visible) { background: var(--chart-hover, var(--hover)); }
.drawing-area-controls > button:focus-visible { outline: 1px solid currentColor; outline-offset: -1px; }
.drawing-area-controls > .drawing-area-trash { color: var(--chart-down-text, var(--negative)); }
.drawing-area-controls .icon svg { width: 15px; height: 15px; }
@media (max-width: 760px) { .drawing-area-controls { inset-inline-end: 52px; } }
@media (pointer: coarse) {
  .drawing-area-controls > button { width: 44px; height: 44px; }
}
.drawing-quickbar select { appearance: auto; font-size: 11px; padding: 0 2px; }
.drawing-quickbar option { background: #24262c; color: #ddd; }
.drawing-quickbar label :is(input,select) { position:absolute; inset:0; width:100%; height:100%; opacity:0; cursor:pointer; }
.drawing-quickbar .quick-color::after { content:''; position:absolute; pointer-events:none; bottom:2px; width:16px; height:2px; background:var(--drawing-ink); border-radius:2px; }
.drawing-quickbar .fixed-profile-placement[data-side='right'] svg,
.drawing-quickbar .fixed-profile-direction[data-facing='left'] svg { transform: scaleX(-1); }
@media (pointer:coarse) { .drawing-quickbar :is(button,label,select) { min-height:36px; } }
@media (max-width: 760px) {
  .drawing-quickbar { flex-wrap: nowrap; gap: 1px; overflow-x: auto; overscroll-behavior: contain; scrollbar-width: none; }
  .drawing-quickbar::-webkit-scrollbar { display: none; }
  .drawing-quickbar > .quick-extra { display: none; }
  .drawing-quickbar > :is(button, label, select) { flex: none; }
  .drawing-quickbar > :is(button, label):not(.drawing-grip) { width: 34px; }
  .drawing-quickbar > label.fixed-profile-picker { width: 44px; height: 44px; }
  .drawing-quickbar .drawing-trash { margin-left: 3px; box-shadow: -4px 0 0 -3px #40424b; }
}
.drawing-color-popover {
  position: fixed; inset: auto; margin: 0; box-sizing: border-box;
  width: 230px; max-width: calc(100vw - 16px); max-height: calc(100dvh - 16px); overflow: auto;
  padding: 10px; background: var(--chart-surface, #1b1d22); color: var(--chart-text, #d4d5dc);
  border: 1px solid var(--chart-edge, #40424b); border-radius: 9px; box-shadow: 0 6px 24px #0006;
}
.terminal-color-control:not(.quick-color) {
  display: inline-grid; grid-template-columns: minmax(0, 1fr); place-items: center; width: 48px; min-width: 48px; height: 28px; padding: 3px;
  border: 1px solid var(--line, #40424b); border-radius: 5px; cursor: pointer;
}
.terminal-color-chip { display: block; width: 100%; height: 17px; background: var(--drawing-ink); border-radius: 3px; }
.drawing-recent-colors { margin-bottom: 8px; font-size: 11px; }
.drawing-recent-colors > span { display: block; margin-bottom: 4px; }
.drawing-color-popover [hidden] { display: none !important; }
.drawing-color-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 4px; }
.drawing-color-popover .drawing-color-grid .drawing-color-swatch {
  display: block; min-width: 0; margin: 0; padding: 0; border: 0; cursor: pointer; font-size: 0;
  width: 100%; height: auto; min-height: 0; aspect-ratio: 1; background: var(--swatch);
  border-radius: 4px; box-shadow: inset 0 0 0 1px #8080804d;
}
.drawing-color-popover .drawing-color-swatch[aria-pressed='true'] {
  outline: 1px solid currentColor; outline-offset: 1px;
  box-shadow: inset 0 0 0 1px #ffffffd9, inset 0 0 0 3px #0008;
}
.drawing-color-popover .drawing-color-swatch:focus-visible { outline: 2px solid currentColor; outline-offset: 1px; }
.drawing-custom-color {
  display: grid; grid-template-columns: 1fr 26px 78px; gap: 7px; align-items: center;
  margin: 9px 0 0; padding-top: 8px; border-top: 1px solid var(--chart-edge, #40424b);
  font-size: 11px;
}
.drawing-custom-color input {
  min-width: 0; width: 100%; height: 25px; padding: 3px; box-sizing: border-box;
  border: 1px solid var(--chart-edge, #40424b); border-radius: 4px;
  background: var(--chart-bg, #171a23); color: inherit;
}
.drawing-custom-color input[type='color'] { cursor: pointer; }
.drawing-custom-color input[type='text'] { padding-inline: 5px; font: 11px ui-monospace, monospace; }
.drawing-color-popover .drawing-color-opacity:not([hidden]) {
  display: grid; grid-template-columns: 1fr auto; gap: 4px; width: auto; height: auto;
  margin-top: 8px; font-size: 11px; cursor: default; background: transparent;
}
.drawing-color-opacity output { font-variant-numeric: tabular-nums; }
.drawing-color-popover .drawing-color-opacity input[type='range'] {
  position: static; grid-column: 1 / -1; margin: 0; width: 100%; height: 18px; opacity: 1;
  accent-color: var(--accent, #a99ae9); cursor: ew-resize;
}

.price-alert-bell {
  position: absolute; z-index: 3; transform: translate(-100%, -50%);
  display: flex; align-items: center; gap: 3px; min-height: 22px;
  padding: 0 5px 0 3px; border: 1px solid #454851; border-radius: 4px;
  background: #303139; color: #e8e8ec; cursor: pointer;
  font: 11px/1.1 ui-monospace, monospace; font-variant-numeric: tabular-nums;
}
.price-alert-bell[hidden] { display: none; }
.price-alert-bell .icon { width: 14px; height: 14px; }
.price-alert-bell:hover, .price-alert-bell:focus-visible { background: #444651; color: white; }

/* Stack controls below OHLC and volume at the left edge of each chart. */
.study-legend { display: flex; flex-direction: column; align-items: flex-start; }
.legend-rows { max-width: 100%; }
.legend-rows { min-height: 0; max-height: 34vh; overflow-y: auto; scrollbar-width: thin; }
.legend-row { gap: 2px; }
.legend-row .legend-eye { opacity: .78; }
.legend-row .legend-eye:hover { opacity: 1; color: var(--accent); }
.legend-row button:focus-visible { outline: 1px solid var(--accent); }
main { position: relative; }
.workspace-splitter { display: none; min-height: 0; padding: 0; border-radius: 0; touch-action: none; }
main .flow { position: relative; }
main .height-splitter { position: absolute; display: block; inset: -3px 0 auto; height: 7px; z-index: 3; width: 100%; cursor: row-resize; background: transparent; }
main #flowBody { height: clamp(52px, var(--flowHeight, 19vh), 64vh); }
.workspace-splitter:hover, .workspace-splitter:focus-visible { background: color-mix(in srgb, var(--accent) 40%, transparent); }
@media (min-width: 761px) {
  main { --side-col:clamp(160px,var(--sidebarWidth,clamp(240px,21vw,328px)),65vw); grid-template-columns: minmax(0,1fr) var(--side-col); }
}
#flowOptions { margin-left:auto; flex:none; }
#watchWidget .paneltitle button { color:var(--muted); background:transparent; padding:3px 5px; font-size:12px; }
#watchWidget .paneltitle button[aria-pressed=true] { color:var(--ink); box-shadow:inset 0 -1px var(--accent); }
#watchWidget.shows-news :is(.watchhead,#watchRows,#addWatch) { display:none; }
#watchNews[hidden] { display:none !important; }
#watchNews { min-height:0; flex:1; overflow:auto; padding:8px; }
.sdock-tile .workspace-splitter { display:none; }
.price-alert-bell { width:23px; justify-content:center; padding:0; }
.price-alert-bell > span { position:absolute; left:100%; pointer-events:none; border-radius:0 3px 3px 0; background:#303139; padding:3px 4px; }
@media (pointer: coarse) {
  .price-alert-bell,
  .price-alert-bell:is(:hover, :focus-visible, :active) {
    width: 44px;
    min-height: 44px;
    justify-content: flex-end;
    background: transparent;
    border: 0;
  }
  .price-alert-bell .icon {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    background: #303139;
    border: 1px solid #454851;
    border-radius: 5px 0 0 5px;
  }
  .price-alert-bell:active .icon { background: #444651; }
  .price-alert-bell > span { padding: 6px 5px; }
}

/* Shared surfaces for floating menus and settings inspectors. */
:root {
  --popup-surface: #1c1d22;
  --popup-edge: #3d3e48;
  --popup-shadow: 0 8px 28px #0006, 0 1px 0 #ffffff06 inset;
}
#modal, .chart-menu, .sdock-picker {
  background: var(--popup-surface);
  color: var(--ink);
  border: 1px solid var(--popup-edge);
  border-radius: 9px;
  box-shadow: var(--popup-shadow);
  scrollbar-width: thin;
}
#modal { width: min(400px, calc(100vw - 16px)); }
#modal:has(.dialog-list:only-child) { width: min(344px, calc(100vw - 16px)); }
#modal:has(.market-picker, .sai-log, .ac-panel table) { width: min(490px, calc(100vw - 16px)); }
#modal::backdrop { background: #06070966; backdrop-filter: blur(1px); }
#modal:has(.study-editor)::backdrop { background: #06070926; backdrop-filter: none; }
#modal .dialoghead { min-height: 36px; padding: 5px 10px 5px 12px; gap: 3px; background: var(--popup-surface); }
#modal .dialoghead h2 { font-size: 14px; font-weight: 600; margin-block: 0; }
#modal .dialoghead .iconbtn { width: 26px; min-width: 26px; height: 26px; min-height: 26px; border-radius: 5px; background: transparent; }
#modal .dialoghead .iconbtn:hover { background: #ffffff0d; }
#dialogBody { padding: 10px 12px; line-height: 1.35; }
#modal:has(.market-picker) #dialogBody { padding: 0; }
#dialogBody .field { margin: 4px 0; gap: 3px; }
#dialogBody .dialog-list { gap: 1px; }
#dialogBody :is(.dialog-row,.settingrow) { min-height: 30px; padding: 5px 3px; font-size: 12px; }
#dialogBody .dialog-row { padding-inline: 6px; border-bottom-color: #ffffff08; }
#dialogBody .dialog-row:hover, .chart-menu-item:hover { background: #ffffff0b; }
#dialogBody .study-row { padding-block: 7px; gap: 9px; }
#dialogBody .study-actions { margin-top: 10px; }
#dialogBody :is(.ac-panel,.ac-block,.ac-section,.sai-form) { gap: 8px; }
#dialogBody :is(.ac-btn,.primary,.secondary) { min-height: 29px; padding: 4px 9px; font-size: 12px; }
#dialogBody :is(select,input:not([type=checkbox],[type=color],[type=range],[type=radio])) { min-height: 28px; height: 29px; padding: 3px 7px; }
.chart-menu { min-width: 194px; padding: 4px; }
.chart-menu-item { min-height: 27px; padding: 3px 6px; gap: 7px; border-radius: 5px; }
.chart-menu .menu-caption { padding: 4px 6px 5px; }
.chart-menu.drawing-library {
  width: min(300px, calc(100vw - 12px));
  max-height: min(65dvh, 540px);
  overscroll-behavior: contain;
}
.drawing-library .menu-caption { padding: 8px 9px 4px; }
.drawing-library .menu-caption:first-child { color: var(--text); font-weight: 650; }
.drawing-library .menu-caption:not(:first-child) { border-top: 1px solid var(--edge); }
.drawing-library .chart-menu-item { min-height: 34px; padding-inline: 9px; }
.drawing-library .chart-menu-shortcuts {
  display: flex;
  gap: 2px;
  padding: 2px 5px 5px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
}
.drawing-library .chart-menu-shortcuts .chart-menu-item {
  justify-content: center;
  flex: 0 0 34px;
}
.chart-menu-favorite-row { display: grid; grid-template-columns: minmax(0, 1fr) 36px; }
.chart-menu-favorite-star { border: 0; background: transparent; color: var(--muted); font-size: 19px; }
.chart-menu-favorite-star[aria-checked='true'] { color: #d5a94b; }
.chart-menu-favorite-star:hover { background: #8882; }
.drawing-library button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
@media (max-width: 760px), (pointer: coarse) {
  .drawing-library .chart-menu-item,
  .drawing-library .chart-menu-favorite-star { min-height: 44px; }
  .drawing-library .chart-menu-shortcuts .chart-menu-item { flex-basis: 44px; }
  .chart-menu-favorite-row { grid-template-columns: minmax(0, 1fr) 44px; }
}
.flow-disabled main .flow { display: none; }
@media (pointer: coarse) {
  #modal .dialoghead .iconbtn, #dialogBody :is(.dialog-row,.settingrow,.ac-btn,.primary,.secondary), .chart-menu-item { min-height: 38px; }
  #dialogBody :is(select,input:not([type=checkbox],[type=color],[type=range],[type=radio])) { min-height: 36px; }
}

.indicator-group h3 {font-size:11px;color:var(--muted);font-weight:600;margin:12px 0 4px}

.context-help {
  position: fixed;
  z-index: 10000;
  width: max-content;
  max-width: min(310px, calc(100vw - 16px));
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  box-shadow: 0 6px 20px #0007;
  color: var(--ink);
  font-size: 11px;
  line-height: 1.45;
  pointer-events: none;
}
.context-help > div + div {margin-top:5px}
button.context-help-button {
  width: auto;
  min-height: 23px;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}
button.context-help-button:hover, button.context-help-button:focus-visible {color:var(--ink);background:var(--hover)}
#flowHelp {margin-inline-start:auto}
.lower-study-header .lower-study-grip {
  min-width:14px;
  padding:0;
  cursor:grab;
  touch-action:none;
}
.lower-study-header .lower-study-grip.dragging {cursor:grabbing;color:var(--accent)}
.lower-drop-up::after,.lower-drop-down::after {
  content:'';
  position:absolute;
  z-index:5;
  inset:0 0 auto;
  height:2px;
  background:var(--accent);
  pointer-events:none;
}
.lower-drop-down::after {inset:auto 0 0}
.study-heat-credits {padding-inline:4px;color:var(--muted);font-size:11px}

/* ── Audit polish · 2026-11-24 ─────────────────────────────────────────────
   Legends sit on quiet chips so candles, bubble labels and zero lines never
   run through the text. Kept in one block for easy review. */
.study-legend { text-shadow: none; }
.legend-volume-row:not([hidden]), .legend-disclosure, .legend-row {
  width: fit-content;
  margin-left: -5px;
  padding-inline: 5px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--chart-bg) 86%, transparent);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
.legend-disclosure { margin: 1px 0 1px -5px; color: var(--muted); }
.legend-rows { display: flex; flex-direction: column; gap: 1px; padding-top: 1px; }
.lower-study-header {
  right: auto;
  top: 2px;
  max-width: calc(100% - 72px);
  padding: 0 4px 0 2px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--chart-bg) 86%, transparent);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
/* Help sits beside the settings gear instead of floating mid-header. */
#flowHelp { margin-inline-start: auto; }
#flowHelp + #flowOptions { margin-left: 4px; }
.legend-row, .legend-volume-row { box-sizing: content-box; }
/* Order book: quieter cumulative depth so prices and sizes stay readable. */
.levelrow .depthbar { height: 64%; top: 18%; background: #57ad921f; }
.ask .levelrow .depthbar { background: #d1838c1c; }
.watchprice > span.needs-key { color: var(--muted, #8b9099); cursor: help; }
/* Drawing favorites: fade the end that still scrolls instead of clipping an icon. */
.rail-favorites { --fade: 18px; }
.rail-favorites.more-after { mask-image: linear-gradient(to bottom, #000 calc(100% - var(--fade)), transparent); }
.rail-favorites.more-before { mask-image: linear-gradient(to top, #000 calc(100% - var(--fade)), transparent); }
.rail-favorites.more-before.more-after { mask-image: linear-gradient(to bottom, transparent, #000 var(--fade), #000 calc(100% - var(--fade)), transparent); }
@media (max-width: 760px) {
  .rail-favorites { scroll-snap-type: x proximity; }
  .rail-favorites > button { scroll-snap-align: start; }
  .rail-favorites.more-after { mask-image: linear-gradient(to right, #000 calc(100% - var(--fade)), transparent); }
  .rail-favorites.more-before { mask-image: linear-gradient(to left, #000 calc(100% - var(--fade)), transparent); }
  .rail-favorites.more-before.more-after { mask-image: linear-gradient(to right, transparent, #000 var(--fade), #000 calc(100% - var(--fade)), transparent); }
}


.workspace-settings {display:grid;gap:8px}
.workspace-setting-group {display:grid;gap:1px}
.workspace-setting-group h3 {margin:0;padding:4px 8px;color:#a5a9b4;font-size:11px;font-weight:550}
.workspace-setting {
  display:grid;grid-template-columns:18px minmax(0,1fr) 14px;align-items:center;gap:8px;width:100%;
  min-height:30px;padding:4px 8px;border:1px solid transparent;border-radius:5px;background:transparent;
  color:var(--text,#e5e7ee);text-align:left;font-size:12px;line-height:1.25
}
.workspace-setting:is(:hover,:focus-visible) {background:#262932;border-color:#373b47}
.workspace-setting:focus-visible,.shortcut-key:focus-visible {outline:2px solid #c3b8ee;outline-offset:-2px}
.workspace-setting svg {width:15px;height:15px}
.workspace-setting > svg {width:12px;height:12px;color:#858b9a;margin-left:auto}
.workspace-setting-icon {display:grid;place-items:center;color:#a9aebc}
.workspace-setting-label {overflow-wrap:anywhere}
.workspace-setting-footer {border-top:1px solid #343741;padding-top:6px}
.workspace-setting-footer small {margin-left:8px;color:#a5a9b4;font-weight:400}
.keyboard-shortcuts {display:grid;gap:8px}
.keyboard-shortcuts > p {margin:0}
.shortcut-list {display:grid}
.shortcut-row {display:flex;justify-content:space-between;align-items:center;gap:12px;padding:4px 2px;border-bottom:1px solid #30333b}
.shortcut-key {min-width:92px;min-height:28px;padding:4px 8px;border:1px solid #414552;border-radius:5px;background:#20232b;color:#e5e7ee}
.shortcut-key[aria-pressed=true] {border-color:#b8a9ee}
@media(max-width:760px) {
  .workspace-settings {gap:6px}
  .workspace-setting {min-height:36px}
}


.market-search {background:#15181e;border-color:#3b404c}
.market-filters {gap:4px}
.market-filters button {border:1px solid transparent;border-radius:5px}
.market-filters button[aria-pressed=true] {color:#e0d9ff;background:#302b40;border-color:#49405e}
.market-group h3 {margin:12px 6px 4px}
.market-row {align-items:center;border-radius:5px;border-bottom-color:#ffffff0d;padding-inline:8px}
.market-row[aria-current=true] {background:#282634;box-shadow:inset 2px 0 #b5a8e6}
.market-row:is(:hover,:focus-visible):not(:disabled) {background:#272b34}
.market-row:focus-visible,.market-filters button:focus-visible {outline:2px solid #c3b8ee;outline-offset:-2px}
.market-source {max-width:min(43%,160px);overflow-wrap:anywhere}
.market-identity small {overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.market-empty {padding:16px 8px;color:var(--muted);font-size:12px}
#mainNav button[data-action=calendar] .icon {width:14px;height:14px}
@media(max-width:760px) {
  body > header #mainNav button[aria-current=page] {box-shadow:inset 0 -2px #b5a8e6}
  body > header #mainNav button[data-action=calendar] .icon {display:none}
  .market-filters button {min-height:34px}
}

.indicator-picker-tabs { margin-block-end: 12px; }
.indicator-picker-tabs [aria-pressed="true"] { color: var(--accent); background: var(--hover); }
.indicator-picker .market-search { margin: 0 0 10px; }
.indicator-search-status { margin: 0; }
.indicator-search-status:not(:empty) { margin-block: 4px 8px; }
.indicator-presets[hidden] { display: none; }
.community-indicator-create { border: 1px solid var(--line); border-radius: 8px; padding: 0 12px; }
.community-indicator-create > summary { display: list-item; align-content: center; min-height: 44px; cursor: pointer; }
.community-indicator-create > .dialog-list { padding-block-end: 12px; }
.community-indicators textarea { width: 100%; min-width: 0; resize: vertical; }
.community-indicators textarea { font: 12px var(--mono); }
#custom-indicator-result { white-space: pre-line; }
.community-indicator-row { flex-wrap: wrap; padding: 8px; row-gap: 6px; }
.community-indicator-row small { display: block; margin-top: 3px; }
.community-indicators button, .indicator-picker-tabs button { min-height: 38px; }
@media (max-width: 760px) {
  .community-indicators button, .indicator-picker-tabs button { min-height: 44px; }
  #dialogBody .indicator-picker .market-search input { min-height: 44px; font-size: 16px; }
}

/* Chart workspace */
.desktop-chart-tabs, .toolbar-market-stats { display: none; }
.funding-comparison { display: grid; gap: 12px; }
.funding-comparison > p { margin: 0; }
.funding-comparison-summary { display: grid; gap: 4px; border-bottom: 1px solid var(--line); padding-block-end: 10px; }
.funding-comparison-summary strong { font: 600 22px var(--mono); }
.funding-comparison-summary span { color: var(--muted); font-size: 12px; }
.funding-comparison .flowtable :is(th, td) { padding-block: 8px; }
@media (min-width: 761px) {
  .desktop-chart-tabs {
    flex: 0 0 34px; display: flex; align-items: center; gap: 4px;
    min-width: 0; overflow: hidden; padding-inline: 8px; background: var(--panel);
    border-bottom: 1px solid var(--line);
  }
  .desktop-chart-tab-list { display: flex; gap: 2px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .desktop-chart-tab {
    display: flex; align-items: center; gap: 2px; flex: none;
    padding-inline-end: 2px; border-radius: 5px;
  }
  .desktop-chart-tab:has([aria-current]) { background: var(--hover); }
  .desktop-chart-tabs button { min-height: 26px; padding: 3px 8px; font-size: 11px; white-space: nowrap; }
  .desktop-chart-tabs .iconbtn { min-width: 26px; width: 26px; padding: 0; color: var(--muted); }
  .desktop-chart-tabs .iconbtn .icon { width: 14px; height: 14px; }
  .toolbar-market-stats:not([hidden]) {
    display: flex; align-items: center; flex: none; gap: 12px;
    margin-inline: 4px 8px; padding-inline-start: 10px; border-inline-start: 1px solid var(--line);
  }
  .toolbar-market-stat {
    display: grid; grid-template-columns: auto auto; align-content: center; align-items: baseline;
    column-gap: 5px; row-gap: 2px; line-height: 1.1; white-space: nowrap;
    font-variant-numeric: tabular-nums;
  }
  .toolbar-market-stat > span {
    grid-column: 1 / -1; font-size: 9px; color: var(--muted);
  }
  .toolbar-market-stat > b { font-family: var(--mono); font-weight: 550; font-size: 11px; }
  .toolbar-market-values { display: contents; }
  .toolbar-market-stat[hidden], .toolbar-market-stat > [hidden] { display: none; }
  .controlbar .toolbar-funding-button {
    grid-column: 1 / -1; justify-self: start; padding: 0 2px;
    min-height: 14px; font-size: 10px; line-height: 1; color: var(--ink);
  }
  .toolbar-funding-countdown { color: var(--muted); font: 10px var(--mono); }
}

.layout-sync { display: grid; gap: 12px; }
.layout-sync > button { justify-self: start; }
.layout-presets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.layout-preset { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 4px; min-height: 42px; }
.layout-preset[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); background: var(--hover); }
.layout-preset-shape { display: grid; width: 20px; height: 15px; gap: 2px; }
.layout-preset-shape[data-count="2"], .layout-preset-shape[data-count="3"], .layout-preset-shape[data-count="4"] {
  grid-template-columns: repeat(2, 1fr);
}
.layout-preset-shape[data-count="3"] > :first-child { grid-row: span 2; }
.layout-preset-shape > i { border: 1px solid currentColor; border-radius: 2px; }
.layout-sync-options { border-block: 1px solid var(--line); padding-block: 7px; }
.layout-sync-options h3 { margin: 2px 6px 4px; color: var(--muted); font-size: 11px; font-weight: 600; }
.layout-sync .layout-sync-toggle {
  display: flex; width: 100%; min-height: 34px; align-items: center; justify-content: space-between;
  border: 1px solid transparent; background: transparent; padding: 3px 6px;
}
.layout-sync .layout-sync-toggle:hover { background: var(--hover); }
.layout-switch-track {
  display: flex; align-items: center; width: 30px; height: 17px; padding: 2px;
  color: var(--muted); border: 1px solid currentColor; border-radius: 12px;
}
.layout-switch-track::before { content: ''; width: 11px; height: 11px; border-radius: 50%; background: currentColor; }
.layout-sync-toggle[aria-pressed="true"] .layout-switch-track {
  justify-content: end; border-color: var(--accent); background: var(--accent); color: var(--panel);
}
.layout-sync-toggle[aria-pressed="mixed"] .layout-switch-track { justify-content: center; color: var(--accent); }
.layout-sync-toggle:focus-visible, .layout-links summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.layout-links summary { min-height: 30px; padding: 5px 6px; color: var(--ink); cursor: pointer; }
.layout-links > p { font-size: 11px; margin: 0 0 5px; }
.layout-link-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px;
  align-items: center; border-top: 1px solid var(--line); padding-block: 7px;
}
.layout-link-market { min-width: 0; }
.layout-link-market > strong { display: block; font-size: 12px; overflow-wrap: anywhere; }
.layout-link-market > small { display: block; font-size: 10px; margin-top: 3px; }
.layout-link-group { min-width: 0; padding: 0; margin: 0; border: 0; white-space: nowrap; }
.layout-link-group legend { font-size: 10px; color: var(--muted); margin-block-end: 2px; }
.layout-link-check {
  display: inline-flex; align-items: center; gap: 4px; min-height: 34px; padding-inline: 4px;
  cursor: pointer; font-size: 11px;
}
.layout-link-check > input { width: 13px; height: 13px; margin: 0; accent-color: var(--accent); }
.layout-link-check:has(input:checked) { color: var(--accent); }
@media (max-width: 760px) {
  .layout-preset, .layout-link-check, .layout-sync .layout-sync-toggle, .layout-links summary { min-height: 44px; }
  .layout-links summary { padding-block: 11px; }
}

.indicator-preview-row { gap: 7px; min-height: 43px; }
.indicator-preview-row > .iconbtn { margin-left: 0; }
.study-preview {
  width: 60px; height: 28px; flex: none; border-radius: 4px;
  background: color-mix(in srgb, var(--panel) 54%, #0a0b11); border: 1px solid var(--line);
}
.indicator-favorite { font-size: 17px; color: var(--muted); }
.indicator-favorite[aria-pressed="true"] { color: var(--accent); }
.community-study-identity { display: flex; align-items: center; gap: 8px; min-width: 0; }
.community-study-title { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 760px) {
  .indicator-preview-row .iconbtn { min-width: 36px; min-height: 44px; }
  .study-preview { width: 47px; height: 24px; }
}


/* The pane, its labels and overlaid controls share the chart's own palette. */
.pane :is(.instrument small, .quote small, .lower-study-missing) { color: var(--chart-muted, var(--chart-text)); }
.pane .quote .pos { color: var(--chart-up-text, var(--up)); }
.pane .quote .neg { color: var(--chart-down-text, var(--down)); }
.pane.light-chart .chart-navigation > button,
.pane.light-chart :is(.phone-chart-reset, .phone-chart-reset:active)::before,
.pane.light-chart .lower-study-header.mobile-open {
  background: var(--chart-surface);
  color: var(--chart-text);
  border-color: var(--chart-edge);
}
.pane.light-chart .chart-navigation > button:is(:hover, :focus-visible, :active) { background: var(--chart-hover); }
.pane.light-chart :is(.lower-study-header button, .lower-study-grip-edge, .lower-study-sources) {
  color: var(--chart-muted);
}
.pane.light-chart .lower-study-header button:is(:hover, :focus-visible) { background: var(--chart-hover); color: var(--chart-text); }


.chart-armed-alerts { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.chart-alert-line { position: absolute; left: 0; border-top: 1px dashed var(--chart-edge, #858691); }
.chart-alert-marker {
  position: absolute; z-index: 2; right: 0;
  min-width: 0; max-width: 100%; min-height: 0; height: 16px; padding: 0 1px; gap: 1px;
  border-radius: 2px; background: #edc768; color: #2f230e;
  font: 9.5px/1 var(--mono); white-space: nowrap; touch-action: none;
}
.chart-alert-marker[hidden] { display: none; }
.chart-alert-marker:is(:hover, :active, [aria-expanded='true']) { background: #ffdb82; }
.chart-alert-marker:focus-visible { outline: 1px solid currentColor; outline-offset: -2px; }
.chart-alert-marker > .icon, .chart-alert-marker > .icon svg { width: 9px; height: 9px; flex: none; }
.chart-alert-marker > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

.candle-appearance-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(2, 34px);
  align-items: center;
  gap: 5px 8px;
  border-bottom: 1px solid var(--line);
  padding: 8px 0;
}
.candle-appearance-column {
  text-align: center;
  color: var(--muted);
  font-size: 11px;
}
.candle-appearance-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.candle-appearance-toggle input { margin: 0; accent-color: var(--accent); }
.candle-appearance-grid .terminal-color-control:not(.quick-color),
.appearance-color-row .terminal-color-control:not(.quick-color) { min-width: 0; min-height: 30px; width: 34px; }
.candle-appearance-grid .terminal-color-control:not(.quick-color) { width: 100%; }
@media (pointer: coarse) {
  .candle-appearance-grid { grid-template-columns: minmax(0, 1fr) repeat(2, 44px); }
  .candle-appearance-grid .terminal-color-control:not(.quick-color), .candle-appearance-toggle { min-height: 44px; }
  .appearance-color-row .terminal-color-control:not(.quick-color) { width: 44px; min-height: 44px; }
}

@media (max-width: 760px) {
  .lower-study-header.mobile-open { z-index: 6; }
}

/* ── Unified Light Theme & Overlay Contrast ────────────────────────────────── */
.pane.light-chart .legend-disclosure {
  color: var(--chart-muted);
}
.pane.light-chart .drawing-quickbar {
  background: var(--chart-surface);
  color: var(--chart-text);
  border-color: var(--chart-edge);
  box-shadow: 0 4px 16px #0000001a;
}
.pane.light-chart .drawing-quickbar :is(label, button, select):hover {
  background-color: var(--chart-hover);
}
.pane.light-chart .drawing-quickbar option {
  background: var(--chart-surface);
  color: var(--chart-text);
}
.pane.light-chart .price-alert-bell,
.pane.light-chart .price-alert-bell > span {
  background: var(--chart-surface);
  color: var(--chart-text);
  border-color: var(--chart-edge);
}
.pane.light-chart .price-alert-bell:hover,
.pane.light-chart .price-alert-bell:focus-visible {
  background: var(--chart-hover);
  color: var(--chart-text);
}
.pane.light-chart .liquidation-zone-tooltip {
  background: var(--chart-surface);
  color: var(--chart-text);
  border-color: var(--chart-edge);
  box-shadow: 0 4px 16px #00000018;
}
.pane.light-chart .liquidation-zone-tooltip strong { color: var(--chart-text); }
.pane.light-chart .liquidation-zone-tooltip small { color: var(--chart-muted); }

:root[data-theme='light'] {
  --bg: #f4f5f8;
  --panel: #ffffff;
  --line: #e2e5ec;
  --muted: #5c6373;
  --ink: #141720;
  --accent: #5b4cc4;
  --up: #0e8f6e;
  --down: #cf3f4c;
  --surface-raised: #eef0f5;
  --hairline: #0f172a12;
  --hover: #0f172a0a;
  --popup-surface: #ffffff;
  --popup-edge: #d7dce6;
  --popup-shadow: 0 12px 32px #0f172a1c, 0 1px 0 #ffffff inset;
  color-scheme: light;
  scrollbar-color: #c2c8d4 transparent;
}
:root[data-theme='light'] body { color: var(--ink); background: var(--bg); }
:root[data-theme='light'] button:active:not(:disabled) { background: #0f172a12; }
:root[data-theme='light'] .brand > span,
:root[data-theme='light'] .paneltitle i,
:root[data-theme='light'] .controlbar button :is(.icon, i) { color: var(--muted); }
:root[data-theme='light'] nav button { color: var(--muted); }
:root[data-theme='light'] nav button.nav-on { color: var(--ink); background: var(--panel); box-shadow: 0 1px 2px #0f172a14; }
:root[data-theme='light'] .ai-button {
  color: #2f256d;
  background: #eeebfb;
  border-color: #d0c7f5;
}
:root[data-theme='light'] .ai-button:hover { background: #e3defa; }
:root[data-theme='light'] .header-actions > .iconbtn,
:root[data-theme='light'] .controlbar button,
:root[data-theme='light'] .tools button { color: #3d4352; }
:root[data-theme='light'] .controlbar,
:root[data-theme='light'] .tools,
:root[data-theme='light'] footer { background: #fafbfc; border-color: var(--line); color: var(--muted); }
:root[data-theme='light'] .toolsep { background: var(--line); }
:root[data-theme='light'] .pane-grid { background: var(--line); }
:root[data-theme='light'] button.selected,
:root[data-theme='light'] .tabset .selected,
:root[data-theme='light'] #intervals .selected,
:root[data-theme='light'] .tools button.selected {
  color: #3f31a8;
  background: #ece8fb;
  box-shadow: inset 0 0 0 1px #5b4cc430;
}
:root[data-theme='light'] .side { border-color: var(--line); box-shadow: none; }
:root[data-theme='light'] .side .panelhead > .iconbtn { border-color: var(--line); }
:root[data-theme='light'] .watchhead { border-bottom-color: var(--line); color: var(--muted); }
:root[data-theme='light'] .watchgroup { background: #f2f4f8; color: var(--muted); box-shadow: none; }
:root[data-theme='light'] .watchrow + .watchrow::after { background: var(--hairline); }
:root[data-theme='light'] .watchrow.current { background: #eeecfa; }
:root[data-theme='light'] .watchrow small,
:root[data-theme='light'] .watchrow.current small,
:root[data-theme='light'] .market-detail dt { color: var(--muted); }
:root[data-theme='light'] .watchrow .watchprice,
:root[data-theme='light'] .market-detail dd { color: var(--ink); }
:root[data-theme='light'] .trade-button,
:root[data-theme='light'] .primary,
:root[data-theme='light'] .sai button.sai-primary { background: #5b4cc4; color: #ffffff; }
:root[data-theme='light'] .trade-button:hover,
:root[data-theme='light'] .primary:hover { background: #4c3db5; }
:root[data-theme='light'] .secondary { background: var(--panel); color: var(--ink); border-color: var(--popup-edge); }
:root[data-theme='light'] .flow { border-top-color: var(--line); }
:root[data-theme='light'] .flow .panelhead { background: #fafbfc; }
:root[data-theme='light'] .tabset button.selected { background: var(--panel); color: var(--ink); box-shadow: 0 1px 2px #0f172a14; }
:root[data-theme='light'] .levelhead,
:root[data-theme='light'] .flowtable th,
:root[data-theme='light'] .panel-note { color: var(--muted); }
:root[data-theme='light'] dialog,
:root[data-theme='light'] .dialoghead { background: var(--panel); color: var(--ink); border-color: var(--popup-edge); }
:root[data-theme='light'] dialog::backdrop { background: #0f172a40; }
:root[data-theme='light'] #dialogBody :is(input, textarea, select),
:root[data-theme='light'] .market-search { background: #f6f7fa; color: var(--ink); border-color: var(--popup-edge); }
:root[data-theme='light'] .workspace-setting { color: var(--ink); }
:root[data-theme='light'] .workspace-setting:is(:hover, :focus-visible) { background: var(--surface-raised); border-color: var(--line); }
:root[data-theme='light'] .workspace-setting-group h3,
:root[data-theme='light'] .workspace-setting-icon,
:root[data-theme='light'] .workspace-setting > svg,
:root[data-theme='light'] .workspace-setting-footer small { color: var(--muted); }
:root[data-theme='light'] .workspace-setting-footer,
:root[data-theme='light'] .shortcut-row { border-color: var(--line); }
:root[data-theme='light'] .shortcut-key { background: var(--surface-raised); color: var(--ink); border-color: var(--popup-edge); }
:root[data-theme='light'] .market-row[aria-current=true] { background: #eeecfa; box-shadow: inset 2px 0 var(--accent); }
:root[data-theme='light'] .market-row:is(:hover, :focus-visible):not(:disabled) { background: var(--surface-raised); }
:root[data-theme='light'] .market-filters button[aria-pressed=true] { color: #3f31a8; background: #ece8fb; border-color: #d0c7f5; }
:root[data-theme='light'] #toast { background: #1e2230; color: #ffffff; border-color: #2f3547; }

/* Command palette (Cmd+K / Ctrl+K) & Header Controls */
.cmd-trigger {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 30px; padding: 3px 9px; border-radius: 7px;
  border: 1px solid var(--line); background: var(--bg); color: var(--muted);
  font-size: 11.5px; white-space: nowrap; flex-shrink: 0;
}
.cmd-trigger:hover { color: var(--ink); background: var(--hover); }
.cmd-trigger kbd {
  font: 10.5px var(--mono); color: var(--muted);
  padding: 1px 4px; border-radius: 4px; border: 1px solid var(--line);
}
@media (max-width: 760px) { .cmd-trigger kbd { display: none; } }
.levelrow { cursor: pointer; border-radius: 3px; }
.levelrow:hover { background: var(--hover); }
.cmd-palette { display: flex; flex-direction: column; max-height: min(520px, calc(82dvh - 54px)); }
.cmd-palette-list { overflow-y: auto; padding: 0 12px 12px; display: grid; gap: 2px; }
.cmd-palette-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; min-height: 36px; padding: 6px 10px; border-radius: 6px;
  text-align: left; font-size: 12.5px; color: var(--ink);
}
.cmd-palette-row:is(:hover, :focus-visible) { background: var(--hover); outline: none; }
.cmd-palette-row small { color: var(--muted); font-size: 11px; font-family: var(--mono); }

/* Sub-page light-theme cohesion (Portfolio, News, Calendar) */
:root[data-theme='light'] .pf-switch { background: var(--surface-raised); border-color: var(--line); }
:root[data-theme='light'] .pf-switch button[aria-pressed='true'] { background: var(--panel); color: var(--ink); box-shadow: 0 1px 2px #0f172a18; }
:root[data-theme='light'] .pf-card,
:root[data-theme='light'] .pf-ring > div { background: var(--panel); border-color: var(--line); }
:root[data-theme='light'] .pf-table :is(th, td) { border-bottom-color: var(--line); }
:root[data-theme='light'] .pf-coin { background: var(--surface-raised); color: var(--ink); }
:root[data-theme='light'] .pf-days .gain { background: #0e8f6e18; }
:root[data-theme='light'] .pf-days .gain small { color: #0b7358; }
:root[data-theme='light'] .pf-days .loss { background: #cf3f4c18; }
:root[data-theme='light'] .pf-days .loss small { color: #b52d3a; }
:root[data-theme='light'] .news-post[data-impact='medium'] .news-time,
:root[data-theme='light'] .calendar-impact[data-impact='medium'] { color: #9a6700; }
:root[data-theme='light'] .news-post[data-impact='high'] .news-time,
:root[data-theme='light'] .calendar-impact[data-impact='high'] { color: #c42b37; }

/* Light theme readability: page-level form controls, hover, and long/short and trade-side colours. */
:root[data-theme='light'] { --up: #0b7d60; --down: #c42b3c; }
html:where([data-theme='light']) input,
html:where([data-theme='light']) select,
html:where([data-theme='light']) textarea { background: #ffffff; color: var(--ink); border-color: var(--popup-edge); }
html:where([data-theme='light']) button:hover { background: var(--hover); }
/* Long liquidations green, short liquidations red (owner's choice). */
:root[data-theme='light'] :is(#liqPage, .liq-totals-widget) { --liq-long: #0b7d62; --liq-short: #c42b48; }
:root[data-theme='light'] .ac-panel [data-side='buy'] { --side-color: #0b7d60; }
:root[data-theme='light'] .ac-panel [data-side='sell'] { --side-color: #c42b3c; }
:root[data-theme='light'] .calendar-impact[data-impact='medium'] { color: #8a5c00; }
.news-gauge canvas { color: var(--ink); }
:root[data-theme='light'] .lower-study-toggle .icon { opacity: .85; }

/* ── Minimalist Terminal Polish · Desktop, Hairline Gaps, Dual Theme Pill & Sub-pages ── */
header {
  height: 50px;
  padding: 0 14px;
  gap: 20px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.brand img { width: 26px; height: 26px; }
.brand b { font-size: 17.5px; letter-spacing: -0.6px; font-weight: 660; }
.brand > span { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; margin-top: 1px; }
.brand small {
  font-size: 9.5px; font-weight: 600; letter-spacing: 0.02em;
  padding: 1px 6px; border-radius: 999px;
  background: var(--surface-raised); color: var(--muted);
  border: 1px solid var(--hairline);
}
nav#mainNav {
  height: 32px; padding: 2px; gap: 2px; border-radius: 999px;
  background: var(--bg); border: 1px solid var(--line);
}
nav#mainNav button {
  height: 26px; min-height: 26px; padding: 0 12px; border-radius: 999px;
  font-size: 12px; font-weight: 540; color: var(--muted);
  transition: background-color 120ms ease, color 120ms ease;
}
nav#mainNav button.nav-on {
  background: var(--accent);
  color: #171525;
  font-weight: 620;
  box-shadow: none;
}
:root[data-theme='light'] nav#mainNav button.nav-on {
  background: var(--accent);
  color: #ffffff;
}
.header-actions { gap: 6px; }
.cmd-trigger {
  height: 30px; min-height: 30px; padding: 0 9px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--bg); color: var(--muted);
  gap: 6px; font-size: 12px;
}
.cmd-trigger .cmd-label { color: var(--muted); }
@media (max-width: 1120px) { .cmd-trigger .cmd-label { display: none; } }

/* Dual rounded Sun / Moon segmented theme pill (collapses cleanly on narrow viewports) */
.theme-pill {
  display: inline-flex; align-items: center; gap: 2px;
  height: 30px; min-height: 30px; padding: 2px; border-radius: 999px;
  background: var(--bg); border: 1px solid var(--line); color: var(--muted);
  flex-shrink: 0;
}
.theme-pill:hover { border-color: color-mix(in srgb, var(--line) 60%, var(--accent)); background: var(--bg); }
.theme-pill .theme-seg {
  display: grid; place-items: center;
  width: 24px; height: 24px; border-radius: 999px;
  color: var(--muted); transition: background-color 140ms ease, color 140ms ease;
}
.theme-pill .theme-seg svg { width: 13.5px; height: 13.5px; stroke-width: 1.85; }
:root:not([data-theme='light']) .theme-pill .theme-moon {
  background: var(--surface-raised); color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--hairline);
}
:root[data-theme='light'] .theme-pill .theme-sun {
  background: var(--panel); color: var(--ink);
  box-shadow: 0 1px 2px #0f172a18;
}
@media (max-width: 1060px) {
  .theme-pill { width: 30px; padding: 0; justify-content: center; border-radius: 8px; }
  :root:not([data-theme='light']) .theme-pill .theme-sun { display: none; }
  :root[data-theme='light'] .theme-pill .theme-moon { display: none; }
  .theme-pill .theme-seg { background: transparent !important; box-shadow: none !important; color: var(--ink); }
}

/* Sparkle Ask AI pill & unified header buttons */
.ai-button {
  height: 30px; min-height: 30px; padding: 0 11px; border-radius: 8px;
  gap: 6px; font-size: 12px; font-weight: 560;
  border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--line));
  background: color-mix(in srgb, var(--accent) 13%, var(--panel));
  color: var(--ink);
}
.ai-button:before { display: none; }
.ai-button i { display: inline-flex; color: var(--accent); }
.ai-button i svg { width: 14px; height: 14px; stroke-width: 1.8; }
.ai-button:hover { background: color-mix(in srgb, var(--accent) 22%, var(--panel)); }
.header-actions .arrange-toggle {
  height: 30px; min-height: 30px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface-raised);
}
.header-actions > .iconbtn {
  width: 30px; min-width: 30px; height: 30px; min-height: 30px;
  border-radius: 8px; border: 1px solid var(--line); background: var(--bg);
}
.header-actions > .iconbtn:hover { background: var(--surface-raised); color: var(--ink); }

/* Ultra-tiny 2px hairline widget gaps & crisp modular framing on Desktop */
@media (min-width: 761px) {
  main {
    height: max(630px, calc(100dvh - 75px));
    padding: 2px;
    gap: 2px;
    background: var(--bg);
  }
  main .terminal { gap: 2px; background: var(--bg); }
  main .side {
    gap: 2px; background: var(--bg); border: 0; box-shadow: none;
    overflow: hidden;
  }
  main #chartWidget,
  main .flow,
  main #watchWidget,
  main #detailsWidget {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 6px;
    overflow: hidden;
  }
  main #detailsWidget .market-detail { border-top: 0; }
  /* In-app Workspace Tab Bar */
  .desktop-chart-tabs {
    flex: 0 0 32px;
    padding: 3px 6px;
    gap: 4px;
    background: var(--panel);
    border-bottom: 1px solid var(--line);
  }
  .desktop-chart-tab-list { gap: 3px; }
  .desktop-chart-tab {
    border-radius: 6px;
    border: 1px solid transparent;
    background: transparent;
    transition: background-color 110ms ease, border-color 110ms ease;
  }
  .desktop-chart-tab:hover { background: var(--hover); }
  .desktop-chart-tab:has([aria-current]) {
    background: var(--surface-raised);
    border-color: var(--line);
    box-shadow: inset 0 -2px 0 var(--accent);
  }
  .desktop-chart-tab button:first-child { color: var(--muted); font-weight: 540; }
  .desktop-chart-tab:has([aria-current]) button:first-child { color: var(--ink); font-weight: 620; }
  .desktop-chart-tabs > .iconbtn {
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--bg);
    height: 24px; min-height: 24px; width: 24px; min-width: 24px;
  }
  .desktop-chart-tabs > .iconbtn:hover { background: var(--surface-raised); color: var(--ink); }
}

/* Chart control bar & active interval underline */
.controlbar {
  height: 40px; min-height: 40px; padding: 3px 10px;
  background: var(--panel); border-top: 0; border-bottom: 1px solid var(--line);
}
#intervals button.selected {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  box-shadow: inset 0 -2px 0 var(--accent);
  border-radius: 5px 5px 0 0;
}

/* Watchlist segmented pill & subtle hairline row dividers */
#watchWidget .panelhead { height: 40px; min-height: 40px; padding: 4px 10px; }
#watchWidget .paneltitle {
  gap: 2px; padding: 2px; border-radius: 8px;
  background: var(--bg); border: 1px solid var(--line);
}
#watchWidget .paneltitle > i { display: none; }
#watchWidget .paneltitle button {
  min-height: 24px; height: 24px; padding: 0 11px; border-radius: 6px;
  font-size: 11.5px; font-weight: 560; color: var(--muted);
}
#watchWidget .paneltitle button[aria-pressed='true'] {
  background: var(--surface-raised); color: var(--ink); box-shadow: none;
}
:root[data-theme='light'] #watchWidget .paneltitle button[aria-pressed='true'] {
  background: var(--panel); box-shadow: 0 1px 2px #0f172a14;
}
.watchrow + .watchrow::after {
  background: rgba(217, 222, 234, 0.08);
}
:root[data-theme='light'] .watchrow + .watchrow::after {
  background: rgba(15, 23, 42, 0.08);
}

/* Order flow sleek underline tabs */
.flow .panelhead { height: 38px; min-height: 38px; padding: 4px 12px; gap: 16px; }
.flow .tabset button {
  border-radius: 5px 5px 0 0;
  color: var(--muted);
}
.flow .tabset button.selected {
  background: transparent;
  color: var(--ink);
  font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--accent);
}

/* Sub-pages minimalist card cohesion (News, Calendar, Portfolio, Liquidations, Usage) */
:is(#newsPage, #calendarPage, #portfolioPage, #liqPage, #usagePage) {
  background: var(--bg);
}
.pf-card, .usage-panel, .usage-metric {
  border-radius: 8px;
  border-color: var(--line);
}

.anchored-dropdown {
  position: fixed;
  inset: 0 auto auto 0;
  box-sizing: border-box;
  max-height: min(480px, calc(100dvh - 16px));
  margin: 0;
  padding: 8px 10px 10px;
  overflow: auto;
  overscroll-behavior: contain;
  color: var(--ink);
  background: var(--popup-surface);
  border: 1px solid var(--popup-edge);
  border-radius: 8px;
  box-shadow: var(--popup-shadow);
}
.anchored-dropdown-heading {
  margin: 0 0 8px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--hairline);
  font-size: 12px;
  font-weight: 650;
}
.anchored-dropdown :is(input:not([type="checkbox"]), select) { width: 100%; }
.anchored-dropdown :is(.primary, .secondary) { justify-self: start; }
.anchored-dropdown .dropdown-note { margin: 0; color: var(--muted); line-height: 1.45; }
@media (pointer: coarse) {
  .anchored-dropdown :is(.primary, .secondary, .settingrow, .field select, .field input) { min-height: 44px; }
  .anchored-dropdown :is(input:not([type="checkbox"]), select) { font-size: 16px; }
}

/* Member activity: feature share and busiest hours. */
.usage-features, .usage-hours { display: grid; gap: 10px; align-content: start; }
.usage-features p, .usage-hours p { margin: 0; font-size: 12px; }
.usage-feature-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.usage-feature { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 10px; align-items: baseline; font-size: 13px; }
.usage-feature-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usage-feature strong { font: 650 12px/1 var(--mono); font-variant-numeric: tabular-nums; }
.usage-feature-bar { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--line) 70%, transparent); overflow: hidden; }
.usage-feature-bar i { display: block; height: 100%; border-radius: 3px; background: var(--accent); }
.usage-feature small { grid-column: 1 / -1; color: var(--muted); font-size: 11px; }
.usage-hour-chart { display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); gap: 2px; height: 96px; align-items: end; }
.usage-hour { height: 100%; display: flex; align-items: flex-end; border-radius: 2px; background: color-mix(in srgb, var(--line) 35%, transparent); }
.usage-hour i { display: block; width: 100%; border-radius: 2px; background: color-mix(in srgb, var(--accent) 55%, transparent); }
.usage-hour.is-peak i { background: var(--accent); }
.usage-hour-axis { display: flex; justify-content: space-between; color: var(--muted); font: 500 10px/1 var(--mono); }
