:root {
  --bg: #0c0d10;
  --surface: #14161c;
  --surface2: #1c1f28;
  --border: #2a2f3d;
  --text: #e8eaef;
  --muted: #8b93a8;
  --accent: #5ce1b8;
  --accent-dim: #3aa386;
  --danger: #f08080;
  --radius: 14px;
  --font-display: "Syne", system-ui, sans-serif;
  --font-body: "Sora", system-ui, sans-serif;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  background-image:
    radial-gradient(ellipse 120% 80% at 10% -20%, rgba(92, 225, 184, 0.09), transparent 50%),
    radial-gradient(ellipse 80% 50% at 100% 100%, rgba(100, 120, 200, 0.06), transparent 45%);
}

a {
  color: var(--accent);
}

.wrap {
  max-width: 920px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}

header {
  margin-bottom: 2rem;
}

header h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  letter-spacing: -0.03em;
  margin: 0 0 0.5rem;
  line-height: 1.15;
}

header p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 36rem;
}

header p + p {
  margin-top: 0.75rem;
}

header .lead {
  max-width: 38rem;
}

.options-reveal-wrap {
  margin: 1rem 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 0.75rem;
}

.options-reveal-note {
  font-size: 0.8rem;
  color: var(--muted);
}

.btn-text {
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.btn-text:hover {
  color: var(--text);
}

.options-card {
  margin-top: 0.75rem;
}

.options-card-head {
  margin-bottom: 0.5rem;
}

.options-card .options-bar {
  margin-top: 0;
}

header .hint {
  font-size: 0.85rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  max-width: 42rem;
}

header .hint strong {
  color: var(--text);
}

header .hint code {
  font-size: 0.88em;
  background: var(--surface2);
  padding: 0.12rem 0.35rem;
  border-radius: 4px;
}

header .inline-code {
  font-size: 0.88em;
  background: var(--surface2);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-family: ui-monospace, monospace;
}

header .hint-secondary {
  opacity: 0.95;
}

.options-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  align-items: flex-end;
  margin-top: 1.25rem;
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
}

.options-hint {
  margin: 0.85rem 0 0;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--muted);
  max-width: 44rem;
}

.meta-applied {
  margin: 0 0 1rem;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.45;
}

.meta-applied code {
  font-size: 0.88em;
  background: var(--surface2);
  padding: 0.06rem 0.3rem;
  border-radius: 4px;
}

.field-inline select {
  width: 100%;
  max-width: 22rem;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
  margin-bottom: 1.25rem;
}

.field label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.field input[type="number"] {
  width: 6rem;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
}

.field-wide {
  flex: 1 1 16rem;
  min-width: min(100%, 18rem);
}

.field select {
  width: 100%;
  max-width: 36rem;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.88rem;
}

.quality-custom-wrap {
  margin-top: 0.85rem;
  max-width: 36rem;
}

.quality-custom-wrap input[type="text"] {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 0.88rem;
}

.field-hint {
  margin: 0.45rem 0 0;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.4;
  max-width: 38rem;
}

.format-panel {
  margin-top: 1.25rem;
  padding: 1.1rem 1.15rem 1.15rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
}

.format-panel-title {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.format-options {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.format-option {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.35;
}

.format-option input {
  margin-top: 0.2rem;
  accent-color: var(--accent);
}

.format-option-note {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.35;
}

.format-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
}

.dropzone {
  position: relative;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 2.75rem 1.5rem;
  text-align: center;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
  cursor: pointer;
}

.dropzone:hover,
.dropzone:focus-within {
  border-color: var(--accent-dim);
  background: var(--surface2);
}

.dropzone.is-dragover {
  border-color: var(--accent);
  background: rgba(92, 225, 184, 0.06);
  transform: scale(1.01);
}

.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.dropzone strong {
  font-family: var(--font-display);
  font-size: 1.1rem;
  display: block;
  margin-bottom: 0.35rem;
}

.dropzone span {
  color: var(--muted);
  font-size: 0.875rem;
}

.status {
  margin-top: 1rem;
  min-height: 1.5rem;
  font-size: 0.9rem;
  color: var(--muted);
  max-width: 100%;
  line-height: 1.45;
  word-break: break-word;
}

.status.is-busy {
  color: var(--accent);
}

.status.is-error {
  color: var(--danger);
}

.progress-panel {
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
}

.progress-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1rem;
  margin-bottom: 0.65rem;
}

.progress-timer {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--accent);
  letter-spacing: -0.02em;
}

.progress-hint {
  font-size: 0.8rem;
  color: var(--muted);
}

.progress-current {
  margin: 0 0 0.85rem;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.45;
}

.batch-file-rows {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-height: min(50vh, 22rem);
  overflow-y: auto;
  padding-top: 0.35rem;
  border-top: 1px solid var(--border);
}

.batch-row {
  font-size: 0.82rem;
}

.batch-row-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.batch-row-name {
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.batch-row-pct {
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 0.75rem;
}

.batch-row--active .batch-row-name {
  color: var(--accent);
}

.batch-row--done .batch-row-name {
  color: var(--muted);
}

.batch-bar {
  height: 6px;
  border-radius: 99px;
  background: var(--surface2);
  overflow: hidden;
}

.batch-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent));
  transition: width 0.25s ease-out;
}

.results {
  margin-top: 2rem;
}

.results h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin: 0 0 1rem;
}

.summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.summary div {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem 1rem;
}

.summary dt {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 0.25rem;
}

.summary dd {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
}

.summary--compact {
  max-width: 28rem;
}

.results-hint {
  margin: 0 0 1.25rem;
  padding: 0.85rem 1rem;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  max-width: 40rem;
}

.results-hint code {
  font-size: 0.9em;
  background: var(--surface2);
  padding: 0.08rem 0.3rem;
  border-radius: 4px;
}

.muted-num {
  color: var(--muted);
  font-size: 0.92em;
}

.zip-actions {
  margin: 0 0 1.25rem;
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent-dim), var(--accent));
  color: #0a0b0d;
  font-weight: 600;
}

.btn-accent:hover {
  filter: brightness(1.06);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

th,
td {
  padding: 0.65rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

tr:last-child td {
  border-bottom: none;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
}

.badge.ok {
  background: rgba(92, 225, 184, 0.15);
  color: var(--accent);
}

.badge.copy {
  background: rgba(139, 147, 168, 0.2);
  color: var(--muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--accent-dim);
  background: transparent;
  color: var(--accent);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.btn:hover {
  background: rgba(92, 225, 184, 0.12);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

details.cand {
  margin-top: 0.35rem;
}

details.cand summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.8rem;
  user-select: none;
}

details.cand pre {
  margin: 0.5rem 0 0;
  padding: 0.5rem 0.65rem;
  background: var(--bg);
  border-radius: 8px;
  font-size: 0.72rem;
  overflow-x: auto;
  color: var(--muted);
  max-height: 200px;
}

footer {
  margin-top: 3rem;
  font-size: 0.8rem;
  color: var(--muted);
}

