:root {
  color-scheme: light;
  --bg: #eef3f7;
  --surface: #ffffff;
  --line: #dce4ec;
  --text: #17202b;
  --muted: #687586;
  --blue: #2f63d7;
  --blue-strong: #1f4fb8;
  --green: #238860;
  --red: #d8564a;
  --amber: #c98118;
  --nav: #132033;
  --nav-soft: #223249;
  --soft-blue: #edf3ff;
  --soft-green: #edf7f1;
  --soft-amber: #fff7e8;
  --shadow: 0 18px 50px rgba(23, 32, 43, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 0%, rgba(47, 99, 215, 0.1), transparent 32%),
    linear-gradient(180deg, #f7fafc 0%, var(--bg) 100%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(420px, 100%);
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  padding: 30px;
  box-shadow: var(--shadow);
}

.login-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.brand-logo {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: contain;
  background: transparent;
  box-shadow: 0 12px 28px rgba(47, 99, 215, 0.28);
}

.brand-logo.small {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  flex: none;
}

.login-card h1 {
  margin: 22px 0 8px;
  font-size: 28px;
  letter-spacing: 0;
}

.login-card p,
.login-card small,
.panel p,
.brand span,
.user-card small {
  color: var(--muted);
}

.stage-badge {
  width: max-content;
  padding: 7px 10px;
  border: 1px solid #c9d6ff;
  border-radius: 999px;
  background: var(--soft-blue);
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

form label {
  display: grid;
  gap: 7px;
  margin: 14px 0;
  color: var(--muted);
  font-size: 13px;
}

input,
select,
textarea {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 11px;
  background: #fff;
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #b8caff;
  box-shadow: 0 0 0 4px rgba(47, 99, 215, 0.08);
}

textarea {
  height: auto;
  min-height: 110px;
  padding: 10px 11px;
  resize: vertical;
}

.primary-btn,
.ghost-btn {
  height: 42px;
  border-radius: 10px;
  padding: 0 14px;
  border: 1px solid transparent;
  font-weight: 800;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.primary-btn {
  background: var(--blue);
  color: white;
  box-shadow: 0 10px 22px rgba(47, 99, 215, 0.22);
}

.primary-btn:hover {
  background: var(--blue-strong);
  transform: translateY(-1px);
}

.primary-btn:disabled {
  cursor: not-allowed;
  opacity: 0.65;
  transform: none;
  box-shadow: none;
}

.ghost-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.ghost-btn {
  background: #fff;
  border-color: var(--line);
  color: var(--text);
}

.error {
  min-height: 20px;
  margin-top: 10px;
  color: var(--red);
  font-size: 13px;
}

.message {
  min-height: 20px;
  margin-top: 10px;
  color: var(--green);
  font-size: 13px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
}

body.detail-open {
  overflow: hidden;
}

.student-detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(15, 23, 42, 0.34);
  backdrop-filter: blur(6px);
}

.student-detail-sheet {
  width: min(1320px, calc(100vw - 24px));
  height: calc(100vh - 24px);
  margin: 12px auto;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--bg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.student-detail-sheet-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fbfcfe, #f4f7fb);
}

.student-detail-sheet-head h2 {
  margin: 2px 0 4px;
  font-size: 24px;
}

.student-detail-sheet-head p {
  margin: 0;
}

.student-detail-sheet-head .ghost-btn {
  flex: none;
}

.student-detail-overlay .student-detail-content {
  overflow: auto;
  padding: 18px 20px 24px;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 24px;
  padding: 24px 18px;
  background: var(--nav);
  color: white;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 2px 4px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand strong,
.brand span,
.user-card span,
.user-card small {
  display: block;
}

nav {
  display: grid;
  align-content: start;
  gap: 8px;
}

.nav-btn {
  height: 44px;
  border: 0;
  border-radius: 11px;
  padding: 0 14px;
  text-align: left;
  color: #a9b7c8;
  background: transparent;
}

.nav-btn.active {
  background: var(--nav-soft);
  color: #fff;
  font-weight: 700;
  box-shadow: inset 3px 0 0 #65a4ff;
}

.user-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
}

.workspace {
  min-width: 0;
  padding: 28px 32px 44px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

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

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
}

h2 {
  font-size: 18px;
}

.status-pill {
  padding: 8px 12px;
  border: 1px solid #c9d6ff;
  border-radius: 999px;
  background: var(--soft-blue);
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.view {
  display: none;
}

.view.active {
  display: grid;
  gap: 18px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
}

.kpi,
.panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(23, 32, 43, 0.02);
}

.kpi {
  position: relative;
  overflow: hidden;
  padding: 18px;
}

.kpi::after {
  content: "";
  position: absolute;
  right: -18px;
  top: -18px;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(47, 99, 215, 0.08);
}

.kpi span {
  color: var(--muted);
  font-size: 12px;
}

.kpi strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
}

.panel {
  padding: 20px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}

.panel-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-left: auto;
}

