/* Interactive graphs in notes (static/js/study_graphs.js). */
.sg-card {
  --sg-ink: #1f2937; --sg-muted: #6b7280; --sg-grid: #e5e7eb; --sg-bg: #ffffff; --sg-edge: #dbe4f0;
  --sg-a: #2563eb; --sg-b: #d9480f; --sg-c: #0f766e; --sg-a-fill: rgba(37, 99, 235, .14); --sg-b-fill: rgba(217, 72, 15, .14);
  margin: 1.25rem 0; padding: 14px 14px 12px; border: 1px solid var(--sg-edge); border-radius: 14px;
  background: var(--sg-bg); color: var(--sg-ink); max-width: 560px;
}
[data-theme="dark"] .sg-card {
  --sg-ink: #e5e7eb; --sg-muted: #9ca3af; --sg-grid: #334155; --sg-bg: #111827; --sg-edge: #334155;
  --sg-a: #60a5fa; --sg-b: #fb923c; --sg-c: #2dd4bf; --sg-a-fill: rgba(96, 165, 250, .18); --sg-b-fill: rgba(251, 146, 60, .18);
}
.sg-head { margin-bottom: 6px; font-size: .98rem; }
.sg-badge {
  display: inline-block; font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: #fff; background: var(--sg-a); border-radius: 999px; padding: 2px 8px; vertical-align: 1px;
}
.sg-hint { color: var(--sg-muted); font-size: .85rem; margin-top: 4px; }
.sg-svg { display: block; width: 100%; height: auto; touch-action: pan-y; }
.sg-svg .sg-axis { stroke: var(--sg-ink); stroke-width: 1.2; }
.sg-svg .sg-grid { stroke: var(--sg-grid); stroke-width: 1; }
.sg-svg .sg-tick { fill: var(--sg-muted); font-size: 10px; }
.sg-svg .sg-label { fill: var(--sg-ink); font-size: 11px; font-weight: 600; }
.sg-svg .sg-line-a { fill: none; stroke: var(--sg-a); stroke-width: 2.6; }
.sg-svg .sg-line-b { fill: none; stroke: var(--sg-b); stroke-width: 2.6; }
.sg-svg .sg-line-c { fill: none; stroke: var(--sg-c); stroke-width: 2; stroke-dasharray: 6 4; }
.sg-svg .sg-guide { fill: none; stroke: var(--sg-muted); stroke-width: 1.2; stroke-dasharray: 3 3; }
.sg-svg .sg-area-a { fill: var(--sg-a-fill); }
.sg-svg .sg-area-b { fill: var(--sg-b-fill); }
.sg-svg .sg-dot { fill: var(--sg-ink); stroke: var(--sg-bg); stroke-width: 2; }
.sg-svg .sg-pt { fill: var(--sg-a); stroke: var(--sg-bg); stroke-width: 1.5; }
.sg-svg .sg-dot-bad { fill: #dc2626; stroke: var(--sg-bg); stroke-width: 1.5; }
.sg-svg .sg-tag-a { fill: var(--sg-a); font-size: 11px; font-weight: 700; }
.sg-svg .sg-tag-b { fill: var(--sg-b); font-size: 11px; font-weight: 700; }
.sg-svg .sg-tag-c { fill: var(--sg-c); font-size: 10px; font-weight: 600; }
.sg-controls { margin-top: 8px; }
.sg-slider { margin-bottom: 4px; }
.sg-slider label { display: flex; justify-content: space-between; font-size: .85rem; font-weight: 600; margin-bottom: 0; }
.sg-slider output { font-variant-numeric: tabular-nums; color: var(--sg-muted); }
.sg-check { font-size: .85rem; margin: 6px 0; }
.sg-readout { margin-top: 8px; font-size: .9rem; line-height: 1.5; padding: 8px 10px; border-radius: 10px; background: rgba(127, 127, 127, .08); }
.sg-key-a { color: var(--sg-a); font-weight: 600; }
.sg-key-b { color: var(--sg-b); font-weight: 600; }
.sg-table-wrap { overflow-x: auto; max-width: 100%; }
.sg-slider input[type=range] { width: 100%; }
.sg-table { font-size: .85rem; color: var(--sg-ink); margin-bottom: 0; }
.sg-table th { font-weight: 600; white-space: nowrap; color: var(--sg-ink); background: transparent; }
.sg-table td { background: transparent; color: var(--sg-ink); }
.sg-table input { min-width: 4.5em; max-width: 7em; }
.sg-table .sg-rhod { font-variant-numeric: tabular-nums; }
@media print { .sg-controls, .sg-hint { display: none; } }

/* 3D models in notes (static/js/study_3d.js). */
.s3-open {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 120px;
  margin-top: 6px; border: 1px dashed var(--sg-edge); border-radius: 12px; background: rgba(37, 99, 235, .06);
  color: var(--sg-a); font-weight: 700; font-size: 1rem;
}
.s3-open:disabled { opacity: .7; }
.s3-cube {
  width: 34px; height: 34px; border: 3px solid currentColor; border-radius: 4px; transform: rotate(45deg) skew(-8deg, -8deg);
  box-shadow: 6px -6px 0 -1px rgba(37, 99, 235, .35);
}
.s3-stage { position: relative; border-radius: 12px; overflow: hidden; background: radial-gradient(circle at 50% 40%, rgba(127,127,127,.10), transparent 70%); }
.s3-stage canvas { display: block; cursor: grab; }
.s3-tools { position: absolute; right: 6px; top: 6px; display: flex; flex-direction: column; gap: 6px; }
.s3-btn {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--sg-edge); background: var(--sg-bg);
  color: var(--sg-ink); font-size: 1.05rem; line-height: 1; padding: 0;
}
.s3-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 8px 0 4px; }
.s3-chip {
  border: 1px solid var(--sg-edge); background: transparent; color: var(--sg-ink); border-radius: 999px;
  padding: 4px 11px; font-size: .82rem; min-height: 32px;
}
.s3-chip.active { background: var(--sg-a); border-color: var(--sg-a); color: #fff; }
.s3-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .78rem; color: var(--sg-muted); margin: 4px 0; }
.s3-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; border: 1px solid rgba(0,0,0,.25); vertical-align: -1px; }
.s3-netbox { margin-top: 8px; font-size: .88rem; }
.s3-netbox summary { cursor: pointer; font-weight: 600; color: var(--sg-a); }
.s3-net { display: block; width: 100%; max-height: 280px; margin-top: 6px; }
.s3-net rect, .s3-net polygon, .s3-net circle { fill: rgba(37, 99, 235, .12); stroke: var(--sg-a); stroke-width: 1.5px; vector-effect: non-scaling-stroke; }
.s3-sheet { margin-top: 8px; padding: 8px; border: 1px solid var(--sg-edge); border-radius: 10px; background: #fff; }
.s3-sheet svg { display: block; width: 100%; max-height: 320px; }
.s3-sheet .s3-vis { stroke: #0f172a; stroke-width: 2px; vector-effect: non-scaling-stroke; stroke-linecap: round; }
.s3-sheet .s3-hid { stroke: #0f172a; stroke-width: 1.3px; stroke-dasharray: 5 4; vector-effect: non-scaling-stroke; }
.s3-sheet .s3-xy { stroke: #64748b; stroke-width: 1px; vector-effect: non-scaling-stroke; }
.s3-sheet .s3-cap { font-size: .42px; fill: #475569; text-anchor: middle; }
.s3-seq { max-width: 16em; font-family: ui-monospace, Menlo, monospace; letter-spacing: .06em; text-transform: uppercase; }
