:root {
  color-scheme: light;
  --bg: #f4f6f0;
  --panel: #ffffff;
  --panel-strong: #eef5f3;
  --ink: #16201d;
  --muted: #5e6b66;
  --line: #cfd9d4;
  --teal: #08766f;
  --teal-dark: #045a55;
  --amber: #b46b09;
  --amber-soft: #fff2d3;
  --rose: #b43d4b;
  --blue: #315e9d;
  --green: #247047;
  --violet: #6b4db3;
  --black: #101412;
  --shadow: 0 16px 42px rgba(20, 31, 29, 0.11);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1211;
  --panel: #141b1a;
  --panel-strong: #172523;
  --ink: #edf7f4;
  --muted: #9fb0aa;
  --line: #2d3b37;
  --teal: #26b8aa;
  --teal-dark: #159488;
  --amber: #f0b44c;
  --amber-soft: #332613;
  --rose: #ff6f83;
  --blue: #72a7ff;
  --green: #54d083;
  --violet: #ad91ff;
  --black: #f0f7f4;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.42);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(74px + env(safe-area-inset-top, 0px));
}

body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 12% 18%, rgba(8, 118, 111, 0.08), transparent 32%),
    radial-gradient(circle at 86% 8%, rgba(180, 107, 9, 0.08), transparent 28%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(237, 245, 241, 0.86)),
    var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

:root[data-theme="dark"] body {
  background:
    radial-gradient(circle at 12% 18%, rgba(38, 184, 170, 0.09), transparent 34%),
    radial-gradient(circle at 86% 8%, rgba(84, 208, 131, 0.08), transparent 30%),
    linear-gradient(145deg, rgba(9, 18, 16, 0.9), rgba(13, 28, 25, 0.96)),
    var(--bg);
}

button,
input,
select {
  font: inherit;
  max-width: 100%;
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

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

@supports (min-height: 100dvh) {
  .app-shell {
    min-height: 100dvh;
  }
}

.topbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding:
    calc(16px + env(safe-area-inset-top, 0px))
    max(24px, env(safe-area-inset-right, 0px))
    16px
    max(24px, env(safe-area-inset-left, 0px));
  background:
    radial-gradient(circle at 7% 0%, rgba(38, 184, 170, 0.15), transparent 28%),
    linear-gradient(135deg, rgba(252, 255, 250, 0.98), rgba(237, 248, 244, 0.95) 54%, rgba(247, 251, 255, 0.94));
  border-bottom: 1px solid var(--line);
  box-shadow: 0 12px 34px rgba(20, 31, 29, 0.08);
  z-index: 4000;
  backdrop-filter: blur(10px);
}

:root[data-theme="dark"] .topbar {
  background:
    radial-gradient(circle at 7% 0%, rgba(38, 184, 170, 0.17), transparent 28%),
    linear-gradient(135deg, rgba(13, 18, 17, 0.96), rgba(13, 31, 27, 0.94) 56%, rgba(15, 29, 39, 0.92));
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 8px;
  border: 1px solid rgba(38, 184, 170, 0.28);
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.28), transparent 34%),
    linear-gradient(135deg, var(--teal), #14211e 72%);
  color: #f5fffb;
  font-weight: 800;
  letter-spacing: 0;
  box-shadow: 0 14px 30px rgba(8, 118, 111, 0.22);
}

.brand h1,
.brand p,
.coach-panel h2,
.lab-hero h2,
.section-title,
.packet-title,
.question-panel h2,
.quick-card h2 {
  margin: 0;
}

.brand h1 {
  font-size: 1.34rem;
  line-height: 1.1;
}

.brand p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.93rem;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(92px, auto));
  gap: 10px;
}

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

.app-menu {
  position: relative;
  z-index: 5000;
}

.menu-button {
  display: inline-grid;
  place-items: center;
  gap: 4px;
  width: 42px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 10px 22px rgba(20, 31, 29, 0.07);
}

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

.menu-button:hover,
.menu-button:focus-visible,
.menu-button[aria-expanded="true"] {
  border-color: var(--teal);
  outline: none;
}

.menu-panel {
  position: absolute;
  z-index: 6000;
  top: calc(100% + 10px);
  right: max(0px, env(safe-area-inset-right, 0px));
  display: grid;
  gap: 8px;
  width: min(260px, calc(100vw - 28px));
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 22px 48px rgba(20, 31, 29, 0.18);
}

.menu-panel[hidden] {
  display: none;
}

.menu-action {
  justify-content: flex-start;
  width: 100%;
  min-height: 42px;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font-weight: 900;
  box-shadow: 0 10px 22px rgba(20, 31, 29, 0.07);
}

.reset-action {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: #7b2d12;
  font-weight: 900;
}

.reset-action:hover,
.reset-action:focus-visible,
.reset-action:active {
  border-color: var(--rose);
  background: var(--rose);
  color: #ffffff;
  outline: none;
}

.loop-icon {
  position: relative;
  width: 20px;
  height: 20px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
}

.loop-icon::after {
  position: absolute;
  right: -2px;
  top: 1px;
  width: 7px;
  height: 7px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  content: "";
  transform: rotate(36deg);
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  border-color: var(--teal);
  outline: none;
}

.theme-toggle-track {
  position: relative;
  width: 42px;
  height: 22px;
  border-radius: 999px;
  background: #d8e2dd;
  box-shadow: inset 0 0 0 1px rgba(16, 20, 18, 0.1);
}

.theme-toggle-thumb {
  position: absolute;
  left: 3px;
  top: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--teal);
  transition:
    transform 160ms ease,
    background 160ms ease;
}

.theme-toggle[aria-pressed="true"] .theme-toggle-track {
  background: #243632;
}

.theme-toggle[aria-pressed="true"] .theme-toggle-thumb {
  background: var(--amber);
  transform: translateX(20px);
}

.summary-strip > div {
  min-width: 92px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(246, 251, 248, 0.9)),
    #fff;
  box-shadow: 0 10px 22px rgba(20, 31, 29, 0.07);
}

:root[data-theme="dark"] .summary-strip > div,
:root[data-theme="dark"] .theme-toggle,
:root[data-theme="dark"] .menu-button,
:root[data-theme="dark"] .menu-panel {
  background: #121a18;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.28);
}

:root[data-theme="dark"] .reset-action {
  border-color: #f4efe7;
  background: #ffffff;
  color: #7b2d12;
}

:root[data-theme="dark"] .reset-action:hover,
:root[data-theme="dark"] .reset-action:focus-visible,
:root[data-theme="dark"] .reset-action:active {
  border-color: var(--rose);
  background: var(--rose);
  color: #ffffff;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(5, 10, 9, 0.52);
  backdrop-filter: blur(6px);
}

.modal-backdrop[hidden] {
  display: none;
}

.confirm-modal {
  width: min(420px, 100%);
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.28);
}

