:root {
  color-scheme: dark;
  --black: #080808;
  --panel: #101010;
  --white: #f2f2f2;
  --ink: #ededed;
  --muted: #858585;
  --line: #2a2a2a;
  --mono: "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-family: var(--mono);
  background: var(--black);
  color: var(--ink);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
html, body { min-width: 320px; min-height: 100%; margin: 0; background: var(--black); }
button, input { font: inherit; }
button { color: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 2px solid #bdbdbd; outline-offset: 3px; }
code, kbd { font-family: var(--mono); }
::selection { background: #555; color: #fff; }

.terminal-page { min-height: 100vh; padding: 54px clamp(16px, 3.1vw, 46px) 24px; }
.terminals-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; gap: 18px; width: 100%; min-height: calc(100vh - 80px); }
.terminal-card { display: grid; min-width: 0; min-height: 560px; grid-template-rows: 48px minmax(0, 1fr) 58px; overflow: hidden; border: 1px solid #363636; border-radius: 7px; background: #050505; box-shadow: 0 14px 44px #0008; }
.terminal-header { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 48px; padding: 0 16px; border-bottom: 1px solid #303030; background: #171717; }
.window-controls { display: flex; align-items: center; gap: 7px; }
.window-controls i { width: 9px; height: 9px; border: 1px solid #777; border-radius: 50%; background: #555; }
.window-controls i:nth-child(2) { background: #777; }
.window-controls i:nth-child(3) { background: #999; }
.terminal-header h1 { margin: 0; color: #d1d1d1; font: 11px var(--mono); }
.terminal-screen,
.capture-terminal-log {
  min-height: 0;
  contain: size;
  overflow: auto;
  overscroll-behavior-y: contain;
  scrollbar-color: #4a4a4a transparent;
  scrollbar-width: thin;
}
.terminal-screen { padding: 19px 20px; color: #dedede; font: 14px/1.7 var(--mono); }
.terminal-line { min-height: 1.7em; white-space: pre-wrap; overflow-wrap: anywhere; }
.terminal-line.muted { color: #898989; }
.terminal-line.success { color: #dedede; font-weight: 600; }
.terminal-line.error { color: #ff7777; }
.terminal-line.warning { color: #f1ce70; }
.terminal-line.command { color: #f0f0f0; }
.prompt-inline { color: #f0f0f0; }
.prompt-inline .prompt-root, .prompt-root { color: #ff7474; font-weight: 700; }
.prompt-inline .prompt-path, .prompt-path { color: #79aaff; }
.prompt-inline .prompt-symbol, .prompt-symbol { color: #eee; }
.command-name { color: #fff; font-weight: 700; }
.command-option { color: #87b9ff; }
.ansi-address { color: #66d9ff; }
.ansi-keyword { color: #a5b4ff; }
.ansi-interface { color: #d5a6ff; }
.ansi-state { color: #83d9ff; font-weight: 600; }
.ansi-warning { color: #f1ce70; }
.ansi-error { color: #ff7777; }
.ansi-dim { color: #898989; }
.terminal-screen:focus-visible { outline-offset: -3px; }
.command-form { display: flex; align-items: center; gap: 10px; margin: 0 14px 13px; padding: 0 11px; border: 1px solid #424242; border-radius: 3px; background: #0c0c0c; transition: border-color .15s ease; }
.command-form:focus-within { border-color: #aaa; }
.prompt-label { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 1px; color: #dedede; font: 13px var(--mono); white-space: nowrap; }
.prompt-bracket, .prompt-symbol { color: #eee; }
.prompt-path { margin-left: 7px; }
.command-form input { width: 100%; min-width: 0; height: 40px; border: 0; outline: 0; background: transparent; color: #f2f2f2; font: 13px var(--mono); caret-color: #ddd; }
.command-form input:focus-visible { outline: 0; }

.scheme-control { position: fixed; z-index: 20; top: 13px; right: clamp(16px, 3.1vw, 46px); }
.scheme-trigger { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border: 1px solid #292929; border-radius: 3px; background: #101010; color: #b8b8b8; font: 10px var(--mono); transition: color .15s ease, border-color .15s ease, background .15s ease; }
.scheme-trigger:hover, .scheme-control[open] .scheme-trigger, .scheme-control:focus-within .scheme-trigger { border-color: #666; background: #171717; color: #fff; }
.scheme-trigger { cursor: pointer; list-style: none; }
.scheme-trigger::-webkit-details-marker { display: none; }
.scheme-trigger-mark { color: #ddd; font-size: 12px; }
.scheme-chevron { color: #858585; transition: transform .18s ease; }
.scheme-control[open] .scheme-chevron { transform: rotate(180deg); }
.scheme-popover { position: absolute; top: calc(100% + 9px); right: 0; width: min(740px, calc(100vw - 24px)); max-height: calc(100svh - 70px); overflow: auto; padding: 10px 11px 9px; border: 1px solid #d4d4d4; background: #fff; color: #171717; box-shadow: 0 18px 50px #000b; opacity: 0; pointer-events: none; transform: translateY(-5px); transform-origin: top right; transition: opacity .16s ease, transform .16s ease, visibility .16s ease; visibility: hidden; }
.scheme-control[open] .scheme-popover { opacity: 1; pointer-events: auto; transform: translateY(0); visibility: visible; }
.scheme-popover-title { padding: 2px 3px 8px; color: #292929; font: 9px var(--mono); }
.scheme-image { display: none; width: 100%; height: auto; background: #fff; }
body[data-practice="1.1"] .scheme-image-1-1,
body[data-practice="1.2"] .scheme-image-1-2,
body[data-practice="1.3"] .scheme-image-1-3 { display: block; }
.scheme-seat { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 3px 0; border-top: 1px solid #e6e6e6; }
.scheme-seat label { color: #555; font: 9px var(--mono); }
.seat-input-row { display: flex; align-items: center; gap: 3px; padding: 2px; border: 1px solid #ccc; background: #fff; }
.seat-input-row input { width: 38px; padding: 3px; border: 0; background: #fff; color: #111; font: 10px var(--mono); text-align: center; }
.seat-input-row button { width: 24px; height: 22px; border: 0; background: #e8e8e8; color: #111; font: 11px var(--mono); }
.seat-input-row button:hover { background: #d8d8d8; }

@media (max-width: 600px) {
  .terminal-page { padding: 58px 18px 18px; }
  .terminals-grid { grid-template-columns: 1fr; min-height: 0; }
  .terminal-card { min-height: 54vh; }
  .scheme-control { right: 18px; }
}
@media (max-width: 520px) {
  .terminal-page { padding: 55px 10px 12px; }
  .terminals-grid { gap: 11px; }
  .terminal-card { min-height: 55vh; grid-template-rows: 42px minmax(0, 1fr) 52px; }
  .terminal-header { min-height: 42px; }
  .terminal-screen { padding: 14px 12px; font-size: 11px; }
  .command-form { gap: 7px; margin: 0 8px 9px; padding-inline: 7px; }
  .prompt-label, .command-form input { font-size: 9px; }
  .command-form input { height: 36px; }
  .scheme-trigger { padding: 6px 7px; font-size: 9px; }
  .scheme-popover { width: min(740px, calc(100vw - 16px)); right: -2px; }
  .diagram-labels { font-size: 31px; }
  .scheme-seat label { font-size: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

#text-editor { width: min(820px, calc(100vw - 32px)); padding: 0; border: 1px solid #505050; border-radius: 12px; color: #eee; background: #202020; box-shadow: 0 24px 80px #0009; }
#text-editor::backdrop { background: #0008; }
.editor-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; background: #303030; }
.editor-header div { min-width: 0; text-align: center; }
.editor-header h2 { margin: 0; font: 600 14px var(--sans); }
.editor-header p { margin: 5px 0 0; font: 11px var(--mono); overflow-wrap: anywhere; color: #bbb; }
.editor-header button { padding: 8px 14px; border: 1px solid #666; border-radius: 6px; background: #414141; color: #fff; cursor: pointer; }
#editor-save { background: #2864b4; border-color: #3676cd; }
#editor-text { display: block; width: 100%; box-sizing: border-box; min-height: 330px; height: min(52vh, 520px); resize: vertical; padding: 20px; border: 0; background: #202020; color: #eee; font: 14px/1.7 var(--mono); tab-size: 4; }
.editor-footer { display: flex; justify-content: space-between; padding: 10px 16px; border-top: 1px solid #444; font: 11px var(--sans); color: #bbb; }

[hidden] { display: none !important; }
.practice-picker { display: grid; place-items: center; min-height: 100svh; padding: 24px; background: #000; }
.practice-options { display: flex; justify-content: center; gap: 24px; }
.practice-option { text-decoration: none; display: grid; place-items: center; width: clamp(125px, 24vw, 230px); aspect-ratio: 1; padding: 16px; border: 1px solid #333; border-radius: 0; background: #000; color: #ddd; font: 16px var(--mono); transition: border-color .15s ease; }
.practice-option:hover { border-color: #aaa; }
.lab-navigation { position: absolute; top: 18px; left: clamp(16px,3.1vw,46px); display: flex; align-items: center; gap: 17px; color: #777; font: 10px var(--mono); }
.lab-navigation button, .lab-navigation a { text-decoration: none; padding: 0; border: 0; background: none; color: #ccc; font: inherit; }
body[data-practice="1.2"] .terminals-grid { grid-template-columns: minmax(0,1fr) minmax(350px,1.15fr) minmax(0,1fr); }
body[data-practice="1.2"] .terminal-screen { font-size: 11px; padding: 17px 14px; }
body[data-practice="1.2"] .command-form { gap: 5px; margin-inline: 8px; padding-inline: 7px; }
body[data-practice="1.2"] .command-form input, body[data-practice="1.2"] .prompt-label { font-size: 10px; }
body[data-practice="1.2"] .prompt-label .prompt-path { max-width: 65px; overflow: hidden; text-overflow: ellipsis; }
.router-card { grid-template-rows: 48px auto minmax(0,1fr) 42px; background: #101010; }
.router-card .terminal-header { padding-inline: 12px; }
#router-reset { justify-self: end; color: #aaa; border: 1px solid #444; border-radius: 3px; padding: 4px 6px; background: transparent; font: 8px var(--mono); }
.router-browser { overflow: auto; min-height: 0; }
#router-address-form { display: flex; gap: 9px; align-items: center; margin: 12px; padding: 5px 9px; border: 1px solid #353535; background: #090909; border-radius: 5px; color: #777; }
#router-address { width: 100%; min-width: 0; height: 25px; border: 0; outline: 0; color: #c8c8c8; background: transparent; font: 10px var(--mono); }
#router-address-form button { border: 0; background: none; color: #bbb; }
.router-footer { display: flex; align-items: center; justify-content: space-between; padding: 9px 12px; border-top: 1px solid #303030; color: #888; font: 8px var(--mono); }
.router-tools { padding: 9px 12px; border-bottom: 1px solid #303030; }
#router-label, #router-label-dialog button {
  padding: 8px 12px;
  border: 1px solid #dedede;
  border-radius: 4px;
  background: #dedede;
  color: #111;
  font: 11px var(--mono);
}
#router-label:hover, #router-label-dialog button:hover { background: #fff; }
#router-label-dialog {
  width: min(420px, calc(100vw - 32px));
  padding: 22px;
  border: 1px solid #505050;
  border-radius: 8px;
  background: #171717;
  color: #eee;
}
#router-label-dialog::backdrop { background: #0009; }
#router-label-dialog h2 { margin: 0 0 18px; font: 600 17px var(--sans); }
#router-label-dialog dl { margin: 0 0 18px; }
#router-label-dialog dt { color: #aaa; font: 12px var(--sans); }
#router-label-dialog dd { margin: 5px 0 14px; }
#router-label-dialog form { text-align: right; }
.router-gate { padding: 40px 25px; text-align: center; }
.router-gate > span { display: block; color: #aaa; font-size: 40px; margin-bottom: 20px; }
.router-gate h2 { margin: 0 0 12px; font: 500 17px var(--sans); }
.router-gate p { color: #929292; font: 12px/1.8 var(--sans); }
.router-gate code { color: #b4b4b4; font-size: 10px; }
.router-gate .router-form { text-align: left; margin-top: 30px; }
.router-dashboard {
  container: router-panel / inline-size;
  min-height: 100%;
  color-scheme: light;
  background: #f3f6fa;
  color: #172a39;
  font: 13px/1.5 var(--sans);
}
.router-brand {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 4px 16px;
  padding: 11px 16px;
  background: #162e40;
  color: #dceaf2;
}
.router-brand strong { font: 600 14px var(--mono); color: #fff; }
.router-brand strong span { color: #9cdddc; }
.router-brand > span { font-size: 11px; }
.router-layout { display: grid; grid-template-columns: minmax(0, 1fr); }
.router-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: start;
  gap: 4px;
  padding: 10px;
  background: #e8eff4;
  border-bottom: 1px solid #cbd9e2;
}
.router-tabs button, .router-tabs summary {
  display: block;
  border: 0;
  border-radius: 6px;
  padding: 7px 8px;
  background: transparent;
  color: #223f53;
  font: 600 12px/1.4 var(--sans);
  text-align: left;
}
.router-tabs summary { cursor: pointer; list-style: none; }
.router-tabs summary::-webkit-details-marker { display: none; }
.router-tabs summary::after { content: ' +'; }
.router-tabs details[open] summary::after { content: ' −'; }
.router-tabs details div { display: grid; gap: 2px; padding: 2px 0 2px 6px; }
.router-tabs button:hover, .router-tabs summary:hover { background: #d9e8ef; }
.router-tabs button[aria-pressed="true"] { background: #cee7e7; color: #134748; }
.router-section { min-width: 0; padding: 16px; }
.router-section-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.router-section-heading h2 { margin: 0; font-size: clamp(20px, 4cqi, 30px); line-height: 1.15; }
.router-section-heading .router-primary { margin: 0; }
.router-path { margin: 0 0 8px; color: #4b6477; font-size: 11px; }
.router-description { margin: 8px 0 18px; color: #425d70; }
.router-section h3 { margin: 8px 0 0; padding-top: 12px; border-top: 1px solid #cbd9e2; color: #244b62; font-size: 14px; }
.router-status { display: flex; gap: 8px; align-items: center; font-weight: 600; }
.router-status::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: #a64b37; }
.router-status[data-online="true"]::before { background: #348458; }
.router-topology { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-block: 14px 20px; }
.router-topology button { position: relative; min-width: 0; border: 1px solid #b6cbd9; border-radius: 8px; padding: 10px 3px; background: #fff; color: #173a53; font-weight: 650; }
.router-topology button:not(:last-child)::after { content: ''; position: absolute; top: 50%; left: 100%; width: 11px; height: 1px; background: #7e9cad; pointer-events: none; }
.router-topology span { display: block; color: #476475; font-size: 10px; overflow-wrap: anywhere; }
.router-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 125px), 1fr)); gap: 8px; margin: 10px 0; }
.router-facts div { padding: 9px; background: #fff; border: 1px solid #d5e0e8; border-radius: 6px; }
.router-facts dt { color: #476475; font-size: 11px; }
.router-facts dd { margin: 3px 0 0; overflow-wrap: anywhere; font-weight: 600; }
@container router-panel (min-width: 540px) {
  .router-layout { grid-template-columns: 152px minmax(0, 1fr); }
  .router-tabs { display: flex; flex-direction: column; align-items: stretch; border-bottom: 0; border-right: 1px solid #cbd9e2; }
  .router-section { padding: 22px; }
}
.router-form { display: grid; gap: 13px; }
.router-form label { display: grid; gap: 7px; color: #aaa; font: 10px var(--sans); }
.router-form input, .router-form select { width: 100%; min-width: 0; padding: 9px 10px; border: 1px solid #404040; border-radius: 4px; color: #e5e5e5; background: #090909; font: 11px var(--mono); }
.router-form .router-check { display: flex; align-items: center; gap: 9px; }
.router-check input { width: 14px; height: 14px; accent-color: #ccc; }
#wan-static:not([hidden]) { display: grid; gap: 13px; }
.router-primary { padding: 10px; margin-top: 3px; border: 1px solid #777; border-radius: 4px; background: #dedede; color: #111; font: 10px var(--mono); }
.router-primary:hover { background: white; }
.router-note, .router-empty { color: #8b8b8b; font: 10px/1.8 var(--sans); overflow-wrap: anywhere; }
.router-note { margin-top: 20px; }
.router-message { padding: 10px; border: 1px solid #555; border-radius: 4px; color: #ddd; font: 10px/1.7 var(--sans); overflow-wrap: anywhere; }
.router-rules { margin-bottom: 18px; }
.router-rules > div { display: flex; gap: 8px; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid #333; font: 9px/1.8 var(--mono); overflow-wrap: anywhere; }
.router-rules button { align-self: start; border: 1px solid #444; border-radius: 3px; color: #bbb; background: #202020; }
.router-log p { padding-bottom: 10px; border-bottom: 1px solid #292929; font: 10px/1.8 var(--mono); overflow-wrap: anywhere; color: #aaa; }
.router-dashboard .router-form { max-width: 520px; }
.router-dashboard .router-form label { color: #314d60; font: 600 12px var(--sans); }
.router-dashboard .router-form input, .router-dashboard .router-form select {
  border-color: #b7cbd9;
  background: #fff;
  color: #142b3b;
  font-size: 12px;
}
.router-dashboard .router-check input { accent-color: #176765; }
.router-dashboard .router-primary, .router-add summary {
  justify-self: start;
  padding: 8px 12px;
  border: 0;
  border-radius: 6px;
  background: #176765;
  color: #fff;
  font: 600 12px var(--sans);
}
.router-dashboard .router-primary:hover, .router-add summary:hover { background: #114f51; }
.router-add summary { display: list-item; width: fit-content; cursor: pointer; }
.router-add .router-form { margin-top: 12px; }
.router-dashboard .router-note, .router-dashboard .router-empty { margin: 0; color: #476475; font-size: 12px; }
.router-dashboard .router-empty { margin-bottom: 12px; }
.router-dashboard .router-message { border-color: #a3c4d6; background: #e2eff7; color: #173a53; font-size: 12px; }
.router-dashboard .router-rules > div, .router-dashboard .router-log p { border-color: #cbd9e2; color: #263d4d; font-size: 12px; }
@media (min-width: 1051px) { body[data-practice="1.2"] .terminals-grid { height: calc(100vh - 80px); } }
@media (max-width: 1050px) { body[data-practice="1.2"] .terminals-grid { grid-template-columns: minmax(0,1fr) minmax(320px,1fr); } body[data-practice="1.2"] #gateway-card { grid-column: 1 / -1; min-height: 380px; max-height: 500px; } }
@media (max-width: 650px) { body[data-practice="1.2"] .terminals-grid { display: flex; flex-direction: column; } body[data-practice="1.2"] #station-card { min-height: 420px; max-height: 550px; } body[data-practice="1.2"] #router-card { min-height: 670px; height: 80vh; } .lab-navigation { gap: 10px; font-size: 9px; } .scheme-trigger { font-size: 8px; } }
@media (min-width: 651px) and (max-width: 1050px) { body[data-practice="1.2"] #station-card, body[data-practice="1.2"] #router-card { height: min(760px, calc(100vh - 80px)); min-height: 600px; } }

#text-editor[data-editor="nano"] { border-radius: 0; background: #090909; }
#text-editor[data-editor="nano"] textarea { background: #090909; }
#text-editor[data-editor="nano"] .editor-header,
#text-editor[data-editor="nano"] .editor-footer { font-family: var(--mono); }
@media (max-width: 470px) {
  .practice-options { gap: 10px; }
  .practice-option { width: min(26vw, 125px); padding: 4px; font-size: 12px; }
}
.terminal-interrupt {
  flex: none;
  border: 1px solid #444;
  border-radius: 3px;
  padding: 4px 6px;
  background: #171717;
  color: #ddd;
  font: 10px var(--mono);
}

/* Packet capture labs */
.practice-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.practice-option { width: clamp(125px, 17vw, 190px); }
.capture-page { min-height: 100vh; background: #080808; color: #dedede; font-family: var(--mono); }
.capture-nav { height: 48px; display: flex; justify-content: space-between; align-items: center; padding: 0 24px; border-bottom: 1px solid #333; color: #999; font-size: 12px; }
.capture-nav a { color: #ccc; text-decoration: none; }
.capture-layout { display: grid; grid-template-columns: minmax(280px, .78fr) minmax(0, 1.7fr); gap: 14px; height: calc(100vh - 86px); min-height: 560px; padding: 14px 16px 0; }
.capture-terminal, .wireshark { min-width: 0; min-height: 0; border: 1px solid #363636; border-radius: 7px; overflow: hidden; background: #0c0c0c; box-shadow: 0 14px 44px #0008; }
.capture-terminal { display: grid; grid-template-rows: 46px minmax(0, 1fr) 54px; }
.capture-panel-head { display: flex; justify-content: space-between; align-items: center; min-height: 46px; padding: 0 15px; border-bottom: 1px solid #343434; background: #171717; font-size: 12px; }
.capture-panel-head strong { font-weight: 500; }
.capture-panel-head > span:last-child { color: #888; font-size: 11px; }
.capture-terminal-log { padding: 17px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; line-height: 1.7; }
.capture-terminal-log .muted { color: #888; }
.capture-terminal-log .entered { color: white; margin-top: 8px; }
.capture-terminal-log .error { color: #ff7777; }
.capture-command-form { display: flex; align-items: center; gap: 8px; padding: 0 10px; border-top: 1px solid #303030; font-size: 11px; }
.capture-command-form label { white-space: nowrap; color: #ddd; }
.capture-command-form input { flex: 1; min-width: 0; border: 0; outline: 0; color: white; background: transparent; font: inherit; }
.capture-command-form button, .capture-toolbar button { padding: 7px 10px; border: 1px solid #555; border-radius: 3px; background: #202020; color: #eee; font: 11px var(--mono); cursor: pointer; }
.capture-command-form button:disabled, .capture-toolbar button:disabled { opacity: .4; cursor: default; }
.wireshark { display: grid; grid-template-rows: 46px auto auto minmax(150px, 1fr) minmax(160px, .9fr) 32px; }
.capture-toolbar, .capture-filter-row { display: flex; align-items: center; gap: 9px; padding: 9px 12px; border-bottom: 1px solid #303030; font-size: 11px; }
.capture-toolbar label, .capture-filter-row label { color: #aaa; white-space: nowrap; }
.capture-toolbar select, .capture-filter-row input { min-width: 0; padding: 7px 9px; border: 1px solid #4b4b4b; border-radius: 3px; background: #111; color: #eee; font: 11px var(--mono); }
.capture-toolbar select { flex: 1; }
.capture-filter-row input { flex: 1; }
.capture-filter-row input.invalid { border-color: #e66; }
#filter-error { color: #e88; font-size: 10px; }
.packet-list { overflow: auto; }
.packet-list table { width: 100%; border-collapse: collapse; white-space: nowrap; font: 11px var(--mono); }
.packet-list th { position: sticky; top: 0; z-index: 1; background: #202020; color: #aaa; font-weight: 500; text-align: left; }
.packet-list td, .packet-list th { padding: 6px 9px; border-bottom: 1px solid #252525; }
.packet-list tbody tr { cursor: pointer; }
.packet-list tbody tr:hover { background: #242424; }
.packet-list tbody tr.selected { background: #3a3a3a; color: white; }
.packet-list tbody tr.arp { color: #e0c7db; }
.packet-list tbody tr.icmp { color: #b8d5ec; }
.packet-list tbody tr.udp { color: #d9d5b4; }
#packet-empty { margin: 22px; color: #777; font-size: 12px; }
.packet-inspection { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 0; border-top: 1px solid #333; }
.packet-details, .packet-bytes { overflow: auto; padding: 10px 13px; }
.packet-details { border-right: 1px solid #333; }
.packet-inspection h2 { margin: 0 0 9px; color: #aaa; font: 500 11px var(--mono); }
.packet-details details { margin: 0 0 6px; font: 11px/1.5 var(--mono); }
.packet-details summary { cursor: pointer; color: #e8e8e8; }
.packet-details details div { padding-left: 16px; color: #bbb; overflow-wrap: anywhere; }
.packet-bytes pre { margin: 0; font: 10px/1.55 var(--mono); color: #d0d0d0; }
.capture-status { display: flex; justify-content: space-between; align-items: center; padding: 0 12px; border-top: 1px solid #333; color: #888; font-size: 10px; }
.capture-scheme { margin: 0 16px 16px; border: 1px solid #333; border-radius: 4px; font: 11px var(--mono); }
.capture-scheme summary { padding: 9px 13px; cursor: pointer; }
.capture-scheme-content { display: flex; align-items: center; padding: 12px; overflow: auto; }
.capture-node { flex: 0 0 auto; padding: 10px 15px; border: 1px solid #777; text-align: center; line-height: 1.6; }
.capture-node small { color: #999; font-size: 10px; }
.capture-wire { flex: 1; min-width: 20px; border-top: 1px solid #777; }
@media (max-width: 1000px) { .capture-layout { grid-template-columns: 1fr; height: auto; } .capture-terminal { min-height: 310px; height: 38vh; } .wireshark { height: 70vh; min-height: 520px; } }
@media (max-width: 650px) { .practice-option { width: min(28vw, 125px); font-size: 11px; } .capture-nav { padding: 0 12px; } .capture-layout { padding: 10px; gap: 10px; } .capture-toolbar { flex-wrap: wrap; } .capture-toolbar select { min-width: 55%; } .capture-filter-row { flex-wrap: wrap; } .capture-filter-row label { width: 100%; } .packet-inspection { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; } .packet-details { border-right: 0; border-bottom: 1px solid #333; } }
.example-browser { display: flex; align-items: center; gap: 9px; margin: 10px 16px; padding: 10px 13px; border: 1px solid #333; border-radius: 4px; font: 11px var(--mono); }
.example-browser[hidden] { display: none; }
.example-browser label { color: #aaa; white-space: nowrap; }
.example-browser input { flex: 1; min-width: 0; padding: 7px; border: 1px solid #444; border-radius: 3px; color: #eee; background: #111; font: inherit; }
.example-browser button { padding: 7px 12px; border: 1px solid #777; border-radius: 3px; color: #111; background: #ddd; font: inherit; cursor: pointer; }
.example-browser span { color: #777; white-space: nowrap; }
@media (max-width: 650px) { .example-browser { flex-wrap: wrap; } .example-browser span { width: 100%; } }

/* Wireshark window follows the light Fedora desktop capture in the lab photos. */
.capture-layout { grid-template-columns: minmax(260px, .62fr) minmax(0, 2fr); }
.wireshark {
  grid-template-rows: 36px 29px 42px 36px minmax(180px, 1fr) minmax(190px, .78fr) 27px;
  background: #f7f7f7;
  color: #222;
  border-color: #777;
  border-radius: 4px;
}
.wireshark > .capture-panel-head { min-height: 36px; background: #252525; color: #eee; border-bottom: 0; }
.wireshark > .capture-panel-head > span:last-child { color: #bbb; }
.wireshark-menu { display: flex; align-items: stretch; gap: 1px; padding: 0 7px; border-bottom: 1px solid #bfc1c3; background: #e5e5e5; color: #252525; font: 11px var(--sans); }
.wireshark-menu details { position: relative; }
.wireshark-menu summary { display: grid; place-items: center; height: 100%; padding: 0 8px; list-style: none; cursor: pointer; }
.wireshark-menu summary::-webkit-details-marker { display: none; }
.wireshark-menu summary:hover, .wireshark-menu details[open] summary { background: #cfd5db; }
.wireshark-menu details button { display: block; position: relative; z-index: 5; width: 190px; padding: 9px 12px; border: 1px solid #aeb5bc; border-bottom: 0; background: #f7f7f7; color: #222; font: 11px var(--sans); text-align: left; cursor: pointer; }
.wireshark-menu details button:first-of-type { position: absolute; top: 29px; left: 0; }
.wireshark-menu details button:nth-of-type(2) { position: absolute; top: 59px; left: 0; }
.wireshark-menu details button:hover { background: #dbe9f7; }
.wireshark .capture-toolbar { gap: 5px; padding: 5px 8px; background: #dedede; border-bottom: 1px solid #bcbcbc; }
.wireshark .capture-toolbar button { width: 30px; height: 28px; padding: 0; border: 1px solid #b4b4b4; border-radius: 2px; background: #efefef; color: #303030; font: 15px var(--sans); }
.wireshark #capture-start { color: #228945; }
.wireshark #capture-stop { color: #b43939; }
.wireshark .capture-toolbar button:disabled { color: #999; opacity: .55; }
.toolbar-divider { height: 25px; margin: 0 5px; border-left: 1px solid #aaa; }
.wireshark .capture-toolbar label { color: #333; }
.wireshark .capture-toolbar select { max-width: 250px; background: #f9f9f9; color: #222; border: 1px solid #b0b0b0; }
.wireshark .capture-filter-row { gap: 7px; padding: 4px 8px; background: #e5e5e5; border-bottom: 1px solid #aeb1ae; }
.wireshark .capture-filter-row label { color: #444; }
.wireshark .capture-filter-row input { height: 26px; padding: 3px 7px; border: 1px solid #689f6b; border-radius: 2px; background: #a8e0a9; color: #162b16; }
.wireshark .capture-filter-row input.invalid { background: #e6a4a4; border-color: #a65a5a; }
.wireshark #filter-error { max-width: 35%; color: #8f2222; }
.wireshark .packet-list { background: #fff; }
.wireshark .packet-list table { font: 11px/1.25 var(--mono); }
.wireshark .packet-list th { background: #e6e8ea; color: #242424; font-weight: 600; border-right: 1px solid #c3c5c7; border-bottom: 1px solid #a8aaac; }
.wireshark .packet-list td, .wireshark .packet-list th { padding: 3px 7px; }
.wireshark .packet-list td { border-bottom: 0; color: #222; }
.wireshark .packet-list tr.arp { background: #f5e5da; }
.wireshark .packet-list tr.icmp { background: #e8e4f5; }
.wireshark .packet-list tr.udp, .wireshark .packet-list tr.dns { background: #e8edf5; }
.wireshark .packet-list tr.tcp, .wireshark .packet-list tr.http { background: #e5f0e6; }
.wireshark .packet-list tbody tr:hover { filter: brightness(.95); }
.wireshark .packet-list tbody tr.selected { background: #5a9bce; color: #111; }
.wireshark .packet-list tbody tr.selected td { color: #111; }
.wireshark #packet-empty { color: #555; }
.wireshark .packet-inspection { background: #fff; border-top: 2px solid #b7b7b7; }
.wireshark .packet-details { border-right: 1px solid #b9b9b9; }
.wireshark .packet-details, .wireshark .packet-bytes { padding: 7px 9px; }
.wireshark .packet-inspection h2 { margin-bottom: 7px; color: #666; font-size: 10px; }
.wireshark .packet-details details { color: #222; }
.wireshark .packet-details summary { color: #222; }
.wireshark .packet-details details div { color: #333; }
.wireshark .packet-bytes pre { color: #222; font-size: 10px; }
.wireshark .capture-status { background: #e9e9e9; color: #444; border-top: 1px solid #b6b6b6; }
@media (max-width: 1000px) { .capture-layout { grid-template-columns: 1fr; } .wireshark { height: 70vh; min-height: 560px; } }

/* Study modes */
.home-page { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; min-height: 100svh; padding: 24px; background: #000; }
.home-page .practice-picker { min-height: 0; padding: 0; }
.mode-bar { display: flex; align-items: center; justify-content: center; gap: 16px; width: max-content; max-width: calc(100vw - 32px); font: 12px var(--mono); }
.mode-switch { display: flex; padding: 4px; border: 1px solid #323232; background: #090909; }
.mode-button, .exam-launch { min-height: 38px; padding: 10px 14px; border: 0; background: transparent; color: #a9a9a9; white-space: nowrap; text-decoration: none; font: inherit; }
.mode-button[aria-pressed="true"] { background: #e7e7e7; color: #080808; }
.mode-button:hover:not([aria-pressed="true"]), .exam-launch:hover { color: #fff; }
.exam-launch { display: grid; place-items: center; border: 1px solid #666; color: #e5e5e5; }
.exam-launch:hover { border-color: #fff; }

.guided-overview[hidden] { display: none; }
body.guided-mode .terminal-page { display: flex; flex-direction: column; min-height: 100svh; }
body.guided-mode .lab-navigation { position: fixed; z-index: 60; }
.guided-overview { position: sticky; z-index: 50; top: 46px; display: grid; grid-template-columns: minmax(0, 365px) minmax(0, 1fr); gap: 14px; flex: none; width: 100%; max-width: 1360px; height: clamp(230px, 25svh, 250px); margin: 0 auto 14px; background: var(--black); }
@media (min-width: 701px) { body[data-practice="1.2"] .guided-overview { grid-template-columns: minmax(0, 310px) minmax(0, 1fr); } }
.guided-map, .guided-tutor-slot { min-width: 0; min-height: 0; overflow: hidden; border: 1px solid #444; background: #101010; }
.guided-map { position: relative; display: flex; flex-direction: column; margin: 0; padding: 8px 10px; }
.guided-map-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex: none; width: 100%; color: #d8d8d8; font-size: 11px; }
.guided-map-head button { padding: 3px 5px; border: 0; background: transparent; color: #969696; font: 9px var(--mono); white-space: nowrap; }
.guided-map-head button:hover { color: #fff; }
.guided-map .scheme-image { flex: 0 1 auto; align-self: center; min-height: 0; width: auto; max-width: 100%; height: calc(100% - 25px); margin-top: 6px; object-fit: contain; background: transparent; }
.guided-seat { position: absolute; top: 11px; right: 89px; color: #888; font-size: 9px; white-space: nowrap; }
.guided-seat strong { color: #ddd; font-weight: 500; }
body.guided-mode .terminals-grid { flex: 1; min-height: 560px; height: auto; }
body.guided-mode .scheme-control { z-index: 90; }
body.guided-mode .guide-panel { position: static; width: 100%; height: 100%; max-height: none; overflow: auto; border: 0; box-shadow: none; }
body.guided-mode .guide-body { padding: 8px 14px; }
body.guided-mode .guide-phase { margin-bottom: 6px; padding: 5px 7px; }
body.guided-mode .guide-body h2 { margin: 4px 0; font-size: 15px; }
body.guided-mode .guide-body p { margin: 5px 0; }
body.guided-mode .guide-actions { margin-top: 6px; }
@media (max-width: 700px) {
  .guided-overview { grid-template-columns: minmax(0, 1fr); grid-template-rows: 155px minmax(0, 1fr); gap: 8px; height: min(365px, 51svh); margin-bottom: 10px; }
  .guided-map { padding: 7px 10px 5px; }
  .guided-map-head { font-size: 10px; }
  .guided-seat { top: 10px; right: 76px; font-size: 8px; }
}

.guide-panel { position: fixed; z-index: 80; right: 18px; bottom: 18px; width: min(390px, calc(100vw - 36px)); max-height: min(470px, 63vh); overflow: auto; border: 1px solid #666; background: #121212; color: #e7e7e7; box-shadow: 0 20px 70px #000d; font: 12px/1.55 var(--mono); }
.guide-panel.guide-advanced { animation: guide-advance 1.25s ease-out; }
.guide-success { padding: 9px 15px; border-bottom: 1px solid #4f8a61; background: #17301e; color: #c7f4d2; font-size: 11px; font-weight: 600; animation: guide-success 1.9s ease-out; }
@keyframes guide-advance { 0%, 38% { border-color: #b8f3c5; box-shadow: 0 0 0 5px #8bd99d40, 0 20px 70px #000d; transform: translateY(-4px); } 70% { border-color: #b8f3c5; box-shadow: 0 0 0 2px #8bd99d20, 0 20px 70px #000d; } 100% { border-color: #666; box-shadow: 0 20px 70px #000d; transform: translateY(0); } }
@keyframes guide-success { 0% { background: #2d673a; } 100% { background: #17301e; } }
.guide-top { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 15px; border-bottom: 1px solid #393939; background: #1b1b1b; }
.guide-top strong { font-size: 12px; }
.guide-top a { color: #aaa; text-decoration: none; font-size: 10px; }
.guide-body { padding: 16px; }
.guide-phase { margin-bottom: 11px; padding: 7px 9px; border: 1px solid #53655a; background: #19231c; color: #c0e1c8; font-size: 10px; letter-spacing: .03em; }
.guide-recovery, .guide-warning { padding: 9px 11px; border-left: 2px solid #d9ad64; background: #30271b; color: #f5ddb5; }
.guide-count { color: #8c8c8c; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }
.guide-body h2 { margin: 8px 0; color: #fff; font-size: 16px; }
.guide-body p { margin: 9px 0; }
.guide-hint, .guide-answer { padding: 10px 12px; border-left: 2px solid #d9d9d9; background: #222; }
.guide-answer { border-color: #93b8ff; color: #dce8ff; white-space: pre-wrap; }
.guide-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; color: #818181; font-size: 10px; }
.guide-actions button { flex: none; border: 1px solid #777; background: #202020; padding: 7px 10px; color: #eee; font-size: 10px; }

body[data-practice="1.2"][data-exam-view="terminal"] .terminals-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
body[data-practice="1.2"][data-exam-view="router"] .terminals-grid { display: flex; justify-content: center; min-height: calc(100vh - 80px); }
body[data-exam-view="router"] #station-card, body[data-exam-view="router"] #gateway-card { display: none !important; }
body[data-exam-view="router"] #router-card { display: grid !important; width: min(100%, 900px); height: calc(100vh - 85px); min-height: 570px; }

.exam-page { min-height: 100vh; background: #080808; color: #e7e7e7; font-family: var(--mono); }
.exam-header { height: 54px; display: flex; align-items: center; justify-content: space-between; padding: 0 22px; border-bottom: 1px solid #333; font-size: 12px; }
.exam-header a { color: #bbb; text-decoration: none; }
.exam-header strong { font-size: 14px; font-weight: 600; }
.exam-header #exam-score { color: #a6d5a6; }
.exam-layout { display: grid; grid-template-columns: minmax(300px, 370px) minmax(0, 1fr); height: calc(100vh - 54px); min-height: 620px; }
.exam-board { display: flex; flex-direction: column; min-height: 0; overflow: auto; padding: 24px 18px; border-right: 1px solid #333; }
.exam-board-head { display: flex; align-items: start; justify-content: space-between; gap: 10px; }
.exam-eyebrow { color: #828282; font-size: 10px; letter-spacing: .12em; }
.exam-board h1 { margin: 6px 0 0; font-size: 20px; }
.exam-board-head button, .exam-tools button, .exam-task-footer button { border: 1px solid #555; background: #1b1b1b; color: #eee; padding: 7px 9px; font: 10px var(--mono); }
.exam-board-head button:hover, .exam-tools button:hover, .exam-task-footer button:hover { border-color: #aaa; }
.exam-intro { color: #aaa; font-size: 11px; line-height: 1.55; }
.exam-tasks { display: grid; gap: 10px; margin: 10px 0 18px; padding: 0; list-style: none; }
.exam-task { padding: 13px; border: 1px solid #383838; background: #111; }
.exam-task.done { border-color: #638a63; }
.exam-task-label { color: #8a8a8a; font-size: 9px; letter-spacing: .08em; }
.exam-task h2 { margin: 7px 0; font-size: 13px; }
.exam-task p { margin: 0 0 14px; color: #b5b5b5; font-size: 10px; line-height: 1.5; }
.exam-task-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #8f8f8f; font-size: 10px; }
.exam-task.done .exam-task-footer span { color: #a6d5a6; }
.exam-tools { display: flex; gap: 8px; margin-top: auto; }
.exam-tools button { flex: 1; min-height: 34px; }
.exam-workspace { display: grid; grid-template-rows: 40px minmax(0, 1fr); min-height: 0; }
.exam-workspace-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 15px; border-bottom: 1px solid #333; color: #aaa; font-size: 10px; }
.exam-workspace iframe { display: block; width: 100%; height: 100%; border: 0; background: #080808; }
@media (max-width: 850px) { .exam-layout { grid-template-columns: 1fr; height: auto; } .exam-board { overflow: visible; border-right: 0; border-bottom: 1px solid #333; } .exam-workspace { height: 75vh; min-height: 600px; } }
@media (max-width: 600px) { .home-page { padding: 12px; } .mode-bar { flex-wrap: wrap; gap: 8px; width: calc(100vw - 24px); } .mode-switch { width: 100%; } .mode-switch .mode-button { flex: 1; } .exam-launch { width: 100%; } .guide-panel { right: 10px; bottom: 10px; width: calc(100vw - 20px); max-height: 38vh; } .exam-workspace-head span:last-child { display: none; } }
@media (max-width: 650px) { .wireshark { grid-template-rows: 36px 29px auto auto minmax(150px, 1fr) minmax(190px, .9fr) 27px; } .wireshark .capture-toolbar { flex-wrap: nowrap; } .wireshark .capture-toolbar select { min-width: 0; } .wireshark .packet-details { border-right: 0; border-bottom: 1px solid #b9b9b9; } }

.router-table-scroll { overflow: auto; margin: 12px 0; border: 1px solid #cbd9e2; border-radius: 6px; background: #fff; }
.router-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.router-table th, .router-table td { padding: 8px; text-align: left; }
.router-table th { background: #dcebec; color: #174e50; }
.router-table td { border-top: 1px solid #e1eaef; overflow-wrap: anywhere; }
.router-table button { padding: 2px 6px; border: 1px solid #cbd9e2; border-radius: 4px; background: #fff; color: #6b2d26; }
