/* המיטאפרים · paper, tomato, cheese. Hand-set, not templated. */

:root {
  --cream: #F4EDE3;
  --cream-deep: #EADFCF;
  --paper: #FBF7F1;
  --card: #FFFDF9;
  --ink: #2A2420;
  --ink-soft: #5C534C;
  --ink-faint: #8A8178;
  --line: #E2D6C4;
  --tomato: #C4452D;
  --tomato-deep: #9E3421;
  --cheese: #D9A441;
  --cheese-soft: #F3DFAE;
  --basil: #3D6B4F;
  --crust: #8B5E34;
  --radius: 14px;
  --font-display: "Frank Ruhl Libre", "Times New Roman", serif;
  --font-body: "Heebo", "Segoe UI", Tahoma, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);
  --wrap: 44rem;
  --toolbar-h: 7.25rem;
  color-scheme: light;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--toolbar-h) + 1rem);
  -webkit-text-size-adjust: 100%;
}
html.modal-open { overflow: hidden; }

body {
  margin: 0;
  position: relative;
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--cream);
  /* fine paper fibre, no gradient blobs */
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 240 240' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.45 0 0 0 0 0.35 0 0 0 0 0.25 0 0 0 0.09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--crust) 22%, transparent) 1px, transparent 1.6px);
  background-size: 240px 240px, 22px 22px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  padding-bottom: env(safe-area-inset-bottom);
}

::selection { background: var(--cheese-soft); color: var(--ink); }

a { color: var(--tomato-deep); text-underline-offset: 0.18em; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2.5px solid var(--tomato); outline-offset: 2px; border-radius: 6px; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: 1.15rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.muted { color: var(--ink-faint); }
.small { font-size: 0.8rem; }

.skip-link {
  position: absolute; inset-inline-start: 1rem; top: -3rem; z-index: 100;
  background: var(--ink); color: var(--paper); padding: 0.5rem 0.9rem; border-radius: 8px;
  text-decoration: none; font-weight: 600; transition: top 0.2s;
}
.skip-link:focus { top: 0.75rem; }

/* · · Buttons · · */
.btn {
  appearance: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  min-height: 2.75rem;
  padding: 0.55rem 1.15rem;
  border-radius: 999px;
  border: 1.5px solid transparent;
  font-weight: 700; font-size: 0.95rem; line-height: 1.2;
  text-decoration: none; cursor: pointer;
  transition: transform 0.18s var(--ease), background-color 0.18s, border-color 0.18s, box-shadow 0.18s, color 0.18s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px) scale(0.98); }
.btn-primary {
  background: var(--tomato); color: #fff;
  box-shadow: 0 1px 0 var(--tomato-deep), 0 6px 16px -6px rgba(158, 52, 33, 0.55);
}
.btn-primary:hover { background: var(--tomato-deep); }
.btn-ghost {
  background: var(--paper); color: var(--ink);
  border-color: color-mix(in srgb, var(--crust) 35%, transparent);
}
.btn-ghost:hover { border-color: var(--tomato); color: var(--tomato-deep); }
.btn-link {
  background: none; color: var(--ink-soft); padding-inline: 0.6rem;
  text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--ink-faint) 50%, transparent);
  text-underline-offset: 0.25em;
}
.btn-link:hover { color: var(--tomato-deep); text-decoration-color: currentColor; }
.btn-small { min-height: 2.25rem; padding: 0.35rem 0.95rem; font-size: 0.86rem; }
.btn.loading { pointer-events: none; opacity: 0.8; }
.btn.loading::after {
  content: ""; width: 0.9em; height: 0.9em; border-radius: 50%;
  border: 2px solid currentColor; border-inline-end-color: transparent;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.inline-btn {
  appearance: none; background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--tomato-deep); font-weight: 600;
  text-decoration: underline; text-underline-offset: 0.2em;
}

