:root {
  --bg: #f6f4ee;
  --panel: #ffffff;
  --panel-soft: #fbfaf6;
  --text: #242424;
  --muted: #6d6a62;
  --border: #dfd8cb;
  --accent: #1f7a5a;
  --accent-strong: #145b43;
  --accent-soft: #e4f3ed;
  --warning: #8a5a00;
  --warning-bg: #fff3cf;
  --danger: #b83a30;
  --shadow: 0 14px 34px rgba(44, 38, 28, 0.11);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: "Segoe UI", Arial, sans-serif;
  line-height: 1.45;
}

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

a:hover {
  text-decoration: underline;
}

img {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
p {
  margin: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(14px, 4vw, 34px);
  border-bottom: 1px solid var(--border);
  background: rgba(246, 244, 238, 0.94);
  backdrop-filter: blur(12px);
}

.brand {
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 800;
}

.top-nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  white-space: nowrap;
}

.top-nav a,
.action-button,
.form-actions a,
button,
.search-form button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
}

.top-nav a:hover,
.action-button:hover,
.form-actions a:hover {
  background: var(--panel-soft);
  text-decoration: none;
}

.page {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: clamp(16px, 4vw, 34px);
}

.hero,
.page-title,
.section-header,
.detail-layout {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.hero {
  align-items: center;
  margin-bottom: 18px;
}

.eyebrow {
  margin-bottom: 6px;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  font-size: clamp(2rem, 7vw, 4.2rem);
  line-height: 0.95;
}

h2 {
  font-size: 1.2rem;
}

.stats-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.stats-row span {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--panel);
  color: var(--muted);
  font-weight: 700;
}

