[data-toantin-tool="chart_builder"] {
  --cb-primary: var(--tt-host-primary, #1667e8);
  --cb-primary-strong: var(--tt-host-primary-strong, #0d5bef);
  --cb-primary-soft: var(--tt-host-primary-soft, #eaf3ff);
  --cb-cyan: var(--tt-host-cyan, #38bdf8);
  --cb-navy: var(--tt-host-navy, #0f1f4b);
  --cb-bg: var(--tt-host-bg, #ffffff);
  --cb-surface: var(--tt-host-surface, #f8fbff);
  --cb-border: var(--tt-host-border, #d8e5f5);
  --cb-text: var(--tt-host-text, #14213d);
  --cb-muted: var(--tt-host-text-muted, #64748b);
  --cb-shadow: 0 12px 34px rgba(15, 31, 75, 0.08);
  --cb-radius: 14px;
  color: var(--cb-text);
  font-family: inherit;
  min-width: 0;
}

[data-toantin-tool="chart_builder"] *,
[data-toantin-tool="chart_builder"] *::before,
[data-toantin-tool="chart_builder"] *::after {
  box-sizing: border-box;
}

[data-toantin-tool="chart_builder"] .cb-tool-root,
[data-toantin-tool="chart_builder"].cb-tool-root {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
}

[data-toantin-tool="chart_builder"] .cb-primary-surface-host,
[data-toantin-tool="chart_builder"] .cb-surface,
[data-toantin-tool="chart_builder"] .cb-chart-shell {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
}

[data-toantin-tool="chart_builder"] .cb-chart-shell {
  overflow: hidden;
  border: 1px solid var(--cb-border);
  border-radius: var(--cb-radius);
  background: var(--cb-bg);
  box-shadow: var(--cb-shadow);
}

[data-toantin-tool="chart_builder"] .cb-chart-svg {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 220px;
}

[data-toantin-tool="chart_builder"] .cb-domain-toolbar {
  min-height: 44px;
  max-width: 100%;
}

[data-toantin-tool="chart_builder"] .cb-domain-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--cb-border);
  border-radius: 10px;
  background: #ffffff;
  color: var(--cb-navy);
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

[data-toantin-tool="chart_builder"] .cb-domain-action:hover:not(:disabled),
[data-toantin-tool="chart_builder"] .cb-domain-action:focus-visible {
  border-color: #9fc4fb;
  background: var(--cb-primary-soft);
  color: var(--cb-primary-strong);
}

[data-toantin-tool="chart_builder"] .cb-domain-action:active:not(:disabled) {
  transform: translateY(1px);
}

[data-toantin-tool="chart_builder"] .cb-domain-action:focus-visible {
  outline: 3px solid rgba(22, 103, 232, 0.22);
  outline-offset: 2px;
}

[data-toantin-tool="chart_builder"] .cb-domain-action:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

[data-toantin-tool="chart_builder"] .cb-domain-action__icon {
  font-size: 20px;
  line-height: 1;
  font-weight: 700;
}

[data-toantin-tool="chart_builder"] .cb-panel-empty {
  min-height: 140px;
  border: 1px dashed #b8cbe5;
  border-radius: 12px;
  padding: 16px;
  color: var(--cb-muted);
  background: var(--cb-surface);
}

[data-toantin-tool="chart_builder"] .cb-panel-empty strong {
  display: block;
  margin-bottom: 6px;
  color: var(--cb-navy);
}

@media (max-width: 575.98px) {
  [data-toantin-tool="chart_builder"] .cb-chart-shell {
    border-radius: 12px;
  }
  [data-toantin-tool="chart_builder"] .cb-domain-action {
    width: 44px;
    height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  [data-toantin-tool="chart_builder"] .cb-domain-action {
    transition: none;
  }
}

[data-toantin-tool="chart_builder"] .cb-chart-svg [data-object-id] {
  cursor: pointer;
}

[data-toantin-tool="chart_builder"] .cb-chart-svg .cb-object-selected {
  filter: drop-shadow(0 0 3px rgba(13, 91, 239, 0.55));
}

[data-toantin-tool="chart_builder"] .cb-chart-svg text.cb-object-selected {
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

/* A2 Full Tool — Quick Create workspace. Scoped; integrated Host still owns outer chrome. */
[data-toantin-tool="chart_builder"] .cb-full-tool {
  display: grid;
  grid-template-columns: var(--cb-data-panel-width, minmax(300px, 380px)) minmax(0, 1fr);
  gap: 16px;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 2px;
}

[data-toantin-tool="chart_builder"] .cb-data-panel,
[data-toantin-tool="chart_builder"] .cb-preview-panel {
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--cb-border);
  border-radius: var(--cb-radius);
  background: var(--cb-bg);
  box-shadow: var(--cb-shadow);
}

[data-toantin-tool="chart_builder"] .cb-data-panel {
  overflow: auto;
  padding: 16px;
}

[data-toantin-tool="chart_builder"] .cb-preview-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 14px;
  background: #f9fbff;
}

[data-toantin-tool="chart_builder"] .cb-preview-header,
[data-toantin-tool="chart_builder"] .cb-section-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

[data-toantin-tool="chart_builder"] .cb-preview-header { margin-bottom: 10px; }
[data-toantin-tool="chart_builder"] .cb-full-chart-host { flex: 1; min-height: 300px; }
[data-toantin-tool="chart_builder"] .cb-full-chart-host .cb-surface,
[data-toantin-tool="chart_builder"] .cb-full-chart-host .cb-chart-shell { height: 100%; }

[data-toantin-tool="chart_builder"] .cb-eyebrow {
  margin-bottom: 2px;
  color: var(--cb-primary-strong);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
}

[data-toantin-tool="chart_builder"] .cb-panel-title {
  margin: 0;
  color: var(--cb-navy);
  font-size: 18px;
  font-weight: 750;
}

[data-toantin-tool="chart_builder"] .cb-panel-hint {
  margin: 6px 0 14px;
  color: var(--cb-muted);
  font-size: 13px;
  line-height: 1.45;
}

[data-toantin-tool="chart_builder"] .cb-editor-section {
  padding: 14px 0;
  border-top: 1px solid #edf3fb;
}

[data-toantin-tool="chart_builder"] .cb-editor-section:first-of-type { border-top: 0; }
[data-toantin-tool="chart_builder"] .cb-section-title {
  margin: 0 0 10px;
  color: var(--cb-navy);
  font-size: 14px;
  font-weight: 750;
}

[data-toantin-tool="chart_builder"] .cb-paste-area {
  resize: vertical;
  min-height: 108px;
  max-height: 230px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

[data-toantin-tool="chart_builder"] .cb-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
[data-toantin-tool="chart_builder"] .cb-action-row--compact { margin-top: 0; }

[data-toantin-tool="chart_builder"] .cb-data-grid-scroll {
  overflow: auto;
  max-width: 100%;
  margin-top: 10px;
  border: 1px solid var(--cb-border);
  border-radius: 10px;
}
[data-toantin-tool="chart_builder"] .cb-data-grid {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: 12px;
}
[data-toantin-tool="chart_builder"] .cb-data-grid th,
[data-toantin-tool="chart_builder"] .cb-data-grid td {
  position: relative;
  min-width: 118px;
  padding: 0;
  border-right: 1px solid #e8f0fa;
  border-bottom: 1px solid #e8f0fa;
}
[data-toantin-tool="chart_builder"] .cb-data-grid th { background: #f3f7fd; }
[data-toantin-tool="chart_builder"] .cb-grid-header-input,
[data-toantin-tool="chart_builder"] .cb-grid-cell {
  width: 100%;
  min-height: 38px;
  padding: 7px 28px 7px 8px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--cb-text);
  font: inherit;
}
[data-toantin-tool="chart_builder"] .cb-grid-header-input { font-weight: 700; }
[data-toantin-tool="chart_builder"] .cb-grid-header-input:focus,
[data-toantin-tool="chart_builder"] .cb-grid-cell:focus {
  box-shadow: inset 0 0 0 2px rgba(22, 103, 232, .35);
  background: #fff;
}
[data-toantin-tool="chart_builder"] .cb-grid-cell[aria-invalid="true"] { box-shadow: inset 0 0 0 2px rgba(220, 53, 69, .45); }
[data-toantin-tool="chart_builder"] .cb-grid-delete {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #64748b;
}
[data-toantin-tool="chart_builder"] .cb-grid-delete:hover,
[data-toantin-tool="chart_builder"] .cb-grid-delete:focus-visible { background: #eef5ff; color: var(--cb-primary-strong); outline: 2px solid rgba(22,103,232,.18); }
[data-toantin-tool="chart_builder"] .cb-grid-row-actions { min-width: 34px !important; width: 34px; }

[data-toantin-tool="chart_builder"] .cb-series-fieldset {
  margin: 10px 0;
  padding: 10px;
  border: 1px solid var(--cb-border);
  border-radius: 10px;
}
[data-toantin-tool="chart_builder"] .cb-check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  color: var(--cb-text);
  font-size: 13px;
}

[data-toantin-tool="chart_builder"] .cb-chart-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
[data-toantin-tool="chart_builder"] .cb-chart-choice {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 62px;
  padding: 9px 10px;
  border: 1px solid var(--cb-border);
  border-radius: 11px;
  background: #fff;
  color: var(--cb-text);
  text-align: left;
}
[data-toantin-tool="chart_builder"] .cb-chart-choice:hover,
[data-toantin-tool="chart_builder"] .cb-chart-choice:focus-visible { border-color: #9fc4fb; background: var(--cb-primary-soft); outline: 3px solid rgba(22,103,232,.15); }
[data-toantin-tool="chart_builder"] .cb-chart-choice.is-active { border-color: var(--cb-primary); box-shadow: inset 0 0 0 1px var(--cb-primary); }
[data-toantin-tool="chart_builder"] .cb-chart-choice__icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: #eef5ff; color: var(--cb-primary-strong); font-size: 20px; }
[data-toantin-tool="chart_builder"] .cb-chart-choice__copy { display: flex; flex-direction: column; min-width: 0; }
[data-toantin-tool="chart_builder"] .cb-chart-choice__copy small { color: var(--cb-muted); font-size: 10px; }
[data-toantin-tool="chart_builder"] .cb-suggested-badge {
  position: absolute;
  top: -7px;
  right: 7px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #e6f7f3;
  color: #08796b;
  font-size: 9px;
  font-weight: 800;
}
[data-toantin-tool="chart_builder"] .cb-type-badge {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--cb-primary-soft);
  color: var(--cb-primary-strong);
  font-size: 11px;
  font-weight: 750;
}
[data-toantin-tool="chart_builder"] .cb-inline-diagnostics { display: grid; gap: 6px; padding-top: 8px; }
[data-toantin-tool="chart_builder"] .cb-inline-message { padding: 8px 10px; border-radius: 8px; background: #f4f7fb; color: #475569; font-size: 12px; }
[data-toantin-tool="chart_builder"] .cb-inline-message--success { background: #edf9f5; color: #08796b; }
[data-toantin-tool="chart_builder"] .cb-inline-message--warning { background: #fff7e6; color: #8a5a00; }
[data-toantin-tool="chart_builder"] .cb-inline-message--error { background: #fff0f1; color: #a62d3b; }
[data-toantin-tool="chart_builder"] .cb-field-warning { margin-top: 6px; color: #8a5a00; font-size: 11px; }

@media (max-width: 991.98px) {
  [data-toantin-tool="chart_builder"] .cb-full-tool { grid-template-columns: var(--cb-data-panel-width, 330px) minmax(0, 1fr); gap: 12px; }
}
@media (max-width: 767.98px) {
  [data-toantin-tool="chart_builder"] .cb-full-tool,
  [data-toantin-tool="chart_builder"] .cb-full-tool.is-compact { display: flex; flex-direction: column; height: auto; }
  [data-toantin-tool="chart_builder"] .cb-data-panel { max-height: none; overflow: visible; }
  [data-toantin-tool="chart_builder"] .cb-preview-panel { min-height: 390px; }
  [data-toantin-tool="chart_builder"] .cb-full-chart-host { min-height: 320px; }
}
@media (max-width: 575.98px) {
  [data-toantin-tool="chart_builder"] .cb-data-panel,
  [data-toantin-tool="chart_builder"] .cb-preview-panel { padding: 12px; border-radius: 12px; }
  [data-toantin-tool="chart_builder"] .cb-chart-gallery { grid-template-columns: 1fr 1fr; }
  [data-toantin-tool="chart_builder"] .cb-chart-choice { min-height: 58px; }
  [data-toantin-tool="chart_builder"] .cb-action-row .btn { min-height: 44px; }
  [data-toantin-tool="chart_builder"] .cb-grid-header-input,
  [data-toantin-tool="chart_builder"] .cb-grid-cell { min-height: 44px; }
  [data-toantin-tool="chart_builder"] .cb-check-row { min-height: 44px; }
}

/* A3 Chart Family controls — still scoped inside Tool root. */
[data-toantin-tool="chart_builder"] .cb-chart-gallery--a3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
[data-toantin-tool="chart_builder"] .cb-combo-map { display: grid; gap: 7px; }
[data-toantin-tool="chart_builder"] .cb-combo-row { display: grid; grid-template-columns: minmax(80px, 1fr) minmax(88px, .8fr) 72px; gap: 6px; align-items: center; }
[data-toantin-tool="chart_builder"] .cb-combo-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--cb-text); font-size: 12px; }
@media (max-width: 575.98px) {
  [data-toantin-tool="chart_builder"] .cb-combo-row { grid-template-columns: 1fr 92px 68px; }
}


/* A4 — Direct edit / contextual UI. Scoped to Tool root. */
[data-toantin-tool="chart_builder"] .cb-chart-shell { position: relative; }
[data-toantin-tool="chart_builder"] .cb-chart-interaction-overlay { position: absolute; inset: 0; pointer-events: none; z-index: 6; }
[data-toantin-tool="chart_builder"] .cb-chart-interaction-overlay > * { pointer-events: auto; }
[data-toantin-tool="chart_builder"] .cb-quick-editor,
[data-toantin-tool="chart_builder"] .cb-context-menu { position: absolute; min-width: 190px; max-width: min(300px, calc(100% - 12px)); padding: 10px; border: 1px solid var(--cb-border); border-radius: 10px; background: #fff; box-shadow: 0 12px 30px rgba(15,31,75,.18); }
[data-toantin-tool="chart_builder"] .cb-quick-editor__title { display:block; margin-bottom:8px; color:var(--cb-navy); font-size:12px; }
[data-toantin-tool="chart_builder"] .cb-quick-editor__actions { display:flex; justify-content:flex-end; gap:6px; margin-top:8px; }
[data-toantin-tool="chart_builder"] .cb-context-menu { display:grid; gap:2px; padding:6px; min-width:170px; }
[data-toantin-tool="chart_builder"] .cb-context-menu__item { min-height:36px; padding:7px 10px; border:0; border-radius:7px; background:transparent; color:var(--cb-text); text-align:left; }
[data-toantin-tool="chart_builder"] .cb-context-menu__item:hover,
[data-toantin-tool="chart_builder"] .cb-context-menu__item:focus-visible { background:var(--cb-primary-soft); outline:2px solid rgba(22,103,232,.18); }
[data-toantin-tool="chart_builder"] .cb-chart-svg [data-object-type="text"],
[data-toantin-tool="chart_builder"] .cb-chart-svg [data-object-id="legend"],
[data-toantin-tool="chart_builder"] .cb-chart-svg [data-object-type="legendItem"] { cursor: grab; }
[data-toantin-tool="chart_builder"] .cb-chart-svg [data-object-type="text"]:active,
[data-toantin-tool="chart_builder"] .cb-chart-svg [data-object-id="legend"]:active,
[data-toantin-tool="chart_builder"] .cb-chart-svg [data-object-type="legendItem"]:active { cursor: grabbing; }
[data-toantin-tool="chart_builder"] .cb-smart-guides line { stroke:#0D5BEF; stroke-width:1; stroke-dasharray:5 4; vector-effect:non-scaling-stroke; pointer-events:none; }
[data-toantin-tool="chart_builder"] .cb-contextual-editor { flex:0 0 auto; padding:9px 10px; border:1px solid var(--cb-border); border-radius:10px; background:#fff; }
[data-toantin-tool="chart_builder"] .cb-contextual-editor.is-empty { padding:8px 10px; background:#f8fbff; }
[data-toantin-tool="chart_builder"] .cb-context-empty { color:var(--cb-muted); font-size:12px; }
[data-toantin-tool="chart_builder"] .cb-context-head { display:flex; align-items:center; justify-content:space-between; gap:10px; }
[data-toantin-tool="chart_builder"] .cb-context-title { display:flex; flex-direction:column; min-width:0; color:var(--cb-navy); font-size:12px; }
[data-toantin-tool="chart_builder"] .cb-context-title small { color:var(--cb-muted); font-size:10px; font-weight:500; }
[data-toantin-tool="chart_builder"] .cb-context-actions { display:flex; flex-wrap:wrap; gap:5px; justify-content:flex-end; }
[data-toantin-tool="chart_builder"] .cb-context-fields { display:grid; grid-template-columns:repeat(auto-fit,minmax(135px,1fr)); gap:8px; margin-top:9px; }
[data-toantin-tool="chart_builder"] .cb-context-field { display:grid; gap:4px; min-width:0; }
[data-toantin-tool="chart_builder"] .cb-context-label { color:var(--cb-muted); font-size:10px; font-weight:700; }
[data-toantin-tool="chart_builder"] .cb-context-lock-note { margin-top:8px; padding:7px 9px; border-radius:7px; background:#fff7e6; color:#8a5a00; font-size:11px; }
[data-toantin-tool="chart_builder"] .cb-panel-surface { height:100%; min-height:0; padding:12px; overflow:auto; border:1px solid var(--cb-border); border-radius:var(--cb-radius); background:#fff; }
[data-toantin-tool="chart_builder"] .cb-panel-surface__heading { display:flex; flex-direction:column; gap:2px; margin-bottom:8px; color:var(--cb-navy); }
[data-toantin-tool="chart_builder"] .cb-panel-surface__heading small { color:var(--cb-muted); }
[data-toantin-tool="chart_builder"] .cb-contextual-editor--panel { border:0; padding:0; }
[data-toantin-tool="chart_builder"] .cb-preview-panel > .cb-contextual-editor { margin-bottom:10px; }
@media (max-width: 575.98px) {
  [data-toantin-tool="chart_builder"] .cb-context-head { align-items:flex-start; flex-direction:column; }
  [data-toantin-tool="chart_builder"] .cb-context-actions { width:100%; justify-content:flex-start; }
  [data-toantin-tool="chart_builder"] .cb-context-actions .btn { min-height:44px; }
  [data-toantin-tool="chart_builder"] .cb-context-fields { grid-template-columns:1fr 1fr; }
  [data-toantin-tool="chart_builder"] .cb-quick-editor__actions .btn,
  [data-toantin-tool="chart_builder"] .cb-context-menu__item { min-height:44px; }
}
[data-toantin-tool="chart_builder"] .cb-object-navigator { display:grid; grid-template-columns:auto minmax(140px, 260px); align-items:center; gap:8px; margin-bottom:8px; }
@media (max-width:575.98px){ [data-toantin-tool="chart_builder"] .cb-object-navigator { grid-template-columns:1fr; } }

/* A5 — Styling / floating Property Inspector / Pie deep edit. */
[data-toantin-tool="chart_builder"] .cb-full-tool { position: relative; isolation: isolate; }
[data-toantin-tool="chart_builder"] .cb-chart-svg [data-drag-kind="pie-explode"],
[data-toantin-tool="chart_builder"] .cb-chart-svg [data-drag-kind="pie-label"] { cursor: grab; }
[data-toantin-tool="chart_builder"] .cb-chart-svg [data-drag-kind="pie-explode"]:active,
[data-toantin-tool="chart_builder"] .cb-chart-svg [data-drag-kind="pie-label"]:active { cursor: grabbing; }
[data-toantin-tool="chart_builder"] .cb-floating-inspector {
  position: absolute;
  z-index: 7;
  display: flex;
  flex-direction: column;
  min-width: 280px;
  min-height: 260px;
  max-width: calc(100% - 16px);
  max-height: calc(100% - 16px);
  overflow: hidden;
  border: 1px solid var(--cb-border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(15,31,75,.22);
}
[data-toantin-tool="chart_builder"] .cb-floating-inspector[hidden] { display: none !important; }
[data-toantin-tool="chart_builder"] .cb-floating-inspector:focus { outline: 3px solid rgba(22,103,232,.16); outline-offset: 1px; }
[data-toantin-tool="chart_builder"] .cb-inspector-header {
  display: grid;
  grid-template-columns: 22px minmax(0,1fr) 34px;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 7px 8px 7px 10px;
  border-bottom: 1px solid var(--cb-border);
  background: linear-gradient(180deg,#fbfdff,#f3f7fc);
  cursor: move;
  touch-action: none;
  user-select: none;
}
[data-toantin-tool="chart_builder"] .cb-inspector-grip { color: var(--cb-muted); font-size: 18px; line-height: 1; }
[data-toantin-tool="chart_builder"] .cb-inspector-title { display: flex; flex-direction: column; min-width: 0; color: var(--cb-navy); }
[data-toantin-tool="chart_builder"] .cb-inspector-title strong { font-size: 13px; }
[data-toantin-tool="chart_builder"] .cb-inspector-title small { overflow: hidden; color: var(--cb-muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
[data-toantin-tool="chart_builder"] .cb-inspector-close {
  display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 8px; background: transparent; color: var(--cb-muted); font-size: 22px;
}
[data-toantin-tool="chart_builder"] .cb-inspector-close:hover,
[data-toantin-tool="chart_builder"] .cb-inspector-close:focus-visible { background: var(--cb-primary-soft); color: var(--cb-primary-strong); outline: 2px solid rgba(22,103,232,.18); }
[data-toantin-tool="chart_builder"] .cb-inspector-toolbar { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 10px; border-bottom: 1px solid #eef3f8; }
[data-toantin-tool="chart_builder"] .cb-inspector-body { flex: 1; min-height: 0; overflow: auto; padding: 10px; overscroll-behavior: contain; }
[data-toantin-tool="chart_builder"] .cb-inspector-group { padding: 0 0 12px; margin: 0 0 12px; border-bottom: 1px solid #eef3f8; }
[data-toantin-tool="chart_builder"] .cb-inspector-group:last-child { margin-bottom: 0; }
[data-toantin-tool="chart_builder"] .cb-inspector-group__title { margin: 0 0 8px; color: var(--cb-navy); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .035em; }
[data-toantin-tool="chart_builder"] .cb-inspector-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
[data-toantin-tool="chart_builder"] .cb-inspector-field { display: grid; gap: 4px; min-width: 0; }
[data-toantin-tool="chart_builder"] .cb-inspector-label { color: var(--cb-muted); font-size: 10px; font-weight: 700; }
[data-toantin-tool="chart_builder"] .cb-inspector-lock-note { margin-bottom: 10px; padding: 8px 9px; border-radius: 8px; background: #fff7e6; color: #8a5a00; font-size: 11px; }
[data-toantin-tool="chart_builder"] .cb-inspector-order-list { display: grid; gap: 6px; }
[data-toantin-tool="chart_builder"] .cb-inspector-order-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 34px; padding: 5px 6px 5px 9px; border: 1px solid #e9eff7; border-radius: 8px; background: #fbfdff; }
[data-toantin-tool="chart_builder"] .cb-inspector-order-label { min-width: 0; overflow: hidden; color: var(--cb-text); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
[data-toantin-tool="chart_builder"] .cb-inspector-order-actions { display: flex; gap: 4px; }
[data-toantin-tool="chart_builder"] .cb-inspector-empty { color: var(--cb-muted); font-size: 11px; }
[data-toantin-tool="chart_builder"] .cb-inspector-reset-pie-label { width: 100%; margin-top: 2px; }
[data-toantin-tool="chart_builder"] .cb-inspector-resize { position: absolute; z-index: 2; touch-action: none; }
[data-toantin-tool="chart_builder"] .cb-inspector-resize--n { top: -3px; left: 12px; right: 12px; height: 8px; cursor: ns-resize; }
[data-toantin-tool="chart_builder"] .cb-inspector-resize--s { bottom: -3px; left: 12px; right: 12px; height: 8px; cursor: ns-resize; }
[data-toantin-tool="chart_builder"] .cb-inspector-resize--e { top: 12px; right: -3px; bottom: 12px; width: 8px; cursor: ew-resize; }
[data-toantin-tool="chart_builder"] .cb-inspector-resize--w { top: 12px; left: -3px; bottom: 12px; width: 8px; cursor: ew-resize; }
[data-toantin-tool="chart_builder"] .cb-inspector-resize--ne,
[data-toantin-tool="chart_builder"] .cb-inspector-resize--nw,
[data-toantin-tool="chart_builder"] .cb-inspector-resize--se,
[data-toantin-tool="chart_builder"] .cb-inspector-resize--sw { width: 14px; height: 14px; }
[data-toantin-tool="chart_builder"] .cb-inspector-resize--ne { top: -4px; right: -4px; cursor: nesw-resize; }
[data-toantin-tool="chart_builder"] .cb-inspector-resize--nw { top: -4px; left: -4px; cursor: nwse-resize; }
[data-toantin-tool="chart_builder"] .cb-inspector-resize--se { right: -4px; bottom: -4px; cursor: nwse-resize; }
[data-toantin-tool="chart_builder"] .cb-inspector-resize--sw { left: -4px; bottom: -4px; cursor: nesw-resize; }

@media (max-width: 575.98px) {
  [data-toantin-tool="chart_builder"] .cb-floating-inspector {
    position: absolute;
    left: 8px !important;
    right: 8px;
    top: auto !important;
    bottom: 8px;
    width: auto !important;
    height: min(64vh, 520px) !important;
    min-width: 0;
    min-height: 260px;
    max-width: none;
    max-height: 72vh;
    border-radius: 14px;
  }
  [data-toantin-tool="chart_builder"] .cb-inspector-header { cursor: default; min-height: 52px; }
  [data-toantin-tool="chart_builder"] .cb-inspector-toolbar .btn,
  [data-toantin-tool="chart_builder"] .cb-inspector-close,
  [data-toantin-tool="chart_builder"] .cb-inspector-order-actions .btn { min-width: 44px; min-height: 44px; }
  [data-toantin-tool="chart_builder"] .cb-inspector-fields { grid-template-columns: 1fr; }
  [data-toantin-tool="chart_builder"] .cb-inspector-resize { display: none; }
}

/* A6 — Axis / ticks / grid / responsive resize / touch. */
[data-toantin-tool="chart_builder"] .cb-chart-svg {
  transform-origin: center center;
  transition: transform 140ms ease;
  touch-action: manipulation;
}
[data-toantin-tool="chart_builder"] .cb-preview-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}
[data-toantin-tool="chart_builder"] .cb-view-zoom {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--cb-border);
  border-radius: 10px;
  background: #fff;
}
[data-toantin-tool="chart_builder"] .cb-view-zoom .btn {
  min-width: 32px;
  min-height: 32px;
  padding: 2px 7px;
}
[data-toantin-tool="chart_builder"] .cb-view-zoom__label {
  min-width: 48px;
  color: var(--cb-muted);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}
[data-toantin-tool="chart_builder"] .cb-view-zoom__reset { font-size: 10px; }

@media (max-width: 575.98px) {
  [data-toantin-tool="chart_builder"] .cb-preview-panel { position: relative; }
  [data-toantin-tool="chart_builder"] .cb-preview-header { order: 1; }
  [data-toantin-tool="chart_builder"] .cb-full-chart-host { order: 2; }
  [data-toantin-tool="chart_builder"] .cb-contextual-editor--full {
    order: 3;
    position: sticky;
    bottom: 0;
    z-index: 5;
    max-height: 42vh;
    overflow: auto;
    margin: 8px -6px -6px;
    padding: 10px;
    border: 1px solid var(--cb-border);
    border-radius: 14px 14px 8px 8px;
    background: rgba(255,255,255,.98);
    box-shadow: 0 -12px 30px rgba(15,31,75,.14);
    overscroll-behavior: contain;
  }
  [data-toantin-tool="chart_builder"] .cb-view-zoom .btn { min-width: 44px; min-height: 44px; }
  [data-toantin-tool="chart_builder"] .cb-view-zoom__reset { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  [data-toantin-tool="chart_builder"] .cb-chart-svg { transition: none; }
}

/* A7 — Files / Help VI / Accessibility. */
[data-toantin-tool="chart_builder"] .cb-visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
[data-toantin-tool="chart_builder"] .cb-file-actions { align-items: center; }
[data-toantin-tool="chart_builder"] .cb-file-import-row { margin-top: 10px; }
[data-toantin-tool="chart_builder"] .cb-file-service-note {
  margin-top: 9px;
  padding: 8px 9px;
  border: 1px solid #e7eef8;
  border-radius: 8px;
  background: #f8fbff;
  color: var(--cb-muted);
  font-size: 11px;
}
[data-toantin-tool="chart_builder"] .cb-a11y-details,
[data-toantin-tool="chart_builder"] .cb-help-item {
  margin-top: 9px;
  border: 1px solid #e7eef8;
  border-radius: 8px;
  background: #fff;
}
[data-toantin-tool="chart_builder"] .cb-a11y-details > summary,
[data-toantin-tool="chart_builder"] .cb-help-item > summary {
  cursor: pointer;
  padding: 8px 10px;
  color: var(--cb-navy);
  font-size: 12px;
  font-weight: 700;
}
[data-toantin-tool="chart_builder"] .cb-a11y-details > label,
[data-toantin-tool="chart_builder"] .cb-help-item > p {
  margin-left: 10px;
  margin-right: 10px;
}
[data-toantin-tool="chart_builder"] .cb-help-item > p {
  color: var(--cb-text);
  font-size: 12px;
  line-height: 1.55;
}
[data-toantin-tool="chart_builder"] .cb-help-panel {
  border-color: #cfe0f7;
  background: linear-gradient(180deg,#fbfdff,#f6faff);
}
[data-toantin-tool="chart_builder"] :focus-visible {
  outline: 3px solid rgba(22,103,232,.28);
  outline-offset: 2px;
}
@media (max-width: 575.98px) {
  [data-toantin-tool="chart_builder"] .cb-file-actions .btn { min-height: 44px; }
  [data-toantin-tool="chart_builder"] .cb-file-actions { display: grid; grid-template-columns: 1fr 1fr; }
  [data-toantin-tool="chart_builder"] .cb-help-item > summary { min-height: 44px; display: flex; align-items: center; }
}
@media (prefers-reduced-motion: reduce) {
  [data-toantin-tool="chart_builder"] *,
  [data-toantin-tool="chart_builder"] *::before,
  [data-toantin-tool="chart_builder"] *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* A8-FIX01 — collapsible Quick Create, multi-selection affordance, readability polish. */
[data-toantin-tool="chart_builder"] .cb-full-tool {
  transition: grid-template-columns 160ms ease, gap 160ms ease;
}
[data-toantin-tool="chart_builder"] .cb-panel-heading--collapsible {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  margin-bottom:8px;
}
[data-toantin-tool="chart_builder"] .cb-panel-heading__text { min-width:0; }
[data-toantin-tool="chart_builder"] .cb-data-panel-toggle {
  display:grid;
  place-items:center;
  flex:0 0 auto;
  width:38px;
  height:38px;
  padding:0;
  border:1px solid #c8d9ee;
  border-radius:10px;
  background:#fff;
  color:var(--cb-primary-strong);
  font-size:24px;
  font-weight:700;
  line-height:1;
  box-shadow:0 3px 10px rgba(15,31,75,.05);
}
[data-toantin-tool="chart_builder"] .cb-data-panel-toggle:hover,
[data-toantin-tool="chart_builder"] .cb-data-panel-toggle:focus-visible { background:var(--cb-primary-soft); border-color:#9fc4fb; }
[data-toantin-tool="chart_builder"] .cb-full-tool.is-data-panel-collapsed { grid-template-columns:58px minmax(0,1fr); gap:10px; }
[data-toantin-tool="chart_builder"] .cb-full-tool.is-data-panel-collapsed .cb-data-panel { overflow:hidden; padding:9px; }
[data-toantin-tool="chart_builder"] .cb-full-tool.is-data-panel-collapsed .cb-data-panel > :not(.cb-panel-heading--collapsible) { display:none !important; }
[data-toantin-tool="chart_builder"] .cb-full-tool.is-data-panel-collapsed .cb-panel-heading--collapsible { justify-content:center; margin:0; }
[data-toantin-tool="chart_builder"] .cb-full-tool.is-data-panel-collapsed .cb-panel-heading__text { display:none; }
[data-toantin-tool="chart_builder"] .cb-full-tool.is-data-panel-collapsed .cb-data-panel-toggle { width:40px; height:44px; }

[data-toantin-tool="chart_builder"] .cb-data-panel,
[data-toantin-tool="chart_builder"] .cb-preview-panel { box-shadow:0 8px 22px rgba(15,31,75,.055); }
[data-toantin-tool="chart_builder"] .cb-preview-panel { background:#fbfdff; }
[data-toantin-tool="chart_builder"] .cb-panel-title { color:#10224f; letter-spacing:-.01em; }
[data-toantin-tool="chart_builder"] .cb-panel-hint { color:#56657a; font-size:12px; line-height:1.5; }
[data-toantin-tool="chart_builder"] .cb-context-label,
[data-toantin-tool="chart_builder"] .cb-inspector-label { color:#56657a; font-size:11px; }
[data-toantin-tool="chart_builder"] .cb-context-title small,
[data-toantin-tool="chart_builder"] .cb-inspector-title small { font-size:11px; line-height:1.35; }
[data-toantin-tool="chart_builder"] .cb-grid-cell,
[data-toantin-tool="chart_builder"] .cb-grid-header-input { font-size:12.5px; }
[data-toantin-tool="chart_builder"] .cb-chart-svg [data-object-type="axisLabel"] { cursor:pointer; transition:filter 120ms ease, opacity 120ms ease; }
[data-toantin-tool="chart_builder"] .cb-chart-svg [data-object-type="axisLabel"]:hover { filter:drop-shadow(0 0 2px rgba(13,91,239,.28)); }
[data-toantin-tool="chart_builder"] .cb-chart-svg text.cb-object-selected {
  text-decoration:underline;
  text-decoration-thickness:2px;
  text-underline-offset:2px;
  paint-order:stroke;
  stroke:rgba(255,255,255,.95);
  stroke-width:2px;
}
[data-toantin-tool="chart_builder"] .cb-chart-svg text.cb-object-primary { filter:drop-shadow(0 0 3px rgba(13,91,239,.7)); }
[data-toantin-tool="chart_builder"] .cb-context-menu { min-width:200px; }
[data-toantin-tool="chart_builder"] .cb-context-menu__item { font-size:12px; }

@media (max-width:767.98px) {
  [data-toantin-tool="chart_builder"] .cb-full-tool.is-data-panel-collapsed { display:flex; flex-direction:column; gap:8px; }
  [data-toantin-tool="chart_builder"] .cb-full-tool.is-data-panel-collapsed .cb-data-panel { min-height:56px; max-height:56px; padding:6px 10px; }
  [data-toantin-tool="chart_builder"] .cb-full-tool.is-data-panel-collapsed .cb-panel-heading--collapsible { justify-content:flex-end; }
}
@media (max-width:575.98px) {
  [data-toantin-tool="chart_builder"] .cb-data-panel-toggle { width:44px; height:44px; }
  [data-toantin-tool="chart_builder"] .cb-panel-hint { font-size:12.5px; }
  [data-toantin-tool="chart_builder"] .cb-context-label,
  [data-toantin-tool="chart_builder"] .cb-inspector-label { font-size:11.5px; }
}
@media (prefers-reduced-motion: reduce) {
  [data-toantin-tool="chart_builder"] .cb-full-tool,
  [data-toantin-tool="chart_builder"] .cb-chart-svg [data-object-type="axisLabel"] { transition:none; }
}


/* V1 PATCH_01 — Owner runtime fixes: resizable Quick Create + reliable semantic label targets. */
[data-toantin-tool="chart_builder"] .cb-data-panel { position:relative; }
[data-toantin-tool="chart_builder"] .cb-data-panel-resize-handle {
  position:absolute;
  z-index:4;
  top:54px;
  right:-6px;
  bottom:10px;
  width:12px;
  cursor:ew-resize;
  touch-action:none;
  border-radius:8px;
  outline:none;
}
[data-toantin-tool="chart_builder"] .cb-data-panel-resize-handle::before {
  content:"";
  position:absolute;
  top:10px;
  bottom:10px;
  left:5px;
  width:2px;
  border-radius:2px;
  background:transparent;
  transition:background-color 120ms ease, box-shadow 120ms ease;
}
[data-toantin-tool="chart_builder"] .cb-data-panel-resize-handle:hover::before,
[data-toantin-tool="chart_builder"] .cb-data-panel-resize-handle:focus-visible::before,
[data-toantin-tool="chart_builder"] .cb-data-panel-resize-handle.is-dragging::before {
  background:#6ea8fe;
  box-shadow:0 0 0 3px rgba(13,91,239,.10);
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-data-panel-collapsed .cb-data-panel-resize-handle { display:none; }
[data-toantin-tool="chart_builder"] .cb-axis-label-hit-target,
[data-toantin-tool="chart_builder"] .cb-pie-label-hit-target {
  fill:transparent;
  stroke:transparent;
  pointer-events:all;
  cursor:pointer;
}
[data-toantin-tool="chart_builder"] .cb-axis-label-hit-target.cb-object-selected,
[data-toantin-tool="chart_builder"] .cb-pie-label-hit-target.cb-object-selected,
[data-toantin-tool="chart_builder"] .cb-pie-label-draggable.cb-object-selected .cb-pie-label-hit-target {
  fill:rgba(13,91,239,.055);
  stroke:rgba(13,91,239,.30);
  stroke-width:1;
  stroke-dasharray:3 2;
}
[data-toantin-tool="chart_builder"] .cb-chart-svg text[data-role="axis-category-label"],
[data-toantin-tool="chart_builder"] .cb-chart-svg text[data-role="pie-label"] { pointer-events:none; }
@media (max-width:767.98px) {
  [data-toantin-tool="chart_builder"] .cb-data-panel-resize-handle { display:none; }
  [data-toantin-tool="chart_builder"] .cb-full-tool { --cb-data-panel-width:100% !important; }
}
@media (prefers-reduced-motion: reduce) {
  [data-toantin-tool="chart_builder"] .cb-data-panel-resize-handle::before { transition:none; }
}

/* V1 PATCH_02 — visual polish, Pie label UX, workspace/LCD space efficiency. */
[data-toantin-tool="chart_builder"] {
  --cb-font-ui: "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-family: var(--cb-font-ui);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
[data-toantin-tool="chart_builder"] button,
[data-toantin-tool="chart_builder"] input,
[data-toantin-tool="chart_builder"] select,
[data-toantin-tool="chart_builder"] textarea,
[data-toantin-tool="chart_builder"] table,
[data-toantin-tool="chart_builder"] summary { font-family: inherit; }

[data-toantin-tool="chart_builder"] .cb-full-tool {
  grid-template-columns: var(--cb-data-panel-width, 332px) minmax(0, 1fr);
  gap: 12px;
  padding: 0;
}
[data-toantin-tool="chart_builder"] .cb-data-panel,
[data-toantin-tool="chart_builder"] .cb-preview-panel {
  border-color: #dce7f4;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(15,31,75,.045);
}
[data-toantin-tool="chart_builder"] .cb-data-panel { padding: 14px; }
[data-toantin-tool="chart_builder"] .cb-preview-panel {
  padding: 10px;
  background: #fff;
}
[data-toantin-tool="chart_builder"] .cb-preview-header {
  min-height: 42px;
  margin-bottom: 7px;
  padding: 0 2px;
}
[data-toantin-tool="chart_builder"] .cb-preview-meta { display:flex; align-items:center; flex-wrap:wrap; justify-content:flex-end; gap:8px; }
[data-toantin-tool="chart_builder"] .cb-full-chart-host { min-height: 360px; }
[data-toantin-tool="chart_builder"] .cb-chart-shell { box-shadow: 0 5px 16px rgba(15,31,75,.045); }
[data-toantin-tool="chart_builder"] .cb-panel-title { font-size: 17px; line-height: 1.25; font-weight: 700; }
[data-toantin-tool="chart_builder"] .cb-eyebrow { font-size: 11.5px; line-height: 1.2; }
[data-toantin-tool="chart_builder"] .cb-panel-hint { margin: 5px 0 11px; font-size: 13px; line-height: 1.45; color: #526277; }
[data-toantin-tool="chart_builder"] .cb-editor-section { padding: 12px 0; }
[data-toantin-tool="chart_builder"] .cb-section-title { margin-bottom: 8px; font-size: 14.5px; font-weight: 700; }
[data-toantin-tool="chart_builder"] .form-label,
[data-toantin-tool="chart_builder"] .cb-context-label,
[data-toantin-tool="chart_builder"] .cb-inspector-label { font-size: 13px; color: #526277; }
[data-toantin-tool="chart_builder"] .form-control-sm,
[data-toantin-tool="chart_builder"] .form-select-sm,
[data-toantin-tool="chart_builder"] .btn-sm { min-height: 36px; font-size: 13px; }
[data-toantin-tool="chart_builder"] .cb-action-row { gap: 7px; }
[data-toantin-tool="chart_builder"] .cb-data-grid { font-size: 13px; }
[data-toantin-tool="chart_builder"] .cb-data-grid th,
[data-toantin-tool="chart_builder"] .cb-data-grid td { min-width: 104px; }
[data-toantin-tool="chart_builder"] .cb-grid-header-input,
[data-toantin-tool="chart_builder"] .cb-grid-cell { min-height: 39px; font-size: 13px; }
[data-toantin-tool="chart_builder"] .cb-chart-gallery { gap: 8px; }
[data-toantin-tool="chart_builder"] .cb-chart-choice { min-height: 60px; padding: 8px 9px; }
[data-toantin-tool="chart_builder"] .cb-chart-choice__copy strong { font-size: 13px; }
[data-toantin-tool="chart_builder"] .cb-chart-choice__copy small { font-size: 11.5px; line-height: 1.25; }
[data-toantin-tool="chart_builder"] .cb-type-badge { font-size: 11.5px; }
[data-toantin-tool="chart_builder"] .cb-contextual-editor { padding: 8px 9px; border-color:#e1eaf5; box-shadow:none; }
[data-toantin-tool="chart_builder"] .cb-context-title { font-size: 13px; }
[data-toantin-tool="chart_builder"] .cb-context-title small,
[data-toantin-tool="chart_builder"] .cb-inspector-title small { font-size: 12px; }
[data-toantin-tool="chart_builder"] .cb-inspector-title strong { font-size: 14px; }
[data-toantin-tool="chart_builder"] .cb-inspector-group__title { font-size: 12px; letter-spacing:.025em; }
[data-toantin-tool="chart_builder"] .cb-inspector-label { font-size: 12.5px; }

[data-toantin-tool="chart_builder"] .cb-pie-quick-controls {
  margin-top: 11px;
  padding: 10px;
  border: 1px solid #dfe9f5;
  border-radius: 10px;
  background: #f8fbff;
}
[data-toantin-tool="chart_builder"] .cb-pie-quick-controls__title { margin-bottom: 7px; color: var(--cb-navy); font-size: 13px; font-weight: 700; }
[data-toantin-tool="chart_builder"] .cb-pie-quick-controls__grid { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
[data-toantin-tool="chart_builder"] .cb-pie-quick-field { display:grid; gap:4px; min-width:0; }
[data-toantin-tool="chart_builder"] .cb-pie-quick-field:last-child { grid-column:1/-1; max-width:150px; }
[data-toantin-tool="chart_builder"] .cb-pie-quick-label { color:#526277; font-size:12.5px; font-weight:600; }

[data-toantin-tool="chart_builder"] .cb-pie-label-hit-target { cursor: grab; }
[data-toantin-tool="chart_builder"] .cb-pie-label-hit-target:active { cursor: grabbing; }
[data-toantin-tool="chart_builder"] .cb-pie-label-hit-target:hover {
  fill: rgba(13,91,239,.035);
  stroke: rgba(13,91,239,.18);
  stroke-width: 1;
}
[data-toantin-tool="chart_builder"] .cb-pie-label-hit-target.cb-object-selected,
[data-toantin-tool="chart_builder"] .cb-pie-label-draggable.cb-object-selected .cb-pie-label-hit-target {
  fill: rgba(13,91,239,.075);
  stroke: rgba(13,91,239,.46);
  stroke-width: 1.2;
  stroke-dasharray: 4 3;
}
[data-toantin-tool="chart_builder"] .cb-pie-label-draggable { cursor:grab; touch-action:none; }
[data-toantin-tool="chart_builder"] .cb-pie-label-draggable:active { cursor:grabbing; }

@media (min-width: 1200px) {
  [data-toantin-tool="chart_builder"] .cb-preview-header { align-items:center; }
  [data-toantin-tool="chart_builder"] .cb-contextual-editor--full.is-empty { padding-top:6px; padding-bottom:6px; }
}
@media (max-width: 767.98px) {
  [data-toantin-tool="chart_builder"] .cb-full-tool { gap: 8px; }
  [data-toantin-tool="chart_builder"] .cb-preview-panel { padding: 8px; }
  [data-toantin-tool="chart_builder"] .cb-preview-header { align-items:flex-start; }
  [data-toantin-tool="chart_builder"] .cb-pie-quick-controls__grid { grid-template-columns:1fr; }
  [data-toantin-tool="chart_builder"] .cb-pie-quick-field:last-child { grid-column:auto; max-width:none; }
}
@media (max-width: 575.98px) {
  [data-toantin-tool="chart_builder"] .form-control-sm,
  [data-toantin-tool="chart_builder"] .form-select-sm,
  [data-toantin-tool="chart_builder"] .btn-sm { min-height:44px; font-size:14px; }
  [data-toantin-tool="chart_builder"] .cb-panel-title { font-size:16px; }
  [data-toantin-tool="chart_builder"] .cb-panel-hint { font-size:13px; }
  [data-toantin-tool="chart_builder"] .cb-full-chart-host { min-height: 360px; }
}

/* V1 PATCH_03 — resizable Preview height + auto-grow/no-clipping workspace. */
[data-toantin-tool="chart_builder"] .cb-full-tool {
  height: auto;
  min-height: 100%;
  align-items: stretch;
}
[data-toantin-tool="chart_builder"] .cb-preview-panel {
  position: relative;
  min-height: clamp(520px, 68vh, 880px);
  overflow: visible;
  padding-bottom: 24px;
}
[data-toantin-tool="chart_builder"] .cb-full-chart-host {
  flex: 1 1 auto;
  min-height: 220px;
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-preview-height-manual .cb-preview-panel {
  height: var(--cb-preview-height);
  min-height: var(--cb-preview-height);
  overflow: auto;
  overscroll-behavior: contain;
}
[data-toantin-tool="chart_builder"] .cb-preview-resize-handle {
  position: absolute;
  z-index: 6;
  left: 50%;
  bottom: 2px;
  width: 104px;
  height: 20px;
  transform: translateX(-50%);
  border-radius: 10px;
  cursor: ns-resize;
  touch-action: none;
  outline: none;
}
[data-toantin-tool="chart_builder"] .cb-preview-resize-handle::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 7px;
  width: 46px;
  height: 5px;
  transform: translateX(-50%);
  border-top: 2px solid #9bb0c9;
  border-bottom: 2px solid #9bb0c9;
  border-radius: 3px;
  opacity: .78;
  transition: border-color 120ms ease, opacity 120ms ease, width 120ms ease;
}
[data-toantin-tool="chart_builder"] .cb-preview-resize-handle:hover::before,
[data-toantin-tool="chart_builder"] .cb-preview-resize-handle:focus-visible::before,
[data-toantin-tool="chart_builder"] .cb-preview-resize-handle.is-dragging::before {
  width: 58px;
  border-color: var(--cb-primary-strong);
  opacity: 1;
}
[data-toantin-tool="chart_builder"] .cb-preview-resize-handle[data-mode="manual"]::after {
  content: "MANUAL";
  position: absolute;
  left: calc(50% + 38px);
  top: 3px;
  color: #8090a5;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .04em;
}
[data-toantin-tool="chart_builder"] .cb-preview-height-auto {
  width: 36px;
  min-width: 36px;
  padding-left: 0;
  padding-right: 0;
  font-size: 16px;
}
[data-toantin-tool="chart_builder"] .cb-preview-height-auto[aria-pressed="true"] {
  border-color: #9fc4fb;
  background: var(--cb-primary-soft);
  color: var(--cb-primary-strong);
}
@media (min-width: 768px) {
  [data-toantin-tool="chart_builder"] .cb-full-tool.is-preview-height-manual .cb-data-panel {
    height: var(--cb-preview-height);
    max-height: var(--cb-preview-height);
  }
}
@media (max-width: 767.98px) {
  [data-toantin-tool="chart_builder"] .cb-preview-panel {
    min-height: clamp(540px, 72vh, 820px);
  }
  [data-toantin-tool="chart_builder"] .cb-full-tool.is-preview-height-manual .cb-preview-panel {
    height: var(--cb-preview-height);
    min-height: var(--cb-preview-height);
  }
  [data-toantin-tool="chart_builder"] .cb-preview-resize-handle {
    width: 128px;
    height: 44px;
    bottom: 0;
  }
  [data-toantin-tool="chart_builder"] .cb-preview-resize-handle::before { top: 18px; }
  [data-toantin-tool="chart_builder"] .cb-preview-resize-handle[data-mode="manual"]::after { top: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  [data-toantin-tool="chart_builder"] .cb-preview-resize-handle::before { transition: none; }
}

/* PATCH_03 sizing correction: keep desktop row bounded by Host slot/minimum, not sidebar content height. */
@media (min-width: 768px) {
  [data-toantin-tool="chart_builder"] .cb-full-tool {
    height: max(100%, 520px);
    min-height: 520px;
  }
  [data-toantin-tool="chart_builder"] .cb-data-panel,
  [data-toantin-tool="chart_builder"] .cb-preview-panel {
    height: 100%;
    min-height: 0;
  }
  [data-toantin-tool="chart_builder"] .cb-full-tool.is-preview-height-manual {
    height: var(--cb-preview-height);
    min-height: var(--cb-preview-height);
  }
  [data-toantin-tool="chart_builder"] .cb-full-tool.is-preview-height-manual .cb-preview-panel,
  [data-toantin-tool="chart_builder"] .cb-full-tool.is-preview-height-manual .cb-data-panel {
    height: 100%;
    min-height: 0;
    max-height: none;
  }
  [data-toantin-tool="chart_builder"] .cb-preview-panel { overflow: hidden; }
}
@media (max-width: 767.98px) {
  [data-toantin-tool="chart_builder"] .cb-full-tool,
  [data-toantin-tool="chart_builder"] .cb-full-tool.is-preview-height-auto {
    height: auto;
    min-height: 0;
  }
  [data-toantin-tool="chart_builder"] .cb-data-panel { height: auto; }
  [data-toantin-tool="chart_builder"] .cb-preview-panel {
    height: auto;
    min-height: clamp(540px, 72vh, 820px);
    overflow: visible;
  }
  [data-toantin-tool="chart_builder"] .cb-full-tool.is-preview-height-manual .cb-preview-panel {
    height: var(--cb-preview-height);
    min-height: var(--cb-preview-height);
    overflow: auto;
  }
}

/* V1 PATCH_04 — Preview fullscreen + step-based height controls. */
[data-toantin-tool="chart_builder"] .cb-preview-height-controls {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 36px;
  padding: 2px 4px 2px 8px;
  border: 1px solid #d9e4f1;
  border-radius: 9px;
  background: #fff;
}
[data-toantin-tool="chart_builder"] .cb-preview-height-controls__caption {
  margin-right: 2px;
  color: #607087;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
}
[data-toantin-tool="chart_builder"] .cb-preview-height-controls__value {
  min-width: 54px;
  padding: 0 4px;
  color: var(--cb-navy);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  text-align: center;
}
[data-toantin-tool="chart_builder"] .cb-preview-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  min-width: 36px;
  padding-left: 0;
  padding-right: 0;
}
[data-toantin-tool="chart_builder"] .cb-preview-control-glyph { pointer-events:none; font-size:18px; line-height:1; font-weight:700; }
[data-toantin-tool="chart_builder"] .cb-preview-fullscreen-toggle[aria-pressed="true"],
[data-toantin-tool="chart_builder"] .cb-preview-height-auto[aria-pressed="true"] {
  border-color: #9fc4fb;
  background: var(--cb-primary-soft);
  color: var(--cb-primary-strong);
}
[data-toantin-tool="chart_builder"] .cb-preview-panel.is-preview-fullscreen-active,
[data-toantin-tool="chart_builder"] .cb-preview-panel:fullscreen {
  box-sizing: border-box;
  width: 100vw;
  height: 100vh !important;
  min-height: 100vh !important;
  max-height: none !important;
  margin: 0;
  padding: 14px 16px 16px;
  border: 0;
  border-radius: 0;
  background: #f7faff;
  box-shadow: none;
  overflow: hidden !important;
}
[data-toantin-tool="chart_builder"] .cb-preview-panel.is-preview-fullscreen-active:not(:fullscreen) {
  position: fixed;
  inset: 0;
  z-index: 120;
}
[data-toantin-tool="chart_builder"] .cb-preview-panel:fullscreen::backdrop { background: #eef4fb; }
[data-toantin-tool="chart_builder"] .cb-preview-panel.is-preview-fullscreen-active .cb-preview-header,
[data-toantin-tool="chart_builder"] .cb-preview-panel:fullscreen .cb-preview-header {
  flex: 0 0 auto;
  padding: 4px 6px 8px;
  border-bottom: 1px solid #dfe8f3;
  background: rgba(247,250,255,.96);
}
[data-toantin-tool="chart_builder"] .cb-preview-panel.is-preview-fullscreen-active .cb-contextual-editor,
[data-toantin-tool="chart_builder"] .cb-preview-panel:fullscreen .cb-contextual-editor {
  flex: 0 0 auto;
  max-height: 34vh;
  overflow: auto;
  overscroll-behavior: contain;
}
[data-toantin-tool="chart_builder"] .cb-preview-panel.is-preview-fullscreen-active .cb-full-chart-host,
[data-toantin-tool="chart_builder"] .cb-preview-panel:fullscreen .cb-full-chart-host {
  flex: 1 1 auto;
  min-height: 0;
}
[data-toantin-tool="chart_builder"] .cb-preview-panel.is-preview-fullscreen-active .cb-preview-resize-handle,
[data-toantin-tool="chart_builder"] .cb-preview-panel:fullscreen .cb-preview-resize-handle {
  display: none;
}
[data-toantin-tool="chart_builder"] .cb-preview-panel.is-preview-fullscreen-active .cb-chart-shell,
[data-toantin-tool="chart_builder"] .cb-preview-panel:fullscreen .cb-chart-shell {
  min-height: 0;
  height: 100%;
  border-radius: 12px;
}
@media (max-width: 767.98px) {
  [data-toantin-tool="chart_builder"] .cb-preview-height-controls { gap: 3px; padding-left: 6px; }
  [data-toantin-tool="chart_builder"] .cb-preview-height-controls__caption { display: none; }
  [data-toantin-tool="chart_builder"] .cb-preview-height-controls__value { min-width: 48px; }
  [data-toantin-tool="chart_builder"] .cb-preview-icon-button { width: 44px; min-width: 44px; }
  [data-toantin-tool="chart_builder"] .cb-preview-panel.is-preview-fullscreen-active,
  [data-toantin-tool="chart_builder"] .cb-preview-panel:fullscreen { padding: 8px; }
  [data-toantin-tool="chart_builder"] .cb-preview-panel.is-preview-fullscreen-active .cb-contextual-editor,
  [data-toantin-tool="chart_builder"] .cb-preview-panel:fullscreen .cb-contextual-editor { max-height: 42vh; }
}

/* V1 PATCH_05 — viewport height != chart scale; movable chart workspace; print/photocopy mode. */
[data-toantin-tool="chart_builder"] .cb-full-chart-host .cb-surface--preserve-vertical-scale {
  display:flex;
  align-items:center;
  justify-content:center;
  position:relative;
  overflow:hidden;
  min-height:100%;
}
[data-toantin-tool="chart_builder"] .cb-surface--preserve-vertical-scale .cb-chart-shell {
  flex:0 0 auto;
  width:100%;
  max-width:100%;
  transition:transform 120ms ease;
  will-change:transform;
}
[data-toantin-tool="chart_builder"] .cb-surface--preserve-vertical-scale.is-workspace-move-mode .cb-chart-shell,
[data-toantin-tool="chart_builder"] .cb-surface--preserve-vertical-scale.is-workspace-move-mode .cb-chart-svg {
  cursor:grab;
}
[data-toantin-tool="chart_builder"] .cb-surface--preserve-vertical-scale.is-workspace-move-mode .cb-chart-svg:active { cursor:grabbing; }
[data-toantin-tool="chart_builder"] .cb-chart-display-mode,
[data-toantin-tool="chart_builder"] .cb-chart-move-controls {
  display:inline-flex;
  align-items:center;
  gap:3px;
  padding:3px;
  border:1px solid #d9e4f1;
  border-radius:9px;
  background:#fff;
}
[data-toantin-tool="chart_builder"] .cb-display-mode-button {
  min-height:30px;
  padding:3px 8px;
  border-radius:7px;
  font-size:11.5px;
  font-weight:700;
}
[data-toantin-tool="chart_builder"] .cb-display-mode-button[aria-pressed="true"],
[data-toantin-tool="chart_builder"] .cb-chart-move-toggle[aria-pressed="true"] {
  border-color:#8bb8f6;
  background:var(--cb-primary-soft);
  color:var(--cb-primary-strong);
  box-shadow:inset 0 0 0 1px rgba(22,103,232,.08);
}
[data-toantin-tool="chart_builder"] .cb-chart-move-controls .cb-preview-icon-button { width:34px; min-width:34px; }
[data-toantin-tool="chart_builder"] .cb-full-chart-host { overflow:hidden; }
@media (max-width:767.98px){
  [data-toantin-tool="chart_builder"] .cb-chart-display-mode .btn,
  [data-toantin-tool="chart_builder"] .cb-chart-move-controls .btn { min-height:44px; }
  [data-toantin-tool="chart_builder"] .cb-display-mode-button { padding-left:9px; padding-right:9px; }
}
@media (prefers-reduced-motion:reduce){
  [data-toantin-tool="chart_builder"] .cb-surface--preserve-vertical-scale .cb-chart-shell { transition:none; }
}
@media (min-width:768px){
  [data-toantin-tool="chart_builder"] .cb-full-tool.is-preview-height-auto {
    height:max(100%,580px);
    min-height:580px;
  }
}

/* V1 PATCH_06 — zoom geometry containment/recovery. The stage owns painted bounds;
   ChartDocument/data/domain remain untouched and the Preview surface owns scrolling. */
[data-toantin-tool="chart_builder"] .cb-full-chart-host .cb-surface--zoom-geometry {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable both-edges;
}
[data-toantin-tool="chart_builder"] .cb-surface--zoom-geometry .cb-chart-zoom-stage {
  position: relative;
  display: block;
  min-width: 100%;
  min-height: 100%;
  box-sizing: border-box;
}
[data-toantin-tool="chart_builder"] .cb-surface--zoom-geometry .cb-chart-shell {
  position: absolute;
  flex: none;
  max-width: none;
  margin: 0;
  will-change: transform;
}
[data-toantin-tool="chart_builder"] .cb-surface--zoom-geometry .cb-chart-svg {
  transform: none;
  transform-origin: center center;
}
[data-toantin-tool="chart_builder"] .cb-surface--zoom-geometry.is-workspace-move-mode {
  cursor: grab;
}
[data-toantin-tool="chart_builder"] .cb-surface--zoom-geometry.is-workspace-move-mode:active {
  cursor: grabbing;
}
@media (prefers-reduced-motion: reduce) {
  [data-toantin-tool="chart_builder"] .cb-surface--zoom-geometry .cb-chart-shell { transition: none; }
}

/* V1 PATCH_07 — canvas/plot separation, selectable Plot Group and natural wheel chaining. */
[data-toantin-tool="chart_builder"] .cb-chart-shell {
  position: relative;
}
[data-toantin-tool="chart_builder"] .cb-plot-selection-layer {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}
[data-toantin-tool="chart_builder"] .cb-plot-selection-box {
  position: absolute;
  border: 2px solid var(--cb-primary-strong);
  border-radius: 8px;
  box-shadow: 0 0 0 3px rgba(13,91,239,.10);
  pointer-events: none;
}
[data-toantin-tool="chart_builder"] .cb-plot-selection-box[hidden] { display: none; }
[data-toantin-tool="chart_builder"] .cb-plot-resize-handle {
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid var(--cb-primary-strong);
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 2px 7px rgba(15,31,75,.18);
  pointer-events: auto;
  touch-action: none;
}
[data-toantin-tool="chart_builder"] .cb-plot-resize-handle--nw { left:0; top:0; transform:translate(-50%,-50%); cursor:nwse-resize; }
[data-toantin-tool="chart_builder"] .cb-plot-resize-handle--n  { left:50%; top:0; transform:translate(-50%,-50%); cursor:ns-resize; }
[data-toantin-tool="chart_builder"] .cb-plot-resize-handle--ne { right:0; top:0; transform:translate(50%,-50%); cursor:nesw-resize; }
[data-toantin-tool="chart_builder"] .cb-plot-resize-handle--e  { right:0; top:50%; transform:translate(50%,-50%); cursor:ew-resize; }
[data-toantin-tool="chart_builder"] .cb-plot-resize-handle--se { right:0; bottom:0; transform:translate(50%,50%); cursor:nwse-resize; }
[data-toantin-tool="chart_builder"] .cb-plot-resize-handle--s  { left:50%; bottom:0; transform:translate(-50%,50%); cursor:ns-resize; }
[data-toantin-tool="chart_builder"] .cb-plot-resize-handle--sw { left:0; bottom:0; transform:translate(-50%,50%); cursor:nesw-resize; }
[data-toantin-tool="chart_builder"] .cb-plot-resize-handle--w  { left:0; top:50%; transform:translate(-50%,-50%); cursor:ew-resize; }
[data-toantin-tool="chart_builder"] .cb-plot-selection-box[data-uniform="true"] .cb-plot-resize-handle--n,
[data-toantin-tool="chart_builder"] .cb-plot-selection-box[data-uniform="true"] .cb-plot-resize-handle--s { cursor:ns-resize; }
[data-toantin-tool="chart_builder"] .cb-plot-selection-box[data-uniform="true"] .cb-plot-resize-handle--e,
[data-toantin-tool="chart_builder"] .cb-plot-selection-box[data-uniform="true"] .cb-plot-resize-handle--w { cursor:ew-resize; }
[data-toantin-tool="chart_builder"] .cb-chart-select-toggle[aria-pressed="true"],
[data-toantin-tool="chart_builder"] .cb-chart-move-toggle[aria-pressed="true"] {
  border-color:#8bb8f6;
  background:var(--cb-primary-soft);
  color:var(--cb-primary-strong);
  box-shadow:inset 0 0 0 1px rgba(22,103,232,.08);
}
[data-toantin-tool="chart_builder"] .cb-full-chart-host .cb-surface--zoom-geometry,
[data-toantin-tool="chart_builder"] .cb-surface--zoom-geometry {
  overscroll-behavior: auto;
  scrollbar-gutter: auto;
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-preview-height-manual .cb-preview-panel {
  overscroll-behavior: auto;
}
[data-toantin-tool="chart_builder"] .cb-preview-panel.is-preview-fullscreen-active .cb-contextual-editor,
[data-toantin-tool="chart_builder"] .cb-preview-panel:fullscreen .cb-contextual-editor {
  overscroll-behavior: auto;
}
[data-toantin-tool="chart_builder"] .cb-preview-panel.is-preview-fullscreen-active .cb-full-chart-host,
[data-toantin-tool="chart_builder"] .cb-preview-panel:fullscreen .cb-full-chart-host,
[data-toantin-tool="chart_builder"] .cb-preview-panel.is-preview-fullscreen-active .cb-surface--zoom-geometry,
[data-toantin-tool="chart_builder"] .cb-preview-panel:fullscreen .cb-surface--zoom-geometry,
[data-toantin-tool="chart_builder"] .cb-preview-panel.is-preview-fullscreen-active .cb-chart-zoom-stage,
[data-toantin-tool="chart_builder"] .cb-preview-panel:fullscreen .cb-chart-zoom-stage {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
}
@media (max-width: 767.98px) {
  [data-toantin-tool="chart_builder"] .cb-plot-resize-handle { width:18px; height:18px; }
}
@media (prefers-reduced-motion: reduce) {
  [data-toantin-tool="chart_builder"] .cb-plot-selection-box { transition:none; }
}

/* V1 PATCH_08 — marquee Select, Plot Group move edges, Data & Ratio teaching window. */
[data-toantin-tool="chart_builder"] .cb-cursor-icon { display:block; }
[data-toantin-tool="chart_builder"] .cb-surface[data-interaction-mode="select"] .cb-chart-svg { cursor: default; }
[data-toantin-tool="chart_builder"] .cb-selection-marquee {
  position:absolute;
  z-index:8;
  border:1.5px solid #0d5bef;
  border-radius:4px;
  background:rgba(13,91,239,.09);
  box-shadow:0 0 0 1px rgba(255,255,255,.72) inset;
  pointer-events:none;
}
[data-toantin-tool="chart_builder"] .cb-selection-marquee[hidden] { display:none; }
[data-toantin-tool="chart_builder"] .cb-chart-svg .cb-marquee-preview,
[data-toantin-tool="chart_builder"] .cb-chart-svg .cb-object-selected {
  filter:drop-shadow(0 0 5px rgba(13,91,239,.78)) drop-shadow(0 0 10px rgba(56,189,248,.34));
}
[data-toantin-tool="chart_builder"] .cb-plot-move-edge {
  position:absolute;
  z-index:2;
  pointer-events:auto;
  touch-action:none;
}
[data-toantin-tool="chart_builder"] .cb-plot-move-edge--n,
[data-toantin-tool="chart_builder"] .cb-plot-move-edge--s { left:18px; right:18px; height:12px; cursor:move; }
[data-toantin-tool="chart_builder"] .cb-plot-move-edge--n { top:-6px; }
[data-toantin-tool="chart_builder"] .cb-plot-move-edge--s { bottom:-6px; }
[data-toantin-tool="chart_builder"] .cb-plot-move-edge--e,
[data-toantin-tool="chart_builder"] .cb-plot-move-edge--w { top:18px; bottom:18px; width:12px; cursor:move; }
[data-toantin-tool="chart_builder"] .cb-plot-move-edge--e { right:-6px; }
[data-toantin-tool="chart_builder"] .cb-plot-move-edge--w { left:-6px; }
[data-toantin-tool="chart_builder"] .cb-plot-selection-box.is-moving {
  box-shadow:0 0 0 4px rgba(13,91,239,.12),0 10px 22px rgba(15,31,75,.10);
}

[data-toantin-tool="chart_builder"] .cb-ratio-window {
  --cb-ratio-title-size:15.5px;
  --cb-ratio-subtitle-size:12px;
  --cb-ratio-body-size:13px;
  --cb-ratio-small-size:12.5px;
  --cb-ratio-formula-title-size:17px;
  --cb-ratio-formula-size:14px;
  --cb-ratio-result-size:15px;
  --cb-ratio-control-height:36px;
  position:absolute;
  z-index:36;
  display:flex;
  flex-direction:column;
  min-width:0;
  min-height:0;
  overflow:hidden;
  border:1px solid #cfe0f4;
  border-radius:14px;
  background:#fff;
  box-shadow:0 22px 64px rgba(15,31,75,.22),0 3px 10px rgba(15,31,75,.10);
}
[data-toantin-tool="chart_builder"] .cb-ratio-window[hidden] { display:none; }
[data-toantin-tool="chart_builder"] .cb-ratio-window__header {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  min-height:58px;
  padding:9px 12px 9px 15px;
  border-bottom:1px solid #dce7f4;
  background:linear-gradient(180deg,#fbfdff 0%,#f4f8ff 100%);
  cursor:move;
  user-select:none;
  touch-action:none;
}
[data-toantin-tool="chart_builder"] .cb-ratio-window.is-maximized .cb-ratio-window__header { cursor:default; }
[data-toantin-tool="chart_builder"] .cb-ratio-window__heading { display:grid; gap:1px; min-width:0; }
[data-toantin-tool="chart_builder"] .cb-ratio-window__title { color:#102a56; font-size:var(--cb-ratio-title-size); font-weight:750; }
[data-toantin-tool="chart_builder"] .cb-ratio-window__subtitle { overflow:hidden; color:#64748b; font-size:var(--cb-ratio-subtitle-size); text-overflow:ellipsis; white-space:nowrap; }
[data-toantin-tool="chart_builder"] .cb-ratio-window__actions { display:flex; gap:7px; flex:none; }
[data-toantin-tool="chart_builder"] .cb-ratio-window__actions .btn { min-height:var(--cb-ratio-control-height); font-size:var(--cb-ratio-body-size); }
[data-toantin-tool="chart_builder"] .cb-ratio-font-btn { min-width:42px; font-weight:800; letter-spacing:-.01em; }
[data-toantin-tool="chart_builder"] .cb-ratio-window .form-control-sm,
[data-toantin-tool="chart_builder"] .cb-ratio-window .form-select-sm { min-height:var(--cb-ratio-control-height); font-size:var(--cb-ratio-body-size); }
[data-toantin-tool="chart_builder"] .cb-ratio-window.is-maximized .cb-ratio-window__header { min-height:72px; padding:12px 18px; }
[data-toantin-tool="chart_builder"] .cb-ratio-window.is-maximized .cb-ratio-window__toolbar { padding:14px 18px; gap:12px 18px; }
[data-toantin-tool="chart_builder"] .cb-ratio-window.is-maximized .cb-ratio-window__body { gap:18px; padding:18px; }
[data-toantin-tool="chart_builder"] .cb-ratio-window.is-maximized .cb-ratio-table th,
[data-toantin-tool="chart_builder"] .cb-ratio-window.is-maximized .cb-ratio-table td { padding:12px 13px; }
[data-toantin-tool="chart_builder"] .cb-ratio-window.is-maximized .cb-ratio-formula { gap:16px; padding:18px; }
[data-toantin-tool="chart_builder"] .cb-ratio-window__toolbar {
  display:flex;
  align-items:end;
  flex-wrap:wrap;
  gap:10px 14px;
  padding:10px 14px;
  border-bottom:1px solid #e4edf7;
  background:#fff;
}
[data-toantin-tool="chart_builder"] .cb-ratio-window__mode { display:grid; grid-template-columns:auto minmax(180px,260px); align-items:center; gap:8px; color:#526277; font-size:var(--cb-ratio-small-size); font-weight:650; }
[data-toantin-tool="chart_builder"] .cb-ratio-window__note { flex:1 1 280px; color:#64748b; font-size:var(--cb-ratio-subtitle-size); line-height:1.4; }
[data-toantin-tool="chart_builder"] .cb-ratio-window__body {
  display:grid;
  grid-template-columns:minmax(0,1.55fr) minmax(260px,.85fr);
  gap:14px;
  min-height:0;
  padding:14px;
  overflow:auto;
  background:#f8fbff;
}
[data-toantin-tool="chart_builder"] .cb-ratio-table-wrap {
  min-width:0;
  overflow:auto;
  border:1px solid #dce7f4;
  border-radius:12px;
  background:#fff;
}
[data-toantin-tool="chart_builder"] .cb-ratio-table { width:100%; border-collapse:separate; border-spacing:0; font-size:var(--cb-ratio-body-size); }
[data-toantin-tool="chart_builder"] .cb-ratio-table th,
[data-toantin-tool="chart_builder"] .cb-ratio-table td { padding:8px 9px; border-bottom:1px solid #edf2f8; vertical-align:middle; }
[data-toantin-tool="chart_builder"] .cb-ratio-table th { position:sticky; top:0; z-index:1; color:#475569; background:#f5f9ff; font-size:var(--cb-ratio-small-size); font-weight:700; text-align:left; }
[data-toantin-tool="chart_builder"] .cb-ratio-table tbody tr:not(.cb-ratio-total) { cursor:pointer; transition:background-color 120ms ease,box-shadow 120ms ease; }
[data-toantin-tool="chart_builder"] .cb-ratio-table tbody tr:not(.cb-ratio-total):hover { background:#f7fbff; }
[data-toantin-tool="chart_builder"] .cb-ratio-table tbody tr.is-active { background:#eef6ff; box-shadow:inset 3px 0 #1667e8; }
[data-toantin-tool="chart_builder"] .cb-ratio-input { min-width:96px; text-align:right; font-variant-numeric:tabular-nums; }
[data-toantin-tool="chart_builder"] .cb-ratio-total td { color:#102a56; background:#f7faff; font-weight:750; border-bottom:0; }
[data-toantin-tool="chart_builder"] .cb-ratio-formula {
  align-self:start;
  display:grid;
  gap:12px;
  min-width:0;
  padding:14px;
  border:1px solid #d7e6f7;
  border-radius:12px;
  background:#fff;
  box-shadow:0 5px 18px rgba(15,31,75,.04);
}
[data-toantin-tool="chart_builder"] .cb-ratio-formula__eyebrow { color:#1667e8; font-size:var(--cb-ratio-small-size); font-weight:800; letter-spacing:.08em; }
[data-toantin-tool="chart_builder"] .cb-ratio-formula__title { margin:0; color:#102a56; font-size:var(--cb-ratio-formula-title-size); font-weight:750; }
[data-toantin-tool="chart_builder"] .cb-formula-line { display:flex; align-items:center; flex-wrap:wrap; gap:8px; min-height:54px; color:#1e293b; font-size:var(--cb-ratio-formula-size); }
[data-toantin-tool="chart_builder"] .cb-formula-label { color:#475569; font-weight:650; }
[data-toantin-tool="chart_builder"] .cb-fraction { display:inline-grid; grid-template-rows:auto auto; min-width:92px; text-align:center; line-height:1.2; font-variant-numeric:tabular-nums; }
[data-toantin-tool="chart_builder"] .cb-fraction__top { padding:0 8px 4px; border-bottom:1.6px solid #1e293b; }
[data-toantin-tool="chart_builder"] .cb-fraction__bottom { padding:4px 8px 0; }
[data-toantin-tool="chart_builder"] .cb-formula-result { color:#0d5bef; font-size:var(--cb-ratio-result-size); font-weight:750; }
[data-toantin-tool="chart_builder"] .cb-ratio-formula__hint { margin:0; color:#64748b; font-size:var(--cb-ratio-subtitle-size); line-height:1.45; }
[data-toantin-tool="chart_builder"] .cb-ratio-window__empty { padding:24px; color:#64748b; }
[data-toantin-tool="chart_builder"] .cb-ratio-resize { position:absolute; z-index:4; display:block; touch-action:none; }
[data-toantin-tool="chart_builder"] .cb-ratio-resize--n { top:-5px; left:12px; right:12px; height:10px; cursor:ns-resize; }
[data-toantin-tool="chart_builder"] .cb-ratio-resize--s { bottom:-5px; left:12px; right:12px; height:10px; cursor:ns-resize; }
[data-toantin-tool="chart_builder"] .cb-ratio-resize--e { right:-5px; top:12px; bottom:12px; width:10px; cursor:ew-resize; }
[data-toantin-tool="chart_builder"] .cb-ratio-resize--w { left:-5px; top:12px; bottom:12px; width:10px; cursor:ew-resize; }
[data-toantin-tool="chart_builder"] .cb-ratio-resize--ne,
[data-toantin-tool="chart_builder"] .cb-ratio-resize--nw,
[data-toantin-tool="chart_builder"] .cb-ratio-resize--se,
[data-toantin-tool="chart_builder"] .cb-ratio-resize--sw { width:18px; height:18px; }
[data-toantin-tool="chart_builder"] .cb-ratio-resize--ne { top:-7px; right:-7px; cursor:nesw-resize; }
[data-toantin-tool="chart_builder"] .cb-ratio-resize--nw { top:-7px; left:-7px; cursor:nwse-resize; }
[data-toantin-tool="chart_builder"] .cb-ratio-resize--se { bottom:-7px; right:-7px; cursor:nwse-resize; }
[data-toantin-tool="chart_builder"] .cb-ratio-resize--sw { bottom:-7px; left:-7px; cursor:nesw-resize; }
[data-toantin-tool="chart_builder"] .cb-ratio-window.is-maximized .cb-ratio-resize { display:none; }

@media (max-width: 767.98px) {
  [data-toantin-tool="chart_builder"] .cb-ratio-window__body { grid-template-columns:1fr; }
  [data-toantin-tool="chart_builder"] .cb-ratio-window__header { min-height:62px; }
  [data-toantin-tool="chart_builder"] .cb-ratio-window__subtitle { display:none; }
}
@media (max-width: 575.98px) {
  [data-toantin-tool="chart_builder"] .cb-ratio-window { left:6px !important; top:6px !important; width:calc(100% - 12px) !important; height:calc(100% - 12px) !important; border-radius:11px; }
  [data-toantin-tool="chart_builder"] .cb-ratio-resize { display:none; }
  [data-toantin-tool="chart_builder"] .cb-ratio-window__toolbar { align-items:stretch; }
  [data-toantin-tool="chart_builder"] .cb-ratio-window__mode { grid-template-columns:1fr; width:100%; }
  [data-toantin-tool="chart_builder"] .cb-ratio-window__body { padding:10px; }
}
@media (prefers-reduced-motion: reduce) {
  [data-toantin-tool="chart_builder"] .cb-ratio-table tbody tr:not(.cb-ratio-total) { transition:none; }
}
[data-toantin-tool="chart_builder"] .cb-cursor-shape {
  display:block;
  width:18px;
  height:18px;
  background:currentColor;
  clip-path:polygon(8% 2%,82% 61%,57% 65%,74% 96%,60% 100%,43% 68%,25% 87%);
  transform:rotate(-2deg);
}

/* V1 PATCH_10 — true fullscreen teaching window + semantic grouping polish. */
[data-toantin-tool="chart_builder"] .cb-group-action { font-weight:700; }
[data-toantin-tool="chart_builder"] .cb-ratio-window:fullscreen,
[data-toantin-tool="chart_builder"] .cb-ratio-window.is-native-fullscreen {
  left:0 !important;
  top:0 !important;
  width:100vw !important;
  height:100vh !important;
  max-width:none !important;
  max-height:none !important;
  border:0;
  border-radius:0;
  box-shadow:none;
  background:#f8fbff;
}
[data-toantin-tool="chart_builder"] .cb-ratio-window:fullscreen .cb-ratio-window__header,
[data-toantin-tool="chart_builder"] .cb-ratio-window.is-native-fullscreen .cb-ratio-window__header {
  min-height:76px;
  padding:14px 20px;
}
[data-toantin-tool="chart_builder"] .cb-ratio-window:fullscreen .cb-ratio-window__body,
[data-toantin-tool="chart_builder"] .cb-ratio-window.is-native-fullscreen .cb-ratio-window__body {
  padding:20px;
  gap:20px;
}
[data-toantin-tool="chart_builder"] .cb-ratio-window:fullscreen .cb-ratio-resize,
[data-toantin-tool="chart_builder"] .cb-ratio-window.is-native-fullscreen .cb-ratio-resize { display:none !important; }

/* V1 PATCH_11 — compact contextual property header: object selector + actions on one row. */
[data-toantin-tool="chart_builder"] .cb-context-bar {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  align-items: center;
  gap: 8px 10px;
  min-width: 0;
}
[data-toantin-tool="chart_builder"] .cb-context-bar--empty {
  grid-template-columns: minmax(220px, 360px);
  margin-bottom: 6px;
}
[data-toantin-tool="chart_builder"] .cb-context-object-select {
  min-width: 0;
  width: 100%;
  color: var(--cb-navy);
  font-weight: 650;
  border-color: #cfdeef;
  background-color: #fff;
}
[data-toantin-tool="chart_builder"] .cb-context-bar .cb-context-actions {
  min-width: 0;
  justify-content: flex-start;
  align-items: center;
}
[data-toantin-tool="chart_builder"] .cb-context-bar + .cb-context-fields {
  margin-top: 8px;
}
@media (max-width: 991.98px) {
  [data-toantin-tool="chart_builder"] .cb-context-bar {
    grid-template-columns: minmax(190px, 280px) minmax(0, 1fr);
  }
}
@media (max-width: 767.98px) {
  [data-toantin-tool="chart_builder"] .cb-context-bar,
  [data-toantin-tool="chart_builder"] .cb-context-bar--empty {
    grid-template-columns: 1fr;
  }
  [data-toantin-tool="chart_builder"] .cb-context-bar .cb-context-actions {
    width: 100%;
    justify-content: flex-start;
  }
  [data-toantin-tool="chart_builder"] .cb-context-bar .cb-context-actions .btn {
    min-height: 44px;
  }
}

/* V1 PATCH_12 — space-efficient contextual command row + subtle 3D icon language. */
[data-toantin-tool="chart_builder"] .cb-context-bar {
  grid-template-columns: minmax(210px, 300px) minmax(0, 1fr) auto;
  gap: 7px 9px;
}
[data-toantin-tool="chart_builder"] .cb-context-bar--empty {
  grid-template-columns: minmax(210px, 340px) auto;
  justify-content: space-between;
}
[data-toantin-tool="chart_builder"] .cb-context-utility-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  min-width: max-content;
  padding-left: 9px;
  border-left: 1px solid #e3ebf5;
}
[data-toantin-tool="chart_builder"] .cb-context-utility-button,
[data-toantin-tool="chart_builder"] .cb-icon-button-3d {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  min-width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid #c9d9ee;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff 0%, #f7faff 46%, #e9f2ff 100%);
  color: #17365f;
  box-shadow:
    0 5px 12px rgba(26, 72, 132, .13),
    inset 0 1px 0 rgba(255,255,255,.96),
    inset 0 -1px 0 rgba(111,154,214,.10);
  text-shadow: 0 1px 0 rgba(255,255,255,.72);
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease, background-color 140ms ease, color 140ms ease;
}
[data-toantin-tool="chart_builder"] .cb-context-utility-icon {
  display: block;
  width: 19px;
  height: 19px;
  filter: drop-shadow(0 1px 0 rgba(255,255,255,.88));
  pointer-events: none;
}
[data-toantin-tool="chart_builder"] .cb-context-utility-button:hover:not(:disabled),
[data-toantin-tool="chart_builder"] .cb-context-utility-button:focus-visible,
[data-toantin-tool="chart_builder"] .cb-icon-button-3d:hover:not(:disabled),
[data-toantin-tool="chart_builder"] .cb-icon-button-3d:focus-visible {
  transform: translateY(-1px);
  border-color: #91b8ec;
  background: linear-gradient(180deg, #ffffff 0%, #eef6ff 42%, #dcecff 100%);
  color: var(--cb-primary-strong);
  box-shadow:
    0 7px 16px rgba(23, 80, 157, .18),
    inset 0 1px 0 rgba(255,255,255,1),
    inset 0 -1px 0 rgba(74,132,210,.12);
}
[data-toantin-tool="chart_builder"] .cb-context-utility-button:active:not(:disabled),
[data-toantin-tool="chart_builder"] .cb-icon-button-3d:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow:
    0 2px 6px rgba(26,72,132,.13),
    inset 0 2px 5px rgba(51,96,158,.13),
    inset 0 1px 0 rgba(255,255,255,.72);
}
[data-toantin-tool="chart_builder"] .cb-context-utility-button:focus-visible,
[data-toantin-tool="chart_builder"] .cb-icon-button-3d:focus-visible {
  outline: 3px solid rgba(22,103,232,.20);
  outline-offset: 2px;
}
[data-toantin-tool="chart_builder"] .cb-context-utility-button:disabled,
[data-toantin-tool="chart_builder"] .cb-icon-button-3d:disabled {
  opacity: .42;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.78);
  cursor: not-allowed;
}

/* Apply the same restrained 3D chrome to existing icon-only controls. */
[data-toantin-tool="chart_builder"] .cb-domain-action,
[data-toantin-tool="chart_builder"] .cb-preview-icon-button,
[data-toantin-tool="chart_builder"] .cb-data-panel-toggle {
  border-color: #c9d9ee;
  background: linear-gradient(180deg, #ffffff 0%, #f7faff 46%, #e9f2ff 100%);
  color: #17365f;
  box-shadow:
    0 4px 10px rgba(26,72,132,.12),
    inset 0 1px 0 rgba(255,255,255,.96),
    inset 0 -1px 0 rgba(111,154,214,.10);
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease, background 140ms ease, color 140ms ease;
}
[data-toantin-tool="chart_builder"] .cb-domain-action:hover:not(:disabled),
[data-toantin-tool="chart_builder"] .cb-preview-icon-button:hover:not(:disabled),
[data-toantin-tool="chart_builder"] .cb-data-panel-toggle:hover:not(:disabled),
[data-toantin-tool="chart_builder"] .cb-domain-action:focus-visible,
[data-toantin-tool="chart_builder"] .cb-preview-icon-button:focus-visible,
[data-toantin-tool="chart_builder"] .cb-data-panel-toggle:focus-visible {
  transform: translateY(-1px);
  border-color: #91b8ec;
  background: linear-gradient(180deg, #ffffff 0%, #eef6ff 42%, #dcecff 100%);
  color: var(--cb-primary-strong);
  box-shadow:
    0 6px 14px rgba(23,80,157,.17),
    inset 0 1px 0 rgba(255,255,255,1),
    inset 0 -1px 0 rgba(74,132,210,.12);
}
[data-toantin-tool="chart_builder"] .cb-domain-action:active:not(:disabled),
[data-toantin-tool="chart_builder"] .cb-preview-icon-button:active:not(:disabled),
[data-toantin-tool="chart_builder"] .cb-data-panel-toggle:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: 0 2px 5px rgba(26,72,132,.12), inset 0 2px 5px rgba(51,96,158,.13);
}
[data-toantin-tool="chart_builder"] .cb-chart-select-toggle[aria-pressed="true"],
[data-toantin-tool="chart_builder"] .cb-chart-move-toggle[aria-pressed="true"],
[data-toantin-tool="chart_builder"] .cb-preview-fullscreen-toggle[aria-pressed="true"],
[data-toantin-tool="chart_builder"] .cb-preview-height-auto[aria-pressed="true"] {
  border-color: #0d5bef;
  background: linear-gradient(180deg, #3b82f6 0%, #1667e8 56%, #0d5bef 100%);
  color: #fff;
  box-shadow:
    0 6px 14px rgba(13,91,239,.28),
    inset 0 1px 0 rgba(255,255,255,.28),
    inset 0 -1px 0 rgba(3,53,148,.24);
  text-shadow: 0 1px 1px rgba(0,39,108,.24);
}
[data-toantin-tool="chart_builder"] .cb-contextual-editor {
  padding-top: 7px;
  padding-bottom: 7px;
}
[data-toantin-tool="chart_builder"] .cb-context-bar + .cb-context-fields { margin-top: 6px; }
[data-toantin-tool="chart_builder"] .cb-preview-panel > .cb-contextual-editor { margin-bottom: 8px; }

@media (max-width: 991.98px) {
  [data-toantin-tool="chart_builder"] .cb-context-bar {
    grid-template-columns: minmax(190px, 270px) minmax(0, 1fr);
  }
  [data-toantin-tool="chart_builder"] .cb-context-utility-actions {
    grid-column: 2;
    justify-self: end;
    padding-left: 0;
    border-left: 0;
  }
  [data-toantin-tool="chart_builder"] .cb-context-bar--empty {
    grid-template-columns: minmax(190px, 300px) auto;
  }
  [data-toantin-tool="chart_builder"] .cb-context-bar--empty .cb-context-utility-actions {
    grid-column: auto;
  }
}
@media (max-width: 767.98px) {
  [data-toantin-tool="chart_builder"] .cb-context-bar,
  [data-toantin-tool="chart_builder"] .cb-context-bar--empty {
    grid-template-columns: 1fr;
  }
  [data-toantin-tool="chart_builder"] .cb-context-utility-actions,
  [data-toantin-tool="chart_builder"] .cb-context-bar--empty .cb-context-utility-actions {
    grid-column: 1;
    justify-self: start;
    width: auto;
  }
  [data-toantin-tool="chart_builder"] .cb-context-utility-button,
  [data-toantin-tool="chart_builder"] .cb-icon-button-3d {
    width: 44px;
    min-width: 44px;
    height: 44px;
  }
}
@media (prefers-reduced-motion: reduce) {
  [data-toantin-tool="chart_builder"] .cb-context-utility-button,
  [data-toantin-tool="chart_builder"] .cb-icon-button-3d,
  [data-toantin-tool="chart_builder"] .cb-domain-action,
  [data-toantin-tool="chart_builder"] .cb-preview-icon-button,
  [data-toantin-tool="chart_builder"] .cb-data-panel-toggle { transition: none; }
}

/* V1 PATCH_14 — universal selectable-object affordance, Arrow/Hand cursor contract, unified mild 3D icons. */
[data-toantin-tool="chart_builder"] .cb-preview-control-svg {
  display:block;
  width:19px;
  height:19px;
  pointer-events:none;
  filter:drop-shadow(0 1px 0 rgba(255,255,255,.82));
}
[data-toantin-tool="chart_builder"] .cb-semantic-hit-layer [data-role="semantic-hit-target"] {
  pointer-events:all;
}
/* Chọn = mũi tên hệ thống trên toàn bộ semantic object. */
[data-toantin-tool="chart_builder"] .cb-surface[data-interaction-mode="select"] .cb-chart-svg,
[data-toantin-tool="chart_builder"] .cb-surface[data-interaction-mode="select"] .cb-chart-svg [data-object-id],
[data-toantin-tool="chart_builder"] .cb-surface[data-interaction-mode="select"] .cb-chart-svg [data-drag-kind] {
  cursor:default;
}
/* Bàn tay = pan workspace; con lăn chuột tạm thời cũng dùng grabbing. */
[data-toantin-tool="chart_builder"] .cb-surface[data-interaction-mode="move"] .cb-chart-svg,
[data-toantin-tool="chart_builder"] .cb-surface[data-interaction-mode="move"] .cb-chart-svg [data-object-id],
[data-toantin-tool="chart_builder"] .cb-surface.is-workspace-move-mode .cb-chart-svg,
[data-toantin-tool="chart_builder"] .cb-surface.is-workspace-move-mode .cb-chart-svg [data-object-id] {
  cursor:grab;
}
[data-toantin-tool="chart_builder"] .cb-surface[data-interaction-mode="move"] .cb-chart-svg:active,
[data-toantin-tool="chart_builder"] .cb-surface.is-temporary-pan-active .cb-chart-svg,
[data-toantin-tool="chart_builder"] .cb-surface.is-temporary-pan-active .cb-chart-svg [data-object-id] {
  cursor:grabbing;
}
/* Extend the same restrained tactile language to icon-like +/-/100% controls. */
[data-toantin-tool="chart_builder"] .cb-zoom-step-button,
[data-toantin-tool="chart_builder"] .cb-view-zoom__reset,
[data-toantin-tool="chart_builder"] .cb-ratio-font-btn {
  border-color:#c9d9ee;
  background:linear-gradient(180deg,#fff 0%,#f7faff 45%,#e8f2ff 100%);
  box-shadow:0 4px 10px rgba(26,72,132,.12),inset 0 1px 0 rgba(255,255,255,.96),inset 0 -1px 0 rgba(111,154,214,.10);
  color:#17365f;
  font-weight:800;
}
[data-toantin-tool="chart_builder"] .cb-zoom-step-button:hover:not(:disabled),
[data-toantin-tool="chart_builder"] .cb-view-zoom__reset:hover:not(:disabled),
[data-toantin-tool="chart_builder"] .cb-ratio-font-btn:hover:not(:disabled) {
  transform:translateY(-1px);
  border-color:#91b8ec;
  background:linear-gradient(180deg,#fff 0%,#eef6ff 42%,#dcecff 100%);
  box-shadow:0 6px 14px rgba(23,80,157,.17),inset 0 1px 0 rgba(255,255,255,1);
}
[data-toantin-tool="chart_builder"] .cb-zoom-step-button:active:not(:disabled),
[data-toantin-tool="chart_builder"] .cb-view-zoom__reset:active:not(:disabled),
[data-toantin-tool="chart_builder"] .cb-ratio-font-btn:active:not(:disabled) {
  transform:translateY(1px);
  box-shadow:0 2px 5px rgba(26,72,132,.12),inset 0 2px 5px rgba(51,96,158,.13);
}
@media (prefers-reduced-motion:reduce) {
  [data-toantin-tool="chart_builder"] .cb-zoom-step-button,
  [data-toantin-tool="chart_builder"] .cb-view-zoom__reset,
  [data-toantin-tool="chart_builder"] .cb-ratio-font-btn { transition:none; }
}

/* V1 PATCH_16 — immediate palette editing, print-friendly grayscale swatches, stronger semantic selection cue. */
[data-toantin-tool="chart_builder"] .cb-context-field.is-color-field { grid-column:span 2; min-width:280px; }
[data-toantin-tool="chart_builder"] .cb-inspector-field.is-color-field { grid-column:1 / -1; }
[data-toantin-tool="chart_builder"] .cb-color-control {
  display:grid;
  gap:7px;
  min-width:0;
}
[data-toantin-tool="chart_builder"] .cb-color-custom-row {
  display:grid;
  grid-template-columns:minmax(108px, auto) minmax(92px, 1fr) auto;
  gap:7px;
  align-items:center;
}
[data-toantin-tool="chart_builder"] .cb-color-native-wrap {
  position:relative;
  display:flex;
  align-items:center;
  gap:7px;
  min-height:34px;
  padding:4px 8px 4px 5px;
  border:1px solid #cbd9eb;
  border-radius:8px;
  background:linear-gradient(180deg,#fff 0%,#f8fbff 55%,#eef5ff 100%);
  box-shadow:0 2px 6px rgba(27,65,115,.07), inset 0 1px 0 rgba(255,255,255,.95);
  color:#334155;
  font-size:11.5px;
  font-weight:650;
  cursor:pointer;
}
[data-toantin-tool="chart_builder"] .cb-color-native-wrap:hover {
  border-color:#9dbfe9;
  box-shadow:0 4px 9px rgba(27,65,115,.10), inset 0 1px 0 rgba(255,255,255,.98);
}
[data-toantin-tool="chart_builder"] .cb-color-native {
  width:28px;
  height:24px;
  padding:1px;
  border:0;
  border-radius:6px;
  background:transparent;
  cursor:pointer;
}
[data-toantin-tool="chart_builder"] .cb-color-native::-webkit-color-swatch-wrapper { padding:1px; }
[data-toantin-tool="chart_builder"] .cb-color-native::-webkit-color-swatch { border:1px solid rgba(15,31,75,.18); border-radius:5px; }
[data-toantin-tool="chart_builder"] .cb-color-native::-moz-color-swatch { border:1px solid rgba(15,31,75,.18); border-radius:5px; }
[data-toantin-tool="chart_builder"] .cb-color-hex {
  min-width:0;
  font-variant-numeric:tabular-nums;
  text-transform:uppercase;
}

[data-toantin-tool="chart_builder"] .cb-color-palette-toggle {
  min-height:34px;
  border:1px solid #cbd9eb;
  border-radius:8px;
  background:linear-gradient(180deg,#fff 0%,#f7faff 55%,#eaf3ff 100%);
  color:#17365f;
  font-size:11.5px;
  font-weight:700;
  box-shadow:0 2px 6px rgba(27,65,115,.07),inset 0 1px 0 rgba(255,255,255,.95);
}
[data-toantin-tool="chart_builder"] .cb-color-palette-toggle:hover,
[data-toantin-tool="chart_builder"] .cb-color-palette-toggle:focus-visible { border-color:#9dbfe9; background:#edf5ff; }
[data-toantin-tool="chart_builder"] .cb-color-palette[hidden] { display:none !important; }

[data-toantin-tool="chart_builder"] .cb-color-palette {
  display:grid;
  gap:6px;
  padding:6px;
  border:1px solid #e0e8f3;
  border-radius:9px;
  background:#fbfdff;
}
[data-toantin-tool="chart_builder"] .cb-color-palette-group {
  display:grid;
  grid-template-columns:74px minmax(0,1fr);
  gap:6px;
  align-items:center;
}
[data-toantin-tool="chart_builder"] .cb-color-palette-title {
  color:#64748b;
  font-size:10.5px;
  font-weight:700;
  line-height:1.2;
}
[data-toantin-tool="chart_builder"] .cb-color-swatches {
  display:flex;
  flex-wrap:wrap;
  gap:4px;
  min-width:0;
}
[data-toantin-tool="chart_builder"] .cb-color-swatch {
  position:relative;
  width:22px;
  height:22px;
  flex:0 0 22px;
  padding:0;
  border:1px solid rgba(31,52,82,.20);
  border-radius:6px;
  background:var(--cb-swatch-color);
  box-shadow:0 2px 4px rgba(15,31,75,.10), inset 0 1px 0 rgba(255,255,255,.45);
  cursor:pointer;
  transition:transform 90ms ease, box-shadow 90ms ease, border-color 90ms ease;
}
[data-toantin-tool="chart_builder"] .cb-color-swatch:hover,
[data-toantin-tool="chart_builder"] .cb-color-swatch:focus-visible {
  z-index:1;
  transform:translateY(-1px) scale(1.08);
  border-color:#0d5bef;
  box-shadow:0 3px 7px rgba(13,91,239,.22), inset 0 1px 0 rgba(255,255,255,.55);
  outline:none;
}
[data-toantin-tool="chart_builder"] .cb-color-swatch[aria-pressed="true"] {
  border-color:#0d5bef;
  box-shadow:0 0 0 2px #fff, 0 0 0 4px rgba(13,91,239,.72), 0 3px 7px rgba(13,91,239,.20);
}
[data-toantin-tool="chart_builder"] .cb-color-palette-group.is-grayscale .cb-color-swatch:first-child {
  box-shadow:0 2px 4px rgba(15,31,75,.10), inset 0 0 0 1px #d8e2ef;
}
[data-toantin-tool="chart_builder"] .cb-color-control[data-mixed="true"] .cb-color-palette {
  border-style:dashed;
}

/* Selection is a transient editor/teaching affordance only; it never mutates chart values/styles. */
[data-toantin-tool="chart_builder"] .cb-chart-svg [data-object-type="point"].cb-object-selected:not(text):not(.cb-object-dragging) {
  transform-box:fill-box;
  transform-origin:center;
  transform:scale(1.025);
  filter:brightness(1.09) saturate(1.07) drop-shadow(0 3px 7px rgba(13,91,239,.52));
  transition:transform 95ms ease, filter 95ms ease;
}
[data-toantin-tool="chart_builder"] .cb-chart-svg [data-object-type="point"].cb-object-primary:not(text):not(.cb-object-dragging) {
  transform:scale(1.055);
  filter:brightness(1.16) saturate(1.12) drop-shadow(0 4px 10px rgba(13,91,239,.66));
}
/* PATCH_18: classroom emphasis for selected bars/columns must remain visible from distance. */
[data-toantin-tool="chart_builder"] .cb-chart-svg[data-chart-type="column"] [data-object-type="point"].cb-object-selected:not(.cb-object-dragging),
[data-toantin-tool="chart_builder"] .cb-chart-svg[data-chart-type="bar"] [data-object-type="point"].cb-object-selected:not(.cb-object-dragging),
[data-toantin-tool="chart_builder"] .cb-chart-svg[data-chart-type="combo"] [data-object-type="point"].cb-object-selected:not(.cb-object-dragging) {
  transform:scale(1.065);
  filter:brightness(1.18) saturate(1.13) drop-shadow(0 4px 10px rgba(13,91,239,.66));
}
[data-toantin-tool="chart_builder"] .cb-chart-svg[data-chart-type="column"] [data-object-type="point"].cb-object-primary:not(.cb-object-dragging),
[data-toantin-tool="chart_builder"] .cb-chart-svg[data-chart-type="bar"] [data-object-type="point"].cb-object-primary:not(.cb-object-dragging),
[data-toantin-tool="chart_builder"] .cb-chart-svg[data-chart-type="combo"] [data-object-type="point"].cb-object-primary:not(.cb-object-dragging) {
  transform:scale(1.105);
  filter:brightness(1.27) saturate(1.18) drop-shadow(0 5px 14px rgba(13,91,239,.78));
}
/* Pie/Donut stays slightly restrained so the teaching highlight does not fight explode drag. */
[data-toantin-tool="chart_builder"] .cb-chart-svg[data-chart-type="pie"] [data-object-type="point"].cb-object-primary:not(.cb-object-dragging),
[data-toantin-tool="chart_builder"] .cb-chart-svg[data-chart-type="donut"] [data-object-type="point"].cb-object-primary:not(.cb-object-dragging) {
  transform:scale(1.045);
  filter:brightness(1.18) saturate(1.10) drop-shadow(0 4px 10px rgba(13,91,239,.68));
}
[data-toantin-tool="chart_builder"] .cb-chart-svg [data-object-type="series"].cb-object-primary:not(text),
[data-toantin-tool="chart_builder"] .cb-chart-svg [data-object-type="legendItem"].cb-object-primary {
  filter:brightness(1.10) drop-shadow(0 3px 8px rgba(13,91,239,.58));
}
@media (max-width:575.98px) {
  [data-toantin-tool="chart_builder"] .cb-color-custom-row { grid-template-columns:1fr; }
  [data-toantin-tool="chart_builder"] .cb-color-native-wrap { min-height:44px; }
  [data-toantin-tool="chart_builder"] .cb-color-swatch { width:28px; height:28px; flex-basis:28px; }
  [data-toantin-tool="chart_builder"] .cb-color-palette-group { grid-template-columns:1fr; }
}
@media (prefers-reduced-motion: reduce) {
  [data-toantin-tool="chart_builder"] .cb-color-swatch,
  [data-toantin-tool="chart_builder"] .cb-chart-svg [data-object-type="point"].cb-object-selected:not(text):not(.cb-object-dragging) { transition:none; }
}

/* V1 PATCH_19 — chart-first compact normal/fullscreen chrome + fullscreen Smart Toolbar Auto-hide/Light Rail. */
[data-toantin-tool="chart_builder"] .cb-preview-panel {
  padding: 8px 10px 10px;
}
[data-toantin-tool="chart_builder"] .cb-preview-chrome {
  display:grid;
  grid-template-columns:124px minmax(0, 1fr);
  align-items:start;
  gap:4px 10px;
  min-width:0;
  margin-bottom:4px;
  padding:0 2px 5px;
  border-bottom:1px solid #e3ebf5;
}
[data-toantin-tool="chart_builder"] .cb-preview-chrome .cb-preview-object-navigator-host {
  grid-column:1;
  grid-row:1;
  min-width:0;
  align-self:start;
}
[data-toantin-tool="chart_builder"] .cb-preview-chrome .cb-contextual-editor {
  grid-column:1 / -1;
  grid-row:2;
  min-width:0;
  margin:0;
  padding:0;
  border:0;
  border-radius:0;
  background:transparent;
}
[data-toantin-tool="chart_builder"] .cb-preview-chrome .cb-contextual-editor.is-empty {
  padding:0;
  background:transparent;
}
[data-toantin-tool="chart_builder"] .cb-preview-chrome .cb-preview-header {
  grid-column:2;
  grid-row:1;
  min-width:0;
  min-height:0;
  margin:0;
  padding:0;
  border:0;
}
[data-toantin-tool="chart_builder"] .cb-preview-chrome .cb-preview-meta {
  width:100%;
  display:flex;
  flex-wrap:nowrap;
  align-items:center;
  justify-content:flex-end;
  gap:6px;
  min-width:0;
  overflow-x:auto;
  overflow-y:hidden;
  scrollbar-width:none;
  overscroll-behavior-inline:contain;
}
[data-toantin-tool="chart_builder"] .cb-preview-chrome .cb-preview-meta::-webkit-scrollbar { display:none; }
[data-toantin-tool="chart_builder"] .cb-preview-chrome .cb-context-bar--empty {
  display:block;
  margin:0 0 3px;
}
[data-toantin-tool="chart_builder"] .cb-preview-chrome .cb-context-empty {
  margin:0;
  color:#66768d;
  font-size:12px;
  line-height:1.25;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
[data-toantin-tool="chart_builder"] .cb-preview-chrome .cb-context-object-select {
  min-height:36px;
  width:124px;
  max-width:124px;
  padding-right:30px;
  text-overflow:ellipsis;
  white-space:nowrap;
}
[data-toantin-tool="chart_builder"] .cb-preview-chrome:not(.has-selection) .cb-contextual-editor {
  width:100%;
  overflow:visible;
}
[data-toantin-tool="chart_builder"] .cb-preview-chrome:not(.has-selection) .cb-context-empty {
  width:max-content;
  max-width:min(620px, calc(100vw - 48px));
}
[data-toantin-tool="chart_builder"] .cb-preview-chrome.has-selection {
  grid-template-columns:124px minmax(0,1fr);
  gap:5px 10px;
}
[data-toantin-tool="chart_builder"] .cb-preview-chrome.has-selection .cb-preview-object-navigator-host {
  grid-column:1;
  grid-row:1;
}
[data-toantin-tool="chart_builder"] .cb-preview-chrome.has-selection .cb-preview-header {
  grid-column:2;
  grid-row:1;
}
[data-toantin-tool="chart_builder"] .cb-preview-chrome.has-selection .cb-contextual-editor {
  grid-column:1 / -1;
  grid-row:2;
  padding:5px 0 0;
  border-top:1px solid #edf2f8;
}
[data-toantin-tool="chart_builder"] .cb-preview-utility-actions {
  display:inline-flex;
  align-items:center;
  gap:6px;
  flex:0 0 auto;
  padding-left:7px;
  margin-left:1px;
  border-left:1px solid #e1e9f4;
}
[data-toantin-tool="chart_builder"] .cb-preview-utility-button {
  width:38px;
  min-width:38px;
  height:38px;
}
[data-toantin-tool="chart_builder"] .cb-full-chart-host {
  min-height:360px;
}
[data-toantin-tool="chart_builder"] .cb-preview-panel > .cb-contextual-editor { margin-bottom:0; }

/* Fullscreen is a compact presentation canvas. The Smart Toolbar is top-docked and auto-hides. */
[data-toantin-tool="chart_builder"] .cb-preview-panel.is-preview-fullscreen-active,
[data-toantin-tool="chart_builder"] .cb-preview-panel:fullscreen {
  position:relative;
  padding:0 8px 8px;
  background:#f7faff;
}
[data-toantin-tool="chart_builder"] .cb-preview-panel.is-preview-fullscreen-active .cb-preview-chrome,
[data-toantin-tool="chart_builder"] .cb-preview-panel:fullscreen .cb-preview-chrome {
  position:absolute;
  z-index:30;
  top:0;
  left:0;
  right:0;
  grid-template-columns:124px minmax(0,1fr);
  gap:4px 10px;
  margin:0;
  padding:6px 10px 5px;
  border:0;
  border-bottom:1px solid rgba(197,214,235,.9);
  background:rgba(247,250,255,.965);
  box-shadow:0 7px 18px rgba(15,31,75,.08);
  backdrop-filter:blur(8px);
  transform:translateY(0);
  opacity:1;
  pointer-events:auto;
  transition:transform 160ms ease, opacity 140ms ease;
}
[data-toantin-tool="chart_builder"] .cb-preview-panel.is-preview-fullscreen-active .cb-preview-header,
[data-toantin-tool="chart_builder"] .cb-preview-panel:fullscreen .cb-preview-header {
  padding:0;
  border:0;
  background:transparent;
}
[data-toantin-tool="chart_builder"] .cb-preview-panel.is-preview-fullscreen-active .cb-contextual-editor,
[data-toantin-tool="chart_builder"] .cb-preview-panel:fullscreen .cb-contextual-editor {
  max-height:42vh;
  overflow:auto;
  overscroll-behavior:contain;
  background:transparent;
}
[data-toantin-tool="chart_builder"] .cb-preview-panel.is-preview-fullscreen-active .cb-contextual-editor.is-empty,
[data-toantin-tool="chart_builder"] .cb-preview-panel:fullscreen .cb-contextual-editor.is-empty {
  display:none;
}
[data-toantin-tool="chart_builder"] .cb-preview-panel.is-preview-fullscreen-active .cb-full-chart-host,
[data-toantin-tool="chart_builder"] .cb-preview-panel:fullscreen .cb-full-chart-host {
  box-sizing:border-box;
  width:100%;
  height:100%;
  min-height:0;
  padding-top:64px;
  transition:padding-top 160ms ease;
}
[data-toantin-tool="chart_builder"] .cb-preview-panel.is-fullscreen-toolbar-hidden .cb-preview-chrome {
  transform:translateY(calc(-100% - 2px));
  opacity:0;
  pointer-events:none;
}
[data-toantin-tool="chart_builder"] .cb-preview-panel.is-fullscreen-toolbar-hidden .cb-full-chart-host {
  padding-top:7px;
}
[data-toantin-tool="chart_builder"] .cb-fullscreen-light-rail {
  display:none;
  position:absolute;
  z-index:31;
  top:0;
  left:50%;
  width:min(220px,34vw);
  height:8px;
  padding:0;
  transform:translateX(-50%);
  border:0;
  border-radius:0 0 999px 999px;
  background:linear-gradient(180deg, rgba(13,91,239,.94), rgba(22,103,232,.48));
  box-shadow:0 3px 9px rgba(13,91,239,.18);
  cursor:pointer;
  opacity:.82;
}
[data-toantin-tool="chart_builder"] .cb-preview-panel.is-preview-fullscreen-active .cb-fullscreen-light-rail[aria-hidden="false"],
[data-toantin-tool="chart_builder"] .cb-preview-panel:fullscreen .cb-fullscreen-light-rail[aria-hidden="false"] {
  display:block;
}
[data-toantin-tool="chart_builder"] .cb-fullscreen-light-rail:hover,
[data-toantin-tool="chart_builder"] .cb-fullscreen-light-rail:focus-visible {
  height:10px;
  opacity:1;
  outline:3px solid rgba(22,103,232,.16);
  outline-offset:2px;
}
[data-toantin-tool="chart_builder"] .cb-preview-fullscreen-close {
  border-color:#cf3f45 !important;
  background:linear-gradient(180deg,#ff7478 0%,#e84a50 55%,#c92f36 100%) !important;
  color:#fff !important;
  box-shadow:0 5px 13px rgba(185,35,44,.22), inset 0 1px 0 rgba(255,255,255,.32), inset 0 -1px 0 rgba(111,9,15,.22) !important;
}
[data-toantin-tool="chart_builder"] .cb-preview-fullscreen-close:hover:not(:disabled),
[data-toantin-tool="chart_builder"] .cb-preview-fullscreen-close:focus-visible {
  border-color:#a9232a !important;
  background:linear-gradient(180deg,#ff656b 0%,#db383f 55%,#b82028 100%) !important;
  color:#fff !important;
}
[data-toantin-tool="chart_builder"] .cb-preview-fullscreen-close .cb-preview-control-glyph {
  font-size:24px;
  line-height:1;
  font-weight:700;
}

@media (max-width:1199.98px) {
  [data-toantin-tool="chart_builder"] .cb-preview-chrome {
    grid-template-columns:124px minmax(0,1fr);
  }
  [data-toantin-tool="chart_builder"] .cb-preview-chrome .cb-preview-meta { gap:4px; }
  [data-toantin-tool="chart_builder"] .cb-preview-height-controls__caption { display:none; }
}
@media (max-width:991.98px) {
  [data-toantin-tool="chart_builder"] .cb-preview-chrome,
  [data-toantin-tool="chart_builder"] .cb-preview-panel.is-preview-fullscreen-active .cb-preview-chrome,
  [data-toantin-tool="chart_builder"] .cb-preview-panel:fullscreen .cb-preview-chrome {
    grid-template-columns:1fr;
  }
  [data-toantin-tool="chart_builder"] .cb-preview-chrome .cb-preview-object-navigator-host,
  [data-toantin-tool="chart_builder"] .cb-preview-chrome .cb-contextual-editor,
  [data-toantin-tool="chart_builder"] .cb-preview-chrome .cb-preview-header {
    grid-column:1;
  }
  [data-toantin-tool="chart_builder"] .cb-preview-chrome .cb-preview-object-navigator-host { grid-row:auto; }
  [data-toantin-tool="chart_builder"] .cb-preview-chrome .cb-preview-header { grid-row:auto; }
  [data-toantin-tool="chart_builder"] .cb-preview-chrome .cb-contextual-editor { grid-row:auto; }
  [data-toantin-tool="chart_builder"] .cb-preview-chrome .cb-preview-meta { justify-content:flex-start; }
  [data-toantin-tool="chart_builder"] .cb-preview-panel.is-preview-fullscreen-active .cb-full-chart-host,
  [data-toantin-tool="chart_builder"] .cb-preview-panel:fullscreen .cb-full-chart-host { padding-top:112px; }
  [data-toantin-tool="chart_builder"] .cb-preview-panel.is-fullscreen-toolbar-hidden .cb-full-chart-host { padding-top:7px; }
}
@media (max-width:575.98px) {
  [data-toantin-tool="chart_builder"] .cb-preview-panel { padding:6px; }
  [data-toantin-tool="chart_builder"] .cb-preview-chrome { padding-bottom:4px; }
  [data-toantin-tool="chart_builder"] .cb-preview-chrome .cb-context-empty { white-space:normal; }
  [data-toantin-tool="chart_builder"] .cb-preview-panel.is-preview-fullscreen-active .cb-preview-chrome,
  [data-toantin-tool="chart_builder"] .cb-preview-panel:fullscreen .cb-preview-chrome { padding:5px 6px; }
  [data-toantin-tool="chart_builder"] .cb-preview-utility-actions { padding-left:4px; gap:4px; }
}
@media (prefers-reduced-motion:reduce) {
  [data-toantin-tool="chart_builder"] .cb-preview-panel.is-preview-fullscreen-active .cb-preview-chrome,
  [data-toantin-tool="chart_builder"] .cb-preview-panel:fullscreen .cb-preview-chrome,
  [data-toantin-tool="chart_builder"] .cb-preview-panel.is-preview-fullscreen-active .cb-full-chart-host,
  [data-toantin-tool="chart_builder"] .cb-preview-panel:fullscreen .cb-full-chart-host { transition:none; }
}
[data-toantin-tool="chart_builder"] .cb-preview-chrome.has-selection .cb-contextual-editor {
  max-height:138px;
  overflow:auto;
  overscroll-behavior:contain;
}
[data-toantin-tool="chart_builder"] .cb-preview-panel.is-preview-fullscreen-active .cb-preview-chrome.has-selection .cb-contextual-editor,
[data-toantin-tool="chart_builder"] .cb-preview-panel:fullscreen .cb-preview-chrome.has-selection .cb-contextual-editor {
  max-height:42vh;
}
[data-toantin-tool="chart_builder"] .cb-preview-panel.is-preview-fullscreen-active .cb-full-chart-host,
[data-toantin-tool="chart_builder"] .cb-preview-panel:fullscreen .cb-full-chart-host { position:relative; z-index:1; }
[data-toantin-tool="chart_builder"] .cb-preview-panel.is-preview-fullscreen-active .cb-preview-chrome,
[data-toantin-tool="chart_builder"] .cb-preview-panel:fullscreen .cb-preview-chrome { z-index:50; }
[data-toantin-tool="chart_builder"] .cb-fullscreen-light-rail { z-index:60; pointer-events:auto; }
[data-toantin-tool="chart_builder"] .cb-preview-chrome .cb-preview-meta { justify-content:flex-start; }
[data-toantin-tool="chart_builder"] .cb-preview-chrome .cb-preview-fullscreen-toggle { margin-left:auto; flex:0 0 auto; }

/* PATCH_19 mobile containment: compact toolbar may scroll internally, never widen the page. */
@media (max-width:575.98px) {
  [data-toantin-tool="chart_builder"] .cb-preview-panel {
    min-width:0;
    max-width:100%;
    overflow-x:hidden;
  }
  [data-toantin-tool="chart_builder"] .cb-preview-chrome,
  [data-toantin-tool="chart_builder"] .cb-preview-chrome .cb-preview-header,
  [data-toantin-tool="chart_builder"] .cb-preview-chrome .cb-contextual-editor--full {
    min-width:0;
    max-width:100%;
    box-sizing:border-box;
  }
  [data-toantin-tool="chart_builder"] .cb-preview-chrome .cb-contextual-editor--full {
    position:sticky;
    bottom:0;
    margin-left:0;
    margin-right:0;
  }
}

/* V1 PATCH_21 — Unified Fullscreen Smart Toolbar Host ownership / edge reservation hardening. */
[data-toantin-tool="chart_builder"] .cb-preview-panel.cb-smart-dock-edge-bottom.is-preview-fullscreen-active .cb-preview-chrome,
[data-toantin-tool="chart_builder"] .cb-preview-panel.cb-smart-dock-edge-bottom:fullscreen .cb-preview-chrome {
  top:auto;
  bottom:0;
  border-bottom:0;
  border-top:1px solid rgba(197,214,235,.9);
  box-shadow:0 -7px 18px rgba(15,31,75,.08);
}
[data-toantin-tool="chart_builder"] .cb-preview-panel.cb-smart-dock-edge-bottom.is-fullscreen-toolbar-hidden .cb-preview-chrome {
  transform:translateY(calc(100% + 2px));
}
[data-toantin-tool="chart_builder"] .cb-preview-panel.cb-smart-dock-edge-bottom.is-preview-fullscreen-active .cb-full-chart-host,
[data-toantin-tool="chart_builder"] .cb-preview-panel.cb-smart-dock-edge-bottom:fullscreen .cb-full-chart-host {
  padding-top:7px;
  padding-bottom:64px;
}
[data-toantin-tool="chart_builder"] .cb-preview-panel.cb-smart-dock-edge-bottom.is-fullscreen-toolbar-hidden .cb-full-chart-host {
  padding-top:7px;
  padding-bottom:7px;
}

/* The visual rail stays thin, while its real button hit target remains touch-friendly. */
[data-toantin-tool="chart_builder"] .cb-fullscreen-light-rail {
  height:44px;
  background:transparent;
  box-shadow:none;
  opacity:1;
}
[data-toantin-tool="chart_builder"] .cb-fullscreen-light-rail::after {
  content:"";
  position:absolute;
  top:0;
  left:0;
  right:0;
  height:8px;
  border-radius:0 0 999px 999px;
  background:linear-gradient(180deg, rgba(13,91,239,.94), rgba(22,103,232,.48));
  box-shadow:0 3px 9px rgba(13,91,239,.18);
  transition:height 120ms ease, opacity 120ms ease;
  opacity:.82;
}
[data-toantin-tool="chart_builder"] .cb-fullscreen-light-rail:hover,
[data-toantin-tool="chart_builder"] .cb-fullscreen-light-rail:focus-visible {
  height:44px;
  opacity:1;
}
[data-toantin-tool="chart_builder"] .cb-fullscreen-light-rail:hover::after,
[data-toantin-tool="chart_builder"] .cb-fullscreen-light-rail:focus-visible::after {
  height:10px;
  opacity:1;
}
[data-toantin-tool="chart_builder"] .cb-preview-panel.cb-smart-dock-edge-bottom .cb-fullscreen-light-rail {
  top:auto;
  bottom:0;
}
[data-toantin-tool="chart_builder"] .cb-preview-panel.cb-smart-dock-edge-bottom .cb-fullscreen-light-rail::after {
  top:auto;
  bottom:0;
  border-radius:999px 999px 0 0;
  background:linear-gradient(0deg, rgba(13,91,239,.94), rgba(22,103,232,.48));
  box-shadow:0 -3px 9px rgba(13,91,239,.18);
}

/* Hosted without a granted supported edge degrades safely: no edge auto-hide/rail takeover. */
[data-toantin-tool="chart_builder"] .cb-preview-panel.is-smart-dock-edge-unassigned.is-preview-fullscreen-active .cb-preview-chrome {
  position:sticky;
  top:0;
  transform:none;
}
[data-toantin-tool="chart_builder"] .cb-preview-panel.is-smart-dock-edge-unassigned .cb-fullscreen-light-rail {
  display:none !important;
}

[data-toantin-tool="chart_builder"] .cb-preview-panel.is-preview-fullscreen-active .cb-preview-icon-button,
[data-toantin-tool="chart_builder"] .cb-preview-panel:fullscreen .cb-preview-icon-button,
[data-toantin-tool="chart_builder"] .cb-preview-panel.is-preview-fullscreen-active .cb-context-object-select,
[data-toantin-tool="chart_builder"] .cb-preview-panel:fullscreen .cb-context-object-select {
  min-height:40px;
}

@media (max-width:991.98px) {
  [data-toantin-tool="chart_builder"] .cb-preview-panel.cb-smart-dock-edge-bottom.is-preview-fullscreen-active .cb-full-chart-host,
  [data-toantin-tool="chart_builder"] .cb-preview-panel.cb-smart-dock-edge-bottom:fullscreen .cb-full-chart-host {
    padding-top:7px;
    padding-bottom:112px;
  }
  [data-toantin-tool="chart_builder"] .cb-preview-panel.cb-smart-dock-edge-bottom.is-fullscreen-toolbar-hidden .cb-full-chart-host {
    padding-bottom:7px;
  }
}
@media (max-width:575.98px), (pointer:coarse) {
  [data-toantin-tool="chart_builder"] .cb-preview-panel.is-preview-fullscreen-active .cb-preview-icon-button,
  [data-toantin-tool="chart_builder"] .cb-preview-panel:fullscreen .cb-preview-icon-button,
  [data-toantin-tool="chart_builder"] .cb-preview-panel.is-preview-fullscreen-active .cb-context-object-select,
  [data-toantin-tool="chart_builder"] .cb-preview-panel:fullscreen .cb-context-object-select {
    min-height:44px;
  }
}
@media (prefers-reduced-motion:reduce) {
  [data-toantin-tool="chart_builder"] .cb-fullscreen-light-rail::after { transition:none; }
}

/* V2 Statistics Classroom S2 — Investigation / Raw Data workspace foundation. */
[data-toantin-tool="chart_builder"] .cb-data-workspace-tabs {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:6px;
  margin:0 0 12px;
  padding:4px;
  border:1px solid #dbe7f5;
  border-radius:12px;
  background:#f5f9ff;
}
[data-toantin-tool="chart_builder"] .cb-data-workspace-tab {
  min-height:38px;
  padding:7px 10px;
  border:0;
  border-radius:9px;
  background:transparent;
  color:#526277;
  font-size:12.5px;
  font-weight:700;
  transition:background-color 120ms ease, color 120ms ease, box-shadow 120ms ease;
}
[data-toantin-tool="chart_builder"] .cb-data-workspace-tab:hover,
[data-toantin-tool="chart_builder"] .cb-data-workspace-tab:focus-visible { background:#eaf3ff; color:#0d5bef; }
[data-toantin-tool="chart_builder"] .cb-data-workspace-tab.is-active {
  background:#fff;
  color:#0d5bef;
  box-shadow:0 2px 8px rgba(15,31,75,.08), inset 0 0 0 1px #cfe0f5;
}
[data-toantin-tool="chart_builder"] .cb-statistics-workspace-heading {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom:6px;
}
[data-toantin-tool="chart_builder"] .cb-statistics-workspace-heading__copy { min-width:0; }
[data-toantin-tool="chart_builder"] .cb-statistics-workspace-heading__actions { display:flex; align-items:center; gap:6px; flex:0 0 auto; }
[data-toantin-tool="chart_builder"] .cb-statistics-workspace-expand,
[data-toantin-tool="chart_builder"] .cb-statistics-workspace-close {
  display:grid;
  place-items:center;
  width:40px;
  height:40px;
  padding:0;
  border-radius:10px;
  font-size:20px;
  font-weight:800;
  line-height:1;
}
[data-toantin-tool="chart_builder"] .cb-statistics-workspace-close {
  border:1px solid #c62f38;
  background:linear-gradient(180deg,#ff7478 0%,#e84a50 55%,#c92f36 100%);
  color:#fff;
  box-shadow:0 5px 13px rgba(185,35,44,.20), inset 0 1px 0 rgba(255,255,255,.30), inset 0 -1px 0 rgba(111,9,15,.22);
}
[data-toantin-tool="chart_builder"] .cb-statistics-workspace-close:hover,
[data-toantin-tool="chart_builder"] .cb-statistics-workspace-close:focus-visible {
  border-color:#a9232a;
  background:linear-gradient(180deg,#ff656b 0%,#db383f 55%,#b82028 100%);
  color:#fff;
}
[data-toantin-tool="chart_builder"] .cb-statistics-intro { margin-bottom:12px; }
[data-toantin-tool="chart_builder"] .cb-statistics-card {
  margin:0 0 10px;
  padding:12px;
  border:1px solid #dce8f5;
  border-radius:12px;
  background:linear-gradient(180deg,#ffffff 0%,#fbfdff 100%);
  box-shadow:0 3px 12px rgba(15,31,75,.035);
}
[data-toantin-tool="chart_builder"] .cb-statistics-card__title {
  margin:0 0 10px;
  color:#10224f;
  font-size:14px;
  font-weight:760;
}
[data-toantin-tool="chart_builder"] .cb-statistics-form-grid {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
}
[data-toantin-tool="chart_builder"] .cb-statistics-form-grid--2 { grid-template-columns:repeat(2,minmax(0,1fr)); }
[data-toantin-tool="chart_builder"] .cb-statistics-field { display:flex; min-width:0; flex-direction:column; gap:5px; }
[data-toantin-tool="chart_builder"] .cb-statistics-field.is-wide { grid-column:1 / -1; }
[data-toantin-tool="chart_builder"] .cb-statistics-field__label { color:#526277; font-size:12px; font-weight:700; line-height:1.25; }
[data-toantin-tool="chart_builder"] .cb-statistics-notes { min-height:74px; resize:vertical; }
[data-toantin-tool="chart_builder"] .cb-statistics-raw-card .cb-section-heading-row { align-items:center; }
[data-toantin-tool="chart_builder"] .cb-statistics-dataset-meta {
  flex:0 0 auto;
  padding:4px 8px;
  border:1px solid #d3e2f4;
  border-radius:999px;
  background:#f6faff;
  color:#526277;
  font-size:11px;
  font-weight:700;
}
[data-toantin-tool="chart_builder"] .cb-raw-mode-tabs {
  display:flex;
  gap:6px;
  margin:8px 0 10px;
  padding-bottom:2px;
  overflow-x:auto;
  overscroll-behavior-x:contain;
}
[data-toantin-tool="chart_builder"] .cb-raw-mode-tab {
  flex:0 0 auto;
  min-height:34px;
  padding:6px 10px;
  border:1px solid #d5e3f2;
  border-radius:999px;
  background:#fff;
  color:#526277;
  font-size:11.5px;
  font-weight:700;
}
[data-toantin-tool="chart_builder"] .cb-raw-mode-tab.is-active {
  border-color:#8ebaf7;
  background:#eaf3ff;
  color:#0d5bef;
}
[data-toantin-tool="chart_builder"] .cb-statistics-sequence-input {
  min-height:116px;
  resize:vertical;
  font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  font-size:13px;
  line-height:1.5;
}
[data-toantin-tool="chart_builder"] .cb-generated-sample-input { display:flex; flex-direction:column; gap:9px; }
[data-toantin-tool="chart_builder"] .cb-generated-sample-title { color:#10224f; font-size:14px; font-weight:760; }
[data-toantin-tool="chart_builder"] .cb-generated-sample-question { color:#526277; font-size:12.5px; line-height:1.45; }
[data-toantin-tool="chart_builder"] .cb-generated-sample-table-wrap {
  max-width:100%;
  max-height:310px;
  overflow:auto;
  border:1px solid #dce7f4;
  border-radius:10px;
  background:#fff;
}
[data-toantin-tool="chart_builder"] .cb-generated-sample-table { margin:0; min-width:420px; font-size:12px; }
[data-toantin-tool="chart_builder"] .cb-generated-sample-table th {
  position:sticky;
  top:0;
  z-index:1;
  background:#f4f8fd;
  color:#334155;
  font-weight:750;
}
[data-toantin-tool="chart_builder"] .cb-generated-sample-table th,
[data-toantin-tool="chart_builder"] .cb-generated-sample-table td { padding:7px 9px; border-color:#e7eef7; }
[data-toantin-tool="chart_builder"] .cb-empty-state {
  padding:18px 14px;
  border:1px dashed #c9d9eb;
  border-radius:10px;
  background:#f8fbff;
  color:#64748b;
  font-size:12.5px;
  line-height:1.5;
  text-align:center;
}
[data-toantin-tool="chart_builder"] .cb-statistics-foundation-note {
  margin:2px 0 8px;
  padding:9px 10px;
  border-left:3px solid #7baef5;
  border-radius:8px;
  background:#f4f8ff;
  color:#526277;
  font-size:11.5px;
  line-height:1.45;
}

[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-data-workspace-expanded {
  position:relative;
  display:block;
  min-height:100%;
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-data-workspace-expanded .cb-data-panel {
  position:absolute;
  inset:0;
  z-index:80;
  width:100%;
  max-width:none;
  height:100%;
  max-height:none;
  padding:18px clamp(14px,2vw,28px) 24px;
  overflow:auto;
  border-radius:12px;
  background:#f8fbff;
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-data-workspace-expanded .cb-preview-panel { visibility:hidden; pointer-events:none; }
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-data-workspace-expanded .cb-data-workspace-tabs { max-width:560px; }
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-data-workspace-expanded .cb-statistics-workspace-heading,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-data-workspace-expanded .cb-statistics-intro,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-data-workspace-expanded .cb-statistics-card,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-data-workspace-expanded .cb-statistics-foundation-note {
  width:min(1100px,100%);
  margin-left:auto;
  margin-right:auto;
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-data-workspace-expanded .cb-statistics-card { padding:16px; }
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-data-workspace-expanded .cb-statistics-card__title { font-size:16px; }
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-data-workspace-expanded .cb-statistics-form-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px 14px; }
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-data-workspace-expanded .cb-statistics-field__label { font-size:13px; }
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-data-workspace-expanded .cb-statistics-sequence-input { min-height:160px; }

@media (max-width:767.98px) {
  [data-toantin-tool="chart_builder"] .cb-statistics-form-grid,
  [data-toantin-tool="chart_builder"] .cb-statistics-form-grid--2,
  [data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-data-workspace-expanded .cb-statistics-form-grid { grid-template-columns:1fr; }
  [data-toantin-tool="chart_builder"] .cb-statistics-field.is-wide { grid-column:auto; }
  [data-toantin-tool="chart_builder"] .cb-data-workspace-tabs { position:sticky; top:0; z-index:6; background:#f5f9ff; }
  [data-toantin-tool="chart_builder"] .cb-statistics-workspace-expand,
  [data-toantin-tool="chart_builder"] .cb-statistics-workspace-close { width:44px; height:44px; }
}
@media (max-width:575.98px), (pointer:coarse) {
  [data-toantin-tool="chart_builder"] .cb-data-workspace-tab,
  [data-toantin-tool="chart_builder"] .cb-raw-mode-tab { min-height:44px; }
  [data-toantin-tool="chart_builder"] .cb-statistics-card { padding:11px; }
  [data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-data-workspace-expanded .cb-data-panel { padding:12px 10px 20px; }
}
@media (prefers-reduced-motion:reduce) {
  [data-toantin-tool="chart_builder"] .cb-data-workspace-tab { transition:none; }
}

/* V2 B37-STAT-S3 — Owner feedback consolidation: teaching typography, resizable statistics panel,
   raw→tables→charts workflow, viewport-efficient expanded workspace, pictogram controls. */
[data-toantin-tool="chart_builder"] .cb-statistics-workspace-heading {
  gap:12px;
  margin-bottom:8px;
}
[data-toantin-tool="chart_builder"] .cb-statistics-workspace-heading__actions {
  flex-wrap:wrap;
  justify-content:flex-end;
}
[data-toantin-tool="chart_builder"] .cb-statistics-font-controls {
  display:inline-flex;
  align-items:center;
  gap:4px;
  padding:3px;
  border:1px solid #d9e5f4;
  border-radius:10px;
  background:#fff;
}
[data-toantin-tool="chart_builder"] .cb-statistics-font-button {
  min-width:38px;
  height:36px;
  padding:0 8px;
  font-weight:800;
}
[data-toantin-tool="chart_builder"] .cb-statistics-font-value {
  min-width:52px;
  color:#334155;
  font-size:12px;
  font-weight:750;
  text-align:center;
}
[data-toantin-tool="chart_builder"] .cb-statistics-section-tabs {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:6px;
  margin:4px 0 12px;
  padding:5px;
  border:1px solid #dce7f4;
  border-radius:12px;
  background:#f3f8ff;
}
[data-toantin-tool="chart_builder"] .cb-statistics-section-tab {
  min-height:40px;
  padding:7px 10px;
  border:1px solid transparent;
  border-radius:9px;
  background:transparent;
  color:#526277;
  font-size:calc(13px * var(--cb-statistics-font-scale,1));
  font-weight:760;
}
[data-toantin-tool="chart_builder"] .cb-statistics-section-tab.is-active {
  border-color:#9fc4fb;
  background:#fff;
  color:#0d5bef;
  box-shadow:0 3px 10px rgba(13,91,239,.08);
}
[data-toantin-tool="chart_builder"] .cb-statistics-card__title {
  font-size:calc(14px * var(--cb-statistics-font-scale,1));
  line-height:1.28;
}
[data-toantin-tool="chart_builder"] .cb-statistics-field__label,
[data-toantin-tool="chart_builder"] .cb-statistics-card .form-label {
  font-size:calc(12px * var(--cb-statistics-font-scale,1));
}
[data-toantin-tool="chart_builder"] .cb-statistics-card .form-control,
[data-toantin-tool="chart_builder"] .cb-statistics-card .form-select,
[data-toantin-tool="chart_builder"] .cb-statistics-raw-paste .form-control,
[data-toantin-tool="chart_builder"] .cb-statistics-analysis-page .form-control,
[data-toantin-tool="chart_builder"] .cb-statistics-analysis-page .form-select {
  min-height:calc(36px * var(--cb-statistics-font-scale,1));
  font-size:calc(13px * var(--cb-statistics-font-scale,1));
}
[data-toantin-tool="chart_builder"] .cb-statistics-intro,
[data-toantin-tool="chart_builder"] .cb-statistics-card .cb-panel-hint,
[data-toantin-tool="chart_builder"] .cb-statistics-next-step {
  font-size:calc(12.5px * var(--cb-statistics-font-scale,1));
}
[data-toantin-tool="chart_builder"] .cb-statistics-dataset-meta {
  font-size:calc(11px * var(--cb-statistics-font-scale,1));
}
[data-toantin-tool="chart_builder"] .cb-statistics-sequence-input {
  min-height:140px;
  font-size:calc(13px * var(--cb-statistics-font-scale,1));
}
[data-toantin-tool="chart_builder"] .cb-statistics-raw-grid .cb-grid-cell,
[data-toantin-tool="chart_builder"] .cb-statistics-raw-grid .cb-data-grid {
  font-size:calc(13px * var(--cb-statistics-font-scale,1));
}
[data-toantin-tool="chart_builder"] .cb-statistics-consistency {
  border-left:4px solid #21a366;
}
[data-toantin-tool="chart_builder"] .cb-statistics-consistency.has-issues { border-left-color:#f3a712; }
[data-toantin-tool="chart_builder"] .cb-consistency-summary {
  margin-bottom:7px;
  font-size:calc(13px * var(--cb-statistics-font-scale,1));
  font-weight:760;
}
[data-toantin-tool="chart_builder"] .cb-consistency-summary.is-ok { color:#137a4b; }
[data-toantin-tool="chart_builder"] .cb-consistency-summary.is-warning { color:#9a6700; }
[data-toantin-tool="chart_builder"] .cb-consistency-list { display:grid; gap:5px; }
[data-toantin-tool="chart_builder"] .cb-consistency-item {
  padding:7px 9px;
  border-radius:8px;
  background:#fff8e7;
  color:#6f5200;
  font-size:calc(12.5px * var(--cb-statistics-font-scale,1));
  line-height:1.4;
}
[data-toantin-tool="chart_builder"] .cb-consistency-item.is-error { background:#fff0f1; color:#982b34; }
[data-toantin-tool="chart_builder"] .cb-consistency-item.is-ok { background:#ecfaf3; color:#176842; }
[data-toantin-tool="chart_builder"] .cb-statistics-next-step {
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:9px;
  margin:10px 0;
  padding:11px 12px;
  border:1px solid #cfe1f8;
  border-radius:11px;
  background:#eef6ff;
  color:#334155;
}
[data-toantin-tool="chart_builder"] .cb-statistics-analysis-actions {
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}
[data-toantin-tool="chart_builder"] .cb-statistics-analysis-actions .btn,
[data-toantin-tool="chart_builder"] .cb-statistics-next-step .btn {
  min-height:calc(36px * var(--cb-statistics-font-scale,1));
  font-size:calc(12.5px * var(--cb-statistics-font-scale,1));
}
[data-toantin-tool="chart_builder"] .cb-statistics-analysis-blocker {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:14px;
  border:1px solid #f3c5ca;
  border-radius:11px;
  background:#fff5f6;
  color:#8f2931;
  font-size:calc(13px * var(--cb-statistics-font-scale,1));
}
[data-toantin-tool="chart_builder"] .cb-statistics-derived-table-wrap {
  max-width:100%;
  overflow:auto;
  border:1px solid #dce7f4;
  border-radius:10px;
  background:#fff;
}
[data-toantin-tool="chart_builder"] .cb-statistics-derived-table {
  width:100%;
  margin:0;
  font-size:calc(14px * var(--cb-statistics-font-scale,1));
}
[data-toantin-tool="chart_builder"] .cb-statistics-derived-table th,
[data-toantin-tool="chart_builder"] .cb-statistics-derived-table td {
  padding:calc(8px * var(--cb-statistics-font-scale,1)) calc(10px * var(--cb-statistics-font-scale,1));
  border-color:#e4edf7;
  vertical-align:middle;
}
[data-toantin-tool="chart_builder"] .cb-statistics-derived-table thead th {
  position:sticky;
  top:0;
  z-index:1;
  background:#eef5ff;
  color:#20334f;
  font-weight:800;
}
[data-toantin-tool="chart_builder"] .cb-statistics-chart-choices {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(145px,1fr));
  gap:9px;
}
[data-toantin-tool="chart_builder"] .cb-statistics-chart-choice {
  display:flex;
  align-items:center;
  gap:9px;
  min-height:64px;
  padding:10px 12px;
  border:1px solid #cfe0f4;
  border-radius:12px;
  background:linear-gradient(180deg,#fff 0%,#f6faff 100%);
  color:#17365f;
  box-shadow:0 4px 12px rgba(15,31,75,.05);
  text-align:left;
}
[data-toantin-tool="chart_builder"] .cb-statistics-chart-choice:hover,
[data-toantin-tool="chart_builder"] .cb-statistics-chart-choice:focus-visible {
  border-color:#8ebaf7;
  background:#eef6ff;
  outline:3px solid rgba(22,103,232,.12);
}
[data-toantin-tool="chart_builder"] .cb-statistics-chart-choice__icon { font-size:26px; line-height:1; }
[data-toantin-tool="chart_builder"] .cb-statistics-chart-choice__label {
  font-size:calc(13px * var(--cb-statistics-font-scale,1));
  font-weight:760;
}
[data-toantin-tool="chart_builder"] .cb-pictogram-settings {
  display:grid;
  gap:9px;
  margin-top:12px;
  padding:12px;
  border:1px solid #dbe7f4;
  border-radius:11px;
  background:#fbfdff;
}
[data-toantin-tool="chart_builder"] .cb-pictogram-icon-palette { display:flex; flex-wrap:wrap; gap:7px; }
[data-toantin-tool="chart_builder"] .cb-pictogram-icon-button {
  display:grid;
  place-items:center;
  width:44px;
  height:44px;
  padding:0;
  border:1px solid #d3e1f0;
  border-radius:10px;
  background:#fff;
  font-size:24px;
}
[data-toantin-tool="chart_builder"] .cb-pictogram-icon-button.is-active {
  border-color:#0d5bef;
  box-shadow:0 0 0 3px rgba(13,91,239,.12);
  background:#edf5ff;
}
[data-toantin-tool="chart_builder"] .cb-pictogram-unit-field {
  display:flex;
  align-items:center;
  gap:8px;
  color:#334155;
  font-size:calc(13px * var(--cb-statistics-font-scale,1));
  font-weight:700;
}
[data-toantin-tool="chart_builder"] .cb-pictogram-unit-field input { width:100px; }

/* Expanded Statistics workspace is a teaching/authoring canvas: use the viewport instead of an 1100px centered island. */
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-data-workspace-expanded .cb-data-panel {
  padding:clamp(10px,1.2vw,18px);
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-data-workspace-expanded .cb-data-workspace-tabs,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-data-workspace-expanded .cb-statistics-workspace-heading,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-data-workspace-expanded .cb-statistics-section-tabs,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-data-workspace-expanded .cb-statistics-intro,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-data-workspace-expanded .cb-statistics-card,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-data-workspace-expanded .cb-statistics-next-step,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-data-workspace-expanded .cb-statistics-analysis-blocker {
  width:100%;
  max-width:none;
  margin-left:0;
  margin-right:0;
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-data-workspace-expanded .cb-data-workspace-tabs { max-width:none; }
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-data-workspace-expanded .cb-statistics-card { padding:clamp(14px,1.25vw,22px); }
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-data-workspace-expanded .cb-statistics-card__title { font-size:calc(18px * var(--cb-statistics-font-scale,1)); }
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-data-workspace-expanded .cb-statistics-field__label { font-size:calc(15px * var(--cb-statistics-font-scale,1)); }
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-data-workspace-expanded .cb-statistics-intro,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-data-workspace-expanded .cb-panel-hint { font-size:calc(14px * var(--cb-statistics-font-scale,1)); }
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-data-workspace-expanded .cb-statistics-card .form-control,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-data-workspace-expanded .cb-statistics-card .form-select { font-size:calc(15px * var(--cb-statistics-font-scale,1)); }
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-data-workspace-expanded .cb-statistics-derived-table { font-size:calc(17px * var(--cb-statistics-font-scale,1)); }
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-data-workspace-expanded .cb-generated-sample-table { font-size:calc(16px * var(--cb-statistics-font-scale,1)); }
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-data-workspace-expanded .cb-generated-sample-question,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-data-workspace-expanded .cb-generated-sample-title { font-size:calc(16px * var(--cb-statistics-font-scale,1)); }

@media (min-width:1200px) {
  [data-toantin-tool="chart_builder"] .cb-full-tool:not(.is-statistics-data-workspace-expanded) .cb-data-panel {
    min-width:0;
  }
}
@media (max-width:767.98px) {
  [data-toantin-tool="chart_builder"] .cb-statistics-workspace-heading { align-items:flex-start; }
  [data-toantin-tool="chart_builder"] .cb-statistics-workspace-heading__actions { width:100%; justify-content:flex-start; }
  [data-toantin-tool="chart_builder"] .cb-statistics-section-tabs { grid-template-columns:1fr; }
  [data-toantin-tool="chart_builder"] .cb-statistics-section-tab { min-height:44px; }
  [data-toantin-tool="chart_builder"] .cb-statistics-derived-table { min-width:520px; }
  [data-toantin-tool="chart_builder"] .cb-statistics-chart-choices { grid-template-columns:1fr; }
}
@media (prefers-reduced-motion:reduce) {
  [data-toantin-tool="chart_builder"] .cb-statistics-section-tab,
  [data-toantin-tool="chart_builder"] .cb-statistics-chart-choice { transition:none; }
}


/* B37 Statistics Classroom pictogram teaching preview — scoped, projector-readable and vector/emoji independent from V1 chart families. */
[data-toantin-tool="chart_builder"] .cb-statistics-pictogram-preview {
  overflow:hidden;
  border-color:#c9dff7;
  background:linear-gradient(180deg,#ffffff 0%,#f8fbff 100%);
}
[data-toantin-tool="chart_builder"] .cb-statistics-pictogram-title {
  margin:0 0 14px;
  color:#15345f;
  font-size:calc(18px * var(--cb-statistics-font-scale,1));
  line-height:1.25;
  font-weight:850;
  text-align:center;
}
[data-toantin-tool="chart_builder"] .cb-statistics-pictogram-grid {
  display:grid;
  gap:0;
  overflow:auto;
  border:1px solid #b9c9dd;
  border-radius:10px;
  background:#fff;
}
[data-toantin-tool="chart_builder"] .cb-statistics-pictogram-row {
  display:grid;
  grid-template-columns:minmax(110px,18%) minmax(0,1fr) max-content;
  align-items:center;
  min-height:62px;
  border-bottom:1px solid #cbd6e3;
}
[data-toantin-tool="chart_builder"] .cb-statistics-pictogram-row:last-child { border-bottom:0; }
[data-toantin-tool="chart_builder"] .cb-statistics-pictogram-label {
  align-self:stretch;
  display:flex;
  align-items:center;
  padding:10px 12px;
  border-right:1px solid #cbd6e3;
  color:#182c49;
  font-size:calc(15px * var(--cb-statistics-font-scale,1));
  font-weight:780;
}
[data-toantin-tool="chart_builder"] .cb-statistics-pictogram-marks {
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:4px;
  min-width:0;
  padding:8px 12px;
}
[data-toantin-tool="chart_builder"] .cb-statistics-pictogram-mark {
  display:inline-grid;
  place-items:center;
  width:1em;
  min-width:1em;
  font-size:calc(31px * var(--cb-statistics-font-scale,1));
  line-height:1;
  text-align:center;
  filter:saturate(1.08);
}
[data-toantin-tool="chart_builder"] .cb-statistics-pictogram-partial {
  position:relative;
  display:inline-block;
  flex:0 0 auto;
  width:calc(31px * var(--cb-statistics-font-scale,1));
  height:calc(34px * var(--cb-statistics-font-scale,1));
  font-size:calc(31px * var(--cb-statistics-font-scale,1));
  overflow:visible;
}
[data-toantin-tool="chart_builder"] .cb-statistics-pictogram-partial__clip {
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  overflow:visible;
  white-space:nowrap;
}
[data-toantin-tool="chart_builder"] .cb-statistics-pictogram-partial__clip > .cb-statistics-pictogram-mark--fractional {
  position:absolute;
  inset:0 auto auto 0;
  width:1em;
  min-width:1em;
  height:1em;
  font-size:1em;
  clip-path:inset(0 var(--cb-pictogram-hidden-fraction,50%) 0 0);
}
[data-toantin-tool="chart_builder"] .cb-statistics-pictogram-value {
  min-width:64px;
  padding:8px 12px;
  color:#334155;
  font-size:calc(14px * var(--cb-statistics-font-scale,1));
  font-weight:800;
  text-align:right;
}
[data-toantin-tool="chart_builder"] .cb-statistics-pictogram-overflow {
  color:#64748b;
  font-size:calc(24px * var(--cb-statistics-font-scale,1));
  font-weight:900;
}
[data-toantin-tool="chart_builder"] .cb-statistics-pictogram-legend {
  margin-top:12px;
  padding:9px 12px;
  border:1px solid #d7e5f5;
  border-radius:9px;
  background:#f3f8ff;
  color:#1e3b64;
  font-size:calc(14px * var(--cb-statistics-font-scale,1));
  font-weight:800;
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-data-workspace-expanded .cb-statistics-pictogram-title {
  font-size:calc(24px * var(--cb-statistics-font-scale,1));
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-data-workspace-expanded .cb-statistics-pictogram-row { min-height:76px; }
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-data-workspace-expanded .cb-statistics-pictogram-label {
  font-size:calc(19px * var(--cb-statistics-font-scale,1));
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-data-workspace-expanded .cb-statistics-pictogram-mark {
  font-size:calc(40px * var(--cb-statistics-font-scale,1));
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-data-workspace-expanded .cb-statistics-pictogram-partial {
  width:calc(40px * var(--cb-statistics-font-scale,1));
  height:calc(43px * var(--cb-statistics-font-scale,1));
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-data-workspace-expanded .cb-statistics-pictogram-value,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-data-workspace-expanded .cb-statistics-pictogram-legend {
  font-size:calc(18px * var(--cb-statistics-font-scale,1));
}
@media (max-width:767.98px) {
  [data-toantin-tool="chart_builder"] .cb-statistics-pictogram-row {
    grid-template-columns:minmax(88px,30%) minmax(0,1fr);
  }
  [data-toantin-tool="chart_builder"] .cb-statistics-pictogram-value { display:none; }
}

/* B37-STAT-S3-FIX01 — Owner teaching terminology + 350% projector font controls. */
[data-toantin-tool="chart_builder"] .cb-statistics-font-value {
  height:36px;
  padding:0 9px;
  cursor:pointer;
  line-height:1;
}
[data-toantin-tool="chart_builder"] .cb-statistics-font-value:hover,
[data-toantin-tool="chart_builder"] .cb-statistics-font-value:focus-visible {
  color:#0d5bef;
  border-color:#9fc4fb;
  background:#f3f8ff;
}
[data-toantin-tool="chart_builder"] .cb-statistics-derived-heading {
  display:grid;
  gap:3px;
  min-width:0;
}
[data-toantin-tool="chart_builder"] .cb-statistics-derived-context-title {
  color:#334155;
  font-size:calc(13px * var(--cb-statistics-font-scale,1));
  font-weight:760;
  line-height:1.3;
}
[data-toantin-tool="chart_builder"] .cb-statistics-derived-table--horizontal {
  width:max-content;
  min-width:100%;
  table-layout:auto;
}
[data-toantin-tool="chart_builder"] .cb-statistics-derived-table--horizontal th[scope="row"] {
  position:sticky;
  left:0;
  z-index:1;
  min-width:max(150px,calc(125px * var(--cb-statistics-font-scale,1)));
  background:#eef5ff;
  color:#20334f;
  font-weight:850;
  white-space:normal;
}
[data-toantin-tool="chart_builder"] .cb-statistics-derived-table--horizontal td {
  min-width:calc(62px * var(--cb-statistics-font-scale,1));
  text-align:center;
  font-weight:720;
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-font-large .cb-statistics-form-grid,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-font-large .cb-statistics-form-grid--2,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-font-large.is-statistics-data-workspace-expanded .cb-statistics-form-grid {
  grid-template-columns:1fr;
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-font-large .cb-statistics-section-tabs {
  grid-template-columns:1fr;
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-font-large .cb-statistics-workspace-heading {
  align-items:flex-start;
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-font-xxl .cb-statistics-workspace-heading__actions {
  width:100%;
  justify-content:flex-start;
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-font-xxl .cb-statistics-analysis-actions,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-font-xxl .cb-statistics-next-step {
  align-items:stretch;
  flex-direction:column;
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-font-xxl .cb-statistics-analysis-actions .btn,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-font-xxl .cb-statistics-next-step .btn {
  width:100%;
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-font-xxl .cb-statistics-workspace-heading {
  flex-direction:column;
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-font-xxl .cb-statistics-workspace-heading__copy {
  width:100%;
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-font-xxl .cb-statistics-workspace-heading__actions {
  order:-1;
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-font-xxl .cb-statistics-workspace-heading .cb-eyebrow {
  display:none;
}

/* V2 B38-STAT-S4 — persistent Statistics Library. Scoped, responsive, projector-safe. */
[data-toantin-tool="chart_builder"] .cb-data-workspace-tabs {
  grid-template-columns:repeat(3,minmax(0,1fr));
}
[data-toantin-tool="chart_builder"] .cb-library-heading { margin-bottom:12px; }
[data-toantin-tool="chart_builder"] .cb-library-save-status {
  display:inline-flex;
  align-items:center;
  min-height:34px;
  padding:0 10px;
  border:1px solid #d9e5f4;
  border-radius:999px;
  background:#fff;
  color:#526277;
  font-size:12px;
  font-weight:750;
}
[data-toantin-tool="chart_builder"] .cb-library-save-status.is-saving { color:#8a5a00; background:#fff8e8; border-color:#f3d893; }
[data-toantin-tool="chart_builder"] .cb-library-save-status.is-saved { color:#17663a; background:#effaf4; border-color:#bce6cb; }
[data-toantin-tool="chart_builder"] .cb-library-save-status.is-error { color:#a32929; background:#fff1f1; border-color:#f1bcbc; }
[data-toantin-tool="chart_builder"] .cb-library-filter-grid {
  display:grid;
  grid-template-columns:minmax(240px,2fr) minmax(120px,.65fr) minmax(150px,.8fr) auto;
  gap:10px;
  align-items:end;
}
[data-toantin-tool="chart_builder"] .cb-library-toggle-row,
[data-toantin-tool="chart_builder"] .cb-library-io-row {
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  align-items:center;
}
[data-toantin-tool="chart_builder"] .cb-library-io-row {
  margin-top:12px;
  padding-top:12px;
  border-top:1px solid #e5edf7;
}
[data-toantin-tool="chart_builder"] .cb-library-import-button { position:relative; margin:0; }
[data-toantin-tool="chart_builder"] .cb-library-results-summary {
  margin:6px 2px 10px;
  color:#64748b;
  font-size:13px;
  font-weight:700;
}
[data-toantin-tool="chart_builder"] .cb-library-grid {
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(280px,1fr));
  gap:12px;
  width:100%;
}
[data-toantin-tool="chart_builder"] .cb-library-card {
  display:flex;
  min-width:0;
  flex-direction:column;
  gap:10px;
  padding:14px;
  border:1px solid #dbe7f5;
  border-radius:14px;
  background:#fff;
  box-shadow:0 5px 18px rgba(15,31,75,.055);
}
[data-toantin-tool="chart_builder"] .cb-library-card.is-active {
  border-color:#79aefa;
  box-shadow:0 0 0 2px rgba(42,111,241,.10),0 6px 20px rgba(15,31,75,.07);
}
[data-toantin-tool="chart_builder"] .cb-library-card__top {
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  gap:10px;
  align-items:start;
}
[data-toantin-tool="chart_builder"] .cb-library-card__icon {
  display:grid;
  place-items:center;
  width:42px;
  height:42px;
  border-radius:12px;
  background:#eef5ff;
  font-size:24px;
}
[data-toantin-tool="chart_builder"] .cb-library-card__title-wrap { min-width:0; }
[data-toantin-tool="chart_builder"] .cb-library-card__title {
  margin:0;
  overflow:hidden;
  color:#10224f;
  font-size:15px;
  font-weight:800;
  line-height:1.3;
  text-overflow:ellipsis;
  white-space:nowrap;
}
[data-toantin-tool="chart_builder"] .cb-library-card__meta,
[data-toantin-tool="chart_builder"] .cb-library-card__updated {
  margin-top:3px;
  color:#64748b;
  font-size:12px;
  line-height:1.4;
}
[data-toantin-tool="chart_builder"] .cb-library-favorite {
  width:36px;
  height:36px;
  border:1px solid #d9e5f4;
  border-radius:10px;
  background:#fff;
  color:#d49a00;
  font-size:19px;
  line-height:1;
}
[data-toantin-tool="chart_builder"] .cb-library-favorite:hover,
[data-toantin-tool="chart_builder"] .cb-library-favorite:focus-visible { background:#fff8dd; border-color:#efd383; }
[data-toantin-tool="chart_builder"] .cb-library-card__actions {
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:auto;
}
[data-toantin-tool="chart_builder"] .cb-library-empty {
  display:grid;
  place-items:center;
  min-height:220px;
  text-align:center;
}
[data-toantin-tool="chart_builder"] .cb-library-empty__icon { font-size:46px; line-height:1; }
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-data-workspace-expanded .cb-library-controls,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-data-workspace-expanded .cb-library-heading,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-data-workspace-expanded .cb-library-grid,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-data-workspace-expanded .cb-library-results-summary {
  width:100%;
  max-width:none;
  margin-left:0;
  margin-right:0;
}
@media (max-width:991.98px) {
  [data-toantin-tool="chart_builder"] .cb-library-filter-grid { grid-template-columns:1fr 1fr; }
  [data-toantin-tool="chart_builder"] .cb-library-search { grid-column:1 / -1; }
}
@media (max-width:575.98px) {
  [data-toantin-tool="chart_builder"] .cb-data-workspace-tabs { grid-template-columns:1fr; }
  [data-toantin-tool="chart_builder"] .cb-library-filter-grid { grid-template-columns:1fr; }
  [data-toantin-tool="chart_builder"] .cb-library-search { grid-column:auto; }
  [data-toantin-tool="chart_builder"] .cb-library-toggle-row,
  [data-toantin-tool="chart_builder"] .cb-library-io-row,
  [data-toantin-tool="chart_builder"] .cb-library-card__actions { align-items:stretch; flex-direction:column; }
  [data-toantin-tool="chart_builder"] .cb-library-toggle-row .btn,
  [data-toantin-tool="chart_builder"] .cb-library-io-row .btn,
  [data-toantin-tool="chart_builder"] .cb-library-card__actions .btn { width:100%; min-height:44px; }
  [data-toantin-tool="chart_builder"] .cb-library-grid { grid-template-columns:1fr; }
}
@media (prefers-reduced-motion:reduce) {
  [data-toantin-tool="chart_builder"] .cb-library-card,
  [data-toantin-tool="chart_builder"] .cb-library-favorite { transition:none; }
}

/* V2 B39-STAT-S5 — multi-chart Gallery over one canonical StatisticsDocument dataset. */
[data-toantin-tool="chart_builder"] .cb-statistics-chart-gallery {
  display:grid;
  gap:12px;
}
[data-toantin-tool="chart_builder"] .cb-statistics-chart-gallery__head {
  align-items:flex-start;
  gap:12px;
}
[data-toantin-tool="chart_builder"] .cb-statistics-chart-gallery__grid {
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(250px,1fr));
  gap:12px;
}
[data-toantin-tool="chart_builder"] .cb-statistics-chart-card {
  display:flex;
  min-width:0;
  flex-direction:column;
  overflow:hidden;
  border:1px solid #dbe7f5;
  border-radius:14px;
  background:#fff;
  box-shadow:0 5px 18px rgba(15,31,75,.05);
}
[data-toantin-tool="chart_builder"] .cb-statistics-chart-card.is-active {
  border-color:#74a9f7;
  box-shadow:0 0 0 2px rgba(42,111,241,.10),0 7px 20px rgba(15,31,75,.07);
}
[data-toantin-tool="chart_builder"] .cb-statistics-chart-card__open {
  display:grid;
  width:100%;
  min-width:0;
  grid-template-columns:96px minmax(0,1fr);
  gap:12px;
  align-items:center;
  padding:12px;
  border:0;
  background:transparent;
  color:inherit;
  text-align:left;
}
[data-toantin-tool="chart_builder"] .cb-statistics-chart-card__open:hover,
[data-toantin-tool="chart_builder"] .cb-statistics-chart-card__open:focus-visible {
  background:#f7fbff;
  outline:none;
}
[data-toantin-tool="chart_builder"] .cb-statistics-chart-card__open:focus-visible {
  box-shadow:inset 0 0 0 2px rgba(42,111,241,.45);
}
[data-toantin-tool="chart_builder"] .cb-statistics-chart-card__meta {
  display:grid;
  min-width:0;
  gap:4px;
  align-content:center;
}
[data-toantin-tool="chart_builder"] .cb-statistics-chart-card__name {
  overflow:hidden;
  color:#10224f;
  font-size:calc(14px * var(--cb-statistics-font-scale,1));
  font-weight:820;
  line-height:1.25;
  text-overflow:ellipsis;
  white-space:nowrap;
}
[data-toantin-tool="chart_builder"] .cb-statistics-chart-card__detail {
  color:#64748b;
  font-size:calc(11px * var(--cb-statistics-font-scale,1));
  line-height:1.35;
}
[data-toantin-tool="chart_builder"] .cb-statistics-chart-card__active-badge {
  width:max-content;
  font-size:calc(10px * var(--cb-statistics-font-scale,1));
}
[data-toantin-tool="chart_builder"] .cb-statistics-chart-card__actions {
  display:flex;
  flex-wrap:wrap;
  gap:7px;
  align-items:center;
  padding:10px 12px 12px;
  border-top:1px solid #edf2f8;
}
[data-toantin-tool="chart_builder"] .cb-statistics-chart-card__rename-input {
  min-width:150px;
  flex:1 1 160px;
}
[data-toantin-tool="chart_builder"] .cb-statistics-chart-thumb {
  position:relative;
  display:grid;
  place-items:center;
  width:96px;
  height:72px;
  overflow:hidden;
  border:1px solid #dce8f6;
  border-radius:10px;
  background:linear-gradient(180deg,#f8fbff,#eef5ff);
  color:#2868c7;
}
[data-toantin-tool="chart_builder"] .cb-statistics-chart-thumb::after {
  position:absolute;
  right:8px;
  bottom:8px;
  left:8px;
  height:1px;
  background:#c7d7eb;
  content:"";
}
[data-toantin-tool="chart_builder"] .cb-statistics-chart-thumb__bars {
  position:absolute;
  inset:10px 10px 9px;
  display:flex;
  gap:6px;
  align-items:flex-end;
  justify-content:center;
}
[data-toantin-tool="chart_builder"] .cb-statistics-chart-thumb__bar {
  width:13px;
  height:var(--cb-thumb-size,50%);
  min-height:8px;
  border-radius:3px 3px 0 0;
  background:currentColor;
  opacity:.78;
}
[data-toantin-tool="chart_builder"] .cb-statistics-chart-thumb.is-bar .cb-statistics-chart-thumb__bars {
  inset:9px 12px;
  flex-direction:column;
  gap:5px;
  align-items:flex-start;
  justify-content:center;
}
[data-toantin-tool="chart_builder"] .cb-statistics-chart-thumb.is-bar .cb-statistics-chart-thumb__bar {
  width:var(--cb-thumb-size,50%);
  height:9px;
  min-width:12px;
  border-radius:0 3px 3px 0;
}
[data-toantin-tool="chart_builder"] .cb-statistics-chart-thumb svg {
  width:82px;
  height:52px;
}
[data-toantin-tool="chart_builder"] .cb-statistics-chart-thumb__pie {
  display:block;
  width:49px;
  height:49px;
  border-radius:50%;
  background:conic-gradient(currentColor 0 36%,rgba(40,104,199,.58) 36% 66%,rgba(40,104,199,.25) 66% 100%);
}
[data-toantin-tool="chart_builder"] .cb-statistics-chart-thumb__pie.is-donut::after {
  display:block;
  width:23px;
  height:23px;
  margin:13px;
  border-radius:50%;
  background:#f4f8fd;
  content:"";
}
[data-toantin-tool="chart_builder"] .cb-statistics-chart-thumb__scatter {
  position:absolute;
  inset:8px 10px 10px;
}
[data-toantin-tool="chart_builder"] .cb-statistics-chart-thumb__dot {
  position:absolute;
  width:7px;
  height:7px;
  border-radius:50%;
  background:currentColor;
  transform:translate(-50%,-50%);
}
[data-toantin-tool="chart_builder"] .cb-statistics-chart-thumb__combo-line {
  position:absolute;
  width:74px;
  height:3px;
  border-radius:999px;
  background:#174ea6;
  transform:rotate(-18deg);
}
[data-toantin-tool="chart_builder"] .cb-statistics-chart-thumb__fallback {
  font-size:34px;
  line-height:1;
}
[data-toantin-tool="chart_builder"] .cb-statistics-chart-create {
  display:grid;
  gap:10px;
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-font-large .cb-statistics-chart-gallery__grid {
  grid-template-columns:1fr;
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-font-xxl .cb-statistics-chart-card__open {
  grid-template-columns:1fr;
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-font-xxl .cb-statistics-chart-thumb {
  width:min(100%,220px);
  height:120px;
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-font-xxl .cb-statistics-chart-card__actions {
  align-items:stretch;
  flex-direction:column;
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-font-xxl .cb-statistics-chart-card__actions .btn,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-font-xxl .cb-statistics-chart-card__rename-input {
  width:100%;
  min-height:44px;
}
@media (max-width:767.98px) {
  [data-toantin-tool="chart_builder"] .cb-statistics-chart-gallery__grid { grid-template-columns:1fr; }
  [data-toantin-tool="chart_builder"] .cb-statistics-chart-card__actions { align-items:stretch; flex-direction:column; }
  [data-toantin-tool="chart_builder"] .cb-statistics-chart-card__actions .btn,
  [data-toantin-tool="chart_builder"] .cb-statistics-chart-card__rename-input { width:100%; min-height:44px; }
}
@media (max-width:420px) {
  [data-toantin-tool="chart_builder"] .cb-statistics-chart-card__open { grid-template-columns:78px minmax(0,1fr); gap:9px; padding:10px; }
  [data-toantin-tool="chart_builder"] .cb-statistics-chart-thumb { width:78px; height:62px; }
}
@media (prefers-reduced-motion:reduce) {
  [data-toantin-tool="chart_builder"] .cb-statistics-chart-card,
  [data-toantin-tool="chart_builder"] .cb-statistics-chart-card__open { transition:none; }
}

/* V2 B40-STAT-S6 — Teaching / Presentation Workspace. */
[data-toantin-tool="chart_builder"] .cb-statistics-section-tabs {
  grid-template-columns:repeat(4,minmax(0,1fr));
}
[data-toantin-tool="chart_builder"] .cb-statistics-projector-toggle {
  min-width:54px;
  font-weight:800;
}
[data-toantin-tool="chart_builder"] .cb-statistics-teaching-page,
[data-toantin-tool="chart_builder"] .cb-teaching-setup,
[data-toantin-tool="chart_builder"] .cb-teaching-reveal,
[data-toantin-tool="chart_builder"] .cb-teaching-sample-card,
[data-toantin-tool="chart_builder"] .cb-teaching-compare,
[data-toantin-tool="chart_builder"] .cb-teaching-question-card,
[data-toantin-tool="chart_builder"] .cb-teaching-misleading {
  display:grid;
  gap:12px;
}
[data-toantin-tool="chart_builder"] .cb-teaching-sample-library {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(190px,1fr));
  gap:8px;
}
[data-toantin-tool="chart_builder"] .cb-teaching-sample-library__item {
  min-height:44px;
  padding:9px 11px;
  border:1px solid #d7e4f3;
  border-radius:11px;
  background:#f8fbff;
  color:#23456e;
  font-size:calc(12px * var(--cb-statistics-font-scale,1));
  font-weight:720;
  text-align:left;
}
[data-toantin-tool="chart_builder"] .cb-teaching-sample-library__item:hover,
[data-toantin-tool="chart_builder"] .cb-teaching-sample-library__item:focus-visible,
[data-toantin-tool="chart_builder"] .cb-teaching-sample-library__item.is-active {
  border-color:#75a9f4;
  background:#edf5ff;
  outline:none;
}
[data-toantin-tool="chart_builder"] .cb-teaching-difficulty,
[data-toantin-tool="chart_builder"] .cb-teaching-generate-actions,
[data-toantin-tool="chart_builder"] .cb-teaching-highlight-row,
[data-toantin-tool="chart_builder"] .cb-teaching-representation-badges,
[data-toantin-tool="chart_builder"] .cb-teaching-page-nav {
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  align-items:center;
}
[data-toantin-tool="chart_builder"] .cb-teaching-sample-question,
[data-toantin-tool="chart_builder"] .cb-teaching-question-prompt,
[data-toantin-tool="chart_builder"] .cb-teaching-conclusion-prompt {
  color:#17335b;
  font-size:calc(16px * var(--cb-statistics-font-scale,1));
  font-weight:740;
  line-height:1.45;
}
[data-toantin-tool="chart_builder"] .cb-teaching-sample-table-wrap,
[data-toantin-tool="chart_builder"] .cb-teaching-table-scroll {
  max-width:100%;
  overflow:auto;
  border:1px solid #dfe8f3;
  border-radius:10px;
}
[data-toantin-tool="chart_builder"] .cb-teaching-sample-table,
[data-toantin-tool="chart_builder"] .cb-teaching-data-table {
  min-width:520px;
  margin:0;
  font-size:calc(14px * var(--cb-statistics-font-scale,1));
}
[data-toantin-tool="chart_builder"] .cb-teaching-sample-table th,
[data-toantin-tool="chart_builder"] .cb-teaching-sample-table td,
[data-toantin-tool="chart_builder"] .cb-teaching-data-table th,
[data-toantin-tool="chart_builder"] .cb-teaching-data-table td {
  padding:calc(8px * var(--cb-statistics-font-scale,1)) calc(10px * var(--cb-statistics-font-scale,1));
  vertical-align:middle;
}
[data-toantin-tool="chart_builder"] .cb-teaching-sample-table__total-row > td {
  font-weight:800;
  border-top:2px solid #b7c9e6;
  background:#f4f8ff;
}
[data-toantin-tool="chart_builder"] .cb-teaching-result {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
  padding:12px;
  border:1px solid #b9dec7;
  border-radius:12px;
  background:#f5fff8;
}
[data-toantin-tool="chart_builder"] .cb-teaching-result__item {
  display:grid;
  gap:4px;
  min-width:0;
  padding:10px;
  border-radius:10px;
  background:#fff;
  color:#214234;
  font-size:calc(13px * var(--cb-statistics-font-scale,1));
  line-height:1.45;
}
[data-toantin-tool="chart_builder"] .cb-teaching-reveal-tabs {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:8px;
}
[data-toantin-tool="chart_builder"] .cb-teaching-reveal-tab {
  min-height:44px;
  padding:8px 10px;
  border:1px solid #d8e4f3;
  border-radius:10px;
  background:#f8fbff;
  color:#526277;
  font-size:calc(12px * var(--cb-statistics-font-scale,1));
  font-weight:800;
}
[data-toantin-tool="chart_builder"] .cb-teaching-reveal-tab.is-active {
  border-color:#76a9f8;
  background:#edf5ff;
  color:#0f62d9;
  box-shadow:inset 0 0 0 1px rgba(15,98,217,.1);
}
[data-toantin-tool="chart_builder"] .cb-teaching-highlight-controls {
  display:grid;
  gap:8px;
  padding:10px;
  border:1px dashed #b9cce4;
  border-radius:11px;
  background:#fbfdff;
}
[data-toantin-tool="chart_builder"] .cb-teaching-representation-badge {
  padding:5px 9px;
  border-radius:999px;
  background:#eaf3ff;
  color:#24558f;
  font-size:calc(11px * var(--cb-statistics-font-scale,1));
  font-weight:760;
}
[data-toantin-tool="chart_builder"] .cb-teaching-compare-grid {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(210px,1fr));
  gap:10px;
}
[data-toantin-tool="chart_builder"] .cb-teaching-representation-card {
  display:grid;
  min-width:0;
  gap:7px;
  align-content:start;
  padding:12px;
  border:1px solid #dbe7f5;
  border-radius:12px;
  background:#fff;
  color:#15345f;
  text-align:left;
}
[data-toantin-tool="chart_builder"] button.cb-teaching-representation-card:hover,
[data-toantin-tool="chart_builder"] button.cb-teaching-representation-card:focus-visible {
  border-color:#76a9f8;
  background:#f7fbff;
  outline:none;
}
[data-toantin-tool="chart_builder"] .cb-teaching-pictogram-settings {
  display:grid;
  gap:8px;
  margin-top:4px;
}
[data-toantin-tool="chart_builder"] .cb-statistics-pictogram-row.is-highlighted,
[data-toantin-tool="chart_builder"] .cb-teaching-data-table tr.is-highlighted {
  background:#fff3c8;
  box-shadow:inset 4px 0 0 #d99a00;
}
[data-toantin-tool="chart_builder"] .cb-teaching-question-card {
  border-color:#c9dff7;
  background:linear-gradient(180deg,#fff,#f7fbff);
}
[data-toantin-tool="chart_builder"] .cb-teaching-question-count {
  min-width:48px;
  color:#607089;
  font-size:calc(12px * var(--cb-statistics-font-scale,1));
  font-weight:760;
  text-align:center;
}
[data-toantin-tool="chart_builder"] .cb-teaching-warning {
  padding:10px 12px;
  border:2px solid #e0a800;
  border-radius:11px;
  background:#fff7d6;
  color:#6d4b00;
  font-size:calc(13px * var(--cb-statistics-font-scale,1));
  font-weight:850;
  line-height:1.4;
}
[data-toantin-tool="chart_builder"] .cb-teaching-misleading-grid {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
}
[data-toantin-tool="chart_builder"] .cb-teaching-misleading-panel {
  display:grid;
  gap:9px;
  padding:12px;
  border:1px solid #e1e7ef;
  border-radius:11px;
  background:#fff;
}
[data-toantin-tool="chart_builder"] .cb-teaching-misleading-row {
  display:grid;
  grid-template-columns:minmax(110px,auto) minmax(100px,1fr);
  gap:10px;
  align-items:center;
  font-size:calc(12px * var(--cb-statistics-font-scale,1));
}
[data-toantin-tool="chart_builder"] .cb-teaching-misleading-track {
  display:block;
  height:18px;
  overflow:hidden;
  border-radius:999px;
  background:#e8eef6;
}
[data-toantin-tool="chart_builder"] .cb-teaching-misleading-bar {
  display:block;
  height:100%;
  border-radius:inherit;
  background:currentColor;
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-projector .cb-statistics-teaching-page .cb-statistics-card {
  padding:clamp(18px,2vw,30px);
  border-width:2px;
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-projector .cb-statistics-teaching-page .cb-panel-hint {
  font-size:calc(15px * var(--cb-statistics-font-scale,1));
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-projector .cb-statistics-teaching-page .btn {
  min-height:48px;
  font-size:calc(13px * var(--cb-statistics-font-scale,1));
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-font-large .cb-teaching-reveal-tabs,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-font-large .cb-teaching-result,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-font-large .cb-teaching-misleading-grid {
  grid-template-columns:1fr;
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-font-xxl .cb-teaching-sample-library,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-font-xxl .cb-teaching-compare-grid {
  grid-template-columns:1fr;
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-font-xxl .cb-teaching-difficulty,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-font-xxl .cb-teaching-generate-actions,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-font-xxl .cb-teaching-page-nav {
  align-items:stretch;
  flex-direction:column;
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-font-xxl .cb-teaching-difficulty .btn,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-font-xxl .cb-teaching-generate-actions .btn,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-font-xxl .cb-teaching-page-nav .btn {
  width:100%;
}
@media (max-width:991.98px) {
  [data-toantin-tool="chart_builder"] .cb-statistics-section-tabs { grid-template-columns:repeat(2,minmax(0,1fr)); }
  [data-toantin-tool="chart_builder"] .cb-teaching-result,
  [data-toantin-tool="chart_builder"] .cb-teaching-misleading-grid { grid-template-columns:1fr; }
}
@media (max-width:575.98px) {
  [data-toantin-tool="chart_builder"] .cb-statistics-section-tabs,
  [data-toantin-tool="chart_builder"] .cb-teaching-reveal-tabs,
  [data-toantin-tool="chart_builder"] .cb-teaching-sample-library,
  [data-toantin-tool="chart_builder"] .cb-teaching-compare-grid { grid-template-columns:1fr; }
  [data-toantin-tool="chart_builder"] .cb-teaching-difficulty,
  [data-toantin-tool="chart_builder"] .cb-teaching-generate-actions,
  [data-toantin-tool="chart_builder"] .cb-teaching-page-nav { align-items:stretch; flex-direction:column; }
  [data-toantin-tool="chart_builder"] .cb-teaching-difficulty .btn,
  [data-toantin-tool="chart_builder"] .cb-teaching-generate-actions .btn,
  [data-toantin-tool="chart_builder"] .cb-teaching-page-nav .btn { width:100%; min-height:44px; }
}
@media (prefers-reduced-motion:reduce) {
  [data-toantin-tool="chart_builder"] .cb-teaching-reveal-tab,
  [data-toantin-tool="chart_builder"] .cb-teaching-sample-library__item,
  [data-toantin-tool="chart_builder"] .cb-teaching-representation-card { transition:none; }
}
/* B40 mobile intrinsic-size guard: teaching grid items may contain long curriculum option text,
   but that min-content width must not force the Statistics panel wider than its viewport. */
[data-toantin-tool="chart_builder"] .cb-statistics-teaching-page,
[data-toantin-tool="chart_builder"] .cb-statistics-teaching-page > *,
[data-toantin-tool="chart_builder"] .cb-statistics-teaching-page .cb-statistics-form-grid,
[data-toantin-tool="chart_builder"] .cb-statistics-teaching-page .cb-statistics-form-grid > *,
[data-toantin-tool="chart_builder"] .cb-statistics-teaching-page .cb-teaching-sample-library,
[data-toantin-tool="chart_builder"] .cb-statistics-teaching-page .cb-teaching-compare-grid {
  min-width:0;
  max-width:100%;
}
[data-toantin-tool="chart_builder"] .cb-statistics-teaching-page > * { width:100%; }
[data-toantin-tool="chart_builder"] .cb-statistics-teaching-page .form-select,
[data-toantin-tool="chart_builder"] .cb-statistics-teaching-page .form-control {
  width:100%;
  min-width:0;
  max-width:100%;
}

/* V2 B41-STAT-S7 — confirmation-first structured Import / Export. */
[data-toantin-tool="chart_builder"] .cb-statistics-section-tabs {
  grid-template-columns:repeat(5,minmax(0,1fr));
}
[data-toantin-tool="chart_builder"] .cb-statistics-io-card {
  display:grid;
  gap:12px;
}
[data-toantin-tool="chart_builder"] .cb-statistics-io-textarea {
  min-height:clamp(150px,24vh,260px);
  resize:vertical;
  white-space:pre;
  overflow:auto;
}
[data-toantin-tool="chart_builder"] .cb-statistics-check-field {
  display:flex;
  align-items:center;
  gap:10px;
  min-height:42px;
  padding-top:calc(20px * var(--cb-statistics-font-scale,1));
}
[data-toantin-tool="chart_builder"] .cb-statistics-check-field .form-check-input {
  width:1.15em;
  height:1.15em;
  flex:0 0 auto;
  margin:0;
}
[data-toantin-tool="chart_builder"] .cb-import-preview-card {
  display:grid;
  gap:10px;
  min-width:0;
  padding:12px;
  border:1px solid #b9d3f4;
  border-radius:12px;
  background:#f8fbff;
}
[data-toantin-tool="chart_builder"] .cb-import-preview-card__title {
  margin:0;
  color:#163b67;
  font-size:calc(13.5px * var(--cb-statistics-font-scale,1));
  font-weight:850;
}
[data-toantin-tool="chart_builder"] .cb-import-preview-summary {
  display:flex;
  flex-wrap:wrap;
  gap:6px;
}
[data-toantin-tool="chart_builder"] .cb-import-preview-chip {
  display:inline-flex;
  align-items:center;
  min-height:28px;
  padding:4px 8px;
  border:1px solid #d5e4f7;
  border-radius:999px;
  background:#fff;
  color:#34506f;
  font-size:calc(11px * var(--cb-statistics-font-scale,1));
  font-weight:720;
}
[data-toantin-tool="chart_builder"] .cb-import-preview-table-wrap {
  max-width:100%;
  overflow:auto;
  border:1px solid #dce8f6;
  border-radius:10px;
  background:#fff;
}
[data-toantin-tool="chart_builder"] .cb-import-preview-table {
  width:max-content;
  min-width:100%;
  margin:0;
  font-size:calc(11.5px * var(--cb-statistics-font-scale,1));
}
[data-toantin-tool="chart_builder"] .cb-import-preview-table th,
[data-toantin-tool="chart_builder"] .cb-import-preview-table td {
  min-width:calc(90px * var(--cb-statistics-font-scale,1));
  max-width:calc(240px * var(--cb-statistics-font-scale,1));
  padding:.45em .6em;
  overflow-wrap:anywhere;
  vertical-align:top;
}
[data-toantin-tool="chart_builder"] .cb-import-preview-table th {
  position:sticky;
  top:0;
  z-index:1;
  background:#eef5ff;
  color:#213f64;
}
[data-toantin-tool="chart_builder"] .cb-import-replace-warning,
[data-toantin-tool="chart_builder"] .cb-import-dependency-gate,
[data-toantin-tool="chart_builder"] .cb-import-deferred-note {
  padding:9px 11px;
  border-radius:10px;
  font-size:calc(11.5px * var(--cb-statistics-font-scale,1));
  line-height:1.45;
}
[data-toantin-tool="chart_builder"] .cb-import-replace-warning {
  border-left:4px solid #e89d16;
  background:#fff8e8;
  color:#684b12;
}
[data-toantin-tool="chart_builder"] .cb-import-dependency-gate {
  border:1px solid #d8e4f2;
  background:#f7fafc;
  color:#44566c;
}
[data-toantin-tool="chart_builder"] .cb-import-deferred-note {
  border:1px dashed #bacce0;
  background:#fbfdff;
  color:#52667e;
}
[data-toantin-tool="chart_builder"] .cb-statistics-export-actions {
  align-items:stretch;
}
[data-toantin-tool="chart_builder"] .cb-statistics-export-actions .btn {
  flex:1 1 150px;
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-font-xxl .cb-statistics-io-card .cb-statistics-grid {
  grid-template-columns:1fr;
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-font-xxl .cb-statistics-export-actions,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-font-xxl .cb-import-preview-card .cb-action-row {
  align-items:stretch;
  flex-direction:column;
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-font-xxl .cb-statistics-export-actions .btn,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-font-xxl .cb-import-preview-card .cb-action-row .btn {
  width:100%;
}
@media (max-width:1199.98px) {
  [data-toantin-tool="chart_builder"] .cb-statistics-section-tabs { grid-template-columns:repeat(3,minmax(0,1fr)); }
}
@media (max-width:767.98px) {
  [data-toantin-tool="chart_builder"] .cb-statistics-section-tabs { grid-template-columns:repeat(2,minmax(0,1fr)); }
  [data-toantin-tool="chart_builder"] .cb-statistics-export-actions .btn { flex-basis:calc(50% - 6px); }
}
@media (max-width:575.98px) {
  [data-toantin-tool="chart_builder"] .cb-statistics-section-tabs { grid-template-columns:1fr; }
  [data-toantin-tool="chart_builder"] .cb-statistics-io-card .cb-action-row,
  [data-toantin-tool="chart_builder"] .cb-statistics-export-actions { align-items:stretch; flex-direction:column; }
  [data-toantin-tool="chart_builder"] .cb-statistics-io-card .cb-action-row .btn,
  [data-toantin-tool="chart_builder"] .cb-statistics-file-picker,
  [data-toantin-tool="chart_builder"] .cb-statistics-export-actions .btn { width:100%; min-height:44px; }
}
@media (prefers-reduced-motion:reduce) {
  [data-toantin-tool="chart_builder"] .cb-import-preview-card { scroll-behavior:auto; }
}

[data-toantin-tool="chart_builder"] .cb-statistics-io-card,
[data-toantin-tool="chart_builder"] .cb-statistics-io-card > *,
[data-toantin-tool="chart_builder"] .cb-statistics-io-card .cb-action-row,
[data-toantin-tool="chart_builder"] .cb-statistics-io-card .cb-statistics-grid {
  min-width:0;
  max-width:100%;
}
[data-toantin-tool="chart_builder"] .cb-import-dependency-gate,
[data-toantin-tool="chart_builder"] .cb-import-deferred-note,
[data-toantin-tool="chart_builder"] .cb-import-replace-warning {
  overflow-wrap:anywhere;
  word-break:normal;
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-font-xxl .cb-statistics-export-actions,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-font-xxl .cb-import-preview-card .cb-action-row {
  flex-wrap:nowrap;
}
@media (max-width:575.98px) {
  [data-toantin-tool="chart_builder"] .cb-statistics-io-card .cb-action-row,
  [data-toantin-tool="chart_builder"] .cb-statistics-export-actions { flex-wrap:nowrap; }
}

/* V2 B41-STAT-S7-FIX01 — compact cross-workspace chart launcher + chart/pictogram Focus Fullscreen. */
[data-toantin-tool="chart_builder"] .cb-statistics-quick-chart-strip {
  display:grid;
  grid-template-columns:auto minmax(0,1fr);
  gap:10px;
  align-items:center;
  width:min(1500px,100%);
  margin:0 auto 10px;
  padding:8px 10px;
  border:1px solid #d9e6f5;
  border-radius:12px;
  background:linear-gradient(180deg,#ffffff 0%,#f6faff 100%);
  box-shadow:0 4px 14px rgba(15,31,75,.04);
}
[data-toantin-tool="chart_builder"] .cb-statistics-quick-chart-strip__title {
  display:grid;
  gap:1px;
  min-width:126px;
  color:#163b67;
  line-height:1.2;
}
[data-toantin-tool="chart_builder"] .cb-statistics-quick-chart-strip__title strong {
  font-size:calc(12px * var(--cb-statistics-font-scale,1));
  font-weight:850;
}
[data-toantin-tool="chart_builder"] .cb-statistics-quick-chart-strip__title span {
  color:#6b7c93;
  font-size:calc(9.5px * var(--cb-statistics-font-scale,1));
}
[data-toantin-tool="chart_builder"] .cb-statistics-quick-chart-strip__scroller {
  display:flex;
  gap:6px;
  min-width:0;
  overflow-x:auto;
  overflow-y:hidden;
  padding:1px 2px 3px;
  scrollbar-width:thin;
  overscroll-behavior-inline:contain;
}
[data-toantin-tool="chart_builder"] .cb-statistics-quick-chart-button {
  display:inline-flex;
  flex:0 0 auto;
  align-items:center;
  gap:6px;
  min-height:38px;
  padding:6px 9px;
  border:1px solid #d5e3f4;
  border-radius:9px;
  background:#fff;
  color:#24476e;
  font-size:calc(10.5px * var(--cb-statistics-font-scale,1));
  font-weight:760;
  white-space:nowrap;
}
[data-toantin-tool="chart_builder"] .cb-statistics-quick-chart-button.is-recommended {
  border-color:#a8c9f6;
  background:#f1f7ff;
  color:#0e56c5;
}
[data-toantin-tool="chart_builder"] .cb-statistics-quick-chart-button:hover:not(:disabled),
[data-toantin-tool="chart_builder"] .cb-statistics-quick-chart-button:focus-visible:not(:disabled) {
  border-color:#6fa5ef;
  background:#eaf4ff;
  outline:3px solid rgba(22,103,232,.12);
}
[data-toantin-tool="chart_builder"] .cb-statistics-quick-chart-button:disabled {
  cursor:not-allowed;
  opacity:.46;
}
[data-toantin-tool="chart_builder"] .cb-statistics-quick-chart-button__icon {
  font-size:18px;
  line-height:1;
}
[data-toantin-tool="chart_builder"] .cb-statistics-chart-choices--complete {
  grid-template-columns:repeat(3,minmax(0,1fr));
}
[data-toantin-tool="chart_builder"] .cb-statistics-chart-choice.is-recommended {
  border-color:#9fc4f6;
  background:linear-gradient(180deg,#ffffff 0%,#eef6ff 100%);
}
[data-toantin-tool="chart_builder"] .cb-statistics-chart-choice:disabled {
  cursor:not-allowed;
  opacity:.48;
  box-shadow:none;
}
[data-toantin-tool="chart_builder"] .cb-statistics-chart-choice__copy {
  display:grid;
  gap:2px;
  min-width:0;
}
[data-toantin-tool="chart_builder"] .cb-statistics-chart-choice__hint {
  color:#718197;
  font-size:calc(9.5px * var(--cb-statistics-font-scale,1));
  line-height:1.2;
}
[data-toantin-tool="chart_builder"] .cb-statistics-chart-thumb--pictogram {
  font-size:42px;
}
[data-toantin-tool="chart_builder"] .cb-statistics-chart-thumb--pictogram::after { display:none; }

/* Existing V1 Preview fullscreen becomes the chart Focus Surface when launched from Statistics. */
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-data-workspace-expanded.is-statistics-chart-focus .cb-preview-panel.is-preview-fullscreen-active {
  visibility:visible;
  pointer-events:auto;
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-chart-focus .cb-preview-height-controls {
  display:none;
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-chart-focus .cb-statistics-focus-chart-title {
  display:inline-flex;
  align-items:center;
  min-width:0;
  max-width:min(260px,24vw);
  min-height:34px;
  padding:5px 9px;
  overflow:hidden;
  border:1px solid #c9dcf5;
  border-radius:8px;
  background:#fff;
  color:#153b67;
  font-size:12px;
  font-weight:850;
  text-overflow:ellipsis;
  white-space:nowrap;
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-chart-focus .cb-preview-panel.is-preview-fullscreen-active .cb-contextual-editor {
  max-height:min(30vh,280px);
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-chart-focus .cb-preview-panel.is-fullscreen-toolbar-hidden .cb-full-chart-host {
  padding-top:5px;
}

/* Pictogram is a Statistics teaching representation, not a ninth V1 ChartDocument family. */
[data-toantin-tool="chart_builder"] .cb-statistics-pictogram-focus-host {
  position:fixed;
  inset:0;
  z-index:125;
  display:block;
  background:#f4f8fe;
}
[data-toantin-tool="chart_builder"] .cb-statistics-pictogram-focus-host[hidden] { display:none !important; }
[data-toantin-tool="chart_builder"] .cb-full-tool.is-hosted-presentation .cb-statistics-pictogram-focus-host {
  position:absolute;
  z-index:95;
}
[data-toantin-tool="chart_builder"] .cb-statistics-pictogram-focus {
  display:grid;
  grid-template-rows:auto minmax(0,1fr);
  width:100%;
  height:100%;
  min-height:0;
  background:linear-gradient(180deg,#f8fbff 0%,#edf4fd 100%);
}
[data-toantin-tool="chart_builder"] .cb-statistics-focus-header {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  min-height:58px;
  padding:7px 12px;
  border-bottom:1px solid #d5e2f2;
  background:rgba(255,255,255,.97);
  box-shadow:0 5px 16px rgba(15,31,75,.06);
}
[data-toantin-tool="chart_builder"] .cb-statistics-focus-heading {
  display:grid;
  gap:1px;
  min-width:0;
}
[data-toantin-tool="chart_builder"] .cb-statistics-focus-kicker {
  color:#0d5bef;
  font-size:10px;
  font-weight:900;
  letter-spacing:.08em;
}
[data-toantin-tool="chart_builder"] .cb-statistics-focus-title {
  overflow:hidden;
  color:#10224f;
  font-size:clamp(17px,1.8vw,25px);
  font-weight:850;
  text-overflow:ellipsis;
  white-space:nowrap;
}
[data-toantin-tool="chart_builder"] .cb-statistics-focus-header__actions {
  display:flex;
  flex:0 0 auto;
  align-items:center;
  gap:8px;
}
[data-toantin-tool="chart_builder"] .cb-statistics-focus-close {
  width:44px;
  min-width:44px;
  height:44px;
  padding:0;
  border-radius:10px;
  font-size:26px;
  font-weight:800;
  line-height:1;
  box-shadow:0 5px 13px rgba(185,35,44,.18);
}
[data-toantin-tool="chart_builder"] .cb-statistics-pictogram-focus__body {
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(260px,320px);
  gap:10px;
  min-height:0;
  padding:10px;
}
[data-toantin-tool="chart_builder"] .cb-statistics-pictogram-focus.is-inspector-collapsed .cb-statistics-pictogram-focus__body {
  grid-template-columns:minmax(0,1fr);
}
[data-toantin-tool="chart_builder"] .cb-statistics-pictogram-focus.is-inspector-collapsed .cb-statistics-pictogram-focus__inspector {
  display:none;
}
[data-toantin-tool="chart_builder"] .cb-statistics-pictogram-focus__stage,
[data-toantin-tool="chart_builder"] .cb-statistics-pictogram-focus__inspector {
  min-width:0;
  min-height:0;
  border:1px solid #d8e5f4;
  border-radius:14px;
  background:#fff;
  box-shadow:0 8px 26px rgba(15,31,75,.06);
}
[data-toantin-tool="chart_builder"] .cb-statistics-pictogram-focus__stage {
  display:grid;
  overflow:hidden;
  padding:10px 14px 12px;
}
[data-toantin-tool="chart_builder"] .cb-statistics-pictogram-focus__chart {
  display:grid;
  grid-template-rows:minmax(0,1fr) auto;
  min-height:0;
}
[data-toantin-tool="chart_builder"] .cb-statistics-pictogram-focus__grid {
  display:grid;
  grid-template-rows:repeat(var(--cb-pictogram-focus-rows,1),minmax(0,1fr));
  min-height:0;
  overflow:hidden;
  border:1px solid #cdddee;
  border-radius:10px;
  background:#fff;
}
[data-toantin-tool="chart_builder"] .cb-statistics-pictogram-focus__row {
  display:grid;
  grid-template-columns:minmax(76px,16%) minmax(0,1fr) minmax(54px,8%);
  align-items:center;
  gap:10px;
  min-height:0;
  padding:2px 12px;
  border-bottom:1px solid #dce7f3;
}
[data-toantin-tool="chart_builder"] .cb-statistics-pictogram-focus__row:last-child { border-bottom:0; }
[data-toantin-tool="chart_builder"] .cb-statistics-pictogram-focus__label,
[data-toantin-tool="chart_builder"] .cb-statistics-pictogram-focus__value {
  color:#18375d;
  font-size:clamp(18px,2.1vw,31px);
  font-weight:850;
}
[data-toantin-tool="chart_builder"] .cb-statistics-pictogram-focus__value { text-align:right; }
[data-toantin-tool="chart_builder"] .cb-statistics-pictogram-focus__marks {
  display:flex;
  align-items:center;
  gap:clamp(4px,.7vw,11px);
  min-width:0;
  overflow:hidden;
}
[data-toantin-tool="chart_builder"] .cb-statistics-pictogram-focus__mark {
  display:inline-grid;
  place-items:center;
  flex:0 0 1em;
  width:1em;
  min-width:1em;
  font-size:var(--cb-pictogram-focus-icon-size,48px);
  line-height:1;
  text-align:center;
}
[data-toantin-tool="chart_builder"] .cb-statistics-pictogram-focus__partial {
  position:relative;
  display:inline-block;
  flex:0 0 var(--cb-pictogram-focus-icon-size,48px);
  width:var(--cb-pictogram-focus-icon-size,48px);
  height:calc(var(--cb-pictogram-focus-icon-size,48px) * 1.05);
  font-size:var(--cb-pictogram-focus-icon-size,48px);
  overflow:visible;
}
[data-toantin-tool="chart_builder"] .cb-statistics-pictogram-focus__partial-clip {
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  overflow:visible;
  white-space:nowrap;
}
[data-toantin-tool="chart_builder"] .cb-statistics-pictogram-focus__partial-clip > .cb-statistics-pictogram-mark--fractional {
  position:absolute;
  inset:0 auto auto 0;
  width:1em;
  min-width:1em;
  height:1em;
  font-size:1em;
  clip-path:inset(0 var(--cb-pictogram-hidden-fraction,50%) 0 0);
}
[data-toantin-tool="chart_builder"] .cb-statistics-pictogram-focus__legend {
  margin-top:8px;
  padding:8px 12px;
  border:1px solid #d5e4f5;
  border-radius:9px;
  background:#f4f8ff;
  color:#173c67;
  font-size:clamp(16px,1.7vw,25px);
  font-weight:850;
  text-align:center;
}
[data-toantin-tool="chart_builder"] .cb-statistics-pictogram-focus__inspector {
  display:flex;
  flex-direction:column;
  gap:12px;
  overflow:auto;
  padding:14px;
}
[data-toantin-tool="chart_builder"] .cb-statistics-focus-inspector-title {
  color:#102b50;
  font-size:15px;
  font-weight:900;
}
[data-toantin-tool="chart_builder"] .cb-statistics-focus-field {
  display:grid;
  gap:7px;
}
[data-toantin-tool="chart_builder"] .cb-pictogram-icon-palette--focus {
  grid-template-columns:repeat(6,minmax(38px,1fr));
}
[data-toantin-tool="chart_builder"] .cb-statistics-pictogram-focus__inspector .cb-pictogram-unit-field {
  grid-template-columns:auto minmax(72px,1fr) auto;
}
[data-toantin-tool="chart_builder"] .cb-statistics-pictogram-focus__inspector .cb-pictogram-unit-field .cb-statistics-field__label {
  grid-column:1 / -1;
}

/* Teaching compactness: one table viewport, all rows, sticky header; no artificial page navigation. */
[data-toantin-tool="chart_builder"] .cb-teaching-stage-card--raw {
  display:grid;
  gap:8px;
}
[data-toantin-tool="chart_builder"] .cb-teaching-raw-heading {
  margin:0;
}
[data-toantin-tool="chart_builder"] .cb-teaching-table-scroll--all-rows {
  max-height:min(58vh,720px);
  overflow:auto;
  border:1px solid #dbe6f2;
  border-radius:10px;
}
[data-toantin-tool="chart_builder"] .cb-teaching-table-scroll--all-rows .cb-teaching-data-table {
  margin:0;
}
[data-toantin-tool="chart_builder"] .cb-teaching-table-scroll--all-rows .cb-teaching-data-table thead th {
  position:sticky;
  top:0;
  z-index:2;
  background:#eef5ff;
}
[data-toantin-tool="chart_builder"] .cb-teaching-table-scroll--all-rows .cb-teaching-data-table th,
[data-toantin-tool="chart_builder"] .cb-teaching-table-scroll--all-rows .cb-teaching-data-table td {
  padding:.45em .65em;
}

@media (max-width:991.98px) {
  [data-toantin-tool="chart_builder"] .cb-statistics-chart-choices--complete { grid-template-columns:repeat(2,minmax(0,1fr)); }
  [data-toantin-tool="chart_builder"] .cb-statistics-pictogram-focus__body { grid-template-columns:minmax(0,1fr) minmax(220px,280px); }
}
@media (max-width:767.98px) {
  [data-toantin-tool="chart_builder"] .cb-statistics-quick-chart-strip { grid-template-columns:1fr; gap:6px; }
  [data-toantin-tool="chart_builder"] .cb-statistics-quick-chart-strip__title { grid-template-columns:auto 1fr; align-items:baseline; gap:8px; }
  [data-toantin-tool="chart_builder"] .cb-statistics-chart-choices--complete { grid-template-columns:1fr; }
  [data-toantin-tool="chart_builder"] .cb-statistics-pictogram-focus__body { grid-template-columns:1fr; grid-template-rows:minmax(0,1fr) auto; }
  [data-toantin-tool="chart_builder"] .cb-statistics-pictogram-focus__inspector { max-height:38vh; }
  [data-toantin-tool="chart_builder"] .cb-statistics-pictogram-focus__row { grid-template-columns:minmax(54px,22%) minmax(0,1fr); padding:2px 7px; }
  [data-toantin-tool="chart_builder"] .cb-statistics-pictogram-focus__value { display:none; }
  [data-toantin-tool="chart_builder"] .cb-statistics-focus-inspector-toggle { min-height:44px; }
  [data-toantin-tool="chart_builder"] .cb-teaching-table-scroll--all-rows { max-height:52vh; }
}
@media (max-width:575.98px) {
  [data-toantin-tool="chart_builder"] .cb-statistics-focus-header { padding:6px 8px; }
  [data-toantin-tool="chart_builder"] .cb-statistics-focus-kicker { display:none; }
  [data-toantin-tool="chart_builder"] .cb-statistics-focus-title { font-size:16px; }
  [data-toantin-tool="chart_builder"] .cb-statistics-pictogram-focus__body { padding:6px; gap:6px; }
  [data-toantin-tool="chart_builder"] .cb-statistics-pictogram-focus__stage { padding:6px; }
  [data-toantin-tool="chart_builder"] .cb-pictogram-icon-palette--focus { grid-template-columns:repeat(5,minmax(42px,1fr)); }
}
@media (prefers-reduced-motion:reduce) {
  [data-toantin-tool="chart_builder"] .cb-statistics-quick-chart-button,
  [data-toantin-tool="chart_builder"] .cb-statistics-chart-choice,
  [data-toantin-tool="chart_builder"] .cb-statistics-pictogram-focus-host { transition:none; }
}

/* B41 FIX01 focus polish: chart first, only relevant configuration remains in the Smart Toolbar. */
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-chart-focus .cb-preview-panel.is-preview-fullscreen-active .cb-preview-chrome {
  grid-template-columns:minmax(0,1fr);
  gap:4px;
  padding:5px 8px 4px;
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-chart-focus .cb-preview-panel.is-preview-fullscreen-active .cb-preview-object-navigator-host,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-chart-focus .cb-preview-panel.is-preview-fullscreen-active .cb-chart-display-mode,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-chart-focus .cb-preview-panel.is-preview-fullscreen-active .cb-chart-move-controls,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-chart-focus .cb-preview-panel.is-preview-fullscreen-active .cb-preview-height-controls {
  display:none;
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-chart-focus .cb-preview-panel.is-preview-fullscreen-active .cb-preview-header,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-chart-focus .cb-preview-panel.is-preview-fullscreen-active .cb-contextual-editor {
  grid-column:1;
  min-width:0;
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-chart-focus .cb-preview-panel.is-preview-fullscreen-active .cb-preview-meta {
  flex-wrap:nowrap;
  min-width:0;
  overflow-x:auto;
  scrollbar-width:thin;
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-chart-focus .cb-preview-panel.is-preview-fullscreen-active .cb-contextual-editor {
  max-height:min(24vh,220px);
  border-top:1px solid rgba(210,224,241,.9);
}
[data-toantin-tool="chart_builder"] .cb-teaching-pictogram-focus-launch {
  min-height:98px;
  text-align:left;
}
[data-toantin-tool="chart_builder"] .cb-teaching-pictogram-focus-launch .cb-panel-hint {
  display:block;
  margin-top:4px;
}
@media (max-width:575.98px) {
  [data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-chart-focus .cb-preview-panel.is-preview-fullscreen-active .cb-preview-meta {
    overflow:hidden;
  }
  [data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-chart-focus .cb-preview-panel.is-preview-fullscreen-active .cb-type-badge,
  [data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-chart-focus .cb-preview-panel.is-preview-fullscreen-active .cb-view-zoom,
  [data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-chart-focus .cb-preview-panel.is-preview-fullscreen-active .cb-preview-utility-actions {
    display:none;
  }
  [data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-chart-focus .cb-statistics-focus-chart-title {
    flex:1 1 auto;
    max-width:none;
  }
  [data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-chart-focus .cb-preview-panel.is-preview-fullscreen-active .cb-preview-fullscreen-toggle {
    flex:0 0 auto;
    margin-left:auto;
  }
}

/* V2 B41-STAT-S7-FIX02 — Owner polish: safe Close inset, full-width Smart Toolbar activation, Library one-click view, semantic chart naming. */
[data-toantin-tool="chart_builder"] .cb-preview-panel.is-preview-fullscreen-active .cb-preview-chrome,
[data-toantin-tool="chart_builder"] .cb-preview-panel:fullscreen .cb-preview-chrome {
  padding-right:18px;
}
[data-toantin-tool="chart_builder"] .cb-preview-panel.is-preview-fullscreen-active .cb-preview-fullscreen-close,
[data-toantin-tool="chart_builder"] .cb-preview-panel:fullscreen .cb-preview-fullscreen-close {
  position:sticky;
  right:max(12px,env(safe-area-inset-right));
  z-index:8;
  margin-right:10px;
  flex:0 0 auto;
}
[data-toantin-tool="chart_builder"] .cb-statistics-focus-close {
  margin-right:max(2px,env(safe-area-inset-right));
}

/* The activation target spans the usable edge without creating horizontal overflow.
   The visible rail remains compact and centered; only the hover/tap target becomes easy to hit. */
[data-toantin-tool="chart_builder"] .cb-fullscreen-light-rail {
  left:0;
  right:0;
  width:auto;
  height:14px;
  transform:none;
  border-radius:0;
}
[data-toantin-tool="chart_builder"] .cb-fullscreen-light-rail::after {
  left:50%;
  right:auto;
  width:min(440px,46vw);
  transform:translateX(-50%);
}
[data-toantin-tool="chart_builder"] .cb-fullscreen-light-rail:hover,
[data-toantin-tool="chart_builder"] .cb-fullscreen-light-rail:focus-visible {
  height:16px;
}
[data-toantin-tool="chart_builder"] .cb-preview-panel.cb-smart-dock-edge-bottom .cb-fullscreen-light-rail {
  left:0;
  right:0;
}
@media (pointer:coarse) {
  [data-toantin-tool="chart_builder"] .cb-fullscreen-light-rail {
    height:44px;
  }
}

[data-toantin-tool="chart_builder"] .cb-library-card__top {
  grid-template-columns:minmax(0,1fr) auto;
}
[data-toantin-tool="chart_builder"] .cb-library-card__preview {
  display:grid;
  grid-template-columns:auto minmax(0,1fr);
  align-items:start;
  gap:10px;
  min-width:0;
  width:100%;
  padding:0;
  border:0;
  background:transparent;
  color:inherit;
  text-align:left;
  cursor:pointer;
}
[data-toantin-tool="chart_builder"] .cb-library-card__preview:hover .cb-library-card__title,
[data-toantin-tool="chart_builder"] .cb-library-card__preview:focus-visible .cb-library-card__title {
  color:#0d5bef;
}
[data-toantin-tool="chart_builder"] .cb-library-card__preview:focus-visible {
  outline:3px solid rgba(13,91,239,.18);
  outline-offset:4px;
  border-radius:10px;
}
[data-toantin-tool="chart_builder"] .cb-library-card__context {
  display:-webkit-box;
  margin-top:2px;
  overflow:hidden;
  color:#173c67;
  font-size:13px;
  font-weight:750;
  line-height:1.35;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
}
[data-toantin-tool="chart_builder"] .cb-library-card__chart-name {
  display:-webkit-box;
  margin-top:3px;
  overflow:hidden;
  color:#51667f;
  font-size:12px;
  line-height:1.35;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
}
[data-toantin-tool="chart_builder"] .cb-library-card__active-label {
  display:inline-flex;
  align-items:center;
  min-height:31px;
  padding:4px 9px;
  border:1px solid #bfe4cc;
  border-radius:999px;
  background:#eefaf2;
  color:#18723b;
  font-size:11px;
  font-weight:850;
}
[data-toantin-tool="chart_builder"] .cb-library-view-chart {
  font-weight:750;
}

[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-chart-focus .cb-statistics-focus-chart-title {
  max-width:min(520px,42vw);
  font-size:13px;
}
[data-toantin-tool="chart_builder"] .cb-statistics-chart-card__name {
  white-space:normal;
  overflow-wrap:anywhere;
}

@media (max-width:575.98px) {
  [data-toantin-tool="chart_builder"] .cb-preview-panel.is-preview-fullscreen-active .cb-preview-chrome,
  [data-toantin-tool="chart_builder"] .cb-preview-panel:fullscreen .cb-preview-chrome {
    padding-right:10px;
  }
  [data-toantin-tool="chart_builder"] .cb-preview-panel.is-preview-fullscreen-active .cb-preview-fullscreen-close,
  [data-toantin-tool="chart_builder"] .cb-preview-panel:fullscreen .cb-preview-fullscreen-close {
    right:6px;
    margin-right:4px;
  }
  [data-toantin-tool="chart_builder"] .cb-fullscreen-light-rail::after {
    width:min(280px,72vw);
  }
  [data-toantin-tool="chart_builder"] .cb-library-card__actions .cb-library-card__active-label {
    width:auto;
    justify-content:center;
  }
  [data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-chart-focus .cb-statistics-focus-chart-title {
    max-width:none;
    font-size:12px;
  }
}
[data-toantin-tool="chart_builder"] .cb-statistics-chart-card__subject {
  display:-webkit-box;
  overflow:hidden;
  color:#315271;
  font-size:12px;
  font-weight:700;
  line-height:1.3;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
}

/* B41-STAT-S7-FIX04 — lesson-specific Teaching Sample Flow / compact setup hierarchy. */
[data-toantin-tool="chart_builder"] .cb-teaching-setting-row {
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:10px;
  min-width:0;
}
[data-toantin-tool="chart_builder"] .cb-teaching-setting-row__label {
  flex:0 0 auto;
  margin:0;
}
[data-toantin-tool="chart_builder"] .cb-teaching-difficulty {
  display:inline-flex;
  flex:0 1 auto;
  flex-wrap:nowrap;
  align-items:center;
  gap:2px;
  padding:3px;
  border:1px solid #d8e5f5;
  border-radius:10px;
  background:#f5f9ff;
}
[data-toantin-tool="chart_builder"] .cb-teaching-difficulty-chip {
  min-height:34px;
  padding:5px 11px;
  border:0;
  border-radius:7px;
  background:transparent;
  color:#345b86;
  font:inherit;
  font-size:calc(12px * var(--cb-statistics-font-scale,1));
  font-weight:750;
  line-height:1.2;
  cursor:pointer;
}
[data-toantin-tool="chart_builder"] .cb-teaching-difficulty-chip:hover,
[data-toantin-tool="chart_builder"] .cb-teaching-difficulty-chip:focus-visible {
  background:#eaf3ff;
  color:#0d5bef;
  outline:2px solid rgba(13,91,239,.22);
  outline-offset:1px;
}
[data-toantin-tool="chart_builder"] .cb-teaching-difficulty-chip.is-active {
  background:#dfeeff;
  color:#0d5bef;
  box-shadow:inset 0 0 0 1px #9cc3fb;
}
[data-toantin-tool="chart_builder"] .cb-teaching-generate-actions {
  margin-top:2px;
  gap:9px;
}
[data-toantin-tool="chart_builder"] .cb-teaching-generate-primary {
  font-weight:800;
}
[data-toantin-tool="chart_builder"] .cb-teaching-invalid-sample-note {
  padding:10px 12px;
  border:1px solid #f0c36a;
  border-radius:10px;
  background:#fff9e8;
  color:#6a4a08;
  font-size:calc(13px * var(--cb-statistics-font-scale,1));
  font-weight:720;
  line-height:1.45;
}
[data-toantin-tool="chart_builder"] .cb-teaching-lesson-sequence {
  display:grid;
  gap:12px;
  min-width:0;
}
[data-toantin-tool="chart_builder"] .cb-teaching-reveal-tabs--lesson {
  grid-template-columns:repeat(auto-fit,minmax(180px,1fr));
}
[data-toantin-tool="chart_builder"] .cb-teaching-horizontal-table-scroll {
  max-width:100%;
  overflow:auto;
}
[data-toantin-tool="chart_builder"] .cb-teaching-horizontal-table {
  width:max-content;
  min-width:100%;
}
[data-toantin-tool="chart_builder"] .cb-teaching-horizontal-table th,
[data-toantin-tool="chart_builder"] .cb-teaching-horizontal-table td {
  min-width:96px;
  white-space:nowrap;
  text-align:center;
}
[data-toantin-tool="chart_builder"] .cb-teaching-horizontal-table th:first-child {
  position:sticky;
  left:0;
  z-index:1;
  min-width:128px;
  background:#f4f8ff;
  text-align:left;
}
[data-toantin-tool="chart_builder"] .cb-teaching-chart-stage {
  display:grid;
  align-items:center;
  min-height:320px;
  max-width:100%;
  overflow:auto;
  padding:12px;
  border:1px solid #dce7f5;
  border-radius:12px;
  background:#fff;
}
[data-toantin-tool="chart_builder"] .cb-teaching-chart-svg {
  display:block;
  width:100%;
  min-width:560px;
  height:auto;
  max-height:560px;
}
[data-toantin-tool="chart_builder"] .cb-teaching-inline-pictogram {
  min-width:540px;
}
[data-toantin-tool="chart_builder"] .cb-teaching-remarks-list {
  display:grid;
  gap:8px;
  margin:0;
  padding-left:1.35rem;
  color:#17335b;
  font-size:calc(14px * var(--cb-statistics-font-scale,1));
  line-height:1.5;
}
[data-toantin-tool="chart_builder"] .cb-statistics-teaching-chart-focus__body {
  display:grid;
  min-height:0;
  flex:1 1 auto;
  padding:10px;
}
[data-toantin-tool="chart_builder"] .cb-statistics-teaching-chart-focus__stage {
  min-height:0;
  overflow:auto;
}
[data-toantin-tool="chart_builder"] .cb-teaching-chart-svg--focus {
  width:100%;
  min-width:0;
  max-width:100%;
  height:100%;
  max-height:none;
}
@media (max-width:575.98px) {
  [data-toantin-tool="chart_builder"] .cb-teaching-setting-row {
    align-items:stretch;
    flex-direction:column;
    gap:7px;
  }
  [data-toantin-tool="chart_builder"] .cb-teaching-difficulty {
    width:100%;
    flex-direction:row;
  }
  [data-toantin-tool="chart_builder"] .cb-teaching-difficulty-chip {
    flex:1 1 0;
    min-width:0;
    min-height:40px;
    padding-inline:7px;
  }
  [data-toantin-tool="chart_builder"] .cb-teaching-generate-actions {
    align-items:stretch;
    flex-direction:column;
  }
  [data-toantin-tool="chart_builder"] .cb-teaching-generate-actions .btn {
    width:100%;
    min-height:44px;
  }
  [data-toantin-tool="chart_builder"] .cb-teaching-reveal-tabs--lesson {
    grid-template-columns:1fr;
  }
  [data-toantin-tool="chart_builder"] .cb-teaching-chart-stage {
    min-height:260px;
    padding:8px;
  }
}
@media (prefers-reduced-motion:reduce) {
  [data-toantin-tool="chart_builder"] .cb-teaching-difficulty-chip { transition:none; }
}
[data-toantin-tool="chart_builder"] .cb-teaching-lesson-sequence > *,
[data-toantin-tool="chart_builder"] .cb-teaching-stage-card,
[data-toantin-tool="chart_builder"] .cb-teaching-horizontal-table-scroll,
[data-toantin-tool="chart_builder"] .cb-teaching-chart-stage {
  width:100%;
  min-width:0;
  max-width:100%;
}


/* B41 FIX05 — shared teaching sample + natural pictogram unit */
[data-toantin-tool="chart_builder"] .cb-teaching-pictogram-unit-control {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
  padding: 8px 10px;
  border: 1px solid var(--cb-border, #d8e5f5);
  border-radius: 12px;
  background: var(--cb-surface-soft, #f8fbff);
}
[data-toantin-tool="chart_builder"] .cb-teaching-pictogram-unit-control .form-control {
  width: 78px;
  min-width: 68px;
}
[data-toantin-tool="chart_builder"] .cb-teaching-pictogram-unit-prefix,
[data-toantin-tool="chart_builder"] .cb-teaching-pictogram-unit-suffix {
  white-space: nowrap;
}
[data-toantin-tool="chart_builder"] .cb-teaching-sample-compatibility-note {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid #d8e5f5;
  border-radius: 12px;
  background: #f8fbff;
  color: #334155;
}
[data-toantin-tool="chart_builder"] .cb-teaching-shared-sample-hint {
  margin: -4px 0 12px;
}
@media (max-width: 575.98px) {
  [data-toantin-tool="chart_builder"] .cb-teaching-pictogram-unit-control {
    width: 100%;
  }
}

/* B41 FIX06 — exact fractional pictogram + reference remarks + smart chart availability */
[data-toantin-tool="chart_builder"] .cb-teaching-remarks-actions {
  margin-top:12px;
}
[data-toantin-tool="chart_builder"] .cb-teaching-reference-remarks {
  display:grid;
  gap:9px;
  margin-top:12px;
  padding:12px 14px;
  border:1px solid #b9d8c7;
  border-radius:12px;
  background:#f4fbf6;
  color:#173b2a;
}
[data-toantin-tool="chart_builder"] .cb-teaching-reference-remarks__title {
  color:#11623d;
  font-size:calc(14px * var(--cb-statistics-font-scale,1));
}
[data-toantin-tool="chart_builder"] .cb-teaching-reference-remarks__list {
  display:grid;
  gap:7px;
  margin:0;
  padding-left:1.35rem;
  line-height:1.5;
}
[data-toantin-tool="chart_builder"] .cb-teaching-smart-chart-hint {
  margin-top:8px;
}
@media (max-width:575.98px) {
  [data-toantin-tool="chart_builder"] .cb-teaching-remarks-toggle {
    width:100%;
    min-height:44px;
  }
}

/* V2 B44-STAT-S8C — Data-Centered domain shell / Home / active-data navigation.
   Host still owns global TOÁN TIN chrome; this header only switches Tool-domain workspaces. */
[data-toantin-tool="chart_builder"] .cb-domain-shell {
  display:flex;
  width:100%;
  height:100%;
  min-width:0;
  min-height:0;
  flex-direction:column;
  gap:10px;
  overflow:hidden;
}
[data-toantin-tool="chart_builder"] .cb-domain-shell > .cb-full-tool {
  flex:1 1 auto;
  min-height:0;
}
[data-toantin-tool="chart_builder"] .cb-domain-shell-header {
  flex:0 0 auto;
  min-width:0;
  padding:10px 12px;
  border:1px solid var(--cb-border,#dce7f4);
  border-radius:14px;
  background:linear-gradient(180deg,#fff 0%,#f9fbff 100%);
  box-shadow:0 7px 20px rgba(15,31,75,.055);
}
[data-toantin-tool="chart_builder"] .cb-domain-shell-top {
  display:flex;
  min-width:0;
  align-items:center;
  gap:14px;
}
[data-toantin-tool="chart_builder"] .cb-domain-identity {
  display:flex;
  min-width:170px;
  flex:0 0 auto;
  flex-direction:column;
  gap:1px;
}
[data-toantin-tool="chart_builder"] .cb-domain-identity__name {
  color:#10224f;
  font-size:14px;
  font-weight:820;
  line-height:1.2;
}
[data-toantin-tool="chart_builder"] .cb-domain-identity__caption {
  color:#718096;
  font-size:11px;
  font-weight:650;
  line-height:1.2;
}
[data-toantin-tool="chart_builder"] .cb-domain-nav {
  display:flex;
  min-width:0;
  flex:1 1 auto;
  align-items:center;
  gap:6px;
  overflow-x:auto;
  padding:2px;
  overscroll-behavior-x:contain;
  scrollbar-width:thin;
}
[data-toantin-tool="chart_builder"] .cb-domain-nav__item {
  flex:0 0 auto;
  min-height:38px;
  padding:7px 12px;
  border:1px solid transparent;
  border-radius:10px;
  background:transparent;
  color:#526277;
  font-size:12.5px;
  font-weight:780;
  line-height:1.15;
  white-space:nowrap;
  transition:transform .14s ease,background .14s ease,border-color .14s ease,box-shadow .14s ease,color .14s ease;
}
[data-toantin-tool="chart_builder"] .cb-domain-nav__item:hover:not(:disabled),
[data-toantin-tool="chart_builder"] .cb-domain-nav__item:focus-visible {
  border-color:#c8dcf7;
  background:#f2f7ff;
  color:#174c9c;
}
[data-toantin-tool="chart_builder"] .cb-domain-nav__item.is-active {
  border-color:#96bbef;
  background:linear-gradient(180deg,#f8fbff 0%,#e6f1ff 100%);
  color:#0d5bef;
  box-shadow:0 3px 8px rgba(13,91,239,.10),inset 0 1px 0 rgba(255,255,255,.9);
}
[data-toantin-tool="chart_builder"] .cb-domain-nav__item:active:not(:disabled) { transform:translateY(1px); }
[data-toantin-tool="chart_builder"] .cb-domain-nav__item:disabled { opacity:.46; cursor:not-allowed; }
[data-toantin-tool="chart_builder"] .cb-active-data-ribbon {
  display:grid;
  grid-template-columns:minmax(180px,1.4fr) auto auto;
  gap:10px;
  align-items:center;
  margin-top:8px;
  padding:7px 8px 7px 10px;
  border:1px solid #dce8f6;
  border-radius:11px;
  background:#f6faff;
}
[data-toantin-tool="chart_builder"] .cb-active-data-ribbon__copy {
  display:flex;
  min-width:0;
  flex-direction:column;
  gap:1px;
}
[data-toantin-tool="chart_builder"] .cb-active-data-ribbon__label {
  color:#718096;
  font-size:10.5px;
  font-weight:720;
  letter-spacing:.025em;
  text-transform:uppercase;
}
[data-toantin-tool="chart_builder"] .cb-active-data-ribbon__title {
  overflow:hidden;
  color:#1f3557;
  font-size:12.5px;
  font-weight:800;
  text-overflow:ellipsis;
  white-space:nowrap;
}
[data-toantin-tool="chart_builder"] .cb-active-data-ribbon__facts {
  display:flex;
  align-items:center;
  gap:5px;
  overflow-x:auto;
}
[data-toantin-tool="chart_builder"] .cb-active-data-ribbon__fact {
  flex:0 0 auto;
  padding:4px 7px;
  border:1px solid #d5e3f4;
  border-radius:999px;
  background:#fff;
  color:#526277;
  font-size:10.5px;
  font-weight:720;
  white-space:nowrap;
}
[data-toantin-tool="chart_builder"] .cb-active-data-ribbon__action { white-space:nowrap; }

[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-home {
  display:block;
  min-height:0;
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-home .cb-data-panel {
  width:100%;
  max-width:none;
  min-height:clamp(520px,68vh,900px);
  padding:clamp(14px,2vw,24px);
  overflow:auto;
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-home .cb-preview-panel,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-home .cb-data-panel-resize-handle { display:none !important; }
[data-toantin-tool="chart_builder"] .cb-home-workspace {
  display:grid;
  width:min(1180px,100%);
  margin:0 auto;
  gap:14px;
}
[data-toantin-tool="chart_builder"] .cb-home-hero {
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:18px;
  align-items:center;
  padding:clamp(18px,2.5vw,30px);
  border:1px solid #cfe0f5;
  border-radius:18px;
  background:linear-gradient(135deg,#f8fbff 0%,#eef6ff 58%,#f8fbff 100%);
  box-shadow:0 10px 30px rgba(19,65,126,.07);
}
[data-toantin-tool="chart_builder"] .cb-home-hero__copy { min-width:0; }
[data-toantin-tool="chart_builder"] .cb-home-hero__title {
  margin:4px 0 7px;
  color:#10224f;
  font-size:clamp(22px,2.2vw,32px);
  font-weight:850;
  line-height:1.16;
}
[data-toantin-tool="chart_builder"] .cb-home-hero__lead {
  max-width:760px;
  margin:0;
  color:#526277;
  font-size:14px;
  line-height:1.55;
}
[data-toantin-tool="chart_builder"] .cb-home-continue { min-height:42px; white-space:nowrap; }
[data-toantin-tool="chart_builder"] .cb-home-metrics {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:9px;
}
[data-toantin-tool="chart_builder"] .cb-home-metric {
  display:flex;
  min-width:0;
  flex-direction:column;
  gap:4px;
  padding:12px 14px;
  border:1px solid #dce7f4;
  border-radius:13px;
  background:#fff;
}
[data-toantin-tool="chart_builder"] .cb-home-metric__label { color:#718096; font-size:11px; font-weight:720; }
[data-toantin-tool="chart_builder"] .cb-home-metric__value { color:#20334f; font-size:17px; font-weight:840; }
[data-toantin-tool="chart_builder"] .cb-home-tasks { padding:2px 0; }
[data-toantin-tool="chart_builder"] .cb-home-section-title {
  margin:0 0 10px;
  color:#10224f;
  font-size:16px;
  font-weight:820;
}
[data-toantin-tool="chart_builder"] .cb-home-task-grid {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:10px;
}
[data-toantin-tool="chart_builder"] .cb-home-task-card {
  display:flex;
  min-width:0;
  min-height:168px;
  flex-direction:column;
  padding:15px;
  border:1px solid #dbe7f5;
  border-radius:14px;
  background:#fff;
  box-shadow:0 5px 18px rgba(15,31,75,.045);
}
[data-toantin-tool="chart_builder"] .cb-home-task-card__title {
  margin:0 0 7px;
  color:#18345d;
  font-size:14px;
  font-weight:820;
}
[data-toantin-tool="chart_builder"] .cb-home-task-card__description {
  margin:0 0 14px;
  color:#64748b;
  font-size:12.5px;
  line-height:1.5;
}
[data-toantin-tool="chart_builder"] .cb-home-task-card__action { width:100%; margin-top:auto; }
[data-toantin-tool="chart_builder"] .cb-home-data-rule {
  padding:12px 14px;
  border-left:4px solid #76aaf2;
  border-radius:10px;
  background:#f4f8ff;
  color:#526277;
  font-size:12.5px;
  line-height:1.55;
}

@media (max-width:1199.98px) {
  [data-toantin-tool="chart_builder"] .cb-domain-shell-top { align-items:flex-start; flex-direction:column; gap:8px; }
  [data-toantin-tool="chart_builder"] .cb-domain-identity { min-width:0; }
  [data-toantin-tool="chart_builder"] .cb-domain-nav { width:100%; }
  [data-toantin-tool="chart_builder"] .cb-home-task-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:767.98px) {
  [data-toantin-tool="chart_builder"] .cb-domain-shell { gap:7px; overflow:visible; height:auto; }
  [data-toantin-tool="chart_builder"] .cb-domain-shell-header { padding:8px; border-radius:12px; }
  [data-toantin-tool="chart_builder"] .cb-domain-identity__caption { display:none; }
  [data-toantin-tool="chart_builder"] .cb-domain-nav__item { min-height:40px; padding:7px 10px; }
  [data-toantin-tool="chart_builder"] .cb-active-data-ribbon { grid-template-columns:minmax(0,1fr) auto; }
  [data-toantin-tool="chart_builder"] .cb-active-data-ribbon__facts { grid-column:1 / -1; grid-row:2; }
  [data-toantin-tool="chart_builder"] .cb-active-data-ribbon__action { grid-column:2; grid-row:1; }
  [data-toantin-tool="chart_builder"] .cb-home-hero { grid-template-columns:1fr; }
  [data-toantin-tool="chart_builder"] .cb-home-continue { width:100%; }
  [data-toantin-tool="chart_builder"] .cb-home-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:575.98px), (pointer:coarse) {
  [data-toantin-tool="chart_builder"] .cb-domain-nav__item,
  [data-toantin-tool="chart_builder"] .cb-active-data-ribbon__action,
  [data-toantin-tool="chart_builder"] .cb-home-continue,
  [data-toantin-tool="chart_builder"] .cb-home-task-card__action { min-height:44px; }
}
@media (max-width:575.98px) {
  [data-toantin-tool="chart_builder"] .cb-active-data-ribbon { grid-template-columns:1fr; }
  [data-toantin-tool="chart_builder"] .cb-active-data-ribbon__action,
  [data-toantin-tool="chart_builder"] .cb-active-data-ribbon__facts { grid-column:1; grid-row:auto; }
  [data-toantin-tool="chart_builder"] .cb-active-data-ribbon__action { width:100%; }
  [data-toantin-tool="chart_builder"] .cb-home-task-grid { grid-template-columns:1fr; }
  [data-toantin-tool="chart_builder"] .cb-home-task-card { min-height:0; }
}
@media (prefers-reduced-motion:reduce) {
  [data-toantin-tool="chart_builder"] .cb-domain-nav__item { transition:none; }
}

/* ========================================================================
   V2 B45-STAT-S8D — DATA & STATISTICS WORKSPACE CONSOLIDATION
   One full data-authoring house; Chart keeps only canonical-data bridge +
   chart-specific controls. All selectors remain Tool-scoped.
   ======================================================================== */
[data-toantin-tool="chart_builder"] .cb-statistics-section-tabs--b45 {
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:8px;
  padding:7px;
  border:1px solid #d7e5f6;
  border-radius:14px;
  background:#f5f9ff;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.9);
}
[data-toantin-tool="chart_builder"] .cb-statistics-section-tabs--b45 .cb-statistics-section-tab {
  min-height:42px;
  border:1px solid transparent;
  border-radius:10px;
  background:transparent;
  color:#526277;
  font-weight:780;
}
[data-toantin-tool="chart_builder"] .cb-statistics-section-tabs--b45 .cb-statistics-section-tab:hover,
[data-toantin-tool="chart_builder"] .cb-statistics-section-tabs--b45 .cb-statistics-section-tab:focus-visible {
  border-color:#c8dcf7;
  background:#fff;
  color:#174c9c;
}
[data-toantin-tool="chart_builder"] .cb-statistics-section-tabs--b45 .cb-statistics-section-tab.is-active {
  border-color:#8db8f1;
  background:linear-gradient(180deg,#ffffff 0%,#e8f2ff 100%);
  color:#0d5bef;
  box-shadow:0 4px 10px rgba(13,91,239,.09),inset 0 1px 0 rgba(255,255,255,.95);
}
[data-toantin-tool="chart_builder"] .cb-statistics-import-workflow,
[data-toantin-tool="chart_builder"] .cb-statistics-export-workflow {
  display:grid;
  gap:10px;
  padding:12px;
  border:1px solid #dbe7f5;
  border-radius:12px;
  background:#f9fbff;
}
[data-toantin-tool="chart_builder"] .cb-statistics-secondary-tools {
  border:1px solid #dbe7f5;
  border-radius:12px;
  background:#fff;
  overflow:hidden;
}
[data-toantin-tool="chart_builder"] .cb-statistics-secondary-tools__summary {
  padding:11px 13px;
  cursor:pointer;
  color:#31527e;
  font-size:12.5px;
  font-weight:780;
  list-style-position:inside;
}
[data-toantin-tool="chart_builder"] .cb-statistics-secondary-tools[open] .cb-statistics-secondary-tools__summary {
  border-bottom:1px solid #e2ebf6;
  background:#f7faff;
}
[data-toantin-tool="chart_builder"] .cb-statistics-secondary-tools .cb-statistics-export-workflow {
  border:0;
  border-radius:0;
  background:#fff;
}
[data-toantin-tool="chart_builder"] .cb-quick-data-bridge {
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:10px;
  align-items:center;
  padding:11px 12px;
  border:1px solid #cfe0f5;
  border-radius:13px;
  background:linear-gradient(135deg,#f9fcff 0%,#eef6ff 100%);
  box-shadow:0 4px 14px rgba(25,73,135,.05);
}
[data-toantin-tool="chart_builder"] .cb-quick-data-bridge__copy {
  display:flex;
  min-width:0;
  flex-direction:column;
  gap:2px;
}
[data-toantin-tool="chart_builder"] .cb-quick-data-bridge__eyebrow {
  color:#6b7f9f;
  font-size:10px;
  font-weight:800;
  letter-spacing:.05em;
}
[data-toantin-tool="chart_builder"] .cb-quick-data-bridge__title {
  overflow:hidden;
  color:#17345f;
  font-size:13px;
  font-weight:830;
  text-overflow:ellipsis;
  white-space:nowrap;
}
[data-toantin-tool="chart_builder"] .cb-quick-data-bridge__meta {
  color:#6a7b92;
  font-size:11px;
  line-height:1.35;
}
[data-toantin-tool="chart_builder"] .cb-quick-data-bridge__action { white-space:nowrap; }
[data-toantin-tool="chart_builder"] .cb-quick-data-bridge__empty {
  grid-column:1 / -1;
  margin:0;
  color:#60738f;
  font-size:11px;
}
[data-toantin-tool="chart_builder"] .cb-quick-gallery-disclosure {
  border:1px solid #dbe7f5;
  border-radius:12px;
  background:#fff;
  overflow:hidden;
}
[data-toantin-tool="chart_builder"] .cb-quick-gallery-disclosure__summary {
  padding:11px 12px;
  cursor:pointer;
  color:#31527e;
  font-size:12px;
  font-weight:800;
  list-style-position:inside;
}
[data-toantin-tool="chart_builder"] .cb-quick-gallery-disclosure[open] .cb-quick-gallery-disclosure__summary {
  border-bottom:1px solid #e1ebf6;
  background:#f7faff;
}
[data-toantin-tool="chart_builder"] .cb-quick-gallery-disclosure .cb-statistics-chart-page {
  padding:10px;
}
[data-toantin-tool="chart_builder"] .cb-statistics-insights-page {
  display:grid;
  gap:12px;
}
[data-toantin-tool="chart_builder"] .cb-statistics-insight-metrics {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:9px;
}
[data-toantin-tool="chart_builder"] .cb-statistics-insight-metric {
  display:flex;
  min-width:0;
  flex-direction:column;
  gap:5px;
  padding:13px 14px;
  border:1px solid #dbe7f5;
  border-radius:12px;
  background:linear-gradient(180deg,#fff 0%,#f8fbff 100%);
}
[data-toantin-tool="chart_builder"] .cb-statistics-insight-metric__label {
  color:#6b7f9f;
  font-size:11px;
  font-weight:720;
  line-height:1.35;
}
[data-toantin-tool="chart_builder"] .cb-statistics-insight-metric__value {
  color:#17345f;
  font-size:clamp(17px,1.6vw,22px);
  font-weight:850;
  line-height:1.1;
}
[data-toantin-tool="chart_builder"] .cb-statistics-insight-remarks__list {
  display:grid;
  gap:8px;
  margin:0;
  padding-left:22px;
  color:#344b6a;
  line-height:1.5;
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-chart .cb-file-utilities .cb-file-import-row,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-chart .cb-file-utilities .cb-file-service-note {
  display:none !important;
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-data.is-statistics-data-workspace-expanded .cb-statistics-section-tabs--b45 {
  width:min(980px,100%);
  margin-inline:auto;
}
@media (max-width:991.98px) {
  [data-toantin-tool="chart_builder"] .cb-statistics-insight-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:767.98px) {
  [data-toantin-tool="chart_builder"] .cb-quick-data-bridge { grid-template-columns:1fr; }
  [data-toantin-tool="chart_builder"] .cb-quick-data-bridge__action { width:100%; min-height:44px; }
}
@media (max-width:575.98px) {
  [data-toantin-tool="chart_builder"] .cb-statistics-section-tabs--b45 { grid-template-columns:1fr; }
  [data-toantin-tool="chart_builder"] .cb-statistics-section-tabs--b45 .cb-statistics-section-tab { min-height:44px; }
  [data-toantin-tool="chart_builder"] .cb-statistics-insight-metrics { grid-template-columns:1fr; }
}
@media (prefers-reduced-motion:reduce) {
  [data-toantin-tool="chart_builder"] .cb-statistics-section-tabs--b45 .cb-statistics-section-tab { transition:none; }
}

/* ========================================================================
   V2 B46-STAT-S8E — CHART STUDIO / CANVAS-FIRST / CONTEXTUAL UI
   Chart workspace becomes one compact control deck above a maximum-area
   existing ChartSurface. No second renderer/editor/data store is introduced.
   ======================================================================== */
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-chart {
  display:grid;
  grid-template-columns:minmax(0,1fr);
  grid-template-rows:auto minmax(0,1fr);
  gap:8px;
  min-height:0;
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-chart .cb-data-panel {
  width:100%;
  max-width:none;
  max-height:min(38vh,340px);
  overflow:auto;
  padding:9px 11px;
  border-radius:14px;
  box-shadow:0 6px 18px rgba(15,31,75,.045);
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-chart .cb-preview-panel {
  min-height:0;
  height:auto;
  padding:7px 9px 9px;
  border-radius:14px;
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-chart .cb-data-panel-resize-handle { display:none !important; }
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-chart.is-data-panel-collapsed {
  grid-template-columns:minmax(0,1fr);
  grid-template-rows:54px minmax(0,1fr);
  gap:7px;
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-chart.is-data-panel-collapsed .cb-data-panel {
  min-height:54px;
  max-height:54px;
  padding:6px 9px;
  overflow:hidden;
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-chart.is-data-panel-collapsed .cb-panel-heading--collapsible {
  min-height:40px;
  justify-content:space-between;
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-chart.is-data-panel-collapsed .cb-panel-heading__text {
  display:flex;
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-chart.is-data-panel-collapsed .cb-chart-studio-heading__hint,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-chart.is-data-panel-collapsed .cb-eyebrow { display:none; }
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-chart.is-data-panel-collapsed .cb-data-panel-toggle {
  width:40px;
  height:40px;
}

[data-toantin-tool="chart_builder"] .cb-chart-studio-heading {
  align-items:center;
  margin:0 0 7px;
}
[data-toantin-tool="chart_builder"] .cb-chart-studio-heading__copy {
  display:flex;
  min-width:0;
  align-items:baseline;
  gap:8px;
  flex-wrap:wrap;
}
[data-toantin-tool="chart_builder"] .cb-chart-studio-heading__copy .cb-eyebrow { margin:0; }
[data-toantin-tool="chart_builder"] .cb-chart-studio-heading__hint {
  color:#6b7d96;
  font-size:11px;
  font-weight:650;
}
[data-toantin-tool="chart_builder"] .cb-chart-studio-collapse {
  box-shadow:0 3px 0 #d6e4f5,0 6px 12px rgba(24,66,121,.08),inset 0 1px 0 #fff;
}
[data-toantin-tool="chart_builder"] .cb-chart-studio-collapse:active {
  transform:translateY(2px);
  box-shadow:0 1px 0 #d6e4f5,0 3px 7px rgba(24,66,121,.07),inset 0 1px 0 #fff;
}
[data-toantin-tool="chart_builder"] .cb-chart-studio-control-deck {
  display:grid;
  grid-template-columns:minmax(230px,.78fr) minmax(0,3fr);
  gap:9px;
  align-items:stretch;
}
[data-toantin-tool="chart_builder"] .cb-chart-studio-control-deck .cb-quick-data-bridge {
  min-height:86px;
  padding:9px 10px;
  grid-template-columns:minmax(0,1fr);
  gap:6px;
}
[data-toantin-tool="chart_builder"] .cb-chart-studio-control-deck .cb-quick-data-bridge__action {
  width:max-content;
  max-width:100%;
}
[data-toantin-tool="chart_builder"] .cb-chart-type-section {
  min-width:0;
  padding:7px 9px 8px;
  border:1px solid #d7e5f5;
  border-radius:13px;
  background:linear-gradient(180deg,#fbfdff 0%,#f6faff 100%);
}
[data-toantin-tool="chart_builder"] .cb-chart-type-section__heading {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin-bottom:5px;
}
[data-toantin-tool="chart_builder"] .cb-chart-type-section__heading .cb-section-title { margin:0; }
[data-toantin-tool="chart_builder"] .cb-chart-type-section__note {
  color:#71839c;
  font-size:10px;
  font-weight:680;
  white-space:nowrap;
}
[data-toantin-tool="chart_builder"] .cb-chart-family-rail {
  display:flex;
  grid-template-columns:none;
  gap:7px;
  overflow-x:auto;
  overflow-y:hidden;
  padding:3px 2px 6px;
  scroll-snap-type:x proximity;
  overscroll-behavior-inline:contain;
  scrollbar-width:thin;
}
[data-toantin-tool="chart_builder"] .cb-chart-family-button {
  flex:0 0 132px;
  scroll-snap-align:start;
  min-height:64px;
  padding:7px 8px;
  border-color:#cdddf0;
  border-radius:11px;
  background:linear-gradient(180deg,#fff 0%,#f3f8ff 100%);
  box-shadow:0 4px 0 #d9e5f3,0 7px 14px rgba(24,66,121,.075),inset 0 1px 0 #fff;
  transition:transform .12s ease,box-shadow .12s ease,border-color .12s ease,background .12s ease,color .12s ease;
}
[data-toantin-tool="chart_builder"] .cb-chart-family-button:hover,
[data-toantin-tool="chart_builder"] .cb-chart-family-button:focus-visible {
  transform:translateY(-1px);
  border-color:#89b4ed;
  background:linear-gradient(180deg,#fff 0%,#eaf3ff 100%);
  box-shadow:0 5px 0 #c9dcf2,0 9px 18px rgba(13,91,239,.11),inset 0 1px 0 #fff;
}
[data-toantin-tool="chart_builder"] .cb-chart-family-button:active {
  transform:translateY(2px);
  box-shadow:0 1px 0 #d0dfef,0 3px 8px rgba(24,66,121,.075),inset 0 1px 2px rgba(20,50,90,.08);
}
[data-toantin-tool="chart_builder"] .cb-chart-family-button.is-active {
  border-color:#4d8fe8;
  background:linear-gradient(180deg,#fafdff 0%,#dfeeff 100%);
  color:#0c55c8;
  box-shadow:0 4px 0 #9dc0ee,0 8px 16px rgba(13,91,239,.13),inset 0 1px 0 #fff;
}
[data-toantin-tool="chart_builder"] .cb-chart-family-button.is-disabled {
  border-color:#dfe7f1;
  background:linear-gradient(180deg,#fbfcfe 0%,#f4f6f9 100%);
  color:#8996a8;
  box-shadow:0 3px 0 #e5ebf2,0 5px 9px rgba(36,54,79,.045),inset 0 1px 0 #fff;
}
[data-toantin-tool="chart_builder"] .cb-chart-family-button.is-disabled:hover,
[data-toantin-tool="chart_builder"] .cb-chart-family-button.is-disabled:focus-visible {
  transform:none;
  border-color:#cfd9e6;
  background:#f7f9fc;
  box-shadow:0 3px 0 #e1e8f0,0 5px 9px rgba(36,54,79,.045),inset 0 1px 0 #fff;
}
[data-toantin-tool="chart_builder"] .cb-chart-family-button__icon {
  flex:0 0 34px;
  width:34px;
  height:34px;
  border:1px solid #d9e7f6;
  border-radius:9px;
  background:linear-gradient(145deg,#fff,#e9f2ff);
  box-shadow:inset 1px 1px 0 rgba(255,255,255,.95),0 2px 5px rgba(35,75,130,.06);
}
[data-toantin-tool="chart_builder"] .cb-chart-family-button.is-active .cb-chart-family-button__icon {
  border-color:#a8c9f2;
  background:linear-gradient(145deg,#fff,#dcecff);
}
[data-toantin-tool="chart_builder"] .cb-chart-family-icon { display:block; }
[data-toantin-tool="chart_builder"] .cb-chart-family-button__copy strong {
  overflow:hidden;
  font-size:12px;
  line-height:1.15;
  text-overflow:ellipsis;
  white-space:nowrap;
}
[data-toantin-tool="chart_builder"] .cb-chart-family-button__copy small {
  display:-webkit-box;
  overflow:hidden;
  color:#6c7d92;
  font-size:9.5px;
  line-height:1.2;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
}
[data-toantin-tool="chart_builder"] .cb-chart-family-button.is-disabled .cb-chart-family-button__copy small { color:#8794a6; }
[data-toantin-tool="chart_builder"] .cb-chart-unavailable-badge {
  position:absolute;
  right:5px;
  bottom:4px;
  max-width:72px;
  overflow:hidden;
  color:#8794a6;
  font-size:8px;
  font-weight:760;
  text-overflow:ellipsis;
  white-space:nowrap;
}

[data-toantin-tool="chart_builder"] .cb-chart-studio-quick-properties {
  display:grid;
  grid-template-columns:minmax(180px,.65fr) minmax(0,2.35fr);
  gap:9px;
  align-items:center;
  margin-top:8px;
  padding:8px 10px;
  border:1px solid #d9e6f5;
  border-radius:12px;
  background:#fff;
}
[data-toantin-tool="chart_builder"] .cb-chart-studio-quick-properties__head {
  display:flex;
  min-width:0;
  flex-direction:column;
  gap:2px;
}
[data-toantin-tool="chart_builder"] .cb-chart-studio-quick-properties__title {
  color:#17355f;
  font-size:12px;
  font-weight:820;
}
[data-toantin-tool="chart_builder"] .cb-chart-studio-quick-properties__hint,
[data-toantin-tool="chart_builder"] .cb-chart-studio-context-hint {
  color:#718096;
  font-size:10.5px;
  line-height:1.35;
}
[data-toantin-tool="chart_builder"] .cb-chart-variant-quick {
  display:flex;
  min-width:0;
  align-items:end;
  gap:8px;
  overflow-x:auto;
  padding:2px 1px;
  scrollbar-width:thin;
}
[data-toantin-tool="chart_builder"] .cb-chart-quick-field {
  display:flex;
  flex:0 0 auto;
  min-width:130px;
  flex-direction:column;
  gap:3px;
}
[data-toantin-tool="chart_builder"] .cb-chart-quick-field__label {
  color:#60738f;
  font-size:9.5px;
  font-weight:740;
}
[data-toantin-tool="chart_builder"] .cb-chart-quick-field--range { min-width:155px; }
[data-toantin-tool="chart_builder"] .cb-chart-variant-quick .cb-combo-map {
  display:flex;
  align-items:end;
  gap:6px;
  min-width:max-content;
}
[data-toantin-tool="chart_builder"] .cb-chart-variant-quick .cb-combo-map > .small { align-self:center; }
[data-toantin-tool="chart_builder"] .cb-chart-variant-quick .cb-combo-row {
  grid-template-columns:minmax(82px,110px) 88px 68px;
}
[data-toantin-tool="chart_builder"] .cb-chart-variant-quick .cb-pie-quick-controls {
  flex:1 1 auto;
  min-width:480px;
  margin:0;
  padding:0;
  border:0;
  background:transparent;
}
[data-toantin-tool="chart_builder"] .cb-chart-variant-quick .cb-pie-quick-controls__title {
  margin:0 0 3px;
  color:#60738f;
  font-size:9.5px;
}
[data-toantin-tool="chart_builder"] .cb-chart-variant-quick .cb-pie-quick-controls__grid {
  grid-template-columns:repeat(3,minmax(132px,1fr));
  gap:6px;
}
[data-toantin-tool="chart_builder"] .cb-chart-studio-advanced,
[data-toantin-tool="chart_builder"] .cb-chart-studio-gallery {
  margin-top:7px;
  border:1px solid #dce7f4;
  border-radius:11px;
  background:#fff;
  overflow:hidden;
}
[data-toantin-tool="chart_builder"] .cb-chart-studio-advanced__summary,
[data-toantin-tool="chart_builder"] .cb-chart-studio-gallery > .cb-quick-gallery-disclosure__summary {
  min-height:38px;
  padding:9px 11px;
  cursor:pointer;
  color:#31527e;
  font-size:11.5px;
  font-weight:780;
  list-style-position:inside;
}
[data-toantin-tool="chart_builder"] .cb-chart-studio-advanced[open] .cb-chart-studio-advanced__summary,
[data-toantin-tool="chart_builder"] .cb-chart-studio-gallery[open] > .cb-quick-gallery-disclosure__summary {
  border-bottom:1px solid #e2ebf6;
  background:#f6faff;
}
[data-toantin-tool="chart_builder"] .cb-chart-studio-advanced__body {
  display:grid;
  grid-template-columns:minmax(180px,.8fr) minmax(220px,1fr) minmax(190px,.8fr);
  gap:12px;
  padding:9px 11px 11px;
}
[data-toantin-tool="chart_builder"] .cb-chart-studio-advanced__body > .cb-editor-section {
  min-width:0;
  padding:0;
  border:0;
}
[data-toantin-tool="chart_builder"] .cb-chart-studio-gallery .cb-statistics-chart-page { padding:9px; }
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-chart .cb-full-chart-host { min-height:0; }

@media (max-width:1199.98px) {
  [data-toantin-tool="chart_builder"] .cb-chart-studio-control-deck { grid-template-columns:1fr; }
  [data-toantin-tool="chart_builder"] .cb-chart-studio-control-deck .cb-quick-data-bridge {
    min-height:0;
    grid-template-columns:minmax(0,1fr) auto;
  }
  [data-toantin-tool="chart_builder"] .cb-chart-studio-advanced__body { grid-template-columns:1fr 1fr; }
  [data-toantin-tool="chart_builder"] .cb-chart-studio-advanced__body > .cb-file-utilities { grid-column:1 / -1; }
}
@media (max-width:767.98px) {
  [data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-chart,
  [data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-chart.is-data-panel-collapsed {
    display:flex;
    height:auto;
    flex-direction:column;
    gap:7px;
  }
  [data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-chart .cb-data-panel {
    max-height:none;
    overflow:visible;
  }
  [data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-chart.is-data-panel-collapsed .cb-data-panel {
    min-height:54px;
    max-height:54px;
    overflow:hidden;
  }
  [data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-chart .cb-preview-panel { min-height:520px; }
  [data-toantin-tool="chart_builder"] .cb-chart-studio-quick-properties { grid-template-columns:1fr; }
  [data-toantin-tool="chart_builder"] .cb-chart-studio-advanced__body { grid-template-columns:1fr; }
  [data-toantin-tool="chart_builder"] .cb-chart-studio-advanced__body > .cb-file-utilities { grid-column:auto; }
  [data-toantin-tool="chart_builder"] .cb-chart-studio-heading__hint { display:none; }
}
@media (max-width:575.98px) {
  [data-toantin-tool="chart_builder"] .cb-chart-studio-control-deck .cb-quick-data-bridge { grid-template-columns:1fr; }
  [data-toantin-tool="chart_builder"] .cb-chart-family-button { flex-basis:122px; min-height:68px; }
  [data-toantin-tool="chart_builder"] .cb-chart-type-section__note { display:none; }
  [data-toantin-tool="chart_builder"] .cb-chart-studio-quick-properties { padding:8px; }
  [data-toantin-tool="chart_builder"] .cb-chart-variant-quick .cb-pie-quick-controls { min-width:420px; }
  [data-toantin-tool="chart_builder"] .cb-chart-studio-advanced__summary,
  [data-toantin-tool="chart_builder"] .cb-chart-studio-gallery > .cb-quick-gallery-disclosure__summary { min-height:44px; }
}
@media (pointer:coarse) {
  [data-toantin-tool="chart_builder"] .cb-chart-family-button { min-height:72px; }
}
@media (prefers-reduced-motion:reduce) {
  [data-toantin-tool="chart_builder"] .cb-chart-family-button,
  [data-toantin-tool="chart_builder"] .cb-chart-studio-collapse { transition:none; }
}

/* V2 B47-STAT-S8F — Teaching source alignment + Library canonical routing. */
[data-toantin-tool="chart_builder"] .cb-teaching-source-chooser {
  display:grid;
  gap:12px;
  padding:14px;
  border:1px solid #cfe0f5;
  border-radius:16px;
  background:linear-gradient(180deg,#f9fcff,#f2f7ff);
}
[data-toantin-tool="chart_builder"] .cb-teaching-source-chooser__heading {
  display:grid;
  gap:4px;
}
[data-toantin-tool="chart_builder"] .cb-teaching-source-options {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
}
[data-toantin-tool="chart_builder"] .cb-teaching-source-card {
  display:grid;
  min-width:0;
  min-height:84px;
  gap:7px;
  padding:12px 14px;
  border:1px solid #cfdcf0;
  border-radius:14px;
  background:#fff;
  color:#17345f;
  box-shadow:0 4px 0 rgba(43,77,126,.08),0 8px 18px rgba(28,59,105,.05);
  text-align:left;
  transition:transform .15s ease,box-shadow .15s ease,border-color .15s ease,background .15s ease;
}
[data-toantin-tool="chart_builder"] .cb-teaching-source-card:hover,
[data-toantin-tool="chart_builder"] .cb-teaching-source-card:focus-visible {
  border-color:#79aafa;
  background:#fbfdff;
  outline:3px solid rgba(41,112,241,.13);
  outline-offset:2px;
  transform:translateY(-1px);
}
[data-toantin-tool="chart_builder"] .cb-teaching-source-card.is-active {
  border-color:#4f91f7;
  background:#edf5ff;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.9),0 2px 0 rgba(25,84,176,.14),0 8px 18px rgba(28,83,167,.10);
  transform:translateY(1px);
}
[data-toantin-tool="chart_builder"] .cb-teaching-source-card__top {
  display:flex;
  min-width:0;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
[data-toantin-tool="chart_builder"] .cb-teaching-source-card__title {
  min-width:0;
  font-size:14px;
  font-weight:850;
  line-height:1.3;
}
[data-toantin-tool="chart_builder"] .cb-teaching-source-card__badge {
  flex:0 0 auto;
  padding:3px 7px;
  border:1px solid #cfe0f5;
  border-radius:999px;
  background:#f7fbff;
  color:#4d6584;
  font-size:10px;
  font-weight:850;
  letter-spacing:.03em;
}
[data-toantin-tool="chart_builder"] .cb-teaching-source-card.is-active .cb-teaching-source-card__badge {
  border-color:#a9c8f8;
  background:#fff;
  color:#175ec6;
}
[data-toantin-tool="chart_builder"] .cb-teaching-source-card__description {
  color:#62738a;
  font-size:12px;
  line-height:1.45;
}
[data-toantin-tool="chart_builder"] .cb-teaching-current-data {
  display:grid;
  gap:12px;
}
[data-toantin-tool="chart_builder"] .cb-teaching-current-source__copy {
  display:grid;
  min-width:0;
  gap:3px;
}
[data-toantin-tool="chart_builder"] .cb-teaching-current-source__title {
  overflow-wrap:anywhere;
  color:#123867;
  font-size:15px;
  font-weight:820;
}
[data-toantin-tool="chart_builder"] .cb-teaching-current-source__actions {
  justify-content:flex-end;
}
[data-toantin-tool="chart_builder"] .cb-teaching-current-stage {
  display:grid;
  gap:8px;
}
[data-toantin-tool="chart_builder"] .cb-teaching-current-stage__title {
  color:#17345f;
  font-size:15px;
  font-weight:850;
}
[data-toantin-tool="chart_builder"] .cb-teaching-current-chart-grid {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(210px,1fr));
  gap:10px;
}
[data-toantin-tool="chart_builder"] .cb-teaching-current-chart-empty {
  min-height:108px;
}
[data-toantin-tool="chart_builder"] .cb-teaching-open-chart-studio {
  justify-self:start;
}
[data-toantin-tool="chart_builder"] .cb-library-card__route-actions {
  display:flex;
  flex:1 1 100%;
  flex-wrap:wrap;
  gap:7px;
  padding-top:8px;
  border-top:1px solid #edf2f8;
}
[data-toantin-tool="chart_builder"] .cb-library-card__route-actions .btn {
  flex:1 1 auto;
}
[data-toantin-tool="chart_builder"] .cb-library-back-home {
  white-space:nowrap;
}
@media (max-width:767.98px) {
  [data-toantin-tool="chart_builder"] .cb-teaching-source-options { grid-template-columns:1fr; }
  [data-toantin-tool="chart_builder"] .cb-teaching-current-source .cb-section-heading-row { align-items:stretch; flex-direction:column; }
  [data-toantin-tool="chart_builder"] .cb-teaching-current-source__actions { justify-content:flex-start; }
  [data-toantin-tool="chart_builder"] .cb-teaching-current-chart-grid { grid-template-columns:1fr; }
}
@media (max-width:575.98px) {
  [data-toantin-tool="chart_builder"] .cb-teaching-source-card { min-height:88px; }
  [data-toantin-tool="chart_builder"] .cb-teaching-current-source__actions { align-items:stretch; flex-direction:column; }
  [data-toantin-tool="chart_builder"] .cb-teaching-current-source__actions .btn,
  [data-toantin-tool="chart_builder"] .cb-library-card__route-actions .btn { width:100%; min-height:44px; }
  [data-toantin-tool="chart_builder"] .cb-library-card__route-actions { align-items:stretch; flex-direction:column; }
}
@media (prefers-reduced-motion:reduce) {
  [data-toantin-tool="chart_builder"] .cb-teaching-source-card { transition:none; }
}

/* ========================================================================
   B48-STAT-S8G-FIX01 — FLAT / AUTO-HEIGHT / EVIDENCE-FIRST UX
   Normal pages use document flow. Fullscreen Focus keeps its bounded viewport.
   ======================================================================== */
[data-toantin-tool="chart_builder"] .cb-domain-shell {
  height:auto;
  min-height:0;
  gap:6px;
  overflow:visible;
}
[data-toantin-tool="chart_builder"] .cb-domain-shell > .cb-full-tool {
  flex:none;
  height:auto;
  min-height:0;
}
[data-toantin-tool="chart_builder"] .cb-domain-shell-header {
  padding:5px 7px;
  border:1px solid #dce7f4;
  border-radius:11px;
  background:#fff;
  box-shadow:0 3px 12px rgba(15,31,75,.04);
}
[data-toantin-tool="chart_builder"] .cb-unified-topbar {
  display:grid;
  grid-template-columns:minmax(210px,auto) minmax(420px,1fr) auto;
  align-items:center;
  gap:8px;
  min-width:0;
}
[data-toantin-tool="chart_builder"] .cb-unified-topbar__start {
  display:flex;
  min-width:0;
  align-items:center;
  gap:9px;
}
[data-toantin-tool="chart_builder"] .cb-unified-brand {
  display:flex;
  flex:0 0 auto;
  align-items:center;
  gap:6px;
}
[data-toantin-tool="chart_builder"] .cb-unified-brand__logo {
  width:54px;
  height:34px;
  object-fit:contain;
  object-position:left center;
}
[data-toantin-tool="chart_builder"] .cb-unified-brand__tool {
  color:#10224f;
  font-size:17px;
  font-weight:850;
  white-space:nowrap;
}
[data-toantin-tool="chart_builder"] .cb-unified-document {
  display:flex;
  min-width:0;
  flex-direction:column;
  gap:0;
  padding-left:8px;
  border-left:1px solid #e1e9f4;
}
[data-toantin-tool="chart_builder"] .cb-unified-document__title {
  overflow:hidden;
  color:#17355f;
  font-size:12.5px;
  font-weight:820;
  text-overflow:ellipsis;
  white-space:nowrap;
}
[data-toantin-tool="chart_builder"] .cb-unified-document__facts {
  overflow:hidden;
  color:#718096;
  font-size:10px;
  font-weight:650;
  text-overflow:ellipsis;
  white-space:nowrap;
}
[data-toantin-tool="chart_builder"] .cb-domain-nav--unified {
  overflow-x:auto;
  padding:0;
  gap:3px;
  scrollbar-width:thin;
}
[data-toantin-tool="chart_builder"] .cb-domain-nav--unified .cb-domain-nav__item {
  min-height:34px;
  padding:5px 9px;
  border-radius:8px;
  font-size:11.5px;
}
[data-toantin-tool="chart_builder"] .cb-unified-topbar__end {
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:5px;
}
[data-toantin-tool="chart_builder"] .cb-unified-data-action,
[data-toantin-tool="chart_builder"] .cb-unified-home-action {
  min-height:34px;
  white-space:nowrap;
}
/* Retired B44 stacked identity/ribbon are not emitted by FIX01. */
[data-toantin-tool="chart_builder"] .cb-domain-shell-top,
[data-toantin-tool="chart_builder"] .cb-active-data-ribbon { display:none !important; }

/* Normal workspaces are one flat document flow; no nested viewport panels. */
[data-toantin-tool="chart_builder"] .cb-full-tool:not(.is-statistics-chart-focus):not(.is-statistics-pictogram-focus):not(.is-statistics-teaching-chart-focus) {
  display:flex;
  height:auto !important;
  min-height:0 !important;
  max-height:none !important;
  flex-direction:column;
  gap:6px;
  overflow:visible;
}
[data-toantin-tool="chart_builder"] .cb-full-tool:not(.is-statistics-chart-focus):not(.is-statistics-pictogram-focus):not(.is-statistics-teaching-chart-focus) .cb-data-panel {
  width:100% !important;
  max-width:none !important;
  height:auto !important;
  min-height:0 !important;
  max-height:none !important;
  overflow:visible !important;
  padding:8px 10px;
  border-radius:11px;
  box-shadow:0 3px 12px rgba(15,31,75,.035);
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-home .cb-data-panel {
  min-height:0;
  overflow:visible;
  padding:10px;
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-data .cb-preview-panel,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-teaching .cb-preview-panel,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-library .cb-preview-panel,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-home .cb-preview-panel {
  display:none !important;
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-chart .cb-preview-panel {
  display:flex;
  width:100%;
  height:auto !important;
  min-height:0 !important;
  max-height:none !important;
  overflow:visible !important;
  padding:6px;
  border-radius:11px;
  background:#fff;
  box-shadow:0 4px 15px rgba(15,31,75,.045);
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-chart .cb-full-chart-host {
  flex:none;
  width:100%;
  height:auto;
  min-height:520px;
  aspect-ratio:16 / 8.6;
  overflow:hidden;
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-chart .cb-full-chart-host .cb-surface,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-chart .cb-full-chart-host .cb-chart-shell {
  width:100%;
  height:100%;
  min-height:0;
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-chart .cb-preview-resize-handle,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-chart .cb-preview-height-controls {
  display:none !important;
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-preview-height-manual:not(.is-statistics-chart-focus) .cb-preview-panel,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-preview-height-manual:not(.is-statistics-chart-focus) .cb-data-panel {
  height:auto !important;
  min-height:0 !important;
  max-height:none !important;
  overflow:visible !important;
}
[data-toantin-tool="chart_builder"] .cb-data-panel-resize-handle { display:none !important; }

/* Chart Studio: flatten control cards, keep chart as dominant visual. */
[data-toantin-tool="chart_builder"] .cb-chart-studio-heading {
  min-height:0;
  padding:1px 2px 4px;
  border-bottom:1px solid #e7eef7;
}
[data-toantin-tool="chart_builder"] .cb-chart-studio-control-deck {
  display:grid;
  grid-template-columns:minmax(190px,.42fr) minmax(0,2.58fr);
  gap:7px;
}
[data-toantin-tool="chart_builder"] .cb-chart-studio-control-deck .cb-quick-data-bridge,
[data-toantin-tool="chart_builder"] .cb-chart-type-section,
[data-toantin-tool="chart_builder"] .cb-chart-studio-quick-properties {
  min-height:0;
  padding:6px 8px;
  border-color:#e1eaf5;
  border-radius:9px;
  box-shadow:none;
  background:#fff;
}
[data-toantin-tool="chart_builder"] .cb-chart-family-button {
  flex-basis:118px;
  min-height:54px;
  padding:5px 7px;
  border-radius:9px;
}
[data-toantin-tool="chart_builder"] .cb-chart-family-button__icon {
  width:30px;
  height:30px;
  flex-basis:30px;
}
[data-toantin-tool="chart_builder"] .cb-chart-studio-quick-properties {
  grid-template-columns:minmax(140px,.45fr) minmax(0,2.55fr);
  margin-top:5px;
}
[data-toantin-tool="chart_builder"] .cb-chart-studio-advanced,
[data-toantin-tool="chart_builder"] .cb-chart-studio-gallery {
  margin-top:5px;
  border-radius:8px;
  box-shadow:none;
}

/* Statistics: one compact workflow instead of two large step cards. */
[data-toantin-tool="chart_builder"] .cb-statistics-analysis-page,
[data-toantin-tool="chart_builder"] .cb-statistics-insights-page {
  display:grid;
  gap:8px;
}
[data-toantin-tool="chart_builder"] .cb-statistics-intro { margin:0; }
[data-toantin-tool="chart_builder"] .cb-statistics-compact-workflow {
  display:flex;
  min-width:0;
  align-items:end;
  gap:8px;
  padding:7px 8px;
  border:1px solid #dce7f4;
  border-radius:9px;
  background:#fff;
}
[data-toantin-tool="chart_builder"] .cb-statistics-compact-workflow__field {
  flex:1 1 360px;
  min-width:180px;
}
[data-toantin-tool="chart_builder"] .cb-statistics-compact-workflow__actions {
  display:flex;
  flex:0 1 auto;
  align-items:center;
  gap:5px;
  flex-wrap:wrap;
}
[data-toantin-tool="chart_builder"] .cb-statistics-aggregate-note {
  margin:-2px 2px 0;
  padding:5px 8px;
  border-left:3px solid #9bc0f1;
  background:#f7faff;
}
[data-toantin-tool="chart_builder"] .cb-statistics-derived-card,
[data-toantin-tool="chart_builder"] .cb-statistics-insight-remarks {
  padding:9px 10px;
  border-radius:10px;
  box-shadow:none;
}
[data-toantin-tool="chart_builder"] .cb-statistics-evidence-heading {
  display:flex;
  align-items:baseline;
  gap:8px;
  margin:2px 2px -2px;
}
[data-toantin-tool="chart_builder"] .cb-statistics-evidence-heading .cb-panel-hint { margin:0; }
[data-toantin-tool="chart_builder"] .cb-statistics-insight-metrics--compact {
  display:flex;
  grid-template-columns:none;
  gap:6px;
  flex-wrap:wrap;
}
[data-toantin-tool="chart_builder"] .cb-statistics-insight-metrics--compact .cb-statistics-insight-metric {
  display:inline-flex;
  min-width:0;
  align-items:baseline;
  gap:6px;
  padding:5px 8px;
  border:1px solid #dce7f4;
  border-radius:999px;
  background:#f8fbff;
}
[data-toantin-tool="chart_builder"] .cb-statistics-insight-metrics--compact .cb-statistics-insight-metric__label,
[data-toantin-tool="chart_builder"] .cb-statistics-insight-metrics--compact .cb-statistics-insight-metric__value {
  font-size:11.5px;
}
[data-toantin-tool="chart_builder"] .cb-statistics-insight-remark {
  padding:3px 5px;
  border-radius:6px;
  outline:none;
}
[data-toantin-tool="chart_builder"] .cb-statistics-insight-remark:hover,
[data-toantin-tool="chart_builder"] .cb-statistics-insight-remark:focus-visible {
  background:#edf5ff;
}
[data-toantin-tool="chart_builder"] [data-stat-evidence-key].is-evidence-highlighted {
  background:#fff2a8 !important;
  box-shadow:inset 0 0 0 2px #e8bb23;
  font-weight:850;
}

/* Teaching: activity and representation are different dimensions. */
[data-toantin-tool="chart_builder"] .cb-teaching-setup {
  padding:10px 12px;
  border-radius:10px;
  box-shadow:none;
}
[data-toantin-tool="chart_builder"] .cb-teaching-activity-label { margin:2px 0 -2px; }
[data-toantin-tool="chart_builder"] .cb-teaching-sample-library {
  gap:5px;
  margin:0;
}
[data-toantin-tool="chart_builder"] .cb-teaching-sample-library__item {
  min-height:38px;
  padding:6px 9px;
}
[data-toantin-tool="chart_builder"] .cb-teaching-representation-section {
  display:grid;
  gap:6px;
  padding-top:7px;
  border-top:1px solid #e3ebf5;
}
[data-toantin-tool="chart_builder"] .cb-teaching-representation-head {
  display:flex;
  min-width:0;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
[data-toantin-tool="chart_builder"] .cb-teaching-representation-head > .cb-panel-hint {
  flex:1 1 auto;
  margin:0;
}
[data-toantin-tool="chart_builder"] .cb-teaching-representation-mode {
  display:flex;
  flex:0 0 auto;
  gap:4px;
}
[data-toantin-tool="chart_builder"] .cb-teaching-representation-rail {
  display:flex;
  min-width:0;
  gap:5px;
  overflow-x:auto;
  padding:2px 1px 5px;
  overscroll-behavior-x:contain;
  scrollbar-width:thin;
}
[data-toantin-tool="chart_builder"] .cb-teaching-representation-button {
  position:relative;
  flex:0 0 auto;
  min-width:102px;
  min-height:42px;
  padding:6px 8px;
  border:1px solid #cdddf0;
  border-radius:9px;
  background:linear-gradient(180deg,#fff,#f1f7ff);
  color:#244b7c;
  font-size:11px;
  font-weight:780;
  box-shadow:0 2px 0 #d9e5f3,0 4px 9px rgba(24,66,121,.06);
}
[data-toantin-tool="chart_builder"] .cb-teaching-representation-button.is-active {
  border-color:#4d8fe8;
  background:#e7f1ff;
  color:#0d5bef;
}
[data-toantin-tool="chart_builder"] .cb-teaching-representation-button.is-disabled {
  color:#8794a6;
  background:#f7f9fc;
  box-shadow:none;
  cursor:not-allowed;
}
[data-toantin-tool="chart_builder"] .cb-teaching-representation-unavailable {
  display:block;
  margin-top:2px;
  font-size:7.5px;
  font-weight:680;
}
[data-toantin-tool="chart_builder"] .cb-teaching-representation-button.is-recommended {
  border-color:#78aaf0;
  background:linear-gradient(180deg,#ffffff,#eaf3ff);
}
[data-toantin-tool="chart_builder"] .cb-teaching-representation-button.is-curriculum-extension {
  border-style:dashed;
  background:linear-gradient(180deg,#ffffff,#f8fbff);
}
[data-toantin-tool="chart_builder"] .cb-teaching-representation-recommended,
[data-toantin-tool="chart_builder"] .cb-teaching-representation-extension {
  display:block;
  margin-top:2px;
  font-size:7.5px;
  font-weight:760;
  line-height:1.15;
}
[data-toantin-tool="chart_builder"] .cb-teaching-representation-recommended { color:#0d5bef; }
[data-toantin-tool="chart_builder"] .cb-teaching-representation-extension { color:#64748b; }

@media (max-width:1199.98px) {
  [data-toantin-tool="chart_builder"] .cb-unified-topbar {
    grid-template-columns:minmax(180px,.8fr) minmax(360px,1.6fr) auto;
  }
  [data-toantin-tool="chart_builder"] .cb-unified-brand__tool { display:none; }
  [data-toantin-tool="chart_builder"] .cb-chart-studio-control-deck { grid-template-columns:1fr; }
}
@media (max-width:767.98px) {
  [data-toantin-tool="chart_builder"] .cb-unified-topbar {
    grid-template-columns:minmax(0,1fr) auto;
    gap:5px;
  }
  [data-toantin-tool="chart_builder"] .cb-unified-topbar__start { grid-column:1; }
  [data-toantin-tool="chart_builder"] .cb-unified-topbar__end { grid-column:2; grid-row:1; }
  [data-toantin-tool="chart_builder"] .cb-domain-nav--unified { grid-column:1 / -1; grid-row:2; width:100%; }
  [data-toantin-tool="chart_builder"] .cb-unified-brand__logo { width:44px; height:30px; }
  [data-toantin-tool="chart_builder"] .cb-unified-document__facts { display:none; }
  [data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-chart .cb-full-chart-host {
    height:auto;
    min-height:440px;
  }
  [data-toantin-tool="chart_builder"] .cb-chart-studio-quick-properties { grid-template-columns:1fr; }
  [data-toantin-tool="chart_builder"] .cb-statistics-compact-workflow {
    align-items:stretch;
    flex-direction:column;
  }
  [data-toantin-tool="chart_builder"] .cb-statistics-compact-workflow__field { flex:auto; width:100%; }
  [data-toantin-tool="chart_builder"] .cb-statistics-compact-workflow__actions .btn { min-height:44px; }
  [data-toantin-tool="chart_builder"] .cb-teaching-representation-head {
    align-items:stretch;
    flex-direction:column;
  }
  [data-toantin-tool="chart_builder"] .cb-teaching-representation-mode { width:100%; }
  [data-toantin-tool="chart_builder"] .cb-teaching-representation-mode .btn { flex:1 1 0; min-height:44px; }
}
@media (max-width:575.98px) {
  [data-toantin-tool="chart_builder"] .cb-domain-shell-header { padding:4px; }
  [data-toantin-tool="chart_builder"] .cb-unified-data-action { display:none; }
  [data-toantin-tool="chart_builder"] .cb-unified-document { border-left:0; padding-left:0; }
  [data-toantin-tool="chart_builder"] .cb-unified-brand { display:none; }
  [data-toantin-tool="chart_builder"] .cb-domain-nav--unified .cb-domain-nav__item { min-height:44px; }
  [data-toantin-tool="chart_builder"] .cb-full-tool:not(.is-statistics-chart-focus):not(.is-statistics-pictogram-focus):not(.is-statistics-teaching-chart-focus) .cb-data-panel { padding:6px; }
  [data-toantin-tool="chart_builder"] .cb-statistics-insight-metrics--compact .cb-statistics-insight-metric { width:100%; justify-content:space-between; }
  [data-toantin-tool="chart_builder"] .cb-teaching-representation-button { min-height:46px; }
}
@media (prefers-reduced-motion:reduce) {
  [data-toantin-tool="chart_builder"] .cb-teaching-representation-button { transition:none; }
}
/* FIX01 containment: horizontal rails scroll inside their own track, never widen the page. */
[data-toantin-tool="chart_builder"] .cb-chart-studio-control-deck,
[data-toantin-tool="chart_builder"] .cb-chart-type-section,
[data-toantin-tool="chart_builder"] .cb-chart-family-rail,
[data-toantin-tool="chart_builder"] .cb-teaching-representation-section,
[data-toantin-tool="chart_builder"] .cb-teaching-representation-rail,
[data-toantin-tool="chart_builder"] .cb-domain-nav--unified {
  min-width:0;
  max-width:100%;
}
[data-toantin-tool="chart_builder"] .cb-chart-family-rail,
[data-toantin-tool="chart_builder"] .cb-teaching-representation-rail,
[data-toantin-tool="chart_builder"] .cb-domain-nav--unified {
  width:100%;
  box-sizing:border-box;
  contain:inline-size;
}
[data-toantin-tool="chart_builder"] .cb-domain-shell,
[data-toantin-tool="chart_builder"] .cb-full-tool:not(.is-statistics-chart-focus):not(.is-statistics-pictogram-focus):not(.is-statistics-teaching-chart-focus) {
  overflow-x:clip;
  overflow-y:visible;
}

/* ========================================================================
   B49-STAT-S9-FIX02 — CHART STUDIO PRIORITY / DE-DUPLICATION
   Primary task order: chart family → contextual quick properties → chart
   → collapsed management. The chart data source is already represented by
   the unified top bar + Data & Statistics workspace, so no duplicate card.
   ======================================================================== */
[data-toantin-tool="chart_builder"] .cb-chart-post-panel {
  display:none;
  min-width:0;
  width:100%;
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-chart .cb-chart-post-panel {
  display:grid;
  gap:6px;
  order:3;
  padding:0 2px 4px;
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-chart .cb-data-panel { order:1; }
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-chart .cb-preview-panel { order:2; }
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-chart .cb-statistics-pictogram-focus-host { order:4; }

/* One compact primary strip: identity + the important chart-family controls. */
[data-toantin-tool="chart_builder"] .cb-chart-studio-primary-strip {
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  align-items:center;
  gap:10px;
  min-width:0;
  padding:5px 6px 7px;
  border-bottom:1px solid #e2ebf6;
  background:#fff;
}
[data-toantin-tool="chart_builder"] .cb-chart-studio-primary-strip__identity {
  display:grid;
  align-content:center;
  gap:1px;
  min-width:155px;
}
[data-toantin-tool="chart_builder"] .cb-chart-studio-primary-strip__title-line {
  display:flex;
  align-items:baseline;
  gap:7px;
  min-width:0;
  white-space:nowrap;
}
[data-toantin-tool="chart_builder"] .cb-chart-studio-primary-strip__title-line .cb-eyebrow,
[data-toantin-tool="chart_builder"] .cb-chart-studio-primary-strip__title-line .cb-panel-title {
  margin:0;
}
[data-toantin-tool="chart_builder"] .cb-chart-studio-primary-strip__title-line .cb-panel-title {
  font-size:15px;
}
[data-toantin-tool="chart_builder"] .cb-chart-studio-primary-strip__hint {
  color:#6b7d96;
  font-size:9.5px;
  font-weight:650;
  line-height:1.2;
  white-space:nowrap;
}
[data-toantin-tool="chart_builder"] .cb-chart-studio-primary-strip .cb-chart-type-section {
  min-width:0;
  padding:0;
  border:0;
  border-radius:0;
  background:transparent;
  box-shadow:none;
}
[data-toantin-tool="chart_builder"] .cb-chart-studio-primary-strip .cb-chart-family-rail {
  gap:7px;
  padding:3px 2px 6px;
}
[data-toantin-tool="chart_builder"] .cb-chart-studio-primary-strip .cb-chart-family-button {
  flex-basis:126px;
  min-height:60px;
  border-color:#bfd5ef;
  background:linear-gradient(180deg,#ffffff 0%,#f2f7ff 100%);
  box-shadow:0 4px 0 #cfdef0,0 7px 14px rgba(24,66,121,.085),inset 0 1px 0 #fff;
}
[data-toantin-tool="chart_builder"] .cb-chart-studio-primary-strip .cb-chart-family-button.is-active {
  border-color:#4b8cff;
  background:linear-gradient(180deg,#f9fcff 0%,#e6f0ff 100%);
  box-shadow:0 4px 0 #9fc0f2,0 8px 16px rgba(13,91,239,.12),inset 0 1px 0 #fff;
}
[data-toantin-tool="chart_builder"] .cb-chart-studio-primary-strip .cb-chart-family-button__copy strong {
  font-size:11.5px;
}
[data-toantin-tool="chart_builder"] .cb-chart-studio-primary-strip .cb-chart-family-button__copy small {
  font-size:8.5px;
}
[data-toantin-tool="chart_builder"] .cb-chart-studio-primary-strip .cb-chart-studio-collapse {
  align-self:start;
  margin-top:4px;
}

/* Quick properties stay directly above the canvas; management is below it. */
[data-toantin-tool="chart_builder"] .cb-chart-studio-quick-properties {
  margin-top:4px;
  padding:5px 7px;
  border:0;
  border-bottom:1px solid #e7eef7;
  border-radius:0;
  background:#fff;
}
[data-toantin-tool="chart_builder"] .cb-chart-studio-quick-properties__head {
  align-self:center;
}
[data-toantin-tool="chart_builder"] .cb-chart-post-panel__item {
  margin:0 !important;
  border:1px solid #dce7f4;
  border-radius:9px;
  background:#fff;
  box-shadow:none !important;
}
[data-toantin-tool="chart_builder"] .cb-chart-post-panel__item > summary {
  min-height:38px;
  padding:7px 10px;
  font-weight:760;
}
[data-toantin-tool="chart_builder"] .cb-chart-post-panel .cb-statistics-chart-page {
  padding:4px 7px 8px;
}
[data-toantin-tool="chart_builder"] .cb-chart-post-panel .cb-statistics-intro {
  display:none;
}

/* Legacy B46/B48 layout pieces remain in source history but are not mounted. */
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-chart .cb-chart-studio-control-deck,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-chart .cb-quick-data-bridge,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-chart .cb-chart-type-section__note {
  display:none !important;
}

[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-chart.is-data-panel-collapsed .cb-data-panel {
  min-height:48px;
  max-height:none !important;
  padding:4px 7px;
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-chart.is-data-panel-collapsed .cb-chart-studio-primary-strip {
  grid-template-columns:minmax(0,1fr) auto;
  padding-bottom:5px;
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-chart.is-data-panel-collapsed .cb-chart-studio-primary-strip__identity {
  min-width:0;
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-chart.is-data-panel-collapsed .cb-chart-studio-primary-strip__hint {
  display:none;
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-chart.is-data-panel-collapsed .cb-chart-post-panel {
  display:none;
}

@media (max-width:1199.98px) {
  [data-toantin-tool="chart_builder"] .cb-chart-studio-primary-strip {
    grid-template-columns:minmax(130px,.26fr) minmax(0,1.74fr) auto;
    gap:7px;
  }
  [data-toantin-tool="chart_builder"] .cb-chart-studio-primary-strip__hint { display:none; }
  [data-toantin-tool="chart_builder"] .cb-chart-studio-primary-strip__identity { min-width:130px; }
}
@media (max-width:767.98px) {
  [data-toantin-tool="chart_builder"] .cb-chart-studio-primary-strip {
    grid-template-columns:minmax(0,1fr) auto;
    gap:4px 6px;
    padding:4px 4px 6px;
  }
  [data-toantin-tool="chart_builder"] .cb-chart-studio-primary-strip__identity {
    grid-column:1;
    min-width:0;
  }
  [data-toantin-tool="chart_builder"] .cb-chart-studio-primary-strip > .cb-chart-type-section {
    grid-column:1 / -1;
    grid-row:2;
  }
  [data-toantin-tool="chart_builder"] .cb-chart-studio-primary-strip .cb-chart-studio-collapse {
    grid-column:2;
    grid-row:1;
    margin-top:0;
  }
  [data-toantin-tool="chart_builder"] .cb-chart-studio-primary-strip .cb-chart-family-button {
    flex-basis:116px;
    min-height:56px;
  }
  [data-toantin-tool="chart_builder"] .cb-chart-post-panel__item > summary {
    min-height:44px;
  }
}
@media (prefers-reduced-motion:reduce) {
  [data-toantin-tool="chart_builder"] .cb-chart-studio-primary-strip .cb-chart-family-button { transition:none; }
}
/* FIX02 collapse recovery: legacy generic rule hides non-heading children; keep the new primary strip visible. */
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-chart.is-data-panel-collapsed .cb-data-panel > .cb-chart-studio-primary-strip {
  display:grid !important;
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-chart.is-data-panel-collapsed .cb-data-panel {
  min-height:52px;
  max-height:60px !important;
  padding:3px 6px;
  overflow:hidden !important;
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-chart.is-data-panel-collapsed .cb-chart-studio-primary-strip {
  min-height:44px;
  padding:2px 4px;
}

/* ========================================================================
   B49-STAT-S9-FIX03 — OWNER UX FEEDBACK BATCH
   1) 8 chart-family buttons own the full primary strip.
   2) Quick chart properties live inside the existing preview toolbar.
   3) Legacy standalone quick-properties panel stays unmounted/hidden.
   ======================================================================== */
[data-toantin-tool="chart_builder"] .cb-chart-studio-primary-strip {
  grid-template-columns:minmax(0,1fr) auto;
  gap:7px;
  padding:4px 5px 7px;
}
[data-toantin-tool="chart_builder"] .cb-chart-studio-primary-strip > .cb-chart-type-section {
  min-width:0;
  width:100%;
}
[data-toantin-tool="chart_builder"] .cb-chart-studio-primary-strip .cb-chart-family-rail {
  width:100%;
  gap:7px;
  padding:3px 1px 6px;
}
[data-toantin-tool="chart_builder"] .cb-chart-studio-primary-strip .cb-chart-studio-collapse {
  align-self:center;
  margin:0;
}
[data-toantin-tool="chart_builder"] .cb-chart-studio-quick-properties {
  display:none !important;
}

/* Contextual quick properties occupy spare space in the existing chart toolbar. */
[data-toantin-tool="chart_builder"] .cb-toolbar-quick-properties {
  display:inline-flex;
  flex:0 0 auto;
  align-items:center;
  gap:5px;
  margin-left:auto;
  padding-left:6px;
  border-left:1px solid #dce7f4;
  white-space:nowrap;
}
[data-toantin-tool="chart_builder"] .cb-toolbar-quick-field {
  display:inline-flex;
  align-items:center;
  gap:4px;
  margin:0;
  color:#536985;
  font-size:10px;
  font-weight:760;
}
[data-toantin-tool="chart_builder"] .cb-toolbar-quick-field__label {
  flex:0 0 auto;
}
[data-toantin-tool="chart_builder"] .cb-toolbar-quick-select {
  width:auto;
  min-width:84px;
  max-width:132px;
  min-height:34px;
  padding-top:3px;
  padding-bottom:3px;
  font-size:11px;
}
[data-toantin-tool="chart_builder"] .cb-toolbar-quick-field:nth-child(2) .cb-toolbar-quick-select {
  min-width:102px;
  max-width:136px;
}
[data-toantin-tool="chart_builder"] .cb-toolbar-quick-number {
  width:58px;
  min-height:34px;
  padding:3px 6px;
  font-size:11px;
}
[data-toantin-tool="chart_builder"] .cb-toolbar-quick-more {
  min-height:34px;
  padding:4px 9px;
  font-size:10.5px;
  font-weight:760;
}

@media (min-width:1200px) {
  [data-toantin-tool="chart_builder"] .cb-chart-studio-primary-strip .cb-chart-family-button {
    flex:1 1 0;
    min-width:104px;
    max-width:none;
  }
}
@media (max-width:1199.98px) {
  [data-toantin-tool="chart_builder"] .cb-chart-studio-primary-strip {
    grid-template-columns:minmax(0,1fr) auto;
  }
  [data-toantin-tool="chart_builder"] .cb-chart-studio-primary-strip .cb-chart-family-button {
    flex:0 0 122px;
  }
  [data-toantin-tool="chart_builder"] .cb-toolbar-quick-properties {
    margin-left:0;
  }
}
@media (max-width:767.98px) {
  [data-toantin-tool="chart_builder"] .cb-chart-studio-primary-strip {
    grid-template-columns:minmax(0,1fr) auto;
    padding:3px 4px 6px;
  }
  [data-toantin-tool="chart_builder"] .cb-chart-studio-primary-strip > .cb-chart-type-section {
    grid-column:1;
    grid-row:1;
  }
  [data-toantin-tool="chart_builder"] .cb-chart-studio-primary-strip .cb-chart-studio-collapse {
    grid-column:2;
    grid-row:1;
  }
  [data-toantin-tool="chart_builder"] .cb-toolbar-quick-properties {
    border-left:0;
    padding-left:0;
  }
  [data-toantin-tool="chart_builder"] .cb-toolbar-quick-field__label {
    display:none;
  }
  [data-toantin-tool="chart_builder"] .cb-toolbar-quick-select {
    min-width:92px;
  }
}

/* ========================================================================
   B49-STAT-S9-FIX04 — DATA LABEL ALIGNMENT / BULK PROPERTIES / SAFE DRAG
   ======================================================================== */
[data-toantin-tool="chart_builder"] .cb-cartesian-label-draggable,
[data-toantin-tool="chart_builder"] .cb-cartesian-label-hit-target,
[data-toantin-tool="chart_builder"] [data-drag-kind="cartesian-label"] {
  cursor:grab;
}
[data-toantin-tool="chart_builder"] .cb-cartesian-label-draggable.cb-object-dragging,
[data-toantin-tool="chart_builder"] .cb-cartesian-label-draggable.cb-object-dragging * {
  cursor:grabbing;
}
[data-toantin-tool="chart_builder"] .cb-cartesian-label-hit-target {
  pointer-events:all;
}
[data-toantin-tool="chart_builder"] .cb-toolbar-label-action {
  min-height:34px;
  padding:4px 8px;
  font-size:10.5px;
  font-weight:760;
  white-space:nowrap;
}
[data-toantin-tool="chart_builder"] .cb-toolbar-quick-field--label-size .cb-toolbar-quick-number {
  width:54px;
}
[data-toantin-tool="chart_builder"] .cb-data-label-drag-guide {
  pointer-events:none;
}
@media (max-width:767.98px) {
  [data-toantin-tool="chart_builder"] .cb-toolbar-label-action {
    min-width:72px;
  }
  [data-toantin-tool="chart_builder"] .cb-toolbar-label-apply-all {
    min-width:78px;
  }
}

/* ========================================================================
   B49-STAT-S9-FIX05 — TEACHING WORKSPACE CONSISTENCY / COMPACT UX
   Owner-approved 2026-10-17. Teaching-facing copy stays pedagogical; architecture
   invariants remain internal. All selectors are scoped to chart_builder.
   ======================================================================== */
[data-toantin-tool="chart_builder"] .cb-teaching-source-chooser {
  padding:0;
  border:0;
  border-radius:0;
  background:transparent;
  box-shadow:none;
}
[data-toantin-tool="chart_builder"] .cb-teaching-source-options {
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:14px;
}
[data-toantin-tool="chart_builder"] .cb-teaching-source-card {
  position:relative;
  display:flex;
  min-height:96px;
  align-items:center;
  gap:14px;
  padding:14px 16px;
  overflow:hidden;
  border:1px solid #c6d9f2;
  border-radius:18px;
  background:linear-gradient(180deg,#ffffff 0%,#f5f9ff 100%);
  color:#123867;
  box-shadow:0 5px 0 #d7e5f6,0 12px 24px rgba(25,72,132,.10),inset 0 1px 0 rgba(255,255,255,.96);
  text-align:left;
}
[data-toantin-tool="chart_builder"] .cb-teaching-source-card:hover,
[data-toantin-tool="chart_builder"] .cb-teaching-source-card:focus-visible {
  border-color:#78aafa;
  background:linear-gradient(180deg,#ffffff 0%,#edf5ff 100%);
  box-shadow:0 6px 0 #bfd5f3,0 16px 30px rgba(21,80,160,.14),inset 0 1px 0 #fff;
  transform:translateY(-2px);
}
[data-toantin-tool="chart_builder"] .cb-teaching-source-card.is-active {
  border-color:#4f91f7;
  background:linear-gradient(180deg,#ffffff 0%,#e8f2ff 100%);
  box-shadow:0 3px 0 #8db8ef,0 12px 24px rgba(13,91,239,.16),inset 0 0 0 1px rgba(255,255,255,.9);
  transform:translateY(1px);
}
[data-toantin-tool="chart_builder"] .cb-teaching-source-card__accent {
  position:relative;
  width:48px;
  height:48px;
  flex:0 0 48px;
  border:1px solid #b9d4f5;
  border-radius:15px;
  background:linear-gradient(145deg,#ffffff,#dcebff);
  box-shadow:0 4px 9px rgba(22,83,160,.12),inset 0 1px 0 #fff;
}
[data-toantin-tool="chart_builder"] .cb-teaching-source-card__accent::before,
[data-toantin-tool="chart_builder"] .cb-teaching-source-card__accent::after {
  content:"";
  position:absolute;
  border-radius:5px;
  background:#2477ef;
}
[data-toantin-tool="chart_builder"] .cb-teaching-source-card__accent--current::before { left:10px; top:13px; width:28px; height:5px; box-shadow:0 9px 0 #60a5fa,0 18px 0 #9cc8fb; }
[data-toantin-tool="chart_builder"] .cb-teaching-source-card__accent--current::after { display:none; }
[data-toantin-tool="chart_builder"] .cb-teaching-source-card__accent--sample::before { left:12px; top:21px; width:24px; height:6px; }
[data-toantin-tool="chart_builder"] .cb-teaching-source-card__accent--sample::after { left:21px; top:12px; width:6px; height:24px; }
[data-toantin-tool="chart_builder"] .cb-teaching-source-card__body { display:grid; min-width:0; flex:1 1 auto; gap:7px; }
[data-toantin-tool="chart_builder"] .cb-teaching-source-card__title { font-size:15px; color:#102a56; }
[data-toantin-tool="chart_builder"] .cb-teaching-source-card__badge {
  border-color:#c4d9f3;
  background:#fff;
  color:#36618f;
  font-size:9px;
}
[data-toantin-tool="chart_builder"] .cb-teaching-source-card__description { font-size:12.5px; color:#5c718c; }

[data-toantin-tool="chart_builder"] .cb-teaching-setup {
  display:grid;
  gap:10px;
  padding:10px;
  border:1px solid #d6e4f5;
  border-radius:14px;
  background:linear-gradient(180deg,#ffffff,#f8fbff);
  box-shadow:0 6px 18px rgba(25,63,112,.06);
}
[data-toantin-tool="chart_builder"] .cb-teaching-setup-bar {
  display:grid;
  grid-template-columns:minmax(118px,.58fr) minmax(260px,1.65fr) minmax(255px,auto) auto;
  align-items:end;
  gap:8px;
  min-width:0;
}
[data-toantin-tool="chart_builder"] .cb-teaching-setup-field { min-width:0; margin:0; }
[data-toantin-tool="chart_builder"] .cb-teaching-setup-field .form-select { min-height:38px; border-radius:9px; }
[data-toantin-tool="chart_builder"] .cb-teaching-setup-field--difficulty { display:grid; gap:4px; }
[data-toantin-tool="chart_builder"] .cb-teaching-setup-actions {
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:6px;
  margin:0;
  white-space:nowrap;
}
[data-toantin-tool="chart_builder"] .cb-teaching-setup-actions .btn { min-height:38px; border-radius:9px; font-weight:780; }
[data-toantin-tool="chart_builder"] .cb-teaching-generate-primary {
  box-shadow:0 3px 0 #0b4fcf,0 7px 14px rgba(13,91,239,.18);
}
[data-toantin-tool="chart_builder"] .cb-teaching-repeat-sample { background:#fff; }
[data-toantin-tool="chart_builder"] .cb-teaching-difficulty {
  width:100%;
  min-height:38px;
  padding:3px;
  border-radius:10px;
  background:#f3f7fd;
}
[data-toantin-tool="chart_builder"] .cb-teaching-difficulty-chip {
  flex:1 1 0;
  min-width:0;
  min-height:30px;
  padding:5px 9px;
  border-radius:7px;
}

[data-toantin-tool="chart_builder"] .cb-teaching-activity-block { display:grid; gap:5px; min-width:0; }
[data-toantin-tool="chart_builder"] .cb-teaching-activity-label { margin:0; }
[data-toantin-tool="chart_builder"] .cb-teaching-activity-rail {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:7px;
  min-width:0;
}
[data-toantin-tool="chart_builder"] .cb-teaching-activity-button {
  min-height:42px;
  padding:7px 10px;
  border:1px solid #cbdcf1;
  border-radius:11px;
  background:linear-gradient(180deg,#fff,#f2f7ff);
  color:#244b7c;
  font-size:12px;
  font-weight:780;
  box-shadow:0 3px 0 #dae6f4,0 7px 13px rgba(24,66,121,.07);
  transition:transform .14s ease,box-shadow .14s ease,border-color .14s ease,background .14s ease;
}
[data-toantin-tool="chart_builder"] .cb-teaching-activity-button:hover,
[data-toantin-tool="chart_builder"] .cb-teaching-activity-button:focus-visible {
  border-color:#78aaf0;
  background:#eef5ff;
  transform:translateY(-1px);
}
[data-toantin-tool="chart_builder"] .cb-teaching-activity-button.is-active {
  border-color:#4b8dea;
  background:linear-gradient(180deg,#f8fbff,#dfedff);
  color:#0d5bef;
  box-shadow:0 2px 0 #9cc1ef,0 7px 14px rgba(13,91,239,.12);
  transform:translateY(1px);
}
[data-toantin-tool="chart_builder"] .cb-teaching-activity-description {
  min-height:18px;
  color:#657991;
  font-size:11.5px;
  line-height:1.4;
}

[data-toantin-tool="chart_builder"] .cb-teaching-representation-section {
  display:grid;
  gap:7px;
  padding-top:8px;
  border-top:1px solid #e1eaf5;
}
[data-toantin-tool="chart_builder"] .cb-teaching-representation-rail {
  display:grid;
  grid-template-columns:repeat(9,minmax(0,1fr));
  gap:6px;
  width:100%;
  overflow:visible;
  padding:1px 0 4px;
  contain:none;
}
[data-toantin-tool="chart_builder"] .cb-teaching-representation-button {
  position:relative;
  min-width:0;
  min-height:52px;
  padding:7px 5px 6px;
  border:1px solid #c9dbf0;
  border-radius:11px;
  background:linear-gradient(180deg,#ffffff 0%,#edf5ff 100%);
  color:#214b7d;
  font-size:11.5px;
  font-weight:800;
  line-height:1.15;
  box-shadow:0 3px 0 #d6e5f5,0 7px 13px rgba(20,69,132,.08),inset 0 1px 0 #fff;
  transition:transform .14s ease,box-shadow .14s ease,border-color .14s ease,background .14s ease;
}
[data-toantin-tool="chart_builder"] .cb-teaching-representation-button:hover:not(.is-disabled),
[data-toantin-tool="chart_builder"] .cb-teaching-representation-button:focus-visible:not(.is-disabled) {
  border-color:#77aaf0;
  background:linear-gradient(180deg,#fff,#e7f1ff);
  transform:translateY(-1px);
  box-shadow:0 4px 0 #bfd7f4,0 10px 17px rgba(22,77,147,.11);
}
[data-toantin-tool="chart_builder"] .cb-teaching-representation-button.is-active {
  border-color:#2477ef;
  background:linear-gradient(180deg,#f7fbff,#dcecff);
  color:#0d5bef;
  box-shadow:0 2px 0 #8db8ee,0 8px 15px rgba(13,91,239,.14),inset 0 1px 0 #fff;
  transform:translateY(1px);
}
[data-toantin-tool="chart_builder"] .cb-teaching-representation-button.is-caution { border-color:#e0b75b; background:linear-gradient(180deg,#fffef9,#fff8e6); }
[data-toantin-tool="chart_builder"] .cb-teaching-representation-button.is-disabled {
  color:#8b97a6;
  border-color:#e0e6ee;
  background:#f7f9fc;
  box-shadow:0 2px 0 #e7ebf0;
  cursor:not-allowed;
}
[data-toantin-tool="chart_builder"] .cb-teaching-representation-status,
[data-toantin-tool="chart_builder"] .cb-teaching-representation-unavailable {
  display:block;
  margin-top:4px;
  font-size:8px;
  font-weight:760;
  line-height:1.1;
}
[data-toantin-tool="chart_builder"] .cb-teaching-representation-status--preferred { color:#0d5bef; }
[data-toantin-tool="chart_builder"] .cb-teaching-representation-status--suitable { color:#16815a; }
[data-toantin-tool="chart_builder"] .cb-teaching-representation-status--caution { color:#9a6600; }
[data-toantin-tool="chart_builder"] .cb-teaching-representation-unavailable { color:#8a96a6; }
[data-toantin-tool="chart_builder"] .cb-teaching-representation-guidance {
  display:grid;
  gap:8px;
  padding:11px 12px;
  border:1px solid #eccb7c;
  border-radius:12px;
  background:#fffaf0;
  color:#5f4509;
}
[data-toantin-tool="chart_builder"] .cb-teaching-representation-guidance__title { font-size:13px; font-weight:850; color:#6f4a00; }
[data-toantin-tool="chart_builder"] .cb-teaching-representation-guidance__reasons { display:grid; gap:4px; margin:0; padding-left:1.25rem; font-size:12px; line-height:1.45; }
[data-toantin-tool="chart_builder"] .cb-teaching-representation-guidance__suggestion { padding:8px 10px; border-left:3px solid #2477ef; border-radius:7px; background:#f4f8ff; color:#23476f; font-size:12px; line-height:1.45; }
[data-toantin-tool="chart_builder"] .cb-teaching-representation-guidance__actions { margin:0; gap:6px; }

[data-toantin-tool="chart_builder"] .cb-teaching-sample-evidence-layout {
  display:grid;
  grid-template-columns:minmax(0,1.2fr) minmax(290px,.8fr);
  gap:12px;
  align-items:start;
}
[data-toantin-tool="chart_builder"] .cb-teaching-sample-evidence-pane,
[data-toantin-tool="chart_builder"] .cb-teaching-sample-remarks-pane {
  min-width:0;
  padding:10px;
  border:1px solid #dce7f5;
  border-radius:12px;
  background:#fff;
}
[data-toantin-tool="chart_builder"] .cb-teaching-sample-evidence-pane__title { margin-bottom:7px; color:#17345f; font-size:12px; font-weight:820; }
[data-toantin-tool="chart_builder"] .cb-teaching-sample-evidence-pane .cb-teaching-sample-table-wrap { width:auto; max-width:100%; overflow:auto; }
[data-toantin-tool="chart_builder"] .cb-teaching-sample-evidence-pane .cb-teaching-sample-table { width:auto; min-width:min(100%,520px); margin:0; }
[data-toantin-tool="chart_builder"] .cb-teaching-sample-remarks-pane__head { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:7px; }
[data-toantin-tool="chart_builder"] .cb-teaching-reference-remarks--compact { margin-top:8px; padding:9px 10px; }
[data-toantin-tool="chart_builder"] .cb-teaching-reference-remarks--compact .cb-teaching-reference-remarks__list { gap:5px; font-size:12px; }

[data-toantin-tool="chart_builder"] .cb-statistics-focus-quickbar {
  display:flex;
  align-items:center;
  gap:6px;
  min-width:0;
  padding:6px 10px;
  border-bottom:1px solid #dce7f5;
  background:#f8fbff;
  overflow-x:auto;
  scrollbar-width:thin;
}
[data-toantin-tool="chart_builder"] .cb-teaching-focus-quickbar__label { flex:0 0 auto; color:#315271; font-size:11px; font-weight:850; }
[data-toantin-tool="chart_builder"] .cb-teaching-focus-quick-btn { flex:0 0 auto; min-height:34px; border-radius:8px; }
[data-toantin-tool="chart_builder"] .cb-teaching-focus-font-value { min-width:42px; color:#52677f; font-size:11px; font-weight:750; text-align:center; }
[data-toantin-tool="chart_builder"] .cb-teaching-focus-quick-field { display:flex; align-items:center; gap:6px; color:#315271; font-size:11px; font-weight:750; }
[data-toantin-tool="chart_builder"] .cb-teaching-focus-quick-field .form-control { width:72px; min-height:34px; }

@media (max-width:1199.98px) {
  [data-toantin-tool="chart_builder"] .cb-teaching-setup-bar { grid-template-columns:minmax(110px,.6fr) minmax(240px,1.4fr) minmax(240px,1fr); }
  [data-toantin-tool="chart_builder"] .cb-teaching-setup-actions { grid-column:1 / -1; justify-content:flex-end; }
  [data-toantin-tool="chart_builder"] .cb-teaching-representation-rail { display:flex; overflow-x:auto; contain:inline-size; }
  [data-toantin-tool="chart_builder"] .cb-teaching-representation-button { flex:1 0 118px; }
}
@media (max-width:767.98px) {
  [data-toantin-tool="chart_builder"] .cb-teaching-source-options { grid-template-columns:1fr; }
  [data-toantin-tool="chart_builder"] .cb-teaching-setup-bar { grid-template-columns:1fr 1fr; align-items:stretch; }
  [data-toantin-tool="chart_builder"] .cb-teaching-setup-field--lesson { grid-column:1 / -1; }
  [data-toantin-tool="chart_builder"] .cb-teaching-setup-field--difficulty { grid-column:1 / -1; }
  [data-toantin-tool="chart_builder"] .cb-teaching-setup-actions { grid-column:1 / -1; }
  [data-toantin-tool="chart_builder"] .cb-teaching-activity-rail { grid-template-columns:repeat(2,minmax(0,1fr)); }
  [data-toantin-tool="chart_builder"] .cb-teaching-sample-evidence-layout { grid-template-columns:1fr; }
}
@media (max-width:575.98px) {
  [data-toantin-tool="chart_builder"] .cb-teaching-source-card { min-height:88px; padding:12px; }
  [data-toantin-tool="chart_builder"] .cb-teaching-source-card__accent { width:42px; height:42px; flex-basis:42px; }
  [data-toantin-tool="chart_builder"] .cb-teaching-setup-bar { grid-template-columns:1fr; }
  [data-toantin-tool="chart_builder"] .cb-teaching-setup-field--lesson,
  [data-toantin-tool="chart_builder"] .cb-teaching-setup-field--difficulty,
  [data-toantin-tool="chart_builder"] .cb-teaching-setup-actions { grid-column:auto; }
  [data-toantin-tool="chart_builder"] .cb-teaching-setup-actions { align-items:stretch; flex-direction:column; }
  [data-toantin-tool="chart_builder"] .cb-teaching-setup-actions .btn { width:100%; min-height:44px; }
  [data-toantin-tool="chart_builder"] .cb-teaching-activity-rail { grid-template-columns:1fr; }
  [data-toantin-tool="chart_builder"] .cb-teaching-representation-button { flex-basis:108px; min-height:54px; }
  [data-toantin-tool="chart_builder"] .cb-teaching-representation-guidance__actions { align-items:stretch; flex-direction:column; }
  [data-toantin-tool="chart_builder"] .cb-teaching-representation-guidance__actions .btn { width:100%; min-height:44px; }
}
@media (prefers-reduced-motion:reduce) {
  [data-toantin-tool="chart_builder"] .cb-teaching-source-card,
  [data-toantin-tool="chart_builder"] .cb-teaching-activity-button,
  [data-toantin-tool="chart_builder"] .cb-teaching-representation-button { transition:none; }
}
/* FIX05 Teaching Focus adds a quick-properties row between header and chart body. */
[data-toantin-tool="chart_builder"] .cb-statistics-teaching-chart-focus {
  grid-template-rows:auto auto minmax(0,1fr);
}
[data-toantin-tool="chart_builder"] .cb-statistics-teaching-chart-focus .cb-statistics-focus-quickbar {
  position:relative;
  z-index:1;
}

/* ========================================================================== 
   B49 FIX06 — LCD-first typography / compact data evidence / Excel import
   All selectors remain strictly scoped to chart_builder.
   ========================================================================== */
[data-toantin-tool="chart_builder"] .cb-full-tool {
  font-size:16px;
  line-height:1.48;
}
[data-toantin-tool="chart_builder"] .cb-domain-nav__item,
[data-toantin-tool="chart_builder"] .cb-statistics-section-tab,
[data-toantin-tool="chart_builder"] .cb-data-workspace-tab { font-size:15px; min-height:42px; }
[data-toantin-tool="chart_builder"] .cb-panel-title { font-size:22px; line-height:1.25; }
[data-toantin-tool="chart_builder"] .cb-section-title { font-size:17px; line-height:1.3; }
[data-toantin-tool="chart_builder"] .cb-full-tool .cb-panel-hint { font-size:max(15px, calc(12px * var(--cb-statistics-font-scale,1))); line-height:1.5; }
[data-toantin-tool="chart_builder"] .cb-full-tool .form-control,
[data-toantin-tool="chart_builder"] .cb-full-tool .form-select { font-size:16px; min-height:42px; }
[data-toantin-tool="chart_builder"] .cb-full-tool .btn:not(.cb-preview-icon-button):not(.cb-grid-delete) { font-size:15.5px; min-height:40px; }
[data-toantin-tool="chart_builder"] .cb-data-grid,
[data-toantin-tool="chart_builder"] .cb-teaching-sample-table,
[data-toantin-tool="chart_builder"] .cb-teaching-data-table { font-size:17px; line-height:1.42; }
[data-toantin-tool="chart_builder"] .cb-data-grid th,
[data-toantin-tool="chart_builder"] .cb-data-grid td,
[data-toantin-tool="chart_builder"] .cb-teaching-sample-table th,
[data-toantin-tool="chart_builder"] .cb-teaching-sample-table td { padding:9px 12px; }
[data-toantin-tool="chart_builder"] .cb-teaching-representation-button { font-size:15px; min-height:64px; }
[data-toantin-tool="chart_builder"] .cb-teaching-representation-status,
[data-toantin-tool="chart_builder"] .cb-teaching-representation-unavailable { font-size:12px; line-height:1.2; }
[data-toantin-tool="chart_builder"] .cb-teaching-representation-guidance__title { font-size:17px; }
[data-toantin-tool="chart_builder"] .cb-teaching-representation-guidance__reasons,
[data-toantin-tool="chart_builder"] .cb-teaching-representation-guidance__suggestion { font-size:15px; }

/* One compact investigation row: Dấu hiệu ≈ 1/3, four fields share the remainder. */
[data-toantin-tool="chart_builder"] .cb-investigation-compact-card { display:grid; gap:10px; }
[data-toantin-tool="chart_builder"] .cb-investigation-compact-grid {
  display:grid;
  grid-template-columns:minmax(260px,2.2fr) minmax(120px,.8fr) minmax(170px,1fr) minmax(120px,.8fr) minmax(220px,1.7fr);
  gap:10px;
  align-items:end;
}
[data-toantin-tool="chart_builder"] .cb-investigation-field { min-width:0; }
[data-toantin-tool="chart_builder"] .cb-investigation-notes { border-top:1px solid #e6edf7; padding-top:7px; }
[data-toantin-tool="chart_builder"] .cb-investigation-notes__summary { cursor:pointer; color:#45617f; font-size:15px; font-weight:750; }
[data-toantin-tool="chart_builder"] .cb-investigation-notes .cb-statistics-notes { margin-top:8px; min-height:74px; }

/* Raw table + consistency evidence in one compact workbench. */
[data-toantin-tool="chart_builder"] .cb-statistics-raw-workbench {
  display:grid;
  grid-template-columns:minmax(0,3fr) minmax(250px,1fr);
  gap:12px;
  align-items:start;
}
[data-toantin-tool="chart_builder"] .cb-statistics-raw-pane { min-width:0; display:grid; gap:9px; }
[data-toantin-tool="chart_builder"] .cb-statistics-raw-hint { margin:0; }
[data-toantin-tool="chart_builder"] .cb-statistics-raw-grid { padding:0; border:0; background:transparent; }
[data-toantin-tool="chart_builder"] .cb-statistics-raw-grid .cb-data-grid-scroll {
  max-height:clamp(300px,42vh,460px);
  overflow:auto;
  border:1px solid #dce7f5;
  border-radius:10px;
}
[data-toantin-tool="chart_builder"] .cb-statistics-raw-grid .cb-data-grid thead { position:sticky; top:0; z-index:1; }
[data-toantin-tool="chart_builder"] .cb-statistics-consistency--compact {
  min-width:0;
  padding:12px;
  border:1px solid #dce7f5;
  border-left:4px solid #14b87a;
  border-radius:12px;
  background:#fbfefd;
}
[data-toantin-tool="chart_builder"] .cb-statistics-consistency--compact.has-issues { border-left-color:#f0ad25; background:#fffdf7; }
[data-toantin-tool="chart_builder"] .cb-statistics-consistency--compact .cb-statistics-card__title { font-size:18px; }
[data-toantin-tool="chart_builder"] .cb-statistics-consistency--compact .cb-consistency-list { max-height:320px; overflow:auto; }

/* Excel import. */
[data-toantin-tool="chart_builder"] .cb-xlsx-sheet-field { margin-top:4px; }
[data-toantin-tool="chart_builder"] .cb-statistics-import-actions { align-items:center; }
[data-toantin-tool="chart_builder"] .cb-xlsx-template-download { text-decoration:none; }
[data-toantin-tool="chart_builder"] .cb-xlsx-template-help { margin-top:8px; padding:8px 10px; border:1px solid #dce7f5; border-radius:10px; background:#f8fbff; }
[data-toantin-tool="chart_builder"] .cb-xlsx-template-help__summary { cursor:pointer; color:#17477d; font-size:15px; font-weight:800; }

/* Teaching evidence: for simple 2-column samples the table is evidence, not the whole page. */
[data-toantin-tool="chart_builder"] .cb-teaching-sample-evidence-layout.is-compact-table {
  grid-template-columns:minmax(250px,1fr) minmax(0,3fr);
}
[data-toantin-tool="chart_builder"] .cb-teaching-sample-evidence-layout.is-medium-table {
  grid-template-columns:minmax(360px,1.4fr) minmax(0,2.6fr);
}
[data-toantin-tool="chart_builder"] .cb-teaching-sample-evidence-layout.is-wide-table {
  grid-template-columns:minmax(0,1.6fr) minmax(340px,1.4fr);
}
[data-toantin-tool="chart_builder"] .cb-teaching-sample-evidence-pane__title { font-size:17px; }
[data-toantin-tool="chart_builder"] .cb-teaching-sample-evidence-pane .cb-teaching-sample-table { width:100%; min-width:0; }
[data-toantin-tool="chart_builder"] .cb-teaching-sample-remarks-pane__head strong,
[data-toantin-tool="chart_builder"] .cb-teaching-observation-panel .cb-statistics-card__title { font-size:22px; color:#102a56; }
[data-toantin-tool="chart_builder"] .cb-teaching-observation-questions {
  display:grid;
  gap:9px;
  margin:12px 0 0;
  padding-left:1.5rem;
  color:#203a58;
  font-size:18px;
  line-height:1.5;
}
[data-toantin-tool="chart_builder"] .cb-teaching-reference-remarks { margin-top:13px; padding:13px 15px; }
[data-toantin-tool="chart_builder"] .cb-teaching-reference-remarks__title { font-size:18px; }
[data-toantin-tool="chart_builder"] .cb-teaching-reference-remarks__list,
[data-toantin-tool="chart_builder"] .cb-teaching-reference-remarks--compact .cb-teaching-reference-remarks__list { font-size:17px; line-height:1.5; gap:7px; }
[data-toantin-tool="chart_builder"] .cb-teaching-observation-stage-notice { padding:11px 14px; }
[data-toantin-tool="chart_builder"] .cb-teaching-observation-stage-notice .cb-teaching-conclusion-prompt { margin:0; font-size:16px; }

@media (max-width:1199.98px) {
  [data-toantin-tool="chart_builder"] .cb-investigation-compact-grid { grid-template-columns:minmax(240px,2fr) repeat(2,minmax(150px,1fr)); }
  [data-toantin-tool="chart_builder"] .cb-investigation-field--source { grid-column:2 / -1; }
  [data-toantin-tool="chart_builder"] .cb-statistics-raw-workbench { grid-template-columns:minmax(0,2fr) minmax(250px,1fr); }
}
@media (max-width:991.98px) {
  [data-toantin-tool="chart_builder"] .cb-statistics-raw-workbench { grid-template-columns:1fr; }
  [data-toantin-tool="chart_builder"] .cb-statistics-consistency--compact .cb-consistency-list { max-height:none; }
  [data-toantin-tool="chart_builder"] .cb-teaching-sample-evidence-layout.is-compact-table,
  [data-toantin-tool="chart_builder"] .cb-teaching-sample-evidence-layout.is-medium-table,
  [data-toantin-tool="chart_builder"] .cb-teaching-sample-evidence-layout.is-wide-table { grid-template-columns:1fr; }
}
@media (max-width:767.98px) {
  [data-toantin-tool="chart_builder"] .cb-full-tool { font-size:15px; }
  [data-toantin-tool="chart_builder"] .cb-full-tool .form-control,
  [data-toantin-tool="chart_builder"] .cb-full-tool .form-select { font-size:16px; }
  [data-toantin-tool="chart_builder"] .cb-investigation-compact-grid { grid-template-columns:1fr 1fr; }
  [data-toantin-tool="chart_builder"] .cb-investigation-field--variable,
  [data-toantin-tool="chart_builder"] .cb-investigation-field--source { grid-column:1 / -1; }
  [data-toantin-tool="chart_builder"] .cb-teaching-observation-questions { font-size:16px; }
  [data-toantin-tool="chart_builder"] .cb-data-grid,
  [data-toantin-tool="chart_builder"] .cb-teaching-sample-table,
  [data-toantin-tool="chart_builder"] .cb-teaching-data-table { font-size:16px; }
}
@media (max-width:575.98px) {
  [data-toantin-tool="chart_builder"] .cb-investigation-compact-grid { grid-template-columns:1fr; }
  [data-toantin-tool="chart_builder"] .cb-investigation-field--variable,
  [data-toantin-tool="chart_builder"] .cb-investigation-field--source { grid-column:auto; }
}

/* ========================================================================== 
   B49 FIX07 — Semantic LCD typography / sticky Chart toolbar / unified Focus
   Owner goal: enlarge classroom-facing evidence, not teacher chrome; every
   chart Focus path must reuse the same Preview Smart Toolbar + properties.
   ========================================================================== */

/* Header/navigation is always classroom-readable, independent of A-/A+. */
[data-toantin-tool="chart_builder"] .cb-domain-shell-header {
  padding:7px 9px;
}
[data-toantin-tool="chart_builder"] .cb-unified-brand__logo {
  width:62px;
  height:40px;
}
[data-toantin-tool="chart_builder"] .cb-unified-brand__tool {
  font-size:22px;
  line-height:1.15;
}
[data-toantin-tool="chart_builder"] .cb-unified-document__title {
  font-size:17px;
  line-height:1.25;
}
[data-toantin-tool="chart_builder"] .cb-unified-document__facts {
  font-size:14px;
  line-height:1.3;
}
[data-toantin-tool="chart_builder"] .cb-domain-nav--unified .cb-domain-nav__item {
  min-height:42px;
  padding:8px 12px;
  font-size:16px;
  font-weight:760;
}
[data-toantin-tool="chart_builder"] .cb-unified-data-action,
[data-toantin-tool="chart_builder"] .cb-unified-home-action {
  min-height:42px;
  padding-inline:13px;
  font-size:16px;
}

/* A-/A+ in Teaching is semantic: teacher setup/chrome stays compact. */
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-teaching .cb-statistics-workspace-heading,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-teaching .cb-statistics-workspace-heading__actions,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-teaching .cb-statistics-font-controls,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-teaching .cb-statistics-projector-toggle,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-teaching .cb-teaching-source-card,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-teaching .cb-teaching-setup,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-teaching .cb-teaching-setup-bar,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-teaching .cb-teaching-activity-button,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-teaching .cb-teaching-representation-button {
  font-size:16px;
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-teaching .cb-teaching-source-card__title,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-teaching .cb-teaching-setup-field,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-teaching .cb-teaching-setup-field label,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-teaching .cb-teaching-setup-field .form-select,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-teaching .cb-teaching-setup-actions .btn,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-teaching .cb-teaching-activity-button,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-teaching .cb-teaching-representation-button {
  font-size:16px;
  line-height:1.3;
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-teaching .cb-teaching-source-card__description,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-teaching .cb-teaching-source-card__badge,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-teaching .cb-teaching-representation-status,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-teaching .cb-teaching-representation-unavailable {
  font-size:13px;
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-teaching .cb-statistics-font-button,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-teaching .cb-statistics-font-value,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-teaching .cb-statistics-projector-toggle {
  min-height:38px;
  font-size:15px;
}

/* Classroom/student-facing typography scales strongly but remains bounded. */
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-teaching .cb-teaching-current-source__title,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-teaching .cb-teaching-sample-evidence-pane__title,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-teaching .cb-teaching-current-stage__title,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-teaching .cb-teaching-stage-card .cb-statistics-card__title,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-teaching .cb-teaching-observation-panel .cb-statistics-card__title,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-teaching .cb-teaching-sample-remarks-pane__head strong,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-teaching .cb-teaching-reference-remarks__title {
  font-size:clamp(22px, calc(20px * var(--cb-statistics-font-scale,1)), 40px);
  line-height:1.25;
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-teaching .cb-teaching-sample-table,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-teaching .cb-teaching-data-table,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-teaching .cb-teaching-horizontal-table {
  font-size:clamp(20px, calc(18px * var(--cb-statistics-font-scale,1)), 40px);
  line-height:1.45;
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-teaching .cb-teaching-sample-table th,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-teaching .cb-teaching-sample-table td,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-teaching .cb-teaching-data-table th,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-teaching .cb-teaching-data-table td,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-teaching .cb-teaching-horizontal-table th,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-teaching .cb-teaching-horizontal-table td {
  padding:clamp(10px, calc(8px * var(--cb-statistics-font-scale,1)), 20px) clamp(12px, calc(10px * var(--cb-statistics-font-scale,1)), 24px);
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-teaching .cb-teaching-observation-questions,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-teaching .cb-teaching-reference-remarks__list,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-teaching .cb-teaching-reference-remarks--compact .cb-teaching-reference-remarks__list,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-teaching .cb-teaching-conclusion-prompt {
  font-size:clamp(20px, calc(18px * var(--cb-statistics-font-scale,1)), 42px);
  line-height:1.55;
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-teaching .cb-teaching-observation-panel > .cb-panel-hint,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-teaching .cb-teaching-stage-card > .cb-panel-hint,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-teaching .cb-teaching-observation-stage-notice .cb-teaching-conclusion-prompt {
  font-size:clamp(18px, calc(16px * var(--cb-statistics-font-scale,1)), 36px);
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-teaching .cb-teaching-representation-guidance__title {
  font-size:clamp(20px, calc(18px * var(--cb-statistics-font-scale,1)), 36px);
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-teaching .cb-teaching-representation-guidance__reasons,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-teaching .cb-teaching-representation-guidance__suggestion {
  font-size:clamp(18px, calc(16px * var(--cb-statistics-font-scale,1)), 34px);
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-teaching .cb-teaching-remarks-toggle,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-teaching .cb-teaching-chart-fullscreen,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-teaching .cb-teaching-reveal-tab {
  font-size:16px;
}

/* LCD is a semantic presentation preset: student-facing content gets extra prominence. */
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-teaching.is-statistics-projector .cb-teaching-observation-questions,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-teaching.is-statistics-projector .cb-teaching-reference-remarks__list,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-teaching.is-statistics-projector .cb-teaching-sample-table,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-teaching.is-statistics-projector .cb-teaching-data-table {
  letter-spacing:.005em;
}

/* Chart Studio toolbar follows scrolling but stays within Tool/document flow. */
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-chart:not(.is-preview-fullscreen-active):not(.is-statistics-chart-focus) .cb-preview-chrome {
  position:sticky;
  top:var(--cb-preview-sticky-top, 0px);
  z-index:18;
  background:rgba(255,255,255,.98);
  box-shadow:0 8px 20px rgba(15,31,75,.08);
  backdrop-filter:blur(8px);
}

/* In every statistics/Teaching chart Focus, restore the full canonical toolbar. */
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-chart-focus .cb-preview-panel.is-preview-fullscreen-active .cb-preview-chrome {
  grid-template-columns:minmax(0,1fr);
  gap:5px;
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-chart-focus .cb-preview-panel.is-preview-fullscreen-active .cb-preview-object-navigator-host,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-chart-focus .cb-preview-panel.is-preview-fullscreen-active .cb-chart-display-mode,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-chart-focus .cb-preview-panel.is-preview-fullscreen-active .cb-chart-move-controls,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-chart-focus .cb-preview-panel.is-preview-fullscreen-active .cb-view-zoom,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-chart-focus .cb-preview-panel.is-preview-fullscreen-active .cb-toolbar-quick-properties,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-chart-focus .cb-preview-panel.is-preview-fullscreen-active .cb-contextual-editor {
  display:flex;
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-chart-focus .cb-preview-panel.is-preview-fullscreen-active .cb-contextual-editor {
  width:100%;
  max-height:min(30vh,300px);
  overflow:auto;
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-chart-focus .cb-preview-panel.is-preview-fullscreen-active .cb-preview-height-controls {
  display:none;
}

@media (max-width:991.98px) {
  [data-toantin-tool="chart_builder"] .cb-unified-topbar {
    grid-template-columns:minmax(190px,auto) minmax(300px,1fr) auto;
  }
  [data-toantin-tool="chart_builder"] .cb-unified-brand__tool { font-size:20px; }
  [data-toantin-tool="chart_builder"] .cb-domain-nav--unified .cb-domain-nav__item { font-size:15px; padding-inline:10px; }
}
@media (max-width:767.98px) {
  [data-toantin-tool="chart_builder"] .cb-unified-brand__tool { font-size:19px; }
  [data-toantin-tool="chart_builder"] .cb-unified-document__title { font-size:15px; }
  [data-toantin-tool="chart_builder"] .cb-unified-document__facts { font-size:13px; }
  [data-toantin-tool="chart_builder"] .cb-domain-nav--unified .cb-domain-nav__item { font-size:15px; }
  [data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-teaching .cb-teaching-observation-questions,
  [data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-teaching .cb-teaching-reference-remarks__list,
  [data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-teaching .cb-teaching-sample-table,
  [data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-teaching .cb-teaching-data-table,
  [data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-teaching .cb-teaching-horizontal-table {
    font-size:clamp(18px, calc(16px * var(--cb-statistics-font-scale,1)), 30px);
  }
}
@media (prefers-reduced-motion:reduce) {
  [data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-chart .cb-preview-chrome { scroll-behavior:auto; }
}
/* FIX07 correction: ContextualEditor keeps its canonical block/grid internals. */
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-chart-focus .cb-preview-panel.is-preview-fullscreen-active .cb-contextual-editor {
  display:block;
}
/* FIX07: domain pages normally hide Preview, but canonical Focus must override that rule. */
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-chart-focus .cb-preview-panel.is-preview-fullscreen-active {
  display:flex !important;
  visibility:visible !important;
  pointer-events:auto;
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-chart-focus .cb-preview-panel.is-preview-fullscreen-active .cb-full-chart-host,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-chart-focus .cb-preview-panel.is-preview-fullscreen-active .cb-full-chart-host .cb-surface,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-statistics-chart-focus .cb-preview-panel.is-preview-fullscreen-active .cb-full-chart-host .cb-chart-shell {
  width:100%;
  min-height:0;
}

/* B49 FIX08 — primary data-entry rail + editable random sample builder. */
[data-toantin-tool="chart_builder"] .cb-raw-mode-tabs--primary {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:10px;
  overflow:visible;
  margin:10px 0 14px;
  padding:0;
}
[data-toantin-tool="chart_builder"] .cb-raw-mode-tab--3d {
  width:100%;
  min-height:48px;
  padding:10px 12px;
  border:1px solid #cfe0f5;
  border-radius:13px;
  background:linear-gradient(180deg,#ffffff 0%,#f4f8ff 100%);
  color:#24466f;
  font-size:16px;
  font-weight:800;
  box-shadow:0 5px 0 #dbe8f7,0 9px 18px rgba(45,91,150,.10);
  transition:transform .14s ease,box-shadow .14s ease,border-color .14s ease,background .14s ease,color .14s ease;
}
[data-toantin-tool="chart_builder"] .cb-raw-mode-tab--3d:hover,
[data-toantin-tool="chart_builder"] .cb-raw-mode-tab--3d:focus-visible {
  transform:translateY(-1px);
  border-color:#8bb9f8;
  color:#0d5bef;
  box-shadow:0 6px 0 #cfe0f5,0 12px 22px rgba(45,91,150,.14);
}
[data-toantin-tool="chart_builder"] .cb-raw-mode-tab--3d:active {
  transform:translateY(3px);
  box-shadow:0 2px 0 #cfe0f5,0 5px 12px rgba(45,91,150,.10);
}
[data-toantin-tool="chart_builder"] .cb-raw-mode-tab--3d.is-active {
  border-color:#3b82f6;
  background:linear-gradient(180deg,#eff6ff 0%,#deecff 100%);
  color:#0b56df;
  box-shadow:0 5px 0 #a9c9f6,0 10px 22px rgba(13,91,239,.18),inset 0 0 0 1px rgba(255,255,255,.9);
}
[data-toantin-tool="chart_builder"] .cb-data-sample-builder { gap:12px; }
[data-toantin-tool="chart_builder"] .cb-data-sample-controls {
  display:grid;
  grid-template-columns:auto minmax(120px,170px) minmax(190px,260px);
  gap:12px;
  align-items:end;
  padding:12px;
  border:1px solid #d8e5f5;
  border-radius:14px;
  background:#f8fbff;
}
[data-toantin-tool="chart_builder"] .cb-data-sample-control-group,
[data-toantin-tool="chart_builder"] .cb-data-sample-row-field { display:grid; gap:6px; margin:0; }
[data-toantin-tool="chart_builder"] .cb-data-sample-control-label { color:#365477; font-size:14px; font-weight:800; }
[data-toantin-tool="chart_builder"] .cb-data-sample-segmented { display:flex; gap:5px; }
[data-toantin-tool="chart_builder"] .cb-data-sample-segment {
  width:42px; min-height:38px; border:1px solid #cfe0f5; border-radius:10px; background:#fff; color:#35506f; font-weight:800;
}
[data-toantin-tool="chart_builder"] .cb-data-sample-segment.is-active { border-color:#3b82f6; background:#e9f2ff; color:#0d5bef; box-shadow:inset 0 0 0 1px rgba(59,130,246,.15); }
[data-toantin-tool="chart_builder"] .cb-random-sample-generate { min-height:42px; font-weight:800; }
[data-toantin-tool="chart_builder"] .cb-data-sample-title-row { display:flex; flex-wrap:wrap; align-items:center; gap:10px; }
[data-toantin-tool="chart_builder"] .cb-sample-inline-editor {
  width:100%; min-width:0; border:1px solid transparent; border-radius:7px; background:transparent; color:inherit; padding:4px 6px; font:inherit; line-height:1.35;
}
[data-toantin-tool="chart_builder"] .cb-sample-inline-editor[readonly] { cursor:default; }
[data-toantin-tool="chart_builder"] .cb-sample-inline-editor[readonly]:hover { border-color:#cfe0f5; background:#f7fbff; }
[data-toantin-tool="chart_builder"] .cb-sample-inline-editor.is-editing { border-color:#3b82f6; background:#fff; outline:3px solid rgba(59,130,246,.14); }
[data-toantin-tool="chart_builder"] .cb-data-sample-title-editor { flex:1 1 320px; font-size:20px; font-weight:850; color:#102a56; }
[data-toantin-tool="chart_builder"] .cb-data-sample-edit-hint { color:#64748b; font-size:13px; }
[data-toantin-tool="chart_builder"] .cb-data-sample-table-wrap { max-height:440px; }
[data-toantin-tool="chart_builder"] .cb-data-sample-table { min-width:560px; font-size:16px; }
[data-toantin-tool="chart_builder"] .cb-data-sample-table th,
[data-toantin-tool="chart_builder"] .cb-data-sample-table td { vertical-align:middle; padding:5px 8px; }
[data-toantin-tool="chart_builder"] .cb-data-sample-table thead .cb-sample-inline-editor { font-weight:850; color:#17395f; }
[data-toantin-tool="chart_builder"] .cb-data-sample-table tfoot th,
[data-toantin-tool="chart_builder"] .cb-data-sample-table tfoot td { background:#eef5ff; color:#123b68; font-weight:850; border-top:2px solid #c8dcf4; }
[data-toantin-tool="chart_builder"] .cb-data-sample-delete-row { font-size:18px; }
[data-toantin-tool="chart_builder"] .cb-data-sample-table-actions { display:flex; justify-content:flex-end; }
[data-toantin-tool="chart_builder"] .cb-data-sample-readiness {
  padding:9px 12px; border-radius:10px; font-weight:750; font-size:14px;
}
[data-toantin-tool="chart_builder"] .cb-data-sample-readiness.is-valid { background:#ecfaf3; color:#176842; border:1px solid #bfead2; }
[data-toantin-tool="chart_builder"] .cb-data-sample-readiness.has-errors { background:#fff7e8; color:#8a5a00; border:1px solid #f1d699; }
[data-toantin-tool="chart_builder"] .cb-sample-commit-cta,
[data-toantin-tool="chart_builder"] .cb-sample-commit-state { width:100%; min-height:48px; font-size:16px; font-weight:850; border-radius:11px; }
[data-toantin-tool="chart_builder"] .cb-sample-commit-state { border:1px solid #9bd9b9; background:#e8f8ef; color:#137a4b; opacity:1; }
[data-toantin-tool="chart_builder"] .cb-next-step-secondary { background:#fff; }
[data-toantin-tool="chart_builder"] .cb-next-step-primary { font-weight:850; box-shadow:0 4px 12px rgba(13,91,239,.16); }
[data-toantin-tool="chart_builder"] .cb-data-replacement-conflict {
  display:grid; gap:10px; padding:14px; border:1px solid #f0c56c; border-left:4px solid #f3a712; border-radius:12px; background:#fffaf0;
}
[data-toantin-tool="chart_builder"] .cb-data-replacement-conflict__title { margin:0; color:#744c00; font-size:18px; font-weight:850; }
[data-toantin-tool="chart_builder"] .cb-xlsx-template-download { cursor:pointer; }

@media (max-width: 900px) {
  [data-toantin-tool="chart_builder"] .cb-raw-mode-tabs--primary { grid-template-columns:repeat(2,minmax(0,1fr)); }
  [data-toantin-tool="chart_builder"] .cb-data-sample-controls { grid-template-columns:1fr 1fr; }
  [data-toantin-tool="chart_builder"] .cb-random-sample-generate { grid-column:1 / -1; }
}
@media (max-width: 520px) {
  [data-toantin-tool="chart_builder"] .cb-raw-mode-tabs--primary { grid-template-columns:1fr; }
  [data-toantin-tool="chart_builder"] .cb-data-sample-controls { grid-template-columns:1fr; }
  [data-toantin-tool="chart_builder"] .cb-random-sample-generate { grid-column:auto; }
}
[data-toantin-tool="chart_builder"] .cb-data-sample-table .cb-grid-row-actions { position:relative; }

/* B49 FIX10 — statistics table orientation + scientifically correct N emphasis */
[data-toantin-tool="chart_builder"] .cb-statistics-table-head-actions {
  display:flex;
  flex:0 0 auto;
  align-items:center;
  justify-content:flex-end;
  gap:8px;
  flex-wrap:wrap;
}
[data-toantin-tool="chart_builder"] .cb-statistics-table-orientation-toggle {
  min-height:40px;
  padding:7px 12px;
  border-color:#a9c9f7;
  border-radius:10px;
  background:#fff;
  color:#164f9f;
  font-size:calc(13px * var(--cb-statistics-font-scale,1));
  font-weight:780;
  box-shadow:0 3px 8px rgba(13,91,239,.08), inset 0 1px 0 rgba(255,255,255,.95);
}
[data-toantin-tool="chart_builder"] .cb-statistics-table-orientation-toggle:hover {
  border-color:#6ea7f3;
  background:#f4f8ff;
  transform:translateY(-1px);
}
[data-toantin-tool="chart_builder"] .cb-statistics-table-orientation-toggle:active {
  transform:translateY(0);
  box-shadow:inset 0 2px 4px rgba(13,91,239,.10);
}
[data-toantin-tool="chart_builder"] .cb-statistics-n-badge {
  padding:7px 13px;
  border:1px solid #8fbaf4;
  border-radius:999px;
  background:#edf5ff;
  color:#0d55c7;
  font-size:calc(16px * var(--cb-statistics-font-scale,1));
  font-weight:900;
  line-height:1.1;
  letter-spacing:.01em;
  box-shadow:0 3px 10px rgba(13,91,239,.10);
}
[data-toantin-tool="chart_builder"] .cb-statistics-derived-table--vertical {
  width:100%;
  table-layout:auto;
}
[data-toantin-tool="chart_builder"] .cb-statistics-derived-table--vertical th,
[data-toantin-tool="chart_builder"] .cb-statistics-derived-table--vertical td {
  text-align:left;
}
[data-toantin-tool="chart_builder"] .cb-statistics-derived-table--vertical td:not(:first-child),
[data-toantin-tool="chart_builder"] .cb-statistics-derived-table--vertical th:not(:first-child) {
  text-align:center;
}
@media (max-width: 767.98px) {
  [data-toantin-tool="chart_builder"] .cb-statistics-table-head-actions {
    width:100%;
    justify-content:space-between;
  }
  [data-toantin-tool="chart_builder"] .cb-statistics-table-orientation-toggle {
    flex:1 1 auto;
  }
}

/* B49 FIX11 — closed-loop Teaching sample editor + one-use error-detection practice. */
[data-toantin-tool="chart_builder"] .cb-data-sample-header-cell {
  display:flex;
  align-items:center;
  gap:5px;
  min-width:0;
}
[data-toantin-tool="chart_builder"] .cb-data-sample-header-cell .cb-sample-inline-editor { flex:1 1 auto; }
[data-toantin-tool="chart_builder"] .cb-data-sample-delete-column {
  flex:0 0 28px;
  width:28px;
  height:28px;
  border-radius:8px;
  font-size:16px;
}
[data-toantin-tool="chart_builder"] .cb-data-sample-table-actions {
  gap:8px;
  flex-wrap:wrap;
}
[data-toantin-tool="chart_builder"] .cb-data-sample-n-row {
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  align-items:center;
}
[data-toantin-tool="chart_builder"] .cb-data-sample-n-badge {
  display:inline-flex;
  align-items:center;
  min-height:38px;
  padding:7px 12px;
  border:1px solid #8fbaf4;
  border-radius:999px;
  background:#edf5ff;
  color:#0d55c7;
  font-size:16px;
  font-weight:900;
  box-shadow:0 3px 10px rgba(13,91,239,.10);
}
[data-toantin-tool="chart_builder"] .cb-data-sample-staged-note {
  padding:10px 12px;
  border:1px solid #b8d7fb;
  border-left:4px solid #2f7df4;
  border-radius:10px;
  background:#f2f7ff;
  color:#173e70;
  font-size:15px;
  font-weight:720;
}
[data-toantin-tool="chart_builder"] .cb-teaching-editable-sample-host {
  display:grid;
  gap:12px;
}
[data-toantin-tool="chart_builder"] .cb-teaching-editable-sample-context {
  color:#405978;
  font-size:clamp(18px, calc(16px * var(--cb-statistics-font-scale,1)), 32px);
  line-height:1.5;
}
[data-toantin-tool="chart_builder"] .cb-teaching-editable-sample .cb-data-sample-title-editor {
  font-size:clamp(24px, calc(21px * var(--cb-statistics-font-scale,1)), 42px);
}
[data-toantin-tool="chart_builder"] .cb-teaching-editable-sample .cb-data-sample-table {
  font-size:clamp(20px, calc(18px * var(--cb-statistics-font-scale,1)), 38px);
}
[data-toantin-tool="chart_builder"] .cb-teaching-editable-sample .cb-data-sample-table th,
[data-toantin-tool="chart_builder"] .cb-teaching-editable-sample .cb-data-sample-table td {
  padding:clamp(9px, calc(7px * var(--cb-statistics-font-scale,1)), 18px) clamp(10px, calc(9px * var(--cb-statistics-font-scale,1)), 22px);
}
[data-toantin-tool="chart_builder"] .cb-teaching-editable-sample .cb-data-sample-n-badge {
  min-height:44px;
  font-size:clamp(18px, calc(16px * var(--cb-statistics-font-scale,1)), 32px);
}
[data-toantin-tool="chart_builder"] .cb-teaching-practice-card {
  display:grid;
  gap:14px;
  border-color:#c6daf4;
  background:linear-gradient(180deg,#fff 0%,#fbfdff 100%);
}
[data-toantin-tool="chart_builder"] .cb-teaching-practice-title {
  margin:0;
  color:#0f2d5c;
  font-size:clamp(26px, calc(23px * var(--cb-statistics-font-scale,1)), 46px);
  font-weight:900;
  line-height:1.25;
}
[data-toantin-tool="chart_builder"] .cb-teaching-practice-context {
  color:#35506f;
  font-size:clamp(20px, calc(18px * var(--cb-statistics-font-scale,1)), 36px);
  line-height:1.5;
}
[data-toantin-tool="chart_builder"] .cb-teaching-practice-prompt {
  padding:12px 16px;
  border:1px solid #b7d7ff;
  border-left:5px solid #2577ef;
  border-radius:12px;
  background:#edf6ff;
  color:#0d3f86;
  font-size:clamp(25px, calc(23px * var(--cb-statistics-font-scale,1)), 46px);
  font-weight:900;
  line-height:1.45;
}
[data-toantin-tool="chart_builder"] .cb-teaching-practice-table-section {
  display:grid;
  gap:10px;
}
[data-toantin-tool="chart_builder"] .cb-teaching-practice-table-head {
  display:flex;
  justify-content:flex-end;
  align-items:center;
}
[data-toantin-tool="chart_builder"] .cb-teaching-practice-orientation-toggle {
  min-height:44px;
  font-size:16px;
  font-weight:800;
}
[data-toantin-tool="chart_builder"] .cb-teaching-practice-table-scroll {
  max-width:100%;
  overflow:auto;
  border:1px solid #d6e3f3;
  border-radius:14px;
}
[data-toantin-tool="chart_builder"] .cb-teaching-practice-table {
  width:100%;
  margin:0;
  min-width:640px;
  font-size:clamp(22px, calc(20px * var(--cb-statistics-font-scale,1)), 42px);
  line-height:1.45;
}
[data-toantin-tool="chart_builder"] .cb-teaching-practice-table th,
[data-toantin-tool="chart_builder"] .cb-teaching-practice-table td {
  padding:clamp(11px, calc(9px * var(--cb-statistics-font-scale,1)), 20px) clamp(13px, calc(11px * var(--cb-statistics-font-scale,1)), 24px);
  vertical-align:middle;
}
[data-toantin-tool="chart_builder"] .cb-teaching-practice-table thead th,
[data-toantin-tool="chart_builder"] .cb-teaching-practice-table tbody th {
  background:#eef5ff;
  color:#143c6a;
  font-weight:900;
}
[data-toantin-tool="chart_builder"] .cb-teaching-practice-table .is-total {
  background:#fff4d8;
  color:#764d00;
  font-weight:900;
}
[data-toantin-tool="chart_builder"] .cb-teaching-practice-actions {
  justify-content:flex-end;
}
[data-toantin-tool="chart_builder"] .cb-teaching-practice-result-toggle {
  min-height:50px;
  padding:10px 18px;
  font-size:clamp(18px, calc(17px * var(--cb-statistics-font-scale,1)), 30px);
  font-weight:900;
}
[data-toantin-tool="chart_builder"] .cb-teaching-practice-result {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
}
[data-toantin-tool="chart_builder"] .cb-teaching-practice-result__item {
  padding:14px 16px;
  border:1px solid #bfe3cf;
  border-radius:12px;
  background:#f0faf5;
}
[data-toantin-tool="chart_builder"] .cb-teaching-practice-result__label {
  margin:0 0 7px;
  color:#11643e;
  font-size:clamp(22px, calc(20px * var(--cb-statistics-font-scale,1)), 38px);
  font-weight:900;
}
[data-toantin-tool="chart_builder"] .cb-teaching-practice-result__text {
  color:#24465a;
  font-size:clamp(20px, calc(18px * var(--cb-statistics-font-scale,1)), 36px);
  line-height:1.55;
}
@media (max-width: 900px) {
  [data-toantin-tool="chart_builder"] .cb-teaching-practice-result { grid-template-columns:1fr; }
}
@media (max-width: 520px) {
  [data-toantin-tool="chart_builder"] .cb-teaching-practice-table { min-width:560px; }
  [data-toantin-tool="chart_builder"] .cb-teaching-practice-title { font-size:24px; }
  [data-toantin-tool="chart_builder"] .cb-teaching-practice-prompt { font-size:21px; }
}

/* B49 FIX12 — classroom table legibility / preference persistence polish. */
[data-toantin-tool="chart_builder"] .cb-teaching-practice-table th,
[data-toantin-tool="chart_builder"] .cb-teaching-practice-table td {
  text-align:center;
}
[data-toantin-tool="chart_builder"] .cb-teaching-practice-table--vertical th:first-child,
[data-toantin-tool="chart_builder"] .cb-teaching-practice-table--vertical td:first-child {
  text-align:center;
}

/* B49 FIX13 — one shared editable sample builder in Data + Teaching. */
[data-toantin-tool="chart_builder"] .cb-data-sample-title-actions {
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:8px;
  flex-wrap:wrap;
  margin-left:auto;
}
[data-toantin-tool="chart_builder"] .cb-data-sample-orientation-toggle {
  min-height:38px;
  border-radius:10px;
  border-color:#a9c9f7;
  background:#fff;
  color:#164f9f;
  font-weight:800;
  box-shadow:0 3px 8px rgba(13,91,239,.08), inset 0 1px 0 rgba(255,255,255,.95);
}
[data-toantin-tool="chart_builder"] .cb-data-sample-table--horizontal {
  width:100%;
  min-width:max-content;
  table-layout:auto;
}
[data-toantin-tool="chart_builder"] .cb-data-sample-table--horizontal th,
[data-toantin-tool="chart_builder"] .cb-data-sample-table--horizontal td {
  text-align:center;
}
[data-toantin-tool="chart_builder"] .cb-data-sample-table--horizontal th:first-child {
  position:sticky;
  left:0;
  z-index:2;
  min-width:150px;
  background:#f1f6fe;
  text-align:left;
}
[data-toantin-tool="chart_builder"] .cb-data-sample-table--horizontal .cb-data-sample-header-cell--category {
  justify-content:center;
}
[data-toantin-tool="chart_builder"] .cb-data-sample-table--horizontal .cb-data-sample-total-head,
[data-toantin-tool="chart_builder"] .cb-data-sample-table--horizontal .cb-data-sample-total-cell {
  background:#eef5ff;
  color:#123b68;
  font-weight:900;
  border-left:2px solid #c8dcf4;
}
[data-toantin-tool="chart_builder"] .cb-teaching-sample-shape-controls {
  grid-template-columns:auto minmax(120px,170px) minmax(220px,1fr);
  align-items:end;
}
[data-toantin-tool="chart_builder"] .cb-teaching-sample-shape-hint {
  align-self:center;
  margin:0;
  text-align:right;
}
[data-toantin-tool="chart_builder"] .cb-teaching-editable-sample .cb-data-sample-table--horizontal th,
[data-toantin-tool="chart_builder"] .cb-teaching-editable-sample .cb-data-sample-table--horizontal td {
  text-align:center;
}
@media (max-width:900px){
  [data-toantin-tool="chart_builder"] .cb-teaching-sample-shape-controls { grid-template-columns:1fr 1fr; }
  [data-toantin-tool="chart_builder"] .cb-teaching-sample-shape-hint { grid-column:1 / -1; text-align:left; }
}
@media (max-width:520px){
  [data-toantin-tool="chart_builder"] .cb-data-sample-title-actions { width:100%; justify-content:flex-start; }
  [data-toantin-tool="chart_builder"] .cb-data-sample-orientation-toggle { width:100%; }
  [data-toantin-tool="chart_builder"] .cb-teaching-sample-shape-controls { grid-template-columns:1fr; }
  [data-toantin-tool="chart_builder"] .cb-teaching-sample-shape-hint { grid-column:auto; }
}

/* B49 FIX14 — compact Library cards, six-slot action dock and inline total N. */
[data-toantin-tool="chart_builder"] .cb-library-grid {
  grid-template-columns:repeat(auto-fill,minmax(min(100%,310px),1fr));
  gap:12px;
}
[data-toantin-tool="chart_builder"] .cb-library-card {
  padding:12px;
  gap:7px;
  border-radius:15px;
}
[data-toantin-tool="chart_builder"] .cb-library-card__title { font-size:16px; }
[data-toantin-tool="chart_builder"] .cb-library-card__chart-name { -webkit-line-clamp:1; }
[data-toantin-tool="chart_builder"] .cb-library-card__updated { font-size:12px; margin-top:0; }
[data-toantin-tool="chart_builder"] .cb-library-save-hint {
  color:#405979;font-size:14px;line-height:1.45;margin:0 0 10px;
}
[data-toantin-tool="chart_builder"] .cb-library-card__actions--compact {
  display:flex;
  flex-wrap:nowrap;
  align-items:center;
  gap:5px;
  width:100%;
  border-top:1px solid #e5eefb;
  padding-top:9px;
}
[data-toantin-tool="chart_builder"] .cb-library-card__actions--compact .cb-library-icon-action {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex:0 0 37px;
  width:37px;
  min-width:37px;
  height:39px;
  min-height:39px;
  padding:0;
  border-radius:10px;
  border:1px solid #cdddf3;
  background:linear-gradient(180deg,#fff,#f0f6ff);
  box-shadow:0 2px 3px rgba(14,55,105,.09);
  color:#315b95;
  transition:transform .12s,background .12s,box-shadow .12s;
}
[data-toantin-tool="chart_builder"] .cb-library-card__actions--compact .cb-library-icon-action:hover {
  background:#e8f2ff;
  transform:translateY(-1px);
  box-shadow:0 3px 7px rgba(14,55,105,.15);
}
[data-toantin-tool="chart_builder"] .cb-library-card__actions--compact .cb-library-icon-action:active { transform:translateY(1px);box-shadow:inset 0 2px 3px rgba(14,55,105,.12); }
[data-toantin-tool="chart_builder"] .cb-library-card__actions--compact .cb-library-icon-action:focus-visible { outline:3px solid #6aa9ff;outline-offset:2px; }
[data-toantin-tool="chart_builder"] .cb-library-card__actions--compact .cb-library-icon-action.is-primary {
  color:#fff;background:#136afa;border-color:#136afa;
}
[data-toantin-tool="chart_builder"] .cb-library-card__actions--compact .cb-library-icon-action.is-danger {color:#c1273b;}
[data-toantin-tool="chart_builder"] .cb-library-card__actions--compact .cb-library-icon-action.is-delete-confirm {background:#e3344f;color:#fff;border-color:#e3344f;}
[data-toantin-tool="chart_builder"] .cb-library-card__actions--compact .cb-library-card__active-label {
  flex:1 1 auto;
  min-width:0;
  min-height:27px;
  justify-content:center;
  padding:4px 5px;
  font-size:10px;
  white-space:nowrap;
}
[data-toantin-tool="chart_builder"] .cb-library-card__active-label.is-inactive {
  background:#f4f7fd;
  color:#4b657e;
  border-color:#dce7f3;
}
[data-toantin-tool="chart_builder"] .cb-data-sample-total-action { text-align:right;min-width:122px; }
[data-toantin-tool="chart_builder"] .cb-data-sample-total-head .cb-data-sample-n-badge--inline {margin-left:8px;}
[data-toantin-tool="chart_builder"] .cb-data-sample-n-badge--inline {
  display:inline-flex;
  min-height:29px;
  padding:4px 10px;
  font-size:calc(15px * var(--cb-statistics-font-scale,1));
  white-space:nowrap;
  vertical-align:middle;
}
@media(max-width:575.98px) {
  [data-toantin-tool="chart_builder"] .cb-library-card__actions--compact { flex-direction:row;align-items:center;gap:4px; }
  [data-toantin-tool="chart_builder"] .cb-library-card__actions--compact .cb-library-icon-action {
    flex:0 0 37px;width:37px;min-width:37px;height:42px;min-height:42px;
  }
  [data-toantin-tool="chart_builder"] .cb-library-card__actions--compact .cb-library-card__active-label {
    width:auto;min-height:27px;
  }
}
@media(prefers-reduced-motion:reduce){
  [data-toantin-tool="chart_builder"] .cb-library-card__actions--compact .cb-library-icon-action {transition:none;}
}

/* B49 FIX15 — Student-facing Q&A: proportional LCD scale, independent of teacher controls. */
[data-toantin-tool="chart_builder"] .cb-teaching-qa-panel {
  min-width:0; padding:clamp(15px,1.3vw,24px); border-radius:14px;
}
[data-toantin-tool="chart_builder"] .cb-teaching-qa-instruction {
  margin:10px 0 16px; color:#41566d;
  font-size:clamp(17px,calc(18px * var(--cb-statistics-font-scale,1)),26px);
  line-height:1.5;
}
[data-toantin-tool="chart_builder"] .cb-teaching-qa-list {
  margin:0; padding-left:1.4em; display:grid; gap:13px;
}
[data-toantin-tool="chart_builder"] .cb-teaching-qa-item {
  padding:10px 12px; border:1px solid #dae6f7; border-radius:12px;
  background:#fff;
}
[data-toantin-tool="chart_builder"] .cb-teaching-qa-question {
  display:flex; gap:14px; align-items:center; justify-content:space-between;
}
[data-toantin-tool="chart_builder"] .cb-teaching-qa-question__text,
[data-toantin-tool="chart_builder"] .cb-teaching-qa-answer {
  font-size:clamp(19px,calc(19px * var(--cb-statistics-font-scale,1)),34px);
  line-height:1.5; overflow-wrap:anywhere;
}
[data-toantin-tool="chart_builder"] .cb-teaching-qa-answer {
  margin:12px 0 3px; padding:14px 16px; border-left:4px solid #208052;
  border-radius:8px; background:#edfaf3; color:#134a33;
}
[data-toantin-tool="chart_builder"] .cb-teaching-qa-all,
[data-toantin-tool="chart_builder"] .cb-teaching-qa-toggle {
  flex-shrink:0; font-size:16px; min-height:40px;
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-teaching.is-statistics-projector .cb-teaching-qa-question__text,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-teaching.is-statistics-projector .cb-teaching-qa-answer {
  font-size:clamp(24px,calc(21px * var(--cb-statistics-font-scale,1)),40px);
}
@media (max-width:680px) {
  [data-toantin-tool="chart_builder"] .cb-teaching-qa-question {flex-wrap:wrap;}
  [data-toantin-tool="chart_builder"] .cb-teaching-qa-all,
  [data-toantin-tool="chart_builder"] .cb-teaching-qa-toggle { min-height:42px; }
  [data-toantin-tool="chart_builder"] .cb-teaching-qa-panel {padding:12px;}
}
/* FIX15: Prevent a wide sample editor from clipping student questions on narrow screens. */
[data-toantin-tool="chart_builder"] .cb-teaching-editable-sample-host,
[data-toantin-tool="chart_builder"] .cb-teaching-qa-panel {
  width:100%; max-width:100%; min-width:0; box-sizing:border-box;
}
@media (max-width:680px) {
  [data-toantin-tool="chart_builder"] .cb-teaching-qa-panel .cb-teaching-qa-list,
  [data-toantin-tool="chart_builder"] .cb-teaching-qa-panel .cb-teaching-qa-item {min-width:0;}
}
/* FIX15: the editable table's 560px intrinsic width must not widen the mobile
   Teaching evidence grid or its student Q&A sibling. The table itself scrolls. */
[data-toantin-tool="chart_builder"] .cb-teaching-editable-sample-host {
  grid-template-columns:minmax(0,1fr);
}
[data-toantin-tool="chart_builder"] .cb-teaching-editable-sample-host > * {
  min-width:0; max-width:100%;
}
[data-toantin-tool="chart_builder"] .cb-teaching-qa-panel {
  grid-column:1 / -1;
  overflow-wrap:anywhere;
}

/* B49 FIX17: Grade 9 grouped-frequency classroom — projector legibility and
   mathematically readable intervals, scoped to Chart Builder only. */
[data-toantin-tool="chart_builder"] .cb-teaching-grouped-learning {
  max-width:100%; min-width:0; padding:clamp(14px,1.4vw,24px);
  margin:20px 0; border:1px solid #bfd3eb; border-radius:14px;
  background:linear-gradient(180deg,#f5faff,#fff 35%);
}
[data-toantin-tool="chart_builder"] .cb-teaching-grouped-title {
  font-size:clamp(23px,calc(24px * var(--cb-statistics-font-scale,1)),36px);
  font-weight:750;color:#102f59;line-height:1.25;margin:0 0 12px;
}
[data-toantin-tool="chart_builder"] .cb-teaching-grouped-instruction,
[data-toantin-tool="chart_builder"] .cb-teaching-grouped-summary {
  font-size:clamp(20px,calc(19px * var(--cb-statistics-font-scale,1)),31px);
  line-height:1.52;color:#1d3756;margin:14px 0;
}
[data-toantin-tool="chart_builder"] .cb-teaching-grouped-summary {
  font-weight:700;background:#eaf3ff;border:1px solid #bfd5fc;border-radius:10px;padding:12px 16px;
}
[data-toantin-tool="chart_builder"] .cb-teaching-grouped-controls {
  display:flex;align-items:end;gap:12px;flex-wrap:wrap;margin:12px 0;
}
[data-toantin-tool="chart_builder"] .cb-teaching-grouped-field {display:grid;gap:7px;min-width:150px;max-width:210px;flex:1 1 155px;}
[data-toantin-tool="chart_builder"] .cb-teaching-grouped-field .form-control {min-height:47px;font-size:18px;}
[data-toantin-tool="chart_builder"] .cb-teaching-grouped-controls .btn {min-height:47px;font-size:16px;}
[data-toantin-tool="chart_builder"] .cb-teaching-grouped-table-scroll {max-width:100%;overflow-x:auto;}
[data-toantin-tool="chart_builder"] .cb-teaching-grouped-table {min-width:560px;width:100%;font-size:clamp(19px,calc(19px * var(--cb-statistics-font-scale,1)),32px);}
[data-toantin-tool="chart_builder"] .cb-teaching-grouped-table :is(td,th) {
  padding:12px 14px;text-align:center;vertical-align:middle;white-space:nowrap;
}
[data-toantin-tool="chart_builder"] .cb-teaching-grouped-table thead,
[data-toantin-tool="chart_builder"] .cb-teaching-grouped-total {background:#e5efff;font-weight:750;color:#103767;}
[data-toantin-tool="chart_builder"] .cb-teaching-grouped-chart-actions {display:flex;gap:10px;flex-wrap:wrap;margin:12px 0;}
[data-toantin-tool="chart_builder"] .cb-teaching-grouped-chart-actions .btn {min-height:43px;font-size:16px;}
[data-toantin-tool="chart_builder"] .cb-teaching-grouped-error {font-size:clamp(18px,calc(18px * var(--cb-statistics-font-scale,1)),27px);}
@media(max-width:600px){
  [data-toantin-tool="chart_builder"] .cb-teaching-grouped-learning {padding:12px;}
  [data-toantin-tool="chart_builder"] .cb-teaching-grouped-field {min-width:130px;}
  [data-toantin-tool="chart_builder"] .cb-teaching-grouped-table {min-width:520px;}
}

/* FIX18 — scoped LCD-readable 3D source-status chips; no Host/global CSS. */
[data-toantin-tool="chart_builder"] .cb-teaching-source-card__badge--current,
[data-toantin-tool="chart_builder"] .cb-teaching-source-card.is-active .cb-teaching-source-card__badge--current {
  display:inline-flex;align-items:center;justify-content:center;gap:6px;
  min-height:32px;padding:6px 13px;border:1px solid #0b63b8;border-radius:999px;
  background:linear-gradient(155deg,#268eff 0%,#176ae0 53%,#104bad 100%);
  color:#fff;font-size:14px;font-weight:850;letter-spacing:.015em;line-height:1.15;
  box-shadow:0 3px 0 #0b4898,0 6px 11px rgba(17,83,166,.22),inset 0 1px 0 rgba(255,255,255,.5);
  white-space:normal;text-align:center;
}
[data-toantin-tool="chart_builder"] .cb-teaching-source-card__badge--current::before {
  content:'✓';display:inline-flex;align-items:center;justify-content:center;
  width:17px;height:17px;flex:0 0 17px;border-radius:50%;
  background:rgba(255,255,255,.22);color:#fff;font-size:12px;
}
[data-toantin-tool="chart_builder"] .cb-teaching-source-card__badge--sample,
[data-toantin-tool="chart_builder"] .cb-teaching-source-card.is-active .cb-teaching-source-card__badge--sample {
  display:inline-flex;align-items:center;justify-content:center;gap:6px;
  min-height:32px;padding:6px 12px;border:1px solid #bb6512;border-radius:999px;
  background:linear-gradient(155deg,#ffcc70 0%,#e99c32 50%,#c97816 100%);
  color:#452801;font-size:14px;font-weight:850;letter-spacing:.005em;line-height:1.15;
  box-shadow:0 3px 0 #a86117,0 6px 11px rgba(152,92,19,.2),inset 0 1px 0 rgba(255,255,255,.7);
  white-space:normal;text-align:center;
}
[data-toantin-tool="chart_builder"] .cb-teaching-source-card__badge--sample::before {
  content:'✦';color:#653b04;font-size:17px;line-height:1;
}
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-teaching .cb-teaching-source-card__badge--current,
[data-toantin-tool="chart_builder"] .cb-full-tool.is-domain-workspace-teaching .cb-teaching-source-card__badge--sample {
  font-size:14px;line-height:1.15;
}
@media (max-width:650px){
  [data-toantin-tool="chart_builder"] .cb-teaching-source-card__top { flex-wrap:wrap; }
  [data-toantin-tool="chart_builder"] .cb-teaching-source-card__badge--current,
  [data-toantin-tool="chart_builder"] .cb-teaching-source-card__badge--sample {font-size:13px;padding:6px 10px;}
}
