﻿:root {
  --ink: #0d1116;
  --ink-soft: #2a3036;
  --muted: #6b7176;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-strong: rgba(255, 255, 255, 0.9);
  --line: rgba(15, 20, 24, 0.12);
  --accent: #0b525b;
  --accent-2: #c99a57;
  --accent-3: #0f7a6f;
  --glow: rgba(11, 82, 91, 0.22);
  --bg-start: #f4f1eb;
  --bg-mid: #e9efe8;
  --bg-end: #f6f3ed;
  --shadow: 0 30px 60px rgba(14, 18, 22, 0.12);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --content-max: 1320px;
  --font-title: "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", "Droid Sans Fallback", sans-serif;
  --font-body: "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", "Droid Sans Fallback", sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: radial-gradient(circle at 15% 10%, #ffffff 0%, transparent 40%),
    radial-gradient(circle at 80% 0%, rgba(201, 154, 87, 0.18) 0%, transparent 45%),
    linear-gradient(160deg, var(--bg-start), var(--bg-mid) 45%, var(--bg-end));
  min-height: 100vh;
  overflow-x: hidden;
}

main {
  width: min(var(--content-max), calc(100vw - 72px));
  margin: 0 auto;
}

.noise-layer {
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='120' height='120' viewBox='0 0 120 120' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23noise)' opacity='0.05'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
  pointer-events: none;
  z-index: 0;
}

main, header, footer {
  position: relative;
  z-index: 1;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px max(36px, calc((100vw - var(--content-max)) / 2)) 10px;
  position: sticky;
  top: 0;
  backdrop-filter: blur(16px);
  background: linear-gradient(180deg, rgba(246, 242, 236, 0.92) 0%, rgba(246, 242, 236, 0.68) 100%);
  border-bottom: 1px solid rgba(12, 16, 20, 0.08);
  z-index: 3;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand > div {
  min-width: 0;
}

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

.brand-title {
  font-family: var(--font-title);
  font-size: clamp(18px, 2vw, 20px);
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.2;
}

.brand-subtitle {
  font-size: clamp(11px, 1.1vw, 12px);
  color: var(--muted);
  letter-spacing: 0.12em;
}

.nav-links {
  display: flex;
  gap: clamp(10px, 1.4vw, 20px);
  margin-left: auto;
  margin-right: 24px;
  flex-wrap: wrap;
  justify-content: center;
}

.nav-links a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: clamp(13px, 1.15vw, 16px);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px;
  padding: 60px 0 40px;
  align-items: center;
}

.hero-content h1 {
  font-family: var(--font-title);
  font-size: clamp(32px, 4vw, 54px);
  line-height: 1.1;
  margin-bottom: 20px;
}

.hero-tag {
  display: inline-flex;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(11, 82, 91, 0.08);
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 18px;
}

.hero-desc {
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.8;
  max-width: 540px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  margin: 24px 0 10px;
  flex-wrap: wrap;
}

.primary-btn,
.secondary-btn,
.ghost-btn {
  border: none;
  border-radius: 999px;
  padding: 12px 22px;
  font-family: var(--font-body);
  font-size: 14px;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.primary-btn {
  background: linear-gradient(130deg, var(--accent), var(--accent-3));
  color: #fff;
  box-shadow: 0 18px 30px rgba(11, 82, 91, 0.25);
}

.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 40px rgba(11, 82, 91, 0.3);
}

.secondary-btn {
  background: #ffffff;
  color: var(--ink);
  border: 1px solid var(--line);
  white-space: normal;
  text-align: center;
}

.secondary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 28px rgba(12, 16, 20, 0.12);
}

.ghost-btn {
  background: transparent;
  border: 1px solid rgba(12, 16, 20, 0.16);
  color: var(--ink);
}

.ghost-btn:hover {
  background: rgba(255, 255, 255, 0.8);
}

.full {
  width: 100%;
}

.hero-panel {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(12, 16, 20, 0.08);
  backdrop-filter: blur(18px);
}

