:root {
  --page: #faf7f2;
  --text: #2c1f10;
  --brown: #7b4f2e;
  --amber: #c8932a;
  --surface: #fff9f2;
  --soft: #f0e6d6;
  --line: rgba(123, 79, 46, 0.25);
  --muted: #7c6a58;
  --shadow: 0 24px 40px rgba(123, 79, 46, 0.08);
}

* {
  box-sizing: border-box;
}

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

button,
input,
a {
  font: inherit;
}

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

button:focus-visible,
a:focus-visible,
.drop-zone:focus-visible {
  outline: 3px solid rgba(200, 147, 42, 0.45);
  outline-offset: 3px;
}

.topbar {
  width: max-content;
  max-width: calc(100% - 48px);
  margin: 24px 0 0 max(24px, calc((100vw - 1500px) / 2));
  padding: 18px 24px;
  border-radius: 38px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.logo,
.script-note {
  font-family: "Caveat", cursive;
  font-weight: 500;
}

.logo {
  color: var(--brown);
  font-size: 3rem;
  line-height: 1;
}

.app-shell {
  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;
}

.control-panel,
.result-panel {
  border-radius: 46px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.control-panel,
.result-panel {
  padding: clamp(22px, 3vw, 42px);
}

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

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 {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: 1.12rem;
  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;
}

.compress-form {
  display: grid;
  gap: 18px;
}

.drop-zone {
  display: grid;
  justify-items: start;
  gap: 14px;
  min-height: 280px;
  padding: 34px;
  border: 2px dashed var(--line);
  border-radius: 44px;
  background: #fbf2e7;
  cursor: pointer;
}

.drop-zone.dragging {
  border-color: var(--amber);
  background: #f6ead9;
}

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

.drop-icon {
  display: grid;
  place-items: center;
  width: 82px;
  height: 82px;
  border-radius: 32px;
  background: var(--soft);
}

.drop-icon svg {
  width: 44px;
  height: 44px;
  fill: var(--brown);
}

.drop-zone strong {
  color: var(--text);
  font-size: 1.3rem;
  font-weight: 700;
}

.script-note {
  color: var(--brown);
  font-size: 1.75rem;
  line-height: 1;
}

.primary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  border-radius: 999px;
  padding: 14px 24px;
  border: 0;
  cursor: pointer;
  font-weight: 600;
}

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

.primary-button:disabled,
.primary-button.disabled {
  color: rgba(44, 31, 16, 0.45);
  background: #e7d9c7;
  pointer-events: none;
  cursor: not-allowed;
}

.ghost-button {
  color: var(--brown);
  border: 1px solid var(--line);
  background: var(--surface);
}

.wide {
  width: 100%;
}

.file-note {
  min-height: 48px;
  padding: 14px 18px;
  border-radius: 24px;
  color: var(--brown);
  background: var(--soft);
  font-weight: 600;
}

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

.settings.locked {
  opacity: 0.5;
  pointer-events: none;
}

.setting-group {
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: 32px;
  background: #fbf2e7;
}

.setting-group > span {
  color: var(--text);
  font-weight: 700;
}

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

.chip {
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  color: var(--brown);
  background: var(--soft);
  cursor: pointer;
  font-weight: 600;
}

.chip.active {
  color: var(--page);
  background: var(--amber);
}

.result-panel {
  display: grid;
  gap: 18px;
}

.result-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.result-header strong {
  color: var(--muted);
  font-weight: 600;
  text-align: right;
}

.preview-box {
  display: grid;
  place-items: center;
  min-height: 360px;
  overflow: hidden;
  border-radius: 44px;
  background: #fbf2e7;
}

.placeholder {
  padding: 32px;
  color: var(--brown);
  font-family: "Caveat", cursive;
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 500;
  text-align: center;
}

.preview-box img,
.preview-box video {
  display: none;
  width: 100%;
  height: 100%;
  max-height: 520px;
  object-fit: contain;
  background: #fbf2e7;
}

.preview-box.has-image img,
.preview-box.has-video video {
  display: block;
}

.preview-box.has-image .placeholder,
.preview-box.has-video .placeholder {
  display: none;
}

.progress-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: 32px;
  background: #fbf2e7;
}

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

.progress-line span,
.progress-line strong {
  color: var(--text);
  font-weight: 700;
}

.progress-track {
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface);
}

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

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

.meta-grid div {
  display: grid;
  gap: 6px;
  min-height: 88px;
  padding: 16px;
  border-radius: 32px;
  background: var(--surface);
  box-shadow: 0 16px 30px rgba(123, 79, 46, 0.06);
}

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

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

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

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

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

  .control-panel,
  .result-panel {
    border-radius: 34px;
  }

  .drop-zone,
  .preview-box {
    border-radius: 34px;
  }

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