@import url("/ds/bf-tokens.css"); /* bf-ds v2 */
/* Semester 1 practice engine and interactive visuals. Builds on study.css tokens. */
:root { --ok: #1f6b45; --ok-tint: #e9f4ee; --no: #a33a27; --no-tint: #fbefec; }

/* nuclide symbol: A over Z on the left, charge on the right */
.nuc { display: inline-flex; align-items: center; font-family: var(--math); white-space: nowrap; }
.nuc-az { display: inline-flex; flex-direction: column; align-items: flex-end; font-size: .7em; line-height: 1.05; margin-right: .08em; }
.nuc-az sup, .nuc-az sub { font-size: 1em; line-height: 1.05; vertical-align: baseline; position: static; }
.nuc > sup { font-size: .7em; align-self: flex-start; line-height: 1; margin-left: .05em; }

.objectives { padding-left: 1.4rem; }
.ar-term { font-family: 'Segoe UI', Tahoma, Arial, sans-serif; color: var(--muted); font-size: .95em; margin-left: .35em; }
.model-limits { border-left: 3px solid var(--accent); background: var(--tint); padding: var(--s3) var(--s4); border-radius: 0 var(--radius-s) var(--radius-s) 0; }
.decision-table td, .decision-table th { vertical-align: top; }

/* cards and choices */
.pr-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s4) var(--s5); margin: var(--s4) 0; min-width: 0; }
fieldset.pr-card, .pr-decision { border: 1px solid var(--line); }
.pr-card legend, .pr-decision legend { font-size: var(--prose); line-height: 1.6; padding: 0 var(--s1); }
.pr-question.solved { border-color: var(--ok); }
.pr-head { display: flex; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s2); font-size: .875rem; }
.pr-tag { color: var(--accent); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.pr-id { color: var(--muted); font-variant-numeric: tabular-nums; }
.pr-num { display: inline-block; min-width: 1.6em; height: 1.6em; line-height: 1.6em; text-align: center; border-radius: 50%; background: var(--tint); color: var(--accent); font-weight: 700; font-size: .875em; margin-right: .3em; }
.pr-stem { font-size: var(--prose); }
.pr-option .nuc, .pr-solution .nuc, .pr-feedback .nuc { font-size: 1.35em; }
.pr-options { display: grid; gap: var(--s2); margin: var(--s3) 0; }
.pr-option { display: flex; gap: var(--s3); align-items: flex-start; border: 1px solid var(--line); border-radius: var(--radius-s); padding: var(--s3) var(--s4); cursor: pointer; background: var(--page); line-height: 1.6; }
.pr-option:hover { border-color: var(--accent); }
.pr-option input { margin-top: .35em; flex: none; width: 1.1rem; height: 1.1rem; accent-color: var(--action); }
.pr-option:has(input:checked) { border-color: var(--action); background: var(--tint); }
.pr-decision { border-radius: var(--radius-s); padding: var(--s3) var(--s4); margin: var(--s3) 0; background: var(--page); }
.pr-imprint { display: inline-block; font-size: .75rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #fff; background: var(--accent); border-radius: 4px; padding: .05rem .4rem; margin-right: .35rem; vertical-align: .1em; }
.pr-fields { display: flex; flex-wrap: wrap; gap: var(--s3) var(--s5); margin: var(--s3) 0; }
.pr-field { display: flex; flex-direction: column; gap: var(--s1); }
.pr-field label { font-size: .9375rem; color: var(--muted); }
.pr-field input { font: inherit; font-size: 1.0625rem; width: 9.5rem; max-width: 100%; padding: var(--s2) var(--s3); border: 1px solid var(--line); border-radius: var(--radius-s); background: #fff; }
.pr-field input.is-ok { border-color: var(--ok); background: var(--ok-tint); }
.pr-field input.is-no { border-color: var(--no); background: var(--no-tint); }
.pr-actions { display: flex; flex-wrap: wrap; gap: var(--s2); margin: var(--s3) 0; }
.pr-btn { font: inherit; font-size: .9375rem; font-weight: 600; padding: var(--s2) var(--s4); border-radius: var(--radius-s); border: 1px solid var(--action); background: #fff; color: var(--action); cursor: pointer; min-height: 2.75rem; }
.pr-btn:hover { background: var(--tint); }
.pr-btn.primary { background: var(--action); color: #fff; }
.pr-btn.primary:hover { background: var(--action-hover); }
.pr-btn[disabled] { opacity: .55; cursor: default; }
.pr-feedback:empty { display: none; }
.pr-feedback { border-radius: var(--radius-s); padding: var(--s3) var(--s4); margin: var(--s2) 0; line-height: 1.6; }
.pr-feedback.ok { background: var(--ok-tint); border-left: 3px solid var(--ok); }
.pr-feedback.no { background: var(--no-tint); border-left: 3px solid var(--no); }
.pr-hints { list-style: none; padding: 0 !important; margin: 0; }
.pr-hint { background: var(--tint); border-radius: var(--radius-s); padding: var(--s3) var(--s4); margin: var(--s2) 0; }
.pr-solution { border-top: 1px solid var(--line); margin-top: var(--s3); padding-top: var(--s3); }
.pr-solution h4 { margin-bottom: var(--s2); }
.pr-idea:empty { display: none; }
.pr-idea { border: 1px dashed var(--accent); border-radius: var(--radius-s); padding: var(--s3) var(--s4); margin-top: var(--s3); }
.pr-idea p { margin-bottom: var(--s2); }
.pr-idea-title { font-size: .8125rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); margin-bottom: var(--s1) !important; }
.pr-widget-link { font-size: .9375rem; margin: 0 0 var(--s2); }
.pr-log { list-style: none; padding: 0 !important; }
.pr-log li { border-bottom: 1px solid var(--line); padding: var(--s3) 0; }
.pr-log li p { margin-bottom: var(--s1); }
.pr-log-count { font-size: 1rem; }
.pr-diag-summary:empty { display: none; }

/* atom builder */
.ab-wrap { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); gap: var(--s5); align-items: start; }
.ab-svg { width: 100%; max-width: 320px; height: auto; display: block; margin: 0 auto; }
.ab-cloud { fill: #eef2f6; stroke: #c8d3dd; stroke-dasharray: 3 4; }
.ab-p { fill: #b3412e; stroke: #fff; stroke-width: 1; }
.ab-n { fill: #8a96a0; stroke: #fff; stroke-width: 1; }
.ab-e { fill: #355b90; }
.ab-readout p { margin-bottom: var(--s2); }
.reading-body .ab-symbol { font-size: 2.5rem; line-height: 1.2; }
.ab-math { font-family: var(--math); font-size: 1rem; background: var(--page); border-radius: var(--radius-s); padding: var(--s2) var(--s3); }
.ab-controls { display: grid; gap: var(--s2); margin: var(--s3) 0; }
.ab-row { display: grid; grid-template-columns: minmax(5.5rem, 1fr) 2.75rem 3rem 2.75rem; align-items: center; gap: var(--s2); }
.ab-label { font-weight: 600; }
.ab-p .ab-label { color: #b3412e; } .ab-n .ab-label { color: #5d6a74; } .ab-e .ab-label { color: #355b90; }
.ab-step { font: inherit; font-size: 1.25rem; width: 2.75rem; height: 2.75rem; border-radius: var(--radius-s); border: 1px solid var(--action); background: #fff; color: var(--action); cursor: pointer; }
.ab-step:hover { background: var(--tint); }
.ab-count { text-align: center; font-size: 1.25rem; font-variant-numeric: tabular-nums; font-weight: 700; }
.ab-tasks ol { padding-left: 1.3rem; }
.ab-tasks li { margin-bottom: var(--s3); }
.ab-tasks li p { margin-bottom: var(--s2); }
.ab-tasks .pr-btn { margin: 0 var(--s2) var(--s2) 0; }

/* isotope lab */
.il-controls { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s2) var(--s3); align-items: center; margin-bottom: var(--s3); }
.il-controls select { font: inherit; padding: var(--s2); border-radius: var(--radius-s); border: 1px solid var(--line); background: #fff; max-width: 100%; }
.il-controls input[type=range] { width: 100%; accent-color: var(--action); min-height: 2.75rem; }
.il-controls .pr-btn { grid-column: 1 / -1; justify-self: start; }
#il-slider-label { grid-column: 1 / -1; font-weight: 600; }
.il-svg { width: 100%; max-width: 560px; height: auto; display: block; }
.il-axis { stroke: #172b3a; stroke-width: 1.2; }
.il-bar { fill: #355b90; }
.il-label { font-size: 11px; fill: #4d5d69; }
.il-tick { font-size: 11px; fill: #172b3a; }
.il-natural { stroke: #1f6b45; stroke-width: 2; stroke-dasharray: 3 3; }
.il-natural-t { font-size: 10.5px; fill: #1f6b45; }
.il-fulcrum { fill: #b3412e; }
.il-avg { stroke: #b3412e; stroke-width: 1.4; stroke-dasharray: 4 3; }
.il-avg-t { font-size: 12px; font-weight: 700; fill: #b3412e; }
.il-readout { font-size: 1rem !important; }

/* language practice: written answers, ordering, locating, criteria, audio, recording */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pr-feedback.maybe { background: #fdf6e3; border-left: 3px solid #8a5a00; }
.pr-feedback ul { margin: var(--s2) 0; padding-left: 1.2rem; }
.pr-feedback p:last-child { margin-bottom: 0; }
.pr-label { display: block; font-size: .9375rem; color: var(--muted); margin: var(--s2) 0 var(--s1); }
.pr-text { display: block; width: 100%; font: inherit; font-size: 1.0625rem; line-height: 1.6; padding: var(--s2) var(--s3); border: 1px solid var(--line); border-radius: var(--radius-s); background: #fff; color: var(--ink); }
textarea.pr-text { resize: vertical; min-height: 4.5rem; }
.pr-text:focus, .pr-sent:focus-visible, .pr-step:focus-visible, .pr-time:focus-visible, .pr-chip:focus-within { outline: 3px solid var(--action); outline-offset: 2px; }
.pr-passage { background: var(--page); border-left: 3px solid var(--accent); border-radius: 0 var(--radius-s) var(--radius-s) 0; padding: var(--s3) var(--s4); margin: var(--s3) 0; line-height: 1.75; }
.pr-locate-text { line-height: 2.1; }
.pr-sent { font: inherit; color: var(--ink); text-align: left; background: transparent; border: 0; border-bottom: 2px dotted var(--line); padding: .1em .05em; cursor: pointer; display: inline; line-height: inherit; }
.pr-sent:hover { background: var(--tint); }
.pr-sent[aria-pressed="true"] { background: var(--tint); border-bottom: 2px solid var(--action); }
.pr-order-list { list-style: decimal; padding-left: 1.6rem !important; margin: var(--s3) 0; }
.pr-order-item { display: flex; gap: var(--s3); align-items: center; justify-content: space-between; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--page); padding: var(--s2) var(--s3); margin: var(--s2) 0; }
.pr-order-text { flex: 1; min-width: 0; }
.pr-order-btns { display: flex; gap: var(--s1); flex: none; }
.pr-step { font: inherit; font-size: 1.1rem; width: 2.75rem; height: 2.75rem; border-radius: var(--radius-s); border: 1px solid var(--action); background: #fff; color: var(--action); cursor: pointer; }
.pr-step[disabled] { opacity: .35; cursor: default; }
.pr-self { border: 1px solid var(--line); border-radius: var(--radius-s); padding: var(--s3) var(--s4); margin: var(--s3) 0; background: var(--page); }
.pr-self legend { font-weight: 700; padding: 0 var(--s1); }
.pr-crit { border-bottom: 1px solid var(--line); padding: var(--s2) 0; }
.pr-crit p { margin-bottom: var(--s2); }
.pr-crit-opts { display: flex; flex-wrap: wrap; gap: var(--s2); }
.pr-chip { display: inline-flex; align-items: center; gap: var(--s2); border: 1px solid var(--line); border-radius: 999px; padding: var(--s1) var(--s3); background: #fff; cursor: pointer; min-height: 2.75rem; }
.pr-chip:has(input:checked) { border-color: var(--action); background: var(--tint); font-weight: 600; }
.pr-chip input { accent-color: var(--action); }
.pr-models { margin-top: var(--s3); }
.pr-models figure { margin: var(--s3) 0; }
.pr-task { background: var(--tint); border-radius: var(--radius-s); padding: var(--s3) var(--s4); margin-bottom: var(--s3); }
.pr-task p:last-child { margin-bottom: 0; }
.pr-count { font-size: .875rem; margin: var(--s1) 0 0; }
.pr-ar, .pr-alt { margin: var(--s2) 0; }
.pr-ar summary, .pr-alt summary { cursor: pointer; color: var(--action); font-weight: 600; min-height: 2.75rem; display: flex; align-items: center; gap: .3em; }
.pr-ar p[lang="ar"] { font-family: 'Segoe UI', Tahoma, Arial, sans-serif; line-height: 1.9; }
.pr-audio { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: var(--s4); margin: var(--s4) 0; }
.pr-audio audio, .pr-rec-audio { width: 100%; margin: var(--s2) 0; }
.pr-speed .pr-btn[aria-pressed="true"] { background: var(--tint); }
.pr-voice { font-size: .875rem; }
.pr-lines { list-style: none; padding: 0 !important; margin: var(--s2) 0; }
.pr-lines li { display: flex; gap: var(--s2); align-items: baseline; padding: var(--s1) 0; border-bottom: 1px solid var(--line); }
.pr-time { font: inherit; font-size: .875rem; font-variant-numeric: tabular-nums; color: var(--action); background: none; border: 1px solid var(--line); border-radius: var(--radius-s); min-width: 3.4rem; min-height: 2.25rem; cursor: pointer; flex: none; }
.pr-rec { border: 1px dashed var(--accent); border-radius: var(--radius-s); padding: var(--s3) var(--s4); margin: var(--s3) 0; }
.pr-rec-status { font-weight: 600; }
.english .language-mention, .pr-card i { font-style: italic; }

/* sentence map (English lesson 01) */
.sl-sentence { font-size: 1.125rem; line-height: 2.9; margin: var(--s3) 0; }
.sl-part { display: inline; padding: .15em .25em; border-radius: 3px; position: relative; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.sl-part[data-role] { border-bottom: 3px solid; }
.sl-part .sl-role { font-size: .6875rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; margin-left: .3em; vertical-align: .15em; white-space: nowrap; }
.sl-subject { background: #e4edf8; border-color: #2f5d9a !important; } .sl-subject .sl-role { color: #24497a; }
.sl-verb { background: #fbe9e4; border-color: #a33a27 !important; } .sl-verb .sl-role { color: #8a2f1f; }
.sl-connector { background: #efe6f4; border-color: #67436c !important; } .sl-connector .sl-role { color: #67436c; }
.sl-dependent { background: #fdf3dc; border-color: #8a5a00 !important; border-bottom-style: dashed !important; } .sl-dependent .sl-role { color: #6b4600; }
.sl-boundary { background: #fbe0db; border: 2px solid #a33a27 !important; border-radius: 4px; padding: 0 .3em; }
.sl-boundary-ok { background: #e9f4ee; border: 2px solid #1f6b45 !important; border-radius: 4px; padding: 0 .3em; }
.sl-legend { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); font-size: .875rem; margin: var(--s2) 0; padding: 0 !important; list-style: none; }
.sl-legend li { display: inline-flex; align-items: center; gap: .4em; }
.sl-key { display: inline-block; width: 1.4em; height: .9em; border-bottom: 3px solid; border-radius: 2px; }
.sl-picker { display: flex; flex-wrap: wrap; gap: var(--s2); margin: var(--s2) 0 var(--s3); }
.sl-picker .pr-btn[aria-pressed="true"] { background: var(--action); color: #fff; }
.sl-status { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); gap: var(--s3); }
.sl-status > div { border-radius: var(--radius-s); padding: var(--s3) var(--s4); border-left: 3px solid var(--line); background: var(--page); }
.sl-status .ok { border-color: var(--ok); background: var(--ok-tint); }
.sl-status .no { border-color: var(--no); background: var(--no-tint); }
.sl-status h4 { font-size: .8125rem; letter-spacing: .05em; text-transform: uppercase; margin-bottom: var(--s1); }
.sl-status p { margin: 0; }
.sl-clauses { display: grid; gap: var(--s2); margin: var(--s3) 0; }
.sl-clauses label { font-weight: 600; }
.sl-clauses select { font: inherit; padding: var(--s2); border-radius: var(--radius-s); border: 1px solid var(--line); background: #fff; max-width: 100%; min-height: 2.75rem; }

/* note frame (English lesson 16) */
.nf-grid { display: grid; gap: var(--s2); margin: var(--s3) 0; }
.nf-row { display: grid; grid-template-columns: minmax(7rem, 9rem) minmax(0, 1fr); gap: var(--s3); align-items: start; }
.nf-row label { font-weight: 600; padding-top: var(--s2); }
.nf-row .pr-text { min-height: 2.75rem; }
@media (max-width: 760px) { .nf-row { grid-template-columns: 1fr; gap: var(--s1); } .nf-row label { padding-top: 0; } .sl-sentence { font-size: 1.0625rem; } }

@media (max-width: 760px) {
  .ab-svg { max-width: 240px; }
  .pr-card { padding: var(--s3) var(--s4); }
  .pr-option { padding: var(--s3); }
  .ab-row { grid-template-columns: 1fr 2.75rem 3rem 2.75rem; }
}
@media (max-width: 760px) {
  .stack-table table, .stack-table thead, .stack-table tbody, .stack-table tr, .stack-table th, .stack-table td, .stack-table caption { display: block; }
  .stack-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .stack-table tr { border: 1px solid var(--line); border-radius: var(--radius-s); margin: var(--s3) 0; padding: var(--s2) var(--s3); background: var(--surface); }
  .stack-table th, .stack-table td { border: 0 !important; padding: var(--s1) 0 !important; text-align: left; }
  .stack-table td[data-label]::before { content: attr(data-label) ": "; font-weight: 600; color: var(--muted); }
  .stack-table caption { text-align: left; margin-bottom: var(--s2); }
}
@media print {
  .pr-actions, .ab-controls, .il-controls, .ab-tasks button, .pr-rec, .sl-picker { display: none; }
}

/* ---------- dark reading theme (screen only; print keeps the light rules above) ---------- */
@media screen {
  :root { --ok: #7dc59a; --ok-tint: #1f2e25; --no: #ee8f7a; --no-tint: #36221e; }
  .pr-imprint { color: var(--on-action); }
  .pr-field input, .pr-text, .pr-chip, .il-controls select, .sl-clauses select { background: var(--page); color: var(--ink); border-color: var(--control-line); }
  .pr-option, .pr-order-item { border-color: var(--control-line); }
  .pr-btn, .ab-step, .pr-step { background: transparent; color: var(--action); border-color: var(--action); }
  .pr-btn:hover, .ab-step:hover, .pr-step:hover { background: var(--tint); }
  .pr-btn.primary, .sl-picker .pr-btn[aria-pressed="true"] { background: var(--action); color: var(--on-action); }
  .pr-btn.primary:hover { background: var(--action-hover); }
  .pr-time { border-color: var(--control-line); }
  .pr-feedback.maybe { background: #33291a; border-left-color: #d9a84e; }
  input::placeholder, textarea::placeholder { color: #8a8580; }

  /* atom builder and isotope lab */
  .ab-cloud { fill: #2b2f36; stroke: #55606b; }
  .ab-p { fill: #e8836f; stroke: #191919; }
  .ab-n { fill: #9aa3ab; stroke: #191919; }
  .ab-e { fill: #8fb0e0; }
  .ab-p .ab-label { color: #ee8f7a; } .ab-n .ab-label { color: #b5b2ad; } .ab-e .ab-label { color: #8fb0e0; }
  .il-axis { stroke: #e8e6e3; }
  .il-bar { fill: #8fb0e0; }
  .il-label { fill: #b5b2ad; }
  .il-tick { fill: #e8e6e3; }
  .il-natural { stroke: #7dc59a; } .il-natural-t { fill: #7dc59a; }
  .il-fulcrum { fill: #ee8f7a; }
  .il-avg { stroke: #ee8f7a; } .il-avg-t { fill: #ee8f7a; }

  /* sentence map: same roles, dark tints with light role labels */
  .sl-subject { background: #22304a; border-color: #8fb0e0 !important; } .sl-subject .sl-role { color: #a9c3ea; }
  .sl-verb { background: #3a2420; border-color: #ee8f7a !important; } .sl-verb .sl-role { color: #f2a593; }
  .sl-connector { background: #33263a; border-color: #c9a0d0 !important; } .sl-connector .sl-role { color: #d6b4dc; }
  .sl-dependent { background: #33291a; border-color: #d9a84e !important; } .sl-dependent .sl-role { color: #e3bb6b; }
  .sl-boundary { background: #3a2420; border-color: #ee8f7a !important; }
  .sl-boundary-ok { background: #1f2e25; border-color: #7dc59a !important; }
}


/* bf-ds v2 map: start — يولّده _unify/sync-ds.mjs؛ لا تعدّل هنا */
:root{--ok:var(--bf-success);--ok-tint:var(--bf-success-tint);--no:var(--bf-danger);--no-tint:var(--bf-danger-tint)}
/* bf-ds v2 map: end */