.icon-btn {
  appearance: none; display: inline-grid; place-items: center;
  width: 2.25rem; height: 2.25rem; border-radius: 50%;
  border: 1px solid var(--line); background: var(--paper); color: var(--ink-soft);
  cursor: pointer; transition: color 0.15s, border-color 0.15s, transform 0.18s var(--ease-spring);
}
.icon-btn svg { width: 1.1rem; height: 1.1rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:hover { color: var(--tomato-deep); border-color: color-mix(in srgb, var(--tomato) 45%, var(--line)); transform: translateY(-1px); }

/* · · Masthead · · */
.masthead { position: relative; z-index: 1; padding-top: clamp(1.5rem, 5vw, 3rem); }

.masthead-inner {
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding-block: clamp(0.9rem, 3vw, 1.25rem);
  box-shadow: 0 2px 0 var(--cream-deep), 0 18px 40px -26px rgba(42, 36, 32, 0.55);
  max-width: calc(var(--wrap) - 1.5rem);
  rotate: -0.4deg;
}
.masthead-text { min-width: 0; }
.title-mark {
  background: linear-gradient(transparent 62%, color-mix(in srgb, var(--cheese) 55%, transparent) 62% 90%, transparent 90%);
  padding-inline: 0.08em; border-radius: 4px;
}
.perks { list-style: none; margin: 0.7rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.35rem 0.4rem; }
.perk {
  font-size: 0.76rem; font-weight: 700; line-height: 1.4;
  padding: 0.18rem 0.6rem; border-radius: 999px;
  border: 1.5px solid currentColor; background: var(--card);
  box-shadow: 0 2px 0 color-mix(in srgb, currentColor 25%, transparent);
  transition: rotate 0.3s var(--ease-spring), translate 0.3s var(--ease-spring);
}
.perk-pizza { color: var(--tomato-deep); rotate: -3deg; }
.perk-beer { color: var(--crust); rotate: 2deg; }
.perk-merch { color: var(--basil); rotate: -1.5deg; }
.perk-talk { color: var(--ink-soft); rotate: 3deg; }
.perk:hover { rotate: 0deg; translate: 0 -2px; }
.masthead-inner { display: flex; align-items: center; gap: clamp(1rem, 4vw, 1.6rem); }
.masthead > .masthead-inner { width: auto; margin-inline: max(0.75rem, calc((100% - var(--wrap)) / 2 + 0.75rem)); padding-inline: clamp(0.9rem, 3vw, 1.4rem); }

.logo-sticker {
  flex-shrink: 0;
  width: clamp(4.75rem, 18vw, 6.25rem); aspect-ratio: 1;
  border-radius: 50%;
  background: var(--paper);
  padding: 4px;
  box-shadow: 0 0 0 1px var(--line), 0 10px 24px -10px rgba(42, 36, 32, 0.45);
  rotate: -6deg;
  animation: sticker-in 0.9s var(--ease-spring) both;
  transition: rotate 0.5s var(--ease-spring);
}
.logo-sticker:hover { rotate: 4deg; }
.logo-sticker img { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
@keyframes sticker-in {
  from { opacity: 0; transform: scale(0.6) rotate(-24deg); }
  to { opacity: 1; transform: none; }
}

.kicker {
  margin: 0 0 0.15rem;
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.02em;
  color: var(--basil);
}
.title {
  margin: 0;
  font-family: var(--font-display); font-weight: 900;
  font-size: clamp(2.3rem, 9vw, 3.4rem);
  line-height: 0.95; letter-spacing: -0.025em;
}
.lede {
  margin: 0.55rem 0 0;
  max-width: 30ch;
  font-size: clamp(0.98rem, 2.6vw, 1.08rem);
  color: var(--ink-soft);
  text-wrap: pretty;
}
.stats {
  margin: 0.6rem 0 0;
  font-size: 0.82rem; font-weight: 600; color: var(--tomato-deep);
  font-variant-numeric: tabular-nums;
  min-height: 1.3em;
}

.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin-top: 1.35rem; }

.squiggle { display: block; width: 100%; height: 14px; margin-top: 1.6rem; }
.squiggle path {
  fill: none; stroke: var(--cheese); stroke-width: 2.2; stroke-linecap: round;
  stroke-dasharray: 1400; stroke-dashoffset: 1400;
  animation: draw 1.6s 0.25s var(--ease) forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }

/* · · Toolbar (sticky) · · */
.toolbar {
  position: sticky; top: 0; z-index: 30;
  /* solid · translucent sticky was cutting a hard line through cards as they scrolled under */
  background: var(--cream);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 240 240' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.45 0 0 0 0 0.35 0 0 0 0 0.25 0 0 0 0.09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--crust) 22%, transparent) 1px, transparent 1.6px);
  background-size: 240px 240px, 22px 22px;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.toolbar.stuck { border-bottom-color: var(--line); box-shadow: 0 10px 22px -18px rgba(42, 36, 32, 0.45); }
.toolbar-inner { padding-block: 0.65rem 0.55rem; display: grid; gap: 0.5rem; }
.filters {
  display: flex; align-items: center; flex-wrap: wrap; gap: 0.45rem 0.5rem;
  padding-bottom: 2px;
}
.search {
  position: relative; min-width: 0;
  display: flex; align-items: center;
}
.search svg {
  position: absolute; inset-inline-start: 0.8rem; width: 1.05rem; height: 1.05rem;
  fill: none; stroke: var(--ink-faint); stroke-width: 2; stroke-linecap: round; pointer-events: none;
}
.search input {
  width: 100%; min-height: 2.6rem;
  padding: 0.5rem 2.4rem 0.5rem 0.9rem;
  padding-inline-start: 2.35rem; padding-inline-end: 0.9rem;
  border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--card);
  font: inherit; font-size: 0.95rem; color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search input::placeholder { color: var(--ink-faint); }
.search input:focus { outline: none; border-color: var(--tomato); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tomato) 18%, transparent); }

