:root {
  --bg: #fbe8f5;
  --ink: #ab5f8d;
  --muted: #b57e9f;
  --panel: rgba(255, 249, 253, 0.62);
  --line: rgba(239, 190, 221, 0.9);
  --accent: #f3a0c8;
  --accent-2: #e388b7;
  --accent-soft: rgba(255, 246, 252, 0.88);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Quicksand', sans-serif;
  background: radial-gradient(circle at 10% 22%, #ffd3eb 0%, transparent 37%),
    radial-gradient(circle at 90% 10%, #ffe0f1 0%, transparent 34%),
    radial-gradient(circle at 58% 88%, #f8d8eb 0%, transparent 37%),
    linear-gradient(180deg, #fae6f3 0%, #f7ddec 100%);
  color: var(--ink);
  overflow-x: hidden;
  position: relative;
}

body::before,
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
}

body::before {
  opacity: 0.78;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.9) 0 1.6px, transparent 2.5px) 0 0 / 170px 170px,
    radial-gradient(circle, rgba(255, 255, 255, 0.72) 0 1.1px, transparent 2px) 48px 68px / 220px 220px,
    radial-gradient(circle, rgba(255, 255, 255, 0.85) 0 1.7px, transparent 2.7px) 110px 16px / 240px 240px;
  animation: twinkle 7s ease-in-out infinite alternate;
}

body::after {
  z-index: -3;
  background: radial-gradient(circle at 22% 30%, rgba(255, 255, 255, 0.55) 0%, transparent 42%),
    radial-gradient(circle at 77% 60%, rgba(255, 255, 255, 0.38) 0%, transparent 44%);
}

.bg-glow {
  position: fixed;
  border-radius: 999px;
  filter: blur(60px);
  z-index: -1;
  opacity: 0.42;
}

.bg-glow-a {
  width: 520px;
  height: 520px;
  background: #ffb9dc;
  top: -140px;
  left: -120px;
}

.bg-glow-b {
  width: 560px;
  height: 560px;
  background: #ffd0e7;
  right: -150px;
  top: 34%;
}

.layout {
  width: min(1380px, 92vw);
  margin: 76px auto 64px;
  animation: reveal 550ms ease;
}

.top-tools {
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 20;
  display: flex;
  gap: 10px;
}

.tool-icon {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  border: 1px solid rgba(234, 173, 208, 0.94);
  background: rgba(255, 249, 253, 0.94);
  color: #b15789;
  font-size: 1.25rem;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(204, 125, 173, 0.26);
}

.tool-icon.active {
  background: linear-gradient(120deg, #f4acd0, #ea81ba);
  color: #fff;
}

.saved-badge {
  position: absolute;
  top: -4px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #d94d97;
  color: #fff;
  font-size: 0.66rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.panel-scrim {
  position: fixed;
  inset: 0;
  background: rgba(120, 52, 88, 0.26);
  backdrop-filter: blur(2px);
  z-index: 17;
}

.app-toast {
  position: fixed;
  top: 18px;
  right: 18px;
  max-width: min(420px, calc(100vw - 36px));
  z-index: 30;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 249, 253, 0.98);
  border: 1px solid rgba(236, 184, 214, 0.92);
  color: #9d4d7f;
  box-shadow: 0 10px 28px rgba(152, 64, 110, 0.2);
  font-size: 0.92rem;
  font-weight: 700;
}

.app-toast.success {
  border-color: rgba(150, 208, 171, 0.95);
  color: #3f8b5a;
}

.app-toast.error {
  border-color: rgba(242, 170, 188, 0.95);
  color: #b3416d;
}

.hero {
  text-align: center;
}

.hero h1 {
  margin: 0;
  font-size: clamp(3.4rem, 9vw, 7.3rem);
  line-height: 0.95;
  font-family: 'Cormorant Garamond', serif;
  letter-spacing: 0.01em;
  color: #bf6f9e;
}

.eyebrow {
  text-transform: uppercase;
  font-size: 0.82rem;
  letter-spacing: 0.19em;
  color: #e19cc4;
  margin: 0 0 16px;
  font-weight: 700;
}

.version-stamp {
  margin: 0 0 14px;
  color: #bc7fa0;
  font-size: 0.84rem;
  letter-spacing: 0.04em;
}

.lead {
  display: none;
}

.panel {
  margin-top: 22px;
  backdrop-filter: blur(10px);
  background: rgba(255, 250, 253, 0.78);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 14px;
  box-shadow: 0 16px 42px rgba(227, 150, 193, 0.18);
}

.search-panel {
  margin-top: 34px;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 48px;
  padding: clamp(22px, 4vw, 52px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45), 0 22px 44px rgba(202, 138, 176, 0.2);
}

label,
.meta-head p,
.helper {
  color: #a86e91;
  font-size: 0.96rem;
}

label {
  display: block;
  font-family: 'Quicksand', sans-serif;
  font-size: clamp(1.2rem, 2.15vw, 2rem);
  font-weight: 500;
  letter-spacing: 0.01em;
}

.search-row {
  display: grid;
  grid-template-columns: 1fr minmax(180px, 240px);
  gap: 14px;
  margin-top: 16px;
}

.search-row input {
  width: 100%;
  border: 4px solid #f2d7e9;
  border-radius: 999px;
  padding: 18px 28px;
  font: inherit;
  background: rgba(255, 255, 255, 0.82);
  color: #835f76;
  font-size: clamp(1.15rem, 2.1vw, 1.35rem);
  font-family: 'Quicksand', 'Segoe UI', sans-serif;
  font-weight: 700;
}

.search-row input::placeholder {
  color: #9a7891;
  opacity: 1;
}

.search-row input:focus {
  outline: 2px solid #f2b8d9;
  outline-offset: 1px;
}

.search-row button {
  border: 0;
  border-radius: 999px;
  min-height: 64px;
  padding: 0 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  line-height: 1.1;
  letter-spacing: 0.01em;
  font-family: 'Quicksand', 'Segoe UI', sans-serif;
  font-size: clamp(1.05rem, 1.5vw, 1.35rem);
  font-weight: 700;
  color: #fff;
  background: linear-gradient(120deg, var(--accent) 0%, #f09dcb 42%, var(--accent-2) 100%);
  cursor: pointer;
  box-shadow: inset 0 -2px 0 rgba(255, 255, 255, 0.4), 0 8px 18px rgba(226, 124, 178, 0.3);
}

.search-row button:disabled {
  opacity: 0.75;
  cursor: default;
}

.helper {
  margin-top: 16px;
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.1rem, 1.8vw, 2rem);
}

.auth-panel {
  margin-top: 14px;
  padding: 16px;
}

.side-panel {
  position: fixed;
  top: 74px;
  left: 18px;
  width: min(390px, calc(100vw - 36px));
  max-height: calc(100vh - 98px);
  overflow-y: auto;
  z-index: 18;
  margin-top: 0;
  border-radius: 20px;
  background: rgba(255, 249, 253, 0.96);
  border: 1px solid rgba(242, 190, 222, 0.95);
  box-shadow: 0 24px 46px rgba(147, 63, 108, 0.25);
}

.auth-dropdown {
  top: 74px;
  left: 18px;
  width: min(320px, calc(100vw - 36px));
  max-height: none;
  overflow: visible;
  padding: 14px;
  animation: drop-in 170ms ease;
}

.auth-dropdown::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 20px;
  width: 18px;
  height: 18px;
  background: rgba(255, 249, 253, 0.96);
  border-left: 1px solid rgba(242, 190, 222, 0.95);
  border-top: 1px solid rgba(242, 190, 222, 0.95);
  transform: rotate(45deg);
}

.auth-dropdown .meta-head {
  justify-content: flex-start;
}

.auth-dropdown .meta-head h2 {
  font-size: 1rem;
}

.auth-dropdown #authStatus {
  margin: 8px 0 10px;
  color: #9f6a88;
  font-size: 0.9rem;
}

