/* =============================================================
   session.css: study session setup + runner + method workspaces
   ============================================================= */

/* ---------------- Setup ---------------- */
.setup-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.plan-panel { position: sticky; top: calc(var(--header-h) + 16px); overflow: hidden; }
.plan-foot { padding: 16px 20px 20px; border-top: 1px solid var(--line); }
.plan-summary { display: grid; grid-template-columns: repeat(3, 1fr); padding: 14px 20px 6px; text-align: center; }
.plan-summary strong { display: block; font-size: 1.3rem; letter-spacing: -0.01em; }
.plan-summary span { font-size: 0.75rem; color: var(--ink-muted); }
.plan-list { list-style: none; padding: 8px 12px 12px; max-height: 46vh; overflow: auto; display: flex; flex-direction: column; gap: 2px; }
.plan-list li { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 10px; font-size: 0.88rem; }
.plan-list li:hover { background: var(--surface-2); }
.plan-list li.is-break { color: var(--ink-muted); font-style: italic; }
.plan-icon { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; flex-shrink: 0; font-size: 0.95rem;
  background: color-mix(in srgb, var(--m, #2f6559) 14%, transparent); color: var(--m, #2f6559); }
.plan-time { font-variant-numeric: tabular-nums; font-size: 0.8rem; color: var(--ink-muted); }

.deck-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; max-height: 340px; overflow: auto; padding: 2px; }
.deck-option { position: relative; display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: var(--r-md);
  border: 1.5px solid var(--line-strong); background: var(--surface); cursor: pointer; transition: border-color var(--dur), background var(--dur); min-width: 0; }
.deck-option > .grow { display: flex; flex-direction: column; min-width: 0; }
.deck-option input { position: absolute; opacity: 0; pointer-events: none; }
.deck-option:hover { border-color: var(--deck); }
.deck-option:has(input:checked) { border-color: var(--deck); background: color-mix(in srgb, var(--deck) 9%, var(--surface)); box-shadow: inset 0 0 0 1px var(--deck); }
.deck-option:has(input:focus-visible) { box-shadow: 0 0 0 4px var(--focus); }

.method-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.method-tile { --m: #2f6559; position: relative; display: flex; gap: 12px; padding: 14px; border-radius: var(--r-md); cursor: pointer;
  border: 1.5px solid var(--line-strong); background: var(--surface); transition: border-color var(--dur), background var(--dur), transform var(--dur); }
.method-tile:hover { border-color: var(--m); transform: translateY(-1px); }
.method-tile input { position: absolute; opacity: 0; pointer-events: none; }
.method-tile:has(input:checked) { border-color: var(--m); background: color-mix(in srgb, var(--m) 8%, var(--surface)); box-shadow: inset 0 0 0 1px var(--m); }
.method-tile:has(input:focus-visible) { box-shadow: 0 0 0 4px var(--focus); }
.method-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 1.3rem; flex-shrink: 0;
  background: color-mix(in srgb, var(--m) 15%, transparent); color: var(--m); }
.method-copy { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.method-copy strong { font-size: 0.95rem; }
.method-copy .small { line-height: 1.4; }
.method-avail { display: inline-flex; align-items: center; gap: 4px; font-size: 0.74rem; color: var(--ink-muted); margin-top: 3px; }
.method-avail.ready { color: var(--ok); }
.method-check { position: absolute; top: 10px; right: 10px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  border: 1.5px solid var(--line-strong); color: transparent; font-size: 0.85rem; transition: all var(--dur); }
.method-tile:has(input:checked) .method-check { background: var(--m); border-color: var(--m); color: #fff; }

/* ---------------- Runner ---------------- */
body.in-session { background: var(--bg); }
.run-top { position: sticky; top: var(--header-h); z-index: 50; background: var(--header-bg); border-bottom: 1px solid var(--line); }
.run-top-inner { display: flex; align-items: center; gap: 16px; padding: 8px clamp(12px, 3vw, 28px); }
.run-deck { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 0.9rem; max-width: 240px; min-width: 0; }
.run-progress { flex: 1; min-width: 80px; }
.seg-track { display: flex; gap: 3px; height: 8px; }
/* One palette for the whole bar (tan track, library-green fill, brass ring on the current task), not a colour per method. */
.seg-piece { position: relative; flex-basis: 0; border-radius: 999px; background: color-mix(in srgb, var(--accent) 22%, var(--surface-3)); overflow: hidden; min-width: 6px; }
.seg-piece i { position: absolute; inset: 0; background: var(--brand); border-radius: inherit; transform: scaleX(0); transform-origin: left center; }
.seg-piece.brk { background: repeating-linear-gradient(45deg, var(--surface-3), var(--surface-3) 3px, transparent 3px, transparent 6px); }
.seg-piece.current { box-shadow: 0 0 0 2px color-mix(in srgb, #c9a227 55%, transparent); }
.run-controls { display: flex; align-items: center; gap: 2px; }
.run-total { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 0.9rem; color: var(--ink-soft); padding: 0 8px; }

.run-grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 20px; padding-block: 20px 60px; align-items: start; }
.run-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.task-head { --m: #2f6559; display: flex; align-items: center; gap: 18px; padding: 18px 20px; position: relative; overflow: hidden; }
.task-head::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--m); }
.task-icon { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-size: 1.6rem; flex-shrink: 0;
  background: color-mix(in srgb, var(--m) 14%, transparent); color: var(--m); }
.task-copy { flex: 1; min-width: 0; }
.task-copy .eyebrow { color: var(--m); }
.task-title { font-size: clamp(1.2rem, 2.2vw, 1.55rem); line-height: 1.2; letter-spacing: -0.015em; margin: 2px 0 4px; }
.task-desc { color: var(--ink-soft); font-size: 0.92rem; }
.task-timer { display: flex; flex-direction: column; align-items: center; gap: 6px; flex-shrink: 0; }
.task-ring .ring-fill { stroke: var(--m); }
.task-ring .ring-label strong { font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.task-ring.low .ring-label strong { color: var(--bad); }
.time-up { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--r-md); background: var(--warn-tint); color: var(--ink); font-size: 0.92rem; animation: slide-in 0.25s var(--ease); }
.time-up[hidden] { display: none; }
.time-up > ion-icon { font-size: 1.3rem; color: var(--warn); }
@keyframes slide-in { from { opacity: 0; transform: translateY(-6px); } }
.workspace { min-width: 0; animation: ws-in 0.3s var(--ease); }
@keyframes ws-in { from { opacity: 0; transform: translateY(6px); } }

.run-side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: calc(var(--header-h) + 72px); }
.run-side .panel-head { padding: 12px 16px; }
.run-side .panel-head h3 { font-size: 0.92rem; }
.upnext-list { list-style: none; padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 2px; }
.upnext-list li { display: flex; align-items: center; gap: 8px; padding: 6px; font-size: 0.85rem; border-radius: 8px; }
.upnext-list .plan-icon { width: 24px; height: 24px; font-size: 0.85rem; }
.live-stats { padding: 6px 16px 12px; }
.live-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 0.86rem; color: var(--ink-soft); border-bottom: 1px solid var(--line); }
.live-row:last-child { border-bottom: 0; }
.live-row ion-icon { color: var(--brand); }
.live-row strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.primer summary { list-style: none; cursor: pointer; }
.primer summary::-webkit-details-marker { display: none; }
.primer .bullets { font-size: 0.86rem; color: var(--ink-soft); }

.paused-veil { position: fixed; inset: 0; z-index: 9999998; display: grid; place-items: center; background: color-mix(in srgb, var(--bg) 82%, transparent); }
.paused-veil[hidden] { display: none; }
.paused-card { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.paused-card > ion-icon { font-size: 4rem; color: var(--brand); }
.keys td { padding: 6px 10px 6px 0; font-size: 0.9rem; color: var(--ink); vertical-align: top; }

/* Focus mode: just the task. */
body.focus-mode .site-header { display: none; }
body.focus-mode.app { padding-top: 0; }
body.focus-mode .run-top { top: 0; }
body.focus-mode .run-side { display: none; }
body.focus-mode .run-grid { grid-template-columns: minmax(0, 860px); justify-content: center; }
body.focus-mode .run-side ~ * { display: none; }

/* ---------------- Shared workspace bits ---------------- */
.ws-done { text-align: center; padding: 40px 24px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.ws-done-icon { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 2rem; background: var(--ok-tint); color: var(--ok); margin-bottom: 6px; }
.ws-done h2 { font-size: 1.35rem; }
.ws-done p { max-width: 460px; }
.fc-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 0.85rem; color: var(--ink-muted); margin-bottom: 10px; }
.tip-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; background: var(--surface-3); font-size: 0.78rem; color: var(--ink-soft); }
.tip ion-icon { color: var(--brand); }
.created-list { display: flex; flex-direction: column; gap: 6px; }
.created-item { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 10px 14px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); font-size: 0.88rem; animation: ws-in 0.25s var(--ease); }
.created-item span { color: var(--ink-soft); }
.notes-peek > summary { list-style: none; cursor: pointer; padding: 12px 16px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.notes-peek > summary::-webkit-details-marker { display: none; }
.notes-scroll { max-height: 320px; overflow: auto; padding: 0 16px 16px; font-size: 0.9rem; color: var(--ink-soft); }
.explain-q { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface-2); }
.explain-q span { color: var(--ink-soft); }
.session-mm { height: min(62vh, 600px); }
.ok-text { color: var(--ok); } .bad-text { color: var(--bad); } .warn-text { color: var(--warn); }
.ai-result h3 { font-size: 1.1rem; }
.ai-result h4 { font-size: 0.92rem; margin-bottom: 6px; display: flex; align-items: center; gap: 4px; }
.score-ring .ring-label strong { font-size: 1.4rem; }
.misconception { display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; border-left: 3px solid var(--warn); background: var(--warn-tint); border-radius: 0 8px 8px 0; font-size: 0.88rem; margin-top: 6px; }
.misconception s { color: var(--ink-muted); }
.model-answer > summary { cursor: pointer; font-weight: 600; color: var(--brand-strong); font-size: 0.9rem; }
.model-answer p { margin-top: 8px; padding: 12px 14px; border-radius: var(--r-md); background: var(--ok-tint); font-size: 0.92rem; }

