:root {
  --blue: #0068d9;
  --blue-dark: #0057b8;
  --header-blue: #e6f3fa;
  --red: #e7002b;
  --green: #118a0b;
  --ink: #101820;
  --muted: #61707d;
  --line: #cdd5da;
  --line-light: #e3e8eb;
  --disabled: #d4dbe0;
  --panel: #ffffff;
  --focus: #111827;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: #f5f7f8;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
}

body {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  padding: 24px;
}

button,
input {
  font: inherit;
}

button,
label,
input[type="range"] {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
.asset-option:has(input:focus-visible) .thumbnail {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.app-shell {
  width: min(1120px, 100%);
  background: var(--panel);
  border: 1px solid #d9e0e4;
  border-radius: 4px;
  box-shadow: 0 8px 28px rgb(31 48 59 / 8%);
  overflow: hidden;
}

.app-header {
  min-height: 72px;
  padding: 0 32px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  background: var(--header-blue);
}

.brand-mark {
  width: 108px;
  height: 40px;
  display: grid;
  place-items: center;
  color: #6b7780;
  background: #d8e8f0;
  font-size: 12px;
}

.app-header h1 {
  margin: 0;
  color: #075db6;
  font-size: 18px;
  line-height: 1;
  text-transform: uppercase;
  font-family: Inter, sans-serif;
}

.app-header p {
  margin: 0;
  color: #075db6;
  font-size: 13px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 2.15fr) minmax(260px, 0.85fr);
  column-gap: 32px;
  row-gap: 36px;
  padding: 28px 32px 24px;
}

.source-column {
  min-width: 0;
}

.source-path {
  min-height: 18px;
  margin: 0 0 12px;
  color: #303b44;
  font-size: 13px;
}

#source-path {
  word-break: break-word;
}

.preview-frame {
  aspect-ratio: 16 / 10;
  min-height: 330px;
  position: relative;
  overflow: hidden;
  border: 1px dashed #7fb6dc;
  border-radius: 5px;
  background: #eff8fd;
}

.preview-frame.has-asset {
  border-style: solid;
  border-color: #d3d9dd;
  background: #e7ecef;
}

.empty-state {
  width: 100%;
  height: 100%;
  min-height: 330px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 28px;
}

.empty-state[hidden],
.asset-preview[hidden] {
  display: none;
}

.empty-icon {
  width: 66px;
  height: 66px;
  margin-bottom: 22px;
  fill: none;
  stroke: #778691;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.5;
}

.empty-state h2 {
  margin: 0 0 12px;
  font-size: 23px;
  font-family: var(--font-sans);
  color: #000000;
}

.empty-state p {
  margin: 0 0 28px;
  color: #33404a;
  font-size: 17px;
  line-height: 1.45;
}

.button {
  min-height: 48px;
  border: 0;
  border-radius: 5px;
  padding: 0 28px;
  color: #fff;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
}

.button--select {
  background: var(--blue);
}

.button--select:hover {
  background: var(--blue-dark);
}

.asset-preview {
  width: 100%;
  height: 100%;
  position: relative;
  margin: 0;
  overflow: hidden;
  background: #dfe6ea;
}

.motion-canvas {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.motion-canvas img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transform: scale(1.002);
}

.asset-preview.is-motion .motion-canvas img {
  animation: ambient-frame 2s ease-in-out infinite alternate;
}

.water-shimmer {
  position: absolute;
  inset: 62% 0 0;
  opacity: 0;
  background: linear-gradient(105deg, transparent 25%, rgb(255 255 255 / 12%) 47%, transparent 62%);
  background-size: 180% 100%;
  mix-blend-mode: screen;
  pointer-events: none;
}

.asset-preview.is-motion[data-region="water"] .water-shimmer {
  opacity: 1;
  animation: water-shimmer 2s ease-in-out infinite;
}

.asset-preview.is-motion[data-region="sky"] .motion-canvas img {
  transform-origin: center 20%;
}

.asset-label,
.asset-badge {
  position: absolute;
  left: 20px;
  z-index: 2;
  margin: 0;
  border-radius: 999px;
  background: rgb(255 255 255 / 94%);
  color: #17212a;
  text-transform: uppercase;
}

