/* teachme on the web: only what the local app's app.css doesn't have (sign-in, settings, the connector line,
   the Run output under the code editor). Same tokens, same soft neutrals and blue accent. */

/* Signed out: no sidebar, no tools in the header. */
body.signed-out { grid-template-columns: 0 minmax(0, 1fr) 0; }
body.signed-out nav, body.signed-out #term-pane,
body.signed-out header > :not(.brand) { display: none !important; }

#user-name { font-size: 13px; color: var(--muted); padding: 3px 8px; border-radius: 4px; }
#user-name:hover { color: var(--ink); background: var(--hover); text-decoration: none; }
#user-name:empty { display: none; }
#claude-btn.warn { color: var(--ink); }
#claude-btn.warn::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #d9a400; margin-right: 6px; vertical-align: 1px; }

nav a.nav-settings { color: var(--muted); }
nav a.nav-settings:hover { color: var(--ink); }

/* ---------- sign in / sign up ---------- */
.auth-page { max-width: 460px; padding-top: 72px; }
.auth-brand { font-weight: 650; color: var(--muted); margin-bottom: 18px; }
.auth .nc-input { margin-bottom: 2px; }
.form-error { color: var(--wrong); font-size: 14px; margin: 14px 0 0; }
.auth-links { margin-top: 22px; }

/* ---------- pending exercises ---------- */
.pending-line { margin: -12px 0 22px; }

/* ---------- build stamp, bottom left ---------- */
#version { position: fixed; left: 10px; bottom: 6px; z-index: 30; font: 11px/1 var(--mono); color: var(--faint); pointer-events: none; user-select: none; white-space: nowrap; }

/* ---------- the tutor is working ---------- */
@keyframes tm-spin { to { transform: rotate(360deg); } }
.tm-spinner { display: inline-block; width: 10px; height: 10px; margin-right: 6px; vertical-align: -1px; border: 2px solid var(--accent); border-top-color: transparent; border-radius: 50%; animation: tm-spin .8s linear infinite; }
#claude-btn.busy { color: var(--accent); }
#claude-btn.busy::after { content: ""; display: inline-block; width: 11px; height: 11px; margin-left: 7px; vertical-align: -2px; border: 2px solid var(--accent); border-top-color: transparent; border-radius: 50%; animation: tm-spin .8s linear infinite; }
.job.running .job-status { color: var(--accent); }

/* Scratch equations use the same editor as the answer field. */
details.math-scratch { margin: 8px 0 12px; }
details.step-calculator { margin: 8px 0 12px; }
.step-calculator output { overflow-wrap: anywhere; }
.scratch-panel { padding: 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--callout); }
.scratch-lines { display: grid; gap: 5px; }
.scratch-line { display: flex; align-items: center; gap: 4px; min-width: 0; }
.scratch-line math-field { min-width: 0; min-height: 40px; padding: 5px 9px; font-size: 18px; }
.scratch-line:only-child .scratch-remove { display: none; }
.scratch-remove { min-width: 32px; min-height: 36px; }
.scratch-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 8px; }

/* ---------- Claude panel: the connector ---------- */
.cp-conn { padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.cp-conn.off { background: var(--callout); }
.cp-conn .row { margin-top: 8px; }
.cp-conn pre.cmd { margin: 6px 0 0; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--right); margin-right: 7px; vertical-align: 1px; }
.dot.busy { background: var(--accent); }
.dot.paused, .dot.off { background: var(--faint); }
a.btn { display: inline-block; font: 500 13px var(--sans); border-radius: 4px; padding: 3px 10px; border: 1px solid var(--line-strong); color: var(--ink); line-height: 1.4; }
a.btn:hover { background: var(--hover); text-decoration: none; }
a.btn.primary { background: var(--btn-primary); color: #fff; border-color: transparent; }
a.btn.primary:hover { background: var(--btn-primary-hover); }

pre.cmd { font: 13px/1.5 var(--mono); background: var(--code-bg); color: var(--ink); padding: 7px 10px; border-radius: 6px; white-space: pre-wrap; word-break: break-all; margin: 4px 0; }

/* ---------- Settings ---------- */
.providers { display: grid; gap: 2px; }
.provider.later { color: var(--muted); }
.cmd-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 8px; margin: 10px 0; }
.cmd-row .hint { grid-column: 1 / -1; }
.cmd-row pre.cmd { margin: 0; }
#pair-box { margin-top: 14px; padding: 12px 14px; border-radius: 6px; background: var(--note-bg); }
#pair-box p { margin: 0 0 8px; }
.devices { display: grid; gap: 2px; }
.device { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; }
.device + .device { border-top: 1px solid var(--line); }
.cp-settings.flat { padding: 0; border: 0; max-width: 360px; }
input[type=file] { font: 13.5px var(--sans); color: var(--muted); }

