:root {
  --bg: #efe7da;
  --panel: #f8f4ed;
  --card: #fffdf9;
  --card-strong: #ffffff;
  --text: #172126;
  --muted: #5d6b73;
  --line: #d8cec0;
  --accent: #16423c;
  --accent-2: #3f6d5d;
  --accent-soft: #e5efe9;
  --warning: #ae5b2b;
  --danger: #9a3c34;
  --shadow: 0 18px 34px rgba(34, 41, 47, 0.08);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --hero-a: rgba(22, 66, 60, 0.96);
  --hero-b: rgba(46, 87, 79, 0.92);
  --hero-solid: #16423c;
  --hero-panel: rgba(255, 255, 255, 0.12);
  --hero-text: rgba(255, 255, 255, 0.82);
  --hero-text-soft: rgba(255, 255, 255, 0.76);
  --bg-glow: rgba(190, 139, 61, 0.13);
  --bg-start: #f3ebdf;
  --bg-end: #ece3d8;
  --shell: rgba(255, 252, 246, 0.76);
  --surface-soft: rgba(255, 255, 255, 0.72);
  --surface-strong: rgba(255, 255, 255, 0.66);
  --upload-surface-top: rgba(240, 246, 242, 0.96);
  --upload-surface-bottom: rgba(232, 241, 236, 0.96);
  --upload-glow: rgba(78, 129, 101, 0.08);
  --video-shell: #101718;
  --video-shell-inner: #0f1517;
  --assistant-bubble: #f1f5f2;
  --assistant-line: #d6e2db;
  --issue-surface: #fffaf8;
  --issue-line: #e6d0ca;
  --status-bg: #f4ecdf;
  --status-line: #e5d4b2;
  --status-success-bg: #ebf4ef;
  --status-success-line: #bfd4ca;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0f1715;
  --panel: #16211f;
  --card: #1a2623;
  --card-strong: #20302c;
  --text: #edf3ef;
  --muted: #a8bbb3;
  --line: #30423d;
  --accent: #79b59a;
  --accent-2: #9bcab5;
  --accent-soft: #20372f;
  --warning: #d49c57;
  --danger: #e28a7c;
  --shadow: 0 20px 44px rgba(0, 0, 0, 0.34);
  --hero-a: rgba(8, 23, 20, 0.96);
  --hero-b: rgba(21, 46, 40, 0.96);
  --hero-solid: #0b1916;
  --hero-panel: rgba(255, 255, 255, 0.06);
  --hero-text: rgba(237, 243, 239, 0.84);
  --hero-text-soft: rgba(220, 231, 226, 0.72);
  --bg-glow: rgba(46, 119, 88, 0.12);
  --bg-start: #101715;
  --bg-end: #0b1110;
  --shell: rgba(18, 27, 24, 0.86);
  --surface-soft: rgba(29, 41, 37, 0.92);
  --surface-strong: rgba(24, 36, 32, 0.94);
  --upload-surface-top: rgba(26, 43, 37, 0.96);
  --upload-surface-bottom: rgba(22, 34, 30, 0.96);
  --upload-glow: rgba(121, 181, 154, 0.08);
  --video-shell: #08100f;
  --video-shell-inner: #060c0b;
  --assistant-bubble: #15211e;
  --assistant-line: #2e413c;
  --issue-surface: #241a1a;
  --issue-line: #4e3532;
  --status-bg: #2b2418;
  --status-line: #5d4d2e;
  --status-success-bg: #182721;
  --status-success-line: #365345;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html, body, #root {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(circle at top right, var(--bg-glow), transparent 24%),
    linear-gradient(180deg, var(--bg-start) 0%, var(--bg-end) 100%);
  color: var(--text);
  font-family: "Aptos", "Segoe UI", sans-serif;
  transition: background 180ms ease, color 180ms ease;
}

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

.app-shell {
  min-height: 100vh;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.auth-card {
  width: min(480px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 30px;
  box-shadow: var(--shadow);
}

.auth-card h1 {
  margin: 0 0 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 5vw, 2.8rem);
}

.auth-form {
  margin-top: 20px;
}

.hero {
  background:
    linear-gradient(135deg, var(--hero-a), var(--hero-b)),
    var(--hero-solid);
  color: white;
  padding: 24px 32px 28px;
  box-shadow: var(--shadow);
}

.hero-top {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--hero-panel);
  margin-bottom: 18px;
}