.panel-header {
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 18px;
  margin-bottom: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.field span {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.field input {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: #fff;
  font-family: var(--font-body);
}

.panel-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hint {
  color: var(--muted);
  font-size: 12px;
}

.panel-info {
  margin-top: 20px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: rgba(12, 16, 20, 0.04);
  color: var(--ink-soft);
  font-size: 13px;
}

.section-title {
  font-family: var(--font-title);
  font-size: 24px;
  margin-bottom: 20px;
}

.assessments {
  padding: 20px 0 40px;
}

.assessment-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.progress-bar {
  height: 8px;
  background: rgba(12, 16, 20, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  transition: width 0.4s ease;
}

.progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

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

.assessment-card {
  background: rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-md);
  border: 1px solid rgba(12, 16, 20, 0.08);
  padding: 18px;
  box-shadow: 0 18px 40px rgba(14, 18, 22, 0.08);
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top right, rgba(201, 154, 87, 0.08), transparent 34%),
    rgba(255, 255, 255, 0.92);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.assessment-card:hover {
  transform: translateY(-3px);
  border-color: rgba(11, 82, 91, 0.18);
  box-shadow: 0 24px 46px rgba(14, 18, 22, 0.11);
}

.assessment-header {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  min-width: 0;
}

.assessment-header > .muted {
  display: -webkit-box;
  overflow: hidden;
  line-height: 1.6;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  font-size: 13px;
  min-width: 0;
}

.assessment-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.assessment-title {
  font-family: var(--font-title);
  font-size: 16px;
  line-height: 1.4;
  min-width: 0;
  flex: 1 1 190px;
}

.badge {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: none;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(11, 82, 91, 0.12);
  color: var(--accent);
  white-space: nowrap;
  flex: 0 0 auto;
}

.side-pill {
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(12, 16, 20, 0.06);
  font-size: 12px;
  flex: 0 0 auto;
}

.action-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px 12px;
  min-width: 0;
}

.assessment-side-meta {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 8px;
  flex: 1 1 auto;
  flex-wrap: wrap;
}

.assessment-side-entry {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid rgba(12, 16, 20, 0.065);
  min-width: 0;
}

.assessment-header + .assessment-side-entry {
  padding-top: 10px;
}

.status {
  font-size: 12px;
  color: var(--muted);
  white-space: normal;
  line-height: 1.55;
  flex: 1 1 150px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.assessment-action-buttons {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 6px;
  flex: 0 1 auto;
  flex-wrap: wrap;
  min-width: 0;
}

.assessment-action-buttons .secondary-btn {
  padding: 8px 12px;
  font-size: 12px;
  box-shadow: none;
  line-height: 1.35;
  white-space: normal;
  max-width: 100%;
}

.reassess-btn {
  border-color: rgba(183, 91, 37, 0.28);
  color: #9b4d22;
}

.signal-preview {
  padding: 3px 5px;
  overflow: hidden;
  border: 1px solid rgba(11, 82, 91, 0.1);
  border-radius: 11px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(235, 245, 243, 0.78));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.sparkline {
  display: block;
  width: 100%;
  height: 58px;
  border-radius: 8px;
}

.face-card-signals {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 7px 8px 6px;
}

.face-card-signal {
  min-width: 0;
}

.face-card-signal + .face-card-signal {
  padding-left: 8px;
  border-left: 1px solid rgba(11, 82, 91, 0.1);
}

.face-card-signal-label {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  color: #426066;
  font-size: 10px;
  line-height: 1.25;
}

.signal-dot {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.signal-dot.eye {
  background: #159688;
}

.signal-dot.lip {
  background: #e7833b;
}

.face-sparkline {
  height: 48px;
}

.face-signal-unavailable {
  padding: 10px 12px;
  border: 1px dashed rgba(11, 82, 91, 0.18);
  border-radius: 10px;
  color: var(--muted);
  background: rgba(242, 247, 246, 0.72);
  font-size: 11px;
  line-height: 1.5;
}

@media (max-width: 520px) {
  .face-card-signals {
    grid-template-columns: 1fr;
  }

  .face-card-signal + .face-card-signal {
    padding-top: 7px;
    padding-left: 0;
    border-top: 1px solid rgba(11, 82, 91, 0.1);
    border-left: 0;
  }
}

.results {
  padding: 20px 0 80px;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.summary-overview {
  --summary-tone: #0b7f75;
  --summary-soft: rgba(11, 127, 117, 0.1);
  display: grid;
  grid-template-columns: minmax(300px, 0.82fr) minmax(0, 1.18fr);
  gap: 0;
  overflow: hidden;
  margin-bottom: 22px;
  border: 1px solid color-mix(in srgb, var(--summary-tone) 24%, transparent);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 22px 45px rgba(14, 35, 38, 0.1);
}

.summary-overview.level-pending {
  --summary-tone: #718186;
  --summary-soft: rgba(113, 129, 134, 0.1);
}

.summary-overview.level-minimal {
  --summary-tone: #43845f;
  --summary-soft: rgba(67, 132, 95, 0.11);
}

.summary-overview.level-mild {
  --summary-tone: #b37a23;
  --summary-soft: rgba(179, 122, 35, 0.12);
}

.summary-overview.level-moderate {
  --summary-tone: #c45d2d;
  --summary-soft: rgba(196, 93, 45, 0.12);
}

.summary-overview.level-marked {
  --summary-tone: #b43e3e;
  --summary-soft: rgba(180, 62, 62, 0.12);
}

.summary-score-block,
.summary-conclusion-block {
  padding: clamp(22px, 3vw, 34px);
}

.summary-score-block {
  color: #fff;
  background:
    radial-gradient(circle at 88% 12%, rgba(255, 255, 255, 0.2), transparent 36%),
    linear-gradient(145deg, color-mix(in srgb, var(--summary-tone) 88%, #173f45), var(--summary-tone));
}

.summary-eyebrow,
.summary-conclusion-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.summary-eyebrow {
  color: rgba(255, 255, 255, 0.76);
}

.summary-total-score {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin: 12px 0 4px;
}

.summary-total-score strong {
  font-family: var(--font-title);
  font-size: clamp(48px, 6vw, 74px);
  line-height: 0.95;
}

.summary-total-score span {
  color: rgba(255, 255, 255, 0.78);
  font-family: var(--font-title);
  font-size: 25px;
}

.summary-score-meta,
.summary-score-direction {
  color: rgba(255, 255, 255, 0.78);
  font-size: 11px;
}

.summary-severity-track {
  height: 8px;
  margin: 18px 0 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
}

.summary-severity-track i {
  display: block;
  height: 100%;
  min-width: 0;
  border-radius: inherit;
  background: #fff;
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.48);
}

.summary-conclusion-block {
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: linear-gradient(145deg, #fff, var(--summary-soft));
}

.summary-conclusion-label {
  color: var(--summary-tone);
}

.summary-conclusion-block h2 {
  margin: 8px 0 10px;
  color: var(--summary-tone);
  font-family: var(--font-title);
  font-size: clamp(25px, 3vw, 38px);
  line-height: 1.2;
}

.summary-conclusion-block p {
  margin: 0;
  color: #344c51;
  font-size: 14px;
  line-height: 1.8;
}

.summary-clinical-note {
  margin-top: 16px;
  padding-top: 13px;
  border-top: 1px solid color-mix(in srgb, var(--summary-tone) 16%, transparent);
  color: #718186;
  font-size: 10px;
  line-height: 1.6;
}

.result-card {
  padding: 18px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(12, 16, 20, 0.08);
  box-shadow: 0 20px 30px rgba(14, 18, 22, 0.08);
}

.result-title {
  font-family: var(--font-title);
  font-size: 15px;
  line-height: 1.45;
  margin-bottom: 10px;
}

.result-rationale {
  margin-top: 12px;
  padding: 11px 12px;
  border-left: 3px solid rgba(11, 127, 117, 0.62);
  border-radius: 0 9px 9px 0;
  background: rgba(237, 246, 244, 0.72);
}

.result-rationale span {
  display: block;
  margin-bottom: 4px;
  color: #176b65;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.08em;
}

.result-rationale p {
  margin: 0;
  color: #40565b;
  font-size: 12px;
  line-height: 1.65;
}

.score {
  font-size: 30px;
  font-family: var(--font-title);
}

.footer {
  width: min(var(--content-max), calc(100vw - 72px));
  margin: 0 auto;
  padding: 20px 0 30px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(10, 14, 18, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 10;
}

.modal.show {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 20px;
  width: min(1800px, 96vw);
  height: min(1040px, 92vh);
  box-shadow: 0 30px 60px rgba(10, 14, 18, 0.3);
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.modal-title {
  font-family: var(--font-title);
  font-size: 18px;
}

.modal-subtitle {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.modal-body {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
  gap: 20px;
  flex: 1;
  min-height: 0;
}

.modal-video {
  position: relative;
  background: #111;
  border-radius: var(--radius-md);
  overflow: hidden;
  min-height: 520px;
}

.modal-video video,
.modal-video canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-video canvas {
  pointer-events: none;
  z-index: 3;
}

.hand-guide {
  position: absolute;
  bottom: 4%;
  z-index: 2;
  width: clamp(220px, 35%, 440px);
  pointer-events: none;
  filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.22));
  transition: left 0.25s ease, right 0.25s ease, opacity 0.25s ease;
}

.hand-guide.screen-left {
  left: 8%;
  right: auto;
}

.hand-guide.screen-right {
  right: 8%;
  left: auto;
}

.hand-guide svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.hand-guide.screen-left svg {
  transform: scaleX(-1);
}

.hand-guide svg > path:first-child {
  fill: rgba(71, 210, 193, 0.13);
  stroke: rgba(240, 255, 253, 0.9);
  stroke-width: 4;
  stroke-linejoin: round;
  stroke-linecap: round;
  stroke-dasharray: 12 9;
}

.hand-guide-label {
  position: absolute;
  left: 50%;
  bottom: -4px;
  padding: 5px 10px;
  border: 1px solid rgba(224, 255, 250, 0.48);
  border-radius: 999px;
  color: #f2fffc;
  background: rgba(5, 28, 31, 0.56);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  transform: translateX(-50%);
  backdrop-filter: blur(7px);
}

#preview.mirrored,
#landmarkOverlay.mirrored,
#playback.mirrored {
  transform: scaleX(-1);
}

.playback-controls {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 14px;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  color: #fff;
  background: rgba(5, 12, 17, 0.76);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(12px);
}

#playback.hidden + .playback-controls {
  display: none;
}

.playback-toggle {
  flex: 0 0 auto;
  min-width: 62px;
  height: 32px;
  border: 0;
  border-radius: 9px;
  color: #062b28;
  background: #67e1ce;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.playback-toggle:hover {
  background: #8aebdc;
}

.playback-seek {
  flex: 1 1 auto;
  min-width: 80px;
  accent-color: #67e1ce;
  cursor: pointer;
}

.playback-time {
  flex: 0 0 auto;
  min-width: 92px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

#playback:not(.hidden) ~ .landmark-status {
  bottom: 74px;
}

.timer {
  position: absolute;
  top: 14px;
  left: 14px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  z-index: 4;
}

.landmark-status {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 4;
  padding: 7px 11px;
  border-radius: 999px;
  color: #fff;
  background: rgba(0, 0, 0, 0.62);
  font-size: 12px;
  backdrop-filter: blur(8px);
}

.countdown-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: rgba(5, 10, 14, 0.34);
  font-family: var(--font-title);
  font-size: clamp(72px, 12vw, 180px);
  font-weight: 700;
  text-shadow: 0 8px 32px rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(2px);
}

.countdown-overlay.preparing {
  font-size: clamp(36px, 5vw, 72px);
}

.countdown-overlay.recording-guidance {
  inset: 24px auto auto 50%;
  width: max-content;
  max-width: calc(100% - 48px);
  min-height: 0;
  padding: 14px 28px;
  transform: translateX(-50%);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 18px;
  background: rgba(5, 18, 23, 0.78);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(12px);
  font-size: clamp(26px, 3vw, 44px);
  line-height: 1.2;
  text-align: center;
  pointer-events: none;
}

.countdown-overlay.recording-guidance.completed-guidance {
  border-color: rgba(87, 224, 199, 0.55);
  background: rgba(7, 65, 59, 0.88);
}

.countdown-overlay.hidden {
  display: none;
}

.modal-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
}

.recording-meta-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 12px;
}

.compact-info-block {
  min-width: 0;
}

.info-block {
  background: rgba(12, 16, 20, 0.04);
  padding: 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.info-label {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.camera-setting .info-label {
  display: block;
}

.camera-select {
  width: 100%;
  height: 40px;
  padding: 0 36px 0 11px;
  border: 1px solid rgba(12, 64, 70, 0.18);
  border-radius: 7px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  cursor: pointer;
}

.camera-select:focus {
  border-color: var(--accent);
  outline: 2px solid rgba(11, 113, 108, 0.16);
  outline-offset: 1px;
}

.camera-select:disabled {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.55);
  cursor: not-allowed;
}

.analysis-progress {
  height: 5px;
  margin-top: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(11, 82, 91, 0.12);
}

.analysis-progress span {
  display: block;
  width: 38%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  animation: analysis-loading 1.1s ease-in-out infinite;
}

@keyframes analysis-loading {
  from { transform: translateX(-110%); }
  to { transform: translateX(290%); }
}

.mirror-setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.mirror-description {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.switch-control {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  white-space: nowrap;
  cursor: pointer;
  font-weight: 600;
}

.switch-control input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch-track {
  width: 42px;
  height: 24px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(12, 16, 20, 0.2);
  transition: background 0.2s ease;
}

.switch-thumb {
  display: block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease;
}

.switch-control input:checked + .switch-track {
  background: var(--accent);
}

.switch-control input:checked + .switch-track .switch-thumb {
  transform: translateX(18px);
}

.switch-control input:focus-visible + .switch-track {
  outline: 3px solid rgba(11, 82, 91, 0.24);
  outline-offset: 2px;
}

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

.modal-actions input[type="file"] {
  display: none;
}

.kinematic-panel {
  margin-top: auto;
  padding: 14px;
  border: 1px solid rgba(11, 82, 91, 0.14);
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, rgba(11, 82, 91, 0.07), rgba(255, 255, 255, 0.92));
}

.kinematic-heading,
.kinematic-axis {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

#kinematicValue {
  color: var(--accent);
  font-family: var(--font-title);
  font-size: 18px;
}

#kinematicCanvas {
  position: static;
  display: block;
  width: 100%;
  height: 150px;
  margin-top: 10px;
  border-radius: 12px;
  background: #071b20;
}

.kinematic-panel.face-signals #kinematicCanvas {
  height: 200px;
}

.kinematic-panel.face-signals #kinematicValue {
  font-size: 14px;
  white-space: nowrap;
}

