:root {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #171717;
  background: #ffffff;
  line-height: 1.5;
  --ink: #111111;
  --text: #171717;
  --muted: #707070;
  --line: #e5e5e5;
  --soft: #f7f7f7;
  --soft-dark: #eeeeee;
}

* { box-sizing: border-box; }
body { margin: 0; background: #ffffff; }
.container { max-width: 1120px; margin: 0 auto; padding: 28px 20px 60px; }
.topbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 28px; }
.eyebrow { font-size: 11px; letter-spacing: 2px; color: var(--muted); }
h1 { font-family: Georgia, "Noto Serif SC", serif; font-weight: 500; font-size: 34px; margin: 6px 0; color: var(--ink); }
h2 { font-size: 20px; font-weight: 600; margin: 0 0 12px; color: var(--ink); }
.toolbar, .price-form, .actions, .section-head { display: flex; gap: 10px; align-items: center; }
.toolbar { margin-bottom: 20px; }
.toolbar input { flex: 1; width: auto; min-width: 0; }
input, select, textarea, button {
  font: inherit;
  border: 1px solid #d8d8d8;
  border-radius: 10px;
  min-height: 42px;
  padding: 0 13px;
  background: #ffffff;
  color: var(--text);
}
input:focus, select:focus, textarea:focus, button:focus-visible {
  outline: 2px solid #bdbdbd;
  outline-offset: 1px;
}
input { width: 100%; }
textarea { width: 100%; margin: 12px 0; padding: 12px; resize: vertical; }
button { background: var(--ink); color: #ffffff; border-color: var(--ink); cursor: pointer; white-space: nowrap; }
button:hover { background: #333333; border-color: #333333; }
button:disabled { opacity: .45; cursor: not-allowed; }
.ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  background: #ffffff;
  text-decoration: none;
  border: 1px solid #bdbdbd;
  border-radius: 10px;
  padding: 9px 13px;
  min-height: 42px;
}
.ghost:hover { background: var(--soft); border-color: #8f8f8f; }
.muted { color: var(--muted); font-size: 14px; }
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.category-section { margin-bottom: 28px; }
.category-section[hidden] { display: none; }
.category-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.category-card {
  display: flex;
  align-items: stretch;
  gap: 12px;
  min-height: 116px;
  padding: 0;
  overflow: hidden;
  text-align: left;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.category-card:hover, .category-card.selected { color: var(--ink); background: var(--soft); border-color: #9d9d9d; }
.category-card img { flex: 0 0 92px; width: 92px; height: 116px; object-fit: cover; background: var(--soft-dark); }
.category-copy { display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 12px 10px 12px 0; }
.category-copy strong { font-size: 16px; }
.category-count { color: var(--muted); font-size: 12px; }
.category-all { color: var(--ink); background: #ffffff; border-color: #bdbdbd; }
.category-all:hover { color: var(--ink); background: var(--soft); border-color: #8f8f8f; }
.card, .panel, .detail-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .045);
}
.card { overflow: hidden; }
.card, .card:hover { color: inherit; text-decoration: none; }
.card:hover { border-color: #c7c7c7; }
.card img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--soft); }
.card-body { padding: 14px; }
.card h3 { font-size: 15px; margin: 0 0 7px; color: var(--ink); }
.price { font-size: 20px; color: var(--ink); font-weight: 700; }
.tag { display: inline-block; color: #555555; background: var(--soft-dark); border-radius: 999px; padding: 3px 8px; font-size: 11px; margin-bottom: 8px; }
.panel { padding: 20px; margin-bottom: 18px; }
.login { max-width: 440px; margin: 70px auto; }
.login form { display: flex; gap: 10px; }
.login form input { flex: 1; }
.detail-card { max-width: 760px; margin: 24px auto; padding: 22px; }
.detail-image { width: 100%; max-height: 620px; object-fit: contain; border-radius: 12px; background: var(--soft); }
.detail-card h1 { font-size: 28px; }
.table-wrap { overflow: auto; }
.product-row { display: grid; grid-template-columns: 24px 52px minmax(240px, 1fr) 90px 100px 100px 72px; min-width: 780px; gap: 12px; align-items: center; border-top: 1px solid var(--line); padding: 12px 0; }
.product-row > * { min-width: 0; }
.product-row input[type="checkbox"] { width: 18px; height: 18px; min-height: 18px; padding: 0; }
.product-row strong { display: block; overflow-wrap: anywhere; }
.product-row img { width: 52px; height: 52px; border-radius: 9px; object-fit: cover; background: var(--soft-dark); }
.status { font-size: 12px; border-radius: 999px; padding: 4px 8px; background: var(--soft-dark); color: #555555; }
.status.published { color: #222222; background: #e3e3e3; }
.status.draft { color: #666666; background: #f0f0f0; }
.preview { white-space: pre-wrap; background: var(--soft); border-radius: 10px; padding: 12px; min-height: 44px; color: #444444; }
.helper-instructions { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 14px; }
.helper-instructions summary { cursor: pointer; color: var(--ink); font-weight: 600; }
.helper-instructions .preview { overflow: auto; font-size: 12px; }
.section-head { justify-content: space-between; }
.price-form select { width: 140px; }
.price-form input { width: 120px; }
.back { color: var(--ink); text-decoration: none; }
.back:hover { text-decoration: underline; }
.empty { padding: 30px; text-align: center; color: var(--muted); }
.contact-menu { position: relative; }
.contact-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 13px;
  border: 1px solid #bdbdbd;
  border-radius: 10px;
  color: var(--ink);
  background: #ffffff;
  cursor: pointer;
  list-style: none;
  white-space: nowrap;
}
.contact-trigger::-webkit-details-marker { display: none; }
.contact-trigger:hover { background: var(--soft); border-color: #8f8f8f; }
.contact-popover {
  position: absolute;
  z-index: 5;
  top: calc(100% + 10px);
  right: 0;
  display: flex;
  align-items: center;
  gap: 18px;
  width: min(360px, calc(100vw - 28px));
  padding: 16px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .1);
}
.contact-popover h2 { margin: 6px 0 4px; font-size: 17px; }
.contact-popover p { margin: 0; }
.contact-qr-wrap { flex: 0 0 auto; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: #ffffff; }
.contact-qr { display: block; width: 128px; height: 128px; }

@media (max-width: 760px) {
  .container { padding: 20px 14px 45px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  h1 { font-size: 28px; }
  .product-row .source { display: none; }
  .price-form { flex-wrap: wrap; }
  .price-form input, .price-form select { width: calc(50% - 5px); }
  .contact-popover { align-items: flex-start; }
  .contact-qr { width: 104px; height: 104px; }
}
