:root {
  font:
    15px/1.5 system-ui,
    sans-serif;
  color: #232333;
  background: #f6f5fa;
  accent-color: #6247df;
}
.image-downloads {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 12px;
  margin: 16px 0 24px;
  text-align: left;
}
.image-version {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  border: 1px solid #e4e1eb;
  border-radius: 12px;
  background: #fff;
}
.image-version small {
  color: #696576;
}
.image-version .download {
  margin-top: auto;
  text-align: center;
}
#preview .image-version .thumbnail {
  width: 80px;
  height: 80px;
  object-fit: contain;
  align-self: flex-start;
}
.optimization-status {
  color: #696576;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
header {
  background: #fff;
  border-bottom: 1px solid #e5e3ed;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 18px max(24px, calc((100vw - 1440px) / 2));
}
.brand {
  font-size: 26px;
  font-weight: 800;
  text-decoration: none;
  color: #6247df;
  white-space: nowrap;
}
.brand span {
  color: #454254;
  font-size: 16px;
  font-weight: 500;
  margin-left: 16px;
}
header label {
  margin-left: auto;
  display: flex;
  gap: 12px;
  align-items: center;
}
main {
  max-width: 1440px;
  margin: auto;
  padding: 36px 24px;
}
h1 {
  font-size: 36px;
  letter-spacing: -1.2px;
  margin: 8px 0;
}
h2 {
  font-size: 20px;
  margin: 12px 0;
}
.intro p {
  color: #696576;
  margin: 6px 0;
}
.eyebrow {
  font-size: 11px !important;
  letter-spacing: 2px;
  font-weight: 750;
  color: #705bcb !important;
}
.studio {
  display: grid;
  grid-template-columns: minmax(340px, 430px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.composer,
.results,
.library {
  min-width: 0;
  background: #fff;
  border: 1px solid #e4e1eb;
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 4px 18px #00000005;
}
.row {
  display: flex;
  gap: 14px;
  align-items: center;
}
.row > label {
  flex: 1;
  min-width: 0;
}
.preset-search-label {
  margin-bottom: 4px;
}
.preset-search-status {
  margin: 0 0 16px;
  color: #696576;
  font-size: 12px;
}
.preset-source {
  min-width: 0;
  margin: 0 0 20px;
  padding: 14px;
  border: 1px solid #e4e1eb;
  border-radius: 10px;
  background: #f8f7fb;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.preset-source p {
  margin: 8px 0;
}
.preset-source .preset-attribution {
  margin-top: 0;
  font-weight: 750;
}
.preset-source a {
  color: #5236cf;
}
.preset-source details {
  margin-top: 12px;
}
.preset-source summary {
  cursor: pointer;
  font-weight: 650;
}
.preset-original {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 260px;
  overflow-y: auto;
}
.preset-source button {
  margin-top: 8px;
}
.preset-source video {
  display: block;
  width: 100%;
  max-height: 360px;
  background: #171220;
  border-radius: 8px;
  margin-top: 12px;
}
.preset-sample-status {
  color: #696576;
}
#review-prompt {
  font-size: 13px;
}
.row h2 {
  margin-right: auto;
}
label {
  display: block;
  font-size: 13px;
  font-weight: 650;
  margin-bottom: 16px;
}
input,
textarea,
select {
  display: block;
  width: 100%;
  font: inherit;
  background: #fff;
  border: 1px solid #d5d1e0;
  border-radius: 9px;
  padding: 10px;
  color: inherit;
  margin-top: 6px;
}
input[type="checkbox"] {
  width: auto;
  display: inline;
  margin-right: 8px;
}
textarea {
  min-height: 136px;
  resize: vertical;
}
fieldset {
  min-width: 0;
  border: 0;
  padding: 0;
  margin: 12px 0 24px;
}
legend {
  font-size: 16px;
  font-weight: 750;
  margin-bottom: 14px;
}
button,
.download {
  font: inherit;
  font-weight: 650;
  border: 1px solid #d8d3e3;
  border-radius: 9px;
  padding: 10px 16px;
  background: #fff;
  color: #484154;
  cursor: pointer;
  text-decoration: none;
}
button:hover,
.download:hover {
  background: #f1edff;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
.primary {
  background: #6247df;
  color: white;
  border-color: #6247df;
}
.primary:hover {
  background: #5236cf;
}
form > .primary {
  width: 100%;
  margin-top: 6px;
}
small {
  color: #777080;
}
#notice {
  min-height: 24px;
  color: #6247df;
  overflow-wrap: anywhere;
}
#notice.error {
  color: #a32939;
}
#review {
  background: #f6f2ff;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
}
pre {
  max-height: 330px;
  overflow: auto;
  white-space: pre-wrap;
  font-size: 12px;
}
#preview {
  min-height: 260px;
  display: grid;
  place-items: center;
  background: #f8f7fb;
  border-radius: 12px;
  margin-bottom: 24px;
  padding: 16px;
}
#preview img,
#preview video {
  max-width: 100%;
  max-height: 520px;
  border-radius: 8px;
}
#preview audio {
  width: 100%;
}
.empty {
  text-align: center;
  color: #696576;
  padding: 50px 20px;
}
.empty span {
  font-size: 40px;
  color: #9883e3;
}
.empty h2 {
  color: #514862;
}
.empty p {
  max-width: 350px;
}
.job {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid #eeeaf3;
}
.job-main {
  flex: 1;
  min-width: 0;
}
.job-main small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}
.badge {
  font-size: 12px;
  border-radius: 8px;
  padding: 4px 8px;
  background: #eeebfa;
}
.library {
  margin-top: 26px;
}
.library summary {
  font-weight: 750;
  cursor: pointer;
}
.library-item {
  padding: 12px 0;
  border-top: 1px solid #eeeaf3;
  overflow-wrap: anywhere;
}
#file-list {
  padding-left: 18px;
  font-size: 12px;
}
#file-list button {
  font-size: 11px;
  padding: 3px 7px;
  margin-left: 8px;
}
[hidden] {
  display: none !important;
}
:focus-visible {
  outline: 3px solid #b9a9f4;
  outline-offset: 2px;
}
@media (max-width: 860px) {
  header {
    flex-wrap: wrap;
    padding: 16px;
  }
  .brand {
    width: 100%;
  }
  header label {
    margin-left: 0;
  }
  .studio {
    grid-template-columns: minmax(0, 1fr);
  }
  main {
    padding: 20px 16px;
  }
  h1 {
    font-size: 28px;
  }
  .row {
    flex-wrap: wrap;
  }
  .row > label {
    min-width: 130px;
  }
  .composer,
  .results {
    padding: 18px;
  }
}

#preview video {
  width: 100%;
  background: #171220;
}
#fields fieldset:nth-child(2) {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 12px;
}

#realtime-status {
  font-size: 0.8rem;
  color: var(--muted, #667085);
}
#realtime-status[data-state="live"] {
  color: #15734b;
}
#realtime-status[data-state="live"]::before {
  content: "● ";
}

.login-panel {
  max-width: 560px;
  margin: 8vh auto;
}
.login-panel form {
  display: grid;
  gap: 20px;
  margin: 28px 0;
}
.login-panel input {
  width: 100%;
}
.login-panel details {
  margin: 28px 0;
}
.login-panel summary {
  cursor: pointer;
}
.login-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
[hidden] {
  display: none !important;
}
