/* ==========================================================================
   Papilles — design system
   Warm cream canvas, gold accents, editorial serif, soft glassmorphism.
   Plain CSS on purpose: Tailwind runs from the Play CDN and cannot @apply here.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
  /* Surfaces — kept close to paper white: the photographic background already
     brings the warmth, so the canvas itself must stay light and barely tinted. */
  --cream-50: #fffefd;
  --cream-100: #fdfcfb;
  --cream-200: #f7f1ea;
  --cream-300: #ece3d9;

  /* Brand gold — same ramp as the Tailwind `yellow`/`amber` overrides */
  --gold-100: #fdefd3;
  --gold-200: #fadda6;
  --gold-300: #f5c46f;
  --gold-400: #efab43;
  --gold-500: #e39421;
  --gold-600: #c4761a;

  /* Warm ink */
  --ink-900: #2c251e;
  --ink-700: #5b4e40;
  --ink-500: #94836f;
  --ink-400: #b9a897;

  /* Warm shadows — never neutral grey, it flattens the cream */
  --shadow-xs: 0 1px 2px rgba(92, 63, 34, 0.05);
  --shadow-sm: 0 2px 10px -2px rgba(92, 63, 34, 0.08);
  --shadow-md: 0 8px 24px -8px rgba(92, 63, 34, 0.16), 0 2px 6px rgba(92, 63, 34, 0.04);
  --shadow-lg: 0 22px 48px -16px rgba(92, 63, 34, 0.24), 0 6px 14px rgba(92, 63, 34, 0.06);
  --shadow-glass: 0 10px 36px -10px rgba(92, 63, 34, 0.18);

  --radius-card: 22px;
  --radius-pill: 999px;

  --header-h: 84px;
  --bottom-nav-h: 68px;

  --ease-out: cubic-bezier(0.22, 0.9, 0.3, 1);
}

/* --------------------------------------------------------------------------
   2. Page canvas + layered background
   The photo lives in a `position: fixed` layer rather than on `body`, so the
   composition is locked to the viewport: identical on a 400px page and on a
   6000px one, no repeat, no stretch, and no iOS `background-attachment` jank.
   -------------------------------------------------------------------------- */
html {
  background-color: var(--cream-100);
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: transparent;
  color: var(--ink-900);
  font-feature-settings: "kern", "liga", "calt";
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

.app-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
  /* Near-white canvas. The amber pools that used to live here were stacking on
     top of the photograph and tinting the whole interface yellow; the depth now
     comes from the picture itself, so this layer only lifts the centre. */
  background:
    radial-gradient(115% 80% at 50% 8%, rgba(255, 255, 255, 0.85) 0%, rgba(255, 255, 255, 0) 62%),
    var(--cream-100);
}

/* The photographic flat-lay. Masked so the middle stays clean for content. */
.app-bg__photo {
  position: absolute;
  inset: 0;
  background-image: var(--bg-photo-mobile);
  background-repeat: no-repeat;
  background-position: left top;
  background-size: 118% auto;
  /* The photo keeps its own colours — no desaturation at all, just a hair of
     brightness — so the salmon, the dill and the linen read as a photograph.
     It is the *mask* that keeps the page clean, not a wash over everything. */
  opacity: 0.85;
  filter: brightness(1.02);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, 0.5) 34%, transparent 58%);
  mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, 0.5) 34%, transparent 58%);
}

@media (min-width: 768px) {
  .app-bg__photo {
    background-image: var(--bg-photo-desktop);
    background-position: center center;
    background-size: cover;
    opacity: 1;
    /* The subjects of the flat-lay all sit near the edges, so the mask clears a
       white well in the middle for the content and lets the borders through
       untouched — full photograph outside the reading column. */
    -webkit-mask-image: radial-gradient(
      98% 88% at 50% 46%,
      transparent 30%,
      rgba(0, 0, 0, 0.55) 55%,
      rgba(0, 0, 0, 0.95) 74%,
      #000 86%
    );
    mask-image: radial-gradient(
      98% 88% at 50% 46%,
      transparent 30%,
      rgba(0, 0, 0, 0.55) 55%,
      rgba(0, 0, 0, 0.95) 74%,
      #000 86%
    );
  }

}

