:root {
  --bg: #0c0c0d;
  --panel: #17181a;
  --line: #2c2e31;
  --ink: #f4f4f2;
  --muted: #9a9c9f;
  --accent: #ffd400;
  --ok: #37d67a;
  --bad: #ff5a5a;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "DejaVu Sans", "Segoe UI", system-ui, sans-serif;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

.wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: 24px 18px 64px;
}

header.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

header.brand img { width: 44px; height: 44px; object-fit: contain; filter: invert(1); }

header.brand h1 {
  font-size: 18px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0;
}

header.brand span { color: var(--accent); }

h2 {
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 28px 0 12px;
}

input[type="text"], input[type="password"] {
  width: 100%;
  font-size: 28px;
  font-weight: 700;
  padding: 16px 18px;
  border-radius: 14px;
  border: 2px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  outline: none;
}

input:focus { border-color: var(--accent); }

.counter { text-align: right; color: var(--muted); font-size: 13px; margin-top: 6px; }

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

.icons button {
  aspect-ratio: 1;
  min-width: 0;
  border-radius: 14px;
  border: 2px solid var(--line);
  background: var(--panel);
  padding: 12px;
  cursor: pointer;
}

.icons button img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: invert(1);
}

.icons button[aria-pressed="true"] {
  border-color: var(--accent);
  background: #2a2600;
}

.preview {
  margin-top: 14px;
  background: #fff;
  border-radius: 12px;
  padding: 10px;
  display: flex;
  justify-content: center;
  min-height: 88px;
}

.preview img { image-rendering: pixelated; max-width: 100%; }
.preview.empty { color: #999; align-items: center; background: var(--panel); }

button.primary {
  width: 100%;
  margin-top: 26px;
  font-size: 22px;
  font-weight: 800;
  padding: 20px;
  border: none;
  border-radius: 16px;
  background: var(--accent);
  color: #000;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

button.primary:disabled { opacity: 0.4; cursor: not-allowed; }

.status {
  margin-top: 22px;
  padding: 20px;
  border-radius: 14px;
  background: var(--panel);
  border: 2px solid var(--line);
  font-size: 20px;
  font-weight: 700;
  text-align: center;
}

.status.ok { border-color: var(--ok); color: var(--ok); }
.status.bad { border-color: var(--bad); color: var(--bad); }
.status small { display: block; margin-top: 6px; font-weight: 400; color: var(--muted); font-size: 14px; }

.hint { color: var(--bad); font-size: 14px; margin-top: 8px; min-height: 18px; }

.opbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding: 14px;
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: 14px;
  margin-bottom: 16px;
}

.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--bad); display: inline-block; }
.dot.on { background: var(--ok); }

.modeswitch { display: flex; gap: 0; border: 2px solid var(--line); border-radius: 10px; overflow: hidden; }
.modeswitch button { border: none; background: var(--panel); color: var(--muted); padding: 10px 16px; font-weight: 700; cursor: pointer; }
.modeswitch button.active { background: var(--accent); color: #000; }

.counts { color: var(--muted); font-size: 13px; margin-left: auto; }

.job {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 2px solid var(--line);
  border-radius: 12px;
  margin-bottom: 10px;
  background: var(--panel);
}

.job img { width: 40px; height: 40px; object-fit: contain; filter: invert(1); flex: none; }
.job .name { font-size: 20px; font-weight: 700; flex: 1; word-break: break-word; }
.job .badge { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; padding: 4px 8px; border-radius: 6px; background: var(--line); }
.job .badge.printed { background: #10391f; color: var(--ok); }
.job .badge.failed { background: #3a1414; color: var(--bad); }
.job .badge.printing { background: #2a2600; color: var(--accent); }
.job .actions { display: flex; gap: 6px; flex: none; }
.job .actions button { border: none; border-radius: 8px; padding: 10px 12px; font-weight: 700; cursor: pointer; }
.job .actions .go { background: var(--accent); color: #000; }
.job .actions .kill { background: var(--line); color: var(--ink); }
.job.done { opacity: 0.45; }

.login { max-width: 360px; margin: 60px auto; }
