:root {
  --ink: #10161c;
  --muted: #6b7683;
  --line: #e3e6ea;
  --bg: #f5f6f8;
  --card: #fff;
  --side: #0e1620;
  --side-ink: #b9c4d1;
  --accent: #0e6e5c;
  --accent-soft: #e6f2ef;
  --danger: #a8322a;
  --radius: 8px;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font: 14px/1.45 "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.mono { font-family: "Cascadia Mono", Consolas, monospace; }

/* login */
.gate { display: grid; place-items: center; height: 100vh; background: var(--side); }
.gate form { width: 320px; background: var(--card); padding: 28px; border-radius: var(--radius); }
.gate h1 { font-size: 19px; margin: 0 0 4px; letter-spacing: -.01em; }
.gate p { color: var(--muted); font-size: 12px; margin: 0 0 20px; }
.gate label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 12px; }
.gate input { width: 100%; margin-top: 5px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 6px; }
.gate .error { color: var(--danger); font-size: 12px; min-height: 16px; margin: 8px 0 0; }

.btn { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 8px 13px; }
.btn:hover { background: #f2f4f6; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); border-color: #e8c9c6; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.block { width: 100%; }
.btn.wide { min-width: 96px; font-weight: 600; }
.btn.file { display: inline-block; padding: 7px 12px; }
.sr { position: absolute; width: 1px; height: 1px; opacity: 0; }
.small { font-size: 12px; }
.hint { font-size: 12px; color: var(--muted); margin: 8px 0 0; }
.hint code { background: #f1f3f5; padding: 1px 5px; border-radius: 4px; }
.crumb { font-size: 11px; color: var(--muted); letter-spacing: .08em; }
.pill.big { font-size: 11px; padding: 4px 11px; }
.panel.slim { padding-bottom: 12px; }

/* shell */
.shell { display: grid; grid-template-columns: 316px 1fr; height: 100vh; }
.side { background: var(--side); color: var(--side-ink); display: flex; flex-direction: column; }
.side .head { padding: 14px 16px; border-bottom: 1px solid #1b2733; display: flex; align-items: baseline; justify-content: space-between; }
.side .head b { color: #fff; font-size: 15px; letter-spacing: -.01em; }
.side .head span { font-size: 11px; color: #7b8794; text-transform: uppercase; letter-spacing: .07em; }
.side .maker { display: flex; gap: 6px; padding: 10px 12px; border-bottom: 1px solid #1b2733; }
.side .maker select { flex: 1; min-width: 0; background: #16232f; color: #dfe7ee; border: 1px solid #24333f; border-radius: 6px; padding: 7px; }
.side .maker .btn { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.list { flex: 1; overflow-y: auto; }
.item { padding: 10px 14px; border-bottom: 1px solid #16212c; cursor: pointer; display: block; }
.item:hover { background: #14202b; }
.item.sel { background: #182634; box-shadow: inset 2px 0 0 var(--accent); }
.item .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.item .nm { color: #eef3f7; font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .meta { color: #7b8794; font-size: 11px; margin-top: 2px; }
.pill { font-size: 10px; letter-spacing: .06em; text-transform: uppercase; padding: 2px 7px; border-radius: 20px; background: #2c3a47; color: #c3ced9; white-space: nowrap; }
.pill.shown, .pill.verifying { background: var(--accent); color: #fff; }
.pill.closed { background: #2c5f36; color: #d9f2df; }
.pill.expired { background: #6d2a24; color: #f6d7d4; }
.side nav { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid #1b2733; }
.side nav button { background: transparent; border: 0; color: #8b97a4; padding: 11px 4px; font-size: 12px; border-right: 1px solid #1b2733; }
.side nav button:last-child { border-right: 0; }
.side nav button.on { color: #fff; background: #16232f; }
.side .out { border-top: 1px solid #1b2733; padding: 9px 14px; font-size: 12px; }
.side .out a { color: #8b97a4; }

/* main */
main { overflow-y: auto; padding: 20px 24px 40px; }
main > section { max-width: 1120px; }
.panel .grid .field input,
.panel .grid .field textarea { max-width: 100%; }
.grid { max-width: 880px; }
.title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 3px; }
h2 { margin: 0; font-size: 18px; letter-spacing: -.01em; }
.device { color: var(--muted); font-size: 12px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-top: 16px; }
.panel h3 { margin: 0 0 12px; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; }

.controls { display: flex; flex-wrap: wrap; gap: 8px; }
.code-read { display: flex; gap: 6px; margin: 4px 0 14px; }
.slot {
  width: 46px; height: 56px; border: 1px solid var(--line); border-radius: 6px;
  display: grid; place-items: center; font: 700 22px/1 Consolas, monospace; background: #fbfcfc;
  color: #c6cdd4;
}
.slot.on { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }
.slot.verifying-all { border-color: var(--accent); }
.empty-code { color: var(--muted); font-size: 12px; }

.two { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid .wide { grid-column: 1 / -1; }
.field label { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 4px; }
.field input, .field textarea, .field select { width: 100%; padding: 8px 9px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.field textarea { min-height: 78px; resize: vertical; }
.logo-row { display: flex; align-items: center; gap: 10px; }
.logo-row img { max-height: 32px; max-width: 110px; border: 1px solid var(--line); border-radius: 4px; background: #fff; padding: 2px; }
.logo-row input[type=file] { font-size: 12px; }

.launch { display: flex; gap: 6px; }
.launch input { flex: 1; font-family: Consolas, monospace; font-size: 12px; padding: 8px; border: 1px solid var(--line); border-radius: 6px; background: #fbfcfc; }

.preview { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: #fff; }
.preview iframe { width: 100%; height: 520px; border: 0; display: block; }

.timeline { list-style: none; margin: 0; padding: 0; font-size: 12px; color: var(--muted); }
.timeline li { padding: 3px 0; border-bottom: 1px dashed var(--line); }
.timeline li:last-child { border-bottom: 0; }

table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
th, td { text-align: left; padding: 9px 11px; border-bottom: 1px solid var(--line); font-size: 13px; }
th { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: #fafbfc; }
tr:last-child td { border-bottom: 0; }
.total { font-weight: 700; }
.muted { color: var(--muted); }
.row-form { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.row-form input { padding: 8px 9px; border: 1px solid var(--line); border-radius: 6px; }

/* operator preview overlay: the real card, big, no effect on the target */
.op-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  background: rgb(12 12 12 / 0.62);
  backdrop-filter: blur(4px);
}
.op-overlay.hidden { display: none; }
.op-frame {
  width: min(760px, 94vw);
  background: #f6f5f2;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 24px 70px rgb(0 0 0 / 0.45);
}
.op-frame header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: #e6e4e0;
  font-size: 14px;
}
.op-frame header .muted { flex: 1; }
.op-frame iframe {
  display: block;
  width: 100%;
  height: min(720px, 82vh);
  border: 0;
  background: #f6f5f2;
}
/* approve / deny: two sides of the same decision */
.btn.ok { border-color: #1f7a5e; color: #1f7a5e; }
.btn.ok:hover:not(:disabled) { background: #e8f3ef; }
.btn.bad { border-color: #b3261e; color: #b3261e; }
.btn.bad:hover:not(:disabled) { background: #fbeceb; }
/* proof the card is actually painted on the target */
.pill.onscreen { background: #1f7a5e; color: #fff; box-shadow: 0 0 0 3px rgb(31 122 94 / 0.18); }
/* remove-from-list affordance on each job row */
.item { position: relative; }
.item .x {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #8a867f;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s, background 0.12s, color 0.12s;
}
.item:hover .x { opacity: 1; }
.item .x:hover { background: #b3261e; color: #fff; }
.maker .btn.wide { width: 100%; }
/* sign-up page */
.gate a { color: #1f7a5e; }
.gate .hint { margin-top: 14px; text-align: center; }
/* accent picker: swatch + hex, green first */
.accent-row { display: flex; gap: 8px; align-items: center; }
.accent-row input[type=color] {
  width: 44px;
  height: 34px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}
.accent-row input[type=text] { flex: 1; }
/* the one rule that bites if forgotten */
.notice {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-left: 3px solid #b3261e;
  border-radius: 6px;
  background: #fdf0ef;
  color: #6b1d18;
  font-size: 12px;
  line-height: 1.45;
}
.notice b { color: #b3261e; }