:root {
  font-family: Arial, Helvetica, sans-serif;
  color: #161616;
  background: #f5f5f5;
}
* { box-sizing: border-box; }
body { margin: 0; }
.topbar {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid #d9d9d9;
  background: #fff;
}
.brand { color: #111; font-weight: 700; text-decoration: none; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.button, input {
  min-height: 40px;
  border: 1px solid #bdbdbd;
  border-radius: 6px;
  background: #fff;
  color: #111;
  font: inherit;
}
.button { padding: 9px 13px; cursor: pointer; text-decoration: none; }
.button:hover { background: #eeeeee; }
.search { display: flex; gap: 6px; }
.search input { width: 230px; padding: 8px 10px; }
.page { width: min(1000px, calc(100% - 28px)); margin: 28px auto; }
.home-panel, .item-card, .message {
  background: #fff;
  border: 1px solid #dedede;
  border-radius: 8px;
  padding: 24px;
}
.home-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}
.home-heading h1, .item-heading h1 { margin: 0 0 8px; }
.home-heading p { margin: 0; color: #555; }
.message { margin-bottom: 16px; }
.eyebrow { margin: 0 0 6px; font-size: 12px; font-weight: 700; letter-spacing: .12em; color: #666; }

.filter-panel { margin-bottom: 20px; padding: 16px; border: 1px solid #e2e2e2; border-radius: 8px; background: #fafafa; }
.filter-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.filter-heading h2 { margin: 0; font-size: 16px; }
.filter-help { color: #666; font-size: 13px; }
.category-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.category-option { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 7px 10px; border: 1px solid #d1d1d1; border-radius: 6px; background: #fff; cursor: pointer; }
.category-option input { min-height: auto; width: 18px; height: 18px; margin: 0; }

.table-wrap { overflow-x: auto; border: 1px solid #dedede; border-radius: 8px; }
.inventory-table { width: 100%; border-collapse: collapse; background: #fff; }
.inventory-table th, .inventory-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid #e8e8e8; }
.inventory-table th { font-size: 12px; letter-spacing: .04em; background: #f7f7f7; }
.inventory-table th:first-child, .inventory-table td:first-child { width: 110px; white-space: nowrap; }
.inventory-table th:last-child, .inventory-table td:last-child { width: 220px; }
.inventory-row { cursor: pointer; }
.inventory-row:last-child td { border-bottom: 0; }
.inventory-row:hover, .inventory-row:focus { background: #f2f2f2; outline: none; }
.empty-results { margin: 18px 0 0; color: #666; }

.fields { margin: 22px 0 0; }
.field-row {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
  padding: 12px 0;
  border-top: 1px solid #e6e6e6;
}
.field-row dt { font-weight: 700; }
.field-row dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.photos-section { margin-top: 28px; }
.photos-section h2 { font-size: 18px; }
.photos-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.photos-grid a { display: block; }
.photos-grid img { width: 100%; height: auto; display: block; border: 1px solid #ddd; border-radius: 6px; background: #fafafa; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.upload-section { margin-top: 26px; padding-top: 20px; border-top: 1px solid #e6e6e6; }
.primary { font-weight: 700; }
.upload-panel { margin-top: 14px; padding: 16px; border: 1px solid #dedede; border-radius: 8px; background: #fafafa; }
.upload-panel h2 { margin: 0 0 8px; font-size: 18px; }
.upload-panel label { display: block; margin: 14px 0 6px; font-weight: 700; }
.upload-help, .token-note { margin: 6px 0; color: #555; font-size: 14px; overflow-wrap: anywhere; }
.token-row { display: flex; gap: 8px; align-items: stretch; }
.token-row input { flex: 1; min-width: 0; padding: 8px 10px; }
.file-input { display: block; width: 100%; min-height: 44px; padding: 8px; background: #fff; }
.upload-status { min-height: 1.4em; margin: 12px 0 0; font-size: 14px; font-weight: 700; }
.upload-status.success { color: #176b2c; }
.upload-status.error { color: #9c2020; }
.button:disabled { opacity: .55; cursor: not-allowed; }

@media (max-width: 650px) {
  .topbar { align-items: flex-start; flex-direction: column; }
  .actions, .search { width: 100%; }
  .search input { flex: 1; min-width: 0; width: auto; }
  .home-panel, .item-card, .message { padding: 16px; }
  .home-heading { flex-direction: column; }
  .filter-heading { align-items: flex-start; flex-direction: column; gap: 4px; }
  .category-option { flex: 1 1 calc(50% - 8px); }
  .inventory-table th, .inventory-table td { padding: 11px 10px; }
  .inventory-table th:first-child, .inventory-table td:first-child { width: 80px; }
  .inventory-table th:last-child, .inventory-table td:last-child { width: auto; }
  .field-row { grid-template-columns: 1fr; gap: 5px; }
  .token-row { flex-direction: column; }
  .upload-panel { padding: 14px; }
}
