/* Unified stock names and a compact, two-pane financial chart. */
[data-stock-chart-name]{cursor:pointer}
.kd-stock-chart-namebox{min-height:44px;justify-content:center!important}
.kdr-sym-main[data-stock-chart-name]{position:relative}
.kdr-sym-main[data-stock-chart-name]::after{content:"";position:absolute;left:0;right:0;top:50%;height:44px;min-width:44px;transform:translateY(-50%)}
[data-stock-chart-name]:focus-visible{outline:2px solid var(--brand-violet-600,#7c3aed);outline-offset:2px;border-radius:3px}
body.kd-stock-chart-open{overflow:hidden}
#kdStockChart{--ks-bg:#fff;--ks-line:#e3e7ef;--ks-muted:#667085;--ks-ink:#2d2440;--ks-accent:#7c3aed;--ks-soft:#f7f5fb;--ks-active:#ede9fe;--ks-up:#0db787;--ks-down:#dc1f4e;--ks-ma5:#996100;--ks-ma20:#7c3aed;--ks-k:#c85a00;--ks-d:#1d4ed8;position:fixed;inset:0;margin:auto;width:min(980px,calc(100vw - 32px));max-width:none;max-height:min(800px,calc(100dvh - 96px));padding:0;border:1px solid var(--ks-line);border-radius:14px;background:var(--ks-bg);color:var(--ks-ink);box-shadow:var(--shadow-overlay,0 18px 46px #0f172a38);font:400 14px/1.5 Inter,"PingFang SC","Microsoft YaHei","Segoe UI",sans-serif;overflow:hidden;visibility:visible!important}
#kdStockChart[open]{display:flex;flex-direction:column}
#kdStockChart::backdrop{background:#18133166;backdrop-filter:blur(8px)}
html[data-theme=dark] #kdStockChart{--ks-bg:#17161f;--ks-line:#302c3e;--ks-muted:#b7b0c4;--ks-ink:#f5f3fa;--ks-accent:#c4b5fd;--ks-soft:#25232f;--ks-active:#2a2040;--ks-ma5:#e0b45b;--ks-ma20:#b5a0fa;--ks-k:#ff9f43;--ks-d:#69acff}
#kdStockChart *{box-sizing:border-box}
#kdStockChart button{font:inherit;color:inherit;min-width:44px;min-height:44px;padding:0 8px;border:0;border-radius:8px;background:transparent;box-shadow:none;cursor:pointer;touch-action:manipulation}
#kdStockChart button[hidden],#kdStockChart [hidden]{display:none!important}
#kdStockChart button:hover{background:var(--ks-soft)}
#kdStockChart button:active{background:var(--ks-active)}
#kdStockChart button:disabled{opacity:.4;cursor:default}
#kdStockChart :focus-visible{outline:2px solid var(--ks-accent);outline-offset:-2px}
#kdStockChart .kd-stock-chart-head{display:flex;align-items:center;gap:12px;flex-shrink:0;padding:8px 16px;border-bottom:1px solid var(--ks-line)}
#kdStockChart .kd-stock-chart-head>div{flex:1;min-width:0}
#kdStockChart h2{font-size:18px;line-height:1.3;margin:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
#kdStockChart .kd-stock-chart-head p{font-size:12px;margin:4px 0 0;color:var(--ks-muted);overflow-wrap:anywhere}
#kdStockChart .kd-stock-chart-head button{width:44px;height:44px;padding:12px;flex-shrink:0;color:var(--ks-muted)}
#kdStockChart button svg{display:block;width:20px;height:20px}
#kdStockChart .kd-stock-chart-scroll{overflow-y:auto;overscroll-behavior:contain;padding:0 16px 8px;min-height:0}
#kdStockChart .kd-stock-chart-body{width:100%;min-width:0;font-variant-numeric:tabular-nums}

#kdStockChart .kd-stock-chart-nav{display:grid;grid-template-columns:minmax(0,1fr) 64px minmax(0,1fr);align-items:center;gap:4px;flex-shrink:0;padding:8px 12px max(8px,env(safe-area-inset-bottom));border-top:1px solid var(--ks-line);background:var(--ks-bg)}
#kdStockChart .kd-stock-chart-nav button{display:flex;align-items:center;gap:8px;min-width:0;min-height:48px;padding:4px 8px;text-align:left}
#kdStockChart .kd-stock-chart-nav button:disabled{opacity:1;color:var(--ks-muted)}
#kdStockChart .kd-stock-chart-nav button:disabled:hover{background:transparent}
#kdStockChart .kd-stock-chart-nav button:disabled svg{opacity:.4}
#kdStockChart .kd-stock-chart-nav button>span{display:grid;gap:2px;min-width:0;font-size:12px;line-height:18px}
#kdStockChart .kd-stock-chart-nav button small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;line-height:18px;color:var(--ks-muted)}
#kdStockChart .kd-stock-chart-nav svg{width:16px;height:16px;flex-shrink:0}
#kdStockChart [data-chart-step="1"]{justify-content:flex-end;text-align:right}
#kdStockChart [data-chart-position]{text-align:center;font:600 12px/20px var(--font-data,Consolas,monospace);color:var(--ks-muted);font-variant-numeric:tabular-nums}
#kdStockChart .ks-chart-toolbar{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:64px}
#kdStockChart .ks-price-summary{display:flex;align-items:baseline;gap:12px;min-width:0}
#kdStockChart [data-close]{font:700 28px/1.2 var(--font-data,Consolas,monospace)}
#kdStockChart [data-change]{font:500 12px/1.5 var(--font-data,Consolas,monospace);white-space:nowrap}
#kdStockChart .ks-up{color:var(--ks-up)}
#kdStockChart .ks-down,#kdStockChart .ks-error{color:var(--ks-down)}
#kdStockChart .ks-chart-actions,#kdStockChart .ks-chart-period{display:flex;align-items:center;gap:4px;flex-shrink:0}
#kdStockChart .ks-chart-period{border:1px solid var(--ks-line);border-radius:8px;padding:2px}
#kdStockChart .ks-chart-period button{font-size:13px;color:var(--ks-muted)}
#kdStockChart .ks-chart-period [aria-pressed=true]{color:var(--ks-accent);background:var(--ks-active);font-weight:700}
#kdStockChart [data-latest]{padding:12px;color:var(--ks-muted)}
#kdStockChart .ks-readout{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:28px;color:var(--ks-muted);font-size:12px}
#kdStockChart .ks-selected-date{display:flex;align-items:center;gap:8px;flex-shrink:0}
#kdStockChart .ks-selected-date time{font-family:var(--font-data,Consolas,monospace);color:var(--ks-ink)}
#kdStockChart .ks-ohlc{display:flex;gap:12px;font-size:12px;color:var(--ks-muted)}
#kdStockChart .ks-ohlc span{white-space:nowrap}
#kdStockChart .ks-ohlc b{font-weight:500;color:var(--ks-ink)}
#kdStockChart .ks-indicator-row{display:flex;gap:12px;align-items:center;min-height:28px;font-size:12px}
#kdStockChart .ks-indicator-row b,#kdStockChart .kd-lwc-kd-legend b{font-weight:500}
#kdStockChart .ks-ma5{color:var(--ks-ma5)}
#kdStockChart .ks-ma20{color:var(--ks-ma20)}
#kdStockChart .ks-k{color:var(--ks-k)}
#kdStockChart .ks-d{color:var(--ks-d)}
#kdStockChart .kd-lwc-stage{position:relative;height:388px;min-width:0}
#kdStockChart .kd-lwc-canvas{width:100%;height:100%}
#kdStockChart .kd-lwc-kd-legend{position:absolute;z-index:3;left:0;right:60px;display:flex;align-items:center;gap:12px;font-size:12px;line-height:20px;background:var(--ks-bg);pointer-events:none;color:var(--ks-muted)}
#kdStockChart .ks-chart-source{display:grid;gap:4px;padding:8px 0 0;border-top:1px solid var(--ks-line);font-size:12px;line-height:1.5;color:var(--ks-muted);overflow-wrap:anywhere}
#kdStockChart .ks-chart-source p{margin:0}
#kdStockChart .kd-stock-chart-status{font-weight:500;color:var(--ks-muted)}
#kdStockChart [data-stale=true],#kdStockChart .kd-stock-chart-warning{color:var(--ks-down)}
#kdStockChart .kd-stock-chart-footer{display:flex;align-items:flex-start;gap:12px}
#kdStockChart .kd-stock-chart-footer>details{flex:1;min-width:0}
#kdStockChart .kd-stock-chart-footer>a{display:flex;align-items:center;min-height:44px;font-size:12px;flex-shrink:0;color:var(--ks-muted);text-underline-offset:3px}
#kdStockChart .kd-stock-chart-method summary{cursor:pointer;min-height:44px;display:flex;align-items:center;justify-content:space-between;gap:8px;color:var(--ks-muted);list-style:none}
#kdStockChart .kd-stock-chart-method summary::after{content:"+";font-size:16px;color:var(--ks-accent)}
#kdStockChart .kd-stock-chart-method[open] summary::after{content:"−"}
#kdStockChart .kd-stock-chart-method p{padding-bottom:8px}
#kdStockChart .kd-stock-chart-attribution a{color:var(--ks-muted);text-underline-offset:3px;display:inline-flex;align-items:center;min-height:44px}
#kdStockChart .ks-chart-state{min-height:320px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;text-align:center;color:var(--ks-muted);font-size:13px}
#kdStockChart .ks-chart-state.ks-error{color:var(--ks-down)}
#kdStockChart .ks-chart-state button{border:1px solid var(--ks-line);color:var(--ks-accent)}
#kdStockChart .ks-chart-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
@media(max-width:650px){#kdStockChart .ks-price-summary{flex-direction:column;align-items:flex-start;gap:0}#kdStockChart .ks-readout{display:block}#kdStockChart .ks-ohlc{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px}#kdStockChart .ks-ohlc span{white-space:normal;overflow-wrap:anywhere}#kdStockChart .ks-selected-date{justify-content:space-between;min-height:24px}}
@media(max-width:520px){#kdStockChart{width:calc(100vw - 16px);max-height:min(560px,70dvh,calc(100dvh - 96px));border-radius:12px}#kdStockChart .kd-stock-chart-head{padding:8px 12px}#kdStockChart .kd-stock-chart-scroll{padding-inline:8px}#kdStockChart h2{font-size:16px}#kdStockChart [data-close]{font-size:22px}#kdStockChart .ks-chart-toolbar{min-height:60px;gap:4px}#kdStockChart .ks-chart-period{gap:0;padding:0}#kdStockChart .ks-chart-period button{padding:0 6px}#kdStockChart .kd-lwc-stage{height:276px}#kdStockChart .ks-indicator-row{min-height:24px}#kdStockChart .kd-lwc-kd-legend{gap:8px}}
/* Gesture containment is limited to the chart stage. Dialog and page scrolling stay available elsewhere. */
#kdStockChart .kd-lwc-stage,#kdStockChart .kd-lwc-stage canvas,#kdStockChart .kd-lwc-stage table,#kdStockChart .kd-lwc-stage [tabindex]{touch-action:none}
#kdStockChart .kd-lwc-stage{overscroll-behavior:contain}
