:root {
  color-scheme: light;
  --ink: #22201c;
  --muted: #6b655c;
  --line: #ded8cc;
  --paper: #faf8f2;
  --surface: #ffffff;
  --accent: #0f6b63;
  --accent-dark: #084a45;
  --gold: #b9831f;
  --danger: #8c2f2f;
  --shadow-soft: 0 12px 28px rgba(34, 32, 28, .08);
  --shadow-lift: 0 18px 34px rgba(34, 32, 28, .13);
}

* { box-sizing: border-box; }

.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;
}

html {
  overflow-x: clip;
}

body {
  margin: 0;
  padding-top: 76px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  overflow-x: clip;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 76px;
  padding: 14px clamp(16px, 4vw, 48px);
  border-bottom: 1px solid var(--line);
  background: rgba(250, 248, 242, 0.96);
  backdrop-filter: blur(12px);
  transition: min-height .18s ease, padding .18s ease, background-color .18s ease, box-shadow .18s ease;
}

.topbar.is-compact {
  min-height: 58px;
  padding-top: 7px;
  padding-bottom: 7px;
  background: rgba(250, 248, 242, 0.985);
  box-shadow: 0 10px 24px rgba(34, 32, 28, .10);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 190px;
  min-height: 48px;
}

.brand-mark {
  display: block;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  transition: width .18s ease, height .18s ease;
}

.topbar.is-compact .brand-mark {
  width: 36px;
  height: 36px;
}

.brand strong {
  display: block;
  line-height: 1.1;
}

.brand small {
  line-height: 1.2;
  transition: opacity .16s ease, transform .16s ease;
}

.topbar.is-compact .brand small {
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  position: absolute;
}

.brand small, .category-link small, .stamp-meta, .muted, .eyebrow {
  display: block;
  color: var(--muted);
}

.eyebrow a {
  color: inherit;
  text-decoration-color: transparent;
}

.eyebrow a:hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 15px;
  transition: gap .18s ease, font-size .18s ease;
}

.header-actions {
  justify-content: flex-end;
  flex: 1 1 auto;
  margin-left: auto;
}

.desktop-actions {
  display: flex;
}

.topbar.is-compact .header-actions {
  gap: 12px;
  font-size: 14px;
}

.nav-shell {
  display: none;
  flex: 1 1 auto;
  margin-left: auto;
}

.nav-shell > summary {
  list-style: none;
}

.nav-shell > summary::-webkit-details-marker {
  display: none;
}

.menu-button {
  display: none;
}

.info-menu {
  position: relative;
}

.info-menu summary {
  list-style: none;
  cursor: pointer;
}

.info-menu summary::-webkit-details-marker {
  display: none;
}

.info-menu summary::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-3px) rotate(45deg);
}

.info-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 12px);
  display: grid;
  min-width: 210px;
  max-height: min(70vh, 420px);
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 16px 30px rgba(34, 32, 28, .12);
}

.info-menu-panel a {
  padding: 10px 12px;
}

.info-menu-panel a:hover {
  background: var(--paper);
}

.cart-link {
  white-space: nowrap;
}

.pill {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  margin-left: 3px;
  color: white;
  background: var(--accent);
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 64px;
  min-width: 0;
}

.safety, .notice {
  padding: 10px 16px;
  color: #3f310d;
  background: #fff3ca;
  border-bottom: 1px solid #ead28b;
}

.hero {
  display: block;
  padding: clamp(18px, 3vw, 32px) 0 32px;
}

.hero h1, .page-head h1 {
  margin: 0;
  max-width: 820px;
  font-size: clamp(36px, 6vw, 72px);
  line-height: 1;
}

.hero p, .page-head p, .lead {
  max-width: 700px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}

.hero-panel {
  display: grid;
  align-content: end;
  padding: 24px;
  background: #efe9db;
  border: 1px solid var(--line);
}

.hero-panel dl {
  display: grid;
  gap: 18px;
  margin: 0;
}

.hero-panel div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #d0c7b7;
  padding-bottom: 12px;
}

dt { font-size: 30px; font-weight: 800; }
dd { margin: 0; color: var(--muted); }

.search {
  display: flex;
  gap: 10px;
  max-width: 720px;
  margin-top: 28px;
}

.search.compact { margin: 18px 0 0; }

.admin-filter {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(190px, 240px) auto;
  align-items: end;
  max-width: 100%;
}

.admin-filter label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.admin-filter label span {
  display: block;
}

