:root {
  color-scheme: light;
  --paper: #faf9f6;
  --ink: #202027;
  --muted: #74746f;
  --line: #e4e1db;
  --orange: #f45126;
  --soft: #f0ede7;
  font-family: "Space Grotesk", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
textarea,
select {
  font: inherit;
}
button,
select,
summary {
  cursor: pointer;
}
button {
  color: inherit;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}
[hidden] {
  display: none !important;
}
a {
  color: inherit;
  text-decoration: none;
}
h1,
h2,
p {
  margin: 0;
}
button {
  transition:
    background 0.15s,
    border-color 0.15s;
}
button:hover:not(:disabled),
.upload-button:hover {
  border-color: #b9b5ab;
  background: var(--soft);
}
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 3px;
}
.topbar {
  height: 72px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 26px;
  padding: 0 28px;
}
.wordmark {
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -1.4px;
  color: var(--orange);
  display: flex;
  align-items: center;
  gap: 7px;
}
.wordmark span {
  font-size: 28px;
}
.workspace-label {
  font-size: 13px;
  border-left: 1px solid var(--line);
  padding-left: 26px;
}
.topbar__meta {
  margin-left: auto;
  display: flex;
  gap: 12px;
  align-items: center;
}
.meta-pill {
  font-size: 12px;
  white-space: nowrap;
  color: #427254;
  background: #eaf1e8;
  padding: 7px 11px;
  border-radius: 30px;
}
.meta-pill.is-error {
  background: #ffebe3;
  color: #a73c23;
}
.ghost-button,
.upload-button,
.export-button,
.icon-button {
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 9px;
  padding: 10px 13px;
  font-size: 12px;
  line-height: 1.3;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}
.export-button {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
}
.export-button:hover:not(:disabled) {
  background: #3b3b43;
  color: white;
}
.icon-button {
  padding: 7px 10px;
  min-width: 32px;
  font-size: 19px;
}
.studio {
  height: calc(100dvh - 72px);
  min-height: 580px;
  display: grid;
  grid-template-columns: 300px minmax(300px, 1fr) 250px;
}
.composer {
  padding: 27px 22px 20px;
  overflow: auto;
  border-right: 1px solid var(--line);
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 1.5px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 13px;
}
h1 {
  font-size: 33px;
  letter-spacing: -1.5px;
  line-height: 1.1;
}
.lede {
  font-size: 13px;
  line-height: 1.65;
  color: var(--muted);
  margin-top: 12px;
}
.prompt-form {
  margin-top: 25px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.field__label {
  font-size: 11px;
  font-weight: 500;
  color: #555650;
}
.field textarea,
.field input[type="email"],
.field select,
.auth-input {
  width: 100%;
  border: 1px solid #d9d6cf;
  border-radius: 9px;
  background: #fffefd;
  color: var(--ink);
  padding: 11px;
  font-size: 12px;
  line-height: 1.6;
  min-width: 0;
}
.field textarea {
  resize: vertical;
  min-height: 85px;
}
.prompt-field textarea {
  min-height: 143px;
}
.field select {
  height: 40px;
  padding: 7px;
}
.field textarea:focus,
.field input[type="email"]:focus,
.field select:focus,
.auth-input:focus {
  border-color: var(--orange);
  outline: 1px solid var(--orange);
}
textarea::placeholder {
  color: #93928c;
}
.toolbar {
  display: flex;
  gap: 8px;
}
.upload-button {
  position: relative;
  flex: 1;
  cursor: pointer;
}
.upload-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.upload-button:focus-within {
  outline: 2px solid var(--orange);
}
.controls-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.reference-chip {
  display: flex;
  gap: 8px;
  align-items: center;
  background: var(--soft);
  border-radius: 8px;
  padding: 5px 8px 5px 12px;
  font-size: 11px;
}
.reference-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.reference-chip button {
  border: 0;
}
.settings {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.settings summary {
  font-size: 12px;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
}
.settings summary::after {
  content: "+";
  margin-left: auto;
  font-size: 17px;
  color: var(--muted);
}
.settings[open] summary::after {
  content: "−";
}
.optional {
  font-size: 10px;
  color: var(--muted);
}
.settings__body {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}
.toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  line-height: 1.5;
}
.toggle-row input {
  accent-color: var(--orange);
}
.field__hint {
  font-size: 10px;
  line-height: 1.6;
  color: var(--muted);
}
.submit-button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  width: 100%;
  padding: 15px 17px;
  background: var(--orange);
  border: 1px solid var(--orange);
  color: white;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
}
.submit-button:hover:not(:disabled) {
  background: #dc421b;
  border-color: #dc421b;
}
.generate-actions {
  margin-top: 4px;
}
.shortcut {
  text-align: center;
  font-size: 10px;
  color: var(--muted);
  margin-top: 10px;
}
kbd {
  font: inherit;
  background: #eeece7;
  padding: 1px 3px;
  border-radius: 3px;
}
.status-line {
  font-size: 11px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.status-line:empty {
  display: none;
}
.is-error {
  color: #ad331f;
}
.is-success {
  color: #417251;
}
.quick-edits {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.quick-edits button {
  font-size: 10px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: transparent;
  padding: 6px 8px;
}
.stage {
  padding: 0 18px 16px;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.canvas-top {
  height: 49px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--muted);
}
#canvas-dimensions {
  letter-spacing: 0;
}
.stage__frame {
  position: relative;
  flex: 1;
  min-height: 260px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background-color: #eeede9;
  background-image: conic-gradient(
    #e7e6e2 25%,
    transparent 0 50%,
    #e7e6e2 0 75%,
    transparent 0
  );
  background-size: 24px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 28px;
}
.stage__frame.is-dragover {
  outline: 3px solid var(--orange);
  outline-offset: -4px;
}
.stage__placeholder {
  text-align: center;
  max-width: 380px;
  padding: 35px 22px;
  background: var(--paper);
  border: 1px dashed #c8c4bb;
  border-radius: 12px;
}
.empty-art {
  font-size: 58px;
  color: #65675f;
  position: relative;
  display: inline-block;
  margin-bottom: 24px;
  line-height: 1;
}
.empty-art span {
  position: absolute;
  right: -15px;
  top: -9px;
  font-size: 26px;
  color: var(--orange);
}
.stage__placeholder h2 {
  font-size: 25px;
  letter-spacing: -0.8px;
  line-height: 1.2;
  margin-bottom: 16px;
}
.stage__placeholder p {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
}
.empty-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 25px 0 16px;
}
.empty-actions button {
  background: #fff;
}
.file-hint {
  font-size: 9px;
  color: #929089;
}
.stage__frame > img {
  display: none;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  flex-shrink: 0;
  box-shadow: 0 10px 35px #00000014;
}
.stage__frame > img.is-visible {
  display: block;
}
.canvas-footer {
  padding: 17px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}
