:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #667085;
  --line: #d8e0e7;
  --paper: #f2f7f7;
  --blue: #0f6684;
  --blue-dark: #0a4055;
  --green: #24705b;
  --red: #b23a42;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 850;
  cursor: pointer;
}

button:hover {
  border-color: var(--blue);
}

.shell {
  width: min(1320px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 24px 0 36px;
}

.topbar,
.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  margin-bottom: 16px;
}

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

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1;
}

h2 {
  font-size: 1.08rem;
}

.status,
.folders,
.capture,
.panel,
.print,
.qr {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
}

.status {
  max-width: 520px;
  padding: 10px 12px;
  color: var(--green);
  overflow-wrap: anywhere;
}

.folders {
  display: grid;
  gap: 8px;
  padding: 12px;
  margin-bottom: 14px;
}

.folders[hidden] {
  display: none;
}

.setup-page[data-setup-page="folders"] label {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr) 116px;
  align-items: center;
  gap: 8px;
}

.setup-page[data-setup-page="folders"] label > span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 850;
}

.setup-page[data-setup-page="folders"] input {
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.controls,
.costumes,
.engines {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

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

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

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

.standard-panel {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
}

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

.standard-note {
  color: var(--muted);
  font-size: 0.86rem;
}

.standard-controls {
  display: grid;
  grid-template-columns: 2fr repeat(7, minmax(80px, 1fr));
  gap: 8px;
}

.standard-controls label {
  display: grid;
  gap: 5px;
}

.standard-controls span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.standard-controls input,
.standard-controls select {
  width: 100%;
  min-height: 40px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

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

.standard-actions button {
  padding: 0 14px;
  background: var(--blue);
  color: #fff;
}

.calculator-result {
  color: var(--green);
  font-weight: 850;
}

.standard-summary {
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.costumes[hidden],
.engines[hidden] {
  display: none;
}

.mode,
.costume,
.engine {
  text-align: left;
  padding: 14px;
}

.mode strong,
.mode span,
.engine strong,
.engine span {
  display: block;
}

.mode span,
.engine span {
  margin-top: 4px;
  color: var(--muted);
}

.mode.is-active,
.costume.is-active,
.engine.is-active {
  border-color: var(--blue);
  background: rgba(15, 102, 132, 0.1);
}

.work {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
  align-items: start;
}

.capture,
.panel,
.print,
.qr {
  padding: 14px;
}

.dropzone {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 520px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 8px;
  background: #111820;
  aspect-ratio: 3 / 2;
  cursor: pointer;
}

.dropzone input {
  position: absolute;
  inset: 0;
  z-index: 5;
  opacity: 0;
  cursor: pointer;
}

.dropzone img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  visibility: hidden;
}

.dropzone img.ready {
  visibility: visible;
}

.dropzone.dragging {
  outline: 4px solid rgba(15, 102, 132, 0.62);
  outline-offset: 4px;
}

.empty {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 8px;
  max-width: 520px;
  padding: 20px;
  color: #fff;
  text-align: center;
  pointer-events: none;
}

.empty span {
  color: rgba(255, 255, 255, 0.78);
}

.empty[hidden] {
  display: none;
}

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

.percent {
  color: var(--blue);
  font-size: 2rem;
  font-weight: 900;
}

.bar {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #dce8ed;
}

.bar div {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--green));
  transition: width 240ms ease;
}

.message,
.log {
  color: var(--muted);
  line-height: 1.42;
}

.log {
  min-height: 96px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafb;
  white-space: pre-wrap;
}

.log.error {
  border-color: rgba(178, 58, 66, 0.35);
  color: var(--red);
}

.log.success {
  border-color: rgba(36, 112, 91, 0.35);
  color: var(--green);
}

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

.steps li {
  min-height: 34px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-weight: 850;
}

.steps li.active {
  border-color: var(--blue);
  background: rgba(15, 102, 132, 0.1);
  color: var(--ink);
}

.steps li.done {
  border-color: rgba(36, 112, 91, 0.35);
  color: var(--green);
}

.output {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  margin-top: 16px;
  align-items: start;
}

.print {
  position: relative;
}

#printCanvas {
  display: block;
  width: 100%;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f5f7f8;
  aspect-ratio: 3 / 2;
}

