:root {
  color-scheme: light;
  --bg: #f7f1e8;
  --panel: #fffdf9;
  --ink: #1a1a1a;
  --muted: #5a5852;
  --accent: #d86a3a;
  --accent-2: #2f7a7b;
  --line: #e6d9c7;
  --shadow: 0 18px 45px rgba(31, 27, 20, 0.12);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --pad-lg: 28px;
  --pad-md: 20px;
  --pad-sm: 12px;
}

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

body {
  font-family: "IBM Plex Sans", "Helvetica Neue", sans-serif;
  background: radial-gradient(circle at top left, #fff6e6 0%, #f7f1e8 42%, #f3ebe0 100%);
  color: var(--ink);
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: linear-gradient(90deg, rgba(0, 0, 0, 0.03) 1px, transparent 1px),
    linear-gradient(180deg, rgba(0, 0, 0, 0.03) 1px, transparent 1px);
  background-size: 140px 140px;
  pointer-events: none;
  opacity: 0.5;
}

#root {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px 64px;
}

.review-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px 64px;
  display: grid;
  gap: 24px;
}

.review-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.review-header h1 {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.02em;
}

.review-header p {
  color: var(--muted);
  max-width: 720px;
  line-height: 1.5;
}

.review-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(18px, 3vw, 28px);
  box-shadow: var(--shadow);
  display: grid;
  gap: 18px;
}

.review-actions {
  margin-top: auto;
  justify-content: flex-start;
}

.review-empty {
  background: var(--panel);
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  padding: var(--pad-lg);
  color: var(--muted);
}

header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 32px;
}

header h1 {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(2.3rem, 4vw, 3.2rem);
  letter-spacing: -0.02em;
}

header p {
  color: var(--muted);
  max-width: 720px;
  line-height: 1.5;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 22px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--pad-lg);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: float-in 0.7s ease both;
}

.right-panel {
  min-height: 100%;
}

.right-panel.is-dimmed {
  opacity: 0.55;
  pointer-events: none;
}

.right-panel .panel-note {
  margin-top: auto;
}

.card h2 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.2rem;
}

.card h3 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1rem;
}

.card p,
.card label,
.card small {
  color: var(--muted);
  line-height: 1.45;
}

section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

input,
textarea,
select {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: #fff;
  font-size: 0.95rem;
}

textarea {
  resize: vertical;
  font-family: "IBM Plex Sans", "Helvetica Neue", sans-serif;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 4px 10px;
  font-size: 0.8rem;
  color: var(--muted);
  background: #fff;
}

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

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

.current-prefix-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.current-prefix {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.current-prefix label {
  font-weight: 600;
}

.current-prefix-button {
  border: none;
  background: none;
  padding: 0;
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
}

.current-prefix-button:hover {
  text-decoration: underline;
}

.prefix-settings {
  border: none;
  background: none;
  padding: 6px;
  border-radius: 999px;
  color: var(--ink);
  cursor: pointer;
}

.prefix-settings:hover {
  background: rgba(0, 0, 0, 0.06);
}

.folder-picker-panel {
  display: none;
  margin-top: 12px;
  padding: 14px;
  background: #fffaf6;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.folder-picker-panel.is-open {
  display: block;
}

.prefix-settings {
  font-weight: 600;
}

.breadcrumb-item {
  border: none;
  background: transparent;
  color: var(--ink);
  padding: 0;
  font-size: 0.85rem;
  cursor: pointer;
  font-weight: 600;
}

.breadcrumb-item:disabled {
  opacity: 0.7;
  cursor: default;
}

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

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

.scroll-panel {
  max-height: 260px;
  overflow: auto;
  padding-right: 6px;
}

.loading-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-weight: 600;
}

.spinner {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2px solid rgba(0, 0, 0, 0.15);
  border-top-color: var(--ink);
  animation: spin 0.9s linear infinite;
}

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

.folder-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  padding: 12px 14px;
  background: #fff;
  cursor: pointer;
  font-weight: 600;
  text-align: left;
}

.folder-row span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.folder-action {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
}

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

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

.field {
  display: grid;
  gap: 6px;
}

.stat {
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  padding: 12px 14px;
  background: #fff;
}

.stat strong {
  display: block;
  font-size: 1.4rem;
  color: var(--ink);
}

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

.toggle-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.toggle {
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  padding: 12px 14px;
  background: #fff;
  cursor: pointer;
  font-weight: 600;
  text-align: center;
}

.toggle.active {
  border-color: var(--accent-2);
  background: rgba(47, 122, 123, 0.1);
  color: var(--accent-2);
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 10px 8px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
}

.table th {
  color: var(--muted);
  font-weight: 600;
}

.table input,
.table select {
  width: 100%;
}

details summary {
  cursor: pointer;
  color: var(--accent-2);
  font-weight: 600;
}

details ul {
  margin-top: 8px;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.4;
}

.progress-wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
}

.progress {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: #f0e6d8;
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #f0b38f);
}

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

button {
  border: none;
  padding: 12px 18px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
}

button.primary {
  background: var(--accent);
  color: #fff;
}

button.secondary {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
}

button.pass {
  background: #2f7a7b;
  color: #fff;
}

button.fail {
  background: #d94f4f;
  color: #fff;
}

.auth-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(247, 241, 232, 0.88);
  backdrop-filter: blur(6px);
  z-index: 10;
}

.auth-card {
  width: min(420px, 92vw);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 14px;
  animation: float-in 0.6s ease both;
}

.auth-card h2 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.3rem;
}

.error {
  color: #b93c3c;
  font-weight: 600;
}

.sample-card {
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  padding: 16px;
  background: #fff;
  display: grid;
  gap: 8px;
}

.sample-card .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--muted);
}

.review-media {
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  padding: 12px;
  background: #fff;
}

.review-media audio,
.review-media video {
  width: 100%;
  max-height: 320px;
}

.review-page .review-media video {
  max-height: 65vh;
}

.video-meta {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--muted);
}

.video-meta .error {
  color: #b93c3c;
}

.frame-panel {
  display: grid;
  gap: 12px;
}

.frame-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}

.frame-toolbar label {
  display: grid;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--muted);
}

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

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

.frame-preview-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: #fff;
  font-size: 0.85rem;
  color: var(--muted);
}

.frame-preview-card img {
  width: 100%;
  max-height: 380px;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.frame-card {
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  display: grid;
  gap: 6px;
  padding: 10px;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  color: var(--muted);
}

.frame-card.active {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 2px rgba(47, 122, 123, 0.15);
}

.frame-card img {
  width: 100%;
  border-radius: var(--radius-sm);
}

footer {
  margin-top: 34px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

@keyframes float-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 720px) {
  #root {
    padding: 36px 18px 48px;
  }

  .card {
    padding: var(--pad-md);
  }

  header {
    align-items: flex-start;
  }
}
