/* Stage 3: діалог індикаторів, легенда, налаштування, віджети */
.ind-dialog { border: 0; padding: 0; background: transparent; max-width: 100vw; }
.ind-dialog::backdrop { background: var(--backdrop); }
.ind-dlg { width: min(860px, 96vw); height: min(640px, 86vh); background: var(--panel); color: var(--text); border: 1px solid var(--border); border-radius: 8px; display: flex; flex-direction: column; overflow: hidden; }
.ind-dlg-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.ind-dlg-body { display: flex; flex: 1; min-height: 0; }
.ind-nav { width: 200px; border-right: 1px solid var(--border); overflow: auto; padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.ind-nav-btn { text-align: left; background: none; border: 0; color: var(--muted); padding: 6px 8px; border-radius: 4px; cursor: pointer; font: inherit; }
.ind-nav-btn[aria-pressed="true"], .ind-nav-btn:hover { background: var(--selected); color: var(--text); }
.ind-main { flex: 1; display: flex; flex-direction: column; min-width: 0; padding: 10px; }
#indSearch { width: 100%; margin-bottom: 8px; background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 4px; padding: 6px 8px; font: inherit; }
.ind-nav-group { font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 10px 8px 2px; }
.ind-list-head { display: grid; grid-template-columns: 28px 1fr 110px 120px 88px; gap: 8px; padding: 4px 6px; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--border); }
.ind-list { overflow: auto; flex: 1; }
.ind-item { display: grid; grid-template-columns: 28px 1fr 110px 120px 88px; gap: 8px; align-items: center; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--rule, var(--border)); color: var(--text); padding: 8px 6px; cursor: pointer; font: inherit; }
.ind-item:hover { background: var(--hover); }
.ind-item.is-on { opacity: .92; }
.ind-item-name { font-weight: 600; }
.ind-on-chart { font-size: 11px; color: var(--muted); border: 1px solid var(--border); border-radius: 3px; padding: 1px 6px; justify-self: end; }
.ind-star { border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 16px; width: 28px; }
.ind-star.on { color: var(--warning); }
#indMenu.ind-menu-compat, .ind-menu-compat {
  position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important;
  clip: rect(0, 0, 0, 0); clip-path: inset(50%); white-space: nowrap; border: 0 !important;
  padding: 0 !important; margin: -1px !important; box-shadow: none !important; background: transparent !important;
}
#indLegend { position: absolute; top: 8px; left: 8px; z-index: 8; max-width: min(340px, 44%); pointer-events: none; font-size: 12px; background: color-mix(in srgb, var(--panel) 88%, transparent); border: 1px solid var(--border); border-radius: 6px; padding: 6px 8px; box-shadow: var(--shadow-1); }
.ind-legend-head { display: flex; align-items: flex-start; gap: 6px; margin-bottom: 2px; }
.ind-leg-sym { color: var(--text); font-size: 12px; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ind-collapse { border: 0; background: transparent; color: var(--text); cursor: pointer; border-radius: 3px; padding: 0 4px; flex-shrink: 0; }
.ind-leg-row { display: flex; align-items: center; gap: 6px; padding: 2px 0; min-height: 20px; }
.ind-leg-row.is-hidden { opacity: .45; }
.ind-leg-title { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ind-leg-vals { color: var(--muted); font-family: var(--mono, var(--mono)); }
.ind-leg-icons { display: flex; margin-left: auto; gap: 2px; flex-shrink: 0; }
#indLegend { pointer-events: none; }
#indLegend.is-hot { pointer-events: auto; }
#indLegend.is-hot button { pointer-events: auto; }
.plan-card { margin-top: 6px; border: 1px solid var(--border); border-radius: 6px; padding: 8px; font-size: 12px; }
.plan-head { margin-bottom: 6px; }
.plan-row { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; border-bottom: 1px solid var(--rule, var(--border)); }
.plan-card .warn { color: var(--warning); margin: 6px 0 0; }
.ind-ico { border: 0; background: color-mix(in srgb, var(--chart-bg) 72%, transparent); color: var(--text); cursor: pointer; border-radius: 3px; width: 22px; height: 20px; line-height: 18px; padding: 0; }
.ind-more-menu { position: fixed; z-index: 40; background: var(--panel); border: 1px solid var(--border); border-radius: 6px; min-width: 200px; box-shadow: var(--shadow-2); }
.ind-more-menu button { display: block; width: 100%; text-align: left; background: none; border: 0; color: var(--text); padding: 7px 10px; cursor: pointer; font: inherit; }
.ind-more-menu button:hover { background: var(--hover); }
#indSettings { position: absolute; top: 8px; right: 8px; z-index: 7; width: min(260px, 40%); background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 10px; box-shadow: var(--shadow-2); }
#indSettings header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.ind-set-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 6px 0; font-size: 12px; }
.ind-set-row input { width: 6rem; background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 4px; padding: 3px 6px; }
#widgetsPanel { display: flex; flex-direction: column; min-height: 0; overflow: auto; padding: 8px; gap: 10px; }
.wid-card { border: 1px solid var(--border); border-radius: 6px; padding: 8px; }
.wid-card h3 { margin: 0 0 6px; font-size: 13px; }
.wid-table { width: 100%; font-size: 12px; border-collapse: collapse; }
.wid-table th, .wid-table td { text-align: right; padding: 2px 4px; border-bottom: 1px solid var(--rule, var(--border)); }
.wid-table th:first-child, .wid-table td:first-child { text-align: left; }
#journalList .j-item { border-bottom: 1px solid var(--border); padding: 6px 0; }
#journalList img { max-width: 100%; border-radius: 4px; margin-top: 4px; }

.wid-card textarea, .wid-card input, .wid-card select { background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 4px; padding: 4px 6px; font: inherit; width: 100%; box-sizing: border-box; margin: 3px 0; }
.wid-card textarea { resize: vertical; min-height: 2.4em; }
#planOut { white-space: pre-wrap; margin: 6px 0 0; }
.wid-card .row input, .wid-card .row select { width: auto; max-width: 7rem; }