.print-empty {
  position: absolute;
  inset: 86px 14px 14px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(17, 24, 32, 0.74);
  color: #fff;
}

.print-empty[hidden] {
  display: none;
}

.qr {
  display: grid;
  gap: 10px;
}

.qr img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  visibility: hidden;
}

.qr img.ready {
  visibility: visible;
}

.qr a {
  color: var(--blue);
  overflow-wrap: anywhere;
  font-weight: 800;
}

@media (max-width: 980px) {
  .work,
  .output,
  .controls {
    grid-template-columns: 1fr;
  }

  .setup-page[data-setup-page="folders"] label,
  .costumes,
  .standard-controls {
    grid-template-columns: 1fr;
  }

  .dashboard-metrics,
  .job-row {
    grid-template-columns: 1fr 1fr;
  }

  .dropzone {
    min-height: 360px;
  }
}

/* Photo booth operator rail */
:root {
  --ink: #17202a;
  --muted: #667085;
  --line: #d7e0e5;
  --paper: #edf4f3;
  --blue: #0f6684;
  --blue-dark: #0a4055;
  --green: #24705b;
  --red: #b23a42;
  --shadow: 0 12px 28px rgba(23, 32, 42, 0.07);
}

body {
  background: var(--paper);
}

.shell {
  width: min(1440px, calc(100vw - 40px));
  padding: 28px 0 44px;
}

.topbar {
  align-items: center;
  margin-bottom: 22px;
}

.brand-lockup,
.topbar-actions,
.route-summary,
.panel-heading,
.settings-heading {
  display: flex;
  align-items: center;
}

.brand-lockup,
.topbar-actions {
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 950;
  letter-spacing: 0;
}

h1 {
  font-size: 2.8rem;
  letter-spacing: 0;
}

.status {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 480px;
  min-height: 44px;
  padding: 9px 12px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 2px 0 rgba(15, 102, 132, 0.04);
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(36, 112, 91, 0.12);
}

.quiet-button,
.text-button {
  min-height: 44px;
  padding: 0 14px;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--blue);
}

