:root {
  color-scheme: dark;
  --bg: #07070b;
  --panel: #17161b;
  --panel-2: #201f25;
  --panel-3: #28272e;
  --line: #393740;
  --line-soft: #2a2930;
  --text: #f7f5ef;
  --muted: #a9a5a0;
  --muted-2: #7f7a7a;
  --cream: #f5ffd8;
  --cream-2: #edf7c2;
  --gold: #e0ad21;
  --coral: #ff806d;
  --green: #96d6a5;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.38);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.nav-link[hidden] {
  display: none;
}

.ops-dashboard {
  display: grid;
  gap: 20px;
  padding: 28px 0 48px;
}

.ops-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.ops-head h1 {
  margin: 0;
  font-size: clamp(1.6rem, 2vw, 2.2rem);
}

.ops-head p {
  margin: 8px 0 0;
  color: var(--text-muted);
}

.ops-head-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.ops-grid {
  display: grid;
  gap: 14px;
}

.ops-grid.kpis {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.ops-grid.health {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.ops-grid.wide {
  grid-template-columns: 1.25fr 1fr;
}

.ops-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #121219;
  padding: 16px;
}

.ops-card h2 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.ops-card strong {
  font-size: 1.6rem;
}

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

.ops-list p {
  margin: 0;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.95rem;
}

.ops-runbook {
  display: grid;
  gap: 8px;
}

.ops-runbook code {
  display: block;
  background: #0b0b10;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.88rem;
}

.ops-checklist {
  margin: 12px 0 0;
  color: var(--text-muted);
  padding-left: 16px;
  display: grid;
  gap: 6px;
}

.ops-mini-table {
  display: grid;
  gap: 8px;
  max-height: 300px;
  overflow: auto;
}

.ops-mini-table p {
  margin: 0;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: flex-start;
  font-size: 0.9rem;
}

.ops-table {
  display: grid;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.ops-table-head,
.ops-table-row {
  display: grid;
  grid-template-columns: 2fr 1fr 0.6fr 0.8fr 1fr 2fr;
  gap: 10px;
  padding: 10px 12px;
  align-items: start;
}

.ops-table-head {
  background: #0d0e14;
  font-size: 0.82rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0;
}

.ops-table-row {
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
}

.ops-filters {
  display: grid;
  grid-template-columns: 1.7fr 1fr 0.7fr 1.3fr 1fr auto;
  gap: 10px;
  margin-bottom: 12px;
}

.ops-filters input,
.ops-filters select {
  background: #0b0b10;
  color: var(--text-main);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 11px;
  min-width: 0;
}

.ops-pagination {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.ops-pagination button {
  border: 1px solid var(--border);
  background: #0d0e14;
  color: var(--text-main);
  border-radius: 8px;
  padding: 8px 11px;
}

@media (max-width: 1100px) {
  .ops-grid.wide {
    grid-template-columns: 1fr;
  }

  .ops-filters {
    grid-template-columns: 1fr 1fr;
  }

  .ops-table-head,
  .ops-table-row {
    grid-template-columns: 1.5fr 1fr 0.7fr 0.8fr 1fr 1.5fr;
  }
}

@media (max-width: 760px) {
  .ops-head {
    flex-direction: column;
  }

  .ops-filters {
    grid-template-columns: 1fr;
  }

  .ops-table-head,
  .ops-table-row {
    grid-template-columns: 1fr;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

.app-shell {
  height: 86px;
  display: grid;
  grid-template-columns: auto minmax(360px, 1fr) minmax(260px, 360px) auto;
  align-items: center;
  gap: 28px;
  padding: 0 44px;
  background: rgba(7, 7, 11, 0.94);
  border-bottom: 1px solid var(--line-soft);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: max-content;
  color: var(--cream);
  text-decoration: none;
  font-size: 28px;
  line-height: 1;
  letter-spacing: 0;
}

.brand strong {
  font-weight: 900;
  color: #ffffff;
}

.brand-icon {
  width: 22px;
  height: 17px;
  border: 2px solid var(--cream);
  border-radius: 2px;
  position: relative;
}

.brand-icon::after {
  content: "";
  position: absolute;
  left: 3px;
  right: 3px;
  bottom: -6px;
  height: 2px;
  background: var(--cream);
}

.primary-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 26px;
  min-width: 0;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  color: #8f9a91;
  font-weight: 750;
  cursor: pointer;
  white-space: nowrap;
  padding: 8px 0;
}

.nav-link.active,
.nav-link:hover {
  color: var(--cream);
}

.top-search {
  display: flex;
  align-items: center;
  height: 46px;
  border: 1px solid var(--line);
  background: #050507;
  border-radius: 4px;
  min-width: 0;
  width: 100%;
}

.top-search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  padding: 0 14px;
  background: transparent;
  color: var(--text);
}

.top-search button,
.profile-button {
  border: 0;
  background: transparent;
  cursor: pointer;
}

.top-search button {
  width: 48px;
  height: 44px;
  color: var(--muted);
  font-size: 24px;
}

.profile-button {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--cream);
  color: #1b1a20;
  box-shadow: inset 0 0 0 4px rgba(0, 0, 0, 0.08);
}

.main-stage {
  min-height: calc(100vh - 86px);
}

.loading-panel,
.placeholder-view,
.empty-state {
  max-width: 1080px;
  margin: 48px auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 32px;
  color: var(--muted);
  text-align: center;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
  gap: 34px;
  min-height: 410px;
  padding: 70px 5vw 48px;
  background: var(--cream);
  color: #222328;
  overflow: hidden;
}

.hero-copy {
  display: grid;
  align-content: center;
  gap: 22px;
  min-width: 0;
  max-width: 850px;
}

.eyebrow {
  color: #35373b;
  font-weight: 900;
  font-size: 20px;
}

.eyebrow.small {
  margin: 0 0 14px;
  color: var(--cream);
  font-size: 15px;
}

.hero h1 {
  margin: 0;
  max-width: 820px;
  color: #202126;
  font-size: clamp(42px, 5vw, 74px);
  line-height: 1.08;
  letter-spacing: 0;
}

.hero p {
  margin: 0;
  max-width: 760px;
  color: #34353a;
  font-size: 21px;
  line-height: 1.45;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.primary-action,
.ghost-action,
.favorite-button,
.share-button {
  min-height: 50px;
  border-radius: 6px;
  padding: 0 18px;
  font-weight: 900;
  cursor: pointer;
}

.primary-action {
  border: 1px solid #202126;
  background: #202126;
  color: var(--cream);
}

.ghost-action {
  border: 1px solid rgba(32, 33, 38, 0.35);
  background: transparent;
  color: #202126;
}

.hero-visual {
  position: relative;
  min-width: 0;
  min-height: 320px;
}

.hero-card-stack {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-content: end;
  height: 100%;
  padding: 34px 0;
}

.hero-card-stack img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 6px;
  border: 6px solid #19181d;
  box-shadow: var(--shadow);
}

.hero-card-stack img:nth-child(2) {
  transform: translateY(48px);
}

.section {
  padding: 38px 5vw 8px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.section-heading h2 {
  margin: 0;
  font-size: 34px;
  line-height: 1.15;
}

.section-heading.compact {
  margin-bottom: 12px;
}

.section-heading.compact h2 {
  font-size: 28px;
}

.section-heading button {
  border: 0;
  background: transparent;
  color: var(--cream);
  font-weight: 850;
  cursor: pointer;
}

.topic-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(150px, 1fr));
  gap: 26px;
}

.topic-button {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.topic-button img {
  width: 68px;
  height: 68px;
  object-fit: cover;
  border-radius: 50%;
  background: var(--panel-2);
}

.topic-button strong {
  display: block;
  font-size: 19px;
}

.topic-button span {
  display: block;
  color: var(--muted-2);
  font-size: 14px;
  margin-top: 3px;
}

.course-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(210px, 1fr));
  gap: 20px;
}

