/* ============================================================
   MAGAZINE — Pages v2.2
   Each page has a distinct editorial grid
   ============================================================ */

/* ── Chat page — interview spread ── */
.chat-page {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: auto 1fr;
  height: 100%;
  gap: 0;
}
.chat-page .page-header {
  grid-column: 1 / -1;
  margin: 0;
  padding: 10px 0 8px var(--main-px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: baseline; gap: 12px;
}
.chat-page .page-header h2 {
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  font-style: italic;
  position: relative;
}
.chat-page .page-header::after {
  content: '';
  flex: 1; height: 1px;
  background: var(--rust);
  opacity: 0.3;
  margin-right: var(--main-px);
}
.chat-page .page-header p { display: none; }

/* Left sidebar — context panel */
.chat-sidebar {
  grid-row: 2;
  padding: 24px 20px;
  border-right: 1px solid var(--border);
  background: var(--ivory-deep);
  display: flex; flex-direction: column; gap: 20px;
  overflow-y: auto;
  animation: sidebarSlideIn 0.5s 0.15s var(--ease-out-expo) both;
}
@keyframes sidebarSlideIn {
  from { opacity: 0; transform: translateX(-20px); }
}
.chat-sidebar .sidebar-label {
  font-size: 0.62rem; font-weight: 700;
  color: var(--ink-muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.chat-sidebar select {
  width: 100%; font-size: 0.78rem;
  padding: 6px 24px 6px 8px;
  border: 1px solid var(--border);
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--font-body);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='8' height='5' viewBox='0 0 8 5' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L4 4L7 1' stroke='%238B7E6C' stroke-width='1.2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  cursor: pointer;
}
.chat-sidebar .sidebar-value {
  font-size: 0.82rem; padding: 6px 8px;
  color: var(--ink);
  font-family: var(--font-display);
  font-style: italic; font-weight: 600;
}
.chat-sidebar .btn {
  width: 100%; font-size: 0.7rem; padding: 6px 10px;
}

/* Main conversation area */
.chat-main {
  grid-row: 2;
  display: flex; flex-direction: column;
  overflow: hidden;
  min-height: 0;
}
.chat-history {
  flex: 1; overflow-y: auto;
  padding: 24px var(--main-px);
  min-height: 0;
}
/* First assistant message gets an ornamental drop-cap quote */
.chat-history .chat-assistant:first-of-type .msg-text::before {
  content: '\201C';
  display: block;
  font-family: var(--font-display);
  font-size: 3.5rem;
  line-height: 0.8;
  color: var(--rust);
  opacity: 0.5;
  margin-bottom: -4px;
  font-style: italic;
}
.chat-input-area {
  flex-shrink: 0;
  display: flex; gap: 0;
  align-items: flex-end;
  background: var(--ivory);
  border-top: 2px solid var(--border);
  padding: 12px var(--main-px);
  margin: 0;
}
.chat-input-area:focus-within { border-top-color: var(--rust); }
.chat-input-area textarea {
  flex: 1; min-height: 44px; max-height: 120px; resize: none;
  border: none !important; box-shadow: none !important;
  background: transparent; padding: 12px 16px;
  font-size: 0.95rem; line-height: 1.6;
  font-family: var(--font-body);
  color: var(--ink);
}
.chat-input-area textarea:focus { box-shadow: none; }
.chat-input-area textarea::placeholder { color: var(--ink-faint); font-style: italic; }
.chat-input-area .btn { padding: 10px 18px; flex-shrink: 0; margin-left: 12px; }

/* Old toolbar (kept for .chat-toolbar compat, hidden in new layout) */
.chat-toolbar { display: none; }

/* ── Library page — archive index ── */
.doc-list {
  display: flex; flex-direction: column;
  border-top: 2px solid var(--ink);
}
.doc-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center; gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: padding var(--dur-fast);
  animation: docEnter 0.35s var(--ease-out-expo) both;
}
.doc-item:nth-child(1) { animation-delay: 0.04s; }
.doc-item:nth-child(2) { animation-delay: 0.08s; }
.doc-item:nth-child(3) { animation-delay: 0.12s; }
.doc-item:nth-child(4) { animation-delay: 0.16s; }
.doc-item:nth-child(5) { animation-delay: 0.20s; }
@keyframes docEnter { from { opacity: 0; transform: translateX(-8px); } }
.doc-item:hover { padding-left: 12px; background: var(--ivory); }
.doc-item .doc-info { min-width: 0; }
.doc-item .doc-name {
  font-family: var(--font-display);
  font-weight: 600; font-size: 1.15rem; color: var(--ink);
  font-style: italic;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.doc-item .doc-meta {
  font-size: 0.7rem; color: var(--ink-muted); margin-top: 2px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  letter-spacing: 0.04em;
  font-family: var(--font-body);
}
.doc-item .doc-actions {
  display: flex; gap: 8px; flex-shrink: 0;
}
.doc-item .btn { font-size: 0.65rem; padding: 4px 10px; }

/* Doc detail panel — inline expand */
.doc-detail-panel {
  background: var(--ivory-deep);
  border: 1px solid var(--border);
  padding: 36px;
  margin-top: 24px;
  animation: panelReveal 0.35s var(--ease-out-expo) both;
}
@keyframes panelReveal { from { opacity: 0; } }
.doc-detail-panel h3 {
  font-family: var(--font-display);
  font-size: 1.5rem; font-weight: 700;
  margin-bottom: 20px;
}
.doc-detail-meta {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px; margin-bottom: 24px;
  padding: 20px; background: var(--ivory);
  border-left: 3px solid var(--rust);
}
.doc-detail-meta dt {
  font-size: 0.6rem; color: var(--ink-muted);
  letter-spacing: 0.1em; font-weight: 700; text-transform: uppercase;
}
.doc-detail-meta dd { font-size: 0.9rem; color: var(--ink); font-weight: 500; margin-top: 2px; }

.doc-chunks-list {
  max-height: 400px; overflow-y: auto;
  border-top: 1px solid var(--border);
  padding-top: 20px;
}
.doc-chunk-item {
  padding: 10px 16px; margin-bottom: 6px;
  background: var(--ivory);
  font-size: 0.84rem; color: var(--ink-soft);
  line-height: 1.75;
  border-left: 3px solid var(--border);
  transition: border-color var(--dur-fast);
}
.doc-chunk-item:hover { border-left-color: var(--rust); }
.doc-chunk-item .chunk-idx {
  font-size: 0.65rem; color: var(--ink-faint); margin-bottom: 4px;
  font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
}

/* Doc progress bar */
.doc-progress-bar {
  width: 100%; height: 3px;
  background: var(--border);
  margin-top: 8px;
  overflow: hidden;
}
.doc-progress-fill {
  height: 100%;
  background: var(--rust);
  transition: width 0.6s var(--ease-out-expo);
}
.doc-progress-label { margin-top: 2px; }

/* ── Quiz page — examination paper ── */
.quiz-setup {
  display: flex; gap: 20px; align-items: flex-end;
  flex-wrap: wrap;
  padding: 28px 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 40px;
}
.quiz-setup .form-group { margin-bottom: 0; }

.quiz-question {
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
  animation: qEnter 0.4s var(--ease-out-expo) both;
}
.quiz-question:nth-child(1) { animation-delay: 0.03s; }
.quiz-question:nth-child(2) { animation-delay: 0.06s; }
.quiz-question:nth-child(3) { animation-delay: 0.09s; }
.quiz-question:nth-child(4) { animation-delay: 0.12s; }
.quiz-question:nth-child(5) { animation-delay: 0.15s; }
.quiz-question:nth-child(6) { animation-delay: 0.18s; }
.quiz-question:nth-child(7) { animation-delay: 0.21s; }
.quiz-question:nth-child(8) { animation-delay: 0.24s; }
@keyframes qEnter { from { opacity: 0; transform: translateY(16px); } }
.quiz-question .q-header {
  display: flex; justify-content: space-between;
  margin-bottom: 12px; font-size: 0.72rem;
}
.quiz-question .q-text {
  font-family: var(--font-display);
  font-size: 1.2rem; font-weight: 600;
  margin-bottom: 18px; line-height: 1.55;
  letter-spacing: 0.01em;
}
.quiz-question .q-num {
  font-family: var(--font-display);
  font-size: 2rem; font-weight: 700; font-style: italic;
  color: var(--rust);
  margin-right: 12px;
  display: inline-block; min-width: 36px;
}

.quiz-option {
  display: block; padding: 10px 16px; margin-bottom: 2px;
  border-left: 3px solid transparent;
  cursor: pointer; transition: all 0.25s var(--ease-spring);
  font-size: 0.9rem; color: var(--ink-soft);
  background: var(--ivory);
  font-family: var(--font-body);
}
.quiz-option:hover { border-left-color: var(--camel); background: var(--ivory-deep); padding-left: 20px; }
.quiz-option.selected {
  border-left-color: var(--rust); color: var(--rust); font-weight: 700;
  background: var(--rust-dim);
}

/* Quiz feedback list — per-question result card */
.quiz-feedback-list { margin-top: 40px; }
.quiz-feedback-item {
  background: var(--ivory);
  border-left: 4px solid var(--border);
  padding: 20px 24px;
  margin-bottom: 12px;
  animation: qEnter 0.35s var(--ease-out-expo) both;
}
.quiz-feedback-item .feedback-icon {
  font-family: var(--font-display);
  font-size: 1.5rem;
}

/* Score reveal — dramatic typographic moment */
.score-reveal {
  text-align: center; padding: 64px 20px;
}
.score-reveal .score-ring {
  display: inline-flex; align-items: center; justify-content: center;
  width: 160px; height: 160px;
  background: var(--forest);
  animation: scorePop 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes scorePop { from { transform: scale(0) rotate(-10deg); opacity: 0; } }
.score-reveal .score-number {
  font-family: var(--font-display);
  font-size: 4rem; font-weight: 700; font-style: italic;
  color: var(--ivory);
}

/* ── Progress page v2.2 — data feature ── */
.progress-charts-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 40px;
  margin: 48px 0;
}
.chart-container {
  width: 100%; min-height: 320px;
  background: var(--ivory);
  border: 1px solid var(--border);
  padding: 4px;
  animation: chartReveal 0.7s 0.3s var(--ease-out-expo) both;
}
@keyframes chartReveal {
  from { opacity: 0; transform: translateY(20px); }
}

.mini-bar {
  width: 100%; height: 3px;
  background: var(--border);
  margin-top: 8px;
}
.mini-bar-fill {
  height: 100%;
  background: var(--forest);
  transition: width 1s var(--ease-out-expo);
}

/* Knowledge point item */
.kp-item {
  display: grid;
  grid-template-columns: 1fr auto 140px auto;
  align-items: center; gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.kp-info { display: flex; flex-direction: column; min-width: 0; }
.kp-name { font-weight: 600; color: var(--ink); font-size: 0.95rem; font-family: var(--font-display); }
.kp-source { margin-top: 1px; }
.kp-level {
  font-weight: 700; font-size: 0.75rem;
  white-space: nowrap;
  letter-spacing: 0.04em;
}
.kp-bar {
  height: 5px;
  background: var(--border);
  overflow: hidden;
}
.kp-bar-fill {
  height: 100%;
  transition: width 1.2s var(--ease-out-expo);
}
.kp-rate { color: var(--ink-muted); text-align: right; min-width: 44px; font-size: 0.88rem; }

/* Doc mastery name */
.doc-mastery-name {
  font-weight: 600;
  color: var(--ink);
}

.weak-points-list { list-style: none; display: flex; flex-direction: column; }
.weak-points-list li {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  display: flex; flex-direction: column; gap: 6px;
  transition: padding var(--dur-fast);
}
.weak-points-list li:hover { padding-left: 12px; }

.mastery-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 8px;
}
.mastery-item {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--ivory);
}

/* ── Report page — feature article ── */
.report-content {
  background: var(--ivory);
  border: 1px solid var(--border);
  padding: 48px 56px;
  line-height: 1.9;
  font-size: 0.95rem;
  max-width: 780px;
}
.report-content h1 {
  font-family: var(--font-display);
  font-size: 2.5rem; font-weight: 700;
  margin-bottom: 20px;
  letter-spacing: -0.015em;
  line-height: 1.2;
}
.report-content h2 {
  font-family: var(--font-display);
  font-size: 1.5rem; font-weight: 700;
  margin: 40px 0 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--rust);
}
.report-content h3 { font-size: 1.1rem; margin: 28px 0 12px; font-weight: 700; }
.report-content p { margin-bottom: 14px; color: var(--ink-soft); }
.report-content ul, .report-content ol { padding-left: 24px; margin-bottom: 16px; color: var(--ink-soft); }
.report-content li { margin-bottom: 8px; }
.report-content strong { color: var(--ink); }
.report-content blockquote {
  margin: 24px 0;
  padding: 16px 24px;
  border-left: 4px solid var(--rust);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--ink-soft);
  background: var(--ivory-deep);
}
.report-content code {
  background: var(--ivory-deep); padding: 2px 7px;
  font-size: 0.9em; font-family: var(--font-mono);
}