/* Very fine paper grain — kills gradient banding and makes flat cream feel
   printed rather than digital. ~1KB inline, no network request. */
.app-bg__grain {
  position: absolute;
  inset: 0;
  /* `multiply` darkens whatever it covers, so it stays light — at 0.22 it was
     visibly dulling the page on top of everything else. */
  opacity: 0.11;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.16'/%3E%3C/svg%3E");
}

/* --------------------------------------------------------------------------
   3. Typography
   -------------------------------------------------------------------------- */
.font-display,
.u-display {
  font-family: Lora, "Iowan Old Style", Georgia, serif;
  letter-spacing: -0.015em;
}

/* Text sitting directly on a photograph: a soft shadow keeps it readable
   whatever the picture underneath. */
.on-photo {
  text-shadow: 0 1px 2px rgba(20, 12, 4, 0.35), 0 6px 24px rgba(20, 12, 4, 0.35);
}

.u-script {
  font-family: "Caveat", "Segoe Script", cursive;
  font-weight: 700;
  letter-spacing: 0;
}

/* Hero title: serif + a gold handwritten accent underlined with an SVG swash. */
.hero-title {
  font-family: Lora, Georgia, serif;
  font-weight: 600;
  color: var(--ink-900);
  line-height: 1.08;
  letter-spacing: -0.015em;
}

.hero-accent {
  font-family: "Caveat", cursive;
  font-weight: 700;
  color: var(--gold-500);
  position: relative;
  display: inline-block;
  padding: 0 0.1em;
  /* Caveat has a small x-height next to Lora, so it needs to run visibly
     larger — and a touch of tilt — before it reads as handwriting. */
  font-size: 1.42em;
  line-height: 0.82;
  rotate: -2.5deg;
  transform-origin: 50% 80%;
}

.hero-accent::after {
  content: "";
  position: absolute;
  left: 4%;
  right: 2%;
  bottom: -0.06em;
  height: 0.16em;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 14' preserveAspectRatio='none'%3E%3Cpath d='M3 9.5C38 3.5 92 2 128 4.5c22 1.6 46 3.6 69 6' stroke='%23e39421' stroke-width='3.2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 100% 100%;
  /* Draws itself in on load. */
  transform-origin: left center;
  animation: swash 0.9s var(--ease-out) 0.35s both;
}

/* Little hand-drawn heart doodle that floats next to hero accents. Stroked
   like a pen sketch — uneven, slightly open, never a geometric icon. */
.hand-heart {
  color: var(--gold-500);
  /* `rotate` (not `transform`) so the float-soft animation can still
     animate `transform` without clobbering the tilt. */
  rotate: 14deg;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@keyframes swash {
  from {
    transform: scaleX(0);
    opacity: 0;
  }
  to {
    transform: scaleX(1);
    opacity: 1;
  }
}

/* --------------------------------------------------------------------------
   4. Glass + surfaces
   -------------------------------------------------------------------------- */
.glass {
  background: rgba(255, 253, 249, 0.72);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow-glass);
}

.glass-strong {
  background: rgba(255, 253, 249, 0.9);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  backdrop-filter: blur(28px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow-lg);
}

