/* Value Giver. The look follows the Fund Analyzer app: light, soft washes of colour, frosted
   glass panels, one phrase of the headline in a blue-to-violet gradient.
   Type: Instrument Serif for headlines, Instrument Sans for everything else. The same two
   families are drawn on the posts themselves (public/js/postcanvas.js). */

@font-face {
  font-family: "Instrument Sans";
  src: url("/fonts/instrument-sans.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("/fonts/instrument-serif.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("/fonts/instrument-serif-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #0f172a;
  --ink-2: #475569;
  --muted: #64748b;
  --line: rgba(15, 23, 42, 0.08);
  --line-strong: rgba(15, 23, 42, 0.16);
  --wash: rgba(15, 23, 42, 0.04);
  --accent: #2a78d6;
  --accent-strong: #1c5cab;
  --accent-soft: rgba(42, 120, 214, 0.14);
  --violet: #6250d6;
  --glass-top: rgba(255, 255, 255, 0.74);
  --glass-bottom: rgba(255, 255, 255, 0.56);
  --glass-edge: rgba(255, 255, 255, 0.85);
  --blur: blur(22px) saturate(170%);
  --shadow-soft: 0 1px 2px rgba(22, 34, 66, 0.04);
  --shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 1px 2px rgba(22, 34, 66, 0.04), 0 18px 48px -20px rgba(22, 34, 66, 0.2);
  --shadow-pop: 0 2px 6px rgba(22, 34, 66, 0.06), 0 24px 60px -16px rgba(22, 34, 66, 0.28);
  --radius-xl: 24px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --font: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Instrument Serif", Georgia, "Times New Roman", serif;
  --ease: cubic-bezier(0.22, 0.8, 0.2, 1);
  --pad: 20px;
}

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: #f4f6fb; }

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--ink);
  font: 15px/1.5 var(--font);
  letter-spacing: -0.004em;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
  /* The soft wash: blue top left, violet top right, mint bottom right, a little peach bottom left. */
  background:
    radial-gradient(60% 46% at 8% 0%, rgba(148, 190, 255, 0.5), transparent 70%),
    radial-gradient(52% 40% at 100% 4%, rgba(190, 170, 255, 0.42), transparent 70%),
    radial-gradient(58% 44% at 96% 100%, rgba(150, 226, 208, 0.42), transparent 70%),
    radial-gradient(46% 36% at 0% 100%, rgba(255, 214, 196, 0.38), transparent 70%),
    #f4f6fb;
  background-attachment: fixed;
}

button, input, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
img, canvas, svg { display: block; }
h1, h2, h3, p, figure { margin: 0; }
[hidden] { display: none !important; }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.glass {
  background: linear-gradient(180deg, var(--glass-top), var(--glass-bottom));
  border: 1px solid var(--glass-edge);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
}
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .glass, .topbar, .post { background: rgba(255, 255, 255, 0.94); }
}

/* ---- Frame ------------------------------------------------------------------------------ */

.app { max-width: 520px; min-height: 100dvh; margin: 0 auto; display: flex; flex-direction: column; padding-top: env(safe-area-inset-top); }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 56px;
  padding: 0 var(--pad);
  flex: none;
  /* Frosted, so the posts pass under it cleanly when the page scrolls. */
  background: rgba(244, 246, 251, 0.7);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
}
.topbar-space { flex: 1; }
/* The Profit Media lion (from profitmedia.se) and the product's name. */
.brand { display: inline-flex; align-items: center; gap: 0.5em; font-weight: 600; font-size: 15.5px; letter-spacing: -0.012em; white-space: nowrap; }
.brand img { width: 1.75em; height: 1.75em; flex: none; }
.icon-btn, .text-btn, .count-btn {
  height: 36px;
  min-width: 36px;
  border-radius: 12px;
  display: inline-grid;
  place-items: center;
  color: var(--ink);
  background: linear-gradient(180deg, var(--glass-top), var(--glass-bottom));
  border: 1px solid var(--glass-edge);
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s var(--ease);
}
.icon-btn:active, .text-btn:active, .count-btn:active { transform: scale(0.94); }
.text-btn { padding: 0 11px; font-size: 12.5px; font-weight: 650; letter-spacing: 0.03em; color: var(--ink-2); }
.count-btn { display: inline-flex; align-items: center; gap: 6px; padding: 0 12px 0 9px; font-weight: 650; font-size: 13.5px; color: var(--accent-strong); }
.count-btn svg { width: 18px; height: 18px; }
.count-btn.bump { animation: bump 0.5s var(--ease); }
@keyframes bump { 35% { transform: scale(1.18); } }

