:root {
  color-scheme: dark;
  --bg: #071126;
  --bg-deep: #050b1b;
  --surface: #0d1a36;
  --surface-2: #122344;
  --surface-3: #182c52;
  --surface-soft: rgba(20, 39, 75, 0.72);
  --border: rgba(150, 184, 234, 0.14);
  --border-strong: rgba(150, 184, 234, 0.26);
  --text: #f3f7ff;
  --muted: #9db0d1;
  --muted-2: #7185aa;
  --primary: #7967ff;
  --primary-2: #5e4ce9;
  --cyan: #28c8e8;
  --cyan-soft: rgba(40, 200, 232, 0.13);
  --violet-soft: rgba(121, 103, 255, 0.14);
  --success: #36d49a;
  --success-soft: rgba(54, 212, 154, 0.13);
  --warning: #ffbf5b;
  --warning-soft: rgba(255, 191, 91, 0.14);
  --danger: #ff6f91;
  --danger-soft: rgba(255, 111, 145, 0.14);
  --info: #68a5ff;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
  --shadow-soft: 0 14px 36px rgba(0, 0, 0, 0.19);
  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --sidebar: 280px;
  --topbar: 82px;
  --font-scale: 1;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f6fc;
  --bg-deep: #e8eef9;
  --surface: #ffffff;
  --surface-2: #f7f9fd;
  --surface-3: #eaf0fa;
  --surface-soft: rgba(255, 255, 255, 0.84);
  --border: rgba(43, 63, 101, 0.12);
  --border-strong: rgba(43, 63, 101, 0.22);
  --text: #13203a;
  --muted: #607191;
  --muted-2: #8594af;
  --primary: #6351e8;
  --primary-2: #4f3ed1;
  --cyan: #078eaf;
  --cyan-soft: rgba(7, 142, 175, 0.1);
  --violet-soft: rgba(99, 81, 232, 0.1);
  --success: #0e9c6c;
  --success-soft: rgba(14, 156, 108, 0.1);
  --warning: #ad6b00;
  --warning-soft: rgba(218, 141, 21, 0.12);
  --danger: #d64064;
  --danger-soft: rgba(214, 64, 100, 0.1);
  --info: #3977cf;
  --shadow: 0 24px 70px rgba(39, 56, 91, 0.16);
  --shadow-soft: 0 12px 32px rgba(39, 56, 91, 0.1);
}

[data-contrast="high"] {
  --bg: #000;
  --bg-deep: #000;
  --surface: #090909;
  --surface-2: #111;
  --surface-3: #1b1b1b;
  --border: rgba(255, 255, 255, 0.38);
  --border-strong: rgba(255, 255, 255, 0.7);
  --text: #fff;
  --muted: #e6e6e6;
  --muted-2: #c5c5c5;
  --primary: #a799ff;
  --cyan: #64e8ff;
}

* {
  box-sizing: border-box;
}

html {
  font-size: calc(16px * var(--font-scale));
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 74% 2%, rgba(70, 76, 191, 0.2), transparent 28rem),
    radial-gradient(circle at 15% 78%, rgba(20, 146, 177, 0.09), transparent 32rem),
    var(--bg);
  color: var(--text);
  font-family: Tahoma, "Segoe UI", Arial, sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

button > svg,
.primary-btn > svg,
.secondary-btn > svg,
.ghost-btn > svg,
.danger-btn > svg,
.text-btn > svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.stat-icon > svg,
.row-icon > svg,
.search-result-icon > svg,
.capability-item svg {
  width: 20px;
  height: 20px;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
svg,
canvas {
  display: block;
  max-width: 100%;
}

button:not(:disabled),
[role="button"]:not([aria-disabled="true"]) {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 3px;
}

::selection {
  color: #fff;
  background: var(--primary);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 100px;
  background: color-mix(in srgb, var(--muted) 45%, transparent);
  background-clip: padding-box;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  z-index: 9999;
  inset-block-start: 12px;
  inset-inline-start: 50%;
  transform: translate(-50%, -180%);
  padding: 10px 18px;
  border-radius: 10px;
  background: var(--cyan);
  color: #03101b;
  font-weight: 800;
  transition: transform 0.2s ease;
}

.skip-link:focus {
  transform: translate(-50%, 0);
}

.app {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  z-index: 80;
  inset-block: 0;
  inset-inline-start: 0;
  width: var(--sidebar);
  display: flex;
  flex-direction: column;
  border-inline-end: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(14, 29, 61, 0.98), rgba(7, 15, 34, 0.99)),
    var(--surface);
  box-shadow: -12px 0 50px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .sidebar {
  background: rgba(255, 255, 255, 0.98);
}

.brand-wrap {
  min-height: 92px;
  display: flex;
  align-items: center;
  padding: 18px 22px 14px;
}

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

.brand-mark {
  position: relative;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--primary), #3b2f9f);
  box-shadow: 0 11px 28px rgba(97, 80, 232, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  overflow: hidden;
}

.brand-core {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 16px #fff;
}

.brand-orbit {
  position: absolute;
  width: 33px;
  height: 17px;
  border: 2px solid rgba(255, 255, 255, 0.78);
  border-radius: 50%;
  transform: rotate(-26deg);
}

.brand-orbit::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--cyan);
  inset-block-start: -2px;
  inset-inline-start: 7px;
  box-shadow: 0 0 10px var(--cyan);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-copy strong {
  font-size: 1.23rem;
  line-height: 1.25;
  letter-spacing: 0.01em;
}

.brand-copy small {
  max-width: 168px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.69rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-mini {
  margin: 0 16px 12px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
}

.role-mini-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 10px;
  background: var(--violet-soft);
}

.role-mini div {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.role-mini strong {
  font-size: 0.76rem;
}

.role-mini small {
  color: var(--muted);
  font-size: 0.68rem;
}

.side-nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 4px 14px 18px;
}

.nav-section-label {
  display: block;
  margin: 18px 12px 7px;
  color: var(--muted-2);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-link {
  position: relative;
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: start;
  transition: 0.18s ease;
}

.nav-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
}

.nav-link.active {
  color: #fff;
  background: linear-gradient(100deg, rgba(104, 85, 240, 0.88), rgba(70, 57, 181, 0.68));
  box-shadow: 0 10px 22px rgba(75, 57, 194, 0.22), inset 0 1px rgba(255, 255, 255, 0.1);
}

.nav-link.active::before {
  content: "";
  position: absolute;
  inset-block: 10px;
  inset-inline-start: -14px;
  width: 3px;
  border-radius: 20px;
  background: var(--cyan);
  box-shadow: 0 0 14px var(--cyan);
}

.nav-icon,
.dynamic-icon {
  width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
}

.nav-icon svg,
.dynamic-icon svg {
  width: 100%;
  height: 100%;
}

.nav-badge {
  margin-inline-start: auto;
  min-width: 22px;
  height: 20px;
  display: grid;
  place-items: center;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 0.66rem;
  font-weight: 800;
}

.sidebar-footer {
  padding: 12px 14px 18px;
  border-block-start: 1px solid var(--border);
}

.mini-card {
  display: flex;
  align-items: center;
  gap: 10px;
}

.session-card {
  margin-bottom: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--success-soft);
}

.session-card div {
  display: flex;
  flex-direction: column;
}

.session-card strong {
  font-size: 0.72rem;
}

.session-card small {
  color: var(--muted);
  font-size: 0.64rem;
}

.session-dot,
.online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 12px var(--success);
}

.qemamm-signature {
  margin-top: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--muted-2);
  font-size: 0.64rem;
}

.qemamm-signature strong {
  color: var(--muted);
}

.workspace {
  min-height: 100vh;
  margin-inline-start: var(--sidebar);
}

.topbar {
  position: sticky;
  z-index: 60;
  inset-block-start: 0;
  min-height: var(--topbar);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px clamp(18px, 2.6vw, 38px);
  border-block-end: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(20px) saturate(1.2);
}

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

.page-heading {
  min-width: 0;
}

.page-heading h1 {
  margin: 1px 0 0;
  font-size: clamp(1.05rem, 1.8vw, 1.35rem);
  line-height: 1.25;
}

.breadcrumbs {
  color: var(--muted-2);
  font-size: 0.67rem;
}

.icon-btn {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--muted);
  transition: 0.18s ease;
}

.icon-btn:hover {
  border-color: var(--border-strong);
  color: var(--text);
  transform: translateY(-1px);
}

.search-trigger {
  min-width: min(24vw, 320px);
  height: 43px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.76rem;
  text-align: start;
}

.search-trigger span:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

kbd {
  padding: 2px 6px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--muted);
  font: 600 0.65rem/1.4 ui-monospace, monospace;
  box-shadow: inset 0 -1px 0 var(--border);
}

