:root {
  color-scheme: dark;
  --bg: #061411;
  --bg-2: #091b17;
  --panel: rgba(13, 29, 25, .92);
  --panel-2: rgba(15, 40, 34, .84);
  --glass: rgba(19, 52, 45, .72);
  --line: rgba(144, 232, 207, .18);
  --line-strong: rgba(138, 245, 214, .48);
  --text: #f2fff9;
  --muted: #99b7ad;
  --dim: #6f8b82;
  --accent: #28d7bf;
  --accent-2: #66f09e;
  --gold: #f4bf55;
  --warn: #f39c46;
  --danger: #d85f50;
  --blue: #36a5ff;
  --shadow: 0 24px 60px rgba(0, 0, 0, .34);
  --radius: 8px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #eef7f3;
  --bg-2: #f8fbf8;
  --panel: rgba(255, 255, 255, .9);
  --panel-2: rgba(235, 248, 242, .9);
  --glass: rgba(255, 255, 255, .82);
  --line: rgba(11, 78, 62, .14);
  --line-strong: rgba(13, 128, 96, .38);
  --text: #082018;
  --muted: #4e6a60;
  --dim: #6b8179;
  --accent: #0e9f8f;
  --accent-2: #12aa6d;
  --gold: #be7b18;
  --warn: #c66d14;
  --danger: #b63f35;
  --blue: #087ddb;
  --shadow: 0 22px 50px rgba(13, 54, 43, .13);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background:
    radial-gradient(circle at 16% -8%, rgba(40, 215, 191, .22), transparent 30rem),
    radial-gradient(circle at 80% 3%, rgba(54, 165, 255, .12), transparent 34rem),
    linear-gradient(145deg, var(--bg), var(--bg-2));
  color: var(--text);
  letter-spacing: 0;
  overflow-x: hidden;
}

button, input {
  font: inherit;
}

button {
  color: inherit;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  grid-template-rows: auto 1fr;
}

.topbar {
  grid-column: 1 / -1;
  min-height: 112px;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 30% 0%, rgba(45, 224, 179, .16), transparent 28rem),
    rgba(5, 17, 14, .84);
  backdrop-filter: blur(18px) saturate(1.2);
}

[data-theme="light"] .topbar {
  background:
    radial-gradient(circle at 30% 0%, rgba(27, 174, 132, .14), transparent 28rem),
    rgba(255, 255, 255, .84);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.logo-mark {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #edfffa;
  background:
    linear-gradient(135deg, rgba(67, 239, 210, .95), rgba(7, 36, 31, .95)),
    #08201b;
  box-shadow: 0 16px 42px rgba(40, 215, 191, .18);
  font-weight: 900;
}

.brand-lockup h1 {
  margin: 0;
  font-size: clamp(1.15rem, 2vw, 1.55rem);
  line-height: 1.05;
}

.brand-lockup p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: .92rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.summary-strip {
  display: flex;
  align-items: stretch;
  gap: 10px;
}

.summary-strip > div {
  min-width: 108px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(10, 24, 21, .72);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}

[data-theme="light"] .summary-strip > div {
  background: rgba(255,255,255,.7);
}

.summary-strip small,
.chip,
.eyebrow,
.nav-label,
.scene-label,
.mini-label {
  text-transform: uppercase;
  font-size: .7rem;
  line-height: 1.1;
  letter-spacing: 0;
  color: var(--muted);
  font-weight: 800;
}

.summary-strip strong {
  display: block;
  margin-top: 4px;
  font-size: 1.05rem;
}

.summary-strip em {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: .68rem;
  font-style: normal;
  font-weight: 800;
}

.mini-xp {
  display: block;
  width: 78px;
  height: 7px;
  margin-top: 4px;
  border-radius: 99px;
  overflow: hidden;
  background: rgba(154, 215, 200, .14);
}

.mini-xp i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--gold));
}

.app-menu {
  position: relative;
}

.menu-button {
  width: 46px;
  height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: rgba(10, 24, 21, .75);
  display: grid;
  place-items: center;
  gap: 4px;
  padding: 10px;
  cursor: pointer;
}

.menu-button span {
  display: block;
  width: 20px;
  height: 2px;
  background: currentColor;
  border-radius: 99px;
}