.category-tools {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(230px, 280px) auto;
  align-items: end;
  max-width: 100%;
}

.category-tools label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.category-tools label span {
  display: block;
}

.category-tools select,
.category-tools input {
  width: 100%;
}

input, textarea, select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #cfc7ba;
  background: white;
  color: var(--ink);
  font: inherit;
}

input:focus, textarea:focus, select:focus, button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 3px solid rgba(15, 107, 99, .22);
  outline-offset: 2px;
}

textarea { min-height: 110px; resize: vertical; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: white;
  font: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.button:hover { background: var(--accent-dark); color: white; }
.button:not(:disabled):active { transform: translateY(1px); }
.button.small { min-height: 36px; padding: 0 12px; }
.button.icon-button {
  width: 38px;
  min-width: 38px;
  padding: 0;
}
.button.ghost { background: transparent; color: var(--accent); }
.button.ghost:hover {
  border-color: var(--accent);
  background: #f3eee4;
  color: var(--accent-dark);
}
.button.subtle {
  border-color: transparent;
  padding-inline: 0;
  background: transparent;
  color: var(--muted);
}
.button.subtle:hover {
  border-color: transparent;
  background: transparent;
  color: var(--accent);
}
.button-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.button.disabled,
.button:disabled {
  border-color: #c9c3b7;
  background: #d8d2c6;
  color: #69635a;
  cursor: not-allowed;
}

span.button.disabled {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.band { margin-top: 38px; }

.cart-toast {
  position: fixed;
  right: clamp(14px, 3vw, 34px);
  bottom: clamp(14px, 3vw, 34px);
  z-index: 90;
  width: min(420px, calc(100vw - 28px));
  pointer-events: none;
}

.cart-toast-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 18px 42px rgba(34, 32, 28, .16);
  pointer-events: auto;
}

.cart-toast-panel strong {
  color: var(--accent-dark);
  font-size: 16px;
}

.showcase {
  margin-top: 8px;
  padding: 24px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

.showcase-track {
  display: grid;
  grid-auto-columns: minmax(230px, 280px);
  grid-auto-flow: column;
  gap: 14px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  padding-bottom: 12px;
}

.showcase-track .stamp-card {
  scroll-snap-align: start;
}

.load-more-panel {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 24px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.section-head h2, .checkout h2, .band h2 { margin: 0; font-size: 26px; }

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.category-link {
  min-height: 72px;
  padding: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.category-link:hover,
.stamp-card:hover,
.catalogue-page-card:hover {
  border-color: rgba(15, 107, 99, .42);
  box-shadow: var(--shadow-soft);
}

.stamp-card:hover,
.stamp-card:focus-within {
  outline: 1px solid rgba(15, 107, 99, .42);
  outline-offset: -1px;
  position: relative;
  z-index: 2;
}

.zemstvo-card {
  position: relative;
  display: block;
  min-height: 88px;
  padding: 0;
  z-index: 0;
}

.zemstvo-card:has(.catalogue-menu[open]),
.zemstvo-card.is-menu-open {
  z-index: 30;
  transform: none;
  box-shadow: var(--shadow-soft);
}

.zemstvo-shop-link {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 88px;
  padding: 14px 54px 14px 14px;
}

.catalogue-menu {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
}

.catalogue-menu[open] {
  z-index: 40;
}

.catalogue-menu summary {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--accent);
  cursor: pointer;
  list-style: none;
  font-weight: 800;
  line-height: 1;
}

.catalogue-menu summary::-webkit-details-marker {
  display: none;
}

.catalogue-menu[open] summary {
  border-color: var(--accent);
  background: var(--surface);
}

.catalogue-menu-panel {
  position: absolute;
  z-index: 41;
  right: 0;
  top: calc(100% + 8px);
  display: grid;
  width: max-content;
  min-width: 220px;
  padding: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 16px 30px rgba(34, 32, 28, .12);
}

.catalogue-menu-panel a {
  padding: 10px 12px;
  color: var(--accent);
  font-weight: 700;
}

.catalogue-menu-panel a:hover {
  background: var(--paper);
}

.catalogue-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.catalogue-actions a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease;
}

.catalogue-actions a:hover,
.catalogue-actions a.current {
  border-color: var(--accent);
  background: #f3eee4;
  color: var(--accent-dark);
}

.admin-nav {
  padding-top: 4px;
}

.admin-nav a.current {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.category-range-panel {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) auto auto;
  align-items: end;
  gap: 10px;
  margin: 16px 0 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.category-range-panel.compact {
  grid-template-columns: minmax(190px, 1fr) auto;
  align-items: center;
  margin-top: 20px;
}

.category-range-panel strong,
.category-range-panel span {
  display: block;
}

.category-range-panel strong {
  font-size: 16px;
  line-height: 1.25;
}

.category-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.category-jump {
  display: flex;
  align-items: end;
  gap: 8px;
}

.category-jump label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.category-jump input {
  width: 96px;
  min-height: 36px;
  padding-block: 7px;
}

.category-jump input:disabled {
  opacity: .65;
  cursor: not-allowed;
}

.category-jump input[aria-invalid="true"] {
  border-color: var(--danger);
}

.category-jump-error {
  flex-basis: 100%;
  min-height: 16px;
  color: var(--danger);
  font-size: 12px;
  line-height: 1.25;
}

.category-range-panel .button.small {
  min-height: 36px;
  padding-inline: 12px;
  font-size: 14px;
}

.catalogue-viewer {
  padding-top: 24px;
}

.catalogue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}

.catalogue-page-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  text-align: center;
}

.catalogue-page-image {
  display: grid;
  place-items: center;
  min-height: 190px;
  background: #f7f1e9;
  overflow: hidden;
}

.catalogue-page-image img {
  display: block;
  max-width: 100%;
  max-height: 220px;
  width: auto;
  height: auto;
}

.catalogue-image-head h1 {
  font-size: clamp(30px, 5vw, 56px);
}

.catalogue-image-viewer {
  display: grid;
  gap: 16px;
  padding-top: 18px;
}

.catalogue-image-toolbar {
  position: sticky;
  top: 78px;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 0;
  background: rgba(250, 248, 242, .94);
  backdrop-filter: blur(10px);
}

.catalogue-image-frame {
  display: grid;
  place-items: center;
  min-height: 60vh;
  padding: 18px;
  border: 1px solid var(--line);
  background: var(--surface);
  overflow: auto;
}

.catalogue-image-frame img {
  display: block;
  max-width: 100%;
  height: auto;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
}

.pagination a {
  display: inline-grid;
  place-items: center;
  min-width: 36px;
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.pagination a.current {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.pagination span {
  display: inline-grid;
  place-items: center;
  min-height: 36px;
  padding: 6px 10px;
}

.directory-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(260px, .8fr);
  gap: 14px;
  align-items: start;
}

.directory-panel {
  padding: 18px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.directory-panel h3 {
  margin: 0 0 14px;
  font-size: 20px;
}

.directory-grid {
  display: grid;
  gap: 8px;
}

.directory-link {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.directory-link small {
  color: var(--muted);
  white-space: nowrap;
}

.lot-jump {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  color: var(--muted);
}

.lot-jump div {
  display: flex;
  gap: 8px;
}

.news-list {
  display: grid;
  gap: 12px;
  max-height: 430px;
  overflow: auto;
}

.news-list article {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.news-panel h3 a {
  color: inherit;
  text-decoration: none;
}

.news-panel h3 a:hover {
  color: var(--accent);
}

.news-list time {
  display: block;
  color: var(--gold);
  font-weight: 700;
}

.news-list p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.news-inline-link {
  font-weight: 850;
}

.inline-link-editor {
  display: grid;
  gap: 12px;
  margin: 6px 0 2px;
  padding: 16px;
  border: 1px solid var(--line);
  background: #fbfaf7;
}

.inline-link-editor legend {
  padding: 0 8px;
  font-weight: 850;
}

.news-link-state {
  padding: 10px 12px;
  border-left: 3px solid var(--accent);
  background: white;
}

.news-page-list {
  display: grid;
  gap: 0;
  max-width: 900px;
}

.news-page-list article {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.news-page-list time {
  display: block;
  color: var(--gold);
  font-weight: 800;
}

.news-page-list p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: clamp(20px, 2vw, 28px);
  line-height: 1.45;
}

.stamp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.stamp-card {
  display: grid;
  grid-template-rows: auto minmax(220px, 1fr);
  border: 1px solid var(--line);
  background: var(--surface);
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.stamp-card .image-link {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
}

.stamp-image {
  display: grid;
  place-items: center;
  min-height: 150px;
  height: 100%;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(15, 107, 99, .08) 1px, transparent 1px),
    linear-gradient(rgba(15, 107, 99, .08) 1px, transparent 1px),
    #f4efe5;
  background-size: 18px 18px;
  color: var(--accent-dark);
  font-weight: 800;
  overflow: hidden;
}

.stamp-card .stamp-image {
  position: absolute;
  inset: 0;
  min-height: 0;
  width: 100%;
  height: 100%;
  padding: 0;
}

.stamp-card .stamp-image img {
  position: absolute;
  inset: 10px;
  display: block;
  max-width: none;
  max-height: none;
  width: calc(100% - 20px);
  height: calc(100% - 20px);
  object-fit: contain;
}

.stamp-image img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
}

.stamp-image.has-photo {
  background: #f7f1e9;
}

.stamp-body {
  display: grid;
  grid-template-rows: auto minmax(58px, max-content) auto 1fr;
  align-content: start;
  gap: 8px;
  padding: 12px 14px 14px;
}
.stamp-body h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.3;
}
.stamp-row {
  display: grid;
  justify-items: start;
  gap: 10px;
  align-self: start;
}
.card-price {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  color: var(--ink);
  font-weight: 850;
  line-height: 1.15;
}
.card-price-amount {
  font-size: 23px;
}
.card-price-currency {
  font-size: 16px;
  font-weight: 750;
}
.stamp-body form,
.stamp-body > .button {
  align-self: end;
  margin-top: 8px;
}
.available { color: #176a2e; }
.absent { color: #6b655c; }

.page-head {
  padding: 26px 0 12px;
  border-bottom: 1px solid var(--line);
}

.page-head.error-page {
  min-height: min(520px, 62vh);
  display: grid;
  align-content: center;
  gap: 14px;
}

.page-head.error-page .eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 18px;
  font-weight: 850;
  letter-spacing: 0;
}

.page-head.error-page .catalogue-actions {
  margin-top: 4px;
}

.content-text {
  max-width: 820px;
  padding-top: 24px;
  font-size: 18px;
  line-height: 1.65;
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 24px;
}

.article-card {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 180px;
  padding: 18px;
  border: 1px solid var(--line);
  background: var(--surface);
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.article-card:hover {
  border-color: rgba(15, 107, 99, .42);
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

.article-card h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
}

.article-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.text-link {
  align-self: end;
  color: var(--accent);
  font-weight: 800;
}

.article-page {
  max-width: 920px;
}

.article-body {
  max-width: 820px;
  padding-top: 24px;
  font-size: 19px;
  line-height: 1.7;
}

.article-body h2,
.article-body h3,
.article-body h4 {
  margin: 30px 0 12px;
  line-height: 1.2;
}

.article-body h2 { font-size: 28px; }
.article-body h3 { font-size: 23px; }
.article-body h4 { font-size: 20px; }

.article-body p,
.article-body ul {
  margin: 0 0 18px;
}

.article-body a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.article-body li + li {
  margin-top: 8px;
}

.article-source-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 820px;
  margin-top: 18px;
}

.article-source-links a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  color: var(--accent);
  background: var(--surface);
  font-size: 14px;
  font-weight: 700;
}

.article-products {
  margin-top: 44px;
}

.article-editor-layout {
  grid-template-columns: minmax(0, 780px) minmax(300px, 460px);
}

.article-preview-panel .article-body {
  max-height: 720px;
  overflow: auto;
  padding-top: 0;
  font-size: 16px;
  line-height: 1.55;
}

.legacy-intro {
  max-width: 920px;
  margin: 22px 0;
  padding: 20px;
  border-left: 4px solid var(--gold);
  background: #fffdf8;
  font-size: 18px;
  line-height: 1.7;
}

.legacy-intro p {
  margin: 0;
}

.section-link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
  margin-top: 22px;
}

.catalog-directory {
  display: grid;
  gap: 28px;
  padding-top: 24px;
}

.catalog-section {
  padding-top: 4px;
}

.catalog-section h2 {
  margin: 0;
  font-size: 26px;
}

.catalog-directory.compact {
  padding-top: 0;
}

.year-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.year-group {
  border: 1px solid var(--line);
  background: var(--surface);
}

.year-group summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  min-height: 48px;
  padding: 12px 14px;
  color: var(--accent);
  cursor: pointer;
  font-weight: 800;
}

.year-group summary small,
.year-group a small {
  color: var(--muted);
  font-weight: 500;
}

.year-group div {
  display: grid;
  gap: 0;
  padding: 0 14px 12px;
}

.year-group a {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  font-size: 14px;
}

.content-text p {
  margin: 0 0 16px;
}

.attention {
  color: var(--danger);
  font-weight: 800;
  text-transform: uppercase;
}

.detail {
  display: grid;
  grid-template-columns: minmax(300px, 52%) minmax(320px, 520px);
  gap: clamp(28px, 5vw, 56px);
  align-items: start;
  padding-top: 34px;
}

.detail-media {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.detail-zoom-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.detail-zoom-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

.detail .stamp-image {
  min-height: min(70vh, 720px);
  height: min(70vh, 720px);
  border: 1px solid var(--line);
  padding: 16px;
}

.detail .stamp-image.is-zoomable {
  display: grid;
  place-items: center;
  max-height: min(70vh, 720px);
  overflow: auto;
  cursor: grab;
  touch-action: none;
  user-select: none;
  place-items: initial;
}

.detail .stamp-image.is-zoomable.is-zoomed {
  display: block;
  place-items: initial;
}

.detail .stamp-image.is-zoomable.is-dragging {
  cursor: grabbing;
}

.detail .zoom-content {
  display: block;
  flex: 0 0 auto;
  margin: auto;
  transform-origin: left top;
}

.detail .stamp-image.is-zoomed .zoom-content {
  margin: 0;
}

.detail .zoom-content img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  pointer-events: none;
}

.detail-panel {
  max-width: 520px;
  padding-right: 16px;
}

.detail-panel h1 {
  margin: 8px 0 18px;
  font-size: clamp(42px, 5vw, 64px);
  line-height: 1;
}

.detail-panel .lead {
  margin: 0 0 26px;
  font-size: 22px;
  line-height: 1.5;
}

.specs {
  display: grid;
  gap: 0;
  margin: 24px 0;
}

.specs div {
  display: grid;
  grid-template-columns: minmax(120px, .7fr) minmax(160px, 1fr);
  gap: 20px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.specs dt {
  font-size: 18px;
  font-weight: 700;
}

.specs dd {
  color: var(--ink);
  font-size: 18px;
  line-height: 1.35;
}

.detail-panel .card-price-amount {
  font-size: 34px;
}

.detail-panel .card-price-currency {
  font-size: 21px;
}

.actions { display: flex; gap: 10px; flex-wrap: wrap; }

.detail-back-action {
  margin-top: 28px;
  padding-top: 8px;
}

.detail-command-actions {
  margin-top: 8px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  max-width: 720px;
  margin-top: 16px;
}

.stats-grid div {
  display: grid;
  gap: 4px;
  padding: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 8px 18px rgba(34, 32, 28, .04);
}

.stats-grid strong {
  font-size: 30px;
  line-height: 1;
}

.stats-grid span {
  color: var(--muted);
}

.price-adjustment-form {
  max-width: 1120px;
}

.price-adjustment-sections {
  display: grid;
  gap: 18px;
}

.price-adjustment-section {
  margin: 0;
  padding: 18px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.price-adjustment-section legend {
  padding: 0 8px;
  font-size: 19px;
  font-weight: 850;
  color: var(--ink);
}

.price-adjustment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  align-items: start;
}

.price-adjustment-grid label.is-disabled {
  opacity: .48;
}

.price-target-grid {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(280px, 1fr) minmax(280px, 1fr);
  gap: 18px;
  align-items: start;
}

.price-scope-field {
  align-self: start;
  display: grid;
  gap: 6px;
}

.price-scope-field select {
  min-height: 52px;
}

.price-section-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  min-width: 0;
}

.price-section-field.is-disabled {
  opacity: .48;
}

.price-checkbox-list {
  display: block;
  min-height: 0;
  max-height: 286px;
  overflow: auto;
  border: 1px solid var(--line);
  background: var(--surface);
}

.price-checkbox-row {
  display: flex !important;
  align-items: center;
  gap: 8px !important;
  min-height: 42px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--text) !important;
  font-size: 15px;
  line-height: 1.22;
  font-weight: 650 !important;
  cursor: pointer;
}