/* ---------- code steps: Run shows the program's output here ---------- */
.run-box { margin-top: 12px; padding: 8px 12px; border-radius: 6px; background: var(--callout); animation: appear .18s ease-out; }
.run-box pre.out { background: var(--bg); margin: 4px 0 2px; }
.run-box pre.out.placeholder { font: 13px/1.5 var(--sans); color: var(--muted); }

/* Lesson examples: why a last line like `word[0]` showed nothing. */
.ex-out-in .out-note { margin-top: 6px; line-height: 1.5; }
.ex-out-in .out-note code { font: 12.5px var(--mono); background: var(--code-inline-bg, rgba(135,131,120,.15)); padding: 0 3px; border-radius: 3px; }

/* Live progress for tutor jobs (course design, next exercise, fixes, reviews). */
.live-job { font-size: 13.5px; color: var(--muted); margin: 8px 0; line-height: 1.5; }
.live-job[hidden] { display: none; }
.live-job b { color: var(--ink); font-weight: 600; }
.live-job .faint { color: var(--faint); }
.live-job .live-note { display: block; margin-left: 16px; }
.live-job.compact { font-size: 12.5px; margin: 6px 0 0; }
.live-job.compact .faint, .live-job.compact .live-note { display: none; }
.course-card .live-job:empty { display: none; }
.tm-wait { display: inline-block; width: 10px; height: 10px; margin-right: 6px; vertical-align: -1px; border: 2px solid var(--faint); border-radius: 50%; }
.pending-line .tm-spinner { margin-right: 6px; }

/* input() during Run: the program's output so far, then a box on the prompt's line. */
.run-box .stdin-out { background: var(--bg); margin: 4px 0 2px; padding: 9px 14px; border-radius: 6px; border: 1px solid var(--line); font: 14px/1.6 var(--mono); }
.run-box .stdin-prev { margin: 0; font: inherit; white-space: pre-wrap; }
.run-box .stdin-line { display: flex; align-items: baseline; gap: 0; }
.run-box .stdin-prompt { white-space: pre; }
.run-box input.stdin { flex: 1; min-width: 6ch; font: inherit; color: var(--ink); background: transparent; border: 0; border-bottom: 1px solid var(--accent); padding: 0 2px; outline: none; }
.run-box .stdin-help { margin-top: 4px; }

