:root {
  color-scheme: dark;
  --bg: #0a0e0d;
  --bg-soft: #0f1513;
  --panel: #121a17;
  --panel-2: #17211d;
  --ink: #f3f7f1;
  --muted: #a7b3aa;
  --faint: #748079;
  --line: rgba(225, 242, 228, 0.11);
  --line-strong: rgba(225, 242, 228, 0.2);
  --lime: #c8f37d;
  --lime-ink: #1c2a0c;
  --mint: #67d8c2;
  --amber: #f2bf73;
  --red: #ff8f7d;
  --radius: 20px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(1000px 520px at 10% -10%, rgba(103, 216, 194, 0.13), transparent 60%),
    radial-gradient(800px 500px at 100% 8%, rgba(200, 243, 125, 0.08), transparent 55%),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 3px;
}

.shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding-bottom: 32px;
}

.topbar {
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}

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

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--lime);
  color: var(--lime-ink);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.08em;
}

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

.brand strong {
  font-size: 16px;
  letter-spacing: 0.14em;
}

.brand small {
  color: var(--muted);
  font-size: 11px;
  margin-top: 2px;
}

.topbar-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

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

.share-page {
  min-height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--mint);
  cursor: pointer;
  font-size: 11px;
}

.share-page:hover {
  border-color: var(--mint);
  background: rgba(103, 216, 194, 0.07);
}

.compat-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(242, 191, 115, 0.32);
  border-radius: 12px;
  background: rgba(242, 191, 115, 0.075);
}

.compat-notice strong,
.compat-notice span {
  display: block;
}

.compat-notice strong {
  color: var(--amber);
  font-size: 12px;
}

.compat-notice span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.compat-notice button {
  flex: 0 0 auto;
  min-height: 32px;
  border: 1px solid rgba(242, 191, 115, 0.36);
  border-radius: 8px;
  padding: 0 10px;
  background: transparent;
  color: var(--amber);
  cursor: pointer;
  font-size: 10px;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 4px rgba(103, 216, 194, 0.1);
}

.hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 48px;
  padding: 64px 0 44px;
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--mint);
  font: 600 11px/1.3 var(--mono);
  letter-spacing: 0.14em;
}

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

h1 {
  max-width: 760px;
  margin-bottom: 20px;
  font-size: clamp(36px, 5.6vw, 68px);
  line-height: 1.05;
  letter-spacing: -0.045em;
  font-weight: 650;
}

h1 span {
  color: var(--lime);
}

.hero-copy {
  max-width: 660px;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
}

.hero-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(74px, 1fr));
  gap: 8px;
  min-width: 300px;
}

.hero-meta div {
  padding: 16px 12px;
  border-left: 1px solid var(--line-strong);
}

.hero-meta strong,
.hero-meta span {
  display: block;
}

.hero-meta strong {
  color: var(--lime);
  font: 600 24px/1 var(--mono);
}

.hero-meta span {
  margin-top: 8px;
  color: var(--faint);
  font-size: 11px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 16px;
  align-items: start;
}

.panel {
  position: relative;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 28%), var(--panel);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.22);
}

.input-panel {
  padding: 24px;
}

.report-panel {
  min-height: 700px;
  padding: 24px;
}

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

.panel-heading > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-heading h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
}

.step {
  color: var(--lime);
  font: 600 11px/1 var(--mono);
}

.panel-hint {
  color: var(--faint);
  font: 500 10px/1 var(--mono);
  letter-spacing: 0.08em;
}

.dropzone {
  min-height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 28px;
  border: 1px dashed var(--line-strong);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.015);
  cursor: pointer;
  text-align: center;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.dropzone:hover,
.dropzone.is-dragging {
  border-color: var(--mint);
  background: rgba(103, 216, 194, 0.05);
}

.dropzone:active {
  transform: scale(0.995);
}

.drop-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin-bottom: 4px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--lime);
  background: rgba(200, 243, 125, 0.07);
}

