:root {
  --bg: #fbf7f6;
  --brand: #5b2140;
  --accent: #8a4560;
  --line: #e0d3d8;
  --ink: #2a2029;
  --muted: #6f6169;
  --white: #fff;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 'Noto Sans Thai', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
  display: flex;
  flex-direction: column;
}
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
button {
  background: var(--brand);
  color: var(--white);
  border: 0;
  border-radius: 8px;
  padding: 8px 16px;
  cursor: pointer;
}
button:disabled { opacity: .6; cursor: default; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--white);
}
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.muted { color: var(--muted); }
.error { color: #a3243b; margin: 4px 0; }
.ok { color: var(--brand); }
.brand { color: var(--brand); font-weight: 600; letter-spacing: .08em; text-decoration: none; }
[hidden] { display: none !important; }

/* login + mock forms */
.login-body { align-items: center; justify-content: center; padding: 16px; }
.login-card, .mock-card {
  width: 100%;
  max-width: 380px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.mock-card { max-width: 520px; margin: 24px auto; }
.login-card h1 { margin: 0; font-size: 28px; }
.login-card p, .mock-card h2, .mock-card p { margin: 0; }
label { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 14px; }

/* ticket 11: left sidebar (replaces the top bar). Fixed; pages make room with body padding. */
:root { --sb-w: 212px; --sb-rail: 60px; }
body:has(> .sidebar) { padding-left: var(--sb-w); }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  width: var(--sb-w);
  display: flex;
  flex-direction: column;
  background: var(--white);
  border-right: 1px solid var(--line);
  overflow-x: hidden;
  overflow-y: auto;
}
.sb-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 10px 12px 20px; min-height: 56px; }
.sb-head .brand { font-size: 20px; }
.sb-toggle, .sb-burger { background: none; color: var(--muted); padding: 8px; border-radius: 8px; display: grid; place-items: center; }
.sb-toggle:hover, .sb-burger:hover { background: var(--bg); color: var(--brand); }
.sb-icon { flex: none; display: block; }
.sb-nav { list-style: none; margin: 0; padding: 4px 10px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sb-link {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  background: none;
  color: var(--ink);
  text-align: left;
  text-decoration: none;
  white-space: nowrap;
}
.sb-link:hover { background: var(--bg); }
.sb-link[aria-current="page"] { background: #f4ebf0; color: var(--brand); font-weight: 600; box-shadow: inset 3px 0 0 var(--brand); }
.sb-link:focus-visible, .sb-toggle:focus-visible, .sb-burger:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.sb-foot { border-top: 1px solid var(--line); padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.sb-foot form { margin: 0; }
.sb-user { display: flex; align-items: center; gap: 10px; padding: 6px 12px; min-width: 0; }
.sb-avatar { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--brand); color: var(--white); display: grid; place-items: center; font-size: 12px; }
.staff-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mobile-bar { display: none; }
.sb-backdrop { position: fixed; inset: 0; z-index: 29; background: rgba(42, 32, 41, .45); }
@media (min-width: 768px) {
  .sb-collapsed body:has(> .sidebar) { padding-left: var(--sb-rail); }
  .sb-collapsed .sidebar { width: var(--sb-rail); }
  .sb-collapsed .sb-label, .sb-collapsed .sb-head .brand { display: none; }
  .sb-collapsed .sb-head { justify-content: center; padding-inline: 0; }
  .sb-collapsed .sb-nav, .sb-collapsed .sb-foot { padding-inline: 6px; }
  .sb-collapsed .sb-link, .sb-collapsed .sb-user { justify-content: center; padding-inline: 0; }
  .sb-collapsed .sb-toggle svg { transform: rotate(180deg); }
}
@media (max-width: 767px) {
  body:has(> .sidebar) { padding-left: 0; }
  .mobile-bar { display: flex; align-items: center; gap: 8px; padding: 6px 12px; background: var(--white); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
  .mobile-bar .brand { font-size: 18px; }
  .sb-toggle { display: none; }
  .sidebar { width: min(280px, 85vw); transform: translateX(-100%); visibility: hidden; transition: transform .2s ease, visibility 0s linear .2s; }
  .sb-open .sidebar { transform: none; visibility: visible; transition: transform .2s ease; box-shadow: 4px 0 24px rgba(42, 32, 41, .18); }
}
@media (prefers-reduced-motion: reduce) {
  .sidebar, .sb-open .sidebar { transition: none; }
}
.spacer { flex: 1; }
.link-button { background: none; color: var(--accent); padding: 0; }

/* inbox */
.app { flex: 1; min-height: 0; display: grid; grid-template-columns: 340px 1fr; }
.list { border-right: 1px solid var(--line); overflow-y: auto; background: var(--white); }
#conv-list { list-style: none; margin: 0; padding: 0; }
.conv a {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
}
.conv a:hover { background: var(--bg); }
.conv.active a { background: var(--bg); box-shadow: inset 3px 0 0 var(--brand); }
.badge {
  flex: none;
  font-size: 11px;
  font-weight: 600;
  color: var(--brand);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 6px;
}
.conv-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.conv-name, .conv-preview { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-preview { color: var(--muted); font-size: 13px; }
.conv.unread .conv-name { font-weight: 600; }
.conv-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; font-size: 12px; color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; }
.conv.unread .dot { background: var(--accent); }

.thread { display: flex; flex-direction: column; min-height: 0; }
.thread-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--white); }
.back { display: none; text-decoration: none; }
.messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 72%; display: flex; flex-direction: column; }
.msg.in { align-self: flex-start; }
.msg.out { align-self: flex-end; align-items: flex-end; }
.bubble {
  padding: 8px 12px;
  border-radius: 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.msg.in .bubble { background: var(--white); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg.out .bubble { background: var(--brand); color: var(--white); border-bottom-right-radius: 4px; }
.meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.reply { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); background: var(--white); }
.reply textarea { flex: 1; resize: vertical; min-height: 44px; max-height: 200px; }
.reply .error { flex-basis: 100%; }
.empty { padding: 24px 16px; margin: 0; }
.conn { position: fixed; bottom: 12px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--white); padding: 6px 12px; border-radius: 8px; font-size: 13px; margin: 0; }