.panel p {
  margin-top: 6px;
  line-height: 1.5;
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.check-item {
  position: relative;
  padding: 13px 14px 13px 36px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfe;
}

.check-item::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 18px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line);
}

.check-item.done {
  border-color: #bfe0ca;
  background: var(--soft-green);
  color: var(--green);
  font-weight: 700;
}

.check-item.done::before {
  background: var(--green);
}

.empty-state {
  padding: 28px;
  border: 1px dashed #b9c7d5;
  border-radius: 12px;
  color: var(--muted);
  text-align: center;
}

.template-list {
  display: grid;
  gap: 14px;
}

.template-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.template-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 14px;
  background: linear-gradient(180deg, #fbfcfe, #f6f9fc);
  border-bottom: 1px solid var(--line);
}

.template-title strong {
  font-size: 16px;
}

.template-title small {
  color: var(--muted);
}

.node-list {
  display: grid;
}

.node-row {
  display: grid;
  grid-template-columns: minmax(140px, 1.2fr) 100px 80px 80px minmax(180px, 1.5fr);
  gap: 12px;
  align-items: center;
  padding: 13px 14px;
  border-bottom: 1px solid #eef2f5;
  font-size: 13px;
}

.node-row:first-child {
  color: var(--muted);
  background: #fbfcfe;
}

.node-row:last-child {
  border-bottom: 0;
}

.tag {
  width: max-content;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--soft-blue);
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
}

.tag.key {
  background: var(--soft-green);
  color: var(--green);
}

.layout.two {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.8fr);
  gap: 16px;
}

.panel-subhead {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-end;
  margin: 2px 0 12px;
}

.panel-subhead h3 {
  margin: 0;
  font-size: 16px;
}

.panel-subhead p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.sync-brief {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 4px 0 16px;
}

.sync-brief div,
.template-note {
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fbfcfe;
  padding: 13px 14px;
}

.sync-brief strong,
.sync-brief span,
.template-note strong,
.template-note span {
  display: block;
}

.sync-brief strong,
.template-note strong {
  margin-bottom: 5px;
  font-size: 13px;
}

.table-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-weight: 700;
}

.table-link.active {
  color: var(--blue-strong);
  text-decoration: underline;
}

.student-detail-content,
.node-detail-list,
.asset-list {
  display: grid;
  gap: 14px;
}

.student-detail-content {
  align-content: start;
  grid-auto-rows: min-content;
}

.student-detail-head {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfcfe;
}

.availability-guide {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid #dce8f6;
  border-radius: 10px;
  background: #f7fbff;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.availability-guide strong {
  margin: 0;
  color: var(--ink);
  font-size: 12px;
}

.availability-guide p {
  flex-basis: 100%;
  margin: 0;
}

.student-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.student-meta-grid span,
.asset-submeta span {
  color: var(--muted);
  font-size: 12px;
}

.student-meta-grid strong {
  display: block;
  margin-top: 5px;
  font-size: 18px;
}

.student-detail-tabs {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  align-content: flex-start;
  flex-wrap: nowrap;
  gap: 10px;
  margin: 16px 0 14px;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(251, 252, 254, 0.96);
  backdrop-filter: blur(8px);
  overflow-x: auto;
  overflow-y: visible;
  max-width: 100%;
}