/* ── Settings page — colophon ── */
.settings-section {
  border-bottom: 1px solid var(--border);
  padding: 28px 0; margin-bottom: 4px;
  max-width: 620px;
}
.settings-section h3 {
  font-family: var(--font-display);
  font-size: 1.2rem; font-weight: 700;
  margin-bottom: 18px;
  font-style: italic;
  letter-spacing: -0.01em;
}
.settings-section:last-of-type {
  border-bottom: none;
  padding-bottom: 16px;
  margin-top: 40px;
}
.api-key-row {
  display: grid;
  grid-template-columns: 180px auto 1fr;
  align-items: center; gap: 12px;
  padding: 8px 0;
  font-size: 0.85rem;
}
.api-key-label { font-weight: 600; color: var(--ink); font-family: var(--font-display); font-size: 0.95rem; }

/* ── Progress Steps (quiz generation / submission) ── */
.progress-steps {
  display: flex; flex-direction: column; gap: 0;
  padding: 24px 28px;
  margin-top: 24px;
  background: var(--ivory-deep);
  border: 1px solid var(--border);
  border-left: 3px solid var(--rust);
}
.progress-step {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 0;
  position: relative;
  transition: all var(--dur-slow) var(--ease-out-expo);
}
.progress-step:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 6px; top: 32px;
  width: 2px; height: calc(100% - 12px);
  background: var(--border);
  transition: background var(--dur-slow);
}
.progress-step.done:not(:last-child)::after,
.progress-step.active:not(:last-child)::after {
  background: var(--rust);
}
.progress-dot {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--ivory);
  flex-shrink: 0;
  transition: all var(--dur-slow) var(--ease-out-expo);
  position: relative; z-index: 1;
}
.progress-step.active .progress-dot {
  border-color: var(--rust);
  background: var(--rust);
  box-shadow: 0 0 0 4px rgba(212, 101, 42, 0.15);
  animation: dotPulse 1.5s var(--ease-out) infinite;
}
@keyframes dotPulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(212, 101, 42, 0.15); }
  50% { box-shadow: 0 0 0 8px rgba(212, 101, 42, 0.05); }
}
.progress-step.done .progress-dot {
  border-color: var(--forest);
  background: var(--forest);
}
.progress-label {
  font-size: 0.85rem;
  color: var(--ink-muted);
  transition: color var(--dur-slow);
}
.progress-step.active .progress-label {
  color: var(--ink);
  font-weight: 600;
}
.progress-step.done .progress-label {
  color: var(--forest);
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .chat-page {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr auto;
  }
  .chat-sidebar {
    grid-row: 2;
    flex-direction: row; gap: 10px;
    padding: 10px var(--main-px);
    border-right: none;
    border-bottom: 1px solid var(--border);
    overflow-x: auto; flex-wrap: wrap;
  }
  .chat-sidebar select { width: auto; min-width: 140px; }
  .chat-sidebar .btn { width: auto; }
  .chat-main { grid-row: 3; }
  .chat-input-area { grid-row: 4; }
  .chat-history { padding: 20px var(--main-px); }

  .progress-charts-row { grid-template-columns: 1fr; }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .kp-item { grid-template-columns: 1fr auto; gap: 8px; }
  .kp-bar, .kp-rate { display: none; }
}

