:root {
  --bg: #f8f2e7;
  --panel: #fffaf2;
  --panel-2: #f3e4ce;
  --ink: #2b2018;
  --muted: #6c5746;
  --brand: #ca5e2e;
  --brand-strong: #9f3f18;
  --line: #dfcbb0;
  --ok: #2f7e4f;
}

[hidden] {
  display: none !important;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Archivo", "Trebuchet MS", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1000px 600px at 10% -10%, #f7dbc3 0%, rgba(247, 219, 195, 0) 70%),
    radial-gradient(900px 500px at 100% 0%, #f2e5d6 0%, rgba(242, 229, 214, 0) 70%),
    var(--bg);
  min-height: 100vh;
}

.app-shell {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.eyebrow {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand-strong);
}

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: clamp(1.5rem, 1.6vw + 1rem, 2.3rem);
  font-family: "DM Serif Display", Georgia, serif;
  font-weight: 400;
}

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

.btn {
  border: 1px solid var(--line);
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-main {
  background: var(--brand);
  color: #fff;
  border-color: transparent;
}

.btn-main:hover {
  background: var(--brand-strong);
}

.btn-ghost {
  background: #fff;
  color: var(--ink);
}

.layout {
  display: grid;
  grid-template-columns: 1.1fr 1.5fr 0.95fr;
  gap: 14px;
}

.panel {
  background: linear-gradient(180deg, var(--panel), #fff);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  min-height: 0;
}

.panel-note {
  margin: 8px 0 14px;
  color: var(--muted);
  font-size: 14px;
}

.panel-count {
  margin-top: -8px;
  margin-bottom: 10px;
  font-size: 13px;
}

.search-label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

.search {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  font: inherit;
  margin-bottom: 10px;
  background: #fff;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.chip {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 12px;
  cursor: pointer;
}

.chip.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.catalog-list {
  height: min(68vh, 760px);
  overflow: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
  display: grid;
  gap: 10px;
}

.item-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 10px;
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 10px;
  cursor: grab;
  content-visibility: auto;
  contain-intrinsic-size: 116px;
}

.item-card:active {
  cursor: grabbing;
}

.thumb {
  width: 74px;
  height: 96px;
  border-radius: 10px;
  background: linear-gradient(160deg, #f6e7d8, #ecd4bd);
  border: 1px solid #ddc2a7;
  overflow: hidden;
  position: relative;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumb-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 28px;
  color: #8f6e56;
}

.item-info h3 {
  margin: 0 0 4px;
  font-size: 14px;
  line-height: 1.2;
}

.item-price {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--brand-strong);
  font-weight: 700;
}

.meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.card-actions {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.slot-tag {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}

.tiny-btn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 12px;
  cursor: pointer;
}

.tiny-btn:hover {
  background: #f8f1e8;
}

.tiny-link {
  color: var(--brand-strong);
  font-size: 12px;
  text-decoration: none;
}

.tiny-link:hover {
  text-decoration: underline;
}

.board-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}

.board-head-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.board-head-actions p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.outfit-board {
  position: relative;
  height: min(97vh, 1360px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  isolation: isolate;
}

.outfit-board.drag-target {
  border-color: var(--ok);
  box-shadow: inset 0 0 0 2px rgba(47, 126, 79, 0.3);
}

.mannequin {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(280px, 45vw);
  height: min(620px, 80%);
  transform: translate(-50%, -50%);
  opacity: 0.28;
  pointer-events: none;
}

.head,
.torso,
.leg {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 999px;
  background: #a58974;
}

.head {
  width: 72px;
  height: 72px;
  top: 28px;
}

.torso {
  width: 138px;
  height: 248px;
  top: 118px;
  border-radius: 70px 70px 54px 54px;
}

.leg {
  width: 54px;
  height: 196px;
  top: 384px;
}

.leg.left {
  left: calc(50% - 34px);
}

.leg.right {
  left: calc(50% + 34px);
}

.placed-layer {
  position: absolute;
  inset: 0;
}

.placed-item {
  position: absolute;
  width: 150px;
  min-height: 160px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 8px 20px rgba(60, 38, 22, 0.18);
  touch-action: none;
  user-select: none;
  transform: translate(-50%, -50%);
  transform-origin: center center;
}

.placed-item.top,
.placed-item.outer,
.placed-item.dress {
  width: 220px;
  min-height: 290px;
}

.placed-item.bottom {
  width: 210px;
  min-height: 270px;
}

.placed-item.shoes {
  width: 210px;
  min-height: 140px;
}

.placed-item.bag,
.placed-item.accessory {
  width: 150px;
  min-height: 160px;
}

.placed-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #fff;
}

.placed-label {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 6px;
  background: rgba(24, 19, 15, 0.75);
  color: #fff;
  border-radius: 6px;
  font-size: 10px;
  padding: 4px 6px;
  line-height: 1.25;
  pointer-events: none;
}

.placed-controls {
  position: absolute;
  top: 6px;
  right: 6px;
  display: inline-flex;
  gap: 4px;
  z-index: 2;
}

.placed-ctl-btn {
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(24, 19, 15, 0.8);
  color: #fff;
  border-radius: 6px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  font-size: 12px;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}

.placed-ctl-btn:hover {
  background: rgba(24, 19, 15, 0.95);
}

.drop-guide {
  position: absolute;
  border: 1px dashed rgba(43, 32, 24, 0.35);
  border-radius: 999px;
  color: rgba(43, 32, 24, 0.6);
  font-size: 12px;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.drop-guide.top {
  width: 220px;
  height: 160px;
  left: 50%;
  top: 26%;
  transform: translate(-50%, -50%);
}

.drop-guide.bottom {
  width: 230px;
  height: 180px;
  left: 50%;
  top: 58%;
  transform: translate(-50%, -50%);
}

.drop-guide.shoes {
  width: 220px;
  height: 80px;
  left: 50%;
  top: 84%;
  transform: translate(-50%, -50%);
}

.slot-summary {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.slot-row {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 10px;
}

.slot-row strong {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.slot-row p {
  margin: 0;
  font-size: 13px;
  line-height: 1.3;
}

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

.summary-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.summary-links a {
  color: var(--brand-strong);
  font-size: 12px;
}

.site-link {
  display: inline-flex;
  margin-top: 14px;
  color: var(--brand-strong);
  font-weight: 700;
  text-decoration: none;
}

.site-link:hover {
  text-decoration: underline;
}

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

  .catalog-list {
    height: 44vh;
  }

  .outfit-board {
    height: 90vh;
  }
}
