/* /practice: on top of ../learn/learn.css (tokens, cards, buttons, the header and the paper). */

.pr-main { min-height: calc(var(--app-h, 100dvh) - 64px); }
.pr-home { padding-bottom: var(--space-16); }
.pr-decks { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: var(--space-4); }
.pr-deck { align-items: flex-start; }
.pr-deck__meta { margin-top: var(--space-2); }

/* One case: the editor's workspace without its knobs (see ../styles.css,
   "Shell"). App bar, control bar, the paper on a pasteboard with "Your read"
   docked on the right, a status bar. Only the dock scrolls. */
:root { --pr-chrome: #fbfaf8; --pr-pasteboard: #e9e6e1; }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) { --pr-chrome: #1e1c1b; --pr-pasteboard: #121110; } }
:root[data-theme='dark'] { --pr-chrome: #1e1c1b; --pr-pasteboard: #121110; }

.pr-app { height: 100vh; height: var(--app-h, 100dvh); display: flex; flex-direction: column; overflow: hidden; background: var(--pr-pasteboard); }
.pr-spacer { flex: 1; }

.pr-appbar { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 8px 0 6px; background: var(--pr-chrome); border-bottom: 1px solid var(--border); font-size: 13px; }
.pr-appbar__exit { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; color: var(--text-secondary); }
.pr-appbar__exit:hover { background: var(--surface-sunken); color: var(--text); }
.pr-appbar__brand { font-family: var(--font-display); font-weight: 800; letter-spacing: -0.01em; color: var(--text); text-decoration: none; }
.pr-appbar__crumb, .pr-appbar__sep { color: var(--text-muted); }
.pr-appbar__title { font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.pr-appbar__link { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 8px; color: var(--text-secondary); font-weight: 600; text-decoration: none; }
.pr-appbar__link:hover { background: var(--surface-sunken); color: var(--text); }
.pr-appbar .kg-seg { padding: 2px; }
.pr-appbar .kg-seg__btn { height: 24px; width: 28px; }
.pr-appbar .btn--sm { min-height: 28px; padding-block: 0; font-size: 13px; }

.pr-controlbar { flex: 0 0 auto; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; padding: 6px 12px; background: var(--pr-chrome); border-bottom: 1px solid var(--border); }
.pr-cb-label { font-size: 11.5px; font-weight: 600; color: var(--text-muted); }
.pr-cb-group { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pr-controlbar .kg-seg { padding: 2px; }
.pr-controlbar .kg-seg__btn { height: 26px; padding: 0 10px; font-size: 12.5px; }
.pr-select { height: 30px; padding: 0 26px 0 10px; border-radius: var(--radius-pill); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-size: 12.5px; font-weight: 600; }
.pr-select[hidden] { display: none; }
.pr-cb-btn { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 12px; border-radius: var(--radius-pill); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-size: 12.5px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.pr-cb-btn:hover { border-color: var(--text-muted); }
button.pr-cb-btn { font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.pr-cb-btn[aria-pressed='true'] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.pr-workspace.dock-hidden .pr-dock, .pr-workspace.dock-hidden .splitter { display: none; }

.pr-workspace { --sidebar-w: 340px; flex: 1 1 auto; min-height: 0; display: flex; }
.pr-workspace.resizing { cursor: col-resize; user-select: none; }
.pr-canvas { flex: 1 1 auto; min-width: 0; padding: 20px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.pr-canvas .kg-paper { width: auto; flex: 0 0 auto; border-radius: 3px; box-shadow: 0 1px 2px rgba(0,0,0,0.12), 0 8px 28px rgba(0,0,0,0.14); background: #fff; }

.pr-workspace .splitter { flex: 0 0 7px; position: relative; cursor: col-resize; touch-action: none; outline: none; background: var(--pr-chrome); border-left: 1px solid var(--border); }
.pr-workspace .splitter::after { content: ""; position: absolute; top: 50%; left: 50%; width: 3px; height: 28px; margin: -14px 0 0 -1.5px; border-radius: 2px; background: var(--border-strong); }
.pr-workspace .splitter:hover, .pr-workspace .splitter:focus-visible, .pr-workspace.resizing .splitter { background: var(--accent-soft); }
.pr-workspace .splitter:hover::after, .pr-workspace .splitter:focus-visible::after, .pr-workspace.resizing .splitter::after { background: var(--accent); }

.pr-dock { flex: 0 0 var(--sidebar-w); width: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; background: var(--pr-chrome); overflow-y: auto; overscroll-behavior: contain; }
.pr-dock__head { flex: 0 0 auto; position: sticky; top: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 38px; padding: 0 16px; background: var(--pr-chrome); border-bottom: 1px solid var(--border); }
.pr-dock__title { margin: 0; font-family: var(--font-display); font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-secondary); }
.pr-dock__count { font-size: 12px; color: var(--text-muted); }
.pr-dock__body { flex: 1 0 auto; display: flex; flex-direction: column; gap: var(--space-4); padding: 14px 16px 0; }

.pr-statusbar { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; height: 28px; padding: 0 12px; font-size: 12px; color: var(--text-secondary); background: var(--pr-chrome); border-top: 1px solid var(--border); white-space: nowrap; overflow: hidden; }
.pr-sb-k { color: var(--text-muted); font-weight: 600; }
.pr-caliper { overflow: hidden; text-overflow: ellipsis; min-width: 0; color: var(--text-muted); }
.pr-caliper.is-reading { color: var(--accent-2, #2f6fed); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.pr-sb-info { color: var(--text-muted); }

/* Narrow screens: as in the editor, stack the paper above the panel and let
   the page scroll. The paper stays pinned at the top while you answer. */
@media (max-width: 900px) {
  .pr-app { height: auto; min-height: var(--app-h, 100dvh); overflow: visible; }
  .pr-workspace { flex-direction: column; }
  .pr-workspace .splitter { display: none; }
  .pr-canvas { --pr-stacked: 1; position: sticky; top: 0; z-index: 5; padding: 10px; background: var(--pr-pasteboard); box-shadow: 0 6px 16px rgba(0,0,0,0.08); }
  .pr-dock { flex: none; width: auto; overflow: visible; }
  .pr-dock__head { position: static; }
  .pr-statusbar, .pr-hide-stacked { display: none; }
  .pr-workspace.dock-hidden .pr-dock { display: flex; }
}
@media (max-width: 640px) {
  .pr-hide-sm { display: none; }
  .pr-controlbar { padding: 6px 10px; }
  /* Phones: the strip and the 12-lead keep a readable scale and scroll sideways
     (as the landing hero does) instead of shrinking to the screen. Auto margins
     center a paper that fits and let one that doesn't start at its left edge. */
  .pr-canvas { --pr-scroll: 1; justify-content: flex-start; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scrollbar-width: thin; }
  .pr-canvas .kg-paper { margin: 0 auto; }
  .pr-canvas.is-scrolling .kg-paper { margin: 0; max-width: none; }
  .pr-canvas.is-scrolling::after { content: ""; flex: 0 0 10px; }
}

/* The answers */
.pr-form { display: flex; flex-direction: column; gap: var(--space-5); }
.pr-section { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-4); }
.pr-section + .pr-section { border-top: 1px solid var(--border); padding-top: var(--space-5); }
.pr-section__title { padding: 0; margin-bottom: var(--space-1); font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.pr-field { display: flex; flex-direction: column; gap: var(--space-2); }
.pr-field__label { font-weight: 600; }
.pr-field__help { margin: -4px 0 0; font-size: var(--text-sm); color: var(--text-muted); }

.pr-pills { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.pr-pill { min-height: 36px; padding: 6px 14px; border-radius: var(--radius-pill); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-secondary); font: inherit; font-size: var(--text-sm); font-weight: 600; cursor: pointer; transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out); }
.pr-pill:hover:not(:disabled) { border-color: var(--text-muted); color: var(--text); }
.pr-pill[aria-checked='true'], .pr-pill[aria-pressed='true'] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.pr-pill:disabled { cursor: default; opacity: 0.7; }
.pr-pill:focus-visible, .pr-dial__svg:focus-visible, .pr-number__input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.pr-number { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2); }
.pr-number__box { display: inline-flex; align-items: center; height: 40px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); padding-right: 12px; }
.pr-number__input { width: 5.5em; height: 100%; border: 0; background: transparent; color: var(--text); font: inherit; font-size: var(--text-lg); font-weight: 700; padding: 0 8px 0 12px; border-radius: var(--radius-sm); }
.pr-number__input:disabled { color: var(--text-muted); }
.pr-number__unit { color: var(--text-muted); font-size: var(--text-sm); font-weight: 600; }
.pr-number__use { white-space: nowrap; }

.pr-check { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); color: var(--text-secondary); cursor: pointer; }
.pr-check__box { width: 18px; height: 18px; accent-color: var(--accent); }

/* The axis dial */
.pr-dial { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); }
.pr-dial__svg { width: min(100%, 260px); height: auto; touch-action: none; cursor: grab; color: var(--text); border-radius: 50%; user-select: none; }
.pr-dial__svg.is-disabled { cursor: default; }
.pr-dial__ring { fill: var(--surface-sunken); stroke: var(--border-strong); stroke-width: 1; }
.pr-dial__normal { fill: none; stroke: var(--tone-normal); stroke-width: 5; stroke-linecap: round; opacity: 0.55; }
.pr-dial__lead { stroke: currentColor; stroke-opacity: 0.22; stroke-width: 1; }
.pr-dial__lead--neg { stroke-dasharray: 2 3; stroke-opacity: 0.14; }
.pr-dial__label { fill: currentColor; fill-opacity: 0.75; font-size: 11px; font-weight: 700; font-family: var(--font-sans); }
.pr-dial__deg { fill: currentColor; fill-opacity: 0.45; font-size: 8.5px; font-weight: 600; font-family: var(--font-sans); }
.pr-dial__arrow line { stroke: var(--accent); stroke-width: 4; stroke-linecap: round; }
.pr-dial__arrow circle { fill: var(--accent); }
.pr-dial__answer line { stroke: var(--tone-normal-ink); stroke-width: 3; stroke-dasharray: 5 4; stroke-linecap: round; }
.pr-dial__hub { fill: var(--text); }
.pr-dial__value { font-weight: 700; color: var(--text-secondary); }

/* After a submit */
.pr-form__foot { position: sticky; bottom: 0; margin: 0 -16px; padding: var(--space-3) 16px; background: var(--pr-chrome); border-top: 1px solid var(--border); display: flex; }
.pr-submit { width: 100%; justify-content: center; }
.pr-submit[hidden] { display: none; }
.pr-result { display: flex; flex-direction: column; gap: 2px; padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); font-size: var(--text-sm); }
.pr-result[hidden] { display: none; }
.pr-result__mark { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.pr-result__note { color: var(--text-secondary); }
.pr-result.is-right { background: var(--tone-normal-soft); }
.pr-result.is-right .pr-result__mark { color: var(--tone-normal-ink); }
.pr-result.is-close { background: var(--tone-borderline-soft); }
.pr-result.is-close .pr-result__mark { color: var(--tone-borderline-ink); }
.pr-result.is-wrong { background: var(--tone-critical-soft); }
.pr-result.is-wrong .pr-result__mark { color: var(--tone-critical-ink); }

.pr-summary { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-4); border-radius: var(--radius-md); background: var(--surface-sunken); scroll-margin-top: 90px; }
.pr-summary[hidden] { display: none; }
.pr-summary__score { display: flex; align-items: baseline; gap: var(--space-3); }
.pr-summary__pct { font-family: var(--font-display); font-size: var(--text-3xl); font-weight: 800; letter-spacing: -0.02em; }
.pr-summary__dx { margin: 0; }
.pr-summary .path__meta { margin: 0; }
