:root {
  --bg: #f5f7f8;
  --surface: #ffffff;
  --surface-soft: #edf7f5;
  --ink: #17212b;
  --muted: #5a6874;
  --line: #d8e0e5;
  --teal: #087f7a;
  --teal-dark: #06615d;
  --mint: #d7f0eb;
  --red: #cf3d45;
  --red-soft: #ffe6e8;
  --yellow: #f5c84c;
  --yellow-soft: #fff5cc;
  --green: #2d8a4d;
  --green-soft: #e5f5ea;
  --blue: #2f6fb3;
  --blue-soft: #e6f0fb;
  --shadow: 0 10px 24px rgba(23, 33, 43, 0.08);
  --radius: 8px;
  color-scheme: light;
  font-family:
    -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", "Yu Gothic UI",
    Meiryo, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button {
  border: 0;
}

img,
video,
iframe,
canvas {
  max-width: 100%;
}

.app {
  min-height: 100vh;
}

.large-text {
  font-size: 19px;
}

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  background: var(--surface);
}

.login-visual {
  position: relative;
  min-height: 100vh;
  padding: 56px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  color: #ffffff;
  background:
    linear-gradient(180deg, rgba(5, 59, 57, 0.12), rgba(15, 49, 55, 0.78)),
    url("./assets/remote-rehab-image.jpg")
      center/cover;
}

.login-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(8, 127, 122, 0.18);
}

.login-visual-content {
  position: relative;
  max-width: 700px;
}

.login-visual-brand {
  margin-bottom: 18px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0;
}

.login-visual h1 {
  margin: 0 0 18px;
  font-size: 42px;
  line-height: 1.14;
}

.login-visual p {
  margin: 0;
  max-width: 640px;
  font-size: 20px;
  line-height: 1.8;
}

.login-panel {
  position: relative;
  min-height: 100vh;
  padding: 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--surface);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  background: var(--teal);
  color: #ffffff;
  font-weight: 800;
  font-size: 20px;
}

.brand-name {
  font-weight: 800;
  font-size: 22px;
}

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

.login-card {
  position: relative;
  padding-top: 58px;
  max-width: 520px;
}

.login-role-toggle {
  position: absolute;
  top: 0;
  right: 0;
  min-height: 44px;
  padding: 10px 14px;
  background: #ffffff;
}

.login-card h2 {
  margin: 0 0 10px;
  font-size: 31px;
  line-height: 1.25;
}

.login-card > p {
  margin: 0 0 24px;
  color: var(--muted);
  line-height: 1.8;
}

.role-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}

.role-button {
  min-height: 64px;
  padding: 14px 16px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.role-button strong {
  display: block;
  font-size: 18px;
}

.role-button span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.role-button.active {
  border-color: var(--teal);
  background: var(--surface-soft);
}

.form-grid {
  display: grid;
  gap: 14px;
}

.field label,
.inline-field label {
  display: block;
  margin-bottom: 7px;
  font-weight: 700;
}

.field input,
.field select,
.field textarea,
.inline-field input,
.inline-field select,
.inline-field textarea {
  width: 100%;
  min-height: 48px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  color: var(--ink);
  background: #ffffff;
}

.field textarea,
.inline-field textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.7;
}

