/*
 * Stand widgets: styles for the statistics board (parent side) and for the
 * widget chrome injected into stand windows. Copy: tools/build_demo_stands.cjs
 * -> assets/live/_shared/stand-widgets.css
 */
.ds-board {
  --ud-up: #3DDC84;
  --ud-down: #FF6B6B;
  --ud-accent2: #6EA8FF;
  --ud-accent: #4C7DFF;
  --ud-muted: #8FA0C0;
  --ud-muted2: #7C8CA8;
  --ud-text: #E8EEFB;
  --ud-text2: #C7D3EA;
  --ud-line: rgba(124, 141, 255, .22);
  --ud-surface3: #101B36;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  background: #0A1224;
  color: var(--ud-text);
  font-family: 'Onest', 'Segoe UI', Arial, sans-serif;
}
.ds-board .bw {
  grid-column: span 12;
  border: 1px solid var(--ud-line);
  border-radius: 10px;
  background: var(--ud-surface3);
  overflow: hidden;
}
.ds-board .bw-w3 { grid-column: span 3; }
.ds-board .bw-w4 { grid-column: span 4; }
.ds-board .bw-w6 { grid-column: span 6; }
.ds-board .bw-w8 { grid-column: span 8; }
@media (max-width: 900px) {
  .ds-board .bw-w3, .ds-board .bw-w4, .ds-board .bw-w6, .ds-board .bw-w8 { grid-column: span 12; }
}
.ds-board .bw-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--ud-line);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ud-text2);
}
.ds-board .bw-chip {
  margin-left: auto;
  padding: 2px 8px;
  border: 1px solid var(--ud-line);
  border-radius: 999px;
  color: var(--ud-muted);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .08em;
}
.ds-board .bw-body { padding: 8px 10px 10px; }
.ds-board .bw-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.ds-board .bw-kpi { border: 1px solid var(--ud-line); border-radius: 8px; padding: 8px 10px; background: rgba(255, 255, 255, .02); }
.ds-board .bw-kpi b { display: block; font-size: 17px; font-weight: 700; color: var(--ud-text); }
.ds-board .bw-kpi span { display: block; margin-top: 2px; font-size: 10px; color: var(--ud-muted); }
.ds-board .bw-kpi .lb { font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.ds-board table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.ds-board th { text-align: left; padding: 4px 6px; color: var(--ud-muted); font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase; border-bottom: 1px solid var(--ud-line); }
.ds-board td { padding: 4px 6px; border-bottom: 1px solid rgba(124, 141, 255, .1); }
.ds-board td.num, .ds-board th.num { text-align: right; font-variant-numeric: tabular-nums; }
.ds-board svg { display: block; width: 100%; height: auto; }
.ds-board .bw-drag { cursor: grab; }
.ds-board .bw-drag:active { cursor: grabbing; }
.ds-board .bw.dragging { opacity: .55; outline: 1px dashed var(--ud-accent2); }
.ds-board .bw-handle { display: inline-flex; gap: 2px; color: var(--ud-muted2); font-size: 12px; line-height: 1; cursor: grab; }

/* Chrome of the signature chart widget injected into a live window. */
.ud-drag-widget { position: relative; }
.ud-drag-widget .widget-grip { position: absolute; top: 7px; right: 9px; color: var(--ud-muted2, #7C8CA8); font-size: 12px; line-height: 1; cursor: grab; letter-spacing: 1px; }
.ud-drag-widget .widget-grip::before { content: '\2261'; }
.ud-win-body.ud-dragging * { user-select: none; }
.sc-svg { display: block; width: 100%; height: auto; }

/* The statistics board assembles itself when its tab opens: every widget rises
   in a short cascade (the board markup is rebuilt on the first open). */
.ds-board .bw { animation: bwIn .46s cubic-bezier(.2, .7, .3, 1) both; }
.ds-board .bw:nth-child(1) { animation-delay: 0ms; }
.ds-board .bw:nth-child(2) { animation-delay: 55ms; }
.ds-board .bw:nth-child(3) { animation-delay: 110ms; }
.ds-board .bw:nth-child(4) { animation-delay: 165ms; }
.ds-board .bw:nth-child(5) { animation-delay: 220ms; }
.ds-board .bw:nth-child(6) { animation-delay: 275ms; }
.ds-board .bw:nth-child(7) { animation-delay: 330ms; }
.ds-board .bw:nth-child(8) { animation-delay: 385ms; }
.ds-board .bw:nth-child(9) { animation-delay: 440ms; }
.ds-board .bw:nth-child(10) { animation-delay: 495ms; }
.ds-board .bw:nth-child(n+11) { animation-delay: 550ms; }
@keyframes bwIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .ds-board .bw { animation: none; }
}

/* Live chart widget: the real chart library window embedded into a product
 * screen, scaled to the widget width so the workspace stays fully usable. */
.ud-drag-widget.lc-panel .lc-view { position: relative; overflow: hidden; height: 360px; }
.lc-view .lc-frame { border: 0; display: block; background: transparent; }
.lc-live { width: 8px; height: 8px; margin-left: 8px; border-radius: 50%; background: #3ddc84; box-shadow: 0 0 0 0 rgba(61, 220, 132, 0.5); animation: lcPulse 2.2s ease-out infinite; }
@keyframes lcPulse {
  0% { box-shadow: 0 0 0 0 rgba(61, 220, 132, 0.5); }
  70% { box-shadow: 0 0 0 9px rgba(61, 220, 132, 0); }
  100% { box-shadow: 0 0 0 0 rgba(61, 220, 132, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .lc-live { animation: none; }
}