.journey {
  display: grid;
  grid-template-columns: 1fr 46px 1fr 46px 1fr 46px 1fr;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.journey-step {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 10px;
  min-height: 62px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
}

.journey-step span {
  grid-row: 1 / span 2;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-weight: 900;
}

.journey-step strong {
  align-self: end;
  font-size: 0.95rem;
}

.journey-step small {
  align-self: start;
  color: var(--muted);
  font-size: 0.75rem;
}

.journey-step.active {
  border-color: var(--blue);
  background: rgba(15, 102, 132, 0.1);
}

.journey-step.active span {
  background: var(--blue);
}

.journey-step.done {
  border-color: rgba(36, 112, 91, 0.35);
  background: rgba(36, 112, 91, 0.06);
}

.journey-step.done span {
  background: var(--green);
}

.journey-line {
  height: 1px;
  background: var(--line);
}

.operator-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 52px;
  padding: 6px 12px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.route-summary {
  min-width: 0;
  gap: 10px;
  color: var(--muted);
  font-size: 0.86rem;
}

.route-summary strong {
  max-width: 360px;
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-label,
.capture-format,
.selected-job span {
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.route-arrow {
  color: var(--blue);
  font-size: 1.15rem;
  font-weight: 900;
}

.folders {
  position: relative;
  gap: 8px;
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}

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

.setup-tab {
  min-height: 42px;
  padding: 0 12px;
}

.setup-tab.is-active {
  border-color: var(--blue);
  background: rgba(15, 102, 132, 0.1);
  color: var(--blue);
}

.setup-page {
  display: none;
}

.setup-page.is-active {
  display: grid;
  gap: 8px;
}

.settings-heading {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 4px;
}

.settings-heading > span,
.selection-hint,
.standard-note {
  color: var(--muted);
  font-size: 0.84rem;
}

.effect-section {
  padding: 18px 0 4px;
}

.effect-heading {
  align-items: center;
  margin-bottom: 10px;
}

.controls,
.costumes,
.engines {
  gap: 10px;
  margin-bottom: 10px;
}

.mode,
.costume,
.engine {
  min-height: 58px;
  padding: 11px 14px;
  border-radius: 8px;
}

.mode {
  display: flex;
  align-items: center;
  gap: 12px;
}

.choice-mark {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 950;
}

.mode span:last-child,
.costume,
.engine {
  display: grid;
  gap: 3px;
}

.mode small,
.costume small,
.engine span {
  display: block;
  margin-top: 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 650;
}

.mode.is-active .choice-mark {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.engine {
  min-height: 54px;
}

.standard-panel {
  margin: 8px 0 18px;
  box-shadow: var(--shadow);
}

.dashboard-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.metric {
  display: grid;
  gap: 4px;
  min-height: 92px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.metric span,
.metric small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.metric strong {
  color: var(--ink);
  font-size: 1.35rem;
}

.job-list {
  display: grid;
  gap: 6px;
}

.job-row {
  display: grid;
  grid-template-columns: 1fr 1fr 0.8fr 0.8fr 0.7fr;
  gap: 8px;
  align-items: center;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 0.82rem;
}

.job-row strong {
  color: var(--ink);
}

.empty-row {
  grid-template-columns: 1fr;
  justify-items: center;
}

.work {
  grid-template-columns: minmax(0, 1.55fr) minmax(340px, 0.75fr);
  gap: 18px;
}

.capture,
.panel,
.print,
.qr {
  padding: 18px;
  box-shadow: var(--shadow);
}

.capture .section-head,
.print .section-head {
  align-items: center;
}

.dropzone {
  min-height: 560px;
  margin-top: 16px;
  border: 1px solid #1d2b36;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.panel {
  min-height: 100%;
  gap: 14px;
}

.panel-heading {
  justify-content: space-between;
  gap: 12px;
}

.percent {
  font-size: 2.1rem;
  line-height: 1;
}

.selected-job {
  display: grid;
  gap: 3px;
  padding: 14px;
  border-left: 3px solid var(--blue);
  background: #f4f8f8;
}

.selected-job strong {
  font-size: 1.18rem;
}

.selected-job small {
  color: var(--muted);
}

.bar {
  height: 10px;
  border-radius: 6px;
}

.bar div {
  border-radius: 6px;
  background: var(--blue);
}

.steps {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
}

.steps li {
  display: grid;
  min-height: 44px;
  place-items: center;
  padding: 6px 3px;
  font-size: 0.72rem;
  text-align: center;
}

.log {
  min-height: 128px;
  font-size: 0.86rem;
}

.output {
  gap: 18px;
  margin-top: 18px;
}

.print-empty {
  inset: 96px 18px 18px;
}

@media (max-width: 980px) {
  .shell {
    width: min(100% - 24px, 720px);
    padding-top: 16px;
  }

  .topbar,
  .topbar-actions,
  .operator-strip,
  .settings-heading,
  .effect-heading {
    align-items: flex-start;
  }

  .topbar,
  .operator-strip {
    flex-direction: column;
  }

  .topbar-actions,
  .route-summary {
    width: 100%;
  }

  .status {
    flex: 1;
  }

  h1 {
    font-size: 2rem;
  }

  .journey {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
  }

  .journey-line {
    display: none;
  }

  .journey-step {
    display: grid;
    min-height: 54px;
    grid-template-columns: auto 1fr;
  }

  .journey-step small {
    display: none;
  }

  .dropzone {
    min-height: 400px;
  }

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

@media (max-width: 560px) {
  .dropzone {
    min-height: 0;
    height: auto;
    aspect-ratio: 3 / 2;
  }

  .topbar-actions,
  .route-summary {
    flex-wrap: wrap;
  }

  .route-summary strong {
    max-width: 190px;
  }

  .journey-step {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .journey-step span {
    grid-row: auto;
  }

  .controls,
  .costumes,
  .engines {
    grid-template-columns: 1fr;
  }

  .setup-tabs,
  .dashboard-metrics,
  .job-row {
    grid-template-columns: 1fr;
  }

  .standard-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .steps li {
    min-height: 52px;
    font-size: 0.64rem;
  }
}
