:root {
  --bg: #f0f3f1;
  --card: #fff;
  --ink: #1a2420;
  --muted: #5a6b62;
  --line: #d5ddd8;
  --accent: #1f7a5c;
  --accent-hover: #18634a;
  --accent-soft: #e8f5ef;
  --warn: #9b2c1f;
  --warn-bg: #fdecea;
  --ok: #145c40;
  --ok-bg: #e8f6ef;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 15px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  line-height: 1.45;
  background: var(--bg);
}

.page {
  width: min(480px, 100% - 1.5rem);
  margin: 0 auto;
  padding: 1.25rem 0 2rem;
}

.site-header {
  margin-bottom: 0.85rem;
}

.brand-kicker {
  margin: 0 0 0.15rem;
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
}

h1 {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.lead {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem 1.1rem 1.15rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.steps {
  list-style: none;
  margin: 0 0 0.9rem;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--muted);
  padding: 0.35rem 0.45rem;
  border-radius: 6px;
}

.step.is-active {
  background: var(--accent-soft);
  color: var(--ink);
  font-weight: 600;
}

.step.is-done {
  color: var(--ok);
}

.step-num {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  flex-shrink: 0;
}

.step.is-done .step-num {
  background: var(--ok);
}

/* Dropzone */

.dropzone {
  position: relative;
  border: 1.5px dashed #b7c4bc;
  border-radius: 8px;
  background: #f7faf8;
  padding: 0.9rem 0.75rem;
  text-align: center;
  cursor: pointer;
  margin-bottom: 0.65rem;
  outline: none;
  transition: border-color 0.12s, background 0.12s;
}

.dropzone:hover,
.dropzone:focus-visible {
  border-color: var(--accent);
  background: #eef8f3;
}

.dropzone.is-dragover {
  border-color: var(--accent);
  border-style: solid;
  background: #dff3ea;
}

.dropzone.has-file {
  border-style: solid;
  border-color: #8fceb3;
  background: var(--ok-bg);
}

.dropzone-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.dropzone-inner {
  pointer-events: none;
}

.dropzone-title {
  margin: 0 0 0.15rem;
  font-size: 0.95rem;
  font-weight: 650;
}

.dropzone-click {
  margin: 0 0 0.35rem;
  font-size: 0.85rem;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.dropzone-sub {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
  word-break: break-all;
}

.dropzone.has-file .dropzone-sub {
  color: var(--ok);
  font-weight: 600;
}

.dropzone-overlay {
  position: absolute;
  inset: 0.25rem;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: rgba(31, 122, 92, 0.92);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  pointer-events: none;
}

.dropzone-overlay[hidden] {
  display: none;
}

.dropzone.is-dragover .dropzone-overlay {
  display: grid;
}

body.is-file-dragging .dropzone:not(.is-dragover) {
  border-color: #9fd4be;
}

/* Buttons */

.btn-primary {
  width: 100%;
  border: none;
  border-radius: 8px;
  padding: 0.7rem 0.9rem;
  background: var(--accent);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 650;
  cursor: pointer;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn-primary:disabled {
  background: #9aabb0;
  cursor: not-allowed;
}

.btn-download {
  width: 100%;
  border: 2px solid var(--accent);
  border-radius: 8px;
  padding: 0.85rem 0.9rem;
  background: #fff;
  color: var(--accent);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  margin: 0.65rem 0 0.5rem;
}

.btn-download:hover {
  background: var(--accent-soft);
}

.btn-download:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Status / result */

.status-panel {
  margin-top: 0.65rem;
  padding: 0.55rem 0.7rem;
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: 600;
}

.status-panel[hidden],
.result-panel[hidden] {
  display: none;
}

.status-panel.is-error {
  background: var(--warn-bg);
  color: var(--warn);
}

.status-panel.is-ok {
  background: var(--ok-bg);
  color: var(--ok);
}

.status-panel.is-busy {
  background: #eef4f8;
  color: #2a4a5c;
}

.result-panel {
  margin-top: 0.65rem;
  padding: 0.9rem 0.95rem;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.result-panel h2 {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
  font-weight: 700;
}

.result-panel .result-lead {
  margin: 0 0 0.15rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.result-panel .result-file {
  margin: 0;
  font-size: 0.88rem;
  word-break: break-all;
}

.result-panel .result-file strong {
  font-weight: 650;
}

.result-panel ul {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.result-panel li {
  margin: 0.15rem 0;
}

.result-panel .result-hint {
  margin: 0.55rem 0 0;
  padding-top: 0.55rem;
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
  color: var(--muted);
}

.result-panel .result-hint ol {
  margin: 0.3rem 0 0;
  padding-left: 1.15rem;
}

.result-panel .result-hint li {
  margin: 0.2rem 0;
}

@media (max-width: 420px) {
  .page {
    width: min(100% - 1rem, 480px);
  }
}