.search-trigger kbd {
  margin-inline-start: auto;
}

.xp-pill {
  height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid rgba(255, 191, 91, 0.25);
  border-radius: 12px;
  background: var(--warning-soft);
  color: var(--warning);
  font-size: 0.74rem;
  font-weight: 800;
  white-space: nowrap;
}

.xp-star {
  font-size: 1rem;
  filter: drop-shadow(0 0 8px rgba(255, 191, 91, 0.5));
}

.notification-btn {
  position: relative;
}

.notification-count {
  position: absolute;
  inset-block-start: -5px;
  inset-inline-end: -5px;
  min-width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  padding: 0 4px;
  border: 2px solid var(--bg);
  border-radius: 999px;
  background: var(--danger);
  color: white;
  font-size: 0.59rem;
  font-weight: 800;
}

.role-switcher-wrap {
  position: relative;
}

.profile-trigger {
  height: 48px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 8px 4px 10px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  text-align: start;
}

.profile-trigger:hover {
  background: var(--surface-soft);
}

.avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 2px solid rgba(255, 255, 255, 0.14);
  border-radius: 13px;
  background: linear-gradient(145deg, var(--cyan), var(--primary));
  color: #fff;
  font-size: 0.82rem;
  font-weight: 900;
  box-shadow: 0 8px 20px rgba(74, 84, 210, 0.24);
}

.profile-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.profile-copy strong {
  max-width: 130px;
  overflow: hidden;
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-copy small {
  color: var(--muted);
  font-size: 0.62rem;
}

.chevron {
  width: 14px;
  height: 14px;
  color: var(--muted-2);
}

.profile-menu {
  position: absolute;
  z-index: 120;
  inset-block-start: calc(100% + 10px);
  inset-inline-end: 0;
  width: 245px;
  padding: 8px;
  border: 1px solid var(--border-strong);
  border-radius: 17px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

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

.profile-menu button {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 0.77rem;
  text-align: start;
}

.profile-menu button:hover {
  color: var(--text);
  background: var(--surface-2);
}

.menu-label {
  padding: 6px 10px 7px;
  color: var(--muted-2);
  font-size: 0.65rem;
  font-weight: 800;
}

.menu-divider {
  height: 1px;
  margin: 7px 4px;
  background: var(--border);
}

.main-content {
  width: 100%;
  max-width: 1700px;
  margin: 0 auto;
  padding: clamp(20px, 2.8vw, 38px);
}

.page-shell {
  animation: page-in 0.32s ease both;
}

@keyframes page-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.page-intro h2 {
  margin: 3px 0 4px;
  font-size: clamp(1.25rem, 2.2vw, 1.75rem);
  line-height: 1.3;
}

.page-intro p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.eyebrow {
  display: block;
  color: var(--cyan);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.intro-actions,
.card-actions,
.inline-actions,
.toolbar,
.filter-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.danger-btn,
.text-btn {
  min-height: 41px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 15px;
  border-radius: 11px;
  font-size: 0.76rem;
  font-weight: 800;
  transition: 0.18s ease;
}

.primary-btn {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(115deg, var(--primary), var(--primary-2));
  color: #fff;
  box-shadow: 0 10px 24px rgba(90, 71, 220, 0.24);
}

.primary-btn:hover,
.secondary-btn:hover,
.ghost-btn:hover,
.danger-btn:hover {
  transform: translateY(-1px);
}

.secondary-btn {
  border: 1px solid rgba(40, 200, 232, 0.26);
  background: var(--cyan-soft);
  color: var(--cyan);
}

.ghost-btn {
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--muted);
}

.ghost-btn:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.danger-btn {
  border: 1px solid rgba(255, 111, 145, 0.24);
  background: var(--danger-soft);
  color: var(--danger);
}

.text-btn {
  min-height: auto;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--cyan);
}

.wide {
  width: 100%;
}

.card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, color-mix(in srgb, var(--surface) 98%, #fff 2%), var(--surface));
  box-shadow: var(--shadow-soft);
}

.card.pad {
  padding: clamp(17px, 2vw, 24px);
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 16px;
}

.card-header h3,
.card h3 {
  margin: 0;
  font-size: 0.98rem;
}

.card-header p,
.card-subtitle {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
}

.grid {
  display: grid;
  gap: 17px;
}

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

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

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

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

.span-2 {
  grid-column: span 2;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.section-gap {
  margin-top: 22px;
}

.stat-card {
  min-height: 128px;
  padding: 18px;
  overflow: hidden;
}

.stat-card::after {
  content: "";
  position: absolute;
  width: 95px;
  height: 95px;
  inset-block-start: -42px;
  inset-inline-end: -32px;
  border-radius: 50%;
  background: var(--stat-color, var(--violet-soft));
  filter: blur(2px);
}

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

.stat-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--icon-bg, var(--violet-soft));
  color: var(--icon-color, var(--primary));
}

.stat-delta {
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--success-soft);
  color: var(--success);
  font-size: 0.62rem;
  font-weight: 800;
}

.stat-value {
  margin-top: 12px;
  font-size: 1.55rem;
  font-weight: 900;
  line-height: 1;
}

.stat-label {
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.69rem;
}

.hero-panel {
  position: relative;
  min-height: 310px;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  overflow: hidden;
  border: 1px solid rgba(128, 112, 255, 0.22);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 82% 30%, rgba(42, 207, 232, 0.2), transparent 18rem),
    radial-gradient(circle at 20% 10%, rgba(121, 103, 255, 0.34), transparent 24rem),
    linear-gradient(125deg, #172b5a, #0c1733 58%, #101b3d);
  box-shadow: var(--shadow);
}

.hero-panel::before,
.hero-panel::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.hero-panel::before {
  width: 3px;
  height: 3px;
  inset: 18% auto auto 11%;
  background: white;
  box-shadow: 68px 35px 0 rgba(255,255,255,.6), 194px -7px 0 rgba(255,255,255,.7), 362px 56px 0 rgba(255,255,255,.4), 525px 9px 0 white, 713px 64px 0 rgba(255,255,255,.55), 808px 8px 0 white, 930px 82px 0 rgba(255,255,255,.4);
}

.hero-panel::after {
  width: 420px;
  height: 420px;
  inset-block-end: -330px;
  inset-inline-start: 22%;
  border: 1px solid rgba(119, 105, 255, 0.22);
}

.hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(25px, 4vw, 48px);
}

.hero-content h2 {
  max-width: 650px;
  margin: 8px 0 9px;
  color: #fff;
  font-size: clamp(1.65rem, 3.4vw, 2.65rem);
  line-height: 1.28;
}

.hero-content p {
  max-width: 620px;
  margin: 0;
  color: #b8c6e4;
  font-size: clamp(0.82rem, 1.25vw, 0.96rem);
}

.hero-kicker {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border: 1px solid rgba(81, 221, 241, 0.22);
  border-radius: 999px;
  background: rgba(28, 185, 214, 0.1);
  color: #5ae0f2;
  font-size: 0.67rem;
  font-weight: 900;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.hero-actions .primary-btn {
  min-height: 46px;
  padding-inline: 19px;
}

.hero-visual {
  position: relative;
  z-index: 1;
  min-height: 280px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.hero-planet {
  position: relative;
  width: clamp(190px, 22vw, 270px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 28%, rgba(255,255,255,.72), transparent 4%),
    radial-gradient(circle at 60% 62%, rgba(19, 42, 103, .7), transparent 29%),
    linear-gradient(145deg, #5ee0e9, #3777e8 48%, #5544c4 77%);
  box-shadow: inset -38px -30px 70px rgba(10, 18, 60, 0.62), 0 0 70px rgba(62, 125, 238, 0.26);
}

.hero-planet::before {
  content: "";
  position: absolute;
  width: 150%;
  height: 44%;
  border: 9px solid rgba(160, 201, 255, 0.35);
  border-inline-color: rgba(134, 104, 255, 0.68);
  border-radius: 50%;
  transform: rotate(-16deg);
  box-shadow: 0 0 35px rgba(111, 89, 238, 0.22);
}

.hero-planet span {
  position: relative;
  z-index: 2;
  color: rgba(255, 255, 255, 0.86);
  font-size: 4.2rem;
  filter: drop-shadow(0 8px 15px rgba(0,0,0,.2));
}

.float-label {
  position: absolute;
  z-index: 3;
  min-width: 142px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 14px;
  background: rgba(8, 19, 46, 0.72);
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  backdrop-filter: blur(14px);
}

.float-label strong,
.float-label small {
  display: block;
}

.float-label strong {
  color: #fff;
  font-size: 0.76rem;
}

.float-label small {
  color: #aebddc;
  font-size: 0.62rem;
}

.float-one { inset-block-start: 17%; inset-inline-start: 2%; }
.float-two { inset-block-end: 17%; inset-inline-end: 3%; }

.progress {
  height: 7px;
  overflow: hidden;
  border-radius: 99px;
  background: color-mix(in srgb, var(--surface-3) 80%, transparent);
}

.progress > span {
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--cyan));
  box-shadow: 0 0 12px rgba(40, 200, 232, 0.28);
  transition: width 0.35s ease;
}

.progress.success > span { background: var(--success); }
.progress.warning > span { background: var(--warning); }

.progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.progress-row .progress {
  flex: 1;
}

.progress-label {
  color: var(--muted);
  font-size: 0.66rem;
  white-space: nowrap;
}

.world-card {
  min-height: 190px;
  padding: 18px;
  overflow: hidden;
  transition: 0.2s ease;
}

.world-card:hover {
  transform: translateY(-3px);
  border-color: var(--world-color, var(--primary));
}

.world-card::after {
  content: "";
  position: absolute;
  width: 130px;
  height: 130px;
  inset-block-start: -58px;
  inset-inline-end: -45px;
  border-radius: 50%;
  background: var(--world-glow, var(--violet-soft));
  filter: blur(4px);
}

.world-icon {
  position: relative;
  z-index: 2;
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--world-glow, var(--violet-soft));
  font-size: 1.45rem;
}