.dropzone p {
  margin: 0;
  font-size: 14px;
}

.dropzone p strong {
  color: var(--lime);
}

.dropzone > span {
  max-width: 360px;
  color: var(--faint);
  font-size: 12px;
  line-height: 1.6;
}

.sample-button {
  margin-top: 8px;
  border: 0;
  padding: 5px 0;
  background: transparent;
  color: var(--mint);
  cursor: pointer;
  font-size: 11px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.sample-button:hover {
  color: var(--lime);
}

.preview {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #050706;
}

.video-wrap {
  position: relative;
  aspect-ratio: 16 / 10;
  background: #050706;
}

.video-wrap video,
.video-wrap canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.video-wrap video {
  object-fit: contain;
  background: #050706;
}

.video-wrap canvas {
  pointer-events: none;
}

.video-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 6px 9px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(5, 7, 6, 0.72);
  color: var(--muted);
  font: 500 10px/1 var(--mono);
  backdrop-filter: blur(8px);
}

.video-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 14px;
  border-top: 1px solid var(--line);
}

.video-meta > div {
  min-width: 0;
  flex: 1;
}

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

.video-meta strong {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.video-meta span {
  margin-top: 4px;
  color: var(--faint);
  font: 10px/1.3 var(--mono);
}

.text-button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--mint);
  cursor: pointer;
  font-size: 12px;
}

.text-button:hover {
  color: var(--lime);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.settings {
  display: grid;
  gap: 18px;
  padding: 20px 0 18px;
}

.setting-label {
  display: block;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 11px;
}

.segmented {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.14);
}

.segmented button {
  border: 0;
  border-radius: 7px;
  padding: 8px 16px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
}

.segmented button.is-active {
  background: var(--ink);
  color: var(--bg);
}

.setting-help {
  margin: 9px 0 0;
  color: var(--faint);
  font-size: 11px;
  line-height: 1.6;
}

.setting-row {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.field select {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0 30px 0 10px;
  background: var(--bg-soft);
  color: var(--ink);
  font-size: 12px;
}

.small-input {
  width: 118px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0 10px;
  background: var(--bg-soft);
  color: var(--ink);
  font-size: 12px;
}

.small-input::placeholder {
  color: var(--faint);
}

.context-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 18px;
}

.pain-check {
  padding-bottom: 8px;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}

.check input {
  accent-color: var(--lime);
}

.primary-button {
  width: 100%;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 0;
  border-radius: 12px;
  padding: 0 18px;
  background: var(--lime);
  color: var(--lime-ink);
  cursor: pointer;
  font-weight: 650;
  font-size: 14px;
  transition: transform 160ms ease, opacity 160ms ease;
}

.primary-button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.primary-button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.button-icon {
  font-size: 18px;
}

.progress-wrap {
  padding-top: 16px;
}

.progress-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
}

.progress-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.progress-track {
  height: 5px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--mint), var(--lime));
  transition: width 180ms ease;
}

.privacy-note {
  display: flex;
  gap: 7px;
  margin: 16px 0 0;
  color: var(--faint);
  font-size: 10px;
  line-height: 1.6;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 0 9px;
  border-radius: 999px;
  font: 600 10px/1 var(--mono);
}

.badge-muted {
  background: rgba(255, 255, 255, 0.05);
  color: var(--faint);
}

.badge-high {
  background: rgba(200, 243, 125, 0.12);
  color: var(--lime);
}

.badge-medium {
  background: rgba(242, 191, 115, 0.12);
  color: var(--amber);
}

.badge-low {
  background: rgba(255, 143, 125, 0.12);
  color: var(--red);
}