@media (max-width: 767px) {
  .app { grid-template-columns: 1fr; }
  .list { border-right: 0; }
  body.has-thread .list { display: none; }
  body:not(.has-thread) .thread { display: none; }
  .back { display: inline; }
  .msg { max-width: 85%; }
}

/* ---------------------------------------------------------------- tickets 03/04 */
.small { font-size: 13px; }
.mono { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 13px; }
.warn { background: #fff4e5; border: 1px solid #f0d2a8; color: #6b4310; border-radius: 8px; padding: 8px 10px; margin: 8px 0; }
button.secondary { background: var(--white); color: var(--brand); border: 1px solid var(--brand); }
button.danger { background: #a3243b; }
.thread-head .spacer { flex: 1; }
.thread-head button { padding: 6px 12px; }
.reply textarea.has-draft { border-color: var(--accent); }

/* order panel: right column on wide screens, full-screen sheet otherwise */
.order-panel { background: var(--white); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.panel-head { display: flex; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.panel-body { flex: 1; overflow-y: auto; padding: 0 16px 24px; }
.panel-section { padding: 14px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.panel-section h3 { margin: 0; font-size: 15px; color: var(--brand); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.row-4 { grid-template-columns: 1.3fr 1fr 1fr 1fr; }
.row-inline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--ink); }
label.check input { width: auto; }
input[readonly] { background: var(--bg); }
@media (min-width: 1280px) {
  body.panel-open .app { grid-template-columns: 300px 1fr 420px; }
}
@media (max-width: 1279px) {
  .order-panel { position: fixed; inset: 0; z-index: 20; border-left: 0; }
}
/* 768-1279px: keep the chat visible while ordering; the conversation list makes room. */
@media (min-width: 768px) and (max-width: 1279px) {
  body.panel-open .app { grid-template-columns: 1fr minmax(360px, 420px); }
  body.panel-open .list { display: none; }
  .order-panel { position: static; border-left: 1px solid var(--line); }
}

.picker-head img { border-radius: 6px; object-fit: cover; background: var(--bg); }
.pc-name { font-size: 13px; line-height: 1.3; }
.pc-meta { font-size: 11px; color: var(--muted); }
.picker { border: 1px solid var(--line); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 10px; background: var(--bg); }
.picker-head { display: flex; align-items: center; gap: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: var(--white); color: var(--ink); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; }
.chip.on { border-color: var(--brand); color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.chip.size { border-radius: 8px; display: flex; flex-direction: column; align-items: center; line-height: 1.2; min-width: 64px; }
.chip.size small { font-size: 11px; color: var(--muted); }
.chip:disabled { opacity: .45; text-decoration: line-through; }
.picker-add { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; background: var(--white); }
.stepper button { background: none; color: var(--brand); padding: 4px 12px; }
.stepper output { min-width: 28px; text-align: center; }
.cart { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.cart-line { display: grid; grid-template-columns: 1fr auto auto auto; gap: 8px; align-items: center; }
.cl-main { display: flex; flex-direction: column; min-width: 0; }
.cl-main small { font-size: 12px; }
.cl-total { min-width: 84px; text-align: right; }
.summary dl, .kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; }
.summary dd, .kv dd { margin: 0; text-align: right; }
.summary button[type="submit"] { padding: 12px; font-weight: 600; }

/* order progress */
.order-progress { display: flex; flex-direction: column; gap: 8px; }
.op-head { display: flex; align-items: center; gap: 10px; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.step { display: flex; gap: 10px; align-items: flex-start; }
.step-icon { width: 22px; height: 22px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 12px; border: 1px solid var(--line); color: var(--muted); }
.step-main { display: flex; flex-direction: column; }
.step-main small { color: var(--muted); font-size: 12px; }
.step-done .step-icon { background: #2f7d4f; border-color: #2f7d4f; color: var(--white); }
.step-skipped .step-icon { background: var(--bg); }
.step-running .step-icon { border-color: var(--accent); color: var(--accent); }
.step-failed .step-icon { background: #a3243b; border-color: #a3243b; color: var(--white); }
.step-failed .step-main small { color: #a3243b; }
.op-links { margin: 0; }
.status { font-size: 12px; border-radius: 999px; padding: 1px 10px; border: 1px solid var(--line); white-space: nowrap; }
.status-needs_attention { background: #fde8ec; border-color: #f2b8c3; color: #a3243b; }
.status-confirmed, .status-shipped { background: #eef3fb; border-color: #c9d8f0; color: #234a85; }
.status-delivered { background: #e7f4ec; border-color: #b9dcc6; color: #2f7d4f; }
.status-cancelled, .status-returned { background: var(--bg); color: var(--muted); }

/* list pages */
body.page { display: block; }
.page-main { max-width: 1200px; margin: 0 auto; padding: 16px; }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.page-head h2 { margin: 0; }
.page-head form { margin: 0; }
.filters { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.filters select { width: auto; }
.filters input { flex: 1; min-width: 200px; width: auto; }
.table-wrap { overflow-x: auto; background: var(--white); border: 1px solid var(--line); border-radius: 10px; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.table th { font-size: 13px; color: var(--muted); font-weight: 500; white-space: nowrap; }
.table .num { text-align: right; white-space: nowrap; }
.table td.zero { color: #a3243b; font-weight: 600; }
.table.compact td { padding: 6px 0; }
.thumb { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; display: block; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.card { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.card h3 { margin: 0 0 10px; font-size: 15px; color: var(--brand); }
.card h3:not(:first-child) { margin-top: 16px; }
.cancel-form { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.cancel-form p { margin: 0; }
/* Ticket 12: cancel lives in the progress block (chat panel); the order page keeps its own in the side card. */
.op-cancel { margin-top: 12px; }
.op-cancel .cancel-form { margin-top: 0; }
#order-live .op-cancel { display: none; }
.parcel-status { display: block; }
.sync-form { margin: 6px 0 0; }
@media (max-width: 767px) {
  .detail-grid { grid-template-columns: 1fr; }
  .thread-head button { white-space: nowrap; }
  .row-4 { grid-template-columns: 1fr 1fr; }
}

/* ticket 05: paging buttons, privacy page */
#more-convs, #older-msgs { display: block; margin: 8px auto; }
.privacy { max-width: 720px; }
.privacy h3 { color: var(--brand); margin-bottom: 4px; }
.table .filters { margin: 0; flex-wrap: nowrap; }
.table .filters input { min-width: 140px; }

/* ticket 07: channel logos + customer status tags */
.ch-icon { flex: none; display: block; border-radius: 4px; }
.tag {
  align-self: flex-start;
  font-size: 12px;
  line-height: 1.5;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 8px;
  white-space: nowrap;
  background: var(--white);
  color: var(--muted);
}
.tag-interested { background: #f4ebf0; border-color: #dcc4d1; color: var(--brand); }
.tag-ordered { background: #e9f3ec; border-color: #bcd9c5; color: #2b6a43; }
.tag-preordered { background: #ecf0f7; border-color: #c8d3e6; color: #2f4b7a; }
/* return / exchange: warm "needs attention", deliberately not the error red */
.tag-return_requested { background: #fbeee3; border-color: #ecc9a8; color: #8a4512; }
.tag-size_exchange { background: #fbf3dc; border-color: #e8d39a; color: #7a5a0b; }
.conv-main .tag { margin: 2px 0; }
.status-form { margin: 0; display: flex; gap: 6px; flex: none; max-width: 100%; }
select.tag-select { width: auto; max-width: 100%; font-size: 13px; padding: 3px 8px; cursor: pointer; font-weight: 500; }
select.tag-select option { background: var(--white); color: var(--ink); }
.thread-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag-filter { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--white); z-index: 1; }
.tag-filter label { font-size: 13px; white-space: nowrap; }
.tag-filter select { flex: 1; min-width: 0; font-size: 14px; }
@media (max-width: 767px) {
  .thread-head { flex-wrap: wrap; row-gap: 6px; }
}

/* ticket 08: batch label print */
.print-labels { display: none; }
/* While labels print, the page holds only the label images, one per sheet, scaled to fit (never cropped): an A6 iShip label
   on 76x130 mm paper prints at about 72%. @page size comes from print.js (LABEL_PAGE_SIZE). */
@media print {
  body.printing-labels { display: block; margin: 0; padding: 0; background: #fff; }
  body.printing-labels > :not(.print-labels) { display: none !important; }
  body.printing-labels .print-labels { display: block; }
  .print-labels img { display: block; width: 100vw; height: 100vh; object-fit: contain; object-position: center; break-after: page; page-break-after: always; }
  .print-labels img:last-child { break-after: auto; page-break-after: auto; }
}
.print-toast { z-index: 30; max-width: calc(100% - 32px); }
.print-toast a { color: var(--white); }
.print-bar {
  position: sticky; bottom: 0; z-index: 5;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-top: 12px; padding: 10px 12px;
  background: var(--white); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 -4px 12px rgba(42, 32, 41, .06);
}
.table .pick { width: 36px; text-align: center; }
.table .pick input { width: 18px; height: 18px; margin: 0; vertical-align: middle; }
.status-printed { background: #e9f3ec; border-color: #bcd9c5; color: #2b6a43; }
.op-links { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.op-links button { padding: 4px 12px; }
.filters label.check { white-space: nowrap; }
.filters label.check input { flex: none; min-width: 0; width: auto; }

/* ticket 09: returns + size exchanges (reuses the existing button, tag and status styles) */
a.button-link { display: inline-block; text-decoration: none; border-radius: 8px; padding: 4px 12px; font-size: 14px; }
a.button-link.secondary { background: var(--white); color: var(--brand); border: 1px solid var(--brand); }
.case-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.case-orders { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.case-orders li { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.case-page .stack, form.stack { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; margin: 0 0 12px; }
.case-page .stack > label, .case-page .stack > .row { width: 100%; }
.case-page form { margin: 0 0 8px; }
.case-form { display: flex; flex-direction: column; gap: 12px; }
.case-form .table td { vertical-align: top; }
.case-form select, .case-form .table input { min-width: 90px; }
.radio-row, .inspect { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin: 0; display: flex; gap: 12px; flex-wrap: wrap; width: 100%; }
.radio-row legend, .inspect legend { font-size: 13px; color: var(--muted); padding: 0 4px; }
.draft-note pre { white-space: pre-wrap; font: inherit; margin: 6px 0 0; }
.timeline { padding-left: 18px; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.settings-form { max-width: 640px; }
.settings-form label > span { display: block; margin-bottom: 4px; }
.case-requested, .case-received { background: #fbeee3; border-color: #ecc9a8; color: #8a4512; }
.case-approved, .case-awaiting_return { background: #eef3fb; border-color: #c9d8f0; color: #234a85; }
.case-completed { background: #e7f4ec; border-color: #b9dcc6; color: #2f7d4f; }
.case-rejected, .case-cancelled { background: var(--bg); color: var(--muted); }
@media (max-width: 767px) {
  /* new-case form: one block per item instead of a sideways-scrolling table */
  .case-form .table, .case-form .table tbody, .case-form .table tr, .case-form .table td { display: block; width: 100%; }
  .case-form .table thead { display: none; }
  .case-form .table tr { padding: 8px 0; border-bottom: 1px solid var(--line); }
  .case-form .table td { border: 0; padding: 4px 10px; text-align: left; }
}

/* ---------------------------------------------------------------- ticket 10: quick replies + images */
.warn-text { color: #6b4310; }
.quick { flex-basis: 100%; display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.quick .chip { flex: none; white-space: nowrap; font-size: 13px; padding: 4px 12px; }
.quick .chip:disabled { text-decoration: none; }
.reply .warn { flex-basis: 100%; margin: 0; }
.qr-attach { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.qr-attach li { position: relative; }
.qr-attach img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); display: block; }
.qr-remove { position: absolute; top: -6px; right: -6px; width: 24px; height: 24px; padding: 0; border-radius: 50%; line-height: 1; }
.bubble-img { padding: 0; overflow: hidden; display: block; }
.bubble-img img { display: block; max-width: min(240px, 100%); max-height: 320px; object-fit: contain; background: var(--white); }
.qr-picker { width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 16px; border: 1px solid var(--line); border-radius: 12px; }
.qr-picker form { display: flex; flex-direction: column; gap: 10px; }
.qr-picker h3 { margin: 0; }
.qr-products { list-style: none; margin: 0; padding: 0; overflow-y: auto; max-height: 50vh; display: flex; flex-direction: column; gap: 4px; }
.qr-picker-actions { display: flex; justify-content: flex-end; gap: 8px; }
.spec-images { margin-top: 24px; }
.spec-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.spec-list > li { border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.spec-thumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; }
.spec-thumb { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.spec-thumb img, .qr-image img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); display: block; }
.spec-upload { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.spec-upload input[type="file"] { max-width: 100%; }
.qr-image { border: 1px solid var(--line); border-radius: 8px; display: flex; flex-direction: column; gap: 6px; }

/* ---------------------------------------------------------------- ticket 11: product picker, role images */
.product-results { list-style: none; margin: 0; padding: 0; max-height: 300px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--white); }
.product-results > li + li { border-top: 1px solid var(--line); }
.product-results > li.muted { padding: 10px 12px; }
.product-row { width: 100%; display: flex; align-items: center; gap: 10px; padding: 6px 10px; background: none; color: var(--ink); border-radius: 0; text-align: left; }
.product-row:hover { background: var(--bg); }
.product-row.selected { background: #f4ebf0; box-shadow: inset 3px 0 0 var(--brand); }
.product-row:focus-visible { outline-offset: -2px; }
.product-row img, .product-row .thumb-empty { width: 48px; height: 48px; flex: none; border-radius: 6px; object-fit: cover; background: var(--bg); }
.thumb-empty { display: inline-block; width: 56px; height: 56px; border-radius: 6px; background: var(--bg); }
.pr-main { display: flex; flex-direction: column; min-width: 0; }
.qr-products > li { padding: 4px 0; }
.qr-colours { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 2px 0 4px 28px; }
.qr-colours label.check { font-size: 14px; gap: 6px; }
.role-slots { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }
.role-slot { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; width: 172px; }
.role-slot img, .role-empty { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); display: grid; place-items: center; font-size: 12px; color: var(--muted); }
.role-slot form { margin: 0; }
.role-slot input[type="file"] { font-size: 12px; padding: 4px; }
.role-slot button.small { padding: 4px 10px; font-size: 13px; }