.world-card h3 {
  margin: 14px 0 4px;
}

.world-card p {
  min-height: 40px;
  margin: 0 0 13px;
  color: var(--muted);
  font-size: 0.69rem;
}

.world-meta,
.meta-row,
.lesson-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 13px;
  color: var(--muted);
  font-size: 0.66rem;
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.badge,
.status,
.tag {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 800;
  white-space: nowrap;
}

.status.success,
.tag.success { border-color: rgba(54,212,154,.2); background: var(--success-soft); color: var(--success); }
.status.warning,
.tag.warning { border-color: rgba(255,191,91,.2); background: var(--warning-soft); color: var(--warning); }
.status.danger,
.tag.danger { border-color: rgba(255,111,145,.2); background: var(--danger-soft); color: var(--danger); }
.status.info,
.tag.info { border-color: rgba(104,165,255,.2); background: rgba(104,165,255,.11); color: var(--info); }
.status.purple,
.tag.purple { border-color: rgba(121,103,255,.22); background: var(--violet-soft); color: #a99cff; }

.lesson-list,
.task-list,
.activity-list,
.simple-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lesson-row,
.task-row,
.activity-row,
.simple-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: var(--surface-2);
  transition: 0.18s ease;
}

.lesson-row:hover,
.task-row:hover,
.simple-row:hover {
  border-color: var(--border-strong);
  background: var(--surface-3);
}

.row-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 13px;
  background: var(--violet-soft);
  color: var(--primary);
}

.row-main {
  flex: 1;
  min-width: 0;
}

.row-main strong {
  display: block;
  overflow: hidden;
  font-size: 0.77rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-main small {
  display: block;
  color: var(--muted);
  font-size: 0.65rem;
}

.row-tail {
  display: flex;
  align-items: center;
  gap: 9px;
}

.check-control {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  background: transparent;
  color: transparent;
}

.task-row.done .check-control {
  border-color: var(--success);
  background: var(--success);
  color: #062319;
}

.task-row.done .row-main strong {
  color: var(--muted);
  text-decoration: line-through;
}

.chart-bars {
  height: 175px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 8px;
  padding: 16px 4px 0;
  border-block-end: 1px solid var(--border);
  background: repeating-linear-gradient(to top, transparent 0, transparent 39px, var(--border) 40px);
}

.bar-group {
  height: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: end;
  gap: 6px;
}

.bar {
  width: min(28px, 72%);
  min-height: 5px;
  border-radius: 8px 8px 3px 3px;
  background: linear-gradient(to top, var(--primary), var(--cyan));
  box-shadow: 0 0 18px rgba(75, 151, 235, 0.16);
}

.bar-group.active .bar {
  background: linear-gradient(to top, var(--warning), #ffe1a6);
}

.bar-group small {
  color: var(--muted-2);
  font-size: 0.59rem;
}

.donut {
  --value: 70;
  --donut-color: var(--primary);
  width: 126px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--donut-color) calc(var(--value) * 1%), var(--surface-3) 0);
  position: relative;
}

.donut::after {
  content: "";
  position: absolute;
  width: 78%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--surface);
}

.donut-content {
  position: relative;
  z-index: 1;
  text-align: center;
}

.donut-content strong {
  display: block;
  font-size: 1.25rem;
  line-height: 1.1;
}

.donut-content small {
  color: var(--muted);
  font-size: 0.59rem;
}

.ring-layout {
  display: flex;
  align-items: center;
  gap: 20px;
}

.legend-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.legend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.67rem;
}

.legend-label {
  display: flex;
  align-items: center;
  gap: 7px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dot-color, var(--primary));
}

.timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.timeline::before {
  content: "";
  position: absolute;
  inset-block: 22px;
  inset-inline-start: 20px;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 11px 0;
}

.timeline-dot {
  z-index: 1;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  justify-self: center;
  border: 3px solid var(--surface);
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--muted);
  font-size: 0.67rem;
}

.timeline-item.done .timeline-dot { background: var(--success); color: #062319; }
.timeline-item.current .timeline-dot { background: var(--primary); color: #fff; box-shadow: 0 0 0 5px var(--violet-soft); }

.timeline-main strong {
  display: block;
  font-size: 0.76rem;
}

.timeline-main small {
  color: var(--muted);
  font-size: 0.65rem;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 15px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.72rem;
}

th,
td {
  padding: 12px 13px;
  border-block-end: 1px solid var(--border);
  text-align: start;
  white-space: nowrap;
}

th {
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 800;
}

tbody tr:last-child td {
  border-block-end: 0;
}

tbody tr:hover td {
  background: color-mix(in srgb, var(--surface-2) 72%, transparent);
}

.person-cell {
  display: flex;
  align-items: center;
  gap: 9px;
}

.mini-avatar {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--violet-soft);
  color: #aaa0ff;
  font-size: 0.66rem;
  font-weight: 900;
}

.heatmap {
  display: grid;
  grid-template-columns: minmax(105px, 1.4fr) repeat(6, minmax(38px, 0.6fr));
  gap: 6px;
  align-items: center;
  overflow-x: auto;
}

.heat-cell {
  min-width: 38px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.59rem;
  font-weight: 800;
}

.heat-cell.label {
  justify-content: start;
  padding-inline: 7px;
  background: transparent;
  font-size: 0.63rem;
}

.heat-cell.hi { background: rgba(54,212,154,.2); color: #71e8bb; }
.heat-cell.mid { background: rgba(255,191,91,.2); color: #ffd58c; }
.heat-cell.low { background: rgba(255,111,145,.18); color: #ff9bb2; }
.heat-cell.head { background: var(--surface-3); color: var(--text); }

.tabs {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface-2);
  overflow-x: auto;
}

.tabs button {
  min-height: 35px;
  padding: 6px 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 0.69rem;
  white-space: nowrap;
}

.tabs button.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 5px 16px rgba(0,0,0,.12);
}

.field,
.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label,
.form-field label {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
}

input,
textarea,
select {
  width: 100%;
  min-height: 43px;
  padding: 9px 11px;
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  outline: 0;
  background: var(--surface-2);
  color: var(--text);
}

textarea {
  min-height: 95px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--violet-soft);
}

input::placeholder,
textarea::placeholder {
  color: var(--muted-2);
}

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

.switch-row {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 10px 0;
  border-block-end: 1px solid var(--border);
}

.switch-row:last-child {
  border-block-end: 0;
}

.switch-copy strong,
.switch-copy small {
  display: block;
}

.switch-copy strong {
  font-size: 0.75rem;
}

.switch-copy small {
  color: var(--muted);
  font-size: 0.64rem;
}

.switch {
  position: relative;
  width: 45px;
  height: 25px;
  flex: 0 0 auto;
}

.switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--surface-3);
  transition: 0.2s ease;
}

.switch span::after {
  content: "";
  position: absolute;
  width: 19px;
  height: 19px;
  inset-block-start: 3px;
  inset-inline-start: 3px;
  border-radius: 50%;
  background: var(--muted);
  transition: 0.2s ease;
}

.switch input:checked + span {
  background: var(--primary);
}

.switch input:checked + span::after {
  inset-inline-start: 23px;
  background: #fff;
}

.range-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

