:root {
  color-scheme: light;
  --ink: #1e201d;
  --muted: #62665d;
  --paper: #fffaf0;
  --panel: #f7efe0;
  --line: #dfd3bd;
  --brand: #244d31;
  --brand-2: #b35d2b;
  --accent: #e7b64f;
  --cream: #fbf6eb;
  --shadow: 0 18px 44px rgba(38, 24, 11, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(36, 77, 49, 0.12), transparent 34%),
    linear-gradient(225deg, rgba(179, 93, 43, 0.13), transparent 34%),
    #f3eadb;
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  width: min(1440px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px;
}

.workspace {
  min-height: calc(100vh - 56px);
  border: 1px solid rgba(84, 63, 38, 0.2);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.88);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 32px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(36, 77, 49, 0.1), rgba(231, 182, 79, 0.16));
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--brand-2);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.08;
}

h1 {
  max-width: 760px;
  font-size: clamp(2rem, 5vw, 4.5rem);
  font-family: Georgia, "Times New Roman", serif;
}

h2 {
  font-size: 1.55rem;
  font-family: Georgia, "Times New Roman", serif;
}

h3 {
  color: var(--brand);
  font-size: 1.05rem;
}

.status-pill {
  align-self: flex-start;
  min-width: 150px;
  padding: 10px 14px;
  border: 1px solid rgba(36, 77, 49, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  color: var(--brand);
  font-size: 0.9rem;
  font-weight: 700;
  text-align: center;
}

.tool-grid {
  display: grid;
  grid-template-columns: minmax(340px, 470px) minmax(0, 1fr);
  min-height: 720px;
}

.input-panel,
.output-panel {
  padding: 28px;
}

.input-panel {
  border-right: 1px solid var(--line);
  background: rgba(247, 239, 224, 0.76);
}

.dropzone {
  display: grid;
  place-items: center;
  min-height: 190px;
  padding: 22px;
  border: 2px dashed #b89d70;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.52);
  color: var(--muted);
  text-align: center;
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}

.dropzone input {
  display: none;
}

.dropzone strong {
  color: var(--ink);
  font-size: 1.05rem;
}

.dropzone.is-dragging {
  border-color: var(--brand-2);
  background: rgba(231, 182, 79, 0.18);
  transform: translateY(-1px);
}

.drop-icon {
  display: inline-grid;
  place-items: center;
  width: 68px;
  height: 78px;
  margin-bottom: 12px;
  border: 2px solid var(--brand);
  border-radius: 6px;
  color: var(--brand);
  font-weight: 900;
}

.file-list {
  min-height: 52px;
  margin: 14px 0 18px;
  color: var(--muted);
  font-size: 0.92rem;
}

.file-list ul {
  margin: 0;
  padding-left: 20px;
}

.field {
  display: grid;
  gap: 7px;
  margin: 14px 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

select,
textarea,
input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--cream);
  color: var(--ink);
}

select,
input {
  min-height: 46px;
  padding: 0 13px;
}

textarea {
  min-height: 230px;
  padding: 14px;
  resize: vertical;
  line-height: 1.45;
}

.small-textarea {
  min-height: 92px;
}

.controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.primary-button,
.ghost-button {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  font-weight: 800;
  cursor: pointer;
}

.primary-button {
  width: 100%;
  margin-top: 4px;
  background: var(--brand);
  color: white;
}

.help-box {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.46);
}

.help-box summary {
  min-height: 46px;
  padding: 12px 14px;
  color: var(--brand);
  font-weight: 900;
  cursor: pointer;
}

.help-box div {
  display: grid;
  gap: 9px;
  padding: 0 14px 14px;
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.45;
}

.help-box p {
  margin: 0;
}

.ghost-button {
  padding: 0 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
  color: var(--brand);
}

.output-panel {
  background: rgba(255, 250, 240, 0.76);
}

.output-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.visual-stage {
  width: 100%;
  margin-bottom: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f1e5d1;
  overflow: hidden;
}

canvas {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 7;
}

.result {
  display: grid;
  gap: 18px;
  line-height: 1.55;
}

.result p,
.result ul {
  margin: 0;
}

.result-section {
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(84, 63, 38, 0.16);
}

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

.chips span {
  padding: 7px 10px;
  border: 1px solid rgba(36, 77, 49, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  color: var(--brand);
  font-size: 0.9rem;
  font-weight: 700;
}

pre {
  max-height: 520px;
  margin: 0;
  padding: 18px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #211d19;
  color: #fff7e8;
  white-space: pre-wrap;
  word-break: break-word;
  font: 0.92rem/1.55 ui-monospace, "Cascadia Code", Consolas, monospace;
}

.menu-items {
  display: grid;
  gap: 12px;
}

.menu-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: baseline;
}

.menu-line strong {
  color: var(--brand);
}

.price {
  font-weight: 900;
  color: var(--brand-2);
}

.toast {
  color: var(--brand);
  font-weight: 800;
}

@media (max-width: 980px) {
  .app-shell {
    padding: 14px;
  }

  .topbar,
  .output-toolbar {
    flex-direction: column;
  }

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

  .input-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 560px) {
  .topbar,
  .input-panel,
  .output-panel {
    padding: 20px;
  }

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

  .menu-line {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}
