:root {
  color-scheme: light;
  --bg: #f4f1ea;
  --surface: #ffffff;
  --ink: #19201d;
  --muted: #68716b;
  --line: #d8ddd4;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --warn: #b45309;
  --bad: #b91c1c;
  --good: #15803d;
}

* {
  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(135deg, rgba(15, 118, 110, 0.10), transparent 38%),
    linear-gradient(315deg, rgba(180, 83, 9, 0.08), transparent 42%),
    var(--bg);
  color: var(--ink);
}

.shell {
  width: min(980px, calc(100vw - 32px));
  min-height: 100vh;
  margin: 0 auto;
  display: flex;
  align-items: center;
  padding: 40px 0;
}

.workspace {
  width: 100%;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(25, 32, 29, 0.14);
  padding: 28px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 28px;
}

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

h1 {
  margin: 0;
  font-size: clamp(2rem, 6vw, 4rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.health {
  min-width: 96px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
  white-space: nowrap;
}

.download-form {
  display: grid;
  gap: 10px;
}

label,
.label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
}

.input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

input {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 14px;
  font-size: 1rem;
  color: var(--ink);
  background: #fff;
}

input:focus {
  outline: 3px solid rgba(15, 118, 110, 0.18);
  border-color: var(--accent);
}

button,
.download-link {
  min-height: 52px;
  border: 0;
  border-radius: 6px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
}

button:hover,
.download-link:hover {
  background: var(--accent-dark);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.button-icon {
  font-size: 1.2rem;
  line-height: 1;
}

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

.status-panel {
  margin-top: 28px;
  border-top: 1px solid var(--line);
  padding-top: 24px;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.status-grid > div {
  min-height: 86px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  background: #fbfcfa;
  overflow: hidden;
}

.status-grid strong {
  display: block;
  margin-top: 8px;
  font-size: 1rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.actions {
  margin-top: 18px;
}

.message {
  margin: 16px 0 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.message.error {
  color: var(--bad);
}

.message.success {
  color: var(--good);
}

.log {
  width: 100%;
  max-height: 260px;
  margin: 18px 0 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  background: #111816;
  color: #dbe7df;
  overflow: auto;
  white-space: pre-wrap;
  font-size: 0.82rem;
  line-height: 1.45;
}

@media (max-width: 760px) {
  .shell {
    width: min(100vw - 20px, 980px);
    align-items: flex-start;
    padding: 10px 0;
  }

  .workspace {
    padding: 18px;
  }

  .topbar,
  .input-row {
    grid-template-columns: 1fr;
    display: grid;
  }

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

@media (max-width: 460px) {
  .status-grid {
    grid-template-columns: 1fr;
  }
}