/* Learn Python: placement, the course card, the map and projects. */
.course-card.lp-card { border-color: var(--accent); }
.lp-page .lp-step { margin: -16px 0 10px; }
.lp-box { max-width: 640px; }
.lp-q { font-size: 20px; margin: 0 0 14px; }
.lp-why { color: var(--muted); font-size: 14px; margin: 0 0 14px; }
.lp-options { display: flex; flex-direction: column; gap: 8px; max-width: 460px; }
.lp-option { text-align: left; padding: 10px 14px; font-size: 15px; border-radius: 6px; }
.lp-option.mono { font: 14px/1.5 var(--mono); }
.lp-option:hover:not(:disabled) { background: var(--hover); }
.lp-option.right { border-color: var(--right); box-shadow: inset 0 0 0 1px var(--right); }
.lp-option.wrong { border-color: var(--wrong); box-shadow: inset 0 0 0 1px var(--wrong); }
.lp-option:disabled { cursor: default; opacity: 1; }
.lp-feedback { min-height: 22px; margin-top: 10px; color: var(--muted); font-size: 14px; }
.lp-code { font: 14px/1.6 var(--mono); background: var(--code-bg); border: 1px solid var(--line); border-radius: 6px; padding: 10px 14px; margin: 0 0 14px; white-space: pre; overflow-x: auto; }
.lp-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.lp-free { width: 100%; max-width: 460px; font: 15px/1.5 var(--sans); padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--bg); color: var(--ink); margin-bottom: 10px; }
.lp-path-note { font-size: 13px; color: var(--muted); background: var(--note-bg); padding: 4px 8px; border-radius: 6px; margin: 4px 0; }
.lp-map { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.lp-area { border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; }
.lp-area.done { border-color: var(--right); }
.lp-area-h { display: flex; justify-content: space-between; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.lp-concepts { display: flex; flex-wrap: wrap; gap: 4px; }
.lp-concept { font-size: 12px; padding: 1px 7px; border-radius: 10px; border: 1px solid var(--line-strong); color: var(--faint); white-space: nowrap; }
.lp-concept.introduced { color: var(--ink); border-color: var(--accent); }
.lp-concept.practiced, .lp-concept.known { color: var(--bg); background: var(--right); border-color: var(--right); }
.lp-concept.planned { color: var(--muted); border-style: dashed; border-color: var(--accent); }
.lp-legend .lp-concept { margin-right: 4px; }
.lp-projects { list-style: none; padding: 0; margin: 0; }
.lp-project { display: flex; gap: 8px; padding: 4px 0; font-size: 14px; }
.lp-project.later { opacity: .6; }
.lp-project.next b { color: var(--accent); }
.lp-pmark { width: 14px; flex: none; color: var(--muted); }
.lp-project.done .lp-pmark { color: var(--right); }

/* A plain-language note under a Python error (client/src/explain.js). */
.err-note { margin: 6px 0 4px; padding: 6px 10px; font-size: 13.5px; line-height: 1.5; border: 1px solid var(--line-strong); background: var(--hover); border-radius: 6px; }
.err-note b { color: var(--wrong); }

/* Parsons problems (client/src/parsons.js). */
.pz { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 8px 0; }
.pz-col { min-width: 0; }
.pz-h { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.pz-pool, .pz-answer { min-height: 44px; border: 1px dashed var(--line-strong); border-radius: 6px; padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.pz-answer { border-style: solid; }
.pz-ok .pz-answer { border-color: var(--right); }
.pz-line { text-align: left; padding: 3px 8px; font: 13.5px/1.5 var(--mono); white-space: pre; overflow-x: auto; }
.pz-line code { background: none; padding: 0; font: inherit; }
.pz-line:hover:not(:disabled) { background: var(--hover); }
.pz-line:disabled { cursor: default; opacity: 1; }
.pz-hint .pz { margin-top: 8px; }
@media (max-width: 700px) { .pz { grid-template-columns: 1fr; } }
/* The learner's own tests, and files their programs saved. */
.test-list { list-style: none; padding: 0; margin: 4px 0; font-size: 14px; }
.test-list li { padding: 2px 0; }
.test-list li.ok { color: var(--right); }
.test-list li.bad { color: var(--wrong); }
.test-err { color: var(--ink); font: 13px/1.5 var(--mono); margin-left: 18px; white-space: pre-wrap; }
.saved-line { margin-top: 6px; }
button.linklike { border: 0; background: none; padding: 0; color: var(--accent); font: inherit; cursor: pointer; }
button.linklike:hover { text-decoration: underline; }

/* Learn Python quick notes from the tutor, under a step. */
.quick-note { margin: 8px 0; padding: 7px 11px; font-size: 14px; line-height: 1.5; background: var(--note-bg); border-radius: 6px; }
.quick-note .qn-label { font-weight: 600; color: var(--accent); margin-right: 4px; }

/* Your arcade. */
.arc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.arc-card { border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; }