.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #e3bf71;
}

.hero h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  line-height: 1;
}

.hero p {
  margin: 14px 0 0;
  max-width: 780px;
  color: var(--hero-text);
  font-size: 1.02rem;
}

.hero-aside {
  min-width: 260px;
  padding: 18px;
  border-radius: var(--radius-md);
  background: var(--hero-panel);
  backdrop-filter: blur(8px);
}

.hero-aside h2 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.hero-aside p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--hero-text-soft);
}

.account-chip {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

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

.theme-btn {
  min-width: 108px;
}

.account-chip .muted {
  color: var(--hero-text);
}

.page {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 22px;
  padding: 26px 28px 34px;
}

.page.page-single {
  grid-template-columns: minmax(0, 1fr);
  max-width: 1480px;
  margin: 0 auto;
  padding: 22px 24px 28px;
}

.sidebar,
.main-column {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.main-column-full {
  width: 100%;
}

.workspace-shell {
  display: grid;
  gap: 16px;
  min-height: calc(100vh - 245px);
  padding: 22px;
  border-radius: 30px;
  background: var(--shell);
  border: 1px solid rgba(216, 206, 192, 0.95);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.workspace-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.workspace-copy h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.55rem, 3vw, 2.25rem);
}

.workspace-copy p {
  margin: 10px 0 0;
  max-width: 760px;
  color: var(--muted);
}

.workspace-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

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

.workflow-tab {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 16px;
  border-radius: 20px;
  border: 1px solid rgba(22, 66, 60, 0.14);
  background: var(--surface-strong);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.workflow-tab:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(22, 66, 60, 0.26);
  box-shadow: 0 10px 24px rgba(22, 66, 60, 0.08);
}

.workflow-tab:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

.workflow-tab.active {
  background: linear-gradient(135deg, rgba(22, 66, 60, 0.96), rgba(58, 103, 83, 0.94));
  border-color: transparent;
  color: white;
}

.workflow-tab.complete:not(.active) {
  background: var(--accent-soft);
  border-color: rgba(22, 66, 60, 0.18);
}

.workflow-step {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(22, 66, 60, 0.1);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.workflow-tab.active .workflow-step {
  background: rgba(255, 255, 255, 0.14);
  color: white;
}

.workflow-text {
  display: grid;
  gap: 4px;
}

.workflow-text strong {
  font-size: 1rem;
}

.workflow-text span {
  font-size: 0.88rem;
  color: var(--muted);
}

.workflow-tab.active .workflow-text span {
  color: rgba(255, 255, 255, 0.78);
}

.workspace-status {
  margin: 0;
}

.workspace-body {
  min-height: 0;
  height: calc(100vh - 430px);
  overflow: hidden;
}

.tab-panel {
  height: 100%;
  min-height: 0;
}

.panel-empty-state {
  height: 100%;
  display: grid;
  place-content: center;
}

.upload-panel-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr);
  gap: 18px;
  height: 100%;
}

.upload-drop-card,
.upload-preview-card {
  height: 100%;
}

