:root {
  color-scheme: dark;
  --bg: #07101b;
  --bg-soft: #0a1523;
  --panel: rgba(14, 27, 42, .92);
  --panel-strong: #101e2f;
  --border: rgba(145, 169, 195, .15);
  --border-strong: rgba(145, 169, 195, .26);
  --text: #edf4fb;
  --muted: #8da1b6;
  --faint: #5d7187;
  --mint: #64e7b3;
  --cyan: #61c9e8;
  --amber: #f4c66b;
  --red: #ff777f;
  --shadow: 0 24px 70px rgba(0, 0, 0, .22);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 1180px; min-height: 100vh; background: radial-gradient(circle at 60% -10%, #14304d 0, transparent 42%), var(--bg); color: var(--text); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

.app-shell { min-height: 100vh; }
.topbar { height: 76px; display: flex; align-items: center; justify-content: space-between; padding: 0 28px; border-bottom: 1px solid var(--border); background: rgba(5, 13, 23, .84); backdrop-filter: blur(18px); position: sticky; top: 0; z-index: 10; }
.brand-lockup, .topbar-actions, .editor-heading, .editor-heading-meta, .panel-heading, .section-heading, .canvas-toolbar, .canvas-footer, .note-footer-row, .sim-actions, .snapshot-summary, .privacy-card { display: flex; align-items: center; }
.brand-lockup { gap: 11px; }
.brand-mark { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 10px; background: linear-gradient(135deg, #65e5b0, #3e94b6); color: #07121b; font-weight: 900; font-size: 12px; letter-spacing: -.05em; }
.brand-name { font-size: 14px; font-weight: 800; letter-spacing: .02em; }
.brand-subtitle { color: var(--muted); font-size: 11px; margin-top: 2px; }
.topbar-actions { gap: 9px; }
.local-pill, .read-only-badge, .private-label, .sim-label { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border-radius: 999px; border: 1px solid rgba(100, 231, 179, .22); background: rgba(100, 231, 179, .08); color: #a3f1ce; font-size: 11px; font-weight: 700; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 12px var(--mint); }
.ghost-button, .primary-button, .toolbar-action, .tool-button, .trade-button { border: 1px solid var(--border); color: var(--text); background: rgba(255, 255, 255, .03); border-radius: 8px; transition: .16s ease; }
.ghost-button { padding: 9px 12px; font-size: 12px; }
.ghost-button:hover, .toolbar-action:hover, .tool-button:hover { border-color: var(--border-strong); background: rgba(255, 255, 255, .08); }
.primary-button { padding: 10px 14px; border-color: rgba(100, 231, 179, .4); background: var(--mint); color: #06151a; font-weight: 800; font-size: 12px; box-shadow: 0 7px 22px rgba(100, 231, 179, .12); }
.primary-button:hover { background: #8bf1c9; transform: translateY(-1px); }
.small-button { padding: 8px 11px; font-size: 11px; }

.workspace-layout { display: grid; grid-template-columns: 252px minmax(660px, 1fr) 258px; gap: 18px; padding: 23px 25px 30px; max-width: 1800px; margin: 0 auto; }
.panel-surface { background: linear-gradient(145deg, rgba(16, 31, 48, .95), rgba(10, 21, 34, .9)); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); }
.library-panel, .inspector-panel { min-height: calc(100vh - 130px); padding: 18px; }
.panel-heading { justify-content: space-between; gap: 12px; }
.panel-heading h1, .editor-heading h2, .section-heading h3, .compact-heading h3 { margin: 3px 0 0; letter-spacing: -.025em; }
.panel-heading h1 { font-size: 16px; }
.editor-heading h2 { font-size: 20px; }
.section-heading h3, .compact-heading h3 { font-size: 15px; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; color: var(--cyan); font-weight: 800; font-size: 9px; }
.count-badge { min-width: 25px; height: 25px; display: grid; place-items: center; border-radius: 8px; background: rgba(97, 201, 232, .12); color: var(--cyan); font-weight: 800; font-size: 11px; }
.panel-description, .helper-copy, .sim-footnote { color: var(--muted); font-size: 11px; line-height: 1.55; }
.panel-description { margin: 14px 0 18px; }
.workspace-list { display: grid; gap: 8px; }
.empty-library { min-height: 215px; border: 1px dashed var(--border-strong); border-radius: 11px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 25px 15px; color: var(--muted); font-size: 11px; }
.empty-library strong { color: var(--text); font-size: 12px; }
.empty-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: rgba(100, 231, 179, .1); color: var(--mint); font-size: 20px; margin-bottom: 5px; }
.workspace-card { padding: 9px; border: 1px solid var(--border); border-radius: 10px; background: rgba(255, 255, 255, .025); text-align: left; color: var(--text); }
.workspace-card:hover, .workspace-card.active { border-color: rgba(100, 231, 179, .5); background: rgba(100, 231, 179, .06); }
.workspace-card-preview { width: 100%; height: 76px; object-fit: cover; border-radius: 7px; background: #091321; display: grid; place-items: center; color: var(--faint); font-size: 10px; }
.workspace-card-title { display: block; font-weight: 800; font-size: 11px; margin: 9px 2px 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace-card-meta { display: block; color: var(--muted); font-size: 10px; margin: 0 2px; }
.library-footer { margin-top: auto; padding-top: 20px; display: flex; flex-direction: column; gap: 7px; }
.link-button { border: 0; padding: 0; color: var(--cyan); background: transparent; text-align: left; font-size: 11px; }
.storage-note { color: var(--faint); font-size: 10px; }

.editor-panel { min-width: 0; }
.editor-heading { justify-content: space-between; padding: 2px 2px 14px; }
.editor-heading-meta { gap: 12px; color: var(--muted); font-size: 10px; }
.canvas-card { overflow: hidden; }
.canvas-toolbar { justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid var(--border); gap: 12px; flex-wrap: wrap; align-items: flex-start; }
.toolbar-group { display: flex; align-items: center; gap: 5px; }
.tool-button, .toolbar-action { width: 29px; height: 29px; display: grid; place-items: center; padding: 0; font-size: 14px; }
.tool-button.active { color: #07151d; border-color: var(--mint); background: var(--mint); }
.toolbar-action { font-size: 13px; }
.danger-action { width: auto; padding: 0 9px; color: #f7a4a9; }
.tool-palette { min-width: 0; flex: 1 1 720px; display: flex; align-items: flex-start; gap: 9px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.tool-family { display: block; flex: 0 0 auto; padding-right: 9px; border-right: 1px solid var(--border); }
.tool-family:last-child { border-right: 0; padding-right: 0; }
.tool-family-label { display: block; margin: 0 0 5px 2px; color: var(--faint); font-size: 8px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.tool-grid { display: flex; flex-wrap: wrap; gap: 4px; max-width: 250px; }
.tool-button { font-size: 10px; font-weight: 800; letter-spacing: -.03em; }
.toolbar-controls { flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; }
.control-label { color: var(--muted); font-size: 10px; margin-left: 7px; }
.color-input { width: 25px; height: 25px; padding: 2px; border: 1px solid var(--border); border-radius: 7px; background: transparent; }
.range-input { width: 70px; accent-color: var(--mint); }
.canvas-stage { position: relative; min-height: 450px; background: #08111d; display: grid; place-items: center; overflow: hidden; }
#annotationCanvas { width: 100%; height: auto; max-height: 68vh; display: block; object-fit: contain; background: #091420; touch-action: none; }
.canvas-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; color: var(--muted); pointer-events: none; background: radial-gradient(circle at center, rgba(34, 66, 89, .22), transparent 55%); }
.canvas-empty.hidden { display: none; }
.canvas-empty strong { color: var(--text); font-size: 14px; }
.canvas-empty span { font-size: 11px; }
.upload-orb { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid rgba(100, 231, 179, .35); border-radius: 14px; color: var(--mint); background: rgba(100, 231, 179, .08); font-size: 22px; }
.empty-actions { display: flex; gap: 8px; margin-top: 7px; pointer-events: auto; }
.canvas-footer { justify-content: space-between; padding: 10px 13px; border-top: 1px solid var(--border); color: var(--muted); font-size: 10px; gap: 12px; }
.canvas-hint { display: flex; align-items: center; gap: 4px; }
.hint-key { border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 4px; padding: 2px 4px; color: var(--text); font-size: 9px; }
.viewport-controls { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.viewport-controls #zoomLabel { min-width: 42px; color: var(--text); text-align: center; font-variant-numeric: tabular-nums; }
.viewport-controls .toolbar-action { width: 25px; height: 25px; }
.canvas-actions { display: flex; align-items: center; gap: 10px; }

.lower-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 18px; margin-top: 18px; }
.note-panel, .simulation-panel { padding: 17px; }
.section-heading { justify-content: space-between; gap: 8px; margin-bottom: 17px; }
.note-panel .section-heading .small-button { margin-left: auto; }
.private-label { padding: 5px 8px; color: #c3b7f4; background: rgba(164, 143, 242, .1); border-color: rgba(164, 143, 242, .2); }
.field-label { display: block; color: var(--muted); font-size: 10px; font-weight: 700; margin: 0 0 6px; }
.text-input, .note-textarea { width: 100%; border: 1px solid var(--border); border-radius: 8px; color: var(--text); background: rgba(4, 12, 22, .6); outline: none; padding: 10px 11px; font-size: 12px; }
.text-input:focus, .note-textarea:focus { border-color: rgba(97, 201, 232, .55); box-shadow: 0 0 0 3px rgba(97, 201, 232, .08); }
.note-meta-grid, .sim-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.note-textarea { min-height: 128px; resize: vertical; margin-top: 12px; line-height: 1.55; }
.note-footer-row { gap: 8px; margin-top: 11px; }
.note-footer-row .text-input { flex: 1; }
.price-source-card { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; padding: 10px 12px; border: 1px solid rgba(97, 201, 232, .2); border-radius: 9px; background: rgba(97, 201, 232, .055); }
.price-source-card strong { display: inline-block; margin-right: 8px; color: var(--cyan); font-size: 16px; letter-spacing: -.03em; }
.price-source-status { color: var(--muted); font-size: 9px; }
.market-data-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 9px 0; }
.market-data-grid > div { min-width: 0; padding: 7px 6px; border: 1px solid var(--border); border-radius: 7px; background: rgba(4, 12, 22, .34); }
.market-data-grid strong { display: block; overflow: hidden; color: var(--text); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.market-data-stamp { margin: 0 1px 9px; color: var(--faint); font-size: 9px; }
.sim-status-card { display: grid; grid-template-columns: repeat(4, 1fr); padding: 12px; gap: 10px; border: 1px solid var(--border); border-radius: 9px; background: rgba(4, 12, 22, .45); }
.sim-status-card div { min-width: 0; }
.muted-label { display: block; color: var(--muted); font-size: 9px; margin-bottom: 4px; }
.sim-status-card strong { font-size: 13px; }
.positive-number { color: var(--mint); }
.sim-actions { gap: 7px; margin-top: 12px; }
.trade-button { flex: 1; padding: 10px 7px; font-size: 10px; font-weight: 800; }
.long-button { border-color: rgba(100, 231, 179, .3); color: #a3f1ce; background: rgba(100, 231, 179, .08); }
.short-button { border-color: rgba(255, 119, 127, .3); color: #ffadb3; background: rgba(255, 119, 127, .08); }
.sim-tools-row { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.mini-tool-button { border: 1px solid var(--border); border-radius: 999px; padding: 5px 8px; color: var(--muted); background: rgba(255, 255, 255, .025); font-size: 9px; }
.mini-tool-button:hover { border-color: var(--border-strong); color: var(--text); background: rgba(255, 255, 255, .08); }
.fee-line { margin-top: 11px; color: var(--faint); font-size: 9px; line-height: 1.45; }
.fee-line strong { color: var(--amber); }
.history-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: 13px; color: var(--text); font-size: 10px; }
.history-heading span { color: var(--muted); font-size: 9px; }
.trade-history { display: grid; gap: 5px; max-height: 150px; overflow: auto; margin-top: 7px; }
.history-empty { padding: 9px; border: 1px dashed var(--border); border-radius: 7px; color: var(--faint); font-size: 9px; }
.trade-history-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 8px; border: 1px solid var(--border); border-radius: 7px; background: rgba(255, 255, 255, .025); }
.trade-history-row strong, .trade-history-row span { display: block; }
.trade-history-row strong { font-size: 9px; }
.trade-history-row span { margin-top: 3px; color: var(--muted); font-size: 8px; }
.trade-history-values { text-align: right; }
.trade-history-values b { display: block; color: var(--text); font-size: 9px; }
.trade-history-values span { font-size: 10px; }
.negative-number { color: var(--red) !important; }
.sim-footnote { margin: 13px 0 0; font-size: 10px; }

.inspector-panel { display: flex; flex-direction: column; }
.compact-heading { margin-bottom: 16px; }
.snapshot-icon { color: var(--cyan); font-size: 22px; }
.snapshot-summary { align-items: flex-start; gap: 10px; }
.snapshot-preview { width: 76px; height: 58px; flex: 0 0 auto; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--border); border-radius: 8px; background: #091420; color: var(--faint); font-size: 9px; text-align: center; }
.snapshot-preview img { width: 100%; height: 100%; object-fit: cover; }
.snapshot-info { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.snapshot-info strong { font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.snapshot-info span { color: var(--muted); font-size: 10px; line-height: 1.45; }
.inspector-divider { height: 1px; background: var(--border); margin: 19px 0; }
.inspector-section-heading { font-size: 11px; font-weight: 800; margin-bottom: 11px; }
.check-row { display: flex; gap: 8px; align-items: center; color: var(--text); font-size: 11px; }
.check-row input { accent-color: var(--mint); }
.helper-copy { margin: 8px 0 0; font-size: 10px; }
.full-button { width: 100%; margin-top: 5px; }
.privacy-card { gap: 9px; margin-top: auto; padding: 11px; border: 1px solid rgba(100, 231, 179, .17); border-radius: 9px; background: rgba(100, 231, 179, .055); }
.privacy-icon { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 7px; background: rgba(100, 231, 179, .12); color: var(--mint); }
.privacy-card strong, .privacy-card span { display: block; }
.privacy-card strong { font-size: 10px; }
.privacy-card span { margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.4; }

.toast { position: fixed; right: 24px; bottom: 24px; z-index: 30; transform: translateY(12px); opacity: 0; pointer-events: none; padding: 11px 14px; border: 1px solid rgba(100, 231, 179, .3); border-radius: 9px; background: #0d221f; color: #b8f5d8; box-shadow: var(--shadow); font-size: 11px; transition: .2s ease; }
.toast.show { transform: translateY(0); opacity: 1; }

@media (max-width: 1280px) {
  body { min-width: 1020px; }
  .workspace-layout { grid-template-columns: 220px minmax(600px, 1fr) 230px; gap: 12px; padding-left: 15px; padding-right: 15px; }
  .library-panel, .inspector-panel { padding: 14px; }
}

/* Compact layout used by the same-origin side panel inside nq.ocscreener.com. */
html.embed-mode body { min-width: 0; min-height: 100%; }
html.embed-mode .topbar { height: 58px; padding: 0 14px; position: sticky; }
html.embed-mode .brand-mark { width: 29px; height: 29px; border-radius: 8px; }
html.embed-mode .brand-subtitle, html.embed-mode .local-pill { display: none; }
html.embed-mode .topbar-actions { gap: 5px; }
html.embed-mode .topbar-actions .ghost-button:first-of-type { display: none; }
html.embed-mode .workspace-layout { display: block; padding: 12px; min-height: 100vh; }
html.embed-mode .library-panel, html.embed-mode .inspector-panel { display: none; }
html.embed-mode .editor-heading { padding: 0 2px 10px; }
html.embed-mode .editor-heading h2 { font-size: 16px; }
html.embed-mode .canvas-stage { min-height: 300px; }
html.embed-mode #annotationCanvas { max-height: 42vh; }
html.embed-mode .lower-grid { grid-template-columns: 1fr; gap: 10px; margin-top: 10px; }
html.embed-mode .note-panel, html.embed-mode .simulation-panel { padding: 12px; }
html.embed-mode .note-textarea { min-height: 82px; }
html.embed-mode .market-data-grid { grid-template-columns: repeat(5, 1fr); }
html.embed-mode .trade-history { max-height: 112px; }
