* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
  color: #333;
  background: #f5f7fa;
}

/* ===== Top Navigation ===== */
nav {
  background: #2c3e50;
  color: white;
  padding: 0.75rem 2rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

/* ===== Progress Overlay ===== */
.progress-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.progress-overlay.active {
  display: flex;
}

.mark-detail-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.mark-detail-overlay.active {
  display: flex;
}

.mark-detail-modal {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  width: min(900px, 90vw);
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.mark-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.mark-detail-header h3 {
  color: #2c3e50;
}

.mark-detail-section {
  margin-top: 1rem;
}

.mark-detail-section h4 {
  color: #2c3e50;
  margin-bottom: 0.5rem;
}

.mark-detail-section pre {
  white-space: pre-wrap;
  background: #f8f9fa;
  padding: 0.75rem;
  border-radius: 4px;
  font-family: inherit;
}

.mark-detail-section ul {
  margin-left: 1.25rem;
  color: #333;
}

.mark-detail-score {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  color: #555;
}

.progress-dialog {
  background: white;
  border-radius: 12px;
  padding: 2rem 3rem;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  min-width: 300px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #ecf0f1;
  border-top: 4px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.progress-dialog h3 {
  margin-bottom: 0.5rem;
  color: #2c3e50;
}

.progress-dialog p {
  color: #7f8c8d;
  font-size: 0.9rem;
}

.progress-steps {
  text-align: left;
  margin-top: 1rem;
}

.progress-step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0;
  color: #bdc3c7;
  transition: color 0.3s;
}

.progress-step.active {
  color: #3498db;
}

.progress-step.done {
  color: #2ecc71;
}

.progress-step .check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid currentColor;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}

.progress-step.done .check::after {
  content: '✓';
}

.progress-step.active .check {
  border-color: #3498db;
  background: rgba(52,152,219,0.1);
}

/* ===== Settings Info Boxes ===== */
.settings-info {
  background: #e8f4fd;
  border: 1px solid #bee5eb;
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: #0c5460;
  line-height: 1.5;
}

.settings-info strong {
  display: block;
  margin-bottom: 0.25rem;
  color: #0c5460;
}

.toggle-description {
  font-size: 0.8rem;
  color: #7f8c8d;
  margin-top: 0.15rem;
  margin-bottom: 0;
}

nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

nav h1 {
  font-size: 1.3rem;
  margin: 0;
  white-space: nowrap;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}

nav a {
  color: #ecf0f1;
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  transition: background 0.2s, color 0.2s;
  font-size: 0.9rem;
}

nav a:hover {
  background: rgba(255,255,255,0.1);
  color: #3498db;
}

nav a.active {
  background: #3498db;
  color: white;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-left: 1rem;
  border-left: 1px solid rgba(255,255,255,0.2);
}

.nav-user-icon {
  font-size: 1.2rem;
}

.nav-user-name {
  color: #ecf0f1;
  font-weight: 500;
  font-size: 0.9rem;
}

.nav-logout-btn {
  color: #e74c3c;
  text-decoration: none;
  font-weight: 500;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.85rem;
  transition: background 0.2s, color 0.2s;
}

.nav-logout-btn:hover {
  background: rgba(231, 76, 60, 0.2);
  color: #ff6b7a;
}

/* ===== Workspace Tabs (below the assignment selector) ===== */
.workspace-tabs {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.workspace-tabs a {
  color: #2c3e50;
  text-decoration: none;
  font-weight: 500;
  padding: 0.4rem 0.9rem;
  border-radius: 6px;
  border: 1px solid #d8dce3;
  background: #fff;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  font-size: 0.88rem;
}

.workspace-tabs a:hover {
  background: #eef4ff;
  border-color: #2f6fed;
  color: #2f6fed;
}

.workspace-tabs a.active {
  background: #2f6fed;
  border-color: #2f6fed;
  color: #fff;
}

/* Results studio: keep the tab row flush with the dark topbar layout */
#workspaceTabs.workspace-tabs-host {
  flex: 0 0 auto;
}

/* ===== Workflow Tracker ===== */


/* ===== Assignment Workspace (top-level section) ===== */
.assignment-workspace {
  background: white;
  border-bottom: 3px solid #3498db;
  padding: 1.5rem 2rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.workspace-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

.assignment-selector {
  flex: 1;
  min-width: 300px;
}

.assignment-selector h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #7f8c8d;
  margin-bottom: 0.5rem;
}

.assignment-selector select {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 2px solid #ddd;
  border-radius: 6px;
  background: #fafafa;
  cursor: pointer;
  transition: border-color 0.2s;
}

.assignment-selector select:focus {
  outline: none;
  border-color: #3498db;
}

.assignment-info {
  padding: 0.75rem 0;
  font-size: 0.9rem;
  color: #555;
}

.assignment-info .subject {
  font-weight: 600;
  color: #2c3e50;
}

.assignment-manager {
  flex-shrink: 0;
}

.assignment-manager .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* ===== Panels Section (below workspace) ===== */
.panels-section {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem 2rem;
}

/* ===== Tab Navigation ===== */
.tab-nav {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #e0e0e0;
  margin-bottom: 1.5rem;
  overflow-x: auto;
}

.tab-nav a {
  padding: 0.75rem 1.25rem;
  text-decoration: none;
  color: #7f8c8d;
  font-weight: 500;
  font-size: 0.9rem;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: color 0.2s, border-color 0.2s;
  white-space: nowrap;
}

.tab-nav a:hover {
  color: #3498db;
}

.tab-nav a.active {
  color: #3498db;
  border-bottom-color: #3498db;
}

/* ===== Panel Content ===== */
.panel-content {
  background: white;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  min-height: 400px;
}

/* ===== Legacy container fallback ===== */
.container {
  background: white;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  margin-bottom: 2rem;
}

/* ===== Layout Utilities ===== */
.main {
  max-width: 1400px;
  margin: 2rem auto;
  padding: 0 2rem;
}

.flex-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.flex-row > * {
  flex: 1;
  min-width: 200px;
}

/* ===== Cards (for home/landing) ===== */
.hero {
  text-align: center;
  padding: 3rem 0;
}

.hero h2 {
  font-size: 2.5rem;
  color: #2c3e50;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.2rem;
  color: #7f8c8d;
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.card {
  background: white;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.card h3 {
  color: #2c3e50;
  margin-bottom: 0.75rem;
}

.card p {
  color: #7f8c8d;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

/* ===== Buttons ===== */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: #3498db;
  color: white;
  text-decoration: none;
  border-radius: 4px;
  font-weight: 500;
  transition: background 0.2s;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
}

.btn:hover {
  background: #2980b9;
}

.btn-secondary {
  background: #95a5a6;
}

.btn-secondary:hover {
  background: #7f8c8d;
}

.btn-success {
  background: #2ecc71;
}

.btn-success:hover {
  background: #27ae60;
}

.btn-danger {
  background: #e74c3c;
}

.btn-danger:hover {
  background: #c0392b;
}

.btn-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

/* ===== Tables ===== */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

th, td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

th {
  background: #f8f9fa;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #555;
}

tr:hover {
  background: #f8f9fa;
}

/* ===== Alerts ===== */
.alert {
  position: relative;
  padding: 1rem 2rem 1rem 1rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.alert-info {
  background: #d1ecf1;
  color: #0c5460;
}

.alert-success {
  background: #d4edda;
  color: #155724;
}

.alert-error {
  background: #f8d7da;
  color: #721c24;
}

.alert-warning {
  background: #fff3cd;
  color: #856404;
}

.alert .alert-close {
  position: absolute;
  top: 0.5rem;
  right: 0.6rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  color: inherit;
  opacity: 0.7;
}

.alert .alert-close:hover {
  opacity: 1;
}

.status-chip {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  vertical-align: middle;
}

.status-chip.processing {
  background: #fff7e0;
  color: #9a6b00;
  border: 1px solid #f0d48a;
}

/* ===== Activity panel (bottom) ===== */
.activity-panel {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 900;
  background: #1f2933;
  color: #e8eef2;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.25);
  border-top: 1px solid #3e4c59;
}

.activity-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.45rem 1rem;
  cursor: pointer;
  user-select: none;
}

.activity-title {
  font-weight: 700;
  letter-spacing: 0.03em;
}

.activity-summary {
  flex: 1;
  color: #9aa5b1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-toggle {
  background: none;
  border: none;
  color: #9aa5b1;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0;
}

.activity-body {
  max-height: 180px;
  overflow-y: auto;
  padding: 0 1rem 0.6rem;
  line-height: 1.5;
}

.activity-panel.collapsed .activity-body {
  display: none;
}

.activity-line {
  white-space: pre-wrap;
  word-break: break-word;
}

.activity-line .time {
  color: #627d98;
  margin-right: 0.5rem;
}

.activity-line.info .msg { color: #e8eef2; }
.activity-line.ok .msg { color: #69db7c; }
.activity-line.warn .msg { color: #ffd43b; }
.activity-line.err .msg { color: #ff8787; }

/* ===== Forms ===== */
.form-group {
  margin-bottom: 1.5rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: #2c3e50;
}

input[type="text"],
input[type="file"],
input[type="number"],
input[type="date"],
textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
  font-family: inherit;
}

textarea {
  min-height: 100px;
  resize: vertical;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52,152,219,0.1);
}

/* ===== Badges ===== */
.status-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 500;
}

.status-active {
  background: #d4edda;
  color: #155724;
}

.status-warning {
  background: #fff3cd;
  color: #856404;
}

.status-danger {
  background: #f8d7da;
  color: #721c24;
}

.rubric-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  font-size: 0.75rem;
  background: #3498db;
  color: white;
  margin: 0.1rem;
}

.action-btn {
  padding: 0.3rem 0.6rem;
  margin: 0 0.25rem;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.8rem;
  background: #3498db;
  color: white;
  text-decoration: none;
  display: inline-block;
}

.action-btn:hover {
  background: #2c8bc9;
}

.edit-btn {
  background: #f39c12;
}

.edit-btn:hover {
  background: #e67e22;
}

.delete-btn {
  background: #e74c3c;
}

.delete-btn:hover {
  background: #c0392b;
}

.actions-cell {
  white-space: nowrap;
}

/* ===== Status section (health check) ===== */
.status {
  margin-top: 3rem;
  padding: 2rem;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.status h3 {
  color: #2c3e50;
  margin-bottom: 1rem;
}

.modules {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.module-badge {
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-size: 0.875rem;
  font-weight: 500;
}

.module-badge.active {
  background: #2ecc71;
  color: white;
}

.module-badge.inactive {
  background: #e74c3c;
  color: white;
}

/* ===== Summary cards ===== */
#assignmentSummary, #taskSummary {
  margin-bottom: 1rem;
}

#assignmentSummary .summary-card, #taskSummary .summary-card {
  padding: 0.6rem 1rem;
}

#assignmentSummary .summary-card .value, #taskSummary .summary-card .value {
  font-size: 1.3rem;
}

.summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.summary-card {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  text-align: center;
  border-left: 4px solid #3498db;
}

.summary-card .value {
  font-size: 2rem;
  font-weight: 700;
  color: #2c3e50;
}

.summary-card .label {
  font-size: 0.85rem;
  color: #7f8c8d;
  margin-top: 0.25rem;
}

/* ===== No-selection state ===== */
.no-selection {
  text-align: center;
  padding: 4rem 2rem;
  color: #95a5a6;
}

.no-selection h3 {
  font-size: 1.5rem;
  color: #7f8c8d;
  margin-bottom: 1rem;
}

.no-selection p {
  font-size: 1rem;
}

/* ===== Chat Widget ===== */
.chat-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #3498db;
  color: white;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(52,152,219,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  z-index: 1000;
  transition: transform 0.2s, background 0.2s;
}

.chat-toggle:hover {
  transform: scale(1.1);
  background: #2980b9;
}

.chat-toggle.active {
  background: #e74c3c;
}

.chat-toggle.active:hover {
  background: #c0392b;
}

.chat-panel {
  position: fixed;
  bottom: 92px;
  right: 24px;
  width: 420px;
  max-height: 600px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  display: none;
  flex-direction: column;
  z-index: 999;
  overflow: hidden;
}

.chat-panel.open {
  display: flex;
}

.chat-header {
  background: #3498db;
  color: white;
  padding: 1rem 1.25rem;
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-header small {
  font-weight: 400;
  font-size: 0.75rem;
  opacity: 0.8;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 440px;
  min-height: 300px;
}

.chat-message {
  max-width: 85%;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-size: 0.9rem;
  line-height: 1.5;
  word-wrap: break-word;
}

.chat-message.user {
  align-self: flex-end;
  background: #3498db;
  color: white;
  border-bottom-right-radius: 4px;
}

.chat-message.assistant {
  align-self: flex-start;
  background: #f0f2f5;
  color: #333;
  border-bottom-left-radius: 4px;
}

.chat-message.system {
  align-self: center;
  background: transparent;
  color: #95a5a6;
  font-size: 0.8rem;
  text-align: center;
  max-width: 100%;
}

.chat-message pre {
  background: #1e1e1e;
  color: #d4d4d4;
  padding: 0.75rem;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 0.8rem;
  margin-top: 0.5rem;
}

.chat-message code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.85em;
}

.chat-message p {
  margin: 0.25em 0;
}

.chat-message ul, .chat-message ol {
  margin: 0.25em 0;
  padding-left: 1.25em;
}

.chat-message li {
  margin: 0.15em 0;
}

.chat-message.tool-result {
  align-self: center;
  background: #fff9e6;
  border: 1px solid #f0c040;
  border-radius: 8px;
  font-size: 0.85rem;
  padding: 0.5rem 1rem;
  max-width: 90%;
  margin: 0.5rem 0;
}

.chat-message.tool-result .tool-icon {
  margin-right: 0.5rem;
}

.chat-message.tool-result .tool-name {
  font-weight: 600;
  color: #555;
  margin-right: 0.5rem;
}

.chat-message.tool-result .tool-output {
  color: #777;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.8em;
}

.chat-input-area {
  padding: 0.75rem;
  border-top: 1px solid #e0e0e0;
  display: flex;
  gap: 0.5rem;
  background: #fafafa;
}

.chat-input-area input {
  flex: 1;
  padding: 0.6rem 1rem;
  border: 1px solid #ddd;
  border-radius: 20px;
  font-size: 0.9rem;
  outline: none;
  font-family: inherit;
}

.chat-input-area input:focus {
  border-color: #3498db;
  box-shadow: 0 0 0 2px rgba(52,152,219,0.1);
}

.chat-input-area button {
  padding: 0.6rem 1.25rem;
  background: #3498db;
  color: white;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.2s;
}

.chat-input-area button:hover {
  background: #2980b9;
}

.chat-input-area button:disabled {
  background: #bdc3c7;
  cursor: not-allowed;
}

.chat-typing {
  align-self: flex-start;
  padding: 0.75rem 1rem;
  color: #95a5a6;
  font-size: 0.85rem;
  font-style: italic;
}

.chat-typing::after {
  content: '';
  animation: dots 1.5s infinite;
}

@keyframes dots {
  0%, 20% { content: '.'; }
  40% { content: '..'; }
  60%, 100% { content: '...'; }
}

.chat-clear {
  background: rgba(255,255,255,0.2);
  border: none;
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.75rem;
  margin-right: 0.5rem;
}

.chat-clear:hover {
  background: rgba(255,255,255,0.3);
}

@media (max-width: 500px) {
  .chat-panel {
    width: calc(100vw - 24px);
    right: 12px;
    bottom: 84px;
    max-height: 70vh;
  }
}

/* Sortable table headers */
.file-link { color: #2f6fed; text-decoration: none; }
.file-link:hover { text-decoration: underline; }
.file-missing { color: #95a5a6; }

th.sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
th.sortable:hover {
  background: #eef1f5;
}
th.sortable[data-sort-dir='asc']::after {
  content: ' ▲';
  font-size: 0.7em;
  color: #2c3e50;
}
th.sortable[data-sort-dir='desc']::after {
  content: ' ▼';
  font-size: 0.7em;
  color: #2c3e50;
}

/* Table filter bar */
.table-filters {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.filter-group {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.filter-btn {
  padding: 0.35rem 0.85rem;
  border: 1px solid #d8dce3;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-weight: 500;
  color: #2c3e50;
  font-size: 0.9rem;
  transition: background 0.2s, color 0.2s;
}
.filter-btn:hover {
  background: #f0f3f7;
}
.filter-btn.active {
  background: #2c3e50;
  color: #fff;
  border-color: #2c3e50;
}
.filter-search {
  padding: 0.45rem 0.75rem;
  border: 1px solid #d8dce3;
  border-radius: 6px;
  min-width: 240px;
  font-size: 0.9rem;
}
.filter-search:focus {
  outline: none;
  border-color: #3498db;
}

/* ===== Interview Guide ===== */
.ig-guide {
  margin-top: 0.5rem;
}

.ig-header h2 {
  margin-bottom: 0.25rem;
}

.ig-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.5rem;
  color: #6b7684;
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
}

.ig-id {
  color: #98a1ad;
}

.guide-card {
  background: #fff;
  border: 1px solid #dfe3ea;
  border-radius: 8px;
  padding: 1.1rem 1.4rem;
  margin-top: 1rem;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.guide-card h3 {
  margin-bottom: 0.6rem;
  font-size: 1rem;
  color: #2c3e50;
}

.guide-card h4 {
  margin-bottom: 0.35rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.ig-count {
  display: inline-block;
  background: #eef1f5;
  color: #5a6572;
  border-radius: 999px;
  font-size: 0.75rem;
  padding: 0.05rem 0.55rem;
  vertical-align: middle;
}

.ig-assessment {
  background: #f6f8fb;
  border-left: 3px solid #3498db;
  border-radius: 0 6px 6px 0;
  padding: 0.6rem 0.9rem;
  margin-bottom: 0.9rem;
}

.ig-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

@media (max-width: 720px) {
  .ig-two-col {
    grid-template-columns: 1fr;
  }
}

.ig-col h4 {
  margin-top: 0;
}

.ig-col ul {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.9rem;
}

.ig-col li {
  margin-bottom: 0.3rem;
}

.ig-questions {
  margin: 0;
}

.question-item {
  display: flex;
  gap: 0.85rem;
  padding: 0.95rem 0;
  border-top: 1px solid #edf0f4;
}

.question-item:first-child {
  border-top: none;
  padding-top: 0.25rem;
}

.q-num {
  flex: 0 0 auto;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  background: #2c3e50;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.1rem;
}

.q-body {
  flex: 1 1 auto;
  min-width: 0;
}

.question-item .level {
  display: inline-block;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.12rem 0.55rem;
  margin-bottom: 0.35rem;
}

.level-foundational { background: #e6f4ea; color: #1e7e34; }
.level-analysis { background: #e7f0fd; color: #1a56b8; }
.level-critical { background: #fdecea; color: #c0392b; }
.level-advanced { background: #f0e9fb; color: #6f42c1; }
.level-reflection { background: #eef1f5; color: #5a6572; }

.question-item .question {
  margin: 0 0 0.2rem;
  font-size: 0.97rem;
  line-height: 1.55;
}

.question-item .evidence {
  margin: 0.4rem 0 0;
  padding: 0.5rem 0.85rem;
  background: #f8f9fb;
  border-left: 3px solid #d8dce3;
  border-radius: 0 6px 6px 0;
  font-size: 0.87rem;
  font-style: italic;
  color: #4a5563;
}

.question-item .purpose {
  margin: 0.4rem 0 0;
  color: #7a8494;
  font-size: 0.82rem;
}

/* ============================================================
   MOBILE RESPONSIVE (Phase 0)
   Breakpoints: 900px (tablet+), 560px (phone)
   Target devices: iPhone 17 Pro (~402px), iPad Mini (~744px), iPad Air (~820px)
   ============================================================ */

/* Backstop — never allow horizontal page scroll at any size */
html {
  -webkit-text-size-adjust: 100%;
}

body {
  overflow-x: hidden;
}

/* ---- Tablet & small laptop (<= 900px) ---- */
@media (max-width: 900px) {
  nav {
    padding: 0.6rem 1rem;
  }
  nav-inner {
    max-width: none;
    gap: 0.5rem 1rem;
  }
  nav h1 {
    font-size: 1.1rem;
  }
  nav a {
    font-size: 0.84rem;
    padding: 0.45rem 0.7rem;
  }
  .nav-user {
    padding-left: 0.6rem;
  }

  .panels-section {
    padding: 0 1rem 1.5rem;
  }
  .assignment-workspace {
    padding: 1rem 1rem;
  }
  .workspace-inner {
    gap: 1rem;
  }
  .assignment-selector {
    min-width: 0;
  }

  /* iOS auto-zooms into focus if an input is < 16px */
  input, select, textarea {
    font-size: 16px;
  }

  /* Minimum tap target */
  .btn, .workspace-tabs a, .quick-action-card {
    min-height: 40px;
  }
}

/* ---- Phone (<= 560px) ---- */
@media (max-width: 560px) {
  /* Stack the assignment workspace (selector + info + manager) */
  .workspace-inner {
    flex-direction: column;
    align-items: stretch;
  }

  /* Wide data tables scroll horizontally within their container */
  table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .panel-content {
    padding: 0.9rem;
  }
  .status-section {
    padding: 1rem;
  }
  .mark-detail-modal {
    padding: 1rem;
    width: 94vw;
  }
  .hero {
    padding: 2rem 1rem;
  }
  .hero h1 {
    font-size: 1.9rem;
  }
  .hero .cta {
    padding: 0.85rem 1.6rem;
    font-size: 1rem;
  }
}
