/* Loaded only by lessons with exercises; uses the Lab's existing theme tokens. */
.try-it { margin-block: 44px; padding-top: 22px; border-top: 1px solid var(--rule-strong); min-width: 0; }
.try-it-heading { display: flex; gap: 20px; align-items: end; justify-content: space-between; margin-bottom: 20px; }
.try-it-heading h2 { font-size: 30px; margin-top: 5px; }
.try-it-heading p, .exercise-help { font: 400 12px/1.6 var(--mono); color: var(--text); }
.try-it-heading p { margin: 0; }
.exercise-tabs { display: flex; overflow-x: auto; border-bottom: 1px solid var(--rule); margin-bottom: 24px; gap: 4px; }
.exercise-tabs button { border: 0; border-bottom: 3px solid transparent; background: none; padding: 12px 14px; font: 500 13px/1.5 var(--sans); color: var(--text); cursor: pointer; flex-shrink: 0; }
.exercise-tabs button[aria-selected="true"] { border-bottom-color: var(--crema); color: var(--ink); background: var(--crema-soft); }
.exercise-tabs [data-exercise-passed] { color: var(--good); }
.exercise-intro { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.exercise-intro h3 { font-size: 21px; }
[data-exercise-prompt] { max-width: 76ch; margin-block: 10px 20px; }
.exercise-workspace { display: grid; grid-template-columns: minmax(0,1fr); gap: 20px; }
.exercise-workspace:has(.exercise-preview-wrap:not([hidden])) { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
.exercise-input, .exercise-preview-wrap { min-width: 0; }
.exercise-input label { display: block; font: 500 12px/1.5 var(--mono); color: var(--ink); margin-bottom: 7px; }
.exercise-editor { display: flex; overflow: hidden; border: 1px solid var(--rule); background: var(--surface); border-radius: 4px; }
.exercise-editor:focus-within { outline: 2px solid var(--crema); outline-offset: 2px; }
.exercise-editor pre { margin: 0; padding: 14px 10px; background: var(--sunk); color: var(--text); text-align: right; user-select: none; min-width: 3ch; overflow: hidden; }
.exercise-editor textarea { display: block; flex: 1; min-width: 0; width: 100%; min-height: 230px; resize: vertical; border: 0; border-radius: 0; padding: 14px 12px; background: transparent; color: var(--ink); outline: none; tab-size: 2; }
.exercise-editor pre, .exercise-editor textarea { font: 400 14px/1.7 var(--mono); white-space: pre; }
.exercise-editor pre { max-height: 230px; }
.exercise-help { margin: 9px 0 16px; }
[data-exercise-stdin] { display: block; width: 100%; resize: vertical; padding: 10px 12px; font: 400 14px/1.5 var(--mono); color: var(--ink); background: var(--surface); border: 1px solid var(--rule); border-radius: 4px; }
.exercise-preview-wrap > .label { margin-bottom: 9px; }
[data-exercise-preview] { border: 1px solid var(--rule); min-height: 230px; background: #fff; }
[data-exercise-preview] iframe { display: block; width: 100%; min-height: 230px; border: 0; }
.exercise-actions { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; margin-block: 18px; }
.exercise-actions [role="status"] { font: 400 12px/1.5 var(--mono); margin-inline-start: auto; color: var(--text); }
.exercise-hint { padding: 12px 16px; background: var(--crema-soft); color: var(--ink); }
.exercise-feedback { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; border-top: 1px solid var(--rule); padding-top: 20px; }
.exercise-feedback section { min-width: 0; }
[data-exercise-output], .exercise-shown-code { overflow: auto; max-height: 260px; white-space: pre-wrap; overflow-wrap: anywhere; font: 400 13px/1.65 var(--mono); color: var(--ink); background: var(--sunk); padding: 14px; margin: 12px 0 0; }
.exercise-shown-code { margin: 0 0 18px; }
[data-exercise-checks] { padding: 0; margin: 12px 0 0; list-style: none; font-size: 14px; }
[data-exercise-checks] li { padding: 7px 0; border-bottom: 1px solid var(--rule); }
[data-exercise-checks] [data-passed="true"] { color: var(--good); }
[data-exercise-checks] [data-passed="false"] { color: var(--bad); }
.exercise-results { overflow: auto; max-height: 300px; }
.exercise-results table { border-collapse: collapse; font: 400 13px/1.6 var(--mono); margin-top: 12px; }
.exercise-results th, .exercise-results td { padding: 6px 12px; border: 1px solid var(--rule); text-align: start; }
.try-it [hidden] { display: none !important; }
@media (max-width: 650px) { .exercise-workspace:has(.exercise-preview-wrap:not([hidden])), .exercise-feedback { grid-template-columns: minmax(0,1fr); } .try-it-heading { align-items: start; } .try-it-heading p { max-width: 13ch; text-align: right; } .exercise-actions .btn { min-height: 42px; } .exercise-actions [role="status"] { margin-inline-start: 0; flex-basis: 100%; } }
@media (prefers-reduced-motion: reduce) { .try-it *, .try-it *::before, .try-it *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }
/* Fallback exercise prose keeps English code punctuation in reading order. */
html[dir="rtl"] [data-exercise-title], html[dir="rtl"] [data-exercise-prompt] { unicode-bidi: plaintext; }
