:root {
  --ink: #18332f;
  --ink-soft: #59706c;
  --paper: #f7f5ef;
  --white: #fffefa;
  --teal: #0c7067;
  --teal-dark: #07564f;
  --teal-pale: #dcebe7;
  --coral: #e36f5b;
  --coral-pale: #fae7e0;
  --gold: #c8973e;
  --line: #d8dfda;
  --shadow: 0 18px 55px rgba(30, 57, 51, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--paper);
  font-family: "Noto Sans JP", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
textarea,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
textarea:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(12, 112, 103, 0.25);
  outline-offset: 3px;
}

.page-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.045;
  z-index: 20;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
}

.site-header {
  height: 84px;
  padding: 0 clamp(24px, 5vw, 76px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(24, 51, 47, 0.13);
  background: rgba(247, 245, 239, 0.92);
  backdrop-filter: blur(16px);
  position: relative;
  z-index: 10;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  width: 41px;
  height: 41px;
  display: grid;
  place-items: center;
  background: var(--teal);
  border-radius: 13px 13px 13px 4px;
  box-shadow: 0 8px 20px rgba(12, 112, 103, 0.18);
}

.brand-mark svg {
  width: 27px;
  fill: var(--white);
}

.brand-mark .brand-pulse {
  fill: none;
  stroke: var(--teal);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-family: "Shippori Mincho", serif;
  font-size: 20px;
  letter-spacing: 0.02em;
  line-height: 1.1;
}

.brand small {
  color: var(--ink-soft);
  font-size: 9px;
  letter-spacing: 0.14em;
  margin-top: 3px;
  text-transform: uppercase;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 13px;
}

.api-availability {
  min-height: 34px;
  padding: 7px 11px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}

.api-availability i {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  background: #c39236;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(195, 146, 54, 0.12);
}

.api-availability strong {
  color: #8c671f;
  font-size: 12px;
}

.api-availability.is-available {
  background: rgba(228, 242, 237, 0.8);
  border-color: #acd0c5;
}

.api-availability.is-available i {
  background: var(--teal);
  box-shadow: 0 0 0 4px rgba(12, 112, 103, 0.12);
}

.api-availability.is-available strong {
  color: var(--teal-dark);
}

.api-availability.is-unavailable {
  background: rgba(250, 236, 232, 0.82);
  border-color: #dfb8ae;
}

.api-availability.is-unavailable i {
  background: #b24d3c;
  box-shadow: 0 0 0 4px rgba(178, 77, 60, 0.12);
}

.api-availability.is-unavailable strong {
  color: #8f372a;
}

.case-chip {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  padding: 8px 12px;
  color: var(--teal-dark);
  border: 1px solid #a9c5be;
  border-radius: 999px;
}

.icon-button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
}

.icon-button svg {
  width: 18px;
  fill: var(--ink-soft);
}

.icon-button .sound-on,
.icon-button[aria-pressed="true"] .sound-off {
  display: none;
}

.icon-button[aria-pressed="true"] .sound-on {
  display: block;
}

.app-shell {
  width: min(1600px, 100%);
  min-height: calc(100vh - 126px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 294px minmax(0, 1fr);
}

.app-shell.landing-mode {
  width: 100%;
  grid-template-columns: minmax(0, 1fr);
}

.app-shell:not(.landing-mode) {
  grid-template-columns: minmax(0, 1fr) 430px;
}

.app-shell:not(.landing-mode) .experience-panel {
  grid-column: 1;
  grid-row: 1;
}

.app-shell.landing-mode .experience-panel {
  min-height: calc(100vh - 126px);
  background:
    radial-gradient(circle at 82% 18%, rgba(213, 231, 223, 0.28), transparent 28%),
    var(--white);
}

.patient-panel {
  padding: 24px 20px 30px;
  border-right: 1px solid rgba(24, 51, 47, 0.13);
  background: #f1f0ea;
}

.patient-panel.memo-only {
  width: auto;
  min-width: 0;
  position: relative;
  grid-column: 2;
  grid-row: 1;
  padding: 24px 24px 36px;
  background: #eff1ed;
  border: 0;
  border-left: 1px solid rgba(24, 51, 47, 0.13);
}

.patient-panel.memo-only > :not(.clinical-memo) {
  display: none;
}

.patient-panel.memo-only .clinical-memo {
  margin-top: 0;
  margin-bottom: 0;
  position: sticky;
  top: 20px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.patient-visual {
  position: relative;
  margin-bottom: 14px;
}

.portrait {
  height: 132px;
  display: grid;
  place-items: end center;
  overflow: hidden;
  background: linear-gradient(145deg, #c8dcd6, #e6ebe4 58%, #d8ddd5);
  border-radius: 3px 40px 3px 3px;
}

.portrait::before {
  content: "";
  position: absolute;
  width: 90px;
  height: 90px;
  left: 18px;
  top: 18px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
}

.portrait svg {
  width: 132px;
  position: relative;
  filter: drop-shadow(0 12px 18px rgba(25, 50, 46, 0.15));
}

.portrait-skin {
  fill: #e7b99d;
}

.portrait-hair {
  fill: #304944;
}

.portrait-line {
  fill: none;
  stroke: #38524c;
  stroke-width: 3;
  stroke-linecap: round;
}

.portrait-shirt {
  fill: #2b6b65;
}

.portrait-collar {
  fill: none;
  stroke: #f7f3e9;
  stroke-width: 8;
}

.patient-status {
  position: absolute;
  right: 13px;
  bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: rgba(17, 50, 45, 0.82);
  border-radius: 999px;
  backdrop-filter: blur(6px);
}

.patient-status i {
  width: 7px;
  height: 7px;
  background: #82d5a4;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(130, 213, 164, 0.17);
}

.patient-name {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line);
}

.patient-name span,
.patient-name h2,
.patient-name small {
  display: block;
}

.patient-name > div > span {
  margin-bottom: 5px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
}

.patient-name h2 {
  margin: 0;
  font-family: "Shippori Mincho", serif;
  font-size: 25px;
}

.patient-name h2 small {
  display: inline;
  margin-left: 5px;
  font-family: "Noto Sans JP", sans-serif;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 500;
}

.patient-name .blood-type {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--teal);
  background: var(--teal-pale);
  border-radius: 50%;
}

.patient-facts {
  margin: 0;
  padding: 6px 0 8px;
  border-bottom: 1px solid var(--line);
}

.patient-facts > div {
  padding: 5px 0;
}

.patient-facts dt {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 600;
  margin-bottom: 3px;
}

.patient-facts dd {
  margin: 0;
  font-size: 12px;
  line-height: 1.65;
  font-weight: 600;
}

.learning-note {
  margin-top: 12px;
  padding: 10px 11px;
  background: rgba(255, 254, 250, 0.7);
  border-left: 3px solid var(--gold);
}

.learning-note span {
  color: var(--gold);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.learning-note p {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.7;
}

.chart-button {
  width: 100%;
  margin-top: 12px;
  padding: 11px 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--teal);
  background: transparent;
  border: 1px solid #a9c5be;
  border-radius: 3px 10px 3px 3px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}

.chart-button:hover {
  color: white;
  background: var(--teal);
}

.clinical-memo {
  margin-top: 14px;
  padding: 24px;
  background: #fffefa;
  border: 1px solid #cfd9d4;
  border-top: 3px solid var(--teal);
  border-radius: 3px 12px 3px 3px;
  box-shadow: 0 8px 22px rgba(27, 57, 51, 0.06);
}

.clinical-memo header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.clinical-memo header span,
.clinical-memo h3 {
  display: block;
}

.clinical-memo header span {
  color: var(--teal);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.13em;
}

.clinical-memo h3 {
  margin: 4px 0 0;
  font-family: "Shippori Mincho", serif;
  font-size: 25px;
}

.clinical-memo > header h3 {
  margin-top: 0;
}

.clinical-memo header button {
  padding: 7px 8px;
  color: #87928e;
  background: transparent;
  border: 0;
  font-size: 10px;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.clinical-memo header .memo-guide-toggle {
  flex: 0 0 auto;
  padding: 7px 9px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #536761;
  background: #f5f7f4;
  border: 1px solid #c9d7d2;
  border-radius: 999px;
  font-size: 9px;
  line-height: 1;
  text-decoration: none;
}

.clinical-memo header .memo-guide-toggle > span {
  width: 8px;
  height: 8px;
  display: block;
  background: var(--teal);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(12, 112, 103, 0.12);
}

.clinical-memo header .memo-guide-toggle > b {
  font-weight: 700;
  white-space: nowrap;
}

.clinical-memo header .memo-guide-toggle[aria-pressed="false"] {
  color: #7d8985;
  background: transparent;
}

.clinical-memo header .memo-guide-toggle[aria-pressed="false"] > span {
  background: #aab5b1;
  box-shadow: none;
}

.clinical-memo header .memo-guide-toggle:focus-visible {
  outline: 3px solid rgba(12, 112, 103, 0.18);
  outline-offset: 2px;
}

.clinical-memo > p {
  margin: 13px 0 16px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.75;
}

.memo-current-pattern {
  margin-top: 12px;
  padding: 10px 12px;
  background: #edf5f1;
  border: 1px solid #b9d2ca;
  border-left: 4px solid var(--teal);
  border-radius: 3px;
}

.memo-current-pattern small,
.memo-current-pattern strong { display: block; }
.memo-current-pattern small { color: #72837e; font-size: 9px; }
.memo-current-pattern strong { margin-top: 3px; color: var(--teal-deep); font-size: 14px; }

.clinical-memo .memo-pattern-guide {
  min-height: 34px;
  margin: 8px 0 10px;
  padding-left: 10px;
  color: #637671;
  border-left: 2px solid #b8d2ca;
  font-size: 11px;
  line-height: 1.55;
}

.memo-thinking-guide {
  margin: 12px 0 14px;
  overflow: hidden;
  background: #f8faf7;
  border: 1px solid #cddbd6;
  border-radius: 4px 12px 4px 4px;
}

.memo-thinking-guide > header {
  padding: 12px 13px;
  align-items: flex-start;
  background: linear-gradient(135deg, #e6f1ed, #f3f7f4);
  border-bottom: 1px solid #cddbd6;
}

.memo-thinking-guide.is-collapsed > header {
  border-bottom: 0;
}

.memo-thinking-guide > header h4 {
  margin: 3px 0 0;
  color: var(--teal-deep);
  font-size: 15px;
}

.memo-thinking-guide .memo-guide-toggle {
  background: rgba(255, 255, 255, 0.76);
}

.memo-thinking-guide-body {
  min-width: 0;
}

.memo-guide-tabs {
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  background: #f2f5f2;
  border-bottom: 1px solid #d8e2de;
}

.memo-guide-tabs button {
  min-height: 36px;
  padding: 7px 8px;
  color: #667873;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.memo-guide-tabs button[aria-selected="true"] {
  color: white;
  background: var(--teal);
  border-color: var(--teal);
  box-shadow: 0 3px 9px rgba(12, 112, 103, 0.16);
}

.memo-guide-tabs button:focus-visible {
  outline: 3px solid rgba(12, 112, 103, 0.18);
  outline-offset: 1px;
}

.memo-guide-section {
  padding: 13px;
}

.memo-guide-section h5 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
  font-size: 12px;
}

.memo-guide-section h5 > span {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--teal);
  border-radius: 50%;
  font-size: 10px;
}

.memo-guide-section > p {
  margin: 7px 0 10px;
  color: #71827d;
  font-size: 11px;
  line-height: 1.65;
}

.memo-guide-section ul {
  margin: 11px 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
  list-style: none;
}

.memo-guide-section li {
  position: relative;
  padding-left: 14px;
  color: #4f625d;
  font-size: 12px;
  line-height: 1.7;
}

.memo-guide-section:not(.assessment-views) li::before {
  content: "";
  width: 5px;
  height: 5px;
  position: absolute;
  top: 0.65em;
  left: 1px;
  background: #84b6aa;
  border-radius: 50%;
}

.memo-guide-section.assessment-views {
  background: #fffaf1;
}

.memo-guide-section.assessment-views h5 > span {
  color: #61491d;
  background: #e8c778;
}

.memo-guide-section.assessment-views li {
  padding: 8px 9px;
  display: grid;
  grid-template-columns: 21px minmax(0, 1fr);
  align-items: start;
  gap: 7px;
  color: #584c36;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid #eadbb8;
  border-radius: 4px;
}

.memo-guide-section.assessment-views li > span:first-child {
  width: 21px;
  height: 21px;
  display: grid;
  place-items: center;
  color: #876724;
  background: #f4e7c6;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 800;
}

.clinical-memo textarea {
  width: 100%;
  min-height: clamp(300px, 36vh, 420px);
  padding: 15px 16px;
  resize: vertical;
  color: var(--ink);
  background:
    linear-gradient(transparent 31px, #e3e7e3 32px) 0 0 / 100% 32px,
    #fbfcf9;
  border: 1px solid #d8dfda;
  border-radius: 2px;
  outline: none;
  font-size: 16px;
  line-height: 32px;
}

.clinical-memo textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(12, 112, 103, 0.1);
}

.clinical-memo footer {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 9px;
  color: #929d99;
  font-size: 10px;
}

.clinical-memo footer .saved {
  color: var(--teal);
}

.memo-pattern-overview {
  margin-top: 4px;
}

.memo-pattern-overview > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}

.memo-pattern-overview > div:first-child b { font-size: 12px; }
.memo-pattern-overview > div:first-child small { color: #84918d; font-size: 9px; }

.memo-pattern-jump-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
}

.memo-pattern-jump-list button {
  min-width: 0;
  min-height: 46px;
  padding: 6px;
  display: grid;
  grid-template-columns: 19px minmax(0, 1fr);
  align-items: center;
  column-gap: 4px;
  color: #50635e;
  text-align: left;
  background: #f7f8f5;
  border: 1px solid #d9e1dd;
  border-radius: 4px;
  cursor: pointer;
}

.memo-pattern-jump-list button b {
  color: #8a9994;
  font-size: 9px;
}

.memo-pattern-jump-list button span {
  min-width: 0;
  font-size: 9px;
  font-weight: 600;
  line-height: 1.4;
  overflow-wrap: anywhere;
  white-space: normal;
}

.memo-pattern-jump-list button.has-note {
  color: var(--teal-deep);
  background: #f0f7f4;
  border-color: #96c1b6;
}
.memo-pattern-jump-list button.active {
  color: var(--teal-deep);
  background: #e8f2ee;
  border-color: var(--teal);
  box-shadow: inset 3px 0 var(--teal);
}

.experience-panel {
  min-width: 0;
  background: var(--white);
}

.progress-nav {
  height: 82px;
  display: flex;
  align-items: center;
  padding: 0 clamp(30px, 5vw, 74px);
  border-bottom: 1px solid var(--line);
}

.progress-nav ol {
  width: min(660px, 100%);
  margin: 0 auto;
  padding: 0;
  display: flex;
  justify-content: space-between;
  list-style: none;
}

.progress-nav li {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #9aa8a4;
  font-size: 10px;
}

.progress-nav li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 42px;
  right: 13px;
  top: 13px;
  height: 1px;
  background: var(--line);
}

.progress-nav li span {
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  background: #ecefeb;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  position: relative;
  z-index: 1;
}

.progress-nav li.active,
.progress-nav li.done {
  color: var(--teal);
}

.progress-nav li.active span {
  color: white;
  background: var(--teal);
  box-shadow: 0 0 0 5px var(--teal-pale);
}

.progress-nav li.done span {
  color: white;
  background: #79aaa2;
}

.progress-nav li.done:not(:last-child)::after {
  background: #79aaa2;
}

.view {
  animation: view-in 0.5s ease both;
}

.role-selection-view {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: clamp(48px, 7vh, 82px) clamp(24px, 6vw, 78px) 70px;
}

.role-selection-heading {
  max-width: 760px;
}

.role-selection-heading h1 {
  margin: 0;
  font-family: "Shippori Mincho", serif;
  font-size: clamp(34px, 4.3vw, 58px);
  line-height: 1.35;
}