/* ---------------- Flashcards ---------------- */
.fc-wrap { display: flex; flex-direction: column; align-items: stretch; max-width: 760px; margin: 0 auto; width: 100%; }
.fc-card { position: relative; width: 100%; min-height: clamp(260px, 42vh, 380px); border: 0; padding: 0; background: none; cursor: pointer; perspective: 1600px; font: inherit; color: inherit; text-align: center; }
.fc-card:focus-visible { outline: none; }
.fc-card:focus-visible .fc-face { box-shadow: 0 0 0 4px var(--focus), var(--shadow-lg); }
.fc-inner { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform 0.55s cubic-bezier(.3, .7, .2, 1); }
.fc-card.flipped .fc-inner { transform: rotateY(180deg); }
.fc-face { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 36px clamp(20px, 5vw, 48px);
  border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: auto; }
.fc-back { transform: rotateY(180deg); background: linear-gradient(170deg, var(--surface), var(--surface-2)); }
.fc-front::after { content: "Answer in your head first, then flip"; position: absolute; bottom: 14px; font-size: 0.75rem; color: var(--ink-muted); }
.fc-label { position: absolute; top: 16px; left: 20px; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-muted); }
.fc-text { font-weight: 600; line-height: 1.35; white-space: pre-wrap; overflow-wrap: anywhere; max-width: 60ch; }
.fc-face.xl .fc-text { font-size: clamp(1.6rem, 3.6vw, 2.3rem); }
.fc-face.lg .fc-text { font-size: clamp(1.3rem, 2.6vw, 1.7rem); }
.fc-face.md .fc-text { font-size: 1.15rem; }
.fc-face.sm .fc-text { font-size: 1rem; font-weight: 500; text-align: left; }
.fc-q { font-size: 0.85rem; color: var(--ink-muted); max-width: 60ch; }
.fc-back .fc-text { color: var(--brand-strong); }
.fc-extra { display: flex; gap: 6px; align-items: flex-start; font-size: 0.88rem; color: var(--ink-soft); padding: 8px 12px; border-radius: 10px; background: var(--brand-tint); max-width: 56ch; text-align: left; }
.fc-extra ion-icon { color: var(--brand); flex-shrink: 0; margin-top: 3px; }
.fc-actions { display: flex; justify-content: center; gap: 10px; margin-top: 18px; flex-wrap: wrap; min-height: 64px; }
.fc-show { min-width: 260px; }
.fc-show .kbd, .rate-btn .kbd { margin-left: 6px; }
.rate-btn { --t: var(--ink-soft); --tt: var(--surface-3); flex: 1 1 0; max-width: 170px; min-width: 110px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 10px 12px; border-radius: var(--r-md); border: 1.5px solid color-mix(in srgb, var(--t) 35%, transparent); background: var(--tt); color: var(--t);
  font: 600 0.95rem var(--font); cursor: pointer; transition: transform 0.12s, box-shadow var(--dur); animation: ws-in 0.2s var(--ease) both; }