/* Content surface — near-opaque so text always wins over the photo. */
.surface {
  background: rgba(255, 253, 249, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: var(--shadow-md);
  border-radius: var(--radius-card);
}

/* On a phone there is no room to spare: the "sheet of paper" framing costs
   width without adding anything, so the surface goes edge to edge instead. */
@media (max-width: 767px) {
  .surface--bleed {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    border-top: 0;
    box-shadow: none;
    background: rgba(255, 253, 249, 0.97);
  }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass,
  .glass-strong {
    background: rgba(255, 253, 249, 0.96);
  }
}

/* --------------------------------------------------------------------------
   5. Navigation
   -------------------------------------------------------------------------- */
/* Deliberately more transparent than `.glass`: the header should let the
   background photography show through and rely on blur, not opacity. */
.nav-pill {
  border-radius: var(--radius-pill);
  background: rgba(255, 253, 250, 0.5);
  -webkit-backdrop-filter: blur(26px) saturate(180%);
  backdrop-filter: blur(26px) saturate(180%);
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 8px 30px -14px rgba(92, 63, 34, 0.22);
  transition: box-shadow 0.35s var(--ease-out), background-color 0.35s var(--ease-out),
    transform 0.35s var(--ease-out);
}

.nav-pill.is-scrolled {
  background: rgba(255, 253, 250, 0.66);
  box-shadow: 0 14px 40px -16px rgba(92, 63, 34, 0.28);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .nav-pill,
  .nav-pill.is-scrolled {
    background: rgba(255, 253, 249, 0.95);
  }
}

.nav-link {
  position: relative;
  color: var(--ink-700);
  transition: color 0.25s var(--ease-out);
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 50%;
  right: 50%;
  bottom: -7px;
  height: 2px;
  border-radius: 2px;
  background: var(--gold-500);
  transition: left 0.3s var(--ease-out), right 0.3s var(--ease-out);
}

.nav-link:hover {
  color: var(--gold-600);
}

.nav-link:hover::after,
.nav-link.is-active::after {
  left: 0;
  right: 0;
}

.nav-link.is-active {
  color: var(--gold-500);
}

/* Mobile bottom tab bar */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(255, 252, 247, 0.82);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  backdrop-filter: blur(24px) saturate(160%);
  border-top: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow: 0 -8px 30px -12px rgba(92, 63, 34, 0.2);
}

.bottom-nav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex: 1 1 0;
  min-width: 0;
  height: var(--bottom-nav-h);
  color: var(--ink-500);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: color 0.2s var(--ease-out), transform 0.2s var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}

.bottom-nav__item span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bottom-nav__item:active {
  transform: scale(0.94);
}

.bottom-nav__item.is-active {
  color: var(--gold-600);
}

.bottom-nav__item.is-active .bottom-nav__icon {
  background: var(--gold-100);
  color: var(--gold-600);
}

.bottom-nav__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 26px;
  border-radius: var(--radius-pill);
  transition: background-color 0.25s var(--ease-out), color 0.25s var(--ease-out);
}

/* Raised “create” action in the middle of the tab bar */
.bottom-nav__fab {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin-top: -20px;
  border-radius: var(--radius-pill);
  color: #fff;
  background: linear-gradient(145deg, var(--gold-400), var(--gold-600));
  box-shadow: 0 10px 22px -8px rgba(196, 118, 26, 0.75), 0 0 0 5px rgba(255, 252, 247, 0.9);
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out);
}

.bottom-nav__fab:active {
  transform: scale(0.92);
}

@media (min-width: 768px) {
  .bottom-nav {
    display: none;
  }
}

/* Reserve room for the bar so nothing hides behind it. */
@media (max-width: 767px) {
  body {
    padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px));
  }
}

/* --------------------------------------------------------------------------
   6. Cards
   -------------------------------------------------------------------------- */
.p-card {
  position: relative;
  display: block;
  border-radius: var(--radius-card);
  background: rgba(255, 253, 249, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out);
}

.p-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.p-card__media {
  position: relative;
  overflow: hidden;
  background: var(--cream-200);
}

.p-card__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--ease-out);
}

.p-card:hover .p-card__media img {
  transform: scale(1.06);
}

.p-card__title {
  font-family: Lora, Georgia, serif;
  font-weight: 500;
  color: var(--ink-900);
  line-height: 1.3;
  transition: color 0.25s var(--ease-out);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-wrap: balance;
}

.p-card:hover .p-card__title {
  color: var(--gold-600);
}

.p-card__meta {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-500);
  font-size: 13px;
}

/* Card title sitting directly on the photo (same treatment as the recipe
   hero): a gradient scrim on the wrapper + a soft text-shadow on the title. */