.seg {
  display: inline-flex; padding: 3px; gap: 2px;
  border-radius: 999px; background: var(--cream-deep);
  border: 1px solid var(--line);
}
.seg button {
  appearance: none; border: 0; background: none; cursor: pointer;
  padding: 0.38rem 0.8rem; border-radius: 999px;
  font-size: 0.85rem; font-weight: 600; color: var(--ink-soft);
  transition: background-color 0.2s var(--ease), color 0.2s, box-shadow 0.2s;
}
.seg button:hover { color: var(--ink); }
.seg button[aria-checked="true"] { background: var(--card); color: var(--tomato-deep); box-shadow: 0 1px 3px rgba(42, 36, 32, 0.15); }

.seg { flex-shrink: 0; }
.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; flex: 1 1 12rem; min-width: 0; }
.tags:empty { display: none; }
.tag {
  flex-shrink: 0; appearance: none; cursor: pointer;
  padding: 0.25rem 0.7rem; border-radius: 999px;
  border: 1px dashed color-mix(in srgb, var(--crust) 40%, transparent);
  background: transparent; font-size: 0.8rem; font-weight: 600; color: var(--ink-soft);
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.tag span { font-weight: 500; color: var(--ink-faint); margin-inline-start: 0.15rem; font-variant-numeric: tabular-nums; }
.tag:hover { border-color: var(--crust); color: var(--ink); }
.tag[aria-pressed="true"] { background: var(--cheese-soft); border-style: solid; border-color: var(--cheese); color: var(--ink); }

/* · · List · · */
.main { position: relative; z-index: 1; padding-top: 0.25rem; padding-bottom: 3rem; min-height: 40vh; }
.result-line { margin: 0.4rem 0 0; min-height: 0; font-size: 0.85rem; color: var(--ink-soft); }
#list:focus { outline: none; }

.day { margin-top: 1.25rem; }
.day:first-child { margin-top: 0.75rem; }
.day-head {
  display: flex; align-items: baseline; gap: 0.6rem; flex-wrap: wrap;
  margin: 0 0 0.75rem;
  font-weight: inherit;
}
.day-name { font-family: var(--font-display); font-weight: 700; font-size: 1.45rem; letter-spacing: -0.015em; }
.day-date { font-size: 0.92rem; color: var(--ink-soft); font-weight: 500; }
.day-count {
  margin-inline-start: auto; font-size: 0.75rem; font-weight: 600; color: var(--basil);
}
.day-head::after {
  content: ""; flex-basis: 100%; height: 1px; margin-top: 0.35rem;
  background: repeating-linear-gradient(to left, var(--line) 0 6px, transparent 6px 10px);
}

.cards { display: grid; gap: 0.7rem; }

/* Card = a ticket: time stub on the right (RTL start), perforation, body. */
.card {
  position: relative;
  display: grid;
  grid-template-columns: 4.6rem 1fr;
  grid-template-areas: "stub body" "stub actions";
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 0 rgba(42, 36, 32, 0.04), 0 10px 22px -18px rgba(42, 36, 32, 0.4);
  transition: box-shadow 0.25s var(--ease), border-color 0.25s, transform 0.25s var(--ease);
}
.card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--tomato) 30%, var(--line)); box-shadow: 0 1px 0 rgba(42, 36, 32, 0.04), 0 16px 30px -18px rgba(158, 52, 33, 0.45); }

.stub {
  grid-area: stub;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 0.35rem;
  padding: 1rem 0.4rem;
  border-inline-end: 2px dashed var(--line);
  position: relative;
}
/* perforation notches */
.stub::before, .stub::after {
  content: ""; position: absolute; inset-inline-end: -9px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--cream);
  border: 1px solid var(--line);
}
.stub::before { top: -9px; clip-path: inset(50% 0 0 0); }
.stub::after { bottom: -9px; clip-path: inset(0 0 50% 0); }