.detail-tab {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: max-content;
  height: 34px;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  writing-mode: horizontal-tb;
  transform: none;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
  outline: none;
  box-shadow: none;
  -webkit-tap-highlight-color: transparent;
}

.detail-tab span {
  display: inline-block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.detail-tab:hover,
.detail-tab:focus,
.detail-tab:focus-visible,
.detail-tab:active {
  outline: none;
  box-shadow: none;
}

.detail-tab.active {
  border-color: #b7caff;
  background: var(--soft-blue);
  color: var(--blue);
}

.node-detail-card,
.asset-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.node-detail-card {
  padding: 16px;
}

.node-detail-head,
.asset-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.node-detail-head h3 {
  margin: 0;
  font-size: 16px;
}

.node-detail-head p {
  margin-top: 6px;
  color: var(--muted);
}

.node-badges,
.asset-meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.asset-card {
  padding: 14px;
}

.asset-card-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.ghost-btn.danger {
  color: #cf3e32;
  border-color: #f0c7c1;
  background: #fff7f6;
}

.asset-upload-form,
.asset-text-edit-form {
  display: grid;
  gap: 10px;
}

.asset-upload-form {
  margin: 14px 0;
  padding: 14px;
  border: 1px dashed #b8cceb;
  border-radius: 12px;
  background: #f8fbff;
}

.asset-upload-title {
  font-weight: 800;
}

.asset-upload-form textarea,
.asset-text-edit-form textarea,
.asset-upload-form input[type="file"] {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.asset-upload-form textarea,
.asset-text-edit-form textarea {
  min-height: 92px;
  padding: 10px 12px;
  resize: vertical;
}

.asset-upload-form input[type="file"] {
  padding: 10px;
}

.asset-upload-actions {
  display: flex;
  justify-content: flex-end;
}

.asset-card.invalid {
  background: #fff7f6;
  border-color: #f0c7c1;
}

.asset-submeta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
}

.asset-content {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.asset-image-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.asset-link {
  color: var(--blue);
  word-break: break-all;
}

.asset-thumb,
.asset-video,
.asset-audio {
  display: block;
  max-width: min(100%, 520px);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f6f8fb;
}

.asset-thumb {
  max-height: 320px;
  object-fit: cover;
}

.asset-video {
  width: min(100%, 520px);
  max-height: 320px;
}

.asset-audio {
  width: min(100%, 520px);
  padding: 8px;
}

.asset-text {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfe;
  color: var(--text);
  font: inherit;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.asset-warning {
  padding: 12px;
  border: 1px solid #f0d8a7;
  border-radius: 12px;
  background: var(--soft-amber);
  color: #865813;
  line-height: 1.5;
  word-break: break-all;
}

.analysis-review-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
  gap: 16px;
  margin-top: 16px;
}

.analysis-review-list,
.analysis-review-editor {
  min-width: 0;
}

.analysis-edit-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

.analysis-edit-form label {
  margin: 0;
}

.analysis-edit-form label:last-child,
.analysis-edit-form label:nth-last-child(2) {
  grid-column: span 1;
}

.analysis-edit-form textarea {
  min-height: 120px;
}

.checkbox-row {
  display: flex !important;
  align-items: center;
  gap: 10px;
  height: 42px;
  padding-top: 22px;
  color: var(--text);
}

.checkbox-row input {
  width: auto;
  height: auto;
  margin: 0;
  box-shadow: none;
}

.review-preview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.review-preview div {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfe;
  padding: 12px 14px;
}

.review-preview strong,
.review-preview span {
  display: block;
}

.review-preview strong {
  margin-bottom: 5px;
  font-size: 13px;
}

.review-preview span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  word-break: break-word;
}

.review-preview .transcript-preview {
  max-height: 260px;
  margin: 0;
  overflow: auto;
  color: var(--text);
  font-family: inherit;
  font-size: 12px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.speaker-editor {
  grid-column: 1 / -1;
}

.speaker-import {
  grid-column: 1 / -1;
}

.speaker-import p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
}

.speaker-import textarea {
  min-height: 120px;
  margin-bottom: 10px;
  white-space: pre-wrap;
}

.speaker-editor p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
}