.kinematic-axis {
  margin-top: 6px;
  color: var(--muted);
  font-size: 10px;
}

.report-modal {
  z-index: 20;
}

.report-card {
  width: min(1500px, 96vw);
  height: min(1050px, 94vh);
  padding: 24px;
  border-radius: var(--radius-lg);
  background: #f7f9f8;
  box-shadow: 0 30px 80px rgba(10, 14, 18, 0.38);
  display: flex;
  flex-direction: column;
}

.report-header {
  flex: 0 0 auto;
}

.report-content {
  overflow-y: auto;
  padding-right: 8px;
}

.report-section {
  margin-bottom: 22px;
  padding: 22px;
  border-radius: var(--radius-md);
  background: #fff;
  border: 1px solid rgba(12, 16, 20, 0.07);
  box-shadow: 0 14px 35px rgba(14, 18, 22, 0.06);
}

.report-section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  font-family: var(--font-title);
  font-size: 20px;
}

.report-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #fff;
  background: var(--accent);
  font-size: 14px;
}

.report-media-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
  gap: 18px;
}

.report-video,
.event-diagnostic {
  display: block;
  width: 100%;
  max-height: 620px;
  border-radius: 14px;
  background: #071014;
  object-fit: contain;
}

.event-diagnostic {
  background: #fff;
}

