/* ===== The Lab — printable lab handout styles ===== */

:root {
  --navy: #0d1b2a;
  --steel: #3a4a5a;
  --muted: #5b6b7b;
  --border: #d8dde2;
  --gold: #f2a900;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: #1b2430;
  background: #eef0f2;
  line-height: 1.5;
}

.toolbar {
  position: sticky;
  top: 0;
  background: var(--navy);
  color: #fff;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 10;
}

.toolbar a.back { color: #cfd8e3; font-size: .9rem; text-decoration: none; }
.toolbar a.back:hover { text-decoration: underline; }

.toolbar button {
  background: var(--gold);
  color: var(--navy);
  border: none;
  padding: 9px 18px;
  border-radius: 7px;
  font-weight: 700;
  cursor: pointer;
  font-size: .9rem;
}
.toolbar button:hover { background: #ffbb24; }

.sheet {
  max-width: 850px;
  margin: 28px auto 60px;
  background: #fff;
  padding: 48px 56px;
  box-shadow: 0 4px 18px rgba(13,27,42,.12);
  border-radius: 4px;
}

.sheet header.head {
  border-bottom: 3px solid var(--navy);
  padding-bottom: 16px;
  margin-bottom: 24px;
}

.sheet .lab-kicker {
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: .74rem;
  font-weight: 700;
  color: var(--gold);
  background: var(--navy);
  display: inline-block;
  padding: 3px 10px;
  border-radius: 4px;
  margin-bottom: 10px;
}

.sheet h1 { font-family: "Space Grotesk", sans-serif; margin: 0 0 8px; font-size: 1.7rem; }
.sheet .subtitle { color: var(--muted); font-size: .95rem; margin: 0; }

.name-line {
  display: flex;
  gap: 24px;
  margin-top: 16px;
  font-size: .9rem;
  color: var(--steel);
  flex-wrap: wrap;
}
.name-line span { border-bottom: 1px solid #aab4be; padding: 4px 0 4px 4px; min-width: 180px; display: inline-block; }

.sheet h2.section {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.05rem;
  margin: 30px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
  color: var(--navy);
}

.sheet ol, .sheet ul { padding-left: 22px; }
.sheet li { margin-bottom: 8px; }

.callout {
  background: #fdf3e0;
  border-left: 4px solid var(--gold);
  padding: 12px 16px;
  border-radius: 6px;
  font-size: .92rem;
  margin: 12px 0;
}

.callout.safety { background: #fdeaea; border-left-color: #c0392b; }
.callout.detroit { background: #e8f6f4; border-left-color: #0ea5a3; }
.callout.home { background: #eef2fb; border-left-color: #3b5bdb; }
.callout .src-url { color: #555; font-size: .85em; }

table.data-table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: .92rem; }
table.data-table th, table.data-table td {
  border: 1px solid var(--border);
  padding: 10px;
  min-height: 30px;
}
table.data-table th { background: #f2f4f6; text-align: left; }

.blank-lines .line {
  border-bottom: 1px solid #aab4be;
  height: 26px;
  margin-bottom: 10px;
}

.sheet footer.foot {
  margin-top: 36px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: .78rem;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
}

/* ---- small screens ---- */
@media screen and (max-width: 640px) {
  .sheet { padding: 24px 16px; margin: 12px 8px 40px; overflow-wrap: anywhere; }
  .sheet table.data-table { display: block; overflow-x: auto; }
  .toolbar { flex-wrap: wrap; }
  .name-line span { min-width: 120px; }
}

/* ---- toolbar actions ---- */
.toolbar-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar button.tb-ghost {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255,255,255,.5);
  font-weight: 600;
}
.toolbar button.tb-ghost:hover { background: rgba(255,255,255,.12); }
.toolbar button.tb-ghost[aria-pressed="true"] { background: #fff; color: var(--navy); }
.toolbar button:focus-visible, .toolbar a:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* ---- teacher key ---- */
.teacher-banner {
  display: none;
  background: #b3261e;
  color: #fff;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 4px;
  margin-bottom: 14px;
  text-align: center;
  letter-spacing: .5px;
  font-size: .85rem;
}
body.teacher-mode .teacher-banner { display: block; }

.teacher-only { display: none; }
body.teacher-mode .teacher-only {
  display: block;
  margin-top: 34px;
  padding-top: 18px;
  border-top: 4px double var(--navy);
}
.teacher-only h3 { font-family: "Space Grotesk", sans-serif; font-size: .98rem; margin: 18px 0 6px; color: var(--navy); }
.key-meta { display: flex; gap: 22px; flex-wrap: wrap; background: #eaf3ff; padding: 10px 14px; border-radius: 6px; font-size: .9rem; }
.key-note { font-size: .88rem; color: var(--muted); margin: 0 0 6px; }

/* ---- high-contrast print mode (toggle, also usable for photocopying) ---- */
body.hc { background: #fff; }
body.hc .sheet { box-shadow: none; font-size: 1.04rem; line-height: 1.6; }
body.hc .sheet, body.hc .sheet * { color: #000 !important; }
body.hc .sheet header.head { border-bottom: 4px solid #000; }
body.hc .sheet h2.section { border-bottom: 2px solid #000; }
body.hc .lab-kicker { background: #fff; border: 2px solid #000; }
body.hc .callout, body.hc .callout.safety, body.hc .callout.detroit, body.hc .callout.home {
  background: #fff !important; border: 2px solid #000; border-left-width: 9px;
}
body.hc .key-meta { background: #fff; border: 2px solid #000; }
body.hc table.data-table th, body.hc table.data-table td { border: 2px solid #000; }
body.hc table.data-table th { background: #fff; }
body.hc .blank-lines .line { border-bottom: 2px solid #000; }
body.hc .name-line span { border-bottom: 2px solid #000; }
body.hc .teacher-banner { background: #fff; border: 3px solid #000; }
body.hc.teacher-mode .teacher-only { border-top: 4px double #000; }

@media print {
  body { background: #fff; }
  .toolbar { display: none; }
  body.teacher-mode .teacher-only { page-break-before: always; }
  .sheet { box-shadow: none; margin: 0; padding: 0; max-width: 100%; }
  a[href]::after { content: ""; }
  @page { margin: 18mm 16mm; }
}