.empty-report {
  min-height: 600px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.empty-report h3 {
  margin: 24px 0 8px;
  font-size: 16px;
  font-weight: 500;
}

.empty-report p {
  max-width: 340px;
  margin: 0;
  color: var(--faint);
  font-size: 12px;
  line-height: 1.8;
}

.empty-figure {
  width: 120px;
  height: 160px;
  position: relative;
  opacity: 0.55;
}

.empty-figure span {
  position: absolute;
  display: block;
  width: 8px;
  height: 8px;
  border: 1px solid var(--mint);
  border-radius: 50%;
  background: var(--panel);
}

.empty-figure span:nth-child(1) { left: 56px; top: 4px; }
.empty-figure span:nth-child(2) { left: 32px; top: 44px; }
.empty-figure span:nth-child(3) { left: 80px; top: 44px; }
.empty-figure span:nth-child(4) { left: 40px; top: 104px; }
.empty-figure span:nth-child(5) { left: 72px; top: 104px; }

.empty-figure::before,
.empty-figure::after {
  content: "";
  position: absolute;
  display: block;
  border-color: rgba(103, 216, 194, 0.45);
  border-style: solid;
  transform-origin: top left;
}

.empty-figure::before {
  left: 37px;
  top: 48px;
  width: 52px;
  height: 1px;
  border-width: 1px 0 0;
}

.empty-figure::after {
  left: 57px;
  top: 12px;
  width: 1px;
  height: 96px;
  border-width: 0 0 0 1px;
  transform: rotate(9deg);
}

.report-summary {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.report-kicker {
  color: var(--mint);
  font: 600 10px/1 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.report-summary h3 {
  margin: 10px 0 7px;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.report-summary p {
  max-width: 430px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.report-grade {
  flex: 0 0 92px;
  min-height: 92px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: rgba(200, 243, 125, 0.04);
}

.report-grade strong {
  color: var(--lime);
  font: 600 26px/1 var(--mono);
}

.report-grade span {
  margin-top: 7px;
  color: var(--faint);
  font-size: 9px;
}

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

.metric-card {
  min-height: 90px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.018);
}

.metric-card.is-good {
  border-color: rgba(200, 243, 125, 0.18);
}

.metric-card.is-watch {
  border-color: rgba(242, 191, 115, 0.22);
}

.metric-card.is-note {
  border-color: rgba(255, 143, 125, 0.18);
}

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

.metric-card span {
  color: var(--faint);
  font-size: 10px;
}

.metric-card strong {
  margin-top: 12px;
  font: 600 21px/1 var(--mono);
  color: var(--ink);
}

.metric-card small {
  margin-top: 7px;
  color: var(--faint);
  font-size: 10px;
  line-height: 1.45;
}

.report-section {
  padding-top: 22px;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.section-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.section-head span {
  color: var(--faint);
  font-size: 10px;
}

.suggestions {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.suggestion-item {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 10px;
  padding: 13px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.018);
}

.suggestion-index {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: rgba(200, 243, 125, 0.13);
  color: var(--lime);
  font: 600 10px/1 var(--mono);
}

.suggestion-copy strong,
.suggestion-copy span {
  display: block;
}

.suggestion-copy strong {
  font-size: 12px;
  font-weight: 600;
}

.suggestion-copy span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
}

.suggestion-copy em {
  display: inline-block;
  margin-top: 6px;
  color: var(--faint);
  font: normal 10px/1.5 var(--mono);
}

.motion-reel {
  margin-bottom: 10px;
}

.keyframe-stage {
  position: relative;
  width: 100%;
  max-height: 520px;
  display: block;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background:
    radial-gradient(400px 260px at 50% 44%, rgba(200, 243, 125, 0.08), transparent 70%),
    #050706;
  cursor: zoom-in;
}

.keyframe-stage img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.keyframe-stage-time,
.keyframe-stage-model,
.keyframe-stage-hint {
  position: absolute;
  z-index: 1;
  border-radius: 5px;
  background: rgba(5, 7, 6, 0.82);
  backdrop-filter: blur(8px);
}

.keyframe-stage-time {
  top: 9px;
  left: 9px;
  padding: 5px 7px;
  color: var(--ink);
  font: 600 10px/1 var(--mono);
}

.keyframe-stage-model {
  top: 9px;
  right: 9px;
  padding: 5px 7px;
  color: var(--mint);
  font: 8px/1 var(--mono);
  letter-spacing: 0.04em;
}

.keyframe-stage-hint {
  left: 9px;
  bottom: 9px;
  max-width: calc(100% - 18px);
  overflow: hidden;
  padding: 6px 8px;
  color: var(--lime);
  font: 9px/1.25 var(--mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.keyframe-reel-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 7px;
}

.keyframe-play {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(200, 243, 125, 0.24);
  border-radius: 999px;
  padding: 0 11px;
  background: rgba(200, 243, 125, 0.07);
  color: var(--lime);
  cursor: pointer;
}

.keyframe-play span {
  width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--lime);
  color: var(--lime-ink);
  font: 700 8px/1 var(--mono);
}

.keyframe-play strong {
  font-size: 10px;
  font-weight: 600;
}

.keyframe-play.is-playing {
  border-color: var(--amber);
  color: var(--amber);
  background: rgba(242, 191, 115, 0.08);
}

.keyframe-play.is-playing span {
  background: var(--amber);
  color: #2b1b05;
}

.keyframe-counter {
  color: var(--faint);
  font: 9px/1 var(--mono);
}

.keyframes {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 2px 1px 7px;
  scrollbar-width: thin;
  scroll-snap-type: x proximity;
}

.keyframe {
  position: relative;
  flex: 0 0 88px;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 9px;
  background: #050706;
  cursor: pointer;
  scroll-snap-align: center;
  opacity: 0.72;
  transition: opacity 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.keyframe:hover {
  opacity: 1;
}

.keyframe.is-active {
  border-color: var(--lime);
  opacity: 1;
  transform: translateY(-2px);
}

.keyframe img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.keyframe span {
  position: absolute;
  left: 7px;
  bottom: 6px;
  padding: 3px 5px;
  border-radius: 4px;
  background: rgba(5, 7, 6, 0.7);
  color: var(--ink);
  font: 9px/1 var(--mono);
}

.keyframe .keyframe-model {
  left: auto;
  right: 7px;
  bottom: 6px;
  font-size: 8px;
  letter-spacing: 0.04em;
}

.keyframe .keyframe-model.is-full {
  color: var(--lime);
}

.keyframe .keyframe-model.is-lite {
  color: var(--faint);
}

.ai-section {
  margin-top: 22px;
  padding: 16px;
  border: 1px solid rgba(103, 216, 194, 0.16);
  border-radius: 13px;
  background: rgba(103, 216, 194, 0.035);
}

.ai-section .section-head {
  margin-bottom: 8px;
}

.ai-copy {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.export-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 13px;
}

.secondary-button {
  min-height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  cursor: pointer;
  font-size: 11px;
}

.secondary-button:hover {
  border-color: var(--mint);
}

.primary-small {
  min-height: 36px;
  border: 0;
  border-radius: 8px;
  padding: 0 13px;
  background: var(--lime);
  color: var(--lime-ink);
  cursor: pointer;
  font-size: 11px;
  font-weight: 650;
}

.primary-small:disabled {
  opacity: 0.5;
  cursor: wait;
}

.ai-privacy {
  margin: 10px 0 0;
  color: var(--faint);
  font-size: 10px;
  line-height: 1.6;
}

.export-hint {
  min-height: 16px;
  margin: 9px 0 0;
  color: var(--lime);
  font-size: 10px;
}

.refine-summary {
  margin-top: 10px;
  padding: 9px 10px;
  border: 1px solid rgba(103, 216, 194, 0.16);
  border-radius: 8px;
  color: var(--mint);
  font: 10px/1.6 var(--mono);
}

.coach-card {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.coach-visual {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  background: #050706;
}

.coach-visual canvas {
  width: 100%;
  height: auto;
  display: block;
}

.coach-frame-label {
  position: absolute;
  top: 9px;
  left: 9px;
  padding: 4px 7px;
  border-radius: 5px;
  background: rgba(5, 7, 6, 0.76);
  color: var(--lime);
  font: 10px/1 var(--mono);
}

.coach-headline {
  margin: 14px 0 10px;
  font-size: 18px;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.coach-issues {
  display: grid;
  gap: 7px;
}

.coach-issue {
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr);
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.018);
}

.coach-issue-number {
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--lime);
  color: var(--lime-ink);
  font: 700 10px/1 var(--mono);
}

.coach-issue-copy strong,
.coach-issue-copy p,
.coach-issue-copy em {
  display: block;
}

.coach-issue-copy strong {
  font-size: 12px;
  font-weight: 650;
}

.coach-issue-copy p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.coach-issue-copy em {
  margin-top: 5px;
  color: var(--mint);
  font: normal 10px/1.45 var(--mono);
}

.coach-issue-evidence {
  display: block;
  margin-top: 7px;
  padding-top: 6px;
  border-top: 1px dashed var(--line);
  color: var(--faint);
  font: 9px/1.5 var(--mono);
}

.coach-limitations {
  margin: 10px 0 0;
  color: var(--faint);
  font-size: 10px;
  line-height: 1.6;
}

.coach-practice {
  margin-top: 12px;
  padding: 13px;
  border: 1px solid rgba(200, 243, 125, 0.2);
  border-radius: 10px;
  background: rgba(200, 243, 125, 0.055);
}

.coach-practice > span,
.coach-chat-head > div > span {
  color: var(--lime);
  font: 600 9px/1.2 var(--mono);
  letter-spacing: 0.07em;
}

.coach-practice h4 {
  margin: 8px 0 10px;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.4;
}

.coach-practice ol {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 22px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.coach-practice p {
  margin: 10px 0 0;
  padding-top: 9px;
  border-top: 1px solid rgba(200, 243, 125, 0.14);
  color: var(--mint);
  font-size: 10px;
  line-height: 1.6;
}

.practice-start {
  --practice-progress: 0%;
  width: 100%;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 10px;
  border: 1px solid rgba(200, 243, 125, 0.25);
  border-radius: 12px;
  background: rgba(5, 7, 6, 0.26);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.practice-start:hover {
  border-color: var(--lime);
  background: rgba(200, 243, 125, 0.075);
}

.practice-ring {
  position: relative;
  width: 52px;
  height: 52px;
  display: grid;
  place-content: center;
  justify-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--lime) var(--practice-progress), rgba(255, 255, 255, 0.11) 0);
  box-shadow: 0 0 24px rgba(200, 243, 125, 0.08);
}

.practice-ring::before {
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: #18221a;
  content: "";
}

.practice-ring strong,
.practice-ring small {
  position: relative;
  z-index: 1;
  display: block;
}

.practice-ring strong {
  font: 650 17px/1 var(--mono);
}

.practice-ring small {
  margin-top: 2px;
  color: var(--faint);
  font-size: 7px;
}

.practice-start.is-running .practice-ring {
  animation: practice-pulse 1.2s ease-in-out infinite;
}

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

.practice-start-copy strong {
  color: var(--lime);
  font-size: 12px;
}

.practice-start-copy small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

@keyframes practice-pulse {
  50% {
    box-shadow: 0 0 0 6px rgba(200, 243, 125, 0.06), 0 0 28px rgba(200, 243, 125, 0.15);
  }
}

.coach-chat {
  margin-top: 16px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}

.coach-chat-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
}

.coach-chat-head h4 {
  margin: 6px 0 0;
  font-size: 15px;
}

.coach-chat-head > span {
  color: var(--faint);
  font: 9px/1 var(--mono);
}

.chat-messages {
  display: grid;
  gap: 8px;
  max-height: 560px;
  overflow-y: auto;
  margin-top: 12px;
  padding: 2px;
  scrollbar-width: thin;
}

.chat-empty {
  margin: 0;
  padding: 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 9px;
  color: var(--faint);
  font-size: 10px;
  line-height: 1.65;
}

.chat-message {
  width: fit-content;
  max-width: 88%;
  margin: 0;
  padding: 9px 11px;
  border-radius: 10px;
  overflow-wrap: anywhere;
  font-size: 11px;
  line-height: 1.65;
}

.chat-copy {
  margin: 0;
  white-space: pre-wrap;
}

.chat-visual {
  overflow: hidden;
  margin: 0 0 9px;
  border: 1px solid rgba(200, 243, 125, 0.18);
  border-radius: 9px;
  background: #050706;
}

.chat-visual canvas {
  width: 100%;
  height: auto;
  display: block;
}

.compare-block {
  overflow: hidden;
  background: #050706;
}

.compare-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  padding: 7px;
  background: #050706;
}

.compare-pane {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  cursor: zoom-in;
}

.compare-pane.is-reference {
  border-color: rgba(103, 216, 194, 0.2);
}

.compare-media {
  position: relative;
  aspect-ratio: 3 / 4;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #050706;
}

.compare-media canvas,
.compare-media img {
  width: 100%;
  height: 100%;
  display: block;
}

.compare-media img {
  object-fit: contain;
}

.compare-pane-label {
  position: absolute;
  top: 6px;
  left: 6px;
  padding: 3px 5px;
  border-radius: 4px;
  background: rgba(5, 7, 6, 0.84);
  color: var(--lime);
  font: 8px/1 var(--mono);
}

.compare-pane.is-reference .compare-pane-label {
  color: var(--mint);
}

.compare-pane-copy {
  margin: 0;
  padding: 7px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.compare-summary {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  padding: 7px 9px 3px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.compare-source-line {
  display: block;
  overflow: hidden;
  padding: 2px 9px 8px;
  color: var(--faint);
  font: 8px/1.4 var(--mono);
  text-overflow: ellipsis;
  text-decoration: none;
  white-space: nowrap;
}

.compare-source-line:hover {
  color: var(--mint);
  text-decoration: underline;
}

.compare-source {
  display: block;
  padding: 0 7px 7px;
  color: var(--faint);
  font: 8px/1.4 var(--mono);
  text-decoration: none;
}

.compare-source:hover {
  color: var(--mint);
  text-decoration: underline;
}

.image-viewer {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
}

.image-viewer-panel {
  position: relative;
  width: min(920px, 100%);
  max-height: calc(100dvh - 36px);
  display: grid;
  justify-items: center;
  gap: 10px;
}

.image-viewer-panel img {
  max-width: 100%;
  max-height: calc(100dvh - 110px);
  display: block;
  object-fit: contain;
  border-radius: 12px;
  background: #050706;
}

.image-viewer-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
  text-align: center;
}

.image-viewer-close {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  right: 16px;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: rgba(10, 14, 13, 0.9);
  color: var(--ink);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.chat-visual figcaption {
  padding: 7px 8px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font: 9px/1.5 var(--mono);
}

.chat-message.is-user {
  justify-self: end;
  border-bottom-right-radius: 3px;
  background: var(--lime);
  color: var(--lime-ink);
}

.chat-message.is-assistant {
  justify-self: start;
  border: 1px solid var(--line);
  border-bottom-left-radius: 3px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--ink);
}

.chat-message.is-error {
  border-color: rgba(255, 143, 125, 0.3);
  background: rgba(255, 143, 125, 0.07);
  color: var(--red);
}

.chat-message.is-pending {
  color: var(--muted);
}

.chat-starters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.chat-starters button {
  min-height: 28px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 9px;
}

.chat-starters button:hover {
  border-color: var(--mint);
  color: var(--mint);
}

.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 7px;
  margin-top: 10px;
}

.chat-form textarea {
  width: 100%;
  min-height: 48px;
  max-height: 120px;
  resize: vertical;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  padding: 10px 11px;
  background: rgba(0, 0, 0, 0.2);
  color: var(--ink);
  outline: none;
  font-size: 11px;
  line-height: 1.55;
}

.chat-form textarea:focus {
  border-color: var(--mint);
}

.chat-form textarea::placeholder {
  color: var(--faint);
}

.chat-form button {
  min-width: 58px;
  min-height: 48px;
  border: 0;
  border-radius: 9px;
  background: var(--lime);
  color: var(--lime-ink);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.chat-form button:disabled {
  opacity: 0.5;
  cursor: wait;
}

.chat-privacy {
  margin: 8px 0 0;
  color: var(--faint);
  font-size: 9px;
  line-height: 1.6;
}

.ai-output {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.ai-output-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.ai-output-head strong {
  color: var(--mint);
  font-size: 11px;
}

.ai-output-head span {
  color: var(--faint);
  font-size: 9px;
}

.ai-output pre {
  max-height: 420px;
  overflow: auto;
  margin: 0;
  padding: 12px;
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.2);
  color: var(--ink);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 11px/1.75 var(--sans);
}

.safety-note {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.safety-note strong {
  color: var(--amber);
  font-size: 11px;
}

.safety-note p {
  margin: 7px 0 0;
  color: var(--faint);
  font-size: 10px;
  line-height: 1.7;
}

.howto {
  padding: 72px 0 40px;
}

.howto-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 24px;
}

.howto-head .eyebrow {
  margin-bottom: 8px;
}

.howto-head h2 {
  margin: 0;
  font-size: clamp(24px, 3.2vw, 40px);
  letter-spacing: -0.035em;
}

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

.howto-grid article {
  min-height: 180px;
  padding: 20px;
  border-top: 1px solid var(--line-strong);
}

.howto-grid article > span {
  color: var(--lime);
  font: 600 11px/1 var(--mono);
}

.howto-grid h3 {
  margin: 34px 0 8px;
  font-size: 15px;
  font-weight: 500;
}

.howto-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font: 10px/1.5 var(--mono);
}

[hidden] {
  display: none !important;
}

@media (max-width: 900px) {
  .hero {
    align-items: start;
    flex-direction: column;
    gap: 28px;
  }

  .hero-meta {
    width: 100%;
    min-width: 0;
  }

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

  .report-panel {
    min-height: 0;
  }

  .empty-report {
    min-height: 380px;
  }
}

@media (max-width: 620px) {
  .shell {
    width: min(100% - 24px, 1180px);
  }

  .topbar {
    min-height: 68px;
  }

  .topbar-note {
    display: none;
  }

  .topbar-actions {
    gap: 0;
  }

  .share-page {
    min-height: 32px;
    padding: 0 10px;
    font-size: 10px;
  }

  .compat-notice {
    align-items: flex-start;
    margin-top: 10px;
  }

  .compat-notice button {
    min-height: 30px;
    padding: 0 8px;
  }

  .hero {
    padding: 38px 0 30px;
  }

  h1 {
    font-size: clamp(34px, 10vw, 52px);
  }

  .hero-copy {
    font-size: 13px;
  }

  .hero-meta div {
    padding: 10px 8px;
  }

  .hero-meta strong {
    font-size: 20px;
  }

  .input-panel,
  .report-panel {
    padding: 16px;
  }

  .dropzone {
    min-height: 240px;
  }

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

  .report-summary {
    gap: 12px;
  }

  .report-grade {
    flex-basis: 80px;
    min-height: 80px;
  }

  .keyframe-stage {
    max-height: 440px;
  }

  .keyframe {
    flex-basis: 76px;
  }

  .chat-message {
    max-width: 94%;
  }

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

  .chat-form button {
    min-height: 40px;
  }

  .howto {
    padding-top: 46px;
  }

  .howto-head {
    align-items: start;
    flex-direction: column;
    gap: 0;
  }

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

  .howto-grid article {
    min-height: 0;
  }

  .howto-grid h3 {
    margin-top: 20px;
  }

  footer {
    align-items: start;
    flex-direction: column;
    gap: 8px;
  }
}

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

  .keyframe {
    transition: none;
  }

  .practice-start.is-running .practice-ring {
    animation: none;
  }
}
