.cc-workspace-dialog { box-sizing:border-box; width:min(460px,calc(100vw - 24px)); max-height:calc(100dvh - 24px); overflow:auto; padding:20px; border:1px solid var(--cc-tool-border); border-radius:12px; background:var(--cc-tool-surface); color:var(--cc-tooltip-text); font:calc(13px - var(--cc-font-reduction,0px)) system-ui,sans-serif; }
.cc-workspace-dialog::backdrop { background:#02081599; }
.cc-workspace-dialog header { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:20px; }
.cc-workspace-dialog h2 { margin:0; font-size:calc(18px - var(--cc-font-reduction,0px)); }
.cc-workspace-dialog button { padding:9px 12px; min-height:36px; border:1px solid var(--cc-tool-border); border-radius:7px; background:var(--cc-tool-surface); color:var(--cc-tooltip-text); font:inherit; cursor:pointer; }
.cc-workspace-dialog button:disabled { opacity:.5; cursor:default; }
.cc-workspace-dialog button:focus-visible,.cc-workspace-dialog input:focus-visible { outline:2px solid var(--cc-tool-accent); outline-offset:3px; }
.cc-workspace-dialog p { line-height:1.6; overflow-wrap:anywhere; }
.cc-chart .cc-workspace-dialog .cc-workspace-toggle { display:flex; flex-direction:row; align-items:center; gap:8px; font-size:calc(13px - var(--cc-font-reduction,0px)); }
.cc-workspace-dialog .cc-workspace-toggle input { width:18px; height:18px; min-height:0; margin:0; flex-shrink:0; accent-color:var(--cc-tool-accent); }
.cc-workspace-files { display:grid; gap:10px; margin:18px 0; }
.cc-workspace-dialog hr { border:0; border-top:1px solid var(--cc-tool-border); margin:20px 0; }
.cc-workspace-dialog [data-workspace-status] { color:var(--cc-tool-accent); }
.cc-workspace-dialog section { padding:12px; border:1px solid var(--cc-tool-border); border-radius:8px; }
.cc-workspace-dialog section button { margin:4px 0; }
.cc-chart {
  container-type:inline-size;
  --cc-tool-accent:#b3a6ff;
  --cc-tool-selected:#302b83;
  --cc-tool-muted:#9baed1;
  --cc-tool-border:#203b70;
  --cc-tool-surface:#081b3c;
  --cc-tooltip-surface:#102650;
  --cc-tooltip-text:#edf0ff;
  position:relative;
  height:100%;
  min-height:320px;
  display:flex;
  flex-direction:column;
  background:#061735;
  color:#b8c5da;
  font:calc(12px - var(--cc-font-reduction,0px)) system-ui,sans-serif;
  overflow:hidden;
  border-radius:10px
}

/* Application charts share the dashboard palette; the standalone lab keeps its theme. */
.cc-chart[data-scanner] {
  --cc-tool-accent:#22d3ee;
  --cc-tool-selected:#4b23a1;
  --cc-tool-muted:#b7c0cc;
  --cc-tool-border:#2a2a32;
  --cc-tool-surface:#09090d;
  --cc-tooltip-surface:#0c0c12;
  --cc-tooltip-text:#f8fafc;
  background:#040404;
  color:#f8fafc;
}
.cc-chart[data-scanner][data-theme="light"] {
  --cc-tool-accent:#0f95bb;
  --cc-tool-selected:#e6dff8;
  --cc-tool-muted:#475569;
  --cc-tool-border:#cbd5e1;
  --cc-tool-surface:#ffffff;
  --cc-tooltip-surface:#f1f5f9;
  --cc-tooltip-text:#0f172a;
  background:#ffffff;
  color:#0f172a;
}
.cc-chart[data-scanner] [hidden] { display:none !important; }

.cc-toolbar {
  display:flex;
  align-items:center;
  gap:5px;
  padding:9px;
  flex-wrap:wrap;
  border-bottom:1px solid var(--cc-tool-border)
}

.cc-toolbar-spacer { flex:1; }
.cc-toolbar-tools,.cc-toolbar-secondary { display:contents; }
.cc-chart .cc-toolbar .cc-mobile-control,.cc-chart .cc-toolbar [data-cc-action="mobile-fullscreen"],.cc-chart .cc-toolbar [data-cc-action="mobile-redo"],.cc-action-caption,.cc-chart [data-cc-mobile-price],.cc-chart .cc-mobile-ohlc { display:none; }
.cc-toolbar .cc-series-trigger,.cc-toolbar .cc-indicator-trigger { display:inline-flex; align-items:center; gap:6px; min-height:32px; }
.cc-toolbar .cc-series-trigger { white-space:nowrap; }
.cc-series-trigger > svg { flex-shrink:0; }
.cc-series-trigger .cc-dropdown-chevron { display:block; width:12px; height:12px; margin-left:2px; opacity:.8; }
.cc-series-trigger[aria-expanded=true] .cc-dropdown-chevron { transform:rotate(180deg); }
.cc-toolbar select[hidden] { display:none; }
.cc-market-header { padding:7px 10px; border-bottom:1px solid var(--cc-tool-border); display:flex; flex-wrap:wrap; align-items:center; gap:4px 10px; min-height:15px; }
.cc-market-header [data-cc-title] { display:flex; flex-wrap:wrap; align-items:center; gap:4px 10px; font-size:calc(11px - var(--cc-font-reduction,0px)); font-variant-numeric:tabular-nums; }
.cc-market-header [data-cc-synthetic] { font-size:calc(10px - var(--cc-font-reduction,0px)); color:var(--cc-tool-muted); }
.cc-series-menu { position:absolute; z-index:30; min-width:220px; max-width:calc(100% - 8px); overflow:auto; padding:5px; border:1px solid var(--cc-tool-border); border-radius:8px; background:var(--cc-tool-surface); box-shadow:0 10px 35px #0005; }
.cc-series-menu[hidden] { display:none; }
.cc-chart .cc-series-menu button { display:flex; align-items:center; gap:10px; width:100%; border:0; background:transparent; padding:8px 10px; text-align:left; }
.cc-series-menu button:nth-child(5),.cc-series-menu button:nth-child(8),.cc-series-menu button:nth-child(11),.cc-series-menu button:nth-child(13) { border-top:1px solid var(--cc-tool-border); border-radius:0; margin-top:4px; }
.cc-series-menu button[aria-checked=true] { color:var(--cc-tool-accent); background:var(--cc-tool-selected); }
.cc-type-check { margin-left:auto; visibility:hidden; }
[aria-checked=true] > .cc-type-check { visibility:visible; }
.cc-chart:fullscreen,.cc-chart.cc-expanded { width:100vw; height:100dvh; max-height:none; border-radius:0; }
.cc-chart.cc-expanded { position:fixed; inset:0; z-index:10000; }
.cc-chart .cc-chart-settings { width:min(680px,calc(100vw - 24px)); max-height:calc(100dvh - 24px); }
.cc-chart-settings > form { overflow:hidden; }
.cc-settings-layout { display:grid; grid-template-columns:155px minmax(0,1fr); min-height:0; height:min(480px,60vh); flex:1; }
.cc-chart-settings .cc-settings-layout nav { display:flex; flex-direction:column; align-items:stretch; padding:10px 0; border-right:1px solid var(--cc-tool-border); border-bottom:0; }
.cc-settings-layout nav button { display:flex; align-items:center; gap:8px; text-align:left; }
.cc-settings-layout nav button[aria-selected=true] { background:var(--cc-tool-selected); color:var(--cc-tool-accent); }
.cc-settings-sections { overflow:auto; min-height:0; min-width:0; padding:8px 20px 20px; }
.cc-settings-sections section[hidden] { display:none; }
.cc-settings-sections label { display:flex; flex-direction:row; align-items:center; justify-content:space-between; gap:10px; margin:13px 0; }
.cc-settings-sections label.cc-setting-check { justify-content:flex-start; }
.cc-settings-sections input[type=checkbox] { width:16px; height:16px; margin:0; padding:0; flex-shrink:0; accent-color:var(--cc-tool-accent); }
.cc-chart-settings input,.cc-chart-settings select,.cc-indicator-dialog input { font:inherit; padding:6px; border:1px solid var(--cc-tool-border); border-radius:5px; background:var(--cc-tool-surface); color:var(--cc-tooltip-text); }
.cc-settings-sections input:not([type=checkbox]),.cc-settings-sections select { width:150px; min-width:0; box-sizing:border-box; }
.cc-settings-sections input[type=color] { width:40px; height:28px; padding:2px; }
.cc-setting-grid { display:grid; grid-template-columns:1fr 1fr; gap:0 16px; }
.cc-settings-sections p { color:var(--cc-tool-muted); line-height:1.6; }
.cc-chart .cc-indicator-dialog { width:min(740px,calc(100vw - 24px)); max-height:calc(100dvh - 24px); overflow:hidden; }
.cc-indicator-dialog header p { margin:5px 0 0; color:var(--cc-tool-muted); font-size:calc(12px - var(--cc-font-reduction,0px)); }
.cc-indicator-search { display:flex; flex-direction:column; gap:6px; padding:12px 18px; }
.cc-indicator-search input { width:100%; box-sizing:border-box; }
.cc-indicator-layout { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.1fr); min-height:0; overflow:hidden; border-top:1px solid var(--cc-tool-border); }
.cc-indicator-library { overflow:auto; min-height:0; padding:8px; }
.cc-indicator-results button { display:flex; align-items:center; gap:10px; width:100%; padding:11px 10px; text-align:left; margin:2px 0; }
.cc-chart .cc-indicator-results button { background:transparent; border:1px solid transparent; }
.cc-chart .cc-indicator-results button:hover { background:var(--cc-tool-selected); }
.cc-chart .cc-indicator-results button[aria-pressed=true] { background:var(--cc-tool-selected); border-color:var(--cc-tool-accent); }
.cc-indicator-results button > span:first-child { flex:1; min-width:0; }
.cc-indicator-results strong,.cc-indicator-results small { display:block; }
.cc-indicator-results small { color:var(--cc-tool-muted); margin-top:4px; }
.cc-indicator-state { flex-shrink:0; color:var(--cc-tool-muted); font-size:calc(11px - var(--cc-font-reduction,0px)); }
.cc-indicator-added .cc-indicator-state { color:var(--cc-tool-accent); }
.cc-indicator-detail { min-width:0; overflow:auto; border-left:1px solid var(--cc-tool-border); padding:16px; }
.cc-indicator-detail-heading { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.cc-indicator-dialog .cc-indicator-detail-heading h3 { font-size:calc(19px - var(--cc-font-reduction,0px)); margin:0; }
.cc-indicator-detail-heading [data-study-actions] { display:flex; gap:4px; }
.cc-indicator-dialog [data-study-actions] button,.cc-indicator-dialog header button { width:32px; height:32px; padding:6px; }
.cc-indicator-detail > p { color:var(--cc-tool-muted); line-height:1.5; margin:8px 0; }
.cc-indicator-detail [data-study-status] { color:var(--cc-tool-accent); font-size:calc(11px - var(--cc-font-reduction,0px)); }
.cc-study-preview { margin:16px 0; border:1px solid var(--cc-tool-border); border-radius:8px; overflow:hidden; }
.cc-study-preview canvas { display:block; width:100%; height:128px; }
.cc-study-preview figcaption { color:var(--cc-tool-muted); padding:6px 8px; font-size:calc(10px - var(--cc-font-reduction,0px)); }
.cc-chart .cc-indicator-back { display:none; }
.cc-study-form { padding:0; }
.cc-study-form[hidden] { display:none; }
.cc-study-form label { display:flex; flex-direction:row; justify-content:space-between; align-items:center; gap:10px; margin:10px 0; }
.cc-study-form input { width:100px; }
.cc-study-form-actions { display:flex; justify-content:flex-end; gap:8px; padding-top:12px; border-top:1px solid var(--cc-tool-border); }
.cc-chart .cc-study-form-actions button { width:auto; margin:0; }
.cc-study-feedback { color:var(--cc-tool-accent); margin:0 0 8px; font-size:calc(12px - var(--cc-font-reduction,0px)); }
.cc-study-feedback:empty { display:none; }
.cc-indicator-dialog [data-study-count] { margin-right:auto; align-self:center; color:var(--cc-tool-muted); font-size:calc(11px - var(--cc-font-reduction,0px)); }
@media(max-width:600px) {
  .cc-indicator-layout { display:block; overflow:auto; }
  .cc-indicator-detail { border:0; padding:12px 16px; overflow:visible; }
  .cc-indicator-dialog[data-view=detail] .cc-indicator-library,.cc-indicator-dialog[data-view=detail] .cc-indicator-search,.cc-indicator-dialog[data-view=library] .cc-indicator-detail { display:none; }
  .cc-chart .cc-indicator-back { display:inline-flex; margin:0 0 14px; padding:6px 0; border:0; background:transparent; color:var(--cc-tool-accent); }
}
@media(pointer:coarse) {
  .cc-indicator-dialog button,.cc-indicator-dialog input,.cc-indicator-dialog select { min-height:44px; }
  .cc-indicator-search input,.cc-study-form input,.cc-study-form select { font-size:calc(16px - var(--cc-font-reduction,0px)); }
  .cc-indicator-dialog [data-study-actions] button,.cc-indicator-dialog header button { min-width:44px; }
}
.cc-chart[data-theme=light] .cc-market-header { color:#334155; }
@media(max-width:600px) {
  .cc-toolbar .cc-series-trigger > span:first-of-type,.cc-toolbar .cc-indicator-trigger > span { display:none; }
  .cc-toolbar .cc-series-trigger,.cc-toolbar .cc-indicator-trigger { padding:5px; }
  .cc-chart .cc-toolbar { display:none; }
  .cc-chart .cc-toolbar .cc-icon-button { width:30px; min-width:30px; height:32px; padding:4px; }
  .cc-market-header { padding:5px 7px; }
  .cc-settings-layout { grid-template-columns:1fr; grid-template-rows:auto minmax(0,1fr); height:62vh; }
  .cc-chart-settings .cc-settings-layout nav { flex-direction:row; flex-wrap:wrap; border-right:0; padding:4px; }
  .cc-settings-layout nav button { padding:6px; font-size:calc(11px - var(--cc-font-reduction,0px)); }
  .cc-settings-layout nav svg { width:15px; height:15px; }
  .cc-settings-sections { padding:0 12px 14px; }
  .cc-setting-grid { gap:0 10px; }
}

.cc-toolbar strong {
  flex:1;
  min-width:180px;
  font-size:calc(11px - var(--cc-font-reduction,0px));
  font-variant-numeric:tabular-nums
}

.cc-toolbar [data-cc-title] { display:flex; flex-wrap:wrap; align-items:center; column-gap:10px; row-gap:4px; }
.cc-ohlc { display:inline-flex; flex-wrap:wrap; gap:4px 8px; }
.cc-ohlc[hidden] { display:none; }
.cc-ohlc > span { white-space:nowrap; }
.cc-ohlc-open { color:#82aaff; }
.cc-ohlc-high { color:#36d4ac; }
.cc-ohlc-low { color:#f27a8c; }
.cc-ohlc-close { color:#f3c76c; }
.cc-chart[data-theme=light] .cc-ohlc-open { color:#3159bb; }
.cc-chart[data-theme=light] .cc-ohlc-high { color:#08775e; }
.cc-chart[data-theme=light] .cc-ohlc-low { color:#bb304c; }
.cc-chart[data-theme=light] .cc-ohlc-close { color:#8f5900; }

.cc-chart button,.cc-chart select {
  background:#14243b;
  color:#d9e4f5;
  border:1px solid #2a3e5b;
  border-radius:5px;
  padding:6px 8px;
  font:inherit;
  cursor:pointer
}

.cc-chart button:hover {
  background:#243b5b
}
.cc-chart button:disabled { opacity:.4; cursor:default; }

.cc-chart :focus-visible {
  outline:2px solid #82aaff;
  outline-offset:2px
}

.cc-stage {
  position:relative;
  flex:1;
  min-height:150px
}

.cc-workspace {
  display:flex;
  flex-direction:column;
  flex:1;
  min-height:0;
  min-width:0;
}

.cc-tool-rail {
  display:flex;
  flex-direction:row;
  flex-shrink:0;
  width:100%;
  gap:4px;
  padding:4px 8px;
  border-bottom:1px solid var(--cc-tool-border);
  background:var(--cc-tool-surface);
  box-sizing:border-box;
}

.cc-rail-tools {
  display:flex;
  flex-direction:row;
  align-items:center;
  gap:2px;
}

.cc-chart .cc-tool-button,.cc-chart .cc-icon-button {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:34px;
  height:34px;
  flex-shrink:0;
  padding:6px;
}

.cc-chart .cc-tool-button,.cc-tool-rail .cc-icon-button {
  background:transparent;
  border-color:transparent;
  color:var(--cc-tool-muted);
}

.cc-chart .cc-tool-button:hover,.cc-tool-rail .cc-icon-button:hover {
  background:var(--cc-tool-selected);
  color:var(--cc-tool-accent);
}

.cc-chart .cc-tool-button[aria-pressed=true] {
  color:var(--cc-tool-accent);
  background:var(--cc-tool-selected);
  border-color:var(--cc-tool-accent);
}

.cc-chart .cc-tool-button svg,.cc-chart .cc-icon-button svg {
  display:block;
  width:20px;
  height:20px;
  pointer-events:none;
}

.cc-tool-delete {
  display:flex;
  flex-direction:row;
  align-items:center;
  gap:2px;
  margin-left:auto;
  padding-left:4px;
  border-left:1px solid var(--cc-tool-border);
}

.cc-tool-trigger { position:relative; }
.cc-tool-trigger [data-cc-group-icon] { display:flex; }
.cc-chart .cc-tool-trigger[aria-expanded=true] { background:var(--cc-tool-selected); color:var(--cc-tool-accent); border-color:var(--cc-tool-accent); }
.cc-tool-menu {
  position:absolute; z-index:25; width:230px; max-width:calc(100% - 8px); box-sizing:border-box;
  padding:7px; border:1px solid var(--cc-tool-border); border-radius:7px;
  background:var(--cc-tool-surface); color:var(--cc-tooltip-text); box-shadow:0 6px 24px #0005;
}
.cc-tool-menu-heading { padding:5px 8px 8px; color:var(--cc-tool-muted); font-size:calc(11px - var(--cc-font-reduction,0px)); }
.cc-emoji-picker { position:absolute; z-index:28; width:250px; max-width:calc(100% - 8px); padding:7px; box-sizing:border-box; border:1px solid var(--cc-tool-border); border-radius:7px; background:var(--cc-tool-surface); color:var(--cc-tooltip-text); box-shadow:0 6px 24px #0005; }
.cc-emoji-picker .cc-tool-menu-heading { display:flex; align-items:center; justify-content:space-between; }
.cc-emoji-grid { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:3px; }
.cc-chart .cc-emoji-grid button { font-size:calc(23px - var(--cc-font-reduction,0px)); height:34px; padding:2px; background:transparent; border-color:transparent; }
.cc-chart .cc-emoji-grid button:hover { background:var(--cc-tool-selected); border-color:var(--cc-tool-accent); }
.cc-measure-actions { position:absolute; z-index:19; display:flex; gap:4px; padding:3px; border:1px solid var(--cc-tool-border); border-radius:5px; background:var(--cc-tool-surface); }
.cc-polyline-actions { position:absolute; z-index:20; left:52px; right:6px; bottom:66px; display:flex; flex-wrap:wrap; align-items:center; justify-content:flex-end; gap:5px; padding:6px; border:1px solid var(--cc-tool-border); border-radius:8px; background:var(--cc-tool-surface); }
.cc-polyline-actions[hidden] { display:none; }
.cc-polyline-actions span { margin-right:auto; color:var(--cc-tool-muted); font-size:calc(11px - var(--cc-font-reduction,0px)); }
.cc-chart .cc-polyline-actions button { min-height:44px; padding:6px 8px; font-size:calc(11px - var(--cc-font-reduction,0px)); }
.cc-chart .cc-tool-option {
  display:flex; align-items:center; gap:10px; width:100%; min-height:38px; padding:9px 8px;
  border-color:transparent; text-align:left; background:transparent; color:var(--cc-tooltip-text);
}
.cc-tool-option svg { flex-shrink:0; width:20px; height:20px; pointer-events:none; }
.cc-chart .cc-tool-option:hover,.cc-chart .cc-tool-option[aria-checked=true] { background:var(--cc-tool-selected); color:var(--cc-tool-accent); }
.cc-chart .cc-tool-rail .cc-tool-button,.cc-chart .cc-tool-rail .cc-icon-button { height:var(--cc-rail-size,34px); padding:3px; }
.cc-rail-overflow-menu { position:absolute; z-index:28; width:230px; max-width:calc(100% - 8px); box-sizing:border-box; padding:6px; border:1px solid var(--cc-tool-border); border-radius:7px; background:var(--cc-tool-surface); box-shadow:0 6px 24px #0005; }
.cc-chart .cc-rail-overflow-menu button { display:flex; align-items:center; gap:9px; width:100%; min-height:30px; border:0; padding:5px 8px; text-align:left; background:transparent; }
.cc-rail-overflow-menu svg { width:18px; height:18px; flex-shrink:0; }

.cc-tool-status {
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:4px 12px;
  padding:8px 10px;
  min-height:32px;
  border-top:1px solid var(--cc-tool-border);
  color:var(--cc-tool-muted);
  font-size:calc(11px - var(--cc-font-reduction,0px));
  line-height:1.5;
}

.cc-tool-status strong {
  color:var(--cc-tool-accent);
}

.cc-tooltip {
  position:absolute;
  box-sizing:border-box;
  z-index:30;
  max-width:calc(100% - 8px);
  padding:7px 10px;
  border:1px solid var(--cc-tool-border);
  border-radius:5px;
  background:var(--cc-tooltip-surface);
  color:var(--cc-tooltip-text);
  font-size:calc(12px - var(--cc-font-reduction,0px));
  line-height:1.4;
  pointer-events:none;
  box-shadow:0 4px 16px #0003;
}

.cc-tooltip[hidden] {
  display:none;
}

.cc-chart [hidden] { display:none !important; }
.cc-drawing-bar {
  position:absolute; z-index:20; display:flex; align-items:center; gap:3px;
  width:max-content; max-width:calc(100% - 8px); padding:3px; border:1px solid var(--cc-tool-border);
  border-radius:8px; background:var(--cc-tool-surface); color:var(--cc-tooltip-text);
  box-shadow:0 6px 24px #0005; flex-wrap:nowrap; box-sizing:border-box;
}
.cc-drawing-bar > :is(button,label,details) { flex:0 0 auto; }
.cc-drawing-bar strong { display:none; }
.cc-drawing-bar button { display:inline-flex; align-items:center; justify-content:center; padding:4px; min-height:26px; }
.cc-drawing-bar svg { width:16px; height:16px; pointer-events:none; }
.cc-drawing-bar [data-editor=move] { cursor:move; touch-action:none; font-size:calc(16px - var(--cc-font-reduction,0px)); line-height:16px; }
.cc-drawing-bar select { min-width:0; max-width:96px; height:26px; padding:3px 4px; font-size:calc(11px - var(--cc-font-reduction,0px)); }
.cc-drawing-bar [data-editor-width] { width:56px; }
.cc-drawing-bar [data-editor-style] { width:96px; }
.cc-quick-color { display:flex; flex-direction:row; align-items:center; gap:0; margin:0; padding:0; line-height:0; font-size:0; }
.cc-quick-color input { box-sizing:border-box; width:26px; height:26px; padding:3px; border:1px solid #2a3e5b; border-radius:5px; cursor:pointer; background:#14243b; }
.cc-quick-color input::-webkit-color-swatch-wrapper { padding:0; }
.cc-quick-color input::-webkit-color-swatch { border:0; border-radius:2px; }
.cc-quick-color input::-moz-color-swatch { border:0; border-radius:2px; }
.cc-drawing-more { position:relative; }
.cc-drawing-more summary { display:flex; align-items:center; justify-content:center; box-sizing:border-box; min-width:24px; height:26px; padding:3px; cursor:pointer; list-style:none; }
.cc-drawing-more > div { position:absolute; right:0; top:100%; width:220px; max-height:230px; overflow:auto; padding:6px; border:1px solid var(--cc-tool-border); background:var(--cc-tool-surface); box-shadow:0 6px 24px #0004; border-radius:6px; }
.cc-drawing-more button { display:block; width:100%; text-align:left; margin:3px 0; }
.cc-drawing-bar button[aria-pressed=true] { color:var(--cc-tool-accent); border-color:var(--cc-tool-accent); }
.cc-drawing-dialog {
  width:min(490px,calc(100vw - 24px)); max-height:calc(100dvh - 28px); padding:0; margin:auto;
  border:1px solid var(--cc-tool-border); border-radius:12px; background:var(--cc-tool-surface);
  color:var(--cc-tooltip-text); font:calc(13px - var(--cc-font-reduction,0px)) system-ui,sans-serif; box-shadow:0 18px 70px #0007; box-sizing:border-box;
}
.cc-drawing-dialog[open] { display:flex; flex-direction:column; }
.cc-drawing-dialog::backdrop { background:#02081599; }
.cc-drawing-dialog form { display:flex; flex-direction:column; width:100%; min-height:0; max-height:inherit; margin:0; }
.cc-drawing-dialog header { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:17px 18px 12px; }
.cc-drawing-dialog h2 { font-size:calc(17px - var(--cc-font-reduction,0px)); margin:0; font-weight:600; }
.cc-drawing-dialog h3 { grid-column:1/-1; font-size:calc(13px - var(--cc-font-reduction,0px)); margin:12px 0 0; }
.cc-drawing-dialog header button { font-size:calc(22px - var(--cc-font-reduction,0px)); line-height:1; }
.cc-drawing-dialog nav { display:flex; gap:4px; padding:0 12px; border-bottom:1px solid var(--cc-tool-border); overflow-x:auto; flex-shrink:0; }
.cc-drawing-dialog nav button { border:0; border-radius:0; padding:11px 8px; background:transparent; border-bottom:2px solid transparent; white-space:nowrap; }
.cc-drawing-dialog nav button[aria-selected=true] { border-bottom-color:var(--cc-tool-accent); color:var(--cc-tool-accent); }
.cc-property-body { padding:18px; overflow-y:auto; min-height:0; }
.cc-property-body section { display:grid; grid-template-columns:1fr 1fr; gap:14px; align-items:start; }
.cc-property-body p { grid-column:1/-1; font-size:calc(12px - var(--cc-font-reduction,0px)); line-height:1.6; color:var(--cc-tool-muted); margin:0; }
.cc-property-field { display:grid; gap:7px; min-width:0; font-size:calc(12px - var(--cc-font-reduction,0px)); color:var(--cc-tooltip-text); }
.cc-property-field > span { grid-column:1/-1; }
.cc-property-field input,.cc-property-field textarea,.cc-property-field select { min-width:0; width:100%; box-sizing:border-box; border:1px solid var(--cc-tool-border); background:var(--cc-tool-surface); color:var(--cc-tooltip-text); border-radius:5px; font:inherit; padding:8px; }
.cc-property-field textarea { resize:vertical; min-height:90px; }
.cc-property-field:has(textarea) { grid-column:1/-1; }
.cc-property-field:has([type=checkbox]) { display:flex; flex-direction:row; align-items:center; justify-content:space-between; min-height:32px; }
.cc-property-field:has([type=checkbox]) > span { text-align:left; }
.cc-property-field input[type=checkbox] { width:18px; height:18px; flex-shrink:0; accent-color:var(--cc-tool-accent); }
.cc-property-field:has([type=color]) { grid-template-columns:38px minmax(0,1fr); }
.cc-property-field input[type=color] { width:38px; height:34px; padding:3px; cursor:pointer; }
.cc-property-field .cc-color-hex { font-family:ui-monospace,monospace; }
.cc-fib-level { grid-column:1/-1; display:grid; grid-template-columns:72px minmax(110px,1fr) 58px 30px; gap:8px; padding:10px 0; border-bottom:1px solid var(--cc-tool-border); align-items:end; }
.cc-fib-level .cc-property-field:has([type=checkbox]) { flex-direction:column; gap:10px; }
.cc-fib-level button { align-self:center; }
.cc-editor-error { color:#f27a8c; font-size:calc(12px - var(--cc-font-reduction,0px)); padding:0 18px; margin:0; }
.cc-editor-error:empty { display:none; }
.cc-drawing-dialog footer { display:flex; justify-content:flex-end; gap:8px; padding:14px 18px; margin:0; border-top:1px solid var(--cc-tool-border); flex-shrink:0; }
.cc-drawing-dialog .cc-primary { color:var(--cc-tool-accent); border-color:var(--cc-tool-accent); }
.cc-object-list { padding:0 18px 18px; overflow:auto; }
.cc-object-row { display:flex; flex-wrap:wrap; gap:6px; padding:12px 0; border-top:1px solid var(--cc-tool-border); }
.cc-object-row > button:first-child { flex-basis:100%; text-align:left; color:var(--cc-tool-accent); }
.cc-chart[data-theme=light] .cc-drawing-bar button,.cc-chart[data-theme=light] .cc-drawing-dialog button { background:#fff; color:#334155; border-color:#cbd5e1; }
.cc-chart[data-theme=light] .cc-quick-color input { background:#fff; border-color:#cbd5e1; }
.cc-chart[data-theme=light] .cc-drawing-dialog nav button[aria-selected=true] { color:var(--cc-tool-accent); border-bottom-color:var(--cc-tool-accent); }
@media(max-width:600px) {
  .cc-drawing-bar { top:auto !important; left:4px !important; bottom:36px; right:auto; max-width:calc(100% - 8px); gap:3px; }
  .cc-drawing-bar strong,.cc-drawing-bar [data-editor=move] { display:none; }
  .cc-drawing-bar button { min-height:34px; min-width:30px; }
  .cc-drawing-bar select { max-width:90px; }
  .cc-drawing-bar [data-editor-width] { width:50px; }
  .cc-drawing-bar [data-editor-style] { width:78px; }
  .cc-drawing-bar select,.cc-drawing-more summary { height:34px; }
  .cc-quick-color input { width:30px; height:34px; }
  .cc-drawing-more > div { top:auto; bottom:100%; }
  .cc-property-body section { grid-template-columns:1fr; }
  .cc-fib-level { grid-template-columns:60px minmax(90px,1fr) 42px 28px; gap:5px; }
  .cc-property-body { padding:14px; }
}

.cc-stage canvas {
  display:block;
  width:100%;
  height:100%;
  touch-action:none;
  cursor:grab
}

.cc-message {
  position:absolute;
  inset:40% 15% auto;
  background:#172a45;
  padding:14px;
  border-radius:8px;
  text-align:center;
  pointer-events:none
}

.cc-message[hidden] {
  display:none
}

.cc-loading {
  position:absolute; z-index:2; left:calc(50% - 48px); top:50%; transform:translate(-50%,-50%);
  display:grid; place-items:center; width:80px; height:64px; box-sizing:border-box;
  border:1px solid var(--cc-tool-border); border-radius:12px;
  background:var(--cc-tool-surface); color:var(--cc-tool-accent); pointer-events:none;
  box-shadow:0 6px 24px #0003;
}
.cc-loading[hidden] { display:none !important; }
.cc-loading-candles { display:flex; align-items:center; justify-content:center; gap:5px; height:40px; }
.cc-loading-candles i { position:relative; display:block; width:5px; height:16px; border-radius:1px; background:currentColor; animation:cc-loading-wave 1.2s ease-in-out infinite; }
.cc-loading-candles i::before { content:''; position:absolute; width:1px; left:2px; top:-5px; bottom:-5px; background:currentColor; }
.cc-loading-candles i:nth-child(2) { height:22px; animation-delay:.12s; }
.cc-loading-candles i:nth-child(3) { height:12px; animation-delay:.24s; }
.cc-loading-candles i:nth-child(4) { height:24px; animation-delay:.36s; }
.cc-loading-candles i:nth-child(5) { height:18px; animation-delay:.48s; }
.cc-loading-label { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
@keyframes cc-loading-wave { 0%,100% { transform:scaleY(.55); opacity:.35; } 50% { transform:scaleY(1); opacity:1; } }
@media(prefers-reduced-motion:reduce) { .cc-loading-candles i { animation:none; opacity:.8; } }

.cc-studies {
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  flex-shrink:0;
  gap:6px;
  padding:0 9px
}

.cc-studies:not(:empty) {
  padding:4px 9px;
  border-top:1px solid #22324a
}

.cc-chart[data-theme=light] {
  --cc-tool-accent:#08775e;
  --cc-tool-selected:#d9f0eb;
  --cc-tool-muted:#53667f;
  --cc-tool-border:#dce3ed;
  --cc-tool-surface:#fff;
  --cc-tooltip-surface:#fff;
  --cc-tooltip-text:#25354c;
  background:#f8fafc;
  color:#334155
}

.cc-chart[data-theme=light] .cc-toolbar button,.cc-chart[data-theme=light] .cc-studies button,.cc-chart[data-theme=light] select {
  background:#fff;
  color:#334155;
  border-color:#cbd5e1
}

@container (max-width:600px) {
  .cc-toolbar .cc-series-trigger > span:first-of-type,.cc-toolbar .cc-indicator-trigger > span { display:none; }
  .cc-toolbar .cc-series-trigger,.cc-toolbar .cc-indicator-trigger { padding:5px; }
  .cc-chart .cc-toolbar { gap:3px; padding:5px; }
  .cc-chart .cc-toolbar .cc-icon-button { width:30px; min-width:30px; height:32px; padding:4px; }
  .cc-market-header { padding:5px 7px; }
  .cc-tool-status [data-cc-tool-help] { display:none; }
  .cc-tool-status { min-height:18px; padding:5px 7px; }
  .cc-toolbar { justify-content:flex-end; }
  .cc-toolbar-spacer { display:none; }
  .cc-chart .cc-toolbar .cc-mobile-control { display:inline-flex; justify-content:center; align-items:center; width:44px; min-width:44px; height:44px; padding:9px; }
  .cc-toolbar-tools { display:none; flex-basis:100%; align-items:center; justify-content:space-between; gap:4px; padding-top:5px; border-top:1px solid var(--cc-tool-border); }
  .cc-toolbar-tools[data-open=true] { display:flex; }
  .cc-chart .cc-toolbar .cc-toolbar-tools > button { width:44px; min-width:44px; height:44px; justify-content:center; padding:8px; }
  .cc-chart .cc-toolbar-tools [data-cc-action="redo"] { display:none; }
  .cc-chart .cc-toolbar-tools [data-cc-action="mobile-fullscreen"] { display:inline-flex; }
  .cc-toolbar-secondary { display:none; position:absolute; z-index:35; right:6px; width:240px; max-width:calc(100% - 12px); padding:6px; border:1px solid var(--cc-tool-border); border-radius:10px; background:var(--cc-tool-surface); box-shadow:0 10px 35px #0005; overflow:auto; }
  .cc-toolbar-secondary[data-open=true] { display:flex; flex-direction:column; }
  .cc-chart .cc-toolbar .cc-toolbar-secondary .cc-icon-button { display:flex; align-items:center; justify-content:flex-start; gap:12px; width:100%; min-height:44px; height:auto; padding:10px; border:0; background:transparent; text-align:left; }
  .cc-toolbar-secondary .cc-action-caption { display:inline; }
  .cc-chart .cc-toolbar .cc-toolbar-secondary [data-cc-action="fullscreen"] { display:none; }
  .cc-chart [data-cc-mobile-price]:not([hidden]) { display:block; font-size:calc(12px - var(--cc-font-reduction,0px)); font-variant-numeric:tabular-nums; }
  .cc-chart .cc-mobile-ohlc:not([hidden]) { display:inline-flex; align-items:center; gap:4px; min-height:36px; margin-left:auto; padding:4px 6px; border:0; background:transparent; color:var(--cc-tool-muted); font-size:calc(11px - var(--cc-font-reduction,0px)); }
  .cc-mobile-ohlc svg { width:14px; height:14px; }
  .cc-mobile-ohlc[aria-expanded=true] svg { transform:rotate(180deg); }
  .cc-chart .cc-mobile-control[aria-expanded=true] { background:var(--cc-tool-selected); color:var(--cc-tool-accent); border-color:var(--cc-tool-accent); }
  .cc-market-header [data-cc-title] { order:2; flex-basis:100%; }
  .cc-market-header:not([data-ohlc-open=true]) .cc-ohlc { display:none; }
  .cc-chart:has(.terminal-context) .cc-market-header [data-cc-instrument] { display:none; }
  .cc-chart:has(.terminal-context) .cc-market-header:not([data-ohlc-open=true]) [data-cc-title] { display:none; }
}

@media(max-width:600px) {
  .cc-toolbar strong {
    flex-basis:100%
  }
  .cc-toolbar {
    gap:4px;
    padding:6px
  }
  .cc-chart {
    border-radius:0
  }
  .cc-toolbar select {
    max-width:148px
  }
  .cc-tool-status [data-cc-tool-help] {
    display:none;
  }
}

@media(pointer:coarse) {
  .cc-tool-rail {
    width:100%;
    padding:4px 8px;
  }
  .cc-chart .cc-tool-button,.cc-chart .cc-icon-button {
    width:44px;
    height:44px;
  }
  .cc-tool-option { min-height:44px; }
}

/* Shared terminal theme; the light palette keeps its own contrast and surfaces. */
.cc-chart[data-theme=dark] .cc-toolbar { background:linear-gradient(110deg,#081a3b,#071630); padding:10px; gap:7px; }
.cc-chart[data-theme=dark] button,.cc-chart[data-theme=dark] select { background:#0a2045; border-color:#233d70; color:#dfe7ff; border-radius:7px; }
.cc-chart[data-theme=dark] button:hover:not(:disabled) { background:#142b59; border-color:#756aff; }
.cc-chart[data-theme=dark] .cc-market-header { background:#071a39; padding:9px 14px; }
.cc-chart[data-theme=dark] .cc-market-header [data-cc-title] { font-size:calc(12px - var(--cc-font-reduction,0px)); }
.cc-chart[data-theme=dark] .cc-tool-rail { background:linear-gradient(110deg,#081e42,#061731); padding:4px 8px; }
.cc-chart[data-theme=dark] .cc-tool-button,.cc-chart[data-theme=dark] .cc-tool-rail .cc-icon-button { background:transparent; border-color:transparent; color:#a5b7db; }
.cc-chart[data-theme=dark] .cc-tool-button:hover,.cc-chart[data-theme=dark] .cc-tool-rail .cc-icon-button:hover { background:#172b60; border-color:#4656a4; color:#eeeaff; }
.cc-chart[data-theme=dark] .cc-tool-button[aria-pressed=true],.cc-chart[data-theme=dark] .cc-tool-trigger[aria-expanded=true] { background:linear-gradient(140deg,#5143ec,#2828a5); border-color:#8f83ff; color:white; box-shadow:0 0 12px #6556ff40,inset 0 0 8px #9a8aff25; }
.cc-chart[data-theme=dark] .cc-tool-option { background:transparent; border-color:transparent; }
.cc-chart[data-theme=dark] .cc-tool-menu,.cc-chart[data-theme=dark] .cc-series-menu,.cc-chart[data-theme=dark] .cc-drawing-dialog { box-shadow:0 12px 40px #0007,0 0 16px #5249dd14; }
.cc-chart[data-theme=dark] .cc-drawing-bar { background:#0b2045ee; border-color:#43589b; box-shadow:0 8px 25px #0005; }
.cc-chart[data-theme=dark] .cc-tool-status { background:#071832; border-color:#203b70; }
.cc-chart[data-theme=dark] .cc-studies:not(:empty) { background:#071832; border-color:#203b70; }
.cc-chart[data-theme=dark] .cc-tooltip { border:1px solid #5260a3; box-shadow:0 5px 18px #0006; }
.cc-chart[data-theme=dark] :focus-visible { outline-color:#b0a4ff; }

/* Drawing properties: visual tabs, compact levels and an isolated live preview. */
.cc-chart .cc-properties-dialog { width:min(540px,calc(100vw - 24px)); max-height:calc(100dvh - 24px); overflow:hidden; }
.cc-properties-dialog > form { max-height:calc(100dvh - 26px); }
.cc-properties-dialog header { flex-shrink:0; padding:14px 18px 10px; }
.cc-properties-dialog .cc-property-subtitle { font-size:calc(12px - var(--cc-font-reduction,0px)); color:var(--cc-tool-muted); margin:3px 0 0; }
.cc-drawing-preview { flex-shrink:0; position:relative; margin:0 18px 10px; border:1px solid var(--cc-tool-border); border-radius:8px; overflow:hidden; }
.cc-drawing-preview > span { position:absolute; right:7px; bottom:5px; background:var(--cc-tool-surface); color:var(--cc-tool-muted); padding:2px 5px; border-radius:4px; font-size:calc(11px - var(--cc-font-reduction,0px)); pointer-events:none; }
.cc-drawing-preview canvas { display:block; width:100%; height:120px; }
.cc-chart .cc-properties-dialog nav { display:flex; gap:5px; padding:0 14px 8px; overflow:visible; }
.cc-chart .cc-properties-dialog nav button { flex:1; display:flex; align-items:center; justify-content:center; gap:6px; min-width:0; min-height:38px; padding:7px; border:1px solid transparent; border-radius:7px; background:transparent; }
.cc-properties-dialog nav svg { width:17px; height:17px; flex-shrink:0; }
.cc-chart .cc-properties-dialog nav button[aria-selected=true] { color:var(--cc-tool-accent); border-color:var(--cc-tool-accent); background:var(--cc-tool-selected); }
.cc-properties-dialog .cc-property-body { flex:1 1 auto; max-height:min(480px,calc(100dvh - 310px)); padding:14px 18px; overscroll-behavior:contain; scrollbar-width:thin; }
.cc-properties-dialog [data-panel] { gap:12px; }
.cc-properties-dialog .cc-property-field { gap:5px; align-items:center; }
.cc-properties-dialog [data-field="properties.visibleIntervals"] { grid-column:1/-1; }
.cc-properties-dialog .cc-property-field input,.cc-properties-dialog .cc-property-field select { min-height:36px; font-size:calc(13px - var(--cc-font-reduction,0px)); }
.cc-properties-dialog .cc-property-field textarea { min-height:65px; font-size:calc(14px - var(--cc-font-reduction,0px)); }
.cc-properties-dialog .cc-percentage-field { grid-column:1/-1; grid-template-columns:minmax(0,1fr) auto; }
.cc-properties-dialog .cc-percentage-field > span { grid-column:1; }
.cc-properties-dialog .cc-percentage-field output { grid-column:2; grid-row:1; color:var(--cc-tooltip-text); font-size:calc(12px - var(--cc-font-reduction,0px)); font-variant-numeric:tabular-nums; }
.cc-properties-dialog .cc-percentage-field input[type=range] { grid-column:1/-1; min-height:22px; padding:0; margin:0; border:0; accent-color:var(--cc-tool-accent); }
.cc-properties-dialog .cc-color-field { grid-column:1/-1; grid-template-columns:44px minmax(0,1fr); }
.cc-properties-dialog .cc-color-field > span:first-child { grid-column:1/-1; }
.cc-properties-dialog .cc-color-field input[type=color] { width:44px; height:36px; padding:3px; }
.cc-properties-dialog .cc-color-name { grid-column:2; grid-row:2; color:var(--cc-tool-muted); font-size:calc(12px - var(--cc-font-reduction,0px)); }
.cc-properties-dialog .cc-color-options { grid-column:1/-1; min-width:0; }
.cc-properties-dialog .cc-color-options summary { color:var(--cc-tool-muted); font-size:calc(12px - var(--cc-font-reduction,0px)); cursor:pointer; padding:5px 0; }
.cc-color-swatches { display:grid; grid-template-columns:repeat(8,minmax(0,1fr)); gap:5px; margin:5px 0 10px; }
.cc-chart .cc-color-swatches button { padding:4px; min-height:34px; display:flex; justify-content:center; align-items:center; }
.cc-color-swatches button > span { display:block; width:22px; height:22px; border-radius:4px; box-shadow:inset 0 0 0 1px #80808055; }
.cc-chart .cc-color-swatches button[aria-pressed=true] { border-color:var(--cc-tool-accent); outline:1px solid var(--cc-tool-accent); }
.cc-color-code { display:flex; align-items:center; gap:10px; color:var(--cc-tool-muted); font-size:calc(12px - var(--cc-font-reduction,0px)); }
.cc-property-field .cc-color-code .cc-color-hex { width:130px; max-width:100%; min-width:0; font-family:ui-monospace,monospace; }
.cc-properties-dialog .cc-fib-levels { grid-column:1/-1; min-width:0; }
.cc-properties-dialog .cc-sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.cc-properties-dialog .cc-fib-columns,.cc-properties-dialog .cc-fib-level { display:grid; grid-template-columns:minmax(75px,1fr) 56px 44px 34px; gap:10px; align-items:center; }
.cc-properties-dialog .cc-fib-columns { color:var(--cc-tool-muted); font-size:calc(11px - var(--cc-font-reduction,0px)); margin-bottom:3px; }
.cc-properties-dialog .cc-fib-level { padding:4px 0; }
.cc-properties-dialog .cc-fib-level .cc-property-field { grid-column:auto; display:block; }
.cc-properties-dialog .cc-fib-level .cc-property-field > span { position:absolute; width:1px; height:1px; padding:0; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.cc-properties-dialog .cc-fib-level .cc-property-field:has([type=checkbox]) { display:flex; justify-content:center; min-height:36px; }
.cc-properties-dialog .cc-fib-level input[type=color] { width:40px; min-height:32px; height:32px; }
.cc-properties-dialog .cc-fib-level button { min-height:32px; padding:4px; font-size:calc(18px - var(--cc-font-reduction,0px)); }
.cc-properties-dialog .cc-property-group,.cc-properties-dialog .cc-property-advanced { grid-column:1/-1; min-width:0; }
.cc-properties-dialog .cc-property-advanced { border-top:1px solid var(--cc-tool-border); }
.cc-properties-dialog .cc-property-advanced > summary { padding:12px 0; color:var(--cc-tool-muted); font-size:calc(12px - var(--cc-font-reduction,0px)); cursor:pointer; }
.cc-properties-dialog .cc-property-grid { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:12px; min-width:0; padding-bottom:10px; }
.cc-properties-dialog .cc-property-grid > p { grid-column:1/-1; }
.cc-properties-dialog .cc-property-advanced .cc-color-swatches { grid-template-columns:repeat(4,minmax(0,1fr)); }
.cc-properties-dialog .cc-property-segments { display:flex; gap:5px; min-width:0; }
.cc-chart .cc-property-segments button { flex:1; padding:7px 5px; font-size:calc(12px - var(--cc-font-reduction,0px)); min-height:36px; }
.cc-chart .cc-property-segments button[aria-pressed=true] { background:var(--cc-tool-selected); color:var(--cc-tool-accent); border-color:var(--cc-tool-accent); }
.cc-properties-dialog .cc-property-field:has(.cc-property-segments) { grid-column:1/-1; }
.cc-properties-dialog .cc-size-field { grid-template-columns:62px minmax(0,1fr); }
.cc-properties-dialog .cc-size-field .cc-property-segments { grid-column:2; grid-row:2; }
.cc-properties-dialog footer { padding:12px 18px; }
.cc-properties-dialog .cc-primary { background:var(--cc-tool-selected); }
@media(max-width:600px) {
  .cc-chart .cc-properties-dialog { width:calc(100vw - 16px); max-height:calc(100dvh - 16px); border-radius:10px; }
  .cc-properties-dialog header { padding:12px; }
  .cc-properties-dialog header button { min-width:40px; min-height:40px; }
  .cc-drawing-preview { margin:0 12px 8px; }
  .cc-drawing-preview canvas { height:100px; }
  .cc-chart .cc-properties-dialog nav { gap:3px; padding:0 8px 8px; }
  .cc-chart .cc-properties-dialog nav button { font-size:calc(12px - var(--cc-font-reduction,0px)); padding:5px 3px; min-height:44px; }
  .cc-properties-dialog nav:has([data-tab=position]:not([hidden])) svg { display:none; }
  .cc-properties-dialog .cc-property-body { padding:12px; }
  .cc-properties-dialog .cc-property-body section,.cc-properties-dialog .cc-property-grid { grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:12px 10px; }
  .cc-properties-dialog .cc-property-field input:not([type=color]):not([type=checkbox]):not([type=range]),.cc-properties-dialog .cc-property-field select { font-size:calc(16px - var(--cc-font-reduction,0px)); min-height:44px; }
  .cc-properties-dialog .cc-property-field textarea { font-size:calc(16px - var(--cc-font-reduction,0px)); }
  .cc-properties-dialog .cc-color-field input[type=color] { min-height:44px; height:44px; }
  .cc-chart .cc-color-swatches button { min-height:44px; }
  .cc-color-swatches { grid-template-columns:repeat(4,minmax(0,1fr)); }
  .cc-properties-dialog .cc-fib-columns,.cc-properties-dialog .cc-fib-level { grid-template-columns:minmax(64px,1fr) 48px 44px 44px; gap:6px; }
  .cc-properties-dialog .cc-fib-level .cc-property-field:has([type=checkbox]),.cc-properties-dialog .cc-fib-level button { min-height:44px; }
  .cc-properties-dialog .cc-fib-level input[type=checkbox] { width:22px; height:22px; }
  .cc-chart .cc-property-segments button { font-size:calc(11px - var(--cc-font-reduction,0px)); padding:5px 3px; min-height:44px; }
  .cc-properties-dialog .cc-property-grid:has([name="points.0.time"]) { grid-template-columns:minmax(0,1fr); }
  .cc-properties-dialog footer button { min-height:44px; }
}
@media(max-width:380px) { .cc-properties-dialog nav svg { display:none; } .cc-chart .cc-properties-dialog nav button { font-size:calc(11px - var(--cc-font-reduction,0px)); } }
@media(max-height:500px) { .cc-drawing-preview,.cc-property-subtitle { display:none; } .cc-properties-dialog .cc-property-body { max-height:calc(100dvh - 180px); } }

/* General chart settings use the same visual-tab pattern as drawing properties. */
.cc-chart .cc-settings-visual { width:min(620px,calc(100vw - 24px)); max-width:calc(100vw - 24px); max-height:calc(100dvh - 24px); overflow:hidden; }
.cc-settings-visual > form { max-height:calc(100dvh - 26px); }
.cc-settings-visual header { flex-shrink:0; padding:14px 18px 10px; }
.cc-settings-visual header p { margin:3px 0 0; color:var(--cc-tool-muted); font-size:calc(12px - var(--cc-font-reduction,0px)); }
.cc-settings-preview { position:relative; flex-shrink:0; margin:0 18px 12px; border:1px solid var(--cc-tool-border); border-radius:8px; overflow:hidden; background:var(--cc-tool-surface); }
.cc-settings-preview [data-settings-preview-title] { display:flex; flex-wrap:wrap; align-items:center; gap:3px 7px; padding:6px 8px; min-height:25px; color:var(--cc-tool-muted); font-size:calc(11px - var(--cc-font-reduction,0px)); font-variant-numeric:tabular-nums; }
.cc-settings-preview canvas { display:block; width:100%; height:150px; }
.cc-settings-preview > span { display:block; text-align:right; padding:3px 7px; color:var(--cc-tool-muted); font-size:calc(11px - var(--cc-font-reduction,0px)); }
.cc-chart .cc-settings-visual nav { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:5px; flex-shrink:0; padding:0 14px 10px; overflow:visible; }
.cc-chart .cc-settings-visual nav button { display:flex; align-items:center; justify-content:center; gap:6px; min-width:0; min-height:38px; padding:7px; border:1px solid transparent; border-radius:7px; background:transparent; }
.cc-settings-visual nav svg { width:18px; height:18px; flex-shrink:0; }
.cc-chart .cc-settings-visual nav button[aria-selected=true] { border-color:var(--cc-tool-accent); color:var(--cc-tool-accent); background:var(--cc-tool-selected); }
.cc-settings-visual .cc-settings-sections { flex:1 1 auto; padding:14px 18px; max-height:min(480px,calc(100dvh - 350px)); overscroll-behavior:contain; scrollbar-width:thin; }
.cc-settings-visual .cc-settings-sections label { display:flex; flex-direction:column; align-items:stretch; justify-content:flex-start; gap:5px; margin:0 0 14px; font-size:calc(12px - var(--cc-font-reduction,0px)); }
.cc-settings-visual .cc-settings-sections input:not([type=color]):not([type=checkbox]):not([type=range]),.cc-settings-visual .cc-settings-sections select { width:100%; min-height:38px; padding:8px; font-size:calc(13px - var(--cc-font-reduction,0px)); }
.cc-settings-visual .cc-setting-grid { grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:0 14px; }
.cc-settings-visual .cc-settings-sections label.cc-settings-color { flex-direction:row; align-items:center; justify-content:space-between; gap:9px; }
.cc-settings-visual .cc-settings-color input[type=color] { flex-shrink:0; width:44px; height:38px; padding:3px; }
.cc-settings-visual .cc-settings-sections label.cc-setting-check { flex-direction:row; align-items:center; gap:9px; min-height:36px; margin:0 0 8px; font-size:calc(13px - var(--cc-font-reduction,0px)); }
.cc-settings-visual .cc-settings-sections input[type=checkbox] { width:18px; height:18px; }
.cc-settings-visual .cc-settings-link { border-bottom:1px solid var(--cc-tool-border); padding:5px 0 13px; }
.cc-settings-link small { display:block; color:var(--cc-tool-muted); margin-top:3px; font-size:calc(11px - var(--cc-font-reduction,0px)); }
.cc-settings-visual details { border-top:1px solid var(--cc-tool-border); }
.cc-settings-visual summary { color:var(--cc-tool-muted); font-size:calc(12px - var(--cc-font-reduction,0px)); padding:12px 0; cursor:pointer; }
.cc-settings-visual .cc-settings-sections label.cc-settings-range { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; }
.cc-settings-range output { font-variant-numeric:tabular-nums; }
.cc-settings-range input[type=range] { grid-column:1/-1; width:100%; min-height:24px; margin:3px 0; padding:0; accent-color:var(--cc-tool-accent); }
.cc-settings-visual footer { padding:12px 18px; }
.cc-settings-visual footer > span { flex:1; }
.cc-settings-visual .cc-primary { background:var(--cc-tool-selected); }
@media(max-width:600px) {
  .cc-chart .cc-settings-visual { width:calc(100vw - 16px); max-width:calc(100vw - 16px); max-height:calc(100dvh - 16px); }
  .cc-settings-visual header { padding:12px; }
  .cc-settings-visual header button { min-width:40px; min-height:40px; }
  .cc-settings-preview { margin:0 12px 10px; }
  .cc-settings-preview canvas { height:125px; }
  .cc-chart .cc-settings-visual nav { gap:3px; padding:0 8px 8px; }
  .cc-chart .cc-settings-visual nav button { flex-direction:column; gap:3px; padding:5px 3px; min-height:48px; font-size:calc(12px - var(--cc-font-reduction,0px)); }
  .cc-settings-visual .cc-settings-sections { padding:12px; }
  .cc-settings-visual .cc-settings-sections input:not([type=color]):not([type=checkbox]):not([type=range]),.cc-settings-visual .cc-settings-sections select { font-size:calc(16px - var(--cc-font-reduction,0px)); min-height:44px; }
  .cc-settings-visual .cc-setting-grid { gap:0 10px; }
  .cc-settings-visual .cc-settings-color input[type=color] { height:44px; }
  .cc-settings-visual .cc-settings-sections label.cc-setting-check { min-height:44px; }
  .cc-settings-visual .cc-settings-sections input[type=checkbox] { width:22px; height:22px; }
  .cc-settings-visual footer { padding:12px; gap:5px; }
  .cc-settings-visual footer button { min-height:44px; font-size:calc(12px - var(--cc-font-reduction,0px)); }
}
@media(max-height:550px) { .cc-settings-preview,.cc-settings-visual header p { display:none; } .cc-settings-visual .cc-settings-sections { max-height:calc(100dvh - 180px); } }
@media(min-width:601px) and (min-height:551px) and (max-height:760px) { .cc-settings-preview canvas { height:120px; } .cc-settings-visual .cc-settings-sections { max-height:calc(100dvh - 320px); } }

/* Compact indicator chips: configuration, visibility and removal are separate actions. */
.cc-chart .cc-study-chip { display:inline-flex; align-items:center; gap:1px; min-width:0; max-width:100%; padding:2px; border:1px solid var(--cc-tool-border); border-radius:8px; background:var(--cc-tool-surface); }
.cc-chart .cc-studies .cc-study-chip button { display:inline-flex; align-items:center; justify-content:center; gap:6px; min-width:26px; min-height:26px; height:26px; padding:4px; margin:0; border:0; border-radius:5px; background:transparent; color:var(--cc-tool-muted); line-height:1; }
.cc-chart .cc-studies .cc-study-chip .cc-study-name { min-width:0; padding:4px 6px; color:inherit; font-size:calc(12px - var(--cc-font-reduction,0px)); }
.cc-study-name span { min-width:0; max-width:180px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.cc-study-chip svg { width:14px; height:14px; flex-shrink:0; }
.cc-study-name > svg { color:var(--cc-tool-accent); }
.cc-chart .cc-studies .cc-study-chip button:hover { color:inherit; background:var(--cc-tool-selected); }
.cc-chart .cc-studies .cc-study-chip .cc-study-remove:hover { color:#e45375; }
.cc-chart .cc-studies .cc-study-chip[data-hidden=true] .cc-study-name { color:var(--cc-tool-muted); }
.cc-chart .cc-studies .cc-study-chip[data-hidden=true] .cc-study-toggle { color:var(--cc-tool-accent); background:var(--cc-tool-selected); }
.cc-studies-label,.cc-studies-count { color:var(--cc-tool-muted); font-size:calc(11px - var(--cc-font-reduction,0px)); white-space:nowrap; }
.cc-studies-label { margin-right:2px; }
.cc-studies-count { margin-left:auto; }
.cc-study-notice { display:inline-flex; flex-wrap:wrap; align-items:center; gap:6px; color:var(--cc-tool-muted); font-size:calc(11px - var(--cc-font-reduction,0px)); }
.cc-chart .cc-studies .cc-study-undo { min-height:26px; padding:4px 6px; margin:0; border:0; background:transparent; color:var(--cc-tool-accent); font-size:calc(12px - var(--cc-font-reduction,0px)); }
.cc-study-colors { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.cc-study-form .cc-study-colors label { min-width:0; }
.cc-study-form .cc-study-colors input { width:44px; min-width:44px; height:30px; padding:3px; }
.cc-study-form input[type=checkbox] { width:16px; height:16px; accent-color:var(--cc-tool-accent); }
.cc-study-form select { min-width:120px; }
.cc-indicator-dialog .cc-study-form select { font:inherit; padding:6px; border:1px solid var(--cc-tool-border); border-radius:5px; background:var(--cc-tool-surface); color:var(--cc-tooltip-text); }
/* Keep the catalogue quiet in both themes; only the current selection is outlined. */
.cc-chart[data-theme] .cc-indicator-results button { background:transparent; border-color:transparent; }
.cc-chart[data-theme] .cc-indicator-results button:hover:not(:disabled):not([aria-pressed=true]) { background:var(--cc-tool-selected); border-color:transparent; }
.cc-chart[data-theme] .cc-indicator-results button[aria-pressed=true] { background:var(--cc-tool-selected); border-color:var(--cc-tool-accent); }
@container(max-width:400px) { .cc-studies-label { display:none; } .cc-study-name span { max-width:120px; } }
@media(pointer:coarse) {
  .cc-chart .cc-studies .cc-study-chip button { min-width:44px; min-height:44px; height:44px; }
  .cc-chart .cc-studies .cc-study-chip .cc-study-name { min-width:0; }
  .cc-chart .cc-studies .cc-study-undo { min-height:44px; }
  .cc-study-form .cc-study-colors input { height:44px; }
  .cc-study-form select { min-height:44px; font-size:calc(16px - var(--cc-font-reduction,0px)); }
}


/* Compact drawing toolbar above the canvas; market and series controls stay in place. */
.cc-chart .cc-tool-rail .cc-tool-button,.cc-chart .cc-tool-rail .cc-icon-button { width:34px; height:34px; }
.cc-tool-rail svg { width:18px; height:18px; }
.cc-chart .cc-tool-rail button[hidden] { display:none; }
.cc-chart .cc-tool-rail .cc-rail-tools { gap:4px; }
.cc-chart .cc-tool-rail { align-items:center; }
.cc-rail-overflow-menu,.cc-tool-menu { max-height:calc(100% - 16px); overflow-y:auto; overscroll-behavior:contain; }
.cc-polyline-actions { left:6px; }

/* Centered Reverse player; each row has one clear purpose. */
.cc-replay-panel { flex-shrink:0; padding:7px 12px 6px; border-top:1px solid var(--cc-tool-border); background:var(--cc-tool-surface); color:var(--cc-tooltip-text); font:calc(12px - var(--cc-font-reduction,0px)) system-ui; }
.cc-replay-panel[hidden] { display:none; }
.cc-replay-transport { display:grid; grid-template-columns:minmax(0,1fr) auto minmax(0,1fr); align-items:center; gap:12px; }
.cc-chart .cc-replay-panel .cc-replay-speed { display:flex; flex-direction:row; align-items:center; justify-self:start; gap:8px; margin:0; color:var(--cc-tool-muted); }
.cc-chart .cc-replay-panel button,.cc-chart .cc-replay-panel select { min-height:32px; height:32px; padding:4px 9px; font:inherit; }
.cc-chart .cc-replay-panel select { width:72px; min-width:0; }
.cc-replay-buttons { display:flex; align-items:center; justify-content:center; gap:6px; }
.cc-chart .cc-replay-buttons button { display:inline-flex; align-items:center; justify-content:center; width:32px; height:32px; padding:0; }
.cc-chart .cc-replay-buttons svg { width:16px; height:16px; display:block; }
.cc-chart .cc-replay-buttons [data-replay-play] { width:36px; height:36px; border-radius:50%; background:var(--cc-tool-selected); border-color:var(--cc-tool-accent); color:var(--cc-tool-accent); }
.cc-replay-panel [data-replay-exit] { justify-self:end; display:inline-flex; align-items:center; justify-content:center; gap:7px; }
.cc-replay-panel [data-replay-exit] svg { display:block; width:18px; height:18px; }
.cc-replay-timeline { display:flex; align-items:center; gap:10px; margin-top:3px; color:var(--cc-tool-muted); }
.cc-chart .cc-replay-timeline input { flex:1; width:0; min-width:0; height:22px; margin:0; padding:0; accent-color:var(--cc-tool-accent); cursor:ew-resize; }
.cc-replay-info { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:4px 12px; margin-top:3px; padding-top:5px; border-top:1px solid var(--cc-tool-border); color:var(--cc-tool-muted); font-variant-numeric:tabular-nums; }
.cc-replay-info [data-replay-status] { overflow-wrap:anywhere; }
.cc-replay-info [data-replay-count] { white-space:nowrap; margin-left:auto; }
.cc-chart .cc-replay-trigger { flex-shrink:0; width:44px; height:44px; }
.cc-chart .cc-replay-trigger[aria-pressed=true] { background:var(--cc-tool-selected); border-color:var(--cc-tool-accent); color:var(--cc-tool-accent); }
@media(max-width:600px) {
 .cc-replay-panel { padding:6px 8px; }
 .cc-replay-transport { grid-template-columns:60px minmax(0,1fr) 36px; gap:6px; }
 .cc-replay-buttons { gap:4px; min-width:0; }
 .cc-chart .cc-replay-panel .cc-replay-speed { display:flex; flex-direction:row; align-items:center; margin:0; gap:0; }
 .cc-replay-speed > span,.cc-replay-panel [data-replay-exit-label] { display:none; }
 .cc-chart .cc-replay-panel select { font-size:calc(16px - var(--cc-font-reduction,0px)); width:60px; padding:6px; }
 .cc-chart .cc-replay-panel [data-replay-exit] { width:36px; height:36px; padding:0; }
 .cc-chart .cc-replay-buttons button { width:36px; height:36px; }
 .cc-chart .cc-replay-buttons [data-replay-play] { width:40px; height:40px; }
 .cc-chart .cc-replay-panel select { height:36px; }
 .cc-replay-timeline { margin-top:4px; gap:8px; }
 .cc-replay-info { margin-top:0; padding-top:6px; gap:4px 8px; }
 .cc-replay-info { font-size:calc(11px - var(--cc-font-reduction,0px)); }
 .cc-chart .cc-replay-timeline input { height:28px; }
}

.cc-chart .cc-toolbar .cc-replay-trigger { width:34px; height:34px; }
@media(max-width:600px) { .cc-chart .cc-toolbar .cc-replay-trigger { width:44px; height:44px; } }

/* Integrated pages follow dashboard surfaces instead of the laboratory chrome. */
.cc-chart[data-scanner][data-theme] :is(.cc-toolbar,.cc-tool-rail,.cc-market-header,.cc-tool-status,.cc-studies:not(:empty),.cc-drawing-bar) {
  background:var(--cc-tool-surface); color:var(--cc-tooltip-text); border-color:var(--cc-tool-border);
}
.cc-chart[data-scanner][data-theme] :is(button,select) {
  background:var(--cc-tool-surface); color:var(--cc-tooltip-text); border-color:var(--cc-tool-border);
}
.cc-chart[data-scanner][data-theme] button:hover:not(:disabled) {
  background:var(--cc-tool-selected); border-color:var(--cc-tool-accent);
}
.cc-chart[data-scanner][data-theme] :is(.cc-tool-button[aria-pressed=true],.cc-tool-trigger[aria-expanded=true]) {
  background:var(--cc-tool-selected); color:var(--cc-tooltip-text); border-color:var(--cc-tool-accent);
  box-shadow:0 0 10px #62067440;
}
.cc-chart[data-scanner][data-theme] :focus-visible { outline-color:var(--cc-tool-accent); }

/* Stars are sibling buttons: saving a favorite never selects a drawing tool. */
.cc-tool-option-row { display:flex; align-items:center; gap:2px; }
.cc-chart .cc-tool-option-row .cc-tool-option { flex:1; min-width:0; width:auto; }
.cc-chart .cc-favorite-star { display:inline-flex; align-items:center; justify-content:center; flex:0 0 32px; width:32px; min-height:36px; padding:5px; }
.cc-favorite-star svg { width:17px; height:17px; pointer-events:none; }
.cc-chart .cc-favorite-star:is([aria-checked=true],[aria-pressed=true]) { color:var(--cc-tool-accent); }
.cc-favorite-star:is([aria-checked=true],[aria-pressed=true]) svg { fill:currentColor; }
.cc-favorites-bar { position:absolute; z-index:20; box-sizing:border-box; display:flex; align-items:center; gap:2px; padding:4px; border:1px solid var(--cc-tool-border); border-radius:8px; background:var(--cc-tool-surface); box-shadow:0 5px 18px #0005; overflow:hidden; }
.cc-favorites-bar[hidden],.cc-favorites-panel[hidden] { display:none !important; }
.cc-chart .cc-favorites-bar button { display:inline-flex; align-items:center; justify-content:center; width:32px; height:32px; min-height:32px; padding:4px; flex:0 0 32px; }
.cc-chart .cc-favorites-bar [data-cc-favorite-grip] { width:24px; flex-basis:24px; cursor:grab; touch-action:none; font-size:calc(21px - var(--cc-font-reduction,0px)); }
.cc-chart .cc-favorites-bar [data-cc-favorite-grip]:active { cursor:grabbing; }
.cc-favorites-bar svg { width:19px; height:19px; pointer-events:none; }
.cc-chart .cc-favorites-bar button[aria-pressed=true],.cc-chart .cc-favorite-row button[aria-pressed=true] { background:var(--cc-tool-selected); border-color:var(--cc-tool-accent); color:var(--cc-tool-accent); }
.cc-favorites-panel { position:absolute; z-index:42; box-sizing:border-box; width:340px; max-width:calc(100% - 8px); max-height:calc(100% - 8px); padding:10px; border:1px solid var(--cc-tool-border); border-radius:10px; background:var(--cc-tool-surface); color:var(--cc-tooltip-text); box-shadow:0 8px 28px #0007; display:flex; flex-direction:column; gap:8px; }
.cc-favorites-panel header { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.cc-favorites-panel header strong { font-size:calc(13px - var(--cc-font-reduction,0px)); }
.cc-chart .cc-favorites-panel button { min-height:32px; }
.cc-favorite-list { min-height:0; overflow:auto; max-height:360px; overscroll-behavior:contain; }
.cc-favorite-row { display:flex; align-items:center; gap:2px; }
.cc-chart .cc-favorite-row [data-cc-favorite-use] { display:flex; align-items:center; gap:7px; text-align:left; min-width:0; flex:1; padding:6px 4px; }
.cc-favorite-row [data-cc-favorite-use] svg { flex:0 0 18px; width:18px; }
.cc-favorite-row [data-cc-favorite-use] span { overflow:hidden; text-overflow:ellipsis; }
.cc-chart .cc-favorite-row [data-cc-favorite-move] { flex:0 0 24px; width:24px; padding:2px; }
.cc-favorites-panel p { flex-shrink:0; margin:0; font-size:calc(11px - var(--cc-font-reduction,0px)); line-height:1.4; color:var(--cc-tool-muted); }
@container(max-width:600px) {
 .cc-chart .cc-favorites-bar button { height:40px; min-height:40px; }
 .cc-chart .cc-favorite-star { min-height:40px; }
 .cc-chart .cc-favorites-panel button { min-height:40px; }
}
.cc-chart .cc-favorites-bar[data-compact=true] button { width:40px; flex-basis:40px; height:40px; min-height:40px; }
.cc-chart .cc-favorites-bar[data-compact=true] [data-cc-favorite-grip] { width:28px; flex-basis:28px; }
.cc-chart[data-theme] button.cc-favorite-star {
  background:transparent !important;
  border:0 !important;
  box-shadow:none !important;
  border-radius:0;
}
.cc-chart[data-theme] button.cc-favorite-star:hover { color:var(--cc-tool-accent); }

/* The bottom-right axis corner stays clear of time labels and price/pane gestures. */
.cc-chart[data-theme] .cc-stage button.cc-price-scale-toggle {
  position:absolute; z-index:1; right:4px; bottom:2px; box-sizing:border-box;
  width:88px; height:24px; min-height:24px; margin:0; padding:2px 6px;
  border:1px solid var(--cc-tool-border); border-radius:4px;
  background:var(--cc-tool-surface); color:var(--cc-tool-muted);
  font:calc(11px - var(--cc-font-reduction,0px)) system-ui; line-height:18px; cursor:pointer;
}
.cc-chart[data-theme] .cc-stage button.cc-price-scale-toggle[aria-pressed=true] {
  background:var(--cc-tool-selected); border-color:var(--cc-tool-accent); color:var(--cc-tool-accent);
}
.cc-chart[data-theme] .cc-stage button.cc-price-scale-toggle:focus-visible { outline:2px solid var(--cc-tool-accent); outline-offset:1px; }
.cc-chart[data-theme] .cc-stage button.cc-price-scale-toggle:disabled { opacity:.5; cursor:default; }
.cc-chart[data-theme] .cc-stage button.cc-axis-timezone {
  position:absolute; z-index:1; right:68px; bottom:2px;
  width:62px; height:24px; min-height:24px; box-sizing:border-box; margin:0; padding:2px 3px;
  border:1px solid var(--cc-tool-border); border-radius:4px; background:var(--cc-tool-surface);
  color:var(--cc-tool-muted); font:10px system-ui; white-space:nowrap; cursor:pointer; touch-action:manipulation;
}
.cc-chart[data-theme] .cc-stage button.cc-axis-timezone:focus-visible { outline:2px solid var(--cc-tool-accent); }

/* ReverseTool retains the blue terminal palette used by its previous chart. */
.cc-chart[data-scanner=reverse][data-theme=dark] {
  --cc-tool-accent:#ffffff;
  --cc-tool-selected:#2448c9;
  --cc-tool-muted:#b5b5b5;
  --cc-tool-border:#17345a;
  --cc-tool-surface:#040c19;
  --cc-tooltip-surface:#040c19;
  --cc-tooltip-text:#c7d6ea;
  background:#040c19; color:#c7d6ea;
}
.cc-chart[data-scanner=reverse][data-theme=dark] :is(.cc-toolbar,.cc-tool-rail,.cc-market-header,.cc-tool-status) { background:#040c19; color:#c7d6ea; }

html[data-reverse-embed=flutter] .cc-chart .cc-indicator-dialog {
  position:fixed;
  inset:var(--cc-study-viewport-top, 0px) 0 auto;
  margin:8px auto 0;
  max-height:calc(var(--cc-study-viewport-height, 100dvh) - 16px);
}
html[data-reverse-embed=flutter] .cc-indicator-dialog :is(header, footer) { flex-shrink:0; padding:8px 12px; }
html[data-reverse-embed=flutter] .cc-indicator-dialog footer .cc-study-form-actions { border:0; padding:0; }
html[data-reverse-embed=flutter] .cc-indicator-library { display:flex; flex-direction:column; }
html[data-reverse-embed=flutter] [data-study-add-error] { order:-1; padding:6px 10px; }
html[data-reverse-embed=flutter] .cc-indicator-dialog[data-view=library] footer .cc-study-form-actions,
html[data-reverse-embed=flutter] .cc-indicator-dialog[data-view=detail] footer > :is([data-study-count], button) { display:none; }
html[data-reverse-embed=flutter] .cc-indicator-search { flex-shrink:0; padding:6px 12px; }
html[data-reverse-embed=flutter] .cc-chart .cc-indicator-dialog :is(input[type=search], input[type=number], select) {
  box-sizing:border-box;
  font-size:16px;
  color:var(--cc-tooltip-text);
  -webkit-text-fill-color:currentColor;
  caret-color:var(--cc-tool-accent);
}
html[data-reverse-embed=flutter] .cc-indicator-layout { display:block; overflow:auto; overscroll-behavior:contain; }
html[data-reverse-embed=flutter] .cc-indicator-dialog[data-compact-edit] .cc-study-preview { display:none; }
html[data-reverse-embed=flutter] .cc-indicator-detail { border:0; overflow:visible; }
html[data-reverse-embed=flutter] .cc-indicator-dialog[data-view=detail] :is(.cc-indicator-library, .cc-indicator-search),
html[data-reverse-embed=flutter] .cc-indicator-dialog[data-view=library] .cc-indicator-detail { display:none; }
html[data-reverse-embed=flutter] .cc-chart .cc-indicator-back {
  display:inline-flex;
  margin:0 0 14px;
  padding:6px 0;
  border:0;
  background:transparent;
  color:var(--cc-tool-accent);
}

.cc-study-disclosure {
  position:absolute;
  z-index:24;
  inset:8px auto auto 8px;
  width:min(300px, calc(100% - 16px));
  max-width:calc(100% - 16px);
  pointer-events:none;
}
.cc-study-disclosure summary {
  display:flex;
  width:max-content;
  min-height:32px;
  align-items:center;
  gap:4px;
  padding:0 8px;
  border:1px solid var(--cc-tool-border);
  border-radius:6px;
  background:var(--cc-tool-surface);
  color:var(--cc-tooltip-text);
  cursor:pointer;
  list-style:none;
  pointer-events:auto;
}
.cc-study-disclosure summary::-webkit-details-marker { display:none; }
.cc-study-disclosure summary svg { width:14px; height:14px; }
.cc-study-disclosure[open] summary svg { transform:rotate(180deg); }
.cc-chart[data-theme] .cc-study-disclosure .cc-studies {
  flex-direction:column;
  align-items:stretch;
  max-height:min(220px, 43dvh);
  margin-top:4px;
  padding:4px;
  overflow:auto;
  overscroll-behavior:contain;
  border:1px solid var(--cc-tool-border);
  border-radius:8px;
  box-shadow:0 5px 18px #0005;
  pointer-events:auto;
}
.cc-study-disclosure:not([open]) > .cc-studies { display:none; }
.cc-chart .cc-study-disclosure .cc-study-chip .cc-study-name { flex:1; justify-content:flex-start; text-align:left; }
.cc-study-disclosure .cc-study-name span { max-width:none; }
.cc-chart[data-scanner=reverse][data-theme=dark] :is(.cc-tool-button,.cc-tool-rail .cc-icon-button) { color:#c7d6ea; }
.cc-chart[data-scanner=reverse][data-theme=dark] :is(.cc-tool-button[aria-pressed=true],.cc-tool-trigger[aria-expanded=true]) {
  color:#ffffff; background:#2448c9; border-color:#2448c9; box-shadow:none;
}
.cc-chart[data-scanner=reverse][data-theme=dark] button:hover:not(:disabled) { background:#10233d; border-color:#17345a; color:#ffffff; }
.cc-chart[data-scanner=reverse][data-theme=dark] button:active:not(:disabled) { background:#17345a; }
.cc-chart[data-scanner=reverse][data-theme=dark] :is(.cc-tool-button[aria-pressed=true],.cc-tool-trigger[aria-expanded=true]):hover { background:#3262f0; border-color:#3262f0; }
