#catalogOpen, #itemCatalog button, #itemCatalog input, #itemCatalog select {
  font: inherit;
}
#catalogOpen {
  position: fixed;
  z-index: 4;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  padding: 11px 18px;
  border: 1px solid #e1ddd0;
  border-radius: 8px;
  background: #f8f5ed;
  color: #23392c;
  font: 650 14px system-ui, sans-serif;
  cursor: pointer;
}
.card-exclusive #catalogOpen { display: none; }
#itemCatalog {
  position: fixed;
  box-sizing: border-box;
  width: min(1440px, calc(100% - 40px));
  height: min(940px, calc(100% - 40px));
  max-width: none;
  max-height: none;
  padding: 25px 28px 0;
  border: 1px solid #dfd9cb;
  border-radius: 18px;
  background: #f8f5ed;
  color: #24392c;
  font: 14px/1.45 system-ui, sans-serif;
  overflow: hidden;
}
#itemCatalog[open] { display: flex; flex-direction: column; }
#itemCatalog::backdrop { background: #111c16bc; }
.catalog-header, .catalog-tools { display: flex; align-items: end; gap: 12px; }
.catalog-header { justify-content: space-between; align-items: start; }
.catalog-header h1 { margin: 0; font: 400 clamp(28px, 4vw, 43px) Georgia, serif; }
.catalog-header p { margin: 4px 0 12px; color: #4c5d51; }
.catalog-tools label { display: grid; gap: 4px; min-width: 0; font-weight: 600; }
.catalog-tools label:first-child { flex: 1; max-width: 420px; }
.catalog-tools input, .catalog-tools select, #itemCatalog button {
  box-sizing: border-box;
  min-height: 40px;
  border: 1px solid #a8aea2;
  border-radius: 7px;
  padding: 7px 10px;
  background: #fffdf8;
  color: inherit;
}
#itemCatalog button:not(:disabled) { cursor: pointer; }
#itemCatalog #catalogClose { min-width: 42px; font-size: 22px; line-height: 1; }
#itemCatalog button[aria-pressed="true"], #itemCatalog .catalog-find {
  background: #2d4d3b;
  color: #fff;
  border-color: #2d4d3b;
}
#itemCatalog button:disabled { opacity: .68; }
#itemCatalog :focus-visible, #catalogOpen:focus-visible { outline: 3px solid #8d6028; outline-offset: 2px; }
#catalogCount { margin: 9px 0; color: #4c5d51; }
#catalogScroll { overflow: auto; overscroll-behavior: contain; padding: 3px 4px 20px; }
#catalogGrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
@media (min-width: 1100px) { #catalogGrid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (min-width: 1360px) { #catalogGrid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.catalog-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #e1ddcf;
  border-radius: 9px;
  background: #fffdf8;
}
.catalog-card img { display: block; width: 100%; aspect-ratio: 4/3; object-fit: contain; background: #e9e7dc; }
.catalog-card-body { flex: 1; display: flex; flex-direction: column; gap: 7px; padding: 10px; }
.catalog-card h2 { margin: 0; font-size: 14px; line-height: 1.25; overflow-wrap: anywhere; }
.catalog-card p { margin: 0; color: #4c5d51; font-size: 12px; }
.catalog-card-actions { margin-top: auto; display: grid; gap: 5px; }
#itemCatalog .catalog-card button { font-size: 12px; padding: 5px; min-height: 36px; }
#catalogMore { display: block; margin: 15px auto 0; }
#itemCatalog [hidden] { display: none; }
#catalogGrid.catalog-photo-sheet { gap: 7px; }
.catalog-photo-sheet .catalog-card { border-radius: 3px; }
.catalog-photo-sheet .catalog-card img { aspect-ratio: 1; }
.catalog-photo-sheet .catalog-card p, .catalog-photo-sheet .catalog-add { display: none; }
#catalogTargetStatus {
  position: fixed;
  left: 50%;
  bottom: 13%;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 8px 12px;
  z-index: 4;
  border-radius: 8px;
  background: #24392c;
  color: #fff;
  font: 14px system-ui, sans-serif;
  pointer-events: none;
}
@media (max-width: 720px) {
  #itemCatalog { width: 100%; height: 100%; padding: max(14px, env(safe-area-inset-top)) 12px 0; border-radius: 0; }
  .catalog-tools { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  .catalog-tools label:first-child { grid-column: 1/-1; max-width: none; }
  .catalog-tools input, .catalog-tools select { font-size: 16px; width: 100%; }
  #catalogGrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
}
