/* Study-note links and drawings */
.study-embedded-diagram{display:grid;gap:7px;width:min(var(--study-embed-width,100%),100%);margin:14px 0;padding:9px;border:1px solid var(--border);border-radius:7px;background:var(--surface-1);box-shadow:0 8px 24px rgba(20,34,48,.08)}
.study-embedded-diagram.align-left{margin-right:auto}.study-embedded-diagram.align-center{margin-right:auto;margin-left:auto}.study-embedded-diagram.align-right{margin-left:auto}
.study-embedded-diagram>svg{display:block;width:100%;height:auto;min-height:120px;max-height:430px;border:1px solid color-mix(in srgb,var(--border) 76%,transparent);background:transparent;object-fit:contain}
.study-embedded-diagram.bg-white>svg{background:#fff}.study-embedded-diagram.bg-paper>svg{background:#fffdf7}.study-embedded-diagram.bg-sky>svg{background:#f3f9fd}.study-embedded-diagram.bg-grid>svg{background-color:#fbfdff;background-image:linear-gradient(rgba(45,114,171,.09) 1px,transparent 1px),linear-gradient(90deg,rgba(45,114,171,.09) 1px,transparent 1px);background-size:20px 20px}.study-embedded-diagram.bg-transparent>svg{background:transparent}
.study-embedded-diagram figcaption{display:flex;align-items:center;justify-content:space-between;gap:10px;color:var(--text-muted);font-size:9px;font-weight:700}.study-embedded-diagram figcaption>span{display:inline-flex;align-items:center;gap:5px}.study-embedded-controls{display:flex;align-items:center;gap:5px}.study-embedded-controls button{display:grid;place-items:center;width:29px;height:29px;padding:0;border:1px solid var(--border);border-radius:5px;background:var(--surface-1);color:var(--text-secondary);cursor:pointer}.study-embedded-controls button:hover,.study-embedded-controls button:focus-visible{border-color:var(--accent);background:var(--accent-bg);color:var(--accent-text)}
.study-linked-highlight{padding:.03em .1em;border-radius:3px;box-decoration-break:clone;-webkit-box-decoration-break:clone;color:#1f2933!important;cursor:pointer;transition:box-shadow .15s ease,filter .15s ease}.study-linked-highlight:hover,.study-linked-highlight:focus-visible{outline:0;box-shadow:0 0 0 2px color-mix(in srgb,var(--accent) 48%,transparent);filter:saturate(1.04)}
.study-linked-highlight.color-yellow{background:#fff0a6}.study-linked-highlight.color-cyan{background:#bff2f0}.study-linked-highlight.color-magenta{background:#f3c3eb}.study-linked-highlight.color-green{background:#cceec8}.study-linked-highlight.color-pink{background:#ffd1da}
.study-highlight-toolbar,.study-highlight-popover{position:fixed;z-index:3450;border:1px solid var(--border-strong);border-radius:8px;background:var(--surface-1);color:var(--text);box-shadow:0 18px 48px rgba(7,22,36,.24)}
.study-highlight-toolbar{display:grid;grid-template-columns:minmax(185px,1fr) auto auto;align-items:end;gap:9px;width:min(390px,calc(100vw - 20px));padding:10px}.study-highlight-toolbar label{display:grid;gap:4px}.study-highlight-toolbar label>span{color:var(--text-muted);font-size:8px;font-weight:800;letter-spacing:.05em;text-transform:uppercase}.study-highlight-toolbar input{width:100%;height:36px;padding:0 9px;border:1px solid var(--border-strong);border-radius:5px;background:var(--surface-1);color:var(--text);font:700 11px var(--font)}
.study-highlight-colors{display:flex;align-items:center;gap:4px}.study-highlight-colors button{width:25px;height:25px;padding:0;border:2px solid var(--surface-1);border-radius:50%;box-shadow:0 0 0 1px var(--border-strong);cursor:pointer}.study-highlight-colors button[aria-pressed="true"]{box-shadow:0 0 0 2px var(--accent)}.study-highlight-colors [data-highlight-color="yellow"]{background:#fff0a6}.study-highlight-colors [data-highlight-color="cyan"]{background:#bff2f0}.study-highlight-colors [data-highlight-color="magenta"]{background:#f3c3eb}.study-highlight-colors [data-highlight-color="green"]{background:#cceec8}.study-highlight-colors [data-highlight-color="pink"]{background:#ffd1da}
.study-highlight-toolbar>[data-highlight-create]{display:inline-flex;align-items:center;justify-content:center;gap:5px;min-height:36px;padding:7px 10px;border:1px solid var(--accent);border-radius:5px;background:var(--accent);color:#fff;font:800 9px var(--font);cursor:pointer}
.study-highlight-popover{width:min(440px,calc(100vw - 24px));padding:16px}.study-highlight-popover header{display:flex;align-items:center;justify-content:space-between;gap:14px}.study-highlight-popover header>span{display:inline-flex;align-items:center;gap:6px;color:var(--accent-text);font-size:9px;font-weight:800;letter-spacing:.06em;text-transform:uppercase}.study-highlight-popover header button{display:grid;place-items:center;width:32px;height:32px;padding:0;border:0;border-radius:6px;background:var(--surface-2);color:var(--text-secondary);font-size:17px;cursor:pointer}.study-highlight-popover h3{margin:11px 0 8px;font-size:17px}.study-highlight-popover blockquote{margin:0 0 11px;padding:10px 12px;border-left:4px solid var(--accent);background:var(--accent-bg);color:var(--text-secondary);font-size:11.5px;line-height:1.55}.study-highlight-note-preview{max-height:190px;overflow:auto;font-size:11.5px;line-height:1.55}.study-highlight-popover footer{display:flex;align-items:center;justify-content:flex-end;gap:7px;margin-top:13px;padding-top:11px;border-top:1px solid var(--border)}.study-highlight-popover footer button{display:inline-flex;align-items:center;justify-content:center;gap:5px;min-width:36px;min-height:36px;padding:7px 10px;border:1px solid var(--border-strong);border-radius:6px;background:var(--surface-1);color:var(--text-secondary);font:700 10.5px var(--font);cursor:pointer}.study-highlight-popover footer .study-highlight-delete{width:36px;padding:0;border-color:color-mix(in srgb,var(--danger-text) 42%,var(--border));color:var(--danger-text)}.study-highlight-popover footer .study-highlight-delete:hover,.study-highlight-popover footer .study-highlight-delete:focus-visible{border-color:var(--danger-text);background:var(--danger-bg)}.study-highlight-popover footer .btn-accent{border-color:var(--accent);background:var(--accent);color:#fff}
@media(max-width:620px){.study-highlight-toolbar{grid-template-columns:1fr auto}.study-highlight-colors{grid-column:1}.study-highlight-toolbar>[data-highlight-create]{grid-column:2;grid-row:1/3}.study-highlight-popover footer{align-items:stretch;display:grid;grid-template-columns:repeat(2,1fr)}.study-highlight-popover footer button{width:100%}.study-embedded-diagram{--study-embed-width:100%!important}}
