:root {
  color-scheme: light;
  --navy: #1c3454;
  --navy-deep: #122640;
  --ink: #20334d;
  --muted: #66768b;
  --blue: #2e6fba;
  --teal: #16777d;
  --teal-bright: #19a7ae;
  --amber: #9a5a00;
  --rose: #b53d48;
  --paper: #f5f8fc;
  --white: #ffffff;
  --line: #d8e3ed;
  --line-strong: #b9cad9;
  --success: #18735e;
  --warning-bg: #fff7e8;
  --danger: #b3313d;
  --shadow: 0 16px 44px rgba(28, 52, 84, 0.1);
  --radius: 20px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 4%, rgba(25, 167, 174, 0.08), transparent 24rem),
    linear-gradient(180deg, #eef4fa 0, var(--paper) 30rem, #edf3f8 100%);
  font-size: 1rem;
  line-height: 1.55;
}

button,
input,
textarea {
  font: inherit;
}

button,
label[for],
.file-button {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

img {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
p,
figure {
  margin-top: 0;
}

h1,
h2,
h3 {
  color: var(--navy-deep);
  line-height: 1.12;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2rem, 5vw, 4.6rem);
}

h2 {
  font-size: clamp(1.45rem, 2.8vw, 2.25rem);
}

h3 {
  font-size: 1.4rem;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  color: var(--white);
  background: var(--navy);
  border-radius: 8px;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 3px solid rgba(46, 111, 186, 0.45);
  outline-offset: 3px;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 72px;
  padding: 10px max(20px, calc((100vw - 1180px) / 2));
  color: var(--white);
  background: rgba(28, 52, 84, 0.97);
  box-shadow: 0 7px 24px rgba(11, 28, 50, 0.16);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--navy);
  background: #72c4c7;
  border-radius: 13px;
  font-weight: 900;
  letter-spacing: -0.06em;
}

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

