/* Instrument stars and the guided picker share the personal panel visual language. */
.panel-instrument-star { display: inline-flex; align-items: center; justify-content: center; gap: 6px; margin-left: 4px; padding: 2px 4px; border: 0; border-radius: 4px; background: transparent; color: var(--color-text-secondary); font: inherit; font-size: 15px; line-height: 1; text-decoration: none; vertical-align: middle; }
.panel-instrument-star::before { content: "☆"; }
.panel-instrument-star[data-saved="true"], .panel-instrument-star:hover { color: var(--color-accent); }
.panel-instrument-star[data-saved="true"]::before { content: "★"; }
.panel-instrument-star:focus-visible, .pi-notice a:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.panel-instrument-star.panel-instrument-star-labeled { margin: 0; padding: 10px 14px; min-height: 42px; box-sizing: border-box; border: 1px solid var(--color-border); border-radius: 5px; background: var(--color-surface); color: var(--color-text); font-size: 13px; font-weight: 500; white-space: nowrap; }
.panel-instrument-star-labeled::before { font-size: 16px; color: var(--color-text-secondary); }
.panel-instrument-star-labeled[data-saved="true"]::before { color: var(--color-accent); }
.panel-instrument-star-labeled:hover { border-color: var(--color-text-secondary); }
.ticker-header-actions { display: flex; flex: none; align-items: flex-start; gap: 8px; }
.ud-dialog.pi-dialog { box-sizing: border-box; width: min(740px, calc(100vw - 40px)); height: min(620px, calc(100dvh - 40px)); overflow: hidden; }
.pi-dialog [hidden] { display: none !important; }
.pi-dialog [data-panel-picker-slot] { height: 100%; }
.pi-dialog form { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.pi-dialog .ud-dialog-heading { align-items: flex-start; flex-shrink: 0; }
.pi-dialog .ud-dialog-heading > div { min-width: 0; }
.pi-dialog .ud-dialog-heading h2 { margin: 4px 0 7px; overflow-wrap: anywhere; }
.pi-dialog .ud-dialog-heading p { line-height: 1.45; }
.pi-dialog .ud-icon-button { flex-shrink: 0; }
.pi-dialog :is(button, a, input):focus-visible { outline: 2px solid var(--color-accent); outline-offset: 3px; }
.pi-steps { flex-shrink: 0; }
.pi-steps .pi-step-done > span:first-child { border-color: var(--color-text-secondary); }
.pi-asset { display: flex; align-items: center; gap: 10px; flex-shrink: 0; padding: 12px 18px; border-bottom: 1px solid var(--color-border); }
.pi-asset > strong { font-size: 15px; letter-spacing: -.01em; overflow-wrap: anywhere; }
.pi-asset > span:last-child { margin-left: auto; color: var(--color-text-secondary); font-size: 12px; text-align: right; }
.pi-asset-mark { display: grid; place-items: center; width: 28px; height: 28px; flex-shrink: 0; color: var(--color-text-secondary); }
.pi-asset svg, .pi-destination-icon svg, .pi-group-heading svg, .pi-preview-panel-name svg, .pi-table-preview h3 svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.pi-stage { flex: 1 1 auto; min-height: 0; padding: 22px 18px; overflow-y: auto; overscroll-behavior: contain; }
.pi-routes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.pi-route { transition: border-color 150ms ease, background-color 150ms ease; }
.pi-route .ud-component-thumbnail { padding: 14px 22px; }
.pi-route .ud-component-choice-copy { gap: 7px; padding: 17px 34px 18px 16px; }
.pi-route .ud-component-choice-copy > strong { font-size: 16px; }
.pi-route .ud-component-choice-copy > span { font-size: 13px; line-height: 1.5; }
.pi-route:disabled { opacity: .45; cursor: default; }
.pi-route:disabled:hover { border-color: var(--color-border); }
.pi-route:disabled .ud-choice-arrow { display: none; }
.pi-art-surface { fill: var(--color-surface); }
.pi-art-accent { stroke: var(--color-accent); stroke-width: 1.5; }
.pi-panel-list { display: grid; gap: 10px; }
.pi-panel-card, .pi-option { display: grid; grid-template-columns: 40px minmax(0, 1fr) 20px; align-items: center; gap: 12px; box-sizing: border-box; width: 100%; min-width: 0; margin: 0; padding: 14px; border: 1px solid var(--color-border); border-radius: 5px; background: var(--color-surface); color: var(--color-text); text-align: left; font: inherit; cursor: pointer; transition: border-color 150ms ease, background-color 150ms ease; }
.pi-panel-card:hover, .pi-option:not(.pi-unavailable):hover { border-color: var(--color-accent); background: var(--color-surface-alt); }
.pi-destination-icon { display: grid; place-items: center; width: 40px; height: 40px; flex-shrink: 0; border: 1px solid var(--color-border); border-radius: 5px; color: var(--color-text-secondary); background: var(--color-surface-warm); }
.pi-choice-copy { display: flex; min-width: 0; flex-direction: column; gap: 5px; overflow-wrap: anywhere; }
.pi-choice-copy > strong { font-size: 14px; line-height: 1.35; font-weight: 600; }
.pi-choice-copy > span { color: var(--color-text-secondary); font-size: 12px; line-height: 1.45; }
.pi-next { width: 18px; height: 18px; fill: none; stroke: var(--color-text-secondary); stroke-width: 1.5; }
.pi-destinations { min-width: 0; margin: 0; padding: 0; border: 0; }
.pi-group + .pi-group { margin-top: 22px; }
.pi-group-heading { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; font-size: 13px; font-weight: 500; overflow-wrap: anywhere; }
.pi-group-heading svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--color-text-secondary); }
.pi-group-heading small { margin-left: auto; color: var(--color-text-secondary); font-size: 11px; font-weight: 400; }
.pi-option { position: relative; margin-bottom: 10px; }
.pi-option:last-child { margin-bottom: 0; }
.pi-option input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: inherit; }
.pi-option:has(input:checked) { border-color: var(--color-accent); background: var(--color-accent-soft); }
.pi-option:has(input:focus-visible) { outline: 2px solid var(--color-accent); outline-offset: 3px; }
.pi-choice-check { display: grid; place-items: center; width: 18px; height: 18px; box-sizing: border-box; border: 1px solid var(--color-border); border-radius: 50%; }
.pi-choice-check svg { width: 14px; height: 14px; fill: none; stroke: #fff; stroke-width: 1.8; opacity: 0; }
.pi-option:has(input:checked) .pi-choice-check { background: var(--color-accent); border-color: var(--color-accent); }
.pi-option:has(input:checked) .pi-choice-check svg { opacity: 1; }
.pi-unavailable { opacity: .55; cursor: default; }
.pi-create-table { border-style: dashed; }
.pi-native-new { margin-block: 18px; grid-template-columns: minmax(0, 1fr) 20px; }
.pi-new-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
.pi-name-settings { padding: 4px 24px 0 0; min-width: 0; }
.pi-name-settings > label { display: block; margin-bottom: 9px; font-size: 13px; font-weight: 600; }
.pi-name-settings .ud-setting-input { margin-bottom: 12px; }
.pi-name-settings p { margin: 0; color: var(--color-text-secondary); font-size: 13px; line-height: 1.6; }
.pi-component-types { display: grid; gap: 8px; margin: 8px 0 0; padding: 0; border: 0; min-width: 0; }
.pi-component-types legend { margin-bottom: 8px; font-size: 13px; font-weight: 600; }
.pi-component-type { position: relative; display: flex; align-items: center; min-height: 38px; padding: 8px 10px; border: 1px solid var(--color-border); border-radius: 5px; background: var(--color-surface); color: var(--color-text-secondary); font-size: 13px; cursor: pointer; }
.pi-component-type:has(input:checked) { background: var(--color-text); border-color: var(--color-text); color: var(--color-surface); }
.pi-component-type:focus-within { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.pi-single-preview { padding: 14px 12px; }
.pi-single-preview h3 { margin: 0 0 12px; font-size: 12px; }
.pi-single-preview > strong { font-size: 14px; }
.pi-single-preview svg { display: block; width: 100%; height: auto; margin-top: 12px; }
.pi-new-preview { padding: 18px; border: 1px solid var(--color-border); border-radius: 5px; min-width: 0; }
.pi-preview-panel-name { display: flex; align-items: center; gap: 8px; margin: 3px 0 18px; min-width: 0; }
.pi-preview-panel-name svg { flex-shrink: 0; color: var(--color-text-secondary); }
.pi-preview-panel-name strong { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.pi-table-preview { min-height: 0; overflow: hidden; }
.pi-table-preview h3 { display: flex; align-items: center; gap: 7px; margin: 0; padding: 14px 12px; font-size: 12px; font-weight: 600; }
.pi-table-preview h3 svg { width: 16px; height: 16px; color: var(--color-text-secondary); }
.pi-preview-table-head, .pi-preview-table-row { display: grid; grid-template-columns: 1.1fr .9fr .9fr; align-items: center; gap: 12px; padding: 10px 12px; }
.pi-preview-table-head { border-block: 1px solid var(--color-border); background: var(--color-surface-warm); color: var(--color-text-secondary); font-size: 10px; }
.pi-preview-table-row { min-height: 32px; font-size: 12px; }
.pi-preview-table-row i { display: block; width: 80%; height: 4px; border-radius: 2px; background: var(--color-border); }
.pi-dialog .ud-dialog-footer { flex-shrink: 0; }
.pi-dialog .ud-dialog-footer a { text-decoration: none; }
.pi-dialog .ud-back svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.pi-loading { display: flex; flex: 1; align-items: center; justify-content: center; flex-direction: column; gap: 14px; padding: 24px; text-align: center; color: var(--color-text-secondary); font-size: 14px; }
.pi-loading p { margin: 0; }
.pi-fallback { margin: 0 auto; height: auto; min-height: 540px; }
.pi-fallback[data-guided="true"] { height: min(620px, calc(100dvh - 40px)); min-height: 0; }
.pi-page { padding-block: 32px; }
.pi-notice { position: fixed; z-index: 100; right: 20px; bottom: 20px; box-sizing: border-box; max-width: min(400px, calc(100vw - 32px)); padding: 14px 18px; border: 1px solid var(--color-border); border-radius: 6px; background: var(--color-surface); color: var(--color-text); box-shadow: 0 8px 30px #0002; font-size: 14px; }
.pi-notice a { display: inline-block; margin-left: 8px; color: var(--color-accent); }
.pi-notice:empty { display: none; }
@media (max-width: 560px) {
    .ud-dialog.pi-dialog { width: calc(100vw - 24px); height: min(660px, calc(100dvh - 24px)); }
    .pi-dialog .ud-dialog-heading h2 { font-size: 20px; }
    .pi-steps { gap: 12px; font-size: 11px; }
    .pi-steps li { gap: 5px; }
    .pi-stage { padding: 18px; }
    .pi-routes { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .pi-route { display: grid; grid-template-columns: 100px minmax(0, 1fr); min-height: 120px; }
    .pi-route .ud-component-thumbnail { display: grid; align-items: center; padding: 8px; border-bottom: 0; border-right: 1px solid var(--color-border); }
    .pi-route .ud-component-choice-copy { justify-content: center; padding: 14px 22px 14px 12px; }
    .pi-route .ud-component-choice-copy > strong { font-size: 14px; }
    .pi-route .ud-component-choice-copy > span { font-size: 12px; }
    .pi-route .ud-choice-arrow { width: 14px; right: 8px; bottom: 50%; transform: translateY(50%); }
    .pi-panel-card, .pi-option { gap: 10px; padding: 12px; grid-template-columns: 34px minmax(0, 1fr) 18px; }
    .pi-destination-icon { width: 34px; height: 34px; }
    .pi-new-layout { grid-template-columns: minmax(0, 1fr); gap: 18px; }
    .pi-name-settings { padding: 0; }
    .pi-name-settings p { font-size: 12px; line-height: 1.5; }
    .pi-new-preview { padding: 14px; border-left: 1px solid var(--color-border); }
    .pi-preview-panel-name { margin-bottom: 12px; }
    .pi-table-preview h3 { padding-block: 10px; }
    .pi-dialog .ud-dialog-footer .ud-button { gap: 5px; padding-inline: 9px; font-size: 12px; }
    .pi-dialog .ud-dialog-footer > div { gap: 7px; }
}
@media (prefers-reduced-motion: reduce) { .pi-route, .pi-panel-card, .pi-option { transition: none; } }