.role-selection-heading h1 em { color: var(--teal); font-style: normal; background: linear-gradient(transparent 76%, #d5e7df 0); }
.role-selection-heading > p:last-child { margin: 16px 0 0; color: var(--ink-soft); font-size: 14px; }

.role-selection-grid {
  margin-top: 40px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.role-card {
  min-height: 330px;
  padding: 26px 28px 24px;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  grid-template-rows: auto 1fr auto;
  gap: 22px 20px;
  color: var(--ink);
  text-align: left;
  background: rgba(255, 255, 252, 0.9);
  border: 1px solid #bfd1cb;
  border-radius: 3px 24px 3px 3px;
  box-shadow: 0 18px 50px rgba(24, 51, 47, 0.06);
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.role-card:hover, .role-card:focus-visible { transform: translateY(-4px); border-color: var(--teal); box-shadow: 0 24px 58px rgba(24, 51, 47, 0.11); }
.role-card-number { grid-column: 1 / -1; color: var(--teal); font-size: 10px; font-weight: 700; letter-spacing: .18em; }
.role-card-icon { width: 58px; height: 58px; display: grid; place-items: center; color: white; font-family: "Shippori Mincho", serif; font-size: 22px; background: var(--teal); border-radius: 50% 50% 50% 12px; }
.role-card.teacher .role-card-icon { background: #466f82; }
.role-card-copy, .role-card-copy small, .role-card-copy strong, .role-card-copy span { display: block; }
.role-card-copy small { color: var(--teal); font-size: 10px; font-weight: 700; letter-spacing: .16em; }
.role-card-copy strong { margin-top: 7px; font-family: "Shippori Mincho", serif; font-size: clamp(23px, 2.2vw, 31px); }
.role-card-copy span { margin-top: 13px; color: var(--ink-soft); font-size: 13px; line-height: 1.9; }
.role-card > b { grid-column: 1 / -1; padding-top: 17px; color: var(--teal); font-size: 13px; border-top: 1px solid #d6e0dc; }

.site-header .teacher-mode-nav {
  display: flex; align-items: center; gap: 6px; margin: 0 auto 0 24px; padding: 0;
  width: auto; min-height: 0; border: 0; background: transparent;
}

.site-header .teacher-mode-nav[hidden] { display: none; }
.teacher-mode-nav button { min-height: 46px; padding: 8px 16px; color: #516a65; font: inherit; font-size: 12px; font-weight: 700; background: transparent; border: 1px solid #9bbdb3; border-radius: 3px 11px 3px 3px; cursor: pointer; }
.teacher-mode-nav button:hover { border-color: var(--teal); background: #eaf4ef; }
.teacher-mode-nav button:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }
.teacher-mode-nav button.active { color: white; background: var(--teal); border-color: var(--teal); }

.teacher-dashboard-view {
  width: min(1260px, 100%);
  margin: 0 auto;
  padding: 36px clamp(24px, 5vw, 64px) 80px;
}

.teacher-dashboard-heading { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 28px; }
.teacher-dashboard-heading h1 { margin: 0; font-family: "Shippori Mincho", serif; font-size: clamp(30px, 3vw, 43px); }
.teacher-dashboard-heading p:last-child { margin: 9px 0 0; color: var(--ink-soft); font-size: 13px; }
.teacher-dashboard-heading .primary-button { flex: 0 0 auto; margin: 0; }
.teacher-dashboard-panel { border: 1px solid #c9d8d3; border-radius: 3px 18px 3px 3px; background: rgba(255,255,252,.82); overflow: hidden; }
.teacher-panel-summary { min-height: 60px; padding: 15px 22px; display: flex; align-items: center; justify-content: space-between; background: #eef3f0; border-bottom: 1px solid #c9d8d3; }
.teacher-panel-summary strong { font-size: 14px; }
.teacher-panel-summary span { color: var(--teal); font-size: 12px; font-weight: 700; }
#teacherCasesPanel { border: 0; background: transparent; box-shadow: none; overflow: visible; }
.teacher-case-review-list { padding: 0; }
html { scrollbar-gutter: stable; }
#teacherCasesPanel .patient-selection-list { margin-top: 0; }
#teacherGeneratedCaseRows { display: contents; }
.teacher-patient-card:focus-visible { outline: 3px solid var(--teal); outline-offset: 4px; }
.teacher-dashboard-status { margin: 0; padding: 13px 22px; color: var(--ink-soft); font-size: 10px; background: #f7f8f5; }

.teacher-metric-grid { padding: 22px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; background: #eef3f0; }
.teacher-metric-grid > div { padding: 17px 19px; background: white; border: 1px solid #d2ded9; }
.teacher-metric-grid small, .teacher-metric-grid strong { display: block; }
.teacher-metric-grid small { color: var(--ink-soft); font-size: 10px; }
.teacher-metric-grid strong { margin-top: 6px; color: var(--teal); font-family: "Shippori Mincho", serif; font-size: 28px; }
.teacher-activity-toolbar { padding: 18px 22px; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; border-bottom: 1px solid #dce4e1; }
.teacher-activity-toolbar label { color: var(--ink-soft); font-size: 9px; font-weight: 700; }
.teacher-demo-notice { min-height: 42px; padding: 9px 22px; display: flex; align-items: center; gap: 12px; color: #6b5b38; background: #fbf3df; border-bottom: 1px solid #ead8aa; }
.teacher-demo-notice span { padding: 4px 7px; color: white; font-size: 8px; font-weight: 700; letter-spacing: .12em; background: #a77a26; border-radius: 999px; }
.teacher-demo-notice p { margin: 0; font-size: 10px; }
.teacher-activity-toolbar input, .teacher-activity-toolbar select { width: 100%; min-height: 38px; margin-top: 6px; padding: 7px 10px; color: var(--ink); background: white; border: 1px solid #c6d5d0; border-radius: 3px; font: inherit; font-size: 11px; }
.teacher-activity-toolbar input:focus, .teacher-activity-toolbar select:focus { outline: 2px solid rgba(17, 105, 94, .2); border-color: var(--teal); }
.teacher-activity-head { min-height: 42px; padding: 0 22px; display: grid; grid-template-columns: 1fr 1.4fr .8fr 1fr .8fr; align-items: center; color: var(--ink-soft); font-size: 9px; font-weight: 700; background: #f7f8f5; border-bottom: 1px solid #dce4e1; }
.teacher-student-row { width: 100%; min-height: 70px; padding: 12px 22px; display: grid; grid-template-columns: 1fr 1.4fr .8fr 1fr .8fr; align-items: center; gap: 12px; color: var(--ink); text-align: left; background: white; border: 0; border-bottom: 1px solid #dce4e1; cursor: pointer; transition: background 150ms ease; }
.teacher-student-row:hover, .teacher-student-row:focus-visible { background: #f2f7f4; outline: none; }
.teacher-student-row > span { font-size: 10px; line-height: 1.6; }
.teacher-student-identity strong, .teacher-student-identity small { display: block; }
.teacher-student-identity strong { font-size: 13px; }
.teacher-student-identity small { margin-top: 2px; color: var(--ink-soft); font-size: 8px; letter-spacing: .08em; }
.teacher-student-progress { color: var(--teal); font-weight: 700; }
.teacher-student-evaluation { width: fit-content; padding: 5px 9px; text-align: center; font-size: 9px !important; font-weight: 700; border-radius: 999px; }
.teacher-student-evaluation.good, .teacher-student-detail header > span.good { color: #11695e; background: #dceee8; }
.teacher-student-evaluation.attention, .teacher-student-detail header > span.attention { color: #9a4f35; background: #f6dfd6; }
.teacher-activity-empty { min-height: 250px; padding: 42px 24px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.teacher-activity-empty > span { width: 48px; height: 48px; display: grid; place-items: center; color: white; font-family: "Shippori Mincho", serif; background: #88aaa2; border-radius: 50% 50% 50% 12px; }
.teacher-activity-empty strong { margin-top: 18px; font-size: 15px; }
.teacher-activity-empty p { max-width: 570px; margin: 9px 0 0; color: var(--ink-soft); font-size: 11px; line-height: 1.8; }

.teacher-activity-panel.is-detail-open > :not(.teacher-student-detail) { display: none; }
.teacher-student-detail { padding: 0 0 32px; background: #f8faf7; }
.teacher-student-detail > header { min-height: 116px; padding: 22px 26px; display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; align-items: center; gap: 22px; background: white; border-bottom: 1px solid #ccd9d5; }
.teacher-student-detail > header button { padding: 8px 10px; color: var(--teal); font: inherit; font-size: 10px; font-weight: 700; background: transparent; border: 1px solid #b9cec7; border-radius: 3px 9px 3px 3px; cursor: pointer; }
.teacher-student-detail > header small { color: var(--teal); font-size: 8px; font-weight: 700; letter-spacing: .14em; }
.teacher-student-detail > header h2 { margin: 5px 0 2px; font-family: "Shippori Mincho", serif; font-size: 25px; }
.teacher-student-detail > header p { margin: 0; color: var(--ink-soft); font-size: 10px; }
.teacher-student-detail > header > span { padding: 6px 11px; font-size: 9px; font-weight: 700; border-radius: 999px; }
.teacher-student-overview { padding: 20px 24px 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.teacher-student-overview > div { min-height: 76px; padding: 14px 15px; background: white; border: 1px solid #d2ded9; }
.teacher-student-overview small, .teacher-student-overview strong { display: block; }
.teacher-student-overview small { color: var(--ink-soft); font-size: 8px; }
.teacher-student-overview strong { margin-top: 7px; font-size: 12px; line-height: 1.5; }
.teacher-attention-card { margin: 14px 24px 0; padding: 18px 20px; background: #fff8e8; border: 1px solid #e7d3a3; border-left: 4px solid #bd8730; }
.teacher-attention-card small, .teacher-attention-card strong { display: block; }
.teacher-attention-card small { color: #8f651f; font-size: 8px; font-weight: 700; letter-spacing: .1em; }
.teacher-attention-card strong { margin-top: 6px; font-size: 15px; }
.teacher-attention-card p { margin: 7px 0 0; color: #5f5a4d; font-size: 11px; line-height: 1.8; }
.teacher-score-section, .teacher-submission-section, .teacher-record-timeline { margin: 18px 24px 0; padding: 20px; background: white; border: 1px solid #d2ded9; }
.teacher-score-section > div:first-child small, .teacher-submission-section > div:first-child small, .teacher-record-timeline > div:first-child small { color: var(--teal); font-size: 8px; font-weight: 700; letter-spacing: .14em; }
.teacher-score-section h3, .teacher-submission-section h3, .teacher-record-timeline h3 { margin: 5px 0 16px; font-family: "Shippori Mincho", serif; font-size: 19px; }
.teacher-score-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.teacher-score-grid > div { padding: 11px; background: #f3f6f3; border: 1px solid #dde5e2; }
.teacher-score-grid span, .teacher-score-grid strong { display: block; }
.teacher-score-grid span { min-height: 28px; color: var(--ink-soft); font-size: 8px; }
.teacher-score-grid strong { margin-top: 5px; font-size: 13px; }
.teacher-score-grid i { height: 4px; margin-top: 8px; display: block; background: linear-gradient(90deg, var(--teal) calc(var(--score) / 3 * 100%), #d9e1de 0); border-radius: 999px; }
.teacher-submission-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.teacher-submission-grid article { padding: 15px; background: #f7f8f5; border-left: 3px solid #90b6ad; }
.teacher-submission-grid h4 { margin: 0; color: var(--teal-deep); font-size: 11px; }
.teacher-submission-grid p { margin: 8px 0 0; color: #435854; font-size: 10px; line-height: 1.85; }
/* Teacher record reader */
.teacher-dashboard-view.student-detail-open > .teacher-dashboard-heading { display: none; }
.teacher-student-detail .teacher-student-overview { padding-top: 12px; gap: 0; }
.teacher-student-detail .teacher-student-overview > div { min-height: 60px; padding: 10px 14px; border-right: 0; }
.teacher-student-detail .teacher-student-overview > div:last-child { border-right: 1px solid #d2ded9; }
.teacher-detail-tabs { display: flex; gap: 24px; margin: 16px 24px 0; border-bottom: 1px solid #b9cec7; }
.teacher-detail-tabs button { padding: 12px 0; border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--ink-soft); font: inherit; font-size: 13px; cursor: pointer; }
.teacher-detail-tabs button[aria-pressed="true"] { color: var(--teal-dark); border-bottom-color: var(--teal); font-weight: 700; }
.teacher-original-section { margin-top: 0; border-top: 0; }
.teacher-reader-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 18px; }
.teacher-reader-heading h3 { margin: 0; }
.teacher-reader-heading > span { color: var(--ink-soft); font-size: 10px; letter-spacing: .06em; }
.teacher-original-note { margin: 6px 0 14px; color: var(--ink-soft); font-size: 11px; line-height: 1.7; }
.teacher-original-nav { display: flex; flex-wrap: wrap; gap: 6px; padding: 5px; margin-bottom: 16px; background: #eef3f0; border-radius: 6px; }
.teacher-original-nav button { flex: 1; padding: 10px 8px; border: 1px solid transparent; border-radius: 4px; background: transparent; color: var(--ink-soft); font: inherit; font-size: 12px; cursor: pointer; }
.teacher-original-nav button[aria-pressed="true"] { color: var(--teal-dark); border-color: #c4d4cc; background: white; box-shadow: 0 1px 3px #173b2e12; font-weight: 700; }
.teacher-detail-tabs button:focus-visible, .teacher-original-nav button:focus-visible, .teacher-pattern-nav button:focus-visible, .teacher-pattern-content:focus-visible { outline: 3px solid #8ebbae; outline-offset: 2px; }
.teacher-pattern-workspace { display: grid; grid-template-columns: 210px minmax(0, 1fr); border: 1px solid #d2ded9; border-radius: 5px; overflow: hidden; }
.teacher-pattern-nav { padding: 8px; background: #f5f8f5; border-right: 1px solid #d2ded9; }
.teacher-pattern-nav button { display: block; width: 100%; padding: 11px 10px; margin-bottom: 3px; text-align: left; border: 0; border-radius: 3px; background: transparent; color: #52645e; font: inherit; font-size: 12px; line-height: 1.6; cursor: pointer; }
.teacher-pattern-nav button[aria-pressed="true"] { background: var(--teal-dark); color: white; font-weight: 700; }
.teacher-pattern-nav button:hover:not([aria-pressed="true"]) { background: #e5eeea; }
.teacher-pattern-select { display: none; }
.teacher-pattern-content { min-width: 0; max-height: 560px; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; padding: 20px; }
.teacher-pattern-title { margin: 0 0 14px; color: var(--teal-dark); font-size: 17px; line-height: 1.7; }
.teacher-original-pattern article { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; margin: 18px 0 0; padding-top: 16px; border-top: 1px solid #dfe7e2; }
.teacher-original-pattern article h4 { grid-column: 1 / -1; margin: 0; font-size: 13px; line-height: 1.7; }
.teacher-original-field { min-width: 0; margin: 0; padding: 12px 14px; background: #f7f8f5; border-left: 2px solid #a7c5bc; }
.teacher-original-pattern > .teacher-original-field { display: flex; align-items: baseline; gap: 16px; padding: 9px 12px; background: #edf5f0; }
.teacher-original-field h5 { margin: 0 0 6px; flex-shrink: 0; color: var(--teal-dark); font-size: 11px; }
.teacher-original-field p { margin: 0; color: #354b46; font-size: 13px; line-height: 1.9; white-space: pre-wrap; overflow-wrap: anywhere; }
#teacherOriginalContent > h4 { margin: 0 0 12px; font-size: 14px; }
.teacher-soap-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.teacher-soap-grid .teacher-original-field { padding: 20px; }
@media (max-width: 1100px) {
  .teacher-pattern-workspace { grid-template-columns: 180px minmax(0, 1fr); }
  .teacher-original-pattern article { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .teacher-detail-tabs { gap: 16px; margin-right: 14px; margin-left: 14px; }
  .teacher-detail-tabs button { font-size: 11px; }
  .teacher-original-section { padding: 14px; }
  .teacher-reader-heading h3 { font-size: 17px; }
  .teacher-original-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .teacher-original-nav button { font-size: 11px; }
  .teacher-pattern-workspace { display: block; }
  .teacher-pattern-nav { display: none; }
  .teacher-pattern-select { display: block; padding: 12px; color: var(--teal-dark); background: #f3f7f4; font-size: 11px; }
  .teacher-pattern-select select { display: block; width: 100%; margin-top: 6px; padding: 10px 6px; font: inherit; font-size: 13px; color: var(--teal-dark); background: white; border: 1px solid #b9cec7; border-radius: 3px; }
  .teacher-pattern-content { padding: 14px; max-height: none; overflow: visible; }
  .teacher-pattern-title { font-size: 15px; }
  .teacher-soap-grid { grid-template-columns: 1fr; gap: 12px; }
  .teacher-soap-grid .teacher-original-field { padding: 14px; }
}
.teacher-record-timeline #teacherStudentTimeline article { min-height: 80px; display: grid; grid-template-columns: 60px minmax(0, 1fr) 130px; align-items: center; gap: 16px; border-top: 1px solid #e0e6e3; }
.teacher-record-timeline #teacherStudentTimeline article > span { color: var(--teal); font-size: 9px; font-weight: 700; letter-spacing: .08em; }
.teacher-record-timeline h4 { margin: 0; font-size: 12px; }
.teacher-record-timeline p { margin: 5px 0 0; color: var(--ink-soft); font-size: 10px; line-height: 1.7; }
.teacher-record-timeline article > div:last-child { text-align: right; }
.teacher-record-timeline article > div:last-child strong, .teacher-record-timeline article > div:last-child small { display: block; }
.teacher-record-timeline article > div:last-child strong { font-size: 11px; }
.teacher-record-timeline article > div:last-child small { margin-top: 4px; color: #9a603d; font-size: 8px; }

@keyframes view-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.case-selection-view {
  padding: 58px clamp(34px, 6vw, 90px) 68px;
}

.landing-mode .case-selection-view {
  width: min(1240px, 100%);
  margin: 0 auto;
  padding-top: 42px;
  animation: none;
}

.landing-mode .view-heading h1 {
  font-size: clamp(28px, 2.7vw, 39px);
  line-height: 1.35;
}

.landing-mode .view-heading > p:last-child {
  margin-top: 10px;
}

.view-heading {
  max-width: 680px;
}

.eyebrow {
  margin: 0 0 11px;
  color: var(--teal);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.view-heading h1,
.scene-header h1,
.record-header h1,
.feedback-heading h1 {
  margin: 0;
  font-family: "Shippori Mincho", serif;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.view-heading h1 {
  font-size: clamp(28px, 3.2vw, 44px);
  line-height: 1.45;
}

.view-heading h1 em {
  color: var(--teal);
  font-style: normal;
  background: linear-gradient(transparent 75%, #d5e7df 0);
}

.view-heading > p:last-child {
  margin: 14px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.patient-selection-list {
  margin-top: 26px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.patient-select-card {
  width: 100%;
  min-height: 430px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  padding: 0;
  text-align: left;
  color: var(--ink);
  background: #fff;
  border: 1px solid #b8cbc6;
  border-radius: 5px 36px 5px 5px;
  box-shadow: 0 18px 50px rgba(29, 62, 55, 0.1);
  cursor: pointer;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.patient-select-card::after {
  content: "";
  width: 180px;
  height: 180px;
  position: absolute;
  right: -80px;
  top: -90px;
  background: var(--teal-pale);
  border-radius: 50%;
  opacity: 0.55;
  pointer-events: none;
}

.patient-select-card:hover {
  transform: translateY(-4px);
  border-color: var(--teal);
  box-shadow: 0 24px 60px rgba(12, 112, 103, 0.16);
}

.patient-select-card:hover .patient-card-arrow {
  transform: translateX(5px);
  color: white;
  background: var(--teal-dark);
}

.generated-case-card {
  cursor: default;
}

.generated-case-open {
  width: 100%;
  min-height: 430px;
  display: flex;
  flex-direction: column;
  padding: 0;
  color: inherit;
  text-align: left;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.generated-case-open:focus-visible {
  outline: 3px solid rgba(12, 112, 103, 0.34);
  outline-offset: -4px;
}

.patient-card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 18px;
  background: #f1f7f4;
  border-bottom: 1px solid #dbe7e3;
}

.case-number {
  color: var(--teal);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
}

.available-status {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 600;
}

.available-status i {
  width: 7px;
  height: 7px;
  background: #49a070;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(73, 160, 112, 0.12);
}

.patient-card-main {
  display: grid;
  grid-template-columns: 78px 1fr;
  justify-items: stretch;
  align-items: center;
  gap: 15px;
  padding: 18px 18px 15px;
}

.patient-card-portrait {
  width: 78px;
  height: 78px;
  display: grid;
  place-items: end center;
  overflow: hidden;
  background: linear-gradient(145deg, #c8dcd6, #edf1eb);
  border-radius: 50% 50% 50% 10px;
}

.patient-card-portrait svg {
  width: 80px;
  transform: translateY(4px);
  filter: drop-shadow(0 9px 12px rgba(25, 50, 46, 0.14));
}

.patient-card-identity {
  display: block;
  text-align: left;
}

.patient-card-identity small,
.patient-card-identity strong,
.patient-card-identity span {
  display: block;
}

.patient-card-identity small {
  margin-bottom: 3px;
  color: var(--teal);
  font-size: 10px;
  font-weight: 700;
}

.patient-card-identity strong {
  font-family: "Shippori Mincho", serif;
  font-size: 26px;
}

.patient-card-identity span {
  margin-top: 6px;
  color: var(--ink-soft);
  font-size: 11px;
}

.patient-card-arrow {
  display: none;
}

.patient-card-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  padding: 0 18px;
}

.case-fact-box.treatment {
  grid-column: 1 / -1;
  grid-row: 2;
}

.case-fact-box {
  min-width: 0;
  display: block;
  padding: 9px 11px;
  background: #f5f6f2;
  border: 1px solid #e0e4df;
  border-radius: 3px 11px 3px 3px;
}

.case-fact-box small,
.case-fact-box strong {
  display: block;
}

.case-fact-box small {
  margin-bottom: 3px;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 600;
}

.case-fact-box strong {
  font-size: 10px;
  line-height: 1.5;
}

.case-focus-box {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 18px 0;
  padding: 9px 11px;
  color: #695a36;
  background: #fff8e6;
  border: 1px solid #ead8a7;
  border-radius: 3px;
}

.focus-mark {
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: #9f782a;
  background: #f4e5b9;
  border-radius: 50%;
  font-weight: 700;
}

.case-focus-box > span:last-child,
.case-focus-box small,
.case-focus-box strong {
  display: block;
}

.case-focus-box small {
  margin-bottom: 3px;
  color: #a07828;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.case-focus-box strong {
  font-size: 8px;
  line-height: 1.6;
}

.patient-card-cta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  margin-top: auto;
  padding: 13px 18px 15px;
  color: var(--teal);
  font-size: 11px;
  font-weight: 700;
}

.patient-placeholder {
  min-height: 430px;
  align-items: center;
  justify-content: center;
  padding: 28px;
  color: #8d9b97;
  background:
    repeating-linear-gradient(-45deg, rgba(238, 241, 237, 0.5), rgba(238, 241, 237, 0.5) 8px, rgba(250, 250, 247, 0.7) 8px, rgba(250, 250, 247, 0.7) 16px),
    #fafaf7;
  border: 1px dashed #c8d2ce;
  border-radius: 5px 28px 5px 5px;
  box-shadow: none;
  cursor: default;
  opacity: 0.72;
}

.patient-placeholder::after {
  display: none;
}

.patient-placeholder:hover {
  transform: none;
  border-color: #c8d2ce;
  box-shadow: none;
}

.placeholder-number {
  position: absolute;
  left: 20px;
  top: 18px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.placeholder-figure {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  color: #aab7b3;
  background: rgba(234, 238, 234, 0.9);
  border: 1px dashed #bcc8c4;
  border-radius: 50% 50% 50% 8px;
  font-size: 25px;
  font-weight: 300;
}

.placeholder-copy {
  display: block;
  margin-top: 18px;
  text-align: center;
}

.placeholder-copy strong,
.placeholder-copy small {
  display: block;
}

.placeholder-copy strong {
  font-family: "Shippori Mincho", serif;
  font-size: 15px;
}

.placeholder-copy small {
  margin-top: 7px;
  font-size: 9px;
  letter-spacing: 0.12em;
}

.patient-card-cta b {
  font-size: 17px;
}

.patient-selection-note {
  margin: 12px 0 0;
  text-align: right;
  color: var(--ink-soft);
  font-size: 9px;
}

.teacher-entry {
  margin-top: 24px;
  padding: 14px 16px 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: rgba(255, 254, 250, 0.74);
  border: 1px solid #c9d8d3;
  border-left: 4px solid var(--teal);
  border-radius: 3px 14px 3px 3px;
}

.teacher-entry div,
.teacher-entry small,
.teacher-entry strong {
  display: block;
}

.teacher-entry small {
  color: var(--teal);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.teacher-entry strong {
  margin-top: 3px;
  font-size: 13px;
}

.teacher-entry .secondary-button,
.teacher-entry .primary-button {
  flex: 0 0 auto;
  min-height: 42px;
  margin: 0;
  padding: 9px 15px;
}

.case-author-view {
  width: min(1260px, 100%);
  margin: 0 auto;
  padding: 44px clamp(24px, 5vw, 72px) 80px;
}

.case-author-header {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  margin-bottom: 28px;
}

.case-author-header h1 {
  margin: 0;
  font-family: "Shippori Mincho", serif;
  font-size: clamp(28px, 3vw, 43px);
  line-height: 1.42;
}

.case-author-header h1 em {
  color: var(--teal);
  font-style: normal;
  background: linear-gradient(transparent 76%, #d5e7df 0);
}

.case-author-header > div > p:last-child {
  max-width: 780px;
  margin: 12px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.8;
}

.case-author-required-note {
  margin-bottom: 16px;
  padding: 13px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--ink-soft);
  background: #e8f1ee;
  border-radius: 3px 12px 3px 3px;
  font-size: 12px;
}

.teacher-case-library {
  margin-bottom: 18px;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid #c8d6d1;
  border-left: 4px solid var(--gold);
}

.teacher-case-library > div:first-child small,
.teacher-case-library > div:first-child strong { display: block; }
.teacher-case-library > div:first-child small { color: var(--gold); font-size: 9px; font-weight: 700; letter-spacing: 0.14em; }
.teacher-case-library > div:first-child strong { margin-top: 3px; font-size: 14px; }
.teacher-case-library > div:last-child { margin-top: 12px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.teacher-case-library button { padding: 11px 12px; text-align: left; background: #f6f7f4; border: 1px solid #d7dfda; border-radius: 3px 9px 3px 3px; cursor: pointer; }
.teacher-case-library button strong,
.teacher-case-library button span { display: block; }
.teacher-case-library button strong { font-size: 11px; line-height: 1.5; }
.teacher-case-library button span { margin-top: 4px; color: var(--ink-soft); font-size: 9px; }

.case-author-required-note b { color: var(--teal-dark); }

.case-author-form {
  display: grid;
  gap: 18px;
}

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

.case-author-steps button {
  min-height: 58px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink-soft);
  text-align: left;
  background: #f5f7f4;
  border: 1px solid #d4ded9;
  border-radius: 3px 12px 3px 3px;
  cursor: pointer;
}

.case-author-steps button span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--teal);
  background: #e4efeb;
  border-radius: 50%;
  font-size: 9px;
  font-weight: 700;
}

.case-author-steps button b { font-size: 11px; }
.case-author-steps button.active { color: white; background: var(--teal); border-color: var(--teal); }
.case-author-steps button.active span { color: var(--teal); background: white; }
.case-author-steps button.done { color: var(--teal-deep); background: #e8f2ee; border-color: #a9c9c0; }

.case-author-form fieldset[hidden],
.case-author-submit[hidden] { display: none; }

.case-author-form fieldset {
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid #cbd8d3;
  border-radius: 4px 18px 4px 4px;
}

.case-author-form legend {
  width: 100%;
  padding: 15px 20px;
  display: flex;
  align-items: center;
  gap: 13px;
  background: #edf3f0;
  border-left: 4px solid var(--teal);
}

.case-author-form legend > span {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--teal);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
}

.case-author-form legend b,
.case-author-form legend small {
  display: block;
}

.case-author-form legend b { font-size: 17px; }
.case-author-form legend small { margin-top: 2px; color: var(--ink-soft); font-size: 10px; }

.case-author-fields {
  padding: 20px;
  display: grid;
  gap: 14px;
}

.case-author-fields.two-columns,
.case-author-fields .two-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.case-author-fields label {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.case-author-fields label.full { grid-column: 1 / -1; }

.case-author-fields label > span {
  font-size: 12px;
  font-weight: 700;
}

.case-author-fields label > span b {
  margin-left: 5px;
  color: var(--coral);
  font-size: 9px;
}

.case-author-fields input,
.case-author-fields textarea {
  width: 100%;
  padding: 12px 14px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #cbd5d1;
  border-radius: 3px 9px 3px 3px;
  line-height: 1.7;
  resize: vertical;
}

.case-author-fields input { min-height: 48px; }
.case-author-fields textarea { min-height: 82px; }
.case-author-fields input::placeholder,
.case-author-fields textarea::placeholder { color: #93a09c; }

.case-author-fields .ai-supplemented {
  background: #f1f8f5;
  border-color: #80b6a8;
  box-shadow: inset 4px 0 #80b6a8;
}

.author-detail-toggle-row {
  margin-top: -5px;
  padding: 0 20px 16px;
  display: flex;
  justify-content: flex-start;
}

.author-detail-toggle-row button {
  min-height: 36px;
  padding: 7px 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--teal-deep);
  background: #f7faf8;
  border: 1px solid #b9cec7;
  border-radius: 3px 9px 3px 3px;
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.author-detail-toggle-row button:hover,
.author-detail-toggle-row button.active { background: #e8f3ef; border-color: #78aa9e; }

.author-detail-toggle-row i {
  font-style: normal;
  font-size: 14px;
  line-height: 1;
  transition: transform 220ms ease;
}

.author-detail-toggle-row button.active i { transform: rotate(180deg); }

.author-detail-drawer {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  background: #f6f8f6;
  border-top: 0 solid transparent;
  transition: grid-template-rows 260ms ease, opacity 180ms ease, border-color 180ms ease;
}

.author-detail-drawer > div { min-height: 0; overflow: hidden; }
.author-detail-drawer .case-author-fields { padding-top: 16px; }

.case-author-form fieldset[data-author-mode="detail"] .author-detail-drawer {
  grid-template-rows: 1fr;
  opacity: 1;
  border-top: 1px dashed #c8d7d1;
}

.author-ai-panel {
  margin: 16px 20px 0;
  padding: 15px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  background: linear-gradient(110deg, #edf8f4, #f7fbf9);
  border: 1px solid #9bc8bc;
  border-radius: 4px 14px 4px 4px;
  box-shadow: 0 7px 20px rgba(19, 103, 89, 0.07);
  transition: background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.author-ai-panel > div { min-width: 0; }
.author-ai-panel b,
.author-ai-panel [data-author-assist-status] { display: block; }
.author-ai-panel b { color: var(--teal-deep); font-size: 13px; }
.author-ai-panel [data-author-assist-status] {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.55;
}

.author-ai-assist {
  min-height: 46px;
  padding: 10px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  flex: 0 0 auto;
  color: white;
  background: var(--teal);
  border: 1px solid var(--teal);
  border-radius: 3px 10px 3px 3px;
  box-shadow: 0 6px 14px rgba(15, 111, 95, 0.16);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.author-ai-assist:hover:not(:disabled),
.author-ai-assist:focus-visible { background: var(--teal-dark); border-color: var(--teal-dark); color: white; }
.author-ai-assist:disabled { cursor: wait; opacity: 0.55; }
.author-ai-assist[aria-busy="true"] { opacity: 1; }
.author-ai-icon { font-size: 17px; line-height: 1; }

.author-ai-panel.is-loading {
  background: #e8f5f1;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 111, 95, 0.1), 0 8px 22px rgba(19, 103, 89, 0.1);
}

.author-ai-assist[aria-busy="true"] .author-ai-icon {
  width: 17px;
  height: 17px;
  font-size: 0;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: author-ai-spin 0.8s linear infinite;
}

.author-ai-panel.is-complete { background: #f1f8f5; border-color: #67a997; }
.author-ai-panel.is-complete [data-author-assist-status] { color: #146653; font-weight: 700; }
.author-ai-panel.has-error { background: #fff4f1; border-color: #d58b7e; }
.author-ai-panel.has-error [data-author-assist-status] { color: #a84233; font-weight: 700; }

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

.author-step-actions {
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: #f7f8f5;
  border-top: 1px solid #dce4df;
}

.author-step-actions > div {
  display: flex;
  align-items: center;
  gap: 12px;
}

.author-step-actions > div:last-child { margin-left: auto; }

.author-step-actions small {
  max-width: 340px;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.5;
}

.author-step-actions .secondary-button,
.author-step-actions .primary-button {
  min-height: 42px;
  margin: 0;
  padding: 9px 15px;
}

.case-author-submit {
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: #fff;
  border: 1px solid #c8d6d1;
  border-top: 3px solid var(--teal);
}

.case-author-submit strong,
.case-author-submit span { display: block; }
.case-author-submit strong { font-size: 13px; }
.case-author-submit div > span { margin-top: 4px; color: var(--ink-soft); font-size: 11px; }
.case-author-submit div > span.error { color: #a84233; }
.case-author-submit .primary-button { flex: 0 0 auto; }

.case-author-submit .primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}

.case-author-submit .primary-button i { display: none; }
.case-author-submit .primary-button b { font-size: 14px; }
.case-author-form.is-generating .case-author-submit .primary-button i {
  width: 16px;
  height: 16px;
  display: block;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: author-ai-spin 0.8s linear infinite;
}
.case-author-form.is-generating .case-author-submit .primary-button b { display: none; }
.case-author-form.is-generating .case-author-steps,
.case-author-form.is-generating fieldset { pointer-events: none; opacity: 0.58; }

.case-generation-progress {
  padding: 24px;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
  gap: 22px;
  color: var(--ink);
  background: linear-gradient(120deg, #e8f5f1, #f7fbf9 65%, #edf5f2);
  border: 1px solid #77ad9f;
  border-left: 5px solid var(--teal);
  border-radius: 4px 18px 4px 4px;
  box-shadow: 0 12px 30px rgba(19, 103, 89, 0.12);
}

.case-generation-progress[hidden] { display: none; }
.case-generation-progress small,
.case-generation-progress strong { display: block; }
.case-generation-progress small { color: var(--teal); font-size: 9px; font-weight: 800; letter-spacing: 0.15em; }
.case-generation-progress strong { margin-top: 5px; font-family: var(--serif); font-size: 21px; }
.case-generation-progress p { margin: 7px 0 0; color: var(--ink-soft); font-size: 11px; line-height: 1.65; }

.case-generation-spinner {
  width: 66px;
  height: 66px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 2px solid rgba(15, 111, 95, 0.18);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: author-ai-spin 1.25s linear infinite;
}

.case-generation-spinner span {
  width: 5px;
  height: 5px;
  background: var(--teal);
  border-radius: 50%;
  animation: evaluating-pulse 0.8s ease-in-out infinite alternate;
}
.case-generation-spinner span:nth-child(2) { animation-delay: 0.14s; }
.case-generation-spinner span:nth-child(3) { animation-delay: 0.28s; }

.case-generation-progress ol {
  margin: 14px 0 0;
  padding: 0;
  display: flex;
  gap: 18px;
  list-style: none;
}
.case-generation-progress li { display: flex; align-items: center; gap: 7px; color: #82918c; font-size: 10px; font-weight: 700; }
.case-generation-progress li i { width: 9px; height: 9px; flex: 0 0 auto; background: #cbd5d1; border-radius: 50%; }
.case-generation-progress li.active { color: var(--teal-deep); }
.case-generation-progress li.active i { background: var(--teal); box-shadow: 0 0 0 5px rgba(15, 111, 95, 0.12); animation: evaluating-pulse 0.8s ease-in-out infinite alternate; }
.case-generation-progress li.done { color: #3f776a; }
.case-generation-progress li.done i { background: #4da178; }

.case-draft-review > header {
  padding: 22px 24px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: flex-start;
  gap: 20px;
  background: #edf3f0;
  border-left: 4px solid var(--teal);
}

.case-preview-back { padding: 8px 10px; color: var(--teal); font: inherit; font-size: 10px; font-weight: 700; background: white; border: 1px solid #b7ccc5; border-radius: 3px 9px 3px 3px; cursor: pointer; }

.case-draft-review > header h2 { margin: 0; font-family: "Shippori Mincho", serif; font-size: 28px; }
.case-draft-review > header p:last-child { margin: 8px 0 0; color: var(--ink-soft); font-size: 12px; }
.case-draft-review > header > span { padding: 7px 11px; color: #976d1d; background: #fff5d9; border-radius: 999px; font-size: 10px; font-weight: 700; }

.generated-patient-card {
  margin-top: 18px;
  padding: 22px 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(3, minmax(130px, 0.55fr));
  gap: 12px;
  align-items: stretch;
  background: white;
  border: 1px solid #b8cbc6;
  border-radius: 4px 20px 4px 4px;
}

.generated-patient-card > div { padding: 12px 14px; background: #f6f8f6; border-radius: 3px 10px 3px 3px; }
.generated-patient-card .generated-identity { background: var(--teal); color: white; }
.generated-patient-card small,
.generated-patient-card strong,
.generated-patient-card span { display: block; }
.generated-patient-card small { color: inherit; opacity: 0.72; font-size: 9px; font-weight: 700; }
.generated-patient-card strong { margin-top: 5px; font-size: 14px; line-height: 1.55; }
.generated-patient-card .generated-identity strong { font-family: "Shippori Mincho", serif; font-size: 23px; }
.generated-patient-card span { margin-top: 6px; font-size: 11px; line-height: 1.6; }

.case-revision-panel {
  margin-top: 18px;
  padding: 18px 20px;
  background: #f7faf8;
  border: 1px solid #abc9c0;
  border-left: 4px solid var(--teal);
  border-radius: 3px 14px 3px 3px;
}

.case-revision-panel > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.case-revision-panel > header small { color: var(--teal); font-size: 9px; font-weight: 800; letter-spacing: 0.14em; }
.case-revision-panel > header h3 { margin: 4px 0 0; font-family: var(--serif); font-size: 20px; }
.case-revision-panel > header > span { padding: 6px 9px; color: var(--teal-deep); background: #e5f1ed; border-radius: 999px; font-size: 9px; font-weight: 700; }
.case-revision-panel > label { margin-top: 15px; display: block; font-size: 11px; font-weight: 700; }
.case-revision-panel > textarea {
  width: 100%;
  min-height: 96px;
  margin-top: 7px;
  padding: 12px 14px;
  color: var(--ink);
  background: white;
  border: 1px solid #bfcfc9;
  border-radius: 3px 10px 3px 3px;
  font: inherit;
  font-size: 12px;
  line-height: 1.7;
  resize: vertical;
}
.case-revision-panel > textarea:focus { outline: 2px solid rgba(15, 111, 95, 0.18); border-color: var(--teal); }

.case-revision-actions {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.case-revision-actions p { margin: 0; color: var(--ink-soft); font-size: 10px; line-height: 1.6; }
.case-revision-actions p.error { color: #a84233; font-weight: 700; }
.case-revision-actions .primary-button { margin: 0; flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; }
.case-revision-actions .primary-button i { display: none; }
.case-revision-panel.is-loading textarea { opacity: 0.58; pointer-events: none; }
.case-revision-panel.is-loading .primary-button i {
  width: 15px;
  height: 15px;
  display: block;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: author-ai-spin 0.8s linear infinite;
}
.case-revision-panel.is-loading .primary-button b { display: none; }

.case-revision-progress {
  margin-top: 14px;
  padding: 13px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #e8f4f0;
  border: 1px solid #8fbaae;
}
.case-revision-progress[hidden] { display: none; }
.case-revision-progress > span {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  border: 2px solid rgba(15, 111, 95, 0.2);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: author-ai-spin 0.85s linear infinite;
}
.case-revision-progress strong,
.case-revision-progress small { display: block; }
.case-revision-progress strong { color: var(--teal-deep); font-size: 12px; }
.case-revision-progress small { margin-top: 3px; color: var(--ink-soft); font-size: 9px; line-height: 1.5; }

.case-draft-tabs {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid #c8d6d1;
  border-bottom: 0;
}

.case-draft-review.fixed-preview .case-draft-tabs { grid-template-columns: repeat(2, 1fr); }

.case-draft-tabs button {
  min-height: 48px;
  background: #f5f6f3;
  border: 0;
  border-right: 1px solid #c8d6d1;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.case-draft-tabs button:last-child { border-right: 0; }
.case-draft-tabs button.active { color: white; background: var(--teal); }

.case-draft-content {
  padding: 22px;
  display: grid;
  gap: 14px;
  background: #fff;
  border: 1px solid #c8d6d1;
}

.draft-section { padding: 17px 18px; background: #f7f8f5; border-left: 3px solid #8eb5ad; }
.draft-section h3 { margin: 0 0 10px; font-size: 15px; }
.draft-section h4 { margin: 14px 0 5px; font-size: 12px; }
.draft-section p,
.draft-section li { margin: 0; color: var(--ink-soft); font-size: 12px; line-height: 1.85; white-space: pre-wrap; }
.draft-section ul,
.draft-section ol { margin: 7px 0 0; padding-left: 22px; }
.draft-dialogue { margin-top: 10px; padding: 10px 12px; background: white; border: 1px solid #dce2de; }
.draft-dialogue b { display: block; color: var(--teal); font-size: 10px; }
.draft-dialogue p + b { margin-top: 8px; }

.student-preview-navigation {
  position: sticky;
  z-index: 3;
  top: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
  padding: 10px;
  background: rgba(247, 248, 245, 0.96);
  border: 1px solid #c8d6d1;
  backdrop-filter: blur(8px);
}

.student-preview-navigation button {
  min-width: 0;
  min-height: 54px;
  padding: 9px 10px;
  color: var(--ink);
  text-align: left;
  background: white;
  border: 1px solid #cedbd6;
  border-radius: 3px 10px 3px 3px;
  cursor: pointer;
}

.student-preview-navigation button b,
.student-preview-navigation button span { display: block; }
.student-preview-navigation button b { color: var(--teal-dark); font-size: 11px; }
.student-preview-navigation button span {
  margin-top: 3px;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.student-preview-navigation button.active {
  color: white;
  background: var(--teal);
  border-color: var(--teal);
  box-shadow: 0 7px 18px rgba(18, 102, 88, 0.15);
}
.student-preview-navigation button.active b,
.student-preview-navigation button.active span { color: white; }

.student-screen-preview {
  overflow: hidden;
  background: #fffefa;
  border: 1px solid #b9cec8;
  border-radius: 4px 18px 4px 4px;
  box-shadow: 0 13px 32px rgba(28, 73, 65, 0.07);
}

.student-preview-header {
  padding: 24px 28px 20px;
  background: linear-gradient(115deg, #f7faf7, #eef5f2);
  border-bottom: 1px solid #c4d5d0;
}
.student-preview-header > span,
.student-preview-scene-header span {
  color: var(--teal);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.13em;
}
.student-preview-header h3,
.student-preview-scene-header h3 {
  margin: 6px 0 0;
  color: var(--teal-dark);
  font-family: "Shippori Mincho", serif;
  font-size: 25px;
  line-height: 1.4;
}
.student-preview-header p { margin: 7px 0 0; color: var(--ink-soft); font-size: 11px; }
.student-briefing-preview > .chart-body {
  height: auto;
  padding: 24px 28px 42px;
  overflow: visible;
  background: #f8f8f4;
}

.student-preview-scene-header {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 17px 22px;
  background: #fffefa;
  border-bottom: 1px solid #c8d6d1;
}
.student-preview-scene-header h3 { font-size: 23px; }
.student-preview-scene-header > b {
  flex: 0 0 auto;
  padding: 7px 11px;
  color: var(--ink-soft);
  background: #f0f2ef;
  border-radius: 99px;
  font-size: 9px;
}
.student-episode-preview > .scene-narration { margin: 0; }
.student-episode-preview > .chat-log {
  height: auto;
  min-height: 320px;
  margin: 14px 18px 0;
  padding: 22px 18px 4px;
  overflow: visible;
  border-radius: 4px 16px 4px 4px;
}
.student-episode-preview .message-content { max-width: min(82%, 720px); }
.student-preview-ending { margin: 18px; border: 1px solid #c7d8d3; }

@media (max-width: 760px) {
  .student-preview-navigation { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .student-preview-navigation button:first-child { grid-column: 1 / -1; }
  .student-preview-header,
  .student-briefing-preview > .chart-body { padding-right: 16px; padding-left: 16px; }
  .student-preview-scene-header { align-items: flex-start; padding: 15px 16px; }
  .student-episode-preview > .chat-log { margin: 10px 10px 0; padding-right: 10px; padding-left: 10px; }
  .student-preview-ending { margin: 12px 10px; }
}

.case-draft-review > footer {
  margin-top: 18px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.case-draft-review > footer .secondary-button { margin: 0; }
.case-draft-review > footer .primary-button:disabled { opacity: 0.45; cursor: not-allowed; }
#caseDraftSaveStatus { min-height: 20px; margin: 8px 0 0; color: var(--teal); text-align: right; font-size: 11px; }

.case-publish-checks {
  margin-top: 14px;
  padding: 14px 16px;
  display: grid;
  gap: 9px;
  background: #fff9e9;
  border: 1px solid #e5d6a9;
}

.case-publish-checks { grid-template-columns: minmax(0, 1fr) minmax(240px, 0.65fr); align-items: center; gap: 22px; }
.publish-check-list { display: grid; gap: 12px; font-size: 14px; line-height: 1.7; }
.publish-check-list label { display: flex; align-items: flex-start; gap: 8px; }
.publish-check-list input { width: 18px; height: 18px; flex-shrink: 0; margin-top: 3px; accent-color: var(--teal); }
.publish-check-action { border-left: 1px solid #e5d6a9; padding-left: 22px; }
.publish-check-action p { margin: 0 0 12px; font-size: 14px; line-height: 1.7; }
.publish-check-action button { width: 100%; }
.publish-check-action button:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
#saveCaseDraftButton { position: fixed; right: 22px; bottom: 20px; z-index: 25; margin: 0; color: white; background: var(--teal-dark); border: 1px solid #07564f; border-radius: 7px; padding: 14px 20px; font-size: 15px; box-shadow: 0 4px 18px #18332f33; }
#saveCaseDraftButton:disabled { opacity: .6; cursor: wait; }
.case-draft-review { padding-bottom: 90px; }
@media (max-width: 700px) {
  .case-publish-checks { grid-template-columns: 1fr; }
  .publish-check-action { border-left: 0; border-top: 1px solid #e5d6a9; padding: 16px 0 0; }
  #saveCaseDraftButton { right: 12px; bottom: 12px; }
}

.case-publish-checks.review-blocked::before {
  content: "臨床整合性レビューの重大な問題を修正して再生成するまで公開できません。";
  display: block;
  grid-column: 1 / -1;
  color: #9b3429;
  font-weight: 700;
}

.clinical-review {
  border-left: 5px solid #c6973d;
}

.clinical-review.pass { border-left-color: var(--green); }
.clinical-review.blocked { border-left-color: #c65443; }

.clinical-review-area {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.74);
}

.clinical-review-area.warning { border-left: 4px solid #c6973d; }
.clinical-review-area.critical { border-left: 4px solid #c65443; }
.clinical-review-area.pass { border-left: 4px solid var(--green); }

.clinical-review-finding {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.clinical-review-finding p { margin: 5px 0 0; }

.case-publish-checks label {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: #6a5b37;
  font-size: 11px;
  line-height: 1.6;
}

.case-publish-checks input { margin-top: 3px; accent-color: var(--teal); }
.generated-case-card .patient-card-portrait { display: grid; place-items: center; color: white; background: var(--teal); font-family: "Shippori Mincho", serif; font-size: 30px; font-weight: 700; }
.episode-grid {
  margin-top: 40px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.episode-card {
  min-height: 220px;
  position: relative;
  padding: 21px 18px 18px;
  text-align: left;
  color: var(--ink);
  background: #fbfaf6;
  border: 1px solid var(--line);
  border-radius: 4px 22px 4px 4px;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.episode-card:hover {
  transform: translateY(-3px);
  border-color: #94b7af;
  box-shadow: 0 14px 30px rgba(39, 69, 63, 0.08);
}

.episode-card.selected {
  background: #f4faf7;
  border: 2px solid var(--teal);
  padding: 20px 17px 17px;
  box-shadow: 0 12px 30px rgba(12, 112, 103, 0.12);
}

.episode-number {
  display: block;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.episode-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  margin: 13px 0 14px;
  font-family: "Shippori Mincho", serif;
  font-size: 14px;
  font-weight: 700;
  border-radius: 50% 50% 50% 4px;
}

.episode-icon.morning { color: #ad643b; background: #f6e2d0; }
.episode-icon.dawn { color: #66559c; background: #e6e0f1; }
.episode-icon.water { color: #377b98; background: #dcecf1; }
.episode-icon.evening { color: #55784e; background: #e0ecdc; }

.episode-card strong,
.episode-card small {
  display: block;
}

.episode-card strong {
  margin-bottom: 4px;
  font-family: "Shippori Mincho", serif;
  font-size: 16px;
}

.episode-card small {
  color: var(--teal);
  font-size: 10px;
  font-weight: 600;
}

.episode-card p {
  margin: 12px 0 0;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.7;
}

.select-mark {
  width: 21px;
  height: 21px;
  display: none;
  place-items: center;
  position: absolute;
  right: 13px;
  top: 13px;
  color: white;
  background: var(--teal);
  border-radius: 50%;
  font-size: 11px;
}

.episode-card.selected .select-mark {
  display: grid;
}

.primary-button,
.secondary-button {
  border: 0;
  cursor: pointer;
  font-weight: 600;
  transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
}

.primary-button {
  min-width: 230px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 16px 22px;
  color: white;
  background: var(--teal);
  border-radius: 3px 14px 3px 3px;
  box-shadow: 0 10px 24px rgba(12, 112, 103, 0.2);
  font-size: 12px;
}

.primary-button:hover {
  transform: translateY(-2px);
  background: var(--teal-dark);
  box-shadow: 0 13px 28px rgba(12, 112, 103, 0.25);
}

.primary-button span {
  font-size: 18px;
  line-height: 1;
}

.briefing-view {
  max-width: 1320px;
  margin: 0 auto;
  padding: 46px 54px 70px;
}

.briefing-header {
  display: grid;
  grid-template-columns: 40px 1fr;
  align-items: start;
  gap: 16px;
}

.briefing-header h1 {
  margin: 0;
  font-family: "Shippori Mincho", serif;
  font-size: clamp(30px, 3vw, 43px);
  line-height: 1.42;
}

.briefing-header h1 em {
  color: var(--teal);
  font-style: normal;
}

.briefing-header > div > p:last-child {
  margin: 9px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.7;
}

.briefing-chart {
  margin-top: 24px;
  padding: 30px 34px;
  background: #f7f8f4;
  border: 1px solid #cdd9d4;
  border-radius: 4px 18px 4px 4px;
  box-shadow: 0 16px 40px rgba(28, 57, 51, 0.08);
}

.briefing-chart .briefing-chart-body {
  height: auto;
  padding: 0;
  overflow: visible;
}

.case-journey {
  margin-top: 20px;
  padding: 22px;
  border: 1px solid rgba(18, 107, 96, 0.22);
  border-radius: 18px;
  background: rgba(247, 251, 249, 0.82);
}

.case-journey-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.75fr);
  gap: 24px;
  align-items: end;
}

.case-journey-heading span {
  color: var(--teal, #11766d);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.case-journey-heading h2 {
  margin: 5px 0 0;
  color: #183b37;
  font-size: 18px;
}

.case-journey-heading p {
  margin: 0;
  color: #617572;
  font-size: 12px;
  line-height: 1.8;
}

.case-journey ol {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.case-journey li {
  display: flex;
  min-width: 0;
  min-height: 92px;
  padding: 14px;
  flex-direction: column;
  border: 1px solid rgba(22, 69, 63, 0.14);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.72);
}

.case-journey li.current {
  border-color: #187b70;
  box-shadow: inset 0 0 0 1px #187b70;
  background: #f1f8f6;
}

.case-journey li small,
.case-journey li strong,
.case-journey li span {
  display: block;
}

.case-journey li small {
  color: #24786e;
  font-size: 10px;
  font-weight: 700;
}

.case-journey li strong {
  margin-top: 8px;
  color: #193a36;
  font-size: 14px;
}

.case-journey li span {
  margin-top: auto;
  color: #6d7d7a;
  font-size: 10px;
}

.briefing-actions .primary-button small {
  margin-left: 8px;
  opacity: 0.72;
  font-size: 10px;
}

.briefing-hero {
  margin-top: 24px;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  overflow: hidden;
  background: #eef6f3;
  border: 1px solid #b8d0ca;
  border-radius: 4px 20px 4px 4px;
}

.briefing-person {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 18px 22px;
}

.briefing-avatar {
  width: 72px;
  height: 72px;
  flex: 0 0 auto;
  display: grid;
  place-items: end center;
  overflow: hidden;
  background: #d8e6e1;
  border-radius: 50% 50% 50% 7px;
}

.briefing-avatar svg {
  width: 73px;
}

.briefing-person > span:last-child,
.briefing-person small,
.briefing-person strong,
.briefing-person b {
  display: block;
}

.briefing-person small {
  color: var(--teal);
  font-size: 8px;
  font-weight: 700;
}

.briefing-person strong {
  margin: 2px 0;
  font-family: "Shippori Mincho", serif;
  font-size: 23px;
}

.briefing-person b {
  font-size: 10px;
}

.briefing-purpose {
  padding: 20px 22px;
  color: white;
  background: var(--teal);
}

.briefing-purpose small,
.briefing-purpose strong {
  display: block;
}

.briefing-purpose small {
  color: #bde0d9;
  font-size: 8px;
  font-weight: 700;
}

.briefing-purpose strong {
  margin-top: 5px;
  font-size: 12px;
}

.briefing-purpose p {
  margin: 5px 0 0;
  color: #d6ece7;
  font-size: 8px;
  line-height: 1.6;
}

.briefing-grid {
  margin-top: 13px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.briefing-card {
  min-height: 190px;
  position: relative;
  padding: 17px;
  overflow: hidden;
  background: white;
  border: 1px solid var(--line);
  border-radius: 3px 13px 3px 3px;
}

.briefing-card-number {
  position: absolute;
  right: 13px;
  top: 10px;
  color: #d6dfdc;
  font-family: "Shippori Mincho", serif;
  font-size: 22px;
  font-weight: 700;
}

.briefing-card h2 {
  margin: 0 0 11px;
  padding-right: 30px;
  color: var(--teal-dark);
  font-family: "Shippori Mincho", serif;
  font-size: 13px;
}

.briefing-card p {
  margin: 7px 0 0;
  color: var(--ink-soft);
  font-size: 8px;
  line-height: 1.75;
}

.briefing-card dl {
  margin: 0;
}

.briefing-card dl div {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 6px;
  margin-top: 5px;
}

.briefing-card dt {
  color: var(--ink-soft);
  font-size: 7px;
  font-weight: 700;
}

.briefing-card dd {
  margin: 0;
  font-size: 8px;
  line-height: 1.55;
}

.briefing-alert {
  display: inline-block;
  margin-top: 10px;
  padding: 5px 8px;
  color: #a75e48;
  background: var(--coral-pale);
  border-radius: 99px;
  font-size: 7px;
  font-weight: 700;
}

.briefing-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.briefing-tags span {
  padding: 5px 7px;
  color: var(--teal-dark);
  background: var(--teal-pale);
  border-radius: 99px;
  font-size: 7px;
  font-weight: 600;
}

.brief-vitals,
.brief-labs {
  display: grid;
  gap: 5px;
}

.brief-vitals {
  grid-template-columns: repeat(3, 1fr);
}

.brief-labs {
  grid-template-columns: repeat(2, 1fr);
}

.brief-vitals span,
.brief-labs span {
  padding: 7px 5px;
  text-align: center;
  background: #f3f5f2;
  border-radius: 3px;
}

.brief-vitals small,
.brief-vitals b,
.brief-labs small,
.brief-labs b {
  display: block;
}

.brief-vitals small,
.brief-labs small {
  color: var(--ink-soft);
  font-size: 6px;
}

.brief-vitals b,
.brief-labs b {
  margin-top: 2px;
  font-size: 8px;
}

.briefing-card ul {
  margin: 0;
  padding-left: 17px;
  color: var(--ink-soft);
  font-size: 9px;
  line-height: 2;
}

.briefing-actions {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.briefing-actions .secondary-button {
  margin-right: auto;
}

.briefing-actions .primary-button {
  min-width: 190px;
  padding: 13px 18px;
}

.dialogue-view {
  position: relative;
  isolation: isolate;
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 30px 48px;
}

.dialogue-view.intro-open::before,
.dialogue-view.chart-open::before {
  content: "";
  position: absolute;
  z-index: 4;
  inset: 0;
  background: rgba(238, 245, 242, 0.78);
  backdrop-filter: blur(2px);
}

.scene-header {
  display: grid;
  grid-template-columns: 42px minmax(210px, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.scene-header-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.scene-info-button {
  width: auto;
  min-height: 48px;
  margin: 0;
  padding: 7px 10px;
  display: grid;
  grid-template-columns: 32px minmax(145px, auto) auto;
  align-items: center;
  gap: 9px;
  text-align: left;
  color: var(--teal-dark);
  background: linear-gradient(105deg, #edf6f3, #f8faf7);
  border: 1px solid #abc9c1;
  border-left: 3px solid var(--teal);
  border-radius: 3px 12px 3px 3px;
  box-shadow: 0 5px 15px rgba(26, 76, 68, 0.06);
  font-weight: 700;
  cursor: pointer;
}

.scene-info-button:hover,
.scene-info-button:focus-visible,
.scene-info-button[aria-expanded="true"] {
  background: #e4f1ed;
  border-color: #6da298;
  outline: 3px solid rgba(24, 123, 112, 0.11);
}

.scene-info-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--teal);
  border-radius: 50% 50% 50% 8px;
  font-size: 14px;
}

.scene-info-copy small,
.scene-info-copy strong {
  display: block;
}

.scene-info-copy small {
  color: #6c827d;
  font-size: 8px;
  letter-spacing: 0.08em;
}

.scene-info-copy strong {
  margin-top: 2px;
  color: #174b43;
  font-size: 12px;
}

.scene-info-patient {
  display: none;
}

.scene-info-arrow {
  color: var(--teal);
  font-size: 10px;
  white-space: nowrap;
}

.back-button {
  width: 37px;
  height: 37px;
  padding: 0;
  background: #f3f4f0;
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
}

.scene-header .eyebrow {
  margin-bottom: 3px;
}

.scene-header h1 {
  font-size: 25px;
}

.turn-counter {
  padding: 7px 11px;
  color: var(--ink-soft);
  background: #f0f2ef;
  border-radius: 99px;
  font-size: 9px;
  font-weight: 700;
}

.scene-narration {
  position: relative;
  padding: 14px 20px;
  background: #eef4f1;
  border-left: 3px solid #80aaa3;
}

.scene-intro-dialog {
  width: min(640px, calc(100% - 64px));
  max-height: min(58vh, 540px);
  position: absolute;
  z-index: 5;
  top: 112px;
  right: 32px;
  left: 32px;
  margin: 0 auto;
  color: var(--ink);
  background: transparent;
  border: 0;
}

.scene-intro-card {
  position: relative;
  max-height: min(58vh, 540px);
  padding: 27px 30px 23px;
  overflow-y: auto;
  background: #fffefa;
  border: 1px solid #aec8c2;
  border-radius: 4px 18px 4px 4px;
  box-shadow: 0 18px 45px rgba(18, 62, 54, 0.2);
}

.scene-intro-card::before {
  content: "";
  width: 28%;
  height: 4px;
  position: absolute;
  top: 0;
  left: 0;
  background: var(--teal);
}

.scene-intro-close {
  width: 35px;
  height: 35px;
  position: absolute;
  top: 13px;
  right: 13px;
  display: grid;
  place-items: center;
  color: #325c56;
  background: #e7f0ed;
  border: 1px solid #bdd0cb;
  border-radius: 50%;
  font: 300 22px/1 sans-serif;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease;
}

.scene-intro-close:hover,
.scene-intro-close:focus-visible {
  background: #d7e9e4;
  outline: 3px solid rgba(24, 123, 112, 0.18);
  transform: rotate(5deg);
}

.scene-intro-heading {
  padding-right: 42px;
}

.scene-intro-heading .eyebrow {
  margin: 13px 0 3px;
  color: #55706b;
}

.scene-intro-heading h2 {
  margin: 0;
  color: #173d37;
  font-family: "Shippori Mincho", serif;
  font-size: clamp(24px, 3vw, 31px);
  line-height: 1.35;
}

.scene-intro-copy {
  display: grid;
  grid-template-columns: 3px minmax(0, 1fr);
  gap: 15px;
  margin-top: 17px;
}

.scene-intro-line {
  min-height: 100%;
  background: linear-gradient(var(--teal), rgba(24, 123, 112, 0.12));
  border-radius: 2px;
}

.scene-intro-copy p {
  margin: 0;
  color: #3f5551;
  font-size: 13px;
  line-height: 1.9;
}

.scene-intro-guide {
  margin: 18px 0 0;
  color: #7a8986;
  font-size: 10px;
  text-align: right;
}

.episode-chart-panel {
  width: min(760px, calc(100% - 40px));
  max-height: min(74vh, 720px);
  position: absolute;
  z-index: 5;
  top: 88px;
  right: 20px;
  left: 20px;
  margin: 0 auto;
  overflow-y: auto;
  background: #f8f8f4;
  border: 1px solid #aac4be;
  border-radius: 4px 18px 4px 4px;
  box-shadow: 0 18px 46px rgba(18, 62, 54, 0.22);
}

.episode-chart-panel > header {
  min-height: 82px;
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 22px;
  color: white;
  background: var(--teal-dark);
}

.episode-chart-panel > header span {
  color: #abd0c9;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.episode-chart-panel > header h2 {
  margin: 3px 0 0;
  font-family: "Shippori Mincho", serif;
  font-size: 20px;
}

.episode-chart-panel > header p {
  margin: 3px 0 0;
  color: #d3e3df;
  font-size: 9px;
}

.episode-chart-panel > header button {
  width: 35px;
  height: 35px;
  flex: 0 0 auto;
  padding: 0;
  color: white;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 50%;
  font-size: 21px;
  cursor: pointer;
}

.episode-chart-content {
  padding: 20px 22px 34px;
}

.episode-chart-content .chart-body {
  height: auto;
  padding: 0;
  overflow: visible;
}

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

.episode-chart-content .vital-grid,
.episode-chart-content .lab-table {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.narrator-label {
  display: block;
  margin-bottom: 7px;
  color: var(--teal);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.15em;
}

.scene-narration p {
  margin: 0;
  font-family: "Shippori Mincho", serif;
  font-size: 12px;
  line-height: 1.75;
}

.chat-log {
  height: clamp(330px, 38vh, 430px);
  min-height: 0;
  max-height: none;
  margin-top: 14px;
  padding: 22px 16px 10px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-color: #bccbc7 transparent;
  background: linear-gradient(180deg, #ffffff, #fbfcfa);
  border: 1px solid #b8cec8;
  border-radius: 4px 16px 0 0;
  box-shadow: inset 0 -10px 20px rgba(30, 75, 67, 0.025);
}

.chat-log:has(+ .dialogue-prompt[hidden]) {
  border-radius: 4px 16px 4px 4px;
}

.message {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 20px;
  animation: message-in 0.35s ease both;
}

@keyframes message-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.message.student {
  flex-direction: row-reverse;
}

.message-avatar {
  width: 35px;
  height: 35px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: white;
  background: #457b74;
  border-radius: 50% 50% 50% 4px;
  font-family: "Shippori Mincho", serif;
  font-size: 11px;
  font-weight: 700;
}

.student .message-avatar {
  color: var(--teal-dark);
  background: var(--teal-pale);
  border-radius: 50% 50% 4px 50%;
}

.message-content {
  max-width: min(82%, 720px);
}

.message-name {
  display: block;
  margin: 0 4px 5px;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 600;
}

.student .message-name {
  text-align: right;
}

.message-bubble {
  margin: 0;
  padding: 13px 16px;
  background: #f2f2ed;
  border-radius: 3px 15px 15px 15px;
  font-size: 13px;
  line-height: 1.8;
  white-space: pre-wrap;
}

.student .message-bubble {
  color: white;
  background: var(--teal);
  border-radius: 15px 3px 15px 15px;
}

.typing-dots {
  display: flex;
  gap: 4px;
  padding: 16px 19px;
}

.typing-dots i {
  width: 5px;
  height: 5px;
  background: #8ca09b;
  border-radius: 50%;
  animation: typing 1s infinite alternate;
}

.typing-dots i:nth-child(2) { animation-delay: 0.15s; }
.typing-dots i:nth-child(3) { animation-delay: 0.3s; }

@keyframes typing {
  to { transform: translateY(-4px); opacity: 0.5; }
}

.dialogue-prompt {
  min-height: 91px;
  margin-top: -1px;
  padding: 15px;
  background: #f8faf7;
  border: 1px solid #b8cec8;
  border-top: 3px solid var(--teal);
  border-radius: 0 0 4px 12px;
  box-shadow: 0 9px 24px rgba(24, 51, 47, 0.08);
}

.dialogue-prompt > p {
  margin: 0 0 10px;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 700;
}

.prompt-list {
  display: grid;
  gap: 8px;
}

.dialogue-action {
  width: 100%;
  display: grid;
  grid-template-columns: 23px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  text-align: left;
  color: var(--ink);
  background: white;
  border: 1px solid #d6dfdb;
  border-radius: 3px 10px 3px 3px;
  font-size: 12px;
  line-height: 1.65;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}

.dialogue-action:hover {
  transform: translateX(3px);
  background: #f1f8f5;
  border-color: var(--teal);
}

.dialogue-action:disabled {
  opacity: 0.52;
  cursor: wait;
}

.dialogue-action .prompt-icon {
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  color: var(--teal);
  background: var(--teal-pale);
  border-radius: 50%;
  font-size: 9px;
  font-weight: 700;
}

.dialogue-action .prompt-arrow {
  color: var(--teal);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.composer-note {
  margin: 7px 0 0;
  text-align: center;
  color: #879690;
  font-size: 8px;
}

.initial-assessment-view,
.assessment-feedback-view,
.progress-record-view,
.progress-feedback-view {
  max-width: 960px;
  margin: 0 auto;
  padding: 48px 48px 70px;
}

.progress-feedback-heading {
  margin-bottom: 20px;
}

.progress-feedback-heading h1 {
  margin: 7px 0 9px;
  font-size: 32px;
}

.progress-feedback-heading > p:last-child {
  margin: 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.8;
}

.progress-feedback-checkpoints {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 14px;
  border: 1px solid var(--line);
  background: white;
}

.progress-feedback-checkpoints span {
  padding: 12px;
  color: var(--teal-dark);
  border-right: 1px solid var(--line);
  text-align: center;
  font-size: 11px;
  font-weight: 700;
}

.progress-feedback-checkpoints span:last-child { border-right: 0; }
.progress-feedback-checkpoints small { color: var(--ink-soft); font-size: 8px; font-weight: 500; }

.progress-feedback-card {
  margin-bottom: 14px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  background: white;
  box-shadow: 0 8px 22px rgba(26, 76, 68, 0.05);
}

.progress-feedback-card > small,
.progress-feedback-card > div small {
  display: block;
  margin-bottom: 8px;
  color: var(--teal);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.progress-feedback-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.9;
}

.progress-feedback-card.next-step {
  border-left: 4px solid var(--coral);
  background: #fffaf6;
}

.progress-feedback-card.next-step > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.progress-feedback-card.next-step strong {
  display: grid;
  min-width: 38px;
  min-height: 28px;
  place-items: center;
  color: white;
  background: var(--coral);
  border-radius: 999px;
  font-size: 11px;
}

.progress-feedback-continue {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 20px;
}

.progress-feedback-continue p { margin: 0; color: var(--ink-soft); font-size: 9px; }

.assessment-relationship-guide {
  margin: 0 0 20px;
  padding: 16px 20px;
  border-left: 3px solid var(--teal);
  border-radius: 0 8px 8px 0;
  background: #edf8f4;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.8;
}

.assessment-relationship-guide strong { color: var(--teal-deep); }
.assessment-relationship-guide p { margin: 4px 0 0; }

.progress-record-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 20px;
}

.progress-record-heading h1 {
  margin: 7px 0 9px;
  font-size: 32px;
}

.progress-record-heading > div > p:last-child {
  margin: 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.8;
}

.previous-plan-card {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  margin-bottom: 14px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #b9cec8;
  border-left: 4px solid var(--teal);
  border-radius: 3px 14px 3px 3px;
  box-shadow: 0 7px 20px rgba(26, 76, 68, 0.06);
}

.previous-plan-card > div:first-child {
  padding: 16px 18px;
  background: #edf5f2;
}

.previous-plan-card span,
.previous-plan-card strong {
  display: block;
}

.previous-plan-card span {
  color: var(--teal);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.previous-plan-card strong {
  margin-top: 4px;
  font-size: 11px;
}

.previous-plan-content {
  min-width: 0;
  padding: 15px 18px;
}

.previous-plan-card p {
  margin: 0;
  color: #3e5550;
  font-size: 11px;
  line-height: 1.75;
  white-space: pre-wrap;
}

.previous-assessment-details {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid #d8e4e0;
}

.previous-assessment-details summary {
  width: fit-content;
  color: var(--teal);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.previous-assessment-details[open] summary {
  margin-bottom: 10px;
}

.previous-assessment-details > p {
  max-height: 320px;
  overflow: auto;
  padding: 12px 14px;
  background: #f6faf8;
  border: 1px solid #d8e4e0;
  border-radius: 8px;
  font-size: 10px;
}

.assessment-heading {
  margin-bottom: 24px;
}

.assessment-heading h1,
.assessment-result-heading h1 {
  margin: 7px 0 9px;
  font-size: 32px;
}

.assessment-heading > p:last-child {
  margin: 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.8;
}

.initial-assessment-form {
  background: transparent;
}

.pattern-assessment-nav {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(11, minmax(104px, 1fr));
  margin-bottom: 14px;
  overflow-x: auto;
  background: #fafaf6;
  border: 1px solid var(--line);
  box-shadow: 0 8px 20px rgba(26, 76, 68, 0.06);
}

.pattern-assessment-nav-button {
  min-width: 104px;
  padding: 10px 5px 9px;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  border-right: 1px solid var(--line);
  cursor: pointer;
  text-align: center;
}

.pattern-assessment-nav-button:last-child { border-right: 0; }
.pattern-assessment-nav-button span,
.pattern-assessment-nav-button strong,
.pattern-assessment-nav-button small { display: block; }
.pattern-assessment-nav-button span { color: var(--teal); font-size: 8px; font-weight: 700; letter-spacing: 0.08em; }
.pattern-assessment-nav-button strong { min-height: 28px; display: grid; margin: 3px 0; place-items: center; font-size: 9px; line-height: 1.45; }
.pattern-assessment-nav-button small { color: #879690; font-size: 7px; }
.pattern-assessment-nav-button.is-active { color: white; background: var(--teal); }
.pattern-assessment-nav-button.is-active span,
.pattern-assessment-nav-button.is-active small { color: rgba(255,255,255,0.78); }
.pattern-assessment-nav-button.is-complete:not(.is-active) { background: #edf7f2; }
.pattern-assessment-nav-button.is-complete:not(.is-active) small { color: var(--teal); font-weight: 700; }

.pattern-assessment-panel {
  overflow: hidden;
  background: white;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.pattern-assessment-header {
  display: grid;
  grid-template-columns: minmax(240px, 0.75fr) minmax(0, 1.25fr);
  align-items: center;
  gap: 24px;
  padding: 22px 24px;
  background: linear-gradient(100deg, #e8f3ef, #fafbf8);
  border-bottom: 1px solid var(--line);
}

.pattern-assessment-header span { color: var(--teal); font-size: 8px; font-weight: 700; letter-spacing: 0.14em; }
.pattern-assessment-header h2 { margin: 5px 0 0; font-size: 20px; }
.pattern-assessment-header p { margin: 0; color: var(--ink-soft); font-size: 10px; line-height: 1.75; }

.assessment-method-guide {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  background: var(--line);
  border-bottom: 1px solid var(--line);
}

.assessment-method-guide > div { padding: 14px 18px; background: #fffdf8; }
.assessment-method-guide b { color: var(--teal-dark); font-size: 10px; }
.assessment-method-guide p { margin: 5px 0 0; color: var(--ink-soft); font-size: 9px; line-height: 1.7; }

.assessment-view-list { padding: 16px; background: #f6f8f5; }
.assessment-view-card { margin-bottom: 12px; overflow: hidden; background: white; border: 1px solid #d8e2de; border-radius: 3px 12px 3px 3px; }
.assessment-view-card:last-child { margin-bottom: 0; }
.assessment-view-card > header { display: flex; align-items: center; gap: 10px; padding: 12px 15px; background: #eef5f2; border-bottom: 1px solid #d8e2de; }
.assessment-view-card > header span { display: grid; width: 25px; height: 25px; place-items: center; color: white; background: var(--teal); border-radius: 50%; font-size: 8px; font-weight: 700; }
.assessment-view-card h3 { margin: 0; font-size: 12px; }
.assessment-view-fields { display: grid; grid-template-columns: 1fr; }
.assessment-view-fields label { min-width: 0; }
.assessment-view-fields label + label { border-left: 1px solid var(--line); }
.assessment-view-fields label > span { display: flex; align-items: baseline; gap: 8px; padding: 11px 14px 0; }
.assessment-view-fields label b { color: var(--teal-dark); font-size: 10px; }
.assessment-view-fields label small { color: var(--ink-soft); font-size: 8px; }
.initial-assessment-form .assessment-view-fields textarea { width: 100%; min-height: 132px; padding: 10px 14px 14px; resize: vertical; color: var(--ink); background: white; border: 0; font-size: 10px; line-height: 1.75; }
.assessment-view-fields label:focus-within { box-shadow: inset 0 0 0 2px rgba(12, 112, 103, 0.25); }

.pattern-judgment { margin: 0; padding: 20px 20px 22px; background: #fffdf8; border: 0; border-top: 3px solid var(--teal); }
.pattern-judgment legend { float: left; width: 100%; margin-bottom: 4px; font: 700 16px/1.5 "Shippori Mincho", serif; }
.pattern-judgment > p { clear: both; margin: 0 0 13px; color: var(--ink-soft); font-size: 9px; }
.pattern-judgment-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.pattern-judgment-options label { position: relative; cursor: pointer; }
.pattern-judgment-options input { position: absolute; opacity: 0; pointer-events: none; }
.pattern-judgment-options span { display: block; height: 100%; padding: 13px 14px; background: white; border: 1px solid #cad8d3; border-radius: 3px 10px 3px 3px; }
.pattern-judgment-options b,
.pattern-judgment-options small { display: block; }
.pattern-judgment-options b { font-size: 10px; }
.pattern-judgment-options small { margin-top: 5px; color: var(--ink-soft); font-size: 8px; line-height: 1.55; }
.pattern-judgment-options input:checked + span { background: #e7f3ef; border-color: var(--teal); box-shadow: inset 0 0 0 1px var(--teal); }
.pattern-judgment-options input:focus-visible + span { outline: 2px solid var(--teal); outline-offset: 2px; }

.initial-assessment-form > label {
  min-height: 128px;
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  border-bottom: 1px solid var(--line);
}

.initial-assessment-form > label > span {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-content: center;
  column-gap: 10px;
  padding: 20px;
  background: #f3f5f1;
}

.initial-assessment-form > label > span > b {
  width: 30px;
  height: 30px;
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  color: white;
  background: var(--teal);
  border-radius: 50%;
  font-size: 11px;
}

.initial-assessment-form > label > span > strong {
  font-size: 12px;
}

.initial-assessment-form > label > span > small {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 9px;
  line-height: 1.6;
}

.initial-assessment-form textarea {
  width: 100%;
  min-height: 128px;
  padding: 20px;
  resize: vertical;
  color: var(--ink);
  background: white;
  border: 0;
  font-size: 12px;
  line-height: 1.8;
}

.initial-assessment-form > label:focus-within {
  box-shadow: inset 0 0 0 2px rgba(12, 112, 103, 0.3);
}

.assessment-submit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 20px;
  background: #eff2ef;
}

.assessment-submit-row > span {
  color: var(--ink-soft);
  font-size: 9px;
}

.assessment-submit-row > span.error {
  color: #a44136;
  font-weight: 700;
}

.assessment-submit-row .primary-button {
  min-width: 240px;
}

.assessment-result-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.assessment-total {
  min-width: 132px;
  padding: 15px 18px;
  text-align: center;
  background: white;
  border: 1px solid #b9cec8;
  border-radius: 3px 15px 3px 3px;
}

.assessment-total strong {
  color: var(--teal);
  font: 700 34px/1 "Shippori Mincho", serif;
}

.assessment-total span {
  margin-left: 4px;
  color: var(--ink-soft);
  font-size: 11px;
}

.assessment-total small {
  display: block;
  margin-top: 6px;
  color: var(--ink-soft);
  font-size: 8px;
}

.assessment-summary-card,
.assessment-bottleneck-card,
.assessment-score-section {
  margin-bottom: 18px;
  padding: 22px;
  background: white;
  border: 1px solid var(--line);
}

.assessment-summary-card > p,
.assessment-bottleneck-card > p {
  margin: 0;
  font-size: 13px;
  line-height: 1.9;
}

.assessment-summary-card > div,
.assessment-bottleneck-card > div {
  margin-top: 15px;
  padding: 13px 15px;
  background: #eef6f3;
  border-left: 3px solid var(--teal);
}

.assessment-summary-card small,
.assessment-bottleneck-card small {
  color: var(--teal);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.assessment-summary-card div p,
.assessment-bottleneck-card div p {
  margin: 5px 0 0;
  font-size: 11px;
  line-height: 1.8;
}

.assessment-score-section h2,
.assessment-bottleneck-card h2 {
  margin: 0 0 14px;
  font-size: 18px;
}

.assessment-bottleneck-card > small + h2 {
  margin-top: 5px;
}

.assessment-score-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.assessment-score-list article {
  padding: 15px;
  background: #f7f8f5;
  border: 1px solid #dce3df;
}

.assessment-score-list header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.assessment-score-list header strong {
  font-size: 11px;
}

.assessment-score-list header span {
  color: var(--ink-soft);
  font-size: 9px;
}

.assessment-score-list header b {
  color: var(--teal);
  font-size: 18px;
}

.assessment-score-list p {
  margin: 10px 0 8px;
  font-size: 10px;
  line-height: 1.75;
}

.assessment-score-list small {
  color: var(--ink-soft);
  font-size: 8px;
  line-height: 1.65;
}

.assessment-continue-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.assessment-continue-row p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 9px;
}

.assessment-continue-row .primary-button {
  min-width: 210px;
}

.soap-view {
  position: relative;
  isolation: isolate;
  max-width: 930px;
  margin: 0 auto;
  padding: 48px 48px 70px;
}

/* Keep the chart and student writing screens aligned at the same width. */
.briefing-view,
.initial-assessment-view,
.progress-record-view,
.soap-view {
  max-width: 1320px;
  padding-inline: 54px;
}

.feedback-view.review-open::before {
  content: "";
  position: absolute;
  z-index: 4;
  inset: 0;
  background: rgba(238, 245, 242, 0.8);
  backdrop-filter: blur(2px);
}

.record-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 28px;
}

.record-header h1 {
  font-size: 32px;
}

.record-header > div > p:last-child {
  margin: 9px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
}

.record-stamp {
  width: 66px;
  height: 66px;
  flex: 0 0 auto;
  display: grid;
  place-content: center;
  text-align: center;
  color: var(--coral);
  border: 2px solid var(--coral);
  border-radius: 50%;
  transform: rotate(7deg);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.1;
  opacity: 0.8;
}

.record-stamp b {
  font-size: 20px;
}

.review-trigger {
  width: 100%;
  min-height: 74px;
  margin: -7px 0 22px;
  padding: 13px 16px;
  display: grid;
  grid-template-columns: 42px minmax(230px, 1fr) auto auto;
  align-items: center;
  gap: 13px;
  text-align: left;
  color: var(--teal-dark);
  background: linear-gradient(105deg, #edf6f3, #fbfcf9);
  border: 1px solid #abc9c1;
  border-left: 4px solid var(--teal);
  border-radius: 3px 14px 3px 3px;
  box-shadow: 0 6px 18px rgba(26, 76, 68, 0.07);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.review-trigger:hover,
.review-trigger:focus-visible,
.review-trigger[aria-expanded="true"] {
  background: #e4f1ed;
  border-color: #6da298;
  transform: translateY(-1px);
}

.review-trigger-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--teal);
  border-radius: 50% 50% 50% 8px;
  font-family: "Shippori Mincho", serif;
  font-size: 15px;
  font-weight: 700;
}

.review-trigger-copy small,
.review-trigger-copy strong {
  display: block;
}

.review-trigger-copy small {
  color: #6c827d;
  font-size: 8px;
  letter-spacing: 0.04em;
}

.review-trigger-copy strong {
  margin-top: 4px;
  color: #174b43;
  font-size: 14px;
}

.review-trigger-meta,
.review-trigger-arrow {
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.review-trigger-meta {
  color: #607772;
  padding: 6px 9px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 99px;
}

.review-trigger-arrow {
  color: var(--teal);
}

.feedback-review-trigger {
  margin: 18px 0 24px;
}

.review-panel {
  width: min(820px, calc(100% - 36px));
  max-height: min(80vh, 820px);
  position: absolute;
  z-index: 5;
  top: 76px;
  right: 18px;
  left: 18px;
  margin: 0 auto;
  overflow-y: auto;
  background: #f8f8f4;
  border: 1px solid #aac4be;
  border-radius: 4px 20px 4px 4px;
  box-shadow: 0 22px 55px rgba(18, 62, 54, 0.24);
  scrollbar-color: #9eb8b2 transparent;
  scroll-padding-top: 142px;
}

.review-panel > header {
  min-height: 90px;
  position: sticky;
  z-index: 3;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 22px;
  color: white;
  background: var(--teal-dark);
}

.review-panel > header span {
  color: #abd0c9;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.review-panel > header h2 {
  margin: 3px 0 0;
  font-family: "Shippori Mincho", serif;
  font-size: 22px;
}

.review-panel > header p {
  margin: 3px 0 0;
  color: #d3e3df;
  font-size: 9px;
}

.review-panel > header button {
  width: 37px;
  height: 37px;
  flex: 0 0 auto;
  padding: 0;
  color: white;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 50%;
  font-size: 22px;
  cursor: pointer;
}

.review-nav {
  position: sticky;
  z-index: 2;
  top: 90px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  padding: 9px 12px;
  background: rgba(239, 244, 241, 0.97);
  border-bottom: 1px solid #cad8d4;
  backdrop-filter: blur(8px);
}

.review-nav button {
  padding: 8px 7px;
  color: var(--teal-dark);
  background: #fff;
  border: 1px solid #c8d8d4;
  border-radius: 3px 8px 3px 3px;
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
}

.review-nav button:hover,
.review-nav button:focus-visible {
  color: white;
  background: var(--teal);
  border-color: var(--teal);
}

.review-content {
  display: grid;
  gap: 18px;
  padding: 18px 20px 34px;
}

.review-section {
  scroll-margin-top: 142px;
  overflow: hidden;
  background: white;
  border: 1px solid #d5ded9;
  border-radius: 3px 14px 3px 3px;
}

.review-section-heading {
  padding: 16px 18px;
  background: #f1f5f2;
  border-bottom: 1px solid #d7e0dc;
}

.review-section-heading > span {
  color: var(--teal);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.review-section-heading h3 {
  margin: 4px 0 0;
  font-family: "Shippori Mincho", serif;
  font-size: 19px;
}

.review-section-heading p {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 9px;
}

.review-chart-body {
  height: auto;
  padding: 18px;
  overflow: visible;
}

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

.review-chart-body .vital-grid,
.review-chart-body .lab-table {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.review-narration {
  margin: 16px 18px 0;
  padding: 13px 15px;
  background: #eef4f1;
  border-left: 3px solid #80aaa3;
}

.review-narration b {
  display: block;
  margin-bottom: 5px;
  color: var(--teal);
  font-size: 7px;
  letter-spacing: 0.13em;
}

.review-narration p {
  margin: 0;
  color: #425a55;
  font-size: 10px;
  line-height: 1.8;
}

.review-narration.closing {
  margin-bottom: 18px;
  background: #faf6e9;
  border-left-color: var(--gold);
}

.review-exchange {
  display: grid;
  gap: 10px;
  padding: 16px 18px 20px;
}

.review-message {
  max-width: 84%;
}

.review-message.student {
  justify-self: end;
}

.review-message > span {
  display: block;
  margin: 0 5px 4px;
  color: var(--ink-soft);
  font-size: 8px;
  font-weight: 700;
}

.review-message.student > span {
  text-align: right;
}

.review-message p {
  margin: 0;
  padding: 10px 13px;
  color: var(--ink);
  background: #f1f2ee;
  border-radius: 3px 12px 12px 12px;
  font-size: 10px;
  line-height: 1.75;
}

.review-message.student p {
  color: white;
  background: var(--teal);
  border-radius: 12px 3px 12px 12px;
}

.soap-form {
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.soap-field {
  min-height: 134px;
  display: grid;
  grid-template-columns: 54px 126px 1fr;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

fieldset.soap-field {
  min-width: 0;
  margin: 0;
  padding: 0;
  border-top: 0;
  border-left: 0;
  border-right: 0;
}

.soap-letter {
  display: grid;
  place-items: center;
  color: white;
  font-family: "Shippori Mincho", serif;
  font-size: 24px;
  font-weight: 700;
}

.soap-s .soap-letter { background: #287d75; }
.soap-o .soap-letter { background: #4d7c94; }
.soap-a .soap-letter { background: #c27f57; }
.soap-p .soap-letter { background: #7a6c96; }

.soap-label {
  padding: 22px 14px;
  background: #f5f5f0;
  border-right: 1px solid var(--line);
}

.soap-label b,
.soap-label small {
  display: block;
}

.soap-label b {
  font-size: 11px;
}

.soap-label small {
  margin-top: 5px;
  color: var(--ink-soft);
  font-size: 9px;
  line-height: 1.6;
}

.soap-field textarea {
  width: 100%;
  padding: 20px;
  resize: vertical;
  color: var(--ink);
  background: #fff;
  border: 0;
  outline: none;
  font-size: 12px;
  line-height: 1.8;
}

.soap-field:focus-within {
  box-shadow: inset 0 0 0 2px rgba(12, 112, 103, 0.35);
}

.soap-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 20px;
  background: #eff2ef;
}

.soap-actions > span {
  color: var(--ink-soft);
  font-size: 9px;
}

.soap-actions > span.error {
  color: #a44136;
  font-weight: 700;
}

.soap-actions .primary-button:disabled {
  cursor: wait;
  opacity: 0.58;
}

.soap-api-note {
  margin: 0;
  padding: 11px 20px 13px;
  color: #75837f;
  background: #eff2ef;
  font-size: 8px;
  line-height: 1.7;
}

.soap-actions .primary-button {
  min-width: 236px;
  padding: 13px 18px;
  font-size: 10px;
}

.evaluating-view {
  min-height: calc(100vh - 150px);
  display: grid;
  place-items: center;
  padding: 48px;
}

.evaluating-card {
  width: min(620px, 100%);
  padding: 44px 48px;
  text-align: center;
  background: rgba(255, 254, 250, 0.96);
  border: 1px solid #cbd9d5;
  border-radius: 5px 32px 5px 5px;
  box-shadow: var(--shadow);
}

.evaluating-spinner {
  width: 74px;
  height: 74px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 22px;
  border: 1px solid #c5d8d3;
  border-radius: 50% 50% 50% 14px;
}

.evaluating-spinner::before {
  content: "";
  position: absolute;
  inset: -1px;
  border: 3px solid transparent;
  border-top-color: var(--teal);
  border-right-color: var(--teal);
  border-radius: inherit;
  animation: evaluating-spin 1.25s linear infinite;
}

.evaluating-spinner span {
  width: 6px;
  height: 6px;
  margin: 2px;
  display: inline-block;
  background: var(--teal);
  border-radius: 50%;
  animation: evaluating-pulse 0.9s ease-in-out infinite alternate;
}

.evaluating-spinner span:nth-child(2) { animation-delay: 0.15s; }
.evaluating-spinner span:nth-child(3) { animation-delay: 0.3s; }

.evaluating-card h1 {
  margin: 8px 0 10px;
  font-size: 30px;
}

.evaluating-card > p:not(.eyebrow) {
  margin: 0 auto;
  max-width: 470px;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.9;
}

.evaluating-card ol {
  display: grid;
  gap: 9px;
  margin: 26px 0 20px;
  padding: 0;
  list-style: none;
  text-align: left;
}

.evaluating-card li {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 14px;
  color: #85938f;
  background: #f7f8f5;
  border: 1px solid #e2e6e2;
  border-radius: 3px 11px 3px 3px;
  font-size: 10px;
}

.evaluating-card li > b {
  font-weight: inherit;
}

.evaluating-card li > span {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid #cbd4d0;
  border-radius: 50%;
  font-size: 9px;
}

.evaluating-card li.done {
  color: var(--ink-soft);
}

.evaluating-card li.done > span {
  color: white;
  background: var(--teal);
  border-color: var(--teal);
}

.evaluating-card li.active {
  color: var(--ink);
  background: #eef7f4;
  border-color: #a9c8c1;
  font-weight: 700;
}

.evaluating-card li.active > span::before {
  content: "";
  width: 7px;
  height: 7px;
  background: var(--teal);
  border-radius: 50%;
  animation: evaluating-pulse 0.8s ease-in-out infinite alternate;
}

.evaluating-card > small {
  color: #7b8985;
  font-size: 9px;
}

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

@keyframes evaluating-pulse {
  to { opacity: 0.25; transform: scale(0.78); }
}

.feedback-view {
  position: relative;
  isolation: isolate;
  max-width: 1120px;
  margin: 0 auto;
  padding: 48px 48px 70px;
}

.feedback-heading {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 30px;
}

.senior-avatar {
  width: 70px;
  height: 70px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: white;
  background: linear-gradient(145deg, #37847b, #155c55);
  border-radius: 50% 50% 50% 8px;
  border: 5px solid var(--teal-pale);
  font-family: "Shippori Mincho", serif;
  font-size: 20px;
  font-weight: 700;
  overflow: hidden;
}

.senior-avatar svg { display: block; width: 100%; height: 100%; }

.feedback-heading .eyebrow {
  margin-bottom: 5px;
}

.feedback-heading h1 {
  font-size: 29px;
  line-height: 1.45;
}

.feedback-cards {
  display: grid;
  gap: 18px;
}

.progress-feedback-history {
  padding: 28px;
  border: 1px solid var(--line);
  background: #f8faf7;
}

.progress-feedback-history-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.progress-history-card {
  padding: 18px;
  border: 1px solid var(--line);
  background: white;
}

.progress-history-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.progress-history-card header strong { color: var(--teal-dark); font-size: 13px; }
.progress-history-card header span { padding: 5px 9px; color: white; background: var(--coral); border-radius: 999px; font-size: 9px; font-weight: 700; }
.progress-history-card div + div { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.progress-history-card small { display: block; margin-bottom: 5px; color: var(--teal); font-size: 8px; font-weight: 700; }
.progress-history-card p { margin: 0; color: var(--ink-soft); font-size: 11px; line-height: 1.75; }

.feedback-overall {
  padding: 26px 28px;
  color: white;
  background: linear-gradient(135deg, var(--teal-dark), #287d75);
  border-radius: 4px 20px 4px 4px;
  box-shadow: 0 12px 30px rgba(25, 89, 82, 0.16);
}

.feedback-overall-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 13px;
}

.feedback-overall-topline > span {
  color: #b9dcd6;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.11em;
}

.feedback-overall-topline strong {
  padding: 7px 12px;
  color: var(--teal-dark);
  background: #edf7f4;
  border-radius: 999px;
  font-size: 13px;
}

.feedback-overall > p {
  max-width: 920px;
  margin: 0;
  font-size: 16px;
  line-height: 1.9;
}

.feedback-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-left-width: 4px;
  background: white;
  box-shadow: 0 7px 20px rgba(34, 59, 54, 0.045);
}

.feedback-card.positive { border-left-color: var(--teal); }
.feedback-card.improve { border-left-color: var(--coral); }
.feedback-card.question { border-left-color: var(--gold); background: #fffbef; }

.feedback-icon {
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: white;
  background: var(--teal);
  border-radius: 50%;
  font-weight: 700;
}

.improve .feedback-icon { background: var(--coral); }
.question .feedback-icon { background: var(--gold); }

.feedback-card h2 {
  margin: 0 0 7px;
  font-size: 17px;
}

.feedback-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.9;
  white-space: pre-line;
}

.feedback-card > div {
  min-width: 0;
}

.feedback-section-heading > span {
  color: var(--teal);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
}

.feedback-section-heading h2 {
  margin: 5px 0 5px;
  font-family: "Shippori Mincho", serif;
  font-size: 22px;
}

.feedback-section-heading > p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.7;
}

.soap-detail-feedback,
.clinical-judgment-feedback {
  padding: 28px;
  border: 1px solid var(--line);
  background: #f8faf7;
}

.soap-feedback-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.soap-feedback-card {
  overflow: hidden;
  border: 1px solid var(--line);
  background: white;
  box-shadow: 0 7px 20px rgba(34, 59, 54, 0.04);
}

.soap-feedback-card > header {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 15px 17px;
  border-bottom: 1px solid var(--line);
}

.soap-feedback-card > header > span {
  width: 35px;
  height: 35px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: white;
  background: var(--teal);
  border-radius: 50%;
  font-family: "Shippori Mincho", serif;
  font-size: 17px;
  font-weight: 700;
}

.soap-feedback-o > header > span { background: #4d7c94; }
.soap-feedback-a > header > span { background: #c27f57; }
.soap-feedback-p > header > span { background: #7a6c96; }

.soap-feedback-card header b,
.soap-feedback-card header small {
  display: block;
}

.soap-feedback-card header b { font-size: 14px; }
.soap-feedback-card header small { margin-top: 2px; color: var(--ink-soft); font-size: 10px; }

.soap-feedback-card > div {
  padding: 15px 17px;
  border-bottom: 1px solid #e7ece8;
}

.soap-feedback-card > div:last-child { border-bottom: 0; }

.soap-feedback-card h3,
.judgment-grid h3 {
  margin: 0 0 6px;
  color: var(--teal-dark);
  font-size: 12px;
}

.soap-feedback-card p,
.judgment-grid p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.85;
  white-space: pre-line;
}

.soap-feedback-card .rewrite-example {
  background: #f3f7f5;
}

.soap-feedback-card .rewrite-example h3::before {
  content: "例 ";
  color: var(--coral);
}

.clinical-judgment-feedback {
  background: white;
}

.judgment-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 20px;
  background: var(--line);
  border: 1px solid var(--line);
}

.judgment-grid section {
  padding: 20px;
  background: #fbfcfa;
}

.judgment-grid section > b {
  display: block;
  margin-bottom: 10px;
  color: var(--teal);
  font-size: 10px;
  letter-spacing: 0.12em;
}

.initial-plan-report {
  margin: 12px 0 16px;
  padding: 14px 15px;
  border-left: 3px solid var(--teal);
  background: #eef6f3;
}

.initial-plan-report small {
  display: block;
  margin-bottom: 6px;
  color: var(--teal-dark);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.initial-plan-report p {
  color: var(--ink);
}

.plan-journey-section h4 {
  margin: 0 0 6px;
  color: var(--teal-dark);
  font-size: 12px;
}

.next-actions-card {
  background: #fff9f5;
}

.feedback-footer {
  margin-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

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

.text-button {
  padding: 10px 12px;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  font-size: 9px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.text-button:hover {
  color: var(--teal);
}

.feedback-footer p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 9px;
}

.feedback-footer p span {
  display: block;
  margin-bottom: 3px;
  color: var(--teal);
  font-weight: 700;
  letter-spacing: 0.12em;
}

.secondary-button {
  padding: 12px 18px;
  color: var(--teal);
  background: transparent;
  border: 1px solid var(--teal);
  border-radius: 3px 10px 3px 3px;
  font-size: 10px;
}

.secondary-button:hover {
  color: white;
  background: var(--teal);
}

.chart-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  justify-items: end;
}

.chart-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  background: rgba(14, 37, 33, 0.5);
  border: 0;
  backdrop-filter: blur(4px);
  cursor: pointer;
}

.chart-sheet {
  width: min(820px, 92vw);
  height: 100%;
  position: relative;
  z-index: 1;
  overflow: hidden;
  background: #f8f8f4;
  box-shadow: -24px 0 70px rgba(8, 32, 28, 0.22);
  animation: chart-in 0.35s ease both;
}

@keyframes chart-in {
  from { transform: translateX(40px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.chart-header {
  height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  color: white;
  background: var(--teal-dark);
}

.chart-header p {
  margin: 0 0 3px;
  color: #a7d0c9;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.15em;
}

.chart-header h2 {
  margin: 0;
  font-family: "Shippori Mincho", serif;
  font-size: 20px;
}

.chart-header button {
  width: 35px;
  height: 35px;
  padding: 0;
  color: white;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  font-size: 21px;
  cursor: pointer;
}

.chart-body {
  height: calc(100% - 82px);
  padding: 26px 30px 60px;
  overflow-y: auto;
}

.chart-scope-note {
  margin-bottom: 12px;
  padding: 15px 18px;
  color: #6d5c35;
  background: #fff8e7;
  border: 1px solid #e6d59f;
  border-left: 3px solid var(--gold);
}

.chart-scope-note b,
.chart-scope-note span {
  display: block;
}

.chart-scope-note b {
  font-size: 13px;
}

.chart-scope-note span {
  margin-top: 5px;
  font-size: 11px;
  line-height: 1.7;
}

.chart-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.chart-summary > div {
  padding: 17px 18px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 3px 9px 3px 3px;
}

.chart-summary small,
.chart-summary strong {
  display: block;
}

.chart-summary small,
.chart-dl dt,
.vital-grid small {
  margin-bottom: 6px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 600;
}

.chart-summary strong {
  font-size: 14px;
  line-height: 1.6;
}

.chart-section {
  margin-top: 34px;
}

.chart-section h3 {
  margin: 0 0 16px;
  padding-bottom: 10px;
  color: var(--teal-dark);
  border-bottom: 2px solid #a7c6bf;
  font-family: "Shippori Mincho", serif;
  font-size: 19px;
}

.chart-section > p {
  margin: 12px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 2;
}

.chart-dl {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.chart-dl > div {
  padding: 15px 16px;
  background: white;
  border-left: 3px solid var(--teal-pale);
}

.chart-dl dt {
  margin-bottom: 6px;
}

.chart-dl dd {
  margin: 0;
  font-size: 12px;
  line-height: 1.8;
}

.chart-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chart-tags span {
  padding: 8px 12px;
  color: var(--teal-dark);
  background: var(--teal-pale);
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
}

.vital-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 1fr;
  gap: 9px;
}

.vital-grid span {
  padding: 14px 10px;
  text-align: center;
  background: white;
  border: 1px solid var(--line);
}

.vital-grid small,
.vital-grid b,
.vital-grid em {
  display: block;
}

.vital-grid b {
  font-size: 14px;
}

.vital-grid em {
  margin-top: 5px;
  color: var(--coral);
  font-size: 9px;
  font-style: normal;
}

.lab-table {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 1fr;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.lab-table span {
  min-height: 44px;
  padding: 11px 10px;
  display: flex;
  align-items: center;
  background: white;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 11px;
}

.clinical-timeline {
  margin: 0;
  padding: 0;
  list-style: none;
}

.clinical-timeline li {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 17px;
  position: relative;
  padding-bottom: 20px;
}

.clinical-timeline li:not(:last-child)::before {
  content: "";
  width: 1px;
  position: absolute;
  left: 92px;
  top: 24px;
  bottom: 0;
  background: #b9cbc6;
}

.clinical-timeline li::after {
  content: "";
  width: 7px;
  height: 7px;
  position: absolute;
  left: 89px;
  top: 7px;
  background: var(--teal);
  border-radius: 50%;
}

.clinical-timeline time {
  padding-right: 17px;
  text-align: right;
  color: var(--teal);
  font-size: 8px;
  font-weight: 700;
  line-height: 1.6;
}

.clinical-timeline div {
  padding: 13px 15px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 3px 10px 3px 3px;
}

.clinical-timeline b {
  font-size: 10px;
}

.clinical-timeline p {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 9px;
  line-height: 1.85;
}

body.modal-open {
  overflow: hidden;
}

.site-footer {
  min-height: 42px;
  padding: 10px clamp(24px, 5vw, 76px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: #82908c;
  background: #e9e9e3;
  border-top: 1px solid rgba(24, 51, 47, 0.1);
  font-size: 8px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

[hidden] {
  display: none !important;
}

@media (min-width: 1200px) {
  .briefing-chart .chart-summary {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .briefing-chart .vital-grid {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }

  .briefing-chart .lab-table {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 235px minmax(0, 1fr); }
  .app-shell:not(.landing-mode) { grid-template-columns: minmax(0, 1fr) 330px; }
  .patient-panel { padding: 20px 16px 26px; }
  .portrait { height: 120px; }
  .episode-grid { grid-template-columns: repeat(2, 1fr); }
  .episode-card { min-height: 190px; }
  .landing-mode .case-selection-view { width: min(1100px, 100%); }
  .case-journey-heading { grid-template-columns: 1fr; gap: 8px; }
  .case-journey ol { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .generated-patient-card { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1101px) and (max-width: 1300px) {
  .app-shell:not(.landing-mode) { grid-template-columns: minmax(0, 1fr) 380px; }
  .patient-panel.memo-only { padding-right: 18px; padding-left: 18px; }
  .clinical-memo { padding: 20px; }
  .clinical-memo textarea { font-size: 15px; }
}

@media (min-width: 761px) and (max-width: 800px) {
  .patient-selection-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .role-selection-view { padding: 34px 20px 50px; }
  .role-selection-grid { grid-template-columns: 1fr; margin-top: 26px; }
  .role-card { min-height: 270px; padding: 22px; }
 .site-header .teacher-mode-nav { order: 3; flex-basis: 100%; margin: 0; padding-top: 4px; }
  .teacher-mode-nav button { flex: 0 0 auto; padding-inline: 11px; }
  .teacher-dashboard-view { padding: 28px 16px 50px; }
  .teacher-dashboard-heading { align-items: stretch; flex-direction: column; }
  .teacher-dashboard-heading .primary-button { width: 100%; }
  .teacher-metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 14px; gap: 7px; }
  .teacher-metric-grid > div { padding: 12px 10px; }
  .teacher-activity-toolbar { grid-template-columns: 1fr; }
  .teacher-activity-head { display: none; }
  .teacher-student-row { padding: 15px; grid-template-columns: 1fr auto; gap: 7px 12px; }
  .teacher-student-row > span:nth-child(2), .teacher-student-row > span:nth-child(4) { grid-column: 1 / -1; }
  .teacher-student-progress { grid-column: 1; }
  .teacher-student-evaluation { grid-column: 2; grid-row: 1; }
  .teacher-student-detail > header { padding: 18px; grid-template-columns: 1fr auto; gap: 12px; }
  .teacher-student-detail > header button { grid-column: 1 / -1; justify-self: start; }
  .teacher-student-overview { padding: 14px 14px 0; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .teacher-attention-card, .teacher-score-section, .teacher-submission-section, .teacher-record-timeline { margin-right: 14px; margin-left: 14px; }
  .teacher-score-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .teacher-submission-grid { grid-template-columns: 1fr; }
  .teacher-record-timeline #teacherStudentTimeline article { padding: 13px 0; grid-template-columns: 48px minmax(0, 1fr); }
  .teacher-record-timeline article > div:last-child { grid-column: 2; text-align: left; }
  .site-header { height: 70px; padding: 0 18px; }
  .scene-intro-dialog {
    width: calc(100% - 24px);
    max-height: 68vh;
    top: 92px;
    right: 12px;
    left: 12px;
  }
  .scene-intro-card {
    max-height: 68vh;
    padding: 25px 20px 21px;
    border-radius: 4px 16px 4px 4px;
  }
  .scene-intro-close {
    width: 34px;
    height: 34px;
    top: 11px;
    right: 11px;
  }
  .scene-intro-heading { padding-right: 38px; }
  .scene-intro-copy { gap: 15px; margin-top: 20px; }
  .scene-intro-copy p { font-size: 13px; line-height: 1.9; }
  .scene-intro-guide { margin-top: 20px; }
  .episode-chart-panel {
    width: calc(100% - 20px);
    max-height: 72vh;
    top: 78px;
    right: 10px;
    left: 10px;
  }
  .episode-chart-panel > header { padding: 14px 16px; }
  .episode-chart-content { padding: 15px 14px 28px; }
  .episode-chart-content .chart-summary,
  .episode-chart-content .vital-grid,
  .episode-chart-content .lab-table { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .brand small, .case-chip, .api-availability > span { display: none; }
  .header-meta { gap: 8px; }
  .api-availability { padding: 7px 9px; }
  .app-shell { display: block; }
  .app-shell.landing-mode { display: block; }
  .app-shell:not(.landing-mode) { display: flex; flex-direction: column; }
  .app-shell:not(.landing-mode) .experience-panel { order: 1; }
  .patient-panel {
    padding: 14px 18px;
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .patient-panel.memo-only {
    width: 100%;
    position: static;
    order: 2;
    display: block;
    padding: 16px;
    background: #eff1ed;
    border: 0;
    border-top: 1px solid var(--line);
  }
  .patient-visual { margin: 0; }
  .portrait { height: 64px; border-radius: 4px 15px 4px 4px; }
  .portrait svg { width: 67px; }
  .portrait::before, .patient-status, .patient-name .blood-type, .patient-facts, .learning-note { display: none; }
  .chart-button { grid-column: 1 / span 2; margin-top: 0; }
  .clinical-memo { grid-column: 1 / span 2; margin-top: 0; }
  .patient-panel.memo-only .clinical-memo { position: static; }
  .clinical-memo textarea { min-height: 240px; }
  .patient-name { padding: 0; border: 0; }
  .patient-name h2 { font-size: 19px; }
  .progress-nav { height: 66px; padding: 0 18px; }
  .progress-nav li { justify-content: center; }
  .progress-nav li b { display: none; }
  .progress-nav li:not(:last-child)::after { left: calc(50% + 17px); right: calc(-50% + 17px); }
  .case-selection-view, .case-author-view, .briefing-view, .dialogue-view, .initial-assessment-view, .assessment-feedback-view, .progress-record-view, .progress-feedback-view, .soap-view, .evaluating-view, .feedback-view { padding: 34px 20px 50px; }
  .landing-mode .case-selection-view { padding-top: 30px; }
  .teacher-entry { align-items: stretch; flex-direction: column; gap: 11px; }
  .teacher-entry .secondary-button, .teacher-entry .primary-button { width: 100%; }
  .case-author-header { grid-template-columns: 37px minmax(0, 1fr); gap: 12px; }
  .case-author-header h1 { font-size: 25px; }
  .case-author-required-note { align-items: flex-start; flex-direction: column; gap: 4px; }
  .case-author-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .teacher-case-library > div:last-child { grid-template-columns: 1fr; }
  .case-author-fields.two-columns,
  .case-author-fields .two-columns { grid-template-columns: 1fr; }
  .case-author-fields label.full { grid-column: auto; }
  .case-author-form legend { padding: 13px 14px; }
  .author-ai-panel { margin: 12px 14px 0; align-items: stretch; flex-direction: column; }
  .author-ai-assist { width: 100%; }
  .case-author-fields { padding: 14px; }
  .author-detail-toggle-row { margin-top: -2px; padding: 0 14px 14px; }
  .author-step-actions, .author-step-actions > div { align-items: stretch; flex-direction: column; }
  .author-step-actions > div:last-child { margin-left: 0; }
  .author-step-actions small { max-width: none; }
  .case-author-submit { align-items: stretch; flex-direction: column; }
  .case-generation-progress { padding: 20px 16px; grid-template-columns: 52px minmax(0, 1fr); gap: 14px; }
  .case-generation-spinner { width: 50px; height: 50px; }
  .case-generation-progress strong { font-size: 18px; }
  .case-generation-progress ol { align-items: flex-start; flex-direction: column; gap: 8px; }
  .case-draft-review > header { grid-template-columns: 1fr auto; padding: 18px 15px; }
  .case-draft-review > header .case-preview-back { grid-column: 1 / -1; justify-self: start; }
  .generated-patient-card { grid-template-columns: 1fr; padding: 14px; }
  .case-revision-panel { padding: 16px 14px; }
  .case-revision-panel > header, .case-revision-actions { align-items: stretch; flex-direction: column; }
  .case-revision-panel > header > span { align-self: flex-start; }
  .case-revision-actions .primary-button { width: 100%; justify-content: center; }
  .case-draft-tabs { grid-template-columns: 1fr; border-bottom: 1px solid #c8d6d1; }
  .case-draft-tabs button { border-right: 0; border-bottom: 1px solid #c8d6d1; }
  .case-draft-tabs button:last-child { border-bottom: 0; }
  .case-draft-content { padding: 13px; }
  .case-draft-review > footer { align-items: stretch; flex-direction: column; }
  .case-draft-review > footer .secondary-button { width: 100%; }
  .patient-selection-list { margin-top: 20px; }
  .patient-selection-list { grid-template-columns: 1fr; }
  .patient-select-card, .patient-placeholder { min-height: 410px; }
  .patient-card-topline { padding: 14px 16px; }
  .patient-card-main { grid-template-columns: 72px 1fr; gap: 13px; padding: 16px; }
  .patient-card-portrait { width: 72px; height: 72px; }
  .patient-card-portrait svg { width: 73px; }
  .patient-card-identity strong { font-size: 24px; }
  .patient-card-identity span { font-size: 9px; line-height: 1.5; }
  .patient-card-details { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0 16px; }
  .case-fact-box { padding: 12px 14px; }
  .case-focus-box { margin: 10px 16px 0; padding: 14px; }
  .patient-card-cta { padding: 17px 17px 20px; }
  .episode-grid { margin-top: 28px; grid-template-columns: 1fr 1fr; gap: 10px; }
  .episode-card { min-height: 170px; padding: 15px 13px; border-radius: 3px 16px 3px 3px; }
  .episode-card.selected { padding: 14px 12px; }
  .episode-card p { display: none; }
  .episode-icon { margin: 10px 0; }
  .primary-button { width: 100%; min-height: 54px; }
  .briefing-header { grid-template-columns: 37px 1fr; }
  .briefing-header h1 { font-size: 24px; }
  .case-journey { padding: 16px; }
  .case-journey ol { grid-template-columns: 1fr; }
  .case-journey li { min-height: 78px; }
  .briefing-hero { grid-template-columns: 1fr; }
  .briefing-grid { grid-template-columns: 1fr; }
  .briefing-chart { padding: 14px; }
  .briefing-card { min-height: 0; }
  .briefing-actions { flex-direction: column; align-items: stretch; }
  .briefing-actions .secondary-button { margin-right: 0; }
  .scene-header { grid-template-columns: 37px minmax(0, 1fr) 42px; gap: 10px; }
  .scene-header-tools { display: none; }
  .scene-info-button {
    width: 42px;
    min-height: 42px;
    grid-template-columns: 1fr;
    gap: 0;
    margin: 0;
    padding: 0;
    border-left-width: 1px;
    border-radius: 3px 11px 3px 3px;
  }
  .scene-info-icon { width: 34px; height: 34px; margin: auto; }
  .scene-info-copy, .scene-info-patient, .scene-info-arrow { display: none; }
  .turn-counter { display: none; }
  .scene-narration { padding: 16px 18px; }
  .chat-log {
    height: clamp(190px, 25vh, 240px);
    min-height: 0;
    max-height: none;
    padding: 18px 10px 8px;
  }
  .message-content { max-width: 82%; }
  .record-header h1 { font-size: 26px; }
  .assessment-heading h1, .assessment-result-heading h1 { font-size: 25px; }
  .progress-record-heading h1 { font-size: 25px; }
  .previous-plan-card { grid-template-columns: 1fr; }
  .previous-plan-card > div:first-child,
  .previous-plan-content { padding: 13px 15px; }
  .initial-assessment-form > label { grid-template-columns: 1fr; }
  .initial-assessment-form > label > span { padding: 15px 16px; }
  .initial-assessment-form textarea { min-height: 116px; padding: 15px 16px; }
  .pattern-assessment-nav { grid-template-columns: repeat(11, 104px); }
  .pattern-assessment-header { grid-template-columns: 1fr; gap: 9px; padding: 18px 16px; }
  .assessment-method-guide,
  .assessment-view-fields,
  .pattern-judgment-options { grid-template-columns: 1fr; }
  .assessment-view-fields label + label { border-top: 1px solid var(--line); border-left: 0; }
  .assessment-view-fields textarea { min-height: 130px; padding: 10px 14px 14px; }
  .assessment-submit-row, .assessment-continue-row, .progress-feedback-continue { flex-direction: column; align-items: stretch; }
  .assessment-submit-row > span, .assessment-continue-row p, .progress-feedback-continue p { text-align: center; }
  .progress-feedback-history-list { grid-template-columns: 1fr; }
  .assessment-result-heading { align-items: flex-start; }
  .assessment-total { min-width: 105px; }
  .assessment-score-list { grid-template-columns: 1fr; }
  .record-stamp { display: none; }
  .review-trigger {
    grid-template-columns: 38px minmax(0, 1fr) auto;
    gap: 10px;
    padding: 12px;
  }
  .review-trigger-icon { width: 38px; height: 38px; }
  .review-trigger-meta { display: none; }
  .review-trigger-copy strong { font-size: 12px; }
  .review-panel {
    width: calc(100% - 20px);
    max-height: 76vh;
    top: 24px;
    right: 10px;
    left: 10px;
  }
  .review-panel > header { min-height: 82px; padding: 14px 16px; }
  .review-panel > header h2 { font-size: 19px; }
  .review-panel > header p { display: none; }
  .review-nav { top: 82px; padding: 7px; }
  .review-nav button { padding: 8px 3px; font-size: 8px; }
  .review-content { padding: 12px 10px 24px; }
  .review-chart-body { padding: 12px; }
  .review-chart-body .chart-summary,
  .review-chart-body .vital-grid,
  .review-chart-body .lab-table { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .review-message { max-width: 94%; }
  .soap-field { grid-template-columns: 44px 1fr; }
  .soap-label { grid-column: 2; padding: 12px 14px 4px; border-right: 0; background: white; }
  .soap-field textarea { grid-column: 2; padding: 8px 14px 16px; }
  .soap-letter { grid-row: 1 / span 2; }
  .soap-actions, .feedback-footer { flex-direction: column; align-items: stretch; }
  .soap-actions > span { text-align: center; }
  .feedback-heading { align-items: flex-start; }
  .feedback-heading h1 { font-size: 24px; }
  .senior-avatar { width: 54px; height: 54px; border-width: 4px; font-size: 16px; }
  .feedback-card { padding: 18px; }
  .feedback-overall { padding: 21px 19px; }
  .feedback-overall-topline { align-items: flex-start; flex-direction: column; gap: 8px; }
  .feedback-overall > p { font-size: 14px; }
  .soap-detail-feedback, .clinical-judgment-feedback { padding: 19px 15px; }
  .feedback-section-heading h2 { font-size: 19px; }
  .soap-feedback-grid, .judgment-grid { grid-template-columns: 1fr; }
  .soap-feedback-card p, .judgment-grid p { font-size: 13px; }
  .feedback-card h2 { font-size: 15px; }
  .feedback-card p { font-size: 14px; }
  .evaluating-card { padding: 34px 22px; border-radius: 4px 22px 4px 4px; }
  .evaluating-card h1 { font-size: 25px; }
  .feedback-actions { align-items: stretch; justify-content: space-between; }
  .site-footer { justify-content: center; text-align: center; }
  .site-footer span:first-child { display: none; }
  .chart-sheet { width: 100%; }
  .chart-header { padding: 0 18px; }
  .chart-body { padding: 20px 16px 45px; }
  .chart-summary, .chart-dl { grid-template-columns: 1fr; }
  .vital-grid, .lab-table { grid-template-columns: repeat(2, 1fr); }
  .clinical-timeline li { grid-template-columns: 78px 1fr; gap: 12px; }
  .clinical-timeline li:not(:last-child)::before { left: 72px; }
  .clinical-timeline li::after { left: 69px; }
  .clinical-timeline time { padding-right: 12px; }
}

@media (max-width: 390px) {
  .episode-grid { grid-template-columns: 1fr; }
  .episode-card { min-height: 135px; }
  .episode-icon { float: right; margin: 4px 0 8px 8px; }
  .episode-card p { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Student information collection: 11pt ≈ 14.67 CSS px, rounded to 15px. */
:is(#briefingView, #dialogueView, #clinicalMemoPanel) {
  --student-reading-size: 15px;
  --student-label-size: 14px;
  --student-caption-size: 12px;
}
:is(#briefingView, #dialogueView) :is(.chart-section > p, .chart-dl dd, .chart-summary strong, .vital-grid b, .lab-table span, .chart-scope-note span),
#briefingView :is(.briefing-header > div > p:last-child, .case-journey-heading p),
#dialogueView :is(.scene-intro-copy p, .scene-narration p, .message-bubble, .dialogue-action),
#clinicalMemoPanel :is(.memo-pattern-guide, .memo-guide-section li, .memo-guide-section > p, .memo-current-pattern strong) {
  font-size: var(--student-reading-size);
  line-height: 1.8;
  overflow-wrap: anywhere;
}
:is(#briefingView, #dialogueView) :is(.chart-summary small, .chart-dl dt, .vital-grid small, .chart-tags span, .chart-scope-note b),
#briefingView :is(.case-journey li strong, .primary-button, .secondary-button),
#dialogueView :is(.scene-info-copy strong, .message-name, .dialogue-prompt > p, .turn-counter, .scene-info-arrow),
#clinicalMemoPanel :is(.memo-pattern-overview > div:first-child b, .memo-pattern-jump-list button span, .memo-guide-tabs button, .memo-guide-section h5) {
  font-size: var(--student-label-size);
  line-height: 1.6;
}
:is(#briefingView, #dialogueView) :is(.vital-grid em, .eyebrow, .narrator-label),
#briefingView :is(.case-journey-heading span, .case-journey li small, .case-journey li span, .briefing-actions .primary-button small),
#dialogueView :is(.scene-info-copy small, .scene-intro-guide, .episode-chart-panel > header p, .episode-chart-panel > header span, .composer-note, .dialogue-action .prompt-arrow),
#clinicalMemoPanel :is(.memo-current-pattern small, .memo-pattern-overview > div:first-child small, .memo-pattern-jump-list button b, .memo-guide-toggle, footer) {
  font-size: var(--student-caption-size);
  line-height: 1.6;
}
#clinicalMemoPanel textarea { font-size: 16px; }
#clinicalMemoPanel .memo-thinking-guide > header { flex-wrap: wrap; }
#clinicalMemoPanel .memo-pattern-overview > div:first-child { flex-wrap: wrap; gap: 4px 10px; }
#clinicalMemoPanel .memo-pattern-jump-list button { height: auto; min-height: 44px; }
#clinicalMemoPanel .memo-pattern-jump-list button span { white-space: normal; overflow: visible; text-overflow: clip; }
:is(#briefingView, #dialogueView) :is(.chart-summary > div, .chart-dl > div, .vital-grid > div, .lab-table > div) { min-width: 0; }
#dialogueView .dialogue-action { grid-template-columns: 23px minmax(0, 1fr) auto; }
@media (max-width: 700px) {
  :is(#briefingView, #dialogueView) .chart-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  :is(#briefingView, #dialogueView) .vital-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  :is(#briefingView, #dialogueView) .lab-table { grid-template-columns: 1fr; }
  #clinicalMemoPanel .memo-pattern-jump-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.patient-portrait-art { display: block; width: 100%; height: auto; }
.message-avatar:has(.patient-portrait-art) { overflow: hidden; background: #edf3ee; }
.message-avatar .patient-portrait-art { width: 100%; height: 100%; }
.generated-case-card .patient-card-portrait:has(.patient-portrait-art) { background: #edf3ee; }

.case-direct-toolbar { padding: 18px; margin: 16px 0; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; border: 1px solid #b5cec4; border-radius: 8px; background: #edf5ef; }
.case-direct-toolbar > div { flex: 1 1 280px; }
.case-direct-toolbar p { margin: 4px 0 0; font-size: 14px; line-height: 1.7; }
.case-direct-toolbar > p { flex-basis: 100%; }
.generated-patient-card:has(.case-direct-field) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.generated-patient-card .case-direct-field:is([data-field="focus"], [data-field="summary"]) { grid-column: 1 / -1; }
.case-direct-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 12px; background: #f5f8f4; border-radius: 6px; }
.case-direct-field > span { font-size: 14px; font-weight: 700; color: var(--teal-dark); }
.case-direct-field :is(textarea, select) { width: 100%; min-width: 0; border: 1px solid #b5cec4; border-radius: 4px; padding: 10px 12px; background: white; color: var(--ink); font-family: inherit; font-size: 16px; line-height: 1.7; resize: vertical; }
.case-direct-field textarea:disabled { opacity: 1; background: #f2f3ef; color: #52645e; }
.case-direct-editor { display: grid; gap: 14px; padding: 18px; background: white; border: 1px solid var(--line); }
.case-direct-group { display: grid; gap: 12px; min-width: 0; margin: 0; padding: 14px; border: 1px solid #d5e1da; border-radius: 6px; }
.case-direct-group > legend { padding: 0 8px; font-size: 16px; font-weight: 700; color: var(--teal-dark); }
.case-direct-pair { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(0, 3fr); gap: 10px; }
@media (max-width: 700px) {
  .generated-patient-card:has(.case-direct-field) { grid-template-columns: 1fr; }
  .case-direct-pair { grid-template-columns: 1fr; }
  .case-direct-editor, .case-direct-group { padding: 10px; }
  .case-direct-toolbar button { flex: 1 1 100%; }
}

.health-problem-view { max-width: 1320px; margin: 0 auto; padding: 48px 54px 70px; }
.health-problem-view .progress-record-heading > div > p:last-child { font-size: 15px; line-height: 1.8; }
.health-problem-view .primary-button { font-size: 15px; }
.problem-list-guide { font-size: 15px; line-height: 1.8; color: var(--ink-soft); }
.health-problem-card { margin: 18px 0; border: 1px solid #b8cec1; border-radius: 8px; overflow: hidden; background: white; }
.health-problem-card > header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: #e8f2e5; }
.health-problem-card h2 { margin: 0; font-size: 17px; }
.problem-remove { border: 1px solid #b6c6ba; border-radius: 4px; padding: 6px 12px; background: white; color: var(--ink-soft); font: inherit; font-size: 14px; cursor: pointer; }
.problem-name { display: grid; grid-template-columns: 100px minmax(0, 1fr); align-items: center; gap: 12px; padding: 16px; font-size: 16px; }
.problem-name > span { font-weight: 700; }
.problem-name input { width: 100%; min-width: 0; padding: 10px 12px; border: 1px solid #b8cec1; border-radius: 4px; font: inherit; }
.health-problem-card fieldset { min-width: 0; margin: 0 16px 16px; padding: 10px 14px 14px; border: 1px solid #d7e1d8; border-radius: 5px; }
.health-problem-card legend { padding: 0 6px; font-size: 15px; font-weight: 700; }
.problem-choices { display: flex; flex-wrap: wrap; gap: 12px 22px; }
.problem-choices label { display: flex; align-items: center; gap: 8px; font-size: 16px; cursor: pointer; }
.problem-choices input { width: 18px; height: 18px; margin: 0; accent-color: var(--teal); }
.problem-add { margin: 4px 0 20px; font-size: 15px; }
.health-problem-trigger { position: fixed; right: 22px; bottom: 80px; z-index: 25; padding: 12px 18px; border: 1px solid #527553; border-radius: 7px; background: #edf4e8; color: #294c2b; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; box-shadow: 0 4px 18px #18332f22; }
body:has(#clinicalReferencePanel:not([hidden])) .health-problem-trigger { visibility: hidden; }
.clinical-reference-panel > nav:has([data-clinical-reference="problems"]:not([hidden])) { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 700px) {
  .health-problem-view { padding: 34px 20px 50px; }
  .problem-name { grid-template-columns: 1fr; gap: 6px; }
  .health-problem-trigger { right: 12px; bottom: 72px; }
  .clinical-reference-panel > nav:has([data-clinical-reference="problems"]:not([hidden])) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Student records: match information collection typography; 16px for writing. */
.initial-assessment-form textarea,
.initial-assessment-form .assessment-view-fields textarea,
.soap-form .soap-field textarea {
  font-size: 16px;
  line-height: 1.8;
}
.initial-assessment-form textarea::placeholder,
.soap-form textarea::placeholder { font-size: inherit; line-height: inherit; }
.assessment-view-fields label > span { flex-wrap: wrap; gap: 4px 8px; }
.assessment-view-card h3 { font-size: 16px; line-height: 1.6; }
:is(.assessment-view-fields label b, .assessment-method-guide b, .pattern-judgment-options b, .soap-label b, .initial-assessment-form > label > span > strong) {
  font-size: 15px;
  line-height: 1.6;
}
:is(.assessment-view-fields label small, .pattern-judgment-options small, .soap-label small, .initial-assessment-form > label > span > small) {
  font-size: 14px;
  line-height: 1.7;
}
:is(.pattern-assessment-header p, .assessment-method-guide p, .pattern-judgment > p) {
  font-size: 15px;
  line-height: 1.8;
}
.pattern-assessment-header span,
.pattern-assessment-nav-button > span,
.assessment-view-card > header span { font-size: 12px; }
.pattern-assessment-nav-button strong { font-size: 14px; }
.pattern-assessment-nav-button small { font-size: 12px; }
.soap-actions > span,
.soap-api-note { font-size: 14px; line-height: 1.7; }

/* Reference material remains available without leaving a student's draft. */
.clinical-reference-trigger { position: fixed; right: 22px; bottom: 20px; z-index: 25; padding: 13px 18px; border: 1px solid #07564f; border-radius: 7px; background: var(--teal-dark); color: white; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; box-shadow: 0 4px 18px #18332f33; }
.clinical-reference-trigger[aria-expanded="true"] { visibility: hidden; }
.clinical-reference-panel { position: fixed; z-index: 30; top: 16px; right: 16px; bottom: 16px; width: min(680px, 48vw); min-width: 360px; display: flex; flex-direction: column; background: #fffefa; border: 1px solid #a5c0b8; border-radius: 8px; box-shadow: 0 8px 40px #18332f40; }
.clinical-reference-panel > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px; color: white; background: var(--teal-dark); border-radius: 7px 7px 0 0; }
.clinical-reference-panel > header h2 { margin: 3px 0; font-size: 20px; }
.clinical-reference-panel > header small { font-size: 12px; }
.clinical-reference-panel > header p { margin: 6px 0 0; font-size: 13px; line-height: 1.6; }
.clinical-reference-panel > header button { flex-shrink: 0; width: 40px; height: 40px; border: 1px solid #b3d6cd; border-radius: 50%; background: #ffffff12; color: white; font-size: 25px; cursor: pointer; }
.clinical-reference-panel > nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 10px; border-bottom: 1px solid var(--line); background: #f1f6f2; }
.clinical-reference-panel > nav button { padding: 10px 5px; color: var(--teal-dark); background: transparent; border: 1px solid transparent; border-radius: 4px; font: inherit; font-size: 13px; cursor: pointer; }
.clinical-reference-panel > nav button[aria-pressed="true"] { background: white; border-color: #b3c9c0; font-weight: 700; }
.clinical-reference-content { flex: 1; min-height: 0; padding: 20px; overflow: auto; overscroll-behavior: contain; font-size: 15px; line-height: 1.8; overflow-wrap: anywhere; }
.clinical-reference-content .chart-body { padding: 0; }
.clinical-reference-content :is(.chart-summary, .chart-dl, .vital-grid) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.clinical-reference-content .lab-table { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.clinical-reference-content :is(.chart-section > p, .chart-dl dd, .chart-summary strong, .vital-grid b, .lab-table span, .chart-scope-note span) { font-size: 15px; line-height: 1.8; overflow-wrap: anywhere; }
.clinical-reference-content :is(.chart-dl dt, .chart-summary small, .vital-grid small, .chart-tags span) { font-size: 14px; }
.reference-record { padding: 14px 0; border-bottom: 1px solid var(--line); }
.reference-record h3 { margin: 0 0 6px; color: var(--teal-dark); font-size: 15px; }
.reference-record p { margin: 0; white-space: pre-wrap; }
.reference-course-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 14px; }
.reference-course-table caption { padding: 14px 0; text-align: left; font-weight: 700; }
.reference-course-table :is(th, td) { padding: 12px 10px; border: 1px solid #d5dfda; vertical-align: top; text-align: left; white-space: pre-wrap; overflow-wrap: anywhere; }
.reference-course-table thead { background: #e9f2ed; }
.reference-course-table th:first-child { width: 24%; }
.clinical-reference-content details { margin: 14px 0; padding: 14px; border: 1px solid var(--line); border-radius: 5px; }
.clinical-reference-content summary { color: var(--teal-dark); font-weight: 700; cursor: pointer; }
body:has(.clinical-reference-trigger:not([hidden])) .site-footer { padding-bottom: 90px; }
@media (max-width: 700px) {
  .clinical-reference-panel { top: 8px; right: 8px; bottom: 8px; width: calc(100% - 16px); min-width: 0; }
  .clinical-reference-panel > header { padding: 14px; }
  .clinical-reference-panel > nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .clinical-reference-content { padding: 14px; }
  .clinical-reference-content :is(.chart-dl, .lab-table) { grid-template-columns: 1fr; }
  .reference-course-table { font-size: 13px; }
  .reference-course-table :is(th, td) { padding: 9px 6px; }
  .clinical-reference-trigger { right: 12px; bottom: 12px; padding: 12px 14px; }
}

.author-ai-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.author-ai-actions .author-ai-assist { flex: 1 1 auto; border-radius: 8px; font-size: 13px; box-shadow: none; }
.author-ai-panel [data-author-assist-status] { font-size: 12px; }
@media (max-width: 640px) { .author-ai-actions { flex-direction: column; } }

.problem-soap-target { padding: 20px; border: 1px solid #b8d4ca; background: #f3f9f6; border-radius: 8px; font-size: 15px; }
.problem-soap-target select { display: block; width: 100%; margin: 12px 0; padding: 12px; font: inherit; background: white; border: 1px solid #9bc8bc; border-radius: 6px; }
.problem-soap-target fieldset { margin: 0; padding: 12px; border: 1px solid #c8dbd3; }
.problem-soap-target p { line-height: 1.8; }

.soap-problem-name { display: block; margin: 16px 0; }
.soap-problem-name input { display: block; width: 100%; box-sizing: border-box; padding: 12px; margin-top: 8px; font: inherit; background: white; border: 1px solid #9bc8bc; border-radius: 6px; }
.problem-soap-target fieldset { margin-bottom: 12px; }

.case-author-fields select { width: 100%; min-width: 0; padding: 12px; font: inherit; font-size: 15px; color: var(--ink); background: white; border: 1px solid #bacbc5; border-radius: 6px; }
.author-balance-note { margin: 0; color: var(--ink-soft); font-size: 13px; line-height: 1.7; }

.lab-table.with-lab-references { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.lab-table.with-lab-references > span { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; overflow-wrap: anywhere; }
.lab-reference-range { display: block; color: var(--ink-soft); font-size: 14px; line-height: 1.65; font-weight: 400; }
p.lab-reference-note { color: var(--ink-soft); font-size: 13px; line-height: 1.7; }
.lab-reference-note a { color: var(--teal-dark); text-decoration: underline; }
@media (max-width: 640px) { .lab-table.with-lab-references { grid-template-columns: 1fr; } }

/* Keep long clinical explanations in one reading column, grouped by purpose. */
.consent-document-section { margin-bottom: 28px; }
.consent-document { border: 1px solid #b6cfc5; border-radius: 12px; background: #fff; padding: 0; overflow: hidden; }
.consent-document > summary { display: flex; align-items: center; gap: 12px; box-sizing: border-box; min-height: 64px; margin: 0; padding: 16px 20px; color: #fff; background: var(--teal-dark); font-size: 16px; line-height: 1.5; font-weight: 700; cursor: pointer; list-style: none; }
.consent-document > summary::-webkit-details-marker { display: none; }
.consent-document > summary:hover { background: #06483f; }
.consent-toggle-icon { flex-shrink: 0; }
.consent-toggle-label { min-width: 0; overflow-wrap: anywhere; }
.consent-toggle-action { display: flex; align-items: center; gap: 8px; margin-left: auto; padding: 5px 10px; border: 1px solid #ffffff70; border-radius: 6px; flex-shrink: 0; font-size: 14px; }
.consent-when-open, .consent-document[open] > summary .consent-when-closed { display: none; }
.consent-document[open] > summary .consent-when-open { display: inline; }
.consent-document[open] > summary .consent-toggle-action svg { transform: rotate(180deg); }
.consent-document-content { display: flow-root; padding: 20px 24px; }
.consent-document-content > :first-child { margin-top: 0; }
.consent-document-content > :last-child { margin-bottom: 0; }
.consent-document h3 { margin: 20px 0 8px; font-size: 21px; line-height: 1.55; }
.consent-document p { font-size: 15px; line-height: 1.8; }
.consent-document .consent-patient { margin: 0 0 22px; color: var(--ink-soft); }
.consent-document .consent-document-note { color: var(--ink-soft); font-size: 13px; line-height: 1.7; }
.consent-document a { color: var(--teal-dark); text-decoration: underline; }
.consent-group { margin: 12px 0; border: 1px solid #d6e3de; border-radius: 8px; overflow: hidden; }
.consent-group > summary { display: flex; align-items: center; gap: 12px; padding: 16px; color: var(--teal-dark); background: #f3f7f5; font-size: 16px; font-weight: 700; cursor: pointer; list-style: none; }
.consent-group > summary::-webkit-details-marker { display: none; }
.consent-group > summary::after { content: '+'; margin-left: auto; font-size: 22px; font-weight: 400; }
.consent-group[open] > summary::after { content: '−'; }
.consent-group > summary:hover { background: #e7f1ed; }
.consent-document summary:focus-visible { outline: 3px solid var(--teal); outline-offset: -3px; }
.consent-group-number { font-size: 13px; letter-spacing: .06em; opacity: .75; }
.consent-fields { margin: 0; padding: 0 20px; }
.consent-fields > div { padding: 16px 0; }
.consent-fields > div + div { border-top: 1px solid #e5ece8; }
.consent-fields dt { margin-bottom: 6px; font-size: 14px; font-weight: 700; color: var(--ink-soft); }
.consent-fields dd { margin: 0; font-size: 16px; line-height: 1.85; white-space: pre-line; overflow-wrap: anywhere; }
.consent-group-emphasis { border-color: #8cb6a8; }
.consent-group-emphasis > summary { background: #e8f3ee; }
.consent-group-emphasis dt { display: none; }
@media (max-width: 640px) {
  .consent-document-content { padding: 16px 14px; }
  .consent-document > summary { padding: 14px; gap: 8px; }
  .consent-document h3 { font-size: 19px; }
  .consent-group > summary { padding: 14px 12px; gap: 8px; }
  .consent-fields { padding: 0 14px; }
}
#generateConsentButton { margin: 0 0 16px; }

.case-author-privacy-notice { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 20px; padding: 16px 20px; color: #a12626; background: #fff3f2; border: 1px solid #e5b4ae; border-left: 4px solid #b82e2e; border-radius: 8px; }
.case-author-privacy-notice > svg { flex-shrink: 0; margin-top: 2px; }
.case-author-privacy-notice strong { display: block; font-size: 16px; line-height: 1.7; }
.case-author-privacy-notice p { margin: 4px 0 0; font-size: 14px; line-height: 1.7; }

.school-account-bar { position: relative; z-index: 100; display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 12px 24px; background: #eaf3ef; border-bottom: 1px solid #adc8bc; }
.school-account-bar[hidden], .school-portal[hidden], .school-save-dock[hidden] { display: none; }
.school-portal { position: fixed; inset: 0; z-index: 200; overflow-y: auto; padding: 38px max(24px, calc((100vw - 1100px)/2)); background: #fafcfb; color: var(--ink); font-size: 16px; line-height: 1.7; }
.school-portal h1 { font-size: 28px; margin: 0 0 20px; }
.school-portal > label { display: inline-flex; flex-direction: column; gap: 6px; margin: 0 20px 16px 0; min-width: 240px; }
.school-portal :is(input,select) { display: block; width: 100%; padding: 10px 12px; font: inherit; border: 1px solid #b4c9bf; border-radius: 6px; background: white; color: inherit; box-sizing: border-box; }
.school-portal button { margin: 6px 8px 6px 0; font-size: 15px; }
.school-record-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 16px 0; border-bottom: 1px solid #d9e4de; }
.school-record-row > strong { flex: 1 1 300px; }
.school-record-row > small { flex-basis: 100%; }
.school-record-section, .school-management { margin: 16px 0; border: 1px solid #ccdcd3; border-radius: 8px; padding: 16px; background: white; }
.school-portal summary { cursor: pointer; color: var(--teal-dark); font-weight: bold; }
.school-record-section p { white-space: pre-wrap; overflow-wrap: anywhere; }
.school-form { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; margin: 20px 0; }
.school-form h3 { grid-column: 1/-1; margin: 0; }
.school-form label { min-width: 0; }
.school-error { color: #a12626; }
.school-save-dock { position: fixed; bottom: 20px; left: 20px; z-index: 150; display: flex; align-items: center; gap: 12px; max-width: calc(100vw - 40px); box-sizing: border-box; padding: 12px 16px; border: 1px solid #a7c9b9; border-radius: 10px; background: #fff; box-shadow: 0 4px 16px #193b2926; font-size: 14px; }
@media(max-width:640px){.school-form{grid-template-columns:1fr}.school-portal > label{min-width:0;display:flex;margin-right:0}.school-save-dock{bottom:10px;left:10px;max-width:calc(100vw - 20px);flex-wrap:wrap}.school-portal{padding:24px 16px}.school-portal h1{font-size:24px}}

.school-login-screen { display: grid; place-items: center; padding: 40px 20px; background: #f0f6f3; }
.school-login-screen[hidden] { display: none; }
.school-login-card { width: min(100%, 480px); box-sizing: border-box; padding: 36px; border: 1px solid #cdded5; border-radius: 18px; background: white; box-shadow: 0 12px 40px #153b2810; }
.school-login-brand { color: var(--teal-dark); font-weight: 700; letter-spacing: .08em; margin-top: 0; }
.school-login-card h1 { font-size: 26px; }
.school-login-steps { display: flex; gap: 16px; list-style: none; margin: 0 0 24px; padding: 0; font-size: 14px; }
.school-login-steps li { flex: 1; padding-bottom: 10px; color: #617169; border-bottom: 3px solid #e1eae5; }
.school-login-steps li.current { border-color: var(--teal-dark); color: var(--teal-dark); font-weight: 700; }
.school-login-form { display: grid; gap: 20px; }
.school-login-form label { display: grid; gap: 8px; font-weight: 700; }
.school-login-form .primary-button { margin: 4px 0 0; padding: 15px; font-size: 16px; }
.school-login-link { display: inline-block; margin: 22px 0 0; color: var(--teal-dark); font-size: 14px; }
.school-login-demo { margin-top: 24px; padding-top: 16px; border-top: 1px solid #dbe5df; font-size: 13px; }
.school-login-demo p { white-space: pre-line; overflow-wrap: anywhere; }
@media(max-width:640px) { .school-login-card { padding: 24px; } }

/* School roster: align identities, recording state, and update time. */
#teacherActivityPanel > [hidden] { display: none !important; }
.school-student-list { font-size: 16px; }
.school-roster-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 24px; }
.school-roster-summary { display: flex; align-items: baseline; gap: 10px; white-space: nowrap; }
.school-roster-summary strong { font-size: 26px; color: var(--teal-dark); }
.school-roster-summary > span { color: var(--muted); font-size: 14px; }
.school-roster-search { display: grid; gap: 6px; width: min(100%, 340px); font-size: 14px; font-weight: 600; }
.school-roster-search input { width: 100%; min-width: 0; padding: 11px 14px; border: 1px solid #cbdad6; border-radius: 8px; background: white; color: var(--ink); font: inherit; font-size: 16px; }
.school-progress-table-wrap { overflow-x: auto; width: 100%; }
.school-progress-table { width: 100%; min-width: 760px; table-layout: fixed; border-collapse: collapse; }
.school-progress-table th, .school-progress-table td { padding: 18px 20px; text-align: left; vertical-align: middle; border-bottom: 1px solid #e0e8e4; overflow-wrap: anywhere; }
.school-progress-table th + th, .school-progress-table td + td { border-left: 1px solid #e0e8e4; }
.school-progress-table th { padding-block: 13px; background: #f3f7f5; border-top: 1px solid #e0e8e4; color: #60736e; font-size: 14px; font-weight: 600; }
.school-progress-table th:nth-child(1) { width: 16%; }
.school-progress-table th:nth-child(2) { width: 23%; }
.school-progress-table th:nth-child(3) { width: 23%; }
.school-progress-table th:nth-child(4) { width: 23%; }
.school-progress-table th:nth-child(5) { width: 15%; }
.school-roster-row { background: white; }
.school-roster-row:last-child td { border-bottom: 0; }
.school-roster-name { font-weight: 600; }
.school-roster-number { font-variant-numeric: tabular-nums; }
.school-roster-badge { justify-self: start; border-radius: 6px; padding: 5px 10px; background: #f0f2f1; color: #61716b; font-size: 14px; white-space: nowrap; }
.school-roster-badge.is-learning { background: #e7f1fc; color: #235b91; }
.school-roster-badge.is-complete { background: #e6f4ec; color: #216b4c; }
.school-roster-badge.is-unstarted { background: #f0f2f1; color: #61716b; }
.school-roster-updated { color: #61716b; font-size: 14px; }
.school-roster-open { min-height: 40px; padding: 8px 12px; color: #08786e; background: white; border: 1px solid #9bbdb3; border-radius: 6px; font: inherit; font-size: 14px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.school-roster-open:hover:not(:disabled) { background: #eaf4ef; border-color: var(--teal); }
.school-roster-open:disabled { opacity: .45; cursor: default; }
.school-roster-open:focus-visible, .school-roster-search input:focus-visible, .school-progress-table-wrap:focus-visible { outline: 3px solid #19877b; outline-offset: -3px; }
.school-progress-table .school-roster-empty { padding: 40px 20px; text-align: center; }
@media (max-width: 1000px) { .school-progress-table th, .school-progress-table td { padding-inline: 12px; } }
@media (max-width: 640px) { .school-roster-toolbar { align-items: stretch; flex-direction: column; gap: 16px; padding: 20px 16px; } .school-roster-search { width: 100%; } }

.school-pause-notice { padding: 16px 20px; border: 1px solid #bad7ca; border-radius: 8px; background: #edf7f1; color: #235e48; }
#pauseLearningButton { font-size: 15px; white-space: nowrap; }
#pauseLearningButton:disabled { opacity: .6; cursor: wait; }

/* Keep the pause action at the upper right, outside the writing area. */
.school-save-dock {
 position: sticky; top: 0; bottom: auto; left: auto; z-index: 25;
 width: 100%; max-width: none; min-height: 68px; margin: 0;
 padding: 10px clamp(16px, 5vw, 76px); border: 0; border-bottom: 1px solid #cadcd5;
 border-radius: 0; background: #f8fcfa; box-shadow: 0 2px 8px #18332f0a;
 display: flex; flex-wrap: nowrap; justify-content: flex-end; gap: 20px;
}
.school-save-status { font-size: 14px; line-height: 1.5; color: #526c62; overflow-wrap: anywhere; min-width: 0; }
.school-save-dock #pauseLearningButton { min-height: 44px; margin: 0; padding: 10px 18px; border-radius: 8px; flex-shrink: 0; }
body:has(.school-save-dock:not([hidden])) .pattern-assessment-nav { top: var(--school-learning-toolbar-height, 68px); }
body:has(.school-save-dock:not([hidden])) .patient-panel.memo-only .clinical-memo { top: calc(var(--school-learning-toolbar-height, 68px) + 20px); max-height: calc(100vh - var(--school-learning-toolbar-height, 68px) - 40px); }
@media(max-width:640px) {
 .school-save-dock { padding: 10px 16px; gap: 12px; }
 .school-save-status { flex: 1; font-size: 13px; }
 .school-save-dock #pauseLearningButton { padding: 10px 14px; }
}

/* One header for branding, learning actions, and account settings. */
.site-header.school-unified-header { position: sticky; top: 0; z-index: 25; height: auto; min-height: 80px; gap: 20px; padding-block: 12px; background: #f8fcfa; backdrop-filter: none; box-shadow: 0 2px 8px #18332f0a; }
.school-header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 16px; min-width: 0; }
.school-unified-header .school-save-dock { position: static; min-height: 0; width: auto; max-width: none; padding: 0; border: 0; box-shadow: none; background: transparent; gap: 16px; }
.school-unified-header .school-account-bar { position: relative; display: block; padding: 0; border: 0; background: transparent; flex-shrink: 0; z-index: 1; }
.school-unified-header .school-account-bar > summary { list-style: none; cursor: pointer; padding: 12px 14px; border: 1px solid #c5d8d0; border-radius: 8px; color: #285c50; font-size: 14px; font-weight: 600; white-space: nowrap; }
.school-unified-header .school-account-bar > summary::-webkit-details-marker { display: none; }
.school-unified-header .school-account-bar > summary:hover { background: #eaf4ef; }
.school-unified-header .school-account-bar > summary:focus-visible { outline: 3px solid #19877b; outline-offset: 2px; }
.school-account-menu { position: absolute; right: 0; top: calc(100% + 10px); width: min(340px,calc(100vw - 32px)); padding: 20px; box-sizing: border-box; display: flex; flex-direction: column; gap: 14px; border: 1px solid #c9dbd2; border-radius: 12px; background: white; box-shadow: 0 12px 32px #18332f26; }
.school-account-menu > span { font-size: 14px; overflow-wrap: anywhere; color: #61746e; }
.school-account-menu > strong { font-size: 16px; }
.school-account-menu .header-meta { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 10px; padding-block: 12px; border-block: 1px solid #e1eae5; }
.school-account-menu > button { width: 100%; min-height: 44px; font-size: 14px; }
@media(max-width:900px) {
 .school-unified-header .school-save-status { display: block; max-width: 160px; font-size: 12px; }
 .school-header-actions, .school-unified-header .school-save-dock { gap: 10px; }
}
@media(max-width:640px) {
 .site-header.school-unified-header { padding: 10px 16px; gap: 10px; flex-wrap: wrap; }
 .school-unified-header .brand { flex: 1; }
 .school-unified-header .brand small { display: none; }
 .school-header-actions { display: contents; }
 .school-unified-header .school-account-bar { order: 1; }
 .school-unified-header .school-save-dock:not([hidden]) { order: 2; flex-basis: 100%; justify-content: space-between; padding-top: 8px; }
 .school-unified-header .school-save-status { max-width: none; }
}

.school-portal.student-record-home { top: var(--school-learning-toolbar-height,80px); z-index: 24; padding: 36px max(20px,calc((100vw - 1100px)/2)) 48px; background: #f6f9f7; }
.student-record-home h1 { margin-bottom: 8px; }
.learning-home-intro { margin: 0 0 24px; color: #61746e; }
.learning-home-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 28px 0 14px; }
.learning-home-toolbar h2 { margin: 0; font-size: 18px; }
.learning-home-list { display: grid; gap: 16px; }
.learning-home-card { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 24px; border: 1px solid #d4e1da; border-radius: 12px; background: white; }
.learning-home-card.is-current { border-color: #6ca99a; box-shadow: inset 4px 0 #147e6c; }
.learning-home-copy { min-width: 0; }
.learning-home-label { font-size: 13px; color: #4e7568; font-weight: 600; }
.learning-home-copy h3 { font-size: 21px; margin: 5px 0 8px; overflow-wrap: anywhere; }
.learning-home-copy p { margin: 0 0 8px; }
.learning-home-copy time { color: #65786f; font-size: 14px; }
.learning-home-card > button { flex-shrink: 0; min-height: 44px; }
.learning-home-footnote { margin-top: 24px; font-size: 14px; color: #60756b; }
.learning-home-empty { padding: 36px 24px; text-align: center; background: white; border: 1px solid #d4e1da; border-radius: 12px; }
@media(max-width:640px) {
 .school-portal.student-record-home { padding: 24px 16px; }
 .learning-home-card { align-items: stretch; flex-direction: column; gap: 12px; padding: 20px; }
 .learning-home-card > button { width: 100%; margin: 0; }
 .learning-home-toolbar { flex-wrap: wrap; }
}

body:has(.student-record-home:not([hidden])) :is(#clinicalReferenceTrigger, #clinicalReferencePanel) { display: none; }

.case-learning-progress { display: block; padding: 12px 18px; margin: 12px 0 0; border: 1px solid #a9d2c3; border-radius: 8px; background: #eaf6ef; color: #1d6954; font-size: 15px; font-weight: 600; line-height: 1.6; }

.patient-card-topline .case-learning-progress { display: inline-flex; flex: 0 0 auto; width: auto; padding: 5px 10px; margin: 0; border: 1px solid #bbd9cd; border-radius: 999px; background: #edf7f1; color: #286952; font-size: 13px; font-weight: 600; line-height: 1.5; white-space: nowrap; }
.patient-card-topline .available-status[hidden] { display: none; }
.case-save-notice { margin: 0 0 20px; padding: 14px 18px; border: 1px solid #c4ded1; border-radius: 8px; background: #eff8f2; color: #286952; font-size: 15px; line-height: 1.7; }

.patient-select-card.has-saved-learning { border: 2px solid #218674; }
.patient-select-card.has-saved-learning .patient-card-topline { background: #e4f3ec; }
.patient-card-topline .case-learning-progress.is-saved { color: white; background: #147665; border-color: #147665; font-size: 14px; }
.patient-card-topline .case-learning-progress.is-new { color: #64716b; background: #f3f5f4; border-color: #d6dfda; }
.case-resume-position { display: block; margin: 16px 18px 0; font-size: 14px; line-height: 1.7; color: #285e50; font-weight: 500; }
.patient-select-card.has-saved-learning .patient-card-cta { color: #fff; background: #147665; border-radius: 7px; margin: 16px 18px 18px; padding: 12px 16px; justify-content: center; text-align: center; }
.patient-select-card.has-completed-learning { border-color: #8ca89a; }

/* Use only the border as a warm accent for saved work. */
.patient-select-card.has-saved-learning:not(.has-completed-learning),
.patient-select-card.has-saved-learning:not(.has-completed-learning):hover { border-color: #c77b35; }

.school-auth-notice { position: fixed; z-index: 350; top: 90px; right: 20px; width: min(460px,calc(100vw - 40px)); box-sizing: border-box; padding: 20px; border: 1px solid #d59b6b; border-radius: 12px; background: #fff9f1; color: #543421; box-shadow: 0 8px 30px #18332f26; font-size: 15px; line-height: 1.7; }
.school-auth-notice[hidden] { display: none; }
.school-auth-notice p { margin: 10px 0; overflow-wrap: anywhere; }
.school-auth-notice :is(a,button) { display: inline-flex; margin: 6px 8px 0 0; font-size: 14px; text-decoration: none; }

.problem-soap-target [hidden] { display: none !important; }

/* Steps are the single entry point for reviewing learning material. */
#clinicalReferenceTrigger, #healthProblemTrigger { display: none !important; }
[data-progress][role="button"] { cursor: pointer; }
[data-progress][role="button"]:hover { color: var(--teal-dark); background: #edf6f1; border-radius: 6px; }
[data-progress][role="button"]:focus-visible { outline: 3px solid var(--teal); outline-offset: 4px; }
[data-progress][aria-disabled="true"] { opacity: .45; cursor: default; }
body:has(.school-save-dock:not([hidden])) .clinical-reference-panel { top: calc(var(--school-learning-toolbar-height,80px) + 12px); }

/* Completion uses the full learning area; record tools remain available via steps. */
.app-shell.completion-mode:not(.landing-mode) { grid-template-columns: minmax(0, 1fr); }
.learning-complete-view { padding: 64px 32px 80px; }
.learning-complete-card { max-width: 720px; margin: 0 auto; padding: 48px; border: 1px solid var(--line, #d4dfdb); border-radius: 20px; background: #fff; text-align: center; box-shadow: 0 12px 40px #214e4410; }
.completion-mark { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 24px; border-radius: 50%; background: #eaf4f0; color: #10776d; font-size: 30px; }
.learning-complete-card h1 { margin: 14px 0 20px; font-size: clamp(26px, 3vw, 36px); line-height: 1.5; }
.completion-description { font-size: 17px; line-height: 1.8; }
.completion-case { margin: 20px 0 32px; color: #526d66; font-size: 15px; }
.completion-actions { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.completion-actions button { width: min(100%, 340px); min-height: 52px; margin: 0; font-size: 16px; display: flex; justify-content: center; align-items: center; gap: 20px; }
.completion-hint { margin: 28px 0 0; font-size: 14px; line-height: 1.8; color: #526d66; }
@media (max-width: 640px) {
 .learning-complete-view { padding: 28px 16px 48px; }
 .learning-complete-card { padding: 32px 20px; border-radius: 14px; }
 .completion-description { font-size: 16px; }
}

@media (max-width: 640px) {
 .progress-nav li { flex-direction: column; gap: 6px; text-align: center; }
 .progress-nav li b { display: block; font-size: 10px; line-height: 1.4; white-space: nowrap; }
 .progress-nav li:not(:last-child)::after { top: 14px; }
}

.episode-day-transition .episode-day-heading { margin: 0 0 12px; padding-bottom: 10px; border-bottom: 1px solid #b7d3cc; color: #10776d; font-size: 18px; line-height: 1.5; font-weight: 700; }
.episode-day-transition p { margin: 0; line-height: 1.8; }

/* Keep navigation reachable without covering the active form. */
:root { --learning-nav-height: 120px; }
.progress-nav { position: sticky; top: var(--school-learning-toolbar-height, 0px); z-index: 20; height: auto; min-height: 108px; padding: 16px 24px 12px; flex-direction: column; justify-content: center; gap: 14px; background: #f8fcfa; }
.learning-reference-links { display: flex; gap: 8px; width: 100%; justify-content: center; overflow-x: auto; }
.learning-reference-links button { flex-shrink: 0; border: 1px solid #b6cec6; border-radius: 6px; background: white; color: #126d64; padding: 8px 14px; font: inherit; font-size: 14px; cursor: pointer; }
.learning-reference-links button:hover, .learning-reference-links button:focus-visible { background: #e5f1ec; }
.learning-reference-links button:disabled { opacity: .5; cursor: default; }
.student-preview-navigation { top: var(--school-learning-toolbar-height, 0px); z-index: 20; background: #f8fcfa; }
body:has(.school-save-dock:not([hidden])) .pattern-assessment-nav, .pattern-assessment-nav { top: calc(var(--school-learning-toolbar-height, 0px) + var(--learning-nav-height)); }
.historical-soap-editor label { display: block; margin: 18px 0; font-weight: 700; }
.historical-soap-editor textarea { display: block; box-sizing: border-box; width: 100%; min-height: 150px; margin-top: 8px; padding: 12px; border: 1px solid #b6cec6; border-radius: 6px; color: var(--ink); background: white; font: inherit; font-size: 17px; line-height: 1.8; }
.historical-soap-editor button { margin: 12px 0; }
@media(max-width:640px) {
 .progress-nav { padding: 12px 16px; }
 .learning-reference-links { justify-content: flex-start; gap: 6px; }
 .learning-reference-links button { padding: 8px 10px; }
 .student-preview-navigation { position: sticky; display: flex; overflow-x: auto; }
 .student-preview-navigation button { flex: 0 0 auto; min-width: 80px; }
}

@media(max-width:640px) {
 .learning-reference-links { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 4px; overflow: visible; }
 .learning-reference-links button { min-width: 0; min-height: 40px; padding: 7px 2px; font-size: 11px; letter-spacing: 0; white-space: nowrap; }
}

/* Numbered steps navigate full pages, not overlays. */
.progress-nav { min-height: 82px; padding: 16px 24px; gap: 0; }
.clinical-reference-panel.learning-history-page {
 position: static; inset: auto; z-index: auto; width: auto; min-width: 0;
 max-width: none; margin: 0; border: 0; border-radius: 0; box-shadow: none;
 background: transparent;
}
.learning-history-page > header { margin: 0; padding: 36px 48px 24px; color: var(--ink); background: transparent; border-radius: 0; align-items: center; }
.learning-history-page > header h2 { font-size: 30px; }
.learning-history-page > header small { color: var(--teal); }
.learning-history-page > header button { width: auto; height: auto; min-height: 44px; padding: 10px 16px; border: 1px solid #a5c0b8; border-radius: 6px; color: var(--teal-dark); background: white; font: inherit; font-size: 14px; }
.learning-history-page > nav, .learning-history-page > nav:has([data-clinical-reference="problems"]:not([hidden])) { display: flex; gap: 8px; margin: 0 48px; padding: 8px; border: 1px solid var(--line); border-radius: 6px; }
.learning-history-page > nav[hidden] { display: none; }
.learning-history-page > nav button { flex: 1; font-size: 15px; }
.learning-history-page .clinical-reference-content { flex: none; overflow: visible; max-height: none; padding: 24px 48px 60px; }
.learning-history-page .reference-record p { font-size: 16px; line-height: 1.9; }
@media(max-width:640px) {
 .learning-history-page > header { padding: 24px 20px 16px; flex-wrap: wrap; }
 .learning-history-page > header h2 { font-size: 26px; }
 .learning-history-page > nav, .learning-history-page > nav:has([data-clinical-reference="problems"]:not([hidden])) { margin: 0 20px; }
 .learning-history-page > nav button { font-size: 13px; }
 .learning-history-page .clinical-reference-content { padding: 20px 20px 40px; }
}

.record-history-link { margin: 0 0 20px; min-height: 44px; }

/* Hide only new-case authoring; keep saved-case editing and AI revision. */
html[data-new-case-authoring="disabled"] [data-teacher-section="create"],
html[data-new-case-authoring="disabled"] #teacherCreateCaseButton,
html[data-new-case-authoring="disabled"] .case-author-header,
html[data-new-case-authoring="disabled"] #caseAuthorFormPanel,
html[data-new-case-authoring="disabled"] #editCaseInputButton {
  display: none !important;
}

.patient-selection-note:empty { display: none; }

.school-progress-case { display: grid; gap: 6px; width: min(100%, 420px); font-size: 14px; font-weight: 600; }
.school-progress-case select { min-width: 0; width: 100%; padding: 11px 14px; border: 1px solid #cbdad6; border-radius: 8px; background: white; color: var(--ink); font: inherit; font-size: 16px; }
.school-progress-state { display: grid; gap: 8px; }
.school-progress-state small { color: #61716b; font-size: 13px; line-height: 1.5; }
@media (max-width: 760px) { .school-progress-case { width: 100%; } }

/* Teacher record reader shares the main header and presents one record category at a time. */
.school-portal.teacher-record-reader { top: var(--school-learning-toolbar-height,80px); z-index: 24; padding: 28px max(20px,calc((100vw - 1180px)/2)) 60px; background: #f6f9f7; }
.record-reader-heading { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 22px 0 26px; }
.teacher-record-reader .record-reader-heading h1 { margin: 0; font-size: 30px; }
.record-reader-number { margin: 0 0 6px; color: #5d746c; font-size: 14px; }
.record-reader-meta { display: grid; justify-items: end; gap: 6px; font-size: 14px; color: #5d746c; }
.record-reader-meta strong { font-size: 18px; color: var(--ink); }
.record-reader-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 0; border-bottom: 1px solid #d6e2dc; }
.teacher-record-reader .record-reader-tabs button { margin: 0; flex: 0 0 auto; padding: 12px 20px; border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: transparent; color: var(--teal-dark); }
.teacher-record-reader .record-reader-tabs button.active { background: transparent; border-bottom-color: var(--teal); color: var(--teal-dark); }
.teacher-record-reader .record-reader-tabs button:hover { background: #e3eeea; color: #135b53; }
.teacher-record-reader .record-reader-tabs button:focus-visible { outline: 2px solid var(--teal); outline-offset: -3px; }
.record-reader-pane { padding-top: 24px; }
.record-pattern-layout { display: grid; grid-template-columns: 250px minmax(0,1fr); gap: 28px; align-items: start; }
.record-pattern-sidebar { position: sticky; top: 0; }
.record-pattern-body { min-width: 0; }
.record-pattern-nav { display: grid; gap: 2px; }
.record-pattern-legend { margin: 0 0 12px; color: #53665e; font-size: 12px; }
.record-pattern-mobile { display: none; }
.teacher-record-reader .record-pattern-button { display: flex; align-items: center; gap: 9px; margin: 0; padding: 10px 12px; min-height: 44px; border: 0; border-left: 3px solid transparent; border-radius: 0 5px 5px 0; background: transparent; color: #234d43; text-align: left; font-size: 14px; line-height: 1.5; }
.record-pattern-marker { flex: 0 0 10px; width: 10px; height: 10px; border: 1.5px solid #387aa5; border-radius: 50%; background: #387aa5; }
.teacher-record-reader .record-pattern-button.is-empty { color: #596860; }
.record-pattern-button.is-empty .record-pattern-marker { background: transparent; border-color: #78877f; }
.record-pattern-button.judgment-only .record-pattern-marker { background: linear-gradient(to right,#387aa5 50%,transparent 50%); }
.teacher-record-reader .record-pattern-button:hover { background: #edf2ef; color: #234d43; }
.teacher-record-reader .record-pattern-button.active, .teacher-record-reader .record-pattern-button.active:hover { background: #e2eee8; border-left-color: #176d60; color: #234d43; }
.teacher-record-reader .record-pattern-button:focus-visible { outline: 2px solid #176d60; outline-offset: -2px; }
@media(max-width:760px) {
 .record-pattern-layout { grid-template-columns: minmax(0,1fr); gap: 20px; }
 .record-pattern-sidebar { position: static; }
 .record-pattern-nav { display: none; }
 .record-pattern-mobile { display: grid; gap: 8px; font-size: 14px; }
 .record-pattern-mobile select { width: 100%; min-width: 0; padding: 12px; background: white; color: #234d43; border: 1px solid #adc4ba; border-radius: 6px; font: inherit; font-size: 16px; }
}
.record-pattern-panel h2 { margin: 0 0 12px; font-size: 23px; }
.record-pattern-judgment { padding: 12px 16px; background: #eaf2ef; border-left: 3px solid var(--teal); margin: 0 0 20px; }
.record-viewpoint, .record-problem-card, .record-soap-card { background: white; border: 1px solid #d5e1dc; border-radius: 10px; overflow: hidden; margin: 0 0 18px; }
.record-viewpoint h3, .record-soap-card h3 { margin: 0; padding: 16px 20px; font-size: 18px; background: #eef5f2; border-bottom: 1px solid #d5e1dc; }
.record-reader-field { padding: 18px 20px; border-bottom: 1px solid #e3ebe7; }
.record-reader-field:last-child { border-bottom: 0; }
.record-reader-field h4 { margin: 0 0 10px; font-size: 16px; color: var(--teal-dark); }
.record-reader-field p { margin: 0; font-size: 16px; line-height: 1.9; white-space: pre-wrap; overflow-wrap: anywhere; }
.record-reader-empty { color: #708078; }
.record-reader-note { margin: 14px 20px; color: #61746c; font-size: 14px; }
.record-problem-card { padding: 20px; }
.record-problem-card h3 { margin: 0 0 8px; font-size: 19px; }
.record-problem-card p { margin: 0; color: #5d746c; }
.teacher-record-reader .school-record-section { margin: 0 0 16px; padding: 18px 20px; }
.teacher-record-reader .school-record-section > summary { font-size: 18px; }
.teacher-record-reader .school-record-section[open] > summary { margin-bottom: 20px; }
.teacher-record-reader .school-record-section p { overflow-wrap: anywhere; white-space: pre-wrap; }
@media(max-width:760px) {
 .school-portal.teacher-record-reader { padding: 20px 16px 40px; }
 .record-reader-heading { align-items: flex-start; flex-direction: column; gap: 12px; padding-block: 16px 20px; }
 .record-reader-meta { justify-items: start; }

 .teacher-record-reader .record-reader-tabs button { padding: 10px 14px; }
 .teacher-record-reader .school-record-section { padding: 16px 12px; }
}

.record-problem-table { width: 100%; border-collapse: collapse; table-layout: fixed; background: white; font-size: 16px; line-height: 1.7; }
.record-problem-table th, .record-problem-table td { padding: 16px; border: 1px solid #d5e1dc; text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.record-problem-table th { background: #edf4f0; font-size: 14px; }
.record-problem-table th:first-child { width: 60%; }
.record-soap-group { margin-bottom: 24px; }
.record-soap-group h3 { margin: 0 0 8px; color: #53665e; font-size: 14px; }
.record-soap-group .record-pattern-button { width: 100%; overflow-wrap: anywhere; }
.record-soap-group p { font-size: 14px; }
.record-soap-content h2 { margin: 0 0 16px; font-size: 23px; }
@media(max-width:760px) {
 .record-soap-nav { display: none; }
 .record-problem-table th, .record-problem-table td { padding: 10px 8px; font-size: 14px; }
 .record-problem-table th:first-child { width: 48%; }
}
