/* Tiko Brick Checker dashboard sections — styled to play nicely with the
   Toolkit dashboard chrome. Variables fall back to dark-friendly defaults. */
.tbc-dash-section { max-width: 1100px; margin: 0 auto; padding: 8px 0 32px; }
.tbc-dash-head h2 { margin: 0 0 4px; font-size: 22px; }
.tbc-dash-head .muted, .tbc-dash-section .muted {
  color: rgba(0,0,0,0.55); font-size: 13px; margin: 4px 0 16px;
}
.tbc-back {
  display: inline-block; margin-bottom: 8px; text-decoration: none; font-size: 13px;
}

.tbc-tabs {
  display: flex; gap: 4px; margin: 16px 0 20px;
  border-bottom: 1px solid rgba(0,0,0,0.1);
}
.tbc-tab {
  padding: 8px 14px; text-decoration: none; color: inherit;
  border-bottom: 2px solid transparent;
  display: inline-flex; align-items: center; gap: 6px; font-size: 14px;
}
.tbc-tab .badge {
  background: rgba(0,0,0,0.08); border-radius: 999px;
  padding: 1px 8px; font-size: 11px; line-height: 1.6;
}
.tbc-tab.is-active { border-bottom-color: #ffcc02; font-weight: 600; }

.tbc-empty {
  background: rgba(0,0,0,0.03); border: 1px dashed rgba(0,0,0,0.15);
  border-radius: 8px; padding: 24px; text-align: center;
}
.tbc-empty p { margin: 0; }

.tbc-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.tbc-card {
  position: relative; background: #fff;
  border: 1px solid rgba(0,0,0,0.1); border-radius: 8px;
  overflow: hidden; display: flex; flex-direction: column;
  transition: border-color 120ms ease, transform 120ms ease;
}
.tbc-card:hover { border-color: #ffcc02; transform: translateY(-1px); }
.tbc-card-link {
  display: flex; flex-direction: column; gap: 0;
  text-decoration: none; color: inherit; flex: 1;
}
.tbc-thumb {
  width: 100%; aspect-ratio: 4/3; object-fit: contain;
  background: #f7f7f9; padding: 12px; box-sizing: border-box;
}
.tbc-thumb-empty {
  display: flex; align-items: center; justify-content: center;
  font-size: 48px; color: rgba(0,0,0,0.2);
}
.tbc-card-body { padding: 10px 12px 12px; }
.tbc-card-body h3 { margin: 0 0 4px; font-size: 14px; line-height: 1.3; }
.tbc-card-body p { margin: 0; font-size: 12px; }
.tbc-card-body .tbc-notes { margin-top: 6px; font-size: 12px; opacity: 0.75; font-style: italic; }
.tbc-remove {
  position: absolute; top: 6px; right: 6px;
  width: 26px; height: 26px;
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(0,0,0,0.12); border-radius: 50%;
  cursor: pointer; font-size: 16px; line-height: 1;
  opacity: 0; transition: opacity 120ms ease;
}
.tbc-card:hover .tbc-remove, .tbc-remove:focus { opacity: 1; }
.tbc-remove:hover { background: #d92027; color: #fff; border-color: #d92027; }

/* Lists grid */
.tbc-list-create {
  display: flex; gap: 8px; margin-bottom: 18px;
  background: rgba(0,0,0,0.03); padding: 10px;
  border: 1px solid rgba(0,0,0,0.1); border-radius: 8px;
}
.tbc-list-create input {
  flex: 1; padding: 8px 10px;
  border: 1px solid rgba(0,0,0,0.15); border-radius: 4px;
  /* 16px to disable iOS Safari's auto-zoom on focus. */
  font-size: 16px;
}
.tbc-list-create button {
  background: #ffcc02; color: #1a1306; border: 0;
  padding: 8px 16px; border-radius: 4px; font-weight: 600; cursor: pointer;
}
.tbc-batch-link {
  background: #1a1a1f; color: #fff;
  padding: 8px 14px; border-radius: 4px;
  text-decoration: none; font-weight: 600; font-size: 14px;
  white-space: nowrap;
}
.tbc-batch-link:hover { background: #2a2a32; color: #ffcc02; }

.tbc-list-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.tbc-list-card {
  background: #fff; border: 1px solid rgba(0,0,0,0.1); border-radius: 8px;
  padding: 14px; display: flex; flex-direction: column; gap: 10px;
}
.tbc-list-link { text-decoration: none; color: inherit; flex: 1; }
.tbc-list-link h3 { margin: 0 0 4px; font-size: 16px; }
.tbc-list-actions {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  border-top: 1px solid rgba(0,0,0,0.06); padding-top: 10px; font-size: 12px;
}
.tbc-toggle { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.tbc-toggle input { accent-color: #ffcc02; }
.tbc-share-url {
  flex: 1; min-width: 0; padding: 4px 6px;
  border: 1px solid rgba(0,0,0,0.1); border-radius: 4px; font-size: 11px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace; background: #f7f7f9;
}
.tbc-list-delete {
  background: transparent; border: 1px solid rgba(0,0,0,0.15); border-radius: 4px;
  padding: 4px 10px; cursor: pointer; font-size: 12px;
}
.tbc-list-delete:hover { background: #d92027; color: #fff; border-color: #d92027; }

#tbc-list-name {
  outline: none; cursor: text;
}
#tbc-list-name:focus {
  background: rgba(255, 204, 2, 0.1); border-radius: 4px;
}

/* Profile section */
.tbc-profile-card {
  max-width: 540px;
  background: #fff; border: 1px solid rgba(0,0,0,0.1); border-radius: 8px;
  padding: 22px;
}
.tbc-profile-id {
  display: flex; align-items: center; gap: 14px;
  padding-bottom: 16px; margin-bottom: 16px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}
.tbc-profile-avatar { width: 64px; height: 64px; border-radius: 50%; }
.tbc-profile-form { display: flex; flex-direction: column; gap: 14px; }
.tbc-field { display: flex; flex-direction: column; gap: 4px; }
.tbc-field-label { font-size: 12px; color: rgba(0,0,0,0.6); font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; }
.tbc-field input {
  padding: 9px 11px;
  /* 16px to disable iOS Safari's auto-zoom on focus. */
  font-size: 16px;
  border: 1px solid rgba(0,0,0,0.18); border-radius: 4px;
  background: #fff;
}
.tbc-field input:focus {
  outline: none; border-color: #ffcc02; box-shadow: 0 0 0 1px #ffcc02;
}
.tbc-pw-details {
  border: 1px solid rgba(0,0,0,0.1); border-radius: 6px;
  padding: 0 14px; background: rgba(0,0,0,0.02);
}
.tbc-pw-details summary {
  cursor: pointer; padding: 12px 0; font-weight: 600; font-size: 13px;
  list-style: none;
}
.tbc-pw-details summary::before { content: "▸ "; color: rgba(0,0,0,0.4); }
.tbc-pw-details[open] summary::before { content: "▾ "; }
.tbc-pw-details[open] { padding-bottom: 14px; }
.tbc-pw-details[open] > .tbc-field:first-of-type { margin-top: 4px; }
.tbc-pw-details > .tbc-field { margin-bottom: 10px; }

.tbc-profile-footer {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-top: 4px; padding-top: 14px;
  border-top: 1px solid rgba(0,0,0,0.08);
}
.tbc-save-btn {
  background: #ffcc02; color: #1a1306; border: 0;
  padding: 9px 18px; border-radius: 4px;
  font-weight: 600; font-size: 14px; cursor: pointer;
}
.tbc-save-btn:hover { background: #ffd633; }
.tbc-save-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.tbc-profile-status { flex: 1; font-size: 13px; }
.tbc-profile-status.is-ok { color: #2d7a2d; }
.tbc-profile-status.is-err { color: #c43237; }
.tbc-logout-link {
  margin-left: auto; font-size: 13px; color: rgba(0,0,0,0.55);
  text-decoration: none;
}
.tbc-logout-link:hover { color: #c43237; }

/* ---- List editor ---------------------------------------------------- */
.tbc-add-bar {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  background: rgba(0,0,0,0.03); padding: 12px;
  border: 1px solid rgba(0,0,0,0.1); border-radius: 8px;
  margin: 16px 0;
}
.tbc-scan-btn {
  background: #ffcc02; color: #1a1306; border: 0;
  padding: 9px 16px; border-radius: 6px; font-weight: 600; cursor: pointer;
  font-size: 14px;
}
.tbc-scan-btn:hover { background: #ffd633; }
.tbc-add-or { color: rgba(0,0,0,0.5); font-size: 13px; }
.tbc-add-form { display: flex; gap: 6px; flex: 1; min-width: 220px; }
.tbc-add-form input {
  flex: 1; padding: 9px 11px; border: 1px solid rgba(0,0,0,0.18);
  border-radius: 4px;
  /* 16px to disable iOS Safari's auto-zoom on focus. */
  font-size: 16px;
}
.tbc-add-form input:focus { outline: none; border-color: #ffcc02; box-shadow: 0 0 0 1px #ffcc02; }
.tbc-add-form button {
  background: #1a1a1f; color: #fff; border: 0;
  padding: 9px 16px; border-radius: 4px; font-weight: 600; cursor: pointer;
}
.tbc-add-form button:hover { background: #2a2a32; }

.tbc-scanner-mount {
  position: relative; background: #000; border-radius: 8px;
  overflow: hidden; max-width: 540px; margin: 0 auto 16px;
  aspect-ratio: 4/3;
}
.tbc-scanner-mount video { width: 100%; height: 100%; object-fit: cover; display: block; }
.tbc-scan-cancel {
  position: absolute; top: 10px; right: 10px;
  background: rgba(0,0,0,0.6); color: #fff; border: 0;
  width: 36px; height: 36px; border-radius: 50%;
  font-size: 22px; line-height: 1; cursor: pointer;
}
.tbc-scan-cancel:hover { background: rgba(0,0,0,0.85); }

.tbc-add-status {
  margin: 8px 0; padding: 8px 12px; border-radius: 4px;
  font-size: 13px; min-height: 1.4em;
}
.tbc-add-status.is-ok  { background: #ecf9ec; color: #2d7a2d; }
.tbc-add-status.is-err { background: #fde8ea; color: #c43237; }

.tbc-items-wrap { overflow-x: auto; margin: 16px 0; }
.tbc-items-table {
  width: 100%; border-collapse: collapse; min-width: 640px;
  background: #fff; border: 1px solid rgba(0,0,0,0.1); border-radius: 8px;
  overflow: hidden; font-size: 14px;
}
.tbc-items-table th {
  text-align: left; padding: 10px 12px; font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.4px;
  color: rgba(0,0,0,0.55); border-bottom: 1px solid rgba(0,0,0,0.08);
  font-weight: 600;
}
.tbc-items-table th.num, .tbc-items-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbc-items-table tbody tr { border-bottom: 1px solid rgba(0,0,0,0.05); }
.tbc-items-table tbody tr:last-child { border-bottom: 0; }
.tbc-items-table tbody tr:hover { background: rgba(255, 204, 2, 0.05); }
.tbc-items-table td { padding: 10px 12px; vertical-align: middle; }
.tbc-items-table .thumb-cell { width: 60px; padding: 6px 8px 6px 12px; }
.tbc-items-table .thumb-cell img { width: 48px; height: 48px; object-fit: contain; background: #f7f7f9; border-radius: 4px; padding: 4px; }
.tbc-items-table .thumb-empty {
  width: 48px; height: 48px; background: #f7f7f9; border-radius: 4px;
  display: flex; align-items: center; justify-content: center; font-size: 22px;
}
.tbc-items-table .tbc-row-name { color: inherit; text-decoration: none; font-weight: 500; }
.tbc-items-table .tbc-row-name:hover { color: #c43237; text-decoration: underline; }
.tbc-items-table .row-actions { width: 40px; text-align: right; padding-right: 12px; }
.tbc-row-remove {
  background: transparent; border: 1px solid rgba(0,0,0,0.15);
  width: 28px; height: 28px; border-radius: 50%;
  font-size: 16px; line-height: 1; cursor: pointer; color: rgba(0,0,0,0.5);
}
.tbc-row-remove:hover { background: #d92027; color: #fff; border-color: #d92027; }
.tbc-empty-row td { text-align: center; padding: 24px 12px; }

.tbc-totals-row {
  background: rgba(255, 204, 2, 0.06);
  border-top: 2px solid rgba(0,0,0,0.1);
  font-weight: 600;
}
.tbc-totals-row td { padding: 12px; }
.tbc-totals-row .muted { font-weight: 400; }
#tbc-priced-note { margin-left: 6px; font-size: 12px; }
#tbc-refresh-btn {
  background: transparent; border: 1px solid rgba(0,0,0,0.15);
  width: 28px; height: 28px; border-radius: 50%;
  font-size: 14px; cursor: pointer;
}
#tbc-refresh-btn:hover:not(:disabled) { background: #ffcc02; border-color: #ffcc02; }
#tbc-refresh-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Add/Check mode toggle — high-contrast pill switch. Dark base, yellow
   thumb, two equal-width slots. The thumb is positioned absolutely and
   translates between slots so the slide motion is unmissable. */
.tbc-mode {
  position: relative;
  display: inline-flex;
  background: #1a1a1f;
  border-radius: 999px; padding: 4px;
  flex-shrink: 0;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.4);
}
.tbc-mode-thumb {
  position: absolute;
  top: 4px; left: 4px;
  width: calc(50% - 4px); height: calc(100% - 8px);
  background: #ffcc02;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(255,204,2,0.35), 0 1px 2px rgba(0,0,0,0.3);
  transition: transform 240ms cubic-bezier(0.34, 1.36, 0.64, 1);
  pointer-events: none;
}
.tbc-mode[data-mode="add"] .tbc-mode-thumb { transform: translateX(100%); }
.tbc-mode-btn {
  position: relative; z-index: 1;
  background: transparent; border: 0;
  padding: 9px 18px;
  font-size: 14px; font-weight: 700;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  transition: color 200ms ease;
  white-space: nowrap;
  border-radius: 999px;
  -webkit-tap-highlight-color: transparent;
}
.tbc-mode-btn.is-active { color: #1a1a1f; }
.tbc-mode-btn:hover:not(.is-active) { color: rgba(255,255,255,0.9); }

/* Statusline below the add-bar — version + mode + wedge state +
   item count. Same shape as the batch-scan one for consistency. */
.tbc-statusline {
  display: flex; flex-wrap: wrap; gap: 14px;
  margin: -8px 0 12px;
  padding: 4px 12px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 11px;
  color: rgba(0,0,0,0.55);
  background: rgba(0,0,0,0.03);
  border-radius: 6px;
}
.tbc-statusline .tbc-stat-version { color: rgba(0,0,0,0.35); }
.tbc-statusline .is-on   { color: #2d7a2d; }
.tbc-statusline .is-warn { color: #b07700; }
.tbc-statusline .is-err  { color: #c43237; }

/* Qty +/- pill — wrapper inside the td so the td itself stays a normal
   table-cell. ~32px touch targets work on every viewport without a
   separate desktop variant. */
.tbc-items-table td.qty-cell {
  white-space: nowrap;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.qty-pill {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: rgba(0,0,0,0.04);
  border-radius: 999px;
  padding: 2px;
  vertical-align: middle;
}
.qty-pill button {
  width: 32px; height: 32px; border-radius: 50%;
  background: transparent; border: 0;
  font-size: 18px; line-height: 1; cursor: pointer; color: rgba(0,0,0,0.65);
  font-weight: 600;
  -webkit-tap-highlight-color: transparent;
  transition: background 120ms ease, color 120ms ease;
}
.qty-pill button:hover,
.qty-pill button:active { background: #ffcc02; color: #1a1306; }
.qty-pill .tbc-qty-v {
  display: inline-block; min-width: 28px; padding: 0 6px;
  font-weight: 700; font-size: 15px;
  text-align: center;
}

/* Check-mode flash highlight */
@keyframes tbc-row-flash {
  0%   { background: rgba(74, 222, 128, 0.5); }
  100% { background: transparent; }
}
.tbc-row-flash { animation: tbc-row-flash 1500ms ease-out; }

/* ---- List editor mobile layout -----------------------------------------
   Below 720px, drop the table layout and render each row as a card.
   Explicit grid coordinates per cell — no shared grid-areas (those
   stack on top of each other in CSS Grid), so nothing overlaps.
   Layout per item card:

     ┌──────────┬──────────────────────────┐ ✕   ← remove (absolute)
     │  thumb   │ Set name                 │
     │   64px   │ set# · theme · year      │
     │          │ [-] qty [+]              │
     │          │ new $X   used $X   rrp$X │
     └──────────┴──────────────────────────┘
*/
@media (max-width: 720px) {
  /* Add bar — mode toggle full-width above scan + form */
  .tbc-add-bar { flex-wrap: wrap; gap: 8px; padding: 10px; }
  .tbc-add-bar .tbc-mode      { order: 1; flex: 0 0 100%; justify-content: stretch; }
  .tbc-add-bar .tbc-mode-btn  { flex: 1; padding: 11px 14px; font-size: 15px; }
  .tbc-add-bar .tbc-scan-btn  { order: 2; flex: 0 0 auto; }
  .tbc-add-bar .tbc-add-form  { order: 3; flex: 1 1 100%; min-width: 0; }

  .tbc-list-actions { gap: 6px; flex-wrap: wrap; font-size: 11px; }
  .tbc-share-url   { flex-basis: 100%; }
  .tbc-statusline  { font-size: 10px; gap: 8px; padding: 4px 8px; }

  /* Reset table chrome */
  .tbc-items-wrap { overflow-x: hidden; margin: 8px 0 16px; padding: 0; }
  .tbc-items-table,
  .tbc-items-table tbody,
  .tbc-items-table thead,
  .tbc-items-table tfoot {
    display: block; background: transparent; border: 0; min-width: 0;
    box-shadow: none;
  }
  .tbc-items-table thead { display: none; }

  /* ---- Each <tr> becomes a card ---- */
  .tbc-items-table tbody tr {
    display: grid;
    grid-template-columns: 64px 1fr 1fr 1fr;
    column-gap: 8px;
    row-gap: 6px;
    background: #fff;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 10px;
    position: relative;
  }
  .tbc-items-table tbody tr:hover { background: #fff; }

  .tbc-items-table tbody td {
    display: block !important;
    padding: 0 !important;
    border: 0 !important;
    text-align: left !important;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Place each cell at an explicit (column, row) — no stacking. */
  .tbc-items-table .thumb-cell        { grid-column: 1; grid-row: 1 / 5; align-self: start; }
  .tbc-items-table tbody td:nth-child(2) { grid-column: 2 / 5; grid-row: 1; }   /* name */
  .tbc-items-table tbody td:nth-child(3) { grid-column: 2 / 5; grid-row: 2; font-size: 12px; color: rgba(0,0,0,0.55); }
  .tbc-items-table .qty-cell          { grid-column: 2 / 5; grid-row: 3; }
  .tbc-items-table tbody td:nth-child(5) { grid-column: 2; grid-row: 4; font-size: 13px; }
  .tbc-items-table tbody td:nth-child(6) { grid-column: 3; grid-row: 4; font-size: 13px; }
  .tbc-items-table tbody td:nth-child(7) { grid-column: 4; grid-row: 4; font-size: 13px; }

  /* Empty theme cell shouldn't reserve a row */
  .tbc-items-table tbody td:nth-child(3):empty { display: none !important; }

  /* Thumb image */
  .tbc-items-table .thumb-cell img,
  .tbc-items-table .thumb-cell .thumb-empty {
    width: 64px !important; height: 64px !important;
  }

  /* Name styling */
  .tbc-items-table .tbc-row-name { font-size: 15px; font-weight: 600; }
  .tbc-items-table tbody td:nth-child(2) > .muted { font-size: 12px; }

  /* Price labels — show "new ", "used ", "rrp " before each value */
  .tbc-items-table tbody td:nth-child(5)::before { content: "new ";  color: rgba(0,0,0,0.5); margin-right: 2px; }
  .tbc-items-table tbody td:nth-child(6)::before { content: "used "; color: rgba(0,0,0,0.5); margin-right: 2px; }
  .tbc-items-table tbody td:nth-child(7)::before { content: "rrp ";  color: rgba(0,0,0,0.5); margin-right: 2px; }

  /* Remove × floats top-right of the card, outside the grid flow */
  .tbc-items-table .row-actions {
    position: absolute;
    top: 6px; right: 6px;
    grid-row: 1; grid-column: 4;     /* fallback if absolute fails */
  }
  .tbc-row-remove { width: 32px; height: 32px; font-size: 18px; background: rgba(0,0,0,0.04); border-color: transparent; }

  /* ---- Footer totals card ---- */
  .tbc-items-table tfoot tr {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    column-gap: 10px;
    row-gap: 6px;
    background: rgba(255, 204, 2, 0.08);
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 10px;
    padding: 12px 14px;
    margin-top: 4px;
    position: relative;
  }
  .tbc-items-table tfoot td {
    display: block !important;
    padding: 0 !important;
    border: 0 !important;
    text-align: left !important;
  }
  .tbc-items-table tfoot td:nth-child(1) { grid-column: 1 / 4; grid-row: 1; font-size: 13px; }
  .tbc-items-table tfoot td:nth-child(2) { grid-column: 1 / 4; grid-row: 2; font-size: 13px; color: rgba(0,0,0,0.6); }
  .tbc-items-table tfoot td:nth-child(2)::before { content: "qty "; color: rgba(0,0,0,0.5); margin-right: 3px; }
  .tbc-items-table tfoot td:nth-child(3) { grid-column: 1; grid-row: 3; font-size: 14px; font-weight: 700; }
  .tbc-items-table tfoot td:nth-child(4) { grid-column: 2; grid-row: 3; font-size: 14px; font-weight: 700; }
  .tbc-items-table tfoot td:nth-child(5) { grid-column: 3; grid-row: 3; font-size: 14px; font-weight: 700; }
  .tbc-items-table tfoot td:nth-child(3)::before { content: "new ";  color: rgba(0,0,0,0.5); font-weight: 400; margin-right: 3px; }
  .tbc-items-table tfoot td:nth-child(4)::before { content: "used "; color: rgba(0,0,0,0.5); font-weight: 400; margin-right: 3px; }
  .tbc-items-table tfoot td:nth-child(5)::before { content: "rrp ";  color: rgba(0,0,0,0.5); font-weight: 400; margin-right: 3px; }
  .tbc-items-table tfoot td.row-actions {
    position: absolute;
    top: 6px; right: 6px;
  }
}

/* ════════════════════════════════════════════════════════════════════
   LIST EDITOR POLISH — overrides + niceties layered on top of the
   base styles above. Goal: tight typography, calm spacing, brand-
   consistent accent on qty + totals, no overlapping cells.
   ════════════════════════════════════════════════════════════════════ */

/* Section frame — slightly narrower for editor pages so list rows
   don't stretch into uncomfortably long lines on desktop. */
.tbc-list-editor { max-width: 960px; }

/* Header — back link as a subtle pill, name claims the eye, actions
   sit on a separate line so they don't fight with the title. */
.tbc-list-editor .tbc-dash-head { margin-bottom: 12px; }
.tbc-list-editor .tbc-back {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px 4px 6px;
  background: rgba(0,0,0,0.04);
  border-radius: 999px;
  margin-bottom: 12px;
  color: rgba(0,0,0,0.6);
  font-size: 13px;
  transition: background 120ms ease;
}
.tbc-list-editor .tbc-back:hover { background: rgba(0,0,0,0.08); color: #1a1a1f; }
#tbc-list-name {
  font-size: 28px; font-weight: 800; letter-spacing: -0.5px;
  margin: 0; padding: 2px 4px;
  border-radius: 6px;
  line-height: 1.15;
}
#tbc-list-name:focus { background: rgba(255, 204, 2, 0.12); outline: 2px solid rgba(255, 204, 2, 0.4); }

/* List header actions row — subtle, secondary */
.tbc-list-editor .tbc-list-actions {
  margin-top: 10px;
  padding: 10px 12px;
  background: rgba(0,0,0,0.025);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 10px;
  border-top-width: 1px;        /* override the prior border-top-only style */
}

/* Add bar — search-bar feel, prominent rounded card */
.tbc-add-bar {
  background: #fff;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 12px;
  padding: 8px 8px 8px 10px;
  margin: 10px 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.02);
}
.tbc-scan-btn {
  border-radius: 999px !important;
  padding: 9px 14px !important;
}
.tbc-add-form {
  background: rgba(0,0,0,0.04);
  border-radius: 999px;
  padding: 2px 4px 2px 14px;
  align-items: center;
}
.tbc-add-form input {
  border: 0 !important;
  background: transparent !important;
  padding: 8px 4px !important;
}
.tbc-add-form input:focus { box-shadow: none !important; }
.tbc-add-form button {
  border-radius: 999px !important;
  padding: 8px 16px !important;
  margin-left: auto;
}

/* Statusline — quieter, clearly secondary */
.tbc-statusline {
  background: transparent !important;
  border-top: 1px solid rgba(0,0,0,0.06);
  border-radius: 0 !important;
  margin: 0 6px 14px !important;
  padding: 6px 0 !important;
  letter-spacing: 0.2px;
}

/* Items table — desktop polish */
.tbc-items-table {
  border-radius: 12px;
  overflow: hidden;
  border-color: rgba(0,0,0,0.08);
}
.tbc-items-table thead {
  background: rgba(0,0,0,0.02);
}
.tbc-items-table th {
  font-weight: 700;
  letter-spacing: 0.6px;
  color: rgba(0,0,0,0.5);
}
.tbc-items-table td {
  font-variant-numeric: tabular-nums;
  vertical-align: middle;
}
.tbc-items-table tbody tr { transition: background 120ms ease; }
.tbc-items-table tbody tr:hover { background: rgba(255,204,2,0.04); }
.tbc-items-table .tbc-row-name {
  font-weight: 600;
  color: #1a1a1f;
}
.tbc-items-table .tbc-row-name:hover { color: #b3211d; }
.tbc-items-table td.num { color: #1a1a1f; font-weight: 500; }

/* Qty pill — soft default, yellow accent when qty > 1 (visual cue
   that this row is a multi-unit entry — the most useful signal at
   a glance for inventory work). */
.qty-pill {
  background: rgba(0,0,0,0.05);
  transition: background 200ms ease, box-shadow 200ms ease;
}
.qty-pill:has(.tbc-qty-v[data-qty]:not([data-qty="1"])) {
  background: rgba(255, 204, 2, 0.18);
  box-shadow: 0 0 0 1px rgba(255, 204, 2, 0.6);
}

/* Remove × — round, ghost by default, red on hover. */
.tbc-row-remove {
  background: transparent;
  border: 0 !important;
  color: rgba(0,0,0,0.35) !important;
  transition: background 120ms ease, color 120ms ease;
}
.tbc-row-remove:hover {
  background: #d92027 !important;
  color: #fff !important;
}

/* Totals row — hero-ish, big bold numbers, accent ring */
.tbc-totals-row {
  background: linear-gradient(180deg, rgba(255,204,2,0.10), rgba(255,204,2,0.04)) !important;
  font-weight: 700;
}
.tbc-totals-row td.num { font-size: 15px; }
#tbc-refresh-btn {
  width: 34px !important; height: 34px !important;
  background: #1a1a1f !important;
  color: #fff !important;
  border: 0 !important;
  font-size: 16px;
  transition: background 120ms ease, transform 200ms ease;
}
#tbc-refresh-btn:hover:not(:disabled) {
  background: #ffcc02 !important; color: #1a1306 !important;
  transform: rotate(45deg);
}

/* ---- Mobile polish — refines the card layout above ---- */
@media (max-width: 720px) {
  .tbc-list-editor { padding: 8px 12px 24px; }
  #tbc-list-name { font-size: 22px; }

  .tbc-add-bar {
    background: rgba(0,0,0,0.025);
    box-shadow: none;
  }

  /* Cards get a soft drop shadow + slightly larger padding */
  .tbc-items-table tbody tr {
    box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 1px 1px rgba(0,0,0,0.03);
    padding: 14px 14px 12px !important;
    border-color: rgba(0,0,0,0.08) !important;
  }

  .tbc-items-table tbody tr:active {
    background: rgba(255,204,2,0.04);
  }

  /* Stack price label/value compactly */
  .tbc-items-table tbody td:nth-child(5),
  .tbc-items-table tbody td:nth-child(6),
  .tbc-items-table tbody td:nth-child(7) {
    font-variant-numeric: tabular-nums;
    line-height: 1.3;
  }
  .tbc-items-table tbody td:nth-child(5)::before,
  .tbc-items-table tbody td:nth-child(6)::before,
  .tbc-items-table tbody td:nth-child(7)::before {
    display: block;
    font-size: 10px !important;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: rgba(0,0,0,0.45) !important;
    margin: 0 !important;
  }
  .tbc-items-table tbody td:nth-child(5),
  .tbc-items-table tbody td:nth-child(6),
  .tbc-items-table tbody td:nth-child(7) {
    font-size: 14px !important;
    font-weight: 600;
  }

  /* Totals card on mobile */
  .tbc-items-table tfoot tr {
    box-shadow: 0 2px 8px rgba(255,204,2,0.15);
    border-color: rgba(255,204,2,0.4) !important;
  }
  .tbc-items-table tfoot td:nth-child(3),
  .tbc-items-table tfoot td:nth-child(4),
  .tbc-items-table tfoot td:nth-child(5) {
    font-size: 15px !important;
    color: #1a1a1f;
  }

  /* Bigger, friendlier remove × on cards */
  .tbc-items-table .tbc-row-remove {
    background: rgba(0,0,0,0.05) !important;
    width: 30px; height: 30px;
  }
}