.special-diagnostic {
  display: block;
  width: 100%;
  max-height: 560px;
  object-fit: contain;
  border: 1px solid rgba(12, 16, 20, 0.08);
  border-radius: 16px;
  background: #fff;
}

.probability-list {
  display: grid;
  gap: 9px;
  margin-top: 18px;
}

.probability-row {
  display: grid;
  grid-template-columns: 42px minmax(120px, 1fr) 52px;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.probability-row > div {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(11, 82, 91, 0.1);
}

.probability-row i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.support-plot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.support-plot-card {
  margin: 0;
  padding: 10px;
  border: 1px solid rgba(12, 16, 20, 0.08);
  border-radius: 14px;
  background: #f8faf9;
}

.support-plot-card img {
  display: block;
  width: 100%;
  max-height: 520px;
  object-fit: contain;
  border-radius: 9px;
  background: #fff;
}

.support-plot-card figcaption {
  padding: 9px 4px 2px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.support-visual-list {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.support-event-visual {
  overflow: hidden;
  border: 1px solid rgba(12, 16, 20, 0.09);
  border-radius: 16px;
  background: linear-gradient(145deg, #ffffff, #f5f9f8);
  box-shadow: 0 10px 28px rgba(16, 55, 58, 0.06);
}

.support-event-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 18px;
  border-bottom: 1px solid rgba(12, 16, 20, 0.07);
  background: rgba(11, 82, 91, 0.045);
}

.support-event-header > div {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.support-event-header span {
  color: var(--muted);
  font-size: 12px;
}

.support-pose-section {
  padding: 16px 16px 2px;
}

.support-pose-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 2px 11px;
}

.support-pose-title strong {
  color: #18383d;
  font-size: 14px;
}

.support-pose-title span {
  color: var(--muted);
  font-size: 11px;
}

.support-pose-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 11px;
}

.support-pose-frame {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(12, 16, 20, 0.08);
  border-radius: 12px;
  background: #fff;
}

.support-pose-canvas-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: linear-gradient(135deg, #eaf1f0, #f7f9f8);
}

.support-pose-frame canvas {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 180ms ease;
}

.support-pose-frame.is-ready canvas {
  opacity: 1;
}

.support-pose-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  color: #6f8588;
  font-size: 11px;
  text-align: center;
}

.support-pose-frame.is-ready .support-pose-loading {
  display: none;
}

.support-pose-frame figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 11px;
  color: #29474c;
  font-size: 11px;
}

