    /* =========================================================
       COURSE & TOPIC PAGE & CONTENT VIEWER STYLES
    ========================================================= */



    /* =========================================================
       MODERN TOPIC SECTION BADGES (Presentation, Quiz, Lecture)
    ========================================================= */
    .topic-card-sections {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin: 14px 0 16px;
      padding-top: 14px;
      border-top: 1px dashed var(--card-border);
    }

    .topic-section-badge {
      font-size: 11.5px;
      font-weight: 700;
      padding: 5px 11px;
      border-radius: 999px;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      transition: all 0.2s ease;
      letter-spacing: 0.2px;
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    }

    .topic-section-badge .badge-icon {
      width: 13px;
      height: 13px;
      vertical-align: -1px;
    }

    /* Lecture badge */
    .topic-section-badge.badge-lecture {
      color: #4f46e5;
      background: rgba(99, 102, 241, 0.12);
      border: 1px solid rgba(99, 102, 241, 0.3);
    }

    [data-theme="dark"] .topic-section-badge.badge-lecture {
      color: #a5b4fc;
      background: rgba(99, 102, 241, 0.18);
      border-color: rgba(99, 102, 241, 0.38);
    }

    /* Presentation badge */
    .topic-section-badge.badge-presentation {
      color: #0284c7;
      background: rgba(56, 189, 248, 0.12);
      border: 1px solid rgba(56, 189, 248, 0.32);
    }

    [data-theme="dark"] .topic-section-badge.badge-presentation {
      color: #38bdf8;
      background: rgba(56, 189, 248, 0.18);
      border-color: rgba(56, 189, 248, 0.4);
    }

    /* Quiz badge */
    .topic-section-badge.badge-quiz {
      color: #059669;
      background: rgba(16, 185, 129, 0.12);
      border: 1px solid rgba(16, 185, 129, 0.32);
    }

    [data-theme="dark"] .topic-section-badge.badge-quiz {
      color: #34d399;
      background: rgba(16, 185, 129, 0.18);
      border-color: rgba(16, 185, 129, 0.4);
    }

    .topic-section-badge:hover {
      transform: translateY(-1px);
    }


    /* Course Preview Banner on Overview */
    .dash-course-preview {
      margin-bottom: 24px;
      padding: 22px 26px;
      background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(56, 189, 248, 0.08) 100%);
      border: 1px solid rgba(99, 102, 241, 0.25);
      border-radius: var(--radius-lg);
      cursor: pointer;
      transition: all 0.25s ease;
      position: relative;
      overflow: hidden;
    }

    .dash-course-preview:hover {
      border-color: var(--brand-indigo);
      transform: translateY(-2px);
      box-shadow: var(--shadow-md);
    }

    .course-preview-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 10px;
    }

    .course-module-tag {
      font-size: 11px;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      padding: 4px 10px;
      border-radius: 999px;
      background: rgba(56, 189, 248, 0.15);
      color: var(--brand-cyan);
      border: 1px solid rgba(56, 189, 248, 0.3);
    }

    .course-preview-title {
      font-size: 20px;
      font-weight: 900;
      color: var(--ink);
      margin: 0 0 6px;
    }

    .course-preview-desc {
      font-size: 13.5px;
      color: var(--muted);
      margin: 0 0 14px;
      line-height: 1.5;
    }

    .course-preview-footer {
      display: flex;
      align-items: center;
      justify-content: space-between;
    }

    .course-topics-indicator {
      font-size: 12px;
      font-weight: 700;
      color: var(--brand-cyan);
    }

    /* Course Summary Card */
    .course-summary-card {
      padding: 22px;
      background: var(--card-bg);
      border: 1px solid var(--card-border);
      border-radius: var(--radius-lg);
      margin-bottom: 24px;
      display: flex;
      flex-direction: column;
      gap: 16px;
    }

    .course-summary-info {
      display: flex;
      align-items: center;
      gap: 14px;
    }

    .course-code-badge {
      padding: 8px 14px;
      background: var(--brand-indigo);
      color: #fff;
      font-weight: 900;
      font-size: 13px;
      border-radius: var(--radius-md);
      letter-spacing: 0.5px;
      white-space: nowrap;
    }

    .course-stats-pills {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
    }

    .course-pill-item {
      font-size: 12px;
      font-weight: 700;
      padding: 5px 12px;
      border-radius: 999px;
      background: var(--card-bg-subtle);
      border: 1px solid var(--card-border);
      color: var(--muted);
    }

    /* Course Topics Grid (1-7) */
    .course-topics-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
      gap: 18px;
    }

    .topic-card {
      background: var(--card-bg);
      border: 1px solid var(--card-border);
      border-radius: var(--radius-lg);
      padding: 22px;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      transition: all 0.25s ease;
      position: relative;
    }

    .topic-card:hover {
      border-color: var(--brand-indigo);
      transform: translateY(-3px);
      box-shadow: var(--shadow-md);
    }

    .topic-card-top {
      display: flex;
      align-items: flex-start;
      gap: 14px;
      margin-bottom: 12px;
    }

    .topic-badge {
      width: 42px;
      height: 42px;
      border-radius: var(--radius-md);
      background: linear-gradient(135deg, var(--brand-indigo), var(--brand-cyan));
      color: #ffffff;
      font-weight: 900;
      font-size: 16px;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
    }

    .topic-card-title {
      font-size: 16px;
      font-weight: 800;
      color: var(--ink);
      margin: 0 0 6px;
      line-height: 1.35;
    }

    .topic-card-desc {
      font-size: 12.5px;
      color: var(--muted);
      margin: 0;
      line-height: 1.45;
    }

    .topic-section-badge.has-item {
      color: var(--green-dark);
      border-color: var(--green);
      background: var(--green-light);
    }

    .topic-card-btn {
      width: 100%;
      padding: 10px 16px;
      border-radius: var(--radius-md);
      font-weight: 800;
      font-size: 13px;
      text-align: center;
      cursor: pointer;
      border: 1px solid var(--card-border);
      background: var(--card-bg-subtle);
      color: var(--ink);
      transition: all 0.2s ease;
    }

    .topic-card-btn:hover {
      background: var(--brand-indigo);
      color: #ffffff;
      border-color: var(--brand-indigo);
    }

    /* Topic Page (Inner View) */
    .topic-page-back-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 18px;
      flex-wrap: wrap;
      gap: 12px;
    }

    .topic-page-crumb {
      font-size: 13px;
      font-weight: 700;
      color: var(--muted);
    }

    .topic-page-header-card {
      background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(168, 85, 247, 0.08) 100%);
      border: 1px solid rgba(99, 102, 241, 0.3);
      border-radius: var(--radius-xl);
      padding: 26px;
      margin-bottom: 24px;
      display: flex;
      align-items: center;
      gap: 20px;
    }

    .topic-page-badge {
      width: 60px;
      height: 60px;
      border-radius: var(--radius-lg);
      background: linear-gradient(135deg, var(--brand-indigo), var(--brand-violet));
      color: #ffffff;
      font-size: 24px;
      font-weight: 900;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      box-shadow: 0 8px 24px rgba(99, 102, 241, 0.35);
    }

    .topic-page-titles {
      flex: 1;
    }

    .topic-pill-sub {
      display: inline-block;
      font-size: 11px;
      font-weight: 900;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      padding: 3px 10px;
      border-radius: 999px;
      background: var(--brand-indigo-light);
      color: var(--brand-indigo);
      margin-bottom: 6px;
    }

    .topic-main-title {
      font-size: 22px;
      font-weight: 900;
      color: var(--ink);
      margin: 0 0 6px;
      line-height: 1.3;
    }

    .topic-main-desc {
      font-size: 13.5px;
      color: var(--muted);
      margin: 0;
      line-height: 1.5;
    }

    /* Topic Navigation Tabs (Lecture, Presentation, Practice, Quiz) */
    .topic-nav-tabs {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 10px;
      margin-bottom: 24px;
    }

    .topic-tab-btn {
      padding: 14px 12px;
      background: var(--card-bg);
      border: 1px solid var(--card-border);
      border-radius: var(--radius-md);
      color: var(--muted);
      font-weight: 800;
      font-size: 13.5px;
      cursor: pointer;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 6px;
      transition: all 0.2s ease;
      text-align: center;
    }

    .topic-tab-btn:hover {
      color: var(--ink);
      border-color: var(--brand-indigo);
      background: var(--card-bg-subtle);
    }

    .topic-tab-btn.active {
      background: var(--brand-indigo);
      color: #ffffff;
      border-color: var(--brand-indigo);
      box-shadow: 0 6px 18px rgba(99, 102, 241, 0.35);
    }

    .topic-tab-btn.active .topic-tab-icon {
      transform: scale(1.15);
    }

    .topic-tab-icon {
      font-size: 20px;
      transition: transform 0.2s ease;
    }

    /* Topic Section Content Panes */
    .topic-section-content {
      animation: fadeIn 0.25s ease;
    }

    /* Lecture Reader (Internal Viewer) */
    .lecture-viewer {
      background: var(--card-bg);
      border: 1px solid var(--card-border);
      border-radius: var(--radius-lg);
      padding: 28px;
    }

    .lecture-viewer-toolbar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 20px;
      padding-bottom: 16px;
      border-bottom: 1px solid var(--card-border);
    }

    .lecture-tag {
      font-size: 13px;
      font-weight: 800;
      color: var(--brand-indigo);
      display: inline-flex;
      align-items: center;
      gap: 6px;
    }

    .lecture-font-controls {
      display: flex;
      gap: 6px;
    }

    .lecture-font-controls button {
      padding: 4px 10px;
      font-size: 12px;
      font-weight: 800;
    }

    .lecture-body {
      font-size: 15px;
      line-height: 1.75;
      color: var(--ink);
    }

    .lecture-body h2,
    .lecture-body h3 {
      color: var(--ink);
      margin: 24px 0 12px;
      font-weight: 800;
    }

    .lecture-body p {
      margin-bottom: 16px;
    }

    .lecture-body pre {
      background: var(--code-bg);
      border: 1px solid var(--card-border);
      border-radius: var(--radius-md);
      padding: 16px;
      overflow-x: auto;
      font-family: 'JetBrains Mono', monospace;
      font-size: 13px;
      color: #f1f5f9;
      margin: 16px 0;
    }

    /* Presentation Viewer */
    .presentation-viewer {
      background: var(--card-bg);
      border: 1px solid var(--card-border);
      border-radius: var(--radius-lg);
      padding: 22px;
    }

    .presentation-toolbar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 18px;
      flex-wrap: wrap;
      gap: 10px;
    }

    .presentation-frame-wrap {
      width: 100%;
      height: 600px;
      border-radius: var(--radius-md);
      overflow: hidden;
      border: 1px solid var(--card-border);
      background: #000;
    }

    .presentation-frame {
      width: 100%;
      height: 100%;
      border: none;
    }

    .download-fallback-banner {
      margin-top: 14px;
      padding: 12px 16px;
      border-radius: var(--radius-md);
      background: var(--card-bg-subtle);
      border: 1px solid var(--card-border);
      font-size: 13px;
      color: var(--muted);
      text-align: center;
    }

    /* Practice Viewer */
    .practice-card {
      background: var(--card-bg);
      border: 1px solid var(--card-border);
      border-radius: var(--radius-lg);
      padding: 24px;
    }

    /* Topic Quiz Card */
    .topic-quiz-card {
      background: var(--card-bg);
      border: 1px solid var(--card-border);
      border-radius: var(--radius-lg);
      padding: 28px;
      text-align: center;
      max-width: 540px;
      margin: 0 auto;
    }

    .topic-quiz-icon {
      font-size: 48px;
      margin-bottom: 14px;
    }

    .topic-quiz-title {
      font-size: 20px;
      font-weight: 900;
      color: var(--ink);
      margin: 0 0 8px;
    }

    .topic-quiz-sub {
      font-size: 13.5px;
      color: var(--muted);
      margin: 0 0 24px;
    }


    /* Learning Path in Course Tab */
    .learning-path-wrapper {
      margin-top: 24px;
      margin-bottom: 30px;
      background: var(--card-bg);
      border: 1px solid var(--card-border);
      border-radius: 16px;
      padding: 22px;
    }

    .learning-path-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      flex-wrap: wrap;
      gap: 12px;
      margin-bottom: 18px;
    }

    .learning-path-flow {
      display: flex;
      flex-direction: column;
      gap: 12px;
    }

    .learning-topic-node {
      display: flex;
      align-items: center;
      gap: 14px;
      padding: 14px 18px;
      border-radius: 12px;
      background: var(--card-bg-subtle);
      border: 1px solid var(--card-border);
      cursor: pointer;
      transition: all 0.18s ease;
    }

    .learning-topic-node:hover {
      transform: translateX(4px);
      border-color: var(--brand-indigo);
    }

    .learning-topic-node.is-completed {
      border-color: rgba(16, 185, 129, 0.4);
    }

    .learning-topic-node.is-current {
      border: 2px solid var(--brand-indigo);
      background: linear-gradient(90deg, rgba(99, 102, 241, 0.12), transparent);
      box-shadow: 0 0 16px rgba(99, 102, 241, 0.2);
    }

    .node-indicator {
      width: 32px;
      height: 32px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: 800;
      font-size: 13px;
      flex-shrink: 0;
    }

    .node-completed-ind {
      background: rgba(16, 185, 129, 0.2);
      color: #34d399;
    }

    .node-current-ind {
      background: var(--brand-indigo);
      color: #ffffff;
      box-shadow: 0 0 10px var(--brand-indigo);
    }

    .node-upcoming-ind {
      background: rgba(148, 163, 184, 0.15);
      color: #94a3b8;
    }


    /* =========================================================
       BQ24 STUDENT LEARNING WORKSPACE (5-LEVEL UX HIERARCHY)
    ========================================================= */

    /* Header & Search */
    .learning-header-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-wrap: wrap;
      gap: 16px;
      margin-bottom: 22px;
    }

    .learning-title {
      font-size: 24px;
      font-weight: 900;
      color: var(--ink);
      display: flex;
      align-items: center;
      gap: 10px;
      margin: 0 0 4px;
      letter-spacing: -0.3px;
    }

    .learning-subtitle {
      font-size: 13.5px;
      color: var(--muted);
      margin: 0;
    }

    /* === SEARCH BOX: single visual container (icon + input inline, one border) === */
    .learning-search-box {
      position: relative;
      display: flex;
      align-items: center;
      gap: 0;
      width: 100%;
      max-width: 340px;
      height: 46px;
      background: var(--input-bg, var(--card-bg, #ffffff));
      border: 1.5px solid var(--card-border, #e2e8f0);
      border-radius: 23px;
      padding: 0 14px 0 14px;
      box-sizing: border-box;
      transition: border-color 0.2s ease, box-shadow 0.2s ease;
    }

    .learning-search-box:focus-within {
      border-color: var(--brand-indigo, #6366f1);
      box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
    }

    /* Icon: inline, left-aligned, flex-shrink:0 */
    .learning-search-icon {
      position: static;
      flex-shrink: 0;
      width: 18px;
      height: 18px;
      color: var(--muted, #94a3b8);
      pointer-events: none;
      margin-right: 10px;
    }

    /* Input: transparent, no border, fills remaining space */
    #learningSearchInput {
      flex: 1;
      width: 100%;
      height: 100%;
      padding: 0;
      border: none !important;
      border-radius: 0 !important;
      background: transparent !important;
      outline: none !important;
      box-shadow: none !important;
      color: var(--ink);
      font-size: 14px;
      font-weight: 500;
    }

    #learningSearchInput::placeholder {
      color: var(--muted, #94a3b8);
      font-weight: 400;
    }

    /* Clear button: right side */
    .learning-search-clear {
      flex-shrink: 0;
      position: static;
      right: auto;
      background: none;
      border: none;
      color: var(--muted);
      cursor: pointer;
      padding: 4px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border-radius: 50%;
      margin-left: 6px;
    }

    .learning-search-clear:hover {
      color: var(--ink);
      background: var(--card-bg-subtle);
    }


    /* 1. CONTINUE / START LEARNING CARD */
    .learning-section-continue {
      margin-bottom: 22px;
    }

    .learning-continue-card {
      background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(56, 189, 248, 0.04) 100%);
      border: 1.5px solid rgba(99, 102, 241, 0.32);
      border-radius: var(--radius-xl);
      padding: 22px 26px;
      box-shadow: 0 8px 24px rgba(99, 102, 241, 0.08);
      transition: all 0.25s ease;
      position: relative;
    }

    [data-theme="dark"] .learning-continue-card {
      background: linear-gradient(135deg, rgba(99, 102, 241, 0.16) 0%, rgba(15, 23, 42, 0.85) 100%);
      border-color: rgba(99, 102, 241, 0.42);
      box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
    }

    .learning-continue-card:hover {
      border-color: var(--brand-indigo);
      box-shadow: 0 10px 30px rgba(99, 102, 241, 0.16);
    }

    .continue-card-badge-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 12px;
    }

    .continue-pill-badge {
      font-size: 11px;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      padding: 4px 10px;
      border-radius: 999px;
      background: rgba(99, 102, 241, 0.18);
      color: var(--brand-indigo);
      border: 1px solid rgba(99, 102, 241, 0.35);
      display: inline-flex;
      align-items: center;
      gap: 6px;
    }

    [data-theme="dark"] .continue-pill-badge {
      color: #a5b4fc;
      background: rgba(99, 102, 241, 0.25);
    }

    .continue-module-badge {
      font-size: 11.5px;
      font-weight: 700;
      color: var(--muted);
    }

    .continue-card-content {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 24px;
      flex-wrap: wrap;
    }

    .continue-text-block {
      flex: 1;
      min-width: 260px;
    }

    .continue-card-title {
      font-size: 18px;
      font-weight: 800;
      color: var(--ink);
      margin: 0 0 8px;
      line-height: 1.35;
    }

    .continue-card-meta {
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 14px;
      font-size: 12.5px;
      color: var(--muted);
      margin-bottom: 14px;
    }

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

    .meta-item .meta-icon {
      width: 14px;
      height: 14px;
      opacity: 0.8;
    }

    .continue-progress-box {
      display: flex;
      align-items: center;
      gap: 12px;
      max-width: 380px;
    }

    .continue-progress-bar-track {
      flex: 1;
      height: 8px;
      border-radius: 999px;
      background: rgba(148, 163, 184, 0.22);
      overflow: hidden;
    }

    .continue-progress-bar-fill {
      height: 100%;
      border-radius: 999px;
      background: linear-gradient(90deg, var(--brand-indigo), var(--brand-cyan));
      transition: width 0.4s ease;
    }

    .continue-progress-percent {
      font-size: 12.5px;
      font-weight: 800;
      color: var(--brand-indigo);
    }

    [data-theme="dark"] .continue-progress-percent {
      color: #a5b4fc;
    }

    .continue-status-badge-wrap {
      display: inline-flex;
      align-items: center;
      margin-top: 4px;
    }

    .continue-status-pill {
      font-size: 12px;
      font-weight: 700;
      padding: 4px 12px;
      border-radius: 999px;
      background: rgba(99, 102, 241, 0.12);
      color: var(--brand-indigo);
      border: 1px solid rgba(99, 102, 241, 0.25);
      display: inline-flex;
      align-items: center;
      gap: 6px;
    }

    [data-theme="dark"] .continue-status-pill {
      background: rgba(99, 102, 241, 0.22);
      color: #a5b4fc;
      border-color: rgba(99, 102, 241, 0.38);
    }

    .continue-action-wrap {
      flex-shrink: 0;
    }

    .continue-action-btn {
      padding: 12px 24px;
      font-size: 14px;
      font-weight: 800;
      border-radius: var(--radius-md);
      box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
      min-height: 46px;
      display: inline-flex;
      align-items: center;
      gap: 8px;
      white-space: nowrap;
      cursor: pointer;
    }

    /* Start Learning Card (When no unfinished item exists) */
    .learning-start-card {
      background: var(--card-bg);
      border: 1.5px solid var(--card-border);
      border-radius: var(--radius-xl);
      padding: 22px 26px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 20px;
      flex-wrap: wrap;
      box-shadow: var(--shadow-sm);
    }

    .start-card-icon-col {
      flex-shrink: 0;
    }

    .start-compass-icon {
      width: 50px;
      height: 50px;
      border-radius: var(--radius-lg);
      background: rgba(99, 102, 241, 0.12);
      color: var(--brand-indigo);
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .start-compass-icon i {
      width: 26px;
      height: 26px;
    }

    .start-card-text-col {
      flex: 1;
      min-width: 240px;
    }

    .start-pill-badge {
      font-size: 11px;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      padding: 3px 9px;
      border-radius: 999px;
      background: rgba(16, 185, 129, 0.15);
      color: var(--green);
      border: 1px solid rgba(16, 185, 129, 0.3);
      display: inline-flex;
      align-items: center;
      gap: 5px;
      margin-bottom: 6px;
    }

    .start-card-title {
      font-size: 17px;
      font-weight: 800;
      color: var(--ink);
      margin: 0 0 4px;
    }

    .start-card-desc {
      font-size: 13px;
      color: var(--muted);
      margin: 0;
      line-height: 1.45;
    }

    .start-action-btn {
      padding: 11px 22px;
      font-size: 13.5px;
      font-weight: 800;
      min-height: 44px;
      display: inline-flex;
      align-items: center;
      gap: 8px;
      white-space: nowrap;
    }


    /* 2. MY LEARNING PROGRESS BLOCK */
    .learning-section-progress {
      margin-bottom: 26px;
    }

    .learning-progress-card {
      background: var(--card-bg);
      border: 1px solid var(--card-border);
      border-radius: var(--radius-lg);
      padding: 20px 24px;
      box-shadow: var(--shadow-sm);
    }

    .progress-card-top-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-wrap: wrap;
      gap: 14px;
      margin-bottom: 14px;
    }

    .progress-card-heading {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .progress-header-icon-wrap {
      width: 38px;
      height: 38px;
      border-radius: var(--radius-md);
      background: rgba(16, 185, 129, 0.12);
      color: var(--green);
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
    }

    .progress-header-icon-wrap i {
      width: 18px;
      height: 18px;
    }

    .progress-card-main-title {
      font-size: 16px;
      font-weight: 800;
      color: var(--ink);
      margin: 0 0 2px;
    }

    .progress-card-sub {
      font-size: 12px;
      color: var(--muted);
      margin: 0;
    }

    .progress-stat-pill-group {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .progress-metric-pill {
      font-size: 13px;
      font-weight: 700;
      color: var(--ink);
      background: var(--card-bg-subtle);
      border: 1px solid var(--card-border);
      padding: 5px 12px;
      border-radius: 999px;
      display: inline-flex;
      align-items: center;
      gap: 6px;
    }

    .progress-metric-pill .metric-icon {
      width: 14px;
      height: 14px;
      color: var(--green);
    }

    .progress-pct-badge-big {
      font-size: 18px;
      font-weight: 900;
      color: var(--green);
      display: inline-flex;
      align-items: center;
      gap: 5px;
    }

    .pct-circle-icon {
      font-size: 14px;
      opacity: 0.8;
    }

    .progress-track-wrapper {
      margin-bottom: 12px;
    }

    .progress-bar-track {
      width: 100%;
      height: 8px;
      border-radius: 999px;
      background: var(--card-bg-subtle);
      overflow: hidden;
      border: 1px solid var(--card-border);
    }

    .progress-bar-fill {
      height: 100%;
      border-radius: 999px;
      background: linear-gradient(90deg, #10b981, #06b6d4);
      transition: width 0.4s ease;
    }

    .progress-details-grid {
      display: flex;
      align-items: center;
      gap: 20px;
      margin-top: 12px;
      padding-top: 12px;
      border-top: 1px solid var(--card-border);
      flex-wrap: wrap;
    }

    .progress-detail-item {
      display: flex;
      align-items: center;
      gap: 6px;
      font-size: 12.5px;
    }

    .detail-label {
      color: var(--muted);
      font-weight: 600;
    }

    .detail-val {
      color: var(--ink);
      font-weight: 800;
    }

    .text-success {
      color: var(--green) !important;
    }


    /* 3. LEARNING CATALOG & FILTERS */
    .learning-section-catalog {
      margin-bottom: 28px;
    }

    .learning-catalog-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-wrap: wrap;
      gap: 14px;
      margin-bottom: 18px;
    }

    .learning-filter-chips {
      display: flex;
      align-items: center;
      gap: 8px;
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
      padding-bottom: 4px;
      max-width: 100%;
      scrollbar-width: none;
    }

    .learning-filter-chips::-webkit-scrollbar {
      display: none;
    }

    .filter-chip {
      padding: 7px 15px;
      border-radius: 999px;
      border: 1px solid var(--card-border);
      background: var(--card-bg-subtle);
      color: var(--muted);
      font-size: 12.5px;
      font-weight: 700;
      cursor: pointer;
      transition: all 0.2s ease;
      white-space: nowrap;
      min-height: 36px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
    }

    .filter-chip:hover {
      color: var(--ink);
      border-color: var(--brand-indigo);
      background: var(--card-bg);
    }

    .filter-chip.active {
      background: var(--brand-indigo);
      color: #ffffff;
      border-color: var(--brand-indigo);
      box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
    }

    [data-theme="light"] .filter-chip.active {
      background: var(--brand-indigo);
      color: #ffffff;
      border-color: var(--brand-indigo);
      box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
    }

    .topic-card-highlight {
      border-color: rgba(99, 102, 241, 0.45);
      background: linear-gradient(180deg, rgba(99, 102, 241, 0.04) 0%, var(--card-bg) 100%);
    }

    .topic-title-area {
      flex: 1;
      min-width: 0;
    }

    .topic-card-headline {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 10px;
      margin-bottom: 6px;
    }

    .topic-state-badge {
      font-size: 11px;
      font-weight: 800;
      padding: 3px 8px;
      border-radius: 6px;
      display: inline-flex;
      align-items: center;
      gap: 4px;
      flex-shrink: 0;
      white-space: nowrap;
    }

    .topic-state-badge.state-completed {
      background: rgba(16, 185, 129, 0.15);
      color: var(--green);
      border: 1px solid rgba(16, 185, 129, 0.3);
    }

    .topic-state-badge.state-active {
      background: rgba(99, 102, 241, 0.15);
      color: var(--brand-indigo);
      border: 1px solid rgba(99, 102, 241, 0.3);
    }

    [data-theme="dark"] .topic-state-badge.state-active {
      color: #a5b4fc;
    }

    .learning-empty-box {
      text-align: center;
      padding: 48px 20px;
      background: var(--card-bg);
      border: 1px dashed var(--card-border);
      border-radius: var(--radius-lg);
      grid-column: 1 / -1;
    }

    .learning-empty-box .empty-icon {
      width: 36px;
      height: 36px;
      color: var(--muted);
      margin-bottom: 10px;
      opacity: 0.6;
    }

    .learning-empty-box .empty-title {
      font-size: 16px;
      font-weight: 800;
      color: var(--ink);
      margin: 0 0 6px;
    }

    .learning-empty-box .empty-desc {
      font-size: 13px;
      color: var(--muted);
      margin: 0 0 16px;
    }


    /* 4. NEW MATERIALS BLOCK */
    .learning-section-new {
      margin-top: 30px;
      margin-bottom: 26px;
    }

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

    .new-material-item {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 14px 16px;
      border-radius: var(--radius-md);
      background: var(--card-bg);
      border: 1px solid var(--card-border);
      transition: all 0.2s ease;
      cursor: pointer;
    }

    .new-material-item:hover {
      transform: translateY(-2px);
      border-color: var(--brand-cyan);
      box-shadow: var(--shadow-sm);
    }

    .new-material-icon-wrap {
      width: 36px;
      height: 36px;
      border-radius: 8px;
      background: rgba(56, 189, 248, 0.12);
      color: var(--brand-cyan);
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
    }

    .new-material-icon-wrap i {
      width: 17px;
      height: 17px;
    }

    .new-material-info {
      flex: 1;
      min-width: 0;
    }

    .new-material-title {
      font-size: 13.5px;
      font-weight: 700;
      color: var(--ink);
      margin: 0 0 4px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .new-material-meta {
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 11px;
      color: var(--muted);
    }

    .new-material-date {
      display: inline-flex;
      align-items: center;
      gap: 4px;
    }

    .mini-icon {
      width: 12px;
      height: 12px;
    }

    .new-material-open-btn {
      background: none;
      border: none;
      color: var(--brand-indigo);
      font-size: 12px;
      font-weight: 700;
      display: inline-flex;
      align-items: center;
      gap: 4px;
      cursor: pointer;
      flex-shrink: 0;
      padding: 6px 8px;
    }

    [data-theme="dark"] .new-material-open-btn {
      color: #38bdf8;
    }


    /* 5. COMPLETED MATERIALS BLOCK */
    .learning-section-completed {
      margin-top: 30px;
      margin-bottom: 36px;
    }

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

    .completed-material-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 13px 18px;
      border-radius: var(--radius-md);
      background: var(--card-bg-subtle);
      border: 1px solid var(--card-border);
      cursor: pointer;
      transition: all 0.2s ease;
      flex-wrap: wrap;
      gap: 12px;
    }

    .completed-material-row:hover {
      border-color: rgba(16, 185, 129, 0.4);
      background: var(--card-bg);
      transform: translateX(2px);
    }

    .completed-left {
      display: flex;
      align-items: center;
      gap: 12px;
      flex: 1;
      min-width: 220px;
    }

    .completed-check-icon {
      width: 28px;
      height: 28px;
      border-radius: 50%;
      background: rgba(16, 185, 129, 0.15);
      color: var(--green);
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
    }

    .completed-check-icon i {
      width: 15px;
      height: 15px;
    }

    .completed-title-wrap {
      display: flex;
      flex-direction: column;
      gap: 2px;
    }

    .completed-title {
      font-size: 13.5px;
      font-weight: 700;
      color: var(--ink);
    }

    .completed-sub {
      font-size: 11.5px;
      color: var(--muted);
    }

    .completed-right {
      display: flex;
      align-items: center;
      gap: 14px;
    }

    .completed-score-pill {
      font-size: 12px;
      font-weight: 800;
      padding: 3px 10px;
      border-radius: 999px;
      background: rgba(16, 185, 129, 0.12);
      color: var(--green);
      border: 1px solid rgba(16, 185, 129, 0.25);
    }

    .completed-review-btn {
      font-size: 12px;
      color: var(--muted);
      display: inline-flex;
      align-items: center;
      gap: 4px;
      cursor: pointer;
    }

    .completed-review-btn:hover {
      color: var(--ink);
    }


    /* =========================================================
       RESPONSIVE RULES (MOBILE 320px / 360px / 375px / 390px / 414px / 768px)
    ========================================================= */
    @media (max-width: 768px) {
      /* 0. Main Workspace Sections Containment */
      #dashCourse,
      .learning-section-continue,
      .learning-section-progress,
      .learning-section-catalog,
      .learning-section-new,
      .learning-section-completed {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
      }

      /* Compact Header & Search */
      .learning-header-row {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
        margin-bottom: 18px;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
      }

      .learning-header-text {
        width: 100%;
        max-width: 100%;
        min-width: 0;
      }

      .learning-title {
        font-size: 22px;
        word-break: break-word;
        overflow-wrap: break-word;
      }

      .learning-subtitle {
        font-size: 12.5px;
        word-break: break-word;
        overflow-wrap: break-word;
      }

      .learning-search-box {
        max-width: 100%;
        min-width: 0;
        width: 100%;
        box-sizing: border-box;
      }

      #learningSearchInput {
        max-width: 100%;
        box-sizing: border-box;
      }

      /* 1. Priority #1 Action Cards (Continue / Start) */
      .learning-continue-card,
      .learning-start-card {
        padding: 16px 14px;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
      }

      .continue-card-badge-row {
        flex-wrap: wrap;
        gap: 8px;
        width: 100%;
        max-width: 100%;
        min-width: 0;
      }

      .continue-card-content {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
        width: 100%;
        max-width: 100%;
        min-width: 0;
      }

      .continue-text-block {
        min-width: 0;
        width: 100%;
        max-width: 100%;
      }

      .continue-card-title {
        font-size: 16px;
        word-break: break-word;
        overflow-wrap: break-word;
        line-height: 1.35;
      }

      .continue-card-meta {
        gap: 10px;
        font-size: 12px;
        width: 100%;
        max-width: 100%;
        min-width: 0;
      }

      .continue-progress-box {
        max-width: 100%;
        width: 100%;
        min-width: 0;
      }

      .continue-action-wrap {
        width: 100%;
        max-width: 100%;
        min-width: 0;
      }

      .continue-action-btn,
      .start-action-btn {
        width: 100%;
        max-width: 100%;
        justify-content: center;
        min-height: 46px;
        font-size: 14px;
        box-sizing: border-box;
      }

      .learning-start-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
      }

      .start-card-text-col {
        min-width: 0;
        width: 100%;
        max-width: 100%;
      }

      .start-card-title {
        font-size: 16px;
        word-break: break-word;
        overflow-wrap: break-word;
      }

      .start-card-action-col {
        width: 100%;
        max-width: 100%;
        min-width: 0;
      }

      /* 2. My Learning Progress Card ("Менің оқу прогресім") */
      .learning-progress-card {
        padding: 16px 14px;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
      }

      .progress-card-top-row {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        width: 100%;
        max-width: 100%;
        min-width: 0;
      }

      .progress-card-heading {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        gap: 10px;
      }

      .progress-card-heading > div {
        min-width: 0;
        flex: 1;
      }

      .progress-card-main-title {
        font-size: 15px;
        word-break: break-word;
        overflow-wrap: break-word;
        line-height: 1.3;
      }

      .progress-card-sub {
        font-size: 11.5px;
        word-break: break-word;
        overflow-wrap: break-word;
        line-height: 1.35;
      }

      .progress-stat-pill-group {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 8px;
        box-sizing: border-box;
      }

      .progress-metric-pill {
        max-width: 100%;
        min-width: 0;
        font-size: 11.5px;
        padding: 5px 10px;
        box-sizing: border-box;
        display: inline-flex;
        align-items: center;
        gap: 5px;
        flex: 1 1 auto;
      }

      .progress-metric-pill span {
        min-width: 0;
        overflow-wrap: break-word;
        word-break: break-word;
      }

      .progress-metric-pill .metric-icon {
        flex-shrink: 0;
      }

      .progress-pct-badge-big {
        font-size: 16px;
        flex-shrink: 0;
      }

      .progress-track-wrapper,
      .progress-bar-track {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
      }

      .progress-details-grid {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px 6px;
        margin-top: 12px;
        padding-top: 12px;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
      }

      .progress-detail-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
        font-size: 11px;
        min-width: 0;
        max-width: 100%;
      }

      .progress-detail-item .detail-label {
        font-size: 10.5px;
        line-height: 1.2;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 100%;
      }

      .progress-detail-item .detail-val {
        font-size: 11.5px;
        line-height: 1.2;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 100%;
      }

      /* 3. Catalog Section, Tabs & Topic Cards ("Оқу материалдары") */
      .learning-catalog-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
        margin-bottom: 14px;
      }

      .learning-catalog-header .dash-section-title {
        font-size: 17px;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow-wrap: break-word;
        word-break: break-word;
      }

      /* Category tabs: horizontal scroll container that never stretches page */
      .learning-filter-chips {
        display: flex;
        align-items: center;
        gap: 8px;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        box-sizing: border-box;
        padding: 2px 2px 6px 2px;
        scrollbar-width: none;
        -ms-overflow-style: none;
      }

      .learning-filter-chips::-webkit-scrollbar {
        display: none;
      }

      .filter-chip {
        flex-shrink: 0;
        white-space: nowrap;
        padding: 6px 14px;
        font-size: 12px;
        min-height: 34px;
        box-sizing: border-box;
      }

      /* Course Topics Grid: strictly use minmax(0, 1fr) to prevent track expansion */
      .course-topics-grid {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
      }

      .topic-card {
        padding: 16px 14px;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
      }

      .topic-card-top {
        gap: 10px;
        width: 100%;
        max-width: 100%;
        min-width: 0;
      }

      .topic-badge {
        width: 38px;
        height: 38px;
        font-size: 14px;
        flex-shrink: 0;
      }

      .topic-title-area {
        flex: 1;
        min-width: 0;
        max-width: 100%;
      }

      .topic-card-headline {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 6px;
        width: 100%;
        max-width: 100%;
        min-width: 0;
      }

      .topic-card-title {
        font-size: 14.5px;
        word-break: break-word;
        overflow-wrap: break-word;
        white-space: normal;
        line-height: 1.35;
        flex: 1 1 100%;
        min-width: 0;
        max-width: 100%;
        margin: 0 0 2px;
      }

      .topic-state-badge {
        font-size: 10.5px;
        padding: 2px 7px;
        flex-shrink: 0;
      }

      .topic-card-desc {
        font-size: 12px;
        word-break: break-word;
        overflow-wrap: break-word;
        line-height: 1.4;
      }

      .topic-card-sections {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
        margin: 12px 0 14px;
        padding-top: 12px;
      }

      .topic-section-badge {
        font-size: 11px;
        padding: 4px 9px;
        gap: 4px;
        box-sizing: border-box;
      }

      .topic-card-btn {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        min-height: 42px;
        display: flex;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
      }

      /* 4. New Materials & 5. Completed Topics */
      .learning-new-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
      }

      .new-material-item {
        padding: 12px 14px;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
      }

      .new-material-title {
        font-size: 13px;
      }

      .learning-completed-list {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
      }

      .completed-material-row {
        padding: 12px 14px;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
      }

      .completed-left {
        min-width: 0;
        flex: 1 1 auto;
      }

      .completed-title {
        word-break: break-word;
        overflow-wrap: break-word;
      }

      .completed-right {
        flex-shrink: 0;
      }
    }

    /* Extra safety for ultra-compact screens <= 360px (e.g. 320px) */
    @media (max-width: 360px) {
      .learning-continue-card,
      .learning-start-card,
      .learning-progress-card,
      .topic-card {
        padding: 14px 10px;
      }

      .progress-details-grid {
        grid-template-columns: 1fr;
        gap: 6px;
      }

      .progress-detail-item {
        flex-direction: row;
        justify-content: space-between;
        width: 100%;
      }

      .progress-detail-item .detail-label,
      .progress-detail-item .detail-val {
        white-space: normal;
      }

      .progress-metric-pill {
        width: 100%;
        justify-content: center;
      }

      .progress-stat-pill-group {
        flex-direction: column;
        align-items: flex-start;
      }
    }

