:root {
  --bg: #05070b;
  --bg-surface: #0d1118;
  --bg-elevated: #151b24;
  --bg-hover: #1b2430;
  --bg-active: #223044;
  --border: rgba(255,255,255,0.1);
  --border-light: rgba(255,255,255,0.18);
  --text-primary: #f6f8fb;
  --text-secondary: #c5cfdb;
  --text-muted: #7c8794;
  --accent: #71b2e1;
  --accent-light: #9fd2f2;
  --accent-dim: rgba(113,178,225,0.14);
  --success: #22c55e;
  --success-dim: rgba(34,197,94,0.13);
  --error: #ef4444;
  --error-dim: rgba(239,68,68,0.12);
  --warning: #eab308;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --radius: 8px;
  --radius-sm: 6px;
  --radius-xs: 4px;
  --radius-pill: 999px;
  --shadow: 0 18px 60px rgba(0,0,0,0.35);
  --transition: 0.16s ease;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font);
}

a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }

.materials-app {
  min-height: calc(100vh - 74px);
}

.auth-panel {
  min-height: calc(100vh - 74px);
  display: grid;
  place-items: center;
  padding: 32px 18px;
  background:
    linear-gradient(135deg, rgba(113,178,225,0.11), transparent 34%),
    radial-gradient(circle at 72% 18%, rgba(34,197,94,0.08), transparent 30%),
    var(--bg);
}

.auth-card {
  width: min(100%, 460px);
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--accent-light);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
}

.auth-logo { width: 28px; height: 28px; object-fit: contain; }
.auth-card h1 { margin: 18px 0 10px; font-size: clamp(28px, 6vw, 40px); line-height: 1.05; letter-spacing: 0; }
.auth-copy { margin: 0 0 22px; color: var(--text-secondary); line-height: 1.6; }
.auth-form { display: grid; gap: 9px; margin-top: 14px; }
.auth-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.status-text { min-height: 20px; margin: 16px 0 0; color: var(--text-secondary); font-size: 13px; line-height: 1.5; }
.status-text.error { color: var(--error); }
.status-text.success { color: var(--success); }

.form-label {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.form-input,
.form-textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--text-primary);
  padding: 10px 12px;
  outline: none;
}

.form-input:focus,
.form-textarea:focus { border-color: var(--accent); }
.code-input { font-family: var(--mono); letter-spacing: 0.2em; text-align: center; }

.btn,
.icon-btn {
  border: 0;
  cursor: pointer;
  transition: var(--transition);
}

.btn {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 15px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 800;
}

.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #07111c; }
.btn-primary:hover:not(:disabled) { background: var(--accent-light); }
.btn-secondary { background: var(--bg-elevated); color: var(--text-primary); border: 1px solid var(--border-light); }
.btn-secondary:hover:not(:disabled) { background: var(--bg-hover); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover:not(:disabled) { background: var(--bg-hover); color: var(--text-primary); }
.btn-sm { min-height: 32px; padding: 0 10px; font-size: 12px; }

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.icon-btn {
  min-width: 34px;
  min-height: 34px;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 800;
}

.icon-btn:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--border); }

.google-login-btn {
  width: 100%;
  min-height: 46px;
  border-radius: var(--radius);
  box-shadow: 0 10px 28px rgba(113,178,225,0.18);
}

.google-mark {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: #ffffff;
  color: #1a73e8;
  font-weight: 900;
  font-size: 13px;
}

.materials-panel {
  min-height: calc(100vh - 74px);
  display: grid;
  grid-template-columns: minmax(300px, 390px) minmax(0, 1fr);
}

.materials-sidebar {
  border-right: 1px solid var(--border);
  background: rgba(13,17,24,0.82);
  padding: 22px;
  overflow-y: auto;
  max-height: calc(100vh - 74px);
}

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

.sidebar-header > div {
  flex: 1;
  min-width: 0;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sidebar-header h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1.3;
  word-break: break-word;
}

.sidebar-header .icon-btn {
  width: 32px;
  min-width: 32px;
  min-height: 32px;
  color: var(--text-muted);
}

