/* NetLab OS: a Windows-style simulated desktop with a Linux terminal inside. System fonts only, so it works offline. */
:root {
  --ui: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Noto Sans", Cantarell, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Mono", "Cascadia Code", "DejaVu Sans Mono", "Liberation Mono", ui-monospace, Menlo, Consolas, monospace;
  --accent: #0067c0; --accent-2: #0078d4; --accent-soft: #cce4f7;
  --bg: #f3f3f3; --bg-2: #fafafa; --card: #ffffff; --text: #1b1b1b; --muted: #5d5b59; --line: #e1dfdd; --line-2: #c8c6c4;
  --ok: #0e700e; --ok-soft: #dff6dd; --bad: #c42b1c; --bad-soft: #fde7e9; --note: #fff4ce; --note-ink: #433519;
  --term-bg: #1c1c1c; --term-fg: #e6e6e6; --term-dim: #8a8a8a; --term-green: #8ae234; --term-blue: #729fcf; --term-yellow: #fce94f; --term-red: #ef2929; --term-magenta: #ad7fa8; --term-cyan: #34e2e2; --term-line: #2e2e2e;
  --shadow-win: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(0, 0, 0, 0.12);
  --shadow-win-off: 0 4px 14px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.1);
  --taskbar-h: 48px; --title-h: 36px;
  --wallpaper: radial-gradient(60% 70% at 22% 62%, #1d6fe0 0, transparent 62%), radial-gradient(50% 60% at 74% 38%, #7cc0ff 0, transparent 60%), radial-gradient(42% 50% at 58% 90%, #5a40d0 0, transparent 66%), linear-gradient(135deg, #d6e8fb, #8db6ee);
}
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; }
body { font-family: var(--ui); font-size: 14px; line-height: 1.45; color: var(--text); background: #000; -webkit-font-smoothing: antialiased; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
svg { display: block; }

/* ---------- boot ---------- */
.screen { position: fixed; inset: 0; z-index: 900; }
.boot { background: #000; color: #fff; display: grid; place-content: center; justify-items: center; gap: 56px; }
.logo { display: grid; grid-template-columns: 44px 44px; gap: 5px; }
.logo i { display: block; width: 44px; height: 44px; background: linear-gradient(135deg, #4cc2ff, #0078d4); box-shadow: 0 0 28px rgba(76, 194, 255, 0.45); }
.spinner { position: relative; width: 44px; height: 44px; }
.spinner b { position: absolute; inset: 0; animation: orbit 2.4s cubic-bezier(0.4, 0.1, 0.4, 0.9) infinite; opacity: 0; }
.spinner b::before { content: ""; position: absolute; left: 50%; top: 0; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: #fff; }
.spinner b:nth-child(2) { animation-delay: 0.15s; } .spinner b:nth-child(3) { animation-delay: 0.3s; } .spinner b:nth-child(4) { animation-delay: 0.45s; } .spinner b:nth-child(5) { animation-delay: 0.6s; }
@keyframes orbit { 0% { transform: rotate(0); opacity: 1; } 70% { transform: rotate(360deg); opacity: 1; } 100% { transform: rotate(360deg); opacity: 0; } }
#boot-line { color: #bdbdbd; min-height: 1.5em; }

/* ---------- lock and sign in ---------- */
.lock { background: var(--wallpaper); color: #fff; display: grid; grid-template-rows: auto 1fr; justify-items: center; padding: 8vh 16px 6vh; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35); }
.lockclock { text-align: center; }
#lock-time { font-size: clamp(64px, 14vw, 120px); font-weight: 200; line-height: 1; letter-spacing: -0.02em; }
#lock-date { font-size: clamp(16px, 3vw, 22px); margin-top: 6px; }
.signin { align-self: center; display: grid; justify-items: center; gap: 12px; width: min(92vw, 340px); text-align: center; }
.avatar { width: 112px; height: 112px; border-radius: 50%; background: rgba(255, 255, 255, 0.28); backdrop-filter: blur(12px); display: grid; place-items: center; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5); }
.avatar svg { width: 62%; fill: #fff; }
.avatar.sm { width: 28px; height: 28px; background: var(--accent-soft); box-shadow: none; display: inline-grid; vertical-align: middle; margin-right: 8px; }
.avatar.sm svg { fill: var(--accent); }
.signin h1 { font-size: 26px; font-weight: 600; }
.signbtn { min-width: 160px; padding: 9px 28px; border: 1px solid rgba(255, 255, 255, 0.6); border-radius: 4px; background: rgba(255, 255, 255, 0.22); backdrop-filter: blur(12px); color: #fff; font-weight: 600; text-shadow: none; }
.signbtn:hover { background: rgba(255, 255, 255, 0.34); }
.signin p { font-size: 13px; opacity: 0.92; max-width: 30ch; }
.noscript { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 24px; background: var(--bg); text-align: center; }

/* ---------- desktop ---------- */
#desktop { position: fixed; inset: 0; background: var(--wallpaper); overflow: hidden; }
.icons { position: absolute; left: 8px; top: 8px; display: grid; gap: 4px; z-index: 1; }
.dicon { width: 88px; padding: 8px 4px 6px; border: 1px solid transparent; border-radius: 4px; background: transparent; color: #fff; display: grid; justify-items: center; gap: 6px; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7); }
.dicon:hover { background: rgba(255, 255, 255, 0.16); border-color: rgba(255, 255, 255, 0.3); }
.dicon:focus-visible { outline: 1px dotted #fff; background: rgba(255, 255, 255, 0.22); }
.dicon .lbl { font-size: 12.5px; line-height: 1.2; text-align: center; }
.ico { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3); }
.ico svg { width: 26px; height: 26px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ic-map { background: linear-gradient(135deg, #2f9bff, #0059b3); }
.ic-term { background: linear-gradient(135deg, #3c3c3c, #111); }
.ic-mentor { background: linear-gradient(135deg, #34b36f, #0b6a3c); }
.ic-learn { background: linear-gradient(135deg, #f5a623, #c25e00); }
.stage { position: absolute; inset: 0 0 var(--taskbar-h) 0; z-index: 2; pointer-events: none; }
.stage > .win { pointer-events: auto; }

/* ---------- windows ---------- */
.win { position: absolute; left: 0; top: 0; display: grid; grid-template-rows: var(--title-h) minmax(0, 1fr); min-width: 0; min-height: 0; background: var(--bg); border-radius: 8px; box-shadow: var(--shadow-win-off); overflow: visible; }
.win.active { box-shadow: var(--shadow-win); }
.win.min { display: none; }
.win.max { inset: 0 !important; width: auto !important; height: auto !important; translate: none !important; border-radius: 0; }
.wtitle { display: flex; align-items: center; gap: 8px; padding-left: 10px; background: var(--bg-2); color: var(--muted); border-radius: 8px 8px 0 0; cursor: default; touch-action: none; user-select: none; -webkit-user-select: none; min-width: 0; }
.win.active .wtitle { background: var(--bg); color: var(--text); }
.win.max .wtitle { border-radius: 0; }
.wtitle b { font-weight: 400; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wspace { flex: 1; min-width: 4px; }
.wico { width: 18px; height: 18px; border-radius: 4px; display: grid; place-items: center; flex: none; }
.wico svg { width: 12px; height: 12px; fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.wc { width: 46px; height: var(--title-h); border: 0; background: transparent; display: grid; place-items: center; color: inherit; flex: none; }
.wc svg { width: 10px; height: 10px; fill: none; stroke: currentColor; stroke-width: 1; }
.wc:hover { background: rgba(0, 0, 0, 0.07); }
.wc.wclose:hover { background: #c42b1c; color: #fff; border-top-right-radius: 8px; }
.win.max .wc.wclose:hover { border-top-right-radius: 0; }
.wbody { min-height: 0; min-width: 0; background: var(--bg); border-radius: 0 0 8px 8px; overflow: hidden; }
.win.max .wbody { border-radius: 0; }
.rz { position: absolute; z-index: 5; }
.rz.r { right: -3px; top: 6px; bottom: 6px; width: 7px; cursor: ew-resize; }
.rz.b { bottom: -3px; left: 6px; right: 6px; height: 7px; cursor: ns-resize; }
.rz.br { right: -4px; bottom: -4px; width: 14px; height: 14px; cursor: nwse-resize; }
.win.max .rz { display: none; }

/* ---------- taskbar and start ---------- */
.taskbar { position: absolute; left: 0; right: 0; bottom: 0; height: var(--taskbar-h); z-index: 600; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; background: rgba(243, 243, 243, 0.86); backdrop-filter: blur(28px) saturate(1.4); border-top: 1px solid rgba(0, 0, 0, 0.08); }
.tcenter { grid-column: 2; display: flex; gap: 4px; align-items: center; }
.tbtn { position: relative; width: 44px; height: 40px; border: 0; border-radius: 6px; background: transparent; display: grid; place-items: center; }
.tbtn:hover { background: rgba(255, 255, 255, 0.7); }
.tbtn:active { transform: scale(0.94); }
.tbtn .ico { width: 28px; height: 28px; border-radius: 7px; box-shadow: none; }
.tbtn .ico svg { width: 17px; height: 17px; }
.tbtn::after { content: ""; position: absolute; bottom: 2px; left: 50%; width: 0; height: 3px; margin-left: 0; border-radius: 2px; background: #6b6b6b; transition: width 120ms ease, margin-left 120ms ease, background-color 120ms ease; }
.tbtn.open::after { width: 6px; margin-left: -3px; }
.tbtn.active::after { width: 16px; margin-left: -8px; background: var(--accent); }
.startbtn.on { background: rgba(255, 255, 255, 0.85); }
.wlogo { display: grid; grid-template-columns: 10px 10px; gap: 2px; }
.wlogo i { display: block; width: 10px; height: 10px; background: linear-gradient(135deg, #3aa0ff, #0067c0); border-radius: 1px; }
.tray { grid-column: 3; justify-self: end; display: flex; align-items: center; gap: 12px; padding-right: 12px; }
.simtag { font-size: 12px; color: var(--note-ink); background: var(--note); padding: 2px 8px; border-radius: 10px; border: 1px solid #e6d28a; }
.net { width: 18px; height: 18px; fill: none; stroke: var(--text); stroke-width: 1.6; stroke-linecap: round; }
.net circle { fill: var(--text); stroke: none; }
.clock { display: grid; text-align: right; font-size: 12px; line-height: 1.25; }
.clock b { font-weight: 400; }
.start { position: absolute; left: 50%; bottom: calc(var(--taskbar-h) + 10px); translate: -50% 0; width: min(560px, calc(100vw - 16px)); z-index: 590; background: rgba(243, 243, 243, 0.94); backdrop-filter: blur(30px) saturate(1.4); border-radius: 8px; box-shadow: var(--shadow-win); overflow: clip; display: grid; }
.start h2 { font-size: 14px; font-weight: 600; padding: 18px 24px 8px; }
.pins { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 0 16px; }
.pin { display: grid; justify-items: center; gap: 6px; padding: 12px 6px; border: 0; border-radius: 6px; background: transparent; font-size: 12.5px; }
.pin:hover { background: rgba(255, 255, 255, 0.8); }
.mlist { display: grid; gap: 2px; padding: 0 16px 14px; max-height: 40vh; overflow: auto; }
.mitem { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: center; text-align: left; padding: 8px 10px; border: 0; border-radius: 6px; background: transparent; }
.mitem:hover { background: rgba(255, 255, 255, 0.8); }
.mitem .n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 12px; }
.mitem small { display: block; color: var(--muted); font-size: 12px; }
.mitem[aria-current=true] { background: rgba(255, 255, 255, 0.9); box-shadow: inset 3px 0 0 var(--accent); }
.startfoot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 16px; background: rgba(230, 230, 230, 0.9); border-top: 1px solid rgba(0, 0, 0, 0.06); }
.who { flex: 1; min-width: 90px; font-weight: 600; }
.sbtn { padding: 6px 12px; border: 1px solid var(--line-2); border-radius: 4px; background: var(--bg-2); font-size: 12.5px; }
.sbtn:hover { background: #fff; }
.sbtn[aria-pressed=true] { background: var(--accent); color: #fff; border-color: var(--accent); }
.toast { position: absolute; right: 12px; bottom: calc(var(--taskbar-h) + 12px); width: min(320px, calc(100vw - 24px)); z-index: 580; background: var(--card); border-radius: 8px; box-shadow: var(--shadow-win); padding: 12px 14px; border-left: 4px solid var(--ok); animation: slidein 220ms ease-out; }
.toast b { display: block; font-size: 12px; color: var(--muted); font-weight: 400; margin-bottom: 2px; }
@keyframes slidein { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- terminal: a Linux shell in a Windows Terminal-style window ---------- */
.term { position: relative; display: grid; grid-template-rows: minmax(0, 1fr) auto; background: var(--term-bg); color: var(--term-fg); font-family: "Cascadia Mono", "JetBrains Mono", "DejaVu Sans Mono", "Liberation Mono", ui-monospace, Menlo, Consolas, monospace; font-size: 14.5px; line-height: 1.4; font-variant-ligatures: none; font-feature-settings: "liga" 0, "calt" 0; }
.term ::selection { background: #264f78; color: #fff; }
.tout { overflow: auto; padding: 14px 18px 2px; white-space: pre-wrap; overflow-wrap: anywhere; min-height: 0; scrollbar-color: #4a4a4a transparent; scrollbar-width: thin; }
.ln { min-height: 1.4em; }
.ln.hint { color: var(--term-yellow); } .ln.dim, .ln.sys { color: var(--term-dim); }
.pu { color: var(--term-green); font-weight: 700; } .pp { color: var(--term-blue); font-weight: 700; }
.c-dir { color: var(--term-blue); font-weight: 700; } .c-exe { color: var(--term-green); font-weight: 700; }
.c-match { color: var(--term-red); font-weight: 700; } .c-fn { color: var(--term-magenta); } .c-sep { color: var(--term-cyan); } .c-ln { color: var(--term-green); }
.tline { display: flex; align-items: flex-start; padding: 0 18px 16px; }
.tprompt { white-space: pre; }
.term textarea#tin { flex: 1; min-width: 0; width: 100%; field-sizing: content; resize: none; overflow: hidden; border: 0; outline: none; background: transparent; color: var(--term-fg); font: inherit; line-height: inherit; padding: 0; margin: 0; caret-color: #fff; caret-shape: block; white-space: pre-wrap; overflow-wrap: anywhere; }
.nano { position: absolute; inset: 0; z-index: 4; display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; background: var(--term-bg); color: var(--term-fg); }
.nhead { display: grid; grid-template-columns: 1fr auto 1fr; padding: 0 8px; background: var(--term-fg); color: var(--term-bg); }
.nhead b { font-weight: 400; } .nhead span:last-child { text-align: right; }
.nano textarea { border: 0; outline: none; resize: none; padding: 4px 8px; background: transparent; color: var(--term-fg); font: inherit; line-height: inherit; caret-color: #fff; caret-shape: block; tab-size: 8; white-space: pre; overflow: auto; }
.nstatus { min-height: 1.4em; padding: 0 8px; text-align: center; }
.nstatus span { background: var(--term-fg); color: var(--term-bg); padding: 0 8px; }
.nfoot { display: flex; flex-wrap: wrap; gap: 4px 18px; padding: 2px 8px 4px; }
.nfoot button { border: 0; background: transparent; color: var(--term-fg); padding: 0; font: inherit; }
.nfoot button b { background: var(--term-fg); color: var(--term-bg); font-weight: 400; padding: 0 3px; margin-right: 6px; }
.nfoot button:hover b { background: var(--term-yellow); }

/* ---------- map ---------- */
.mapbody { display: grid; grid-template-columns: minmax(0, 1fr) minmax(230px, 270px); background: #fff; }
#map { width: 100%; height: 100%; min-height: 0; min-width: 0; background: #fbfbfb; }
.cable { stroke: #8a8886; stroke-width: 3; stroke-linecap: round; }
.node .body { fill: #fff; stroke: #3b3a39; stroke-width: 2.2; }
.node.sw .body { fill: #cce4f7; }
.node.you .body { fill: var(--note); }
.node .scr { fill: #e7eaee; } .node .stand { fill: #3b3a39; }
.node text { fill: var(--text); font-family: var(--ui); text-anchor: middle; }
.node .nm { font-size: 16px; font-weight: 600; }
.node .ipt { font-family: var(--mono); font-size: 11.5px; fill: var(--muted); }
.node .tag { font-size: 11px; fill: var(--muted); }
.halo { fill: none; stroke: var(--accent-2); stroke-width: 5; opacity: 0; }
.halo.bad { stroke: var(--bad); }
.port circle { fill: #fff; stroke: #3b3a39; stroke-width: 2; transition: fill 120ms ease; }
.port text { font-family: var(--mono); font-size: 11px; fill: var(--text); text-anchor: middle; dominant-baseline: central; }
.port.empty circle { stroke-dasharray: 3 3; opacity: 0.6; }
.port.in circle { fill: var(--accent-2); } .port.in text { fill: #fff; }
.port.out circle { fill: #ffb900; }
.pkt rect { stroke: rgba(0, 0, 0, 0.45); stroke-width: 1; }
.pkt text { font-family: var(--mono); font-size: 11px; text-anchor: middle; dominant-baseline: central; }
.pkt.arp rect { fill: #ffb900; } .pkt.arp text { fill: #1b1b1b; }
.pkt.icmp rect { fill: #0078d4; } .pkt.icmp text { fill: #fff; }
.pkt.tcp rect { fill: #107c10; } .pkt.tcp text { fill: #fff; }
.pkt.udp rect { fill: #ca5010; } .pkt.udp text { fill: #fff; }
.burst circle { fill: none; stroke: var(--bad); stroke-width: 5; }
.burst path { fill: none; stroke: var(--bad); stroke-width: 6; stroke-linecap: round; }
.mapfoot { min-width: 0; display: grid; gap: 8px; align-content: start; overflow: auto; padding: 14px 16px; border-left: 1px solid var(--line); background: var(--bg); }
.mapfoot h3 { font-size: 12px; font-weight: 600; color: var(--muted); }
#decision { min-height: 3.2em; padding: 8px 10px; border-radius: 6px; background: var(--note); color: var(--note-ink); font-size: 13px; overflow-wrap: anywhere; }
.mactbl { width: 100%; border-collapse: collapse; font-size: 12.5px; background: var(--card); border-radius: 6px; overflow: hidden; }
.mactbl th, .mactbl td { padding: 5px 6px; text-align: left; border-bottom: 1px solid var(--line); }
.mactbl th { font-weight: 600; background: var(--bg-2); color: var(--muted); }
.mactbl td:nth-child(2) { font-family: var(--mono); font-size: 10.5px; white-space: nowrap; }
.mactbl tr.fresh td { background: var(--note); }
.mactbl td.none { color: var(--muted); }

/* ---------- Lab Assistant ---------- */
.mentor { overflow: auto; padding: 16px; display: grid; gap: 14px; align-content: start; font-size: 13.5px; background: var(--bg); }
.mentor h2 { font-size: 22px; font-weight: 600; }
.mentor p { max-width: none; }
.mhead { display: grid; gap: 8px; }
.mchips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn { padding: 4px 12px; border: 1px solid var(--line-2); border-radius: 14px; background: var(--card); font-size: 12.5px; }
.chip-btn:hover { background: var(--accent-soft); }
.chip-btn[aria-current=true] { background: var(--accent); border-color: var(--accent); color: #fff; }
.story, .muted { color: var(--muted); }
.pbar { display: grid; gap: 4px; color: var(--muted); font-size: 12.5px; }
.prog { height: 4px; border-radius: 2px; background: #d5d3d1; overflow: clip; }
.prog i { display: block; height: 100%; border-radius: 2px; background: var(--accent); transform-origin: left; transform: scaleX(var(--p, 0)); transition: transform 300ms ease; }
.card { padding: 14px 16px; border-radius: 8px; background: var(--card); border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); display: grid; gap: 10px; }
.card h3 { font-size: 16px; font-weight: 600; }
.card .why { color: var(--muted); }
.card .why b { color: var(--text); font-weight: 600; }
.cmd { display: inline; font-family: var(--mono); font-size: 12px; background: #1f1f1f; color: #e8e8e8; border: 0; border-radius: 4px; padding: 2px 7px; text-align: left; overflow-wrap: anywhere; line-height: 1.8; }
.cmd:hover { background: var(--accent); color: #fff; }
.row { display: flex; flex-wrap: wrap; gap: 8px; }
.btn { padding: 6px 16px; border: 1px solid var(--line-2); border-radius: 4px; background: var(--bg-2); font-size: 13px; }
.btn:hover { background: #fff; border-color: #a8a6a4; }
.btn:active { background: #ececec; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn--primary:hover { background: #1975c5; border-color: #1975c5; }
.hintbox { padding: 8px 10px; border-radius: 6px; background: var(--accent-soft); color: #0b3a66; }
.qopts { display: grid; gap: 6px; }
.opt { text-align: left; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--card); line-height: 1.35; }
.opt:hover { border-color: var(--accent); background: #f4f9fd; }
.opt[aria-pressed=true] { border-color: var(--bad); background: var(--bad-soft); }
.qfb { padding: 8px 10px; border-radius: 6px; background: var(--bad-soft); color: #5a1010; }
.banner { padding: 8px 12px; border-radius: 6px; background: var(--ok-soft); color: #0b3d0b; font-weight: 600; animation: slidein 220ms ease-out; }
.done-card { background: #f0f7ff; border-color: #b5d5f0; }
.done-card ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.qa { border-radius: 6px; background: var(--card); border: 1px solid var(--line); padding: 6px 10px; }
.qa summary { cursor: pointer; font-weight: 600; }
.qa p { margin-top: 6px; }
.slist { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.sitem { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 8px; align-items: start; color: var(--muted); }
.sitem .dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 600; border: 1.5px solid var(--line-2); background: var(--card); }
.sitem.done { color: var(--text); }
.sitem.done .dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.sitem.done .dot svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sitem.now { color: var(--text); font-weight: 600; }
.sitem.now .dot { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- small screens: one app at a time, switched from the taskbar ---------- */
.stage[data-phone] > .win { inset: 0 !important; width: auto !important; height: auto !important; translate: none !important; border-radius: 0; }
.stage[data-phone] > .win:not(.show) { display: none; }
.stage[data-phone] .wtitle { border-radius: 0; }
.stage[data-phone] .wmin, .stage[data-phone] .wmax, .stage[data-phone] .rz { display: none; }
.stage[data-phone] .mapbody { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto; overflow: auto; }
.stage[data-phone] .mapfoot { border-left: 0; border-top: 1px solid var(--line); overflow: visible; }
@media (max-width: 47.5rem) {
  .icons { display: none; }
  .simtag, .clock span { display: none; }
  .taskbar { grid-template-columns: auto 1fr; }
  .tcenter { grid-column: 1; justify-self: start; padding-left: 4px; }
  .tray { grid-column: 2; }
  .term { font-size: 13px; }
  .mentor { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; } .spinner b { opacity: 1; } }

/* ---------- Concepts: chapters, widgets, games ---------- */
.learn { display: grid; grid-template-columns: minmax(220px, 290px) minmax(0, 1fr); min-height: 0; background: var(--card); --cw: 26px; }
.lnav { overflow: auto; min-height: 0; padding: 16px; border-right: 1px solid var(--line); background: var(--bg); display: grid; gap: 8px; align-content: start; }
.lnav h2 { font-size: 22px; font-weight: 600; } .lnav h3 { font-size: 12px; color: var(--muted); margin-top: 8px; font-weight: 600; }
.lchap { text-align: left; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--card); display: grid; gap: 2px; }
.lchap:hover { border-color: var(--accent); } .lchap b { font-weight: 600; } .lchap span { color: var(--muted); font-size: 12.5px; } .lchap em { color: var(--ok); font-style: normal; font-size: 12px; font-weight: 600; }
.lchap[aria-current=true] { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.lpage { overflow: auto; min-height: 0; padding: 20px 28px 40px; display: grid; gap: 18px; align-content: start; }
.lpage h2 { font-size: 28px; font-weight: 600; } .lsec { display: grid; gap: 10px; min-width: 0; } .lsec h3 { font-size: 18px; font-weight: 600; }
.lsec p, .lsec li { max-width: 72ch; } .lsec ul { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.lback { justify-self: start; display: none; }
.widget { padding: 14px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); display: grid; gap: 10px; min-width: 0; overflow: hidden; }
.wctl { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; } .wctl label { display: flex; gap: 6px; align-items: center; font-size: 13px; }
.bitsin, .widget select { padding: 5px 8px; border: 1px solid var(--line-2); border-radius: 4px; background: #fff; font-family: var(--mono); font-size: 13px; }
.bitsin { width: 12em; }
.wmsg { padding: 8px 10px; border-radius: 6px; background: var(--bg-2); border: 1px solid var(--line); } .wmsg.ok { background: var(--ok-soft); border-color: #b6dfb4; } .wmsg.bad { background: var(--bad-soft); border-color: #f1b5ba; } .wmsg.warn { background: var(--note); color: var(--note-ink); border-color: #e6d28a; }
.cap { font-size: 12.5px; color: var(--muted); } .fine { color: var(--muted); font-size: 12.5px; }
.crcboard { overflow-x: auto; padding-bottom: 6px; display: grid; gap: 4px; justify-items: start; align-content: start; }
.crow { display: flex; } .cstep { display: grid; gap: 3px; justify-items: start; margin-top: 6px; } .cstep.in { animation: rowin 0.45s ease-out; }
@keyframes rowin { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.cell { width: var(--cw); height: 30px; display: grid; place-items: center; font-family: var(--mono); border: 1px solid var(--line-2); background: #fff; margin-right: -1px; padding: 0; flex: none; }
.cell.pad { color: var(--muted); background: var(--bg); } .cell.gen { background: #fff4ce; } .cell.cwin { background: #cce4f7; } .cell.chg { font-weight: 700; color: var(--bad); } .cell.done { color: #9a9996; background: var(--bg); }
button.cell.inp { cursor: pointer; background: #fff; } button.cell.inp:hover { background: #e6f2fc; } button.cell.inp:disabled { background: var(--bg); cursor: default; }
.bits { display: flex; flex-wrap: wrap; gap: 6px; }
.bit { position: relative; width: 42px; height: 46px; padding: 14px 0 0; border-radius: 8px; border: 2px solid var(--line-2); background: #fff; font-family: var(--mono); font-size: 18px; transition: background-color 0.2s, border-color 0.2s; }
.bit.d { border-color: #0078d4; background: #e6f2fc; } .bit.r { border-color: #ca5010; background: #fdeee3; } .bit.flipped { background: #fde7e9; border-color: var(--bad); } .bit:hover { filter: brightness(0.96); }
.bpos { position: absolute; top: 2px; left: 0; right: 0; font-size: 9.5px; color: var(--muted); line-height: 1.2; font-family: var(--ui); }
.hgrid { display: grid; grid-template-columns: minmax(220px, 320px) minmax(0, 1fr); gap: 16px; align-items: start; } .hside { display: grid; gap: 10px; min-width: 0; }
.venn { width: 100%; max-width: 330px; }
.vc { fill: rgba(0, 120, 212, 0.07); stroke: #6b6b6b; stroke-width: 2; transition: fill 0.3s, stroke 0.3s; } .vc.bad { fill: rgba(196, 43, 28, 0.2); stroke: var(--bad); }
.vlab { font-size: 11px; fill: var(--muted); } .vdot { fill: #fff; stroke: #3b3a39; stroke-width: 2; } .vbit.par .vdot { fill: #fdeee3; } .vbit.dat .vdot { fill: #e6f2fc; }
.vring { fill: none; stroke: var(--bad); stroke-width: 3; opacity: 0; transition: opacity 0.2s; } .vbit.flipped .vring { opacity: 1; } .vbit.target .vring { opacity: 1; stroke: #107c10; animation: pulse 0.5s infinite alternate; }
@keyframes pulse { from { stroke-width: 2; } to { stroke-width: 6; } }
.vval { font-family: var(--mono); font-size: 14px; font-weight: 700; fill: var(--text); } .vpos { font-size: 9px; fill: var(--muted); } .venn.blind .vval { opacity: 1; }
.tbar { height: 6px; background: #d5d3d1; border-radius: 3px; overflow: hidden; } .tbar i { display: block; height: 100%; background: var(--accent); transform-origin: left; transform: scaleX(1); }
.game { padding: 14px; border-radius: 10px; border: 2px dashed var(--accent); background: #f0f7ff; display: grid; gap: 10px; min-width: 0; } .game h4 { margin: 0; font-size: 16px; } .gh { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.stations { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; }
.stn { padding: 10px; border-radius: 10px; border: 2px solid var(--line-2); background: #fff; display: grid; gap: 6px; justify-items: center; }
.stn:hover { border-color: var(--accent); } .stn.go { border-color: #107c10; background: #dff6dd; box-shadow: 0 0 0 3px rgba(16, 124, 16, 0.2); }
.qd { display: flex; gap: 3px; flex-wrap: wrap; justify-content: center; min-height: 12px; } .qd i { width: 12px; height: 12px; border-radius: 3px; background: #0078d4; }
.tl { width: 100%; height: auto; background: #fff; border-radius: 8px; border: 1px solid var(--line); } .lane { font: 11px var(--mono); fill: var(--muted); } .lline { stroke: #e1dfdd; } .cursor { stroke: var(--accent); stroke-width: 2; }
.fr { fill: #9aa0a6; } .fr.live { fill: #ffb900; } .fr.ok { fill: #107c10; } .fr.bad { fill: var(--bad); }
.cstats { display: flex; flex-wrap: wrap; gap: 6px 18px; } .cstats .g b { color: var(--ok); } .cstats .r b { color: var(--bad); }
.cbar { display: grid; grid-template-columns: minmax(110px, 190px) 1fr 44px; gap: 10px; align-items: center; } .cb { height: 14px; background: #d5d3d1; border-radius: 7px; overflow: hidden; } .cb i { display: block; height: 100%; transition: width 0.6s ease; }
.cb .al { background: var(--bad); } .cb .cs { background: var(--accent); } .cb .me { background: var(--ok); }
.qcard { padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; display: grid; gap: 8px; } .opt.right { border-color: var(--ok); background: var(--ok-soft); } .opt.wrong { border-color: var(--bad); background: var(--bad-soft); }
@media (max-width: 47.5rem) {
  .learn { grid-template-columns: minmax(0, 1fr); } .learn .lpage { display: none; } .learn.reading .lnav { display: none; } .learn.reading .lpage { display: grid; padding: 14px; } .lback { display: inline-block; }
  .hgrid { grid-template-columns: minmax(0, 1fr); } .cbar { grid-template-columns: 1fr 44px; } .cbar span { grid-column: 1 / -1; } :root { --cw: 20px; } .learn { --cw: 22px; }
}

/* ---------- Concepts, parts 2 and 3 ---------- */
.mono { font-family: var(--mono); } .bitsin.wide { width: min(100%, 27em); } .scn { font-size: 16px; font-weight: 600; }
.hubsvg { width: 100%; max-width: 420px; height: auto; background: #fff; border: 1px solid var(--line); border-radius: 8px; } .hubgrid, .rgrid { display: grid; grid-template-columns: minmax(240px, 430px) minmax(0, 1fr); gap: 16px; align-items: start; }
.cable { stroke: #8a8886; stroke-width: 3; } .devbox { fill: #cce4f7; stroke: #3b3a39; stroke-width: 2; } .devlab { font: 700 13px var(--ui); fill: var(--text); }
.hostbox { fill: #fff; stroke: #3b3a39; stroke-width: 2; transition: fill 0.25s; } .hostbox.ok { fill: #dff6dd; stroke: #107c10; } .hostbox.bad { fill: #fde7e9; stroke: var(--bad); } .hostbox.warn { fill: #fff4ce; stroke: #b8860b; } .hostlab { font: 700 16px var(--ui); fill: var(--text); } .badge { font: 11px var(--ui); fill: var(--muted); } .pkt-dot { fill: var(--accent-2); stroke: #fff; stroke-width: 2; }
.gsvg { width: 100%; max-width: 440px; height: auto; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.gedge { stroke: #8a8886; stroke-width: 3; stroke-linecap: round; } .gedge.on { stroke: var(--accent-2); stroke-width: 6; } .gedge.down { stroke: var(--bad); stroke-dasharray: 5 6; opacity: 0.6; } .ghit { stroke: transparent; stroke-width: 22; cursor: pointer; } .ghit:hover, .ghit:focus-visible { stroke: rgba(0, 120, 212, 0.18); }
.gcostbox { fill: #fff; stroke: var(--line-2); } .gcost { font: 700 11px var(--mono); fill: var(--text); }
.gnode circle { fill: #fff; stroke: #3b3a39; stroke-width: 2.2; transition: fill 0.3s; } .gnode text { font: 700 14px var(--ui); fill: var(--text); } .gnode.done circle { fill: #dff6dd; stroke: #107c10; } .gnode.cur circle { fill: #ffb900; } .gnode.src circle { fill: #dff6dd; stroke: #107c10; stroke-width: 4; } .gnode.dst circle { fill: #fde7e9; stroke: var(--bad); stroke-width: 4; } .gnode.onp circle { stroke: var(--accent-2); stroke-width: 4; }
.glab { font: 700 12px var(--mono); fill: var(--accent); text-anchor: middle; }
.dvwrap { overflow-x: auto; } .dvt { border-collapse: collapse; font-size: 12.5px; background: #fff; } .dvt th, .dvt td { border: 1px solid var(--line-2); padding: 3px 7px; text-align: center; font-family: var(--mono); } .dvt th { background: var(--bg-2); font-family: var(--ui); } .dvt tr.me td, .dvt tr.me th { background: #f0f7ff; } .dvt td.chg { background: #ffb900; font-weight: 700; animation: rowin 0.5s ease-out; }
.qsvg, .csvg { width: 100%; height: auto; background: #fff; border: 1px solid var(--line); border-radius: 8px; } .capline { stroke: var(--bad); stroke-dasharray: 5 5; } .caplab { font: 11px var(--ui); fill: var(--bad); } .axis, .grid { stroke: var(--line-2); } .grid { stroke: #eee; } .axl { font: 11px var(--ui); fill: var(--muted); }
.qbar { fill: #0078d4; } .qbar.hi { fill: #ca5010; } .qdrop { fill: var(--bad); }
.tankwrap { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; } .tank { display: grid; grid-template-columns: repeat(8, 26px); gap: 4px; padding: 8px; border: 3px solid #3b3a39; border-top-color: transparent; border-radius: 0 0 10px 10px; background: #fff; } .tank i { height: 22px; border-radius: 4px; background: #eee; } .tank i.f { background: #0078d4; } .tank i.f.hi { background: #ca5010; transition: background 0.3s; }
.tpath { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; } .tnode { padding: 8px 14px; border: 2px solid var(--line-2); border-radius: 8px; background: #fff; font-weight: 600; } .tnode.gw { background: #e6f2fc; border-color: #0078d4; } .tnode.cur { box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.35); border-color: var(--accent); } .tarrow { color: var(--muted); font-family: var(--mono); }
.lstack { display: grid; gap: 4px; max-width: 520px; padding: 8px; border: 2px dashed var(--line-2); border-radius: 10px; background: #fff; min-height: 20px; } .layer { padding: 8px 12px; border-radius: 6px; border: 2px solid; font-size: 13px; animation: rowin 0.4s ease-out both; } .layer.outer { background: #fff4ce; border-color: #b8860b; } .layer.tun { background: #fdeee3; border-color: #ca5010; } .layer.inner { background: #e6f2fc; border-color: #0078d4; } .layer.pay { background: #dff6dd; border-color: #107c10; } .layer.hid { background: repeating-linear-gradient(45deg, #ddd, #ddd 6px, #eee 6px, #eee 12px); border-color: #777; color: #444; }
.v6row { display: grid; gap: 4px; margin: 6px 0; } .v6lab { font-size: 12.5px; color: var(--muted); } .v6g { display: flex; flex-wrap: wrap; gap: 4px; } .v6c { min-width: 3.4em; padding: 6px 4px; text-align: center; border: 2px solid var(--line-2); border-radius: 6px; background: #fff; font-family: var(--mono); font-weight: 700; } .v6c.zero { color: #9a9996; background: var(--bg); } .v6c.chg { background: #fff4ce; border-color: #b8860b; } .v6c.dbl { background: #cce4f7; border-color: #0078d4; } .space { display: grid; gap: 6px; margin-top: 8px; }
.uhdr { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; } .ufield { padding: 14px 6px; border: 2px solid #3b3a39; background: #fff; display: grid; gap: 2px; font-weight: 700; margin-right: -2px; } .ufield small { font-weight: 400; color: var(--muted); } .ufield.on, .ufield:hover { background: #cce4f7; }
.lanes { display: grid; gap: 8px; } .lane2 { display: grid; gap: 4px; } .uc { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 4px; } .uc i, .strip i { display: block; height: 26px; border-radius: 5px; background: #ddd; transition: background 0.25s; } .uc i.got, .strip i.got { background: #107c10; } .uc i.lost, .strip i.lost { background: var(--bad); } .uc i.retx, .strip i.retx { background: #ffb900; } .strip { display: grid; grid-template-columns: repeat(16, minmax(0, 1fr)); gap: 3px; max-width: 480px; }
.grid { stroke: #eee; } .chit { fill: transparent; cursor: pointer; } .chit:hover, .chit:focus-visible { fill: rgba(196, 43, 28, 0.1); } .cl { stroke-width: 3; stroke-linecap: round; } .cl.slow { stroke: #0078d4; } .cl.avoid { stroke: #107c10; } .cl.red { stroke: var(--bad); } .cd { fill: #107c10; } .cd.slow { fill: #0078d4; } .cd.red { fill: var(--bad); }
.hist { display: flex; gap: 4px; align-items: stretch; height: 120px; padding: 4px; background: #fff; border: 1px solid var(--line); border-radius: 8px; } .hcol { position: relative; width: 22px; display: flex; align-items: flex-end; } .hcol i { width: 100%; border-radius: 3px 3px 0 0; } .hcol i.ok { background: #0078d4; } .hcol i.lost { background: var(--bad); } .hcol em { position: absolute; left: -2px; right: -2px; height: 2px; background: #3b3a39; } .cb .me { background: var(--ok); }
.rsakeys { display: grid; gap: 4px; } .rstep { display: grid; grid-template-columns: minmax(200px, 340px) 1fr; gap: 10px; padding: 6px 10px; background: #fff; border: 1px solid var(--line); border-radius: 6px; } .rsaenc { display: grid; gap: 8px; overflow-x: auto; }
.cstats .fine { flex-basis: 100%; }
@media (max-width: 47.5rem) { .hubgrid, .rgrid { grid-template-columns: minmax(0, 1fr); } .rstep { grid-template-columns: 1fr; } .tank { grid-template-columns: repeat(8, minmax(0, 1fr)); } .hcol { width: 14px; } .uhdr { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* the terminal window blends into the terminal */
#win-term .wtitle { background: #262626; color: #a8a8a8; }
#win-term.active .wtitle { background: #2d2d2d; color: #ececec; }
#win-term .wc:hover { background: rgba(255, 255, 255, 0.12); }
.term textarea#tin { caret-color: var(--term-fg); }
/* course map */
.mapunit { font-size: 15px; font-weight: 600; margin-top: 10px; }
.topic { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 0.6fr); gap: 10px; align-items: center; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.topic.both { border-color: #8fd18f; background: #f4fbf4; } .tname { display: grid; gap: 1px; } .tmiss { color: var(--muted); font-size: 12.5px; font-style: italic; }
.topic .btn { padding: 4px 10px; font-size: 12.5px; text-align: left; }
@media (max-width: 47.5rem) { .topic { grid-template-columns: minmax(0, 1fr); } }

/* concepts, part 4 */
.bitrow { display: flex; flex-wrap: wrap; gap: 1px; } .bt { display: inline-block; width: 1.1ch; text-align: center; padding: 2px 3px; border-radius: 3px; font-family: var(--mono); } .bt.net { background: #d8e9fb; color: #0b4a8a; } .bt.host { background: #ffe6c7; color: #8a4b00; }
.cmp { border-collapse: collapse; width: 100%; font-size: 13px; } .cmp th, .cmp td { padding: 4px 8px; border-bottom: 1px solid var(--line); text-align: left; } .fwt tr.hit td { background: var(--ok-soft); font-weight: 700; }
.wstrip { display: flex; flex-wrap: wrap; gap: 3px; } .wc { font-style: normal; font-family: var(--mono); width: 22px; height: 22px; display: grid; place-items: center; border-radius: 4px; font-size: 12px; background: var(--bg-2); border: 1px solid var(--line); } .wc.send { background: #d8e9fb; } .wc.ack { background: var(--ok-soft); } .wc.lost { background: var(--bad-soft); } .wc.drop { background: #ffe6c7; }
.slog { max-height: 190px; overflow: auto; margin: 0; padding: 8px; background: var(--bg-2); border-radius: 6px; white-space: pre-wrap; }
.httpbox .two { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.idsrow { display: grid; grid-template-columns: 9em 1fr 9em 12em; gap: 8px; align-items: center; padding: 3px 0; font-size: 13px; } .idsrow.alarm { color: var(--bad); font-weight: 600; } .ibar { display: block; height: 10px; border-radius: 5px; background: #6b8fb8; } .idsrow.alarm .ibar { background: var(--bad); }
.freq { display: flex; gap: 2px; align-items: flex-end; height: 74px; } .fcol { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; font-size: 10px; flex: 1; } .fcol i { display: block; width: 100%; background: #6b8fb8; border-radius: 2px 2px 0 0; } .alpha { font-size: 12px; overflow-x: auto; white-space: pre; }

.ic-pkts { background: linear-gradient(135deg, #36b37e, #12724b); } .ic-exam { background: linear-gradient(135deg, #a069e8, #5b2db3); }
.pklist { max-height: 38vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; font-family: var(--mono); font-size: 12px; } .pkrow { display: grid; grid-template-columns: 3em 4.5em 9em 9em 4.5em 1fr; gap: 6px; width: 100%; padding: 3px 8px; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: inherit; font: inherit; cursor: pointer; } .pkrow span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .pkhead { position: sticky; top: 0; background: var(--bg-2); font-weight: 700; cursor: default; }
.pkrow.p-tcp { background: #eef3ff; } .pkrow.p-udp, .pkrow.p-dns { background: #e8f6ff; } .pkrow.p-icmp { background: #fff1f4; } .pkrow.p-arp { background: #fff8e1; } .pkrow.p-gre { background: #f1ecff; } .pkrow.sel { outline: 2px solid var(--accent); }
.pkdetail { display: grid; gap: 6px; margin-top: 8px; } .pklayer { border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; } .pklayer.app { background: var(--bg-2); } .pklayer summary { font-weight: 600; cursor: pointer; } .pklayer dl { display: grid; grid-template-columns: 11em 1fr; gap: 2px 10px; margin: 6px 0; } .pklayer dt { color: var(--muted, #667); } .pklayer dd { margin: 0; white-space: pre-wrap; word-break: break-word; }
.exam { padding: 6px 4px; display: grid; gap: 10px; } .examcards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
@media (prefers-color-scheme: dark) { .pkrow.p-tcp, .pkrow.p-udp, .pkrow.p-dns, .pkrow.p-icmp, .pkrow.p-arp, .pkrow.p-gre { background: transparent; } .bt.net { background: #1d3a5c; color: #bcd8f5; } .bt.host { background: #5a3a14; color: #ffd9a8; } }
