/* exercise.css — page-specific styles. Enqueue ONLY on the exercise template. */

.prac {
    max-width: 1320px; margin: 0 auto;
    padding: 44px 32px 80px;
  }

.prac-hero {
    margin-bottom: 36px;
    padding-bottom: 28px;
    border-bottom: 0.5px solid var(--line);
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 40px;
    align-items: end;
  }

.prac-hero-text { min-width: 0; }

.prac-hero-eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 11.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--t-code);
    margin-bottom: 12px;
    padding: 5px 12px 5px 11px;
    border-radius: 999px;
    background: var(--t-code-soft);
    border: 0.5px solid color-mix(in oklab, var(--t-code) 18%, transparent);
  }

.prac-hero-eyebrow svg { width: 13px; height: 13px; }

.prac-hero-title {
    font-family: var(--font-display);
    font-size: 42px; line-height: 1.08; font-weight: 700;
    letter-spacing: -0.022em;
    margin: 0 0 12px;
    color: var(--ink);
    text-wrap: balance;
  }

html[data-theme="editorial"] .prac-hero-title { font-size: 48px; }

.prac-hero-sub {
    font-size: 16.5px; color: var(--ink-2);
    margin: 0;
    max-width: 78ch;
    line-height: 1.5;
    text-wrap: pretty;
  }

.prac-hero-stats {
    display: flex; flex-direction: column;
    gap: 14px;
    align-items: flex-end;
    text-align: end;
  }

.prac-hero-stat {
    display: flex; flex-direction: column;
    gap: 2px;
  }

.prac-hero-stat .num {
    font-family: var(--font-display);
    font-size: 26px; font-weight: 700;
    color: var(--ink);
    line-height: 1;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
  }

.prac-hero-stat .num .total {
    color: var(--ink-3);
    font-size: 18px;
    font-weight: 500;
  }

.prac-hero-stat .lbl {
    font-size: 12px; color: var(--ink-3);
    font-weight: 500;
  }

.prac-hero-stat.ok .num { color: var(--ok); }

.prac-hero-stat.active .num { color: var(--accent); }

@media (max-width: 720px){
.prac-hero {
      grid-template-columns: 1fr;
      gap: 20px;
      margin-bottom: 22px;
      padding-bottom: 22px;
      align-items: start;
    }
.prac-hero-eyebrow { font-size: 11px; padding: 4px 10px; }
.prac-hero-title { font-size: 26px; text-wrap: balance; }
.prac-hero-sub { font-size: 14.5px; line-height: 1.6; }
.prac-hero-stats {
      flex-direction: row;
      flex-wrap: wrap;
      text-align: start;
      gap: 18px;
    }
.prac-hero-stat .num { font-size: 22px; }
.prac-hero-stat .num .total { font-size: 15px; }
.prac-hero-stat .lbl { font-size: 11.5px; }
}

@media (max-width: 420px){
.prac-hero-title { font-size: 22px; }
}

.prac-list {
    display: flex; flex-direction: column; gap: 14px;
  }

.prac-card {
    appearance: none; border: 0.5px solid var(--line);
    background: var(--bg-elev);
    border-radius: 18px;
    padding: 20px 24px;
    cursor: pointer;
    text-align: inherit; font: inherit; color: inherit;
    width: 100%;
    display: grid;
    grid-template-columns: 56px 1fr auto;
    gap: 18px;
    align-items: center;
    box-shadow: var(--shadow-card);
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
    position: relative;
    overflow: hidden;
  }

.prac-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-card-lg);
    border-color: color-mix(in oklab, var(--accent) 28%, transparent);
  }

.prac-card::before {
    content: ""; position: absolute;
    inset-inline-start: 0; top: 14px; bottom: 14px;
    width: 3px;
    background: var(--t-code);
    opacity: 0.3;
    border-radius: 3px;
  }

.prac-card.done::before { background: var(--ok); opacity: 0.85; }

