
    :root {
      --bg: #0b0f1a; --bg-card: #141b2d; --bg-elevated: #1c2538;
      --text: #f1f5f9; --text-muted: #94a3b8;
      --green: #22c55e; --green-bg: rgba(34,197,94,0.12);
      --yellow: #eab308; --yellow-bg: rgba(234,179,8,0.12);
      --red: #ef4444; --red-bg: rgba(239,68,68,0.12);
      --blue: #3b82f6; --blue-bg: rgba(59,130,246,0.12);
      --primary: #f59e0b; --border: rgba(255,255,255,0.06); --radius: 16px;
    }
    :root[data-theme="light"] {
      --bg: #f4f6fb; --bg-card: #ffffff; --bg-elevated: #e9edf5;
      --text: #172033; --text-muted: #5b6678;
      --green: #15803d; --green-bg: rgba(21,128,61,0.1);
      --yellow: #a16207; --yellow-bg: rgba(161,98,7,0.1);
      --red: #b91c1c; --red-bg: rgba(185,28,28,0.1);
      --blue: #1d4ed8; --blue-bg: rgba(29,78,216,0.1);
      --border: rgba(15,23,42,0.12);
    }
    :root[data-font-size="small"] { font-size: 15px; }
    :root[data-font-size="normal"] { font-size: 16px; }
    :root[data-font-size="large"] { font-size: 18px; }
    :root[data-reduce-motion="true"] *,
    :root[data-reduce-motion="true"] *::before,
    :root[data-reduce-motion="true"] *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      scroll-behavior: auto !important;
      transition-duration: 0.01ms !important;
    }
    * { margin: 0; padding: 0; box-sizing: border-box; }
    :focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
    .skip-link {
      position: fixed; top: 8px; left: 8px; z-index: 100000;
      transform: translateY(-160%); background: var(--bg-card); color: var(--text);
      border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px;
    }
    .skip-link:focus { transform: translateY(0); }
    body {
      font-family: 'Inter', system-ui, sans-serif;
      background: var(--bg); color: var(--text);
      min-height: 100vh; line-height: 1.5;
      -webkit-font-smoothing: antialiased;
    }

    /* AUTH SCREEN */
    .auth-screen {
      min-height: 100vh; display: flex; flex-direction: column;
      align-items: center; justify-content: center; padding: 24px;
    }
    .auth-card {
      width: 100%; max-width: 400px; background: var(--bg-card);
      border-radius: 24px; padding: 32px 24px; border: 1px solid var(--border);
    }
    .auth-logo {
      text-align: center; margin-bottom: 28px;
    }
    .auth-logo .icon {
      width: 64px; height: 64px; margin: 0 auto 12px;
      background: linear-gradient(135deg, #22c55e, #eab308, #ef4444);
      border-radius: 18px; display: grid; place-items: center; font-size: 32px;
    }
    .auth-logo h1 { font-size: 1.8rem; font-weight: 800; }
    .auth-logo h1 .di { color: #f59e0b; }
    .auth-logo h1 .a2 { color: #ef4444; }
    .auth-logo p { color: var(--text-muted); font-size: 0.9rem; margin-top: 4px; }

    .auth-tabs { display: flex; gap: 8px; margin-bottom: 22px; }
    .auth-tab {
      flex: 1; padding: 10px; text-align: center; border-radius: 12px;
      background: transparent; border: 1px solid var(--border);
      color: var(--text-muted); font-weight: 600; font-size: 0.9rem; cursor: pointer;
    }
    .auth-tab.active {
      background: rgba(245,158,11,0.12); border-color: rgba(245,158,11,0.4); color: var(--primary);
    }

    .form-group { margin-bottom: 14px; }
    .form-group label { display: block; font-size: 0.83rem; font-weight: 500; margin-bottom: 5px; color: var(--text-muted); }
    .date-help { display: block; margin-top: 6px; color: var(--text-muted); font-size: 0.75rem; }
    .form-group input, .form-group select, .form-group textarea {
      width: 100%; background: var(--bg); border: 1px solid var(--border);
      border-radius: 12px; padding: 12px 14px; color: var(--text);
      font-size: 0.93rem; font-family: inherit; outline: none;
    }
    .form-group input:focus { border-color: var(--primary); }

    .btn-primary {
      width: 100%; background: linear-gradient(135deg, #f59e0b, #ef4444);
      border: none; color: white; padding: 14px; border-radius: 14px;
      font-size: 1rem; font-weight: 700; cursor: pointer; margin-top: 6px;
    }
    .btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
    .btn-secondary {
      width: 100%; background: transparent; border: 1px solid var(--border);
      color: var(--text-muted); padding: 12px; border-radius: 14px;
      font-size: 0.93rem; cursor: pointer; margin-top: 8px;
    }
    .auth-error {
      background: var(--red-bg); color: var(--red); padding: 10px 14px;
      border-radius: 10px; font-size: 0.85rem; margin-bottom: 14px; display: none;
    }
    .auth-error.show { display: block; }
    .auth-hint { text-align: center; font-size: 0.8rem; color: var(--text-muted); margin-top: 16px; }

    /* APP SHELL */
    .app-shell { display: none; }
    .app-shell.visible { display: block; }

    .app-header {
      position: sticky; top: 0; z-index: 50;
      background: rgba(11,15,26,0.88); backdrop-filter: blur(16px);
      border-bottom: 1px solid var(--border);
      padding: 14px 20px; display: flex; align-items: center; justify-content: space-between;
    }
    :root[data-theme="light"] .app-header { background: rgba(244,246,251,0.92); }
    .logo { display: flex; align-items: center; gap: 10px; }
    .logo-icon {
      width: 40px; height: 40px;
      background: linear-gradient(135deg, #22c55e, #eab308, #ef4444);
      border-radius: 12px; display: grid; place-items: center; font-size: 20px;
    }
    .logo-text { font-weight: 800; font-size: 1.3rem; }
    .logo-text .di { color: #f59e0b; }
    .logo-text .a2 { color: #ef4444; }
    .header-right { display: flex; align-items: center; gap: 8px; }
    .btn-icon {
      width: 40px; height: 40px; border-radius: 12px;
      background: var(--bg-elevated); border: 1px solid var(--border);
      color: var(--text); display: grid; place-items: center; cursor: pointer; font-size: 18px;
      position: relative;
    }
    .btn-icon .badge-notif {
      position: absolute; top: -4px; right: -4px;
      min-width: 18px; height: 18px; padding: 0 4px;
      background: var(--red); border: 2px solid var(--bg);
      border-radius: 999px; color: white; font-size: 0.65rem; font-weight: 700;
      line-height: 14px; text-align: center; display: none;
    }
    .btn-icon .badge-notif.show { display: block; }
    .user-avatar {
      width: 36px; height: 36px; border-radius: 10px;
      background: linear-gradient(135deg, #f59e0b, #ef4444);
      display: grid; place-items: center; font-weight: 700; font-size: 0.85rem;
      cursor: pointer; border: 0; padding: 0; color: var(--text);
    }

    .container { max-width: 480px; margin: 0 auto; padding: 20px 16px 110px; }
    .screen { display: none; }
    .screen.active { display: block; }

    .greeting h1 { font-size: 1.4rem; font-weight: 700; margin-bottom: 4px; }
    .greeting p { color: var(--text-muted); font-size: 0.93rem; margin-bottom: 20px; }

    .stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-bottom: 24px; }
    .stat-card {
      background: var(--bg-card); border-radius: var(--radius);
      padding: 14px 10px; text-align: center; border: 1px solid var(--border);
    }
    .stat-card .num { font-size: 1.5rem; font-weight: 800; }
    .stat-card .label { font-size: 0.68rem; color: var(--text-muted); margin-top: 3px; text-transform: uppercase; }
    .stat-card.red .num { color: var(--red); }
    .stat-card.yellow .num { color: var(--yellow); }
    .stat-card.green .num { color: var(--green); }

    .section { margin-bottom: 24px; }
    .section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
    .section-title { font-size: 1rem; font-weight: 700; display: flex; align-items: center; gap: 8px; }
    .dot { width: 8px; height: 8px; border-radius: 50%; }
    .dot.red { background: var(--red); }
    .dot.yellow { background: var(--yellow); }
    .dot.green { background: var(--green); }
    .dot.blue { background: var(--blue); }

    .task-list { display: flex; flex-direction: column; gap: 10px; }
    .task-card {
      background: var(--bg-card); border-radius: var(--radius);
      padding: 14px; border: 1px solid var(--border);
      display: flex; gap: 12px; align-items: flex-start;
    }
    .task-badge {
      flex-shrink: 0; padding: 4px 10px; border-radius: 20px;
      font-size: 0.68rem; font-weight: 600; text-transform: uppercase;
    }
    .badge-red { background: var(--red-bg); color: var(--red); }
    .badge-yellow { background: var(--yellow-bg); color: var(--yellow); }
    .badge-green { background: var(--green-bg); color: var(--green); }
    .task-title { font-weight: 600; font-size: 0.92rem; margin-bottom: 3px; }
    .task-meta { font-size: 0.76rem; color: var(--text-muted); }
    .task-discipline {
      display: inline-block; margin-top: 5px; font-size: 0.7rem;
      padding: 2px 8px; background: rgba(255,255,255,0.05); border-radius: 6px; color: var(--text-muted);
    }
    :root[data-theme="light"] .task-discipline { background: rgba(15,23,42,0.06); }
    .task-card > div:nth-child(2) { flex: 1; min-width: 0; }
    .task-card.completed .task-title { color: var(--text-muted); text-decoration: line-through; }
    .task-toggle {
      flex: 0 0 auto; padding: 8px 10px; border: 1px solid var(--border);
      border-radius: 10px; background: var(--bg-elevated); color: var(--text-muted);
      font: inherit; font-size: 0.72rem; cursor: pointer;
    }
    .task-toggle.is-complete { background: var(--green-bg); color: var(--green); }

    .content-card {
      background: var(--bg-card); border-radius: var(--radius);
      padding: 16px; border: 1px solid var(--border); margin-bottom: 10px;
    }
    .content-card h3 { font-size: 0.92rem; font-weight: 600; margin-bottom: 4px; }
    .content-card p { font-size: 0.83rem; color: var(--text-muted); }
    .btn-access {
      margin-top: 10px; display: inline-flex; align-items: center; gap: 6px;
      background: var(--blue-bg); color: var(--blue); border: none;
      padding: 8px 14px; border-radius: 10px; font-size: 0.83rem; font-weight: 600; cursor: pointer;
    }

    /* METRICS */
    .metric-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
    .metric-card {
      background: var(--bg-card); border-radius: var(--radius);
      padding: 16px 12px; border: 1px solid var(--border); text-align: center;
    }
    .metric-card .value { font-size: 1.6rem; font-weight: 800; margin-bottom: 3px; }
    .metric-card .label { font-size: 0.75rem; color: var(--text-muted); }
    .metric-card.highlight { border-color: rgba(245,158,11,0.3); }
    .metric-card.highlight .value { color: var(--primary); }
    .progress-bar { height: 8px; background: rgba(255,255,255,0.06); border-radius: 10px; overflow: hidden; margin-top: 10px; }
    .progress-fill { height: 100%; border-radius: 10px; background: var(--green); transition: width 0.5s; }
    .week-chart { display: flex; align-items: flex-end; gap: 8px; height: 90px; padding: 10px 0 4px; }
    .week-bar { flex: 1; background: var(--bg-elevated); border-radius: 6px 6px 0 0; min-height: 6px; }
    .week-bar.active { background: linear-gradient(180deg, #f59e0b, #ef4444); }
    .week-labels { display: flex; gap: 8px; }
    .week-labels span { flex: 1; text-align: center; font-size: 0.68rem; color: var(--text-muted); }

    /* NOTIFICATIONS SETTINGS */
    .notif-status {
      display: flex; align-items: center; gap: 12px;
      background: var(--bg-card); border-radius: var(--radius);
      padding: 16px; border: 1px solid var(--border); margin-bottom: 16px;
    }
    .notif-status .icon-box {
      width: 44px; height: 44px; border-radius: 12px;
      display: grid; place-items: center; font-size: 22px;
    }
    .notif-status .icon-box.on { background: var(--green-bg); }
    .notif-status .icon-box.off { background: rgba(255,255,255,0.05); }
    :root[data-theme="light"] .notif-status .icon-box.off { background: rgba(15,23,42,0.06); }
    .notif-status .info { flex: 1; }
    .notif-status .info strong { display: block; font-size: 0.92rem; }
    .notif-status .info span { font-size: 0.78rem; color: var(--text-muted); }
    .toggle {
      width: 48px; height: 28px; border-radius: 14px; border: none;
      background: rgba(255,255,255,0.1); position: relative; cursor: pointer;
      transition: 0.2s;
    }
    :root[data-theme="light"] .toggle { background: rgba(15,23,42,0.16); }
    .toggle.on { background: var(--green); }
    .toggle::after {
      content: ''; position: absolute; top: 3px; left: 3px;
      width: 22px; height: 22px; border-radius: 50%; background: white;
      transition: 0.2s;
    }
    .toggle.on::after { left: 23px; }

    .fab {
      position: fixed; bottom: 90px; right: 20px;
      width: 56px; height: 56px; border-radius: 18px;
      background: linear-gradient(135deg, #f59e0b, #ef4444);
      border: none; color: white; font-size: 28px;
      display: grid; place-items: center;
      box-shadow: 0 8px 24px rgba(245,158,11,0.4);
      cursor: pointer; z-index: 40;
    }
    .bottom-nav {
      position: fixed; bottom: 0; left: 0; right: 0;
      background: rgba(11,15,26,0.94); backdrop-filter: blur(16px);
      border-top: 1px solid var(--border);
      display: flex; justify-content: flex-start; overflow-x: auto;
      padding: 10px 0 18px; z-index: 50;
    }
    :root[data-theme="light"] .bottom-nav { background: rgba(255,255,255,0.95); }
    .nav-item {
      display: flex; flex-direction: column; align-items: center; gap: 3px;
      color: var(--text-muted); font-size: 0.6rem; font-weight: 500;
      cursor: pointer; padding: 6px 2px; border-radius: 12px; flex: 0 0 66px; white-space: nowrap;
      background: transparent; border: 0; font-family: inherit; line-height: inherit;
    }
    .nav-item.active { color: var(--primary); }
    .nav-item .icon { font-size: 20px; }

    .modal-overlay {
      position: fixed; inset: 0; background: rgba(0,0,0,0.7);
      z-index: 100; display: none; align-items: flex-end; justify-content: center;
    }
    .modal-overlay.show { display: flex; }
    .modal {
      background: var(--bg-card); width: 100%; max-width: 480px;
      border-radius: 24px 24px 0 0; padding: 24px 20px 40px; 
      animation: slideUp 0.3s ease; max-height: 90vh; overflow-y: auto;
    }
    .report-dialog {
      width: min(480px, calc(100vw - 32px)); max-height: 90vh; margin: auto;
      border: 1px solid var(--border); border-radius: 20px;
      padding: 22px; color: var(--text); background: var(--bg-card);
    }
    .report-dialog::backdrop { background: rgba(0,0,0,0.72); }
    .report-dialog h2 { font-size: 1.1rem; margin-bottom: 8px; }
    .report-dialog p { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 14px; }
    @keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
    .modal h2 { font-size: 1.12rem; margin-bottom: 16px; font-weight: 700; }

    .api-badge {
      display: inline-flex; align-items: center; gap: 6px;
      font-size: 0.7rem; padding: 4px 10px; border-radius: 20px;
      background: rgba(255,255,255,0.04); color: var(--text-muted); margin-bottom: 14px;
    }
    .api-badge .dot-status { width: 7px; height: 7px; border-radius: 50%; }
    .api-badge.online .dot-status { background: var(--green); }
    .api-badge.mock .dot-status { background: var(--yellow); }
    .empty { color: var(--text-muted); font-size: 0.88rem; padding: 12px 0; }

    .toast {
      position: fixed; top: 70px; left: 50%; transform: translateX(-50%);
      background: var(--bg-elevated); border: 1px solid var(--border);
      padding: 12px 20px; border-radius: 12px; font-size: 0.88rem;
      z-index: 200; opacity: 0; transition: 0.3s; pointer-events: none;
      box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    }
    .toast.show { opacity: 1; }
    .chat-log {
      display: flex; flex-direction: column; gap: 10px;
      min-height: 220px; max-height: 48vh; overflow-y: auto;
      padding: 12px; background: var(--bg-card); border: 1px solid var(--border);
      border-radius: var(--radius); margin-bottom: 12px;
    }
    .chat-message {
      max-width: 90%; padding: 10px 12px; border-radius: 12px;
      font-size: 0.88rem; white-space: pre-wrap; overflow-wrap: anywhere;
    }
    .chat-message.assistant { align-self: flex-start; background: var(--bg-elevated); }
    .chat-message.user { align-self: flex-end; background: rgba(245,158,11,0.16); }
    .chat-form textarea {
      width: 100%; min-height: 88px; resize: vertical;
      background: var(--bg-card); border: 1px solid var(--border);
      border-radius: 12px; padding: 12px 14px; color: var(--text);
      font: inherit; outline: none;
    }
    .chat-form textarea:focus { border-color: var(--primary); }
    .chat-status { min-height: 1.4em; color: var(--text-muted); font-size: 0.8rem; margin-top: 8px; }
    .material-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
    .material-card h3 { font-size: 0.96rem; margin-bottom: 4px; }
    .material-meta { color: var(--text-muted); font-size: 0.76rem; margin-bottom: 8px; }
    .material-card audio { width: 100%; margin-top: 10px; }
    .material-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
    .material-actions button, .material-actions a { width: auto; margin: 0; }
    .material-comments { border-top: 1px solid var(--border); margin-top: 14px; padding-top: 12px; }
    .material-comments h4 { font-size: 0.85rem; margin-bottom: 8px; }
    .material-comments summary { cursor: pointer; font-size: 0.85rem; font-weight: 600; }
    .library-filters { display: grid; grid-template-columns: 1fr; gap: 8px; margin-bottom: 12px; }
    .library-filters input, .library-filters select {
      width: 100%; background: var(--bg-card); border: 1px solid var(--border);
      border-radius: 12px; padding: 11px 12px; color: var(--text); font: inherit;
    }
    .section > summary { cursor: pointer; list-style: none; }
    .section > summary::-webkit-details-marker { display: none; }
    .auth-link {
      display: block; margin: 12px auto 0; padding: 6px;
      color: var(--text-muted); background: transparent; border: 0;
      font: inherit; font-size: 0.82rem; text-decoration: underline; cursor: pointer;
    }
    .auth-link[hidden] { display: none; }
    .comment-form { display: flex; gap: 8px; margin-top: 10px; }
    .comment-form input { flex: 1; min-width: 0; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 9px; color: var(--text); font: inherit; }
    .comment-form button { width: auto; margin: 0; }
    .role-pending { color: var(--yellow); }
    .notification-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; margin-bottom: 10px; }
    .notification-card.unread { border-color: rgba(245,158,11,.42); }
    .notification-card h3 { font-size: .92rem; margin-bottom: 4px; }
    .notification-card p { color: var(--text-muted); font-size: .84rem; white-space: pre-wrap; }
    .notification-meta { color: var(--text-muted); font-size: .72rem; margin-top: 8px; }
    .notification-actions { margin-top: 10px; }

    .settings-form {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
      gap: 12px;
      align-items: end;
      margin: 14px 0;
    }
    .settings-form .form-group { margin: 0; }
    .settings-form .btn-primary { margin: 0; }
    .profile-meta { margin-bottom: 8px; overflow-wrap: anywhere; }
    .settings-hint {
      padding: 10px 12px;
      margin: 10px 0;
      border-radius: 10px;
      background: var(--yellow-bg);
      color: var(--yellow) !important;
    }
    .role-request { margin-top: 12px; }
    .settings-preferences {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
      gap: 14px;
      align-items: end;
    }
    .settings-preferences .form-group { margin: 0; }
    .preference-check { display: flex; align-items: center; gap: 10px; min-height: 44px; }
    .preference-check input { width: 18px; height: 18px; accent-color: var(--primary); }

    .auth-screen { display: none; }
    .auth-screen.visible { display: flex; }

    .public-site {
      min-height: 100vh;
      background:
        radial-gradient(ellipse at 82% 7%, rgba(245,158,11,.13), transparent 34rem),
        var(--bg);
    }
    .public-header {
      position: sticky; top: 0; z-index: 20;
      display: flex; align-items: center; justify-content: space-between;
      max-width: 1180px; margin: 0 auto; padding: 18px 28px;
      background: rgba(11,15,26,.88); backdrop-filter: blur(16px);
      border-bottom: 1px solid var(--border);
    }
    :root[data-theme="light"] .public-header { background: rgba(244,246,251,.92); }
    .public-logo {
      color: var(--text); font-size: 1.55rem; font-weight: 850;
      letter-spacing: -.06em; text-decoration: none;
    }
    .public-logo span { color: var(--primary); }
    .public-nav { display: flex; align-items: center; gap: 28px; }
    .public-nav a, .footer-login {
      color: var(--text-muted); font: inherit; text-decoration: none;
    }
    .public-nav a:hover, .footer-login:hover { color: var(--text); }
    .public-nav .public-login, .public-hero-actions .btn-primary,
    .public-hero-actions .btn-secondary {
      width: auto; margin: 0; padding: 11px 18px;
      border-radius: 12px; font: inherit; text-decoration: none;
    }
    .public-nav .public-login { font-weight: 700; }
    .public-hero {
      display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(260px, .8fr);
      align-items: center; gap: 56px; max-width: 1120px;
      min-height: 470px; margin: 0 auto; padding: 72px 28px;
    }
    .public-eyebrow {
      color: var(--primary); font-size: .77rem; font-weight: 800;
      letter-spacing: .13em; text-transform: uppercase;
    }
    .public-hero h1 {
      margin: 14px 0 18px; font-size: clamp(2.5rem, 5vw, 4.3rem);
      line-height: 1.08; letter-spacing: -.055em;
    }
    .public-hero h1 span { color: var(--primary); }
    .public-hero-copy { max-width: 590px; color: var(--text-muted); font-size: 1.07rem; }
    .public-hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
    .public-hero-actions .btn-secondary {
      color: var(--text); border-color: var(--border); font-weight: 650;
    }
    .public-hero-card {
      display: flex; min-height: 260px; flex-direction: column;
      align-items: center; justify-content: center; gap: 14px; padding: 32px;
      text-align: center; background: linear-gradient(145deg, var(--bg-card), var(--bg-elevated));
      border: 1px solid var(--border); border-radius: 28px;
      box-shadow: 0 24px 70px rgba(0,0,0,.24);
    }
    .public-hero-icon { font-size: 3.4rem; }
    .public-hero-card strong { max-width: 240px; font-size: 1.3rem; }
    .public-hero-card > span:last-child { color: var(--text-muted); font-size: .88rem; }
    .public-section { max-width: 1120px; margin: 0 auto; padding: 55px 28px; }
    .public-section h2 { margin: 8px 0 24px; font-size: clamp(1.7rem, 3vw, 2.4rem); letter-spacing: -.035em; }
    .public-feature-grid, .public-course-grid {
      display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px;
    }
    .public-feature-card, .public-course-card {
      background: var(--bg-card); border: 1px solid var(--border);
      border-radius: 18px; padding: 22px;
    }
    .public-feature-card > span { font-size: 1.55rem; }
    .public-feature-card h3 { margin: 12px 0 6px; font-size: 1rem; }
    .public-feature-card p, .public-course-card p {
      color: var(--text-muted); font-size: .88rem;
    }
    .public-section-heading {
      display: flex; align-items: end; justify-content: space-between; gap: 20px;
      margin-bottom: 22px;
    }
    .public-section-heading h2 { margin-bottom: 0; }
    .course-search-label { display: grid; gap: 6px; min-width: 230px; color: var(--text-muted); font-size: .8rem; }
    .course-search-label input {
      width: 100%; padding: 10px 12px; border: 1px solid var(--border);
      border-radius: 10px; background: var(--bg-card); color: var(--text); font: inherit;
    }
    .public-course-card { display: flex; gap: 14px; padding: 18px; }
    .public-course-card[hidden] { display: none; }
    .public-course-icon {
      display: grid; flex: 0 0 46px; width: 46px; height: 46px;
      place-items: center; background: var(--bg-elevated); border-radius: 14px; font-size: 1.35rem;
    }
    .public-course-body { min-width: 0; }
    .course-level {
      display: inline-block; margin-bottom: 6px; color: var(--primary);
      font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
    }
    .public-course-card h3 { margin-bottom: 6px; font-size: .98rem; }
    .course-open {
      margin-top: 14px; padding: 0; border: 0; background: transparent;
      color: var(--primary); font: inherit; font-size: .85rem; font-weight: 750; cursor: pointer;
    }
    .course-empty { margin: 18px 0; color: var(--text-muted); }
    .course-disclaimer { margin-top: 18px; color: var(--text-muted); font-size: .78rem; }
    .public-footer {
      display: flex; justify-content: space-between; gap: 16px;
      max-width: 1120px; margin: 0 auto; padding: 24px 28px;
      border-top: 1px solid var(--border); color: var(--text-muted); font-size: .83rem;
    }
    .footer-login { border: 0; background: transparent; cursor: pointer; }
    .public-footer-actions { display: flex; flex-wrap: wrap; gap: 18px; }
    .cookie-consent {
      position: fixed; z-index: 10000; right: 16px; bottom: 16px; left: 16px;
      display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center;
      gap: 20px; max-width: 1120px; margin: 0 auto; padding: 18px 20px;
      color: var(--text); background: var(--bg-card); border: 1px solid var(--border);
      border-radius: 16px; box-shadow: 0 16px 48px rgba(0,0,0,.4);
    }
    .cookie-consent[hidden] { display: none; }
    .cookie-consent h2 { margin-bottom: 4px; font-size: 1rem; }
    .cookie-consent p, .cookie-settings-dialog p {
      color: var(--text-muted); font-size: .84rem;
    }
    .cookie-consent-actions, .cookie-settings-actions {
      display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px;
    }
    .cookie-consent-actions button, .cookie-settings-actions button {
      width: auto; margin: 0; padding: 10px 12px; font-size: .82rem;
    }
    .cookie-settings-dialog {
      width: min(520px, calc(100% - 28px)); max-height: 84vh; margin: auto;
      padding: 22px; overflow: auto; color: var(--text);
      background: var(--bg-card); border: 1px solid var(--border); border-radius: 18px;
    }
    .cookie-settings-dialog::backdrop { background: rgba(0,0,0,.72); }
    .cookie-settings-dialog form { display: grid; gap: 14px; }
    .cookie-settings-dialog h2 { font-size: 1.2rem; }
    .cookie-option {
      display: flex; align-items: flex-start; gap: 12px; padding: 12px;
      background: var(--bg); border: 1px solid var(--border); border-radius: 12px;
      cursor: pointer;
    }
    .cookie-option input { flex: 0 0 18px; width: 18px; height: 18px; margin-top: 3px; accent-color: var(--primary); }
    .cookie-option span { display: grid; gap: 3px; }
    .cookie-option small { color: var(--text-muted); font-size: .78rem; }
    .course-dialog {
      width: min(620px, calc(100% - 28px)); max-height: min(82vh, 760px);
      margin: auto; padding: 24px; overflow: auto; color: var(--text);
      background: var(--bg-card); border: 1px solid var(--border); border-radius: 20px;
    }
    .course-dialog::backdrop { background: rgba(0,0,0,.72); backdrop-filter: blur(3px); }
    .course-dialog-header { display: flex; align-items: start; justify-content: space-between; gap: 14px; }
    .course-dialog-header h2 { font-size: 1.4rem; }
    .course-dialog-close {
      flex: 0 0 38px; width: 38px; height: 38px; border: 1px solid var(--border);
      border-radius: 10px; background: var(--bg-elevated); color: var(--text);
      font-size: 1.4rem; cursor: pointer;
    }
    .course-dialog-description { margin: 10px 0 12px; color: var(--text-muted); }
    .course-prerequisites {
      padding: 10px 12px; border-left: 3px solid var(--primary);
      background: var(--bg-elevated); border-radius: 8px;
      color: var(--text-muted); font-size: .84rem;
    }
    .course-scope-note {
      margin-top: 10px; padding: 10px 12px; border-radius: 8px;
      background: var(--yellow-bg); color: var(--yellow); font-size: .82rem;
    }
    #course-dialog-content h3 { margin-top: 18px; font-size: 1rem; }
    .course-progress { margin: 7px 0 10px; color: var(--text-muted); font-size: .8rem; }
    .course-progress-bar { display: block; width: 100%; height: 10px; margin-bottom: 14px; accent-color: var(--primary); }
    .course-modules { display: grid; gap: 9px; }
    .course-module { padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); }
    .course-module summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; }
    .course-module-title { font-weight: 650; }
    .course-module-count { flex: 0 0 auto; color: var(--text-muted); font-size: .76rem; }
    .course-lesson-list { display: grid; gap: 8px; list-style: none; }
    .course-module .course-lesson-list { margin-top: 12px; }
    .course-lesson { display: flex; align-items: start; gap: 10px; }
    .course-lesson input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--primary); }
    .course-lesson label { cursor: pointer; }
    .course-quiz { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--border); }
    .course-quiz-note { margin: 7px 0 12px; color: var(--text-muted); font-size: .8rem; }
    .course-quiz-question { margin: 12px 0; padding: 12px; border: 1px solid var(--border); border-radius: 12px; }
    .course-quiz-question h4 { margin-bottom: 5px; font-size: .9rem; }
    .course-quiz-question > p { margin-bottom: 10px; }
    .course-quiz-options { display: grid; gap: 8px; }
    .course-quiz-option {
      padding: 10px 12px; text-align: left; border: 1px solid var(--border);
      border-radius: 10px; background: var(--bg); color: var(--text); font: inherit; cursor: pointer;
    }
    .course-quiz-option:hover:not(:disabled) { border-color: var(--primary); }
    .course-quiz-option:disabled { cursor: default; opacity: .7; }
    .course-quiz-feedback { margin-top: 10px; font-size: .88rem; }
    .course-quiz-feedback.is-correct { color: var(--green); }
    .course-quiz-feedback.is-incorrect { color: var(--yellow); }
    .course-quiz-summary { margin-top: 12px; font-weight: 650; }
    .course-faq details {
      margin-top: 10px; padding: 15px 17px; background: var(--bg-card);
      border: 1px solid var(--border); border-radius: 12px;
    }
    .course-faq summary { cursor: pointer; font-weight: 650; }
    .course-faq details p { margin-top: 10px; color: var(--text-muted); font-size: .9rem; }

    @media (max-width: 760px) {
      .public-header { padding: 14px 18px; }
      .public-nav { gap: 14px; }
      .public-nav a { font-size: .88rem; }
      .public-hero { grid-template-columns: 1fr; gap: 28px; min-height: auto; padding: 58px 20px; }
      .public-hero-card { min-height: 190px; }
      .public-section { padding: 42px 20px; }
      .public-feature-grid, .public-course-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    }
    @media (max-width: 520px) {
      .public-nav { gap: 10px; }
      .public-nav a { display: none; }
      .public-nav .public-login { padding: 9px 14px; }
      .public-hero { padding-top: 44px; }
      .public-hero h1 { font-size: 2.65rem; }
      .public-hero-actions { align-items: stretch; flex-direction: column; }
      .public-hero-actions .btn-primary, .public-hero-actions .btn-secondary { text-align: center; }
      .public-feature-grid, .public-course-grid { grid-template-columns: 1fr; }
      .public-section-heading { align-items: stretch; flex-direction: column; }
      .course-search-label { min-width: 0; }
      .public-footer { align-items: start; flex-direction: column; padding: 20px; }
      .cookie-consent { grid-template-columns: 1fr; gap: 12px; padding: 16px; }
      .cookie-consent-actions { justify-content: stretch; }
      .cookie-consent-actions button, .cookie-settings-actions button { flex: 1 1 auto; }
      .course-dialog { padding: 18px; }
    }
  