.confirm-modal h2 {
  margin: 0;
  font-size: 1.2rem;
}

.confirm-modal p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.primary-button.danger-button {
  border-color: var(--rose);
  background: var(--rose);
}

.primary-button.danger-button:hover,
.primary-button.danger-button:focus-visible {
  border-color: #b42b2b;
  background: #b42b2b;
}

.metric-label {
  display: block;
  color: var(--muted);
  font-size: 0.73rem;
  text-transform: uppercase;
}

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

.metric-sub {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  white-space: nowrap;
}

.metric-bar {
  display: block;
  height: 5px;
  margin-top: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #d9e5df;
}

.metric-bar span {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--amber));
  transition: width 180ms ease;
}

.sidebar {
  padding: 18px;
  background: rgba(231, 238, 233, 0.92);
  border-right: 1px solid var(--line);
}

:root[data-theme="dark"] .sidebar {
  background: rgba(12, 20, 18, 0.94);
}

.nav-tabs {
  display: grid;
  gap: 14px;
}

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

.nav-heading {
  color: #52645e;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

:root[data-theme="dark"] .nav-heading {
  color: #8ea19a;
}

.nav-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  font-weight: 700;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.nav-label {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.nav-label > span:last-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.nav-label small {
  display: block;
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 700;
  line-height: 1.15;
}

.nav-icon {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: rgba(8, 118, 111, 0.1);
  color: var(--teal);
  font-size: 0.72rem;
  font-weight: 900;
}

.nav-button:hover,
.nav-button:focus-visible {
  border-color: #9db6ae;
  background: rgba(255, 255, 255, 0.56);
  outline: none;
  transform: translateX(3px);
}

:root[data-theme="dark"] .nav-button:hover,
:root[data-theme="dark"] .nav-button:focus-visible {
  background: rgba(255, 255, 255, 0.08);
}

:root[data-theme="dark"] .nav-sub {
  background: rgba(255, 255, 255, 0.04);
}

:root[data-theme="dark"] .nav-icon {
  background: rgba(38, 184, 170, 0.12);
}

.nav-button.active {
  background: var(--teal);
  color: #fff;
  box-shadow: 0 12px 22px rgba(8, 118, 111, 0.22);
}

.nav-button.active .nav-icon {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.nav-button.active .nav-label small {
  color: rgba(255, 255, 255, 0.78);
}

.nav-main {
  min-height: 46px;
}

.nav-sub {
  min-height: 38px;
  padding: 9px 10px;
  background: rgba(255, 255, 255, 0.28);
}

.nav-pill {
  min-width: 42px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--teal-dark);
  font-size: 0.76rem;
  text-align: center;
}

:root[data-theme="dark"] .nav-pill {
  background: rgba(10, 15, 14, 0.92);
  color: var(--teal);
}

.coach-panel {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid #bed0ca;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 242, 211, 0.72), rgba(255, 255, 255, 0.92) 42%, rgba(232, 245, 242, 0.9)),
    #f9fbf5;
  box-shadow: 0 14px 28px rgba(24, 36, 32, 0.08);
}

:root[data-theme="dark"] .coach-panel {
  background:
    linear-gradient(135deg, rgba(51, 38, 19, 0.8), rgba(20, 27, 26, 0.94) 42%, rgba(18, 37, 35, 0.9)),
    var(--panel);
  box-shadow: var(--shadow);
}

.coach-panel h2 {
  font-size: 0.95rem;
}

.coach-panel p {
  margin: 8px 0 14px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.level-ring {
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  margin: 0 auto 12px;
  border: 8px solid #d6e2de;
  border-top-color: var(--teal);
  border-right-color: var(--amber);
  border-radius: 50%;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(8, 118, 111, 0.08);
  animation: ringPulse 2200ms ease-in-out infinite;
}

:root[data-theme="dark"] .level-ring {
  border-color: #253631;
  border-top-color: var(--teal);
  border-right-color: var(--amber);
  background: #0d1211;
}

.level-ring strong {
  font-size: 1.25rem;
  line-height: 1;
}

.level-ring span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.rank-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid #d4c08f;
  border-radius: 8px;
  background: var(--amber-soft);
}

.rank-line span {
  color: #744407;
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.rank-line strong {
  color: #593300;
  font-size: 0.86rem;
}

:root[data-theme="dark"] .rank-line {
  border-color: rgba(240, 180, 76, 0.36);
}

:root[data-theme="dark"] .rank-line span,
:root[data-theme="dark"] .rank-line strong {
  color: #ffd88f;
}

.mini-progress {
  display: grid;
  gap: 8px;
  font-size: 0.83rem;
  font-weight: 700;
}

.mini-progress > span {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.bar {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #d8e0dc;
}

.bar span {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--teal), var(--blue));
  transition: width 180ms ease;
}

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

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 8px;
  border: 1px solid #c7d3ce;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(234, 243, 239, 0.92)),
    #eef3ef;
  color: #6a7872;
  font-size: 0.68rem;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.54);
}

.badge-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.42;
}

.badge strong,
.badge em {
  display: block;
  min-width: 0;
}

.badge em {
  margin-top: 1px;
  color: inherit;
  font-style: normal;
  font-size: 0.58rem;
  opacity: 0.72;
  text-transform: uppercase;
}

:root[data-theme="dark"] .badge {
  border-color: #364741;
  background: #17211f;
  color: #8da19a;
}

:root[data-theme="dark"] .badge.earned {
  border-color: rgba(84, 208, 131, 0.7);
  background: #12341f;
  color: #89f4b0;
}

.badge.earned {
  border-color: #1f8f4a;
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.24), transparent 32%),
    linear-gradient(135deg, #18824a, #20a064);
  color: #fff;
  box-shadow: 0 12px 22px rgba(32, 160, 100, 0.18), 0 0 0 1px rgba(255, 255, 255, 0.24) inset;
}

.badge.earned .badge-dot {
  background: #dfffea;
  opacity: 1;
  box-shadow: 0 0 12px rgba(223, 255, 234, 0.72);
}

.main-panel {
  min-width: 0;
  padding: 22px;
}

.labs-layout {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr) minmax(280px, 340px);
  gap: 16px;
  align-items: start;
}

.lab-list,
.workspace,
.question-panel,
.quick-grid,
.reference-grid {
  min-width: 0;
}

.lab-list {
  display: grid;
  gap: 10px;
}

.lab-card,
.quick-card,
.reference-card,
.flashcard {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 8px 20px rgba(24, 36, 32, 0.06);
}

.lab-card {
  position: relative;
  display: grid;
  gap: 6px;
  padding: 12px;
  text-align: left;
  overflow: hidden;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    opacity 160ms ease;
}

.lab-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: transparent;
  content: "";
}

.lab-card:not(.locked):hover,
.lab-card:not(.locked):focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 18px 30px rgba(24, 36, 32, 0.12);
}