.mobile-menu {
  display: none;
}

.app-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 9px);
  min-width: 265px;
  padding: 8px;
  z-index: 100;
  background: rgba(7, 18, 15, .96);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

[data-theme="light"] .app-menu-panel {
  background: rgba(255,255,255,.96);
}

.app-menu-panel button {
  width: 100%;
  min-height: 44px;
  text-align: left;
  border: 0;
  border-radius: 7px;
  background: transparent;
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 850;
}

.app-menu-panel button:hover,
.app-menu-panel button:focus-visible {
  background: rgba(40, 215, 191, .12);
  outline: none;
}

.danger-option {
  color: #fff;
}

.danger-option:hover,
.danger-option:focus-visible {
  background: #fff !important;
  color: var(--danger);
}

.sidebar {
  grid-column: 1;
  grid-row: 2;
  min-width: 0;
  height: calc(100vh - 112px);
  position: sticky;
  top: 112px;
  overflow: auto;
  padding: 20px 18px 28px;
  border-right: 1px solid var(--line);
  background: rgba(4, 16, 13, .54);
}

.nav-tabs,
.nav-group {
  display: grid;
  gap: 8px;
}

.nav-group + .nav-group,
.sidebar-module-panel,
.coach-panel {
  margin-top: 18px;
}

.nav-label {
  padding-left: 2px;
}

.nav-button {
  width: 100%;
  min-height: 56px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .045);
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  text-align: left;
}

.nav-button:hover,
.nav-button.active {
  border-color: rgba(40, 215, 191, .28);
  background: rgba(40, 215, 191, .18);
}

.nav-button.active {
  box-shadow: 0 12px 34px rgba(40, 215, 191, .12);
}

.nav-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: rgba(40, 215, 191, .18);
  color: #6af0dd;
  font-weight: 900;
}

.nav-button strong,
.nav-button small {
  display: block;
}

.nav-button small {
  color: var(--muted);
  margin-top: 2px;
  font-size: .72rem;
}

.nav-button em {
  font-style: normal;
  font-weight: 900;
  padding: 4px 8px;
  border-radius: 99px;
  background: rgba(0,0,0,.35);
  color: var(--accent);
}

.sidebar-module-panel,
.coach-panel,
.quick-card,
.question-panel,
.simulation-panel,
.packet-analyzer-panel,
.reference-card,
.profile-dialog form {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.sidebar-module-panel {
  padding: 12px;
}

.sidebar-module-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.sidebar-module-list {
  max-height: 470px;
  overflow: auto;
  display: grid;
  gap: 8px;
  padding-right: 3px;
}

.module-card {
  width: 100%;
  min-height: 76px;
  padding: 10px;
  border: 1px solid var(--line);
  border-left: 4px solid rgba(144, 232, 207, .26);
  border-radius: 7px;
  background: rgba(255,255,255,.035);
  text-align: left;
  display: grid;
  gap: 5px;
  cursor: pointer;
}

.module-card.active {
  border-left-color: var(--accent);
  background: rgba(40, 215, 191, .1);
}

.module-card.complete {
  border-left-color: var(--accent-2);
}

.module-card.locked {
  opacity: .52;
  cursor: not-allowed;
}

.module-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.module-card h3 {
  font-size: .92rem;
  margin: 0;
  line-height: 1.1;
}

.module-card small {
  color: var(--muted);
}

.status-pill,
.chip,
.focus-pill,
.packet-badge,
.option-letter {
  border-radius: 99px;
  padding: 4px 8px;
  font-size: .68rem;
  font-weight: 900;
  white-space: nowrap;
}

.status-pill {
  background: rgba(144, 232, 207, .12);
  color: var(--muted);
}

.status-pill.complete {
  background: rgba(102, 240, 158, .18);
  color: var(--accent-2);
}

.status-pill.unlocked {
  background: rgba(40, 215, 191, .14);
  color: var(--accent);
}

.status-pill.gold {
  background: rgba(244, 190, 79, .18);
  color: var(--gold);
}

.question-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 6px;
  white-space: nowrap;
}

.difficulty-pill {
  border: 1px solid rgba(144, 232, 207, .18);
  border-radius: 999px;
  color: var(--muted);
  font-size: .62rem;
  font-weight: 900;
  letter-spacing: .04em;
  padding: 3px 7px;
  text-transform: uppercase;
}