.card-scrim {
  background: linear-gradient(
    to top,
    rgba(23, 15, 7, 0.88) 0%,
    rgba(23, 15, 7, 0.72) 26%,
    rgba(23, 15, 7, 0.34) 62%,
    rgba(23, 15, 7, 0) 100%
  );
  pointer-events: none;
}

.p-card__title--photo {
  color: #fff;
  text-shadow: 0 1px 2px rgba(20, 12, 4, 0.45), 0 5px 18px rgba(20, 12, 4, 0.4);
}

.p-card:hover .p-card__title--photo {
  color: var(--gold-300, #f3ca7e);
}

/* Floating action chips over card images */
.card-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  background: rgba(255, 253, 249, 0.82);
  -webkit-backdrop-filter: blur(10px) saturate(150%);
  backdrop-filter: blur(10px) saturate(150%);
  box-shadow: 0 3px 10px -3px rgba(92, 63, 34, 0.3);
  color: var(--ink-700);
  transition: transform 0.25s var(--ease-out), background-color 0.25s var(--ease-out),
    color 0.25s var(--ease-out);
}

.card-chip:hover {
  transform: scale(1.1);
  background: #fff;
}

.card-chip.is-on {
  color: var(--gold-500);
}

.card-chip.is-on svg {
  fill: currentColor;
}

/* The bookmark toggle is a secondary control: it stays discreet on the photo
   and only comes forward on hover — or stays lit when it is switched on. */
.bookmark-btn {
  opacity: 0.55;
  background: rgba(255, 253, 249, 0.62);
  box-shadow: 0 2px 8px -4px rgba(92, 63, 34, 0.28);
}

.bookmark-btn.is-on,
.bookmark-btn:hover,
.p-card:hover .bookmark-btn,
.bookmark-btn:focus-visible {
  opacity: 1;
}

/* Bookmark toggle pop */
@keyframes chip-pop {
  0% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.32);
  }
  100% {
    transform: scale(1);
  }
}

.card-chip.just-toggled {
  animation: chip-pop 0.42s var(--ease-out);
}

/* --------------------------------------------------------------------------
   7. Buttons & control pills
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 600;
  border-radius: 14px;
  padding: 0.7rem 1.35rem;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out),
    background-color 0.25s var(--ease-out), color 0.25s var(--ease-out),
    border-color 0.25s var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}

.btn:active {
  transform: translateY(1px) scale(0.985);
}

.btn-gold {
  color: #fff;
  background: linear-gradient(145deg, var(--gold-400), var(--gold-600));
  box-shadow: 0 8px 20px -8px rgba(196, 118, 26, 0.75);
}

.btn-gold:hover {
  box-shadow: 0 14px 28px -10px rgba(196, 118, 26, 0.85);
  transform: translateY(-2px);
}

.btn-ghost {
  color: var(--ink-700);
  background: rgba(255, 253, 249, 0.8);
  /* Blurred so it stays legible when it floats over page content. */
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);
  border: 1px solid var(--cream-300);
  box-shadow: var(--shadow-sm);
}

/* The like button keeps the ghost shell but turns red once liked. The bare
   utility class loses to .btn-ghost's own colour, so it is restated here —
   recipe.js toggles exactly this class. */
.btn.text-red-500,
.btn.text-red-500:hover {
  color: #ef4444;
}