.brand strong {
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

.brand small {
  margin-top: 1px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.72rem;
}

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

.public-chip {
  padding: 5px 9px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.text-button {
  min-height: 44px;
  padding: 8px 12px;
  color: var(--white);
  background: transparent;
  border: 0;
  border-radius: 10px;
}

.text-button:hover {
  background: rgba(255, 255, 255, 0.09);
}

main {
  min-height: calc(100dvh - 72px);
}

.page {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 52px 0 72px;
}

.eyebrow {
  margin-bottom: 7px;
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.panel {
  background: rgba(255, 255, 255, 0.93);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
  gap: 20px 28px;
  align-items: center;
  padding: 34px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(185, 202, 217, 0.74);
  border-radius: 26px;
}

.hero-title {
  grid-column: 1 / -1;
  text-align: center;
  border-block: 1px solid var(--line-strong);
  padding: 12px 0;
}

.hero-title .eyebrow {
  margin-bottom: 3px;
}

.hero-title h1 {
  margin-bottom: 0;
  font-weight: 950;
  letter-spacing: -0.07em;
}

.hero-media {
  overflow: hidden;
  min-height: 360px;
  background: #122876;
  border-radius: 22px;
  box-shadow: 0 28px 48px rgba(33, 54, 108, 0.2);
}

.hero-media img {
  width: 100%;
  height: 100%;
  min-height: 360px;
  object-fit: cover;
}

.hero-copy {
  padding: 24px 8px 24px 4px;
}

.hero-slogan {
  margin-bottom: 12px;
  color: var(--navy-deep);
  font-size: clamp(1.35rem, 2.5vw, 2.25rem);
  font-weight: 900;
  line-height: 1.18;
}

.lede {
  max-width: 32rem;
  color: var(--muted);
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.badges span {
  padding: 7px 10px;
  color: var(--navy);
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
}

.module-picker {
  padding-top: 56px;
}

.section-heading,
.page-head,
.results-heading,
.disc-panel-head,
.canvas-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-end;
}

.section-heading {
  margin-bottom: 22px;
}

.section-heading h2,
.section-heading p,
.page-head h1,
.page-head p,
.results-heading h2,
.canvas-toolbar p,
.disc-panel-head h2 {
  margin-bottom: 0;
}

.section-heading > p {
  max-width: 34rem;
  color: var(--muted);
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.module-card {
  --accent: var(--blue);
  --tint: rgba(46, 111, 186, 0.09);
  position: relative;
  display: flex;
  min-height: 268px;
  flex-direction: column;
  padding: 20px;
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 12px 32px rgba(28, 52, 84, 0.08);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease;
}

.module-card::after {
  position: absolute;
  right: -54px;
  bottom: -64px;
  width: 160px;
  height: 160px;
  background: var(--tint);
  border-radius: 50%;
  content: "";
}

.module-card:hover,
.module-card:focus-within {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  box-shadow: 0 22px 50px rgba(28, 52, 84, 0.14);
  transform: translateY(-3px);
}

.module-card.is-recommended {
  border-color: var(--accent);
  box-shadow:
    0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent),
    0 24px 56px rgba(28, 52, 84, 0.16);
}

.module-blue {
  --accent: var(--blue);
  --tint: rgba(46, 111, 186, 0.1);
}

.module-teal {
  --accent: var(--teal);
  --tint: rgba(25, 167, 174, 0.12);
}

.module-amber {
  --accent: var(--amber);
  --tint: rgba(239, 155, 39, 0.13);
}

.module-rose {
  --accent: var(--rose);
  --tint: rgba(201, 74, 84, 0.1);
}

.module-card-meta {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 900;
}

.score-chip {
  padding: 5px 8px;
  color: var(--accent);
  background: var(--tint);
  border-radius: 999px;
}

.recommended-label {
  position: absolute;
  z-index: 3;
  top: 50px;
  left: 20px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 900;
}

.module-card h3 {
  position: relative;
  z-index: 2;
  margin: 38px 0 10px;
}

.module-card p {
  position: relative;
  z-index: 2;
  color: var(--muted);
  font-size: 0.88rem;
}

.module-button {
  position: relative;
  z-index: 2;
  align-self: flex-start;
  margin-top: auto;
  background: var(--accent);
}

.button,
.file-button,
.square-button {
  display: inline-flex;
  min-height: 44px;
  justify-content: center;
  align-items: center;
  padding: 10px 16px;
  color: var(--white);
  background: var(--navy);
  border: 1px solid transparent;
  border-radius: 11px;
  font-weight: 800;
  line-height: 1.15;
  text-decoration: none;
  transition:
    transform 150ms ease,
    box-shadow 150ms ease,
    background 150ms ease;
}

.button:hover:not(:disabled),
.file-button:hover,
.square-button:hover:not(:disabled) {
  box-shadow: 0 10px 22px rgba(28, 52, 84, 0.18);
  transform: translateY(-1px);
}

.button.secondary,
.file-button {
  color: var(--navy);
  background: var(--white);
  border-color: var(--line-strong);
}

.square-button {
  width: 44px;
  padding: 0;
  color: var(--navy);
  background: var(--white);
  border-color: var(--line-strong);
  font-size: 1.35rem;
}

.score-panel {
  display: grid;
  grid-template-columns: 0.75fr 1.25fr;
  gap: 20px;
  margin-top: 22px;
  padding: 16px;
}

.total-score {
  display: flex;
  min-height: 230px;
  flex-direction: column;
  justify-content: flex-end;
  padding: 24px;
  color: var(--white);
  background: var(--navy);
  border-radius: 15px;
}

.total-score small {
  color: rgba(255, 255, 255, 0.7);
  font-weight: 800;
}

.total-score strong {
  margin: 4px 0;
  font-size: 4rem;
  line-height: 1;
}

.total-score span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.8rem;
}

.score-list {
  display: grid;
  align-content: center;
  gap: 0;
}

.score-list > div {
  display: flex;
  justify-content: space-between;
  padding: 10px 6px;
  border-bottom: 1px solid var(--line);
}

.score-list .button {
  justify-self: start;
  margin-top: 18px;
}

.privacy-strip,
.notice {
  padding: 12px 14px;
  border-radius: 12px;
}

.privacy-strip {
  display: flex;
  gap: 12px;
  margin: 16px 0 0;
  color: #315a62;
  background: #e8f6f5;
  border: 1px solid #c9e7e4;
  font-size: 0.78rem;
}

.notice {
  color: var(--navy);
  background: #edf4fb;
  border: 1px solid var(--line);
}

.notice.warning {
  color: #704400;
  background: var(--warning-bg);
  border-color: #f0d8a7;
}

.page-head {
  margin-bottom: 24px;
}

.page-head > div {
  max-width: 760px;
}

.demo-review-enabled .page-head > .demo-review-anchor,
.demo-review-enabled .teacher-guide > .demo-review-anchor,
.demo-review-enabled .canvas-toolbar > .demo-review-anchor {
  padding-right: 54px;
}

.demo-review-enabled .report-dialog > .demo-review-marker[data-review-placement="report"] {
  top: 16px;
  right: 80px;
}

.page-head h1 {
  margin-bottom: 8px;
  font-size: clamp(2rem, 4vw, 3.6rem);
}

.page-head > div > p:last-child {
  color: var(--muted);
}

.step-track {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 16px;
}

.step-node {
  min-height: 46px;
  padding: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 800;
  text-align: center;
}

.step-node.is-current {
  color: var(--white);
  background: var(--blue);
  border-color: var(--blue);
}

.step-node.is-complete {
  color: var(--success);
  background: #e8f6f1;
  border-color: #b9decf;
}

.teacher-guide {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
  padding: 14px 16px;
}

.teacher-guide img {
  width: 54px;
  height: 54px;
  object-fit: cover;
  border-radius: 50%;
  background: #dceaf3;
}

.teacher-guide span {
  display: block;
  color: var(--teal);
  font-size: 0.72rem;
  font-weight: 900;
}

.teacher-guide p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.workshop-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(290px, 0.65fr);
  gap: 16px;
}

.lesson-media {
  position: relative;
  min-height: 480px;
  overflow: hidden;
  background: #dfe9f2;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.lesson-media img {
  width: 100%;
  height: 100%;
  min-height: 480px;
  object-fit: cover;
}

.lesson-media figcaption {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 7px 9px;
  color: var(--white);
  background: rgba(18, 38, 64, 0.82);
  border-radius: 8px;
  font-size: 0.72rem;
}

.lesson-actions {
  padding: 24px;
}

.lesson-actions h2 {
  margin-bottom: 10px;
}

.lesson-actions > p:not(.eyebrow, .feedback) {
  color: var(--muted);
}

.action-stack {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}

.action-stack button {
  min-height: 54px;
  padding: 11px 14px;
  color: var(--navy);
  background: #f7fafc;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  font-weight: 800;
  text-align: left;
}

.action-stack button:hover {
  background: #edf5fb;
  border-color: var(--blue);
}

.feedback {
  min-height: 26px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.feedback.success {
  color: var(--success);
  font-weight: 800;
}

.feedback.error {
  color: var(--danger);
  font-weight: 800;
}

.measure-source,
.interpret-intro,
.case-summary,
.advice-panel {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  margin-bottom: 16px;
  padding: 20px;
}

.measure-source h2,
.interpret-intro h2,
.case-summary h2,
.advice-panel h2 {
  margin-bottom: 6px;
}

.measure-source p,
.interpret-intro p,
.case-summary p,
.advice-panel p {
  margin-bottom: 0;
  color: var(--muted);
}

.source-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.file-button {
  position: relative;
  overflow: hidden;
}

.file-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.source-status {
  flex-basis: 100%;
  min-height: 20px;
  margin-top: 6px;
  color: var(--teal);
  font-size: 0.8rem;
}

.measure-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
  gap: 16px;
  align-items: start;
}

.canvas-panel,
.disc-panel,
.interpret-results,
.prescription-stage {
  padding: 20px;
}

.canvas-toolbar {
  margin-bottom: 12px;
}

.canvas-toolbar strong {
  font-size: 1.12rem;
}

.canvas-toolbar output {
  color: var(--blue);
  font-size: 1.7rem;
  font-weight: 950;
}

#measure-canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 900 / 560;
  background: #dce6ed;
  border: 1px solid var(--line);
  border-radius: 15px;
  touch-action: none;
}

