:root {
  --bg: #f2eee3;
  --panel: #f9f7f2;
  --card: #fffdf8;
  --ink: #201a14;
  --accent: #8d5f2d;
  --muted: #73695f;
  --ok: #2f6b3f;
  --bad: #8f2d21;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Avenir Next", "Futura", "Trebuchet MS", sans-serif;
  background: #2222fd;
  color: var(--ink);
}

.app {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.header-logo {
  width: 54px;
  height: 54px;
  object-fit: contain;
  display: block;
}

.header-logo.spinning {
  animation: spin 0.85s linear infinite;
}

.topbar p {
  margin: 6px 0 20px;
  color: #fff;
  font-weight: 600;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.tab {
  background: #efe3d2;
}

.tab.active {
  background: #d8c1a0;
}

.layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 16px;
  align-items: stretch;
}

.panel,
.card {
  background: var(--panel);
  border: 1px solid #c8bba7;
  border-radius: 16px;
  box-shadow: 0 12px 28px rgba(43, 32, 22, 0.08);
}

.panel {
  padding: 16px;
  height: 100%;
}

.panel h2 {
  margin-top: 0;
}

.section-title {
  margin: 8px 0 10px;
  font-weight: 700;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
  font-size: 0.9rem;
}

input {
  border: 1px solid #c8bba7;
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

textarea {
  border: 1px solid #c8bba7;
  border-radius: 8px;
  padding: 10px;
  background: #fff;
  resize: vertical;
  font-family: inherit;
}

.brand-controls {
  margin-bottom: 12px;
}

.brand-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.brand-add-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-bottom: 8px;
}

.brand-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 180px;
  overflow: auto;
  padding: 4px;
  border: 1px solid #c8bba7;
  border-radius: 8px;
  background: #fff;
}

.brand-chip {
  border: 1px solid #9d8f7c;
  background: #f6f2ea;
  color: #2e241b;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.8rem;
  cursor: pointer;
}

.brand-chip.active {
  background: #1e1e1e;
  color: #fff;
  border-color: #1e1e1e;
}

button {
  border: 1px solid #573f26;
  border-radius: 10px;
  background: #fff8ec;
  color: #2e241b;
  padding: 10px 12px;
  font-weight: 600;
  cursor: pointer;
}

button:hover {
  filter: brightness(0.98);
}

#refreshLive {
  margin-top: 8px;
}

.swipe-zone {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--panel);
  border: 1px solid #c8bba7;
  border-radius: 16px;
  box-shadow: 0 12px 28px rgba(43, 32, 22, 0.08);
  padding: 10px;
  height: 100%;
}

.card {
  position: relative;
  overflow: hidden;
  background: var(--card);
  min-height: auto;
}

.hidden {
  display: none;
}

.checkbox-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  text-align: center;
}

.checkbox-label {
  text-align: center;
}

.inline-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 160px));
  gap: 10px;
  justify-content: start;
}

.focus-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
  margin-bottom: 10px;
}

.focus-grid .checkbox-row {
  margin-bottom: 0;
}

.gallery {
  position: relative;
}

.gallery-stage {
  position: relative;
  width: min(100%, 420px);
  margin: 0 auto;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #f4efe7;
  border-radius: 12px;
}

.gallery-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.2s ease;
  transform-origin: center;
}

.gallery-image.active {
  opacity: 1;
}

.gallery-stage:hover .gallery-image.active {
  transform: scale(1.75);
  cursor: zoom-in;
}

.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border-radius: 999px;
  padding: 0;
  line-height: 30px;
  text-align: center;
  font-size: 20px;
  background: rgba(255, 248, 236, 0.9);
  z-index: 2;
}

.gallery-nav.prev {
  left: 10px;
}

.gallery-nav.next {
  right: 10px;
}

.gallery-dots {
  position: absolute;
  bottom: 10px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 6px;
  z-index: 2;
}

.gallery-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  padding: 0;
  border: 1px solid #fff;
  background: rgba(255, 255, 255, 0.5);
}

.gallery-dot.active {
  background: #fff;
}

.gallery-price {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid #000;
  background: #111;
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  z-index: 3;
}

.card-content {
  padding: 16px;
}

.price-row {
  display: flex;
  gap: 10px;
  align-items: baseline;
  flex-wrap: wrap;
}

.price {
  font-size: 1.4rem;
  font-weight: 700;
}

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

.metrics {
  display: flex;
  gap: 16px;
  color: var(--muted);
  font-size: 0.88rem;
  margin-top: 8px;
}

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

.tags span {
  font-size: 0.78rem;
  border: 1px solid #baaa92;
  border-radius: 999px;
  padding: 4px 8px;
}

.open-listing-btn {
  border: 1px solid #0b0b9f;
  border-radius: 999px;
  background: #2222fd;
  color: #fff;
  font-weight: 700;
  padding: 10px 16px;
}

.open-listing-btn:hover {
  filter: brightness(1.06);
}

.actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  position: sticky;
  top: 8px;
  z-index: 4;
  background: rgba(242, 238, 227, 0.95);
  padding: 6px;
  border-radius: 12px;
}

.hint {
  font-size: 0.85rem;
  color: var(--muted);
}

.swipe-zone .hint {
  color: #fff;
}

.note {
  color: var(--ink);
}

.liked-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.overall-profile-panel {
  grid-column: 1 / -1;
}

.liked-item {
  border: 1px solid #c8bba7;
  border-radius: 12px;
  padding: 10px;
  background: #fff;
}

.liked-item-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.liked-item img {
  width: 100%;
  max-width: 260px;
  height: 180px;
  object-fit: cover;
  border-radius: 8px;
  margin-top: 8px;
}

.liked-remove-btn {
  margin-top: 8px;
  border: 1px solid #3a3a3a;
  background: #111;
  color: #fff;
}

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

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .card {
    min-height: auto;
  }

  .actions {
    grid-template-columns: repeat(2, 1fr);
  }

  .liked-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .inline-fields,
  .focus-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .liked-list {
    grid-template-columns: 1fr;
  }
}