.upload-drop-card {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.upload-drop-card h2,
.upload-preview-card h3 {
  margin: 0;
}

.upload-drop-card p {
  margin: 0;
  color: var(--muted);
}

.upload-zone {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 20px;
  border-radius: 22px;
  border: 1px dashed rgba(22, 66, 60, 0.26);
  background:
    radial-gradient(circle at top right, var(--upload-glow), transparent 40%),
    linear-gradient(180deg, var(--upload-surface-top), var(--upload-surface-bottom));
  overflow: hidden;
  cursor: pointer;
}

.upload-zone-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-zone-copy {
  display: grid;
  gap: 6px;
}

.upload-zone-copy strong {
  font-size: 1.05rem;
}

.upload-zone-copy span {
  color: var(--muted);
  font-size: 0.92rem;
}

.upload-zone-action {
  flex: 0 0 auto;
  min-width: 108px;
  text-align: center;
  padding: 11px 14px;
  border-radius: 999px;
  background: var(--accent);
  color: white;
}

.upload-spinner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

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

.upload-detail {
  display: grid;
  gap: 6px;
  padding: 14px;
  border-radius: 18px;
  background: var(--surface-soft);
  border: 1px solid rgba(216, 206, 192, 0.85);
}

.upload-preview-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mini-video-shell {
  overflow: hidden;
  border-radius: calc(var(--radius-lg) - 4px);
  background: #101718;
  aspect-ratio: 16 / 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mini-video-shell video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #0f1517;
}

.upload-preview-meta {
  display: grid;
  gap: 12px;
}

.upload-empty {
  height: 100%;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
}

.card-tight {
  padding: 16px;
}

.card h2,
.card h3,
.card h4 {
  margin: 0;
}

.card code,
.hero-aside code,
.meta-note code {
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 0.92em;
}

.eyebrow {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 10px;
}

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

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

.step-pill {
  border-radius: 999px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.64);
  color: var(--muted);
  font-size: 0.94rem;
}

.step-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.step-pill.complete {
  background: var(--accent-soft);
  border-color: rgba(22, 66, 60, 0.2);
  color: var(--accent);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.field label {
  font-size: 0.9rem;
  color: var(--muted);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card-strong);
  color: var(--text);
  padding: 11px 12px;
}

.field textarea {
  min-height: 110px;
  resize: vertical;
}

.primary-btn,
.secondary-btn,
.ghost-btn {
  border: none;
  cursor: pointer;
  border-radius: 999px;
  padding: 12px 16px;
  transition: transform 140ms ease, opacity 140ms ease, background 140ms ease;
}

.primary-btn {
  background: var(--accent);
  color: white;
}

.secondary-btn {
  background: var(--accent-soft);
  color: var(--accent);
}

.ghost-btn {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}

.primary-btn:hover,
.secondary-btn:hover,
.ghost-btn:hover {
  transform: translateY(-1px);
}

.primary-btn:disabled,
.secondary-btn:disabled,
.ghost-btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
}

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

.status-banner {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--status-bg);
  border: 1px solid var(--status-line);
  color: var(--warning);
  font-size: 0.95rem;
}

.status-banner.success {
  background: var(--status-success-bg);
  border-color: var(--status-success-line);
  color: var(--accent);
}

.status-stack {
  display: grid;
  gap: 10px;
}

.meta-note {
  font-size: 0.88rem;
  color: var(--muted);
}

.intake-card {
  padding: 22px 24px;
}

.intake-head {
  display: flex;
  justify-content: space-between;
  gap: 22px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.intake-flow {
  display: grid;
  gap: 10px;
}

.intake-upload {
  min-width: min(100%, 420px);
  display: grid;
  gap: 10px;
  flex: 1 1 420px;
}

.upload-field {
  margin-bottom: 0;
}

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

.review-shell {
  display: grid;
  gap: 18px;
  height: 100%;
  min-height: 0;
}

.review-summary {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.review-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) 360px;
  gap: 20px;
  min-height: 0;
  height: 100%;
}

.video-stage {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
}

.video-shell {
  overflow: hidden;
  border-radius: calc(var(--radius-lg) - 4px);
  background: var(--video-shell);
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-shell video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--video-shell-inner);
}

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

.review-command-bar {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  border: 1px solid rgba(216, 206, 192, 0.9);
}

.timeline-panel {
  display: grid;
  gap: 12px;
  min-height: 0;
}

.timeline-ruler {
  position: relative;
  height: 34px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(22, 66, 60, 0.08), rgba(22, 66, 60, 0.16));
  overflow: hidden;
  border: 1px solid rgba(22, 66, 60, 0.14);
}

.timeline-window {
  position: absolute;
  top: 4px;
  bottom: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(22, 66, 60, 0.18), rgba(62, 109, 93, 0.38));
}

.timeline-marker {
  position: absolute;
  top: 3px;
  bottom: 3px;
  width: 3px;
  border-radius: 999px;
  transform: translateX(-50%);
}

.timeline-marker.start {
  background: var(--accent);
}