/* ==========================================
   TOPIC DETAIL BOTTOM NAVIGATION
========================================== */
.topic-detail-nav-card {
  margin-top: 32px;
  margin-bottom: 36px;
  padding: 20px 24px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg, 16px);
  box-shadow: var(--shadow-sm, 0 4px 20px rgba(0, 0, 0, 0.08));
  display: flex;
  flex-direction: column;
  gap: 14px;
}

[data-theme="light"] .topic-detail-nav-card {
  background: #ffffff;
  border-color: rgba(226, 232, 240, 0.9);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.topic-nav-top-meta {
  display: flex;
  align-items: center;
  justify-content: center;
}

.topic-nav-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: var(--card-bg-subtle, rgba(255, 255, 255, 0.04));
  border: 1px solid var(--card-border, rgba(255, 255, 255, 0.08));
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
  letter-spacing: 0.3px;
}

[data-theme="light"] .topic-nav-indicator {
  background: rgba(241, 245, 249, 0.85);
  border-color: rgba(203, 213, 225, 0.7);
  color: #475569;
}

.topic-nav-ind-icon {
  width: 14px;
  height: 14px;
  color: var(--brand-indigo, #6366f1);
  flex-shrink: 0;
}

.topic-nav-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
}

.topic-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 22px;
  font-size: 14px;
  font-weight: 800;
  border-radius: var(--radius-md, 12px);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  box-sizing: border-box;
  min-width: 170px;
}

