/* Studio section styles: upload wizard (views/upload.js, shared with the item page). Tokens come from styles.css :root.
   Loaded after styles.css, so the wizard replaces the old two-column form grid there. */

/* The form is a single column of steps; the grid of the old form is not used. */
.submission.wizard { display: block; }
.submission.wizard [hidden] { display: none !important; }

/* Step indicator */
.wizard-steps { margin: 0 0 24px; }
.steps-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.step-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: var(--hit);
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-2);
  font: inherit;
  font-size: var(--fs-sm);
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.step-btn:hover { background: var(--surface-2); border-color: var(--line-strong); }
.step-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.step-btn[aria-current="step"] { border-color: var(--primary); background: var(--primary-tint); color: var(--primary); font-weight: 600; }
.step-btn[aria-disabled="true"] { cursor: default; color: var(--muted); }
.step-btn[aria-disabled="true"]:hover { background: var(--surface); border-color: var(--line); }
.step-num {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-weight: 700;
}
.step-btn[aria-current="step"] .step-num { border-color: var(--primary); background: var(--primary); color: #FFFFFF; }
.step-btn.is-done .step-num { border-color: transparent; background: var(--ok-bg); color: var(--ok-fg); }
.step-name { min-width: 0; overflow-wrap: anywhere; }

/* Step header and layout */
.step-title { margin: 0 0 6px; font-size: var(--fs-lg); }
.step-title:focus-visible { outline: 2px solid var(--primary); outline-offset: 4px; border-radius: var(--radius-xs); }
.step-lead { margin: 0 0 20px; color: var(--muted); font-size: var(--fs-base); }
.step-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  column-gap: 32px;
  align-items: start;
}
.step-col, .step-side { min-width: 0; }
.step-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 24px;
  margin-bottom: 8px;
}
.submission.wizard .side-title { margin-bottom: 12px; }
.submission.wizard .field-drop { margin-bottom: 24px; }
/* The side panels sit inside the form card: they are plain columns, not a second card (one card per form). */
.submission.wizard .side-card { margin: 0 0 16px; padding: 0; background: none; border: 0; border-radius: 0; }
.wizard-step { min-width: 0; }

/* Checks (step 3) */
.checks { display: grid; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.check-state {
  flex: 0 0 auto;
  min-width: 64px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  text-align: center;
  font-size: var(--fs-xs);
  font-weight: 700;
}
.check.is-pass .check-state { background: var(--ok-bg); color: var(--ok-fg); }
.check.is-warn .check-state { background: var(--pending-bg); color: var(--pending-fg); }
.check-body { display: grid; gap: 2px; min-width: 0; color: var(--text-2); font-size: var(--fs-sm); overflow-wrap: anywhere; }
.check-body strong { color: var(--text); font-size: var(--fs-base); font-weight: 600; }

/* Rules and rights (step 3) */
.rights-field { margin-top: 16px; }
.rights-field .hint { margin: 6px 0 0; }
.rights-choice { display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 10px 12px; border-radius: var(--radius); }
.rights-choice > input { flex: 0 0 auto; margin: 2px 0 0; }
.rights-choice > span { min-width: 0; line-height: 1.4; }

/* Publish options and summary (step 4) */
.publish-field { margin: 0 0 16px; padding: 0; border: 0; min-width: 0; }
.publish-field > legend { margin-bottom: 10px; font-weight: 600; color: var(--text); }
.publish-options { display: grid; gap: 8px; }
.publish-choice { align-items: flex-start; width: 100%; padding: 12px 14px; border-radius: var(--radius); }
.publish-choice > span { display: grid; gap: 4px; }
.choice-note { color: var(--muted); font-size: var(--fs-sm); font-weight: 400; }
.publish-when { margin-bottom: 8px; }
.publish-when input[type="datetime-local"] {
  width: 100%;
  min-height: var(--hit);
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
.publish-when input[type="datetime-local"]:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.summary { display: grid; gap: 10px; margin: 0; }
.summary > div { display: grid; gap: 2px; min-width: 0; }
.summary dt { color: var(--muted); font-size: var(--fs-xs); }
.summary dd { margin: 0; color: var(--text); font-size: var(--fs-sm); overflow-wrap: anywhere; }

/* Footer: Back on the left, save, Next or Review on the right */
.wizard-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.foot-main { display: flex; flex-wrap: wrap; gap: 10px; margin-left: auto; justify-content: flex-end; }
.wizard-foot .btn { min-height: var(--hit); }
.progress-wrap { margin-top: 16px; }
.form-alert { margin: 12px 0 0; }

@media (max-width: 1023px) {
  .step-split { grid-template-columns: minmax(0, 1fr); row-gap: 8px; }
  .step-grid-2 { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 699px) {
  .steps-list { gap: 6px; }
  .step-btn {
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    padding: 8px 4px;
    text-align: center;
    font-size: var(--fs-xs);
    line-height: 1.2;
  }
  .step-name { font-size: var(--fs-xs); overflow-wrap: normal; word-break: normal; }
  /* Four short tiles: only the current step's name shows; the others stay for screen readers. */
  .step-btn:not([aria-current="step"]) .step-name {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .step-btn { position: relative; }
  .step-title { font-size: var(--fs-md); }
  .wizard-foot { flex-direction: column-reverse; align-items: stretch; }
  .wizard-foot > [data-wizard-back] { align-self: flex-start; }
  .foot-main { margin-left: 0; width: 100%; }
  .foot-main .btn { flex: 1 1 auto; }
  .check { padding: 10px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .step-btn { transition: none; }
}

/* Game after the video (step 2): topics as collapsible groups, at most 3 ticked */
.games-pick { margin-top: 16px; }
.games-pick details { border-top: 1px solid var(--border); padding: 8px 0; }
.games-pick summary { min-height: var(--hit); display: flex; align-items: center; gap: 6px; cursor: pointer; font-weight: 600; }
.games-pick .choices { padding: 4px 0 8px; }
.games-pick .choice:has(input:disabled) { opacity: 0.5; cursor: not-allowed; }