.notice { margin: 0 var(--pad) 8px; padding: 10px 14px; border-radius: var(--radius-md); font-size: 13.5px; background: #fff6dd; color: #6b4e00; border: 1px solid #f0dca0; }

main { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.screen { display: none; flex: 1; flex-direction: column; gap: 18px; padding: 8px var(--pad) calc(28px + env(safe-area-inset-bottom)); }
.screen.is-active { display: flex; animation: screen-in 0.55s var(--ease) both; }
@keyframes screen-in { from { opacity: 0; transform: translateY(12px); } }

/* ---- Type ------------------------------------------------------------------------------- */

.hero {
  margin: clamp(10px, 5dvh, 48px) 0 4px;
  text-align: center;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(42px, 13vw, 62px);
  line-height: 1;
  letter-spacing: -0.022em;
  text-wrap: balance;
}
.hero em {
  /* Italic letters lean past their box; the padding keeps the gradient from cutting them off. */
  display: inline-block;
  padding: 0 0.08em 0.1em 0;
  margin: 0 -0.08em -0.1em 0;
  font-style: italic;
  background: linear-gradient(100deg, var(--accent), var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.title { margin-top: clamp(6px, 3dvh, 28px); text-align: center; font-family: var(--display); font-weight: 400; font-size: 38px; line-height: 1.04; letter-spacing: -0.018em; text-wrap: balance; }

/* ---- Panels, fields, buttons ------------------------------------------------------------ */

.panel { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: var(--radius-xl); }

.field {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 56px;
  padding: 0 8px 0 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--glass-edge);
  box-shadow: inset 0 1px 0 #fff, var(--shadow-soft), 0 14px 28px -18px rgba(22, 34, 66, 0.35);
  transition: box-shadow 0.2s, border-color 0.2s;
}
.field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow-soft); }
.field svg { color: var(--muted); }
.field input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; font-size: 16.5px; /* 16px or more: iOS does not zoom on focus */ }
.field input::placeholder { color: var(--muted); }
.field-btn { height: 40px; padding: 0 16px; border-radius: 13px; font-weight: 620; font-size: 14.5px; color: #fff; background: var(--ink); }
.field-note { min-height: 18px; margin: -4px 4px 0; font-size: 13px; color: var(--muted); }
.field-note.is-good { color: #14805c; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  height: 54px;
  border-radius: 999px;
  font-weight: 640;
  font-size: 16px;
  letter-spacing: -0.012em;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.2s var(--ease), opacity 0.2s, box-shadow 0.2s;
}
.btn:active { transform: scale(0.975); }
.btn-primary { color: #fff; background: linear-gradient(180deg, #1b2538, var(--ink)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 12px 32px -8px rgba(15, 23, 42, 0.45); }
.btn-primary:disabled { opacity: 0.35; box-shadow: none; cursor: default; }
.btn-soft { height: 50px; font-size: 15px; color: var(--ink); background: rgba(255, 255, 255, 0.8); border: 1px solid var(--glass-edge); box-shadow: inset 0 1px 0 #fff, var(--shadow-soft); }
.btn-quiet { height: 44px; font-weight: 520; font-size: 15px; color: var(--ink-2); }
.btn:focus-within, button:focus-visible, .pill:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.photo-row { display: flex; align-items: center; gap: 8px; }
.photo-row .btn { flex: 1; padding: 0 10px; white-space: nowrap; }
.photo-thumb { width: 50px; height: 50px; border-radius: 14px; object-fit: cover; box-shadow: var(--shadow-soft), 0 0 0 1px var(--glass-edge); animation: screen-in 0.4s var(--ease); }
.photo-row.has-photo .btn span { display: none; }
.photo-row.has-photo .btn { flex: 0 0 50px; }
.photo-row.has-photo .photo-thumb { flex: 1; width: auto; }

/* The button that starts it all stays in reach while the pills scroll. */
#occasions .btn-primary { position: sticky; bottom: calc(14px + env(safe-area-inset-bottom)); }

.toggle { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 6px 4px 6px 6px; font-size: 15px; font-weight: 520; cursor: pointer; transition: opacity 0.3s; }
.toggle > span { flex: 1; }
.toggle small { display: block; margin-top: 2px; font-size: 13px; font-weight: 450; color: var(--accent-strong); }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle i { position: relative; flex: none; width: 50px; height: 30px; border-radius: 999px; background: rgba(15, 23, 42, 0.14); transition: background-color 0.25s var(--ease); }
.toggle i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(15, 23, 42, 0.25); transition: transform 0.25s var(--ease); }
.toggle input:checked + i { background: #34c759; }
.toggle input:checked + i::after { transform: translateX(20px); }
.toggle input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }
.toggle.is-off { opacity: 0.42; }

.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 15px 0 12px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 560;
  white-space: nowrap;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--glass-edge);
  box-shadow: inset 0 1px 0 #fff, var(--shadow-soft);
  transition: transform 0.2s var(--ease), background-color 0.2s, color 0.2s, box-shadow 0.2s;
  animation: screen-in 0.45s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 28ms);
}
.pill i { width: 10px; height: 10px; border-radius: 50%; background: linear-gradient(135deg, var(--pa), var(--pc)); flex: none; }
.pill:active { transform: scale(0.95); }
.pill.is-on { color: #fff; background: linear-gradient(180deg, #1b2538, var(--ink)); border-color: transparent; box-shadow: 0 8px 18px -8px rgba(15, 23, 42, 0.55); }
.pill.is-more { color: var(--ink-2); background: none; border-color: var(--line-strong); box-shadow: none; }
.pill.is-site { border-style: dashed; border-color: var(--line-strong); }
.pill.is-site.is-on { border-style: solid; border-color: transparent; }

/* ---- Results: one row of posts per occasion ---------------------------------------------- */

#results { padding-left: 0; padding-right: 0; gap: 22px; }
#results > .offer, #results > .btn { margin: 0 var(--pad); width: auto; }

.set-head { display: flex; align-items: baseline; gap: 10px; padding: 0 var(--pad); }
.set-name { font-family: var(--display); font-weight: 400; font-size: 30px; line-height: 1.1; letter-spacing: -0.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.set-status { margin-left: auto; font-size: 13px; color: var(--muted); white-space: nowrap; }
.set-status.swap { animation: screen-in 0.45s var(--ease) both; }
.progress { margin: 8px var(--pad) 0; height: 3px; border-radius: 3px; background: rgba(15, 23, 42, 0.07); overflow: hidden; transition: opacity 0.6s 0.4s; }
.progress i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--accent), var(--violet)); transform-origin: left; transform: scaleX(var(--p, 0)); transition: transform 0.9s var(--ease); }
.progress.is-done { opacity: 0; }