.topic-nav-btn .btn-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.topic-nav-btn:disabled,
.topic-nav-btn.disabled {
  opacity: 0.45;
  cursor: not-allowed !important;
  pointer-events: none;
  box-shadow: none !important;
  transform: none !important;
}

[data-theme="light"] .topic-nav-btn:disabled,
[data-theme="light"] .topic-nav-btn.disabled {
  opacity: 0.55;
  background: #f1f5f9 !important;
  color: #94a3b8 !important;
  border-color: #e2e8f0 !important;
}

@media (max-width: 600px) {
  .topic-detail-nav-card {
    padding: 16px 14px;
    margin-top: 24px;
    margin-bottom: 28px;
    border-radius: 14px;
    gap: 12px;
  }

  .topic-nav-indicator {
    font-size: 12px;
    padding: 5px 12px;
  }

  .topic-nav-action-row {
    gap: 10px;
  }

  .topic-nav-btn {
    flex: 1;
    min-width: 0;
    max-width: 100%;
    min-height: 46px;
    padding: 10px 10px;
    font-size: 13px;
  }

  .topic-nav-long-text {
    display: none;
  }
}

/* =========================================================
   LEARNING ACCESS RESTRICTION (08:15–14:20 Asia/Almaty)
========================================================= */

.topic-card.topic-card-locked {
  cursor: default !important;
  user-select: none;
  opacity: 0.92;
  border-color: var(--card-border);
}