.lab-card.active {
  border-color: var(--teal);
  box-shadow: 0 0 0 2px rgba(8, 118, 111, 0.15), 0 18px 36px rgba(8, 118, 111, 0.13);
}

.lab-card.active::before {
  background: var(--teal);
}

.lab-card.complete::before {
  background: var(--green);
}

.lab-card.locked {
  background: #eef2ee;
  color: #7c8882;
  cursor: not-allowed;
  opacity: 0.74;
}

.lab-card strong {
  line-height: 1.25;
}

.lab-card span {
  color: var(--muted);
  font-size: 0.82rem;
}

.lab-card .status {
  font-weight: 800;
}

.module-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 900;
  text-transform: uppercase;
}

.module-meta .status {
  padding: 3px 7px;
  border-radius: 999px;
  background: #edf3f0;
}

.module-meta .status.complete {
  background: #e9f6ee;
  color: var(--green);
}

.module-meta .status.unlocked {
  background: #e8f5f2;
  color: var(--teal);
}

.module-meta .status.locked {
  background: #e4e8e4;
  color: #75827c;
}

.lab-card-progress {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #d9e3df;
}

.lab-card-progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--amber));
  transition: width 220ms ease;
}

.workspace,
.question-panel,
.quick-card,
.reference-card {
  padding: 14px;
}

.workspace {
  position: relative;
  border: 1px solid rgba(207, 217, 212, 0.75);
  border-radius: 8px;
  background:
    radial-gradient(circle at 0% 14%, rgba(8, 118, 111, 0.14), transparent 34%),
    radial-gradient(circle at 100% 4%, rgba(84, 208, 131, 0.12), transparent 34%),
    linear-gradient(120deg, rgba(255, 255, 255, 0.88), rgba(238, 248, 244, 0.92) 45%, rgba(255, 250, 237, 0.84));
  background-size: 170% 170%, 170% 170%, 220% 220%;
  box-shadow: 0 20px 44px rgba(20, 31, 29, 0.08);
  animation: moduleGradient 24s ease-in-out infinite;
}

.lab-hero {
  position: relative;
  display: grid;
  gap: 12px;
  padding: 2px 0 4px;
}

.lab-hero h2 {
  font-size: 1.35rem;
}

.lab-story {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.network-scene {
  position: relative;
  margin-top: 12px;
  padding: 12px;
  overflow: hidden;
  border: 1px solid rgba(137, 221, 194, 0.72);
  border-radius: 8px;
  background:
    radial-gradient(circle at 10% 22%, rgba(84, 208, 131, 0.32), transparent 30%),
    radial-gradient(circle at 62% 8%, rgba(38, 184, 170, 0.24), transparent 28%),
    radial-gradient(circle at 94% 72%, rgba(240, 180, 76, 0.16), transparent 32%),
    linear-gradient(135deg, rgba(242, 255, 249, 0.95), rgba(216, 246, 232, 0.9) 48%, rgba(230, 247, 252, 0.92));
  background-size: 190% 190%, 180% 180%, 180% 180%, 260% 260%;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.84);
  animation: moduleGradient 26s ease-in-out infinite;
}

.network-scene::before {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent, rgba(84, 208, 131, 0.22), transparent),
    linear-gradient(0deg, rgba(84, 208, 131, 0.09), transparent 42%, rgba(38, 184, 170, 0.11));
  background-size: 340px 100%, 100% 100%;
  content: "";
  opacity: 0.72;
  pointer-events: none;
  animation: networkSweep 13000ms linear infinite;
}

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

