@import url("https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap");

:root {
  --paper: #faf7f2;
  --paper-deep: #f5f0e8;
  --wool: #efe4d4;
  --cream: #fffaf2;
  --amber: #c58a2b;
  --brown: #76593a;
  --brown-deep: #4f351f;
  --gold-soft: #e4c77f;
  --ink: #211a14;
  --muted: #6f6255;
  --line: #dccab2;
  --shadow: 0 28px 70px rgba(118, 89, 58, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Nunito Sans", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

button,
a,
input {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  width: max-content;
  max-width: calc(100% - 48px);
  margin: 22px 0 0 max(24px, calc((100vw - 1500px) / 2));
  padding: 18px 24px;
  border-radius: 38px;
  background: #fffaf4;
  box-shadow: 0 18px 48px rgba(118, 89, 58, 0.1);
}

.logo,
.script-label,
#readyNote {
  font-family: "Caveat", cursive;
}

.logo {
  color: var(--brown);
  font-size: 3rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.material-symbols-outlined {
  font-size: 1.25em;
  line-height: 1;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(420px, 0.9fr) minmax(520px, 1.1fr);
  gap: 32px;
  width: min(1500px, calc(100% - 48px));
  margin: 30px auto 42px;
}

.left-panel,
.preview-shell {
  border-radius: 46px;
  background: var(--cream);
  box-shadow: var(--shadow);
}

.left-panel {
  padding: clamp(24px, 3vw, 42px);
}

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

.small-note {
  color: var(--brown);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  font-family: "Inter", sans-serif;
  max-width: 680px;
  margin: 0;
  color: var(--brown);
  font-size: clamp(2.75rem, 5vw, 4.8rem);
  font-weight: 700;
  line-height: 1;
}

.intro p:last-child {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1.04rem, 1.6vw, 1.24rem);
  font-weight: 500;
  line-height: 1.55;
}

.capacity-note {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.capacity-note span {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1;
}

.tool-form {
  display: grid;
  gap: 22px;
}

.upload-zone {
  display: grid;
  justify-items: start;
  gap: 16px;
  min-height: 270px;
  padding: 34px;
  border: 2px dashed var(--line);
  border-radius: 48px;
  background: var(--paper-deep);
  text-align: left;
  outline: none;
  transition: transform 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

.upload-zone.dragging {
  transform: translateY(-2px);
  border-color: var(--amber);
  background: #f2e6d6;
}

.upload-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.upload-icon {
  display: grid;
  place-items: center;
  width: 82px;
  height: 82px;
  border-radius: 32px;
  color: var(--brown);
  background: var(--wool);
}

.upload-icon .material-symbols-outlined {
  font-size: 44px;
}

.upload-copy {
  display: grid;
  gap: 6px;
}

.upload-copy strong {
  color: var(--brown-deep);
  font-size: 1.26rem;
  font-weight: 700;
}

.upload-copy span {
  color: var(--muted);
  font-weight: 500;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  border: 0;
  border-radius: 999px;
  padding: 14px 24px;
  cursor: pointer;
  font-weight: 650;
  transition: transform 160ms ease, background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}

.primary-button {
  color: #fffaf4;
  background: var(--brown);
}

.primary-button:hover {
  transform: translateY(-1px);
  background: var(--brown-deep);
}

.primary-button:disabled,
.primary-button.disabled {
  cursor: not-allowed;
  pointer-events: none;
  color: #9c8d7d;
  background: #e5d8c8;
}

.secondary-button {
  color: var(--brown);
  border: 1px solid var(--line);
  background: #fffaf4;
}

.secondary-button:hover {
  transform: translateY(-1px);
  background: var(--paper-deep);
}

.secondary-button:disabled {
  cursor: not-allowed;
  color: #a99d91;
  background: #f3ece3;
}

.wide {
  width: 100%;
}

.settings {
  display: grid;
  gap: 14px;
}

.setting-group {
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: 32px;
  background: var(--paper-deep);
}

.setting-title {
  color: var(--brown-deep);
  font-weight: 700;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  min-height: 42px;
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  color: var(--muted);
  background: #fffaf4;
  cursor: pointer;
  font-weight: 600;
}

.pill.active {
  color: #fffaf4;
  background: var(--amber);
}

.progress-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: 32px;
  background: var(--paper-deep);
}

.progress-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

#stageLabel {
  color: var(--brown-deep);
  font-weight: 700;
}

#readyNote {
  color: var(--amber);
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1;
  opacity: 0;
}

.progress-card.active #readyNote {
  opacity: 1;
}

.progress-track {
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #fffaf4;
}

.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--brown);
  transition: width 240ms ease;
}

.actions {
  display: grid;
  gap: 12px;
}

.actions .primary-button:first-child {
  grid-column: auto;
}

.right-panel {
  min-width: 0;
}

.preview-shell {
  display: grid;
  gap: 20px;
  min-height: calc(100vh - 150px);
  padding: clamp(20px, 3vw, 32px);
}

.preview-topline {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

#scaleBadge {
  padding: 9px 14px;
  border-radius: 999px;
  color: var(--brown);
  background: var(--paper-deep);
  font-weight: 700;
}

.compare-stage {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  min-height: 460px;
}

.preview-pane {
  position: relative;
  overflow: hidden;
  min-height: 460px;
  border-radius: 44px;
  background-color: var(--paper-deep);
}

.preview-pane img {
  display: none;
  width: 100%;
  height: 100%;
  min-height: 460px;
  object-fit: contain;
  background: var(--paper-deep);
}

.preview-pane.has-image img {
  display: block;
}

.preview-pane.has-image .placeholder {
  display: none;
}

.script-label {
  position: absolute;
  z-index: 3;
  top: 20px;
  left: 22px;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--brown);
  background: #fffaf4;
  box-shadow: 0 12px 28px rgba(118, 89, 58, 0.12);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
}

.placeholder {
  display: grid;
  place-items: center;
  min-height: 460px;
  padding: 32px;
  color: var(--muted);
  text-align: center;
  font-weight: 600;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.meta-grid div {
  display: grid;
  gap: 4px;
  min-height: 82px;
  padding: 16px;
  border-radius: 28px;
  background: var(--paper-deep);
}

.meta-grid span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
}

.meta-grid strong {
  color: var(--brown-deep);
  font-size: 1.02rem;
  font-weight: 700;
}

@media (max-width: 1120px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .preview-shell {
    min-height: auto;
  }
}

@media (max-width: 760px) {
  .workspace {
    width: min(100% - 28px, 1500px);
  }

  .topbar {
    border-radius: 32px;
  }

  .left-panel,
  .preview-shell {
    border-radius: 34px;
  }

  .actions,
  .compare-stage,
  .meta-grid {
    grid-template-columns: 1fr;
  }

  .preview-pane,
  .preview-pane img,
  .placeholder {
    min-height: 330px;
  }

}