.hint {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.primary-button,
.secondary-button,
.danger-button,
.ghost-button,
.icon-button {
  min-height: 48px;
  border-radius: var(--radius);
  padding: 12px 18px;
  cursor: pointer;
  font-weight: 800;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
  border: 0;
}

.primary-button {
  background: var(--teal);
  color: #ffffff;
}

.primary-button:hover,
.primary-button:focus {
  background: var(--teal-dark);
}

.secondary-button {
  background: var(--blue-soft);
  color: #154e87;
}

.danger-button {
  background: var(--red);
  color: #ffffff;
}

.ghost-button {
  border: 2px solid var(--line);
  background: #ffffff;
  color: var(--ink);
}

.icon-button {
  min-width: 48px;
  padding: 10px 12px;
  background: #ffffff;
  border: 2px solid var(--line);
  color: var(--ink);
}

.login-actions {
  margin-top: 20px;
}

.login-error {
  padding: 12px 14px;
  border: 1px solid #f0a7ad;
  border-radius: var(--radius);
  background: var(--red-soft);
  color: #9d222b;
  font-weight: 800;
}

.demo-note {
  margin-top: 18px;
  padding: 14px;
  border-left: 5px solid var(--yellow);
  background: var(--yellow-soft);
  line-height: 1.7;
}

.login-register-block {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.login-register-block h3 {
  margin: 0 0 6px;
  font-size: 22px;
}

.login-register-block > p {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.6;
}

.login-issued-card {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid #bfdfc9;
  border-radius: var(--radius);
  background: var(--green-soft);
}

.login-issued-card strong {
  display: block;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
}

.patient-shell {
  grid-template-columns: 230px minmax(0, 1fr);
}

.side-nav {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 22px 18px;
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.side-brand .brand-mark {
  width: 42px;
  height: 42px;
  font-size: 18px;
}

.profile-block {
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfc;
}

.profile-block strong {
  display: block;
  margin-bottom: 5px;
  font-size: 18px;
}

.profile-block span {
  display: block;
  color: var(--muted);
  line-height: 1.5;
  font-size: 14px;
}

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

.nav-item {
  width: 100%;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  font-weight: 800;
}

.nav-item:hover {
  background: #f0f4f5;
}

.nav-item.active {
  background: var(--teal);
  color: #ffffff;
}

.nav-badge {
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--red);
  color: #ffffff;
  font-size: 13px;
}

.side-footer {
  margin-top: 18px;
  display: grid;
  gap: 8px;
}

.patient-app .side-nav {
  padding: 24px 16px;
}

.patient-app .nav-list {
  gap: 12px;
}

.patient-app .nav-item {
  min-height: 64px;
  padding: 16px;
  font-size: 18px;
}

.main {
  min-width: 0;
  padding: 26px;
}

.topbar {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.topbar h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.28;
}

.topbar p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.safety-banner {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-left: 5px solid var(--red);
  border-radius: var(--radius);
  background: var(--red-soft);
  line-height: 1.7;
}

.safety-banner strong,
.safety-banner span {
  display: block;
}

.patient-app .safety-banner {
  display: grid;
  gap: 2px;
  font-size: 15px;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel.pad {
  padding: 18px;
}

.panel-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.panel-title h2,
.panel-title h3 {
  margin: 0;
  font-size: 22px;
  line-height: 1.35;
}

.panel-title p {
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.patient-register-panel {
  margin-bottom: 16px;
}

.patient-register-form {
  padding-top: 2px;
}

.dashboard-register-area {
  display: grid;
  gap: 14px;
  margin: 0 0 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfc;
}

.dashboard-rehab-panel {
  overflow: hidden;
}

.dashboard-rehab-grid {
  display: grid;
  gap: 16px;
}

.dashboard-rehab-card {
  display: grid;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.dashboard-rehab-head,
.mini-section-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.dashboard-rehab-head h3 {
  margin: 0;
  font-size: 22px;
}

.dashboard-rehab-head p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.dashboard-rehab-sections {
  display: grid;
  grid-template-columns: minmax(360px, 0.85fr) minmax(0, 1.15fr);
  gap: 16px;
  align-items: start;
}

.dashboard-rehab-block {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.mini-section-title strong {
  font-size: 17px;
}

.mini-button {
  min-height: 38px;
  padding: 7px 11px;
  font-size: 13px;
}

.dashboard-evaluation-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.dashboard-evaluation-metric {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfc;
}

.dashboard-evaluation-metric span,
.dashboard-evaluation-metric small {
  display: block;
  color: var(--muted);
  font-weight: 800;
}

.dashboard-evaluation-metric strong {
  display: block;
  margin: 4px 0;
  font-size: 20px;
  line-height: 1.2;
}

.dashboard-training-table table {
  min-width: 900px;
}

.playlist-add-panel {
  margin-bottom: 16px;
}

.playlist-picker {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfc;
}

.playlist-player-wrap {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius);
  background: #111;
}

.playlist-player-wrap iframe {
  width: 100%;
  height: 100%;
}

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

.playlist-list-header strong {
  font-size: 18px;
}

.playlist-video-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.playlist-video-card {
  min-height: 138px;
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.playlist-video-card.active {
  border-color: var(--teal);
  background: var(--surface-soft);
}

.playlist-video-card img {
  width: 132px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius);
  background: #111;
}

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

.playlist-video-card strong {
  line-height: 1.45;
}

.playlist-video-card small {
  margin-top: 6px;
  color: var(--muted);
  font-weight: 800;
}

.selected-video-card {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.selected-video-card strong,
.selected-video-card span {
  display: block;
}

.selected-video-card span {
  color: var(--muted);
  word-break: break-all;
}

.playlist-video-preview {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.playlist-preview-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.playlist-preview-header strong,
.playlist-preview-header span {
  display: block;
}

.playlist-preview-header span {
  color: var(--muted);
  font-size: 14px;
}

.playlist-preview-frame {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius);
  background: #111111;
}

.playlist-preview-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.playlist-preview-empty {
  min-height: 120px;
}

.evaluation-detail-form {
  gap: 18px;
}

.evaluation-score-section {
  display: grid;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfc;
}

.score-section-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.score-section-title h3 {
  margin: 0 0 6px;
  font-size: 22px;
}

.score-section-title p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.score-section-title .score-help {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: #eef8f7;
  color: var(--ink);
  font-weight: 700;
}

.score-section-title strong {
  padding: 8px 12px;
  border-radius: var(--radius);
  background: var(--teal);
  color: #ffffff;
  white-space: nowrap;
}

.evaluation-score-group {
  display: grid;
  gap: 10px;
}

.evaluation-score-group h4 {
  margin: 0;
  color: var(--teal-dark);
  font-size: 17px;
}

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

.evaluation-score-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.evaluation-score-field span {
  display: grid;
  gap: 5px;
  font-weight: 800;
  line-height: 1.5;
}

.evaluation-score-field small {
  color: var(--muted);
  font-weight: 700;
  line-height: 1.55;
}

.evaluation-score-field em {
  color: var(--teal-dark);
  font-style: normal;
  font-size: 13px;
  font-weight: 900;
}

.evaluation-score-field .selected-score-meaning {
  display: block;
  grid-column: 1 / -1;
  margin-top: 4px;
  padding: 10px 12px;
  border-left: 4px solid var(--teal);
  border-radius: var(--radius);
  background: #f1fbfa;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.6;
}

.evaluation-video-list {
  display: grid;
  gap: 12px;
}

.evaluation-video-card {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.evaluation-video-card span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.5;
}

.evaluation-trend-chart {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  overflow-x: auto;
}

.evaluation-trend-chart svg {
  width: 100%;
  min-width: 560px;
  height: auto;
}

.trend-axis {
  stroke: #c6d1d8;
  stroke-width: 2;
}

.trend-axis-label,
.trend-date {
  fill: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.trend-line {
  fill: none;
  stroke: var(--trend-color);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trend-dot {
  fill: #ffffff;
  stroke: var(--trend-color);
  stroke-width: 4;
}

.trend-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-weight: 900;
}

.trend-legend span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.trend-legend i {
  width: 12px;
  height: 12px;
  border-radius: 999px;
}

.evaluation-trend-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.ghost-link {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.login-credential-card {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfc;
}

.login-credential-card strong,
.login-credential-card span {
  display: block;
}

.login-credential-card span {
  margin-top: 4px;
  color: var(--muted);
}

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

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

.credential-grid code {
  display: block;
  margin-top: 6px;
  font-size: 18px;
  font-weight: 900;
  white-space: normal;
  word-break: break-all;
}

.patient-onboarding-next {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid #bfdfc9;
  border-radius: var(--radius);
  background: var(--green-soft);
}

.patient-onboarding-next strong {
  margin: 0;
}

.patient-onboarding-next span {
  margin: 0;
}

.patient-info-block {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.section-heading h3 {
  margin: 0;
  font-size: 20px;
}

.section-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

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

.patient-info-item {
  min-height: 82px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfc;
}

.patient-info-item dt {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.patient-info-item dd {
  margin: 0;
  color: var(--ink);
  font-weight: 800;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.metric {
  min-height: 126px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.metric-action {
  width: 100%;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease;
}

.metric-action:hover,
.metric-action:focus-visible {
  border-color: var(--teal);
  box-shadow: 0 10px 22px rgba(0, 121, 107, 0.14);
  transform: translateY(-1px);
  outline: none;
}

.metric span {
  display: block;
  color: var(--muted);
  font-weight: 700;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 34px;
  line-height: 1.1;
}

.metric small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.5;
}

.patient-home-simple {
  display: grid;
  gap: 18px;
}

.patient-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 20px;
  align-items: center;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow);
}

.simple-eyebrow {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--teal-dark);
  font-weight: 900;
}

.patient-hero h2 {
  margin: 0 0 10px;
  font-size: 34px;
  line-height: 1.25;
}

.patient-hero p {
  margin: 0;
  max-width: 760px;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.75;
}

.patient-hero-buttons {
  display: grid;
  gap: 12px;
}

.patient-primary-action {
  min-height: 78px;
  font-size: 22px;
}

.patient-chat-top-button {
  min-width: 180px;
  background: #0a7d70;
}

.patient-unread-chat-notice {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(200px, auto);
  gap: 14px;
  align-items: center;
  margin-bottom: 18px;
  padding: 18px;
  border: 3px solid var(--red);
  border-radius: var(--radius);
  background: var(--red-soft);
  box-shadow: var(--shadow);
}

.patient-unread-chat-notice strong,
.patient-unread-chat-notice span {
  display: block;
}

.patient-unread-chat-notice strong {
  color: #9d222b;
  font-size: 22px;
  line-height: 1.35;
}

.patient-unread-chat-notice span {
  margin-top: 5px;
  color: var(--ink);
  font-weight: 900;
  line-height: 1.6;
}

.patient-home-utility-actions {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(140px, auto);
  gap: 12px;
  align-items: center;
}

.patient-home-utility-actions > button {
  width: 100%;
}

.patient-call-shortcut {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 300px);
  gap: 18px;
  align-items: center;
  padding: 22px;
  border: 2px solid #86d5cd;
  border-radius: var(--radius);
  background: #effaf8;
  box-shadow: var(--shadow);
}

.patient-call-shortcut strong {
  display: block;
  margin-bottom: 6px;
  color: var(--teal-dark);
  font-size: 22px;
  font-weight: 900;
}

.patient-call-shortcut span {
  display: block;
  color: var(--muted);
  font-weight: 900;
  line-height: 1.6;
}

.patient-call-join-button {
  min-height: 76px;
  font-size: 22px;
}

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

.patient-action-card {
  min-height: 112px;
  padding: 18px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.patient-action-card.pain {
  border-color: #f0a7ad;
  background: var(--red-soft);
}

.patient-action-card.chat.has-unread {
  border-color: var(--red);
  background: var(--red-soft);
  box-shadow: 0 0 0 4px rgba(207, 57, 73, 0.14);
}

.patient-action-card.chat.has-unread strong {
  color: #9d222b;
}

.patient-action-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 22px;
}

.patient-action-card span {
  color: var(--muted);
  font-size: 16px;
}

.simple-section {
  display: grid;
  gap: 12px;
}

.simple-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.simple-section-title h2 {
  margin: 0;
  font-size: 25px;
}

.simple-section-title span {
  color: var(--muted);
  font-weight: 800;
}

.simple-training-list {
  display: grid;
  gap: 12px;
}

.simple-training-item {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) minmax(180px, 240px);
  gap: 16px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow);
}

.simple-training-item.completed {
  background: #f7fbf8;
  border-color: #bfdfc9;
}

.simple-training-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--mint);
}

.simple-training-body h3 {
  margin: 6px 0;
  font-size: 23px;
  line-height: 1.35;
}

.simple-training-body p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.simple-status {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--yellow-soft);
  color: var(--ink);
  font-weight: 900;
}

.simple-training-item.completed .simple-status {
  background: var(--green-soft);
  color: #1d6b37;
}

.simple-training-actions {
  display: grid;
  gap: 8px;
}

.training-list {
  display: grid;
  gap: 16px;
}

.training-item {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.thumb {
  aspect-ratio: 16 / 9;
  width: 100%;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--mint);
  border: 1px solid var(--line);
}

.training-item h3 {
  margin: 0 0 8px;
  font-size: 24px;
  line-height: 1.35;
}

.training-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #eef2f3;
  color: var(--ink);
  font-weight: 700;
  font-size: 14px;
}

.pill.green {
  background: var(--green-soft);
  color: #1d6b37;
}

.pill.red {
  background: var(--red-soft);
  color: #9d222b;
}

.pill.yellow {
  background: var(--yellow-soft);
  color: #735800;
}

.pill.blue {
  background: var(--blue-soft);
  color: #154e87;
}

.notes {
  margin: 12px 0;
  padding: 12px 14px;
  border-left: 5px solid var(--teal);
  background: var(--surface-soft);
  line-height: 1.75;
}

.progress-wrap {
  margin-top: 10px;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
  color: var(--muted);
  font-weight: 700;
}

.progress {
  height: 14px;
  border-radius: 999px;
  background: #e5ecef;
  overflow: hidden;
}

.progress > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--teal);
}