.sidebar-tools {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.sidebar-tools .btn {
  width: 100%;
  min-width: 0;
}

.sidebar-tools .btn-ghost {
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
}

.sidebar-tools .btn-ghost:hover:not(:disabled) {
  border-color: var(--border-light);
}

.saved-search-row { margin-bottom: 10px; }
.saved-search-wrap { position: relative; display: flex; align-items: center; }
.saved-search-icon {
  position: absolute;
  left: 11px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 900;
}
.saved-search-input {
  width: 100%;
  padding: 9px 32px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  outline: none;
}
.saved-search-input:focus { border-color: var(--accent); }
.saved-search-clear {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
}

.mobile-materials-hint {
  display: none;
  margin: 0 0 10px;
  color: var(--accent-light);
  font-size: 12px;
  font-weight: 800;
}

.saved-list { display: flex; flex-direction: column; gap: 8px; padding-bottom: 20px; }
.saved-folder { margin-bottom: 4px; }
.saved-folder-header {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 4px 6px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
  margin-bottom: 7px;
}
.saved-folder-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.saved-folder-count {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 1px 7px;
  font-size: 10px;
}
.saved-folder-items { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }

.saved-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 13px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: inherit;
  cursor: pointer;
  text-align: left;
}
.saved-item:hover,
.saved-item.active { background: var(--bg-elevated); border-color: var(--border-light); }
.saved-item.active { box-shadow: inset 3px 0 0 var(--accent); }
.saved-item-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  background: var(--bg-elevated);
  color: var(--accent-light);
  font-size: 12px;
  font-weight: 900;
  flex-shrink: 0;
}
.saved-item-body { flex: 1; min-width: 0; }
.saved-item-title {
  display: block;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.saved-item-meta { display: flex; align-items: center; gap: 6px; margin-top: 5px; flex-wrap: wrap; }
.saved-item-type-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.saved-type-flashcards { background: rgba(139,92,246,0.15); color: #a78bfa; }
.saved-type-notes { background: rgba(59,130,246,0.15); color: #60a5fa; }
.saved-type-questions { background: rgba(245,158,11,0.15); color: #fbbf24; }
.saved-type-lecture { background: rgba(34,197,94,0.15); color: #4ade80; }
.saved-item-date { color: var(--text-muted); font-size: 11px; }
.saved-item-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.saved-item-share,
.saved-item-rename,
.saved-item-delete {
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
  padding: 0;
  opacity: 0.38;
}
.saved-item:hover .saved-item-share,
.saved-item:hover .saved-item-rename,
.saved-item:hover .saved-item-delete,
.saved-item-share:focus,
.saved-item-rename:focus,
.saved-item-delete:focus {
  opacity: 0.88;
}
.saved-item-share:hover { color: var(--accent-light); background: var(--accent-dim); border-color: rgba(113,178,225,0.32); }
.saved-item-rename:hover { color: var(--accent-light); background: var(--accent-dim); border-color: rgba(113,178,225,0.32); }
.saved-item-delete:hover { color: var(--error); background: var(--error-dim); border-color: rgba(239,68,68,0.32); }
.saved-item-rename-input {
  width: 100%;
  min-height: 26px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-xs);
  background: var(--bg);
  color: var(--text-primary);
  padding: 3px 7px;
  outline: none;
  font-size: 13px;
  font-weight: 700;
}

.material-workspace {
  min-width: 0;
  padding: clamp(18px, 3vw, 36px);
  overflow-y: auto;
  max-height: calc(100vh - 74px);
}

.workspace-empty {
  min-height: calc(100vh - 150px);
  display: grid;
  place-content: center;
  text-align: center;
  color: var(--text-secondary);
}
.workspace-empty h2 { margin: 0 0 8px; color: var(--text-primary); font-size: clamp(28px, 5vw, 48px); }
.workspace-empty p { margin: 0; max-width: 420px; line-height: 1.6; }

.material-view {
  max-width: 980px;
  margin: 0 auto;
}

.material-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 18px;
}
.materials-back-btn {
  display: none;
  min-height: 34px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--text-primary);
  padding: 0 12px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.materials-back-btn:hover { background: var(--bg-hover); }
.material-header h2 { margin: 0; font-size: clamp(24px, 4vw, 38px); line-height: 1.15; }
.material-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

.flashcard-viewer { display: flex; flex-direction: column; gap: 12px; }
.fc-progress { display: flex; align-items: center; gap: 10px; }
#fc-counter { color: var(--text-muted); font-size: 12px; white-space: nowrap; }
.fc-progress-bar { flex: 1; height: 3px; background: var(--border); border-radius: var(--radius-pill); overflow: hidden; }
.fc-progress-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-light)); transition: width 0.3s ease; }
.flashcard { perspective: 1000px; cursor: pointer; user-select: none; min-height: 340px; }
.flashcard-inner { position: relative; width: 100%; min-height: 340px; transform-style: preserve-3d; transition: transform 0.5s cubic-bezier(0.4,0,0.2,1); }
.flashcard.flipped .flashcard-inner { transform: rotateY(180deg); }
.flashcard-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: var(--radius);
  padding: clamp(24px, 5vw, 46px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 14px;
  border: 1px solid var(--border-light);
}
.flashcard-front { background: linear-gradient(135deg, var(--bg-elevated), var(--bg-hover)); }
.flashcard-back { background: linear-gradient(135deg, rgba(113,178,225,0.13), rgba(34,197,94,0.08)); border-color: rgba(113,178,225,0.35); transform: rotateY(180deg); }
.fc-label { color: var(--text-muted); font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.1em; }
#fc-question, #fc-answer { color: var(--text-primary); font-size: clamp(18px, 2.5vw, 28px); line-height: 1.5; max-height: 210px; overflow-y: auto; }
.fc-hint { color: var(--text-muted); font-size: 12px; margin-top: auto; }
.fc-nav { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }

