:root {
  --bg: #f3f7fc;
  --card: #ffffff;
  --line: #d8e4f2;
  --text: #12314f;
  --muted: #6a7f95;
  --primary: #1768e0;
  --primary-soft: #eaf2ff;
  --success: #11834d;
  --warning: #c47a10;
  --danger: #c43b3b;
  --purple: #6f52d8;
  --shadow: 0 14px 40px rgba(18, 49, 79, 0.08);
  --radius: 18px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #eef5ff 0%, #f8fbff 100%);
}
button, input, select, textarea { font: inherit; }
button { border: none; cursor: pointer; transition: .15s ease; }
button:hover { transform: translateY(-1px); }
button:disabled { opacity: .55; cursor: not-allowed; transform: none; }
input, select, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px;
  background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid rgba(23,104,224,.15); border-color: var(--primary);
}
textarea { resize: vertical; }
select[multiple] { min-height: 112px; padding: 8px; }
select[multiple] option { padding: 6px 8px; border-radius: 8px; }

.login-view {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px; background: linear-gradient(180deg, #eef5ff 0%, #f8fbff 100%);
}
.login-card {
  width: min(620px, 100%); padding: 24px; display: grid; gap: 14px;
}
.login-brand { display: flex; gap: 16px; align-items: center; margin-bottom: 6px; }
.login-brand img {
  width: 82px; height: 82px; object-fit: contain; border-radius: 22px; background: #fff;
  border: 1px solid var(--line); padding: 6px;
}
.login-brand h1 { margin: 0 0 8px; font-size: 28px; }
.login-brand p, .login-message { margin: 0; color: var(--muted); line-height: 1.7; }
.login-message.error { color: var(--danger); font-weight: 700; }
.login-message.success { color: var(--success); font-weight: 700; }
.login-role-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 4px; }
.login-role-grid div {
  padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: #f8fbff;
  display: grid; gap: 5px;
}
.login-role-grid span { color: var(--muted); font-size: 12px; line-height: 1.5; }

.app-shell { min-height: 100vh; padding: 22px; position: relative; }
.app-shell::before {
  content: ""; position: fixed; right: -80px; bottom: -80px; width: 340px; height: 340px;
  background: url("logo_thoracic.png") center/contain no-repeat; opacity: .055; pointer-events: none; z-index: 0;
}
.app-shell > * { position: relative; z-index: 1; }
.topbar-brand { display: flex; align-items: center; gap: 16px; min-width: 0; }
.brand-logo-wrap {
  width: 84px; height: 84px; flex: 0 0 84px; border-radius: 22px; background: #fff;
  border: 1px solid rgba(216,228,242,.95); box-shadow: 0 10px 24px rgba(18,49,79,.08);
  display: flex; align-items: center; justify-content: center; padding: 6px;
}
.brand-logo { width: 100%; height: 100%; object-fit: contain; }

.topbar {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px;
}
.topbar h1 { margin: 0 0 8px; font-size: 30px; }
.subtitle { margin: 0; color: var(--muted); }
.topbar-actions, .stack-actions, .inline-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.stack-actions.horizontal { flex-direction: row; }
.stack-actions.compact { margin: 6px 0 14px; }
.stack-actions.end { justify-content: flex-end; }
.user-badge {
  display: inline-flex; align-items: center; min-height: 38px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--line); background: #fff; color: var(--text); font-weight: 700;
}

.layout {
  display: grid; grid-template-columns: 420px minmax(0, 1fr); gap: 18px; align-items: start;
}
.card {
  background: var(--card); border: 1px solid rgba(216,228,242,.85); border-radius: var(--radius); box-shadow: var(--shadow);
}
.sidebar { padding: 18px; position: sticky; top: 16px; max-height: calc(100vh - 40px); overflow: auto; }
.main-area { display: grid; gap: 16px; }
.main-area.question-mode > :not(.question-practice-panel) { display: none; }
.main-area.question-mode .question-practice-panel { display: block!important; }

