:root {
  --bg: #f4f7f6;
  --surface: #ffffff;
  --ink: #17211f;
  --muted: #64736f;
  --border: #dce5e1;
  --accent: #007c72;
  --accent-dark: #005e57;
  --accent-soft: #e7f5f2;
  --success: #1f9d55;
  --warning: #b7791f;
  --shadow: 0 20px 60px rgba(23, 33, 31, 0.11);
}

* { box-sizing: border-box; }

body {
  font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background:
    linear-gradient(135deg, rgba(0, 124, 114, 0.12), rgba(240, 184, 90, 0.12) 42%, transparent 42%),
    var(--bg);
  margin: 0;
  color: var(--ink);
  line-height: 1.5;
  min-height: 100vh;
}

.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 44px 20px 28px;
}

.hero {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 14px;
  align-items: center;
  margin-bottom: 24px;
}

.brand-mark {
  display: grid;
  place-items: center;
  grid-row: span 3;
  width: 58px;
  height: 58px;
  border-radius: 14px;
  background: var(--ink);
  color: #fff;
  font-size: 28px;
  font-weight: 800;
  box-shadow: 0 14px 28px rgba(23, 33, 31, 0.18);
}

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

.hero h1 {
  margin: 0;
  font-size: clamp(34px, 6vw, 58px);
  line-height: 1;
  letter-spacing: 0;
}

.lead {
  max-width: 640px;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
}

.tool-panel {
  background: rgba(255, 255, 255, 0.92);
  padding: 28px;
  border-radius: 16px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.panel-heading h2 {
  margin: 0 0 4px;
  font-size: 20px;
  letter-spacing: 0;
}

.panel-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.file-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 220px;
  padding: 34px 22px;
  border: 2px dashed var(--border);
  border-radius: 12px;
  cursor: pointer;
  text-align: center;
  background: #fbfdfc;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.file-drop input { display: none; }

#dropText {
  display: grid;
  gap: 7px;
  justify-items: center;
}

.file-drop .icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  font-weight: 300;
}

.file-drop small {
  max-width: 520px;
  color: var(--muted);
  font-size: 13px;
}

.file-drop:hover, .file-drop.drag {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.selected-file {
  margin-top: 12px;
  font-size: 14px;
  color: var(--ink);
  padding: 10px 12px;
  background: #f8fbfa;
  border-radius: 8px;
  border: 1px solid var(--border);
  overflow-wrap: anywhere;
}

.actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.btn {
  background: var(--accent);
  color: #fff;
  padding: 11px 22px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}
.btn:hover:not(:disabled) {
  background: var(--accent-dark);
  box-shadow: 0 10px 22px rgba(0, 124, 114, 0.2);
  transform: translateY(-1px);
}
.btn:disabled { opacity: 0.5; cursor: default; }

.btn-download {
  background: var(--success);
  text-decoration: none;
  font-size: 14px;
  padding: 9px 18px;
}
.btn-download:hover { background: #15803d; }

.status {
  color: var(--muted);
  font-size: 14px;
  min-height: 22px;
}

.status.error { color: #b42318; }

.result {
  margin-top: 20px;
  padding: 16px 20px;
  border-radius: 10px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
}
.result-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.result-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #dcfce7;
  font-size: 12px;
  font-weight: 800;
  color: var(--success);
  flex-shrink: 0;
}
.result-inner > div { flex: 1; }
.result-inner p { margin: 0 0 2px; }

.muted { color: var(--muted); font-size: 13px; }

footer {
  margin-top: 20px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

footer a {
  color: var(--accent-dark);
  font-weight: 700;
  text-decoration: none;
}

@media (max-width: 520px) {
  .container { padding: 24px 14px; }
  .hero {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .brand-mark {
    grid-row: auto;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    font-size: 24px;
  }
  .tool-panel { padding: 18px; }
  .panel-heading { display: block; }
  .file-drop { min-height: 190px; }
  .result-inner { flex-direction: column; align-items: flex-start; }
}