.stage__caption {
  min-width: 0;
}
.stage__caption-title {
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 55vw;
}
.stage__caption-body {
  font-size: 10px;
  line-height: 1.5;
  color: var(--muted);
  margin-top: 4px;
}
.zoom-controls {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.zoom-controls button {
  border: 0;
  padding: 6px;
}
.stage__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.history {
  border-left: 1px solid var(--line);
  padding: 28px 18px 18px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: auto;
}
.history__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.history h2 {
  font-size: 17px;
  letter-spacing: -0.5px;
}
.history__header button {
  border: 0;
}
.history__hint {
  font-size: 10px;
  color: var(--muted);
  margin: 8px 0 24px;
}
.jobs-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.gallery__empty {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.9;
  padding: 50px 8px;
  text-align: center;
}
.job-card {
  display: flex;
  gap: 10px;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px;
  width: 100%;
  min-width: 0;
}
.job-card.is-active {
  border-color: #f4bcaa;
  background: #fff0e9;
}
.job-card__media {
  width: 46px;
  height: 48px;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 5px;
  background: var(--soft);
}
.job-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.job-card__placeholder {
  display: grid;
  place-items: center;
  height: 100%;
  font-size: 8px;
  color: var(--muted);
}
.job-card__content {
  min-width: 0;
  flex: 1;
}
.job-card__topline {
  display: flex;
  justify-content: space-between;
  font-size: 8px;
  color: var(--muted);
  gap: 4px;
}
.job-card__stamp {
  font-size: 7px;
}
.job-card__prompt {
  font-size: 11px;
  line-height: 1.45;
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.job-card__meta {
  font-size: 8px;
  color: var(--muted);
  margin-top: 5px;
}
.history__footer {
  font-size: 9px;
  color: var(--muted);
  padding-top: 30px;
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}
.history-dot {
  height: 5px;
  width: 5px;
  border-radius: 50%;
  background: #81a381;
}
.completed-history {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 11px;
}
.completed-history > button {
  margin: 12px 0;
}
.gallery__strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.gallery__item {
  padding: 0;
  background: none;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
  text-align: left;
}
.gallery__thumb {
  aspect-ratio: 1;
  background: var(--soft);
}
.gallery__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.gallery__meta {
  padding: 6px;
  font-size: 9px;
}
.gallery__stamp {
  font-size: 8px;
  color: var(--muted);
}
.annotate-dialog {
  width: min(1100px, 95vw);
  max-height: 95dvh;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  color: var(--ink);
}
.annotate-dialog::backdrop {
  background: #15141c88;
  backdrop-filter: blur(4px);
}
.annotate-dialog__sheet {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-height: 92dvh;
}
.annotate-dialog__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.annotate-dialog__header h2 {
  font-size: 21px;
}
.annotate-dialog__header p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}
.annotate-dialog__toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.annotate-dialog__toolbar .field {
  gap: 5px;
}
.annotate-dialog__toolbar input[type="range"] {
  width: 120px;
  accent-color: var(--orange);
}
input[type="color"] {
  width: 42px;
  height: 28px;
  border: 0;
  background: none;
  padding: 0;
}
.annotate-dialog__canvas-wrap {
  background: #e7e5df;
  border-radius: 8px;
  overflow: auto;
  min-height: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}
.annotate-dialog canvas {
  max-width: 100%;
  max-height: 58dvh;
  object-fit: contain;
  touch-action: none;
  cursor: crosshair;
  background: white;
  display: block;
}
.annotate-dialog__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.annotate-dialog__footer .submit-button {
  width: auto;
}
.auth-shell {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.auth-card {
  width: min(420px, 100%);
  padding: 35px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.auth-copy {
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
  margin: 15px 0 25px;
}
.auth-form {
  display: grid;
  gap: 18px;
}
.auth-card h1 {
  color: var(--orange);
}
@media (min-width: 1600px) {
  .studio {
    grid-template-columns: 330px minmax(300px, 1fr) 280px;
  }
  .composer {
    padding: 32px 28px;
  }
  .stage {
    padding: 0 25px 22px;
  }
  .history {
    padding: 32px 22px;
  }
}
@media (max-width: 1150px) {
  .studio {
    grid-template-columns: 280px minmax(300px, 1fr) 210px;
  }
  .composer {
    padding: 25px 17px;
  }
  .history {
    padding: 25px 12px;
  }
  .stage {
    padding: 0 12px 15px;
  }
  .stage__frame {
    padding: 15px;
  }
  .stage__placeholder {
    padding: 28px 14px;
  }
  .stage__placeholder h2 {
    font-size: 22px;
  }
  .canvas-top {
    font-size: 8px;
  }
  .job-card {
    padding: 6px;
    gap: 6px;
  }
  .job-card__stamp {
    display: none;
  }
}
@media (max-width: 950px) {
  .studio {
    grid-template-columns: 280px minmax(280px, 1fr);
    height: auto;
    min-height: calc(100dvh - 72px);
  }
  .stage {
    height: calc(100dvh - 72px);
    min-height: 560px;
    position: sticky;
    top: 0;
  }
  .composer {
    overflow: visible;
  }
  .history {
    grid-column: 1/-1;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .jobs-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }
  .history__footer {
    margin-top: 20px;
  }
  .gallery__strip {
    grid-template-columns: repeat(6, 1fr);
  }
  .workspace-label {
    display: none;
  }
  .stage__caption-title {
    max-width: 35vw;
  }
}
@media (max-width: 620px) {
  .topbar {
    height: 62px;
    padding: 0 14px;
    gap: 10px;
  }
  .wordmark {
    font-size: 22px;
  }
  .wordmark span {
    display: none;
  }
  .topbar__meta {
    gap: 6px;
  }
  .topbar__meta button {
    font-size: 10px;
    padding: 8px;
  }
  .meta-pill {
    font-size: 9px;
    padding: 5px 7px;
  }
  .export-button span {
    display: none;
  }
  .studio {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }
  .composer {
    order: 2;
    border-right: 0;
    padding: 22px 20px;
  }
  .hero-copy {
    display: none;
  }
  .prompt-form {
    margin-top: 0;
  }
  .prompt-field textarea {
    min-height: 105px;
  }
  .stage {
    order: 1;
    position: static;
    height: 380px;
    min-height: 380px;
    padding: 0 14px 12px;
  }
  .canvas-top {
    height: 36px;
  }
  .stage__frame {
    min-height: 230px;
    padding: 12px;
  }
  .stage__placeholder {
    padding: 18px;
    background: #faf9f6ed;
    width: 100%;
    max-width: 340px;
  }
  .empty-art {
    display: none;
  }
  .stage__placeholder h2 {
    font-size: 21px;
    margin-bottom: 8px;
  }
  .stage__placeholder h2 br {
    display: none;
  }
  .stage__placeholder p {
    font-size: 10px;
  }
  .empty-actions {
    margin: 14px 0 10px;
  }
  .canvas-footer {
    padding-top: 10px;
  }
  .stage__caption-title {
    max-width: 64vw;
    font-size: 10px;
  }
  .stage__caption-body {
    display: none;
  }
  .history {
    order: 3;
    padding: 22px 20px;
  }
  .jobs-list {
    grid-template-columns: 1fr 1fr;
  }
  .gallery__strip {
    grid-template-columns: repeat(3, 1fr);
  }
  .annotate-dialog__sheet {
    padding: 14px;
  }
  .annotate-dialog__header h2 {
    font-size: 18px;
  }
  .annotate-dialog__header p {
    font-size: 10px;
  }
  .annotate-dialog__toolbar {
    gap: 8px;
  }
  .annotate-dialog__toolbar button {
    font-size: 10px;
    padding: 7px;
  }
  .annotate-dialog__footer {
    flex-direction: column;
    align-items: stretch;
  }
  .annotate-dialog__footer .submit-button {
    width: 100%;
  }
  .shortcut {
    display: none;
  }
  .settings summary {
    min-height: 25px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 620px) {
  body {
    padding-bottom: 82px;
  }
  .generate-actions {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 20px max(12px, env(safe-area-inset-bottom));
    background: var(--paper);
    border-top: 1px solid var(--line);
    z-index: 5;
  }
  .stage__placeholder h2 br {
    display: initial;
  }
  .stage__placeholder h2 {
    font-size: 20px;
  }
  .prompt-form {
    gap: 14px;
  }
}