.course-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.course-hit {
  display: grid;
  gap: 12px;
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  padding: 0;
}

.course-card img,
.course-hit img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 2px;
  background: var(--panel-2);
}

.course-card h3,
.course-hit h3 {
  margin: 0;
  min-height: 52px;
  color: #f4f2ee;
  font-size: 18px;
  line-height: 1.25;
}

.meta,
.course-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

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

.badge,
.chip {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  border-radius: 6px;
  padding: 3px 9px;
  background: var(--cream);
  color: #202126;
  font-size: 13px;
  font-weight: 900;
}

.badge.outline,
.chip {
  background: transparent;
  color: var(--cream);
  border: 1px solid var(--line);
}

.badge.warn {
  background: #4a3720;
  color: #ffd07a;
}

.badge.bad {
  background: #4a2420;
  color: #ff9d90;
}

.watch-chip {
  justify-self: start;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--cream);
  padding: 0 10px;
  font-weight: 900;
  cursor: pointer;
}

.watch-chip.saved {
  border-color: var(--cream);
  background: var(--cream);
  color: #111116;
}

.search-view {
  padding: 46px 5vw 80px;
}

.search-top {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: end;
  gap: 18px;
  margin-bottom: 28px;
}

.search-top h1 {
  margin: 0;
  font-size: clamp(34px, 4vw, 56px);
  line-height: 1.1;
}