.rate-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.rate-btn:nth-child(2) { animation-delay: 0.03s; } .rate-btn:nth-child(3) { animation-delay: 0.06s; } .rate-btn:nth-child(4) { animation-delay: 0.09s; }
.rate-btn.bad { --t: var(--bad); --tt: var(--bad-tint); }
.rate-btn.warn { --t: var(--warn); --tt: var(--warn-tint); }
.rate-btn.ok { --t: var(--ok); --tt: var(--ok-tint); }
.rate-btn.info { --t: var(--info); --tt: var(--info-tint); }
.rate-sub { font-size: 0.75rem; font-weight: 500; opacity: 0.85; }
.rate-btn .kbd { margin: 2px 0 0; }

/* ---------------- Quiz ---------------- */
.quiz-wrap { max-width: 760px; margin: 0 auto; width: 100%; }
.quiz-card { padding: clamp(20px, 3vw, 30px); }
.quiz-question { font-weight: 600; line-height: 1.35; margin: 6px 0 18px; white-space: pre-wrap; }
.quiz-question.xl, .quiz-question.lg { font-size: clamp(1.25rem, 2.4vw, 1.55rem); }
.quiz-question.md { font-size: 1.12rem; }
.quiz-body { display: flex; flex-direction: column; gap: 8px; }
.choice-btn { display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 16px; border-radius: var(--r-md); text-align: left;
  border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--ink); font: 500 0.98rem/1.4 var(--font); cursor: pointer; transition: all var(--dur); }
.choice-btn:hover:not(:disabled) { border-color: var(--brand); background: var(--brand-tint); }
.choice-btn:disabled { cursor: default; }
.choice-btn.correct { border-color: var(--ok); background: var(--ok-tint); color: var(--ink); font-weight: 600; }
.choice-btn.wrong { border-color: var(--bad); background: var(--bad-tint); }
.choice-btn:disabled:not(.correct):not(.wrong) { opacity: 0.55; }
.input.is-ok { border-color: var(--ok); background: var(--ok-tint); }
.input.is-bad { border-color: var(--bad); background: var(--bad-tint); }
.quiz-feedback { margin-top: 16px; padding: 14px 16px; border-radius: var(--r-md); font-size: 0.93rem; display: flex; flex-direction: column; gap: 4px; animation: ws-in 0.2s var(--ease); }
.quiz-feedback[hidden] { display: none; }
.quiz-feedback.ok { background: var(--ok-tint); }
.quiz-feedback.bad { background: var(--bad-tint); }
.fb-title { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 1rem; }
.quiz-feedback.ok .fb-title { color: var(--ok); }
.quiz-feedback.bad .fb-title { color: var(--bad); }
.fb-exp { color: var(--ink-soft); }