.scene-header span {
  color: #48615b;
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.scene-header strong {
  padding: 5px 9px;
  border-radius: 999px;
  background: #101412;
  color: #fff;
  font-size: 0.76rem;
}

.network-map {
  position: relative;
  z-index: 1;
  min-height: 190px;
  overflow: hidden;
}

.network-lane {
  display: grid;
  grid-template-columns: minmax(104px, 128px) minmax(36px, 1fr) minmax(104px, 128px) minmax(36px, 1fr) minmax(104px, 128px) minmax(36px, 1fr) minmax(104px, 128px) minmax(36px, 1fr) minmax(104px, 128px);
  align-items: center;
  gap: clamp(6px, 1vw, 12px);
  min-height: 138px;
  padding: 12px 2px 6px;
}

.network-node {
  position: absolute;
  z-index: 3;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 5px 8px;
  width: 100%;
  max-width: 128px;
  min-width: 0;
  min-height: 62px;
  padding: 8px 9px;
  border: 1px solid rgba(8, 118, 111, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 22px rgba(20, 31, 29, 0.09);
  animation: nodePulse 2400ms ease-in-out infinite;
}

.network-node::before {
  display: none;
  width: 16px;
  height: 16px;
  border: 4px solid rgba(8, 118, 111, 0.25);
  border-top-color: var(--teal);
  border-radius: 50%;
  content: "";
}

.network-node strong {
  align-self: end;
  min-width: 0;
  font-size: 0.72rem;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.network-node span {
  min-width: 0;
  color: var(--muted);
  font-size: 0.64rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.network-node > span:not(.device-icon) {
  grid-column: 2;
}

.device-icon {
  position: relative;
  grid-row: 1 / span 2;
  align-self: center;
  justify-self: center;
  display: block;
  width: 30px;
  height: 30px;
  color: var(--teal);
}

.device-icon::before,
.device-icon::after,
.device-icon span {
  position: absolute;
  content: "";
}

.device-client::before {
  left: 3px;
  top: 5px;
  width: 24px;
  height: 15px;
  border: 2px solid currentColor;
  border-radius: 3px;
}

.device-client::after {
  left: 8px;
  bottom: 4px;
  width: 14px;
  height: 3px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 5px -4px 0 -1px currentColor;
}

.device-switch::before {
  left: 2px;
  top: 8px;
  width: 26px;
  height: 14px;
  border: 2px solid currentColor;
  border-radius: 4px;
}

.device-switch span {
  left: 7px;
  top: 13px;
  width: 3px;
  height: 3px;
  border-radius: 1px;
  background: currentColor;
  box-shadow: 6px 0 0 currentColor, 12px 0 0 currentColor, 18px 0 0 currentColor;
}

.device-gateway::before {
  left: 5px;
  top: 8px;
  width: 20px;
  height: 14px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.device-gateway::after {
  left: 6px;
  top: 4px;
  width: 18px;
  height: 18px;
  border-top: 2px solid currentColor;
  border-radius: 50%;
}

.device-gateway span {
  left: 13px;
  top: 12px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}

.device-service::before {
  left: 7px;
  top: 3px;
  width: 16px;
  height: 24px;
  border: 2px solid currentColor;
  border-radius: 4px;
}

.device-service span {
  left: 11px;
  top: 8px;
  width: 8px;
  height: 2px;
  background: currentColor;
  box-shadow: 0 6px 0 currentColor, 0 12px 0 currentColor;
}

.device-cloud::before {
  left: 4px;
  top: 13px;
  width: 22px;
  height: 10px;
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 0 0 999px 999px;
}

.device-cloud::after {
  left: 6px;
  top: 7px;
  width: 18px;
  height: 15px;
  border-top: 2px solid currentColor;
  border-radius: 999px 999px 0 0;
}

.node-client {
  left: 1%;
  top: 54px;
}

.node-switch {
  left: 22%;
  top: 54px;
}

.node-gateway {
  left: 42%;
  top: 54px;
}

.node-service {
  right: 19%;
  top: 54px;
}

.node-cloud {
  right: 1%;
  top: 54px;
}

.network-lane .network-node {
  position: relative;
  inset: auto;
  width: auto;
}

.network-lane .network-node:nth-of-type(2),
.network-lane .network-node:nth-of-type(4) {
  transform: translateY(-18px);
}

.network-lane .network-node:nth-of-type(3) {
  transform: translateY(14px);
}

.network-link {
  position: absolute;
  z-index: 2;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(84, 208, 131, 0.34);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.72);
}

.network-link.focus-flow {
  background: rgba(84, 208, 131, 0.52);
  box-shadow: 0 0 18px rgba(84, 208, 131, 0.24);
}

.network-link::after {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.72) 0 10px, rgba(255, 255, 255, 0) 10px 20px);
  content: "";
  animation: dashFlow 760ms linear infinite;
}

.link-1 {
  left: 12%;
  top: 90px;
  width: 12%;
}

.link-2 {
  left: 32%;
  top: 90px;
  width: 12%;
}

.link-3 {
  left: 53%;
  top: 90px;
  width: 12%;
}

.link-4 {
  left: 74%;
  top: 90px;
  width: 12%;
}

.network-lane .network-link {
  position: relative;
  inset: auto;
  display: block;
  justify-self: center;
  width: 106%;
  min-width: 0;
}

.network-lane > .network-link:nth-of-type(1),
.network-lane > .network-link:nth-of-type(3) {
  transform: rotate(-5deg) translateY(-8px);
}

.network-lane > .network-link:nth-of-type(2),
.network-lane > .network-link:nth-of-type(4) {
  transform: rotate(5deg) translateY(8px);
}

.packet-dot {
  position: absolute;
  top: 50%;
  left: 0;
  z-index: 4;
  width: 14px;
  height: 14px;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 18px currentColor;
  transform: translateY(-50%);
  animation: packetTravel 1150ms linear infinite;
  animation-delay: var(--delay);
}

.flow-legend {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.flow-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 6px 9px;
  border: 1px solid #c6d6d1;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  color: #4f625c;
  font-size: 0.75rem;
  font-weight: 800;
}

.flow-pill i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.flow-pill strong {
  color: var(--ink);
}

.signal-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  height: 8px;
  margin-bottom: 2px;
}

.signal-strip span {
  border-radius: 999px;
  background: linear-gradient(90deg, var(--teal), var(--blue));
  opacity: 0.24;
  animation: packetBlink 1300ms ease-in-out infinite;
}

.signal-strip span:nth-child(2) {
  animation-delay: 120ms;
}

.signal-strip span:nth-child(3) {
  animation-delay: 240ms;
}

.signal-strip span:nth-child(4) {
  animation-delay: 360ms;
}

.signal-strip span:nth-child(5) {
  animation-delay: 480ms;
}

.unlock-note {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #e1c174;
  border-radius: 8px;
  background: var(--amber-soft);
  color: #6f4409;
  font-weight: 800;
}

.capture-focus {
  display: grid;
  gap: 6px;
  margin-top: 0;
  padding: 9px 10px;
  border: 1px solid rgba(180, 107, 9, 0.34);
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(255, 242, 211, 0.82), rgba(255, 255, 255, 0.72));
}

.capture-focus div:first-child {
  display: grid;
  gap: 3px;
}

.capture-focus span {
  color: #744407;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.capture-focus strong {
  line-height: 1.25;
}

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

.focus-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.focus-tags span {
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #6f4409;
}

.chip-row,
.filter-chip-row,
.question-actions,
.exam-actions,
.port-options,
.osi-board,
.subnet-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip,
.difficulty,
.filter-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #f6f8f4;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.chip-row.compact {
  gap: 5px;
}

.chip-row.compact .chip,
.chip-row.compact .difficulty {
  min-height: 24px;
  padding: 4px 8px;
  font-size: 0.68rem;
}

.skill-summary {
  max-width: min(540px, 100%);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.difficulty {
  border-color: #e7c68c;
  background: #fff7e7;
  color: #744407;
}

.capture-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  margin-top: 14px;
}

.capture-tools input,
.quick-input,
.command-row input,
.subnet-fields input {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid #aebdb8;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.capture-tools input:focus,
.quick-input:focus,
.command-row input:focus,
.subnet-fields input:focus {
  outline: 2px solid rgba(8, 118, 111, 0.25);
  border-color: var(--teal);
}

.primary-button,
.secondary-button,
.ghost-button,
.filter-chip,
.choice-label,
.port-option,
.osi-tile {
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-weight: 800;
}

.primary-button {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

.primary-button:hover,
.primary-button:focus-visible {
  background: var(--teal-dark);
}

.primary-button:disabled,
.secondary-button:disabled,
.ghost-button:disabled,
.port-option:disabled,
.osi-tile:disabled {
  border-color: #c7d3ce;
  background: #e8eee9;
  color: #82908a;
  cursor: not-allowed;
}

.secondary-button:hover,
.secondary-button:focus-visible,
.ghost-button:hover,
.ghost-button:focus-visible,
.filter-chip:hover,
.filter-chip:focus-visible,
.choice-label:hover,
.port-option:hover,
.port-option:focus-visible,
.osi-tile:hover,
.osi-tile:focus-visible {
  border-color: var(--teal);
  outline: none;
}

.ghost-button {
  background: transparent;
}

.filter-chip-row {
  margin-top: 8px;
}

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

.filter-preset {
  align-items: flex-start;
  flex-direction: column;
  gap: 2px;
}

.filter-preset code {
  color: var(--muted);
  font-family: inherit;
  font-size: 0.66rem;
  font-weight: 800;
}

.capture-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 330px);
  gap: 14px;
  align-items: start;
  margin-top: 12px;
}

.capture-client {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.42);
}

.capture-client-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.capture-client-head strong {
  color: var(--ink);
}

.packet-table-wrap {
  align-self: start;
  overflow: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.8);
}

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

.packet-table th,
.packet-table td {
  padding: 7px 9px;
  border-bottom: 1px solid #e7ece9;
  text-align: left;
  vertical-align: top;
}

.packet-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #edf3f0;
  color: #30423c;
  font-size: 0.75rem;
  text-transform: uppercase;
}

.packet-table tr {
  cursor: pointer;
}

