:root {
  --bg: #f5f1e9;
  --paper: #fffdf8;
  --ink: #171717;
  --muted: #716d65;
  --line: #d9d2c6;
  --accent: #ff5c35;
  --accent-dark: #d8401d;
  --soft: #ece6da;
  --radius: 24px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 0%, rgba(255,92,53,.10), transparent 26rem),
    var(--bg);
  color: var(--ink);
}
button, select, textarea { font: inherit; }
button { cursor: pointer; }
.shell { width: min(760px, calc(100% - 32px)); margin: 0 auto; padding: 42px 0 28px; }
.header { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.eyebrow { margin: 0 0 7px; font-size: 11px; font-weight: 800; letter-spacing: .13em; color: var(--muted); }
h1 { margin: 0; font-size: clamp(38px, 8vw, 68px); line-height: .9; letter-spacing: -.065em; }
h1 span { color: var(--accent); }
h2 { margin: 0; font-size: 22px; letter-spacing: -.025em; }
.status-pill { flex: none; display: inline-flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.45); font-size: 13px; color: var(--muted); }
.status-pill i { width: 7px; height: 7px; border-radius: 50%; background: #2f9f62; }
.card { background: rgba(255,253,248,.92); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: 0 18px 50px rgba(60,45,20,.06); }
.upload-card { display: grid; gap: 16px; }
.dropzone { border: 1.5px dashed #bbb1a1; border-radius: 18px; min-height: 290px; padding: 38px 24px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; transition: .18s ease; outline: none; }
.dropzone:hover, .dropzone:focus-visible, .dropzone.dragover { background: #fff9f4; border-color: var(--accent); transform: translateY(-1px); }
.upload-icon { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 18px; background: var(--soft); margin-bottom: 17px; }
.upload-icon svg { width: 28px; height: 28px; }
.dropzone p { margin: 8px 0 22px; color: var(--muted); font-size: 14px; }
.button { border: 0; border-radius: 13px; padding: 13px 18px; font-weight: 750; transition: .15s ease; }
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.primary { background: var(--ink); color: white; }
.primary:hover { background: #2a2a2a; }
.secondary { background: var(--soft); color: var(--ink); }
.controls { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 3px 2px; }
.controls label { font-size: 14px; font-weight: 700; }
select { max-width: 230px; width: 52%; border: 1px solid var(--line); border-radius: 12px; background: white; padding: 10px 12px; color: var(--ink); }
.selected-file { display: flex; align-items: center; gap: 16px; background: var(--soft); border-radius: 14px; padding: 12px 14px; }
.file-copy { min-width: 0; flex: 1; display: grid; gap: 3px; }
.file-copy strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.file-copy span { color: var(--muted); font-size: 12px; }
.icon-button { width: 32px; height: 32px; border: 0; border-radius: 50%; background: white; color: var(--muted); font-size: 21px; line-height: 1; }
.progress-card, .result-card { margin-top: 16px; }
.progress-head, .result-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.progress-head strong { font-size: 28px; letter-spacing: -.04em; }
.progress-track { width: 100%; height: 11px; border-radius: 999px; background: var(--soft); margin: 22px 0 12px; overflow: hidden; }
.progress-bar { width: 0; height: 100%; border-radius: inherit; background: var(--accent); transition: width .25s ease; }
.muted { margin: 0; color: var(--muted); font-size: 13px; }
.language-badge { border: 1px solid var(--line); border-radius: 999px; padding: 7px 10px; color: var(--muted); font-size: 12px; font-weight: 800; }
textarea { width: 100%; min-height: 360px; resize: vertical; margin: 20px 0 14px; border: 1px solid var(--line); border-radius: 15px; padding: 18px; background: white; color: var(--ink); line-height: 1.55; outline: none; }
textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255,92,53,.1); }
.actions { display: grid; grid-template-columns: 1fr 1.25fr; gap: 10px; }
.text-button { width: 100%; border: 0; background: transparent; color: var(--muted); margin-top: 13px; padding: 8px; font-size: 13px; }
.text-button:hover { color: var(--ink); }
.error-box { margin-top: 16px; border: 1px solid #e5aaa0; background: #fff0ed; color: #7c2112; border-radius: 16px; padding: 14px 16px; font-size: 14px; }
footer { text-align: center; padding: 22px 12px 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.hidden { display: none !important; }

@media (max-width: 560px) {
  .shell { width: min(100% - 20px, 760px); padding-top: 24px; }
  .header { align-items: center; }
  .status-pill { padding: 8px 10px; }
  .card { padding: 14px; border-radius: 20px; }
  .dropzone { min-height: 250px; padding: 28px 18px; }
  .controls { align-items: flex-start; flex-direction: column; }
  select { width: 100%; max-width: none; }
  .actions { grid-template-columns: 1fr; }
  textarea { min-height: 310px; }
}

@keyframes progress-scan {
  from { transform: translateX(-135%); }
  to { transform: translateX(365%); }
}
.progress-bar.indeterminate {
  width: 38%;
  transition: none;
  animation: progress-scan 1.15s ease-in-out infinite;
}
