/* THINKWAYAI focused learning layout (v4). Same brand colors (ink #0b0b0c, green #19e85a, white cards).
   Layout modeled on a "focused learning environment": step rail across the top, the lesson guide as a left column,
   the replay as the main panel with its own header, Claude Code on the right, narration as a labeled strip below.
   The recorded steps and the simulator's internals are untouched: this file only arranges the panels. */
:root { --tf-bg:#f3f6f4; --tf-card:#fff; --tf-line:#dbe7df; --tf-ink:#0b0b0c; --tf-green:#19e85a; --tf-green-d:#067a2b; --tf-mute:#5b6068; --tf-r:14px; }
body { background:var(--tf-bg); }
.pane { border:1px solid var(--tf-line); box-shadow:0 2px 10px rgba(15,31,75,.06); border-radius:var(--tf-r); }

/* ---- step rail: chapter pill · ‹ · step chips · › ---- */
.twl-rail { flex:none; display:flex; align-items:center; gap:8px; padding:8px 16px; background:#fff; border-bottom:1px solid var(--tf-line); min-width:0; }
.twl-chap { flex:none; background:var(--tf-green); color:#062b14; font:800 .66rem system-ui,sans-serif; letter-spacing:.06em; text-transform:uppercase; border-radius:999px; padding:7px 12px; white-space:nowrap; }
.twl-chap[hidden] { display:none; }
.twl-rarrow { flex:none; width:30px; height:30px; border-radius:50%; border:1px solid var(--tf-line); background:#fff; color:var(--tf-ink); cursor:pointer; font:600 1rem/1 system-ui,sans-serif; padding:0; }
.twl-rarrow:hover { border-color:var(--tf-ink); }
.twl-chips { flex:1; min-width:0; display:flex; gap:6px; overflow-x:auto; scrollbar-width:none; padding:2px; }
.twl-chips::-webkit-scrollbar { display:none; }
.twl-step { flex:none; display:inline-flex; align-items:center; gap:7px; border:1px solid var(--tf-line); background:#fff; color:var(--tf-ink); border-radius:999px; padding:6px 11px; font:600 .74rem system-ui,sans-serif; cursor:pointer; white-space:nowrap; max-width:250px; }
.twl-step span { overflow:hidden; text-overflow:ellipsis; }
.twl-step:hover { border-color:var(--tf-ink); }
.twl-step[aria-current=step] { border:2px solid var(--tf-green-d); background:#eefcf2; font-weight:800; padding:5px 10px; }
.twl-step i { flex:none; width:18px; height:18px; border-radius:50%; display:inline-flex; align-items:center; justify-content:center; font:800 .62rem/1 system-ui,sans-serif; font-style:normal; background:#eef1ef; color:var(--tf-mute); }
.twl-step i.seen { background:#dcfce7; color:#065f2a; }
.twl-step i.q { background:var(--tf-ink); color:var(--tf-green); }
.twl-step i.right { background:var(--tf-green); color:#062b14; }

/* ---- the guide is a card (a column on wide screens, a row below on narrower ones) ---- */
main > #twGuide { background:var(--tf-card); border:1px solid var(--tf-line); border-top:1px solid var(--tf-line) !important; border-radius:var(--tf-r); box-shadow:0 2px 10px rgba(15,31,75,.06); max-height:none; min-height:0; overflow:auto; padding:16px 18px 18px; }
.twl-ghead { display:flex; flex-direction:column; align-items:flex-start; gap:4px; margin-bottom:2px; padding-bottom:10px; border-bottom:1px solid var(--tf-line); }
.twl-ghead h2 { font-size:1.12rem; line-height:1.3; }
.twl-say::before { content:"What happens"; display:block; font:800 .62rem system-ui,sans-serif; letter-spacing:.1em; text-transform:uppercase; color:var(--tf-green-d); margin:12px 0 5px; }
.twl-what { margin-top:12px; }
.twl-why, .twl-notice { margin-top:12px; }
.twl-why b, .twl-notice b { display:block; margin:0 0 4px; }
.twl-whobox { margin-top:14px; }
.twl-check { margin-top:14px; }

/* ---- replay panel header (above the simulator) ---- */
.twl-phead { flex:none; display:flex; align-items:center; justify-content:space-between; gap:10px; padding:8px 14px; background:#fff; border-bottom:1px solid var(--tf-line); font:700 .78rem system-ui,sans-serif; color:var(--tf-ink); }
.twl-phk { display:inline-flex; align-items:center; gap:8px; min-width:0; }
.twl-phk b { flex:none; width:20px; height:20px; border-radius:6px; background:var(--tf-ink); color:var(--tf-green); display:inline-flex; align-items:center; justify-content:center; font-size:.68rem; }
.twl-tag { font:800 .6rem system-ui,sans-serif; letter-spacing:.08em; text-transform:uppercase; border-radius:999px; padding:4px 9px; background:#eef1ef; color:var(--tf-mute); white-space:nowrap; }
.twl-tag[hidden] { display:none; }
.twl-tag.recorded { background:#dcfce7; color:#065f2a; }
.twl-tag.edited { background:#dbeafe; color:#1e3a8a; }
.twl-tag.added { background:#fef3c7; color:#92400e; }

/* ---- narration strip below the replay ---- */
body.tw-beginner .twl-caption::before { content:"Narration"; display:block; font:800 .58rem system-ui,sans-serif; letter-spacing:.1em; text-transform:uppercase; color:var(--tf-green); margin-bottom:3px; }

/* ---- controls ---- */
.controls { border-top:1px solid var(--tf-line); }
.cbtn.sec { background:#fff; color:var(--tf-ink); }

/* ---- layout by width ---- */
@media (min-width:1280px) {
  main { grid-template-columns:280px minmax(0,1.6fr) minmax(320px,.8fr); }   /* the replay keeps about the width it had before the guide column */
  main > #twGuide { grid-column:1; grid-row:1; }
  body.focusL main, body.focusR main { grid-template-columns:280px 1fr; }
}
@media (min-width:1600px) {
  main { grid-template-columns:320px minmax(0,1.6fr) minmax(360px,.8fr); }
  body.focusL main, body.focusR main { grid-template-columns:320px 1fr; }
}
/* Below 1280 px the guide stays a (narrower) column: a guide row under the panels starved the replay of height,
   and the replay is scaled to fit its pane (1280×800 at the largest scale that fits). */
@media (min-width:981px) and (max-width:1279px) {
  main { grid-template-columns:236px minmax(0,1.5fr) minmax(300px,.8fr); }
  main > #twGuide { grid-column:1; grid-row:1; padding:12px 14px 14px; font-size:.84rem; }
  body.focusL main, body.focusR main { grid-template-columns:236px 1fr; }
}
@media (min-width:701px) and (max-width:980px) {
  main { grid-template-columns:220px minmax(0,1fr); grid-template-rows:minmax(0,1.25fr) minmax(0,1fr); }
  main > #twGuide { grid-column:1; grid-row:1 / 3; padding:12px 12px 14px; font-size:.82rem; }
  main > #left { grid-column:2; grid-row:1; } main > #right { grid-column:2; grid-row:2; }
  body.focusL main, body.focusR main { grid-template-columns:220px 1fr; grid-template-rows:minmax(0,1fr); }
  body.focusL main > #left, body.focusR main > #right { grid-row:1; }
}
@media (max-width:700px) {
  main > #twGuide { display:none; border-radius:10px; }
  body[data-mobile-view=explanation] main > #twGuide { display:block; flex:1; min-height:0; overflow:auto; max-height:none; }
  body[data-mobile-view=explanation] main #left { display:none; }
  .twl-rail { padding:6px 10px; gap:6px; }
  .twl-chap, .twl-rarrow { display:none; }
  .twl-step { font-size:.7rem; padding:5px 9px; max-width:170px; }
  .twl-phead { padding:6px 10px; font-size:.72rem; }
}
@media (prefers-reduced-motion:reduce) { .twl-chips { scroll-behavior:auto; } }

/* ---- wide screens: the technical "who did what" rows become the panel under the replay (like a results panel),
   so the guide column stays plain-language and the replay keeps a sensible height ---- */
@media (min-width:1280px) {
  body.tw-beginner #explain { display:block; background:#fff; border-top:1px solid var(--tf-line); color:var(--tf-ink); max-height:min(22%, 150px); padding:8px 14px 7px; font-size:.76rem; }   /* short: the replay gets the height */
  body.tw-beginner #explain:empty { display:none; }
  body.tw-beginner #explain::before { content:"Who did what in this step"; display:block; font:800 .6rem system-ui,sans-serif; letter-spacing:.1em; text-transform:uppercase; color:var(--tf-green-d); margin-bottom:4px; }
  body.tw-beginner #explain .lead { color:var(--tf-ink); }
  body.tw-beginner #explain .lead small, body.tw-beginner #explain .recon { color:var(--tf-mute); }
  body.tw-beginner #explain code { background:#f1f3f2; border-color:var(--tf-line); }
  body.tw-beginner #explain .more { border-color:var(--tf-line); color:var(--tf-ink); background:#fff; }
  main > #twGuide .twl-whobox { display:none; }
}
@media (max-width:700px) { .twl-goal { overflow:hidden; } }   /* keep the 2-line clamp (lesson-focus.css opens overflow) */

/* ---- review pass: quieter chrome, one progress indicator, compact playback bar ---- */
/* header: one primary action (Open the app); the rest are plain outline buttons */
.top .fsBtn { background:#fff; border:1px solid var(--tf-line); color:var(--tf-ink); font-weight:600; box-shadow:none; }
.top .fsBtn:hover { border-color:var(--tf-ink); }
.top .fsBtn.primary, .top .openApp, .top .fsBtn[data-primary] { background:var(--tf-ink); border-color:var(--tf-ink); color:var(--tf-green); font-weight:800; }
.top h1 small { display:none; }
/* goal bar: secondary */
.twl-bar { background:var(--tf-bg) !important; border-bottom-color:var(--tf-line) !important; padding:5px 16px; font-size:.76rem; color:var(--tf-mute); }
.twl-bar .twl-k { color:var(--tf-mute); }
.twl-meter, .twl-pct { display:none; }
/* progress: the step rail is the one indicator */
.controls .progress { display:none; }
/* Claude pane: keep the transcript, drop decorative icons */
.ccBar .ccRight, .ccBar .ci, .ccBar .chip { display:none; }
.ccBar .title { margin-left:4px; }
/* playback bar: compact, same height for everything */
.controls { padding:6px 12px; gap:8px; }
.controls .cbtn, .twl-play, .twl-sm { height:32px; padding:0 14px; display:inline-flex; align-items:center; box-shadow:none; }
.twl-sm { padding:0 10px; }
.controls .stepTitle { font-size:.8rem; color:var(--tf-mute); font-weight:500; margin-left:auto; }
/* instruction area: the explanation plus one key takeaway; the small "notice" line is secondary */
.twl-notice { font-size:.8rem; color:var(--tf-mute); }
.twl-notice b { background:transparent; color:var(--tf-mute); padding:0; }

/* ---- guide hidden: the replay and Claude panes take the whole width and height ---- */
.twl-hide { float:right; margin:-2px 0 0 10px; border:1px solid var(--tf-line); background:#fff; color:var(--tf-mute); border-radius:999px; padding:3px 9px; font:700 .66rem system-ui,sans-serif; cursor:pointer; }
.twl-hide:hover { border-color:var(--tf-ink); color:var(--tf-ink); }
.twl-gbtn { font-size:.7rem; }
.twl-gbtn[aria-pressed=false] { opacity:1; text-decoration:none; background:var(--tf-ink); color:var(--tf-green); border-color:var(--tf-ink); }
body.tw-guide-off main > #twGuide { display:none; }
@media (min-width:701px) {
  body.tw-guide-off main { grid-template-columns:minmax(0,1.6fr) minmax(320px,.8fr); grid-template-rows:minmax(0,1fr); }
  body.tw-guide-off main > #left { grid-column:1; grid-row:1; } body.tw-guide-off main > #right { grid-column:2; grid-row:1; }
  body.tw-guide-off.focusL main, body.tw-guide-off.focusR main { grid-template-columns:1fr; }
}
@media (max-width:700px) { .twl-hide, .twl-gbtn { display:none; } body.tw-guide-off[data-mobile-view=explanation] main > #twGuide { display:block; } }
/* the notes panel under the replay starts collapsed to its one-line lead (More ▾ opens it), so the replay keeps its height */
@media (min-width:1280px) {
  body.tw-beginner #explain:not(.open) .row, body.tw-beginner #explain:not(.open) .recon { display:none; }
  body.tw-beginner #explain:not(.open) { max-height:none; }
  body.tw-beginner #explain .lead { display:inline; margin:0; } body.tw-beginner #explain .more { margin:0 0 0 8px; vertical-align:middle; }
}
body.tw-guide-off .twl-bar { display:none; }   /* the goal line belongs to the guide; hidden with it, the panes get its height too */
