:root {
  --bg: #0e0f12;
  --panel: #14161b;
  --fg: #e8e8ea;
  --muted: #8a8c93;
  --accent: #5b8def;
  --ok: #4ade80;
  --bad: #f87171;
  --line: #23252b;
}
* { box-sizing: border-box; }
body {
  margin: 0; padding: 2rem 1rem;
  font: 15px/1.5 -apple-system, system-ui, sans-serif;
  background: var(--bg); color: var(--fg);
  display: grid; place-items: start center; min-height: 100vh;
}
main { width: 100%; max-width: 540px; }

header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
h1 { margin: 0; font-weight: 600; letter-spacing: -.02em; }
.sub { color: var(--muted); margin: .25rem 0 1.5rem; font-size: 13px; }
code { background: var(--panel); padding: 1px 6px; border-radius: 4px; font-size: 12px; }

.status {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .25rem .6rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px; color: var(--muted);
}
.status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); transition: background .2s; }
.status--ok .dot { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.status--bad .dot { background: var(--bad); }
.status--warn .dot { background: #f5a524; box-shadow: 0 0 8px #f5a524; }
.status--ok .status-text { color: var(--ok); }
.status--bad .status-text { color: var(--bad); }
.status--warn .status-text { color: #f5a524; }

.alert {
  padding: .65rem .85rem;
  border-radius: 8px;
  margin: .5rem 0 1rem;
  font-size: 13px;
  border: 1px solid var(--line);
}
.alert--error { background: rgba(248,113,113,.08); border-color: rgba(248,113,113,.4); color: var(--bad); }
.alert--warn  { background: rgba(245,165,36,.08); border-color: rgba(245,165,36,.4); color: #f5a524; }
.alert--info  { background: var(--panel); color: var(--muted); }
.alert-list { margin: 0; padding-left: 1.1rem; display: grid; gap: .15rem; }
.alert-item { line-height: 1.35; }

.inks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: .5rem;
  margin: 0 0 1rem;
}
.ink-bar {
  height: 6px; background: var(--panel); border-radius: 999px; overflow: hidden;
  border: 1px solid var(--line);
}
.ink-fill { height: 100%; transition: width .3s; border-radius: 999px; }
.ink-label {
  display: flex; justify-content: space-between;
  font-size: 11px; color: var(--muted); margin-top: .25rem;
  font-variant-numeric: tabular-nums;
}
.ink--warn .ink-label { color: #f5a524; }
.ink--bad  .ink-label { color: var(--bad); }
.ink--bad  .ink-bar { box-shadow: 0 0 0 1px rgba(248,113,113,.5); }

.meta-line {
  font-size: 11px; color: var(--muted);
  margin: -.25rem 0 1rem; padding: 0;
  display: flex; flex-direction: column; gap: .15rem;
  letter-spacing: .01em;
}
/* tag-Pills statt Plain-Text-Trenner: wir liefern jetzt <span>-pro-Item */
.meta-line .meta-row { display: block; }

.queue {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid #f5a524;
  border-radius: 6px;
  padding: .55rem .75rem;
  margin: 0 0 1rem;
  font-size: 12px;
}
.queue-head { color: var(--fg); }
.queue-head strong { color: #f5a524; }
.queue-list { list-style: none; padding: .35rem 0 0; margin: 0; display: grid; gap: .15rem; color: var(--muted); }
.queue-list code { font-size: 10px; padding: 0 4px; }

.quality-set {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: .35rem .55rem .5rem;
  background: var(--panel);
  margin: 0;
}
.quality-set legend {
  font-size: 11px; color: var(--muted); padding: 0 .35rem;
  text-transform: uppercase; letter-spacing: .05em;
}
.quality-row {
  display: flex; flex-wrap: wrap; gap: .25rem;
}
.quality {
  flex: 1 1 90px;
  min-width: 90px;
  cursor: pointer;
  padding: .35rem .55rem; border-radius: 4px;
  display: flex; align-items: center; gap: .35rem;
  transition: background .12s;
  color: var(--muted) !important;
  font-size: 13px;
  white-space: nowrap;
}
.quality:has(input:checked) {
  background: rgba(91,141,239,.15);
  color: var(--fg) !important;
}
.quality input { accent-color: var(--accent); }

.step {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 1rem;
  padding: 1rem 0;
  border-top: 1px solid var(--line);
}
.step:first-of-type { border-top: 0; }
.step-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--panel);
  color: var(--muted);
  display: grid; place-items: center;
  font-size: 13px; font-weight: 600;
  margin-top: 4px;
}

.drop {
  display: grid; place-items: center;
  border: 1.5px dashed var(--line);
  border-radius: 12px;
  padding: 2rem 1rem;
  cursor: pointer; transition: all .15s;
  text-align: center;
}
.drop:hover, .drop.drag { border-color: var(--accent); background: var(--panel); }
.drop.has-file { border-color: var(--ok); border-style: solid; }
.drop input { display: none; }
.drop span { color: var(--muted); }
.drop.has-file span { color: var(--fg); }

.opts { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; align-items: center; }
.opts label { display: inline-flex; align-items: center; gap: .5rem; color: var(--muted); font-size: 14px; }
.opts label.full { grid-column: 1 / -1; }
.opts input[type=number],
.opts input[type=text] {
  padding: .35rem .5rem; background: var(--panel); border: 1px solid var(--line);
  border-radius: 6px; color: var(--fg); font: inherit;
}
.opts input[type=number] { width: 4.5rem; }
.opts input[type=text] { flex: 1; min-width: 0; }

button {
  width: 100%; padding: .85rem;
  background: var(--accent); color: white; border: 0;
  border-radius: 8px; font-weight: 600; font-size: 15px; cursor: pointer;
  transition: filter .15s, opacity .15s;
}
button:hover:not(:disabled) { filter: brightness(1.1); }
button:disabled { opacity: .4; cursor: not-allowed; }

#out { background: var(--panel); padding: .75rem 1rem; border-radius: 8px; min-height: 1rem; color: var(--fg); font-size: 13px; margin: 1rem 0 0; white-space: pre-wrap; }
#out:empty { display: none; }

.history { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.history h2 { font-size: 13px; font-weight: 500; color: var(--muted); margin: 0 0 .75rem; text-transform: uppercase; letter-spacing: .05em; }
#history-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .35rem; }
#history-list .empty { color: var(--muted); font-size: 13px; padding: .5rem 0; }
.job {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: .75rem;
  padding: .5rem .75rem;
  background: var(--panel);
  border-radius: 6px;
  font-size: 12px;
  align-items: center;
}
.job-time { color: var(--muted); font-variant-numeric: tabular-nums; }
.job-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-meta, .job-user { color: var(--muted); font-size: 11px; }
.job.failed { border-left: 3px solid var(--bad); }
.job.ok { border-left: 3px solid var(--ok); }

.meta { color: var(--muted); font-size: 11px; text-align: center; margin-top: 1rem; }