.btn-ghost:hover {
  color: var(--gold-600);
  border-color: var(--gold-300);
  background: #fff;
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.btn-danger {
  color: #fff;
  background: linear-gradient(145deg, #e57d76, #c1453d);
  box-shadow: 0 8px 20px -8px rgba(193, 69, 61, 0.6);
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px -10px rgba(193, 69, 61, 0.7);
}

/* AI-assisted action — a soft plum accent so "magic" reads apart from the
   gold brand actions without breaking the warm palette. */
.ai-action {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-pill);
  font-size: 13.5px;
  font-weight: 500;
  color: #8b5e83;
  background: rgba(243, 232, 241, 0.75);
  border: 1px solid rgba(214, 190, 210, 0.7);
  transition: all 0.25s var(--ease-out);
  white-space: nowrap;
}

.ai-action:hover {
  color: #6f4468;
  background: rgba(243, 232, 241, 1);
  border-color: #d0a9c8;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.ai-action:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Rounded white control (Filtrer, Trier par, Affichage…) */
.ctrl {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  height: 44px;
  padding: 0 1.05rem;
  border-radius: 16px;
  background: rgba(255, 253, 249, 0.88);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: var(--shadow-sm);
  color: var(--ink-700);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: box-shadow 0.3s var(--ease-out), border-color 0.3s var(--ease-out),
    color 0.3s var(--ease-out), transform 0.3s var(--ease-out);
}

.ctrl:hover {
  color: var(--gold-600);
  border-color: var(--gold-200);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.ctrl.is-active {
  color: var(--gold-600);
  border-color: var(--gold-300);
  background: rgba(253, 239, 211, 0.85);
}

.ctrl__step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-pill);
  background: var(--cream-200);
  color: var(--ink-700);
  transition: background-color 0.2s var(--ease-out), color 0.2s var(--ease-out);
}

.ctrl__step:hover {
  background: var(--gold-200);
  color: var(--gold-600);
}

/* --------------------------------------------------------------------------
   8. Search field
   -------------------------------------------------------------------------- */
.search-shell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-radius: var(--radius-pill);
  background: rgba(255, 253, 249, 0.92);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-md);
  transition: box-shadow 0.35s var(--ease-out), border-color 0.35s var(--ease-out);
}

.search-shell:focus-within {
  border-color: var(--gold-300);
  box-shadow: var(--shadow-lg), 0 0 0 4px rgba(239, 171, 67, 0.16);
}

.search-shell input {
  background: transparent;
  border: 0;
  outline: none;
  width: 100%;
  color: var(--ink-900);
}

.search-shell input::placeholder {
  color: var(--ink-400);
}

/* --------------------------------------------------------------------------
   9. Forms
   -------------------------------------------------------------------------- */
.field {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--cream-300);
  color: var(--ink-900);
  transition: border-color 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out),
    background-color 0.25s var(--ease-out);
}

.field::placeholder {
  color: var(--ink-400);
}

.field:focus {
  outline: none;
  background: #fff;
  border-color: var(--gold-300);
  box-shadow: 0 0 0 4px rgba(239, 171, 67, 0.16);
}

/* Django-rendered widgets inside .form-shell get the same treatment without
   having to touch every form class in Python. */
.form-shell input[type="text"],
.form-shell input[type="email"],
.form-shell input[type="url"],
.form-shell input[type="number"],
.form-shell input[type="password"],
.form-shell textarea,
.form-shell select {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--cream-300);
  color: var(--ink-900);
  transition: border-color 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out);
}

.form-shell input:focus,
.form-shell textarea:focus,
.form-shell select:focus {
  outline: none;
  background: #fff;
  border-color: var(--gold-300);
  box-shadow: 0 0 0 4px rgba(239, 171, 67, 0.16);
}

/* Checkboxes in the brand gold */
input[type="checkbox"].tick {
  appearance: none;
  -webkit-appearance: none;
  width: 1.15rem;
  height: 1.15rem;
  flex: none;
  border: 1.5px solid var(--cream-300);
  border-radius: 6px;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
}

input[type="checkbox"].tick:hover {
  border-color: var(--gold-400);
}

input[type="checkbox"].tick:checked {
  background: var(--gold-500);
  border-color: var(--gold-500);
}

input[type="checkbox"].tick:checked::after {
  content: "";
  width: 0.32rem;
  height: 0.6rem;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: translateY(-1px) rotate(45deg);
}

/* --------------------------------------------------------------------------
   10. Modals
   -------------------------------------------------------------------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  background: rgba(44, 37, 30, 0.42);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  animation: fade-in 0.28s var(--ease-out) both;
}

/* Modals are toggled with Tailwind's `hidden`; win over `display:flex`
   regardless of where the Play CDN injects its stylesheet. */
.modal-backdrop.hidden {
  display: none !important;
}

