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

:root {
  --bg: #0d0d12;
  --surface: #13131a;
  --surface2: #1c1c28;
  --border: rgba(255,255,255,0.07);
  --text: #e8e8f0;
  --muted: #7a7a9a;
  --radius: 16px;
  --nav-bg: rgba(13,13,18,0.75);
  --transition-theme: background 0.3s, color 0.3s, border-color 0.3s;
}
html.light {
  --bg: #f8f7ff;
  --surface: #ffffff;
  --surface2: #ede9fe;
  --border: rgba(0,0,0,0.08);
  --text: #1a1a2e;
  --muted: #6b6b8a;
  --nav-bg: rgba(248,247,255,0.85);
}
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Pretendard', 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
  transition: var(--transition-theme);
}

/* ── ICON BUTTON ── */
.icon-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
  flex-shrink: 0;
}
.icon-btn:hover { background: var(--surface2); border-color: rgba(167,139,250,0.3); transform: scale(1.08); }
.icon-btn.active-user { border-color: rgba(167,139,250,0.5); background: rgba(167,139,250,0.12); }

/* ── SEARCH OVERLAY ── */
.search-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.75); backdrop-filter: blur(8px);
  display: flex; flex-direction: column; align-items: center;
  padding-top: 100px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
}
.search-overlay.open { opacity: 1; pointer-events: all; }
.search-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px; width: 100%; max-width: 640px; margin: 0 16px;
  overflow: hidden; box-shadow: 0 24px 64px rgba(0,0,0,0.4);
}
.search-input-wrap {
  display: flex; align-items: center; gap: 12px; padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.search-input-wrap span { font-size: 1.1rem; color: var(--muted); }
.search-input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text); font-size: 1rem; font-family: inherit;
}
.search-input::placeholder { color: var(--muted); }
.search-close { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 1.1rem; padding: 4px; transition: color 0.2s; }
.search-close:hover { color: var(--text); }
.search-results { max-height: 400px; overflow-y: auto; }
.search-section-title { font-size: 0.7rem; font-weight: 700; color: var(--muted); letter-spacing: 0.1em; text-transform: uppercase; padding: 12px 20px 6px; }
.search-result-item {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 20px; text-decoration: none; color: var(--text);
  transition: background 0.15s; cursor: pointer;
}
.search-result-item:hover { background: var(--surface2); }
.search-result-swatch { width: 36px; height: 28px; border-radius: 6px; flex-shrink: 0; }
.search-result-swatch.grad { border-radius: 6px; }
.search-result-info { flex: 1; min-width: 0; }
.search-result-name { font-size: 0.9rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-result-meta { font-size: 0.72rem; color: var(--muted); }
.search-result-badge { font-size: 0.65rem; font-weight: 700; padding: 2px 8px; border-radius: 100px; flex-shrink: 0; }
.search-empty { padding: 32px 20px; text-align: center; color: var(--muted); font-size: 0.9rem; }
.search-history-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 20px; cursor: pointer; transition: background 0.15s; color: var(--muted);
  font-size: 0.88rem;
}
.search-history-item:hover { background: var(--surface2); color: var(--text); }
.search-history-del { margin-left: auto; background: none; border: none; color: var(--muted); cursor: pointer; font-size: 0.75rem; padding: 2px 4px; transition: color 0.2s; }
.search-history-del:hover { color: #f87171; }

/* ── LOGIN MODAL ── */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.modal-backdrop.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 24px; padding: 40px 36px; max-width: 440px; width: 100%;
  position: relative; transform: translateY(16px); transition: transform 0.2s;
  box-shadow: 0 24px 64px rgba(0,0,0,0.4);
}
.modal-backdrop.open .modal { transform: translateY(0); }
.modal-close { position: absolute; top: 16px; right: 16px; background: none; border: none; color: var(--muted); cursor: pointer; font-size: 1.3rem; line-height: 1; transition: color 0.2s; }
.modal-close:hover { color: var(--text); }
.modal h2 { font-size: 1.4rem; font-weight: 900; letter-spacing: -0.03em; margin-bottom: 8px; }
.modal p { font-size: 0.875rem; color: var(--muted); margin-bottom: 28px; line-height: 1.65; }
.modal-form-group { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.modal-form-group label { font-size: 0.78rem; font-weight: 700; color: var(--muted); letter-spacing: 0.04em; }
.modal-input {
  padding: 11px 14px; background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; color: var(--text); font-size: 0.9rem; font-family: inherit;
  outline: none; transition: border-color 0.2s;
}
.modal-input:focus { border-color: rgba(167,139,250,0.5); }
.modal-input::placeholder { color: var(--muted); }
.modal-btn {
  width: 100%; padding: 12px; background: linear-gradient(135deg, #a78bfa, #60a5fa);
  border: none; border-radius: 10px; color: #fff; font-size: 0.95rem; font-weight: 700;
  cursor: pointer; transition: opacity 0.2s; margin-top: 8px;
}
.modal-btn:hover { opacity: 0.88; }
.modal-user-info { text-align: center; }
.modal-user-avatar { width: 64px; height: 64px; border-radius: 50%; background: linear-gradient(135deg, #a78bfa, #60a5fa); display: flex; align-items: center; justify-content: center; font-size: 1.6rem; margin: 0 auto 16px; }
.modal-user-name { font-size: 1.2rem; font-weight: 800; margin-bottom: 4px; }
.modal-user-stats { font-size: 0.85rem; color: var(--muted); margin-bottom: 24px; }
.modal-stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px; }
.modal-stat-card { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 14px; text-align: center; }
.modal-stat-num { font-size: 1.6rem; font-weight: 900; background: linear-gradient(90deg, #a78bfa, #60a5fa); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.modal-stat-label { font-size: 0.72rem; color: var(--muted); margin-top: 2px; }
.modal-btn-outline { width: 100%; padding: 11px; background: none; border: 1px solid var(--border); border-radius: 10px; color: var(--muted); font-size: 0.9rem; cursor: pointer; margin-top: 6px; transition: all 0.2s; }
.modal-btn-outline:hover { border-color: rgba(248,113,113,0.4); color: #f87171; }
.modal-favorites-link { display: block; width: 100%; padding: 12px; background: rgba(167,139,250,0.1); border: 1px solid rgba(167,139,250,0.2); border-radius: 10px; color: #a78bfa; font-size: 0.9rem; font-weight: 700; text-align: center; text-decoration: none; margin-bottom: 8px; transition: background 0.2s; }
.modal-favorites-link:hover { background: rgba(167,139,250,0.18); }

/* ── HEART/FAVORITE BUTTON ── */
.fav-btn {
  width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--bg);
  color: var(--muted); font-size: 0.9rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; flex-shrink: 0;
}
.fav-btn:hover { border-color: rgba(255,107,174,0.4); color: #ff6bae; }
.fav-btn.saved { border-color: rgba(255,107,174,0.5); background: rgba(255,107,174,0.1); color: #ff6bae; }
.grad-fav-wrap { display: flex; align-items: center; gap: 8px; }

/* ── FAVORITES PAGE ── */
.favs-empty { text-align: center; padding: 80px 24px; color: var(--muted); }
.favs-empty-icon { font-size: 3rem; margin-bottom: 16px; }
.favs-empty h3 { font-size: 1.2rem; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.rec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 16px; }

/* ── THEME TOGGLE ── */
.theme-toggle {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
  flex-shrink: 0;
}
.theme-toggle:hover { background: var(--surface2); border-color: rgba(167,139,250,0.3); transform: rotate(15deg); }

/* ── NAV ── */
nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 48px;
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: var(--transition-theme);
}
.logo {
  font-size: 1.5rem; font-weight: 900; letter-spacing: -0.04em;
  background: linear-gradient(90deg, #ff6bae, #a78bfa, #60a5fa);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  text-decoration: none;
}
.nav-links { display: flex; gap: 32px; list-style: none; }
.nav-links a {
  color: var(--muted); text-decoration: none;
  font-size: 0.9rem; font-weight: 500; transition: color 0.2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); font-weight: 700; }
.nav-cta {
  padding: 9px 22px;
  background: linear-gradient(135deg, #a78bfa, #60a5fa);
  border: none; border-radius: 100px; color: #fff;
  font-size: 0.875rem; font-weight: 700; cursor: pointer;
  text-decoration: none; transition: opacity 0.2s, transform 0.2s;
}
.nav-cta:hover { opacity: 0.85; transform: translateY(-1px); }

/* ── HERO ── */
.hero {
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 120px 24px 80px;
  position: relative; overflow: hidden;
}
.hero-glow {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -60%);
  width: 900px; height: 600px;
  background: conic-gradient(from 180deg at 50% 50%,
    rgba(167,139,250,0.18) 0deg, rgba(96,165,250,0.14) 90deg,
    rgba(52,211,153,0.12) 180deg, rgba(251,191,36,0.12) 270deg,
    rgba(255,107,174,0.18) 360deg);
  border-radius: 50%; filter: blur(80px); pointer-events: none;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 14px; border: 1px solid rgba(167,139,250,0.3);
  border-radius: 100px; font-size: 0.78rem; font-weight: 600;
  color: #a78bfa; margin-bottom: 28px;
  background: rgba(167,139,250,0.07); letter-spacing: 0.05em;
}
.hero h1 {
  font-size: clamp(2.6rem, 7vw, 5.2rem); font-weight: 900;
  letter-spacing: -0.04em; line-height: 1.06; margin-bottom: 20px;
}
.gradient-text {
  background: linear-gradient(90deg, #ff6bae 0%, #a78bfa 40%, #60a5fa 70%, #34d399 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-size: 200%; animation: shimmer 4s linear infinite;
}
@keyframes shimmer { 0%{background-position:0% 50%} 100%{background-position:200% 50%} }
.hero p {
  font-size: clamp(1rem, 2.2vw, 1.2rem); color: var(--muted);
  max-width: 560px; margin-bottom: 44px; line-height: 1.75;
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; margin-bottom: 72px; }

/* ── BUTTONS ── */
.btn-primary {
  padding: 15px 34px;
  background: linear-gradient(135deg, #a78bfa, #60a5fa);
  border: none; border-radius: 100px; color: #fff;
  font-size: 1rem; font-weight: 700; cursor: pointer;
  text-decoration: none; transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 8px 32px rgba(167,139,250,0.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 40px rgba(167,139,250,0.45); }
.btn-secondary {
  padding: 15px 34px; background: transparent;
  border: 1px solid var(--border); border-radius: 100px;
  color: var(--text); font-size: 1rem; font-weight: 600;
  cursor: pointer; text-decoration: none; transition: background 0.2s, border-color 0.2s;
}
.btn-secondary:hover { background: var(--surface2); border-color: rgba(255,255,255,0.15); }

/* ── PALETTE PREVIEW (hero) ── */
.palette-preview { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 640px; }
.palette-row { display: flex; gap: 8px; border-radius: 14px; overflow: hidden; }
.swatch {
  flex: 1; height: 72px; border-radius: 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  padding-bottom: 8px; cursor: pointer;
  transition: transform 0.2s, filter 0.2s; position: relative; overflow: hidden;
}
.swatch:hover { transform: scaleY(1.06); filter: brightness(1.1); }
.swatch-code { font-size: 0.68rem; font-weight: 700; color: rgba(255,255,255,0.85); letter-spacing: 0.04em; text-shadow: 0 1px 4px rgba(0,0,0,0.5); }

/* ── PAGE HERO (inner pages) ── */
.page-hero {
  padding: 140px 24px 64px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.page-hero-glow {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 600px; height: 300px;
  background: conic-gradient(from 180deg at 50% 0%,
    rgba(167,139,250,0.15) 0deg, rgba(96,165,250,0.1) 120deg,
    rgba(255,107,174,0.12) 240deg, rgba(167,139,250,0.15) 360deg);
  border-radius: 0 0 50% 50%; filter: blur(60px); pointer-events: none;
}
.breadcrumb { font-size: 0.78rem; color: var(--muted); margin-bottom: 16px; }
.breadcrumb a { color: var(--muted); text-decoration: none; transition: color 0.2s; }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb span { margin: 0 6px; }
.page-hero h1 { font-size: clamp(2rem, 5vw, 3.6rem); font-weight: 900; letter-spacing: -0.04em; line-height: 1.1; margin-bottom: 16px; }
.page-hero p { font-size: 1.05rem; color: var(--muted); max-width: 520px; margin: 0 auto; line-height: 1.75; }

/* ── TOOL CARDS (home) ── */
.tools-section { padding: 0 24px 96px; max-width: 1200px; margin: 0 auto; }
.tools-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.tool-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px; overflow: hidden;
  text-decoration: none; color: var(--text);
  display: block; transition: transform 0.22s, box-shadow 0.22s, border-color 0.22s;
}
.tool-card:hover { transform: translateY(-6px); box-shadow: 0 16px 40px rgba(0,0,0,0.2); border-color: rgba(167,139,250,0.25); }
.tool-card-preview { height: 150px; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.tool-card-body { padding: 24px; }
.tool-card-icon { font-size: 1.6rem; margin-bottom: 12px; }
.tool-card h3 { font-size: 1.05rem; font-weight: 800; margin-bottom: 8px; letter-spacing: -0.02em; }
.tool-card p { font-size: 0.84rem; color: var(--muted); line-height: 1.65; margin-bottom: 16px; }
.tool-card-cta { font-size: 0.82rem; font-weight: 700; color: #a78bfa; display: flex; align-items: center; gap: 4px; }

/* ── SECTION BASE ── */
.section { padding: 80px 24px; max-width: 1200px; margin: 0 auto; }
.section-label { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: #a78bfa; margin-bottom: 14px; }
.section-title { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 900; letter-spacing: -0.035em; line-height: 1.15; margin-bottom: 14px; }
.section-desc { color: var(--muted); font-size: 1.05rem; max-width: 500px; line-height: 1.75; margin-bottom: 48px; }
.divider { border: none; border-top: 1px solid var(--border); }

/* ── FEATURES ── */
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.feature-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 32px;
  transition: border-color 0.3s, transform 0.3s; position: relative; overflow: hidden;
}
.feature-card::after { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; border-radius: 2px 2px 0 0; opacity: 0; transition: opacity 0.3s; }
.feature-card:hover { transform: translateY(-4px); border-color: rgba(167,139,250,0.2); }
.feature-card:hover::after { opacity: 1; }
.fc-purple::after { background: linear-gradient(90deg, #a78bfa, #60a5fa); }
.fc-pink::after   { background: linear-gradient(90deg, #ff6bae, #fb923c); }
.fc-teal::after   { background: linear-gradient(90deg, #34d399, #60a5fa); }
.fc-amber::after  { background: linear-gradient(90deg, #fbbf24, #f97316); }
.fc-red::after    { background: linear-gradient(90deg, #f87171, #a78bfa); }
.fc-indigo::after { background: linear-gradient(90deg, #818cf8, #34d399); }
.feature-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; margin-bottom: 18px; }
.fi-purple{background:rgba(167,139,250,0.12)} .fi-pink{background:rgba(255,107,174,0.12)} .fi-teal{background:rgba(52,211,153,0.12)} .fi-amber{background:rgba(251,191,36,0.12)} .fi-red{background:rgba(248,113,113,0.12)} .fi-indigo{background:rgba(129,140,248,0.12)}
.feature-card h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 10px; letter-spacing: -0.02em; }
.feature-card p { color: var(--muted); font-size: 0.88rem; line-height: 1.7; }

/* ── CTA ── */
.cta-section { padding: 100px 24px; text-align: center; }
.cta-box {
  max-width: 720px; margin: 0 auto;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 28px; padding: 72px 48px; position: relative; overflow: hidden;
}
.cta-box::before {
  content: ''; position: absolute; top: -150px; left: 50%; transform: translateX(-50%);
  width: 600px; height: 400px;
  background: conic-gradient(from 0deg at 50% 100%, rgba(167,139,250,0.12), rgba(96,165,250,0.1), rgba(52,211,153,0.08), rgba(251,191,36,0.08), rgba(255,107,174,0.12), rgba(167,139,250,0.12));
  border-radius: 50%; filter: blur(60px); pointer-events: none;
}
.cta-box h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 900; letter-spacing: -0.03em; margin-bottom: 14px; }
.cta-box p { color: var(--muted); margin-bottom: 40px; font-size: 1.05rem; }
.email-form { display: flex; gap: 10px; max-width: 420px; margin: 0 auto; flex-wrap: wrap; justify-content: center; }
.email-form input {
  flex: 1; min-width: 200px; padding: 13px 20px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 100px; color: var(--text); font-size: 0.9rem; outline: none; transition: border-color 0.2s;
}
.email-form input:focus { border-color: rgba(167,139,250,0.4); }
.email-form input::placeholder { color: var(--muted); }
.email-form button {
  padding: 13px 26px; background: linear-gradient(135deg, #a78bfa, #60a5fa);
  border: none; border-radius: 100px; color: #fff; font-weight: 700;
  font-size: 0.9rem; cursor: pointer; transition: opacity 0.2s; white-space: nowrap;
}
.email-form button:hover { opacity: 0.85; }

/* ── CONTACT FORM ── */
.contact-section { padding: 96px 24px; max-width: 720px; margin: 0 auto; }
.contact-form {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 24px; padding: 48px 44px; position: relative; overflow: hidden; transition: var(--transition-theme);
}
.contact-form::before {
  content: ''; position: absolute; top: -80px; right: -80px;
  width: 280px; height: 280px;
  background: radial-gradient(circle, rgba(167,139,250,0.1) 0%, transparent 70%); pointer-events: none;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 7px; margin-bottom: 18px; }
.form-group label { font-size: 0.8rem; font-weight: 700; color: var(--muted); letter-spacing: 0.04em; }
.form-group label .req { color: #a78bfa; margin-left: 2px; }
.form-control {
  padding: 12px 16px; background: var(--bg); border: 1px solid var(--border);
  border-radius: 12px; color: var(--text); font-size: 0.9rem; font-family: inherit;
  outline: none; transition: border-color 0.2s, box-shadow 0.2s; width: 100%;
}
.form-control:focus { border-color: rgba(167,139,250,0.5); box-shadow: 0 0 0 3px rgba(167,139,250,0.1); }
.form-control::placeholder { color: var(--muted); }
select.form-control {
  cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237a7a9a' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px;
}
textarea.form-control { resize: vertical; min-height: 120px; line-height: 1.65; }
.form-submit {
  width: 100%; padding: 14px; background: linear-gradient(135deg, #a78bfa, #60a5fa);
  border: none; border-radius: 12px; color: #fff; font-size: 1rem; font-weight: 700;
  cursor: pointer; transition: opacity 0.2s, transform 0.2s; margin-top: 6px;
}
.form-submit:hover:not(:disabled) { opacity: 0.88; transform: translateY(-1px); }
.form-submit:disabled { opacity: 0.55; cursor: not-allowed; }
.form-status { margin-top: 16px; padding: 13px 16px; border-radius: 10px; font-size: 0.875rem; font-weight: 600; text-align: center; display: none; }
.form-status.success { display: block; background: rgba(52,211,153,0.12); border: 1px solid rgba(52,211,153,0.25); color: #34d399; }
.form-status.error   { display: block; background: rgba(248,113,113,0.1); border: 1px solid rgba(248,113,113,0.2); color: #f87171; }

/* ── FOOTER ── */
footer { border-top: 1px solid var(--border); padding: 36px 48px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.footer-logo { font-size: 1.25rem; font-weight: 900; background: linear-gradient(90deg, #ff6bae, #a78bfa, #60a5fa); -webkit-background-clip: text; -webkit-text-fill-color: transparent; text-decoration: none; }
footer p { color: var(--muted); font-size: 0.82rem; }
.footer-links { display: flex; gap: 22px; list-style: none; }
.footer-links a { color: var(--muted); text-decoration: none; font-size: 0.82rem; transition: color 0.2s; }
.footer-links a:hover { color: var(--text); }

/* ── IMAGE EXTRACTOR ── */
.drop-zone {
  border: 2px dashed rgba(167,139,250,0.35); border-radius: 20px;
  padding: 48px 24px; text-align: center; cursor: pointer;
  transition: border-color 0.25s, background 0.25s; background: rgba(167,139,250,0.03);
}
.drop-zone:hover, .drop-zone.drag-over { border-color: #a78bfa; background: rgba(167,139,250,0.08); }
.drop-zone-icon { font-size: 2.4rem; margin-bottom: 12px; }
.drop-zone h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 8px; }
.drop-zone p { font-size: 0.85rem; color: var(--muted); margin-bottom: 20px; }
.drop-zone-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.dz-btn { padding: 10px 22px; border-radius: 100px; font-size: 0.85rem; font-weight: 700; cursor: pointer; transition: opacity 0.2s, transform 0.2s; border: none; }
.dz-btn-primary { background: linear-gradient(135deg, #a78bfa, #60a5fa); color: #fff; }
.dz-btn-secondary { background: var(--bg); border: 1px solid var(--border); color: var(--text); }
.dz-btn:hover { opacity: 0.85; transform: translateY(-1px); }
#imageFileInput { display: none; }
.extractor-preview { display: none; margin-top: 24px; border-radius: 16px; overflow: hidden; border: 1px solid var(--border); background: var(--bg); }
.extractor-preview.visible { display: block; }
.preview-img-wrap { position: relative; background: repeating-conic-gradient(#aaa 0% 25%, transparent 0% 50%) 0 0 / 16px 16px; }
#previewImg { display: block; max-width: 100%; max-height: 320px; object-fit: contain; margin: 0 auto; }
.color-count-bar { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.color-count-bar span { font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.count-btns { display: flex; gap: 6px; }
.count-btn { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 0.85rem; font-weight: 700; cursor: pointer; transition: background 0.15s; }
.count-btn.active { background: linear-gradient(135deg, #a78bfa, #60a5fa); border-color: transparent; color: #fff; }
.extracted-colors { padding: 20px; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.color-chip { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; transition: transform 0.2s, box-shadow 0.2s; cursor: pointer; }
.color-chip:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.15); }
.chip-swatch { height: 80px; position: relative; }
.chip-copy-hint { position: absolute; inset: 0; background: rgba(0,0,0,0.35); display: flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 700; color: #fff; opacity: 0; transition: opacity 0.2s; }
.color-chip:hover .chip-copy-hint { opacity: 1; }
.chip-info { padding: 10px 12px; }
.chip-name { font-size: 0.8rem; font-weight: 700; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip-hex { font-size: 0.72rem; color: var(--muted); font-family: monospace; letter-spacing: 0.04em; }
.chip-rgb { font-size: 0.68rem; color: var(--muted); font-family: monospace; }
.chip-copied { animation: chipCopied 1s ease forwards; }
@keyframes chipCopied { 0%{transform:translateY(-3px) scale(1)} 30%{transform:translateY(-3px) scale(1.05)} 100%{transform:translateY(0) scale(1)} }
.chip-pct { color: var(--muted); font-weight: 600; }

.ratio-section { padding: 20px; border-top: 1px solid var(--border); }
.ratio-title { font-size: 0.95rem; font-weight: 700; margin-bottom: 4px; }
.ratio-desc { font-size: 0.8rem; color: var(--muted); margin-bottom: 14px; }
.ratio-bar { display: flex; width: 100%; height: 20px; border-radius: 10px; overflow: hidden; background: var(--bg); margin-bottom: 4px; }
.ratio-seg { height: 100%; transition: width 0.3s ease; }
.ratio-bar.reco { margin-bottom: 16px; }
.ratio-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.ratio-table th, .ratio-table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--border); }
.ratio-table th { color: var(--muted); font-weight: 600; font-size: 0.75rem; }
.ratio-table .ratio-hex { font-family: monospace; letter-spacing: 0.04em; }
.ratio-swatch-dot { display: inline-block; width: 16px; height: 16px; border-radius: 5px; vertical-align: middle; }
.paste-toast { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(80px); background: #a78bfa; color: #fff; padding: 10px 22px; border-radius: 100px; font-size: 0.85rem; font-weight: 700; z-index: 9999; transition: transform 0.3s ease; pointer-events: none; }
.paste-toast.show { transform: translateX(-50%) translateY(0); }

/* ── PALETTE GALLERY ── */
.palette-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 40px; }
.ptab { padding: 9px 20px; border-radius: 100px; border: 1px solid var(--border); background: var(--bg); color: var(--muted); font-size: 0.82rem; font-weight: 700; cursor: pointer; transition: all 0.2s; white-space: nowrap; }
.ptab:hover { color: var(--text); border-color: rgba(167,139,250,0.35); }
.ptab.active { background: linear-gradient(135deg, #a78bfa, #60a5fa); border-color: transparent; color: #fff; }
.palette-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 16px; }
.pal-card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; overflow: hidden; transition: transform 0.22s, box-shadow 0.22s, border-color 0.22s; }
.pal-card:hover { transform: translateY(-5px); box-shadow: 0 14px 36px rgba(0,0,0,0.18); border-color: rgba(167,139,250,0.22); }
.pal-card[data-hidden] { display: none; }
.pal-swatches { display: flex; height: 108px; }
.pal-swatch { flex: 1; position: relative; cursor: pointer; transition: flex 0.25s ease; overflow: hidden; }
.pal-swatch:hover { flex: 2.2; }
.pal-hex-tip { position: absolute; bottom: 7px; left: 50%; transform: translateX(-50%); font-size: 0.58rem; font-weight: 800; white-space: nowrap; color: rgba(255,255,255,0.92); text-shadow: 0 1px 4px rgba(0,0,0,0.7); letter-spacing: 0.03em; opacity: 0; transition: opacity 0.15s; pointer-events: none; }
.pal-swatch:hover .pal-hex-tip { opacity: 1; }
.pal-swatch.swatch-flash { animation: swatchFlash 0.45s ease; }
@keyframes swatchFlash { 0%{filter:brightness(1)} 40%{filter:brightness(1.5) saturate(1.2)} 100%{filter:brightness(1)} }
.pal-info { padding: 14px 16px 15px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pal-meta { display: flex; flex-direction: column; gap: 3px; }
.pal-name { font-size: 0.9rem; font-weight: 700; letter-spacing: -0.015em; }
.pal-mood { font-size: 0.72rem; color: var(--muted); }
.pal-badge { padding: 4px 11px; border-radius: 100px; font-size: 0.68rem; font-weight: 700; white-space: nowrap; flex-shrink: 0; }
.pb-comp{background:rgba(255,107,174,0.12);color:#FF6BAE;border:1px solid rgba(255,107,174,0.28)}
.pb-ana {background:rgba(52,211,153,0.12); color:#34D399;border:1px solid rgba(52,211,153,0.28)}
.pb-tri {background:rgba(251,191,36,0.12); color:#FBBF24;border:1px solid rgba(251,191,36,0.28)}
.pb-mono{background:rgba(167,139,250,0.12);color:#A78BFA;border:1px solid rgba(167,139,250,0.28)}
.pb-spl {background:rgba(96,165,250,0.12); color:#60A5FA;border:1px solid rgba(96,165,250,0.28)}
.pal-copy-toast { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(80px); background: #34d399; color: #fff; padding: 10px 24px; border-radius: 100px; font-size: 0.85rem; font-weight: 700; z-index: 9998; transition: transform 0.3s cubic-bezier(.34,1.56,.64,1); pointer-events: none; }
.pal-copy-toast.show { transform: translateX(-50%) translateY(0); }

/* ── GRADIENT LIST ── */
.grad-list { display: flex; flex-direction: column; gap: 14px; }
.grad-item { display: grid; grid-template-columns: 180px 1fr; border: 1px solid var(--border); border-radius: 16px; overflow: hidden; background: var(--surface); transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s; }
.grad-item:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(0,0,0,0.14); border-color: rgba(167,139,250,0.22); }
.grad-bar { min-height: 96px; }
.grad-body { padding: 18px 20px; display: flex; flex-direction: column; justify-content: center; gap: 6px; }
.grad-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.grad-name { font-size: 0.95rem; font-weight: 800; letter-spacing: -0.02em; }
.grad-mood { font-size: 0.72rem; font-weight: 700; padding: 3px 10px; border-radius: 100px; background: rgba(167,139,250,0.1); color: #a78bfa; border: 1px solid rgba(167,139,250,0.2); white-space: nowrap; }
.grad-desc { font-size: 0.82rem; color: var(--muted); line-height: 1.55; }
.grad-stops { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.grad-hex { font-size: 0.68rem; font-family: monospace; font-weight: 700; letter-spacing: 0.04em; padding: 2px 8px; border-radius: 6px; background: var(--bg); border: 1px solid var(--border); color: var(--muted); cursor: pointer; transition: background 0.15s, color 0.15s; }
.grad-hex:hover { background: rgba(167,139,250,0.15); color: var(--text); }
.grad-copy-btn { margin-left: auto; padding: 5px 14px; border-radius: 100px; border: 1px solid var(--border); background: var(--bg); color: var(--muted); font-size: 0.72rem; font-weight: 700; cursor: pointer; white-space: nowrap; transition: all 0.2s; align-self: flex-start; }
.grad-copy-btn:hover { background: linear-gradient(135deg, #a78bfa, #60a5fa); border-color: transparent; color: #fff; }
.grad-copy-btn.copied { background: linear-gradient(135deg, #34d399, #059669); border-color: transparent; color: #fff; }

/* ── TIPS ── */
.tips-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.tip-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; transition: transform 0.3s, border-color 0.3s; }
.tip-card:hover { transform: translateY(-3px); border-color: rgba(167,139,250,0.2); }
.tip-tag { display: inline-block; padding: 3px 10px; border-radius: 100px; font-size: 0.7rem; font-weight: 700; margin-bottom: 14px; }
.tip-card h4 { font-size: 1rem; font-weight: 700; margin-bottom: 10px; letter-spacing: -0.02em; }
.tip-card p { font-size: 0.875rem; color: var(--muted); line-height: 1.7; }
.tip-palette { display: flex; gap: 6px; margin-top: 16px; }
.tp { height: 28px; border-radius: 6px; flex: 1; }

/* ── HARMONY (theory) ── */
.harmony-bg { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); transition: var(--transition-theme); }
.harmony-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; }
.harmony-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px 20px; text-align: center; transition: border-color 0.3s, transform 0.3s; }
.harmony-card:hover { border-color: rgba(167,139,250,0.2); transform: translateY(-4px); }
.harmony-swatches { display: flex; gap: 6px; margin-bottom: 16px; justify-content: center; }
.h-swatch { width: 36px; height: 52px; border-radius: 8px; }
.harmony-card h4 { font-size: 0.9rem; font-weight: 700; margin-bottom: 6px; }
.harmony-card p { font-size: 0.78rem; color: var(--muted); line-height: 1.55; }

/* ── FADE IN ── */
.fade-in { opacity: 0; transform: translateY(20px); transition: opacity 0.6s ease, transform 0.6s ease; }
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* ── COMMENTS ── */
.comment-section { border-top: 1px solid var(--border); padding: 10px 16px 14px; }
.comment-toggle-row { display: flex; }
.comment-toggle-btn { background: none; border: none; color: var(--muted); font-size: 0.8rem; font-weight: 700; cursor: pointer; padding: 6px 0; display: flex; align-items: center; gap: 4px; }
.comment-toggle-btn:hover { color: var(--text); }
.comment-body { margin-top: 8px; }
.comment-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 10px; }
.comment-empty { font-size: 0.78rem; color: var(--muted); padding: 10px 0; }
.comment-item { display: flex; gap: 10px; }
.comment-avatar { flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, #a78bfa, #60a5fa); color: #fff; font-weight: 800; font-size: 0.8rem; display: flex; align-items: center; justify-content: center; }
.comment-avatar.small { width: 28px; height: 28px; font-size: 0.75rem; }
.comment-content { flex: 1; min-width: 0; }
.comment-header { display: flex; align-items: baseline; gap: 8px; }
.comment-username { font-size: 0.8rem; font-weight: 700; }
.comment-time { font-size: 0.7rem; color: var(--muted); }
.comment-text { font-size: 0.82rem; line-height: 1.5; margin: 3px 0 4px; word-break: break-word; }
.comment-actions { display: flex; gap: 12px; }
.cmt-like-btn, .cmt-del-btn { background: none; border: none; cursor: pointer; font-size: 0.72rem; color: var(--muted); padding: 0; }
.cmt-like-btn:hover, .cmt-del-btn:hover { color: var(--text); }
.cmt-like-btn.liked { color: #f87171; }
.comment-form-wrap { display: flex; gap: 10px; align-items: flex-start; }
.comment-input-row { flex: 1; display: flex; gap: 8px; }
.comment-textarea { flex: 1; resize: none; border: 1px solid var(--border); background: var(--bg); color: var(--text); border-radius: 10px; padding: 8px 10px; font-size: 0.8rem; font-family: inherit; max-height: 120px; }
.comment-textarea:focus { outline: none; border-color: rgba(167,139,250,0.5); }
.comment-submit-btn { background: linear-gradient(135deg, #a78bfa, #60a5fa); color: #fff; border: none; border-radius: 10px; padding: 0 16px; font-size: 0.8rem; font-weight: 700; cursor: pointer; }
.comment-submit-btn:hover { opacity: 0.88; }
.comment-login-prompt { font-size: 0.8rem; color: var(--muted); }
.comment-login-prompt a { color: #a78bfa; font-weight: 700; }

/* ── AUTH PAGE ── */
.auth-section { display: flex; justify-content: center; padding: 60px 20px; }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 32px; }
.auth-tabs { display: flex; gap: 6px; background: var(--bg); border-radius: 12px; padding: 4px; margin-bottom: 24px; }
.auth-tab { flex: 1; padding: 10px; border: none; background: none; border-radius: 9px; color: var(--muted); font-weight: 700; font-size: 0.85rem; cursor: pointer; transition: all 0.2s; }
.auth-tab.active { background: linear-gradient(135deg, #a78bfa, #60a5fa); color: #fff; }
.auth-form { display: flex; flex-direction: column; }
.auth-error { color: #f87171; font-size: 0.78rem; margin: -6px 0 12px; min-height: 1em; }
.auth-note { text-align: center; font-size: 0.75rem; color: var(--muted); margin-top: 18px; }

/* ── PALETTE STUDIO ── */
.studio-form { max-width: 520px; }
.studio-color-list { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.studio-color-row { display: flex; align-items: center; gap: 4px; }
.studio-color-picker { width: 44px; height: 40px; border: 1px solid var(--border); border-radius: 8px; background: none; cursor: pointer; padding: 2px; }
.studio-color-remove { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: 0.7rem; cursor: pointer; line-height: 1; }
.studio-color-remove:hover { color: #f87171; border-color: rgba(248,113,113,0.4); }
.studio-color-actions { margin-bottom: 6px; }
.studio-delete-btn { background: none; border: none; cursor: pointer; font-size: 0.95rem; opacity: 0.7; }
.studio-delete-btn:hover { opacity: 1; }

/* ── LEGAL PAGES ── */
.legal-content { max-width: 720px; }
.legal-content h2 { font-size: 1.15rem; font-weight: 800; margin: 32px 0 12px; }
.legal-content h2:first-child { margin-top: 0; }
.legal-content p { color: var(--muted); font-size: 0.92rem; line-height: 1.75; margin-bottom: 12px; }
.legal-content ul { color: var(--muted); font-size: 0.92rem; line-height: 1.75; margin: 0 0 12px 20px; }
.legal-content li { margin-bottom: 6px; }
.legal-content a { color: #a78bfa; }
.legal-date { font-size: 0.82rem; color: var(--muted); margin-top: 24px; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  nav { padding: 14px 20px; }
  .nav-links { display: none; }
  .cta-box { padding: 44px 22px; }
  footer { flex-direction: column; text-align: center; }
  .extracted-colors { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .palette-gallery { grid-template-columns: 1fr; }
  .grad-item { grid-template-columns: 1fr; }
  .grad-bar { min-height: 72px; }
  .tools-grid { grid-template-columns: 1fr 1fr; }
  .page-hero { padding: 120px 20px 48px; }
}
@media (max-width: 480px) {
  .tools-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .contact-form { padding: 32px 22px; }
}
