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

html, body { height: 100%; overflow: hidden; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: #f0f0ee;
  color: #1a1a18;
}

/* ── Layout ── */
.app {
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 100vh;
}

/* ── Left Panel ── */
.drop-panel {
  padding: 40px 48px 48px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  background: #f0f0ee;
}

/* ── Brand Header ── */
.brand-header {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  flex-shrink: 0;
}

.brand-mark {
  flex-shrink: 0;
  margin-top: 5px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.brand-name {
  font-size: 24px;
  font-weight: 200;
  letter-spacing: -0.03em;
  color: #1a1a18;
  line-height: 1;
}

.brand-tagline {
  font-size: 10px;
  color: #bcbcb9;
  letter-spacing: 0.07em;
}

/* ── Section Header (right panel) ── */
.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  padding-bottom: 16px;
  border-bottom: 1px solid #eeeeea;
}

.panel-label {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #a8a8a5;
  font-weight: 600;
}

.drop-zone {
  flex: 1;
  border: 1.5px dashed #d0d0cc;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
  overflow: hidden;
  background: #fafaf8;
}

.drop-zone:hover     { border-color: #aaaaa5; background: #f5f5f3; }
.drop-zone.drag-over { border-color: #888884; background: #eeeeed; }
.drop-zone.has-image { border-style: solid;   border-color: #dededa; }

.drop-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
  user-select: none;
  text-align: center;
}

.drop-hint svg  { width: 32px; height: 32px; color: #c8c8c4; }
.drop-hint p    { font-size: 12.5px; color: #8a8a88; letter-spacing: 0.01em; }
.drop-hint span { font-size: 11px;   color: #b5b5b2; letter-spacing: 0.02em; }

#previewImg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 28px;
  display: none;
}

/* ── Spinner ── */
.spinner-wrap {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.75);
  border-radius: 20px;
}
.spinner-wrap.show { display: flex; }

@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  width: 20px; height: 20px;
  border: 1.5px solid rgba(0,0,0,0.08);
  border-top-color: rgba(0,0,0,0.45);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ── Right Panel ── */
.palette-panel {
  border-left: 1px solid #e2e2de;
  padding: 40px 48px 48px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  background: #ffffff;
}

/* ── Compact Swatches ── */
.swatches {
  display: flex;
  flex-direction: row;
  gap: 14px;
  flex-shrink: 0;
  align-items: flex-start;
}

.empty-state {
  font-size: 12px;
  color: #c0c0bc;
  letter-spacing: 0.04em;
  padding: 4px 0;
}

.swatch-item {
  display: none;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
}

.swatch-chip {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 0.6s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.12s ease, box-shadow 0.12s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.10), 0 0 0 1px rgba(0,0,0,0.05);
}
.swatch-chip:hover  { transform: scale(1.08); box-shadow: 0 3px 8px rgba(0,0,0,0.14), 0 0 0 1px rgba(0,0,0,0.05); }
.swatch-chip:active { transform: scale(0.96); }

/* ── Copy toast ── */
.copy-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: #1a1a18;
  color: #f0f0ee;
  font-family: 'SF Mono', 'Fira Code', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  padding: 7px 14px;
  border-radius: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  white-space: nowrap;
}
.copy-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.swatch-name {
  font-size: 8.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 600;
  color: #a8a8a5;
}

.swatch-hex {
  font-family: 'SF Mono', 'Fira Code', ui-monospace, monospace;
  font-size: 9.5px;
  letter-spacing: 0.03em;
  color: #555552;
}

canvas, input[type="file"] { display: none; }

/* ── Wheel section ── */
.wheel-section {
  flex: 1;
  display: none;
  gap: 28px;
  align-items: flex-start;
  min-height: 0;
  overflow: hidden;
}
.wheel-section.active { display: flex; }

.wheel-wrap { flex-shrink: 0; }

#wheelCanvas {
  display: block;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  box-shadow: 0 2px 12px rgba(0,0,0,0.12);
}

.wheel-explanation {
  flex: 1;
  min-width: 0;
  padding-top: 2px;
}

.wheel-explanation p {
  font-size: 12px;
  line-height: 1.78;
  color: #7a7a78;
  margin-bottom: 12px;
}
.wheel-explanation p:last-child { margin-bottom: 0; }

.hue-tag {
  color: #3a3a38;
  font-weight: 500;
}

/* ── Source Colors ── */
.source-colors {
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
  padding-top: 4px;
}

.source-label {
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 600;
  color: #c0c0bc;
}

.source-chips {
  display: flex;
  flex-direction: row;
  gap: 10px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.source-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.source-chip {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.10), 0 0 0 1px rgba(0,0,0,0.05);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.source-chip:hover  { transform: scale(1.1); box-shadow: 0 3px 7px rgba(0,0,0,0.14), 0 0 0 1px rgba(0,0,0,0.05); }
.source-chip:active { transform: scale(0.95); }

.source-hex {
  font-family: 'SF Mono', 'Fira Code', ui-monospace, monospace;
  font-size: 8.5px;
  letter-spacing: 0.02em;
  color: #a8a8a5;
}

/* ── Learn link ── */
.learn-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #a8a8a5;
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color 0.15s;
  margin-top: auto;
  padding-top: 4px;
}
.learn-link:hover { color: #555552; }
.learn-link svg { flex-shrink: 0; }