.notes-content {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(20px, 3vw, 34px);
  line-height: 1.65;
  color: var(--text-primary);
  font-size: 15px;
}
.notes-content h1 { font-size: 24px; font-weight: 800; margin: 0 0 12px; padding-bottom: 9px; border-bottom: 2px solid var(--accent); }
.notes-content h2 { font-size: 18px; font-weight: 800; color: var(--accent-light); margin: 18px 0 8px; padding-left: 10px; border-left: 3px solid var(--accent); }
.notes-content h3 { font-size: 16px; color: var(--text-secondary); margin: 14px 0 5px; }
.notes-content h4 { font-size: 15px; color: var(--text-muted); margin: 12px 0 4px; }
.notes-content ul { list-style: none; margin: 6px 0 10px; padding: 0; }
.notes-content li { position: relative; padding-left: 18px; margin: 4px 0; }
.notes-content li::before { content: ""; position: absolute; left: 0; top: 10px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.notes-content .li-sub { margin-left: 20px; color: var(--text-secondary); }
.notes-content .li-3 { margin-left: 38px; color: var(--text-muted); }
.notes-content p { margin: 5px 0; }
.notes-content hr { border: 0; border-top: 1px solid var(--border); margin: 14px 0; }
.notes-content strong { color: var(--text-primary); }
.notes-content em { color: var(--accent-light); }
.notes-content code { font-family: var(--mono); font-size: 13px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; color: #fdba74; }
.notes-table-wrap { overflow-x: auto; margin: 12px 0 16px; }
.notes-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.notes-table th, .notes-table td { padding: 8px 11px; border: 1px solid var(--border); text-align: left; vertical-align: top; }
.notes-table th { background: var(--bg-elevated); color: var(--accent-light); }

.questions-list { display: flex; flex-direction: column; gap: 10px; }
.question-item { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.question-item.open { border-color: rgba(113,178,225,0.45); }
.question-header { display: flex; align-items: flex-start; gap: 11px; padding: 14px 16px; cursor: pointer; }
.question-header:hover { background: var(--bg-hover); }
.question-number { width: 24px; height: 24px; border-radius: var(--radius-xs); background: var(--accent-dim); color: var(--accent-light); font-size: 11px; font-weight: 900; display: grid; place-items: center; flex-shrink: 0; }
.question-text { flex: 1; min-width: 0; color: var(--text-primary); font-size: 14px; line-height: 1.55; overflow-x: auto; }
.question-type-badge { color: var(--text-muted); background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-pill); padding: 2px 7px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.question-toggle { color: var(--text-muted); transition: transform 0.2s ease; }
.question-item.open .question-toggle { transform: rotate(180deg); }
.question-answer { display: none; padding: 12px 16px 14px 52px; border-top: 1px solid var(--border); color: var(--text-secondary); line-height: 1.65; overflow-x: auto; }
.question-item.open .question-answer { display: block; }
.answer-label { color: var(--success); font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 5px; }
.mc-options { display: flex; flex-direction: column; gap: 6px; padding: 0 16px 14px 52px; }
.mc-option { width: 100%; display: flex; align-items: center; gap: 9px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 9px 10px; color: var(--text-primary); cursor: pointer; text-align: left; }
.mc-option:hover:not(:disabled) { background: var(--bg-hover); border-color: var(--border-light); }
.mc-option.correct { background: var(--success-dim); border-color: var(--success); }
.mc-option.wrong { background: var(--error-dim); border-color: var(--error); }
.question-item.answered .mc-option:not(.correct):not(.wrong) { opacity: 0.45; cursor: default; }
.mc-letter { width: 21px; height: 21px; border-radius: 50%; border: 1px solid var(--border-light); display: grid; place-items: center; font-size: 11px; font-weight: 900; color: var(--text-muted); flex-shrink: 0; }
.mc-option.correct .mc-letter, .mc-option.correct .mc-text { color: var(--success); border-color: var(--success); }
.mc-option.wrong .mc-letter, .mc-option.wrong .mc-text { color: var(--error); border-color: var(--error); }
.mc-text { min-width: 0; overflow-x: auto; font-size: 14px; line-height: 1.45; }
.response-area {
  padding: 0 16px 14px 52px;
  border-top: 1px solid var(--border);
}
.response-textarea {
  width: 100%;
  min-height: 78px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--text-primary);
  padding: 9px 10px;
  font-size: 14px;
  line-height: 1.5;
  outline: none;
}
.response-textarea:focus { border-color: var(--accent); }
.response-textarea::placeholder { color: var(--text-muted); }
.response-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
}
.response-char-count {
  color: var(--text-muted);
  font-size: 11px;
  font-family: var(--mono);
}
.feedback-display {
  margin-top: 10px;
  padding: 11px 12px;
  border: 1px solid rgba(113,178,225,0.3);
  border-radius: var(--radius-sm);
  background: var(--accent-dim);
}
.feedback-label {
  margin-bottom: 5px;
  color: var(--accent-light);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.feedback-text {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.65;
}
.practice-score { display: flex; justify-content: space-between; gap: 12px; margin-top: 14px; padding: 12px 14px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); }
.practice-score-metric { display: flex; flex-direction: column; gap: 2px; }
.practice-score-label { color: var(--text-muted); font-size: 12px; }
.practice-score-value { color: var(--text-primary); font-size: 15px; font-weight: 900; }
.practice-score.score-low { background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.45); }
.practice-score.score-mid { background: rgba(234,179,8,0.1); border-color: rgba(234,179,8,0.45); }
.practice-score.score-high { background: rgba(34,197,94,0.1); border-color: rgba(34,197,94,0.45); }
.practice-score.score-low .practice-score-value { color: var(--error); }
.practice-score.score-mid .practice-score-value { color: var(--warning); }
.practice-score.score-high .practice-score-value { color: var(--success); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%) translateY(80px);
  max-width: min(420px, calc(100vw - 32px));
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 10px 16px;
  color: var(--text-primary);
  box-shadow: var(--shadow);
  opacity: 0;
  transition: 0.25s ease;
  pointer-events: none;
  z-index: 50;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.success { border-color: rgba(34,197,94,0.45); color: var(--success); }