.timeline-marker.end {
  background: var(--warning);
}

.timeline-marker.phase {
  background: #b98a3d;
}

.timeline-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 120px;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 10px;
}

.timeline-thumb {
  cursor: pointer;
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid transparent;
  background: var(--card-strong);
  padding: 0;
  text-align: left;
}

.timeline-thumb.active {
  border-color: var(--accent);
}

.timeline-thumb.outside-window {
  opacity: 0.4;
}

.timeline-thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.timeline-thumb .caption {
  padding: 8px 9px;
  font-size: 0.8rem;
  color: var(--muted);
}

.phase-rail {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  overflow: auto;
  padding-right: 8px;
}

.phase-card {
  border-radius: var(--radius-md);
  padding: 18px;
  background: var(--card-strong);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.phase-card.active {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.phase-card h4 {
  font-size: 1rem;
}

.confidence {
  font-size: 0.82rem;
  color: var(--muted);
}

.confidence.low {
  color: var(--danger);
}

.phase-meta {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.45;
}

.phase-summary {
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--text);
  font-weight: 600;
}

.phase-checklist-shell {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
}

.phase-checklist-title {
  font-size: 0.77rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-2);
  font-weight: 700;
}

.phase-checklist {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.42;
}

.phase-window,
.marker-meta {
  font-size: 0.88rem;
  color: var(--accent-2);
}

.marker-card {
  display: grid;
  gap: 12px;
}

.marker-card.selected-marker {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.marker-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.badge-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 7px 11px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.84rem;
}

.budget-card {
  display: grid;
  gap: 10px;
}

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

.range-wrap input[type="range"] {
  width: 100%;
}

.report-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 18px;
}

.rating-card {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 22px 24px;
  border-radius: var(--radius-lg);
  color: white;
  box-shadow: var(--shadow);
  flex: 0 0 auto;
}

.rating-card h2 {
  margin: 0 0 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
}

.rating-card p {
  margin: 0;
  max-width: 680px;
  color: rgba(255, 255, 255, 0.84);
}

.rating-stage {
  margin: 0 0 10px;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.92);
}

.rating-stage-copy {
  margin-top: 10px;
}

.rating-category-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.rating-category-chip {
  padding: 8px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: white;
  font-size: 0.84rem;
}

.rating-elite {
  background: linear-gradient(135deg, #18473b, #3d7559);
}

.rating-strong {
  background: linear-gradient(135deg, #275249, #648464);
}

.rating-developing {
  background: linear-gradient(135deg, #7a5d2d, #b1873f);
}

.rating-early {
  background: linear-gradient(135deg, #7b4538, #b16850);
}

.rating-score-shell {
  display: grid;
  justify-items: end;
  min-width: 160px;
}

.rating-score {
  font-size: clamp(2.8rem, 7vw, 4.5rem);
  font-weight: 700;
  line-height: 0.9;
}

.rating-scale {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.82);
}

.issue-list,
.insight-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.issue-card {
  border-radius: var(--radius-md);
  padding: 16px;
  background: var(--issue-surface);
  border: 1px solid var(--issue-line);
}

.issue-card h4 {
  color: var(--danger);
  margin-bottom: 10px;
}

.issue-card p {
  margin: 8px 0 0;
}

.issue-frame-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.issue-frame-btn {
  border: 1px solid rgba(46, 110, 87, 0.18);
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.issue-frame-btn:hover {
  transform: translateY(-1px);
}

.issue-frame-btn.active {
  border-color: rgba(46, 110, 87, 0.38);
  background: linear-gradient(180deg, rgba(97, 157, 127, 0.16), rgba(97, 157, 127, 0.08));
}

.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 9px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.88rem;
}

.keyframe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

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

.keyframe-card {
  border-radius: var(--radius-md);
  overflow: hidden;
  background: white;
  border: 1px solid var(--line);
}

.keyframe-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}

.keyframe-card .body {
  padding: 12px;
  display: grid;
  gap: 6px;
}

.coach-layout {
  display: grid;
  grid-template-columns: minmax(360px, 0.92fr) minmax(0, 1.08fr);
  gap: 18px;
  height: 100%;
  min-height: 0;
}

.coach-review-column,
.coach-analysis-column {
  min-height: 0;
}

.coach-review-column {
  display: flex;
  flex-direction: column;
  overflow: auto;
  padding-right: 4px;
}

.coach-film-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
  height: 100%;
  overflow: auto;
  padding: 18px;
  background:
    radial-gradient(circle at top left, rgba(90, 148, 118, 0.12), transparent 48%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0)),
    var(--card);
}

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