.support-pose-frame figcaption span {
  color: var(--muted);
}

.support-overall-pill,
.support-decision-pill {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  white-space: nowrap;
}

.support-overall-pill.is-supported,
.support-hand-card.is-supported .support-decision-pill {
  color: #a33a29;
  background: #fff0ec;
}

.support-overall-pill.is-free,
.support-hand-card.is-free .support-decision-pill {
  color: #147263;
  background: #e9f7f2;
}

.support-hands-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 16px;
}

.support-hand-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(12, 16, 20, 0.07);
  border-radius: 13px;
  background: #fff;
}

.support-hand-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}

.support-hand-header > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.support-hand-side {
  color: #18383d;
  font-family: var(--font-title);
  font-size: 17px;
  font-weight: 700;
}

.support-hand-header small {
  color: var(--muted);
}

.support-metric + .support-metric {
  margin-top: 14px;
}

.support-metric-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.support-metric-heading {
  margin-bottom: 7px;
  color: #40575c;
  font-size: 12px;
}

.support-metric-heading strong {
  color: #173f45;
  font-size: 14px;
}

.support-gauge {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: #e7edec;
}

.support-gauge-safe {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--threshold-position);
  border-radius: inherit 0 0 inherit;
  background: #ccebe2;
}

.support-gauge-threshold {
  position: absolute;
  top: -3px;
  bottom: -3px;
  left: var(--threshold-position);
  width: 2px;
  border-radius: 2px;
  background: #0b7f75;
}

