/* code-viz modes styling (modes.css): the mode tabs, Explain mode's code marks and step card,
   Simulate mode's terminal, docker ps table, network diagram and command prompt, and the blank
   screen. Colors come from viewer.css's tokens, so light and dark themes both work.

   Full manual: the header of code-viz (`code-viz readme`, or README.md), sections 21 to 23.
*/
.modetabs { display: inline-flex; gap: 4px; margin-left: 12px; }
.modetabs[hidden] { display: none; }
.modetab { padding: 3px 12px; }
.modenote { margin: 0 0 8px; padding: 6px 10px; border-left: 3px solid var(--accent); background: var(--card); color: var(--muted); font-size: 13px; }

/* Explain mode: lines not yet revealed keep their place but are hidden; focus dims the rest. */
body[data-mode="explain"] .code .ln.hid { visibility: hidden; }
body[data-mode="explain"] .code .ln.dim { opacity: 0.35; }
body[data-mode="explain"] .code .ln.foc { background: var(--hl); }
body[data-mode="explain"] .code .ln.fresh { animation: cviz-fresh 1.4s ease-out; box-shadow: inset 3px 0 0 var(--ok); }
@keyframes cviz-fresh { from { background: var(--hl-strong); } to { background: transparent; } }
@media (prefers-reduced-motion: reduce) { body[data-mode="explain"] .code .ln.fresh { animation: none; } }
.tourcard { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; margin-bottom: 10px; }
.tourcard h3 { margin: 6px 0 4px; font-size: 15px; }
.tourcard p { margin: 6px 0; }
.tourhead { font-weight: 700; }
.tourdesc { color: var(--muted); }
.predict { border-left: 3px solid var(--accent); padding-left: 8px; }
.answer { border-left: 3px solid var(--ok); padding-left: 8px; }
.badge.draft { background: transparent; color: var(--muted); border: 1px dashed var(--muted); border-radius: 4px; padding: 0 5px; font-size: 11px; font-weight: 400; }

/* Simulate mode: the terminal emulator box keeps the recorded width; on a narrow screen the font
   shrinks to fit (mode-simulate.js) and, past that, the box scrolls sideways, never the page. */
.simterm { background: #1d2330; border-radius: 8px; padding: 6px; overflow-x: auto; max-width: 100%; box-sizing: border-box; }
.simterm[hidden] { display: none; }
.simterm .xterm { display: inline-block; }
.simterm.plainterm { color: #e6e9ef; font: 13px/1.45 ui-monospace, Menlo, Consolas, monospace; white-space: pre-wrap; min-height: 200px; }
.extra .sep { display: inline-block; width: 10px; }
/* Simulate mode: plain-text fallback, prompt, docker ps, diagram. */
body[data-mode="simulate"] .code { white-space: pre-wrap; }
.tline { font-weight: 600; }
.tline .prompt { color: var(--ok); }
.tout { color: var(--fg); opacity: 0.85; margin: 0 0 6px; }
.tline.now, .tout.now { background: var(--hl); }
.texit { color: var(--bad); font-size: 12px; margin-bottom: 6px; }
.simbar { margin: 6px 0 10px; }
.simbar[hidden] { display: none; }
.simbar input { width: 100%; box-sizing: border-box; font: 13px/1.5 ui-monospace, Menlo, Consolas, monospace; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); color: var(--fg); }
.panel-sub { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin: 12px 0 4px; }
.dps { border-collapse: collapse; width: 100%; font-size: 12px; }
.dps th, .dps td { border-bottom: 1px solid var(--line); padding: 3px 6px; text-align: left; }
.netdiag { display: flex; flex-wrap: wrap; gap: 10px; }
.net { border: 1px dashed var(--muted); border-radius: 10px; padding: 6px 8px 8px; min-width: 160px; }
.netname { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.ctr { border: 1px solid var(--line); border-radius: 6px; padding: 5px 7px; margin-top: 5px; background: var(--card); display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.ctr.up { box-shadow: inset 3px 0 0 var(--ok); }
.ctr.down { opacity: 0.6; }
.ctr .img { color: var(--muted); font-size: 11px; }
.tag { font-size: 11px; border-radius: 4px; padding: 0 5px; border: 1px solid var(--line); }
.tag.port { border-color: var(--accent); }
.tag.mount { border-style: dashed; }
.mono { font: 12px/1.45 ui-monospace, Menlo, Consolas, monospace; white-space: pre-wrap; margin: 0; }
.tournote { border-left: 3px solid var(--accent); padding-left: 8px; }

/* The presenter's blank screen (B). */
.blank { position: fixed; inset: 0; background: #000; z-index: 50; cursor: none; }
.blank[hidden] { display: none; }
body.student .modetab { min-height: 40px; }