.patient-bottom-exit {
  display: grid;
  justify-items: center;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.patient-exit-button {
  min-width: min(100%, 320px);
}

.patient-video-stage {
  aspect-ratio: 16 / 9;
  width: 100%;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: var(--radius);
  background: #111;
}

.video-frame {
  width: 100%;
  height: 100%;
  border: 0;
  background: #111;
}

.patient-video-stage:fullscreen {
  width: 100vw;
  height: 100vh;
  aspect-ratio: auto;
  border-radius: 0;
  background: #000000;
}

.patient-video-stage:fullscreen .video-frame {
  width: 100vw;
  height: 100vh;
}

.patient-video-stage:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  aspect-ratio: auto;
  border-radius: 0;
  background: #000000;
}

.patient-video-stage:-webkit-full-screen .video-frame {
  width: 100vw;
  height: 100vh;
}

.video-frame:fullscreen,
.video-frame:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
}

.patient-video-actions {
  display: grid;
  grid-template-columns: 1fr;
}

.patient-video-actions > button {
  width: 100%;
}

.record-box {
  display: grid;
  gap: 16px;
}

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

.segmented button {
  min-height: 72px;
  padding: 12px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
}

.segmented button.active {
  border-color: var(--teal);
  background: var(--surface-soft);
}

.pain-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 16px;
  align-items: start;
}

