:root {
  --bg: #f8f4f6;
  --surface: #fffafc;
  --surface-2: #f4fffb;
  --mint: #bfe9dc;
  --mint-dark: #7cb5a5;
  --pink: #efc6d5;
  --pink-dark: #b67a90;
  --lavender: #ddd4f3;
  --text: #242424;
  --text-soft: #55585e;
  --line: rgba(36, 36, 36, 0.08);
  --shadow: 0 18px 40px rgba(80, 58, 68, 0.09);
  --radius: 24px;
  --topbar-h: 76px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(239,198,213,.55), transparent 34%),
    radial-gradient(circle at top right, rgba(191,233,220,.6), transparent 30%),
    linear-gradient(180deg, #fffdfd 0%, var(--bg) 100%);
}

a { color: inherit; text-decoration: none; }

.quote-author,
.quote-category {
  text-decoration: none;
}

.quote-author:hover,
.quote-author:focus-visible,
.quote-category:hover,
.quote-category:focus-visible {
  text-decoration: none;
}

button, input { font: inherit; }
button { cursor: pointer; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

.page-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  min-height: var(--topbar-h);
  backdrop-filter: blur(16px);
  background: rgba(255, 250, 252, 0.84);
  border-bottom: 1px solid rgba(36, 36, 36, 0.06);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.logo-mark {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--pink), var(--mint));
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.logo-mark .q {
  position: absolute;
  font-family: "Playfair Display", serif;
  font-size: 2.2rem;
  line-height: 1;
  color: rgba(36, 36, 36, 0.82);
}
.logo-mark .q-left { left: 7px; top: 4px; }
.logo-mark .q-right { right: 7px; bottom: -2px; }

.searchbar { min-width: 0; }
.search-input-wrap { position: relative; }
#searchInput {
  width: 100%;
  height: 48px;
  padding: 0 52px 0 16px;
  border-radius: 999px;
  border: 1px solid rgba(36, 36, 36, 0.08);
  background: rgba(255,255,255,0.92);
  color: var(--text);
  outline: none;
  box-shadow: 0 6px 20px rgba(0,0,0,0.04);
}
#searchInput:focus {
  border-color: var(--mint-dark);
  box-shadow: 0 0 0 4px rgba(124,181,165,0.14);
}
.search-btn {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  background: var(--mint);
  display: grid;
  place-items: center;
}
.search-btn svg {
  width: 20px;
  height: 20px;
  fill: var(--text);
}

.topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.favorites-toggle,
.menu-toggle {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  border: 0;
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
}

.favorites-toggle {
  background: rgba(255,255,255,0.92);
}

.favorites-toggle svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--pink-dark);
  stroke-width: 2;
}

.favorites-toggle.is-active,
.favorites-toggle:hover {
  background: rgba(239,198,213,0.45);
}

.favorites-count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--mint-dark);
  color: white;
  font-size: 0.72rem;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.menu-toggle {
  background: var(--pink);
  gap: 4px;
  padding: 12px;
}
.menu-toggle span:not(.sr-only) {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

.suggestions {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  border-radius: 18px;
  background: rgba(255,255,255,0.97);
  border: 1px solid rgba(36,36,36,0.08);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.suggestion-item {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(36,36,36,0.06);
}
.suggestion-item:last-child { border-bottom: 0; }
.suggestion-item:hover,
.suggestion-item:focus-visible { background: var(--surface-2); }
.suggestion-type {
  display: inline-block;
  margin-bottom: 4px;
  font-size: 0.75rem;
  color: var(--pink-dark);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.suggestion-title {
  display: block;
  color: var(--text);
  font-weight: 600;
}
.suggestion-sub {
  display: block;
  margin-top: 2px;
  color: var(--text-soft);
  font-size: 0.92rem;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 60;
  width: min(90vw, 380px);
  height: 100vh;
  background: rgba(255,250,252,0.98);
  backdrop-filter: blur(20px);
  box-shadow: -18px 0 40px rgba(0,0,0,0.12);
  padding: 18px;
  transform: translateX(102%);
  transition: transform .25s ease;
  display: flex;
  flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(36,36,36,0.28);
}
.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.drawer-header h2 {
  margin: 0;
  font-size: 1.1rem;
}
.drawer-close {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 0;
  background: var(--surface);
  font-size: 1.8rem;
  line-height: 1;
}
.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 6px;
  background: rgba(191,233,220,0.35);
  border-radius: 18px;
}
.tab-btn {
  border: 0;
  background: transparent;
  border-radius: 14px;
  padding: 10px 12px;
  font-weight: 600;
  color: var(--text-soft);
}
.tab-btn.active {
  background: white;
  color: var(--text);
  box-shadow: 0 6px 18px rgba(0,0,0,0.06);
}
.tab-panel { display: none; margin-top: 14px; overflow: auto; }
.tab-panel.active { display: block; }
.link-list {
  display: grid;
  gap: 8px;
  padding-bottom: 32px;
}
.menu-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.82);
  border: 1px solid rgba(36,36,36,0.05);
}
.menu-link:hover { background: var(--surface-2); }
.count-badge {
  flex: none;
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(239,198,213,0.35);
  color: var(--text-soft);
  font-size: 0.84rem;
}