.asset-label {
  top: 18px;
  padding: 6px 10px;
  font-size: 10px;
  font-weight: 700;
}

.asset-badge {
  bottom: 18px;
  padding: 8px 14px;
  font-size: 11px;
  font-weight: 800;
}

.asset-badge[data-state="review"]::after,
.asset-badge[data-state="approved"]::after {
  content: " ✓";
  color: var(--green);
}

.processing-indicator {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgb(7 24 36 / 64%);
  color: white;
  font-size: 15px;
  font-weight: 700;
}

.processing-indicator[hidden] {
  display: none;
}

.spinner {
  width: 25px;
  height: 25px;
  border: 3px solid rgb(255 255 255 / 45%);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.controls {
  min-width: 0;
  padding-top: 42px;
}

.controls h2 {
  margin: 0 0 30px;
  font-size: 18px;
  text-transform: uppercase;
  font-family: Inter, sans-serif;
  color: #000000;
}

.control-group {
  margin: 0 0 34px;
  padding: 0;
  border: 0;
}

.control-group legend,
.control-group > label,
.control-label {
  display: block;
  margin: 0 0 12px;
  color: #5c6872;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.segmented-control {
  display: flex;
  align-items: center;
  gap: 10px;
}

.segmented-control label {
  cursor: pointer;
}

.segmented-control input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented-control span {
  min-width: 76px;
  min-height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #56636e;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.segmented-control input:checked + span {
  color: white;
  background: #5d9fd1;
}

.segmented-control input:focus-visible + span {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

fieldset:disabled .segmented-control label {
  cursor: default;
}

fieldset:disabled .segmented-control span {
  opacity: 0.42;
}

input[type="range"] {
  width: 100%;
  height: 20px;
  display: block;
  margin: 0;
  appearance: none;
  background: transparent;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 3px;
  background: #c9d0d4;
}

input[type="range"]::-moz-range-track {
  height: 3px;
  background: #c9d0d4;
}

input[type="range"]::-webkit-slider-thumb {
  width: 18px;
  height: 18px;
  margin-top: -7.5px;
  appearance: none;
  border: 0;
  border-radius: 50%;
  background: #4c5a63;
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 50%;
  background: #4c5a63;
}

input[type="range"]:disabled {
  cursor: default;
  opacity: 0.38;
}

.range-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  color: #6d7780;
  font-size: 11px;
}

.duration strong {
  display: block;
  font-size: 30px;
  line-height: 1;
}

.options {
  display: grid;
  gap: 14px;
  margin-bottom: 28px;
}

.options label {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #39454e;
  font-size: 13px;
  cursor: pointer;
}

.options input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--blue);
}

.options input:disabled + span {
  opacity: 0.5;
}

.primary-action {
  width: 100%;
  background: var(--red);
}

.primary-action:hover:not(:disabled) {
  background: #c90025;
}

.primary-action:disabled {
  color: white;
  background: var(--disabled);
  cursor: default;
}

.primary-action.is-approve {
  background: var(--green);
}

.primary-action.is-approve:hover:not(:disabled) {
  background: #0c7308;
}

.primary-action.is-approved:disabled {
  background: #6e7880;
}

.workflow {
  grid-column: 1 / -1;
  position: relative;
  padding-top: 2px;
}

.progress-track {
  height: 5px;
  position: absolute;
  top: 7px;
  right: 8px;
  left: 8px;
  overflow: hidden;
  background: var(--line-light);
}

.progress-fill {
  width: 0;
  height: 100%;
  display: block;
  background: var(--blue);
  transition: width 1.8s ease-in-out;
}

.status-list {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 0;
  padding: 0;
  list-style: none;
}

.status-list li {
  display: grid;
  justify-items: center;
  gap: 12px;
  color: #6a747d;
  font-size: 12px;
}

.status-list li:first-child {
  justify-items: start;
}

.status-list li:last-child {
  justify-items: end;
}

.status-dot {
  width: 15px;
  height: 15px;
  display: block;
  border: 3px solid white;
  border-radius: 50%;
  background: #cdd4d8;
  box-shadow: 0 0 0 1px transparent;
}