.packet-table tbody tr:hover,
.packet-table tbody tr.selected {
  background: #eaf6f3;
}

.packet-table tbody tr {
  animation: rowIn 240ms ease both;
}

.packet-table tbody tr.capture-hit {
  background: #fff7e7;
  box-shadow: inset 4px 0 0 var(--amber);
}

.packet-table tbody tr.capture-hit.selected {
  background: #e8f5f2;
  box-shadow: inset 4px 0 0 var(--teal), inset 0 0 0 999px rgba(180, 107, 9, 0.09);
}

.proto {
  display: inline-flex;
  justify-content: center;
  min-width: 54px;
  padding: 3px 7px;
  border-radius: 999px;
  color: #fff;
  font-size: 0.74rem;
  font-weight: 900;
}

.proto-dhcp,
.proto-dns {
  background: var(--blue);
}

.proto-tcp,
.proto-http {
  background: var(--teal);
}

.proto-arp {
  background: var(--amber);
}

.proto-icmp {
  background: var(--rose);
}

.proto-tls,
.proto-smb,
.proto-ntp {
  background: #4f5d75;
}

.packet-dot.proto-dhcp,
.packet-dot.proto-dns,
.flow-pill i.proto-dhcp,
.flow-pill i.proto-dns {
  background: var(--green);
  color: var(--green);
}

.packet-dot.proto-tcp,
.packet-dot.proto-http,
.flow-pill i.proto-tcp,
.flow-pill i.proto-http {
  background: var(--teal);
  color: var(--teal);
}

.packet-dot.proto-arp,
.flow-pill i.proto-arp {
  background: var(--amber);
  color: var(--amber);
}

.packet-dot.proto-icmp,
.flow-pill i.proto-icmp {
  background: var(--rose);
  color: var(--rose);
}

.packet-dot.proto-tls,
.packet-dot.proto-smb,
.packet-dot.proto-ntp,
.flow-pill i.proto-tls,
.flow-pill i.proto-smb,
.flow-pill i.proto-ntp {
  background: #4f5d75;
  color: #4f5d75;
}

.packet-detail {
  display: grid;
  gap: 0;
  min-height: 0;
  align-self: stretch;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 250, 247, 0.96)),
    #fbfcf8;
}

.packet-title {
  margin: 0;
  padding: 13px 14px;
  border-bottom: 1px solid #e4ebe7;
  font-size: 1rem;
  line-height: 1.25;
}

.detail-lines {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 12px 14px;
}

.detail-lines div {
  display: grid;
  grid-template-columns: minmax(96px, 0.9fr) minmax(0, 1.1fr);
  gap: 10px;
  align-items: start;
  min-width: 0;
  padding: 0 0 8px;
  border-bottom: 1px solid #e4ebe7;
}

.detail-lines div.field-hit {
  margin: -3px -6px 0;
  padding: 6px;
  border: 1px solid rgba(180, 107, 9, 0.34);
  border-radius: 8px;
  background: #fff7e7;
  box-shadow: inset 4px 0 0 var(--amber);
}

.detail-lines dt {
  min-width: 0;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.2;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.detail-lines dd {
  min-width: 0;
  margin: 0;
  line-height: 1.25;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.timeline {
  display: grid;
  gap: 7px;
  padding: 0 14px 14px;
}

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

.timeline-line {
  height: 9px;
  border-radius: 999px;
  background: #d6e2de;
  overflow: hidden;
}

.timeline-line span {
  display: block;
  height: 100%;
  background: var(--teal);
  animation: dataFlow 1700ms ease-in-out infinite;
}

.question-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.question-panel h2 {
  font-size: 1rem;
}

.question-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.question-panel-head span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.question-panel-head strong {
  min-width: 54px;
  padding: 6px 8px;
  border-radius: 8px;
  background: #101412;
  color: #fff;
  text-align: center;
}

.question-stepper {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}

.question-stepper span {
  height: 8px;
  border-radius: 999px;
  background: #dae4df;
}

.question-stepper span.done {
  background: var(--green);
}

.question-stepper span.active {
  background: var(--amber);
  animation: stepPulse 1200ms ease-in-out infinite;
}

.question {
  display: grid;
  gap: 6px;
  padding: 10px 0;
  border-bottom: 1px solid #e8eeeb;
  opacity: 0.64;
  transition:
    opacity 160ms ease,
    transform 160ms ease,
    background 160ms ease;
}

.question.active {
  margin: 0 -8px;
  padding: 12px 8px;
  border-radius: 8px;
  background: #fffaf0;
  opacity: 1;
  transform: translateX(2px);
}

.question.complete {
  opacity: 0.88;
}

.question.locked {
  opacity: 0.46;
}

.question:last-of-type {
  border-bottom: 0;
}

.question p {
  margin: 0;
  line-height: 1.4;
}

.question-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.question-title span {
  align-self: flex-start;
  padding: 3px 7px;
  border-radius: 999px;
  background: #edf3f0;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.question.active .question-title span {
  background: var(--amber-soft);
  color: #744407;
}

.question.complete .question-title span {
  background: #e9f6ee;
  color: var(--green);
}

.question input[type="text"] {
  min-height: 40px;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid #aebdb8;
  border-radius: 8px;
}

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

.question-inline-actions {
  display: flex;
  justify-content: flex-start;
}

.question-check-button {
  min-width: 132px;
  white-space: nowrap;
}

.reset-module-actions {
  justify-content: flex-end;
  padding-top: 8px;
}

.question input:disabled,
.choice-label:has(input:disabled) {
  cursor: not-allowed;
}

.question input:disabled {
  background: #f3f6f4;
}

.choice-list {
  display: grid;
  gap: 7px;
}

.choice-label {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-weight: 700;
}

.choice-label:has(input:disabled) {
  background: #f5f7f5;
  color: #77847e;
}

.hint-panel {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #d8e2dd;
  border-radius: 8px;
  background: #f8fbf7;
}

.hint-panel.hint-required {
  border-color: rgba(180, 107, 9, 0.45);
  background: #fff7e7;
  box-shadow: inset 4px 0 0 var(--amber);
}

.hint-meter {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}

.hint-meter span {
  height: 7px;
  border-radius: 999px;
  background: #dbe5e0;
}

.hint-meter span.used {
  background: linear-gradient(90deg, var(--amber), var(--teal));
}

.hint-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}

.hint-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.hint-actions span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.hint-button {
  min-height: 34px;
  padding: 6px 10px;
}

.feedback {
  min-height: 23px;
  color: var(--muted);
  font-size: 0.87rem;
  line-height: 1.35;
}

.feedback.good {
  color: var(--green);
  font-weight: 800;
}

.feedback.bad {
  color: var(--rose);
  font-weight: 800;
}

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

.quick-card.wide,
.reference-card.wide {
  grid-column: 1 / -1;
}

.quick-card h2,
.reference-card h2 {
  font-size: 1.08rem;
  margin-bottom: 8px;
}

.quick-card p,
.reference-card p,
.exam-question p {
  color: var(--muted);
  line-height: 1.5;
}

.prompt-box {
  margin: 12px 0;
  padding: 12px;
  border-left: 4px solid var(--teal);
  background: var(--panel-strong);
  border-radius: 0 8px 8px 0;
}

.tool-page {
  display: grid;
  gap: 16px;
}

.tool-hero,
.filter-workbench,
.filter-lab-panel,
.filter-reference-panel,
.subnet-teacher,
.subnet-answer-card,
.subnet-reference-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    radial-gradient(circle at 0% 0%, rgba(38, 184, 170, 0.1), transparent 34%),
    rgba(255, 255, 255, 0.72);
}