.modal-panel {
  border-radius: 26px;
  background: rgba(255, 253, 249, 0.97);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  backdrop-filter: blur(28px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 40px 90px -30px rgba(44, 30, 16, 0.55);
  animation: modal-in 0.36s var(--ease-out) both;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Dropdown menus */
.menu-panel {
  border-radius: 18px;
  background: rgba(255, 253, 249, 0.94);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: menu-in 0.22s var(--ease-out) both;
}

@keyframes menu-in {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 1rem;
  font-size: 14px;
  color: var(--ink-700);
  transition: background-color 0.2s var(--ease-out), color 0.2s var(--ease-out);
}

.menu-item:hover {
  background: rgba(253, 239, 211, 0.7);
  color: var(--gold-600);
}

.menu-item--danger {
  color: #c1453d;
}

.menu-item--danger:hover {
  background: rgba(251, 229, 227, 0.9);
  color: #a13832;
}

/* --------------------------------------------------------------------------
   11. Section headings, badges, dividers
   -------------------------------------------------------------------------- */
.section-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: Lora, Georgia, serif;
  font-weight: 600;
  color: var(--ink-900);
  letter-spacing: -0.01em;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  font-weight: 500;
  background: rgba(253, 239, 211, 0.9);
  color: var(--gold-600);
  border: 1px solid var(--gold-200);
}

.divider-ornament {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.divider-ornament::before,
.divider-ornament::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--cream-300), transparent);
}

/* --------------------------------------------------------------------------
   12. Motion
   -------------------------------------------------------------------------- */
@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.reveal {
  opacity: 0;
  animation: rise-in 0.65s var(--ease-out) forwards;
  animation-delay: calc(min(var(--i, 0), 6) * 70ms);
}

/* Cards further down the page wait for the viewport instead of firing at once.
   The stagger is capped so long lists never leave the last card waiting. */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.45s var(--ease-out), transform 0.45s var(--ease-out);
  transition-delay: calc(min(var(--i, 0), 6) * 45ms);
}

.reveal-on-scroll.is-visible {
  opacity: 1;
  transform: none;
}

@keyframes float-soft {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

.float-soft {
  animation: float-soft 6s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal-on-scroll,
  .float-soft,
  .hero-accent::after,
  .modal-panel,
  .menu-panel,
  .modal-backdrop {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* --------------------------------------------------------------------------
   13. Misc
   -------------------------------------------------------------------------- */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

::selection {
  background: var(--gold-200);
  color: var(--ink-900);
}

/* Warm, slim scrollbar on desktop */
@media (min-width: 768px) {
  * {
    scrollbar-width: thin;
    scrollbar-color: var(--cream-300) transparent;
  }

  *::-webkit-scrollbar {
    width: 10px;
    height: 10px;
  }

  *::-webkit-scrollbar-thumb {
    background: var(--cream-300);
    border: 3px solid transparent;
    background-clip: content-box;
    border-radius: 999px;
  }

  *::-webkit-scrollbar-thumb:hover {
    background: var(--gold-300);
    background-clip: content-box;
  }
}

:focus-visible {
  outline: 2px solid var(--gold-500);
  outline-offset: 2px;
  border-radius: 8px;
}

/* Feedback launcher */
.feedback-fab {
  position: fixed;
  right: 1.25rem;
  bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px) + 1rem);
  z-index: 45;
  width: 46px;
  height: 46px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-500);
  background: rgba(255, 253, 249, 0.85);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  backdrop-filter: blur(16px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: var(--shadow-md);
  transition: transform 0.3s var(--ease-out), color 0.3s var(--ease-out),
    box-shadow 0.3s var(--ease-out);
}

.feedback-fab:hover {
  color: var(--gold-600);
  transform: translateY(-3px) scale(1.05);
  box-shadow: var(--shadow-lg);
}

/* Edit screens float their save/cancel row exactly where the launcher sits,
   so on phones it steps up out of the way. */
@media (max-width: 767px) {
  body:has(.sticky-actions) .feedback-fab {
    bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px) + 4.75rem);
  }
}

@media (min-width: 768px) {
  .feedback-fab {
    right: 1.75rem;
    bottom: 1.75rem;
  }
}