input[type="range"] {
  min-height: auto;
  padding: 0;
  border: 0;
  accent-color: var(--primary);
  background: transparent;
}

.range-value {
  min-width: 72px;
  padding: 6px 8px;
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--cyan);
  font-size: 0.69rem;
  font-weight: 800;
  text-align: center;
}

.lesson-hero {
  position: relative;
  min-height: 270px;
  overflow: hidden;
  padding: clamp(25px, 4vw, 44px);
  border: 1px solid rgba(40, 200, 232, 0.19);
  border-radius: 28px;
  background:
    radial-gradient(circle at 78% 40%, rgba(27, 192, 220, 0.2), transparent 18rem),
    linear-gradient(125deg, #142b57, #0c1833);
}

.lesson-hero::after {
  content: "";
  position: absolute;
  width: 330px;
  height: 330px;
  inset-block-end: -210px;
  inset-inline-end: 7%;
  border: 36px solid rgba(72, 202, 225, 0.08);
  border-radius: 50%;
}

.lesson-hero-content {
  position: relative;
  z-index: 2;
  max-width: 750px;
}

.lesson-hero h2 {
  margin: 8px 0;
  color: #fff;
  font-size: clamp(1.6rem, 3vw, 2.35rem);
}

.lesson-hero p {
  margin: 0 0 18px;
  color: #b6c5e1;
  font-size: 0.84rem;
}

.objective-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.objective-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,.025);
  color: var(--muted);
  font-size: 0.7rem;
}

.objective-list li::before {
  content: "✓";
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--success-soft);
  color: var(--success);
  font-size: 0.62rem;
  font-weight: 900;
}

.video-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 18px;
}

.video-shell {
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 22px;
  background: #030815;
  box-shadow: var(--shadow);
}

.video-stage {
  position: relative;
  min-height: min(53vw, 550px);
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 72% 26%, rgba(43, 208, 227, .14), transparent 18rem),
    linear-gradient(145deg, #0e2451, #050a18 60%);
}

.video-scene {
  position: relative;
  width: 68%;
  max-width: 620px;
  height: 70%;
}

.tank {
  position: absolute;
  width: 40%;
  height: 72%;
  inset-block-end: 7%;
  inset-inline-start: 12%;
  overflow: hidden;
  border: 4px solid rgba(188, 227, 255, 0.6);
  border-block-start: 0;
  border-radius: 0 0 20px 20px;
  box-shadow: inset 0 -10px 30px rgba(36, 172, 218, 0.15), 0 15px 40px rgba(0,0,0,.2);
}

.tank-water {
  position: absolute;
  inset-inline: 0;
  inset-block-end: 0;
  height: 72%;
  background: linear-gradient(rgba(41, 211, 235, 0.42), rgba(39, 114, 223, 0.66));
}

.tank-water::before {
  content: "";
  position: absolute;
  inset-block-start: -7px;
  inset-inline: -7%;
  height: 14px;
  border-radius: 50%;
  background: #58dceb;
  opacity: 0.7;
}

.pressure-arrows {
  position: absolute;
  inset: 0;
}

.pressure-arrows span {
  position: absolute;
  inset-inline-end: 22%;
  width: var(--arrow-width, 30%);
  height: 3px;
  border-radius: 4px;
  background: var(--warning);
  transform-origin: right;
  animation: arrow-pulse 1.8s ease-in-out infinite;
}

.pressure-arrows span::before {
  content: "";
  position: absolute;
  inset-inline-start: -1px;
  inset-block-start: -4px;
  border-block: 5px solid transparent;
  border-inline-end: 8px solid var(--warning);
}

.pressure-arrows span:nth-child(1) { inset-block-start: 28%; --arrow-width: 20%; }
.pressure-arrows span:nth-child(2) { inset-block-start: 50%; --arrow-width: 31%; animation-delay: .15s; }
.pressure-arrows span:nth-child(3) { inset-block-start: 72%; --arrow-width: 43%; animation-delay: .3s; }

@keyframes arrow-pulse {
  0%, 100% { opacity: .55; transform: scaleX(.92); }
  50% { opacity: 1; transform: scaleX(1); }
}

.video-formula {
  position: absolute;
  inset-block-start: 12%;
  inset-inline-end: 4%;
  padding: 10px 16px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 13px;
  background: rgba(7, 16, 39, .72);
  color: #fff;
  font: 800 clamp(1.1rem, 2vw, 1.65rem)/1.2 ui-monospace, monospace;
  direction: ltr;
  backdrop-filter: blur(10px);
}

.video-caption {
  position: absolute;
  inset-block-end: 18px;
  inset-inline: 10%;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(0,0,0,.72);
  color: #fff;
  font-size: clamp(.72rem, 1.3vw, .9rem);
  text-align: center;
}

.play-center {
  position: absolute;
  z-index: 4;
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 50%;
  background: rgba(105, 85, 239, .88);
  color: #fff;
  box-shadow: 0 0 0 12px rgba(105,85,239,.14), 0 18px 40px rgba(0,0,0,.3);
  font-size: 1.4rem;
  transition: .18s ease;
}

.play-center:hover { transform: scale(1.05); }
.video-stage.playing .play-center { opacity: 0; pointer-events: none; }

.video-controls {
  padding: 11px 14px 13px;
  background: #071126;
}

.video-progress {
  position: relative;
  height: 7px;
  margin-bottom: 10px;
  border-radius: 99px;
  background: #1c2b48;
}

.video-progress span {
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--cyan));
}

.video-cue {
  position: absolute;
  inset-block-start: 50%;
  width: 12px;
  height: 12px;
  border: 2px solid #071126;
  border-radius: 50%;
  background: var(--warning);
  transform: translate(50%, -50%);
  box-shadow: 0 0 10px rgba(255,191,91,.7);
}

.video-control-row {
  display: flex;
  align-items: center;
  gap: 11px;
  color: #b8c8e5;
}

.video-control-row button {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: inherit;
}

.video-control-row button:hover { background: rgba(255,255,255,.07); color: #fff; }
.video-time { font: .68rem ui-monospace, monospace; direction: ltr; }
.video-spacer { flex: 1; }

.chapter-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chapter-btn {
  width: 100%;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--muted);
  text-align: start;
}

.chapter-btn.active {
  border-color: rgba(121,103,255,.3);
  background: var(--violet-soft);
  color: var(--text);
}

.chapter-time {
  font: .62rem ui-monospace, monospace;
  direction: ltr;
}

.chapter-main strong,
.chapter-main small { display: block; }
.chapter-main strong { font-size: .69rem; }
.chapter-main small { color: var(--muted); font-size: .6rem; }

.lab-layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 18px;
}

.lab-controls {
  align-self: start;
  position: sticky;
  inset-block-start: calc(var(--topbar) + 18px);
}

.control-block {
  padding: 15px 0;
  border-block-end: 1px solid var(--border);
}

.control-block:first-of-type { padding-block-start: 0; }
.control-block:last-of-type { border-block-end: 0; }

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

.control-head strong { font-size: .72rem; }
.control-head output { color: var(--cyan); font: 800 .7rem ui-monospace, monospace; direction: ltr; }

.lab-stage {
  min-height: 500px;
  display: grid;
  grid-template-rows: minmax(300px, 1fr) auto;
  overflow: hidden;
}

.lab-scene {
  position: relative;
  min-height: 340px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 52% 45%, rgba(37, 188, 225, .12), transparent 22rem),
    linear-gradient(145deg, #0c2149, #071128);
}

.lab-tank {
  position: relative;
  width: min(54%, 430px);
  height: 250px;
  overflow: hidden;
  border: 5px solid rgba(180, 223, 255, .56);
  border-block-start: 0;
  border-radius: 0 0 24px 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,.28), inset 0 -20px 45px rgba(35,142,218,.13);
}

.lab-liquid {
  position: absolute;
  inset-inline: 0;
  inset-block-end: 0;
  height: 82%;
  background: linear-gradient(rgba(40, 210, 232, .44), rgba(44, 102, 213, .78));
  transition: background .25s ease;
}

.lab-liquid::before {
  content: "";
  position: absolute;
  inset-block-start: -8px;
  inset-inline: -5%;
  height: 16px;
  border-radius: 50%;
  background: rgba(92, 225, 240, .82);
}

.depth-marker {
  position: absolute;
  inset-inline-end: 8%;
  width: 44%;
  border-block-start: 2px dashed var(--warning);
  color: var(--warning);
  transition: inset-block-start .25s ease;
}

.depth-marker::before,
.depth-marker::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  inset-block-start: -5px;
  border-radius: 50%;
  background: var(--warning);
  box-shadow: 0 0 12px rgba(255,191,91,.8);
}

