@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700&family=Oswald:wght@500;600;700&display=swap");

:root {
  color-scheme: light;
  --ink: #1c1c1c;
  --muted: #6b6b6b;
  --accent: #f6c21e;
  --accent-dark: #c89000;
  --accent-cool: #1c1c1c;
  --card: rgba(255, 255, 255, 0.9);
  --card-border: rgba(28, 28, 28, 0.08);
  --shadow: 0 20px 45px rgba(20, 20, 20, 0.12);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top, #ffffff 0%, #f4f4f1 55%, #efefec 100%);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

.bg-shape {
  position: fixed;
  z-index: 0;
  border-radius: 999px;
  filter: blur(0px);
  opacity: 0.25;
}

.shape-one {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle at 30% 30%, rgba(246, 194, 30, 0.55), transparent 70%);
  top: -120px;
  left: -140px;
}

.shape-two {
  width: 520px;
  height: 520px;
  background: radial-gradient(circle at 60% 40%, rgba(160, 160, 160, 0.4), transparent 72%);
  bottom: -220px;
  right: -160px;
}

.hero {
  position: relative;
  z-index: 1;
  padding: 54px 8vw 24px;
}

.hero-inner {
  max-width: 980px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.28em;
  font-size: 0.72rem;
  color: #9a7b00;
  margin: 0 0 12px;
}

.hero h1 {
  font-family: "Oswald", "Times New Roman", serif;
  font-size: clamp(2.6rem, 4vw, 4rem);
  margin: 0 0 16px;
}

.hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-link {
  font-size: 0.85rem;
  color: var(--ink);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(28, 28, 28, 0.12);
  background: rgba(255, 255, 255, 0.7);
}

.hero-link:hover {
  border-color: rgba(246, 194, 30, 0.7);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.hero-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  border: 1px solid transparent;
}

.hero-btn.primary {
  background: var(--accent);
  color: #1b1b1b;
  box-shadow: 0 10px 18px rgba(246, 194, 30, 0.3);
}

.hero-btn.ghost {
  background: rgba(28, 28, 28, 0.06);
  color: var(--ink);
  border-color: rgba(28, 28, 28, 0.12);
}

.lead {
  font-size: 1.05rem;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}

.main {
  position: relative;
  z-index: 1;
  padding: 16px 8vw 80px;
}

.mode-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.mode-btn {
  background: rgba(32, 31, 27, 0.06);
  color: var(--ink);
  border: 1px solid rgba(32, 31, 27, 0.12);
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 600;
}

.mode-btn:hover {
  background: rgba(32, 31, 27, 0.1);
}

.mode-btn.active {
  background: var(--accent-cool);
  color: var(--accent);
  border-color: transparent;
}

.mode-btn.reset-btn {
  background: rgba(246, 194, 30, 0.16);
  color: #7a5a00;
  border-color: rgba(246, 194, 30, 0.4);
}

.mode-btn.reset-btn:hover {
  background: rgba(246, 194, 30, 0.28);
}

.upload-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  margin-bottom: 28px;
}

.panel {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  display: grid;
  gap: 16px;
  animation: fadeUp 0.6s ease both;
}

.hidden {
  display: none !important;
}

.panel-header h2 {
  margin: 0 0 6px;
  font-size: 1.3rem;
}

.panel-header p {
  margin: 0;
  color: var(--muted);
}

.panel-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

input[type="file"] {
  padding: 10px 12px;
  background: #fff8e0;
  border: 1px dashed rgba(32, 31, 27, 0.2);
  border-radius: 12px;
  max-width: 100%;
}

button {
  border: none;
  background: var(--accent);
  color: #1b1b1b;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

button:hover {
  transform: translateY(-1px);
  background: var(--accent-dark);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.status {
  font-size: 0.9rem;
  color: var(--muted);
}

.thumbs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.thumbs img {
  width: 80px;
  height: 80px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid rgba(32, 31, 27, 0.12);
}

.detected h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.detected .chip-row {
  gap: 6px;
}

.chip {
  --chip-bg: rgba(32, 31, 27, 0.06);
  --chip-fg: var(--ink);
  --chip-border: rgba(28, 28, 28, 0.12);
  --chip-shadow: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--chip-fg);
  border: 1px solid var(--chip-border);
  box-shadow: var(--chip-shadow);
  font-size: 0.85rem;
}

.chip.compact {
  gap: 6px;
  padding: 4px 10px;
  font-size: 0.78rem;
}

.chip.color-chip {
  font-weight: 600;
}

.chip.color-chip .chip-swatch {
  display: none;
}

.chip.compact .chip-swatch {
  width: 12px;
  height: 12px;
}

.chip-remove {
  border: none;
  background: var(--chip-x-bg, rgba(32, 31, 27, 0.12));
  color: var(--chip-x-color, var(--ink));
  width: 20px;
  height: 20px;
  border-radius: 999px;
  font-size: 0.75rem;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}

.chip.compact .chip-remove {
  width: 16px;
  height: 16px;
  font-size: 0.7rem;
}

.chip-remove:hover {
  background: rgba(32, 31, 27, 0.2);
  transform: none;
}

.chip-swatch {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid rgba(32, 31, 27, 0.2);
}

.color-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(76px, 1fr));
  gap: 8px;
}