.launch-cover {
  position: relative; overflow: hidden; padding: 22px; border: 1px solid rgba(23,104,224,.12);
  background: radial-gradient(circle at top right, rgba(23,104,224,.10), transparent 38%), linear-gradient(180deg, #fbfdff 0%, #f5f9ff 100%);
}
.launch-cover::after {
  content: ""; position: absolute; right: -36px; top: -30px; width: 220px; height: 220px;
  background: url("logo_thoracic.png") center/contain no-repeat; opacity: .08; pointer-events: none;
}
.launch-cover.hidden { display: none; }
.launch-cover-shell { position: relative; z-index: 1; display: grid; gap: 18px; }
.launch-brand-wrap { display: flex; align-items: center; gap: 18px; }
.launch-logo {
  width: 108px; height: 108px; object-fit: contain; border-radius: 24px; background: #fff;
  padding: 8px; border: 1px solid rgba(216,228,242,.95); box-shadow: 0 10px 24px rgba(18,49,79,.08);
}
.launch-kicker { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.launch-brand-wrap h2 { margin: 0 0 10px; font-size: 30px; }
.launch-brand-wrap p { margin: 0; color: var(--muted); line-height: 1.7; }
.launch-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.launch-card {
  padding: 16px 18px; border-radius: 18px; background: rgba(255,255,255,.8); border: 1px solid var(--line);
  backdrop-filter: blur(2px);
}
.launch-card h3 { margin: 0 0 10px; }
.launch-card ul { margin: 0; padding-left: 18px; line-height: 1.9; color: var(--muted); }
.launch-actions { display: flex; justify-content: flex-end; }

.report-brand {
  display: flex; align-items: center; gap: 14px; margin-bottom: 14px; padding: 14px 16px;
  border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(180deg, #fbfdff 0%, #f5f9ff 100%);
}
.report-brand-logo {
  width: 72px; height: 72px; flex: 0 0 72px; border-radius: 18px; background: #fff; border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; padding: 6px;
}
.report-brand-logo img { width: 100%; height: 100%; object-fit: contain; }
.report-brand h4 { margin: 0 0 6px; font-size: 20px; }
.report-brand p { margin: 0; color: var(--muted); }

.student-top, .agent-banner, .patient-panel, .chat-panel, .test-panel, .final-panel, .report-panel { padding: 18px; }
.student-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.student-top h2, .panel-header h3, .sidebar h2, .sidebar h3 { margin: 0; }

.tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); gap: 8px; margin-bottom: 14px; }
.tab {
  padding: 10px 6px; border-radius: 12px; background: #f1f6fd; color: var(--muted); font-weight: 600; font-size: 13px;
}
.tab.active { background: var(--primary); color: #fff; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.field { margin-bottom: 12px; }
.field label { display: block; margin-bottom: 6px; font-weight: 600; }
.field-grid { display: grid; gap: 12px; }
.field-grid.two-cols { grid-template-columns: repeat(2, 1fr); }
.check-list {
  display: grid; gap: 7px; max-height: 168px; overflow: auto; padding: 8px;
  border: 1px solid var(--line); border-radius: 14px; background: #fff;
}
.check-list.compact { max-height: 128px; }
.case-check-list { max-height: 260px; }
.check-option {
  display: grid; grid-template-columns: 18px minmax(0, 1fr); align-items: start; gap: 8px;
  padding: 7px 8px; border-radius: 10px; color: var(--text); line-height: 1.35;
}
.check-option:hover { background: #f4f8ff; }
.check-option input { width: 16px; height: 16px; margin: 1px 0 0; accent-color: var(--primary); }
.check-option span { min-width: 0; overflow-wrap: anywhere; }
.check-option small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.compact-checks { margin-bottom: 12px; }
.toggle-row {
  display: flex; align-items: center; gap: 10px; padding: 11px 12px; background: #f7faff; border: 1px solid var(--line); border-radius: 14px;
}
.toggle-row input { width: auto; }
.slider-group { display: grid; gap: 10px; margin-bottom: 14px; }
.slider-row {
  display: grid; grid-template-columns: 100px 1fr 36px; align-items: center; gap: 10px;
}
.slider-row input[type="range"] { padding: 0; }

.sub-card {
  margin: 12px 0 14px; padding: 14px; border: 1px dashed var(--line); background: #f9fbff; border-radius: 16px;
}
.sub-card-header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; gap: 12px;
}
.avatar-preview-wrap { display: flex; align-items: center; gap: 14px; margin-top: 8px; }
.avatar-preview {
  width: 88px; height: 88px; border-radius: 20px; background: linear-gradient(180deg, #eef5ff 0%, #f8fbff 100%);
  display: flex; align-items: center; justify-content: center; border: 1px solid var(--line);
}
.avatar-preview img { width: 100%; height: 100%; object-fit: cover; border-radius: 20px; }
.mini-note { color: var(--muted); font-size: 12px; line-height: 1.5; }

.agent-sidebar-grid { display: grid; gap: 10px; margin: 12px 0; }
.agent-mini-card, .compliance-panel {
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: #f9fbff;
}
.agent-mini-card strong { display: block; margin-bottom: 6px; }
.agent-mini-card span, .compliance-panel li { color: var(--muted); line-height: 1.7; }
.compliance-panel h3 { margin-bottom: 8px; }
.compliance-panel ul { margin: 0; padding-left: 18px; }

.agent-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  border-left: 4px solid var(--success);
}
.agent-banner h3 { margin: 0 0 6px; }
.agent-banner p { margin: 0; color: var(--muted); line-height: 1.7; }
.evidence-strip { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; min-width: 300px; }
.evidence-chip {
  display: inline-flex; align-items: center; min-height: 30px; padding: 5px 10px; border-radius: 999px;
  background: #e6f7ef; color: var(--success); font-size: 12px; font-weight: 700;
}

.primary-btn, .secondary-btn, .ghost-btn, .danger-btn, .test-pill {
  border-radius: 14px; padding: 11px 16px; font-weight: 600;
}
.primary-btn { background: var(--primary); color: #fff; }
.secondary-btn { background: #edf4ff; color: var(--primary); }
.ghost-btn { background: #f7faff; color: var(--text); border: 1px solid var(--line); }
.danger-btn { background: #fff1f1; color: var(--danger); border: 1px solid #f3caca; }

.case-preview, .library-item, .report-item, .test-result-card, .knowledge-box, .report-block {
  background: #f9fbff; border: 1px solid var(--line); border-radius: 16px;
}
.case-preview { padding: 14px; line-height: 1.7; }
.case-preview h4 { margin: 0 0 8px; }
.case-tags, .chip-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.chip, .mini-chip {
  display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; background: #edf4ff; color: var(--primary); font-size: 12px; font-weight: 600;
}
.mini-chip.warning { background: #fff3df; color: var(--warning); }
.mini-chip.success { background: #e6f7ef; color: var(--success); }
.mini-chip.purple { background: #f0ecff; color: var(--purple); }
.library-list { display: grid; gap: 10px; }
.library-item { padding: 12px; }
.library-item h4 { margin: 0 0 8px; }
.library-item p { margin: 0 0 6px; color: var(--muted); }
.library-detail { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 8px; }
.library-detail summary { cursor: pointer; font-weight: 700; color: var(--primary); }
.library-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.library-detail-grid > div { padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.library-detail h5 { margin: 0 0 8px; font-size: 14px; }
.library-detail ul { margin: 0; padding-left: 18px; color: var(--muted); line-height: 1.7; }
.filter-summary {
  margin: 10px 0 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px;
  background: #fbfdff; color: var(--muted); line-height: 1.6;
}

.question-stats {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px;
}
.question-stat {
  padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: #f8fbff;
}
.question-stat span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.question-stat strong { font-size: 20px; color: var(--primary); }
.question-card {
  margin-top: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: #f9fbff; line-height: 1.7;
}
.question-card h4 { margin: 0 0 8px; }
.question-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.question-practice-panel { padding: 18px; }
.question-practice-shell { width: min(980px, 100%); margin: 0 auto; }
.question-practice-shell .panel-header p { margin: 6px 0 0; color: var(--muted); line-height: 1.6; }
.question-practice-shell .question-card { min-height: 260px; padding: 18px; }
.question-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0;
  padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: #fbfdff;
}
.question-toolbar label { font-weight: 700; color: var(--text); }
.question-toolbar input { width: 88px; padding: 9px 10px; border-radius: 12px; }
.option-list { display: grid; gap: 8px; margin: 10px 0; }
.option-btn {
  text-align: left; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: #fff; color: var(--text);
}
.option-btn.selected { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.option-btn.correct { border-color: #9bd9bd; background: #ecfbf4; color: #0b7a44; }
.option-btn.wrong { border-color: #efb5b5; background: #fff3f3; color: var(--danger); }
.rationale-box, .authority-box, .question-analysis-panel {
  margin-top: 12px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: #fff; color: var(--muted); line-height: 1.7;
}
.question-analysis-panel h4 { margin: 0 0 8px; color: var(--text); }
.question-analysis-panel ul, .question-analysis-panel ol { margin: 8px 0 0; padding-left: 20px; }
.question-analysis-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 10px 0; }
.question-analysis-card { border: 1px solid var(--line); border-radius: 12px; background: #f8fbff; padding: 10px 12px; }
.question-analysis-card span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.question-analysis-card strong { color: var(--primary); font-size: 20px; }
.authority-box ul { margin: 8px 0 0; padding-left: 18px; }
.assessment-mode-info {
  margin: 10px 0 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: #fbfdff; color: var(--muted); line-height: 1.7;
}
.assessment-mode-info strong { color: var(--text); }
.assessment-mode-info ul { margin: 8px 0 0; padding-left: 18px; }
.assessment-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px;
}
.assessment-chip {
  border: 1px solid var(--line); border-radius: 14px; background: #fbfdff; padding: 10px 12px;
}
.assessment-chip span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.assessment-chip strong { color: var(--primary); }

.dashboard-grid { display: grid; grid-template-columns: minmax(320px, .82fr) minmax(520px, 1.18fr); gap: 16px; }
.test-panel { grid-column: 1 / -1; }
.bottom-grid { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 16px; }
.panel-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px;
}
.status-badge {
  padding: 6px 12px; border-radius: 999px; background: #eef2f7; color: var(--muted); font-size: 12px; font-weight: 700;
}
.status-badge.active { background: #e7f1ff; color: var(--primary); }
.status-badge.paused { background: #fff4df; color: var(--warning); }
.status-badge.done { background: #e6f7ef; color: var(--success); }

.patient-card {
  padding: 14px; min-height: 216px; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(180deg, #f9fbff 0%, #f4f8ff 100%);
}
.patient-shell { display: grid; grid-template-columns: 88px minmax(0,1fr); gap: 12px; align-items: center; }
.patient-avatar { width: 88px; height: 88px; border-radius: 22px; overflow: hidden; border: 1px solid var(--line); background: #fff; }
.patient-avatar img { width: 100%; height: 100%; object-fit: cover; }
.patient-name-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.patient-text h4 { margin: 0; font-size: 24px; line-height: 1.15; white-space: nowrap; }
.patient-age-sex {
  display: inline-flex; align-items: center; min-height: 26px; padding: 3px 9px; border-radius: 999px;
  background: #edf4ff; color: var(--primary); font-size: 12px; font-weight: 700; white-space: nowrap;
}
.patient-meta { display: flex; flex-wrap: wrap; gap: 7px; font-size: 13px; }
.patient-meta span {
  display: inline-flex; align-items: center; gap: 5px; min-height: 28px; padding: 4px 8px;
  border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--muted);
}
.patient-meta strong { color: var(--text); }
.patient-chief { display: grid; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); line-height: 1.55; }
.patient-chief > div { display: flex; gap: 8px; align-items: flex-start; min-width: 0; }
.patient-chief strong { flex: 0 0 auto; color: var(--text); white-space: nowrap; }
.patient-chief span { min-width: 0; color: var(--muted); overflow-wrap: anywhere; }
.mini-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 12px; }
.metric-card {
  padding: 12px; border-radius: 16px; border: 1px solid var(--line); background: #fbfdff;
}
.metric-card span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.metric-card strong { font-size: 22px; }
.hint-box {
  margin-top: 12px; padding: 12px 14px; border-radius: 16px; background: #f7fbff; border: 1px solid var(--line); color: var(--muted); line-height: 1.7;
}

.chat-window {
  min-height: 430px; max-height: 430px; overflow: auto; padding: 12px; border-radius: 16px; background: #f9fbff; border: 1px solid var(--line);
}
.message { display: flex; gap: 10px; margin-bottom: 12px; }
.message.user { flex-direction: row-reverse; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700;
  background: #e9f2ff; color: var(--primary); flex-shrink: 0;
}
.message.patient .avatar { background: #f1eefe; color: var(--purple); }
.bubble {
  max-width: 74%; padding: 12px 14px; border-radius: 16px; background: #fff; border: 1px solid var(--line); line-height: 1.7; white-space: pre-wrap;
}
.message.user .bubble { background: #edf4ff; }
.chat-input-row { display: grid; grid-template-columns: 1fr 110px; gap: 12px; margin-top: 12px; }
.chat-tools { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 10px 0 0; }
.listening { box-shadow: 0 0 0 4px rgba(196,59,59,.15) inset; border-color: var(--danger)!important; }

.test-buttons { display: flex; flex-wrap: wrap; gap: 8px; min-height: 72px; align-content: flex-start; }
.test-pill { background: #f4f8ff; color: var(--text); border: 1px solid var(--line); white-space: nowrap; }
.test-pill:disabled { background: #eef3f8; color: #91a1b2; }
.test-results {
  margin-top: 12px; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px; align-items: stretch;
}
.test-result-summary {
  grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 16px; background: #fbfdff;
}
.test-result-card { padding: 14px; min-width: 0; display: grid; gap: 8px; align-content: start; }
.test-result-card h4 { margin: 0; font-size: 18px; line-height: 1.35; overflow-wrap: anywhere; }
.test-result-card .chip-row { margin-top: 0; }
.test-result-card .mini-chip { white-space: normal; line-height: 1.35; }
.test-result-body {
  margin: 0; color: var(--muted); line-height: 1.75; white-space: pre-line;
  word-break: normal; overflow-wrap: anywhere;
}

.report-content.hidden, .hidden { display: none!important; }
.report-top { display: grid; grid-template-columns: 360px minmax(0,1fr); gap: 14px; align-items: center; }
.score-summary { display: grid; gap: 10px; }
.score-chip {
  padding: 12px 14px; border-radius: 16px; border: 1px solid var(--line); background: #f8fbff;
}
.score-chip span { display: block; color: var(--muted); margin-bottom: 6px; }
.score-chip strong { font-size: 24px; }
.report-details { display: grid; gap: 12px; margin-top: 14px; }
.report-block { padding: 14px; }
.report-block h4 { margin: 0 0 10px; }
.report-block p { margin: 0 0 10px; line-height: 1.7; }
.report-block ul { margin: 0; padding-left: 18px; line-height: 1.8; }
.competency-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.competency-item {
  display: grid; gap: 5px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: #fbfdff;
}
.competency-item strong { color: var(--primary); }
.competency-item small { color: var(--muted); line-height: 1.5; }
.competency-item.risk { border-color: #f3caca; background: #fff7f7; }
.competency-item.risk strong { color: var(--danger); }
.osce-list { margin-top: 4px!important; }
.pathway-list { margin: 0; padding-left: 20px; line-height: 1.9; }
.knowledge-grid { display: grid; gap: 10px; }
.knowledge-box { padding: 12px 14px; }
.knowledge-box h5 { margin: 0 0 8px; font-size: 14px; }
.knowledge-box p { margin: 0; line-height: 1.7; color: var(--muted); }

.report-list { display: grid; gap: 10px; }
.report-item { padding: 12px 14px; }
.report-item-header { display: flex; justify-content: space-between; gap: 12px; font-weight: 700; margin-bottom: 6px; }
.report-item-meta { color: var(--muted); font-size: 13px; line-height: 1.7; }
.learner-list { display: grid; gap: 10px; }
.learner-card {
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: #f9fbff;
}
.learner-card h4 { margin: 0 0 8px; }
.learner-meta { color: var(--muted); line-height: 1.7; margin-bottom: 8px; }
.learner-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.learner-warning { color: var(--warning); font-weight: 700; }
.task-list, .evaluation-list, .user-list { display: grid; gap: 10px; }
.task-card, .evaluation-card, .student-profile-card, .user-card {
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: #f9fbff;
}
.task-card h4, .student-profile-card h4, .user-card h4 { margin: 0 0 8px; }
.task-meta, .evaluation-meta { color: var(--muted); line-height: 1.7; margin-bottom: 8px; }
.task-card p, .evaluation-card p, .student-profile-card p { margin: 6px 0; line-height: 1.7; }
.task-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.role-note { color: var(--muted); line-height: 1.7; }

.help-list { padding-left: 20px; line-height: 1.8; }
.empty-state {
  color: var(--muted); display: flex; align-items: center; justify-content: center; min-height: 80px; text-align: center;
}
hr { border: none; border-top: 1px dashed var(--line); margin: 16px 0; }

.modal {
  position: fixed; inset: 0; background: rgba(14, 28, 44, 0.45); display: flex; align-items: center; justify-content: center; z-index: 99; padding: 20px;
}
.modal-card {
  width: min(820px, 100%); background: #fff; border-radius: 22px; box-shadow: 0 20px 60px rgba(14, 28, 44, 0.25); padding: 18px; max-height: 90vh; overflow: auto;
}

@media (max-width: 1420px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; max-height: none; }
}
@media (max-width: 1180px) {
  .dashboard-grid, .bottom-grid, .report-top, .launch-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .topbar, .student-top, .agent-banner, .topbar-brand { flex-direction: column; align-items: stretch; }
  .brand-logo-wrap { width: 72px; height: 72px; flex-basis: 72px; }
  .tabs { grid-template-columns: repeat(2, 1fr); }
  .field-grid.two-cols, .chat-input-row, .question-stats { grid-template-columns: 1fr; }
  .login-brand { align-items: flex-start; }
  .login-role-grid { grid-template-columns: 1fr; }
  .library-detail-grid { grid-template-columns: 1fr; }
  .question-analysis-grid { grid-template-columns: 1fr; }
  .competency-grid, .assessment-grid { grid-template-columns: 1fr; }
  .evidence-strip { min-width: 0; justify-content: flex-start; }
  .mini-grid { grid-template-columns: repeat(2, 1fr); }
}
