/* Python Practice problems (docs/python-practice.md). Loaded together with sql-cells.css, which holds the shared practice
   styles (.pr-meta, .pr-verdict, .sc-*). Without JavaScript every step, the solutions and the explanations stay visible. */
.pyp { counter-reset: pyp-step; }
.pyp-step { margin-top: 1.6rem; padding-top: .2rem; border-top: 1px solid var(--line); }
.pyp-step > h2 { counter-increment: pyp-step; margin-top: .8rem; font-size: 1.15rem; }
.pyp-step > h2::before { content: "Step " counter(pyp-step) " \00B7  "; color: var(--muted); font-weight: 600; }
.js-pyp .pyp-step.is-locked { display: none; }
.js-pyp .pyp-step.pyp-live { animation: pyp-in .25s ease-out; }
@media (prefers-reduced-motion: reduce) { .js-pyp .pyp-step.pyp-live { animation: none; } }
@keyframes pyp-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.pyp-skip { margin: 0 0 .5rem; padding: 8px 12px; font-size: .9rem; color: var(--muted); background: var(--surface-2); border-radius: var(--radius-sm); }
.pyp-link { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; cursor: pointer; font: inherit; }

/* questions */
.pyp-q { margin: 1rem 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.pyp-q > p:first-child { margin-top: 0; }
.js-pyp .pyp-why[hidden] { display: none; }
.pyp-why { margin-top: .6rem; padding-top: .6rem; border-top: 1px dashed var(--line); }
.pyp-answer { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: .4rem; }
.pyp-text { flex: 1 1 14rem; min-width: 0; padding: 8px 10px; font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.pyp-choices { display: grid; gap: 6px; margin: .4rem 0; width: 100%; }
.pyp-choice { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; }
.pyp-choice input { margin-top: .3em; }
.pyp-choice code { white-space: pre-wrap; }
.pyp-answer:has(.pyp-choices) { display: block; }
.pyp-answer:has(.pyp-choices) .pyp-check { margin-top: .4rem; }
.pyp-feedback { margin: .5rem 0 0; min-height: 1.2em; font-weight: 600; font-size: .92rem; }
.pyp-feedback.is-right { color: #1b6e3a; }
.pyp-feedback.is-wrong { color: #8a5a00; }
.pyp-feedback.is-shown { color: var(--muted); }
:root[data-theme="dark"] .pyp-feedback.is-right { color: #7fd69b; }
:root[data-theme="dark"] .pyp-feedback.is-wrong { color: #f0c46a; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .pyp-feedback.is-right { color: #7fd69b; }
  :root:not([data-theme="light"]) .pyp-feedback.is-wrong { color: #f0c46a; }
}
.pyp-continue { margin-top: 1rem; }

/* coding */
.pyp-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; tab-size: 4; white-space: pre; overflow-x: auto; }
.pr-verdict.is-run { background: var(--surface-2); color: var(--muted); }
.pyp-results { padding: 0 14px 10px; }
.pyp-results:empty { display: none; }
.pyp-small { margin: .8rem 0 .3rem; font-size: .85rem; color: var(--muted); }
.pyp-output { margin: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); white-space: pre-wrap; overflow-x: auto; font-size: .85rem; }
.pyp-tests { list-style: none; margin: .4rem 0 0; padding: 0; display: grid; gap: 4px; font-size: .9rem; }
.pyp-tests li { padding: 6px 10px; border-left: 4px solid var(--line); background: var(--surface-2); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.pyp-tests li.is-ok { border-left-color: #1b6e3a; }
.pyp-tests li.is-bad { border-left-color: #b3261e; }
.pyp-detail { display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px; margin: .4rem 0 0; font-size: .85rem; }
.pyp-detail dt { color: var(--muted); }
.pyp-detail dd { margin: 0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-wrap: anywhere; white-space: pre-wrap; }

/* pieces of a problem */
.pyp details { margin: .6rem 0; padding: 6px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.pyp details summary { cursor: pointer; font-weight: 600; }
.pyp-solution { margin: 1rem 0; }
.pyp-spec[hidden] { display: none; }
.pyp-pattern { margin: 1rem 0; padding: 12px 14px; border-left: 4px solid var(--accent); background: var(--surface-2); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.pyp-pattern > :first-child { margin-top: 0; }
.pyp-pattern > :last-child { margin-bottom: 0; }

/* "Try your own call" under the editor */
.pyp-try { display: flex; gap: 8px; padding: 8px 14px; border-top: 1px solid var(--line); background: var(--surface-2); }
.pyp-try-input { flex: 1 1 auto; min-width: 0; padding: 7px 10px; font: inherit; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9rem; color: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.pyp-try-button { padding: 7px 14px; font: inherit; font-size: .9rem; font-weight: 600; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; }
.pyp-try-out { margin: 0; padding: 8px 14px; border-top: 1px solid var(--line); background: var(--surface-2); font-size: .88rem; white-space: pre-wrap; overflow-x: auto; }
.pyp-try-out[hidden] { display: none; }