.speaker-segment-list {
  display: grid;
  gap: 10px;
  max-height: 420px;
  overflow: auto;
}

.speaker-segment {
  display: grid;
  grid-template-columns: minmax(110px, 0.22fr) minmax(160px, 0.28fr) minmax(220px, 1fr);
  gap: 10px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 10px;
}

.speaker-segment-meta span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.speaker-segment-meta span:first-child {
  color: var(--text);
  font-weight: 700;
}

.speaker-segment-name,
.speaker-segment-text {
  width: 100%;
}

.speaker-segment-text {
  min-height: 58px;
  resize: vertical;
}

.analysis-review-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}

.report-module-grid {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.rebuild-progress {
  display: grid;
  gap: 12px;
  margin: 0 0 14px;
  padding: 14px;
  border: 1px solid #bcd4ff;
  border-radius: 14px;
  background: #f3f8ff;
}

.rebuild-progress strong,
.rebuild-progress small {
  display: block;
}

.rebuild-progress small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.rebuild-progress.done {
  border-color: #b9e6cc;
  background: #f1fbf5;
}

.rebuild-progress.error {
  border-color: #ffd0cb;
  background: #fff5f4;
}

.rebuild-progress-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.rebuild-progress-steps span {
  position: relative;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.rebuild-progress-steps span.done {
  border-color: #b9e6cc;
  background: #eaf9ef;
  color: #158047;
}

.rebuild-progress-steps span.active {
  border-color: #8cb7ff;
  background: #eaf3ff;
  color: #0f63d8;
  box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.08);
}

.rebuild-progress-steps span.error {
  border-color: #ffd0cb;
  background: #fff0ee;
  color: #c33b30;
}

.report-module-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfcfe;
  padding: 14px;
}

.report-module-card.hidden-module {
  opacity: 0.72;
  border-style: dashed;
}

.report-module-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.report-module-head strong {
  display: block;
  font-size: 16px;
}

.report-module-head small {
  color: var(--muted);
}

.report-module-field {
  margin: 0;
  gap: 8px;
}

.report-module-field span {
  color: var(--muted);
  font-size: 13px;
}

.report-module-content {
  min-height: 96px;
}