.support-gauge-value {
  position: absolute;
  top: 50%;
  left: var(--value-position);
  width: 14px;
  height: 14px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #e36c4b;
  box-shadow: 0 1px 5px rgba(20, 45, 48, 0.24);
  transform: translate(-50%, -50%);
}

.support-metric.is-pass .support-gauge-value {
  background: #148373;
}

.support-metric-note {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
}

.support-clinical-note {
  min-height: 44px;
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px dashed rgba(12, 16, 20, 0.11);
  color: #53676b;
  font-size: 12px;
  line-height: 1.65;
}

.arising-table {
  max-height: 300px;
}

.event-report-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(340px, 0.55fr);
  align-items: start;
  gap: 20px;
}

.arising-event-layout .event-details {
  gap: 14px;
}

.arising-event-layout {
  grid-template-columns: minmax(0, 1.15fr) minmax(460px, 0.85fr);
}

.arising-event-layout .event-table-wrap {
  margin-top: 0;
}

.arising-event-layout .event-table th,
.arising-event-layout .event-table td {
  padding: 9px 8px;
  white-space: nowrap;
}

.event-visual {
  display: flex;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  aspect-ratio: 16 / 9;
  padding: 8px;
  border: 1px solid rgba(12, 16, 20, 0.08);
  border-radius: 16px;
  background: #fff;
}

.event-visual .event-diagnostic {
  height: 100%;
  max-height: none;
  object-fit: contain;
}

.event-details {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
}

.event-details .event-table-wrap {
  flex: 1 1 0;
  min-height: 120px;
  max-height: none;
}

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