.status-list li.is-complete,
.status-list li.is-active {
  color: var(--blue);
  font-weight: 700;
}

.status-list li.is-complete .status-dot,
.status-list li.is-active .status-dot {
  background: var(--blue);
}

.status-list li[data-status="review"].is-active,
.status-list li[data-status="approved"].is-active {
  color: var(--green);
}

.status-list li[data-status="review"].is-active .status-dot,
.status-list li[data-status="approved"].is-active .status-dot {
  background: var(--green);
}

.asset-dialog {
  width: min(760px, calc(100% - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 0;
  border-radius: 7px;
  color: var(--ink);
  box-shadow: 0 24px 80px rgb(0 0 0 / 28%);
}

.asset-dialog::backdrop {
  background: rgb(19 32 40 / 72%);
}

.dialog-panel {
  position: relative;
  padding: 34px 34px 28px;
}

.dialog-panel h2 {
  margin: 0 44px 8px 0;
  font-size: 24px;
  color: var(--color-text);
    font-family: var(--font-sans);
}

.dialog-panel > p {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 15px;
}

.dialog-close {
  width: 44px;
  height: 44px;
  position: absolute;
  top: 20px;
  right: 20px;
  border: 0;
  background: transparent;
  color: #63717c;
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
}

.asset-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px 18px;
  margin: 0;
  padding: 0;
  border: 0;
}

.asset-option {
  min-width: 0;
  display: grid;
  cursor: pointer;
}

.asset-option input {
  position: absolute;
  opacity: 0;
}

.thumbnail {
  aspect-ratio: 1.7 / 1;
  position: relative;
  overflow: hidden;
  margin-bottom: 10px;
  border: 2px solid transparent;
  border-radius: 4px;
  background: #e7ebed;
}

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

.asset-option input:checked + .thumbnail {
  border-color: var(--blue);
}

.selection-check {
  width: 26px;
  height: 26px;
  position: absolute;
  top: 8px;
  right: 8px;
  display: none;
  place-items: center;
  border-radius: 50%;
  background: white;
  color: var(--blue);
  font-weight: 800;
}

.asset-option input:checked + .thumbnail .selection-check {
  display: grid;
}

.asset-option strong {
  margin-bottom: 4px;
  font-size: 15px;
}

.asset-option small {
  color: #697680;
  font-size: 14px;
}

.asset-option--unavailable {
  cursor: default;
}

.placeholder-thumbnail {
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #edf0f2, #dce1e4);
}

.placeholder-thumbnail svg {
  width: 52px;
  fill: none;
  stroke: #8d9aa3;
  stroke-width: 2.5;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 18px;
  margin-top: 30px;
}

.dialog-actions .button {
  min-height: 44px;
}

.text-button {
  border: 0;
  padding: 10px;
  background: transparent;
  color: #45525d;
  font-weight: 700;
  cursor: pointer;
}

.sr-only {
  width: 1px;
  height: 1px;
  position: absolute;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

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

@keyframes ambient-frame {
  from { transform: scale(1.002) translate3d(0, 0, 0); }
  to { transform: scale(1.018) translate3d(-0.25%, -0.15%, 0); }
}

@keyframes water-shimmer {
  0% { background-position: 130% 0; }
  100% { background-position: -80% 0; }
}

@media (max-width: 760px) {
  body {
    display: block;
    padding: 0;
    background: white;
  }

  .app-shell {
    width: 100%;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .app-header {
    padding: 14px 20px;
    grid-template-columns: auto 1fr;
    gap: 12px 16px;
  }

  .brand-mark {
    width: 70px;
  }

  .app-header h1 {
    font-size: 16px;
  }

  .app-header p {
    grid-column: 1 / -1;
  }

  .workspace {
    grid-template-columns: 1fr;
    padding: 22px 20px 28px;
  }

  .preview-frame,
  .empty-state {
    min-height: 260px;
  }

  .controls {
    padding-top: 0;
  }

  .workflow {
    grid-column: auto;
  }

  .status-list li {
    font-size: 10px;
  }

  .asset-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