.search-panel,
.section-block,
.form-shell {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.search-panel {
  margin-bottom: 16px;
  padding: clamp(14px, 3vw, 22px);
}

.search-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.search-form input {
  width: 100%;
  min-height: 58px;
  border: 2px solid var(--accent);
  border-radius: 8px;
  padding: 12px 14px;
  background: #fff;
  color: var(--text);
  font-size: 1.05rem;
}

.search-form button,
.primary,
button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

.search-results {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.result-row,
.item-card,
.container-card,
.booth-row {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 12px;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  background: var(--panel-soft);
  color: var(--text);
}

.result-row:hover,
.item-card:hover,
.container-card:hover,
.booth-row:hover {
  border-color: #b8ad9d;
  text-decoration: none;
}

.thumb,
.photo-slot {
  width: 86px;
  align-self: center;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: #ece7dc;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

.thumb img,
.photo-slot img,
.gallery-grid img,
.gallery-tile img,
.detail-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb img,
.photo-slot img {
  object-fit: contain;
  background: #eee8dd;
}

.card-copy {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 2px;
}

.card-copy strong,
.result-row strong {
  color: var(--text);
  font-size: 1.02rem;
}

.card-copy span,
.result-row span {
  color: var(--muted);
}

.card-copy small,
.result-row small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.card-copy p {
  margin-top: 4px;
  color: var(--muted);
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.action-button {
  min-height: 58px;
  font-size: 1rem;
  font-weight: 800;
}

.action-button.muted {
  background: var(--accent-soft);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
}

.section-block,
.form-shell {
  padding: clamp(14px, 3vw, 22px);
}

.booth-list,
.card-list,
.card-grid {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.card-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.booth-row {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.booth-row span {
  color: var(--muted);
  font-size: 0.9rem;
}

.stacked-form {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.stacked-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
  color: var(--text);
}

.field-autofilled {
  border-color: var(--accent);
  background: var(--accent-soft);
}

textarea {
  resize: vertical;
}

small {
  color: var(--muted);
  font-weight: 500;
}

.file-feedback {
  color: var(--accent-strong);
}

.two-field {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

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

.is-submitting {
  opacity: 0.86;
}

.submit-feedback {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #9ccfbd;
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 800;
}

.upload-toast-stack {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 40;
  display: grid;
  gap: 10px;
  width: min(390px, calc(100vw - 32px));
}

.upload-toast {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  border: 1px solid #9ccfbd;
  border-radius: 8px;
  padding: 12px;
  background: #fff;
  box-shadow: var(--shadow);
}

.upload-toast p {
  margin-top: 2px;
  color: var(--muted);
}

.upload-toast.success {
  background: var(--accent-soft);
}

.upload-toast.error {
  border-color: #f0c5bf;
  background: #fff5f3;
}

.upload-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.upload-actions a {
  font-weight: 800;
  text-decoration: underline;
}

.spinner {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  border: 3px solid rgba(31, 122, 90, 0.2);
  border-top-color: var(--accent);
  border-radius: 999px;
  animation: spin 0.85s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.danger,
button.danger {
  border-color: #f0c5bf;
  background: #fff5f3;
  color: var(--danger);
  font-weight: 800;
}

.link-button {
  min-height: 0;
  padding: 6px 8px;
}

.warning-box {
  display: grid;
  gap: 8px;
  border: 1px solid #e6c15f;
  border-radius: 8px;
  padding: 12px;
  background: var(--warning-bg);
  color: var(--warning);
}

.warning-box a {
  color: var(--warning);
  font-weight: 800;
  text-decoration: underline;
}

.flash-stack {
  position: fixed;
  right: 16px;
  top: 76px;
  z-index: 30;
  display: grid;
  gap: 8px;
  max-width: min(360px, calc(100vw - 32px));
}

.flash {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  background: #fff;
  box-shadow: var(--shadow);
}

.flash.success {
  border-color: #9ccfbd;
}

.flash.warning {
  border-color: #e6c15f;
  background: var(--warning-bg);
}

.flash.error {
  border-color: #f0c5bf;
  background: #fff5f3;
}

.detail-layout {
  align-items: stretch;
  margin-bottom: 18px;
}

.detail-layout.compact {
  align-items: center;
}

.detail-photo {
  flex: 0 0 min(42vw, 460px);
  min-height: 320px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: #e9e3d8;
  color: var(--muted);
}

.detail-copy {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: clamp(16px, 3vw, 24px);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.meta-grid div {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel-soft);
}

.meta-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.notes {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.gallery-grid,
.gallery-edit {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.gallery-tile,
.current-cover {
  aspect-ratio: 1;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel-soft);
}

.gallery-photo {
  min-height: 220px;
  max-height: 420px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: var(--panel-soft);
}

.gallery-photo:hover {
  border-color: #b8ad9d;
  text-decoration: none;
}

.gallery-photo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #eee8dd;
}

.gallery-tile {
  display: grid;
  gap: 8px;
  padding: 8px;
  aspect-ratio: auto;
}

.gallery-tile img {
  aspect-ratio: 1;
  border-radius: 6px;
}

.radio-row {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 8px !important;
  color: var(--text) !important;
}

.radio-row input {
  width: auto;
}

.current-cover {
  width: min(280px, 100%);
}

.delete-form {
  margin-top: 16px;
}

.empty {
  color: var(--muted);
}

@media (max-width: 760px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-nav {
    width: 100%;
  }

  .top-nav a {
    flex: 0 0 auto;
  }

  .hero,
  .page-title,
  .section-header,
  .detail-layout {
    flex-direction: column;
  }

  .stats-row {
    justify-content: flex-start;
  }

  .search-form,
  .content-grid,
  .two-field,
  .quick-actions {
    grid-template-columns: 1fr;
  }

  .detail-photo {
    width: 100%;
    flex-basis: auto;
    min-height: auto;
    aspect-ratio: 4 / 3;
  }

  .result-row,
  .item-card,
  .container-card {
    grid-template-columns: 72px 1fr;
  }

  .thumb,
  .photo-slot {
    width: 72px;
  }

  .flash-stack {
    left: 16px;
    right: 16px;
    top: auto;
    bottom: 16px;
  }

  .upload-toast-stack {
    left: 16px;
    right: 16px;
    bottom: 16px;
    width: auto;
  }
}