/* ---------------- Speed notes ---------------- */
.blurt-area { min-height: 46vh; font-size: 1rem; line-height: 1.7; padding: 18px; }
.feynman-area { min-height: 220px; }
.compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.compare-notes { max-height: 60vh; overflow: auto; font-size: 0.92rem; user-select: text; cursor: text; }
.col-head { display: flex; align-items: center; gap: 6px; font-size: 0.9rem; margin-bottom: 8px; color: var(--ink-soft); }
.col-head .badge { margin-left: auto; }
.missed-mark { background: #fbe08a; color: #3b2f08; border-radius: 3px; padding: 0 2px; }
.missed-list { padding-left: 1.1em; font-size: 0.88rem; display: flex; flex-direction: column; gap: 4px; }
.missed-ai { list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 0.88rem; }
.missed-ai li { display: flex; gap: 8px; align-items: flex-start; }
.missed-ai .imp { font-size: 0.66rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; padding: 2px 6px; border-radius: 6px; flex-shrink: 0; margin-top: 2px; background: var(--surface-3); color: var(--ink-muted); }
.missed-ai .imp-high .imp { background: var(--bad-tint); color: var(--bad); }
.missed-ai .imp-medium .imp { background: var(--warn-tint); color: var(--warn); }

/* ---------------- Fill in the blanks ---------------- */
.cloze-card { max-width: 820px; margin: 0 auto; width: 100%; }
.cloze-run { font-size: 1.12rem; line-height: 2.3; white-space: pre-wrap; }
.cloze-input { display: inline-block; margin: 0 3px; padding: 2px 8px; border: 0; border-bottom: 2px solid var(--brand); border-radius: 6px 6px 0 0;
  background: var(--brand-tint); font: 600 1rem var(--font); color: var(--ink); text-align: center; outline: none; max-width: 100%; }
.cloze-input:focus { background: color-mix(in srgb, var(--brand) 22%, var(--surface)); box-shadow: 0 0 0 3px var(--focus); }
.cloze-input.is-ok { background: var(--ok-tint); border-color: var(--ok); color: var(--ok); }
.cloze-input.is-bad { background: var(--bad-tint); border-color: var(--bad); color: var(--bad); text-decoration: line-through; }
.cloze-input.is-revealed { background: var(--warn-tint); border-color: var(--warn); }
.cloze-fb { margin-top: 12px; }

/* ---------------- Break ---------------- */
.break-wrap { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; padding: 40px 20px; }
.break-wrap h2 { font-size: 1.5rem; }
.break-tip { color: var(--ink-soft); max-width: 420px; min-height: 3em; }
.breath { position: relative; width: 200px; height: 200px; display: grid; place-items: center; margin-bottom: 8px; }
.breath-circle { position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle at 35% 35%, color-mix(in srgb, var(--brand) 45%, var(--surface)), var(--brand)); opacity: 0.85; animation: breathe 8s ease-in-out infinite; box-shadow: 0 20px 60px color-mix(in srgb, var(--brand) 35%, transparent); }
.breath-label { position: relative; font-weight: 600; color: #fff; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.25); }
@keyframes breathe { 0%, 100% { transform: scale(0.62); } 50% { transform: scale(1); } }

/* ---------------- Responsive ---------------- */
@media (max-width: 1080px) {
  .run-grid { grid-template-columns: minmax(0, 1fr); }
  .run-side { position: static; display: grid; grid-template-columns: 1fr 1fr; }
  .run-side .primer { grid-column: 1 / -1; }
}
@media (max-width: 1180px) and (min-width: 721px) {
  .type-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .setup-grid { grid-template-columns: 1fr; }
  .plan-panel { position: static; }
}
@media (max-width: 720px) {
  .run-top { top: 0; }
  .run-top-inner { flex-wrap: wrap; gap: 8px; }
  .run-deck { flex: 1; }
  .run-progress { order: 3; flex-basis: 100%; }
  .task-head { flex-wrap: wrap; padding: 16px; }
  .task-timer { flex-direction: row; width: 100%; justify-content: space-between; }
  .task-ring { --size: 76px !important; }
  .run-side { grid-template-columns: 1fr; }
  .compare-grid { grid-template-columns: 1fr; }
  .created-item { grid-template-columns: 1fr; gap: 2px; }
  .rate-btn { min-width: calc(50% - 6px); max-width: none; }
  .fc-card { min-height: 300px; }
}


/* ---------------- Research notes ("Why this works") ---------------- */
.why-btn { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border: 0; border-radius: 999px; background: transparent;
  color: var(--ink-muted); font: 500 0.74rem var(--font); cursor: pointer; transition: background var(--dur), color var(--dur); }
.why-btn:hover, .why-btn:focus-visible { background: var(--brand-tint); color: var(--brand-strong); outline: none; }
.why-btn ion-icon { font-size: 0.95rem; }
.why-block h3 { font-size: 1rem; display: flex; align-items: center; gap: 6px; color: var(--ink); margin-bottom: 4px; }
.why-block h3 ion-icon { color: var(--brand); }
.why-block + .why-block { padding-top: 12px; border-top: 1px solid var(--line); }
.switch.small { font-size: 0.84rem; gap: 8px; }
.mix-hint:empty { display: none; }
.mix-hint { margin: -4px 0 10px; }
.exam-banner { margin-bottom: 18px; align-items: center; }

/* ---------------- Session goal ---------------- */
.goal-card .panel-body { color: var(--ink); line-height: 1.5; }
.goal-card { border-color: color-mix(in srgb, var(--brand) 40%, transparent); }

/* ---------------- Quiz: confidence + calibration ---------------- */
.choice-btn.chosen { border-color: var(--info); background: var(--info-tint); }
.conf-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 16px; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface-2); border: 1px dashed var(--line-strong); animation: ws-in 0.2s var(--ease); }
.conf-label { font-weight: 600; margin-right: 6px; }
.conf-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--line-strong);
  background: var(--surface); color: var(--ink); font: 600 0.9rem var(--font); cursor: pointer; transition: all var(--dur); }
.conf-btn:hover { border-color: var(--brand); }
.conf-btn.on { background: var(--brand-tint); border-color: var(--brand); color: var(--brand-strong); }
.conf-guess:hover { border-color: var(--warn); }
.conf-sure:hover { border-color: var(--ok); }
.hyper-note { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; margin: 6px 0 2px; border-radius: 10px;
  background: color-mix(in srgb, var(--warn) 16%, var(--surface)); color: var(--ink); font-size: 0.9rem; }