.measurement-controls {
  display: grid;
  grid-template-columns: 44px minmax(120px, 1fr) 44px auto;
  gap: 8px;
  align-items: end;
  margin-top: 12px;
}

.measurement-controls label span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.measurement-controls input {
  width: 100%;
  min-height: 44px;
  padding: 9px 10px;
  color: var(--navy);
  background: var(--white);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  font-weight: 900;
}

.disc-panel {
  position: sticky;
  top: 88px;
}

.disc-panel-head {
  align-items: center;
}

.disc-panel-head > span {
  color: var(--blue);
  font-weight: 900;
}

.disc-list {
  display: grid;
  gap: 7px;
  margin-top: 14px;
}

.disc-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 48px;
  padding: 7px 9px;
  color: var(--navy);
  background: #f7fafc;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.disc-row.is-active {
  background: #eaf3fb;
  border-color: var(--blue);
}

.disc-row button {
  min-height: 36px;
  padding: 5px 7px;
  color: inherit;
  background: transparent;
  border: 0;
  font-weight: 800;
  text-align: left;
}

.disc-row output {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
}

.disc-row.is-confirmed output {
  color: var(--success);
}

.confirm-plate {
  width: 100%;
  margin-top: 14px;
}

.interpret-results {
  min-height: 360px;
}