.content {
  width: min(100%, 900px);
  margin: 0 auto;
  padding: 18px 16px 64px;
}
.hero-card {
  padding: 22px;
  margin: 10px 0 18px;
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(255,250,252,.92), rgba(244,255,251,.96));
  box-shadow: var(--shadow);
  border: 1px solid rgba(36,36,36,0.05);
}
.eyebrow {
  margin: 0 0 8px;
  font-size: .82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--pink-dark);
}
.hero-card h1 {
  margin: 0;
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}
.subtitle {
  margin: 10px 0 0;
  color: var(--text-soft);
  line-height: 1.6;
}
.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(191,233,220,0.45);
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 600;
}

.quotes-grid {
  display: grid;
  gap: 16px;
}
.quote-card {
  position: relative;
  overflow: hidden;
  padding: 24px 20px 18px;
  border-radius: var(--radius);
  background: rgba(255,255,255,0.88);
  border: 1px solid rgba(36,36,36,0.05);
  box-shadow: var(--shadow);
}
.quote-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(191,233,220,0.2), rgba(239,198,213,0.16));
  pointer-events: none;
}
.favorite-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,0.9);
  display: grid;
  place-items: center;
  box-shadow: 0 8px 20px rgba(0,0,0,0.07);
}
.favorite-btn svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--pink-dark);
  stroke-width: 2;
  transition: transform .18s ease, fill .18s ease, stroke .18s ease;
}
.favorite-btn:hover svg,
.favorite-btn:focus-visible svg {
  transform: scale(1.06);
}
.favorite-btn.is-active svg {
  fill: var(--pink-dark);
  stroke: var(--pink-dark);
}
.quote-mark {
  position: absolute;
  top: 10px;
  left: 14px;
  font-family: "Playfair Display", serif;
  font-size: 4rem;
  line-height: 1;
  color: rgba(182,122,144,0.25);
}
.quote-text {
  position: relative;
  z-index: 1;
  margin: 8px 42px 18px 0;
  padding-left: 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-size: clamp(1.18rem, 3vw, 1.5rem);
  line-height: 1.72;
  letter-spacing: 0.01em;
  color: #1e1f22;
}
.quote-footer {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
}
.quote-author {
  display: inline-block;
  margin: 0;
  font-weight: 700;
  font-size: 1rem;
}
.quote-meta {
  margin: 6px 0 0;
  color: var(--text-soft);
  font-size: 0.92rem;
}
.quote-category {
  flex: none;
  max-width: 45%;
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(221,212,243,0.45);
  color: var(--text-soft);
  font-size: .86rem;
  text-align: right;
}

.load-more-wrap {
  display: flex;
  justify-content: center;
  padding-top: 20px;
}
.load-more-btn {
  border: 0;
  padding: 15px 20px;
  border-radius: 999px;
  background: var(--mint);
  color: var(--text);
  font-weight: 700;
  box-shadow: var(--shadow);
}
.load-more-btn:hover { filter: brightness(1.02); }
.load-more-btn[hidden],
.load-more-wrap[hidden] { display: none !important; }

.empty-state {
  margin-top: 18px;
  padding: 24px;
  border-radius: 24px;
  background: rgba(255,255,255,0.85);
  text-align: center;
  box-shadow: var(--shadow);
}
.empty-state h2 { margin-top: 0; }
.empty-state p { color: var(--text-soft); margin-bottom: 0; }

@media (min-width: 768px) {
  .topbar {
    padding-inline: 24px;
  }
  .content {
    padding-inline: 24px;
  }
  .quotes-grid {
    gap: 20px;
  }
  .quote-card {
    padding: 28px 26px 22px;
  }
}