.event-summary-grid,
.feature-kpi-grid,
.score-breakdown {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.report-kpi {
  padding: 14px;
  border-radius: 12px;
  background: rgba(11, 82, 91, 0.06);
}

.report-kpi-label {
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 6px;
}

.report-kpi-value {
  color: var(--accent);
  font-family: var(--font-title);
  font-size: 22px;
}

.feature-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.feature-chart-card {
  padding: 14px;
  border-radius: 14px;
  background: #f4f7f6;
}

.feature-chart-card canvas {
  width: 100%;
  height: 220px;
}

.score-hero {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  align-items: center;
  gap: 24px;
}

.score-orb {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: conic-gradient(var(--accent) var(--score-angle, 0deg), #dfe9e7 0);
  box-shadow: inset 0 0 0 18px rgba(255, 255, 255, 0.22);
}

.score-orb strong {
  font-size: 52px;
  line-height: 1;
}

.score-explanation {
  line-height: 1.8;
  color: #34454b;
}

.score-rule-reference {
  margin: 14px 0 0;
  padding: 11px 14px;
  border-left: 3px solid rgba(11, 127, 117, 0.42);
  border-radius: 0 10px 10px 0;
  background: rgba(11, 127, 117, 0.06);
  color: #52646b;
  font-size: 13px;
  line-height: 1.65;
}

.report-downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

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

.capture-video-grid figure {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(12, 16, 20, 0.08);
  border-radius: 14px;
  background: #fff;
}

.capture-video-grid figcaption {
  padding: 10px 13px;
  color: #29474c;
  font-size: 12px;
  font-weight: 700;
}

.capture-only-notice {
  border-left: 4px solid #d89032;
  background: #fffaf1;
}

.capture-only-notice h2 {
  margin: 4px 0 8px;
  color: #704916;
}

@media (max-width: 760px) {
  .capture-video-grid {
    grid-template-columns: 1fr;
  }
}

.face-report-note { margin: 12px 0 0; }

.face-diagnostic-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(230px, 0.65fr);
  gap: 18px;
  align-items: start;
}

.face-diagnostic-plot {
  display: block;
  width: 100%;
  border: 1px solid rgba(12, 16, 20, 0.08);
  border-radius: 14px;
  background: #f7faf9;
  box-shadow: 0 12px 28px rgba(14, 46, 50, 0.07);
}

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

.face-rule-callout {
  grid-column: 1 / -1;
  padding: 12px 13px;
  border: 1px solid rgba(18, 117, 102, 0.18);
  border-radius: 11px;
  color: #31585a;
  background: #eef8f5;
  font-size: 12px;
  line-height: 1.65;
}

.face-rule-callout.is-alert {
  border-color: rgba(202, 96, 58, 0.25);
  color: #85462f;
  background: #fff3ee;
}

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

.face-state-ratio {
  padding: 14px;
  border: 1px solid rgba(12, 16, 20, 0.075);
  border-radius: 13px;
  background: linear-gradient(145deg, #fff, #f5f9f8);
}

.face-state-ratio-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #284a4f;
  font-size: 13px;
}

.face-state-ratio-heading span {
  color: #173f45;
  font-size: 18px;
  font-weight: 750;
}

.face-state-ratio-track {
  overflow: hidden;
  height: 10px;
  margin: 11px 0 9px;
  border-radius: 999px;
  background: #e3ecea;
}

.face-state-ratio-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #dc843f;
}

