:root {
  color-scheme: light;
  --ink: #1c2421;
  --muted: #5f6d68;
  --paper: #f7f4ea;
  --panel: #fffdf7;
  --line: #d6cebd;
  --green: #1f6c5d;
  --green-dark: #164c42;
  --rust: #a14e36;
  --yellow: #e8bd53;
  --blue: #4d6f98;
  --red: #b54735;
  --shadow: 0 18px 52px rgba(28, 36, 33, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  background:
    linear-gradient(90deg, rgba(31, 108, 93, 0.08) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(180deg, rgba(77, 111, 152, 0.07) 1px, transparent 1px) 0 0 / 44px 44px,
    var(--paper);
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

a {
  color: inherit;
}

.app-shell {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 22px;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 18px;
  border-bottom: 2px solid var(--ink);
}

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

.topbar-actions a,
.session-chip,
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid var(--ink);
  background: var(--panel);
  font-size: 0.82rem;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.session-chip {
  gap: 8px;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 0 4px rgba(232, 189, 83, 0.24);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--rust);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(2.2rem, 5vw, 5.4rem);
  line-height: 0.9;
}

h2 {
  font-size: clamp(1.7rem, 3vw, 3.2rem);
  line-height: 1;
}

h3 {
  font-size: 1.3rem;
}

.workspace {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 22px;
  padding-top: 22px;
}

.stepper {
  position: sticky;
  top: 22px;
  display: grid;
  gap: 10px;
  align-self: start;
}

.step-pill {
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 253, 247, 0.74);
  color: var(--ink);
  text-align: left;
}

.step-pill span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 38px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 900;
}

.step-pill strong {
  font-size: 0.92rem;
}

.step-pill.is-active {
  border-color: var(--ink);
  background: var(--yellow);
  box-shadow: 5px 5px 0 var(--ink);
}

.screen {
  display: none;
  padding: 22px;
  border: 2px solid var(--ink);
  background: rgba(255, 253, 247, 0.95);
  box-shadow: var(--shadow);
}

.screen.is-active {
  display: block;
}

.screen-heading,
.card-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.screen-heading {
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.card-header {
  padding: 12px;
  border-bottom: 1px solid var(--ink);
}

.home-grid,
.collection-layout,
.evaluation-layout,
.upload-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  gap: 16px;
}

.entry-card,
.config-card,
.screenshot-card,
.recording-card,
.replay-card,
.manifest-card,
.upload-card,
.describe-panel {
  border: 1px solid var(--ink);
  background: #fffaf0;
}

.entry-card,
.config-card,
.manifest-card,
.upload-card,
.describe-panel {
  padding: 16px;
}

.entry-steps {
  display: grid;
  gap: 10px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}

.entry-steps li {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 12px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.entry-steps li > span {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 900;
}

.entry-steps p,
.upload-card p,
.media-state span {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 750;
  line-height: 1.45;
}

.entry-form,
.form-grid,
.stacked-form,
.questionnaire {
  display: grid;
  gap: 14px;
}

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

label,
legend,
dt {
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 900;
}

input[type="text"],
textarea,
select {
  width: 100%;
  margin-top: 7px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--panel);
  color: var(--ink);
  outline: none;
}

textarea {
  resize: vertical;
}

input[type="text"]:focus,
textarea:focus,
select:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(232, 189, 83, 0.35);
}

.checkbox-line,
.representation-list label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.4;
}

.config-card dl,
.manifest-card dl {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}

.config-card dl div,
.manifest-card dl div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

dd {
  margin: 0;
  color: var(--green);
  font-weight: 900;
  text-align: right;
}

.readiness-grid,
.media-state,
.receipt-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.readiness-grid span,
.media-state span,
.receipt-strip span {
  padding: 7px 9px;
  border: 1px solid var(--line);
  background: var(--panel);
  font-size: 0.78rem;
  font-weight: 900;
}

.asset-frame {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #dfe5df;
}

.asset-frame img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.target-grid {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
}

.target-cell {
  border: 1px solid rgba(28, 36, 33, 0.3);
  background: rgba(255, 255, 255, 0.02);
}

.target-cell:disabled {
  opacity: 1;
}

.target-cell.is-selected {
  background: rgba(232, 189, 83, 0.36);
  box-shadow: inset 0 0 0 3px var(--rust);
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px;
  border-top: 1px solid var(--ink);
}

.card-footer span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.card-footer strong {
  text-align: right;
}

.video-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 330px;
  background:
    radial-gradient(circle at 22% 18%, rgba(232, 189, 83, 0.24), transparent 28%),
    linear-gradient(135deg, #1a2824, #46514d);
  overflow: hidden;
}

.video-stage video,
.canvas-stage,
.canvas-stage canvas,
.replay-card video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.canvas-stage {
  min-height: 330px;
}

.stage-status {
  position: absolute;
  left: 12px;
  bottom: 12px;
  max-width: calc(100% - 24px);
  padding: 8px 10px;
  background: rgba(255, 253, 247, 0.92);
  border: 1px solid var(--ink);
  font-size: 0.84rem;
  font-weight: 900;
}

.recording-controls,
.action-row,
.upload-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.recording-controls {
  padding: 12px;
  border-top: 1px solid var(--ink);
}

.action-row,
.upload-actions {
  margin-top: 16px;
}

.primary-button,
.secondary-button,
.ghost-button {
  min-height: 42px;
  padding: 10px 14px;
  border: 1px solid var(--ink);
  font-weight: 900;
}

.primary-button {
  background: var(--green);
  color: #fffdf7;
  box-shadow: 4px 4px 0 var(--ink);
}

.primary-button:hover:not(:disabled) {
  background: var(--green-dark);
}

.secondary-button {
  background: var(--panel);
  color: var(--ink);
}

.secondary-button:hover:not(:disabled),
.ghost-button:hover:not(:disabled) {
  background: #f0e8d5;
}

.ghost-button {
  background: transparent;
  color: var(--muted);
}

.describe-panel {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.describe-panel[hidden] {
  display: none;
}

.stacked-form {
  align-content: start;
  padding: 16px;
  border: 1px solid var(--ink);
  background: #fffaf0;
}

.replay-card {
  overflow: hidden;
}

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

.questionnaire > label {
  grid-column: 1 / -1;
}

fieldset {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--ink);
  background: #fffaf0;
}

.representation-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.progress-shell {
  height: 16px;
  overflow: hidden;
  border: 1px solid var(--ink);
  background: var(--panel);
}

.progress-fill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--yellow));
  transition: width 180ms ease;
}

.receipt {
  min-height: 160px;
  margin: 16px 0 0;
  padding: 14px;
  overflow: auto;
  border: 1px solid var(--ink);
  background: #1c2421;
  color: #fffdf7;
  line-height: 1.5;
}

@media (max-width: 1080px) {
  .workspace,
  .home-grid,
  .collection-layout,
  .evaluation-layout,
  .upload-layout,
  .questionnaire {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 680px) {
  .app-shell {
    padding: 14px;
  }

  .topbar,
  .screen-heading,
  .card-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .stepper,
  .form-grid,
  .split-row {
    grid-template-columns: 1fr;
  }
}