.price-checkbox-row:last-child {
  border-bottom: 0;
}

.price-checkbox-row:hover {
  background: #f8f5ee;
}

.price-checkbox-row input {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  min-height: 0;
  margin: 0;
  padding: 0;
  accent-color: var(--accent);
}

.price-checkbox-row span {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}

.price-checkbox-row small {
  flex: 0 0 auto;
  min-width: 48px;
  text-align: right;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

@media (max-width: 980px) {
  .price-target-grid {
    grid-template-columns: 1fr;
  }

  .price-scope-field {
    max-width: none;
  }
}

.price-stats {
  max-width: none;
}

.price-stats div:first-child {
  grid-column: span 2;
}

.price-preview-table {
  max-height: 560px;
  overflow: auto;
  border: 1px solid var(--line);
  background: var(--surface);
}

.price-preview-table .table-wrap {
  overflow: visible;
}

.confirm-panel {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  margin: 24px 0 0;
  padding: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.inline-form {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.inline-form select {
  width: auto;
  min-width: 150px;
}

.admin-detail {
  max-width: 860px;
  padding-top: 20px;
}

.admin-copy-actions {
  align-items: center;
}

.copy-source {
  position: fixed;
  left: -9999px;
  top: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-preview-panel,
.template-card {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.admin-preview-panel {
  position: sticky;
  top: 84px;
  display: grid;
  gap: 14px;
  margin-top: 28px;
  padding: 18px;
}

.admin-preview-panel h2 {
  margin: 0;
  font-size: 22px;
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.template-card {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.template-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.template-head h3 {
  margin: 0;
  font-size: 20px;
}

.template-card pre,
.template-preview {
  margin: 0;
  max-height: 360px;
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--line);
  background: #fffaf2;
}

.template-card pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: inherit;
  color: var(--ink);
}

.template-preview {
  color: var(--ink);
}

.template-preview table {
  width: 100%;
}

.admin-notes-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, .7fr);
  gap: 24px;
}

.admin-note-form {
  margin-top: 14px;
}

.note-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.note-list article {
  padding: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.note-list time {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 14px;
}

.note-list p {
  margin: 0;
  overflow-wrap: anywhere;
}

.availability {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  white-space: nowrap;
}

.status-icon {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  font-size: 14px;
  line-height: 1;
}

.check-icon {
  color: white;
  background: #176a2e;
}

.cross-icon {
  color: white;
  background: #8a867e;
}

.inline-notice {
  margin: 14px 0 0;
  color: var(--accent-dark);
  font-weight: 700;
}

.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  background: white;
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

.table-wrap .table {
  min-width: 760px;
}

.row-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.autosave-state {
  min-width: 88px;
  color: var(--muted);
  font-size: 14px;
}

.admin-id {
  display: block;
  margin-top: 3px;
}

.order-admin-actions {
  margin-top: 12px;
}

.danger-button {
  color: var(--danger);
  border-color: rgba(139, 38, 38, .38);
}

.media-missing-group {
  margin-top: 22px;
}

.media-missing-group h3 {
  margin: 0 0 10px;
  font-size: 22px;
}

.cart-table th:first-child,
.cart-table td:first-child {
  width: 132px;
}

.cart-lot-link {
  display: grid;
  gap: 8px;
  width: fit-content;
  min-width: 86px;
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}

.cart-lot-code {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cart-lot-preview {
  position: relative;
  display: grid;
  place-items: center;
  width: 86px;
  height: 86px;
  border: 1px solid var(--line);
  background: #f7f1e9;
  color: var(--muted);
  font-size: 13px;
}

.cart-lot-preview img {
  position: absolute;
  inset: 6px;
  display: block;
  max-width: none;
  max-height: none;
  width: calc(100% - 12px);
  height: calc(100% - 12px);
  padding: 0;
  object-fit: contain;
}

.admin-users-table {
  table-layout: fixed;
}

.admin-users-table th,
.admin-users-table td {
  overflow-wrap: anywhere;
}

th, td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--danger);
  font: inherit;
  cursor: pointer;
}

.checkout, .editor {
  display: grid;
  gap: 12px;
  max-width: 720px;
  margin-top: 28px;
}

.checkout label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 700;
}

.checkout label input,
.checkout label textarea,
.checkout label select {
  font-weight: 400;
}

.field-label {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
}

.form-note,
.form-hint,
.form-status,
.field-error {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.required-mark,
.field-error {
  color: var(--danger);
}

.field-error {
  font-weight: 700;
}

.form-status.is-error {
  color: var(--danger);
  font-weight: 700;
}

.auth-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, .7fr);
  gap: 28px;
  align-items: start;
  max-width: 980px;
  margin-top: 28px;
}

.auth-panel {
  padding: 20px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.auth-panel h2 {
  margin: 0 0 12px;
}

.auth-panel form {
  display: grid;
  gap: 12px;
}

.form-link {
  color: var(--accent);
  font-weight: 700;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.auth-panel label {
  display: grid;
  gap: 6px;
  color: var(--muted);
}

.auth-panel input:disabled,
.auth-panel input[readonly] {
  color: var(--muted);
  background: #f4f0e8;
}

.auth-panel input[readonly] {
  cursor: not-allowed;
}

.contact-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.contact-summary div {
  display: grid;
  gap: 4px;
}

.contact-summary span, .contact-edit label {
  color: var(--muted);
}

.contact-summary strong {
  font-weight: 700;
}

.contact-edit {
  border: 1px solid var(--line);
  background: var(--surface);
}

.contact-edit summary {
  padding: 12px 14px;
  cursor: pointer;
  color: var(--accent);
  font-weight: 700;
}

.contact-edit-fields {
  display: grid;
  gap: 12px;
  padding: 0 14px 14px;
}

.contact-edit-fields label {
  display: grid;
  gap: 6px;
}

.contact-edit input:disabled {
  color: var(--muted);
  background: #f4f0e8;
}

.editor label {
  display: grid;
  gap: 6px;
  color: var(--muted);
}

.editor .checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
}

.editor .checkbox-row input {
  width: 18px;
  height: 18px;
}

.field-hint {
  font-size: 14px;
  line-height: 1.35;
  color: var(--muted);
}

.metadata-editor {
  max-width: 860px;
}

.editor-layout {
  display: grid;
  grid-template-columns: minmax(0, 720px) minmax(280px, 420px);
  gap: 24px;
  align-items: start;
}

.editor-layout > .editor {
  grid-column: 1;
}

.danger-zone {
  border-color: #c7b6a3;
}

.image-preview-panel {
  grid-column: 2;
  grid-row: 1 / span 2;
  position: sticky;
  top: 84px;
  display: grid;
  gap: 14px;
  margin-top: 28px;
  padding: 18px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.image-preview-panel h2 {
  margin: 0;
  font-size: 22px;
}

.admin-image-preview {
  display: grid;
  place-items: center;
  min-height: 260px;
  border: 1px solid var(--line);
  background: #f7f1e9;
  overflow: hidden;
}

.admin-image-preview img {
  display: block;
  max-width: 100%;
  max-height: 420px;
  width: auto;
  height: auto;
}

.admin-image-preview span {
  color: var(--accent-dark);
  font-weight: 800;
}

.compact-specs {
  margin: 0;
}

.compact-specs div {
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 0;
}

.compact-specs dt,
.compact-specs dd {
  font-size: 15px;
}

.compact-specs code {
  overflow-wrap: anywhere;
}

@media (max-width: 920px) {
  body {
    padding-top: 65px;
  }

  .topbar {
    align-items: center;
    flex-direction: row;
    gap: 12px;
    min-height: 65px;
    padding: 10px 14px;
  }

  .topbar.is-compact {
    min-height: 54px;
    padding-top: 6px;
    padding-bottom: 6px;
  }

  .brand {
    min-width: 0;
    flex: 1 1 auto;
  }

  .brand-mark {
    width: 44px;
    height: 44px;
  }

  .topbar.is-compact .brand-mark {
    width: 34px;
    height: 34px;
  }

  .brand strong {
    display: block;
    max-width: 56vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .nav-shell {
    display: block;
    position: relative;
    flex: 0 0 auto;
    margin-left: 0;
  }

  .desktop-actions {
    display: none;
  }

  .menu-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 40px;
    height: 40px;
    border: 1px solid var(--line);
    background: var(--surface);
    cursor: pointer;
  }

  .menu-button span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--ink);
  }

  .header-actions {
    position: fixed;
    top: 65px;
    left: 0;
    right: 0;
    display: none;
    align-items: stretch;
    justify-content: flex-start;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-left: 0;
    padding: 12px 14px 16px;
    max-height: calc(100dvh - 65px);
    overflow: auto;
    border-bottom: 1px solid var(--line);
    background: var(--paper);
    box-shadow: 0 18px 28px rgba(34, 32, 28, .12);
  }

  .topbar.is-compact .header-actions {
    top: 54px;
    max-height: calc(100dvh - 54px);
  }

  .nav-shell[open] .header-actions {
    display: grid;
  }

  .mobile-menu-section {
    display: grid;
    gap: 0;
    width: 100%;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .62);
  }

  .mobile-menu-section h2 {
    margin: 0;
    padding: 10px 14px 8px;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0;
  }

  .mobile-menu-section a,
  .header-actions > a,
  .info-menu > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 44px;
    width: 100%;
    padding: 11px 14px;
    border-bottom: 1px solid var(--line);
  }

  .mobile-menu-section a:last-child {
    border-bottom: 0;
  }

  .mobile-menu-section .cart-link {
    justify-content: flex-start;
    gap: 10px;
  }

  .info-menu {
    position: static;
  }

  .info-menu summary::after {
    float: right;
    margin-top: 5px;
  }

  .info-menu-panel {
    position: static;
    min-width: 0;
    padding: 0 0 8px 12px;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .info-menu-panel a {
    min-height: 40px;
    padding: 10px 12px;
  }
}

