:root {
  --bg: #12141b; --card: #191c25; --line: #2c303c;
  --text: #e8e6df; --dim: #9aa0ae; --faint: #4a5060;
  --amber: #e8a33d; --radius: 14px;
}
* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }
body { background: var(--bg); color: var(--text); font: 16px/1.45 system-ui, sans-serif; }
.hidden { display: none !important; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.wordmark, h1, h2 { font-family: Georgia, 'Times New Roman', serif; font-weight: normal; }
.wordmark { font-style: italic; }

.view { min-height: 100dvh; max-width: 640px; margin: 0 auto; display: flex; flex-direction: column;
  padding: 0 16px calc(16px + env(safe-area-inset-bottom)); }

/* section chrome */
.section-head { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.section-head h1 { font-size: 1.35rem; font-style: italic; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.back-btn { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 12px; background: none;
  color: var(--text); font-size: 20px; flex: none; padding: 0; margin: 0; }
.home-btn { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--text);
  padding: 15px; font-size: 1.05rem; margin-top: auto; width: 100%; }

/* home */
.home-head { display: flex; justify-content: space-between; align-items: baseline; padding: 18px 0 6px; }
.home-head .wordmark { font-size: 1.6rem; }
.home-date { color: var(--amber); font-size: .75rem; letter-spacing: 1px; }
.kiosk { flex: 1; display: flex; flex-direction: column; gap: 14px; padding: 10px 0 16px; }
.kiosk-btn { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  background: var(--card); border: 1px solid var(--line); border-radius: 18px; color: var(--text);
  font-family: Georgia, 'Times New Roman', serif; font-size: 1.35rem; padding: 12px; margin: 0; }
.kiosk-btn .glyph { font-size: 2rem; }
.kiosk-btn.amber { background: var(--amber); border-color: var(--amber); color: var(--bg); font-weight: bold; }
.home-foot { text-align: center; color: var(--faint); font-size: .75rem; padding: 6px 0 10px; }
.home-foot a { color: var(--faint); }

/* base controls */
input, select, textarea, button { font: inherit; color: inherit; width: 100%; padding: 13px; margin: 6px 0;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
input:focus, textarea:focus { outline: 2px solid var(--amber); border-color: transparent; }
button { cursor: pointer; }
button.primary { background: var(--amber); border-color: var(--amber); color: var(--bg); font-weight: 700; }
button.danger { background: transparent; border-color: #c96a5a; color: #c96a5a; }
button.ghost { background: transparent; }
.error { color: #c96a5a; min-height: 1.2em; }

/* cards */
.row1 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.job-card { background: var(--card); border-left: 3px solid var(--amber); border-radius: 0 10px 10px 0;
  padding: 11px 13px; margin: 8px 0; }
.job-card.done { border-left-color: var(--faint); opacity: .6; }
.rack-chip { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--amber);
  font-weight: 700; font-size: 1.05rem; white-space: nowrap; }
.sub { color: var(--dim); font-size: .85rem; }
.faint { color: var(--faint); }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; background: #232833; }
.badge.picked { color: var(--dim); }
.row { display: flex; gap: 10px; align-items: center; }
.row > * { flex: 1; }
.uncertain { outline: 2px solid var(--amber); }
.spin { text-align: center; padding: 28px; color: var(--dim); }
.piece-photo { width: 62px; height: 62px; object-fit: cover; border-radius: 10px; }

/* rack grids */
.rack-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 4px 0; }
.rack-grid button { aspect-ratio: 1.6; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.7rem; font-weight: 700; margin: 0; border-radius: 14px; }
.rack-grid button:disabled { opacity: .45; }
.tile-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.rack-tile { aspect-ratio: 1.15; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; margin: 0; border-radius: 16px; }
.rack-tile .num { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 1.9rem; font-weight: 700; }
.rack-tile .cnt { color: var(--dim); font-size: .78rem; }
.rack-tile.empty .num { color: var(--faint); }

/* check-in */
.glance { background: var(--card); border: 1px solid var(--amber); border-radius: 16px; padding: 12px 14px; margin: 10px 0; }
.chip { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .68rem;
  letter-spacing: 1px; color: var(--amber); }
.scan-big { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: var(--card); border: 1px dashed var(--line); border-radius: 18px; font-size: 1.25rem;
  margin: 10px 0; min-height: 40dvh; }

#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--amber); color: var(--bg);
  font-weight: 600; padding: 11px 22px; border-radius: 999px; z-index: 10; max-width: 90vw; }
#toast.err { background: #c96a5a; color: #fff; }

#login { justify-content: center; }
#login .wordmark { font-size: 2rem; text-align: center; margin-bottom: 12px; }
