:root {
  --bg: #f5f6f8; --card: #fff; --ink: #1c1e21; --sub: #6b7280;
  --line: #e5e7eb; --brand: #7c3aed; --brand-ink: #fff;
  --green: #16a34a; --amber: #d97706; --blue: #2563eb; --red: #dc2626;
  --purple: #7c3aed; --teal: #0d9488; --gray: #6b7280;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", sans-serif;
}
header.topbar {
  background: var(--card); border-bottom: 1px solid var(--line);
  padding: 14px 20px; display: flex; align-items: center; gap: 12px;
}
header.topbar h1 { font-size: 17px; margin: 0; }
header.topbar .tag { font-size: 12px; color: var(--sub); }
header.topbar nav { margin-left: auto; display: flex; gap: 14px; font-size: 14px; }
header.topbar a { color: var(--sub); text-decoration: none; }
header.topbar a:hover { color: var(--ink); }
main { max-width: 1080px; margin: 0 auto; padding: 24px 20px 60px; }
main.narrow { max-width: 480px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 20px; margin-bottom: 16px;
}
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.item-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden; cursor: pointer; text-decoration: none; color: inherit; display: block;
  transition: box-shadow .15s;
}
.item-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.item-card .thumb { width: 100%; aspect-ratio: 1; object-fit: cover; background: #eee; display: block; }
.item-card .body { padding: 12px; }
.item-card .title { font-size: 14px; font-weight: 600; margin: 0 0 6px; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.price { font-weight: 700; font-size: 16px; }
.price .orig { color: var(--sub); text-decoration: line-through; font-weight: 400; font-size: 12px; margin-right: 6px; }
.badge {
  display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px;
  border-radius: 999px; color: #fff; vertical-align: middle;
}
.badge.grade { background: #111827; }
.b-REGISTERED { background: var(--gray); } .b-LISTED { background: var(--green); }
.b-HELD { background: var(--amber); } .b-SOLD { background: var(--blue); }
.b-SHIPPED { background: var(--purple); } .b-ARRIVED { background: var(--teal); }
.b-PICKED_UP { background: #374151; }
.b-HOLD { background: var(--amber); } .b-CONFIRMED { background: var(--blue); }
.b-CANCELLED { background: var(--red); } .b-EXPIRED { background: var(--gray); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--sub); font-weight: 600; font-size: 12px; white-space: nowrap; }
button, .btn {
  font: inherit; font-size: 13px; padding: 7px 14px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--card); cursor: pointer;
}
button:hover { background: #f3f4f6; }
button.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
button.primary:hover { opacity: .9; }
button.small { font-size: 12px; padding: 4px 10px; }
input, select, textarea {
  font: inherit; font-size: 14px; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 8px; background: #fff; width: 100%;
}
label { font-size: 12px; color: var(--sub); display: block; margin: 10px 0 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.tabs button { border-radius: 999px; }
.tabs button.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.muted { color: var(--sub); font-size: 13px; }
.log {
  background: #0f172a; color: #d1fae5; font-family: ui-monospace, monospace;
  font-size: 12px; border-radius: 10px; padding: 14px; white-space: pre-wrap;
  max-height: 320px; overflow: auto;
}
.hub { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.hub a.card { text-decoration: none; color: inherit; margin: 0; }
.hub .emoji { font-size: 30px; }
.hub h3 { margin: 8px 0 4px; }
.flow {
  background: #0f172a; color: #e2e8f0; font-family: ui-monospace, monospace;
  font-size: 12.5px; border-radius: 12px; padding: 18px; overflow-x: auto; line-height: 1.7;
}
.statusline { font-size: 14px; padding: 12px 14px; border-radius: 10px; background: #f3f4f6; }
.statusline.ok { background: #ecfdf5; color: #065f46; }
.statusline.warn { background: #fffbeb; color: #92400e; }
.statusline.info { background: #eff6ff; color: #1e40af; }
#barcode-wrap { text-align: center; padding: 10px 0; }
.code-text { font-family: ui-monospace, monospace; letter-spacing: 2px; color: var(--sub); font-size: 13px; }