.face-state-ratio.rest-open .face-state-ratio-track i { background: #d15f46; }
.face-state-ratio.mouth-active .face-state-ratio-track i { background: #7569ac; }

.face-state-ratio p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.face-state-tables {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.face-state-tables h3 {
  margin: 0 0 8px;
  color: #294d52;
  font-size: 14px;
}

.face-threshold-note {
  margin-top: 14px;
  padding: 12px 14px;
  border-left: 4px solid #5f70a5;
  border-radius: 0 10px 10px 0;
  color: #46575c;
  background: #f1f3f9;
  font-size: 12px;
  line-height: 1.7;
}

.facial-score-scale {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
  margin-top: 18px;
}

.facial-score-scale span {
  padding: 9px 7px;
  border-radius: 9px;
  color: #426065;
  background: #eef3f2;
  font-size: 10px;
  line-height: 1.4;
  text-align: center;
}

.facial-score-scale span:nth-child(2) { background: #eef7f2; }
.facial-score-scale span:nth-child(3) { background: #fff7e7; }
.facial-score-scale span:nth-child(4) { background: #fff0e6; }
.facial-score-scale span:nth-child(5) { background: #fde9e5; }

.report-summary-spacing {
  margin-top: 16px;
}

.event-table-wrap {
  margin-top: 16px;
  max-height: 280px;
  overflow: auto;
  border: 1px solid rgba(12, 16, 20, 0.08);
  border-radius: 12px;
  background: #fff;
  isolation: isolate;
}

.event-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
}

.event-table th,
.event-table td {
  padding: 10px 12px;
  text-align: center;
  border-bottom: 1px solid rgba(12, 16, 20, 0.06);
}

.event-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  color: var(--accent);
  background: #edf4f3;
  font-weight: 700;
  box-shadow: 0 1px 0 rgba(12, 16, 20, 0.1);
}

.event-table td {
  background: #fff;
}

.report-open-btn {
  margin-top: 12px;
}

.hidden {
  display: none;
}

.muted {
  color: var(--muted);
}

@media (max-width: 1280px) {
  .assessment-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1160px) {
  .nav {
    gap: 14px;
    flex-wrap: wrap;
  }

  .nav .ghost-btn {
    margin-left: auto;
  }

  .summary-overview {
    grid-template-columns: minmax(260px, 0.9fr) minmax(0, 1.1fr);
  }

  .assessment-card {
    padding: 16px;
  }

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

  .assessment-action-buttons {
    justify-content: flex-start;
  }
}

@media (max-width: 860px) {
  .nav {
    flex-direction: column;
    gap: 14px;
    padding-top: 18px;
  }

  .nav-links {
    flex-wrap: wrap;
    justify-content: center;
    margin: 0;
  }

  .hero {
    padding-top: 30px;
  }

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

  .hand-guide {
    bottom: 5%;
    width: clamp(180px, 34%, 300px);
  }

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

  .progress-meta > .secondary-btn {
    width: 100%;
    text-align: left;
  }

  .modal-card {
    width: 96vw;
    height: 94vh;
  }

  .modal-body {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }

  .modal-video {
    min-height: 50vh;
  }

  .report-media-grid,
  .event-report-layout,
  .feature-chart-grid,
  .score-hero {
    grid-template-columns: 1fr;
  }

  .face-diagnostic-layout,
  .face-state-ratio-grid,
  .face-state-tables {
    grid-template-columns: 1fr;
  }

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

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

  .event-details .event-table-wrap {
    flex: none;
    min-height: 0;
    max-height: 280px;
  }

  .support-hands-grid {
    grid-template-columns: 1fr;
  }

  .support-pose-strip {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 620px) {
  .summary-overview {
    grid-template-columns: 1fr;
  }

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

  main,
  .footer {
    width: min(var(--content-max), calc(100vw - 32px));
  }

  .hero,
  .assessments,
  .results {
    padding-top: 18px;
  }

  .hero-panel,
  .assessment-card,
  .result-card,
  .report-section {
    border-radius: 16px;
  }

  .assessment-title {
    font-size: 15px;
  }

  .assessment-header > .muted,
  .status {
    font-size: 12px;
  }

  .assessment-action-buttons {
    width: 100%;
  }

  .assessment-action-buttons .secondary-btn {
    flex: 1 1 160px;
    justify-content: center;
  }

  .modal {
    padding: 10px;
  }

  .modal-card,
  .report-card {
    padding: 14px;
  }

  .modal-header,
  .report-header {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 12px;
  }
}

@media (max-width: 480px) {
  .brand {
    width: 100%;
  }

  .brand-title {
    letter-spacing: 0.02em;
  }

  .nav .ghost-btn,
  .hero-actions .primary-btn,
  .hero-actions .secondary-btn,
  .panel-actions .primary-btn {
    width: 100%;
  }

  .hero-actions {
    flex-direction: column;
  }

  .badge {
    max-width: 100%;
    white-space: normal;
  }

  .assessment-side-meta {
    flex-direction: column;
    gap: 6px;
  }

  .recording-meta-grid,
  .face-diagnostic-summary,
  .event-details .event-summary-grid {
    grid-template-columns: 1fr;
  }
}
