:root {
  --ink: #1a2420;
  --ink-soft: #3d4a44;
  --paper: #f3efe6;
  --paper-deep: #e4ddd0;
  --shelf: #faf8f3;
  --accent: #0f5c4c;
  --accent-deep: #0a3f35;
  --accent-soft: #d7ebe4;
  --warn: #8a5a12;
  --warn-bg: #f4e6c8;
  --muted: #6b756f;
  --line: rgba(26, 36, 32, 0.12);
  --shadow: 0 18px 40px rgba(20, 32, 28, 0.12);
  --radius: 14px;
  --font: "DM Sans", "Segoe UI", sans-serif;
  --display: "Fraunces", Georgia, serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font);
  color: var(--ink);
  background: #1c2a24;
  line-height: 1.45;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(47, 110, 92, 0.55), transparent 55%),
    radial-gradient(ellipse 60% 40% at 90% 0%, rgba(180, 140, 70, 0.28), transparent 50%),
    linear-gradient(165deg, #24352e 0%, #1a2621 42%, #14201c 100%);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.hidden {
  display: none !important;
}

.mock-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem clamp(1rem, 3vw, 2rem) 0;
  color: #f4f1ea;
}

.back-dash {
  color: #f4f1ea;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  opacity: 0.88;
  border-bottom: 1px solid transparent;
  transition: opacity 0.15s ease, border-color 0.15s ease;
}

.back-dash:hover {
  opacity: 1;
  border-bottom-color: rgba(244, 241, 234, 0.55);
}

.nav-current {
  font-size: 0.92rem;
  font-weight: 600;
  opacity: 0.7;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0.85rem clamp(1rem, 3vw, 2rem) 1rem;
  color: #f4f1ea;
}

.dash-page .dash-main {
  margin: 1rem clamp(1rem, 3vw, 2rem) 2rem;
  max-width: 40rem;
  color: #f4f1ea;
}

.dash-copy {
  margin: 0.75rem 0 1.25rem;
  opacity: 0.8;
  line-height: 1.5;
}

.dash-links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.dash-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem 1.15rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(244, 241, 234, 0.22);
  color: #f4f1ea;
  text-decoration: none;
  transition: background 0.15s ease;
}

.dash-card:hover {
  background: rgba(255, 255, 255, 0.14);
}

.dash-card strong {
  font-size: 1.05rem;
}

.dash-card span {
  font-size: 0.88rem;
  opacity: 0.75;
}

.eyebrow {
  margin: 0 0 0.2rem;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.72;
}

.brand {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 0.85rem;
  align-items: flex-end;
}

.field-label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.7;
  margin: 0 0 0.3rem 0.35rem;
}

.search-wrap input,
.prop-wrap select {
  appearance: none;
  border: 1px solid rgba(244, 241, 234, 0.28);
  background: rgba(255, 255, 255, 0.08);
  color: #f4f1ea;
  border-radius: 999px;
  padding: 0.65rem 1rem;
  font: inherit;
  min-width: min(100%, 14rem);
}

.search-wrap input::placeholder {
  color: rgba(244, 241, 234, 0.55);
}

.prop-wrap select option {
  color: var(--ink);
  background: #fff;
}