.sir-legend {
  display: flex;
  gap: 7px;
}

.sir-legend span,
.sir-pill {
  display: inline-grid;
  min-width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 9px;
  font-size: 0.82rem;
  font-weight: 950;
}

.sir-s {
  color: #0d6952;
  background: #dff3eb;
}

.sir-i {
  color: #805000;
  background: #fff0cc;
}

.sir-r {
  color: #a12836;
  background: #fbe2e5;
}

.empty-state {
  display: grid;
  min-height: 220px;
  place-items: center;
  margin: 18px 0;
  color: var(--muted);
  background: #f6f9fc;
  border: 1px dashed var(--line-strong);
  border-radius: 15px;
  text-align: center;
}

.result-table-wrap {
  margin: 18px 0;
  overflow-x: auto;
}

.result-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
}

.result-table th,
.result-table td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.result-table th {
  color: var(--muted);
  font-size: 0.72rem;
}

.case-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.case-tab {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 9px 14px;
  color: var(--navy);
  background: var(--white);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  font-weight: 850;
}

.case-tab[aria-selected="true"] {
  color: var(--white);
  background: var(--navy);
  border-color: var(--navy);
}

.advice-panel {
  justify-content: flex-start;
  border-color: #b9d9db;
}

.advice-mark {
  display: grid;
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--white);
  background: var(--teal);
  border-radius: 17px;
  font-weight: 950;
}

.drug-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.drug-card {
  display: grid;
  gap: 8px;
  min-height: 176px;
  padding: 15px;
  color: var(--navy);
  background: #f7fafc;
  border: 1px solid var(--line);
  border-radius: 14px;
  text-align: left;
}

.drug-card:hover,
.drug-card[aria-pressed="true"] {
  background: #eaf3fb;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(46, 111, 186, 0.11);
}

.drug-card strong {
  font-size: 1.02rem;
}

.drug-card span {
  color: var(--muted);
  font-size: 0.78rem;
}

.review-reason {
  display: grid;
  gap: 7px;
  margin: 16px 0;
  color: var(--navy);
  font-weight: 800;
}

.review-reason textarea {
  width: 100%;
  resize: vertical;
  padding: 10px 12px;
  color: var(--navy);
  background: var(--white);
  border: 1px solid var(--line-strong);
  border-radius: 11px;
}

.prescription-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

dialog {
  width: min(680px, calc(100% - 24px));
  max-height: min(86dvh, 780px);
  padding: 0;
  overflow: auto;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 36px 100px rgba(18, 38, 64, 0.3);
}

dialog::backdrop {
  background: rgba(10, 25, 44, 0.64);
  backdrop-filter: blur(5px);
}

.task-dialog form {
  position: relative;
  padding: 30px;
}

.dialog-close {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: var(--navy);
  background: transparent;
  border: 0;
  border-radius: 10px;
  font-size: 1.5rem;
}

.task-dialog .dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
}

.dialog-objective {
  color: var(--muted);
  font-size: 1.02rem;
}

.task-dialog ol {
  display: grid;
  gap: 8px;
  margin: 20px 0;
  padding-left: 24px;
}

.score-note {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  color: var(--navy);
  background: #edf4fb;
  border-radius: 11px;
}