.depth-marker::before { inset-inline-start: 0; }
.depth-marker::after { inset-inline-end: 0; }

.depth-label {
  position: absolute;
  inset-block-start: -31px;
  inset-inline-end: 0;
  padding: 3px 7px;
  border-radius: 7px;
  background: rgba(7,17,40,.8);
  font: .64rem ui-monospace, monospace;
  direction: ltr;
}

.sensor {
  position: absolute;
  inset-inline-start: 23%;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 8px rgba(255,111,145,.14), 0 0 25px rgba(255,111,145,.5);
  transition: inset-block-start .25s ease;
}

.sensor::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
}

.lab-reading {
  position: absolute;
  inset-block-start: 25px;
  inset-inline-end: 25px;
  min-width: 180px;
  padding: 14px 16px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 15px;
  background: rgba(5, 14, 35, .75);
  backdrop-filter: blur(12px);
}

.lab-reading small { display: block; color: #9fb3d5; font-size: .63rem; }
.lab-reading strong { display: block; margin-top: 3px; color: #fff; font: 900 1.4rem ui-monospace, monospace; direction: ltr; }
.lab-reading span { color: var(--cyan); font-size: .65rem; }

.formula-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--border);
  border-block-start: 1px solid var(--border);
}

.formula-cell {
  padding: 13px;
  background: var(--surface-2);
  text-align: center;
}

.formula-cell strong { display: block; font: 800 .86rem ui-monospace, monospace; direction: ltr; }
.formula-cell small { color: var(--muted); font-size: .59rem; }

.chart-canvas-wrap {
  position: relative;
  min-height: 235px;
}

#lab-chart {
  width: 100%;
  height: 235px;
}

.quiz-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 18px;
}

.question-card {
  padding: clamp(20px, 3vw, 30px);
}

.question-count {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: .7rem;
}

.question-title {
  margin: 0 0 20px;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  line-height: 1.7;
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option-label {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  min-height: 54px;
  padding: 10px 13px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: .76rem;
  cursor: pointer;
  transition: .16s ease;
}

.option-label:hover { border-color: var(--border-strong); color: var(--text); }
.option-label.selected { border-color: var(--primary); background: var(--violet-soft); color: var(--text); }
.option-label.correct { border-color: var(--success); background: var(--success-soft); color: var(--success); }
.option-label.wrong { border-color: var(--danger); background: var(--danger-soft); color: var(--danger); }

.option-label input { position: absolute; opacity: 0; pointer-events: none; }

.option-key {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: var(--surface);
  font-size: .66rem;
  font-weight: 800;
}

.question-nav {
  display: grid;
  grid-template-columns: repeat(5, minmax(34px, 1fr));
  gap: 7px;
}

.question-nav button {
  aspect-ratio: 1;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: .66rem;
}

.question-nav button.current { border-color: var(--primary); background: var(--violet-soft); color: #b8afff; }
.question-nav button.answered { border-color: rgba(54,212,154,.25); background: var(--success-soft); color: var(--success); }

.result-hero {
  position: relative;
  min-height: 270px;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 30px;
  text-align: center;
}

.result-hero::before {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  border: 55px solid var(--violet-soft);
  border-radius: 50%;
}

.result-content { position: relative; z-index: 2; }
.result-icon { font-size: 3rem; filter: drop-shadow(0 10px 22px rgba(255,191,91,.28)); }
.result-content h2 { margin: 5px 0; font-size: 1.6rem; }
.result-score { color: var(--cyan); font-size: 2rem; font-weight: 900; }
.result-content p { max-width: 560px; margin: 6px auto 18px; color: var(--muted); font-size: .77rem; }

.mission-card {
  min-height: 225px;
  padding: 19px;
  overflow: hidden;
}

.mission-visual {
  height: 92px;
  display: grid;
  place-items: center;
  margin: -19px -19px 15px;
  background: var(--mission-bg, linear-gradient(120deg, rgba(121,103,255,.25), rgba(40,200,232,.15)));
  font-size: 2.2rem;
}

.badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}

.achievement {
  min-height: 185px;
  padding: 17px;
  text-align: center;
}

.achievement.locked { filter: grayscale(.8); opacity: .62; }
.achievement-icon { width: 68px; height: 68px; display: grid; place-items: center; margin: 0 auto 11px; border-radius: 22px; background: var(--warning-soft); font-size: 2rem; box-shadow: inset 0 0 0 1px rgba(255,191,91,.18); }
.achievement h3 { font-size: .78rem; }
.achievement p { margin: 4px 0 10px; color: var(--muted); font-size: .62rem; }

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(60px, 1fr));
  gap: 7px;
  min-width: 610px;
}

.calendar-day {
  min-height: 86px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface-2);
}

.calendar-day.muted { opacity: .42; }
.calendar-day.today { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.calendar-date { font-size: .65rem; font-weight: 800; }
.calendar-event { margin-top: 6px; padding: 4px 5px; border-radius: 6px; background: var(--violet-soft); color: #aaa0ff; font-size: .55rem; white-space: normal; }
.calendar-event.cyan { background: var(--cyan-soft); color: var(--cyan); }

.pipeline {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 12px;
  overflow-x: auto;
}

.pipeline-column {
  min-width: 160px;
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-2);
}

.pipeline-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: .67rem;
  font-weight: 800;
}

.pipeline-count { min-width: 22px; height: 22px; display: grid; place-items: center; border-radius: 7px; background: var(--surface-3); color: var(--text); }

.content-ticket {
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  box-shadow: 0 8px 20px rgba(0,0,0,.08);
}

.content-ticket + .content-ticket { margin-top: 8px; }
.content-ticket strong { display: block; font-size: .67rem; }
.content-ticket small { color: var(--muted); font-size: .57rem; }
.ticket-footer { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-top: 9px; }

.audit-line {
  position: relative;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  padding: 11px 0;
  border-block-end: 1px solid var(--border);
}

.audit-line:last-child { border-block-end: 0; }
.audit-main strong { display: block; font-size: .7rem; }
.audit-main small { color: var(--muted); font-size: .61rem; }
.audit-time { color: var(--muted-2); font-size: .59rem; }

.empty-state {
  min-height: 250px;
  display: grid;
  place-items: center;
  padding: 30px;
  text-align: center;
}

.empty-icon { font-size: 2.8rem; }
.empty-state h3 { margin: 8px 0 4px; }
.empty-state p { max-width: 440px; margin: 0 0 15px; color: var(--muted); font-size: .72rem; }

.callout {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 14px;
  border: 1px solid rgba(104,165,255,.22);
  border-radius: 13px;
  background: rgba(104,165,255,.09);
  color: var(--muted);
  font-size: .7rem;
}

.callout strong { display: block; color: var(--text); font-size: .72rem; }
.callout.success { border-color: rgba(54,212,154,.22); background: var(--success-soft); }
.callout.warning { border-color: rgba(255,191,91,.22); background: var(--warning-soft); }
.callout.danger { border-color: rgba(255,111,145,.22); background: var(--danger-soft); }

.astroguide-fab {
  position: fixed;
  z-index: 75;
  inset-inline-end: calc(var(--sidebar) + 25px);
  inset-block-end: 24px;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 15px 8px 11px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 16px;
  background: linear-gradient(125deg, #6c57ee, #303f9f);
  color: #fff;
  box-shadow: 0 16px 40px rgba(51, 48, 148, .4);
  font-size: .73rem;
  font-weight: 900;
}

.guide-icon {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(255,255,255,.13);
  font-size: 1.1rem;
}

.guide-pulse {
  position: absolute;
  inset: -1px;
  border: 1px solid rgba(121,103,255,.6);
  border-radius: 16px;
  animation: fab-pulse 2.2s ease-out infinite;
  pointer-events: none;
}

@keyframes fab-pulse {
  0% { opacity: .8; transform: scale(1); }
  75%, 100% { opacity: 0; transform: scale(1.12); }
}

.drawer {
  position: fixed;
  z-index: 210;
  inset-block: 0;
  inset-inline-end: 0;
  width: min(430px, 94vw);
  display: flex;
  flex-direction: column;
  border-inline-start: 1px solid var(--border-strong);
  background: var(--surface);
  box-shadow: var(--shadow);
  transform: translateX(110%);
  transition: transform .25s ease;
}

[dir="rtl"] .drawer {
  transform: translateX(-110%);
}

.drawer.open,
[dir="rtl"] .drawer.open { transform: translateX(0); }

.drawer header {
  min-height: 84px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-block-end: 1px solid var(--border);
}

.drawer header > div:nth-child(1),
.drawer header > div:nth-child(2) { flex: 1; }
.drawer header h2 { margin: 2px 0 0; font-size: 1.15rem; }
.drawer-close { margin-inline-start: auto; font-size: 1.25rem; }
.drawer-tools { padding: 10px 18px; border-block-end: 1px solid var(--border); }

.notification-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px 15px 20px;
}