.auth-dropdown .auth-row {
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 0;
}

.auth-dropdown .auth-actions {
  margin-top: 12px;
  gap: 7px;
}

.auth-dropdown .secondary-btn {
  flex: 1 1 auto;
}

.panel-close {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(216, 156, 194, 0.92);
  background: #fff;
  color: #ad4f84;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.saved-panel #savedCount {
  margin: 10px 0 8px;
  color: #9e6285;
}

.auth-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.auth-row input {
  width: 100%;
  border: 1px solid rgba(224, 175, 205, 0.9);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  font-size: 1.02rem;
  font-family: 'Quicksand', 'Segoe UI', sans-serif;
  background: rgba(255, 255, 255, 0.95);
  color: #7f5f75;
}

.auth-row input:focus {
  outline: 2px solid #edbdd9;
  outline-offset: 1px;
}

.auth-actions {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.secondary-btn {
  border: 1px solid rgba(224, 170, 202, 0.8);
  background: rgba(255, 255, 255, 0.9);
  color: #a35687;
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.secondary-btn:disabled {
  opacity: 0.65;
  cursor: default;
}

.meta-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.meta-head h2 {
  margin: 0;
  font-size: 1rem;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.chip {
  background: var(--accent-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 11px;
  font-size: 0.86rem;
}

.results {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(246px, 1fr));
  gap: 16px;
}

.more-actions {
  margin-top: 20px;
  display: flex;
  justify-content: center;
}

.more-actions[hidden] {
  display: none !important;
}

.load-more {
  min-width: 200px;
  padding: 12px 20px;
  border-radius: 999px;
  font-family: 'Quicksand', sans-serif;
  font-size: 1rem;
  background: linear-gradient(120deg, #f0a4cc, #e683b6);
}

.idea-card {
  background: rgba(255, 250, 253, 0.92);
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: pop 400ms ease both;
  box-shadow: 0 10px 26px rgba(194, 84, 146, 0.12);
}

.sponsored-card {
  border-color: rgba(231, 173, 108, 0.95);
  box-shadow: 0 12px 28px rgba(191, 126, 58, 0.18);
}

.image-wrap {
  aspect-ratio: 4 / 5;
  background: #f8d7ea;
}

.idea-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.idea-content {
  padding: 12px;
}

.brand {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #b14682;
  font-weight: 700;
}

.sponsored-tag {
  margin: 0 0 6px;
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 234, 200, 0.9);
  color: #a4681a;
  border: 1px solid rgba(237, 183, 107, 0.9);
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  font-weight: 700;
  text-transform: uppercase;
}

.title {
  margin: 7px 0;
  font-size: 1rem;
}

.price {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.save-btn {
  border: 1px solid rgba(224, 160, 196, 0.9);
  background: #fff7fc;
  color: #a64c80;
  border-radius: 999px;
  padding: 7px 12px;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
}

.save-btn:disabled {
  opacity: 0.7;
  cursor: default;
}

a {
  color: #b03c7b;
}

.primary-link {
  display: inline-block;
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 999px;
  color: #fff;
  text-decoration: none;
  background: linear-gradient(120deg, var(--accent-2), #ef60a7);
  font-weight: 700;
}

.empty {
  grid-column: 1 / -1;
  border: 1px dashed var(--line);
  border-radius: 16px;
  padding: 30px;
  text-align: center;
  color: var(--muted);
  background: #fff9fd;
}

.saved-panel {
  margin-top: 0;
}

.saved-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}

.saved-card {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(230, 180, 210, 0.9);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
}

.saved-image {
  width: 78px;
  height: 98px;
  object-fit: cover;
  border-radius: 10px;
}

.saved-content {
  min-width: 0;
}

.saved-title {
  display: block;
  font-weight: 700;
  color: #9f4e7d;
  text-decoration: none;
  line-height: 1.2;
}

.saved-meta {
  margin: 6px 0 8px;
  color: #8d6880;
  font-size: 0.86rem;
}

.saved-actions {
  display: flex;
  gap: 8px;
}

.saved-open {
  display: inline-block;
  border-radius: 999px;
  padding: 6px 10px;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(120deg, #eb90c0, #df6fb0);
  font-size: 0.84rem;
  font-weight: 700;
}

.saved-remove {
  border: 1px solid rgba(216, 149, 186, 0.9);
  background: #fff;
  color: #a85385;
  border-radius: 999px;
  padding: 6px 10px;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
}

.site-footer {
  margin: 26px 0 14px;
  text-align: center;
  font-size: 0.78rem;
  color: #a87393;
  letter-spacing: 0.02em;
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

@keyframes twinkle {
  from {
    opacity: 0.6;
  }
  to {
    opacity: 0.95;
  }
}

@media (max-width: 760px) {
  .layout {
    margin-top: 30px;
  }

  .top-tools {
    top: 10px;
    left: 10px;
  }

  .app-toast {
    top: 10px;
    right: 10px;
    max-width: calc(100vw - 20px);
  }

  .tool-icon {
    width: 44px;
    height: 44px;
  }

  .side-panel {
    top: 64px;
    left: 10px;
    width: calc(100vw - 20px);
    max-height: calc(100vh - 78px);
  }

  .auth-dropdown {
    top: 64px;
    left: 10px;
    width: min(320px, calc(100vw - 20px));
  }

  .search-row {
    grid-template-columns: 1fr;
  }

  .search-row button {
    width: 100%;
    min-height: 58px;
    font-size: 1.2rem;
  }

  .auth-row {
    grid-template-columns: 1fr;
  }

  .meta-head {
    flex-direction: column;
    align-items: flex-start;
  }
}