.hyper-note ion-icon { color: var(--warn); font-size: 1.15rem; flex-shrink: 0; margin-top: 2px; }
.calibration-box { display: flex; flex-direction: column; gap: 4px; margin: 8px auto 4px; padding: 12px 16px; max-width: 520px;
  border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); font-size: 0.9rem; text-align: left; }
.calibration-box strong { display: flex; align-items: center; gap: 6px; }
.pretest-note { margin-bottom: 12px; }

/* ---------------- Feynman: student dialogue ---------------- */
.student-dialog { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px; background: var(--surface-2); }
.dialog-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.dialog-head ion-icon { font-size: 1.3rem; color: #a5432f; }
.dialog-thread { display: flex; flex-direction: column; gap: 10px; }
.bubble { position: relative; max-width: 86%; padding: 10px 14px; border-radius: 16px; font-size: 0.93rem; line-height: 1.5; white-space: pre-wrap; animation: ws-in 0.2s var(--ease); }
.bubble .who { display: block; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.7; margin-bottom: 2px; }
.bubble.student { align-self: flex-start; background: color-mix(in srgb, #a5432f 12%, var(--surface)); border-bottom-left-radius: 4px; }
.bubble.you { align-self: flex-end; background: var(--brand-tint); border-bottom-right-radius: 4px; }
.bubble.verdict { align-self: center; max-width: 100%; display: flex; gap: 8px; align-items: flex-start; font-size: 0.86rem; background: var(--surface); border: 1px solid var(--line); }
.bubble.verdict.ok ion-icon { color: var(--ok); } .bubble.verdict.bad ion-icon { color: var(--warn); }
.bubble.verdict ion-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 2px; }
.bubble-form { display: flex; flex-direction: column; gap: 6px; align-self: stretch; }

/* ---------------- Session types (setup) ---------------- */
.type-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.type-tile { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: var(--r-md); cursor: pointer;
  border: 1.5px solid var(--line-strong); background: var(--surface); transition: border-color var(--dur), background var(--dur), transform var(--dur); }
.type-tile:hover { border-color: var(--brand); transform: translateY(-1px); }
.type-tile input { position: absolute; opacity: 0; pointer-events: none; }
.type-tile:has(input:checked) { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 8%, var(--surface)); box-shadow: inset 0 0 0 1px var(--brand); }
.type-tile:has(input:focus-visible) { box-shadow: 0 0 0 4px var(--focus); }
.type-tile.is-custom { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 10px; padding: 9px 14px; border-style: dashed; }
.type-tile.is-custom .type-icon { width: 30px; height: 30px; font-size: 1rem; }
.type-tile.is-custom .type-copy { flex-direction: row; align-items: baseline; gap: 8px; }
.type-icon { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; font-size: 1.2rem; background: var(--brand-tint); color: var(--brand-strong); }
.type-copy { display: flex; flex-direction: column; gap: 2px; }
.type-copy strong { font-size: 0.93rem; }
.type-copy .small { line-height: 1.4; }
.type-rec { position: absolute; top: 10px; right: 10px; }
.type-detail:empty { display: none; }
.type-methods { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.method-chip { --m: #2f6559; display: inline-flex; align-items: center; gap: 5px; padding: 4px 4px 4px 10px; border-radius: 999px; font-size: 0.82rem; font-weight: 600;
  background: color-mix(in srgb, var(--m) 12%, var(--surface)); color: var(--ink); border: 1px solid color-mix(in srgb, var(--m) 30%, transparent); }
.method-chip > ion-icon { color: var(--m); }
.method-chip .why-btn { padding: 2px 6px; }
.method-groups[hidden] { display: none; }
.method-groups { display: flex; flex-direction: column; gap: 14px; }
.group-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.group-head strong { font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); }
.plan-list li.phase-head { padding: 10px 8px 2px; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-muted); }
.plan-list li.phase-head:hover { background: none; }
.plan-list li.phase-head:first-child { padding-top: 2px; }
.fuzzy-hint { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 12px; margin-bottom: 6px; border-radius: var(--r-md); background: var(--warn-tint); font-size: 0.88rem; }
.fuzzy-hint > ion-icon { color: var(--warn); }

/* ---------------- Runner: park a thought ---------------- */
.park-btn { position: relative; }
.park-count { position: absolute; top: 2px; right: 0; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 0.65rem; font-weight: 700; display: grid; place-items: center; }
.park-count[hidden] { display: none; }

/* ---------------- Flashcards: typed answers ---------------- */
.fc-card.typed .fc-front::after { content: "Type your answer below"; }
.typed-form { display: flex; gap: 8px; width: 100%; max-width: 640px; flex-wrap: wrap; }
.typed-form .input { flex: 1 1 260px; }
.typed-compare { margin-top: 14px; padding: 12px 16px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; animation: ws-in 0.2s var(--ease); }
.typed-compare[hidden] { display: none; }
.typed-row { display: flex; gap: 10px; align-items: baseline; font-size: 0.95rem; }
.typed-label { flex: 0 0 82px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-muted); }
.typed-you { white-space: pre-wrap; overflow-wrap: anywhere; }
.typed-answer { line-height: 1.7; }
mark.iu-hit { background: var(--ok-tint); color: var(--ok); border-radius: 4px; padding: 0 2px; font-weight: 600; }
mark.iu-miss { background: none; color: var(--bad); text-decoration: underline wavy color-mix(in srgb, var(--bad) 60%, transparent); text-underline-offset: 3px; font-weight: 600; }
.typed-score { font-size: 0.82rem; font-weight: 600; }
.rate-btn.suggested { box-shadow: 0 0 0 3px color-mix(in srgb, var(--t) 45%, transparent); transform: translateY(-2px); }

