:root {
  --text: #1a1a1a;
  --text-muted: #595959;
  --border: #ccc;
  --bg-subtle: #eee;
  --accent: #1a6aff;
  --accent-hover: #0050d0;
  --accent-bg-hover: #f0f4ff;
  --error: #c0392b;
  --error-bg: #fdf0f0;
}

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

body {
  font-family: system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text);
  background: #f5f5f5;
  margin: 0;
  padding: 2rem 1rem;
}

main {
  max-width: 680px;
  margin: 0 auto;
  background: #fff;
  padding: 2rem 2.5rem;
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0,0,0,.1);
}

h1 { font-size: 1.5rem; margin: 0 0 .5rem; }
.lede { margin: 0 0 1.5rem; color: var(--text); }
.lede code {
  background: #f4f4f4;
  padding: .1rem .35rem;
  border-radius: 3px;
  font-size: .9em;
}
.preset-desc {
  display: block;
  margin-top: .4rem;
  color: var(--text-muted);
  font-size: .875rem;
}
.preset-desc[hidden] { display: none; }
h2 { font-size: 1.1rem; margin: 2rem 0 .75rem; color: var(--text); }

.field { margin-bottom: 1.25rem; }
.field > label:first-child {
  display: block;
  font-weight: 600;
  margin-bottom: .35rem;
}
.hint { font-weight: 400; color: var(--text-muted); font-size: .875rem; }

input[type="file"],
select {
  display: block;
  width: 100%;
  padding: .4rem .5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 1rem;
  background: #fafafa;
}

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  margin-right: 1rem;
  font-weight: 400;
  cursor: pointer;
}

.actions { display: flex; gap: 1rem; align-items: center; margin-top: 1.5rem; }

button, .btn-secondary {
  padding: 0.625rem 1.25rem;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  min-height: 44px;
}

button {
  background: var(--accent);
  color: #fff;
  border: 1px solid transparent;
}
button:hover { background: var(--accent-hover); }

.btn-secondary {
  background: #fff;
  color: var(--accent);
  border: 1px solid var(--accent);
}
.btn-secondary:hover { background: var(--accent-bg-hover); }

:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.recent table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}
.recent th, .recent td {
  text-align: left;
  padding: .4rem .5rem;
  border-bottom: 1px solid var(--bg-subtle);
}
.recent th { color: var(--text-muted); font-weight: 600; }
.btn-download {
  display: inline-block;
  padding: .2rem .6rem;
  font-size: .8rem;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 4px;
  text-decoration: none;
  white-space: nowrap;
}
.btn-download:hover { background: var(--accent-bg-hover); }

.downloads { list-style: none; padding: 0; }
.downloads li { padding: .4rem 0; border-bottom: 1px solid var(--bg-subtle); }
.downloads a { color: var(--accent); text-decoration: none; font-weight: 500; }
.downloads a:hover { text-decoration: underline; }
.size { color: var(--text-muted); font-size: .85rem; margin-left: .5rem; }

footer {
  max-width: 680px;
  margin: 1.5rem auto 0;
  padding: 1rem 2.5rem 0;
  border-top: 1px solid #e5e5e5;
  text-align: center;
}
footer a {
  color: var(--text-muted);
  font-size: .875rem;
  text-decoration: none;
}
footer a:hover { text-decoration: underline; }
.pending { display: none; }

.file-meta {
  display: block;
  margin-top: .4rem;
  color: var(--text-muted);
  font-size: .85rem;
}
.file-error {
  display: block;
  margin-top: .4rem;
  color: var(--error);
  font-size: .85rem;
  font-weight: 500;
}
.file-meta[hidden],
.file-error[hidden] { display: none; }

button[disabled] {
  background: #9bb8e6;
  cursor: not-allowed;
}
button[disabled]:hover { background: #9bb8e6; }

.error-page h1 { color: var(--error); }
.error-location { font-size: .875rem; color: var(--text-muted); margin: 0 0 .5rem; }
.error-msg { font-family: monospace; background: var(--error-bg); padding: .75rem; border-radius: 6px; }
.error-hint { margin-top: 1rem; color: var(--text-muted); }
.error-hint code { background: #f4f4f4; padding: .1rem .35rem; border-radius: 3px; font-size: .9em; }