/* ── News page — 资讯追踪 ── */
.news-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start; gap: 16px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: padding 0.2s var(--ease-out-expo);
}
.news-item:hover { padding-left: 14px; }
.news-item.unread {
  border-left: 3px solid var(--rust);
  padding-left: 14px;
}
.news-item-main { min-width: 0; }
.news-item .news-title {
  font-family: var(--font-display);
  font-weight: 600; font-size: 1.08rem; color: var(--ink);
  font-style: italic; line-height: 1.35;
  margin-bottom: 4px;
}
.news-item .news-meta {
  font-size: 0.7rem; color: var(--ink-muted); margin-top: 4px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.news-item .news-summary {
  font-size: 0.84rem; color: var(--ink-soft); margin-top: 10px;
  line-height: 1.7;
}
.news-item .news-key-points {
  margin-top: 10px;
  display: flex; flex-wrap: wrap; gap: 6px;
}
.news-key-point {
  font-size: 0.7rem; padding: 3px 10px;
  background: rgba(130,100,70,0.08);
  color: var(--ink-soft);
  font-weight: 600;
}
.news-item-actions {
  display: flex; gap: 8px; flex-wrap: wrap;
  padding-top: 8px;
  flex-shrink: 0;
}
.news-action-btn {
  font-size: 0.78rem; padding: 6px 14px;
  border: 1px solid var(--border);
  background: var(--ivory);
  color: var(--ink);
  cursor: pointer;
  font-family: var(--font-body);
  white-space: nowrap;
}
.news-action-btn:hover {
  background: var(--ivory-deep);
  border-color: var(--ink-muted);
}
.news-action-primary {
  background: var(--rust);
  color: #fff;
  border-color: var(--rust);
}
.news-action-primary:hover {
  background: var(--rust-bright);
  border-color: var(--rust-bright);
}
.news-action-danger {
  color: var(--rust);
}
.news-action-danger:hover {
  background: rgba(180,100,60,0.1);
  border-color: var(--rust);
}
.news-article-body {
  max-height: 60vh; overflow-y: auto;
  padding: 24px; background: var(--ivory);
  border: 1px solid var(--border);
  font-size: 0.88rem; line-height: 1.85;
  color: var(--ink-soft);
  white-space: pre-wrap; word-wrap: break-word;
}
.news-badge {
  font-size: 0.64rem;
  padding: 2px 6px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.news-badge-source {
  background: var(--forest-dim);
  color: var(--forest-soft);
}
.news-badge-manual {
  background: var(--ivory-deep);
  color: var(--ink-muted);
  border: 1px solid var(--border);
}
.news-badge-lang {
  background: var(--ink-dim);
  color: var(--ivory);
}
.news-detail-panel {
  background: var(--ivory-deep);
  border: 1px solid var(--border);
  border-top: none;
  padding: 20px 24px;
  animation: panelReveal 0.3s var(--ease-out-expo) both;
}
@keyframes panelReveal {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}
.news-detail-panel.hidden { display: none; }

/* ── 综合报告流式面板 ── */
.consolidated-panel {
  background: var(--ivory);
  border: 1px solid var(--border);
  border-left: 4px solid var(--rust);
  padding: 24px;
  margin-bottom: 24px;
}
.consolidated-panel.hidden { display: none; }
.consolidated-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.consolidated-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.consolidated-content {
  max-height: 50vh;
  overflow-y: auto;
  font-size: 0.9rem;
  line-height: 1.75;
  padding-right: 8px;
}

/* ── 全屏阅读弹窗 ── */
.fullscreen-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
}
.fullscreen-modal.hidden { display: none; }
.fullscreen-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
}
.fullscreen-modal-content {
  position: absolute;
  inset: 24px;
  background: var(--ivory);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.fullscreen-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.fullscreen-modal-header h3 {
  font-size: 1rem;
  font-weight: 600;
}
.fullscreen-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
  font-size: 0.9rem;
  line-height: 1.8;
}
.fullscreen-modal-body h2 { font-size: 1.2rem; margin: 20px 0 12px; }
.fullscreen-modal-body h3 { font-size: 1rem; margin: 14px 0 8px; }
.fullscreen-modal-body ul, .fullscreen-modal-body ol { padding-left: 20px; margin: 8px 0; }
.fullscreen-modal-body li { margin-bottom: 6px; }
.fullscreen-modal-body blockquote {
  border-left: 3px solid var(--rust);
  padding: 4px 14px;
  margin: 12px 0;
  color: var(--ink-muted);
  background: var(--ivory-deep);
}