.difficulty-pill.tier-4,
.difficulty-pill.tier-5 {
  border-color: rgba(244, 190, 79, .38);
  color: var(--gold);
}

.module-progress,
.track-bar,
.question-progress {
  height: 7px;
  border-radius: 99px;
  overflow: hidden;
  background: rgba(144, 232, 207, .14);
}

.module-progress i,
.track-bar i,
.question-progress i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--gold));
}

.coach-panel {
  padding: 16px;
}

.progress-ring {
  --pct: 0;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  text-align: center;
  background:
    radial-gradient(circle closest-side, var(--bg) 68%, transparent 69%),
    conic-gradient(var(--accent) calc(var(--pct) * 1%), var(--gold) calc(var(--pct) * 1% + 3%), rgba(144, 232, 207, .15) 0);
}

.progress-ring span,
.progress-ring small {
  grid-area: 1 / 1;
}

.progress-ring span {
  transform: translateY(-8px);
  font-size: 1.45rem;
  font-weight: 950;
}

.progress-ring small {
  transform: translateY(18px);
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 900;
  font-size: .68rem;
}

.coach-panel h2 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.coach-panel p {
  color: var(--muted);
  margin: 10px 0 12px;
  line-height: 1.35;
}

.rank-pill,
.track-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.rank-pill {
  border: 1px solid rgba(244, 191, 85, .36);
  background: rgba(244, 191, 85, .12);
  border-radius: 7px;
  padding: 8px 10px;
  color: #ffd77b;
  font-weight: 900;
}

.track-row {
  font-weight: 900;
  margin: 12px 0 7px;
}

.badge-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.badge-tile {
  min-height: 47px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255,255,255,.035);
  display: grid;
  grid-template-columns: 9px 1fr;
  gap: 8px;
  align-items: center;
}

.badge-tile i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(144, 232, 207, .32);
}

.badge-tile.earned {
  border-color: rgba(102, 240, 158, .55);
  background: rgba(102, 240, 158, .12);
}

.badge-tile.earned i {
  background: var(--accent-2);
  box-shadow: 0 0 18px rgba(102,240,158,.6);
}

.badge-tile strong,
.badge-tile small {
  display: block;
  line-height: 1.05;
}

.badge-tile small {
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 900;
  font-size: .62rem;
  margin-top: 2px;
}

main {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
  padding: 24px;
}

.labs-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 370px);
  gap: 18px;
  align-items: start;
}

.workspace {
  display: grid;
  gap: 18px;
}

.simulation-panel,
.packet-analyzer-panel {
  padding: 16px;
  overflow: hidden;
}

.lab-hero {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.chip {
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(144, 232, 207, .08);
}

.chip.gold {
  border-color: rgba(244, 191, 85, .5);
  background: rgba(244, 191, 85, .13);
  color: #ffd77b;
}

.lab-hero h2 {
  margin: 0;
  font-size: clamp(1.3rem, 2.5vw, 1.75rem);
}

.lab-hero p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.network-scene {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  min-height: 282px;
  padding: 14px;
  background:
    radial-gradient(circle at 14% 25%, rgba(86, 235, 180, .24), transparent 18rem),
    radial-gradient(circle at 82% 55%, rgba(54, 165, 255, .16), transparent 23rem),
    linear-gradient(122deg, rgba(16, 74, 58, .88), rgba(5, 29, 25, .85) 56%, rgba(24, 63, 55, .9));
  box-shadow: inset 0 0 80px rgba(102, 240, 158, .08);
}

.network-scene:before {
  content: "";
  position: absolute;
  inset: -40%;
  background:
    linear-gradient(100deg, transparent 20%, rgba(102,240,158,.09), transparent 45%),
    linear-gradient(0deg, rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.02) 1px, transparent 1px);
  background-size: 58% 100%, 32px 32px, 32px 32px;
  animation: sceneDrift 18s linear infinite;
  pointer-events: none;
}