.color-dropdown {
  border: 1px solid rgba(32, 31, 27, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  padding: 10px 12px;
}

.color-dropdown summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  color: var(--ink);
  gap: 12px;
}

.color-dropdown summary::-webkit-details-marker {
  display: none;
}

.color-dropdown summary::after {
  content: "▾";
  font-size: 0.9rem;
  color: var(--muted);
  transition: transform 0.2s ease;
}

.color-dropdown[open] summary::after {
  transform: rotate(-180deg);
}

.color-dropdown .color-grid {
  margin-top: 10px;
  max-height: 260px;
  overflow-y: auto;
  padding-right: 4px;
}

.color-item {
  border-radius: 12px;
  border: 1px solid rgba(32, 31, 27, 0.08);
  padding: 6px 8px;
  display: grid;
  gap: 4px;
  background: rgba(255, 255, 255, 0.7);
  transition: transform 0.2s ease, border 0.2s ease;
}

.color-item.present {
  border-color: rgba(246, 194, 30, 0.6);
  box-shadow: inset 0 0 0 1px rgba(246, 194, 30, 0.3);
}

.color-item .swatch {
  width: 100%;
  height: 16px;
  border-radius: 10px;
  border: 1px solid rgba(32, 31, 27, 0.1);
}

.color-item .label {
  font-size: 0.72rem;
}

.color-item .status-tag {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.color-item.present .status-tag {
  color: var(--accent-dark);
}


.split-list {
  display: grid;
  gap: 12px;
}

.split-item {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  background: rgba(32, 31, 27, 0.04);
  border-radius: 14px;
}

.split-item .split-label {
  font-weight: 600;
}

.split-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--muted);
}

.rec-panel {
  margin-top: 32px;
}

.rec-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}

.select-label {
  display: inline-flex;
  flex-direction: column;
  font-size: 0.9rem;
  color: var(--muted);
  gap: 6px;
}

select {
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(32, 31, 27, 0.2);
  font-family: inherit;
}

.tips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tip {
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(246, 194, 30, 0.18);
  color: #7a5a00;
  font-size: 0.85rem;
}

.combo-list {
  display: grid;
  gap: 14px;
}

.combo-card {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(32, 31, 27, 0.08);
  background: rgba(255, 255, 255, 0.75);
  display: grid;
  gap: 10px;
}

.combo-header {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.combo-preview {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(32, 31, 27, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
  display: grid;
}

.combo-preview span {
  display: block;
}

.preview-top {
  height: 55%;
}

.preview-bottom {
  height: 45%;
}

.combo-reasons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.combo-accessories {
  display: grid;
  gap: 6px;
}

.combo-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.accessory-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.accessory {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(32, 31, 27, 0.06);
  font-size: 0.75rem;
  color: var(--ink);
}

.accessory.xside {
  background: rgba(246, 194, 30, 0.25);
  color: #7a5a00;
  font-weight: 600;
}

.badge {
  background: rgba(246, 194, 30, 0.2);
  color: #7a5a00;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.footer {
  text-align: center;
  padding: 28px 12px 48px;
  color: var(--muted);
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 780px) {
  .hero {
    padding: 40px 6vw 18px;
  }

  .main {
    padding: 16px 6vw 60px;
  }

  .panel-actions {
    flex-direction: column;
  }

  .split-item {
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
  }
}

@media (max-width: 520px) {
  .detected .chip-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 6px;
  }

  .detected .chip {
    width: 100%;
    justify-content: space-between;
  }

  .detected .chip span:not(.chip-swatch) {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .chip-remove {
    flex-shrink: 0;
  }
}