.notification-item {
  position: relative;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 11px;
  padding: 13px 10px;
  border-block-end: 1px solid var(--border);
}

.notification-item.unread::after {
  content: "";
  position: absolute;
  inset-block-start: 19px;
  inset-inline-end: 2px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
}

.notification-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: var(--violet-soft); }
.notification-copy strong { display: block; padding-inline-end: 10px; font-size: .73rem; }
.notification-copy p { margin: 3px 0; color: var(--muted); font-size: .65rem; }
.notification-copy small { color: var(--muted-2); font-size: .58rem; }

.guide-header .guide-avatar {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  flex: 0 0 auto !important;
  border-radius: 16px;
  background: linear-gradient(145deg, var(--primary), #2b3d9d);
  font-size: 1.4rem;
  box-shadow: 0 10px 24px rgba(91,71,219,.3);
}

.guide-header small { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .62rem; }
.guide-header .online-dot { display: inline-block; }

.guide-context {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 15px 0;
  padding: 9px 11px;
  border: 1px solid rgba(40,200,232,.19);
  border-radius: 11px;
  background: var(--cyan-soft);
  color: var(--cyan);
  font-size: .65rem;
}

.chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 11px;
  padding: 17px;
}

.chat-message {
  max-width: 88%;
  padding: 10px 12px;
  border-radius: 14px 14px 4px 14px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: .7rem;
  line-height: 1.75;
}

.chat-message.user {
  align-self: flex-start;
  border-radius: 14px 14px 14px 4px;
  background: var(--violet-soft);
  color: var(--text);
}

.chat-message.guide {
  align-self: flex-end;
  border: 1px solid var(--border);
}

.chat-message small { display: block; margin-top: 5px; color: var(--muted-2); font-size: .55rem; }

.prompt-chips {
  display: flex;
  gap: 7px;
  padding: 0 15px 10px;
  overflow-x: auto;
}

.prompt-chips button {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: .59rem;
}

.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 8px;
  padding: 12px 15px;
  border-block-start: 1px solid var(--border);
}

.chat-form textarea {
  min-height: 42px;
  max-height: 105px;
  resize: none;
}

.send-btn {
  height: 42px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 12px;
  background: var(--primary);
  color: white;
}

.ai-disclaimer { margin: 0; padding: 0 16px 12px; color: var(--muted-2); font-size: .55rem; text-align: center; }

.overlay {
  position: fixed;
  z-index: 200;
  inset: 0;
  background: rgba(2, 6, 17, .62);
  backdrop-filter: blur(3px);
}

.overlay[hidden] { display: none; }

dialog {
  color: var(--text);
}

dialog::backdrop {
  background: rgba(2, 6, 17, .72);
  backdrop-filter: blur(7px);
}

.search-dialog {
  width: min(680px, calc(100vw - 28px));
  max-height: min(680px, calc(100vh - 40px));
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.search-head {
  min-height: 66px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 15px;
  border-block-end: 1px solid var(--border);
}

.search-head input {
  min-height: auto;
  padding: 7px 3px;
  border: 0;
  background: transparent;
  box-shadow: none;
  font-size: .87rem;
}

.key-close {
  padding: 3px 7px;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--muted);
  font: .6rem ui-monospace, monospace;
}

.search-scope {
  display: flex;
  gap: 7px;
  padding: 10px 15px;
  border-block-end: 1px solid var(--border);
  overflow-x: auto;
}

.search-scope button {
  min-height: 30px;
  padding: 4px 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: .62rem;
}

.search-scope button.active { border-color: rgba(121,103,255,.28); background: var(--violet-soft); color: #b4abff; }

.search-results {
  min-height: 210px;
  max-height: 440px;
  overflow-y: auto;
  padding: 8px;
}

.search-result {
  width: 100%;
  display: grid;
  grid-template-columns: 39px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  text-align: start;
}

.search-result:hover,
.search-result.selected { border-color: var(--border); background: var(--surface-2); color: var(--text); }
.search-result-icon { width: 37px; height: 37px; display: grid; place-items: center; border-radius: 11px; background: var(--violet-soft); }
.search-result strong, .search-result small { display: block; }
.search-result strong { font-size: .7rem; }
.search-result small { color: var(--muted); font-size: .6rem; }
.search-result .tag { font-size: .54rem; }
.search-dialog footer { padding: 9px 15px; border-block-start: 1px solid var(--border); color: var(--muted-2); font-size: .58rem; }

.modal {
  width: min(610px, calc(100vw - 28px));
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  padding: clamp(20px, 3vw, 30px);
  border: 1px solid var(--border-strong);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.modal-x {
  position: absolute;
  inset-block-start: 13px;
  inset-inline-end: 13px;
  font-size: 1.2rem;
}

.modal-hero-icon {
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  margin-bottom: 12px;
  border-radius: 19px;
  background: var(--violet-soft);
  font-size: 1.7rem;
}

.modal h2 { margin: 0 0 5px; font-size: 1.25rem; }
.modal-lead { margin: 0 0 18px; color: var(--muted); font-size: .72rem; }

.onboarding {
  width: min(880px, calc(100vw - 28px));
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(121,103,255,.32);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.onboarding[open] {
  display: grid;
  grid-template-columns: .85fr 1.15fr;
}

.onboarding-visual {
  position: relative;
  min-height: 470px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 40% 35%, rgba(49,217,232,.2), transparent 14rem),
    linear-gradient(145deg, #182b5a, #0a132d);
}

.onboarding-visual::before {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  border: 1px solid rgba(121,103,255,.24);
  border-radius: 50%;
}

.planet-large {
  position: relative;
  z-index: 2;
  width: 170px;
  height: 170px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, #45d4e6, #4a71df 50%, #5e40bd);
  box-shadow: inset -25px -25px 50px rgba(10,18,65,.5), 0 0 80px rgba(59,140,222,.3);
}

.planet-large::after {
  content: "";
  position: absolute;
  width: 155%;
  height: 42%;
  border: 8px solid rgba(182,202,255,.43);
  border-radius: 50%;
  transform: rotate(-18deg);
}

.planet-large span { position: relative; z-index: 2; font-size: 3rem; }

.orbit-dot { position: absolute; z-index: 3; width: 12px; height: 12px; border-radius: 50%; background: var(--warning); box-shadow: 0 0 15px var(--warning); }
.orbit-dot.one { inset-block-start: 18%; inset-inline-end: 25%; }
.orbit-dot.two { inset-block-end: 21%; inset-inline-start: 18%; width: 8px; height: 8px; background: var(--cyan); }
.orbit-dot.three { inset-block-start: 34%; inset-inline-start: 17%; width: 6px; height: 6px; background: #fff; }

.onboarding-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(28px, 5vw, 50px);
}

.onboarding-content h2 { margin: 7px 0 9px; font-size: clamp(1.45rem, 3vw, 2.1rem); line-height: 1.35; }
.onboarding-content > p { margin: 0; color: var(--muted); font-size: .78rem; }

.tour-points {
  display: grid;
  gap: 10px;
  margin: 22px 0;
}

.tour-points > div {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 0 10px;
  align-items: center;
  padding: 9px;
  border-radius: 12px;
  background: var(--surface-2);
}

.tour-points span {
  grid-row: span 2;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--violet-soft);
  color: #b3a9ff;
  font-size: .7rem;
  font-weight: 900;
}

.tour-points strong { font-size: .7rem; }
.tour-points small { color: var(--muted); font-size: .6rem; }

.toast-stack {
  position: fixed;
  z-index: 999;
  inset-block-end: 22px;
  inset-inline-start: 22px;
  width: min(360px, calc(100vw - 30px));
  display: flex;
  flex-direction: column;
  gap: 9px;
  pointer-events: none;
}

.toast {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
  animation: toast-in .25s ease both;
  pointer-events: auto;
}

@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }
.toast.out { animation: toast-out .2s ease both; }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }
.toast-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; background: var(--success-soft); }
.toast.warning .toast-icon { background: var(--warning-soft); }
.toast.error .toast-icon { background: var(--danger-soft); }
.toast strong { display: block; font-size: .67rem; }
.toast small { display: block; color: var(--muted); font-size: .58rem; }
.toast button { border: 0; background: transparent; color: var(--muted); }

.mobile-nav,
.mobile-only {
  display: none;
}