.body-map {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.body-map-board {
  position: relative;
  width: 100%;
  aspect-ratio: 1208 / 802;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.body-map-scroll {
  width: 100%;
  overflow-x: auto;
  padding-bottom: 4px;
}

.body-map-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.body-map-caption {
  position: absolute;
  top: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.body-map-caption.front {
  left: 18.5%;
}

.body-map-caption.back {
  left: 48.5%;
}

.body-map-caption.side {
  left: 78.5%;
}

.body-view {
  position: relative;
  min-height: 500px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfc;
  overflow: hidden;
}

.body-view img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 14px;
  opacity: 0.92;
}

.body-view-title {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  padding: 4px 8px;
  border-radius: 999px;
  background: #ffffff;
  color: var(--muted);
  font-weight: 800;
  font-size: 13px;
}

.part-point {
  position: absolute;
  width: 42px;
  height: 42px;
  transform: translate(-50%, -50%);
  border: 3px solid #ffffff;
  border-radius: 50%;
  background: var(--blue);
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(23, 33, 43, 0.18);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.part-point.segment {
  width: 48px;
  height: 34px;
  border-radius: 999px;
  background: var(--teal);
}

.part-point.spine {
  width: 44px;
  height: 34px;
  border-radius: 999px;
  background: #735800;
}

.part-point span {
  display: block;
  pointer-events: none;
}

.part-point.active {
  background: var(--red);
}

.body-hotspot {
  position: absolute;
  width: 24px;
  height: 24px;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  background: rgba(47, 111, 179, 0.72);
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(23, 33, 43, 0.22);
  font-size: 0;
}

.body-hotspot.segment {
  width: 28px;
  height: 22px;
  background: rgba(8, 127, 122, 0.68);
}

.body-hotspot.spine {
  width: 28px;
  height: 22px;
  background: rgba(115, 88, 0, 0.7);
}

.body-hotspot.active {
  width: 36px;
  height: 36px;
  background: var(--red);
  border-color: #ffffff;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  display: grid;
  place-items: center;
  z-index: 3;
}

.body-hotspot:hover,
.body-hotspot:focus {
  width: 36px;
  height: 36px;
  background: var(--red);
  border-color: #ffffff;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  display: grid;
  place-items: center;
  z-index: 4;
}

.body-hotspot span {
  pointer-events: none;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #eef2f3;
  font-weight: 800;
}

.tag.red {
  background: var(--red-soft);
  color: #9d222b;
}

.selection-box {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.range-value {
  display: flex;
  align-items: center;
  gap: 12px;
}

.range-value input {
  flex: 1;
}

.score-badge {
  min-width: 54px;
  height: 54px;
  display: inline-grid;
  place-items: center;
  border-radius: var(--radius);
  background: var(--red);
  color: #ffffff;
  font-size: 24px;
  font-weight: 900;
}

.pain-detail-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.pain-detail-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.pain-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.pain-detail-head strong {
  display: block;
  font-size: 18px;
}

.pain-detail-head span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
  background: #ffffff;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 13px 12px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 14px;
  background: #f8fafb;
}

tr.alert-high td {
  background: #fff3f4;
}

tr.clickable {
  cursor: pointer;
}

tr.clickable:hover td {
  background: #f3f8f7;
}

.alert-list {
  display: grid;
  gap: 10px;
}

.alert-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-left-width: 7px;
  border-radius: var(--radius);
  background: #ffffff;
}

.alert-item.high {
  border-left-color: var(--red);
}

.alert-item.middle {
  border-left-color: var(--yellow);
}

.alert-item.low {
  border-left-color: var(--blue);
}

.priority {
  min-width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  font-weight: 900;
}

.priority.high {
  background: var(--red);
  color: #ffffff;
}

.priority.middle {
  background: var(--yellow);
  color: #332600;
}

.priority.low {
  background: var(--blue);
  color: #ffffff;
}

.patient-summary {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 16px;
}

.timeline {
  display: grid;
  gap: 10px;
}

.timeline-item {
  padding: 12px 14px;
  border-left: 5px solid var(--teal);
  background: #fbfcfc;
  border-radius: var(--radius);
}

.timeline-item strong {
  display: block;
  margin-bottom: 5px;
}

.timeline-item span {
  display: block;
  color: var(--muted);
  line-height: 1.6;
}

.chart-bars {
  display: grid;
  gap: 10px;
}

.bar-row {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr) 48px;
  gap: 10px;
  align-items: center;
}

.bar-track {
  height: 24px;
  border-radius: 999px;
  background: #e8eef1;
  overflow: hidden;
}

.bar-track > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--teal);
}