.search-top.single {
  grid-template-columns: 1fr;
}

.search-subtitle {
  max-width: 760px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.45;
}

.filter-toggle,
.sort-select,
.filter-select {
  width: 100%;
  min-width: 0;
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg);
  color: var(--text);
  padding: 0 16px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.filter-toggle {
  min-width: 126px;
  font-weight: 850;
  cursor: pointer;
}

.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -8px 0 26px;
}

.active-chip {
  border-color: var(--cream);
  background: var(--cream);
  color: #17161b;
}

.search-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 34px;
  align-items: start;
  min-width: 0;
}

.filters {
  display: grid;
  gap: 20px;
  min-width: 0;
  padding: 28px 0;
  background: var(--panel);
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.filter-group {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.filter-group h3 {
  margin: 0;
  font-size: 22px;
}

.filter-group label {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-weight: 750;
}

.filter-group input {
  width: 22px;
  height: 22px;
  accent-color: var(--cream);
}

.result-list {
  display: grid;
  gap: 18px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 18px;
  padding: 14px 0;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.pagination.bottom {
  margin: 22px 0 0;
}

.pagination p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.page-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.page-button {
  min-height: 36px;
  min-width: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--cream);
  padding: 0 12px;
  font-weight: 850;
  cursor: pointer;
}

.page-button.active {
  border-color: var(--cream);
  background: var(--cream);
  color: #111116;
}

.page-button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.page-gap {
  color: var(--muted-2);
  font-weight: 800;
  padding: 0 2px;
}

.result-card {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 250px;
  gap: 26px;
  align-items: center;
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  text-align: left;
  padding: 30px;
}

.result-hit {
  display: contents;
  color: inherit;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.result-card:hover,
.course-hit:hover {
  filter: brightness(1.1);
}

.result-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 2px;
}

.result-card h2 {
  margin: 0 0 10px;
  font-size: 26px;
  line-height: 1.2;
}

.favorite-button {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--cream);
}

.favorite-button.featured {
  border-color: var(--cream);
  background: var(--cream);
  color: #111116;
}

.favorite-button.saved {
  border-color: var(--cream);
  background: var(--cream);
  color: #111116;
}

.detail-view {
  padding: 56px 5vw 80px;
}

.detail-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(360px, 0.75fr);
  gap: 54px;
  padding: 38px;
  border-radius: 8px;
  background: var(--panel);
}

.breadcrumbs {
  color: var(--muted-2);
  font-size: 20px;
  font-weight: 750;
  margin-bottom: 26px;
}

.breadcrumbs button {
  border: 0;
  background: transparent;
  color: var(--muted-2);
  cursor: pointer;
  font: inherit;
  font-weight: inherit;
  padding: 0;
}

.breadcrumbs button:hover {
  color: var(--cream);
}

.breadcrumbs strong {
  color: var(--cream);
}

.detail-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
}