@media (max-width: 760px) {
  main {
    width: min(100% - 24px, 1180px);
    padding-top: 18px;
  }

  .hero, .detail, .directory-layout, .editor-layout, .admin-notes-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    gap: 22px;
    padding: 20px 0 28px;
  }

  .hero > div,
  .page-head,
  .detail-panel {
    min-width: 0;
  }

  .auth-grid { grid-template-columns: 1fr; }
  .search { flex-direction: column; }
  .admin-filter {
    grid-template-columns: 1fr;
  }
  .category-tools {
    grid-template-columns: 1fr;
  }
  .category-tools select { width: 100%; }
  .category-range-panel,
  .category-range-panel.compact {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 12px;
  }
  .category-range-panel > div {
    display: grid;
    gap: 2px;
  }
  .category-page-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
  }
  .category-page-actions > * {
    width: 100%;
    min-height: 44px;
  }
  .category-page-actions > .button.small,
  .category-page-actions > span.button.small {
    min-height: 44px;
  }
  .category-jump {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(116px, .72fr);
    align-items: stretch;
    gap: 8px;
  }
  .category-jump label {
    min-width: 0;
  }
  .category-jump input {
    width: 100%;
    min-height: 44px;
  }
  .category-jump .button {
    width: 100%;
    min-height: 44px;
  }
  .category-jump-error {
    grid-column: 1 / -1;
  }
  .image-preview-panel {
    grid-column: auto;
    grid-row: auto;
    position: static;
    margin-top: 0;
  }
  .admin-preview-panel {
    position: static;
    margin-top: 0;
  }
  .admin-image-preview {
    min-height: 220px;
  }
  .load-more-panel {
    display: grid;
    justify-content: stretch;
  }
  .lot-jump div { flex-direction: column; }

  .hero h1, .page-head h1 {
    max-width: 100%;
    font-size: 34px;
    line-height: 1.08;
    overflow-wrap: anywhere;
  }

  .hero p, .page-head p, .lead {
    max-width: 100%;
    font-size: 17px;
    line-height: 1.5;
    overflow-wrap: anywhere;
  }

  .hero-panel {
    padding: 18px;
  }

  .hero-panel div {
    display: grid;
    grid-template-columns: minmax(0, auto) minmax(0, 1fr);
    align-items: baseline;
  }

  dt {
    font-size: 28px;
  }

  dd {
    text-align: right;
    overflow-wrap: anywhere;
  }

  .specs div { grid-template-columns: 1fr; }

  .table-wrap {
    margin-inline: -12px;
    padding-inline: 12px;
  }

  .table-wrap .table {
    min-width: 680px;
  }

  .table-wrap .responsive-table {
    min-width: 0;
  }

  .responsive-table,
  .responsive-table tbody,
  .responsive-table tr,
  .responsive-table td {
    display: block;
    width: 100%;
  }

  .responsive-table thead {
    display: none;
  }

  .responsive-table tr {
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
  }

  .responsive-table td {
    display: grid;
    grid-template-columns: minmax(120px, .42fr) minmax(0, 1fr);
    gap: 12px;
    padding: 8px 0;
    border-bottom: 0;
    overflow-wrap: anywhere;
  }

  .responsive-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-weight: 700;
  }

  .catalogue-menu-panel {
    right: -10px;
    max-width: calc(100vw - 34px);
  }

  .catalogue-image-toolbar {
    top: 58px;
  }

  .catalogue-image-toolbar .button {
    flex: 1 1 150px;
  }

  .catalogue-image-frame {
    padding: 10px;
  }
}

@media (max-width: 430px) {
  .brand {
    gap: 8px;
  }

  .brand small {
    font-size: 13px;
  }

  .hero h1, .page-head h1 {
    font-size: 30px;
  }

  .hero p, .page-head p, .lead {
    font-size: 16px;
  }

  input, textarea, select {
    font-size: 16px;
  }
}