.score-note span {
  color: var(--muted);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 24px;
}

.report-dialog {
  width: min(900px, calc(100% - 24px));
  padding: 24px;
}

.report-head,
.signature-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.report-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 20px 0;
}

.report-summary div {
  padding: 14px;
  background: #f4f8fb;
  border: 1px solid var(--line);
  border-radius: 11px;
}

.report-summary span,
.report-summary strong {
  display: block;
}

.report-summary span {
  color: var(--muted);
  font-size: 0.72rem;
}

.report-summary strong {
  margin-top: 3px;
  color: var(--navy);
  font-size: 1.25rem;
}

.signature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 20px;
}

.signature-grid > div {
  padding: 12px;
  background: #f7fafc;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.signature-head button {
  min-height: 36px;
  color: var(--blue);
  background: transparent;
  border: 0;
}

.signature-canvas {
  display: block;
  width: 100%;
  height: 112px;
  margin-top: 8px;
  background: var(--white);
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  touch-action: none;
}

.toast {
  position: fixed;
  z-index: 60;
  right: 18px;
  bottom: 18px;
  max-width: min(360px, calc(100% - 36px));
  padding: 11px 14px;
  color: var(--white);
  background: var(--navy);
  border-radius: 11px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 980px) {
  .page {
    width: min(100% - 28px, 900px);
    padding-top: 36px;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .hero-title {
    grid-column: 1;
  }

  .hero-media,
  .hero-media img {
    min-height: 320px;
  }

  .hero-copy {
    padding: 12px 2px;
  }

  .module-grid {
    grid-template-columns: 1fr 1fr;
  }

  .workshop-stage,
  .measure-workspace {
    grid-template-columns: 1fr;
  }

  .disc-panel {
    position: static;
  }

  .drug-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 700px) {
  .text-button,
  .disc-row button,
  .signature-head button {
    min-height: 44px;
  }

  .topbar {
    min-height: 62px;
    padding: 8px 12px;
  }

  .demo-review-enabled .topbar-actions {
    padding-right: 52px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .brand small,
  .public-chip {
    display: none;
  }

  .text-button {
    padding-inline: 8px;
    font-size: 0.78rem;
  }

  .page {
    width: min(100% - 20px, 620px);
    padding: 24px 0 54px;
  }

  .hero {
    padding: 14px;
    border-radius: 18px;
  }

  .hero-title {
    padding: 8px 0;
  }

  .hero-media,
  .hero-media img {
    min-height: 230px;
  }

  .section-heading,
  .page-head,
  .results-heading,
  .measure-source,
  .interpret-intro,
  .case-summary,
  .advice-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .page-head .button,
  .source-actions .button,
  .source-actions .file-button {
    width: 100%;
  }

  .module-picker {
    padding-top: 34px;
  }

  .module-grid {
    grid-template-columns: 1fr;
  }

  .module-card {
    min-height: 220px;
  }

  .module-card .button {
    width: 100%;
  }

  .score-panel,
  .signature-grid {
    grid-template-columns: 1fr;
  }

  .total-score {
    min-height: 170px;
  }

  .privacy-strip {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .step-track {
    grid-template-columns: repeat(7, 38px);
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .step-node {
    min-height: 42px;
    font-size: 0.64rem;
  }

  .teacher-guide {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .teacher-guide .button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .lesson-media,
  .lesson-media img {
    min-height: 300px;
  }

  .measurement-controls {
    grid-template-columns: 44px minmax(0, 1fr) 44px;
  }

  .measurement-controls .button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .drug-grid {
    grid-template-columns: 1fr;
  }

  .drug-card {
    min-height: 142px;
  }

  .report-summary {
    grid-template-columns: 1fr 1fr;
  }

  .score-note,
  .dialog-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .dialog-actions .button {
    width: 100%;
  }
}

@media (max-width: 950px) and (max-height: 500px) {
  .demo-review-enabled .topbar-actions {
    padding-right: 52px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .topbar,
  .dialog-close,
  .signature-head button {
    display: none !important;
  }

  body {
    background: var(--white);
  }

  dialog[open] {
    position: static;
    width: 100%;
    max-height: none;
    box-shadow: none;
  }
}