/* ---------------- Warm-up / exit ticket ---------------- */
.dump-area { min-height: 30vh; font-size: 1rem; line-height: 1.7; padding: 16px; }
.term-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.term-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; font-size: 0.82rem; background: var(--surface-3); color: var(--ink-soft); }
.term-chip.hit { background: var(--ok-tint); color: var(--ok); font-weight: 600; }
.term-chip.miss { background: var(--surface-2); border: 1px dashed var(--line-strong); color: var(--ink-muted); }
.exit-line { display: flex; align-items: center; gap: 10px; }
.exit-line .input { flex: 1; }
.exit-num { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; font-size: 0.8rem; font-weight: 700; background: var(--brand-tint); color: var(--brand-strong); }

/* ---------------- Why & How ---------------- */
.elab-wrap { max-width: 820px; margin: 0 auto; width: 100%; }
.fact-box { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); }
.fact-box .badge { align-self: flex-start; margin-top: 4px; }
.fact-label { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-muted); }
.fact-q { color: var(--ink-soft); font-size: 0.92rem; }
.fact-a { font-weight: 600; font-size: 1.05rem; color: var(--ink); white-space: pre-wrap; }
.elab-prompt { display: flex; gap: 8px; align-items: flex-start; font-weight: 600; font-size: 1.02rem; color: var(--ink); }
.elab-prompt ion-icon { color: #b0702a; font-size: 1.2rem; margin-top: 2px; flex-shrink: 0; }
.elab-area { min-height: 90px; font-size: 1rem; line-height: 1.6; }
.elab-fb.ok { border-left: 4px solid var(--ok); }
.elab-fb.warn { border-left: 4px solid var(--warn); }
.elab-fb.bad { border-left: 4px solid var(--bad); }
.model-box { padding: 12px 14px; border-radius: var(--r-md); background: var(--ok-tint); }
.model-box p { margin-top: 4px; font-size: 0.94rem; line-height: 1.55; }

/* ---------------- Tell Them Apart ---------------- */
.concept-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.concept-pill, .sort-btn, .sort-lane { --lane: #5d6b3a; }
.lane-0 { --lane: #5d6b3a; } .lane-1 { --lane: #a5432f; } .lane-2 { --lane: #3d8a7a; } .lane-both { --lane: #9a7b2f; }
.concept-pill { padding: 5px 12px; border-radius: 999px; font-weight: 700; font-size: 0.85rem; background: color-mix(in srgb, var(--lane) 14%, var(--surface)); color: var(--lane); border: 1.5px solid color-mix(in srgb, var(--lane) 40%, transparent); }
.sort-stage { max-width: 760px; margin: 0 auto; width: 100%; display: flex; flex-direction: column; gap: 12px; }
.sort-card { padding: 28px clamp(18px, 4vw, 36px); border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg);
  font-size: clamp(1.1rem, 2.2vw, 1.35rem); font-weight: 600; line-height: 1.4; text-align: center; animation: ws-in 0.25s var(--ease); }
.sort-btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.sort-btn { flex: 1 1 150px; max-width: 260px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 14px; border-radius: var(--r-md); cursor: pointer;
  border: 1.5px solid color-mix(in srgb, var(--lane) 45%, transparent); background: color-mix(in srgb, var(--lane) 9%, var(--surface)); color: var(--ink); font: 600 0.95rem var(--font); transition: transform 0.12s, box-shadow var(--dur); }
.sort-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.sort-btn:disabled { cursor: default; opacity: 0.6; }
.sort-btn.correct { opacity: 1; border-color: var(--ok); background: var(--ok-tint); box-shadow: inset 0 0 0 1px var(--ok); }
.sort-btn.wrong { opacity: 1; border-color: var(--bad); background: var(--bad-tint); }
.sort-fb:empty { display: none; }
.sort-lanes { display: grid; grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); gap: 10px; }
.sort-lane { border-radius: var(--r-md); border: 1px solid color-mix(in srgb, var(--lane) 30%, var(--line)); background: color-mix(in srgb, var(--lane) 5%, var(--surface)); padding: 10px 12px; min-height: 70px; }
.sort-lane h4 { font-size: 0.85rem; color: var(--lane); margin-bottom: 6px; }
.sort-lane ul { list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: 0.84rem; }
.sort-lane li { display: flex; gap: 5px; align-items: flex-start; animation: ws-in 0.2s var(--ease); }
.sort-lane li ion-icon { flex-shrink: 0; margin-top: 3px; }
.sort-lane li.ok ion-icon { color: var(--ok); } .sort-lane li.bad ion-icon { color: var(--bad); }
.compare-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 6px 0; }

/* ---------------- Spot the Error ---------------- */
.err-passage { line-height: 1.9; font-size: 1.05rem; }
.err-sentence { display: inline; padding: 2px 3px; margin: 0 1px; border: 0; border-radius: 5px; background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer;
  border-bottom: 2px dotted var(--line-strong); transition: background var(--dur); }
.err-sentence:hover:not(:disabled) { background: var(--surface-3); }
.err-sentence:disabled { cursor: default; }
.err-sentence.flagged { background: color-mix(in srgb, var(--warn) 22%, var(--surface)); border-bottom-color: var(--warn); }
.err-sentence.found { background: var(--ok-tint); border-bottom: 2px solid var(--ok); }
.err-sentence.missed { background: var(--bad-tint); border-bottom: 2px solid var(--bad); }
.err-sentence.false-alarm { background: var(--surface-3); border-bottom: 2px dashed var(--warn); }
.fix-list { display: flex; flex-direction: column; gap: 6px; }
.fix-list:empty { display: none; }
.fix-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 8px; align-items: center; }
.fix-quote { font-size: 0.85rem; color: var(--ink-soft); font-style: italic; }
.err-note { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border-radius: 0 10px 10px 0; font-size: 0.9rem; border-left: 3px solid var(--line-strong); background: var(--surface-2); }
.err-note.found { border-left-color: var(--ok); } .err-note.found .row ion-icon { color: var(--ok); }
.err-note.missed { border-left-color: var(--bad); background: var(--bad-tint); } .err-note.missed .row ion-icon { color: var(--bad); }
.err-note.false-alarm { border-left-color: var(--warn); }
.err-note s { color: var(--ink-muted); }
.statement { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0 18px; font-size: 1.1rem; line-height: 1.4; }
.statement-arrow { color: var(--ink-muted); }