.tool-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.tool-hero h2,
.filter-lab-panel h2,
.filter-reference-panel h2,
.subnet-answer-card h2,
.subnet-reference-card h2 {
  margin: 0 0 8px;
  font-size: 1.08rem;
}

.tool-hero p,
.filter-lab-panel p,
.subnet-teacher p,
.subnet-reference-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.tool-kicker {
  display: block;
  margin-bottom: 6px;
  color: var(--teal);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.tool-patterns,
.subnet-mini-map {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.tool-patterns span,
.subnet-mini-map span {
  min-height: 30px;
  padding: 6px 9px;
  border: 1px solid rgba(8, 118, 111, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
}

.filter-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 14px;
}

.filter-command {
  display: grid;
  gap: 9px;
}

.filter-command label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

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

.filter-cheats {
  display: grid;
  gap: 8px;
}

.filter-cheats article {
  padding: 10px;
  border: 1px solid rgba(8, 118, 111, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.54);
}

.filter-cheats strong,
.filter-cheats span {
  display: block;
}

.filter-cheats span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.filter-lab-panel {
  display: grid;
  gap: 10px;
}

.filter-reference-panel .reference-list li {
  grid-template-columns: minmax(190px, 0.42fr) minmax(0, 1fr);
}

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

.subnet-page .tool-hero,
.subnet-answer-card {
  grid-column: 1 / -1;
}

.subnet-teacher {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.subnet-teacher article {
  display: grid;
  gap: 6px;
  align-content: start;
  padding: 12px;
  border: 1px solid rgba(8, 118, 111, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.5);
}

.subnet-teacher article > span {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  font-weight: 900;
}

.subnet-answer-card {
  display: grid;
  gap: 10px;
}

.subnet-actions {
  margin-top: 2px;
}

.port-options {
  margin-top: 12px;
}

.port-option.correct,
.osi-tile.correct {
  border-color: var(--green);
  background: #e9f6ee;
  color: #185236;
}

.port-option.wrong,
.osi-tile.wrong {
  border-color: var(--rose);
  background: #fff0f1;
  color: #8a2632;
}

.flashcard {
  display: grid;
  place-items: center;
  min-height: 160px;
  padding: 18px;
  text-align: center;
}

.flashcard strong {
  display: block;
  font-size: 1.8rem;
}

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

.subnet-fields {
  margin: 12px 0;
}

.subnet-fields label {
  flex: 1 1 170px;
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.osi-board {
  align-items: center;
  margin-top: 12px;
}

.osi-tile {
  min-width: 118px;
}

.exam-question {
  display: grid;
  gap: 10px;
  padding: 14px 0;
  border-top: 1px solid #e8eeeb;
}

.exam-score {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 9px 12px;
  border-radius: 8px;
  background: #101412;
  color: #fff;
  font-weight: 900;
}

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

.reference-list li {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #e8eeeb;
}

.reference-list strong {
  overflow-wrap: anywhere;
}

.reference-list span {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.empty-state {
  padding: 28px;
  border: 1px dashed #9db6ae;
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

:root[data-theme="dark"] .brand-mark {
  border-color: rgba(38, 184, 170, 0.42);
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.22), transparent 34%),
    linear-gradient(135deg, #26b8aa, #0b1513 72%);
  color: #f5fffb;
}

:root[data-theme="dark"] .lab-card,
:root[data-theme="dark"] .quick-card,
:root[data-theme="dark"] .reference-card,
:root[data-theme="dark"] .flashcard,
:root[data-theme="dark"] .question-panel,
:root[data-theme="dark"] .packet-table-wrap,
:root[data-theme="dark"] .packet-detail {
  background: var(--panel);
  border-color: var(--line);
  box-shadow: var(--shadow);
}

:root[data-theme="dark"] .tool-hero,
:root[data-theme="dark"] .filter-workbench,
:root[data-theme="dark"] .filter-lab-panel,
:root[data-theme="dark"] .filter-reference-panel,
:root[data-theme="dark"] .subnet-teacher,
:root[data-theme="dark"] .subnet-answer-card,
:root[data-theme="dark"] .subnet-reference-card {
  background:
    radial-gradient(circle at 0% 0%, rgba(38, 184, 170, 0.12), transparent 34%),
    #111a18;
  border-color: var(--line);
}

:root[data-theme="dark"] .tool-patterns span,
:root[data-theme="dark"] .subnet-mini-map span,
:root[data-theme="dark"] .filter-cheats article,
:root[data-theme="dark"] .subnet-teacher article {
  border-color: #314741;
  background: rgba(255, 255, 255, 0.05);
}

:root[data-theme="dark"] .lab-card.locked {
  background: #111817;
  color: #77867f;
  opacity: 0.72;
}

:root[data-theme="dark"] .module-meta .status,
:root[data-theme="dark"] .question-title span {
  background: #1b2724;
  color: var(--muted);
}

:root[data-theme="dark"] .module-meta .status.complete,
:root[data-theme="dark"] .question.complete .question-title span {
  background: rgba(84, 208, 131, 0.14);
  color: var(--green);
}

:root[data-theme="dark"] .module-meta .status.unlocked {
  background: rgba(38, 184, 170, 0.14);
  color: var(--teal);
}

:root[data-theme="dark"] .module-meta .status.locked {
  background: #1c2422;
  color: #76877f;
}

:root[data-theme="dark"] .lab-card-progress,
:root[data-theme="dark"] .bar,
:root[data-theme="dark"] .metric-bar,
:root[data-theme="dark"] .question-stepper span,
:root[data-theme="dark"] .timeline-line {
  background: #263531;
}

:root[data-theme="dark"] .workspace {
  border-color: var(--line);
  background:
    radial-gradient(circle at 0% 14%, rgba(38, 184, 170, 0.16), transparent 36%),
    radial-gradient(circle at 100% 4%, rgba(84, 208, 131, 0.12), transparent 36%),
    linear-gradient(120deg, rgba(13, 22, 20, 0.96), rgba(16, 33, 29, 0.92) 45%, rgba(28, 24, 15, 0.9));
  background-size: 170% 170%, 170% 170%, 220% 220%;
  box-shadow: var(--shadow);
}

:root[data-theme="dark"] .network-scene {
  border-color: rgba(137, 221, 194, 0.42);
  background:
    radial-gradient(circle at 10% 22%, rgba(84, 208, 131, 0.22), transparent 30%),
    radial-gradient(circle at 62% 8%, rgba(38, 184, 170, 0.2), transparent 28%),
    radial-gradient(circle at 94% 72%, rgba(240, 180, 76, 0.12), transparent 32%),
    linear-gradient(135deg, rgba(11, 18, 17, 0.98), rgba(8, 54, 42, 0.9) 52%, rgba(10, 35, 48, 0.92));
  background-size: 190% 190%, 180% 180%, 180% 180%, 260% 260%;
}

:root[data-theme="dark"] .network-scene::before {
  background:
    linear-gradient(90deg, transparent, rgba(84, 208, 131, 0.28), transparent),
    linear-gradient(0deg, rgba(84, 208, 131, 0.09), transparent 42%, rgba(38, 184, 170, 0.09));
}

:root[data-theme="dark"] .network-node,
:root[data-theme="dark"] .flow-pill {
  background: rgba(17, 26, 24, 0.94);
  border-color: #324842;
}

:root[data-theme="dark"] .capture-focus,
:root[data-theme="dark"] .hint-panel.hint-required,
:root[data-theme="dark"] .detail-lines div.field-hit {
  border-color: rgba(240, 180, 76, 0.42);
  background: #2a2114;
  color: #ffd88f;
}

:root[data-theme="dark"] .capture-focus span,
:root[data-theme="dark"] .focus-tags span {
  color: #ffd88f;
}

:root[data-theme="dark"] .focus-tags span {
  background: rgba(255, 255, 255, 0.08);
}

:root[data-theme="dark"] .hint-panel {
  border-color: #344641;
  background: #101816;
}

:root[data-theme="dark"] .hint-meter span {
  background: #263531;
}

:root[data-theme="dark"] .scene-header strong,
:root[data-theme="dark"] .question-panel-head strong,
:root[data-theme="dark"] .exam-score {
  background: #eaf8f5;
  color: #0c1211;
}

:root[data-theme="dark"] .chip,
:root[data-theme="dark"] .filter-chip,
:root[data-theme="dark"] .difficulty {
  background: #16221f;
  border-color: #314741;
  color: #bfd0cb;
}

:root[data-theme="dark"] .filter-preset code {
  color: #8ea19a;
}

:root[data-theme="dark"] .difficulty {
  border-color: rgba(240, 180, 76, 0.45);
  background: #2a2114;
  color: #ffd88f;
}

:root[data-theme="dark"] .capture-tools input,
:root[data-theme="dark"] .quick-input,
:root[data-theme="dark"] .command-row input,
:root[data-theme="dark"] .subnet-fields input,
:root[data-theme="dark"] .question input[type="text"] {
  border-color: #3a4b46;
  background: #0f1715;
  color: var(--ink);
}

:root[data-theme="dark"] .question input:disabled,
:root[data-theme="dark"] .choice-label:has(input:disabled) {
  background: #121a18;
  color: #7f9089;
}

:root[data-theme="dark"] .secondary-button,
:root[data-theme="dark"] .ghost-button,
:root[data-theme="dark"] .choice-label,
:root[data-theme="dark"] .port-option,
:root[data-theme="dark"] .osi-tile {
  background: #111a18;
  border-color: #354842;
  color: var(--ink);
}

:root[data-theme="dark"] .primary-button:disabled,
:root[data-theme="dark"] .secondary-button:disabled,
:root[data-theme="dark"] .ghost-button:disabled,
:root[data-theme="dark"] .port-option:disabled,
:root[data-theme="dark"] .osi-tile:disabled {
  border-color: #2f3e3a;
  background: #1a2421;
  color: #76877f;
}

:root[data-theme="dark"] .packet-table th {
  background: #182522;
  color: #c4d6d0;
}

:root[data-theme="dark"] .packet-table td,
:root[data-theme="dark"] .packet-table th,
:root[data-theme="dark"] .detail-lines div,
:root[data-theme="dark"] .question,
:root[data-theme="dark"] .exam-question,
:root[data-theme="dark"] .reference-list li {
  border-bottom-color: #293935;
}

:root[data-theme="dark"] .packet-table tbody tr:hover,
:root[data-theme="dark"] .packet-table tbody tr.selected {
  background: rgba(38, 184, 170, 0.13);
}

:root[data-theme="dark"] .packet-table tbody tr.capture-hit {
  background: rgba(240, 180, 76, 0.13);
  box-shadow: inset 4px 0 0 var(--amber);
}

:root[data-theme="dark"] .packet-table tbody tr.capture-hit.selected {
  background: rgba(38, 184, 170, 0.14);
  box-shadow: inset 4px 0 0 var(--teal), inset 0 0 0 999px rgba(240, 180, 76, 0.07);
}

:root[data-theme="dark"] .packet-detail,
:root[data-theme="dark"] .capture-client,
:root[data-theme="dark"] .prompt-box {
  background: #111a18;
}

:root[data-theme="dark"] .packet-detail {
  background:
    linear-gradient(180deg, rgba(17, 26, 24, 0.98), rgba(13, 24, 22, 0.98)),
    #111a18;
}

:root[data-theme="dark"] .question.active,
:root[data-theme="dark"] .unlock-note {
  background: #2a2114;
  border-color: rgba(240, 180, 76, 0.38);
  color: #ffd88f;
}

:root[data-theme="dark"] .question.active .question-title span {
  background: #3a2b13;
  color: #ffd88f;
}

:root[data-theme="dark"] .port-option.correct,
:root[data-theme="dark"] .osi-tile.correct {
  background: rgba(84, 208, 131, 0.14);
  color: #a6f0c0;
}

:root[data-theme="dark"] .port-option.wrong,
:root[data-theme="dark"] .osi-tile.wrong {
  background: rgba(255, 111, 131, 0.12);
  color: #ffadb8;
}

:root[data-theme="dark"] .empty-state {
  border-color: #456158;
}

@keyframes packetBlink {
  0%,
  100% {
    opacity: 0.22;
    transform: scaleX(0.72);
  }
  50% {
    opacity: 0.78;
    transform: scaleX(1);
  }
}

@keyframes networkSweep {
  from {
    background-position: -240px 0, 0 0;
  }
  to {
    background-position: 240px 0, 0 0;
  }
}

@keyframes moduleGradient {
  0%,
  100% {
    background-position: 0% 45%, 100% 35%, 0% 50%;
  }
  50% {
    background-position: 100% 55%, 0% 65%, 100% 50%;
  }
}

@keyframes packetTravel {
  0% {
    left: 0;
    opacity: 0;
  }
  12% {
    opacity: 1;
  }
  88% {
    opacity: 1;
  }
  100% {
    left: calc(100% - 14px);
    opacity: 0;
  }
}

@keyframes dashFlow {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 48px 0;
  }
}

@keyframes dashFlowY {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 0 48px;
  }
}

@keyframes packetTravelY {
  0% {
    top: 0;
    opacity: 0;
  }
  12% {
    opacity: 1;
  }
  88% {
    opacity: 1;
  }
  100% {
    top: calc(100% - 14px);
    opacity: 0;
  }
}

@keyframes nodePulse {
  0%,
  100% {
    box-shadow: 0 12px 22px rgba(20, 31, 29, 0.09);
  }
  50% {
    box-shadow: 0 14px 30px rgba(8, 118, 111, 0.15);
  }
}

@keyframes dataFlow {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.25);
  }
}

@keyframes rowIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes stepPulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(180, 107, 9, 0.24);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(180, 107, 9, 0);
  }
}