.mobile-backdrop[hidden] { display: none; }
.noscript { position: fixed; z-index: 9999; inset: 20px; padding: 18px; border-radius: 12px; background: #fff; color: #111; text-align: center; }

.skeleton {
  border-radius: 8px;
  background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2));
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}

@keyframes shimmer { to { background-position: -200% 0; } }

@media (max-width: 1240px) {
  :root { --sidebar: 242px; }
  .profile-copy { display: none; }
  .search-trigger { min-width: 210px; }
  .grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .video-layout { grid-template-columns: minmax(0, 1fr) 280px; }
}

@media (max-width: 1024px) {
  :root { --sidebar: 84px; }
  .brand-wrap { justify-content: center; padding-inline: 12px; }
  .brand-copy,
  .role-mini div,
  .nav-link > span:not(.nav-icon):not(.nav-badge),
  .nav-section-label,
  .sidebar-footer .session-card div,
  .sidebar-footer .qemamm-signature,
  .sidebar-footer .nav-link > span:last-child { display: none; }
  .role-mini { justify-content: center; margin-inline: 10px; padding-inline: 8px; }
  .side-nav { padding-inline: 9px; }
  .nav-link { justify-content: center; padding-inline: 10px; }
  .nav-link.active::before { inset-inline-start: -9px; }
  .sidebar-footer { padding-inline: 9px; }
  .session-card { justify-content: center; }
  .astroguide-fab { inset-inline-end: calc(var(--sidebar) + 18px); }
  .hero-panel { grid-template-columns: minmax(0, 1.3fr) minmax(240px, .7fr); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .video-layout,
  .quiz-layout { grid-template-columns: 1fr; }
  .video-side { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .lab-layout { grid-template-columns: 285px minmax(0,1fr); }
}

@media (max-width: 767px) {
  :root { --sidebar: 0px; --topbar: 66px; }
  html { scroll-padding-bottom: 84px; }
  body { padding-bottom: 74px; }
  .mobile-only { display: inline-grid; }
  .sidebar {
    width: min(310px, 88vw);
    transform: translateX(110%);
    transition: transform .24s ease;
    box-shadow: var(--shadow);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar .brand-wrap { justify-content: flex-start; padding-inline: 18px; }
  .sidebar .brand-copy,
  .sidebar .role-mini div,
  .sidebar .nav-link > span:not(.nav-icon):not(.nav-badge),
  .sidebar .nav-section-label,
  .sidebar .session-card div,
  .sidebar .qemamm-signature,
  .sidebar .sidebar-footer .nav-link > span:last-child { display: flex; }
  .sidebar .brand-copy { display: flex; }
  .sidebar .nav-section-label { display: block; }
  .sidebar .role-mini { justify-content: flex-start; margin-inline: 16px; padding-inline: 12px; }
  .sidebar .nav-link { justify-content: flex-start; padding-inline: 12px; }
  .sidebar .session-card { justify-content: flex-start; }
  .sidebar-close { margin-inline-start: auto; }
  .mobile-backdrop {
    position: fixed;
    z-index: 70;
    inset: 0;
    background: rgba(2,6,17,.65);
    backdrop-filter: blur(3px);
  }
  .mobile-backdrop:not([hidden]) { display: block; }
  .workspace { margin-inline-start: 0; }
  .topbar { padding: 9px 13px; }
  .topbar-start { min-width: 0; }
  .breadcrumbs { display: none; }
  .page-heading h1 { max-width: 42vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .search-trigger,
  .xp-pill,
  .profile-copy,
  .profile-trigger .chevron { display: none; }
  .topbar-actions { gap: 7px; }
  .profile-trigger { height: 42px; padding: 2px; }
  .avatar { width: 38px; height: 38px; }
  .main-content { padding: 18px 13px 24px; }
  .page-intro { align-items: flex-start; flex-direction: column; margin-bottom: 17px; }
  .page-intro .intro-actions { width: 100%; }
  .page-intro .intro-actions > * { flex: 1; }
  .grid-2,
  .grid-3,
  .grid-4,
  .grid-5 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .stats-grid-mobile { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-card { min-height: 118px; padding: 15px; }
  .hero-panel { min-height: auto; grid-template-columns: 1fr; }
  .hero-content { padding: 26px 20px 12px; }
  .hero-visual { min-height: 230px; }
  .hero-planet { width: 175px; }
  .float-label { min-width: 125px; padding: 8px 10px; }
  .world-card { min-height: 170px; }
  .objective-list { grid-template-columns: 1fr; }
  .lesson-hero { padding: 24px 19px; }
  .video-side { grid-template-columns: 1fr; }
  .video-stage { min-height: auto; }
  .video-scene { width: 88%; height: 76%; }
  .video-formula { inset-block-start: 6%; font-size: .9rem; }
  .play-center { width: 56px; height: 56px; }
  .lab-layout { grid-template-columns: 1fr; }
  .lab-controls { position: static; }
  .lab-stage { min-height: auto; }
  .lab-scene { min-height: 330px; }
  .lab-tank { width: 72%; height: 215px; }
  .lab-reading { inset-block-start: 15px; inset-inline-end: 15px; min-width: 145px; padding: 10px; }
  .lab-reading strong { font-size: 1.05rem; }
  .formula-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: 1fr; }
  .ring-layout { align-items: flex-start; flex-direction: column; }
  .onboarding[open] { display: block; }
  .onboarding-visual { min-height: 220px; }
  .planet-large { width: 115px; height: 115px; }
  .onboarding-content { padding: 26px 20px; }
  .pipeline { grid-template-columns: repeat(5, 220px); }
  .astroguide-fab { inset-inline-end: 14px; inset-block-end: 86px; width: 48px; height: 48px; padding: 7px; border-radius: 15px; }
  .astroguide-fab > span:last-child { display: none; }
  .guide-icon { width: 32px; height: 32px; }
  .mobile-nav {
    position: fixed;
    z-index: 70;
    inset-inline: 10px;
    inset-block-end: calc(8px + env(safe-area-inset-bottom));
    min-height: 62px;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: center;
    padding: 5px;
    border: 1px solid var(--border-strong);
    border-radius: 18px;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
  }
  .mobile-nav button {
    min-height: 49px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border: 0;
    border-radius: 13px;
    background: transparent;
    color: var(--muted);
    font-size: .51rem;
  }
  .mobile-nav button .nav-icon { width: 19px; height: 19px; }
  .mobile-nav button.active { background: var(--violet-soft); color: #b7aeff; }
  .toast-stack { inset-inline: 15px; inset-block-end: 84px; width: auto; }
  .search-dialog { max-height: calc(100vh - 20px); }
}

@media (max-width: 430px) {
  .stats-grid-mobile { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-value { font-size: 1.3rem; }
  .row-tail .status { display: none; }
  .hero-actions > * { flex: 1; }
  .hero-content h2 { font-size: 1.55rem; }
  .float-one { inset-inline-start: 0; }
  .float-two { inset-inline-end: 0; }
  .page-intro h2 { font-size: 1.25rem; }
  .table-wrap { margin-inline: -2px; }
  .question-card { padding: 18px 15px; }
  .option-label { grid-template-columns: 26px minmax(0,1fr); padding: 9px; }
}

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

[data-reduced-motion="true"] *,
[data-reduced-motion="true"] *::before,
[data-reduced-motion="true"] *::after {
  scroll-behavior: auto !important;
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
}

@media print {
  .sidebar,
  .topbar,
  .mobile-nav,
  .astroguide-fab,
  .intro-actions,
  .drawer { display: none !important; }
  .workspace { margin: 0; }
  .main-content { max-width: none; padding: 0; }
  body { background: #fff; color: #111; }
  .card { break-inside: avoid; box-shadow: none; }
}

/* Hostinger PWA enhancements */
html,
body {
  width: 100%;
  max-width: 100%;
  overscroll-behavior-y: contain;
}

body {
  overflow-x: clip;
  -webkit-tap-highlight-color: transparent;
}

.page-shell,
.grid,
.grid > *,
.lab-layout,
.lab-layout > *,
.quiz-layout,
.quiz-layout > *,
.video-layout,
.video-layout > *,
.card,
.card-header > *,
.row-main,
.table-wrap,
.workspace,
.main-content {
  min-width: 0;
  max-width: 100%;
}

.top-action-btn,
.language-toggle {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px 11px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: .67rem;
  font-weight: 900;
}

.top-action-btn:hover,
.language-toggle:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.top-action-btn .dynamic-icon {
  width: 17px;
  height: 17px;
}

.language-toggle {
  min-width: 43px;
  padding-inline: 9px;
  color: var(--cyan);
  letter-spacing: .02em;
}

.network-pill {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border: 1px solid rgba(54,212,154,.2);
  border-radius: 999px;
  background: var(--success-soft);
  color: var(--success);
  font-size: .59rem;
  font-weight: 800;
  white-space: nowrap;
}

.network-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 10px currentColor;
}

.network-pill.offline {
  border-color: rgba(255,191,91,.24);
  background: var(--warning-soft);
  color: var(--warning);
}

.install-banner {
  position: fixed;
  z-index: 190;
  inset-inline: 50%;
  inset-block-end: 22px;
  width: min(680px, calc(100vw - 28px));
  display: grid;
  grid-template-columns: 44px minmax(0,1fr) auto 36px;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(121,103,255,.35);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
  transform: translateX(50%);
}

[dir="ltr"] .install-banner { transform: translateX(-50%); }
.install-banner[hidden] { display: none; }
.install-banner-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; background: linear-gradient(135deg,var(--primary),var(--cyan)); color:#fff; font-size:1.1rem; }
.install-banner strong,
.install-banner small { display: block; }
.install-banner strong { font-size: .73rem; }
.install-banner small { margin-top: 2px; color: var(--muted); font-size: .61rem; }
.install-banner .primary-btn { min-height: 38px; }

.content-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.content-manage-card { display: flex; flex-direction: column; }
.content-manage-card .inline-actions { margin-top: auto !important; }
.danger-icon { border-color: rgba(255,111,145,.2); color: var(--danger); }

.bilingual-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 14px;
}

.language-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--surface-2);
}

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

.media-upload-field small {
  color: var(--muted-2);
  font-size: .59rem;
}

.form-status { min-height: 20px; margin: 0; color: var(--muted); font-size: .64rem; }
.form-status.error { color: var(--danger); }
.content-preview-media { width: 100%; max-height: 360px; object-fit: contain; margin: 4px 0 15px; border-radius: 15px; background: #030817; }
.content-preview-audio { width: 100%; margin: 5px 0 15px; }
.preview-meta { flex-wrap: wrap; }

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

.capability-item {
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface-2);
}

.capability-item > span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 9px;
  background: var(--violet-soft);
  color: #b7aeff;
  font-size: .62rem;
  font-weight: 900;
}

.capability-item strong { font-size: .68rem; }

.responsive-data-list { display: flex; flex-direction: column; gap: 9px; }
.data-list-row { display: grid; grid-template-columns: minmax(170px,1fr) minmax(180px,.8fr); align-items: center; gap: 16px; padding: 12px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface-2); }
.data-list-row strong,
.data-list-row small { display: block; }
.data-list-row strong { font-size: .72rem; }
.data-list-row small { margin-top: 3px; color: var(--muted); font-size: .61rem; }

.page-end-actions {
  justify-content: space-between;
  margin-top: 18px;
}

.install-steps {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 10px;
  align-items: center;
  margin-top: 16px;
}

.install-steps span { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; background: var(--violet-soft); color:#b7aeff; font-weight:900; }
.install-steps strong { font-size:.7rem; }

.pwa-standalone .topbar {
  padding-block-start: max(12px, env(safe-area-inset-top));
}

@media (max-width: 1180px) {
  .network-pill .network-copy,
  .top-action-copy { display: none; }
  .network-pill { width: 34px; justify-content: center; padding: 6px; }
  .top-action-btn { width: 40px; padding: 7px; }
}

@media (max-width: 767px) {
  body { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
  [dir="ltr"] .sidebar { transform: translateX(-110%); }
  [dir="ltr"] .sidebar.open { transform: translateX(0); }

  .topbar {
    min-height: 64px;
    gap: 8px;
    padding: max(9px, env(safe-area-inset-top)) 10px 9px;
  }

  .topbar-start,
  .topbar-actions { gap: 6px; }
  .page-heading h1 { max-width: 36vw; font-size: .9rem; }
  .notification-btn,
  .language-toggle,
  .profile-trigger { width: 38px; height: 38px; min-height: 38px; }
  .language-toggle { min-width: 42px; font-size: .61rem; }
  .profile-trigger { padding: 1px; }
  .avatar { width: 36px; height: 36px; }
  .network-pill { width: 30px; min-height: 30px; }
  .install-trigger { display: none !important; }

  .main-content {
    width: 100%;
    padding: 15px 11px 28px;
  }

  .page-intro { gap: 12px; }
  .page-intro > div:first-child { width: 100%; }
  .page-intro p { font-size: .72rem; line-height: 1.65; }
  .page-intro .intro-actions { display: grid; grid-template-columns: repeat(auto-fit,minmax(130px,1fr)); }
  .page-intro .intro-actions > * { width: 100%; min-width: 0; }

  .card.pad { padding: 15px; }
  .card-header { flex-wrap: wrap; gap: 9px; }
  .card-header > div:first-child { flex: 1 1 170px; }
  .card-header .tabs,
  .card-header .filter-row { width: 100%; }
  .card-header .filter-row > input,
  .card-header .filter-row > select { width: 100% !important; }

  .toolbar { align-items: stretch; }
  .toolbar > input,
  .toolbar > select,
  .toolbar > .field,
  .toolbar > button { width: 100% !important; min-width: 0 !important; }

  .table-wrap {
    max-width: calc(100vw - 52px);
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
  }
  .table-wrap table { min-width: 680px; }
  .heatmap { width: 100%; min-width: 0; padding-bottom: 5px; }
  .pipeline { max-width: calc(100vw - 52px); padding-bottom: 6px; }
  .chart-canvas-wrap { width: 100%; overflow-x: auto; }
  .chart-canvas-wrap canvas { min-width: 640px; max-width: none; }

  .lab-layout,
  .quiz-layout,
  .video-layout { grid-template-columns: minmax(0, 1fr); }

  .option-label { position: relative; }
  .option-label input {
    inset-block-start: 0;
    inset-inline-start: 0;
    width: 1px;
    height: 1px;
    min-height: 1px;
    padding: 0;
  }

  .stats-grid-mobile { grid-template-columns: repeat(2, minmax(0,1fr)) !important; }
  .stat-card { min-height: 110px; padding: 13px; }
  .stat-value { font-size: 1.25rem; }
  .stat-label { font-size: .62rem; }
  .stat-delta { max-width: 68px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  .bilingual-fields,
  .capability-grid { grid-template-columns: 1fr; }
  .content-editor-form .form-grid { grid-template-columns: 1fr; }
  .language-panel { padding: 12px; }
  .content-editor-actions { display: grid; grid-template-columns: 1fr; }

  .responsive-data-list .data-list-row { grid-template-columns: 1fr; gap: 9px; }
  .data-list-row .progress-row { width: 100%; }

  .timeline-item { grid-template-columns: 38px minmax(0,1fr); }
  .timeline-item > .status { grid-column: 2; justify-self: start; }
  .audit-line { grid-template-columns: 36px minmax(0,1fr); }
  .audit-time { grid-column: 2; }
  .ring-layout { width: 100%; }

  .inline-actions.page-end-actions {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 8px;
  }
  .inline-actions.page-end-actions > * { width: 100%; min-width: 0; }

  .modal {
    width: calc(100vw - 18px);
    max-height: calc(100dvh - 18px);
    padding: 20px 15px;
    border-radius: 18px;
  }

  .install-banner {
    inset-inline: 9px;
    inset-block-end: calc(82px + env(safe-area-inset-bottom));
    width: auto;
    grid-template-columns: 38px minmax(0,1fr) 34px;
    gap: 9px;
    padding: 10px;
    transform: none !important;
  }
  .install-banner .primary-btn { grid-column: 2; width: 100%; min-height: 34px; }
  .install-banner > .icon-btn { grid-column: 3; grid-row: 1; }
  .install-banner-icon { width: 38px; height: 38px; }
  .install-banner small { font-size: .56rem; }

  .mobile-nav {
    inset-inline: 7px;
    inset-block-end: calc(6px + env(safe-area-inset-bottom));
    min-height: 64px;
    border-radius: 17px;
  }
  .mobile-nav button { min-width: 0; padding-inline: 2px; }
  .mobile-nav button > span:last-child { width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  .astroguide-fab { inset-block-end: calc(84px + env(safe-area-inset-bottom)); }
}

@media (max-width: 390px) {
  .main-content { padding-inline: 9px; }
  .page-heading h1 { max-width: 31vw; font-size: .82rem; }
  .notification-btn { display: none; }
  .stats-grid-mobile { gap: 8px !important; }
  .stat-card { min-height: 104px; padding: 12px; }
  .table-wrap,
  .pipeline { max-width: calc(100vw - 46px); }
  .mobile-nav button { font-size: .47rem; }
  .mobile-nav button .nav-icon { width: 18px; height: 18px; }
}
