/* Essence of Fragrance: a cute, pastel perfume journal. Mobile-first. */

:root {
  --hot: #ff5fa2;
  --lav: #c9b6ff;
  --baby: #a8d8ff;
  --blush: #ffe3ef;
  --white: #ffffff;
  --cream: #fffafd;

  --ink: #4a2560;        /* main text: 12:1 on white */
  --ink-soft: #6b4a8a;   /* secondary text: 6:1 on white/blush */
  --pink-ink: #c2185b;   /* pink text: 5.9:1 on white */
  --badge-ink: #3d1e52;

  --btn-a: #d1247a;
  --btn-b: #8e44c9;

  --paper: #fff7fb;
  --line: #f3d6e6;
  --shadow: 0 6px 20px rgba(142, 68, 201, 0.12), 0 2px 6px rgba(255, 95, 162, 0.1);
  --shadow-lift: 0 14px 34px rgba(142, 68, 201, 0.2), 0 4px 10px rgba(255, 95, 162, 0.15);
  --r-sm: 12px;
  --r: 20px;
  --r-lg: 28px;

  --font-body: 'Quicksand', 'Nunito', system-ui, sans-serif;
  --font-ui: 'Fredoka', 'Quicksand', system-ui, sans-serif;
  --font-script: 'Pacifico', 'Brush Script MT', cursive;

  color-scheme: light;
}

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

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 12% 8%, rgba(255, 179, 212, 0.45) 0, transparent 38%),
    radial-gradient(circle at 92% 18%, rgba(168, 216, 255, 0.4) 0, transparent 34%),
    radial-gradient(circle at 70% 92%, rgba(201, 182, 255, 0.4) 0, transparent 40%),
    radial-gradient(rgba(255, 95, 162, 0.13) 1.2px, transparent 1.4px);
  background-size: auto, auto, auto, 22px 22px;
  background-attachment: fixed;
  padding-bottom: env(safe-area-inset-bottom);
}

img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--pink-ink); }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; }
[hidden] { display: none !important; }

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

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 999px;
  text-decoration: none; font-family: var(--font-ui);
}
.skip:focus { top: 12px; }

:focus-visible {
  outline: 3px solid var(--btn-b);
  outline-offset: 3px;
  border-radius: 8px;
}

/* ------------------------------------------------------------ header */

.site-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  padding-top: max(10px, env(safe-area-inset-top));
  background: rgba(255, 247, 251, 0.82);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 2px dashed var(--line);
}

.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); min-width: 0; }
.logo-mark {
  display: grid; place-items: center; flex: none;
  width: 42px; height: 42px; border-radius: 50%;
  background: linear-gradient(135deg, var(--hot), var(--lav) 60%, var(--baby));
  color: #fff; font-size: 24px;
  box-shadow: var(--shadow);
  animation: spin-slow 18s linear infinite;
}
.logo-text { display: flex; flex-direction: column; min-width: 0; }
.logo-title {
  font-family: var(--font-script); font-size: 1.2rem; line-height: 1.3; color: var(--pink-ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.logo-tag { font-size: 0.75rem; color: var(--ink-soft); font-weight: 600; }

.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a {
  font-family: var(--font-ui); text-decoration: none; color: var(--ink);
  padding: 8px 12px; border-radius: 999px; font-size: 0.95rem;
  transition: background 0.2s;
}
.nav a:hover { background: var(--blush); }
.nav a[aria-current='page'] { background: var(--white); box-shadow: var(--shadow); color: var(--pink-ink); }

.auth-area { flex: none; }
.auth-area:empty { display: none; }

.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; }
.menu summary::-webkit-details-marker { display: none; }
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 30;
  min-width: 240px; padding: 8px;
  background: var(--white); border-radius: var(--r); box-shadow: var(--shadow-lift);
  border: 2px solid var(--blush);
  animation: pop 0.18s ease-out;
}
.menu-who { margin: 4px 10px 8px; font-size: 0.85rem; color: var(--ink-soft); }
.menu-item {
  display: block; width: 100%; text-align: left; border: 0; background: none; cursor: pointer;
  padding: 10px 12px; border-radius: var(--r-sm); font-family: var(--font-ui); font-size: 0.95rem;
}
.menu-item:hover, .menu-item:focus-visible { background: var(--blush); }

/* ------------------------------------------------------------ banners */