/* ---------------- Sketch It ---------------- */
.swatches { display: flex; gap: 4px; }
.swatch { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--surface); background: var(--c); box-shadow: 0 0 0 1px var(--line-strong); cursor: pointer; }
.swatch.on { box-shadow: 0 0 0 2px var(--c); }
.sketch-host { position: relative; width: 100%; }
.narrow-only { display: none; }
.sketch-img { width: 100%; border-radius: var(--r-md); border: 1px solid var(--line); background: #fff; }

/* ---------------- Worked examples ---------------- */
.worked-stepper { list-style: none; display: flex; gap: 8px; max-width: 520px; }
.worked-stepper li { flex: 1; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 999px; background: var(--surface-3); color: var(--ink-muted); font-size: 0.85rem; font-weight: 600; }
.worked-stepper li span { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); font-size: 0.75rem; }
.worked-stepper li.on { background: var(--brand-tint); color: var(--brand-strong); }
.worked-stepper li.done { color: var(--ok); }
.problem-box { padding: 14px 16px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); }
.problem-box p { font-size: 1.05rem; font-weight: 600; margin-top: 4px; white-space: pre-wrap; }
.worked-steps { padding-left: 1.4em; display: flex; flex-direction: column; gap: 8px; }
.worked-steps li { padding-left: 4px; animation: ws-in 0.2s var(--ease); }
.worked-steps.compact { gap: 4px; margin: 6px 0; }
.step-text { display: block; font-weight: 600; white-space: pre-wrap; }
.step-why { display: block; font-size: 0.84rem; color: var(--ink-muted); }
.blank-step .textarea { min-height: 44px; }
.model-step { margin-top: 6px; padding: 8px 10px; border-radius: 8px; background: var(--ok-tint); font-size: 0.9rem; display: flex; flex-direction: column; gap: 2px; }
.answer-line { display: flex; align-items: center; gap: 6px; padding: 10px 12px; border-radius: var(--r-md); background: var(--ok-tint); }
.answer-line ion-icon { color: var(--ok); }