.upload-zone {
  padding: 22px;
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  background: #fbfcfc;
}

.upload-zone input {
  margin-top: 10px;
}

.chat-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 620px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #ffffff;
}

.thread-list {
  border-right: 1px solid var(--line);
  background: #f8fafb;
  overflow-y: auto;
}

.thread-item {
  width: 100%;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.thread-item.active,
.thread-item:hover {
  background: var(--surface-soft);
}

.thread-item strong {
  display: block;
  margin-bottom: 5px;
}

.thread-item span {
  color: var(--muted);
  font-size: 14px;
}

.chat-main {
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.chat-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  font-weight: 900;
}

.messages {
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #ffffff;
}

.message {
  max-width: 78%;
  padding: 11px 13px;
  border-radius: var(--radius);
  line-height: 1.65;
}

.message.patient {
  align-self: flex-start;
  background: #eef2f3;
}

.message.therapist {
  align-self: flex-end;
  background: var(--teal);
  color: #ffffff;
}

.message small {
  display: block;
  margin-top: 5px;
  color: inherit;
  opacity: 0.78;
}

.message a {
  color: inherit;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--line);
}

.chat-form textarea {
  min-height: 56px;
  resize: none;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
}

.video-review {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 16px;
}

.dashboard-video-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.dashboard-video-card {
  display: grid;
  grid-template-columns: minmax(220px, 0.95fr) minmax(0, 1.05fr);
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.dashboard-video-info h3 {
  margin: 8px 0;
  font-size: 20px;
}

.dashboard-video-info p {
  margin: 7px 0;
  line-height: 1.6;
}

.video-player-box {
  position: relative;
  min-height: 170px;
  border-radius: var(--radius);
  overflow: hidden;
  background: #101417;
}

.dashboard-video-player,
.review-video-player {
  width: 100%;
  height: 100%;
  min-height: 170px;
  display: block;
  object-fit: contain;
  background: #101417;
}

.video-missing {
  min-height: 170px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: #fbfcfc;
  color: var(--muted);
  text-align: center;
  line-height: 1.6;
}

.video-player-box .video-missing {
  position: absolute;
  inset: 0;
  border: 0;
  border-radius: 0;
}

.video-player-box.loaded .video-missing {
  display: none;
}

.review-stage {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background:
    linear-gradient(rgba(23, 33, 43, 0.18), rgba(23, 33, 43, 0.34)),
    url("https://images.unsplash.com/photo-1518611012118-696072aa579a?auto=format&fit=crop&w=1200&q=80")
      center/cover;
}

.review-stage.drawing {
  outline: 3px solid var(--red);
  outline-offset: 2px;
}

.review-stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
  pointer-events: none;
}