.detail-title h1 {
  margin: 0;
  font-size: 40px;
  line-height: 1.12;
}

.session-badge {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  border-radius: 4px;
  padding: 0 16px;
  background: var(--cream);
  color: #17161b;
  font-size: 28px;
  font-weight: 900;
}

.video-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 8px;
  background: #101014;
}

.detail-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(110px, 1fr));
  gap: 18px;
  margin: 24px 0 34px;
}

.detail-stats span {
  display: block;
  color: var(--muted-2);
  font-size: 17px;
}

.detail-stats strong {
  display: block;
  margin-top: 6px;
  font-size: 20px;
}

.long-copy {
  color: #d8d5d1;
  font-size: 17px;
  line-height: 1.65;
}

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

.decision-grid h2 {
  margin: 0 0 12px;
  font-size: 28px;
}

.learning-list {
  margin: 0;
  padding-left: 20px;
  color: #d8d5d1;
  font-size: 17px;
  line-height: 1.65;
}

.learning-list li::marker {
  color: var(--coral);
}

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

.detail-side-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 18px;
}

.detail-side-actions .favorite-button,
.detail-side-actions .share-button {
  width: 100%;
}

.playlist-head h2,
.detail-copy h2,
.similar h2 {
  margin: 0;
  font-size: 34px;
}

.playlist {
  display: grid;
  gap: 14px;
  max-height: 600px;
  overflow: auto;
  padding-right: 8px;
}

.playlist-item {
  display: grid;
  grid-template-columns: 24px 86px minmax(0, 1fr) 38px;
  align-items: center;
  gap: 12px;
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #1c1b20;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.playlist-item.active {
  border-color: var(--cream);
}

.playlist-item.disabled {
  opacity: 0.52;
  cursor: not-allowed;
}

.playlist-item img {
  width: 86px;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 4px;
}

.playlist-item strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.playlist-item span {
  color: var(--muted);
  font-size: 13px;
}

.status-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--muted-2);
}

.status-dot.ok {
  border-color: var(--cream);
  background: var(--cream);
}

.status-dot.started {
  border-color: var(--gold);
  background: linear-gradient(90deg, var(--gold) 50%, transparent 50%);
}

.status-dot.done {
  border-color: var(--green);
  background: var(--green);
}

.share-button {
  width: 100%;
  margin-top: 14px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--cream);
}

.similar {
  margin-top: 54px;
}

.auth-view {
  min-height: calc(100vh - 86px);
  padding: 70px 5vw;
  display: grid;
  align-items: center;
}

.auth-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 440px);
  gap: 54px;
  align-items: center;
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
}

.auth-panel h1 {
  margin: 0;
  max-width: 720px;
  font-size: clamp(42px, 5vw, 68px);
  line-height: 1.08;
}

.auth-card {
  display: grid;
  gap: 14px;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.auth-card h2 {
  margin: 0 0 6px;
  font-size: 30px;
}

.auth-card label {
  color: var(--muted);
  font-weight: 800;
}

.auth-card input {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #050507;
  color: var(--text);
  outline: 0;
  padding: 0 14px;
}

.auth-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  color: var(--muted-2);
  font-size: 13px;
  font-weight: 850;
  text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  height: 1px;
  background: var(--line-soft);
}

.google-button {
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: #17161b;
  font-weight: 900;
  cursor: pointer;
}

.google-button span {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-right: 8px;
  border-radius: 50%;
  background: #17161b;
  color: #ffffff;
  font-size: 14px;
}

.auth-notice {
  margin: 4px 0 0;
  padding: 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.45;
}

.auth-notice.success {
  background: rgba(150, 214, 165, 0.14);
  color: var(--green);
}

.auth-notice.error {
  background: rgba(255, 128, 109, 0.14);
  color: var(--coral);
}

.auth-helper {
  margin: -2px 0 0;
  color: var(--muted-2);
  font-size: 13px;
  line-height: 1.45;
}

.sync-message {
  margin: 12px 0 0;
  color: var(--green);
  font-size: 14px;
  font-weight: 800;
}

.sync-message.error {
  color: var(--coral);
}

.learning-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0 0;
}