.stub-time {
  font-family: var(--font-display); font-weight: 700; font-size: 1.3rem;
  color: var(--tomato); line-height: 1;
  font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate;
}
.stub-live {
  font-size: 0.68rem; font-weight: 700; color: #fff; background: var(--basil);
  padding: 0.05rem 0.45rem; border-radius: 999px;
}

.card-body { grid-area: body; padding: 0.9rem 1rem 0.3rem; min-width: 0; }
.card-title { margin: 0; font-size: 1.04rem; font-weight: 700; line-height: 1.35; text-wrap: pretty; overflow-wrap: anywhere; }
.card-title a { color: inherit; text-decoration: none; background: linear-gradient(var(--cheese-soft), var(--cheese-soft)) no-repeat 100% 92% / 0 35%; transition: background-size 0.35s var(--ease); }
.card-title a:hover { background-size: 100% 35%; }
.card-venue { margin: 0.3rem 0 0; font-size: 0.86rem; color: var(--ink-soft); }
.card-venue::before { content: "📍"; font-size: 0.8em; margin-inline-end: 0.3rem; filter: saturate(0.7); }
.card-org { margin: 0.05rem 0 0; font-size: 0.8rem; color: var(--ink-faint); }

.card-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.5rem; }
.card-tags:empty { display: none; }
.pill {
  font-size: 0.72rem; font-weight: 600; line-height: 1.5;
  padding: 0.05rem 0.5rem; border-radius: 6px;
  background: var(--paper); color: var(--ink-soft); border: 1px solid var(--line);
}
.pill-free { background: color-mix(in srgb, var(--basil) 10%, var(--paper)); color: var(--basil); border-color: color-mix(in srgb, var(--basil) 25%, transparent); }
.pill-hot { background: var(--cheese-soft); color: var(--crust); border-color: color-mix(in srgb, var(--cheese) 60%, transparent); }

.card-actions { grid-area: actions; display: flex; align-items: center; gap: 0.4rem; padding: 0.5rem 1rem 0.9rem; }
.card-actions .btn { margin-inline-end: auto; }

.card.is-notable { border-color: color-mix(in srgb, var(--cheese) 55%, var(--line)); }

.card.flash { animation: flash 2.4s var(--ease); }
@keyframes flash {
  0%, 30% { box-shadow: 0 0 0 3px var(--cheese), 0 16px 30px -18px rgba(158, 52, 33, 0.45); }
  100% { box-shadow: 0 1px 0 rgba(42, 36, 32, 0.04), 0 10px 22px -18px rgba(42, 36, 32, 0.4); }
}

/* reveal: only opacity + translate, so :hover transform keeps working */
.card, .day-head { opacity: 0; translate: 0 12px; }
.card.in, .day-head.in { opacity: 1; translate: 0 0; transition: opacity 0.5s var(--ease) var(--d, 0ms), translate 0.55s var(--ease) var(--d, 0ms), box-shadow 0.25s var(--ease), border-color 0.25s, transform 0.25s var(--ease); }