#annotation-display-canvas,
.sent-annotation-canvas {
  z-index: 2;
}

#feedback-canvas {
  z-index: 3;
  cursor: crosshair;
}

.review-stage.drawing #feedback-canvas {
  pointer-events: auto;
}

.review-stage .review-video-player {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
  background: #101417;
}

.feedback-frame-freeze {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: none;
  object-fit: contain;
  background: #101417;
}

.feedback-frame-freeze.active {
  display: block;
}

.feedback-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.review-label {
  position: absolute;
  left: 16px;
  bottom: 16px;
  z-index: 4;
  padding: 8px 10px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  font-weight: 900;
  pointer-events: none;
}

.annotation-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.annotation-panel {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.annotation-panel h3 {
  margin: 0 0 10px;
}

.audio-panel,
.feedback-audio-panel {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.audio-panel h3,
.feedback-audio-panel h3 {
  margin: 0;
}

.mic-permission-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fbf9;
}

.mic-permission-card strong,
.mic-permission-card span {
  display: block;
}

.mic-permission-card span {
  margin-top: 4px;
  color: var(--muted);
}

.mic-level-card {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fbf9;
}

.mic-level-card span {
  color: var(--muted);
  font-weight: 800;
}

.mic-level-meter {
  height: 14px;
  overflow: hidden;
  border-radius: var(--radius);
  background: #e4ece9;
}

.mic-level-meter span {
  display: block;
  width: 0%;
  height: 100%;
  background: var(--teal);
  transition: width 120ms linear;
}

.feedback-submit-progress {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fbf9;
}

.feedback-submit-progress[hidden] {
  display: none;
}

.feedback-submit-progress strong,
.feedback-submit-progress span {
  display: block;
}

.feedback-submit-progress span {
  margin-top: 4px;
  color: var(--muted);
}

.feedback-submit-progress[data-status="done"] {
  border-color: rgba(46, 125, 101, 0.4);
  background: #eff8f4;
}

.feedback-submit-progress[data-status="error"] {
  border-color: rgba(207, 61, 69, 0.45);
  background: #fff4f4;
}

.feedback-submit-progress-bar {
  height: 12px;
  overflow: hidden;
  border-radius: var(--radius);
  background: #e4ece9;
}

.feedback-submit-progress-bar span {
  display: block;
  width: 0%;
  height: 100%;
  margin: 0;
  background: var(--teal);
  transition: width 240ms ease;
}

.feedback-submit-progress[data-status="error"] .feedback-submit-progress-bar span {
  background: var(--red);
}

.feedback-submit-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.feedback-submit-steps span {
  min-height: 32px;
  display: grid;
  place-items: center;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.feedback-submit-steps span.active {
  border-color: var(--teal);
  color: var(--teal);
  background: #eff8f4;
}

.feedback-submit-steps span.done {
  border-color: var(--teal);
  color: #ffffff;
  background: var(--teal);
}

.sent-feedback-panel {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.sent-feedback-panel h3 {
  margin: 0;
}

.sent-feedback-list {
  display: grid;
  gap: 12px;
}

.sent-feedback-card {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fbf9;
}

.compact-title {
  gap: 10px;
  margin: 0;
}

.compact-title h4 {
  margin: 0;
  font-size: 18px;
}

.audio-controls {
  margin-top: 0;
}

.audio-button-field {
  justify-content: end;
}

.annotation-list {
  display: grid;
  gap: 10px;
}

.audio-clip-list {
  display: grid;
  gap: 10px;
}

.annotation-item {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fbf9;
}

.audio-clip-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 260px) auto auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fbf9;
}

.audio-clip-item audio {
  width: 100%;
}

.annotation-item img {
  width: 96px;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  border-radius: var(--radius);
  background: #101417;
}

.annotation-item span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.audio-clip-item span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.feedback-preview {
  margin-top: 12px;
}

.feedback-preview img {
  width: 100%;
  display: block;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #101417;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.call-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
  gap: 16px;
}

.call-screen {
  min-height: 430px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background:
    linear-gradient(rgba(23, 33, 43, 0.22), rgba(23, 33, 43, 0.42)),
    url("https://images.unsplash.com/photo-1573497491208-6b1acb260507?auto=format&fit=crop&w=1200&q=80")
      center/cover;
  color: #ffffff;
  text-align: center;
}

.call-screen video {
  width: 100%;
  height: 100%;
  min-height: 430px;
  object-fit: cover;
}

.call-screen strong {
  display: block;
  margin-bottom: 8px;
  font-size: 28px;
}

.call-room-card {
  max-width: min(680px, calc(100% - 32px));
  padding: 24px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.call-room-card span:not(.pill) {
  display: block;
  color: var(--muted);
  line-height: 1.7;
}

.call-room-link {
  display: block;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--teal-dark);
  font-weight: 800;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.call-settings-form {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.call-reservation-panel {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid #bfdfc9;
  border-radius: var(--radius);
  background: var(--green-soft);
}

.call-reservation-panel h3,
.call-reservation-status h3 {
  margin: 0;
}

.call-reservation-form {
  display: grid;
  gap: 12px;
}

.call-reservation-status {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.call-reservation-list {
  display: grid;
  gap: 10px;
}

.call-reservation-item {
  display: grid;
  grid-template-columns: minmax(90px, 0.8fr) minmax(150px, 1.2fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.call-reservation-item span:not(.pill) {
  color: var(--muted);
  font-weight: 800;
  line-height: 1.5;
}

.call-patient-guide {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fbfb;
}

.call-patient-guide span {
  color: var(--muted);
  line-height: 1.6;
}

.settings-list {
  display: grid;
  gap: 12px;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.empty {
  padding: 22px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  line-height: 1.7;
  background: #fbfcfc;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  max-width: 420px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--ink);
  color: #ffffff;
  box-shadow: var(--shadow);
}

.mobile-nav {
  display: none;
  position: sticky;
  top: 0;
  z-index: 30;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  padding: 10px;
}

.mobile-nav select {
  width: 100%;
  min-height: 48px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: #ffffff;
}

.patient-mobile-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.patient-mobile-actions button {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: var(--radius);
  background: #eef2f3;
  color: var(--ink);
  font-weight: 900;
}

.patient-mobile-actions .nav-badge {
  min-width: 22px;
  height: 22px;
  font-size: 12px;
}

.patient-mobile-actions button.active {
  background: var(--teal);
  color: #ffffff;
}

@media (max-width: 1100px) {
  .grid.four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid.three,
  .patient-summary,
  .video-review,
  .call-stage,
  .pain-layout,
  .dashboard-rehab-sections,
  .dashboard-video-list {
    grid-template-columns: 1fr;
  }

  .patient-info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-video-card {
    grid-template-columns: 1fr;
  }

  .annotation-controls {
    grid-template-columns: 1fr;
  }

  .audio-clip-item {
    grid-template-columns: 1fr;
  }

  .evaluation-score-grid,
  .evaluation-video-card,
  .evaluation-trend-summary,
  .dashboard-evaluation-metrics {
    grid-template-columns: 1fr;
  }

  .mic-permission-card {
    grid-template-columns: 1fr;
  }

  .patient-hero,
  .patient-home-utility-actions,
  .patient-unread-chat-notice,
  .patient-call-shortcut,
  .call-reservation-item,
  .simple-training-item {
    grid-template-columns: 1fr;
  }

  .simple-training-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .login-page {
    display: block;
  }

  .login-visual {
    min-height: 42vh;
    padding: 28px;
  }

  .login-visual h1 {
    font-size: 32px;
  }

  .login-panel {
    min-height: auto;
    padding: 28px;
  }

  .shell {
    display: block;
  }

  .side-nav {
    display: none;
  }

  .mobile-nav {
    display: block;
  }

  .main {
    padding: 18px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions {
    justify-content: flex-start;
  }

  .grid.two,
  .grid.four {
    grid-template-columns: 1fr;
  }

  .training-item {
    grid-template-columns: 1fr;
  }

  .patient-action-grid {
    grid-template-columns: 1fr;
  }

  .score-section-title,
  .evaluation-score-field {
    grid-template-columns: 1fr;
  }

  .score-section-title {
    display: grid;
  }

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

  .playlist-video-list {
    grid-template-columns: 1fr;
  }

  .patient-hero h2 {
    font-size: 30px;
  }

  .patient-hero p {
    font-size: 17px;
  }

  .body-map {
    grid-template-columns: 1fr;
  }

  .body-view {
    min-height: 460px;
  }

  .body-map-board {
    min-width: 760px;
  }

  .chat-shell {
    grid-template-columns: 1fr;
  }

  .thread-list {
    max-height: 210px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .chat-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .role-switch,
  .segmented {
    grid-template-columns: 1fr;
  }

  .login-visual,
  .login-panel,
  .main {
    padding-left: 16px;
    padding-right: 16px;
  }

  .topbar h1 {
    font-size: 25px;
  }

  .patient-mobile-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .training-item h3 {
    font-size: 21px;
  }

  .patient-hero {
    padding: 18px;
  }

  .patient-primary-action {
    min-height: 70px;
    font-size: 20px;
  }

  .patient-call-join-button,
  .patient-chat-top-button {
    min-height: 70px;
    font-size: 20px;
  }

  .simple-training-actions {
    grid-template-columns: 1fr;
  }

  .patient-info-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-rehab-head,
  .mini-section-title {
    display: grid;
  }

	  .playlist-video-card {
    grid-template-columns: 1fr;
  }

  .playlist-video-card img {
    width: 100%;
  }

  .primary-button,
  .secondary-button,
  .danger-button,
  .ghost-button {
    width: 100%;
  }

  .message {
    max-width: 92%;
  }

  .annotation-item {
    grid-template-columns: 1fr;
  }

  .audio-clip-item {
    grid-template-columns: 1fr;
  }

  .mic-permission-card {
    grid-template-columns: 1fr;
  }

  .annotation-item img {
    width: 100%;
  }
}