.learning-stats span {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.learning-stats strong {
  color: var(--cream);
  font-size: 15px;
}

.ghost-action.light {
  border-color: var(--line);
  color: var(--cream);
}

.ghost-action.active {
  border-color: var(--gold);
  color: var(--gold);
}

.primary-action.complete {
  border-color: var(--green);
  background: var(--green);
  color: #111116;
}

.learning-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: -8px 0 24px;
}

.learning-tabs button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--cream);
  padding: 0 14px;
  font-weight: 900;
  cursor: pointer;
}

.learning-tabs button.active {
  background: var(--cream);
  color: #111116;
}

.learning-tabs span {
  margin-left: 8px;
  color: inherit;
  opacity: 0.72;
}

.learning-workspace {
  display: grid;
  gap: 22px;
}

.continue-card {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  padding: 26px;
  border-radius: 8px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
}

.continue-card.empty {
  grid-template-columns: minmax(0, 1fr) auto;
}

.continue-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 4px;
}

.continue-card h2,
.learning-secondary-grid h2 {
  margin: 0 0 8px;
  font-size: 30px;
  line-height: 1.18;
}

.continue-card p,
.learning-course p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.progress-track {
  height: 8px;
  width: 100%;
  margin: 12px 0 8px;
  border-radius: 999px;
  background: var(--line-soft);
  overflow: hidden;
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

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

.learning-secondary-grid > article {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
  padding: 22px;
  border-radius: 8px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
}

.learning-list-panel {
  display: grid;
  gap: 16px;
}

.learning-course {
  min-width: 0;
  padding: 18px;
  border-radius: 8px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
}

.learning-course .course-hit {
  grid-template-columns: 180px minmax(0, 1fr);
  display: grid;
  align-items: center;
}

.learning-course img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 4px;
}

.learning-footer-actions {
  margin-top: 26px;
}

.course-progress-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  margin: 18px 0 24px;
  padding: 18px;
  border-radius: 8px;
  background: #1c1b20;
  border: 1px solid var(--line-soft);
}

.course-progress-panel strong {
  display: block;
  margin-top: 4px;
  font-size: 22px;
}

.lecture-progress-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.current-lecture-panel .lecture-progress-actions {
  justify-content: flex-start;
}

.lecture-progress-actions .meta {
  flex-basis: 100%;
  text-align: right;
}

.current-lecture-panel .lecture-progress-actions .meta {
  text-align: left;
}

.learning-footer-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 14px;
}

.learning-footer-line button {
  border: 0;
  background: transparent;
  color: var(--cream);
  font-weight: 900;
  cursor: pointer;
}

.share-button.compact {
  width: auto;
  margin-top: 0;
  min-height: 50px;
}

.learning-home {
  padding: 48px 5vw 80px;
}

.learning-home-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 18px;
}

.learning-home-head h1 {
  margin: 0;
  font-size: clamp(42px, 5vw, 72px);
  line-height: 1;
}

.learning-home-head p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 18px;
}

.learning-home-head .learning-stats {
  justify-content: flex-end;
  margin: 0;
}

.learning-spotlight {
  position: relative;
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  min-height: 154px;
  padding: 18px 22px 18px 18px;
  overflow: hidden;
  border-radius: 8px;
  background: #151419;
  border: 1px solid var(--line-soft);
  border-left: 5px solid var(--course-accent);
}

.learning-spotlight.empty {
  grid-template-columns: minmax(0, 1fr);
  min-height: 180px;
}

.spotlight-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 4px;
  background: linear-gradient(135deg, var(--course-accent), #17161b);
}

.spotlight-copy {
  min-width: 0;
  max-width: 760px;
}

.spotlight-copy h1 {
  margin: 8px 0 8px;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.12;
}

.spotlight-copy p {
  margin: 0;
  color: #d2cfcb;
  font-size: 18px;
  line-height: 1.45;
}

.spotlight-copy .spotlight-lecture {
  display: block;
  max-width: 680px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-size: 16px;
  font-weight: 780;
}