/* skeleton */
.skeleton { display: grid; gap: 0.7rem; margin-top: 1.4rem; }
.skeleton span {
  height: 6.5rem; border-radius: var(--radius); border: 1px solid var(--line);
  background: linear-gradient(90deg, var(--paper) 0%, var(--cream-deep) 50%, var(--paper) 100%) 0 0 / 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* empty / error */
.empty {
  margin-top: 1.4rem; text-align: center;
  padding: 2rem 1.25rem 2.2rem;
  background: var(--card); border: 1.5px dashed var(--line); border-radius: var(--radius);
}
.empty-art { width: 4.5rem; height: 4.5rem; rotate: 8deg; animation: wobble 3.5s ease-in-out infinite; }
.empty-art .slice { fill: var(--cheese-soft); stroke: var(--cheese); stroke-width: 2; stroke-linejoin: round; }
.empty-art .crust { fill: var(--crust); opacity: 0.85; }
.empty-art .pep { fill: var(--tomato); }
@keyframes wobble { 50% { rotate: -4deg; } }
.empty-title { margin: 0.6rem 0 0.2rem; font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; }
.empty-body { margin: 0 auto; max-width: 32ch; color: var(--ink-soft); font-size: 0.92rem; }
.empty-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.empty.is-error .empty-title { color: var(--tomato-deep); }

/* · · Sources · · */
.sources { position: relative; z-index: 1; padding-block: 2rem 1rem; }
.sources-head h2 { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; }
.sources-head p { margin: 0.3rem 0 1rem; color: var(--ink-soft); font-size: 0.92rem; max-width: 40ch; }
.source-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.45rem; }
.source-list a {
  display: inline-flex; align-items: baseline; gap: 0.45rem;
  padding: 0.35rem 0.75rem; border-radius: 8px;
  background: var(--card); border: 1px solid var(--line);
  color: var(--ink); text-decoration: none; font-size: 0.86rem; font-weight: 600;
  transition: border-color 0.15s, transform 0.18s var(--ease), background-color 0.15s;
}
.source-list a:hover { border-color: var(--cheese); background: color-mix(in srgb, var(--cheese-soft) 35%, var(--card)); transform: rotate(-1deg); }
.src-kind { font-size: 0.7rem; font-weight: 500; color: var(--ink-faint); }
.source-more { margin-top: 0.8rem; }
.source-more summary { cursor: pointer; color: var(--ink-soft); font-size: 0.88rem; font-weight: 600; width: fit-content; }
.source-more summary:hover { color: var(--tomato-deep); }
.source-more[open] .source-list { margin-top: 0.7rem; animation: fade-up 0.35s var(--ease); }
.sources-foot { margin: 1.1rem 0 0; font-size: 0.9rem; color: var(--ink-soft); }
@keyframes fade-up { from { opacity: 0; translate: 0 6px; } }

/* · · Footer · · */
.site-footer { text-align: center; padding-block: 2rem 7rem; color: var(--ink-faint); font-size: 0.85rem; }
.site-footer p { margin: 0.2rem 0; }
.footer-logo { border-radius: 50%; opacity: 0.85; rotate: 8deg; }
.footer-small { font-size: 0.75rem; }

/* · · Mobile action bar · · */
.action-bar {
  position: fixed; inset-inline: 0.75rem; bottom: calc(0.75rem + env(safe-area-inset-bottom)); z-index: 40;
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem;
  padding: 0.5rem; border-radius: 999px;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  box-shadow: 0 12px 30px -12px rgba(42, 36, 32, 0.45);
  transition: translate 0.35s var(--ease), opacity 0.25s;
}
.action-bar .btn { min-height: 2.6rem; }
.action-bar.tuck, .action-bar.tuck-top { translate: 0 calc(100% + 1.5rem); opacity: 0; pointer-events: none; }
@media (min-width: 720px) { .action-bar { display: none; } .site-footer { padding-bottom: 3rem; } }

/* · · Toast · · */
.toast {
  position: fixed; left: 50%; bottom: calc(5.5rem + env(safe-area-inset-bottom)); z-index: 60;
  translate: -50% 1rem; opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--paper);
  padding: 0.55rem 1rem; border-radius: 999px; font-size: 0.88rem; font-weight: 600;
  transition: opacity 0.2s, translate 0.3s var(--ease-spring);
}
.toast.show { opacity: 1; translate: -50% 0; }

/* · · Dialogs · · */
.sheet {
  width: min(32rem, calc(100vw - 1.5rem));
  max-height: calc(100dvh - 2rem);
  padding: 0; border: 0; border-radius: 20px;
  background: var(--paper); color: var(--ink);
  box-shadow: 0 30px 60px -20px rgba(42, 36, 32, 0.55);
  overflow: auto;
}
.sheet::backdrop { background: rgba(42, 36, 32, 0.42); backdrop-filter: blur(2px); }
.sheet[open] { animation: sheet-in 0.35s var(--ease-spring); }
.sheet[open]::backdrop { animation: fade 0.25s ease; }
.sheet.closing { animation: sheet-out 0.18s ease forwards; }
.sheet.closing::backdrop { animation: fade 0.18s ease reverse forwards; }
@keyframes sheet-in { from { opacity: 0; transform: translateY(18px) scale(0.97); } }
@keyframes sheet-out { to { opacity: 0; transform: translateY(10px) scale(0.98); } }
@keyframes fade { from { opacity: 0; } }

@media (max-width: 560px) {
  .sheet { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 20px 20px 0 0; max-height: 92dvh; }
  @keyframes sheet-in { from { transform: translateY(100%); } }
  @keyframes sheet-out { to { transform: translateY(100%); } }
}

