/* Chart-Tab (chart.js): Vollbild-Chart im Stil des Terminals; nur Design-Werte aus theme.css */
.ct-wrap { position: relative; display: flex; flex-direction: column; background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--radius); height: calc(100vh - 150px); min-height: 460px; overflow: hidden; }
.ct-wrap:fullscreen { height: 100vh; border-radius: 0; }
.ct-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.ct-head .grow { flex: 1; }
.ct-head .seg button { padding: 5px 10px; font-size: 12px; }
.ct-ohlc { font-size: 11.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46%; }
.ct-ohlc b.up { color: var(--up); } .ct-ohlc b.down { color: var(--down); }
.ct-auto, #ct-log { font-size: 11px; padding: 3px 9px; opacity: .7; } .ct-auto.on, #ct-log.on { opacity: 1; border-color: var(--accent); color: var(--accent); }
.ct-body { flex: 1; display: flex; min-height: 0; }
.ct-tools { display: flex; flex-direction: column; gap: 2px; padding: 6px 4px; border-right: 1px solid var(--line); align-items: center; }
.ct-tools .iconbtn { width: 34px; height: 34px; } .ct-tools .iconbtn.on { background: var(--bg-hover); color: var(--accent); }
.ct-tools svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ct-tools input[type="color"] { width: 26px; height: 26px; padding: 0; border: 1px solid var(--line-strong); border-radius: 4px; background: none; margin: 4px 0; cursor: pointer; }
.ct-stage { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ct-mainwrap { position: relative; flex: 1 1 0; min-height: 220px; touch-action: none; }
.ct-main { position: absolute; inset: 0; }
.ct-ov { position: absolute; left: 0; top: 0; pointer-events: none; }
.ct-err { position: absolute; left: 50%; top: 40%; transform: translateX(-50%); color: var(--text-2); background: var(--bg-hover); padding: 8px 14px; border-radius: 8px; z-index: 6; }
#ct-panes { display: flex; flex-direction: column; flex: 0 0 auto; min-height: 0; } #ct-panes:empty, #ct-panes[hidden] { display: none; }
.ct-pane { position: relative; flex: 0 0 auto; height: 150px; min-height: 48px; border-top: 1px solid var(--line); }
.ct-psplit { position: absolute; left: 0; right: 0; top: -3px; height: 7px; cursor: ns-resize; z-index: 8; touch-action: none; } .ct-psplit:hover { background: var(--accent-bg); }
.ct-pc { position: absolute; inset: 0; }
.ct-pn { position: absolute; left: 8px; top: 3px; z-index: 4; font: 11px var(--font-mono); color: var(--text-2); display: flex; gap: 6px; align-items: center; }
.ct-hinweis { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--text-3); font-size: 12px; pointer-events: none; }
.ct-x { background: none; border: 0; color: var(--text-3); cursor: pointer; font-size: 15px; line-height: 1; padding: 0 4px; } .ct-x:hover { color: var(--down); }
.ct-pop { position: absolute; right: 12px; top: 48px; z-index: 20; width: min(440px, calc(100% - 24px)); max-height: 70%; overflow: auto; background: var(--bg-raised); border: 1px solid var(--line-strong); border-radius: 10px; padding: 10px 12px; box-shadow: var(--tip-shadow, 0 8px 24px rgba(0, 0, 0, .35)); }
.ct-pop h4 { margin: 0 0 8px; display: flex; justify-content: space-between; font-size: 13px; }
.ct-pop[hidden] { display: none; }
.ct-list { display: flex; flex-direction: column; gap: 6px; }
.ct-irow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.ct-chk { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.ct-par { display: flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--text-3); } .ct-par input { width: 62px; background: var(--bg-hover); border: 1px solid var(--line); border-radius: 4px; color: var(--text); padding: 2px 4px; }
.ct-irow input[type="color"] { width: 24px; height: 22px; padding: 0; border: 0; background: none; cursor: pointer; }
.ct-add { margin-top: 10px; } .ct-add div { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
@media (max-width: 760px) {
  .ct-wrap { height: calc(100vh - 170px); min-height: 420px; }
  .ct-ohlc { order: 9; max-width: 100%; flex-basis: 100%; }
  .ct-head { gap: 6px; padding: 6px; } .ct-head .seg button { padding: 5px 7px; }
  .ct-tools { padding: 4px 2px; } .ct-tools .iconbtn { width: 30px; height: 30px; }
}

/* Layout: normal / breit / voll / frei, Griff, Werkzeugleiste einklappbar */
.ct-wrap.ct-breit { position: relative; left: 50%; transform: translateX(-50%); width: min(97vw, 2200px); }
.ct-wrap.ct-voll { position: relative; left: 50%; transform: translateX(-50%); width: 100vw; border-radius: 0; border-left: 0; border-right: 0; }
.ct-wrap.ct-frei { max-width: none; }
.ct-grip { position: absolute; right: 0; bottom: 0; width: 18px; height: 18px; cursor: nwse-resize; z-index: 30; touch-action: none; background: linear-gradient(135deg, transparent 50%, var(--line-strong) 50%, var(--line-strong) 58%, transparent 58%, transparent 70%, var(--line-strong) 70%, var(--line-strong) 78%, transparent 78%); }
.ct-toolsbtn { display: none; position: absolute; left: 4px; top: 4px; z-index: 12; width: 30px; height: 30px; background: var(--bg-raised); border: 1px solid var(--line); }
.ct-toolsbtn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.ct-wrap.ct-toolszu .ct-tools { display: none; }
.ct-tools .iconbtn:disabled { opacity: .35; cursor: default; }
.ct-tools { overflow-y: auto; max-height: 100%; }
.ct-name { all: unset; flex: 1; cursor: pointer; color: var(--text); font-size: 12.5px; } .ct-zrow.sel .ct-name { color: var(--accent); }
.ct-add input[type="search"] { width: 100%; background: var(--bg-hover); border: 1px solid var(--line); border-radius: 6px; color: var(--text); padding: 4px 8px; margin-bottom: 6px; }
.ct-vorl { display: inline-flex; align-items: center; } .ct-datei { cursor: pointer; }
.ct-pop input[type="text"], .ct-pop input[type="number"], .ct-pop select { background: var(--bg-hover); border: 1px solid var(--line); border-radius: 4px; color: var(--text); padding: 2px 6px; font: inherit; }
@media (max-width: 760px) { .ct-toolsbtn { display: inline-flex; } .ct-body { position: relative; } .ct-wrap.ct-breit, .ct-wrap.ct-voll { width: 100vw; } .ct-grip { display: none; } .ct-tools { padding-top: 38px; } }
