/* Biology 30 Portal — shared viewer styling */

:root {
  --bio30-bg: #f5f7fb;
  --bio30-card: #ffffff;
  --bio30-border: #dbe3ef;
  --bio30-text: #1f2937;
  --bio30-muted: #64748b;
  --bio30-accent: #1d4ed8;
  --bio30-header-bg: #0f2744;
  --bio30-header-text: #f8fafc;
  --bio30-pass: #067647;
  --bio30-pass-bg: #ecfdf3;
  --bio30-warning: #b54708;
  --bio30-warning-bg: #fffaeb;
  --bio30-action: #b42318;
  --bio30-action-bg: #fef3f2;
  --bio30-info-bg: #e8f0fe;
}

* { box-sizing: border-box; }

body.bio30-viewer {
  margin: 0;
  background: var(--bio30-bg);
  color: var(--bio30-text);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

.bio30-header {
  background: var(--bio30-header-bg);
  color: var(--bio30-header-text);
  padding: 16px 20px;
}

.bio30-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.bio30-brand {
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.85;
  margin: 0 0 4px;
}

.bio30-header h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
}

.bio30-header-sub {
  margin: 4px 0 0;
  font-size: 14px;
  opacity: 0.9;
}

.bio30-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 16px 48px;
}

.back-link {
  display: inline-block;
  margin-bottom: 16px;
  color: var(--bio30-accent);
  text-decoration: none;
  font-size: 14px;
}

.back-link:hover { text-decoration: underline; }

.status-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  align-items: center;
}

.status-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bio30-info-bg);
  color: #1a4d8f;
  font-size: 12px;
  font-weight: 600;
}

.card {
  background: var(--bio30-card);
  border: 1px solid var(--bio30-border);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 16px;
}

.card h2 {
  margin: 0 0 12px;
  font-size: 1.15rem;
}

.card h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

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

.stat-card {
  background: #f8fafc;
  border: 1px solid #eef2f7;
  border-radius: 8px;
  padding: 14px;
}