.report-module-sources {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.report-module-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.report-module-source-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.report-module-media {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.report-module-media figure {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfe;
}

.report-module-media img,
.report-module-media video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: #eef4fa;
}

.report-module-media figcaption {
  padding: 8px 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.source-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid #c9d6ff;
  background: var(--soft-blue);
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
}

.selected-row {
  background: #f7fbff;
}

.small {
  height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 12px;
}

.empty-state.compact {
  padding: 18px;
}

.sync-brief span,
.template-note span {
  color: var(--muted);
  font-size: 12px;
}

.template-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.questionnaire-list {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.questionnaire-list-item {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  text-align: left;
}

.questionnaire-list-item.active {
  border-color: rgba(47, 99, 215, 0.45);
  background: #f7fbff;
  box-shadow: inset 0 0 0 1px rgba(47, 99, 215, 0.08);
}

.questionnaire-list-main {
  display: grid;
  gap: 4px;
}

.questionnaire-list-main strong {
  font-size: 15px;
}

.questionnaire-list-main span,
.questionnaire-list-meta .tag {
  color: var(--muted);
  font-size: 12px;
}

.questionnaire-list-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filters-row {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(320px, 1fr);
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
}

.filters-row label {
  margin: 0;
}

.dashboard-filters {
  grid-template-columns: minmax(160px, 200px) minmax(280px, 1fr) minmax(150px, 190px) minmax(150px, 190px);
}

.dashboard-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.dashboard-summary div {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfe;
  padding: 12px 14px;
}

.dashboard-summary .dashboard-loading-card {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, #f8fbff, #eef5ff);
}

.dashboard-summary .availability-guide {
  grid-column: 1 / -1;
  margin-top: 0;
}

.dashboard-summary .availability-guide span {
  display: inline;
  margin-top: 0;
  color: var(--muted);
  font-size: 12px;
}

.dashboard-summary .availability-guide strong {
  display: inline;
  margin-top: 0;
  color: var(--ink);
  font-size: 12px;
}

.dashboard-summary strong,
.dashboard-summary span {
  display: block;
}

.dashboard-summary strong {
  font-size: 22px;
}

.dashboard-summary span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.dashboard-summary.single-line {
  display: block;
  margin-top: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfe;
}

.table-loading {
  padding: 18px 8px;
  color: var(--muted);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 14px;
}

.stage-chip {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px;
  background: #fff;
  color: var(--text);
  font-weight: 700;
}

.stage-chip.active {
  border-color: #b7caff;
  background: var(--soft-blue);
  color: var(--blue);
}

.tiny {
  font-size: 12px;
}

.muted {
  color: var(--muted);
}

.wrap-cell {
  white-space: normal;
  min-width: 220px;
  max-width: 360px;
}

.import-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(300px, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 12px;
}

.import-toolbar label {
  margin: 0;
}

.import-note {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfe;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  margin-top: 10px;
}

.ai-video-import-grid {
  display: grid;
  gap: 12px;
}

.ai-video-import-grid-inner {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.ai-video-import-row-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 14px;
  display: grid;
  gap: 12px;
}

.ai-video-import-row-card.included {
  border-color: #cce7db;
  background: #fbfffd;
}

.ai-video-import-row-card.excluded {
  border-style: dashed;
  background: #fbfcfe;
  opacity: 0.82;
}

.ai-video-import-row-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.ai-video-import-row-head strong {
  display: block;
  font-size: 16px;
}

.ai-video-import-row-head span {
  color: var(--muted);
  font-size: 12px;
}

.ai-video-import-row-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.95fr);
  gap: 12px;
}

.ai-video-import-row-col {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.ai-video-import-row-line {
  display: grid;
  gap: 4px;
}

.ai-video-import-row-line span,
.ai-video-import-inline-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.ai-video-import-row-line strong,
.ai-video-import-match-name {
  word-break: break-word;
  line-height: 1.5;
}

.ai-video-import-inline-field {
  display: grid;
  gap: 6px;
}

.ai-video-import-match-name {
  color: var(--muted);
  font-size: 12px;
}

.ai-video-import-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfe;
}

.pagination-info {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.pagination-actions {
  display: flex;
  gap: 8px;
}

.filters-row.single {
  grid-template-columns: minmax(180px, 1fr);
}

.question-editor-list {
  display: grid;
  gap: 14px;
}

.question-editor-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfcfe;
  padding: 14px;
}

.question-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.question-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkbox-label input {
  width: 16px;
  height: 16px;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
}

.ghost-btn.small {
  height: 34px;
  padding: 0 12px;
  font-weight: 700;
}

.submission-head {
  margin-top: 18px;
}

.dashboard-table-wrap {
  max-height: calc(100vh - 280px);
}

#student-dashboard-table th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.status-chip,
.report-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  height: 26px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 800;
}

.status-chip.missing,
.report-status.data_insufficient,
.report-status.not_ready {
  background: #f1f4f7;
  color: var(--muted);
}

.status-chip.excluded {
  background: #eef1f5;
  color: #7b8797;
}

.status-chip.invalid {
  background: #fff0ee;
  color: var(--red);
}

.status-chip.unmatched {
  background: #fff7e8;
  color: var(--amber);
}

.status-chip.matched {
  background: #edf3ff;
  color: var(--blue);
}

.status-chip.committed {
  background: var(--soft-green);
  color: var(--green);
}

.status-chip.pending {
  background: #f3f6fb;
  color: var(--muted);
}

.status-chip.processing {
  background: var(--soft-blue);
  color: var(--blue);
}

.status-chip.failed {
  background: #fff0ee;
  color: var(--red);
}