@keyframes ringPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.025);
  }
}

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

@media (hover: none), (pointer: coarse) {
  button,
  .nav-button,
  .lab-card,
  .filter-chip,
  .choice-label,
  .primary-button,
  .secondary-button,
  .ghost-button,
  .question input[type="text"] {
    min-height: 44px;
  }

  .lab-card:not(.locked):hover,
  .lab-card:not(.locked):focus-visible,
  .nav-button:hover,
  .nav-button:focus-visible {
    transform: none !important;
  }
}

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

  .question-panel {
    grid-column: 1 / -1;
  }
}

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

  .topbar,
  .sidebar {
    position: static;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding-right: max(18px, env(safe-area-inset-right, 0px));
    padding-left: max(18px, env(safe-area-inset-left, 0px));
  }

  .summary-strip {
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .topbar-actions {
    align-items: stretch;
    width: 100%;
    flex-direction: row;
    justify-content: space-between;
  }

  .app-menu {
    order: 2;
  }

  .summary-strip {
    order: 1;
    flex: 1;
    width: auto;
    min-width: 0;
  }

  .menu-panel .theme-toggle {
    justify-content: flex-start;
  }

  .sidebar {
    padding-right: max(18px, env(safe-area-inset-right, 0px));
    padding-left: max(18px, env(safe-area-inset-left, 0px));
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .main-panel {
    padding-right: max(22px, env(safe-area-inset-right, 0px));
    padding-left: max(22px, env(safe-area-inset-left, 0px));
    padding-bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  }

  .nav-tabs {
    grid-template-columns: minmax(150px, 0.8fr) minmax(260px, 1.2fr);
    align-items: start;
  }

  .nav-button {
    text-align: center;
  }

  .nav-group:last-child {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .nav-group:last-child .nav-heading {
    grid-column: 1 / -1;
  }

  .nav-sub {
    margin-left: 0;
    padding-left: 12px;
    justify-content: center;
  }

  .nav-sub::before {
    display: none;
  }

  .coach-panel {
    display: none;
  }

  .labs-layout,
  .capture-grid,
  .quick-grid,
  .reference-grid,
  .filter-workbench,
  .subnet-page,
  .subnet-teacher {
    grid-template-columns: 1fr;
  }

  .subnet-page .tool-hero,
  .subnet-answer-card,
  .subnet-teacher {
    grid-column: auto;
  }

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

  .network-map {
    min-height: 230px;
  }
}

@media (max-width: 620px) {
  .topbar {
    padding:
      calc(14px + env(safe-area-inset-top, 0px))
      max(14px, env(safe-area-inset-right, 0px))
      14px
      max(14px, env(safe-area-inset-left, 0px));
  }

  .main-panel,
  .sidebar {
    padding-right: max(14px, env(safe-area-inset-right, 0px));
    padding-left: max(14px, env(safe-area-inset-left, 0px));
  }

  .main-panel {
    padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  }

  .summary-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

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

  .metric-label {
    font-size: 0.62rem;
  }

  .metric-sub {
    display: none;
  }

  .nav-tabs,
  .lab-list,
  .capture-tools,
  .command-row,
  .answer-line {
    grid-template-columns: 1fr;
  }

  .nav-tabs {
    gap: 10px;
  }

  .nav-group:last-child {
    grid-template-columns: repeat(5, minmax(126px, 1fr));
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }

  .nav-group:last-child .nav-button {
    min-width: 126px;
  }

  .lab-list {
    max-height: 46vh;
    overflow: auto;
    padding-right: 2px;
    -webkit-overflow-scrolling: touch;
  }

  .lab-card {
    min-height: 76px;
  }

  .workspace,
  .question-panel,
  .capture-client,
  .quick-card,
  .reference-card {
    padding: 12px;
  }

  input,
  select,
  textarea {
    font-size: 16px;
  }

  .topbar-actions {
    gap: 8px;
  }

  .nav-button {
    justify-content: flex-start;
    text-align: left;
  }

  .capture-client-head,
  .question-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .packet-table {
    min-width: 620px;
    font-size: 0.76rem;
  }

  .packet-table th,
  .packet-table td {
    padding: 6px 7px;
  }

  .packet-detail {
    max-height: none;
  }

  .detail-lines {
    gap: 6px;
    padding: 10px;
  }

  .question.active {
    margin: 0;
    transform: none;
  }

  .choice-label {
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
  }

  .tool-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .tool-patterns,
  .subnet-mini-map {
    justify-content: flex-start;
  }

  .question-check-button {
    width: 100%;
  }

  .nav-group:last-child {
    grid-template-columns: repeat(5, minmax(126px, 1fr));
  }

  .brand {
    align-items: flex-start;
  }

  .detail-lines div,
  .reference-list li {
    grid-template-columns: 1fr;
  }

  .network-map {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    min-height: 0;
  }

  .network-lane {
    grid-template-columns: 1fr;
    justify-items: stretch;
    min-height: 0;
    padding: 8px 0;
  }

  .network-link {
    display: block;
    width: 4px;
    height: 24px;
    min-width: 4px;
    background: rgba(84, 208, 131, 0.5);
  }

  .network-link::after {
    background: repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.74) 0 8px, rgba(255, 255, 255, 0) 8px 16px);
    animation: dashFlowY 760ms linear infinite;
  }

  .packet-dot {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    animation-name: packetTravelY;
  }

  .network-node,
  .node-client,
  .node-switch,
  .node-gateway,
  .node-service,
  .node-cloud {
    position: relative;
    inset: auto;
    width: 100%;
    min-height: 60px;
    transform: none !important;
  }

  .network-lane > .network-link {
    justify-self: start;
    width: 4px;
    min-width: 4px;
    height: 24px;
    margin-left: 20px;
    transform: none;
  }

  .scene-header {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 420px) {
  .summary-strip {
    grid-template-columns: 1fr;
  }

  .metric-sub {
    display: block;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
  }

  .brand h1 {
    font-size: 1.12rem;
  }
}
