:root {
  color-scheme: light;
  --cream: #f5efe5;
  --ink: #382b24;
  --muted: #766454;
  --burgundy: #61374a;
  --line: #d8cbbc;
  --copper: #aa754c;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.6;
}
button,
input,
a {
  font: inherit;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input {
  color: inherit;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
summary:focus-visible,
.dropzone:focus-within {
  outline: 3px solid var(--copper);
  outline-offset: 4px;
}
h1,
h2,
p {
  margin: 0;
}
h1 {
  font-family: Georgia, serif;
  font-size: 44px;
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -1.6px;
  margin: 12px 0 20px;
}
h2 {
  font-weight: 500;
  font-size: 17px;
  line-height: 1.4;
}
p {
  color: var(--muted);
}
.eyebrow {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 600;
}
.fine {
  font-size: 12px;
  line-height: 1.6;
}
.brand {
  font-size: 27px;
  font-weight: 650;
  letter-spacing: -1.3px;
  display: flex;
  align-items: center;
  gap: 22px;
}
.brand span {
  font-size: 11px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  font-weight: 400;
  border-left: 1px solid var(--line);
  padding-left: 22px;
}
.header {
  height: 84px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 38px;
  border-bottom: 1px solid var(--line);
}
.header-end {
  display: flex;
  align-items: center;
  gap: 26px;
}
.private {
  font-size: 12px;
  color: var(--muted);
}
.text-button {
  padding: 8px 0;
  min-height: 44px;
  background: none;
  border: none;
  color: var(--burgundy);
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}
.workspace {
  display: grid;
  grid-template-columns: 350px minmax(0, 1fr);
  max-width: 1800px;
  margin: auto;
}
.sidebar {
  border-right: 1px solid var(--line);
  padding: 34px 28px;
}
.upload-section > p {
  margin-bottom: 18px;
}
.primary {
  background: var(--burgundy);
  color: #fff6eb;
  border: 0;
  border-radius: 9px;
  padding: 15px 20px;
  min-height: 48px;
  font-weight: 550;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.primary:hover {
  background: #75425a;
}
#upload-form .primary {
  width: 100%;
  margin-top: 16px;
}
.dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 1px dashed #bba892;
  border-radius: 10px;
  padding: 25px 12px;
  cursor: pointer;
  background: #faf6ef;
}
.dropzone.dragover {
  border: 2px solid var(--burgundy);
  background: #eee4d7;
}
.dropzone strong {
  font-size: 13px;
  font-weight: 500;
}
.dropzone span {
  font-size: 12px;
  color: var(--muted);
}
.dropzone small {
  font-size: 10px;
  color: var(--muted);
  margin-top: 12px;
}
.dropzone .upload-icon {
  font-size: 28px;
  line-height: 1;
  margin: 0 0 14px;
}
.dropzone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}
.upload-preview {
  width: 100%;
  max-height: 180px;
  object-fit: contain;
  background: #e8dfd4;
  border-radius: 8px;
  margin-top: 12px;
}
#filename {
  overflow-wrap: anywhere;
  margin-top: 6px;
}
#upload-error,
#login-error {
  color: #9c2929;
  margin: 12px 0;
  min-height: 0;
}
.notice {
  border-left: 3px solid var(--copper);
  padding-left: 12px;
  font-size: 12px;
}
.dropzone[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
}
.generation-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  color: var(--burgundy);
  font-size: 12px;
  line-height: 1.6;
}
.spinner {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  border: 2px solid var(--line);
  border-top-color: var(--burgundy);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
.is-generating .bottle-outline {
  animation: breathe 2s ease-in-out infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes breathe {
  50% {
    opacity: 1;
    filter: drop-shadow(0 0 12px #cb9d61);
  }
}
@media (prefers-reduced-motion: reduce) {
  .spinner,
  .is-generating .bottle-outline {
    animation: none;
  }
}
details {
  font-size: 12px;
  margin: 20px 0;
}
summary {
  cursor: pointer;
  color: var(--ink);
  padding: 8px 0;
}
details p {
  margin-top: 10px;
}
.history {
  border-top: 1px solid var(--line);
  padding-top: 24px;
  margin-top: 28px;
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.section-heading h2 {
  font-size: 13px;
}
.section-heading span {
  font-size: 11px;
  color: var(--muted);
}
.job {
  width: 100%;
  border: 1px solid transparent;
  background: none;
  text-align: left;
  padding: 10px;
  display: flex;
  gap: 12px;
  align-items: center;
  border-radius: 9px;
  margin-bottom: 5px;
}
.job.selected {
  background: #e9dfd1;
  border-color: #d2bfac;
}
.job img {
  width: 38px;
  height: 58px;
  object-fit: contain;
  background: #d5c7b7;
  border-radius: 4px;
}
.job strong {
  display: block;
  font-weight: 500;
  font-size: 12px;
  line-height: 1.4;
}
.job small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 4px;
}
.viewer-panel {
  padding: 34px 34px 20px;
  min-width: 0;
}
.viewer-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 15px;
  min-height: 75px;
}
.viewer-heading h2 {
  font-family: Georgia, serif;
  font-size: 24px;
  font-weight: 400;
  letter-spacing: -0.4px;
  margin-top: 6px;
}
.status-badge {
  font-size: 10px;
  white-space: nowrap;
  background: #e4d9c9;
  border-radius: 30px;
  padding: 5px 10px;
  color: #69563e;
}
.stage {
  height: min(68vh, 780px);
  min-height: 420px;
  position: relative;
  overflow: hidden;
  background: #211d1b;
  border-radius: 12px;
}
canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}
.empty-stage {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  gap: 26px;
}
.empty-stage p {
  text-align: center;
  color: #c1aa91;
  font-family: Georgia, serif;
  font-size: 22px;
  line-height: 1.45;
}
.empty-stage em {
  color: #847361;
}
.bottle-outline {
  height: 145px;
  width: 49px;
  border: 1px solid #806c53;
  border-radius: 20px 20px 9px 9px;
  position: relative;
  opacity: 0.7;
}
.bottle-outline:before {
  content: "";
  position: absolute;
  width: 17px;
  height: 48px;
  top: -39px;
  left: 15px;
  background: #211d1b;
  border: 1px solid #806c53;
  border-radius: 3px 3px 0 0;
}
.bottle-outline:after {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 16px;
  height: 64px;
  border: 1px solid #806c53;
}
.stage-message {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 68px;
  text-align: center;
  color: #ddc8b1;
  font-size: 12px;
}
.stage-controls {
  position: absolute;
  bottom: 18px;
  left: 15px;
  right: 15px;
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
}
.stage-controls button {
  background: #39312ae6;
  color: #eddac4;
  border: 1px solid #5b4c3e;
  border-radius: 30px;
  padding: 8px 15px;
  min-height: 40px;
  font-size: 11px;
}
.stage-controls button[aria-pressed="true"] {
  background: #70434d;
}
.result {
  display: flex;
  justify-content: space-between;
  gap: 22px;
  padding-top: 24px;
}
.result p:not(.eyebrow) {
  font-size: 12px;
  margin-top: 8px;
  max-width: 450px;
}
.result ul {
  padding-left: 16px;
  color: var(--muted);
  font-size: 11px;
  max-width: 450px;
}
.result-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 0;
}
.result .primary {
  font-size: 12px;
}
.viewer-footnote {
  font-size: 11px;
  margin-top: 22px;
  max-width: 680px;
}
.login-page {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 30px;
}
.login-card {
  width: min(100%, 420px);
}
.login-card .brand {
  margin-bottom: 55px;
}
.login-card > p.eyebrow {
  margin-bottom: 10px;
}
.login-card h1 {
  font-size: 46px;
}
.login-card form {
  margin: 30px 0;
}
.login-card label {
  display: block;
  font-size: 12px;
  margin-bottom: 8px;
}
.login-card input {
  width: 100%;
  padding: 13px;
  background: #fffbf5;
  border: 1px solid var(--line);
  border-radius: 7px;
}
.login-card button {
  width: 100%;
  margin-top: 16px;
}
[hidden] {
  display: none !important;
}
@media (min-width: 1500px) {
  .workspace {
    grid-template-columns: 390px minmax(0, 1fr);
  }
  .sidebar {
    padding: 42px;
  }
  .viewer-panel {
    padding: 42px 48px;
  }
}
@media (max-width: 850px) {
  .header {
    height: 70px;
    padding: 0 20px;
  }
  .private {
    display: none;
  }
  .brand {
    gap: 14px;
  }
  .brand span {
    padding-left: 14px;
    font-size: 9px;
  }
  .workspace {
    display: flex;
    flex-direction: column;
  }
  .sidebar {
    border: 0;
    border-bottom: 1px solid var(--line);
    padding: 26px 22px;
  }
  .upload-section h1 br {
    display: none;
  }
  h1 {
    font-size: 36px;
  }
  .history {
    margin-top: 20px;
  }
  .viewer-panel {
    padding: 24px 18px;
  }
  .stage {
    min-height: 460px;
    height: 65vh;
  }
  .result {
    flex-direction: column;
  }
  .result-actions {
    align-items: flex-start;
  }
  .viewer-heading h2 {
    font-size: 21px;
  }
  .dropzone {
    padding: 18px;
  }
  #jobs {
    display: flex;
    gap: 8px;
    overflow: auto;
    max-height: 180px;
  }
  .job {
    min-width: 170px;
    max-width: 220px;
  }
  .upload-preview {
    max-height: 160px;
  }
}