.scene-header {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.scene-header strong {
  padding: 4px 10px;
  border-radius: 99px;
  background: rgba(255,255,255,.9);
  color: #10231d;
  font-size: .78rem;
}

.network-map {
  position: relative;
  z-index: 1;
  overflow-x: auto;
  padding: 8px 0 12px;
}

.network-lane {
  min-width: 980px;
  display: grid;
  grid-template-columns: 122px 160px 122px 170px 122px 170px 122px;
  align-items: center;
  gap: 8px;
}

.network-lane.stagger .network-node:nth-of-type(1),
.network-lane.stagger .network-node:nth-of-type(5) {
  transform: translateY(16px);
}

.network-lane.stagger .network-node:nth-of-type(3),
.network-lane.stagger .network-node:nth-of-type(7) {
  transform: translateY(-10px);
}

.network-node {
  min-height: 72px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(4, 15, 14, .76);
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  box-shadow: 0 12px 30px rgba(0,0,0,.22);
}

.node-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: #b8e5de;
}

.node-title,
.node-meta {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.node-title {
  font-weight: 950;
  line-height: 1.05;
}

.node-meta {
  color: var(--muted);
  font-size: .72rem;
  margin-top: 2px;
}

.network-link {
  height: 5px;
  border-radius: 99px;
  background:
    repeating-linear-gradient(90deg,
      rgba(200,255,224,.9) 0 12px,
      rgba(102,240,158,.95) 12px 17px,
      transparent 17px 27px);
  position: relative;
  transform-origin: center;
  box-shadow: 0 0 18px rgba(102, 240, 158, .25);
  animation: packetRun .95s linear infinite;
}

.network-link:nth-of-type(2n) {
  transform: rotate(5deg);
}

.network-link:nth-of-type(4n) {
  transform: rotate(-5deg);
}

.network-link:after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, rgba(244,191,85,.95), transparent);
  width: 34px;
  animation: packetDot 1.15s linear infinite;
}

.scene-tags {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.focus-pill {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  background: rgba(5, 18, 16, .7);
  border: 1px solid var(--line);
  color: var(--muted);
}

.focus-pill i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent-2);
}

.learning-guide {
  margin-top: 10px;
  padding: 10px 12px;
  min-height: 48px;
  border: 1px solid rgba(102, 240, 158, .22);
  border-radius: var(--radius);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  background: rgba(40, 215, 191, .075);
}

.guide-beacon {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 0 rgba(102,240,158,.42);
  animation: guidePulse 2.8s ease-in-out infinite;
}

.learning-guide strong {
  display: block;
  font-size: .88rem;
}

.learning-guide p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.3;
}

.packet-analyzer-head,
.capture-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.packet-analyzer-head h3,
.capture-head h3 {
  margin: 0;
  font-size: .95rem;
}

.packet-analyzer-head p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: .82rem;
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
}

input[type="text"],
input:not([type]) {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(3, 14, 12, .72);
  color: var(--text);
  padding: 10px 12px;
  outline: none;
}

input:focus {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px rgba(40, 215, 191, .12);
}

.primary,
.secondary,
.ghost,
.answer-button,
.port-option,
.osi-layer,
.command-button {
  min-height: 40px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.04);
  padding: 9px 12px;
  font-weight: 900;
  cursor: pointer;
}

.primary {
  background: linear-gradient(135deg, var(--accent), #20b6aa);
  color: #06201b;
  border-color: transparent;
}

.secondary:hover,
.ghost:hover,
.answer-button:hover,
.port-option:hover,
.osi-layer:hover,
.command-button:hover {
  border-color: var(--line-strong);
}

.filter-chip-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0 6px;
}

.filter-chip {
  min-width: 80px;
  text-align: left;
}

.filter-chip span {
  display: block;
  color: var(--muted);
  font-size: .68rem;
  margin-top: 2px;
}

.filter-help {
  color: var(--muted);
  font-size: .8rem;
  margin: 0 0 12px;
}

.capture-client {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: rgba(8, 22, 19, .62);
}

.capture-focus {
  margin: 0 0 12px;
  padding: 12px;
  border: 1px solid rgba(244, 191, 85, .44);
  border-radius: 7px;
  background: rgba(244, 146, 47, .11);
}

.capture-focus h4 {
  margin: 2px 0 5px;
  color: #ffd77b;
}

.capture-focus p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: .86rem;
}

.capture-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 330px);
  gap: 14px;
}

.packet-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.packet-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: .82rem;
}