/* ---------------- Mock exam ---------------- */
.exam-wrap { max-width: 860px; margin: 0 auto; width: 100%; display: flex; flex-direction: column; gap: 12px; }
.exam-intro h2 { font-size: 1.3rem; }
.exam-rules { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.exam-rules li { display: flex; gap: 10px; align-items: flex-start; color: var(--ink-soft); }
.exam-rules ion-icon { color: var(--brand); font-size: 1.15rem; flex-shrink: 0; margin-top: 2px; }
.exam-bar { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.exam-nav { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; min-width: 0; }
.nav-q { position: relative; width: 32px; height: 32px; border-radius: 8px; border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--ink-soft); font: 600 0.8rem var(--font); cursor: pointer; }
.nav-q.answered { background: var(--brand-tint); border-color: var(--brand); color: var(--brand-strong); }
.nav-q.current { box-shadow: 0 0 0 3px var(--focus); border-color: var(--ink); color: var(--ink); }
.nav-q.flagged::after { content: ""; position: absolute; top: -4px; right: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--warn); border: 2px solid var(--surface); }
.exam-conf { display: flex; align-items: center; gap: 6px; margin-top: 14px; flex-wrap: wrap; }
.conf-btn.sm { padding: 5px 11px; font-size: 0.82rem; }
.ui-btn.on { background: var(--warn-tint); color: var(--warn); }
.exam-score h2 { font-size: 1.35rem; }
.deck-split { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.exam-review { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border-left: 4px solid var(--line-strong); }
.exam-review.ok { border-left-color: var(--ok); }
.exam-review.bad { border-left-color: var(--bad); }
.exam-review > .row ion-icon { font-size: 1.15rem; }
.exam-answers { display: flex; flex-wrap: wrap; gap: 4px 18px; padding-left: 26px; }
.why-tags { gap: 6px; padding-left: 26px; flex-wrap: wrap; }
.chip.sm { padding: 3px 10px; font-size: 0.78rem; }

@media (max-width: 720px) {
  .type-grid { grid-template-columns: 1fr 1fr; }
  .type-tile.is-custom .type-copy { flex-direction: column; gap: 0; }
  .sort-lanes { grid-template-columns: 1fr; }
  .compare-pair, .fix-row { grid-template-columns: 1fr; }
  .typed-label { flex-basis: 64px; }
  .narrow-only { display: inline; }
  .worked-stepper li { padding: 6px 8px; font-size: 0.78rem; }
}

/* ---------- In-session AI coaching: hint ladder, meaning check, why-not-my-answer ---------- */
.hint-row { display: flex; justify-content: center; margin-top: 10px; }
.hint-btn[disabled] { opacity: 0.55; }
.hint-ladder {
  margin: 10px auto 0; max-width: 640px; padding: 10px 14px; display: flex; flex-direction: column; gap: 6px;
  background: #fbf3d5; color: #2a2616; border: 1px dashed #c9a227; border-radius: var(--r-md);
}
.hint-rung { display: flex; gap: 10px; align-items: baseline; font-size: 0.95rem; }
.hint-n { flex-shrink: 0; font: 700 0.7rem/1 var(--font-ui); letter-spacing: 0.06em; text-transform: uppercase; color: #7a6a2c; }
.hint-note { font-size: 0.76rem; color: #6b6548; }
html[data-theme="dark"] .hint-ladder { background: #1a352d; color: var(--ink); border-color: #8f7a2a; }
html[data-theme="dark"] .hint-n, html[data-theme="dark"] .hint-note { color: #cfc39a; }
.ai-check .soft { display: inline-flex; align-items: center; gap: 6px; }
.ai-verdict { line-height: 1.5; }
.ai-verdict ion-icon { vertical-align: -2px; }
.ai-verdict.correct ion-icon { color: var(--ok); }
.ai-verdict.partial ion-icon { color: var(--warn); }
.ai-verdict.wrong ion-icon { color: var(--bad); }
.misconception-inline { display: block; margin-top: 4px; color: var(--bad); }
.why-wrong { margin-top: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; border-left: 3px solid var(--brand); background: var(--surface-2); border-radius: 0 var(--r-sm) var(--r-sm) 0; font-size: 0.92rem; }
.why-rule { font-weight: 600; color: var(--brand-strong); }
html[data-theme="dark"] .why-rule { color: var(--brand); }

/* "Tailored to your topic": Gemini's read of the deck and how the plan adapts (session.js drawTopic). */
.topic-card { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: var(--r-md); background: var(--brand-tint); border: 1px solid var(--line); }
.topic-card p { margin-top: 3px; }
.topic-card .why-btn { flex-shrink: 0; }
.topic-icon { flex-shrink: 0; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--surface); color: var(--brand); font-size: 1.2rem; border: 1px solid var(--line); }
.topic-card.is-reading { align-items: center; background: var(--surface-2); }
.topic-card.is-reading > ion-icon { color: var(--brand); animation: topic-pulse 1.2s ease-in-out infinite; }
@keyframes topic-pulse { 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .topic-card.is-reading > ion-icon { animation: none; } }

/* ---------- Tutor: side panel during a session (see toggleTutor in session.js) ---------- */
.tutor-toggle { gap: 6px; margin-right: 6px; border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); }
.tutor-toggle[aria-pressed="true"] { background: var(--brand); color: var(--btn-ink, #fff); border-color: var(--brand); }
.tutor-panel { position: fixed; right: 0; bottom: 0; top: 120px; z-index: 60; width: 380px; display: flex; flex-direction: column;
  background: var(--surface); border-left: 1px solid var(--line); box-shadow: -10px 0 30px rgba(20, 30, 20, 0.08); animation: tutor-in 0.22s var(--ease); }
.tutor-panel[hidden] { display: none; }
@keyframes tutor-in { from { transform: translateX(24px); opacity: 0; } }
.tutor-panel-head { display: flex; align-items: flex-start; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.tutor-panel-head .grow { display: flex; flex-direction: column; gap: 2px; }
.tutor-panel-head strong { display: flex; align-items: center; gap: 6px; }
.tutor-panel-head strong ion-icon { color: var(--brand); }
.tutor-panel-body { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; padding: 12px 14px 14px; overflow: auto; }
.tutor-panel .tutor-log { flex: 1; min-height: 140px; max-height: none; }
.tutor-panel .tutor-msg { font-size: 0.92rem; }
/* Wide screens: the task moves over so the tutor sits beside it, not on top of it. */
@media (min-width: 1100px) {
  body.tutor-open .run-grid { width: min(1180px, 100% - 380px - 96px); margin-left: max(24px, (100% - 380px - 1180px - 48px) / 2); margin-right: 0;
    grid-template-columns: minmax(0, 1fr) 240px; }
  /* The tools dock moves to the tutor's edge, as icon-only tabs, instead of covering it. */
  body.tutor-open .dock { right: 380px; }
  body.tutor-open .dock-tab .dock-label { display: none; }
  body.tutor-open .dock-tab { padding: 0 10px; }
}
@media (max-width: 1099px) {
  .tutor-panel { box-shadow: -14px 0 44px rgba(20, 30, 20, 0.2); }
}
@media (max-width: 720px) {
  .run-controls { flex-wrap: wrap; justify-content: flex-end; row-gap: 4px; }
  body.tutor-open .dock { display: none; }
  /* The site header scrolls away so it can't cover the session's top bar. */
  body.session-page header.site-header { position: static; }
  .tutor-panel { top: auto !important; left: 0; width: auto; height: 74vh; border-left: 0; border-top: 1px solid var(--line); border-radius: 14px 14px 0 0; }
  .tutor-toggle-label { display: none; }
}

/* ---------- "Have a question?" bar under the task (opens the tutor) ---------- */
.ask-bar { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 14px; margin-top: -4px;
  background: var(--surface); border: 1.5px solid color-mix(in srgb, var(--brand) 30%, var(--line)); border-radius: 999px;
  box-shadow: 0 2px 0 rgba(18, 48, 43, 0.06); transition: border-color 0.15s, box-shadow 0.15s; }
.ask-bar[hidden] { display: none; }
.ask-bar:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--focus); }
.ask-icon { display: grid; place-items: center; color: var(--brand); font-size: 1.15rem; }
.ask-input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 0.93rem; padding: 6px 0; outline: none; }
.ask-input::placeholder { color: var(--ink-soft); }
.ask-chips { display: flex; gap: 6px; }
.ask-chips .chip { cursor: pointer; white-space: nowrap; font-size: 0.8rem; padding: 4px 10px; }
.ask-send { border-radius: 999px; padding-inline: 16px; }
body.tutor-open .ask-bar { display: none; }
@media (max-width: 900px) { .ask-chips { display: none; } }
