/* Shared presentation for the AI series; numerical state lives in page scripts. */
.ai-widget { scroll-margin-top: 80px; margin: 2rem 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: #11121c; }
.ai-widget .widget-title { margin: 0; padding: 1rem 1.25rem; font-size: 1rem; background: #181a28; color: #eeeef4; }
.ai-widget .widget-controls { display: flex; flex-wrap: wrap; gap: .8rem 1.2rem; align-items: center; padding: 1rem 1.25rem; }
.ai-widget label { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; font-size: .8rem; color: #c5c9dc; }
.ai-widget input[type=range] { width: 118px; accent-color: #a78bfa; }
.ai-widget select, .ai-widget button { background: #25283a; border: 1px solid #4c526d; border-radius: 6px; color: #edeefa; font: inherit; font-size: .8rem; padding: .4rem .7rem; cursor: pointer; }
.ai-widget button[aria-pressed=true] { background: #4c377d; }
.ai-widget button:focus-visible, .ai-widget select:focus-visible, .ai-widget input:focus-visible { outline: 2px solid #c4b5fd; outline-offset: 3px; }
.ai-widget canvas { display: block; width: 100%; height: 310px; background: #0d1019; }
.ai-widget .widget-readout { padding: .8rem 1.25rem; color: #dddff1; font: .8rem/1.7 ui-monospace, monospace; border-top: 1px solid #282c40; overflow-wrap: anywhere; }
.ai-widget .widget-caption { margin: 0; padding: .9rem 1.25rem 1.1rem; font-size: .85rem; color: #b5bdd1; line-height: 1.6; }
.ai-equation { display: block; margin: 1.5rem 0; padding: 1.2rem; border-left: 3px solid #a78bfa; background: #151724; font: 1rem/1.9 ui-monospace, monospace; overflow-x: auto; }
.ai-equation .tip { white-space: nowrap; }
.ai-article .tip::before, .ai-article .tip::after { display: none; }
.ai-tooltip { position: fixed; z-index: 100; max-width: min(290px, calc(100vw - 24px)); padding: .7rem .9rem; border: 1px solid #58607d; border-radius: 8px; background: #181c2c; color: #eef0fa; font: .85rem/1.5 system-ui, sans-serif; box-shadow: 0 8px 24px #0008; pointer-events: none; }
.ai-symbols { color: var(--muted); font-size: .9rem; }
.ai-series-list { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.5rem 0; }
.ai-series-list a { border: 1px solid var(--border); border-radius: 6px; padding: .4rem .7rem; font-size: .8rem; }
.ai-series-list a[aria-current=page] { border-color: #a78bfa; color: #c4b5fd; }
.ai-table-wrap { overflow-x: auto; margin: 1.5rem 0; }
.ai-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.ai-table td, .ai-table th { padding: .65rem; border: 1px solid var(--border); text-align: left; }
.ai-table th { color: #c4b5fd; background: #171925; }
@media (max-width: 600px) {
  .ai-widget canvas { height: 350px; }
  .ai-widget .widget-controls { padding: .8rem; gap: .75rem; }
  .ai-widget label { width: 100%; justify-content: space-between; }
  .ai-widget .widget-title, .ai-widget .widget-readout, .ai-widget .widget-caption { padding-left: .8rem; padding-right: .8rem; }
  .ai-equation { font-size: .85rem; padding: .8rem; }
}

@media (max-width: 600px) { .ai-widget[data-panels="3"] canvas { height: 740px; } .ai-widget[data-panels="2"] canvas { height: 460px; } }
@media (max-width: 600px) { .ai-widget.ai-grid-pair canvas { height: 570px; } }

.ai-widget button:disabled { opacity: .45; cursor: default; }
