:root {
  color-scheme: light;
  --ink: #17191c;
  --panel: rgba(255, 255, 255, 0.86);
  --line: #e9e9e6;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  overflow: hidden;
  background: #ffffff;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.stage-shell {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #ffffff;
}

#wizard-canvas {
  max-width: 100vw;
  max-height: 100vh;
  display: block;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
  background: #ffffff;
}

#wizard-selection {
  display: none;
}

.diagnostics {
  position: absolute;
  left: 12px;
  top: 12px;
  width: 250px;
  max-height: calc(100vh - 96px);
  padding: 10px 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-line;
}

.toolbar {
  position: absolute;
  left: 50%;
  bottom: 12px;
  display: flex;
  gap: 6px;
  transform: translateX(-50%);
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
}

.media-status {
  position: absolute;
  left: 50%;
  top: 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 52px;
  max-width: min(360px, calc(100vw - 560px));
  transform: translateX(-50%);
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.media-status-indicator {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #9b7213;
}

.media-status strong,
.media-status small {
  display: block;
  letter-spacing: 0;
}

.media-status strong {
  font-size: 13px;
  line-height: 1.2;
}

.media-status small {
  margin-top: 3px;
  color: #5d6268;
  font-size: 11px;
  line-height: 1.2;
}

.media-status.is-animating .media-status-indicator {
  background: #13824b;
  box-shadow: 0 0 0 3px rgba(19, 130, 75, 0.14);
}

.media-status.is-stale .media-status-indicator,
.media-status.is-disabled .media-status-indicator {
  background: #b43a2f;
}

.captions {
  position: absolute;
  left: 50%;
  bottom: 72px;
  width: min(760px, calc(100vw - 32px));
  transform: translateX(-50%);
  padding: 9px 14px;
  border: 1px solid rgba(23, 25, 28, 0.18);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.94);
  color: #17191c;
  font: 700 15px/1.35 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-align: center;
}

.pose-picker {
  width: min(720px, calc(100vw - 24px));
  max-height: min(660px, calc(100vh - 24px));
  padding: 0;
  overflow: hidden;
  border: 1px solid #d7d7d2;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
}

.pose-picker::backdrop {
  background: rgba(23, 25, 28, 0.28);
}

.pose-picker-header {
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px 8px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}

.pose-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(146px, 1fr));
  gap: 7px;
  max-height: calc(min(660px, 100vh - 24px) - 52px);
  padding: 10px;
  overflow: auto;
}

.pose-button {
  width: 100%;
  height: 46px;
  padding: 6px 8px;
  overflow-wrap: anywhere;
  font-size: 11px;
  line-height: 1.15;
  text-transform: capitalize;
}

.pose-auto {
  border-color: #176db5;
  color: #0e568e;
}

button {
  width: 34px;
  height: 34px;
  border: 1px solid #d7d7d2;
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  font: 700 17px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  cursor: pointer;
}

button:hover,
button:focus-visible {
  border-color: #176db5;
  outline: none;
}

button[aria-pressed="true"] {
  border-color: #176db5;
  background: #e8f4fc;
  color: #0e568e;
}

@media (max-width: 820px) {
  .diagnostics {
    display: none;
  }

  .media-status {
    left: 8px;
    right: 8px;
    top: 8px;
    max-width: none;
    transform: none;
  }

  .captions {
    bottom: 104px;
  }

  .toolbar {
    left: 8px;
    right: 8px;
    bottom: 8px;
    display: grid;
    grid-template-columns: repeat(6, 34px);
    justify-content: center;
    transform: none;
  }

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