/* 🆕 (Update 31) نمودارهایِ آموزشیِ پاسخ (ac-) و سازنده‌ی نمودار (acb-) */
.ac { margin: 12px 0; padding: 12px; border: 1px solid #e5e7eb; border-radius: 14px; background: #fff; font-family: inherit; }
.ac-title { font-size: 13px; font-weight: 700; margin-bottom: 6px; display: flex; align-items: center; gap: 6px; color: #111827; }
.ac-title i { color: #2563eb; }
.ac-svg { width: 100%; height: auto; max-height: 420px; display: block; direction: ltr; }
.ac-grid { stroke: #eef0f3; stroke-width: 1; }
.ac-axis { stroke: #9ca3af; stroke-width: 1.2; }
.ac-axis0 { stroke: #6b7280; stroke-width: 1.2; stroke-dasharray: 4 3; }
.ac-tick { font-size: 11px; fill: #6b7280; font-family: 'Vazirmatn', system-ui, sans-serif; }
.ac-label { font-size: 12px; fill: #374151; font-weight: 600; font-family: 'Vazirmatn', system-ui, sans-serif; }
.ac-marker { stroke: #fff; stroke-width: 1.2; }
.ac-bar { opacity: .9; transition: opacity .15s; }
.ac-bar:hover { opacity: 1; }
.ac-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; font-size: 12px; color: #374151; }
.ac-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.ac-swatch { width: 18px; height: 4px; border-radius: 2px; display: inline-block; }
.ac-swatch.s1 { background-image: linear-gradient(90deg, currentColor 60%, transparent 60%) !important; background-size: 6px 4px; }
.ac-caption { margin: 6px 0 0; font-size: 12px; color: #4b5563; line-height: 1.9; }
.ac-data { margin-top: 6px; font-size: 12px; }
.ac-data summary { cursor: pointer; color: #2563eb; }
.ac-table-wrap { overflow-x: auto; max-height: 240px; margin-top: 6px; }
.ac-data table { border-collapse: collapse; width: 100%; }
.ac-data th, .ac-data td { border-bottom: 1px solid #f3f4f6; padding: 4px 8px; text-align: center; white-space: nowrap; }
.ac-data th { color: #6b7280; font-weight: 600; }
.qf-answer-charts { margin-top: 8px; }

.acb { display: grid; gap: 10px; }
.acb-toggle { justify-self: start; border: 1px dashed #93c5fd; background: #eff6ff; color: #1d4ed8; border-radius: 10px; padding: 8px 14px; font: inherit; font-size: 13px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.acb-toggle:hover { background: #dbeafe; }
.acb-panel { border: 1px solid #e5e7eb; border-radius: 14px; padding: 12px; background: #fafafa; display: grid; gap: 10px; }
.acb-seg { display: inline-flex; gap: 4px; background: #f3f4f6; padding: 4px; border-radius: 10px; justify-self: start; flex-wrap: wrap; }
.acb-seg button { border: none; background: transparent; padding: 6px 12px; border-radius: 8px; font: inherit; font-size: 12.5px; cursor: pointer; color: #4b5563; }
.acb-seg button.on { background: #fff; color: #1d4ed8; font-weight: 700; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.acb-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.acb-grid label, .acb-block { display: grid; gap: 4px; font-size: 12px; color: #374151; }
.acb-grid label.wide { grid-column: span 3; }
.acb-input { border: 1px solid #e5e7eb; border-radius: 9px; padding: 7px 10px; font: inherit; font-size: 13px; background: #fff; width: 100%; box-sizing: border-box; }
.acb-input.ltr { direction: ltr; text-align: left; font-family: ui-monospace, Consolas, monospace; }
.acb-input:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
.acb-hint { font-size: 11.5px; color: #6b7280; direction: rtl; }
.acb-error { font-size: 12px; color: #b91c1c; background: #fef2f2; border: 1px solid #fecaca; border-radius: 8px; padding: 6px 10px; }
.acb-preview-lbl { font-size: 11.5px; color: #6b7280; margin-bottom: -6px; }
.acb-actions { display: flex; gap: 8px; }
.acb-btn { min-height: 36px; padding: 0 14px; border-radius: 9px; border: 1px solid #e5e7eb; background: #fff; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.acb-btn.primary { background: #2563eb; border-color: #2563eb; color: #fff; }
.acb-btn:disabled { opacity: .5; cursor: not-allowed; }
.acb-item { position: relative; }
.acb-remove { position: absolute; top: 18px; left: 18px; border: 1px solid #fecaca; background: #fff; color: #b91c1c; border-radius: 8px; padding: 4px 10px; font: inherit; font-size: 12px; cursor: pointer; }
@media (max-width: 640px) {
    .acb-grid { grid-template-columns: 1fr; }
    .acb-grid label.wide { grid-column: auto; }
}
@media (prefers-color-scheme: dark) {
    .ac { background: #1c1d22; border-color: rgba(255,255,255,.1); }
    .ac-title, .ac-legend { color: #f1f1ef; }
    .ac-grid { stroke: rgba(255,255,255,.07); }
    .ac-tick { fill: #a1a1aa; }
    .ac-label { fill: #e4e4e7; }
    .ac-marker { stroke: #1c1d22; }
}
