:root {
  color-scheme: light;
  --bg: #f2f5f2;
  --surface: #ffffff;
  --surface-soft: #f7f8f5;
  --text: #1f2823;
  --muted: #627066;
  --line: #dfe5dc;
  --brand: #23624f;
  --brand-strong: #174837;
  --accent: #c66a3a;
  --danger: #b3261e;
  --shadow: 0 18px 50px rgba(28, 45, 37, 0.13);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Tahoma, sans-serif;
  background:
    linear-gradient(135deg, rgba(35, 98, 79, 0.08), transparent 38%),
    var(--bg);
  color: var(--text);
}

button,
input,
a {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  padding: 32px;
  display: grid;
  place-items: center;
}

.workspace {
  width: min(1080px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 26px;
}

.header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 20px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(25px, 4vw, 38px);
  line-height: 1.2;
}

.status-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 13px;
  border-radius: 999px;
  background: #edf6f1;
  color: var(--brand-strong);
  border: 1px solid #cfe4d9;
  font-size: 13px;
  font-weight: 700;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 18px;
}

.drop-panel,
.settings-panel,
.progress-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.drop-panel {
  padding: 16px;
  min-height: 320px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.drop-zone {
  width: 100%;
  min-height: 250px;
  border: 2px dashed #9bb7ac;
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 26px;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--brand);
  background: #f0faf5;
  transform: translateY(-1px);
}

.drop-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--brand);
  color: #ffffff;
  font-size: 34px;
  line-height: 1;
}

.drop-title {
  font-size: 20px;
  font-weight: 700;
  text-align: center;
}

.drop-subtitle,
.file-summary {
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  line-height: 1.6;
}

.file-summary {
  min-height: 28px;
}

.settings-panel {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 17px;
}

.setting {
  display: grid;
  gap: 8px;
}

.setting-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

label {
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

output {
  direction: ltr;
  color: var(--brand-strong);
  font-weight: 700;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--brand);
}

input[type="number"],
input[type="text"] {
  width: 100%;
  min-height: 44px;
  border: 1px solid #cfd8d2;
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  padding: 10px 12px;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid #d9e2dc;
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
}

.toggle-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
}

.actions {
  display: grid;
  gap: 10px;
  margin-top: auto;
}

.primary-button,
.download-button {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
  font-weight: 700;
}

.primary-button {
  background: var(--brand);
  color: #ffffff;
}

.download-button {
  background: var(--accent);
  color: #ffffff;
}

.primary-button:hover,
.download-button:hover {
  filter: brightness(0.96);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.progress-panel {
  margin-top: 18px;
  padding: 16px;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 9px;
}

#progressText {
  direction: ltr;
  color: var(--brand-strong);
  font-weight: 700;
}

.progress-track {
  width: 100%;
  height: 11px;
  overflow: hidden;
  border-radius: 999px;
  background: #dfe7e1;
}

.progress-track > div {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  transition: width 0.18s ease;
}

.log {
  margin-top: 12px;
  min-height: 118px;
  max-height: 240px;
  overflow: auto;
  border: 1px solid #e0e6e2;
  border-radius: 8px;
  background: #ffffff;
  padding: 10px 12px;
  color: #334138;
  font-size: 13px;
  line-height: 1.5;
}

.log p {
  margin: 0;
  padding: 6px 0;
  border-bottom: 1px solid #f0f2ef;
}

.log p:last-child {
  border-bottom: 0;
}

.log .error {
  color: var(--danger);
  font-weight: 700;
}

@media (max-width: 820px) {
  .app-shell {
    padding: 16px;
    place-items: start center;
  }

  .workspace {
    padding: 18px;
  }

  .header,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .header {
    flex-direction: column;
  }

  .settings-panel {
    order: -1;
  }

  .drop-zone {
    min-height: 220px;
  }
}