.coach-film-head h2 {
  font-size: 1.3rem;
}

.coach-video-shell {
  aspect-ratio: 16 / 9.6;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

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

.coach-phase-chip {
  border: 1px solid var(--line);
  background: var(--card-strong);
  color: var(--text);
  border-radius: 18px;
  padding: 12px 14px;
  display: grid;
  gap: 4px;
  text-align: left;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.coach-phase-chip strong {
  font-size: 0.92rem;
}

.coach-phase-chip span {
  font-size: 0.82rem;
  color: var(--muted);
}

.coach-phase-chip:hover {
  transform: translateY(-1px);
}

.coach-phase-chip.active {
  border-color: rgba(46, 110, 87, 0.42);
  background: linear-gradient(180deg, rgba(97, 157, 127, 0.16), rgba(97, 157, 127, 0.08));
  box-shadow: inset 0 0 0 1px rgba(74, 134, 106, 0.2);
}

.coach-timeline-panel {
  gap: 10px;
}

.coach-timeline-strip {
  grid-auto-columns: 108px;
}

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

.coach-keyframe-card {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--card-strong);
  padding: 0;
  text-align: left;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.coach-keyframe-card:hover {
  transform: translateY(-1px);
}

.coach-keyframe-card.active {
  border-color: rgba(46, 110, 87, 0.42);
  box-shadow: inset 0 0 0 1px rgba(74, 134, 106, 0.2);
}

.coach-keyframe-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}

.coach-keyframe-card .body {
  padding: 10px 12px 12px;
  display: grid;
  gap: 4px;
}

.coach-keyframe-card .body span {
  font-size: 0.8rem;
  color: var(--muted);
}

.coach-analysis-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

.scroll-card {
  min-height: 0;
  overflow: auto;
}

.chat-shell {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  flex: 1 1 auto;
}

.segmentation-summary p {
  margin: 8px 0 0;
  color: var(--muted);
}

.chat-log {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 4px;
}

.message {
  border-radius: 16px;
  padding: 12px 14px;
  max-width: 80%;
  white-space: pre-wrap;
}

.message.user {
  align-self: flex-end;
  background: var(--accent);
  color: white;
}

.message.assistant {
  align-self: flex-start;
  background: var(--assistant-bubble);
  color: var(--text);
  border: 1px solid var(--assistant-line);
}

.empty-state {
  text-align: center;
  padding: 42px 24px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  color: var(--muted);
}

.spinner {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: white;
  display: inline-block;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
}

.inline-spinner {
  border-color: rgba(22, 66, 60, 0.18);
  border-top-color: var(--accent);
}

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

@media (max-width: 1120px) {
  .page {
    grid-template-columns: 1fr;
  }

  .workspace-shell {
    min-height: auto;
  }

  .workspace-body {
    height: auto;
    overflow: visible;
  }

  .workflow-tabs,
  .upload-panel-grid,
  .coach-layout,
  .review-layout,
  .report-grid {
    grid-template-columns: 1fr;
  }

  .coach-analysis-column {
    overflow: visible;
    padding-right: 0;
  }

  .coach-review-column,
  .coach-film-card {
    overflow: visible;
    padding-right: 0;
  }

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

  .review-command-bar,
  .review-summary,
  .workspace-head,
  .workspace-meta,
  .rating-card {
    flex-direction: column;
  }

  .workflow-tab {
    padding: 12px 14px;
  }

  .keyframe-grid-compact {
    grid-template-columns: 1fr;
  }

  .coach-phase-strip,
  .coach-keyframe-grid {
    grid-template-columns: 1fr;
  }

  .rating-score-shell {
    justify-items: start;
    width: 100%;
  }
}
