    @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400&display=swap');

    :root {
      --primary-color: #3b82f6;
      --teacher-bg: #f8fafc;
      --teacher-accent: #2563eb;
      --teach-bg: #f0fdf4;
      --teach-accent: #10b981;
      --header-height: 64px;
    }

    * {
      box-sizing: border-box;
    }

    body {
      margin: 0;
      font-family: 'Inter', system-ui, -apple-system, sans-serif;
      padding-top: var(--header-height);
      background: #ffffff;
      color: #111827;
      min-height: 100vh;
      transition: background 0.3s ease;
    }

    /* Mode Switching Banner */
    #modeHeader {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      height: var(--header-height);
      background: #ffffff;
      border-bottom: 1px solid #e2e8f0;
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0 24px;
      z-index: 1000;
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    }

    .brand {
      display: flex;
      align-items: center;
      gap: 12px;
      font-weight: 700;
      font-size: 1.25rem;
      color: #1e293b;
    }

    .mode-toggle-pill {
      display: flex;
      background: #f1f5f9;
      padding: 4px;
      border-radius: 999px;
      gap: 4px;
      border: 1px solid #e2e8f0;
    }

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

    .theme-toggle,
    .font-size-control {
      display: flex;
      align-items: center;
      gap: 8px;
      color: #64748b;
      font-weight: 600;
    }

    .theme-toggle {
      font-size: 14px;
    }

    .theme-toggle label {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      cursor: pointer;
    }

    .mode-btn {
      padding: 8px 20px;
      border-radius: 999px;
      font-size: 14px;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
      border: none;
      color: #64748b;
      background: transparent;
    }

    .mode-btn.active {
      background: #ffffff;
      color: #1e293b;
      box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

    body.display-mode-active {
      background: #f0fdf4;
    }

    body.display-mode-active #modeHeader {
      background: #ecfdf5;
      border-bottom-color: #d1fae5;
    }

    body.display-mode-active .mode-btn.active {
      color: #059669;
    }

    body.turtle-mode-active {
      background: #fef8e7;
    }

    body.turtle-mode-active #modeHeader {
      background: #fffdf5;
      border-bottom-color: #fef08a;
    }

    body.turtle-mode-active .mode-btn.active {
      color: #b45309;
    }

    body.blocks-mode-active {
      background: #faf5ff;
      padding-top: 0;
    }

    body.blocks-mode-active #modeHeader {
      position: sticky;
      height: auto;
      min-height: var(--header-height);
      background: #faf5ff;
      border-bottom-color: #e9d5ff;
      flex-wrap: wrap;
      align-items: center;
      gap: 8px 14px;
      padding: 8px 16px;
    }

    body.blocks-mode-active .mode-btn.active {
      color: #7e22ce;
    }

    body.blocks-mode-active .brand {
      flex: 0 1 260px;
      min-width: 180px;
      font-size: clamp(1rem, 1.4vw, 1.25rem);
      line-height: 1.15;
    }

    body.blocks-mode-active .visual-controls {
      flex: 1 1 680px;
      min-width: 0;
      gap: 8px;
      justify-content: flex-end;
    }

    body.blocks-mode-active #blocksTabHeader {
      flex: 1 1 520px;
      min-width: 280px;
      margin-left: 0 !important;
      display: flex;
      flex-wrap: wrap;
      justify-content: center;
      gap: 8px !important;
    }

    body.blocks-mode-active #blocksTabHeader span {
      flex: 0 0 auto;
      white-space: nowrap;
      align-self: center;
    }

    body.blocks-mode-active #blocksTabHeader button {
      flex: 0 1 auto;
      min-width: 0;
      white-space: nowrap;
      padding: 6px 12px !important;
      font-size: clamp(12px, 1vw, 14px);
      line-height: 1.15;
    }

    body.blocks-mode-active .toggle-row {
      display: flex;
    }

    html.dark-theme {
      background: #151515;
    }

    body.dark-theme {
      background: #151515 !important;
      color: #f4f4f5;
    }

    body.dark-theme.display-mode-active {
      background: #151515 !important;
    }

    body.dark-theme.turtle-mode-active {
      background: #151515 !important;
    }

    body.dark-theme.blocks-mode-active {
      background: #151515 !important;
    }

    body.dark-theme #modeHeader,
    body.dark-theme.display-mode-active #modeHeader,
    body.dark-theme.turtle-mode-active #modeHeader,
    body.dark-theme.blocks-mode-active #modeHeader {
      background: #1f1f1f;
      border-bottom-color: #3f3f46;
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
    }

    body.dark-theme .brand {
      color: #f4f4f5;
    }

    body.dark-theme .mode-toggle-pill {
      background: #2a2a2a;
      border-color: #3f3f46;
    }

    body.dark-theme .theme-toggle,
    body.dark-theme .font-size-control {
      color: #d4d4d8;
    }

    body.dark-theme .mode-btn {
      color: #a1a1aa;
    }

    body.dark-theme .mode-btn.active {
      background: #3a3a3a;
      color: #ffffff;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
    }

    body.dark-theme.display-mode-active .mode-btn.active {
      color: #5eead4;
    }

    body.dark-theme.blocks-mode-active .mode-btn.active {
      color: #c084fc;
    }

    body.dark-theme .display-badge {
      background: #134e4a;
      color: #99f6e4;
    }

    body.dark-theme .edit-badge {
      background: #1e3a8a;
      color: #bfdbfe;
    }

    body.dark-theme .turtle-badge {
      background: #713f12;
      color: #fef08a;
    }

    body.dark-theme .blocks-badge {
      background: #581c87;
      color: #e9d5ff;
    }

    body.dark-theme .toggle-row,
    body.dark-theme .status,
    body.dark-theme .note,
    body.dark-theme #detectionLabel {
      color: #d4d4d8;
    }

    body.dark-theme .panel,
    body.dark-theme .runner-panel,
    body.dark-theme.display-mode-active .runner-panel,
    body.dark-theme .starter-panel,
    body.dark-theme .console-input-panel {
      background: #202020;
      border-color: #3f3f46;
      color: #f4f4f5;
    }

    body.dark-theme.display-mode-active .runner-panel {
      box-shadow: -4px 0 12px rgba(20, 184, 166, 0.14);
      border-color: #0f766e;
    }

    body.dark-theme .starter-panel p,
    body.dark-theme .console-input-help {
      color: #d4d4d8;
    }

    body.dark-theme .starter-hero,
    body.dark-theme .starter-section {
      border-color: #3f3f46;
    }

    body.dark-theme .starter-kicker,
    body.dark-theme .starter-section summary {
      color: #60a5fa;
    }

    body.dark-theme .igcse-lab {
      background: #1f1f1f;
      border-color: #3f3f46;
    }

    body.dark-theme .starter-section {
      background: #202020;
    }

    body.dark-theme .starter-section summary {
      background: #2a2a2a;
    }

    body.dark-theme .igcse-card {
      border-bottom-color: #3f3f46;
    }

    body.dark-theme .igcse-card h5 {
      color: #f4f4f5;
    }

    body.dark-theme .blocks-code-preview {
      background: #202020;
      border-color: #3f3f46;
    }

    body.dark-theme .blocks-code-preview-header {
      background: #2a2a2a;
      border-bottom-color: #3f3f46;
      color: #f4f4f5;
    }

    body.dark-theme .blocks-preview-theme-toggle {
      color: #d4d4d8;
    }

    body.dark-theme .blockly-ws-search {
      background: #202020;
      border-color: #3f3f46;
      box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
    }

    body.dark-theme .blockly-ws-search-input input {
      background: #202020;
      color: #f4f4f5;
    }

    body.dark-theme .blockly-ws-search-input input::placeholder {
      color: #a1a1aa;
    }

    body.dark-theme .blockly-ws-search button {
      filter: invert(1);
    }

    body.dark-theme #blocksCodePreviewText {
      background: #151515;
      color: #f4f4f5;
    }

    body.dark-theme #blocksCodePreviewText.blocks-colors {
      background: #151515;
      color: #f4f4f5;
    }

    body.dark-theme .blocks-line-import {
      background: #2e1f45;
      border-left-color: #9966ff;
    }

    body.dark-theme .blocks-line-loop {
      background: #3a2d12;
      border-left-color: #ffab19;
    }

    body.dark-theme .blocks-line-logic {
      background: #1c2c3a;
      border-left-color: #5b80a5;
    }

    body.dark-theme .blocks-line-text,
    body.dark-theme .blocks-line-input {
      background: #12352d;
      border-left-color: #0fbd8c;
    }

    body.dark-theme .blocks-line-variable {
      background: #3b1d2d;
      border-left-color: #a55b80;
    }

    body.dark-theme .blocks-line-turtle {
      background: #172a46;
      border-left-color: #4c97ff;
    }

    body.dark-theme .blocks-line-comment {
      background: #27272a;
      border-left-color: #71717a;
      color: #d4d4d8;
    }

    body.dark-theme .blocks-line-default {
      background: #202020;
      border-left-color: #71717a;
    }

    body.dark-theme .starter-button {
      background: #263238;
      border-color: #475569;
      color: #e0f2fe;
    }

    body.dark-theme .starter-button:hover {
      background: #334155;
    }

    body.dark-theme .action-primary,
    body.dark-theme .action-blocks,
    body.dark-theme .action-flowchart,
    body.dark-theme .action-parsons {
      color: #ffffff;
    }

    body.dark-theme .action-primary {
      background: #2563eb;
    }

    body.dark-theme .action-blocks {
      background: #6d28d9;
    }

    body.dark-theme .action-flowchart {
      background: #b45309;
    }

    body.dark-theme .action-parsons {
      background: #047857;
    }

    body.dark-theme .igcse-actions .starter-button:nth-child(2) {
      background: #3b246b;
      border-color: #6d28d9;
      color: #ddd6fe;
    }

    body.dark-theme .igcse-actions .starter-button:nth-child(3) {
      background: #3f2c0b;
      border-color: #b45309;
      color: #fde68a;
    }

    body.dark-theme .igcse-actions .starter-button:nth-child(4) {
      background: #12382b;
      border-color: #047857;
      color: #a7f3d0;
    }

    body.dark-theme .editor-shell {
      background: #151515 !important;
      border-color: #3f3f46;
    }

    body.dark-theme #editor,
    body.dark-theme #displayEditor,
    body.dark-theme #displayEditor code {
      color: #e7e5e4;
      background: transparent;
    }

    body.dark-theme .line-numbers {
      background: #202020 !important;
      color: #a1a1aa !important;
      border-right-color: #3f3f46;
    }

    body.dark-theme .highlight-line {
      background-color: rgba(20, 184, 166, 0.24);
      border-left-color: #2dd4bf;
    }

    body.dark-theme .message {
      background: #172554;
      color: #bfdbfe;
      border-color: #1d4ed8;
    }

    body.dark-theme #callTracePanel,
    body.dark-theme #variablePanel {
      background: #2a2a2a !important;
      border-color: #52525b !important;
      color: #f4f4f5 !important;
    }

    body.dark-theme #callTracePanel h4,
    body.dark-theme #callTraceList,
    body.dark-theme #variablePanel h4,
    body.dark-theme #variableList th,
    body.dark-theme #variableList td {
      color: #f4f4f5 !important;
    }

    body.dark-theme #variableList tr {
      border-color: #52525b !important;
    }

    body.dark-theme #variableList td:last-child {
      color: #86efac !important;
    }

    /* Display debugger tab styles */
    .display-tab-headers {
      display: flex;
      background: #f1f5f9;
      padding: 4px;
      border-radius: 8px;
      gap: 4px;
      border: 1px solid #e2e8f0;
      margin-bottom: 12px;
    }
    body.dark-theme .display-tab-headers {
      background: #2a2a2a;
      border-color: #3f3f46;
    }
    .display-tab-btn {
      flex: 1;
      padding: 6px 12px;
      border-radius: 6px;
      font-size: 13px;
      font-weight: 600;
      cursor: pointer;
      border: none;
      background: transparent;
      color: #64748b;
      transition: all 0.2s ease;
      text-align: center;
    }
    .display-tab-btn.active {
      background: #ffffff;
      color: #059669; /* Green display badge theme color */
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    }
    body.dark-theme .display-tab-btn {
      color: #a1a1aa;
    }
    body.dark-theme .display-tab-btn.active {
      background: #3a3a3a;
      color: #34d399; /* Teal accent color in dark display mode */
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    }

    /* Trace Table Styles */
    .trace-table-grid {
      width: 100%;
      border-collapse: collapse;
      font-family: 'JetBrains Mono', Consolas, Monaco, monospace;
      font-size: 13px;
    }
    .trace-table-grid th {
      padding: 6px 8px;
      border: 1px solid #cbd5e1;
      text-align: left;
      color: #1e293b;
      font-weight: bold;
      background-color: #f1f5f9;
      position: sticky;
      top: 0;
      z-index: 10;
    }
    .trace-table-grid td {
      padding: 6px 8px;
      border: 1px solid #cbd5e1;
      color: #059669;
      font-weight: 600;
    }
    .trace-table-row {
      border-bottom: 1px solid #e2e8f0;
      cursor: pointer;
      transition: background-color 0.15s ease;
    }
    .trace-table-row:hover {
      background-color: #f1f5f9;
    }
    .trace-table-grid td:first-child {
      text-align: center;
      font-weight: bold;
      color: #64748b;
      background-color: #f8fafc;
      min-width: 50px;
    }
    .trace-table-grid td:last-child {
      color: #2563eb;
      font-weight: 500;
    }
    .active-trace-row {
      background-color: rgba(20, 184, 166, 0.15) !important;
    }
    
    /* Dark Theme Trace Table Styles */
    body.dark-theme #traceTablePanel {
      background: #2a2a2a !important;
      border-color: #52525b !important;
      color: #f4f4f5 !important;
    }
    body.dark-theme #traceTablePanel h4 {
      color: #f4f4f5 !important;
    }
    body.dark-theme #traceTablePanel label {
      color: #a1a1aa !important;
    }
    body.dark-theme #traceTableContainer {
      background: #151515 !important;
      border-color: #52525b !important;
    }
    body.dark-theme .trace-table-grid th {
      background-color: #27272a !important;
      border-color: #3f3f46 !important;
      color: #f4f4f5 !important;
    }
    body.dark-theme .trace-table-grid td {
      border-color: #3f3f46 !important;
      color: #34d399 !important;
    }
    body.dark-theme .trace-table-row {
      border-bottom-color: #3f3f46 !important;
    }
    body.dark-theme .trace-table-row:hover {
      background-color: #27272a;
    }
    body.dark-theme .trace-table-grid td:first-child {
      color: #a1a1aa !important;
      background-color: #1e1e1e !important;
    }
    body.dark-theme .trace-table-grid td:last-child {
      color: #60a5fa !important;
    }
    body.dark-theme .active-trace-row {
      background-color: rgba(20, 184, 166, 0.3) !important;
    }

    body.dark-theme .console-input-row input,
    body.dark-theme .input-container input[type="text"] {
      background: #151515;
      color: #f4f4f5;
      border-color: #52525b;
    }

    body.dark-theme #output {
      background: #0f0f0f;
      color: #bbf7d0;
      border-color: #3f3f46;
    }

    body.dark-theme .runner-toggle {
      background: #2a2a2a;
      color: #f4f4f5;
      border-color: #3f3f46;
    }

    body.dark-theme .runner-toggle:hover {
      background: #3a3a3a;
    }


    .input-container {
      margin: 20px 24px 18px;
    }

    .input-container input[type="text"] {
      width: min(900px, 82%);
      padding: 12px 16px;
      font-size: 16px;
      border-radius: 10px;
      border: 1px solid #d1d5db;
      background: #ffffff;
    }

    .input-container button {
      padding: 12px 20px;
      font-size: 16px;
      background-color: var(--primary-color);
      color: white;
      border: none;
      cursor: pointer;
      border-radius: 10px;
      font-weight: 600;
    }

    .starter-panel {
      margin: 0 auto 18px;
      max-width: 1200px;
      padding: 18px;
      background: #f8fafc;
      border: 1px solid #dbe3ef;
      border-radius: 10px;
    }

    .starter-hero {
      display: flex;
      justify-content: space-between;
      gap: 18px;
      align-items: flex-start;
      margin-bottom: 18px;
      padding-bottom: 16px;
      border-bottom: 1px solid #dbe3ef;
    }

    .starter-kicker {
      margin: 0 0 4px;
      color: var(--primary-color);
      font-size: 12px;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: 0;
    }

    .starter-panel h3 {
      margin: 0 0 6px;
      font-size: 24px;
      line-height: 1.15;
    }

    .starter-panel p {
      margin: 0 0 12px;
      color: #475569;
      font-size: 14px;
    }

    .quick-action-row {
      display: flex;
      flex-wrap: wrap;
      justify-content: flex-end;
      gap: 8px;
      min-width: 310px;
    }

    .starter-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
      gap: 10px;
    }

    .starter-button {
      background: #e0ecff;
      color: #1e3a8a;
      border: 1px solid #bfdbfe;
      padding: 10px 12px;
      border-radius: 8px;
      cursor: pointer;
      font-size: 14px;
      font-weight: 600;
      text-align: left;
    }

    .starter-button:hover {
      background: #dbeafe;
    }

    .quick-action-row .starter-button,
    .igcse-actions .starter-button {
      text-align: center;
    }

    .action-primary,
    .action-blocks,
    .action-flowchart,
    .action-parsons {
      color: white;
      border: 0;
      font-weight: 800;
    }

    .action-primary {
      background: var(--primary-color);
    }

    .action-blocks {
      background: #7c3aed;
    }

    .action-flowchart {
      background: #d97706;
    }

    .action-parsons {
      background: #059669;
    }

    .igcse-lab {
      margin-bottom: 18px;
      background: #ffffff;
      border: 1px solid #dbe3ef;
      border-radius: 8px;
      overflow: hidden;
    }

    .igcse-grid {
      display: grid;
      gap: 0;
    }

    .igcse-card {
      display: grid;
      grid-template-columns: minmax(180px, 1fr) minmax(360px, 2.3fr);
      gap: 16px;
      align-items: center;
      padding: 12px 16px;
      border-bottom: 1px solid #e2e8f0;
    }

    .igcse-card:last-child {
      border-bottom: 0;
    }

    .igcse-card h5 {
      margin: 0;
      color: #1e293b;
      font-size: 15px;
    }

    .igcse-actions {
      display: grid;
      grid-template-columns: repeat(4, minmax(72px, 1fr));
      gap: 6px;
    }

    .igcse-actions .starter-button {
      padding: 8px 10px;
      font-size: 12px;
      white-space: nowrap;
    }

    .igcse-actions .starter-button:nth-child(2) {
      background: #ede9fe;
      border-color: #c4b5fd;
      color: #5b21b6;
    }

    .igcse-actions .starter-button:nth-child(3) {
      background: #fef3c7;
      border-color: #fbbf24;
      color: #92400e;
    }

    .igcse-actions .starter-button:nth-child(4) {
      background: #d1fae5;
      border-color: #6ee7b7;
      color: #065f46;
    }

    .starter-section-title {
      margin: 16px 0 6px;
      font-weight: 700;
      font-size: 14px;
    }

    .starter-section {
      margin-top: 16px;
      border: 1px solid #dbe3ef;
      border-radius: 8px;
      background: #ffffff;
      overflow: hidden;
    }

    .starter-section summary {
      cursor: pointer;
      padding: 12px 14px;
      background: #f1f5f9;
      color: #1e293b;
      font-weight: 800;
      border-bottom: 1px solid #dbe3ef;
    }

    .starter-section:not([open]) summary {
      border-bottom: 0;
    }

    .starter-section .starter-grid {
      padding: 14px;
    }

    .starter-section .igcse-lab {
      margin: 0;
      border: 0;
      border-radius: 0;
    }


    .workspace {
      display: none;
      grid-template-columns: minmax(420px, 1fr) auto;
      gap: 18px;
      align-items: stretch;
      transition: grid-template-columns 0.28s ease, gap 0.28s ease;
    }

    .workspace.runner-collapsed {
      grid-template-columns: minmax(420px, 1fr) 42px;
      gap: 12px;
    }

    .workspace-toolbar {
      grid-column: 1 / -1;
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 10px;
      margin-bottom: -2px;
    }

    .panel {
      background: #f8fafc;
      border: 1px solid #dbe3ef;
      border-radius: 10px;
      padding: 14px;
      min-width: 0;
      width: 100%;
      box-sizing: border-box;
      height: 100%;
      display: flex;
      flex-direction: column;
    }

    .panel h3 {
      margin: 0 0 12px;
    }

    .button-row {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-bottom: 12px;
    }

    button {
      color: white;
      border: none;
      padding: 8px 12px;
      cursor: pointer;
      border-radius: 6px;
      font-size: 14px;
    }

    .primary-button {
      background: #007bff;
    }

    .primary-button:disabled {
      background: #94a3b8 !important;
      opacity: 0.6;
      cursor: not-allowed;
    }

    .run-button {
      background: #059669;
    }

    .stop-button {
      background: #dc2626;
    }

    .console-submit-button {
      background: #2563eb;
    }

    .toggle-row {
      display: flex;
      flex-wrap: wrap;
      gap: 16px;
      align-items: center;
      margin: 0 0 12px;
      color: #334155;
      font-size: 14px;
    }

    .paste-counter {
      color: #64748b;
      font-size: 13px;
      font-weight: 600;
      line-height: 1;
      margin-left: 4px;
      min-width: 1ch;
      user-select: none;
    }

    body.dark-theme .paste-counter {
      color: #94a3b8;
    }

    .editor-action-row {
      display: inline-flex;
      gap: 6px;
      align-items: center;
      margin-left: auto;
    }

    .editor-action-button {
      background: #475569;
      color: #ffffff;
      border: none;
      border-radius: 6px;
      padding: 5px 9px;
      font-size: 13px;
      line-height: 1.2;
      min-width: 54px;
    }

    .editor-action-button:hover {
      background: #334155;
    }

    body.dark-theme .editor-action-button {
      background: #3a3a3a;
      color: #f4f4f5;
      border: 1px solid #52525b;
    }

    body.dark-theme .editor-action-button:hover {
      background: #4a4a4a;
      border-color: #71717a;
    }

    body.dark-theme .editor-action-button:focus-visible {
      outline: 2px solid #60a5fa;
      outline-offset: 2px;
    }

    .editor-action-button:disabled {
      cursor: not-allowed;
      opacity: 0.5;
    }

    body.dark-theme .editor-action-button:disabled {
      background: #2a2a2a;
      color: #a1a1aa;
      border-color: #3f3f46;
    }

    .toggle-row label {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      cursor: pointer;
    }

    .mode-badge {
      padding: 4px 8px;
      border-radius: 4px;
      font-size: 10px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      margin-left: 8px;
    }

    .edit-badge {
      background: #dbeafe;
      color: #1e40af;
    }

    .display-badge {
      background: #d1fae5;
      color: #065f46;
      display: none;
    }

    .turtle-badge {
      background: #fef08a;
      color: #854d0e;
      display: none;
    }

    .blocks-badge {
      background: #f3e8ff;
      color: #6b21a8;
      display: none;
    }

    .editor-shell {
      border: 1px solid #cbd5e1;
      border-radius: 8px;
      overflow: hidden;
      background: #ffffff;
      height: 640px;
      display: grid;
      grid-template-columns: 64px 1fr;
      position: relative;
    }

    #editorSplitResizer {
      display: none;
      height: 10px;
      background: #f1f5f9;
      cursor: ns-resize;
      border-top: 1px solid #cbd5e1;
      border-bottom: 1px solid #cbd5e1;
      align-items: center;
      justify-content: center;
      user-select: none;
      transition: background 0.2s ease;
    }

    #editorSplitResizer:hover {
      background: #e2e8f0;
    }

    body.dark-theme #editorSplitResizer {
      background: #202020;
      border-color: #3f3f46;
    }

    body.dark-theme #editorSplitResizer:hover {
      background: #2d2d2d;
    }

    body.dark-theme #editorSplitResizer div {
      background: #52525b !important;
    }

    #displayEditor {
      display: none;
      width: auto;
      height: 100%;
      padding: 14px;
      margin: 0;
      box-sizing: border-box;
      font-family: 'JetBrains Mono', Consolas, Monaco, monospace;
      font-size: 16px;
      line-height: 24px;
      overflow: auto;
      white-space: pre;
      word-break: normal;
      background: transparent;
      position: absolute;
      top: 0;
      left: 64px;
      right: 0;
      bottom: 0;
      z-index: 2;
    }

    #displayEditor code {
      font-family: inherit;
      font-size: inherit;
      line-height: inherit;
      background: none;
      padding: 0;
      text-shadow: none;
    }

    .line-numbers {
      background: #f1f5f9;
      color: #64748b;
      border-right: 1px solid #cbd5e1;
      padding: 14px 8px 14px 0;
      text-align: right;
      font-family: 'JetBrains Mono', monospace;
      font-size: 16px;
      line-height: 24px;
      overflow: hidden;
      user-select: none;
      white-space: pre;
      z-index: 3;
    }

    .highlight-line {
      position: absolute;
      left: 0;
      right: 0;
      background-color: rgba(16, 185, 129, 0.2);
      border-left: 4px solid #10b981;
      z-index: 4;
      pointer-events: none;
    }


    #editor {
      width: 100%;
      height: 100%;
      resize: none;
      border: none;
      padding: 14px;
      box-sizing: border-box;
      font-family: 'JetBrains Mono', Consolas, Monaco, monospace;
      font-size: 16px;
      line-height: 24px;
      background: transparent;
      color: #0f172a;
      outline: none;
      overflow: auto;
      white-space: pre;
      tab-size: 4;
      position: relative;
      z-index: 2;
    }

    .runner-layout {
      display: grid;
      grid-template-columns: 42px minmax(280px, 720px);
      gap: 0;
      align-items: stretch;
      height: 100%;
      min-height: 100%;
    }

    .runner-toggle {
      background: #e2e8f0;
      color: #1e293b;
      border: 1px solid #cbd5e1;
      border-right: none;
      border-radius: 10px 0 0 10px;
      min-height: 100%;
      width: 42px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 22px;
      font-weight: bold;
      cursor: pointer;
      user-select: none;
      transition: background 0.2s ease;
    }

    .runner-toggle:hover {
      background: #cbd5e1;
    }

    .runner-panel {
      padding: 14px;
      background: #f8fafc;
      border: 1px solid #dbe3ef;
      border-radius: 0 10px 10px 0;
      overflow: hidden;
      transition: all 0.28s ease;
      max-width: 720px;
      opacity: 1;
      height: 100%;
      box-sizing: border-box;
      display: flex;
      flex-direction: column;
    }

    .blocks-code-preview {
      background: #ffffff;
      border: 1px solid #cbd5e1;
      border-radius: 8px;
      margin-bottom: 12px;
      overflow: hidden;
      flex: 0 0 auto;
    }

    .blocks-code-preview-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      padding: 8px 10px;
      border-bottom: 1px solid #e2e8f0;
      background: #f1f5f9;
      color: #1e293b;
      font-size: 14px;
      font-weight: 700;
    }

    .blocks-preview-theme-toggle {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      margin-left: auto;
      color: #475569;
      font-size: 12px;
      font-weight: 700;
    }

    .blocks-preview-theme-toggle label {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      cursor: pointer;
      white-space: nowrap;
    }

    .blocks-code-preview-header button {
      border: none;
      border-radius: 6px;
      background: #2563eb;
      color: #ffffff;
      font-size: 12px;
      font-weight: 700;
      padding: 5px 10px;
      cursor: pointer;
    }

    .blockly-ws-search {
      color: #1f2937;
      border-radius: 8px;
      border: 1px solid #cbd5e1;
      box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
    }

    .blockly-ws-search-input input {
      min-width: 210px;
      color: #1f2937;
      font: 13px system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      outline: none;
    }

    .blockly-ws-search button {
      min-width: 26px;
      min-height: 26px;
      cursor: pointer;
    }

    #blocksCodePreviewText {
      margin: 0;
      padding: 10px;
      max-height: 180px;
      overflow: auto;
      background: #ffffff;
      color: #1f2937;
      font-family: Consolas, Monaco, monospace;
      font-size: 13px;
      line-height: 1.45;
      white-space: pre-wrap;
      overflow-wrap: anywhere;
    }

    #blocksCodePreviewText code {
      font-family: inherit;
      font-size: inherit;
      line-height: inherit;
      background: none;
      padding: 0;
      text-shadow: none;
    }

    #blocksCodePreviewText.blocks-colors {
      background: #ffffff;
      color: #1f2937;
    }

    #blocksCodePreviewText.blocks-colors code {
      display: block;
    }

    .blocks-code-line {
      display: block;
      margin: 0 0 4px;
      padding: 5px 8px;
      border-radius: 6px;
      border-left: 5px solid transparent;
      white-space: pre-wrap;
    }

    .blocks-line-import {
      background: #f3e8ff;
      border-left-color: #9966ff;
    }

    .blocks-line-loop {
      background: #fff4d6;
      border-left-color: #ffab19;
    }

    .blocks-line-logic {
      background: #e7f0fa;
      border-left-color: #5b80a5;
    }

    .blocks-line-text,
    .blocks-line-input {
      background: #e6f7f1;
      border-left-color: #0fbd8c;
    }

    .blocks-line-variable {
      background: #fce7f3;
      border-left-color: #a55b80;
    }

    .blocks-line-turtle {
      background: #e8f1ff;
      border-left-color: #4c97ff;
    }

    .blocks-line-comment {
      background: #f1f5f9;
      border-left-color: #94a3b8;
      color: #475569;
    }

    .blocks-line-default {
      background: #f8fafc;
      border-left-color: #64748b;
    }

    .blocks-line-empty {
      min-height: 1.4em;
      background: transparent;
    }

    body.display-mode-active .runner-panel {
      background: #ffffff;
      border-color: #34d399;
      box-shadow: -4px 0 12px rgba(16, 185, 129, 0.05);
    }


    .runner-layout.collapsed .runner-panel {
      max-width: 0;
      opacity: 0;
      padding-left: 0;
      padding-right: 0;
      border-left-width: 0;
      border-right-width: 0;
    }

    .runner-layout.collapsed .runner-toggle {
      border-right: 1px solid #cbd5e1;
      border-radius: 10px;
    }

    .status {
      margin: 8px 0 12px;
      color: #475569;
      font-size: 14px;
      min-height: 20px;
    }

    .message {
      margin: 0 0 12px;
      padding: 12px;
      border-radius: 8px;
      background: #eff6ff;
      color: #1d4ed8;
      border: 1px solid #bfdbfe;
      display: none;
      white-space: pre-wrap;
    }

    .console-input-panel {
      margin-bottom: 12px;
      padding: 12px;
      background: #ffffff;
      border: 1px solid #dbe3ef;
      border-radius: 8px;
      display: none;
    }

    .console-input-help {
      margin: 0 0 8px;
      font-size: 14px;
      color: #475569;
    }

    .console-input-row {
      display: flex;
      gap: 8px;
    }

    .console-input-row input {
      flex: 1;
      padding: 10px;
      border: 1px solid #cbd5e1;
      border-radius: 6px;
      font-family: Consolas, Monaco, monospace;
      font-size: 14px;
    }

    #output {
      background: #111827;
      color: #d1fae5;
      border-radius: 8px;
      padding: 12px;
      min-height: 250px;
      font-family: Consolas, Monaco, monospace;
      white-space: pre-wrap;
      overflow-wrap: anywhere;
      overflow: auto;
      border: 1px solid #1f2937;
      margin-bottom: 12px;
    }

    #output {
      flex-grow: 1;
    }

    .note {
      margin-top: 10px;
      font-size: 14px;
      color: #475569;
    }

    @media (max-width: 1200px) {
      .workspace {
        grid-template-columns: 1fr;
      }

      .runner-layout {
        grid-template-columns: 1fr;
        grid-template-rows: 38px auto;
      }

      .editor-shell {
        height: 420px;
      }

      .runner-toggle {
        min-height: 38px;
        width: 100%;
        border: 1px solid #cbd5e1;
        border-bottom: none;
        border-radius: 10px 10px 0 0;
      }

      .runner-panel {
        max-width: none;
        border-radius: 0 0 10px 10px;
      }

      .runner-layout.collapsed {
        grid-template-rows: 38px 0;
      }

      .runner-layout.collapsed .runner-panel {
        max-width: none;
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
        border-top-width: 0;
        border-bottom-width: 0;
      }

      .runner-layout.collapsed .runner-toggle {
        border: 1px solid #cbd5e1;
        border-radius: 10px;
      }

    }

    @media (max-width: 720px) {
      body {
        padding-top: 0;
      }

      #modeHeader {
        position: sticky;
        height: auto;
        min-height: var(--header-height);
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 10px 12px;
      }

      .brand {
        font-size: 1rem;
        gap: 8px;
        justify-content: center;
      }

      .brand svg {
        width: 20px;
        height: 20px;
        flex: 0 0 auto;
      }

      .mode-badge {
        display: none !important;
      }

      .visual-controls {
        justify-content: center;
        gap: 8px;
      }

      .mode-toggle-pill {
        width: 100%;
      }

      .mode-btn {
        flex: 1;
        padding: 8px 10px;
        font-size: 13px;
      }

      .theme-toggle,
      .font-size-control {
        font-size: 13px;
      }

      .font-size-control {
        flex: 1 1 180px;
        justify-content: center;
      }

      .font-size-control input[type="range"] {
        width: min(150px, 45vw) !important;
      }

      .input-container {
        margin: 12px;
      }

      .input-container input[type="text"] {
        width: 100%;
        margin-bottom: 8px;
      }

      .input-container button {
        width: 100%;
      }

      .starter-panel {
        margin: 12px;
      }

      .starter-hero {
        display: block;
      }

      .quick-action-row {
        justify-content: flex-start;
        min-width: 0;
        margin-top: 12px;
      }

      .igcse-card {
        grid-template-columns: 1fr;
        gap: 10px;
      }

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

      .starter-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
      }

      .workspace {
        gap: 10px;
        grid-template-columns: minmax(0, 1fr);
      }

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

      .workspace-toolbar {
        padding: 0 8px;
        gap: 6px;
      }

      .button-row {
        width: 100%;
        gap: 6px;
        margin-bottom: 8px;
      }

      .workspace-toolbar .button-row button {
        flex: 1 1 calc(50% - 6px);
      }

      button {
        padding: 8px 10px;
        font-size: 13px;
      }

      .panel {
        border-radius: 8px;
        padding: 10px;
      }

      .editor-shell {
        height: 52vh;
        min-height: 300px;
        grid-template-columns: 48px 1fr;
      }

      .line-numbers {
        padding-right: 6px;
      }

      #displayEditor {
        left: 48px;
        padding: 14px 10px;
      }

      #highlightLayer {
        left: 48px !important;
      }

      .runner-layout {
        min-width: 0;
      }

      .runner-panel {
        min-width: 0;
      }

      #callTraceList,
      #variableList {
        max-height: 120px !important;
      }

      #output {
        min-height: 180px;
      }

      .note {
        font-size: 12px;
      }
    }

    @media (max-width: 1100px) {
      body.blocks-mode-active #modeHeader {
        align-items: stretch;
      }

      body.blocks-mode-active .brand {
        flex: 1 1 100%;
        justify-content: center;
        text-align: center;
      }

      body.blocks-mode-active .visual-controls {
        flex: 1 1 100%;
        justify-content: center;
      }

      body.blocks-mode-active #blocksTabHeader {
        flex: 1 1 100%;
      }

      body.blocks-mode-active #blocksTabHeader button {
        flex: 1 1 150px;
      }
    }

    @media print {

      .input-container,
      .starter-panel,
      .button-row,
      .toggle-row,
      .console-input-panel,
      .runner-toggle {
        display: none !important;
      }

      .workspace {
        display: block !important;
      }

      .runner-panel {
        max-width: none !important;
        opacity: 1 !important;
        border-radius: 10px !important;
        border-left-width: 1px !important;
        padding: 14px !important;
      }

      .runner-layout {
        display: block !important;
      }
    }

    /* Instructions Panel Styles */
    .instructions-panel {
      max-width: 1000px;
      margin: 20px auto 40px;
      padding: 30px;
      background: #f8fafc;
      border-radius: 12px;
      box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
      border: 1px solid #e2e8f0;
      color: #334155;
    }

    @media (max-width: 768px) {
      .instructions-panel {
        margin: 12px 12px 40px;
        padding: 20px;
      }
    }

    body.dark-theme .instructions-panel {
      background: #1e293b;
      border-color: #334155;
      color: #cbd5e1;
    }

    .instructions-panel h2 {
      color: var(--primary-color);
      margin-top: 0;
      font-size: 1.5rem;
    }

    .instructions-panel h3 {
      margin-top: 24px;
      border-bottom: 1px solid #e2e8f0;
      padding-bottom: 8px;
      font-size: 1.2rem;
    }

    body.dark-theme .instructions-panel h3 {
      border-color: #334155;
    }

    .instructions-panel p,
    .instructions-panel ul,
    .instructions-panel ol {
      line-height: 1.6;
    }

    .instructions-panel li {
      margin-bottom: 8px;
    }

    .instructions-panel table {
      width: 100%;
      border-collapse: collapse;
      margin-top: 10px;
      background: #ffffff;
      border-radius: 6px;
      overflow: hidden;
    }

    body.dark-theme .instructions-panel table {
      background: #0f172a;
    }

    .instruction-image {
      width: 160px;
      max-width: 100%;
      height: auto;
      border-radius: 8px;
      margin: 12px auto;
      display: block;
      box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
      transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
      background: white;
    }

    .instruction-image:hover {
      transform: scale(1.03) translateY(-2px);
      box-shadow: 0 10px 20px rgba(0, 0, 0, 0.18);
    }

    body.dark-theme .instruction-image {
      background: #1e293b;
      box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
    }

    .instructions-panel th,
    .instructions-panel td {
      text-align: left;
      padding: 12px;
      border-bottom: 1px solid #e2e8f0;
    }

    body.dark-theme .instructions-panel th,
    body.dark-theme .instructions-panel td {
      border-color: #334155;
    }

    .instructions-panel th {
      background: #f1f5f9;
      font-weight: 600;
    }

    body.dark-theme .instructions-panel th {
      background: #1e293b;
    }

    /* Carousel Styles */
    .carousel-container {
      position: relative;
      overflow: visible;
      margin-top: 20px;
    }

    .carousel-track {
      display: block;
    }

    .pythoncopy-hero-carousel {
      position: relative;
      width: 100%;
      aspect-ratio: 16 / 9;
      overflow: hidden;
      border-radius: 12px;
      background: #0f172a;
      box-shadow: 0 14px 30px rgba(15, 23, 42, 0.18);
    }

    .pythoncopy-hero-carousel img {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      object-fit: cover;
      opacity: 0;
      transition: opacity 1.1s ease-in-out;
    }

    .pythoncopy-hero-carousel img.active {
      opacity: 1;
    }

    .pythoncopy-instructions-link {
      margin: 18px 0 0;
      text-align: center;
    }

    .pythoncopy-instructions-link a {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-height: 40px;
      padding: 9px 16px;
      border-radius: 8px;
      background: var(--primary-color);
      color: #ffffff;
      font-weight: 700;
      text-decoration: none;
      box-shadow: 0 8px 16px rgba(59, 130, 246, 0.22);
    }

    .pythoncopy-instructions-link a:hover {
      background: #2563eb;
    }

    body.dark-theme .pythoncopy-hero-carousel {
      box-shadow: 0 16px 34px rgba(0, 0, 0, 0.45);
    }

    @media (prefers-reduced-motion: reduce) {
      .pythoncopy-hero-carousel img {
        transition: none;
      }
    }

    .carousel-controls {
      display: flex;
      justify-content: center;
      align-items: center;
      gap: 14px;
      margin-top: 14px;
    }

    .carousel-btn {
      width: 38px;
      height: 38px;
      border-radius: 999px;
      border: none;
      background: var(--primary-color);
      color: #ffffff;
      cursor: pointer;
      font-size: 26px;
      line-height: 1;
      font-weight: 700;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      box-shadow: 0 8px 16px rgba(59, 130, 246, 0.2);
    }

    .carousel-btn:hover {
      background: #2563eb;
    }

    .carousel-dots {
      display: flex;
      gap: 8px;
    }

    .dot {
      width: 10px;
      height: 10px;
      border-radius: 50%;
      background: #cbd5e1;
      cursor: pointer;
      transition: background 0.3s;
      border: none;
      padding: 0;
    }

    .dot.active {
      background: var(--primary-color);
    }

    body.dark-theme .dot {
      background: #475569;
    }

    body.dark-theme .dot.active {
      background: var(--primary-color);
    }

    /* Footer */
    footer {
      text-align: center;
      padding: 2rem 1rem;
      border-top: 1px solid #e2e8f0;
      font-size: 0.95rem;
      color: #64748b;
      margin-top: 2rem;
      background: #f8fafc;
    }

    body.dark-theme footer {
      background: #0f172a;
      border-color: #334155;
      color: #94a3b8;
    }

    footer a {
      color: var(--primary-color);
      font-weight: 600;
      text-decoration: none;
    }

    footer a.tea {
      color: #e73c7e;
    }


    footer a.computing-link {
      display: inline-block;
      margin-top: 10px;
    }

    /* Reference Links Panel styling */
    .links-panel {
      background: #f8fafc;
      border: 1px solid #dbe3ef;
      border-radius: 10px;
      padding: 14px;
      margin-bottom: 14px;
      transition: all 0.3s ease;
    }

    body.dark-theme .links-panel {
      background: #202020 !important;
      border-color: #3f3f46 !important;
      color: #f4f4f5 !important;
    }

    .links-panel h4 {
      margin: 0 0 10px;
      font-size: 15px;
      font-weight: 600;
      color: #1e293b;
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 8px;
    }

    body.dark-theme .links-panel h4 {
      color: #f4f4f5 !important;
    }

    .links-list {
      display: flex;
      flex-direction: column;
      gap: 8px;
      max-height: 180px;
      overflow-y: auto;
      padding-right: 4px;
    }

    .link-item {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      background: #ffffff;
      border: 1px solid #e2e8f0;
      border-radius: 8px;
      padding: 8px 12px;
      transition: all 0.2s ease;
      box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
    }

    body.dark-theme .link-item {
      background: #151515 !important;
      border-color: #3f3f46 !important;
    }

    .link-item:hover {
      transform: translateY(-1px);
      box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    }

    .link-item-badge {
      cursor: pointer;
      background: #e0f2fe;
      color: #0369a1;
      font-weight: bold;
      font-family: 'JetBrains Mono', monospace;
      font-size: 11px;
      padding: 2px 6px;
      border-radius: 4px;
      flex-shrink: 0;
      border: 1px solid #bae6fd;
      transition: background 0.2s;
    }

    .link-item-badge:hover {
      background: #bae6fd;
    }

    body.dark-theme .link-item-badge {
      background: #1e293b !important;
      color: #38bdf8 !important;
      border-color: #0369a1 !important;
    }

    body.dark-theme .link-item-badge:hover {
      background: #0369a1 !important;
    }

    .link-item-anchor {
      color: #2563eb;
      font-weight: 500;
      font-size: 13px;
      text-decoration: none;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      flex: 1;
      outline: none;
    }

    .link-item-anchor:hover {
      text-decoration: underline;
    }

    body.dark-theme .link-item-anchor {
      color: #60a5fa !important;
    }

    .link-item-btn-preview {
      background: #10b981;
      color: white;
      border: none;
      font-size: 12px;
      font-weight: 600;
      padding: 4px 10px;
      border-radius: 6px;
      cursor: pointer;
      transition: all 0.2s;
    }

    .link-item-btn-preview:hover {
      background: #059669;
    }

    .link-item-btn-open {
      background: #64748b;
      color: white;
      border: none;
      font-size: 12px;
      font-weight: 600;
      padding: 4px 10px;
      border-radius: 6px;
      cursor: pointer;
      text-decoration: none;
      display: inline-flex;
      align-items: center;
      transition: all 0.2s;
    }

    .link-item-btn-open:hover {
      background: #475569;
    }

    .preview-container {
      display: none;
      border-top: 1px solid #e2e8f0;
      padding-top: 12px;
      margin-top: 10px;
      transition: all 0.3s ease;
    }

    body.dark-theme .preview-container {
      border-top-color: #3f3f46 !important;
    }

    .preview-url-title {
      font-size: 12px;
      color: #64748b;
      font-family: 'JetBrains Mono', monospace;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      max-width: 60%;
    }

    body.dark-theme .preview-url-title {
      color: #a1a1aa !important;
    }

    .preview-iframe-wrapper {
      position: relative;
      width: 100%;
      height: 380px;
      background: #ffffff;
      border: 1px solid #cbd5e1;
      border-radius: 8px;
      overflow: hidden;
      box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
    }

    body.dark-theme .preview-iframe-wrapper {
      background: #151515 !important;
      border-color: #3f3f46 !important;
    }

    .preview-iframe-footer {
      position: absolute;
      bottom: 0;
      left: 0;
      right: 0;
      background: rgba(241, 245, 249, 0.95);
      padding: 8px 12px;
      font-size: 11px;
      color: #475569;
      text-align: center;
      border-top: 1px solid #cbd5e1;
    }

    body.dark-theme .preview-iframe-footer {
      background: rgba(32, 32, 32, 0.95) !important;
      color: #d4d4d8 !important;
      border-top-color: #3f3f46 !important;
    }

    /* Quiz Button & Results Styling */
    .quiz-button {
      background: #6366f1 !important;
      color: white !important;
      font-weight: 600 !important;
    }

    .quiz-button:hover {
      background: #4f46e5 !important;
    }

    .quiz-button:active {
      transform: scale(0.97);
    }

    .test-results-container {
      white-space: normal !important;
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
      color: #1e293b !important;
      background: #f8fafc !important;
      border: 1px solid #cbd5e1 !important;
      border-radius: 8px !important;
      padding: 16px !important;
      margin-top: 4px !important;
      text-align: left !important;
    }

    body.dark-theme .test-results-container {
      color: #f1f5f9 !important;
      background: #1e293b !important;
      border-color: #475569 !important;
    }

    .test-results-header {
      display: flex !important;
      justify-content: space-between !important;
      align-items: center !important;
      margin-bottom: 12px !important;
    }

    .test-results-title {
      font-size: 16px !important;
      font-weight: 700 !important;
      color: inherit !important;
    }

    .test-results-badge {
      padding: 4px 10px !important;
      border-radius: 20px !important;
      font-size: 12px !important;
      font-weight: 700 !important;
    }

    .test-results-badge.pass {
      background: #d1fae5 !important;
      color: #065f46 !important;
    }

    body.dark-theme .test-results-badge.pass {
      background: #065f46 !important;
      color: #d1fae5 !important;
    }

    .test-results-badge.fail {
      background: #fee2e2 !important;
      color: #991b1b !important;
    }

    body.dark-theme .test-results-badge.fail {
      background: #991b1b !important;
      color: #fee2e2 !important;
    }

    .test-results-progress-bar {
      height: 6px !important;
      background: #e2e8f0 !important;
      border-radius: 3px !important;
      margin-bottom: 20px !important;
      overflow: hidden !important;
    }

    body.dark-theme .test-results-progress-bar {
      background: #475569 !important;
    }

    .test-results-progress-fill {
      height: 100% !important;
      border-radius: 3px !important;
      transition: width 0.3s ease !important;
    }

    .test-results-progress-fill.pass {
      background: #10b981 !important;
    }

    .test-results-progress-fill.fail {
      background: #ef4444 !important;
    }

    .test-case-list {
      display: flex !important;
      flex-direction: column !important;
      gap: 12px !important;
    }

    .test-case-item {
      border: 1px solid #e2e8f0 !important;
      border-radius: 6px !important;
      background: #ffffff !important;
      overflow: hidden !important;
      transition: box-shadow 0.2s !important;
    }

    body.dark-theme .test-case-item {
      border-color: #334155 !important;
      background: #0f172a !important;
    }

    .test-case-item:hover {
      box-shadow: 0 2px 4px rgba(0,0,0,0.05) !important;
    }

    .test-case-summary {
      display: flex !important;
      align-items: center !important;
      padding: 12px !important;
      cursor: pointer !important;
      user-select: none !important;
    }

    .status-icon {
      font-size: 16px !important;
      margin-right: 10px !important;
      display: flex !important;
      align-items: center !important;
      justify-content: center !important;
    }

    .status-icon.pass {
      color: #10b981 !important;
    }

    .status-icon.fail {
      color: #ef4444 !important;
    }

    .test-case-name {
      font-weight: 600 !important;
      font-size: 14px !important;
      flex-grow: 1 !important;
      color: inherit !important;
    }

    .test-case-status-text {
      font-size: 12px !important;
      font-weight: 600 !important;
      margin-right: 12px !important;
    }

    .test-case-status-text.pass {
      color: #10b981 !important;
    }

    .test-case-status-text.fail {
      color: #ef4444 !important;
    }

    .toggle-details-btn {
      background: #f1f5f9 !important;
      color: #475569 !important;
      border: 1px solid #cbd5e1 !important;
      padding: 4px 10px !important;
      font-size: 11px !important;
      border-radius: 4px !important;
      cursor: pointer !important;
      transition: all 0.15s !important;
    }

    body.dark-theme .toggle-details-btn {
      background: #1e293b !important;
      color: #cbd5e1 !important;
      border-color: #475569 !important;
    }

    .toggle-details-btn:hover {
      background: #e2e8f0 !important;
      color: #1e293b !important;
    }

    body.dark-theme .toggle-details-btn:hover {
      background: #334155 !important;
      color: #f8fafc !important;
    }

    .test-case-details {
      padding: 12px !important;
      border-top: 1px solid #e2e8f0 !important;
      background: #f8fafc !important;
    }

    body.dark-theme .test-case-details {
      border-color: #334155 !important;
      background: #1e293b !important;
    }

    .detail-grid {
      display: grid !important;
      grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
      gap: 12px !important;
    }

    .detail-section {
      display: flex !important;
      flex-direction: column !important;
      gap: 4px !important;
      text-align: left !important;
    }

    .detail-label {
      font-size: 11px !important;
      font-weight: 600 !important;
      color: #64748b !important;
      text-transform: uppercase !important;
      letter-spacing: 0.05em !important;
    }

    .detail-value {
      background: #f1f5f9 !important;
      border: 1px solid #cbd5e1 !important;
      border-radius: 4px !important;
      padding: 8px !important;
      font-family: Consolas, Monaco, monospace !important;
      font-size: 13px !important;
      white-space: pre-wrap !important;
      margin: 0 !important;
      color: #0f172a !important;
      text-align: left !important;
      overflow: auto !important;
    }

    body.dark-theme .detail-value {
      background: #0f172a !important;
      border-color: #334155 !important;
      color: #cbd5e1 !important;
    }

    .detail-value.pass {
      border-color: #a7f3d0 !important;
      background: #ecfdf5 !important;
      color: #065f46 !important;
    }

    body.dark-theme .detail-value.pass {
      border-color: #065f46 !important;
      background: #022c22 !important;
      color: #a7f3d0 !important;
    }

    .detail-value.fail {
      border-color: #fca5a5 !important;
      background: #fef2f2 !important;
      color: #991b1b !important;
    }

    body.dark-theme .detail-value.fail {
      border-color: #991b1b !important;
      background: #450a0a !important;
      color: #fca5a5 !important;
    }

    .expected-check-list {
      list-style: none !important;
      padding: 0 !important;
      margin: 0 !important;
    }

    .expected-check-item {
      display: flex !important;
      align-items: center !important;
      gap: 6px !important;
      font-size: 13px !important;
      margin-bottom: 2px !important;
      color: inherit !important;
    }

    .expected-check-item.pass {
      color: #059669 !important;
    }

    .expected-check-item.fail {
      color: #dc2626 !important;
    }

    /* Course Completion & Progression Styling */
    .quiz-completion-panel {
      margin-top: 16px !important;
      padding: 20px !important;
      border-radius: 8px !important;
      text-align: center !important;
      border: 1px solid #cbd5e1 !important;
      animation: slideIn 0.3s ease-out !important;
    }

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

    .quiz-completion-panel.pass {
      background: #ecfdf5 !important;
      border-color: #a7f3d0 !important;
      color: #065f46 !important;
    }

    body.dark-theme .quiz-completion-panel.pass {
      background: #022c22 !important;
      border-color: #065f46 !important;
      color: #a7f3d0 !important;
    }

    .quiz-completion-panel.end {
      background: #f0fdf4 !important;
      border-color: #bbf7d0 !important;
      color: #166534 !important;
    }

    body.dark-theme .quiz-completion-panel.end {
      background: #052e16 !important;
      border-color: #14532d !important;
      color: #bbf7d0 !important;
    }

    .quiz-completion-panel h4 {
      font-size: 18px !important;
      font-weight: 700 !important;
      margin: 0 0 8px 0 !important;
      color: inherit !important;
    }

    .quiz-completion-panel p {
      font-size: 14px !important;
      margin: 0 0 16px 0 !important;
      color: inherit !important;
    }

    .next-level-btn {
      background: #10b981 !important;
      color: white !important;
      border: none !important;
      padding: 10px 20px !important;
      font-size: 14px !important;
      font-weight: 600 !important;
      border-radius: 6px !important;
      cursor: pointer !important;
      transition: all 0.2s !important;
      display: inline-block !important;
    }

    .next-level-btn:hover {
      background: #059669 !important;
      transform: translateY(-1px) !important;
    }

    .cert-input-row {
      display: flex !important;
      justify-content: center !important;
      gap: 10px !important;
      max-width: 450px !important;
      margin: 0 auto !important;
    }

    .cert-input-row input {
      flex: 1 !important;
      padding: 10px 12px !important;
      border: 1px solid #cbd5e1 !important;
      border-radius: 6px !important;
      font-size: 14px !important;
      outline: none !important;
    }

    body.dark-theme .cert-input-row input {
      background: #0f172a !important;
      border-color: #334155 !important;
      color: #cbd5e1 !important;
    }

    .download-cert-btn {
      background: #eab308 !important;
      color: #1e1b4b !important;
      border: none !important;
      padding: 10px 18px !important;
      font-size: 14px !important;
      font-weight: 700 !important;
      border-radius: 6px !important;
      cursor: pointer !important;
      transition: all 0.2s !important;
    }

    .download-cert-btn:hover {
      background: #ca8a04 !important;
      transform: translateY(-1px) !important;
    }

    /* Playback Controls Bar Styling */
    .playback-controls-bar {
      display: flex;
      flex-direction: column;
      align-items: stretch;
      gap: 12px;
      padding: 12px 18px;
      background: #f8fafc;
      border: 1px solid #cbd5e1;
      border-radius: 10px;
      margin-bottom: 12px;
      box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
      transition: background 0.3s ease, border-color 0.3s ease;
    }

    body.dark-theme .playback-controls-bar {
      background: #222222;
      border-color: #3f3f46;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    }

    .playback-btn-group {
      display: flex;
      gap: 6px;
      align-items: center;
    }

    .playback-control-btn {
      background: #e2e8f0;
      color: #334155;
      border: 1px solid #cbd5e1;
      padding: 6px 12px;
      font-size: 14px;
      font-weight: 600;
      border-radius: 6px;
      cursor: pointer;
      transition: all 0.2s;
      min-width: 38px;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .playback-control-btn:hover:not(:disabled) {
      background: #cbd5e1;
      color: #1e293b;
      transform: translateY(-1px);
    }

    .playback-control-btn:active:not(:disabled) {
      transform: translateY(0);
    }

    .playback-control-btn:disabled {
      opacity: 0.4;
      cursor: not-allowed;
    }

    body.dark-theme .playback-control-btn {
      background: #2d2d2d;
      color: #d4d4d8;
      border-color: #52525b;
    }

    body.dark-theme .playback-control-btn:hover:not(:disabled) {
      background: #3f3f46;
      color: #ffffff;
    }

    .playback-timeline-container {
      flex-grow: 1;
      height: 42px;
      overflow: hidden;
      background: #f1f5f9;
      border: 1px solid #cbd5e1;
      border-radius: 6px;
      display: flex;
      align-items: center;
      padding: 0 10px;
      position: relative;
    }

    body.dark-theme .playback-timeline-container {
      background: #18181b;
      border-color: #3f3f46;
    }

    .playback-timeline-track {
      position: relative;
      width: 100%;
      height: 100%;
      display: flex;
      align-items: center;
    }

    #playbackTimeline {
      width: 100%;
      height: 6px;
      -webkit-appearance: none;
      appearance: none;
      background: #cbd5e1;
      border-radius: 3px;
      outline: none;
      position: relative;
      z-index: 10;
      margin: 0;
    }

    body.dark-theme #playbackTimeline {
      background: #4b5563;
    }

    #playbackTimeline::-webkit-slider-thumb {
      -webkit-appearance: none;
      appearance: none;
      width: 16px;
      height: 16px;
      border-radius: 50%;
      background: var(--primary-color);
      cursor: pointer;
      box-shadow: 0 1px 3px rgba(0,0,0,0.2);
      transition: transform 0.1s;
    }

    #playbackTimeline::-webkit-slider-thumb:hover {
      transform: scale(1.2);
    }

    #playbackTimeline::-moz-range-thumb {
      width: 16px;
      height: 16px;
      border: none;
      border-radius: 50%;
      background: var(--primary-color);
      cursor: pointer;
      box-shadow: 0 1px 3px rgba(0,0,0,0.2);
      transition: transform 0.1s;
    }

    #playbackTimeline::-moz-range-thumb:hover {
      transform: scale(1.2);
    }

    .playback-markers-container {
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      pointer-events: none;
      z-index: 5;
    }

    .playback-marker {
      position: absolute;
      width: 6px;
      height: 50%;
      top: 25%;
      background: #f97316;
      border-radius: 3px;
      cursor: pointer;
      pointer-events: auto;
      transform: translateX(-50%);
      transition: transform 0.15s, background 0.15s;
      box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    }

    .playback-marker:hover {
      background: #ea580c;
      transform: translateX(-50%) scale(1.3);
      z-index: 20;
    }

    .playback-marker.checkpoint-play {
      background: #10b981;
    }
    .playback-marker.checkpoint-play:hover {
      background: #059669;
    }

    .playback-marker.checkpoint-save {
      background: #f59e0b;
    }
    .playback-marker.checkpoint-save:hover {
      background: #d97706;
    }

    .playback-marker.checkpoint-paste {
      background: #ef4444;
    }
    .playback-marker.checkpoint-paste:hover {
      background: #dc2626;
    }

    .playback-status-label {
      font-size: 13px;
      font-weight: 600;
      color: #475569;
      min-width: 200px;
      text-align: right;
      font-family: monospace;
      flex-shrink: 0;
    }

    body.dark-theme .playback-status-label {
      color: #a1a1aa;
    }

    .playback-action-group {
      display: flex;
      gap: 8px;
      align-items: center;
    }

    .playback-action-btn {
      padding: 6px 14px;
      border-radius: 6px;
      font-size: 13px;
      font-weight: 700;
      cursor: pointer;
      border: 1px solid transparent;
      transition: all 0.2s;
    }

    .playback-action-btn.restore {
      background: #10b981;
      color: white;
    }

    .playback-action-btn.restore:hover {
      background: #059669;
      transform: translateY(-1px);
    }

    .playback-action-btn.close {
      background: #ef4444;
      color: white;
    }

    .playback-action-btn.close:hover {
      background: #dc2626;
      transform: translateY(-1px);
    }

    /* Readonly visualization for editor during playback */
    #editor.playback-readonly {
      background: #f1f5f9 !important;
      cursor: not-allowed;
      opacity: 0.85;
    }

    body.dark-theme #editor.playback-readonly {
      background: #1a1a1a !important;
    }

    /* Friendly Error Tips and Highlights */
    .highlight-line-error {
      position: absolute;
      left: 0;
      right: 0;
      background-color: rgba(239, 68, 68, 0.2);
      border-left: 4px solid #ef4444;
      z-index: 4;
      pointer-events: none;
    }

    .friendly-error-tip {
      background-color: #1e1b4b; /* Dark indigo */
      border: 1px solid #312e81;
      border-left: 6px solid #ef4444; /* Highlight left border with red to indicate error */
      border-radius: 8px;
      padding: 14px;
      margin-top: 15px;
      color: #e0e7ff;
      font-family: system-ui, -apple-system, sans-serif;
      line-height: 1.5;
      white-space: normal; /* Override console pre-wrap spacing */
    }

    body.dark-theme .friendly-error-tip {
      background-color: #0f0b29;
      border-color: #231b54;
    }

    .friendly-error-header {
      font-weight: 700;
      font-size: 14px;
      margin-bottom: 6px;
      display: flex;
      align-items: center;
      gap: 6px;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      color: #fca5a5; /* Soft light red */
    }

    .friendly-error-body {
      font-size: 13px;
      color: #cbd5e1;
    }

    .friendly-error-body code {
      background: rgba(0, 0, 0, 0.4);
      padding: 2px 5px;
      border-radius: 4px;
      font-family: Consolas, Monaco, monospace;
      color: #f472b6; /* Pink code tag */
    }

    /* File Request Modal Styles */
    .file-modal-overlay {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: rgba(15, 23, 42, 0.6);
      backdrop-filter: blur(4px);
      -webkit-backdrop-filter: blur(4px);
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 9999;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.25s ease;
    }

    .file-modal-overlay.active {
      opacity: 1;
      pointer-events: auto;
    }

    .file-modal-card {
      background: #ffffff;
      border: 1px solid #e2e8f0;
      border-radius: 16px;
      padding: 24px;
      width: 90%;
      max-width: 440px;
      box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
      transform: scale(0.95);
      transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
      display: flex;
      flex-direction: column;
      gap: 16px;
    }

    .file-modal-overlay.active .file-modal-card {
      transform: scale(1);
    }

    .file-modal-title {
      font-size: 1.25rem;
      font-weight: 700;
      color: #0f172a;
      margin: 0;
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .file-modal-body {
      font-size: 14px;
      color: #475569;
      line-height: 1.5;
      margin: 0;
    }

    .file-modal-filename {
      font-family: 'JetBrains Mono', Consolas, Monaco, monospace;
      background: #f1f5f9;
      color: #0f172a;
      padding: 3px 6px;
      border-radius: 6px;
      font-size: 13px;
      border: 1px solid #e2e8f0;
      font-weight: 600;
      word-break: break-all;
    }

    .file-modal-actions {
      display: flex;
      justify-content: flex-end;
      gap: 12px;
      margin-top: 8px;
    }

    .file-modal-btn {
      padding: 10px 18px;
      font-size: 14px;
      font-weight: 600;
      border-radius: 8px;
      cursor: pointer;
      transition: all 0.2s ease;
      border: none;
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }

    .file-modal-btn-secondary {
      background: #f1f5f9;
      color: #475569;
    }

    .file-modal-btn-secondary:hover {
      background: #e2e8f0;
      color: #0f172a;
    }

    .file-modal-btn-primary {
      background: #2563eb;
      color: #ffffff;
      position: relative;
      overflow: hidden;
    }

    .file-modal-btn-primary:hover {
      background: #1d4ed8;
      box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
    }

    .file-modal-btn-primary input[type="file"] {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      opacity: 0;
      cursor: pointer;
    }

    /* Dark Mode Overrides */
    body.dark-theme .file-modal-card {
      background: #1e1e24;
      border-color: #2d2d34;
      box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    }

    body.dark-theme .file-modal-title {
      color: #f8fafc;
    }

    body.dark-theme .file-modal-body {
      color: #94a3b8;
    }

    body.dark-theme .file-modal-filename {
      background: #111115;
      color: #38bdf8;
      border-color: #2d2d34;
    }

    body.dark-theme .file-modal-btn-secondary {
      background: #2d2d34;
      color: #94a3b8;
    }

    body.dark-theme .file-modal-btn-secondary:hover {
      background: #3e3e4a;
      color: #f8fafc;
    }

    body.dark-theme .file-modal-btn-primary {
      background: #3b82f6;
    }

    body.dark-theme .file-modal-btn-primary:hover {
      background: #2563eb;
    }

    /* Daily Challenge Component Styling */
    .daily-challenge-card {
      margin-top: 16px;
      margin-bottom: 24px;
      padding: 24px;
      background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), rgba(139, 92, 246, 0.05));
      border: 1px solid rgba(59, 130, 246, 0.18);
      border-radius: 14px;
      box-shadow: 0 4px 20px rgba(59, 130, 246, 0.03);
      transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .daily-challenge-card:hover {
      box-shadow: 0 10px 28px rgba(59, 130, 246, 0.09);
      border-color: rgba(59, 130, 246, 0.35);
      transform: translateY(-1px);
    }

    .daily-challenge-content {
      display: flex;
      gap: 24px;
      align-items: center;
    }

    .daily-challenge-text {
      flex: 1;
      display: flex;
      flex-direction: column;
    }

    .daily-challenge-image-container {
      flex: 0 0 140px;
      width: 140px;
      height: 140px;
      display: flex;
      align-items: center;
      justify-content: center;
      overflow: hidden;
      border-radius: 12px;
      box-shadow: 0 8px 16px rgba(0, 0, 0, 0.06);
      background: #f1f5f9;
      border: 1px solid rgba(0, 0, 0, 0.05);
      transition: all 0.3s ease;
    }

    .daily-challenge-card:hover .daily-challenge-image-container {
      transform: scale(1.03) rotate(1deg);
      box-shadow: 0 12px 24px rgba(59, 130, 246, 0.12);
    }

    .daily-challenge-image {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }

    .daily-challenge-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 12px;
    }

    .daily-challenge-badge {
      font-size: 11px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      color: #3b82f6;
      background: rgba(59, 130, 246, 0.08);
      padding: 4px 10px;
      border-radius: 999px;
      display: inline-flex;
      align-items: center;
      gap: 5px;
    }

    .daily-challenge-title {
      margin: 0 0 8px;
      font-size: 18px;
      font-weight: 700;
      color: #1e293b;
      line-height: 1.3;
    }

    .daily-challenge-desc {
      margin: 0 0 18px;
      color: #475569;
      font-size: 13.5px;
      line-height: 1.5;
    }

    .daily-challenge-actions {
      display: flex;
      align-items: center;
      gap: 16px;
      flex-wrap: wrap;
    }

    .daily-challenge-btn {
      text-decoration: none;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      background: linear-gradient(135deg, #3b82f6, #8b5cf6);
      color: #ffffff !important;
      font-weight: 700;
      font-size: 13.5px;
      padding: 11px 22px;
      border-radius: 8px;
      box-shadow: 0 4px 14px rgba(59, 130, 246, 0.25);
      transition: all 0.2s ease;
      border: none;
      cursor: pointer;
      position: relative;
      overflow: hidden;
    }

    .daily-challenge-btn:hover {
      background: linear-gradient(135deg, #2563eb, #7c3aed);
      box-shadow: 0 6px 18px rgba(59, 130, 246, 0.4);
      transform: translateY(-1px);
    }

    .daily-challenge-view-all {
      font-size: 13px;
      color: #64748b;
      text-decoration: underline;
      font-weight: 600;
      transition: color 0.2s;
    }

    .daily-challenge-view-all:hover {
      color: #3b82f6;
    }

    /* Dark theme overrides for Daily Challenge */
    body.dark-theme .daily-challenge-card {
      background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(139, 92, 246, 0.08));
      border-color: rgba(59, 130, 246, 0.25);
      box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    }

    body.dark-theme .daily-challenge-card:hover {
      border-color: rgba(59, 130, 246, 0.45);
      box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
    }

    body.dark-theme .daily-challenge-image-container {
      background: #1e1e24;
      border-color: rgba(255, 255, 255, 0.05);
    }

    body.dark-theme .daily-challenge-badge {
      color: #60a5fa;
      background: rgba(96, 165, 250, 0.15);
    }

    body.dark-theme .daily-challenge-title {
      color: #f8fafc;
    }

    body.dark-theme .daily-challenge-desc {
      color: #cbd5e1;
    }

    body.dark-theme .daily-challenge-view-all {
      color: #94a3b8;
    }

    body.dark-theme .daily-challenge-view-all:hover {
      color: #60a5fa;
    }

    @media (max-width: 600px) {
      .daily-challenge-content {
        flex-direction: column-reverse;
        align-items: stretch;
        gap: 16px;
      }
      .daily-challenge-image-container {
        width: 100%;
        height: 120px;
        flex: 0 0 120px;
      }
    }

    /* Course Buttons / Area */
    .courses-area {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
      gap: 12px;
      margin-top: 8px;
    }

    .course-button {
      display: flex;
      align-items: center;
      gap: 14px;
      text-decoration: none;
      background: #ffffff;
      border: 1px solid #dbe3ef;
      border-radius: 10px;
      padding: 12px;
      transition: all 0.2s ease;
      cursor: pointer;
      color: #1e293b;
    }

    .course-button:hover {
      transform: translateY(-1px);
      box-shadow: 0 4px 12px rgba(59, 130, 246, 0.08);
      border-color: var(--primary-color);
    }

    .course-button-image {
      width: 80px;
      height: 60px;
      border-radius: 6px;
      object-fit: cover;
      flex-shrink: 0;
      border: 1px solid rgba(0, 0, 0, 0.05);
    }

    .course-button-content {
      display: flex;
      flex-direction: column;
      gap: 3px;
      min-width: 0;
    }

    .course-button-title {
      font-size: 14.5px;
      font-weight: 700;
      margin: 0;
      color: #1e293b;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .course-button-desc {
      font-size: 12.5px;
      color: #64748b;
      margin: 0;
      line-height: 1.35;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
    }

    /* Dark theme overrides for course buttons */
    body.dark-theme .course-button {
      background: #202020;
      border-color: #3f3f46;
      color: #f4f4f5;
    }

    body.dark-theme .course-button:hover {
      border-color: var(--primary-color);
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }

    body.dark-theme .course-button-title {
      color: #f4f4f5;
    }

    body.dark-theme .course-button-desc {
      color: #a1a1aa;
    }