.prac-card.in-progress::before { background: var(--accent); opacity: 0.85; }

.prac-card.submitted::before { background: #f5b91e; opacity: 0.85; }

.prac-card-num {
    width: 48px; height: 48px;
    border-radius: 14px;
    background: var(--t-code-soft);
    color: var(--t-code);
    display: inline-flex; align-items: center; justify-content: center;
    font-family: var(--font-display);
    font-size: 19px; font-weight: 700;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
  }

.prac-card.done .prac-card-num {
    background: var(--ok-soft); color: var(--ok);
  }

.prac-card.in-progress .prac-card-num {
    background: var(--accent-soft); color: var(--accent-ink);
  }

.prac-card.submitted .prac-card-num {
    background: rgba(245,185,30,0.15); color: #8a6800;
  }

html[data-dark="1"] .prac-card.submitted .prac-card-num { color: #f5c878; }

.prac-card-body { min-width: 0; }

.prac-card-title {
    font-family: var(--font-display);
    font-size: 18px; font-weight: 600; color: var(--ink);
    line-height: 1.3;
    margin: 0 0 4px;
    letter-spacing: -0.01em;
  }

.prac-card-sub {
    font-size: 14px; color: var(--ink-2);
    margin: 0 0 10px;
    line-height: 1.5;
    text-wrap: pretty;
  }

.prac-card-meta {
    display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
    font-size: 12px; color: var(--ink-3);
  }

.prac-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--bg-sunk);
    font-size: 11.5px; font-weight: 500;
  }

.prac-pill.diff-easy   { background: rgba(31,138,90,0.10); color: var(--ok); }