.sheet-form { padding: 1.3rem 1.3rem calc(1.2rem + env(safe-area-inset-bottom)); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.sheet-head h2 { margin: 0; font-family: var(--font-display); font-size: 1.6rem; font-weight: 900; letter-spacing: -0.02em; }
.x {
  appearance: none; border: 0; background: var(--cream-deep); cursor: pointer;
  width: 2.2rem; height: 2.2rem; border-radius: 50%; font-size: 1.35rem; line-height: 1; color: var(--ink-soft);
  transition: rotate 0.25s var(--ease), background-color 0.15s;
}
.x:hover { rotate: 90deg; background: var(--line); }
.sheet-sub { margin: 0.35rem 0 1rem; color: var(--ink-soft); font-size: 0.92rem; }

.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.span-2 { grid-column: 1 / -1; }
.field { display: grid; gap: 0.25rem; }
.field > span { font-size: 0.84rem; font-weight: 600; color: var(--ink-soft); }
.field em { color: var(--tomato); font-style: normal; }
.field small { font-weight: 400; color: var(--ink-faint); }
.field input, .field textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--ink);
  padding: 0.6rem 0.75rem; border-radius: 10px;
  border: 1.5px solid var(--line); background: var(--card);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field textarea { resize: vertical; min-height: 5.5rem; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--tomato); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tomato) 16%, transparent); }
.field input[dir="ltr"] { text-align: left; }
.field input[dir="ltr"]::placeholder { text-align: left; }
.hp { position: absolute; inset-inline-start: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-msg { margin: 0.9rem 0 0; min-height: 1.4em; font-size: 0.9rem; font-weight: 600; }
.form-msg:empty { margin: 0; min-height: 0; }
.form-msg.err { color: var(--tomato-deep); }
.form-msg.ok { color: var(--basil); }
.ok-slice { display: inline-block; animation: hop 0.7s var(--ease-spring); }
@keyframes hop { 0% { transform: translateY(6px) rotate(-20deg) scale(0.6); opacity: 0; } 60% { transform: translateY(-6px) rotate(8deg) scale(1.15); opacity: 1; } }
.sheet-foot { display: flex; align-items: center; gap: 0.5rem; margin-top: 1.1rem; }
.sheet.sent .fields { opacity: 0.45; transition: opacity 0.3s; }

/* · · Wider screens · · */
@media (min-width: 640px) {
  .card {
    grid-template-columns: 5.25rem 1fr auto;
    grid-template-areas: "stub body actions";
    align-items: stretch;
  }
  .card-body { padding: 1rem 1.15rem; }
  .card-actions { padding: 1rem 1.15rem; align-self: center; }
  .card-actions .btn { margin-inline-end: 0.2rem; }
  .stub { padding-block: 1.1rem; }
}


/* · · Party layer: small icons painted on the page (scrolls with content, not fixed) · · */
.party {
  position: absolute; top: 0; left: 0; right: 0; z-index: 0;
  height: 100%; min-height: 100%;
  overflow: visible; pointer-events: none;
}
.party i {
  position: absolute; left: var(--x); top: var(--y);
  width: calc(var(--s) * 0.42); height: calc(var(--s) * 0.42);
  margin-left: calc(var(--s) * -0.21);
  opacity: calc(var(--o) * 0.45);
  /* no rise — stay painted on the page so they scroll with content */
}
.party svg {
  display: block; width: 100%; height: 100%;
  rotate: var(--r);
  filter: drop-shadow(0 2px 0 rgba(139, 94, 52, 0.12));
  animation: sway var(--sw) ease-in-out var(--dl) infinite alternate;
}
@keyframes sway {
  from { transform: translateX(-6px) rotate(-6deg); }
  to { transform: translateX(6px) rotate(6deg); }
}
/* phones: fewer + tinier */
@media (max-width: 640px) {
  .party i:nth-child(n + 10) { display: none; }
  .party i { width: calc(var(--s) * 0.38); height: calc(var(--s) * 0.38); opacity: calc(var(--o) * 0.4); }
}
/* Cards & panels stay solid so the drift never sits under text */
.sources-head, .day-head { position: relative; }

/* · · Reduced motion · · */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .card, .day-head { opacity: 1; translate: none; }
  .squiggle path { stroke-dashoffset: 0; }
  .card:hover, .source-list a:hover, .icon-btn:hover { transform: none; }
  /* party layer: park the icons where they are, no drifting */
  .party i { top: var(--y); animation: none !important; transform: none; }
  .party svg { animation: none !important; transform: none; }
}
