:root {
  --bg: var(--tg-theme-bg-color, #fff);
  --fg: var(--tg-theme-text-color, #111);
  --hint: var(--tg-theme-hint-color, #888);
  --link: var(--tg-theme-link-color, #2481cc);
  --accent: var(--tg-theme-button-color, #2481cc);
  --accent-fg: var(--tg-theme-button-text-color, #fff);
  --card: var(--tg-theme-secondary-bg-color, #f2f2f5);
}
* { box-sizing: border-box; }
body {
  margin: 0; padding: 0 12px 24px; background: var(--bg); color: var(--fg);
  font: 15px/1.4 -apple-system, "Segoe UI", Roboto, sans-serif;
}
header { position: sticky; top: 0; background: var(--bg); padding: 10px 0 6px; z-index: 1; }
#search {
  width: 100%; padding: 9px 12px; border: 0; border-radius: 10px;
  background: var(--card); color: var(--fg); font-size: 15px;
}
#filters { display: flex; gap: 6px; overflow-x: auto; padding: 8px 0 2px; scrollbar-width: none; }
#filters button {
  flex: none; border: 0; border-radius: 16px; padding: 5px 11px; font-size: 13px;
  background: var(--card); color: var(--fg);
}
#filters button.on { background: var(--accent); color: var(--accent-fg); }
.card { background: var(--card); border-radius: 12px; padding: 10px 12px; margin: 8px 0; cursor: pointer; }
.row { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.num { font-weight: 600; }
.old { font-size: 11px; color: var(--hint); margin-left: 6px; }
.title { margin: 3px 0; overflow: hidden; text-overflow: ellipsis; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.meta { color: var(--hint); font-size: 13px; }
.badge { font-size: 12px; padding: 2px 8px; border-radius: 10px; white-space: nowrap; background: var(--bg); }
.g-parcel { color: #8a4fd8; } .g-warehouse { color: #2e9e4f; } .g-bought { color: #2481cc; }
.g-active { color: #d98b00; } .g-problem { color: #d93a3a; } .g-closed { color: var(--hint); }
#detail h2 { margin: 14px 0 4px; font-size: 18px; }
#detail dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 10px 0; }
#detail dt { color: var(--hint); }
#detail dd { margin: 0; word-break: break-word; }
.item { background: var(--card); border-radius: 10px; padding: 8px 10px; margin: 6px 0; }
a { color: var(--link); }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; }
#message { color: var(--hint); text-align: center; margin-top: 30px; }
.card.with-photo { display: flex; gap: 10px; align-items: flex-start; }
.card-body { flex: 1; min-width: 0; }
.ph { background: var(--bg); border-radius: 8px; overflow: hidden; flex: none; }
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph.none { opacity: .35; }
.thumb { width: 56px; height: 56px; }
.big { width: 100%; max-height: 320px; aspect-ratio: 1 / 1; margin-bottom: 6px; }
.big img { object-fit: contain; }
.big.none { display: none; }
