/* AI Lecturer — Standalone App Styles */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  background: #f1f5f9;
  color: #1e293b;
  min-height: 100vh;
}

body.view-login, body.view-register { background: #1e293b; }

a { color: #4f46e5; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Nav ────────────────────────────────────────────────────────────────── */
.app-nav {
  background: #1e293b;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 52px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 rgba(255,255,255,.08);
}
.nav-brand { font-weight: 700; font-size: 1rem; letter-spacing: -.01em; }
.nav-links  { display: flex; align-items: center; gap: 20px; font-size: .875rem; }
.nav-links a { color: #94a3b8; transition: color .12s; }
.nav-links a:hover, .nav-links a.active { color: #fff; text-decoration: none; }
.nav-user   { color: #e2e8f0; font-size: .82rem; }
.nav-logout { color: #f87171 !important; }

/* ── Layout ─────────────────────────────────────────────────────────────── */
.app-main { max-width: 1100px; margin: 0 auto; padding: 32px 24px; }
body.view-chat .app-main, body.view-login .app-main, body.view-register .app-main {
  max-width: 100%; padding: 0;
}
body.view-chat .app-nav { display: none; }

/* ── Auth ───────────────────────────────────────────────────────────────── */
.auth-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
.auth-box {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 8px 40px rgba(0,0,0,.2);
  padding: 40px;
  width: 100%;
  max-width: 420px;
}
.auth-logo { font-size: 2.5rem; text-align: center; margin-bottom: 12px; }
.auth-box h1 { text-align: center; font-size: 1.4rem; color: #1e293b; margin-bottom: 4px; }
.auth-sub { text-align: center; color: #64748b; font-size: .875rem; margin-bottom: 28px; }
.auth-foot { text-align: center; color: #64748b; font-size: .82rem; margin-top: 20px; }
.auth-box label { display: block; font-size: .82rem; font-weight: 600; color: #374151; margin-bottom: 4px; }
.auth-box input { width: 100%; border: 1.5px solid #e2e8f0; border-radius: 8px; padding: 9px 12px; font-size: .9rem; color: #1e293b; margin-bottom: 14px; outline: none; transition: border-color .15s; }
.auth-box input:focus { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,.1); }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 5px; padding: 8px 16px; border-radius: 8px; border: none; font-size: .875rem; font-weight: 600; cursor: pointer; transition: all .12s; text-decoration: none; white-space: nowrap; }
.btn-primary   { background: #4f46e5; color: #fff; }
.btn-primary:hover { background: #4338ca; color: #fff; }
.btn-secondary { background: #f1f5f9; color: #374151; border: 1px solid #e2e8f0; }
.btn-secondary:hover { background: #e2e8f0; }
.btn-outline   { background: transparent; color: #4f46e5; border: 1.5px solid #4f46e5; }
.btn-outline:hover { background: #f5f3ff; }
.btn-danger    { background: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-full  { width: 100%; justify-content: center; padding: 11px; font-size: .95rem; }
.btn-sm    { padding: 5px 12px; font-size: .8rem; }
.btn-xs    { padding: 3px 8px; font-size: .75rem; border-radius: 5px; }
.btn-icon  { background: none; border: none; cursor: pointer; font-size: 1rem; padding: 4px 6px; border-radius: 5px; transition: background .12s; }
.btn-danger-icon:hover { background: #fef2f2; }

/* ── Cards ──────────────────────────────────────────────────────────────── */
.card { background: #fff; border-radius: 10px; box-shadow: 0 1px 4px rgba(0,0,0,.07); overflow: hidden; }
.card-header { padding: 14px 20px; font-weight: 700; font-size: .9rem; border-bottom: 1px solid #f1f5f9; color: #1e293b; background: #fff; }
.card-body   { padding: 20px; }

/* ── Page header ────────────────────────────────────────────────────────── */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 24px; gap: 16px; }
.page-header h2 { font-size: 1.4rem; color: #1e293b; }
.page-sub { color: #64748b; font-size: .875rem; margin-top: 4px; }
.back-link { color: #64748b; font-size: .82rem; display: block; margin-bottom: 4px; }
.back-link:hover { color: #1e293b; }

/* ── Course grid ────────────────────────────────────────────────────────── */
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.course-card { background: #fff; border-radius: 10px; box-shadow: 0 1px 4px rgba(0,0,0,.07); padding: 18px; display: flex; flex-direction: column; transition: box-shadow .15s; }
.course-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.1); }
.course-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.course-code { background: #f0f4ff; color: #4f46e5; font-size: .75rem; font-weight: 700; padding: 3px 8px; border-radius: 4px; font-family: monospace; letter-spacing: .06em; }
.course-title { font-size: 1rem; font-weight: 700; color: #1e293b; margin-bottom: 6px; }
.course-desc  { font-size: .82rem; color: #64748b; line-height: 1.5; margin-bottom: 10px; flex: 1; }
.course-meta  { display: flex; gap: 12px; font-size: .78rem; color: #64748b; margin-bottom: 14px; }
.course-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }

/* ── Empty state ────────────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-icon  { font-size: 3rem; margin-bottom: 14px; }
.empty-state h3 { font-size: 1.1rem; color: #1e293b; margin-bottom: 6px; }
.empty-state p  { color: #64748b; margin-bottom: 20px; }

/* ── Form helpers ───────────────────────────────────────────────────────── */
label  { display: block; font-size: .82rem; font-weight: 600; color: #374151; margin-bottom: 4px; margin-top: 12px; }
label:first-child { margin-top: 0; }
input[type=text], input[type=email], input[type=password], input[type=number], textarea, select {
  width: 100%; border: 1.5px solid #e2e8f0; border-radius: 8px;
  padding: 8px 12px; font-size: .875rem; font-family: inherit;
  color: #1e293b; outline: none; transition: border-color .15s;
  background: #fff;
}
input:focus, textarea:focus, select:focus { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,.1); }
textarea { resize: vertical; }
.form-msg { font-size: .82rem; margin-top: 8px; min-height: 1.2em; }
.form-msg.ok  { color: #16a34a; }
.form-msg.err { color: #dc2626; }
.alert { padding: 10px 14px; border-radius: 6px; font-size: .85rem; margin-bottom: 16px; }
.alert-error { background: #fef2f2; border: 1px solid #fecaca; color: #dc2626; }
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #16a34a; }

/* ── Upload ─────────────────────────────────────────────────────────────── */
.upload-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media(max-width:600px){ .upload-grid { grid-template-columns: 1fr; } }
.dropzone { border: 2px dashed #e2e8f0; border-radius: 8px; padding: 16px; text-align: center; cursor: pointer; transition: all .15s; background: #f8fafc; position: relative; }
.dropzone.dragover { border-color: #6366f1; background: #f5f3ff; }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.dropzone-label { font-size: .82rem; color: #64748b; pointer-events: none; }
.upload-actions { display: flex; align-items: center; gap: 14px; margin-top: 14px; flex-wrap: wrap; }
.progress { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 160px; }
.progress-bar-wrap { flex: 1; height: 6px; background: #e2e8f0; border-radius: 3px; overflow: hidden; }
.progress-bar { height: 100%; background: #4f46e5; width: 0; transition: width .2s; border-radius: 3px; }
.hidden { display: none !important; }

/* ── Data table ─────────────────────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.data-table th { text-align: left; padding: 10px 14px; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #64748b; border-bottom: 1px solid #f1f5f9; white-space: nowrap; }
.data-table td { padding: 12px 14px; border-bottom: 1px solid #f8fafc; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #fafafa; }
.muted { color: #94a3b8; font-size: .8rem; }
.error-text { color: #ef4444; font-size: .75rem; }

/* ── Badges & status ────────────────────────────────────────────────────── */
.badge { background: #f0f4ff; color: #4f46e5; font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 4px; font-family: monospace; }
.badge-admin    { background: #fef3c7; color: #92400e; }
.badge-lecturer { background: #ede9fe; color: #6d28d9; }
.type-badge { font-size: .72rem; font-weight: 600; padding: 2px 8px; border-radius: 4px; }
.type-document     { background: #eff6ff; color: #1d4ed8; }
.type-presentation { background: #fff7ed; color: #c2410c; }
.type-code         { background: #f0fdf4; color: #166534; }

.status { font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 20px; }
.status-approved   { background: #dcfce7; color: #15803d; }
.status-pending    { background: #fef9c3; color: #a16207; animation: pulse 2s ease-in-out infinite; }
.status-processing { background: #dbeafe; color: #1d4ed8; animation: pulse 1.4s ease-in-out infinite; }
.status-failed     { background: #fee2e2; color: #b91c1c; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.55} }

/* ── Stats ──────────────────────────────────────────────────────────────── */
.stats-row { display: flex; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.stat-card { background: #fff; border-radius: 10px; box-shadow: 0 1px 4px rgba(0,0,0,.07); padding: 20px 28px; text-align: center; }
.stat-num { font-size: 2rem; font-weight: 700; color: #4f46e5; }
.stat-lbl { font-size: .78rem; color: #64748b; margin-top: 2px; }

/* ── Modal ──────────────────────────────────────────────────────────────── */
.modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 200; align-items: center; justify-content: center; padding: 20px; }
.modal.open { display: flex; }
.modal-box { background: #fff; border-radius: 12px; width: 100%; max-width: 520px; box-shadow: 0 20px 60px rgba(0,0,0,.2); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid #f1f5f9; }
.modal-header h3 { font-size: 1rem; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 1.1rem; cursor: pointer; color: #64748b; padding: 2px 6px; border-radius: 4px; }
.modal-close:hover { background: #f1f5f9; }
.modal-box form { padding: 20px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* ── Course name display in chat sidebar ────────────────────────────────── */
.course-name-display { font-size: .88rem; font-weight: 600; color: #e2e8f0; }
.course-code-display { font-size: .75rem; color: #64748b; margin-top: 2px; }
.sidebar-footer { padding: 12px 14px; border-top: 1px solid rgba(255,255,255,.07); }
.sidebar-back { font-size: .78rem; color: #64748b; }
.sidebar-back:hover { color: #94a3b8; text-decoration: none; }

/* ══════════════════════════════════════════════════════════════════════════
   CHAT WIDGET  (identical design to WordPress plugin version)
   ══════════════════════════════════════════════════════════════════════════ */
.ail-widget {
  display: flex;
  height: calc(100vh - 0px);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  background: #fff;
}
.ail-sidebar {
  width: 240px; background: #1e293b; color: #fff;
  display: flex; flex-direction: column; flex-shrink: 0; overflow: hidden;
}
.ail-sidebar-header { padding: 16px; border-bottom: 1px solid rgba(255,255,255,.08); display: flex; align-items: center; gap: 10px; }
.ail-logo-mark  { font-size: 1.6rem; line-height: 1; }
.ail-logo-title { font-weight: 700; font-size: .9rem; }
.ail-logo-sub   { font-size: .72rem; color: #94a3b8; }
.ail-user-info  { padding: 12px 14px; border-bottom: 1px solid rgba(255,255,255,.08); display: flex; align-items: center; gap: 9px; }
.ail-avatar { width: 30px; height: 30px; border-radius: 50%; background: #4f46e5; display: flex; align-items: center; justify-content: center; font-size: .75rem; font-weight: 700; flex-shrink: 0; }
.ail-user-name { font-size: .82rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ail-sidebar-section { padding: 12px 14px; border-bottom: 1px solid rgba(255,255,255,.05); }
.ail-sidebar-section.ail-grow { flex: 1; overflow-y: auto; border-bottom: none; }
.ail-sidebar-label { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: #64748b; margin-bottom: 6px; }
.ail-sidebar-label-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.ail-icon-btn { background: none; border: none; color: #475569; cursor: pointer; font-size: 1rem; padding: 2px 4px; border-radius: 4px; }
.ail-icon-btn:hover { color: #fff; background: rgba(255,255,255,.1); }
.ail-sessions { padding-top: 2px; }
.ail-session-btn { display: block; width: 100%; background: none; border: none; color: #94a3b8; text-align: left; padding: 7px 8px; border-radius: 6px; font-size: .78rem; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: all .12s; }
.ail-session-btn:hover { background: rgba(255,255,255,.07); color: #e2e8f0; }
.ail-session-btn.active { background: rgba(99,102,241,.25); color: #fff; }
.ail-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; background: #f8fafc; }
.ail-chat-header { background: #fff; border-bottom: 1px solid #e2e8f0; padding: 12px 20px; flex-shrink: 0; }
.ail-chat-header-title { font-weight: 600; color: #1e293b; }
.ail-chat-header-sub   { font-size: .78rem; color: #94a3b8; margin-top: 1px; }
.ail-messages { flex: 1; overflow-y: auto; padding: 20px 16px; display: flex; flex-direction: column; gap: 16px; }
.ail-welcome { margin: auto; text-align: center; max-width: 380px; padding: 20px; }
.ail-welcome-icon { font-size: 3rem; margin-bottom: 12px; }
.ail-welcome h3 { color: #1e293b; font-size: 1.1rem; margin: 0 0 6px; }
.ail-welcome p  { color: #64748b; line-height: 1.6; margin: 0 0 16px; }
.ail-suggestions { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.ail-suggestion-btn { background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 8px 12px; font-size: .82rem; color: #475569; cursor: pointer; text-align: left; transition: all .12s; }
.ail-suggestion-btn:hover { border-color: #6366f1; color: #4f46e5; background: #f5f3ff; }
.ail-msg-row { display: flex; animation: ail-fadein .2s ease; }
.ail-msg-row.user      { justify-content: flex-end; }
.ail-msg-row.assistant { justify-content: flex-start; }
.ail-bubble { max-width: 80%; padding: 10px 14px; border-radius: 14px; line-height: 1.6; font-size: .875rem; }
.ail-msg-row.user .ail-bubble      { background: #4f46e5; color: #fff; border-bottom-right-radius: 4px; }
.ail-msg-row.assistant .ail-bubble { background: #fff; color: #1e293b; border: 1px solid #e2e8f0; border-bottom-left-radius: 4px; }
.ail-bubble h1,.ail-bubble h2,.ail-bubble h3 { font-weight: 700; margin: .6em 0 .3em; }
.ail-bubble p  { margin: .4em 0; }
.ail-bubble ul,.ail-bubble ol { padding-left: 1.3em; margin: .4em 0; }
.ail-bubble li { margin: .2em 0; }
.ail-bubble code { background: #f1f5f9; padding: .1em .35em; border-radius: 4px; font-size: .83em; font-family: monospace; }
.ail-bubble pre { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 6px; padding: 10px; overflow-x: auto; margin: .5em 0; }
.ail-bubble pre code { background: none; padding: 0; }
.ail-bubble strong { font-weight: 700; color: #dc2626; }
.ail-bubble em     { font-style: italic; }
.ail-bubble hr     { border: none; border-top: 1px solid #e2e8f0; margin: .6em 0; }
.ail-sources { margin-top: 8px; border-top: 1px solid #f1f5f9; padding-top: 6px; }
.ail-sources-toggle { display: flex; align-items: center; gap: 4px; font-size: .75rem; color: #94a3b8; cursor: pointer; background: none; border: none; padding: 0; }
.ail-sources-toggle:hover { color: #64748b; }
.ail-sources-toggle .ail-chevron { transition: transform .15s; }
.ail-sources-toggle.open .ail-chevron { transform: rotate(90deg); }
.ail-sources-list { margin-top: 6px; display: flex; flex-direction: column; gap: 4px; }
.ail-source-item { display: flex; align-items: center; gap: 7px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 6px; padding: 5px 10px; font-size: .75rem; color: #475569; }
.ail-thinking .ail-bubble { display: flex; align-items: center; gap: 4px; padding: 12px 16px; }
.ail-dot { width: 7px; height: 7px; border-radius: 50%; background: #94a3b8; animation: ail-blink 1.2s infinite; }
.ail-dot:nth-child(2) { animation-delay: .2s; }
.ail-dot:nth-child(3) { animation-delay: .4s; }
@keyframes ail-blink { 0%,80%,100%{opacity:.2;transform:scale(.8)} 40%{opacity:1;transform:scale(1)} }
.ail-input-bar { background: #fff; border-top: 1px solid #e2e8f0; padding: 12px 16px 8px; flex-shrink: 0; }
.ail-input-box { display: flex; align-items: flex-end; gap: 8px; background: #fff; border: 1.5px solid #e2e8f0; border-radius: 12px; padding: 8px 10px; transition: border-color .15s; }
.ail-input-box:focus-within { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,.1); }
.ail-input-box textarea { flex: 1; border: none; background: transparent; resize: none; font-size: .9rem; line-height: 1.5; max-height: 120px; outline: none; font-family: inherit; color: #1e293b; }
.ail-input-box textarea::placeholder { color: #94a3b8; }
#ail-send-btn { width: 34px; height: 34px; flex-shrink: 0; background: #4f46e5; border: none; border-radius: 8px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .15s; }
#ail-send-btn:hover { background: #4338ca; }
#ail-send-btn svg { width: 16px; height: 16px; stroke: #fff; }
.ail-disclaimer { font-size: .7rem; color: #94a3b8; text-align: center; margin: 6px 0 0; }
@keyframes ail-fadein { from{opacity:0;transform:translateY(6px)} to{opacity:1;transform:translateY(0)} }

@media(max-width:600px) {
  .ail-widget  { flex-direction: column; height: 100vh; }
  .ail-sidebar { width: 100%; max-height: 200px; }
  .app-main    { padding: 16px; }
}

/* ── Footer ─────────────────────────────────────────────────────────────── */
.app-footer {
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  padding: 12px 24px;
  text-align: center;
  font-size: .75rem;
  color: #94a3b8;
  flex-shrink: 0;
}
.footer-inner { display: inline-flex; align-items: center; gap: 8px; }
.footer-sep   { color: #cbd5e1; }
.app-footer strong { color: #64748b; }
body.view-chat   .app-footer,
body.view-login  .app-footer,
body.view-register .app-footer { display: none; }

/* ── Nav logo image ──────────────────────────────────────────────────────── */
.nav-logo-img { height: 32px; width: auto; object-fit: contain; vertical-align: middle; }

/* ── Admin appearance ────────────────────────────────────────────────────── */
.admin-appear-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
@media(max-width:640px){ .admin-appear-grid{ grid-template-columns:1fr; } }
.admin-section-label { font-size: .78rem; font-weight: 700; color: #374151; margin-bottom: 8px; text-transform: uppercase; letter-spacing: .05em; }
.color-presets { display: flex; gap: 10px; flex-wrap: wrap; }
.color-swatch {
  width: 34px; height: 34px; border-radius: 50%; border: 3px solid transparent;
  cursor: pointer; transition: transform .15s, box-shadow .15s;
  outline: none; position: relative;
}
.color-swatch:hover { transform: scale(1.15); box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.color-swatch.active { box-shadow: 0 0 0 3px #fff, 0 0 0 5px currentColor; transform: scale(1.1); }
input[type=color] { width: 48px; height: 36px; border: 1.5px solid #e2e8f0; border-radius: 6px; padding: 2px; cursor: pointer; background: #fff; }

/* ── Type badges — media ─────────────────────────────────────────────────── */
.type-video { background: #fdf4ff; color: #a21caf; }
.type-audio { background: #f0f9ff; color: #0369a1; }

/* ── Chat tab bar ────────────────────────────────────────────────────────── */
.ail-tabs { display: flex; background: #fff; border-bottom: 1px solid #e2e8f0; flex-shrink: 0; }
.ail-tab-btn { background: none; border: none; border-bottom: 2px solid transparent; padding: 10px 20px; font-size: .875rem; font-weight: 600; color: #64748b; cursor: pointer; transition: all .15s; margin-bottom: -1px; }
.ail-tab-btn:hover { color: #1e293b; }
.ail-tab-btn.active { color: #4f46e5; border-bottom-color: #4f46e5; }

/* ── Media library (student chat) ───────────────────────────────────────── */
.media-grid  { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.media-card  { background: #fff; border-radius: 10px; box-shadow: 0 1px 4px rgba(0,0,0,.07); overflow: hidden; }
.media-card-player iframe { width: 100%; height: 180px; border: none; display: block; background: #000; }
.media-card-player video  { width: 100%; display: block; max-height: 200px; background: #000; }
.media-card-player audio  { width: 100%; display: block; background: #1e293b; padding: 10px; }
.media-card-body  { padding: 12px 14px; }
.media-card-title { font-weight: 600; font-size: .875rem; color: #1e293b; margin-bottom: 3px; }
.media-card-meta  { font-size: .75rem; color: #64748b; line-height: 1.4; }
.media-empty { text-align: center; color: #94a3b8; padding: 60px 20px; font-size: .9rem; }

/* ── Media upload section (lecturer) ────────────────────────────────────── */
.media-upload-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
@media(max-width:640px) { .media-upload-grid { grid-template-columns: 1fr; } }
.media-section-title { font-size: .875rem; font-weight: 700; color: #1e293b; margin-bottom: 10px; }

/* ── Source download link ─────────────────────────────────────────────────── */
.ail-dl-link { color: #4f46e5; margin-left: 8px; font-size: .8rem; text-decoration: none; opacity: .6; transition: opacity .12s; }
.ail-dl-link:hover { opacity: 1; text-decoration: none; }

/* ── Assignment Planner ───────────────────────────────────────────────────── */
.planner-wrap { max-width: 760px; margin: 0 auto; }
.planner-intro { margin-bottom: 20px; }
.planner-intro h3 { font-size: 1.05rem; font-weight: 700; color: #1e293b; margin-bottom: 6px; }
.planner-intro p  { color: #64748b; font-size: .875rem; line-height: 1.6; }
.planner-form { background: #fff; border-radius: 10px; padding: 20px; box-shadow: 0 1px 4px rgba(0,0,0,.07); }
.planner-row  { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 4px; }
@media(max-width:600px) { .planner-row { grid-template-columns: 1fr; } }
.planner-result-header { display: flex; align-items: center; justify-content: space-between; padding: 8px 0 12px; }
.planner-result-header strong { font-size: .95rem; color: #1e293b; }
.planner-output {
  background: #fff; border-radius: 10px; padding: 22px 24px;
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
  font-size: .875rem; line-height: 1.8; color: #1e293b;
}
.planner-output h1,.planner-output h2 { font-size: 1rem; font-weight: 700; color: #1e3a8a; margin: 18px 0 6px; border-bottom: 1px solid #e0e7ff; padding-bottom: 4px; }
.planner-output h3,.planner-output h4 { font-size: .9rem; font-weight: 700; color: #374151; margin: 12px 0 4px; }
.planner-output p  { margin: 4px 0; }
.planner-output li { margin: 4px 0; }
.planner-output ul,.planner-output ol { padding-left: 20px; margin: 6px 0; }
.planner-output strong { font-weight: 700; color: #1e3a8a; }
.planner-output em     { font-style: italic; color: #475569; }
.planner-output code   { background: #f1f5f9; padding: .1em .35em; border-radius: 4px; font-size: .83em; font-family: monospace; }