/* 综合报告 markdown 内容 */
.news-article-markdown {
  max-height: none;
  white-space: normal;
  font-size: 0.88rem;
  line-height: 1.75;
}

/* 综合报告徽章 */
.news-badge-digest {
  font-size: 0.62rem;
  padding: 1px 8px;
  border-radius: 3px;
  background: var(--rust-dim);
  color: var(--rust);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

@media (max-width: 768px) {
  .news-item { grid-template-columns: 1fr; }
  .news-item-actions { flex-direction: row; padding-top: 0; }
  .news-item .news-title { font-size: 0.96rem; }
}

@media (max-width: 768px) {
  :root { --main-px: 20px; --main-py: 36px; }
  .main-content { padding: var(--main-py) var(--main-px); }
  .topbar { padding: 0 var(--main-px); flex-wrap: wrap; height: auto; min-height: 48px; gap: 8px; }
  .topbar-nav { order: 3; width: 100%; overflow-x: auto; margin: 6px 0; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .topbar-nav::-webkit-scrollbar { display: none; }
  .topbar-tab { font-size: 0.65rem; padding: 4px 8px; white-space: nowrap; flex-shrink: 0; }
  .topbar-user { margin-left: 0; }
  .chat-input-area { flex-wrap: wrap; gap: 8px; }
  .chat-input-area textarea { flex: 1 1 100%; min-width: 0; }
  .chat-input-area .btn { margin-left: auto; align-self: flex-end; }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .auth-card { padding: 36px 24px; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-hero { padding: 40px 24px; min-height: 35vh; }
  .report-content { padding: 28px; }
  .page-header h2 { font-size: 2rem; }
  .quiz-setup { flex-direction: column; align-items: stretch; gap: 12px; }
}