.toast.error { border-color: rgba(239,68,68,0.45); color: var(--error); }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.58);
  backdrop-filter: blur(3px);
  z-index: 80;
}

.share-code-modal {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(360px, calc(100vw - 32px));
  height: fit-content;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  z-index: 90;
}
.share-code-modal h3 {
  margin: 0 0 8px;
  font-size: 17px;
  line-height: 1.25;
}
.share-code-modal p {
  margin: 0 0 14px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
}
.share-code-value {
  display: grid;
  place-items: center;
  min-height: 58px;
  border: 1px dashed rgba(113,178,225,0.42);
  border-radius: var(--radius-sm);
  background: var(--accent-dim);
  color: var(--accent-light);
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.12em;
  margin-bottom: 14px;
}
.share-code-input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--text-primary);
  padding: 0 12px;
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-align: center;
  outline: none;
  margin-bottom: 14px;
}
.share-code-input:focus { border-color: var(--accent); }
.share-code-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.empty-state { text-align: center; padding: 38px 20px; color: var(--text-muted); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty-icon { font-family: var(--mono); font-size: 28px; }
.empty-state p { margin: 0; max-width: 260px; line-height: 1.5; font-size: 13px; }
.materials-diagnostics {
  max-width: 360px !important;
  color: var(--text-secondary);
  font-family: var(--mono);
  font-size: 11px !important;
  word-break: break-word;
}
.hidden { display: none !important; }

@media (max-width: 860px) {
  .materials-panel { display: block; min-height: calc(100vh - 74px); }
  .materials-sidebar { min-height: calc(100vh - 74px); max-height: none; border-right: 0; border-bottom: 0; }
  .material-workspace { display: none; min-height: calc(100vh - 74px); max-height: none; padding: 16px; }
  .materials-panel.detail-open .materials-sidebar { display: none; }
  .materials-panel.detail-open .material-workspace { display: block; }
  .materials-back-btn { display: inline-flex; align-items: center; justify-content: center; }
  .mobile-materials-hint { display: block; }
  .workspace-empty { display: none; }
  .material-header { flex-direction: column; }
  .material-actions { justify-content: flex-start; }
  .question-answer,
  .response-area,
  .mc-options { padding-left: 16px; }
}

@media (max-width: 520px) {
  .auth-card { padding: 22px; }
  .auth-actions,
  .fc-nav { display: grid; grid-template-columns: 1fr; width: 100%; }
  .fc-nav .btn { width: 100%; }
  .sidebar-tools { grid-template-columns: 1fr; }
  .flashcard,
  .flashcard-inner { min-height: 280px; }
}