.status-chip.draft_generated {
  background: var(--soft-green);
  color: var(--green);
}

.queue-progress-card {
  min-width: 320px;
}

.queue-progress-card small,
.task-progress small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  white-space: normal;
}

.queue-progress-track,
.task-progress-track {
  position: relative;
  width: 100%;
  height: 7px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eef7;
}

.queue-progress-track i,
.task-progress-track i {
  display: block;
  height: 100%;
  min-width: 6px;
  border-radius: inherit;
  background: linear-gradient(90deg, #2f6bff, #49c7ff);
  transition: width .3s ease;
}

.task-progress {
  width: 190px;
}

.task-progress-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: var(--text);
}

.task-progress-top strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-progress-top span {
  color: var(--blue);
  font-weight: 800;
}

.status-chip.submitted,
.report-status.auto_ready {
  background: var(--soft-amber);
  color: var(--amber);
}

.status-chip.usable,
.report-status.published,
.report-status.ready_to_publish,
.report-status.approved {
  background: var(--soft-green);
  color: var(--green);
}

.report-status.draft,
.report-status.reviewing {
  background: var(--soft-blue);
  color: var(--blue);
}

.meter {
  display: inline-block;
  width: 68px;
  height: 7px;
  margin-right: 8px;
  border-radius: 999px;
  background: #e8edf2;
  vertical-align: middle;
  overflow: hidden;
}

.meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--amber);
}

.meter.usable i {
  background: var(--green);
}

.camp-sections {
  display: grid;
  gap: 16px;
}

.camp-section {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.camp-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(180deg, #fbfcfe, #f6f9fc);
  border-bottom: 1px solid var(--line);
}

.camp-section-head strong {
  font-size: 16px;
}

.camp-section-head span {
  color: var(--muted);
  font-size: 13px;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 12px;
  border-bottom: 1px solid #eef2f5;
  text-align: left;
  font-size: 13px;
  white-space: nowrap;
}

th {
  color: var(--muted);
  background: #fbfcfe;
  font-weight: 700;
}

tbody tr:hover {
  background: #fbfcfe;
}

.form-stack {
  display: grid;
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(220px, 360px) auto;
  gap: 12px;
  align-items: end;
}

.inline-form label {
  margin: 0;
}

.group-workbench {
  display: grid;
  grid-template-columns: minmax(340px, 0.9fr) minmax(0, 1.4fr);
  gap: 16px;
}

.group-list,
.student-list {
  display: grid;
  gap: 12px;
}

.group-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}

.group-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  background: #fbfcfe;
  border-bottom: 1px solid #eef2f5;
}

.group-card-head strong,
.group-card-head span {
  display: block;
}

.group-card-head span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.group-actions {
  display: flex;
  gap: 8px;
  flex: none;
}

.member-list {
  display: grid;
}

.member-row,
.student-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid #eef2f5;
}

.member-row:last-child,
.student-row:last-child {
  border-bottom: 0;
}

.member-row span {
  font-weight: 700;
}

.member-row .ghost-btn {
  height: 34px;
  padding: 0 10px;
}

.muted-row {
  padding: 14px;
  color: var(--muted);
  font-size: 13px;
}

.student-tools {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 160px;
  gap: 10px;
  margin-bottom: 12px;
}

.student-row {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.student-row div {
  min-width: 0;
}

.student-row strong,
.student-row span,
.student-row small {
  display: block;
}

.student-row span,
.student-row small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.student-row select {
  width: 150px;
  flex: none;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .layout.two {
    grid-template-columns: 1fr;
  }

  .group-workbench,
  .question-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .sync-brief {
    grid-template-columns: 1fr;
  }

  .filters-row {
    grid-template-columns: 1fr;
  }

  .dashboard-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .template-note {
    align-items: flex-start;
    flex-direction: column;
  }

  .inline-form,
  .student-tools {
    grid-template-columns: 1fr;
  }

  .speaker-segment {
    grid-template-columns: 1fr;
  }

  .student-row {
    align-items: stretch;
    flex-direction: column;
  }

  .student-row select {
    width: 100%;
  }
}
