:root {
  color-scheme: light;
  --ink: #17363c;
  --text: #29484d;
  --muted: #4b6a70;
  --teal: #087564;
  --teal-dark: #075c50;
  --mint: #e8f4f0;
  --paper: #f4f8f7;
  --line: #d8e5e2;
  --white: #fff;
  --radius: 16px;
  font: 16px/1.55 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
p, h1, h2 { margin: 0; }
[hidden] { display: none; }

:focus-visible { outline: 3px solid #008375; outline-offset: 3px; }
.skip-link, .visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.skip-link:focus {
  clip-path: none;
  left: 16px;
  top: 16px;
  width: auto;
  height: auto;
  padding: 10px 14px;
  z-index: 5;
  color: var(--ink);
  background: var(--white);
}

.topbar {
  height: 74px;
  padding: 0 clamp(20px, 4vw, 62px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #ecf6f4;
  background: #12363c;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 41px;
  height: 41px;
  color: #154038;
  background: #bce6d1;
  border-radius: 11px;
  font-size: 22px;
  font-weight: 800;
}
.brand strong { display: block; font-weight: 750; letter-spacing: .11em; line-height: 1.25; }
.brand div span { display: block; color: #c7e2dc; font-size: .79rem; }
.training-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #c7e2dc;
  font-size: .83rem;
  font-weight: 600;
}
.training-label span { width: 7px; height: 7px; border-radius: 50%; background: #a5dabf; }

.layout {
  width: min(1410px, 100%);
  min-height: calc(100vh - 74px);
  margin: 0 auto;
  padding: clamp(26px, 5vw, 60px) clamp(20px, 4vw, 62px);
  display: grid;
  grid-template-columns: minmax(205px, 238px) minmax(0, 1fr);
  gap: clamp(24px, 5vw, 70px);
  align-items: start;
}
.course { position: sticky; top: 24px; }
.course-heading { padding: 0 10px 14px; }
.course-heading h2 { font-size: 1.1rem; }
.course-heading p { color: var(--muted); font-size: .82rem; }
#lessons { display: grid; gap: 5px; }
.lesson-control {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  column-gap: 11px;
  padding: 8px 9px;
  min-height: 48px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--text);
  background: transparent;
  text-align: left;
}
.lesson-control:hover { background: #eaf2ef; }
.lesson-control[aria-current="step"] {
  border-color: #c4dfd8;
  color: var(--teal-dark);
  background: var(--mint);
  font-weight: 700;
}
.lesson-marker {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border: 1px solid #d2e2de;
  border-radius: 7px;
  color: var(--teal-dark);
  background: var(--white);
  font-size: .79rem;
  font-weight: 700;
}
.lesson-title { line-height: 1.28; font-size: .89rem; }

main { min-width: 0; }
.exercise-header { margin-bottom: 24px; }
.exercise-meta {
  display: flex;
  gap: 9px;
  color: var(--teal-dark);
  font-size: .8rem;
  font-weight: 700;
}
.exercise-meta span + span::before { content: '›'; margin-right: 9px; color: var(--muted); }
h1 {
  margin-top: 6px;
  color: var(--ink);
  font-size: clamp(1.85rem, 4vw, 2.85rem);
  font-weight: 770;
  letter-spacing: -.04em;
  line-height: 1.13;
}
.exercise-summary { margin-top: 9px; color: var(--muted); max-width: 66ch; }
.tracker {
  display: flex;
  gap: 5px;
  width: min(320px, 100%);
  margin-top: 17px;
}
.tracker span { flex: 1; height: 4px; border-radius: 4px; background: #d7e6e2; }
.tracker .complete { background: var(--teal); }
.tracker .current { background: #74b4a7; }

.work-area {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(215px, 31%);
  gap: 16px;
  align-items: start;
}
.screen {
  min-width: 0;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 27px #12363c0c;
}
.screen-header {
  padding: 15px clamp(15px, 3vw, 25px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
}
.screen-header h2 { font-size: 1rem; font-weight: 740; }
.badge, .pill {
  display: inline-block;
  border: 1px solid #c6e0d7;
  padding: 2px 9px;
  border-radius: 100px;
  color: var(--teal-dark);
  background: #eff8f4;
  font-size: .77rem;
  font-weight: 700;
}
.exercise-form { display: grid; gap: 14px; padding: clamp(15px, 3vw, 25px); }
.record-card {
  padding: 15px;
  border: 1px solid var(--line);
  border-top: 3px solid #23927f;
  border-radius: 10px;
  background: #f8fbfa;
}
.record-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
}
.patient-name { margin-top: 10px; font-size: .96rem; font-weight: 720; }
.patient-id { margin-top: 2px; color: var(--muted); font-size: .83rem; }
.field { display: grid; gap: 4px; font-weight: 660; color: var(--ink); }
.field span { font-size: .9rem; }
.field small { color: var(--muted); font-weight: 400; font-size: .8rem; }
.field input, .field select, .field textarea {
  width: 100%;
  min-height: 42px;
  max-width: 100%;
  padding: 7px 10px;
  border: 1px solid #c1d4d2;
  border-radius: 7px;
  color: var(--ink);
  background: var(--white);
  font-weight: 440;
}
.field textarea { resize: vertical; }
.button {
  min-height: 42px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: .89rem;
  font-weight: 720;
  text-align: center;
}
.button-primary { border-color: var(--teal); background: var(--teal); color: var(--white); }
.button-primary:hover { border-color: var(--teal-dark); background: var(--teal-dark); }
.button-secondary, .button-choice {
  border-color: #bad6cf;
  color: var(--teal-dark);
  background: var(--white);
}
.button-secondary:hover, .button-choice:hover { background: var(--mint); }
.form-actions { display: flex; justify-content: flex-end; padding-top: 2px; }
.choices { display: grid; gap: 9px; }
.choices .button { text-align: left; }

.guide {
  padding: clamp(15px, 2.2vw, 23px);
  background: var(--mint);
  border: 1px solid #cbe1d9;
  border-radius: var(--radius);
}
.step-count { font-size: .78rem; color: var(--teal-dark); font-weight: 730; }
.guide h2 { margin: 4px 0 7px; font-size: 1.25rem; letter-spacing: -.02em; line-height: 1.23; }
.guide p { color: var(--text); font-size: .91rem; }
.checkpoint { border-top: 1px solid #c4dbd3; padding-top: 10px; margin-top: 13px; }
.checkpoint strong { color: var(--teal-dark); font-size: .8rem; }
.checkpoint p { margin-top: 2px; font-size: .82rem; }

.feedback {
  margin-top: 14px;
  padding: 10px 13px;
  border: 1px solid #b5d5cd;
  border-radius: 8px;
  color: var(--teal-dark);
  background: var(--mint);
  font-size: .9rem;
}
.feedback[data-kind="error"] { border-color: #e7b6a7; color: #832b1f; background: #fff2ec; }
.placeholder, .completion {
  padding: clamp(18px, 4vw, 35px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}
.placeholder p, .completion p { margin-top: 8px; color: var(--muted); }
.placeholder .button, .completion-actions { margin-top: 18px; }
.completion-mark {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  margin-bottom: 9px;
  border-radius: 50%;
  background: var(--mint);
  color: var(--teal-dark);
  font-weight: 800;
}
.completion-actions { display: flex; flex-wrap: wrap; gap: 8px; }

@media (max-width: 950px) {
  .layout { grid-template-columns: minmax(165px, 195px) minmax(0, 1fr); }
  .work-area { grid-template-columns: minmax(0, 1fr); }
  .guide { grid-row: 1; }
}
@media (max-width: 650px) {
  .topbar { height: 62px; }
  .layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .course { position: static; }
  .course-heading { padding-left: 0; padding-bottom: 8px; }
  #lessons { display: flex; flex-wrap: wrap; }
  .lesson-control { min-height: 39px; grid-template-columns: 21px minmax(0, 1fr); gap: 5px; padding: 4px 6px; }
  .lesson-marker { width: 20px; height: 20px; font-size: .71rem; }
  .lesson-title { font-size: .78rem; }
  .training-label { font-size: .75rem; }
}

.record-card[data-status="occupied"] { border-top-color: #a86a24; background: #fffcf5; }
.record-card[data-status="occupied"] .pill {
  border-color: #e5d3a9;
  color: #755019;
  background: #fff6e0;
}
.summary-card {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
  gap: 8px 12px;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: .86rem;
}
.summary-card dt { color: var(--muted); }
.summary-card dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }

.session-note {
  margin: 18px 10px 0;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .78rem;
}