.prac-pill.diff-medium { background: rgba(184,134,43,0.12); color: #8a6800; }

.prac-pill.diff-hard   { background: rgba(199,90,58,0.14); color: var(--warn); }

html[data-dark="1"] .prac-pill.diff-medium { color: #f5c878; }

.prac-pill.status-done { background: var(--ok-soft); color: var(--ok); }

.prac-pill.status-in-progress { background: var(--accent-soft); color: var(--accent-ink); }

.prac-pill.status-submitted { background: rgba(245,185,30,0.15); color: #8a6800; }

html[data-dark="1"] .prac-pill.status-submitted { color: #f5c878; }

.prac-pill.status-not-started { background: var(--bg-sunk); color: var(--ink-3); }

.prac-pill svg { width: 13px; height: 13px; }

.prac-card-tail {
    flex-shrink: 0; align-self: center;
    display: flex; flex-direction: column; align-items: flex-end;
    gap: 8px;
  }

.prac-score {
    font-family: var(--font-display);
    font-size: 22px; font-weight: 700;
    color: var(--ok);
    line-height: 1;
    font-variant-numeric: tabular-nums;
  }

.prac-score .total { color: var(--ink-3); font-size: 14px; font-weight: 500; }

.prac-score-label { font-size: 11px; color: var(--ink-3); margin-top: 2px; }

.prac-cta {
    appearance: none; border: 0; cursor: pointer;
    padding: 9px 18px;
    border-radius: 999px;
    font-size: 13.5px; font-weight: 600;
    display: inline-flex; align-items: center; gap: 6px;
    transition: background .15s ease, transform .12s ease;
    white-space: nowrap;
  }

.prac-cta:active { transform: scale(0.97); }

.prac-cta.primary { background: var(--accent); color: #fff; }

.prac-cta.primary:hover { background: color-mix(in oklab, var(--accent) 85%, #000); }

.prac-cta.secondary { background: var(--bg-sunk); color: var(--ink); }

.prac-cta.secondary:hover { background: var(--accent-soft); color: var(--accent-ink); }

.prac-cta svg { width: 13px; height: 13px; }

.prac-feedback-strip {
    grid-column: 2 / -1;
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--bg);
    border: 0.5px solid var(--line-2);
    font-size: 13px;
    color: var(--ink-2);
    display: flex; gap: 10px; align-items: flex-start;
    line-height: 1.55;
  }

.prac-feedback-strip svg { flex-shrink: 0; width: 16px; height: 16px; color: var(--accent); margin-top: 2px; }

.prac-feedback-strip b { color: var(--ink); }

.prac-feedback-strip .ai-tag {
    flex-shrink: 0;
    margin-inline-start: auto;
    padding: 2px 8px; border-radius: 999px;
    background: var(--accent-soft); color: var(--accent-ink);
    font-size: 10.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  }

/* The exercise page IS the fixed .ws workspace — the document itself never
   scrolls. Forbid any stray horizontal overflow so a sub-pixel leak can't expose
   the page background as a strip at the edge. (exercise.css loads only here.) */
html, body { overflow-x: hidden; max-width: 100%; }

.ws {
    position: fixed; inset: 0; z-index: 60;
    background: var(--bg);
    display: grid;
    grid-template-rows: auto 1fr;
    min-height: 0;
    overflow: hidden; /* backstop: nothing inside the workspace may widen the page */
  }

.ws.has-footer { grid-template-rows: auto 1fr auto; }

.ws-foot {
    display: flex; align-items: center; gap: 12px;
    padding: 8px 22px;
    background: var(--bg-elev);
    border-top: 0.5px solid var(--line);
    font-size: 12px; color: var(--ink-3);
    white-space: nowrap; overflow-x: auto; scrollbar-width: none;
  }

.ws-foot::-webkit-scrollbar { display: none; }

.ws-foot .spacer { flex: 1; }

.ws-foot a { color: var(--ink-2); text-decoration: none; transition: color .15s ease; }

.ws-foot a:hover { color: var(--ink); }

.ws-foot-brand {
    display: inline-flex; align-items: center; gap: 7px;
    font-family: var(--font-display); font-weight: 600; color: var(--ink) !important;
  }

.ws-foot-brand b { color: var(--accent); font-weight: 700; }

.ws-foot-mark {
    font-family: var(--font-mono); font-size: 11px; font-weight: 700;
    color: #fff; background: linear-gradient(135deg, var(--accent), color-mix(in oklab, var(--accent) 60%, var(--ok)));
    border-radius: 6px; padding: 2px 5px; line-height: 1;
  }

.ws-foot-sep, .ws-foot-mut { color: var(--ink-4); }

.ws-foot-mut { font-size: 11.5px; }

.ws-bar {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 22px;
    background: var(--bg-elev);
    border-bottom: 0.5px solid var(--line);
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
    min-width: 0; /* let children (the title) shrink instead of overflowing */
    overflow-x: auto; scrollbar-width: none; /* backstop: scroll, never widen the page */
  }
.ws-bar::-webkit-scrollbar { display: none; }

.ws-back {
    appearance: none; border: 0.5px solid var(--line);
    background: var(--bg);
    color: var(--ink-2);
    padding: 7px 12px;
    border-radius: 10px;
    cursor: pointer;
    text-decoration: none; /* it's an <a> — no default link underline */
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 13px; font-weight: 500;
    white-space: nowrap; flex-shrink: 0;
    transition: background .15s ease, color .15s ease;
  }
.ws-back:hover { text-decoration: none; }

.ws-back:hover { background: var(--bg-sunk); color: var(--ink); }

.ws-back svg { width: 14px; height: 14px; }

.ws-title { font-family: var(--font-display); font-size: 16px; font-weight: 600; color: var(--ink); flex: 0 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ws-bar .spacer { flex: 1; }

.ws-bar .ws-status {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12.5px;
    color: var(--ink-3);
    padding: 6px 12px;
    border-radius: 10px;
    background: var(--bg-sunk);
    white-space: nowrap; flex-shrink: 0;
  }

.ws-bar .ws-status.dirty { background: rgba(245,185,30,0.16); color: #8a6800; }

.ws-bar .ws-status.saved { background: var(--ok-soft); color: var(--ok); }

html[data-dark="1"] .ws-bar .ws-status.dirty { color: #f5c878; }

.ws-bar .ws-status .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.ws-inst-toggle {
    appearance: none; border: 0.5px solid var(--line);
    background: var(--bg);
    color: var(--ink-2);
    padding: 7px 12px;
    border-radius: 10px;
    cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12.5px; font-weight: 500;
    white-space: nowrap; flex-shrink: 0;
    transition: background .15s ease, color .15s ease;
  }

.ws-inst-toggle:hover { background: var(--bg-sunk); color: var(--ink); }

.ws-inst-toggle.active { background: var(--accent-soft); border-color: color-mix(in oklab, var(--accent) 24%, transparent); color: var(--accent-ink); }

.ws-inst-toggle svg { width: 14px; height: 14px; }

.ws-btn {
    appearance: none; border: 0; cursor: pointer;
    padding: 8px 14px;
    border-radius: 10px; /* rounded rectangle, never a circle */
    font-size: 13px; font-weight: 600;
    display: inline-flex; align-items: center; gap: 6px;
    white-space: nowrap; flex-shrink: 0; /* keep label on one line so it can't ball up */
    transition: background .15s ease, transform .12s ease;
  }

.ws-btn:active { transform: scale(0.97); }

.ws-btn.primary { background: var(--accent); color: #fff; }

.ws-btn.primary:hover { background: color-mix(in oklab, var(--accent) 90%, black 10%); }

.ws-btn.success { background: var(--ok); color: #fff; }

.ws-btn.success:hover { background: color-mix(in oklab, var(--ok) 92%, black 8%); }

.ws-btn.ghost { background: transparent; color: var(--ink-2); border: 0.5px solid var(--line); }

.ws-btn.ghost:hover { background: var(--bg-sunk); color: var(--ink); }

.ws-btn.warn { background: transparent; color: var(--warn); border: 0.5px solid color-mix(in oklab, var(--warn) 35%, var(--line)); }

.ws-btn.warn:hover { background: rgba(201,122,43,0.08); }

.ws-btn.disabled { background: var(--bg-sunk); color: var(--ink-3); pointer-events: none; }

.ws-btn svg { width: 14px; height: 14px; }

.ws-body {
    display: grid;
    grid-template-columns: minmax(0, var(--ws-inst-w, 320px)) 6px minmax(0, 1fr);
    gap: 8px;
    padding: 14px;
    min-height: 0;
    background: var(--bg);
    position: relative;
  }

.ws-body.inst-collapsed { grid-template-columns: 40px 6px 1fr; }

.ws-resizer {
    width: 6px;
    background: var(--line);
    cursor: col-resize;
    position: relative;
    align-self: stretch;
    border-radius: 3px;
    transition: background .15s ease;
    user-select: none;
  }

.ws-resizer::before {
    content: ""; position: absolute;
    top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 3px; height: 36px;
    border-radius: 3px;
    background: var(--ink-3);
    opacity: 0.5;
    transition: opacity .15s ease, background .15s ease;
  }

.ws-resizer:hover { background: color-mix(in oklab, var(--accent) 35%, var(--line)); }

.ws-resizer:hover::before { opacity: 1; background: var(--accent); }

.ws-resizer.dragging { background: var(--accent); }

.ws-resizer.dragging::before { opacity: 1; background: #fff; height: 56px; }

.ws-inst-rail {
    background: var(--bg-elev);
    border: 0.5px solid var(--line);
    border-radius: 14px;
    display: flex; flex-direction: column; align-items: center;
    padding: 12px 0;
    gap: 8px;
  }

.ws-inst-rail-btn {
    appearance: none; border: 0; background: transparent;
    width: 32px; height: 32px;
    border-radius: 8px;
    color: var(--ink-2);
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background .15s ease, color .15s ease;
  }

.ws-inst-rail-btn:hover { background: var(--accent-soft); color: var(--accent-ink); }

.ws-inst-rail-btn svg { width: 16px; height: 16px; }

.ws-inst-rail-label {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    font-size: 12px; font-weight: 600;
    color: var(--ink-3);
    letter-spacing: 0.04em;
    margin-top: 6px;
  }

.ws-pane-head .ws-collapse {
    margin-inline-start: auto;
    appearance: none; border: 0; background: transparent;
    width: 26px; height: 26px;
    border-radius: 6px;
    color: var(--ink-3);
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
  }

.ws-pane-head .ws-collapse:hover { background: var(--bg-sunk); color: var(--ink); }

.ws-pane-head .ws-collapse svg { width: 14px; height: 14px; }

.ws-pane {
    background: var(--bg-elev);
    border: 0.5px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
    display: flex; flex-direction: column;
    min-height: 0;
  }

.ws-pane-head {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px;
    border-bottom: 0.5px solid var(--line-2);
    font-size: 12px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase;
    color: var(--ink-3);
  }

.ws-pane-head svg { width: 14px; height: 14px; color: var(--ink-3); }

.ws-pane-head .menu {
    margin-inline-start: auto;
    display: flex; gap: 6px;
  }

.ws-pane-head .menu button {
    appearance: none; border: 0; background: transparent;
    color: var(--ink-3); cursor: pointer;
    padding: 4px 8px; border-radius: 6px;
    font-size: 11.5px; font-weight: 500;
    text-transform: none; letter-spacing: 0;
  }

.ws-pane-head .menu button:hover { background: var(--bg-sunk); color: var(--ink); }

.ws-pane-head .menu button svg { width: 12px; height: 12px; vertical-align: middle; margin-inline-start: 4px; color: inherit; }

.ws-inst-drawer {
    position: absolute; top: 14px; bottom: 14px;
    inset-inline-end: 14px;
    width: 380px;
    z-index: 25;
    background: var(--bg-elev);
    border: 0.5px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
    display: flex; flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.16);
    animation: wsInstIn .28s cubic-bezier(.16,1,.3,1);
  }

html[dir="rtl"] .ws-inst-drawer { animation-name: wsInstInRtl; }

.ws-inst-drawer-overlay {
    position: absolute; inset: 0; z-index: 20;
    background: rgba(0,0,0,0.18);
    -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
    animation: wsFadeIn .2s ease-out;
  }

.ws-inst-body {
    flex: 1; min-height: 0; overflow-y: auto;
    padding: 18px 22px 28px;
  }

.ws-inst-close {
    appearance: none; border: 0; background: var(--bg-sunk);
    width: 30px; height: 30px; border-radius: 50%;
    color: var(--ink-2); cursor: pointer;
    margin-inline-start: auto;
    display: inline-flex; align-items: center; justify-content: center;
  }

.ws-inst-close:hover { background: var(--accent-soft); color: var(--accent-ink); }

.ws-inst-close svg { width: 14px; height: 14px; }

.ws-inst-title {
    font-family: var(--font-display);
    font-size: 19px; font-weight: 700; line-height: 1.25;
    margin: 0 0 10px;
    letter-spacing: -0.01em;
  }

.ws-guest-banner {
    display: flex; gap: 12px; align-items: flex-start;
    margin: 12px 0 18px;
    padding: 14px 16px;
    border-radius: 14px;
    background: color-mix(in oklab, var(--accent) 8%, var(--bg-elev));
    border: 0.5px solid color-mix(in oklab, var(--accent) 28%, var(--line));
  }

.ws-guest-banner-ic {
    width: 34px; height: 34px;
    border-radius: 10px;
    background: var(--bg-elev);
    border: 0.5px solid color-mix(in oklab, var(--accent) 26%, var(--line));
    color: var(--accent);
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0;
  }

.ws-guest-banner-ic svg { width: 16px; height: 16px; }

.ws-guest-banner-title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 3px;
  }

.ws-guest-banner-text {
    font-size: 12.5px;
    color: var(--ink-2);
    line-height: 1.55;
  }

.ws-guest-banner-text a {
    color: var(--accent-ink);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: color-mix(in oklab, var(--accent) 40%, transparent);
    text-underline-offset: 2px;
  }

.ws-guest-banner-text a:hover {
    text-decoration-color: var(--accent);
  }

.ws-inst-diff {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 10px; border-radius: 999px;
    font-size: 11.5px; font-weight: 600;
    margin-bottom: 14px;
  }

.ws-inst-body p { font-size: 14px; line-height: 1.65; color: var(--ink-2); margin: 0 0 12px; }

.ws-inst-body h4 {
    font-family: var(--font-display);
    font-size: 14px; font-weight: 600;
    margin: 18px 0 8px;
    color: var(--ink);
  }

.ws-inst-body ul { padding-inline-start: 22px; margin: 0 0 12px; }

.ws-inst-body li { font-size: 14px; color: var(--ink-2); margin-bottom: 6px; line-height: 1.55; }

.ws-inst-body code {
    font-family: var(--font-mono); font-size: 0.88em;
    background: var(--bg-sunk); padding: 2px 6px; border-radius: 4px;
    direction: ltr; display: inline-block;
  }

.ws-inst-criteria {
    background: var(--bg);
    border: 0.5px solid var(--line-2);
    border-radius: 10px;
    padding: 12px 14px;
    margin: 6px 0;
  }

.ws-inst-criteria .ws-crit-item {
    display: flex; gap: 10px; align-items: flex-start;
    padding: 6px 0;
    font-size: 13px; color: var(--ink-2);
    border-bottom: 0.5px solid var(--line-2);
  }

.ws-inst-criteria .ws-crit-item:last-child { border-bottom: 0; }

.ws-inst-criteria svg { width: 14px; height: 14px; flex-shrink: 0; margin-top: 3px; color: var(--ink-4); }

.ws-inst-criteria .ws-crit-item.done svg { color: var(--ok); }

.ws-inst-criteria .ws-crit-item.done { color: var(--ink); }

.ws-preview-frame {
    flex: 1; min-height: 0;
    background: #fff;
    border: 0;
    width: 100%;
  }

.ws-preview-bar {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 14px;
    border-top: 0.5px solid var(--line-2);
    background: var(--bg-sunk);
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--ink-3);
    direction: ltr;
  }

.ws-preview-bar .ws-pv-dots { display: flex; gap: 5px; margin-inline-end: 4px; }

.ws-preview-bar .ws-pv-dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--ink-4); }

.ws-preview-bar .ws-pv-url {
    flex: 1;
    padding: 3px 10px;
    border-radius: 6px;
    background: var(--bg-elev);
    color: var(--ink-2);
  }

.ws-grading-overlay {
    position: fixed; inset: 0; z-index: 200;
    background: rgba(0,0,0,0.42);
    -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
    display: flex; align-items: center; justify-content: center;
  }

.ws-grading-card {
    background: var(--bg-elev);
    border: 0.5px solid var(--line);
    border-radius: 22px;
    padding: 36px 44px;
    text-align: center;
    min-width: 380px; max-width: 480px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.25);
  }

.ws-grading-spinner {
    width: 56px; height: 56px;
    margin: 0 auto 18px;
    border-radius: 50%;
    border: 3.5px solid var(--bg-sunk);
    border-top-color: var(--accent);
    animation: wsSpin 0.8s linear infinite;
  }

.ws-grading-card h3 {
    font-family: var(--font-display);
    font-size: 22px; font-weight: 700; margin: 0 0 6px;
  }

.ws-grading-card p { font-size: 14px; color: var(--ink-2); margin: 0 0 14px; }

.ws-grading-steps {
    text-align: start;
    background: var(--bg);
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 13px;
  }

.ws-grading-steps li {
    display: flex; gap: 10px; padding: 4px 0;
    color: var(--ink-3);
    list-style: none;
  }

.ws-grading-steps li.active { color: var(--ink); }

.ws-grading-steps li.done { color: var(--ok); }

.ws-grading-steps li svg { width: 14px; height: 14px; flex-shrink: 0; margin-top: 2px; }

.ws-result {
    background: linear-gradient(135deg, var(--ok-soft), color-mix(in oklab, var(--accent-soft) 60%, transparent));
    border: 0.5px solid color-mix(in oklab, var(--ok) 22%, transparent);
    border-radius: 14px;
    padding: 16px 18px;
    margin-bottom: 18px;
  }

.ws-result-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }

.ws-result-score {
    font-family: var(--font-display);
    font-size: 36px; font-weight: 700; color: var(--ok);
    font-variant-numeric: tabular-nums;
    line-height: 1;
  }

.ws-result-score .total { color: var(--ink-3); font-size: 18px; font-weight: 500; }

.ws-result-head .lbl { font-size: 11.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ok); margin-bottom: 4px; }

.ws-result-head .sub { font-size: 12.5px; color: var(--ink-2); }

.ws-result-fb { font-size: 13.5px; line-height: 1.6; color: var(--ink-2); }

.ws-result-fb b { color: var(--ink); }

.ws-result-fb ul { padding-inline-start: 22px; margin: 6px 0 0; }

.ws-result-fb li { margin-bottom: 4px; }

.ws-solution-btn {
    margin-top: 14px;
    appearance: none; cursor: pointer;
    width: 100%;
    border: 0.5px solid var(--accent);
    background: var(--bg-elev);
    color: var(--accent);
    padding: 11px 16px;
    border-radius: 12px;
    font-size: 13.5px; font-weight: 600;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    transition: background .15s ease;
  }

.ws-solution-btn:hover { background: var(--accent-soft); }

.ws-solution-btn svg { width: 14px; height: 14px; }

.ws-solution-btn.locked {
    color: var(--ink-3);
    border-color: var(--line);
    background: var(--bg-sunk);
    cursor: not-allowed;
  }

.ws-sol-drawer {
    position: fixed; top: 0; bottom: 0; inset-inline-start: 0;
    width: 560px; max-width: 80vw;
    background: var(--bg-elev);
    box-shadow: 12px 0 40px rgba(0,0,0,0.18);
    z-index: 250;
    display: flex; flex-direction: column;
    animation: wsSlideIn .25s cubic-bezier(.16,1,.3,1);
  }

html[dir="rtl"] .ws-sol-drawer { inset-inline-start: auto; inset-inline-end: 0; box-shadow: -12px 0 40px rgba(0,0,0,0.18); }

html[dir="rtl"] .ws-sol-drawer { animation-name: wsSlideInRtl; }

.ws-sol-overlay {
    position: fixed; inset: 0; z-index: 240;
    background: rgba(0,0,0,0.32);
    -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  }

.ws-sol-head {
    padding: 18px 22px;
    border-bottom: 0.5px solid var(--line);
    display: flex; align-items: center; gap: 12px;
  }

.ws-sol-head h3 {
    font-family: var(--font-display);
    font-size: 17px; font-weight: 700; margin: 0;
  }

.ws-sol-head .ws-sol-eyebrow {
    font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
    color: var(--accent); margin-bottom: 2px;
  }

.ws-sol-close {
    margin-inline-start: auto;
    appearance: none; border: 0; background: var(--bg-sunk);
    width: 32px; height: 32px; border-radius: 50%;
    color: var(--ink-2); cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
  }

.ws-sol-close svg { width: 14px; height: 14px; }

.ws-sol-body {
    flex: 1; min-height: 0; overflow-y: auto;
    padding: 18px 22px;
  }

.ws-sol-tabs {
    display: flex; align-items: stretch;
    border-bottom: 0.5px solid var(--line);
    background: var(--bg);
    overflow-x: auto;
    flex-wrap: nowrap;
  }

.ws-sol-tabs::-webkit-scrollbar { height: 0; display: none; }

.ws-sol-tab {
    appearance: none; border: 0; background: transparent;
    color: var(--ink-3);
    font-family: var(--font-mono);
    font-size: 12.5px;
    padding: 11px 16px;
    cursor: pointer;
    display: inline-flex; align-items: center; gap: 8px;
    border-inline-end: 0.5px solid var(--line-2);
    transition: background .15s ease, color .15s ease;
    direction: ltr;
    white-space: nowrap;
    position: relative;
  }

.ws-sol-tab:hover { background: var(--bg-sunk); color: var(--ink-2); }

.ws-sol-tab.active {
    background: var(--bg-elev);
    color: var(--ink);
    font-weight: 500;
  }

.ws-sol-tab.active::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -1px;
    height: 2px; background: var(--accent);
  }

.ws-sol-tab-ic {
    width: 14px; height: 14px; border-radius: 3px;
    color: #fff; font-size: 9px; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center;
  }

.ws-sol-tab-mark { color: var(--accent); font-size: 8px; margin-inline-start: 2px; }

.ws-mobile-toggle { display: none; }

@media (max-width: 760px){
/* bar + toggle are auto, body takes the rest */
.ws { grid-template-rows: auto auto 1fr !important; }
.ws.has-footer { grid-template-rows: auto auto 1fr auto !important; }
.ws-foot { padding: 8px 14px; gap: 10px; font-size: 11.5px; }
.ws-foot-mut:last-child { display: none; }
.ws-mobile-toggle {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 6px;
      padding: 8px 10px;
      background: var(--bg-elev);
      border-bottom: 0.5px solid var(--line);
      position: sticky; top: 0; z-index: 7;
    }
.ws-mobile-toggle button {
      appearance: none; cursor: pointer;
      border: 0.5px solid var(--line);
      background: var(--bg-sunk); color: var(--ink-2);
      font: inherit; font-size: 13.5px; font-weight: 600;
      padding: 11px 10px; border-radius: 11px;
      display: inline-flex; align-items: center; justify-content: center; gap: 7px;
      transition: background .15s ease, color .15s ease, border-color .15s ease;
    }
.ws-mobile-toggle button svg { width: 16px; height: 16px; }
.ws-mobile-toggle button.active {
      background: var(--ink); color: var(--bg-elev); border-color: var(--ink);
      box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    }
/* One pane at a time, edge to edge, filling all remaining height */
.ws-body {
      display: flex !important;
      flex-direction: column !important;
      grid-template-columns: 1fr !important;
      gap: 0 !important;
      padding: 0 !important;
      min-height: 0 !important;
    }
.ws-resizer { display: none !important; }
.ws-inst-rail { display: none !important; }
/* Drop the file rail on mobile — the file TABS above already switch files,
       and the rail eats ~210px of precious code width. */
.ws-ide-wrap .ide-rail { display: none !important; }
.ws-body[data-mobile="editor"] .ws-pane { display: none !important; }
.ws-body[data-mobile="instructions"] .ws-ide-wrap { display: none !important; }
.ws-pane,
    .ws-ide-wrap {
      flex: 1 1 auto !important;
      width: 100% !important;
      min-height: 0 !important;
      height: auto !important;
      border-radius: 0 !important;
      border-left: 0 !important; border-right: 0 !important;
    }
/* The toggle above already labels the pane — drop the pane's own header
       (title + collapse chevron) on mobile; it's redundant and eats height. */
.ws-pane .ws-pane-head { display: none !important; }
/* Smooth touch scrolling for the instructions; room to breathe at the end. */
.ws-inst-body {
      -webkit-overflow-scrolling: touch;
      overscroll-behavior: contain;
      padding-bottom: 40px !important;
    }
/* Keep the toolbar to one tidy row instead of a tall wrap that eats screen. */
.ws-bar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.ws-bar::-webkit-scrollbar { display: none; }
.ws-bar .ws-title { display: none; }
}