.cart-toggle {
  border: 1px solid rgba(244, 241, 234, 0.35);
  background: rgba(15, 92, 76, 0.55);
  color: #f4f1ea;
  border-radius: 999px;
  padding: 0.65rem 1rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.cart-toggle:hover {
  background: rgba(15, 92, 76, 0.8);
}

.cart-toggle.cart-pulse {
  transform: scale(1.05);
}

.cart-count {
  display: inline-grid;
  place-items: center;
  min-width: 1.35rem;
  height: 1.35rem;
  margin-left: 0.35rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: #f4f1ea;
  color: var(--accent-deep);
  font-size: 0.78rem;
}

.shell {
  display: grid;
  grid-template-columns: minmax(220px, 280px) 1fr;
  gap: 0;
  margin: 0 clamp(0.75rem, 2vw, 1.5rem) 1.5rem;
  min-height: calc(100vh - 8rem);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--shelf);
  animation: rise 0.55s ease both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.dept-rail {
  background: linear-gradient(180deg, #e8efe9 0%, var(--paper) 40%, var(--paper-deep) 100%);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 6rem);
}

.rail-head {
  padding: 1.25rem 1.1rem 0.75rem;
}

.rail-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.2rem;
}

.rail-sub {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.dept-list {
  overflow: auto;
  padding: 0.35rem 0.65rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.dept-btn {
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-size: 0.92rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.dept-btn:hover {
  background: rgba(15, 92, 76, 0.08);
  color: var(--ink);
}

.dept-btn.is-active {
  background: var(--accent);
  color: #f7fbf9;
  font-weight: 600;
}

.dept-btn.is-all {
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.dept-count {
  float: right;
  opacity: 0.7;
  font-size: 0.78rem;
  font-weight: 500;
}

.stage {
  padding: 1.15rem clamp(0.9rem, 2vw, 1.5rem) 1.5rem;
  overflow: auto;
  max-height: calc(100vh - 6rem);
}

.stage-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 0.9rem;
}

.stage-kicker {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stage-title {
  margin: 0.15rem 0 0;
  font-family: var(--display);
  font-size: clamp(1.45rem, 2.5vw, 1.85rem);
}

.stage-count {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.cat-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.cat-chip {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.cat-chip:hover {
  border-color: rgba(15, 92, 76, 0.35);
}

.cat-chip.is-active {
  background: var(--accent-soft);
  border-color: transparent;
  color: var(--accent-deep);
  font-weight: 600;
}

.shelf {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 0.85rem;
}

.card {
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  animation: fade-in 0.35s ease both;
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.card:nth-child(2) { animation-delay: 0.03s; }
.card:nth-child(3) { animation-delay: 0.06s; }
.card:nth-child(4) { animation-delay: 0.09s; }
.card:nth-child(5) { animation-delay: 0.12s; }
.card:nth-child(6) { animation-delay: 0.15s; }

.card-photo {
  position: relative;
  aspect-ratio: 1 / 1.05;
  border-radius: var(--radius);
  overflow: hidden;
  background:
    linear-gradient(145deg, #ece7dc, #d9d3c5);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset;
}

.card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.card:hover .card-photo img {
  transform: scale(1.04);
}

.card-photo .ph {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 1rem;
  text-align: center;
}

.badge {
  position: absolute;
  left: 0.55rem;
  bottom: 0.55rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.28rem 0.45rem;
  border-radius: 6px;
  background: rgba(15, 92, 76, 0.92);
  color: #f4fff9;
}

.badge.is-fallback {
  background: rgba(138, 90, 18, 0.92);
}

.badge.is-missing {
  background: rgba(80, 80, 80, 0.85);
}

.card-style {
  margin: 0;
  font-weight: 700;
  font-size: 0.95rem;
}

.card-desc {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.82rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-dept {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
}

.empty {
  margin: 2rem 0;
  color: var(--muted);
  text-align: center;
}

.detail,
.cart-dialog {
  border: 0;
  border-radius: 18px;
  padding: 0;
  max-width: min(960px, calc(100vw - 1.5rem));
  width: 100%;
  background: var(--shelf);
  box-shadow: var(--shadow);
}

.detail::backdrop,
.cart-dialog::backdrop {
  background: rgba(12, 20, 17, 0.55);
}

.detail-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 0;
  position: relative;
  max-height: min(92vh, 900px);
  overflow: auto;
}

.detail-close {
  position: absolute;
  top: 0.6rem;
  right: 0.7rem;
  z-index: 2;
  width: 2.2rem;
  height: 2.2rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.detail-media {
  position: sticky;
  top: 0;
  align-self: start;
  background: #ddd7c8;
  min-height: 280px;
}

.detail-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  min-height: 280px;
  max-height: 70vh;
}

.detail-copy {
  padding: 1.35rem 1.4rem 1.5rem;
}

.detail-style {
  margin: 0;
  font-weight: 700;
  color: var(--accent-deep);
  letter-spacing: 0.02em;
}

.detail-copy h3 {
  margin: 0.35rem 0 0.75rem;
  font-family: var(--display);
  font-size: 1.45rem;
  line-height: 1.2;
}

.detail-meta,
.detail-sizes,
.detail-note,
.muted-note {
  margin: 0.4rem 0 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.section-label {
  margin: 1rem 0 0.45rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.swatch {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 0.35rem;
  width: 5.5rem;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: center;
}

.swatch.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.swatch img,
.swatch-ph {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 7px;
  display: block;
  background: #ddd7c8;
  margin-bottom: 0.3rem;
}

.swatch span {
  font-size: 0.72rem;
  line-height: 1.2;
}

.all-colors {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.55rem;
}

.color-card {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 0.4rem;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.color-card-photo {
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  background: #ddd7c8;
}

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

.color-card-photo .ph {
  display: grid;
  place-items: center;
  height: 100%;
  font-size: 0.75rem;
  color: var(--muted);
}

.color-card-name {
  margin: 0.35rem 0 0;
  font-weight: 700;
  font-size: 0.82rem;
}

.color-card-depts {
  margin: 0.15rem 0 0;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.3;
}

.dept-usage {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.dept-usage li {
  margin: 0.25rem 0;
}

.add-form {
  margin-top: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--line);
}

.add-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.add-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.add-grid .span-2 {
  grid-column: 1 / -1;
}

.add-grid select,
.add-grid input {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.5rem 0.6rem;
  font: inherit;
  color: var(--ink);
  background: #fff;
}

.add-btn {
  margin-top: 0.75rem;
  width: 100%;
  border: 0;
  border-radius: 10px;
  padding: 0.75rem 1rem;
  background: var(--accent);
  color: #f7fbf9;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.add-btn:hover {
  background: var(--accent-deep);
}

.detail-note {
  margin-top: 0.75rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.detail-note a {
  color: var(--accent-deep);
}

.cart-inner {
  padding: 1.2rem 1.3rem 1.4rem;
  position: relative;
}

.cart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-right: 2rem;
}

.cart-head h2 {
  margin: 0;
  font-family: var(--display);
}

.cart-sub {
  margin: 0.35rem 0 1rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.cart-lines {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-height: 50vh;
  overflow: auto;
}

.cart-line {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.75rem;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
}

.cart-line-title {
  margin: 0;
  font-weight: 700;
}

.cart-line-meta {
  margin: 0.25rem 0 0;
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.cart-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.ghost-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 0.45rem 0.85rem;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.site-foot {
  color: rgba(244, 241, 234, 0.55);
  font-size: 0.78rem;
  text-align: center;
  padding: 0 1rem 1.5rem;
}

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

  .dept-rail {
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .dept-list {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.9rem;
    gap: 0.35rem;
  }

  .dept-btn {
    white-space: nowrap;
    flex: 0 0 auto;
  }

  .dept-count {
    float: none;
    margin-left: 0.35rem;
  }

  .stage {
    max-height: none;
  }

  .detail-inner {
    grid-template-columns: 1fr;
  }

  .detail-media {
    position: relative;
  }
}
