* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, sans-serif;
  color: #222;
  background: #f5f5f5;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1rem;
}

.top {
  width: min(520px, 100%);
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.75rem;
}
.top a {
  color: #444;
  text-decoration: none;
  font-size: 0.9rem;
}
.top a:hover { text-decoration: underline; }

.card {
  width: min(420px, 100%);
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 1.25rem;
}
.card.wide { width: min(520px, 100%); }

.muted {
  color: #666;
  margin: 0.75rem 0 0;
  font-size: 0.9rem;
  line-height: 1.4;
}

.stack { display: grid; gap: 0.85rem; }

label {
  display: grid;
  gap: 0.3rem;
  font-size: 0.9rem;
  color: #444;
}

input[type="text"],
input[type="password"],
input[type="file"] {
  width: 100%;
  border: 1px solid #ccc;
  background: #fff;
  color: #222;
  border-radius: 4px;
  padding: 0.55rem 0.65rem;
  font: inherit;
}

button,
.download {
  appearance: none;
  border: 1px solid #333;
  border-radius: 4px;
  padding: 0.6rem 0.9rem;
  font: inherit;
  cursor: pointer;
  background: #333;
  color: #fff;
  text-align: center;
  text-decoration: none;
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
button:hover:not(:disabled),
.download:hover {
  background: #111;
}

.error {
  background: #f8e8e8;
  border: 1px solid #e0b4b4;
  color: #8a2f2f;
  padding: 0.55rem 0.7rem;
  border-radius: 4px;
  margin-bottom: 0.85rem;
  font-size: 0.9rem;
}

.progress-box {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid #e5e5e5;
}
.progress-box.hidden,
.hidden {
  display: none !important;
}

.bar-wrap {
  height: 8px;
  background: #eee;
  border-radius: 4px;
  overflow: hidden;
}
.bar {
  height: 100%;
  width: 0;
  background: #333;
  transition: width 0.3s ease;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 0.5rem;
  font-variant-numeric: tabular-nums;
  font-size: 0.9rem;
}

.download {
  display: inline-block;
  margin-top: 0.9rem;
}