.carousel {
  --w: min(84vw, 400px, max(62vw, calc((100vh - 360px) * var(--ar, 0.75))));
  display: flex;
  gap: 14px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding: 12px calc((100% - var(--w)) / 2) 22px;
  -webkit-overflow-scrolling: touch;
}
.carousel::-webkit-scrollbar { display: none; }
@supports (height: 100dvh) {
  .carousel { --w: min(84vw, 400px, max(62vw, calc((100dvh - 300px) * var(--ar, 0.75)))); }
}

/* A post, laid out as it will look in a feed: who posts it, the picture with its headline, the
   button, and the post text, on frosted glass. */
.post {
  flex: 0 0 var(--w);
  scroll-snap-align: center;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: linear-gradient(180deg, var(--glass-top), var(--glass-bottom));
  border: 1px solid var(--glass-edge);
  box-shadow: var(--shadow-pop);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  animation: post-in 0.7s var(--ease) both;
  animation-delay: calc(var(--i) * 90ms);
}
@keyframes post-in { from { opacity: 0; transform: translateY(22px) scale(0.97); } }

.post-media { position: relative; aspect-ratio: var(--ar, 0.75); overflow: hidden; background: #e7ebf3; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.post-media img, .post-media canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.post-before { transition: filter 0.5s var(--ease); }
.post-after { clip-path: inset(0 100% 0 0); }
.post-overlay { opacity: 0; }
.post-after, .post-overlay { transition: opacity 0.18s; }

/* Developing: the photo slightly faded, light passing over it. */
.post.is-dev .post-before { filter: saturate(0.8) brightness(1.04) contrast(0.92); }
.post-sheen { position: absolute; inset: 0; opacity: 0; background: linear-gradient(112deg, transparent 32%, rgba(255, 255, 255, 0.55) 49%, transparent 64%); background-size: 260% 100%; transition: opacity 0.5s; }
.post.is-dev .post-sheen { opacity: 1; animation: sheen 2.6s linear infinite; animation-delay: calc(var(--i) * -0.8s); }
@keyframes sheen { from { background-position: 130% 0; } to { background-position: -130% 0; } }

.chip { position: absolute; display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--ink); background: rgba(255, 255, 255, 0.78); border: 1px solid var(--glass-edge); -webkit-backdrop-filter: blur(14px) saturate(160%); backdrop-filter: blur(14px) saturate(160%); }
.post-wait { left: 12px; bottom: 12px; display: none; }
.post.is-dev .post-wait { display: inline-flex; }
.post.is-armed .post-wait { display: none; }
.post-wait::before { content: ""; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--accent); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* The reveal: a line of light crosses the photo and leaves the new picture behind it. */
.post-wipe { position: absolute; top: -4%; bottom: -4%; left: 0; width: 3px; margin-left: -2px; opacity: 0; background: #fff; box-shadow: 0 0 18px 6px rgba(255, 255, 255, 0.85), 0 0 70px 26px rgba(98, 80, 214, 0.55); pointer-events: none; }

.post.is-ready .post-after { clip-path: none; }
.post.is-ready .post-overlay { opacity: 1; }
.post.is-comparing .post-after, .post.is-comparing .post-overlay { opacity: 0; clip-path: none; }

.post-compare { right: 10px; top: 10px; width: 38px; height: 38px; padding: 0; justify-content: center; display: none; touch-action: none; }
.post-compare svg { width: 19px; height: 19px; }
.post-compare .half { fill: currentColor; stroke: none; }
.post[data-zone="top"] .post-compare { top: auto; bottom: 10px; }
.post.is-ready .post-compare { display: inline-flex; }
.post-hint { right: 56px; top: 14px; opacity: 0; transform: translateX(8px); pointer-events: none; transition: opacity 0.5s var(--ease), transform 0.5s var(--ease); }
.post[data-zone="top"] .post-hint { top: auto; bottom: 14px; }
.post-hint.is-on { opacity: 1; transform: none; }
.post-original { left: 10px; top: 10px; display: none; }
.post.is-comparing .post-original { display: inline-flex; }

.post-fail { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 20px; text-align: center; background: rgba(244, 246, 251, 0.8); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.post.is-failed .post-fail { display: flex; }
.post-fail strong { font-family: var(--display); font-weight: 400; font-size: 24px; line-height: 1.1; letter-spacing: -0.01em; }
.post-fail span { font-size: 13.5px; color: var(--ink-2); }
.post-fail button { margin-top: 10px; height: 40px; padding: 0 18px; border-radius: 999px; font-weight: 620; font-size: 14.5px; color: #fff; background: var(--ink); }

/* Everything but the picture stays out of sight until the post is finished. */
.post-text { position: relative; padding: 0 14px 12px; }
.post-body { padding: 0 14px 14px; }
.post-caption, .post-body > * { opacity: 0; transform: translateY(8px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.post.is-ready .post-caption, .post.is-ready .post-body > * { opacity: 1; transform: none; }
.post:not(.is-ready) .post-caption, .post:not(.is-ready) .post-body > * { visibility: hidden; }
.post-skeleton { position: absolute; inset: 4px 14px auto; display: grid; gap: 10px; transition: opacity 0.4s; }
.post-skeleton i { height: 11px; border-radius: 6px; background: linear-gradient(100deg, rgba(15, 23, 42, 0.06) 30%, rgba(15, 23, 42, 0.12) 50%, rgba(15, 23, 42, 0.06) 70%); background-size: 260% 100%; animation: sheen 2s linear infinite; }
.post-skeleton i:nth-child(1) { width: 96%; }
.post-skeleton i:nth-child(2) { width: 88%; }
.post-skeleton i:nth-child(3) { width: 60%; }
.post.is-ready .post-skeleton, .post.is-failed .post-skeleton { opacity: 0; }

/* Who posts it: the logo, the name, and under the name the whole post text. */
.post-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px 10px; }
.post-avatar { position: relative; flex: none; width: 40px; height: 40px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; font-family: var(--display); font-size: 23px; line-height: 1; color: #fff; background: linear-gradient(135deg, var(--accent), var(--violet)); border: 1px solid rgba(15, 23, 42, 0.1); }
.post-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #fff; }
.post-who { min-width: 0; display: flex; flex-direction: column; gap: 1px; line-height: 1.2; }
.post-who .post-name { font-size: 15px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.post-sub { display: flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--muted); }
.post-sub svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.post-more { margin-left: auto; display: flex; gap: 3px; padding: 6px 2px; }
.post-more i { width: 4px; height: 4px; border-radius: 50%; background: var(--ink-2); }
/* The whole text, never cut short: this is how the post will read. */
.post-caption { font-size: 15px; line-height: 1.42; color: var(--ink); min-height: 4.26em; white-space: pre-line; overflow-wrap: anywhere; }

/* Under the picture: where the post leads and its button, then like, comment, share. */
.post-link { display: flex; align-items: center; gap: 12px; margin: 0 -14px; padding: 11px 14px; background: rgba(15, 23, 42, 0.045); }
.post-link-info { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; line-height: 1.2; }
.post-host { font-size: 11.5px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.post-host:empty { display: none; }
.post-link .post-name { font-size: 15px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.post-cta { flex: none; max-width: 55%; padding: 9px 14px; border-radius: 8px; font-size: 14px; font-weight: 640; color: var(--ink); background: rgba(15, 23, 42, 0.09); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.post-react { display: flex; padding: 4px 0; border-bottom: 1px solid rgba(15, 23, 42, 0.08); }
.post-react span { flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px; height: 38px; font-size: 13.5px; font-weight: 620; color: var(--ink-2); }
.post-react svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.post-actions { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.post-actions .icon-btn { width: 44px; height: 44px; border-radius: 14px; font-weight: 650; font-size: 15px; }
.post-actions .js-keep.is-on { color: #fff; background: linear-gradient(135deg, var(--accent), var(--violet)); border-color: transparent; }
.post-actions .js-keep.is-on svg { animation: bump 0.45s var(--ease); }
.post-actions .btn { height: 44px; font-size: 15px; }
.post-actions .btn svg { width: 18px; height: 18px; }

.dots { display: flex; justify-content: center; gap: 7px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(15, 23, 42, 0.14); transition: background-color 0.4s, width 0.4s var(--ease); }
.dots i.is-ready { background: rgba(15, 23, 42, 0.32); }
.dots i.is-active { width: 20px; border-radius: 7px; background: var(--ink); }
.dots i.pulse { animation: bump 0.6s var(--ease); }

/* ---- The offer ---------------------------------------------------------------------------- */

.offer { gap: 10px; padding: 20px 16px 16px; animation: screen-in 0.7s var(--ease) both; }
.offer-title { font-family: var(--display); font-weight: 400; font-size: 34px; line-height: 1.04; letter-spacing: -0.018em; }
.offer-body { font-size: 14.5px; line-height: 1.5; color: var(--ink-2); }
.offer form { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 30px; font-size: 14.5px; font-weight: 520; cursor: pointer; }
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check i { flex: none; width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--line-strong); background: rgba(255, 255, 255, 0.8); display: grid; place-items: center; transition: background-color 0.2s, border-color 0.2s; }
.check i::after { content: ""; width: 10px; height: 6px; border: solid #fff; border-width: 0 0 2px 2px; transform: rotate(-45deg) translate(1px, -1px); opacity: 0; }
.check input:checked + i { background: var(--accent); border-color: var(--accent); }
.check input:checked + i::after { opacity: 1; }
.check input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---- Sheets ----------------------------------------------------------------------------- */

.sheet { position: fixed; inset: auto 0 0 0; width: 100%; max-width: 520px; max-height: 88dvh; margin: 0 auto; padding: 0; border: 0; border-radius: 26px 26px 0 0; color: var(--ink); background: rgba(246, 248, 252, 0.92); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); overflow: auto; box-shadow: 0 -30px 80px rgba(15, 23, 42, 0.25); }
.sheet[open] { animation: sheet-in 0.5s var(--ease) both; }
.sheet::backdrop { background: rgba(15, 23, 42, 0.32); animation: fade-in 0.4s both; }
@keyframes sheet-in { from { transform: translateY(100%); } }
@keyframes fade-in { from { opacity: 0; } }
.sheet-inner { display: flex; flex-direction: column; gap: 14px; padding: 10px var(--pad) calc(18px + env(safe-area-inset-bottom)); }
.sheet-grip { align-self: center; width: 38px; height: 4px; border-radius: 4px; background: var(--line-strong); }
.sheet-title { font-family: var(--display); font-weight: 400; font-size: 32px; line-height: 1.05; letter-spacing: -0.016em; }
.sheet-empty { color: var(--ink-2); font-size: 15px; }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field span { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.form-field input, .form-field textarea { width: 100%; padding: 13px 15px; border-radius: 14px; border: 1px solid var(--line); background: #fff; outline: 0; font-size: 16.5px; resize: none; transition: border-color 0.2s, box-shadow 0.2s; }
.form-field input:focus, .form-field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

.kept-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.kept-item { position: relative; border-radius: 16px; overflow: hidden; background: #e7ebf3; box-shadow: var(--shadow-pop); }
.kept-item canvas { width: 100%; height: auto; }
.kept-item button { position: absolute; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: var(--ink); background: rgba(255, 255, 255, 0.82); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.kept-item button svg { width: 17px; height: 17px; }
.kept-item .js-remove { top: 8px; right: 8px; }
.kept-item .js-save-one { bottom: 8px; right: 8px; }

/* The giant QR code. */

/* ---- Toast ------------------------------------------------------------------------------ */

.toast { position: fixed; z-index: 50; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); max-width: min(88vw, 420px); padding: 12px 18px; border-radius: 16px; font-size: 14.5px; font-weight: 540; line-height: 1.35; text-align: center; color: #fff; background: rgba(15, 23, 42, 0.92); box-shadow: var(--shadow-pop); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); opacity: 0; transform: translate(-50%, 16px); pointer-events: none; transition: opacity 0.35s var(--ease), transform 0.35s var(--ease); }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
dialog[open] ~ .toast { bottom: auto; top: calc(20px + env(safe-area-inset-top)); }

@media (min-width: 700px) {
  .app { padding-top: 20px; }
  .carousel { --w: min(400px, calc((100dvh - 300px) * var(--ar, 0.75))); }
}

/* A computer screen: the three posts of an occasion stand side by side, nothing to swipe. */
@media (min-width: 960px) {
  .app:has(#results.is-active) { max-width: 1180px; }
  .carousel { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; gap: 24px; overflow: visible; padding: 14px var(--pad) 26px; scroll-snap-type: none; }
  .dots { display: none; }
  .set-name { font-size: 36px; }
  #results { gap: 30px; }
  #results > .offer, #results > .btn { width: 100%; max-width: 520px; margin: 0 auto; }
}

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