.stat-label {
  font-size: 12px;
  color: var(--bio30-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.stat-value {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 4px;
}

.muted { color: var(--bio30-muted); font-size: 14px; }

.error { color: var(--bio30-action); }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge-pass {
  background: var(--bio30-pass-bg);
  color: var(--bio30-pass);
  border: 1px solid #bbf7d0;
}

.badge-warning {
  background: var(--bio30-warning-bg);
  color: var(--bio30-warning);
  border: 1px solid #fedf89;
}

.badge-action {
  background: var(--bio30-action-bg);
  color: var(--bio30-action);
  border: 1px solid #fecdca;
}

.badge-info {
  background: var(--bio30-info-bg);
  color: #1a4d8f;
  border: 1px solid #bfdbfe;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th,
.data-table td {
  border: 1px solid #eef2f7;
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

.data-table th {
  background: #f8fafc;
  font-weight: 600;
}

.data-table tr:nth-child(even) td {
  background: #fafbfc;
}

.material-link {
  color: var(--bio30-accent);
  text-decoration: none;
}

.material-link:hover { text-decoration: underline; }

.material-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.material-tile {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  background: #f8fafc;
  border: 1px solid #eef2f7;
  border-radius: 10px;
  min-height: 96px;
}

.material-tile-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--bio30-text);
  line-height: 1.35;
}

.material-btn {
  display: inline-block;
  align-self: flex-start;
  padding: 8px 14px;
  background: var(--bio30-accent);
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid #1e40af;
  transition: background 0.15s ease;
}

.material-btn:hover {
  background: #1e40af;
  text-decoration: none;
}

.section-intro {
  margin: 0 0 4px;
}

.sessions-table-wrap {
  overflow-x: auto;
  margin-top: 8px;
}

.sessions-table td,
.sessions-table th {
  white-space: nowrap;
}

.sessions-table td:nth-child(5),
.sessions-table td:nth-child(6),
.sessions-table th:nth-child(5),
.sessions-table th:nth-child(6) {
  white-space: normal;
  min-width: 140px;
}

.session-id,
.session-tz {
  font-size: 12px;
}

.materials-ref {
  font-size: 12px;
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
}

.stat-value-sm {
  font-size: 1rem;
  line-height: 1.35;
}

.whiteboard-main {
  padding-bottom: 32px;
}

.whiteboard-toolbar-card {
  padding-bottom: 12px;
}

.whiteboard-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.tool-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.tool-btn {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: var(--bio30-text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.tool-btn:hover {
  background: #eef2f7;
}

.tool-btn.active {
  background: var(--bio30-accent);
  color: #fff;
  border-color: #1e40af;
}

.tool-btn.secondary-tool {
  background: #fff;
}

.tool-label {
  font-size: 12px;
  color: var(--bio30-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.tool-label input[type="color"] {
  width: 36px;
  height: 28px;
  padding: 0;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  cursor: pointer;
}

.tool-label input[type="range"] {
  width: 90px;
}

.template-select {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  font-size: 13px;
  background: #fff;
}

.import-label {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.whiteboard-note {
  margin: 10px 0 0;
  font-size: 13px;
}

.whiteboard-sync-status {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--bio30-pass);
  font-weight: 600;
}

.whiteboard-sync-status.error {
  color: var(--bio30-action);
}

.sync-debug {
  margin-top: 10px;
  font-size: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 10px;
  background: #f8fafc;
}

.sync-debug summary {
  cursor: pointer;
  font-weight: 600;
  color: #334155;
}

.sync-debug-panel {
  margin-top: 8px;
}

.sync-debug-grid {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 4px 12px;
  margin: 0;
}

.sync-debug-grid dt {
  color: #64748b;
  font-weight: 600;
}

.sync-debug-grid dd {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.whiteboard-stage-card {
  padding: 12px;
}

.whiteboard-stage {
  width: 100%;
  min-height: 480px;
  height: calc(100vh - 340px);
  max-height: 720px;
  background: #fff;
  border: 1px solid #eef2f7;
  border-radius: 8px;
  overflow: hidden;
}

#board {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  background: #fff;
}

@media (max-width: 640px) {
  .whiteboard-stage {
    min-height: 360px;
    height: 55vh;
  }
  .tool-btn {
    padding: 7px 10px;
    font-size: 12px;
  }
}

.key-value {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 8px 16px;
  margin: 8px 0;
  font-size: 14px;
}

.key-value dt { color: var(--bio30-muted); font-weight: 600; }
.key-value dd { margin: 0; }

.question-block { margin-top: 12px; }

.blank-row {
  margin: 10px 0;
  padding: 12px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #eef2f7;
}

.blank-resolved {
  background: #f0f9ff;
  padding: 2px 6px;
  border-radius: 4px;
  border-bottom: 2px solid #93c5fd;
}

.answer-key {
  margin-top: 10px;
  padding: 12px;
  background: var(--bio30-pass-bg);
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  font-size: 14px;
}

.technical-panel {
  margin-top: 24px;
  border: 1px solid var(--bio30-border);
  border-radius: 10px;
  background: #fafbfc;
  padding: 12px 16px;
}

.technical-panel summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--bio30-muted);
  font-size: 13px;
}

.technical-panel pre {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12px;
  margin: 12px 0 0;
  max-height: 400px;
  overflow: auto;
}

ul.compact { margin: 8px 0; padding-left: 20px; }

@media (max-width: 640px) {
  .key-value { grid-template-columns: 1fr; }
  .data-table { font-size: 13px; }
  .data-table th, .data-table td { padding: 8px; }
}

.context-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-top: 8px; }
.context-card { border: 1px solid #cbd5e1; border-radius: 10px; padding: 14px; background: #fff; cursor: pointer; text-align: left; transition: border-color 0.15s, box-shadow 0.15s; }
.context-card:hover { border-color: #1d4ed8; box-shadow: 0 2px 8px rgba(29, 78, 216, 0.12); }
.context-card h4 { margin: 0 0 6px; font-size: 15px; }
.context-card p { margin: 0; font-size: 13px; color: #64748b; }
.context-badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; margin-top: 8px; background: #eef2f7; color: #475569; }
.context-badge.pilot { background: #ecfdf3; color: #067647; }
.context-badge.preview { background: #e8f0fe; color: #1d4ed8; }
.context-badge.shell { background: #fffaeb; color: #b54708; }
.context-section { margin-bottom: 20px; }
.context-section h3 { font-size: 14px; color: #64748b; margin: 0 0 4px; text-transform: uppercase; letter-spacing: 0.04em; }
.portal-wrap { max-width: 1100px; margin: 24px auto; padding: 0 16px 40px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.portal-nav { display: flex; gap: 8px; margin: 0 0 16px; flex-wrap: wrap; }
.nav-tab { padding: 8px 14px; border: 1px solid #cbd5e1; background: #fff; border-radius: 8px; cursor: pointer; font-size: 14px; }
.nav-tab.active { background: #1d4ed8; color: #fff; border-color: #1d4ed8; }
.eep-preview-badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; background: #fffaeb; color: #b54708; border: 1px solid #fedf89; margin-left: 8px; }
.eep-space-list { margin: 8px 0 0; padding-left: 18px; }
.login-grid { display: grid; gap: 12px; max-width: 420px; }
.login-grid input, .login-grid button { padding: 10px 12px; font-size: 15px; }
.hidden { display: none; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
button.secondary { background: #eef2f7; color: #1f2937; border: 1px solid #cbd5e1; }
.refresh-msg { margin-top: 10px; font-size: 14px; min-height: 18px; }
.refresh-msg.success { color: #067647; }
.refresh-msg.error { color: #b42318; }
.refresh-msg.info { color: #1d4ed8; }
.section-card { border-top: 1px solid #eef2f7; padding-top: 12px; margin-top: 12px; }

@media print {
  body.bio30-viewer, body { background: #fff; }
  .back-link, .technical-panel, .actions, .login-grid { display: none; }
  .card { break-inside: avoid; border-color: #ccc; }
  .bio30-header { background: #333; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .material-btn { color: #000; background: #eee; border-color: #999; }
  .sessions-table-wrap { overflow: visible; }
}


/* OPS-BIO30-NAV-001: course-first navigation; advanced content remains available by drill-in. */
body.bio30-course-shell { margin: 0; background: #f5f7fb; color: #1f2937; font-family: Arial, Helvetica, sans-serif; }
.bio30-shell { max-width: 1180px; margin: 0 auto; padding: 22px 18px 56px; }
.course-header { display:flex; justify-content:space-between; gap:18px; align-items:flex-start; padding:4px 0 18px; border-bottom:1px solid #dbe3ef; }
.course-brand,.course-kicker { margin:0 0 4px; color:#526b90; font-size:12px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; }
.course-header h1 { margin:0; font-size:1.8rem; color:#0f2744; }
.course-subtitle { margin:6px 0 0; color:#64748b; }
.course-account { display:flex; gap:8px; align-items:center; flex-wrap:wrap; justify-content:flex-end; }
.course-nav { display:flex; gap:8px; align-items:center; flex-wrap:wrap; padding:14px 0; position:relative; z-index:10; }
.course-nav-home,.course-menu>summary { display:inline-flex; align-items:center; min-height:38px; padding:8px 12px; border:1px solid #d3deec; border-radius:8px; background:#fff; color:#173b68; font-weight:600; font-size:14px; cursor:pointer; text-decoration:none; list-style:none; }
.course-menu>summary::-webkit-details-marker { display:none; }
.course-menu>summary::after { content:'⌄'; margin-left:8px; font-size:13px; }
.course-menu { position:relative; }
.course-menu-panel { position:absolute; top:44px; left:0; min-width:250px; display:grid; gap:2px; padding:8px; background:#fff; border:1px solid #d3deec; border-radius:10px; box-shadow:0 12px 24px rgba(15,39,68,.15); }
.course-menu-panel a,.course-menu-panel button { width:100%; padding:9px 10px; border:0; border-radius:6px; background:transparent; color:#173b68; text-align:left; font:inherit; cursor:pointer; text-decoration:none; }
.course-menu-panel a:hover,.course-menu-panel button:hover { background:#eef5ff; }
.course-menu-panel .menu-primary { background:#173b68; color:#fff; font-weight:700; }
.course-hero { display:flex; align-items:center; justify-content:space-between; gap:22px; padding:24px; }
.course-hero h2 { margin:0 0 6px; color:#0f2744; }
.course-hero-actions { display:flex; flex-wrap:wrap; gap:10px; }
.course-primary-action,.course-secondary-action { display:inline-block; padding:11px 14px; border-radius:8px; font-weight:700; text-decoration:none; white-space:nowrap; }
.course-primary-action { background:#173b68; color:#fff; }
.course-secondary-action { background:#eaf1fb; color:#173b68; border:1px solid #cbd9ec; }
.course-quick-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; margin-bottom:16px; }
.quick-card { display:flex; flex-direction:column; gap:5px; min-height:90px; padding:16px; border:1px solid #dbe3ef; border-radius:10px; background:#fff; color:#173b68; text-align:left; text-decoration:none; font:inherit; cursor:pointer; }
.quick-card:hover { border-color:#93b4df; background:#f8fbff; }
.quick-card span { color:#64748b; font-size:13px; line-height:1.35; }
.course-details { margin-bottom:12px; border:1px solid #dbe3ef; background:#fff; border-radius:10px; overflow:hidden; }
.course-details>summary { padding:14px 16px; font-weight:700; color:#0f2744; cursor:pointer; list-style:none; }
.course-details>summary::-webkit-details-marker { display:none; }
.course-details>summary::after { content:'Show'; float:right; color:#526b90; font-weight:600; font-size:13px; }
.course-details[open]>summary::after { content:'Hide'; }
.course-details-body { padding:0 16px 16px; }
#trainingView>.card:not(.course-hero) { display:none; }
@media(max-width:760px){ .bio30-shell { padding:16px 12px 36px; } .course-header,.course-hero { flex-direction:column; } .course-quick-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } .course-menu-panel { position:fixed; left:12px; right:12px; top:auto; min-width:0; } }