.spotlight-lecture span {
  display: inline-flex;
  margin-right: 8px;
  border: 1px solid rgba(245, 255, 216, 0.18);
  border-radius: 999px;
  padding: 2px 8px;
  color: var(--cream);
  font-size: 12px;
  font-weight: 900;
}

.spotlight-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.spotlight-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 0;
}

.spotlight-facts {
  position: absolute;
  right: 28px;
  bottom: 28px;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  max-width: 440px;
}

.spotlight-facts span,
.course-status-chip {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(245, 255, 216, 0.22);
  border-radius: 999px;
  background: rgba(7, 7, 11, 0.54);
  color: var(--cream);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 900;
}

.spotlight-facts strong {
  margin-right: 5px;
}

.learning-shelves {
  display: grid;
  gap: 32px;
  margin-top: 34px;
}

.learning-shelf {
  min-width: 0;
}

.shelf-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.shelf-heading h2 {
  margin: 0;
  font-size: 30px;
  line-height: 1.1;
}

.shelf-heading p {
  margin: 7px 0 0;
  color: var(--muted);
}

.shelf-heading > span {
  min-width: 38px;
  min-height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--cream);
  font-weight: 900;
}

.learning-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(280px, 360px);
  gap: 18px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding: 2px 0 12px;
}

.learning-course-tile {
  position: relative;
  min-width: 0;
}

.learning-course-tile .course-hit {
  height: 100%;
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #151419;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.subject-accent {
  position: absolute;
  inset: 12px auto auto 12px;
  z-index: 1;
  width: 48px;
  height: 5px;
  border-radius: 999px;
  background: var(--course-accent);
  box-shadow: 0 0 24px color-mix(in srgb, var(--course-accent), transparent 45%);
}

.learning-course-tile .course-hit:hover {
  transform: translateY(-3px);
  border-color: var(--line);
  background: #1f1e24;
}

.learning-course-tile img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 4px;
}

.learning-course-tile h3 {
  margin: 6px 0 5px;
  color: var(--text);
  font-size: 20px;
  line-height: 1.2;
}

.learning-course-tile p {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}

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

.ai-notes-button {
  min-height: 34px;
  border: 1px solid rgba(245, 255, 216, 0.18);
  border-radius: 999px;
  background: transparent;
  color: var(--cream);
  padding: 0 12px;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.ai-notes-button:hover {
  border-color: var(--course-accent);
}

.shelf-empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 22px;
  color: var(--muted);
}

.course-watch-view {
  padding: 28px 5vw 80px;
}

.course-watch-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 430px);
  gap: 28px;
  align-items: start;
}

.watch-main {
  min-width: 0;
}

.course-watch-view .video-frame {
  border-radius: 4px;
  box-shadow: var(--shadow);
}

.current-lecture-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  padding: 22px 0 8px;
  border-bottom: 1px solid var(--line-soft);
}

.lecture-title,
.current-lecture-panel h1 {
  margin: 14px 0 8px;
  max-width: 920px;
  font-size: clamp(1.4rem, 3vw, 2rem);
  line-height: 1.3;
}

.lecture-meta-line,
.current-lecture-panel p {
  min-width: 0;
  max-width: 920px;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  overflow-wrap: normal;
  word-break: normal;
}

.current-lecture-panel .session-badge {
  min-height: 30px;
  padding: 0 10px;
  font-size: 14px;
  border-radius: 999px;
}

.course-syllabus {
  position: sticky;
  top: 108px;
  max-height: calc(100vh - 130px);
  display: grid;
  align-content: start;
  gap: 18px;
  min-width: 0;
  overflow: hidden;
}

.course-context-panel {
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #151419;
}

.course-context-panel > img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 14px;
}

.course-context-panel h2 {
  margin: 6px 0 8px;
  font-size: 25px;
  line-height: 1.15;
}

.course-context-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.course-syllabus .playlist {
  max-height: min(520px, calc(100vh - 455px));
}

.course-about {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 34px 48px;
  margin-top: 46px;
  padding-top: 34px;
  border-top: 1px solid var(--line-soft);
}

.course-about h2 {
  margin: 0 0 12px;
  font-size: 30px;
}

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