.banners { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.banners:empty { display: none; }
.banner {
  display: flex; gap: 12px; align-items: center;
  margin-top: 12px; padding: 12px 16px;
  background: linear-gradient(120deg, #f3eeff, #eaf6ff);
  border: 2px dashed var(--lav); border-radius: var(--r);
  font-size: 0.92rem;
}
.banner > span { font-size: 1.5rem; }
.banner p { margin: 0; }
.banner code { background: #fff; padding: 2px 6px; border-radius: 6px; word-break: break-all; font-size: 0.85em; }
.banner-pink { background: linear-gradient(120deg, #fff0f7, #f6efff); border-color: #ffb3d4; }

/* ------------------------------------------------------------ layout */

main { max-width: 1180px; margin: 0 auto; padding: 16px; outline: none; }

/* ------------------------------------------------------------ buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 10px 20px;
  border: 0; border-radius: 999px; cursor: pointer;
  font-family: var(--font-ui); font-weight: 600; font-size: 1rem; text-decoration: none;
  color: #fff;
  background: linear-gradient(135deg, var(--btn-a), var(--btn-b));
  box-shadow: 0 4px 14px rgba(209, 36, 122, 0.3);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s;
}
.btn:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 8px 20px rgba(209, 36, 122, 0.35); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn:disabled { filter: grayscale(0.5); opacity: 0.7; cursor: progress; transform: none; }
.btn-sm { min-height: 36px; padding: 6px 14px; font-size: 0.9rem; }
.btn-ghost {
  background: var(--white); color: var(--ink);
  box-shadow: inset 0 0 0 2px var(--line), 0 2px 8px rgba(142, 68, 201, 0.08);
}
.btn-ghost:hover { box-shadow: inset 0 0 0 2px var(--lav), 0 6px 16px rgba(142, 68, 201, 0.15); }
.btn-soft { background: var(--blush); color: var(--ink); box-shadow: none; }
.btn-soft:hover { background: #ffd2e5; box-shadow: none; }
.btn-danger { background: linear-gradient(135deg, #c2185b, #a3144c); }
.danger { color: #b0124f; }

.icon-btn {
  display: grid; place-items: center; flex: none;
  width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--white); color: var(--pink-ink); font-size: 1.2rem;
  box-shadow: var(--shadow);
  transition: transform 0.18s;
}
.icon-btn:hover { transform: scale(1.08) rotate(-6deg); }

.link-btn {
  border: 0; background: none; padding: 0; cursor: pointer;
  color: var(--pink-ink); font-weight: 700; text-decoration: underline; text-underline-offset: 3px;
}

.chip-btn {
  display: inline-flex; align-items: center; gap: 4px;
  min-height: 40px; padding: 6px 14px; border-radius: 999px; cursor: pointer;
  border: 2px solid var(--line); background: var(--white);
  font-family: var(--font-ui); font-size: 0.92rem;
  transition: background 0.2s, border-color 0.2s, transform 0.18s;
}
.chip-btn:hover { background: var(--blush); border-color: #ffb3d4; transform: translateY(-1px); }

.fab {
  position: fixed; z-index: 25;
  right: max(16px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom));
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 56px; padding: 0 22px; border: 0; border-radius: 999px; cursor: pointer;
  font-family: var(--font-ui); font-weight: 600; font-size: 1.05rem; color: #fff;
  background: linear-gradient(135deg, var(--btn-a), var(--btn-b));
  box-shadow: 0 10px 26px rgba(209, 36, 122, 0.4);
  transition: transform 0.2s;
}
.fab span { font-size: 1.5rem; line-height: 1; }
.fab:hover { transform: translateY(-3px) scale(1.04); }

/* ------------------------------------------------------------ perfume of the day */

.potd {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 16px;
  padding: 14px; margin-bottom: 18px;
  text-decoration: none; color: var(--ink);
  background: linear-gradient(120deg, #ffe3ef 0%, #f1e9ff 55%, #e3f2ff 100%);
  border-radius: var(--r-lg); box-shadow: var(--shadow);
  border: 3px solid #fff;
  transition: transform 0.25s, box-shadow 0.25s;
}
.potd:hover { transform: translateY(-3px) rotate(-0.4deg); box-shadow: var(--shadow-lift); }
.potd-img {
  flex: none; width: 92px; aspect-ratio: 3 / 4; border-radius: 16px; overflow: hidden;
  background: #fff; box-shadow: 0 4px 12px rgba(74, 37, 96, 0.15); transform: rotate(-4deg);
}
.potd-img img { width: 100%; height: 100%; object-fit: contain; }
.potd-text { min-width: 0; }
.eyebrow {
  margin: 0 0 2px; font-family: var(--font-ui); font-size: 0.8rem; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase; color: var(--pink-ink);
}
.potd-name { font-family: var(--font-script); font-weight: 400; font-size: 1.35rem; line-height: 1.35; color: var(--ink); }
.potd-brand { margin: 0 0 4px; color: var(--ink-soft); font-weight: 600; }
.sparkle { position: absolute; color: var(--hot); animation: twinkle 2.4s ease-in-out infinite; }
.sparkle.s1 { top: 10px; right: 18px; font-size: 1.4rem; }
.sparkle.s2 { bottom: 12px; right: 52px; font-size: 1rem; color: #8e44c9; animation-delay: 1.1s; }

/* ------------------------------------------------------------ tabs + toolbar */

.tabs {
  display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x proximity;
  margin: 0 -16px; padding: 4px 16px 10px;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none; scroll-snap-align: start;
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 8px 14px; border-radius: 999px; cursor: pointer;
  border: 2px solid transparent; background: rgba(255, 255, 255, 0.85);
  font-family: var(--font-ui); font-weight: 500; font-size: 0.95rem;
  box-shadow: 0 2px 8px rgba(142, 68, 201, 0.08);
  transition: transform 0.18s, background 0.2s;
}
.tab:hover { transform: translateY(-1px); background: #fff; }
.tab .count {
  min-width: 26px; padding: 1px 8px; border-radius: 999px;
  background: var(--blush); color: var(--pink-ink); font-size: 0.82rem; font-weight: 600; text-align: center;
}
.tab.active {
  color: #fff; background: linear-gradient(135deg, var(--btn-a), var(--btn-b));
  box-shadow: 0 6px 16px rgba(209, 36, 122, 0.3);
}
.tab.active .count { background: rgba(255, 255, 255, 0.95); color: var(--pink-ink); }

.toolbar { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; }
.search { grid-column: 1 / -1; position: relative; }
.search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: 0.95rem; }
.search input, .select select, .field input, .field select, .field textarea {
  width: 100%; min-height: 46px;
  border: 2px solid var(--line); border-radius: 999px; background: #fff;
  padding: 10px 16px; font-weight: 500;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search input { padding-left: 42px; }
.select select, .field select {
  appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23c2185b' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 12px;
  text-overflow: ellipsis;
}
.search input:focus, .select select:focus, .field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--lav); box-shadow: 0 0 0 4px rgba(201, 182, 255, 0.4);
}
.result-count { margin: 12px 4px 8px; font-size: 0.88rem; color: var(--ink-soft); font-weight: 600; }

/* ------------------------------------------------------------ gallery */

.grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.card {
  position: relative;
  background: #fff; border-radius: var(--r); box-shadow: var(--shadow);
  border: 3px solid #fff;
  transform: rotate(var(--tilt, 0deg));
  transition: transform 0.25s cubic-bezier(.3, 1.4, .5, 1), box-shadow 0.25s;
  animation: card-in 0.35s ease-out both;
}
.card:hover, .card:focus-within { transform: rotate(0deg) translateY(-4px) scale(1.02); box-shadow: var(--shadow-lift); z-index: 1; }
.card-link { display: block; text-decoration: none; color: inherit; border-radius: inherit; }
.card-img {
  aspect-ratio: 3 / 4; overflow: hidden;
  border-radius: calc(var(--r) - 4px) calc(var(--r) - 4px) 12px 12px;
  background: linear-gradient(160deg, #fff4f9, #f1ebff 60%, #eaf6ff);
}
.card-img img { width: 100%; height: 100%; object-fit: contain; padding: 6px; transition: transform 0.35s; }
.card-img img[src^='data:'] { object-fit: cover; padding: 0; }
.card:hover .card-img img { transform: scale(1.05); }
.card-body { padding: 8px 10px 12px; }
.card-name {
  font-family: var(--font-ui); font-weight: 600; font-size: 0.98rem; line-height: 1.25;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-brand {
  margin: 2px 0 4px; font-size: 0.82rem; color: var(--ink-soft); font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-badge { position: absolute; top: 8px; left: 8px; pointer-events: none; }
.card-edit { position: absolute; top: 6px; right: 6px; width: 38px; height: 38px; font-size: 1rem; }

.skeleton {
  aspect-ratio: 3 / 4.6;
  background: linear-gradient(100deg, #fff 30%, #ffeef6 50%, #fff 70%) 0 0 / 300% 100%;
  animation: shimmer 1.4s linear infinite;
}
.detail-skel { aspect-ratio: auto; height: 60vh; }

.sentinel { display: flex; justify-content: center; padding: 24px 0 8px; }

/* hearts */
.hearts { display: inline-flex; gap: 1px; font-size: 1rem; line-height: 1; }
.hearts.sm { font-size: 0.9rem; }
.hearts.lg { font-size: 1.6rem; gap: 3px; }
.heart { color: #e7d9ef; }
.heart.on { color: var(--hot); text-shadow: 0 1px 0 #d1247a33; }

/* badges */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 999px;
  font-family: var(--font-ui); font-size: 0.75rem; font-weight: 600; color: var(--badge-ink);
  box-shadow: 0 2px 6px rgba(74, 37, 96, 0.12);
}
.badge-have { background: var(--hot); }
.badge-had { background: var(--lav); }
.badge-want { background: var(--baby); }
.badge-testing { background: var(--blush); color: var(--pink-ink); }

/* ------------------------------------------------------------ empty state */

.empty {
  grid-column: 1 / -1;
  text-align: center; padding: 40px 20px;
  background: rgba(255, 255, 255, 0.75); border-radius: var(--r-lg); border: 3px dashed var(--line);
}
.empty-art { width: 130px; margin: 0 auto 10px; animation: bob 3s ease-in-out infinite; }
.empty h3 { font-family: var(--font-script); font-weight: 400; font-size: 1.5rem; color: var(--pink-ink); margin-bottom: 6px; }
.empty p { margin: 0 0 16px; color: var(--ink-soft); }

/* ------------------------------------------------------------ detail */

.back {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px;
  font-family: var(--font-ui); font-weight: 600; text-decoration: none; color: var(--pink-ink);
}
.back:hover { text-decoration: underline; }

.detail-hero { display: grid; gap: 22px; margin: 8px 0 22px; }
.polaroid {
  position: relative; background: #fff; padding: 12px 12px 34px;
  border-radius: 8px; box-shadow: var(--shadow-lift);
}
.detail-img { width: min(78%, 320px); margin: 10px auto 0; transform: rotate(-2.5deg); }
.detail-img img {
  width: 100%; aspect-ratio: 3 / 4; object-fit: contain; border-radius: 4px;
  background: linear-gradient(160deg, #fff4f9, #f1ebff 60%, #eaf6ff);
}
.detail-img img[src^='data:'] { object-fit: cover; }
.tape {
  position: absolute; top: -12px; left: 50%; width: 96px; height: 26px; transform: translateX(-50%) rotate(-4deg);
  background: repeating-linear-gradient(45deg, rgba(255, 179, 212, 0.75) 0 8px, rgba(255, 227, 239, 0.75) 8px 16px);
  border-radius: 3px;
}
.detail-head { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.detail-name { font-family: var(--font-script); font-weight: 400; font-size: clamp(1.8rem, 6vw, 2.6rem); line-height: 1.3; color: var(--ink); }
.detail-brand { margin: -4px 0 0; font-family: var(--font-ui); font-size: 1.1rem; color: var(--ink-soft); }
.move-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.owner-row { display: flex; gap: 10px; flex-wrap: wrap; }
.hint { margin: 0; font-size: 0.88rem; color: var(--ink-soft); }

.detail-grid { display: grid; gap: 14px; }
.panel {
  position: relative; padding: 18px; background: #fff; border-radius: var(--r);
  box-shadow: var(--shadow); border: 2px solid #fff;
}
.panel h3 { font-family: var(--font-ui); font-weight: 600; font-size: 1.1rem; margin-bottom: 10px; color: var(--pink-ink); }
.panel h3 small { font-family: var(--font-body); font-size: 0.8rem; color: var(--ink-soft); font-weight: 600; }
.panel h4 { font-family: var(--font-ui); font-weight: 500; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-soft); margin: 10px 0 6px; }
.muted-panel { background: rgba(255, 255, 255, 0.6); border: 2px dashed var(--line); box-shadow: none; }
.prose {
  margin: 0; white-space: pre-wrap;
  background-image: repeating-linear-gradient(transparent 0 1.55em, #f6e3ee 1.55em calc(1.55em + 1px));
  line-height: 1.55em;
}

.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; list-style: none; }
.chip {
  padding: 4px 12px; border-radius: 999px; font-size: 0.88rem; font-weight: 600;
  background: var(--blush); color: var(--ink);
}
.chips.top .chip, .chips.season .chip { background: #e3f2ff; }
.chips.heart .chip, .chips.accord .chip { background: #ffe3ef; }
.chips.base .chip, .chips.occasion .chip { background: #efe8ff; }
.chips.cloud .chip { font-size: calc(0.85rem * var(--w, 1)); }
.chips.cloud small { color: var(--ink-soft); }
.pyramid .tier h4 { margin-top: 4px; }
.pyramid .tier + .tier { margin-top: 8px; }

.meter + .meter { margin-top: 12px; }
.meter-head { display: flex; justify-content: space-between; font-size: 0.92rem; margin-bottom: 6px; }
.meter-track { display: flex; gap: 4px; }
.meter-track span { flex: 1; height: 10px; border-radius: 999px; background: #f2e8f7; }
.meter-track span.on { background: linear-gradient(90deg, var(--hot), var(--lav)); }

.facts { margin: 0 0 12px; display: grid; gap: 8px; }
.facts div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px dashed var(--line); padding-bottom: 6px; }
.facts dt { color: var(--ink-soft); }
.facts dd { margin: 0; font-weight: 700; text-align: right; }

/* note chips + note page */
.note-chip {
  display: inline-flex; align-items: center; gap: 5px; text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
}
.note-chip:hover { transform: translateY(-2px) scale(1.04); box-shadow: 0 4px 10px rgba(142, 68, 201, 0.18); }
.note-emoji { font-size: 1.05em; }
.note-hero { display: flex; align-items: center; gap: 16px; margin: 8px 0 18px; }
.note-hero-emoji {
  display: grid; place-items: center; flex: none; width: 76px; height: 76px; border-radius: 50%;
  font-size: 2.4rem; background: #fff; box-shadow: var(--shadow); border: 3px solid var(--blush);
  animation: bob 3s ease-in-out infinite;
}
.note-hero .subtitle { margin: 0; }
.note-card { display: flex; flex-direction: column; }
.note-where {
  margin: 6px 0 0; text-align: center; font-size: 0.78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-soft);
}

/* ------------------------------------------------------------ combos */

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head .subtitle { margin: 0; }
.section-title { font-family: var(--font-ui); font-weight: 600; font-size: 1.25rem; color: var(--pink-ink); margin: 6px 0 12px; }

.combo-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.combo-card {
  background: #fff; border-radius: var(--r-lg); border: 3px solid #fff; box-shadow: var(--shadow);
  transition: transform 0.25s cubic-bezier(.3, 1.4, .5, 1), box-shadow 0.25s;
}
.combo-card:hover, .combo-card:focus-within { transform: translateY(-4px) rotate(-0.5deg); box-shadow: var(--shadow-lift); }
.combo-link { display: block; color: inherit; text-decoration: none; border-radius: inherit; }
.combo-body { padding: 12px 16px 16px; }
.combo-name { font-family: var(--font-script); font-weight: 400; font-size: 1.4rem; line-height: 1.35; color: var(--ink); }
.combo-meta { margin: 2px 0 0; font-size: 0.85rem; font-weight: 700; color: var(--pink-ink); }
.combo-desc {
  margin: 6px 0 0; font-size: 0.9rem; color: var(--ink-soft);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.combo-img {
  position: relative; aspect-ratio: 1; overflow: hidden;
  border-radius: calc(var(--r-lg) - 4px) calc(var(--r-lg) - 4px) 14px 14px;
  background: linear-gradient(160deg, #fff4f9, #f1ebff 60%, #eaf6ff);
}
.combo-img > img { width: 100%; height: 100%; object-fit: cover; }
.collage-cell { position: absolute; padding: 2px; }
.collage-cell img {
  width: 100%; height: 100%; object-fit: contain; border-radius: 10px;
  background: rgba(255, 255, 255, 0.7);
}
.collage-cell img[src^='data:'] { object-fit: cover; }
.combo-polaroid { width: min(86%, 380px); margin: 10px auto 0; transform: rotate(-2deg); padding-bottom: 34px; }
.combo-polaroid .combo-img { border-radius: 4px; }
.combo-description { width: 100%; }
.badge-combo { background: var(--lav); }

.combo-mini-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.combo-mini-list a { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; border-radius: var(--r-sm); padding: 4px; }
.combo-mini-list a:hover { background: var(--blush); }
.combo-mini-list span { display: flex; flex-direction: column; }
.combo-mini-list small { color: var(--ink-soft); font-weight: 600; }
.combo-img.mini { width: 64px; flex: none; border-radius: 12px; }
.combo-img.mini .collage-cell { padding: 1px; }
.combo-img.mini .collage-cell img { border-radius: 4px; }

/* combo editor: perfume picker */
.pick-count { margin-left: 6px; padding: 1px 10px; border-radius: 999px; background: var(--blush); color: var(--pink-ink); font-size: 0.82rem; font-weight: 700; }
.picked, .pick-results { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.picked { margin-bottom: 10px; }
.picked-item, .pick-row {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 6px 10px 6px 6px; border-radius: var(--r); background: #fff; border: 2px solid var(--line); text-align: left;
}
.picked-item { border-color: #ffb3d4; background: #fff7fb; }
.pick-row { cursor: pointer; transition: background 0.15s, border-color 0.15s; }
.pick-row:hover:not(:disabled) { background: var(--blush); border-color: #ffb3d4; }
.pick-row:disabled { opacity: 0.5; cursor: not-allowed; }
.picked-thumb { flex: none; width: 42px; height: 56px; border-radius: 10px; overflow: hidden; background: linear-gradient(160deg, #fff4f9, #f1ebff); }
.picked-thumb img { width: 100%; height: 100%; object-fit: contain; }
.picked-thumb img[src^='data:'] { object-fit: cover; }
.picked-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.picked-text strong { font-family: var(--font-ui); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.picked-text small { color: var(--ink-soft); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.picked-actions { display: flex; gap: 4px; }
.mini-btn {
  width: 36px; height: 36px; border-radius: 50%; border: 0; cursor: pointer;
  background: #fff; color: var(--pink-ink); font-weight: 700; box-shadow: 0 2px 6px rgba(142, 68, 201, 0.12);
}
.mini-btn:disabled { opacity: 0.35; cursor: default; }
.pick-plus {
  flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--btn-a), var(--btn-b)); color: #fff; font-weight: 700;
}
.picker-search { display: block; margin-bottom: 8px; }
.picker-search input {
  width: 100%; min-height: 46px; border: 2px solid var(--line); border-radius: 999px; background: #fff; padding: 10px 16px 10px 42px;
}
.pick-results { max-height: 320px; overflow-y: auto; padding: 2px; }
.photo-preview .combo-img { border-radius: 4px; }

/* ------------------------------------------------------------ share dialog */

.share { display: flex; flex-direction: column; height: 100%; }
.share-body { flex: 1; overflow-y: auto; padding: 16px; display: grid; gap: 18px; align-content: start; }
.share-preview {
  position: relative; display: grid; place-items: center; min-height: 240px;
  max-height: 52vh; overflow-y: auto; border-radius: var(--r);
  background: repeating-conic-gradient(#f6eef7 0 25%, #fff 0 50%) 0 0 / 22px 22px;
  border: 2px dashed var(--line);
}
.share-preview img { width: 100%; height: auto; display: block; border-radius: 12px; box-shadow: var(--shadow); }
.share-loading {
  position: absolute; inset: auto 12px 12px auto; margin: 0; padding: 6px 14px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.92); font-family: var(--font-ui); font-weight: 500; color: var(--pink-ink);
  box-shadow: var(--shadow);
}
.share-preview img[hidden] + .share-loading { position: static; }
.share-h { font-family: var(--font-ui); font-weight: 600; font-size: 1.05rem; color: var(--pink-ink); margin-bottom: 8px; }

.palette-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.palette { position: relative; }
.palette-btn {
  width: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; cursor: pointer;
  padding: 10px 12px; border-radius: var(--r-sm); border: 2px solid var(--line); background: #fff; text-align: left;
  transition: border-color 0.15s, transform 0.15s;
}
.palette-btn:hover { transform: translateY(-1px); border-color: var(--lav); }
.palette.active .palette-btn { border-color: var(--btn-a); box-shadow: 0 0 0 3px rgba(209, 36, 122, 0.18); }
.palette-dots { display: flex; }
.palette-dots span { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #fff; margin-right: -6px; box-shadow: 0 1px 3px rgba(74, 37, 96, 0.25); }
.palette-name { font-family: var(--font-ui); font-weight: 500; font-size: 0.9rem; }
.palette-del {
  position: absolute; top: -8px; right: -8px; width: 28px; height: 28px; border-radius: 50%; border: 0; cursor: pointer;
  background: #fff; color: #b0124f; font-weight: 700; box-shadow: var(--shadow);
}

.palette-custom { margin-top: 14px; background: #fff; border-radius: var(--r); border: 2px solid var(--line); padding: 12px 14px; }
.palette-custom summary { cursor: pointer; font-family: var(--font-ui); font-weight: 500; }
.palette-custom[open] summary { margin-bottom: 12px; }
.role-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.role-pill { position: relative; cursor: pointer; }
.role-pill input { position: absolute; opacity: 0; pointer-events: none; }
.role-pill > span {
  display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 4px 12px 4px 6px;
  border-radius: 999px; border: 2px solid var(--line); background: #fff; font-size: 0.85rem; font-weight: 600;
}
.role-pill i { width: 24px; height: 24px; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(74, 37, 96, 0.15); }
.role-pill input:checked + span { border-color: var(--btn-a); background: var(--blush); }
.role-pill input:focus-visible + span { outline: 3px solid var(--btn-b); outline-offset: 2px; }

.color-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.color-swatch { width: 48px; height: 48px; border-radius: 14px; flex: none; box-shadow: inset 0 0 0 2px rgba(74, 37, 96, 0.15); }
.hex-field input {
  width: 7.5em; min-height: 44px; padding: 8px 12px; border-radius: 12px; border: 2px solid var(--line);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 600; text-transform: uppercase;
}
.hex-field input[aria-invalid='true'] { border-color: #b0124f; }
.native-pick input { width: 48px; height: 44px; padding: 0; border: 0; background: none; cursor: pointer; }
.slider-row { display: grid; grid-template-columns: 6.5rem 1fr 3rem; align-items: center; gap: 10px; font-size: 0.88rem; font-weight: 600; min-height: 40px; }
.slider-row output { text-align: right; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.slider { -webkit-appearance: none; appearance: none; width: 100%; height: 14px; border-radius: 999px; outline-offset: 4px; cursor: pointer; }
.slider-h { background: linear-gradient(90deg, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00); }
.slider-s { background: linear-gradient(90deg, var(--sat-from, #888), var(--sat-to, #f0f)); }
.slider-l { background: linear-gradient(90deg, #000, var(--light-mid, #f0f), #fff); }
.slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 28px; height: 28px; border-radius: 50%;
  background: #fff; border: 3px solid var(--ink); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}
.slider::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 3px solid var(--ink); }
.save-palette { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.save-palette .field { flex: 1; }
.save-palette input { min-height: 40px; }

/* ------------------------------------------------------------ stats */

.page-title { font-family: var(--font-script); font-weight: 400; font-size: 2rem; color: var(--pink-ink); }
.subtitle { margin: 0 0 16px; color: var(--ink-soft); font-weight: 600; }
.stat-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 16px; }
.stat-tile {
  display: flex; flex-direction: column; align-items: flex-start;
  padding: 14px 16px; border-radius: var(--r); box-shadow: var(--shadow); border: 3px solid #fff;
}
.stat-tile strong { font-family: var(--font-ui); font-size: 2rem; line-height: 1.1; color: var(--badge-ink); }
.stat-tile span:last-child { font-weight: 600; color: var(--badge-ink); font-size: 0.9rem; }
.stat-icon { font-size: 1.4rem; }
.tile-have { background: linear-gradient(135deg, #ffd0e4, #ffe3ef); }
.tile-had { background: linear-gradient(135deg, #e3d9ff, #f1ebff); }
.tile-want { background: linear-gradient(135deg, #cfe9ff, #eaf6ff); }
.tile-testing { background: linear-gradient(135deg, #fff0f7, #fff); }

.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.bars li { display: grid; grid-template-columns: minmax(0, 9rem) 1fr 2rem; align-items: center; gap: 10px; font-size: 0.9rem; }
.bar-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.bar { height: 14px; border-radius: 999px; background: #f6edf9; overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--hot), var(--lav) 70%, var(--baby)); }
.bar-n { text-align: right; font-weight: 700; color: var(--ink-soft); }
.loved { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; counter-reset: loved; }
.loved li { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px dashed var(--line); padding-bottom: 8px; }
.loved a { text-decoration: none; color: var(--ink); min-width: 0; }
.loved a:hover .loved-name { text-decoration: underline; }
.loved-name { font-weight: 700; }
.loved-brand { display: block; font-size: 0.82rem; color: var(--ink-soft); }

/* ------------------------------------------------------------ dialogs */

.dialog {
  border: 0; padding: 0; color: var(--ink);
  background: var(--cream); box-shadow: var(--shadow-lift);
}
.dialog::backdrop { background: rgba(74, 37, 96, 0.35); backdrop-filter: blur(3px); }
.dialog[open] { animation: pop 0.22s ease-out; }
.dialog-small { width: min(420px, calc(100vw - 32px)); border-radius: var(--r-lg); }
.dialog-editor {
  width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0;
  border-radius: 0;
}

.editor { display: flex; flex-direction: column; height: 100%; }
.editor-head, .editor-foot {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: #fff;
}
.editor-head { border-bottom: 2px dashed var(--line); padding-top: max(12px, env(safe-area-inset-top)); }
.editor-head h2 { font-family: var(--font-script); font-weight: 400; font-size: 1.5rem; color: var(--pink-ink); flex: 1; }
.editor-foot { border-top: 2px dashed var(--line); padding-bottom: max(12px, env(safe-area-inset-bottom)); flex-wrap: wrap; }
.editor-body { flex: 1; overflow-y: auto; padding: 16px; display: grid; gap: 14px; align-content: start; }
.spacer { flex: 1; }

.field { display: grid; gap: 6px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field .label, .field legend { font-family: var(--font-ui); font-weight: 500; font-size: 0.92rem; color: var(--ink); padding: 0; }
.field legend { margin-bottom: 6px; }
.field textarea { border-radius: var(--r); resize: vertical; min-height: 90px; line-height: 1.5; }
.row2, .row3 { display: grid; gap: 14px; }

.photo-field { display: grid; grid-template-columns: 120px 1fr; gap: 14px; align-items: center; }
.photo-preview { padding: 6px 6px 18px; transform: rotate(-3deg); }
.photo-preview img { width: 100%; aspect-ratio: 3 / 4; object-fit: contain; background: #fff4f9; border-radius: 4px; }
.photo-preview img[src^='data:'] { object-fit: cover; }
.photo-actions { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.photo-actions .btn { min-height: 42px; font-size: 0.95rem; }

.seg, .toggle-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.seg-opt, .toggle { position: relative; cursor: pointer; }
.seg-opt input, .toggle input, .heart-picker input { position: absolute; opacity: 0; pointer-events: none; }
.seg-opt > span, .toggle > span {
  display: inline-flex; align-items: center; gap: 4px; min-height: 40px; padding: 6px 14px;
  border-radius: 999px; border: 2px solid var(--line); background: #fff; font-weight: 600; font-size: 0.92rem;
  transition: all 0.18s;
}
.seg-opt input:checked + span, .toggle input:checked + span {
  background: linear-gradient(135deg, var(--btn-a), var(--btn-b)); color: #fff; border-color: transparent;
}
.seg-opt input:focus-visible + span, .toggle input:focus-visible + span, .heart-picker input:focus-visible + span {
  outline: 3px solid var(--btn-b); outline-offset: 2px;
}

.heart-picker { display: flex; gap: 4px; align-items: center; }
.heart-picker label { cursor: pointer; }
.heart-picker label > span[aria-hidden] {
  display: grid; place-items: center; width: 44px; height: 44px; font-size: 1.8rem; color: #e7d9ef;
  transition: transform 0.15s, color 0.15s;
}
.heart-picker .hp-none > span[aria-hidden] { font-size: 1.1rem; color: var(--ink-soft); }
.heart-picker label:hover > span[aria-hidden] { transform: scale(1.15); }
/* Fill every heart up to the checked one. */
.heart-picker:has(input[value='1']:checked) label:nth-child(-n + 2) > span[aria-hidden],
.heart-picker:has(input[value='2']:checked) label:nth-child(-n + 3) > span[aria-hidden],
.heart-picker:has(input[value='3']:checked) label:nth-child(-n + 4) > span[aria-hidden],
.heart-picker:has(input[value='4']:checked) label:nth-child(-n + 5) > span[aria-hidden],
.heart-picker:has(input[value='5']:checked) label:nth-child(-n + 6) > span[aria-hidden] { color: var(--hot); }
.heart-picker .hp-none > span[aria-hidden] { color: var(--ink-soft) !important; }
.heart-picker input[value='0']:checked + span { background: var(--blush); border-radius: 50%; }

.more { background: #fff; border-radius: var(--r); padding: 12px 16px; border: 2px solid var(--line); }
.more summary { cursor: pointer; font-family: var(--font-ui); font-weight: 500; }
.more[open] summary { margin-bottom: 12px; }
.more .field + .field { margin-top: 12px; }
.form-error { margin: 0; color: #b0124f; font-weight: 700; }
.form-error:empty { display: none; }

.confirm, .progress-box { padding: 24px; text-align: center; }
.confirm h2, .progress-box h2 { font-family: var(--font-script); font-weight: 400; font-size: 1.5rem; color: var(--pink-ink); margin-bottom: 8px; }
.confirm p, .progress-box p { margin: 0 0 18px; color: var(--ink-soft); }
.confirm-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.progress { height: 16px; border-radius: 999px; background: #f4e8f3; overflow: hidden; margin-bottom: 12px; }
.progress span {
  display: block; height: 100%; border-radius: inherit; transition: width 0.3s;
  background: linear-gradient(90deg, var(--hot), var(--lav), var(--baby)) 0 0 / 200% 100%;
  animation: shimmer 1.6s linear infinite;
}

/* ------------------------------------------------------------ toast, confetti, footer */

.toast {
  position: fixed; left: 50%; bottom: 90px; z-index: 60;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  max-width: calc(100vw - 32px); padding: 12px 20px; border-radius: 999px;
  background: var(--ink); color: #fff; font-family: var(--font-ui); font-weight: 500;
  box-shadow: var(--shadow-lift); transition: all 0.25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 70; }
.confetti span {
  position: absolute; left: 50%; top: 55%;
  animation: burst 1.5s cubic-bezier(.15, .7, .3, 1) forwards;
}

.site-footer { text-align: center; padding: 36px 16px 110px; color: var(--ink-soft); font-size: 0.92rem; }
.site-footer p { margin: 4px 0; }
.footer-small { font-size: 0.82rem; }
.noscript { text-align: center; padding: 40px; }

/* ------------------------------------------------------------ animations */

@keyframes pop { from { opacity: 0; transform: scale(0.94) translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes card-in { from { opacity: 0; translate: 0 10px; } to { opacity: 1; translate: 0 0; } }
@keyframes shimmer { to { background-position: -300% 0; } }
@keyframes twinkle { 0%, 100% { opacity: 0.3; transform: scale(0.8) rotate(0); } 50% { opacity: 1; transform: scale(1.2) rotate(20deg); } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes spin-slow { to { rotate: 360deg; } }
@keyframes burst {
  0% { transform: translate(-50%, -50%) scale(0.4); opacity: 1; }
  80% { opacity: 1; }
  100% { transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y) + 160px)) rotate(var(--r)) scale(1); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .card { transform: none; }
}

/* ------------------------------------------------------------ larger screens */

@media (min-width: 560px) {
  .toolbar { grid-template-columns: 1fr 200px 170px; }
  .search { grid-column: auto; }
  .grid { gap: 18px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  .stat-tiles { grid-template-columns: repeat(4, 1fr); }
  .row2 { grid-template-columns: 1fr 1fr; }
  .row3 { grid-template-columns: 1fr 1fr 1fr; }
  .potd { padding: 18px 22px; }
  .potd-img { width: 110px; }
  .potd-name { font-size: 1.7rem; }
  .photo-field { grid-template-columns: 160px 1fr; }
  .photo-actions { flex-direction: row; flex-wrap: wrap; align-items: center; }
}

@media (min-width: 800px) {
  .site-header { padding-left: 28px; padding-right: 28px; }
  .logo-title { font-size: 1.5rem; }
  main { padding: 24px 28px; }
  .tabs { margin: 0; padding: 4px 0 12px; flex-wrap: wrap; overflow: visible; }
  .detail-hero { grid-template-columns: 360px 1fr; align-items: center; gap: 36px; }
  .detail-img { width: 100%; }
  .detail-grid { grid-template-columns: 1fr 1fr; align-items: start; }
  .dialog-editor {
    width: min(760px, calc(100vw - 48px)); height: auto; max-height: calc(100dvh - 48px);
    margin: auto; border-radius: var(--r-lg); overflow: hidden;
  }
  .editor { max-height: calc(100dvh - 48px); }
  .fab { bottom: 28px; right: 28px; }
}

@media (max-width: 560px) {
  .site-header { flex-wrap: wrap; row-gap: 6px; }
  .auth-area { margin-left: auto; }
  .nav { order: 3; width: 100%; margin-left: 0; justify-content: center; }
}

@media (min-width: 800px) {
  .share-body { grid-template-columns: minmax(0, 1fr) 380px; align-items: start; }
  .share-preview { max-height: calc(100dvh - 200px); }
  .dialog-share { width: min(1100px, calc(100vw - 48px)); }
}

@media (max-width: 420px) {
  .logo-tag { display: none; }
  .logo-title { font-size: 1.05rem; }
  .logo-mark { width: 36px; height: 36px; font-size: 20px; }
  .nav a { padding: 8px 9px; font-size: 0.9rem; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
}
