:root {
  color-scheme: light;
  --ink: #17212b;
  --muted: #5a6672;
  --line: #a8cdea;
  --surface: #e9f6ff;
  --panel: #f7fcff;
  --accent: #28b463;
  --accent-strong: #1f8f4f;
  --focus: #b54708;
  --danger: #a32020;
}

* {
  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;
  background: linear-gradient(180deg, #eef9ff 0%, #d7efff 100%);
  color: var(--ink);
}

.app-shell {
  width: min(1040px, calc(100% - 32px));
  margin: 0 auto;
  padding: 56px 0;
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 44px;
  align-items: start;
}

.intro {
  padding-top: 18px;
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 4.3rem);
  line-height: 1;
  letter-spacing: 0;
}

.lede {
  max-width: 560px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.6;
}

.translator-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(23, 33, 43, 0.12);
  padding: 24px;
}

form {
  display: grid;
  gap: 20px;
}

.drop-zone {
  min-height: 176px;
  border: 2px dashed #91a7b8;
  border-radius: 8px;
  background: var(--surface);
  display: grid;
  place-content: center;
  gap: 8px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
}

.drop-zone:focus-within,
select:focus,
button:focus {
  outline: 3px solid rgba(181, 71, 8, 0.25);
  outline-offset: 2px;
}

.drop-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.drop-title {
  font-size: 1.35rem;
  font-weight: 800;
}

.drop-detail {
  color: var(--muted);
  line-height: 1.5;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

label span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  padding: 0 12px;
}

.privacy-note {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 0;
  padding: 14px;
  display: grid;
  gap: 6px;
  background: #ffffff;
}

.privacy-note strong {
  color: var(--ink);
  font-size: 0.98rem;
  font-weight: 800;
}

.privacy-note span {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

button {
  min-height: 52px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

button:hover {
  background: var(--accent-strong);
}

button:disabled {
  background: #7d8b95;
  cursor: wait;
}

.progress-panel {
  display: grid;
  gap: 8px;
}

.progress-header {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 0.92rem;
  font-weight: 800;
  justify-content: space-between;
}

.progress-track {
  background: #d7edf9;
  border: 1px solid var(--line);
  border-radius: 8px;
  height: 14px;
  overflow: hidden;
}

.progress-fill {
  background: linear-gradient(90deg, var(--accent), #58d68d);
  height: 100%;
  transition: width 180ms ease;
  width: 0;
}

.download-panel {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.download-name {
  margin: 0 0 12px;
  color: var(--ink);
  font-weight: 800;
  overflow-wrap: anywhere;
}

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

.preview-panel {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.preview-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 10px;
}

.preview-header h2 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0;
}

.preview-header span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
}

#previewText {
  margin: 0;
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font: 0.95rem/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  padding: 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.status {
  min-height: 24px;
  margin-top: 18px;
  color: var(--muted);
  line-height: 1.5;
}

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

.status.success {
  color: var(--accent-strong);
  font-weight: 700;
}

@media (max-width: 820px) {
  .app-shell {
    grid-template-columns: 1fr;
    padding: 32px 0;
    gap: 26px;
  }

  .intro {
    padding-top: 0;
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100% - 20px, 1040px);
  }

  .translator-panel {
    padding: 16px;
  }

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

  .download-actions {
    grid-template-columns: 1fr;
  }

  .preview-header {
    align-items: flex-start;
    flex-direction: column;
  }
}