.topic-card.topic-card-locked:hover {
  transform: none !important;
  box-shadow: none !important;
  border-color: var(--card-border) !important;
}

.topic-card.topic-card-locked .topic-badge {
  filter: grayscale(0.2);
  opacity: 0.9;
}

.learning-continue-card.continue-card-locked,
.learning-start-card.start-card-locked {
  opacity: 0.95;
}

.new-material-item.material-locked,
.completed-material-row.material-locked,
.learning-topic-node.node-locked {
  cursor: default !important;
  user-select: none;
}

.new-material-item.material-locked:hover,
.completed-material-row.material-locked:hover,
.learning-topic-node.node-locked:hover {
  transform: none !important;
  border-color: var(--card-border) !important;
  box-shadow: none !important;
}

/* Full Lock Box (for Cards) */
.topic-lock-box {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: rgba(99, 102, 241, 0.06);
  border: 1px dashed rgba(99, 102, 241, 0.28);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 3px;
  user-select: none;
  box-sizing: border-box;
  margin-top: 10px;
}

[data-theme="dark"] .topic-lock-box {
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.35);
}

.topic-lock-headline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 800;
  color: var(--ink, #0f172a);
  line-height: 1.35;
}

[data-theme="dark"] .topic-lock-headline {
  color: #f1f5f9;
}