.packet-table th,
.packet-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(144, 232, 207, .12);
  text-align: left;
}

.packet-table th {
  color: #c7f2e9;
  background: rgba(40, 215, 191, .08);
  text-transform: uppercase;
  font-size: .7rem;
}

.packet-table tr {
  cursor: pointer;
}

.packet-table tr:hover,
.packet-table tr.active {
  background: rgba(54, 165, 255, .11);
}

.packet-table tr.highlighted {
  background: rgba(102, 240, 158, .13);
  animation: captureGlow 2.6s ease-in-out infinite;
}

.packet-table tr.answer-row {
  background: rgba(244, 191, 85, .16);
}

.packet-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  color: #051612;
  background: #73a7ff;
}

.packet-badge.DHCP { background: #72a9ff; }
.packet-badge.DNS { background: #6fa3ff; }
.packet-badge.ARP { background: #ffc45d; }
.packet-badge.TCP { background: #25d5c4; }
.packet-badge.HTTP { background: #8be68a; }
.packet-badge.TLS { background: #b99cff; }
.packet-badge.ICMP { background: #ffb45f; }
.packet-badge.SMB { background: #f58ad0; }
.packet-badge.NTP { background: #9be7ff; }

.packet-detail {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  min-width: 0;
  background: rgba(7, 19, 17, .76);
}

.packet-detail h3 {
  margin: 0 0 10px;
}

.detail-lines {
  margin: 0;
}

.detail-lines div {
  display: grid;
  grid-template-columns: minmax(120px, .9fr) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 8px 0;
  border-bottom: 1px solid rgba(144, 232, 207, .14);
  min-width: 0;
}

.detail-lines dt,
.detail-lines dd {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.detail-lines dt {
  color: var(--muted);
  font-weight: 950;
}

.detail-lines dd {
  margin: 0;
}

.field-highlight {
  border-radius: 5px;
  padding: 2px 5px;
  background: rgba(244, 191, 85, .13);
  color: #ffd77b;
  animation: captureGlow 2.6s ease-in-out infinite;
}

.timeline {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.timeline-row {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: .75rem;
}

.timeline-row i {
  height: 9px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), rgba(144,232,207,.16));
}

.question-panel {
  position: sticky;
  top: 132px;
  max-height: calc(100vh - 152px);
  overflow: auto;
  padding: 16px;
}

.question-panel-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  margin-bottom: 12px;
}

.question-panel h2 {
  margin: 0;
  font-size: 1.05rem;
}

.percent-chip {
  display: grid;
  place-items: center;
  min-width: 56px;
  padding: 7px 10px;
  border-radius: 8px;
  background: #e7fffb;
  color: #041b16;
  font-weight: 950;
}

.question-progress-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
  grid-column: 1 / -1;
}

.question-progress {
  height: 7px;
}

.question {
  border-top: 1px solid rgba(144,232,207,.12);
  padding: 14px 0;
  opacity: .45;
}

.question.active {
  opacity: 1;
  background: rgba(244, 146, 47, .10);
  margin: 0 -8px;
  padding: 14px 8px;
  border-radius: 7px;
}

.question.complete {
  opacity: .74;
}

.question.locked .question-body {
  display: none;
}

.question:not(.active) .question-body {
  display: none;
}

.question h3 {
  margin: 0 0 10px;
  font-size: .98rem;
  color: #ffd77b;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.question input {
  margin-bottom: 8px;
}

.inline-answer-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.answer-list {
  display: grid;
  gap: 8px;
}

.answer-button {
  width: 100%;
  text-align: left;
  display: flex;
  gap: 9px;
  align-items: center;
}

.answer-button input {
  margin: 0;
}

.hint-box {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(0,0,0,.18);
  color: var(--muted);
}

.hint-box strong {
  color: var(--text);
}

.hint-list {
  display: grid;
  gap: 6px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.hint-list li {
  font-size: .82rem;
}

.result-note {
  margin-top: 8px;
  color: var(--accent-2);
  font-weight: 900;
}

.locked-note {
  color: var(--dim);
  font-size: .82rem;
}

.question-footer {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
}

.quick-grid,
.reference-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.quick-card,
.reference-card {
  padding: 16px;
}

.wide {
  grid-column: 1 / -1;
}

.quick-card h2,
.quick-card h3,
.reference-card h2,
.reference-card h3 {
  margin: 0 0 12px;
}

.prompt-box {
  margin: 0 0 14px;
  padding: 14px;
  border-left: 4px solid var(--accent);
  background: rgba(40,215,191,.06);
  color: var(--muted);
}

.port-page {
  align-items: start;
}

.game-stat-row,
.exam-rules {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0 12px;
}

.game-stat-row span,
.exam-rules span {
  padding: 6px 10px;
  border-radius: 99px;
  background: rgba(40,215,191,.12);
  color: var(--accent);
  font-weight: 900;
  font-size: .78rem;
}

.flashcard {
  min-height: 140px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 20px;
  margin-bottom: 12px;
  background: rgba(54, 165, 255, .06);
}

.flashcard strong {
  display: block;
  font-size: clamp(1.6rem, 3vw, 2.15rem);
}

.flashcard span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.port-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.port-option {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
}

.option-letter {
  background: rgba(40, 215, 191, .13);
  color: var(--accent);
  border: 1px solid var(--line);
  min-width: 28px;
  text-align: center;
}

.question-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.osi-zone {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 52px;
  padding: 8px;
  border: 1px dashed rgba(144,232,207,.24);
  border-radius: var(--radius);
}

.osi-layer {
  cursor: grab;
  touch-action: none;
}

.osi-layer.dragging {
  opacity: .55;
  transform: scale(.98);
}

.table-list {
  width: 100%;
  border-collapse: collapse;
}

.table-list td,
.table-list th {
  padding: 10px;
  border-bottom: 1px solid rgba(144,232,207,.12);
  text-align: left;
  vertical-align: top;
}

.table-list th {
  color: #c7f2e9;
}

.subnet-board {
  display: grid;
  gap: 12px;
}

.subnet-fields {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.subnet-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: rgba(40,215,191,.05);
}

.subnet-card strong {
  display: block;
  color: var(--accent);
}

.reference-grid {
  grid-template-columns: minmax(0, 1fr);
}

.command-trainer {
  order: -1;
}

.command-lab {
  display: grid;
  grid-template-columns: minmax(220px, 410px) minmax(0, 1fr);
  gap: 14px;
}

.command-stack {
  display: grid;
  gap: 8px;
}

.command-button {
  min-height: 58px;
  text-align: left;
  background: rgba(54, 165, 255, .09);
}

.command-button small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}

.cli-client {
  border: 1px solid rgba(106, 196, 255, .28);
  border-radius: var(--radius);
  overflow: hidden;
  background: #061d2c;
  min-height: 260px;
}

.cli-bar {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  border-bottom: 1px solid rgba(106,196,255,.22);
  color: #d8f5ff;
  font-size: .78rem;
  font-weight: 900;
}

.cli-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.cli-dot.red { background: #ff6f6f; }
.cli-dot.yellow { background: #ffc95f; }
.cli-dot.green { background: #66f09e; }

.cli-client pre {
  margin: 0;
  padding: 18px;
  color: #d4f8ff;
  white-space: pre-wrap;
  min-height: 220px;
  font-size: .9rem;
  line-height: 1.45;
}

.exam-card {
  max-width: 980px;
}

.exam-head {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 18px;
}

.exam-pill {
  background: #f2fffb;
  color: #061411;
  border-radius: 7px;
  padding: 8px 10px;
  font-weight: 950;
}

.exam-question {
  border-top: 1px solid var(--line);
  padding: 18px 0;
}

.exam-question input[type="text"] {
  margin-top: 8px;
}

.toast-stack {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 120;
  display: grid;
  gap: 8px;
  max-width: min(360px, calc(100vw - 32px));
}

.toast {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(7, 18, 15, .95);
  padding: 12px;
  box-shadow: var(--shadow);
  animation: slideToast .25s ease-out both;
}

.toast strong {
  display: block;
}

.toast p {
  color: var(--muted);
  margin: 4px 0 0;
}

.profile-dialog {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
}

.profile-dialog::backdrop {
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(5px);
}

.profile-dialog form {
  width: min(520px, calc(100vw - 24px));
  padding: 18px;
  position: relative;
}

.dialog-close {
  position: absolute;
  top: 10px;
  right: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.leaderboard-card {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.leaderboard-row {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(144,232,207,.12);
}

@keyframes packetRun {
  to { background-position: 27px 0; }
}

@keyframes packetDot {
  from { left: 0; opacity: 0; }
  12% { opacity: 1; }
  88% { opacity: 1; }
  to { left: calc(100% - 34px); opacity: 0; }
}

@keyframes sceneDrift {
  to { transform: translate3d(20%, 8%, 0); }
}

@keyframes guidePulse {
  50% { box-shadow: 0 0 0 10px rgba(102,240,158,0); transform: scale(1.05); }
}

@keyframes captureGlow {
  50% { box-shadow: inset 3px 0 0 var(--gold), 0 0 20px rgba(244,191,85,.12); }
}

@keyframes slideToast {
  from { transform: translateY(8px); opacity: 0; }
}

@media (max-width: 1380px) {
  .labs-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .question-panel {
    position: static;
    max-height: none;
  }
}

@media (max-width: 1060px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .topbar {
    min-height: auto;
    align-items: flex-start;
  }

  .sidebar {
    position: fixed;
    top: 86px;
    bottom: 0;
    left: 0;
    width: min(320px, 86vw);
    height: auto;
    z-index: 90;
    transform: translateX(-105%);
    transition: transform .22s ease;
    background: rgba(5, 17, 14, .96);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  main {
    grid-column: 1;
    padding: 16px;
  }

  .mobile-menu {
    display: grid;
  }

  .desktop-menu {
    display: none;
  }

  .app-menu-panel {
    right: 0;
  }
}

@media (max-width: 760px) {
  body {
    background:
      radial-gradient(circle at 40% -10%, rgba(40,215,191,.28), transparent 18rem),
      linear-gradient(160deg, #061411, #071b18);
  }

  .topbar {
    padding: max(12px, env(safe-area-inset-top)) 12px 12px;
    gap: 12px;
  }

  .brand-lockup {
    flex: 1;
    gap: 10px;
  }

  .logo-mark {
    width: 42px;
    height: 42px;
  }

  .brand-lockup p {
    display: none;
  }

  .summary-strip {
    gap: 6px;
  }

  .summary-strip > div {
    min-width: 78px;
    padding: 8px;
  }

  .summary-strip > div:nth-child(1) {
    display: none;
  }

  .summary-strip small {
    font-size: .58rem;
  }

  .summary-strip strong {
    font-size: .82rem;
  }

  .mini-xp {
    width: 58px;
  }

  main {
    padding: 12px;
  }

  .simulation-panel,
  .packet-analyzer-panel,
  .quick-card,
  .reference-card,
  .question-panel {
    padding: 12px;
    border-radius: 10px;
  }

  .network-scene {
    min-height: 238px;
    padding: 12px;
    border-radius: 12px;
  }

  .network-map {
    margin: 0 -12px;
    padding: 8px 12px 16px;
    scroll-snap-type: x mandatory;
  }

  .network-lane {
    min-width: 760px;
    grid-template-columns: 112px 116px 112px 116px 112px 116px 112px;
  }

  .network-node {
    min-height: 64px;
    padding: 10px;
    scroll-snap-align: center;
  }

  .network-link {
    height: 4px;
  }

  .learning-guide {
    grid-template-columns: auto 1fr;
    padding: 9px 10px;
  }

  .learning-guide strong {
    font-size: .78rem;
  }

  .learning-guide p {
    font-size: .7rem;
  }

  .filter-bar,
  .inline-answer-row {
    grid-template-columns: 1fr;
  }

  .filter-bar .primary,
  .filter-bar .secondary {
    width: 100%;
  }

  .capture-grid,
  .quick-grid,
  .command-lab,
  .subnet-fields {
    grid-template-columns: 1fr;
  }

  .packet-table {
    min-width: 690px;
  }

  .detail-lines div {
    grid-template-columns: minmax(96px, .9fr) minmax(0, 1fr);
  }

  .port-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .question-panel {
    max-height: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}

.skip-link {
  position: fixed;
  left: 12px;
  top: 12px;
  z-index: 999;
  transform: translateY(-140%);
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--accent);
  color: #041613;
  font-weight: 900;
  text-decoration: none;
  transition: transform .18s ease;
}

.skip-link:focus {
  transform: translateY(0);
  outline: 3px solid rgba(255,255,255,.75);
}

.noscript-warning {
  padding: 12px 16px;
  color: #041613;
  background: var(--gold);
  font-weight: 850;
}

.main-panel:focus {
  outline: none;
}

.main-panel:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.mobile-quick-nav {
  display: none;
}

.overview-page,
.reference-page {
  display: grid;
  gap: 18px;
  animation: riseIn .22s ease both;
}

.overview-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 18px;
  padding: clamp(18px, 3vw, 30px);
  border: 1px solid var(--line);
  border-radius: 12px;
  background:
    radial-gradient(circle at 80% 15%, rgba(40, 215, 191, .2), transparent 18rem),
    linear-gradient(135deg, rgba(24, 68, 56, .88), rgba(10, 25, 22, .92));
  box-shadow: var(--shadow);
}

.overview-hero-copy h2,
.section-headline h2 {
  margin: 6px 0 10px;
}

.overview-hero-copy p,
.overview-score-card p,
.mode-card p,
.overview-reference-card p,
.quick-ref-card p,
.prompt-card p,
.prompt-box,
.search-label {
  color: var(--muted);
}

.overview-actions,
.mini-action-row,
.reference-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.overview-score-card {
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(4, 18, 15, .58);
}

.overview-score-card strong {
  font-size: clamp(2.2rem, 7vw, 4rem);
  line-height: 1;
  color: var(--accent);
}

.mode-grid,
.quick-ref-grid,
.prompt-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.mode-card,
.overview-reference-card,
.quick-ref-card,
.prompt-card,
.reference-search-panel,
.ticket-note-box {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(8, 25, 21, .74);
}

.mode-number {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 28px;
  border-radius: 8px;
  color: #061411;
  background: var(--accent);
  font-weight: 950;
}

.triage-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.triage-strip div {
  min-width: 0;
  padding: 12px;
  border-radius: 10px;
  background: rgba(40, 215, 191, .08);
  border: 1px solid var(--line);
}

.triage-strip strong,
.triage-strip span {
  display: block;
}

.quick-ref-head,
.section-headline,
.prompt-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.quick-ref-head code,
.ticket-note-box code,
.compact-reference-list code {
  overflow-wrap: anywhere;
}

.result-count {
  flex: 0 0 auto;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--accent);
  background: rgba(40, 215, 191, .11);
  font-weight: 900;
  font-size: .78rem;
}

.reference-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin: 8px 0;
}

.reference-search-row input,
.exam-question input,
.subnet-fields input {
  min-height: 44px;
}

.quick-ref-grid.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.empty-state {
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  color: var(--muted);
}

.copy-prompt {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(40, 215, 191, .1);
  color: var(--text);
  cursor: pointer;
  font-weight: 850;
}

.prompt-card ul {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

.exam-question p {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.difficulty-pill {
  white-space: nowrap;
}

@media (max-width: 1180px) {
  .overview-hero {
    grid-template-columns: 1fr;
  }

  .mode-grid,
  .quick-ref-grid,
  .prompt-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .triage-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  body {
    padding-bottom: calc(76px + env(safe-area-inset-bottom));
  }

  .mobile-quick-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 110;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: rgba(5, 17, 14, .9);
    backdrop-filter: blur(18px) saturate(1.25);
  }

  .mobile-nav-button {
    min-height: 44px;
    justify-content: center;
    text-align: center;
    padding: 8px 6px;
    border-radius: 12px;
    font-size: .76rem;
  }

  .mobile-nav-button.active {
    background: var(--accent);
    color: #041613;
  }

  .section-headline,
  .quick-ref-head,
  .prompt-card-head {
    align-items: stretch;
    flex-direction: column;
  }

  .reference-search-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .mode-grid,
  .quick-ref-grid,
  .quick-ref-grid.compact,
  .prompt-grid,
  .triage-strip {
    grid-template-columns: 1fr;
  }

  .overview-hero,
  .mode-card,
  .reference-search-panel,
  .reference-card,
  .quick-card {
    border-radius: 14px;
  }

  .overview-actions > button,
  .mini-action-row > button,
  .reference-search-row > button,
  .copy-prompt {
    width: 100%;
  }
}
