/* ui/Customs: the stage on the left, the tabbed shelf of pictured items on the right (over ui/Menu's Menu.css). */
.tk-customs__line { margin: 6px 0 16px; }
.tk-customs {
  display: grid;
  grid-template-columns: minmax(300px, 400px) 1fr;
  gap: 22px;
  align-items: start;
}
.tk-customs__stage {
  position: sticky;
  top: 16px;
  display: flex;
  flex-direction: column;
  border-top: 10px solid var(--tk-coral);
}
.tk-customs__canvas {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  background: var(--tk-ground);
  border-bottom: var(--tk-border);
}
.tk-customs__inspector { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 16px; }
.tk-customs__name { margin: 0; font: 400 24px/1.05 var(--tk-font-display); text-transform: uppercase; }
.tk-customs__what { margin: 0; font: 700 15px/1.3 var(--tk-font-ui); color: var(--tk-ink-dim); }
.tk-customs__earn { margin: 0; font-size: 13px; }
.tk-customs__action { margin-top: 8px; min-height: 40px; display: flex; align-items: center; }
.tk-customs__action .tk-menu__button { font: 400 16px/1 var(--tk-font-display); padding: 10px 18px; display: inline-flex; gap: 6px; align-items: center; }
.tk-customs__worn {
  padding: 8px 14px;
  background: var(--tk-lime);
  border: var(--tk-border);
  font: 400 16px/1 var(--tk-font-display);
}
.tk-customs__gate { font: 700 15px/1.3 var(--tk-font-ui); }

.tk-customs__tabs { display: flex; gap: 10px; margin-bottom: 14px; }
.tk-customs__tab {
  padding: 10px 22px;
  background: var(--tk-paper);
  border: var(--tk-border);
  box-shadow: var(--tk-ledge-sm);
  font: 400 18px/1 var(--tk-font-display);
  text-transform: uppercase;
  color: var(--tk-ink);
  cursor: pointer;
}
.tk-customs__tab[aria-selected="true"] { background: var(--tk-coral); color: var(--tk-paper); }

.tk-customs__group {
  margin-bottom: 18px;
  padding: 12px 14px 14px;
  background: var(--tk-paper);
  border: var(--tk-border);
  box-shadow: var(--tk-ledge);
  border-left: 10px solid var(--tk-coral);
}
/* Each kind of group its own colour, so the shelf reads at a glance. */
.tk-customs__group[data-group="factory"] { border-left-color: var(--tk-sun); }
.tk-customs__group[data-group="mastery"] { border-left-color: var(--tk-coral); }
.tk-customs__group[data-group="pilot"] { border-left-color: var(--tk-sky); }
.tk-customs__group[data-group="collection"] { border-left-color: var(--tk-teal); }
.tk-customs__group[data-group="prestige"] { border-left-color: var(--tk-lime); }
.tk-customs__group[data-set="neon"] { border-left-color: var(--tk-ink-dim); }
.tk-customs__group[data-set="rustbucket"] { border-left-color: color-mix(in srgb, var(--tk-coral) 55%, var(--tk-ink)); }
.tk-customs__group[data-set="carbon"] { border-left-color: var(--tk-ink); }
.tk-customs__group[data-set="crystal"] { border-left-color: var(--tk-teal); }
.tk-customs__group[data-set="hive"] { border-left-color: var(--tk-ink-dim); }
.tk-customs__group[data-set="gilded"] { border-left-color: var(--tk-sun); }
.tk-customs__group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.tk-customs__group-title { margin: 0; font: 400 18px/1 var(--tk-font-display); text-transform: uppercase; }
.tk-customs__group-note { font-size: 13px; font-weight: 700; }
.tk-customs__progress { margin-top: 8px; }

.tk-customs__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(124px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.tk-customs__group[data-part="customs-set"] .tk-customs__grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.tk-customs__item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px 6px 8px;
  background: var(--tk-paper);
  border: var(--tk-border);
  box-shadow: var(--tk-ledge-sm);
  color: var(--tk-ink);
  text-align: left;
  cursor: pointer;
}
.tk-customs__item:hover { transform: translateY(-2px); }
.tk-customs__item[data-selected] { outline: 4px solid var(--tk-coral); outline-offset: 2px; }
.tk-customs__picture {
  aspect-ratio: 1;
  display: block;
  background: var(--tk-ground);
  border: 2px solid var(--tk-ink);
}
.tk-customs__picture { overflow: hidden; }
/* A picture is framed for the bot turning; held still, it can come in closer. */
.tk-customs__picture img { display: block; width: 100%; height: 100%; object-fit: contain; transform: scale(1.4); }
.tk-customs__item[data-state="locked"] .tk-customs__picture { filter: grayscale(0.85); opacity: 0.6; }
.tk-customs__item-name { font: 700 13px/1.15 var(--tk-font-ui); min-height: 30px; }
.tk-customs__badge {
  align-self: flex-start;
  padding: 3px 7px;
  border: 2px solid var(--tk-ink);
  font: 700 12px/1 var(--tk-font-ui);
  display: inline-flex;
  gap: 4px;
  align-items: center;
}
.tk-customs__badge .tk-menu__bolts { gap: 4px; font-size: 14px; }
.tk-customs__badge .tk-menu__bolt { --size: 14px; }
.tk-customs__badge[data-state="worn"] { background: var(--tk-lime); }
.tk-customs__badge[data-state="owned"] { background: var(--tk-teal); }
.tk-customs__badge[data-state="buy"] { background: var(--tk-sun); }
.tk-customs__badge[data-state="locked"] { background: var(--tk-paper-2); color: var(--tk-ink-dim); }

@media (max-width: 760px) {
  .tk-customs { grid-template-columns: 1fr; }
  .tk-customs__stage { position: static; }
  .tk-customs__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tk-customs__group[data-part="customs-set"] .tk-customs__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-height: 500px) {
  /* A phone on its side: the stage beside the shelf again (the narrow column would push the shelf
     off the screen), the stage no taller than the screen, the line that explains it gone. */
  .tk-customs__line { display: none; }
  .tk-customs { grid-template-columns: minmax(170px, 32vw) 1fr; gap: 12px; }
  .tk-customs__stage { position: sticky; top: 0; border-top-width: 6px; }
  .tk-customs__canvas { aspect-ratio: auto; height: min(30vw, calc(100vh - 210px)); }
  .tk-customs__inspector { padding: 6px 10px 8px; gap: 3px; }
  .tk-customs__name { font-size: 16px; }
  .tk-customs__what { font-size: 12px; }
  .tk-customs__action { margin-top: 4px; min-height: 0; }
  .tk-customs__action .tk-menu__button { font-size: 13px; padding: 6px 10px; }
  .tk-customs__tabs { gap: 6px; margin-bottom: 8px; }
  .tk-customs__tab { padding: 6px 12px; }
  .tk-customs__grid, .tk-customs__group[data-part="customs-set"] .tk-customs__grid { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }
}