.topic-lock-emoji {
  font-size: 14px;
  line-height: 1;
  display: inline-block;
  vertical-align: middle;
}

.topic-lock-time {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.4px;
  color: var(--brand-indigo, #6366f1);
  line-height: 1.25;
}

[data-theme="dark"] .topic-lock-time {
  color: #a5b4fc;
}

/* Pill Lock Badge (for Rows / Small items) */
.topic-lock-pill {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  background: rgba(99, 102, 241, 0.06);
  border: 1px dashed rgba(99, 102, 241, 0.28);
  font-size: 11.5px;
  user-select: none;
  flex-shrink: 0;
  box-sizing: border-box;
}

[data-theme="dark"] .topic-lock-pill {
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.35);
}

.topic-lock-pill .topic-lock-text {
  font-weight: 800;
  color: var(--ink, #0f172a);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

[data-theme="dark"] .topic-lock-pill .topic-lock-text {
  color: #f1f5f9;
}

.topic-lock-pill .topic-lock-time {
  font-size: 11px;
  font-weight: 800;
  color: var(--brand-indigo, #6366f1);
  letter-spacing: 0.3px;
}

[data-theme="dark"] .topic-lock-pill .topic-lock-time {
  color: #a5b4fc;
}

/* Viewer locked state placeholder */
.topic-viewer-locked {
  padding: 50px 20px;
  text-align: center;
}

/* Mobile responsive adjustments */
@media (max-width: 600px) {
  .topic-lock-box {
    padding: 8px 10px;
    gap: 2px;
  }

  .topic-lock-headline {
    font-size: 12px;
    gap: 4px;
    flex-wrap: wrap;
  }

  .topic-lock-emoji {
    font-size: 13px;
  }

  .topic-lock-time {
    font-size: 11.5px;
  }

  .topic-lock-pill {
    padding: 5px 8px;
    align-items: center;
    max-width: 140px;
  }

  .topic-lock-pill .topic-lock-text {
    font-size: 11px;
    white-space: normal;
    text-align: right;
    line-height: 1.25;
  }

  .topic-lock-pill .topic-lock-time {
    font-size: 10.5px;
  }
}

/* =========================================================
   BQ24 STUDENT LEARNING REDESIGN (SCREEN 3 & 4 REFERENCE)
   ========================================================= */

.learning-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.learning-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--ink);
  margin: 0;
  letter-spacing: -0.5px;
}

/* Global (non-media-query) .learning-search-box:
   Consolidates with the scoped definition above.
   Here we only override properties that differ outside the media scope. */
.learning-search-box {
  position: relative;
  display: flex;
  align-items: center;
  height: 46px;
  background: var(--input-bg, var(--card-bg, #ffffff));
  border: 1.5px solid var(--input-border, var(--card-border, #e2e8f0));
  border-radius: 23px;
  padding: 0 14px;
  box-sizing: border-box;
  width: 100%;
  max-width: 340px;
  min-width: 0;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  gap: 0;
}

.learning-search-box:focus-within {
  border-color: var(--brand-indigo, #6366f1);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* Input inside search box: NO border, NO background — the box is the container */
.learning-search-box input,
#learningSearchInput {
  flex: 1;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  outline: none !important;
  box-shadow: none !important;
  padding: 0;
  height: 100%;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  width: 100%;
}

#learningSearchInput::placeholder {
  color: var(--muted, #94a3b8);
  font-weight: 400;
}

.learning-main-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 6px;
  width: 100%;
  max-width: 100%;
}

.learning-main-tabs::-webkit-scrollbar {
  display: none;
}

.learning-main-tab {
  flex-shrink: 0;
  background: var(--card-bg-subtle, #f1f5f9);
  color: var(--muted, #64748b);
  border: 1px solid var(--card-border, #e2e8f0);
  border-radius: 8px;
  padding: 8px 18px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.learning-main-tab:hover {
  color: var(--ink);
  border-color: #cbd5e1;
}

.learning-main-tab.active {
  background: #2563eb !important;
  color: #ffffff !important;
  border-color: #2563eb !important;
  font-weight: 700;
}

/* Learning Hero Today Card */
.learning-hero-container {
  margin-bottom: 24px;
}

.learning-today-hero {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.learning-hero-left {
  flex: 1;
}

.learning-hero-badge-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.learning-hero-pill {
  background: #dcfce7;
  color: #15803d;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 9999px;
  letter-spacing: 0.5px;
}

.learning-hero-date {
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 600;
}

.learning-hero-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 8px 0;
}

.learning-hero-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 18px;
}

.learning-hero-time-card {
  padding: 14px 20px;
  border-radius: 12px;
  background: var(--card-bg-subtle, #f8fafc);
  border: 1px solid var(--card-border, #e2e8f0);
  text-align: right;
  flex-shrink: 0;
}

.learning-hero-time-card .time-label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 4px;
}

.learning-hero-time-card .time-value {
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
  font-family: inherit;
}

[data-theme="dark"] .learning-hero-time-card {
  background: var(--card-bg-subtle, #162238);
  border-color: var(--card-border, #1e293b);
}
[data-theme="dark"] .learning-hero-time-card .time-value {
  color: #f8fafc;
}
[data-theme="dark"] .learning-hero-time-card .time-label {
  color: #94a3b8;
}

/* Two Columns Grid (Screen 3) */
.learning-two-cols-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.learning-col-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.learning-col-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}

.learning-col-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--ink);
  margin: 0;
}

.learning-catalog-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

.learning-search-mini {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--input-bg, #ffffff);
  border: 1px solid var(--input-border, #e2e8f0);
  border-radius: 8px;
  padding: 5px 10px;
}

.learning-search-mini input {
  border: none;
  outline: none;
  background: transparent;
  font-size: 12.5px;
  width: 140px;
  color: var(--ink);
}

.learning-filter-select {
  padding: 5px 10px;
  font-size: 12px;
  border-radius: 8px;
  height: 32px;
  border: 1px solid var(--input-border, #e2e8f0);
  background: var(--card-bg);
  color: var(--ink);
}

/* Topic Cards Grid (Screen 3 & 4: Upcoming, Past, All Topics) */
.learning-past-list,
.learning-upcoming-list,
.learning-topics-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin-bottom: 16px;
}

/* Dedicated Clean Topic Card */
.learning-topic-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 14px 16px;
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--card-border, #e2e8f0);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
  min-height: 104px;
}

[data-theme="dark"] .learning-topic-card {
  background: var(--card-bg, #111a2e);
  border-color: var(--card-border, #1e293b);
  color: var(--ink, #f1f5f9);
}

@media (hover: hover) {
  .learning-topic-card:hover {
    border-color: var(--brand-blue, #2563eb);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.12);
  }
  [data-theme="dark"] .learning-topic-card:hover {
    background: #162238;
    border-color: #3b82f6;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  }
  [data-theme="light"] .learning-topic-card:hover,
  :root:not([data-theme="dark"]) .learning-topic-card:hover {
    background: #ffffff;
  }
}

.learning-topic-card:active {
  transform: translateY(0);
}

.topic-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-width: 0;
  margin-bottom: 4px;
}

.topic-card-date {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted, #64748b);
  line-height: 1.3;
}

[data-theme="dark"] .topic-card-date {
  color: #94a3b8;
}

.topic-card-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--ink, #0f172a);
  margin: 6px 0 10px 0;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: break-word;
  min-width: 0;
  width: 100%;
}

[data-theme="dark"] .topic-card-title {
  color: #f8fafc;
}

.topic-card-footer {
  display: flex;
  align-items: center;
  margin-top: auto;
  padding-top: 4px;
  width: 100%;
  min-width: 0;
}

.topic-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  width: fit-content;
}

.learning-past-callout {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  font-size: 12px;
  margin-top: 14px;
}

[data-theme="dark"] .learning-past-callout {
  background: rgba(30, 58, 138, 0.25);
  border-color: rgba(59, 130, 246, 0.3);
  color: #93c5fd;
}

/* Badges */
.badge-pill-upcoming {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(148, 163, 184, 0.15);
  color: #64748b;
  border: 1px solid rgba(148, 163, 184, 0.25);
  white-space: nowrap;
}

[data-theme="dark"] .badge-pill-upcoming {
  background: rgba(148, 163, 184, 0.2);
  color: #cbd5e1;
  border-color: rgba(148, 163, 184, 0.3);
}

.badge-pill-past {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(56, 189, 248, 0.12);
  color: #0284c7;
  border: 1px solid rgba(56, 189, 248, 0.25);
  white-space: nowrap;
}

[data-theme="dark"] .badge-pill-past {
  background: rgba(56, 189, 248, 0.18);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.35);
}

.badge-pill-green {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(34, 197, 94, 0.12);
  color: #16a34a;
  border: 1px solid rgba(34, 197, 94, 0.25);
  white-space: nowrap;
}

[data-theme="dark"] .badge-pill-green {
  background: rgba(34, 197, 94, 0.18);
  color: #4ade80;
  border-color: rgba(34, 197, 94, 0.35);
}

.badge-pill-blue {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(37, 99, 235, 0.12);
  color: #2563eb;
  border: 1px solid rgba(37, 99, 235, 0.25);
  white-space: nowrap;
}

[data-theme="dark"] .badge-pill-blue {
  background: rgba(59, 130, 246, 0.22);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.35);
}

/* Progress card */
.learning-progress-card {
  padding: 18px 22px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  margin-top: 18px;
}

.learning-hero-container {
  margin-bottom: 0;
}

.empty-state-compact {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
  gap: 8px;
}

/* Mobile Responsive */
@media (max-width: 860px) {
  .learning-two-cols-grid {
    grid-template-columns: 1fr;
  }

  .learning-today-hero {
    flex-direction: column;
    align-items: stretch;
  }

  .learning-hero-time-card {
    text-align: center;
  }
}

@media (max-width: 640px) {
  .learning-past-list,
  .learning-upcoming-list,
  .learning-topics-list {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .learning-topic-card {
    padding: 12px 14px;
    width: 100%;
    min-width: 0;
  }

  .topic-card-title {
    font-size: 13.5px;
    margin: 6px 0 8px 0;
  }
}

/* ========================================
   MOBILE RESPONSIVE: LEARNING TABS & SEARCH
   ======================================== */
@media (max-width: 480px) {
  /* Compact tabs on small phones — reduce padding so all 4 tabs fit or scroll cleanly */
  .learning-main-tab {
    padding: 7px 12px;
    font-size: 12.5px;
    border-radius: 7px;
  }

  /* Ensure tab row does not clip tab text */
  .learning-main-tabs {
    gap: 6px;
    padding-bottom: 4px;
    /* Ensure no parent clips this overflow */
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Search box: full width on mobile, same pill shape */
  .learning-search-box {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    /* Keep border-radius consistent with pill shape */
    border-radius: 23px;
    /* Do NOT override padding — height:46px + padding:0 14px is correct */
  }

  /* Header row: stack vertically on small screens */
  .learning-header-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 14px;
  }

  /* Catalog filter controls: full width on mobile */
  .learning-catalog-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .learning-search-mini {
    width: 100%;
  }

  .learning-search-mini input {
    width: 100%;
  }

  .learning-filter-select {
    width: 100%;
    height: 40px;
  }
}

@media (max-width: 360px) {
  .learning-main-tab {
    padding: 6px 10px;
    font-size: 11.5px;
  }

  .learning-main-tabs {
    gap: 5px;
  }
}