.course-facts span {
  display: block;
  color: var(--muted-2);
  font-size: 13px;
  font-weight: 800;
}

.course-facts strong {
  display: block;
  margin-top: 5px;
  line-height: 1.3;
}

@media (max-width: 1180px) {
  .app-shell {
    height: auto;
    grid-template-columns: auto minmax(220px, 1fr) auto;
    row-gap: 12px;
    padding-top: 16px;
    padding-bottom: 16px;
  }

  .primary-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    display: flex;
    justify-content: flex-start;
    overflow-x: auto;
  }

  .hero,
  .detail-panel,
  .search-layout,
  .auth-panel,
  .continue-card,
  .course-progress-panel {
    grid-template-columns: 1fr;
  }

  .lecture-progress-actions {
    justify-content: flex-start;
  }

  .lecture-progress-actions .meta {
    text-align: left;
  }

  .learning-home-head,
  .current-lecture-panel {
    align-items: start;
  }

  .course-watch-grid,
  .course-about {
    grid-template-columns: 1fr;
  }

  .course-syllabus {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .course-syllabus .playlist {
    max-height: 560px;
  }

  .topic-row,
  .course-row {
    grid-template-columns: repeat(3, minmax(190px, 1fr));
  }

  .result-card {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .result-card .favorite-button {
    grid-column: 1 / -1;
  }

  .decision-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .app-shell {
    height: auto;
    grid-template-columns: 1fr;
    padding: 16px;
    gap: 14px;
  }

  .brand {
    font-size: 26px;
  }

  .primary-nav {
    max-width: 100%;
    gap: 18px;
    justify-content: flex-start;
    padding-bottom: 4px;
  }

  .nav-link {
    font-size: 14px;
  }

  .top-search {
    width: 100%;
  }

  .profile-button {
    display: none;
  }

  .hero,
  .section,
  .search-view,
  .detail-view,
  .learning-home {
    padding-left: 18px;
    padding-right: 18px;
  }

  .learning-home {
    padding-top: 28px;
  }

  .learning-home-head,
  .current-lecture-panel,
  .shelf-heading {
    display: grid;
    grid-template-columns: 1fr;
  }

  .learning-home-head h1 {
    font-size: 42px;
  }

  .learning-spotlight {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 16px;
  }

  .spotlight-copy {
    padding: 0;
  }

  .spotlight-copy h1 {
    font-size: 28px;
  }

  .spotlight-copy .spotlight-lecture {
    white-space: normal;
  }

  .spotlight-actions {
    justify-content: flex-start;
  }

  .spotlight-facts {
    position: static;
    justify-content: flex-start;
    padding: 0 26px 26px;
  }

  .learning-rail {
    grid-auto-columns: minmax(245px, 84vw);
  }

  .course-facts {
    grid-template-columns: 1fr;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
    width: 100%;
  }

  .hero-copy,
  .hero-visual,
  .hero-actions {
    width: 100%;
    max-width: calc(100vw - 36px);
  }

  .hero h1 {
    width: 100%;
    max-width: 100%;
    font-size: 38px;
    overflow-wrap: break-word;
  }

  .hero p {
    width: 100%;
    max-width: 100%;
    font-size: 18px;
    overflow-wrap: break-word;
  }

  .hero-card-stack {
    grid-template-columns: 1fr;
    padding: 8px 0 0;
  }

  .hero-card-stack img:nth-child(2) {
    transform: none;
  }

  .hero-card-stack img:nth-child(n + 3) {
    display: none;
  }

  .topic-row,
  .course-row {
    grid-template-columns: 1fr;
  }

  .search-top,
  .result-card,
  .detail-stats,
  .playlist-item,
  .learning-secondary-grid,
  .learning-course .course-hit {
    grid-template-columns: 1fr;
  }

  .filters {
    display: none;
    padding: 18px 0;
  }

  .filters.open {
    display: grid;
  }

  .result-card {
    padding: 18px;
  }

  .pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .page-controls {
    justify-content: flex-start;
  }

  .detail-panel {
    padding: 18px;
  }

  .playlist-item img {
    width: 100%;
  }
}
