/* Momenti brand tokens: the CSS block of the Official Brand Guidelines, Version 1.0
   (November 2026; docs/brand.md). The one place the palette and the two English
   typefaces are written down. build.sh puts this at the head of the site, app and
   invitation stylesheets; everything Momenti owns reads these. */
:root {
  --momenti-ivory: #F8F1E8;      /* backgrounds */
  --momenti-cherry: #5A1A2C;     /* primary, buttons */
  --momenti-champagne: #D9BCA4;  /* premium accents */
  --momenti-blush: #E8B7B7;      /* soft accents */
  --momenti-espresso: #302827;   /* text */
  --momenti-font-display: "Cormorant Garamond", serif;
  --momenti-font-body: "DM Sans", sans-serif;
}
/* Working surfaces: the client's dashboard, builder and RSVP inbox (on top of
   site.css, so the brand tokens apply), and the platform admin (standalone, the reference project's admin look). */

/* --- client area: shared ----------------------------------------------------- */
.appmain { padding: 2rem 0 4rem; }
.apphead { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.6rem; }
.apphead h1 { font-size: var(--step-3); }
.eyebrow { margin: 0 0 .35rem; font-size: .78rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
:root[lang="ar"] .eyebrow { letter-spacing: 0; }
.eyebrow a { text-decoration: none; }
.eyebrow a:hover { color: var(--ink); }
.small { font-size: .88rem; }
.nowrap { white-space: nowrap; }
.row--tight { gap: .5rem; }
.empty { display: grid; justify-items: start; gap: 1rem; }
.pill { display: inline-block; width: fit-content; padding: .2rem .7rem; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--paper-2); color: var(--ink-2); }
.pill--published { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.pill--pending_payment { background: var(--champagne); color: var(--ink); }
.pill--paused, .pill--expired { background: color-mix(in srgb, var(--danger) 13%, transparent); color: var(--danger); }
.btn--quiet-danger { color: var(--danger); }
.btn--quiet-danger:hover { border-color: var(--danger); }
.btn .ico { width: 1.1em; height: 1.1em; }
[dir="rtl"] .ico--back { transform: scaleX(-1); }
.input--num { max-width: 9rem; }
.field--inline { display: inline-flex; align-items: center; gap: .6rem; }
.field--inline > span { white-space: nowrap; }
.field--inline .input { width: auto; min-height: 42px; }
.iconbtn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--card); color: var(--ink); font: 600 1rem/1 var(--f-body); cursor: pointer;
}
.iconbtn:hover { border-color: var(--ink); }
.iconbtn .ico { width: 16px; height: 16px; }
.iconbtn--danger { color: var(--danger); }
.iconbtn--danger:hover { border-color: var(--danger); }
.ferr { margin: 0; color: var(--danger); font-size: .85rem; }
.ferr:empty { display: none; }
.has-error :is(.input, input, textarea, select) { border-color: var(--danger); }

/* --- dashboard ------------------------------------------------------------------ */
.invlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.invrow { display: grid; grid-template-columns: 104px 1fr auto; gap: 1.25rem; align-items: center; padding: 1rem; }
.invrow__thumb > img { width: 100%; height: 100%; object-fit: cover; }
.invrow__thumb { width: 104px; aspect-ratio: 4 / 3.4; border-radius: var(--r-surface); overflow: hidden; background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); }
.invrow__main { display: grid; gap: .3rem; min-width: 0; }
.invrow h2 { font-size: 1.45rem; overflow-wrap: anywhere; }
.invrow h2 a { text-decoration: none; }
.invrow h2 a:hover { color: var(--accent); }
.invrow__actions { display: flex; flex-wrap: wrap; gap: .45rem; justify-content: end; max-width: 430px; }
.invrow__actions form { margin: 0; }
.invmedia { display: flex; flex-wrap: wrap; gap: .4rem .5rem; align-items: center; margin-top: .3rem; }
.invmedia .dl {
  display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .7rem; border-radius: 999px; text-decoration: none;
  font-size: .82rem; font-weight: 600; background: var(--accent-soft); color: var(--ink);
}
.invmedia .dl .ico { color: var(--accent); }
.invmedia .dl:hover { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.invmedia__note { font-size: .85rem; color: var(--muted); }
.invmedia__note--bad { color: var(--danger); }
@media (max-width: 860px) {
  .invrow { grid-template-columns: 76px 1fr; }
  .invrow__thumb { width: 76px; }
  .invrow__actions { grid-column: 1 / -1; justify-content: start; max-width: none; }
}

/* --- builder: frame ------------------------------------------------------------------ */
.bld { display: grid; gap: 1.4rem; }
/* Back (a phone only), the name, the status pill, the saved state, Publish. The saved
   state changes text as you type; it has a fixed width so nothing shifts under a finger. */
.bld__head { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem .9rem; }
.bld__title { flex: 1 1 14rem; min-width: 0; }
.bld__head h1 { font-size: var(--step-3); overflow-wrap: anywhere; }
.bld__back { display: none; }
.bld__head .bstatus { min-width: 14rem; justify-content: center; }
.bld__go .ico { font-size: 1.05em; }
.bstatus { justify-self: end; }
@media (max-width: 760px) { .bld__head { grid-template-columns: 1fr; } .bld__head .bstatus { justify-self: start; } }
.bld__head h1 { font-size: var(--step-3); overflow-wrap: anywhere; }
.bstatus {
  display: inline-flex; align-items: center; gap: .5rem; margin: 0; padding: .4rem .85rem; border-radius: 999px;
  background: var(--card); box-shadow: inset 0 0 0 1px var(--line); font-size: .85rem; color: var(--ink-2); white-space: nowrap;
}
.bstatus::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.bstatus[data-state="dirty"]::before { background: var(--muted); }
.bstatus[data-state="saving"]::before { background: var(--accent); animation: blink 1s ease-in-out infinite; }
.bstatus[data-state="error"], .bstatus[data-state="offline"] { color: var(--danger); }
.bstatus[data-state="error"]::before, .bstatus[data-state="offline"]::before { background: var(--danger); }
@keyframes blink { 50% { opacity: .25; } }

/* The steps, in order: a numbered badge and a name each, a chevron between them pointing the
   way they run. Behind the client: ticked. Here: filled. Ahead: plain. (A phone shows them as
   the sheet's icon tabs instead; see the phone editor at the end of this file.) */
.bsteps { overflow-x: auto; scrollbar-width: none; margin-inline: -1.25rem; padding-inline: 1.25rem; }
.bsteps::-webkit-scrollbar { display: none; }
.bsteps__where { margin: 0 0 .7rem; font-size: .9rem; color: var(--muted); }
.bsteps__where b { color: var(--accent); font-weight: 700; }
.bsteps ol { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; width: max-content; }
.bsteps li { display: flex; align-items: center; }
.bsteps li + li::before {
  content: ""; flex: none; width: .5rem; height: .5rem; margin-inline: .5rem .8rem; rotate: 45deg;
  border-block-start: 2px solid var(--line-2); border-inline-end: 2px solid var(--line-2);
}
[dir="rtl"] .bsteps li + li::before { rotate: -45deg; }
.bsteps li.is-done + li::before { border-color: var(--accent); }
.bsteps__a {
  display: inline-flex; align-items: center; gap: .55rem; padding: .4rem .95rem .4rem .45rem; border-radius: 999px;
  text-decoration: none; font-size: .92rem; font-weight: 600; color: var(--ink-2); background: var(--card); box-shadow: inset 0 0 0 1px var(--line);
  transition: background-color .25s var(--ease), color .25s var(--ease);
}
[dir="rtl"] .bsteps__a { padding: .4rem .45rem .4rem .95rem; }
a.bsteps__a:hover { color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }
.bsteps__n { display: grid; place-items: center; width: 1.75rem; height: 1.75rem; border-radius: 50%; background: var(--paper-2); font-size: .85rem; font-weight: 700; font-variant-numeric: lining-nums tabular-nums !important; }
.bsteps__check, .bsteps__ico { display: none; }
.bsteps__a.is-done { color: var(--ink); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent); }
.bsteps__a.is-done .bsteps__n { background: var(--accent-soft); color: var(--accent); font-size: 1rem; }
.bsteps__a.is-done .bsteps__num { display: none; }
.bsteps__a.is-done .bsteps__check { display: block; }
.bsteps__a.is-on { background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 16px -8px var(--accent); }
.bsteps__a.is-on .bsteps__n { background: var(--accent-ink); color: var(--accent); }
.bsteps__a.is-off { opacity: .5; }

.bnote { display: flex; gap: .7rem; align-items: start; margin: 0; padding: .85rem 1.1rem; border-radius: var(--r-field); background: var(--accent-soft); font-size: .93rem; }
.bnote .ico { color: var(--accent); margin-top: .15em; }
.bnote a { font-weight: 600; }
.bstack { display: grid; gap: 1rem; align-content: start; min-width: 0; }
.bcard { display: grid; gap: 1rem; align-content: start; min-width: 0; padding: 1.5rem; border-radius: var(--r-surface);
  background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
@media (max-width: 760px) { .bcard { padding: 1.1rem; } }
.bcard h2 { font-size: 1.45rem; }
.bcard h3 { font-size: 1.2rem; }
/* Back, where you are, Next: stuck to the bottom of the screen for as long as the form is in
   view, so the way on is always visible however long the step is. */
.bld__foot {
  position: sticky; bottom: 0; z-index: 6; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem;
  margin-inline: -.75rem; padding: .8rem .75rem calc(.8rem + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--paper) 88%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.bld__where { margin: 0; display: grid; justify-items: center; gap: .1rem; line-height: 1.25; font-size: .85rem; color: var(--muted); }
.bld__where b { color: var(--ink); font-size: .92rem; }

/* One markup, two shapes (docs/PLAN.md, "Mobile editor"). Here, the wide one: the tabs
   across, the form on the left, the live preview sticky on the right; .bsheet is only a
   wrapper. Under 1024 px it becomes the bottom sheet of the phone editor (end of this file). */
.bsplit { display: grid; grid-template-columns: minmax(0, 1fr) 20rem; gap: 1.4rem 1.75rem; align-items: start; }
.bld:not(.bld--pv) .bsplit { grid-template-columns: minmax(0, 1fr); }
.bsheet { display: contents; }
.bsheet__top { display: contents; }
.bsheet__grip, .bsheet__size { display: none; }
.bsplit .bsteps { grid-column: 1 / -1; }
.bsheet__body { grid-column: 1; display: grid; gap: 1.4rem; align-content: start; min-width: 0; }
.bsplit__side { grid-column: 2; position: sticky; top: 88px; }

/* --- builder: the live preview ------------------------------------------------------------ */
.pv { display: grid; gap: .9rem; justify-items: center; }
.pv__phone {
  position: relative; width: min(100%, 20rem, calc((100dvh - 10.5rem) * 390 / 844)); aspect-ratio: 390 / 844; padding: 9px; border-radius: 44px;
  background: linear-gradient(150deg, color-mix(in srgb, var(--momenti-espresso) 87%, #fff), color-mix(in srgb, var(--momenti-espresso) 60%, #000) 60%); box-shadow: var(--shadow-lg), inset 0 0 0 1.5px rgb(255 255 255 / .08);
}
.pv__screen { position: relative; width: 100%; height: 100%; overflow: hidden; border-radius: 36px; background: var(--paper-2); isolation: isolate; }
/* Laid out at a real phone's width (390 CSS px) and scaled down, so the page
   wraps and sizes its type exactly as on a phone. app.js sets --pv-scale. */
.pv__screen iframe {
  position: absolute; top: 0; left: 0; width: 390px; height: calc(100% / var(--pv-scale, .79)); border: 0;
  transform: scale(var(--pv-scale, .79)); transform-origin: 0 0;
}
.pv__bar { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--paper-2); }
.seg__b { min-height: 34px; padding: .3rem .9rem; border: 0; border-radius: 999px; background: none; color: var(--ink-2); font: 600 .85rem/1 var(--f-body); cursor: pointer; }
.seg__b[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgb(0 0 0 / .12); }
.seg__b[lang="ar"] { font-family: "IBM Plex Sans Arabic", sans-serif; }

/* --- builder: choices ----------------------------------------------------------------------- */
.tpick, .swpick, .optlist, .chips { border: 0; margin: 0; padding: 0; min-width: 0; }
.tpick legend { padding: 0; margin-bottom: .8rem; font: 600 1.35rem/1.2 var(--f-display); }
.tpick__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 1rem; }
.tpick__o, .swpick__o, .opt, .chipr, .check { position: relative; cursor: pointer; }
.tpick__o input, .swpick__o input, .opt input, .chipr input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.tpick__o { display: grid; gap: .35rem; padding: .6rem .6rem 1rem; border-radius: var(--r-surface); background: var(--card); box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .25s var(--ease); }
.tpick__o:hover { box-shadow: inset 0 0 0 1px var(--line-2); }
.tpick__o:has(input:checked) { box-shadow: inset 0 0 0 2px var(--accent); }
.tpick__o:has(input:focus-visible), .swpick__o:has(input:focus-visible), .opt:has(input:focus-visible),
.chipr:has(input:focus-visible), .filebtn:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
.tpick__art > img { width: 100%; height: 100%; object-fit: cover; }
.tpick__art { display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 16px; background: var(--bg); margin-bottom: .4rem; }
.tpick__name { padding-inline: .4rem; font-weight: 700; }
.tpick__desc { padding-inline: .4rem; color: var(--muted); font-size: .88rem; line-height: 1.45; }
.tfilter { margin-bottom: .2rem; }
.bstack:has(.tfilter input[value="all"]:not(:checked)) .tpick { display: none; }
.bstack:has(.tfilter input[value="wedding"]:checked) .tpick[data-occ="wedding"],
.bstack:has(.tfilter input[value="engagement"]:checked) .tpick[data-occ="engagement"],
.bstack:has(.tfilter input[value="birthday"]:checked) .tpick[data-occ="birthday"],
.bstack:has(.tfilter input[value="baby"]:checked) .tpick[data-occ="baby"],
.bstack:has(.tfilter input[value="graduation"]:checked) .tpick[data-occ="graduation"],
.bstack:has(.tfilter input[value="business"]:checked) .tpick[data-occ="business"] { display: block; }
.tpick__demo { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: .35rem; width: fit-content; margin: .2rem .4rem 0; font-size: .85rem; font-weight: 600; color: var(--accent); text-decoration: none; }
.tpick__demo:hover { text-decoration: underline; }
.tpick__demo .ico { width: 14px; height: 14px; }
.tpick__o:has(input:checked)::after {
  content: "✓"; position: absolute; top: 1.1rem; inset-inline-end: 1.1rem; display: grid; place-items: center; width: 30px; height: 30px;
  border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 700;
}

.swpick { display: flex; flex-wrap: wrap; gap: .6rem; }
.swpick__o { display: inline-flex; align-items: center; gap: .6rem; padding: .45rem .9rem .45rem .45rem; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line-2); font-size: .92rem; font-weight: 500; }
[dir="rtl"] .swpick__o { padding: .45rem .45rem .45rem .9rem; }
.swpick__o:has(input:checked) { box-shadow: inset 0 0 0 2px var(--accent); }
.swpick__sw { width: 30px; height: 30px; border-radius: 50%; background: conic-gradient(var(--b) 0 33%, var(--c) 0 66%, var(--a) 0); box-shadow: inset 0 0 0 1px var(--line-2); }
.check { display: inline-flex; align-items: center; gap: .6rem; font-size: .95rem; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); margin: 0; }
.colorpair { display: grid; grid-template-columns: repeat(2, minmax(0, 160px)); gap: .8rem 1rem; align-items: end; }
.colorpair .small { grid-column: 1 / -1; }
.colorpair input[type="color"] { padding: .25rem; min-height: 46px; cursor: pointer; }
[data-look]:has([name="custom_on"]:not(:checked)) [data-custom] { display: none; }
.optlist { display: grid; gap: .5rem; }
.optlist--row { display: flex; flex-wrap: wrap; }
.opt { display: flex; align-items: center; gap: .7rem; padding: .7rem 1rem; border-radius: var(--r-field); box-shadow: inset 0 0 0 1px var(--line-2); }
.opt::before { content: ""; flex: none; width: 18px; height: 18px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--line-2); transition: box-shadow .2s; }
.opt:has(input:checked) { box-shadow: inset 0 0 0 2px var(--accent); }
.opt:has(input:checked)::before { box-shadow: inset 0 0 0 5px var(--accent); }
.fxrow { display: grid; gap: .5rem; padding-block: .8rem; border-top: 1px solid var(--line); }
.fxrow:first-of-type { border-top: 0; padding-top: 0; }
.fxrow__label { font-size: .85rem; font-weight: 600; color: var(--ink-2); }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chipr span { display: inline-block; padding: .45rem .95rem; border-radius: 999px; border: 1px solid var(--line-2); font-size: .88rem; font-weight: 500; color: var(--ink-2); transition: all .2s var(--ease); }
.chipr:hover span { border-color: var(--ink); color: var(--ink); }
.chipr:has(input:checked) span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.range { width: min(100%, 360px); accent-color: var(--accent); }

/* Font pairs, each shown with the client's own names. */
.fontpick { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: .75rem; }
.fontopt { position: relative; display: grid; gap: .35rem; padding: 1rem 1.1rem .9rem; border-radius: var(--r-field); box-shadow: inset 0 0 0 1px var(--line-2); cursor: pointer; }
.fontopt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.fontopt:has(input:checked) { box-shadow: inset 0 0 0 2px var(--accent); }
.fontopt:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
.fontopt__en { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 .4rem; font-size: 1.7rem; line-height: 1.15; color: var(--ink); }
.fontopt__name { font-style: italic; font-weight: 500; }
.fontopt__join { font-size: 1.35em; color: var(--accent); }
.fontopt__ar { font-size: 1.6rem; line-height: 1.5; color: var(--ink); }
.fontopt__label { font-size: .8rem; font-weight: 600; color: var(--muted); }

/* Animation flows: a card each, with a tiny loop that shows its tempo. */
.flows { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 128px), 1fr)); gap: .75rem; }
.flow { position: relative; display: grid; gap: .3rem; align-content: start; padding: .8rem .8rem 1rem; border-radius: var(--r-field); box-shadow: inset 0 0 0 1px var(--line-2); cursor: pointer; transition: box-shadow .2s var(--ease); }
.flow input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.flow:hover { box-shadow: inset 0 0 0 1px var(--ink); }
.flow:has(input:checked) { box-shadow: inset 0 0 0 2px var(--accent); background: var(--accent-soft); }
.flow:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
.flow__name { font-weight: 700; }
.flow__desc { font-size: .84rem; line-height: 1.4; color: var(--muted); }
.flow__demo { display: flex; align-items: end; justify-content: center; gap: 7px; height: 64px; margin-bottom: .35rem; border-radius: 10px; background: var(--paper-2); overflow: hidden; padding-bottom: 14px; }
.flow__demo i { width: 14px; height: 26px; border-radius: 4px; background: var(--accent); }
.flow__demo i:nth-child(2) { height: 36px; opacity: .75; }
.flow__demo i:nth-child(3) { height: 20px; opacity: .5; }
.flow__demo--classic i { animation: fl-rise 2.8s var(--ease) infinite; }
.flow__demo--cinematic { position: relative; }
.flow__demo--cinematic i { animation: fl-reveal 3.2s cubic-bezier(.7, 0, .2, 1) infinite; }
.flow__demo--cinematic::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 35%, rgb(255 255 255 / .55) 50%, transparent 65%); background-size: 250% 100%; animation: fl-sweep 3.2s ease-in-out infinite; }
.flow__demo--playful i { animation: fl-bounce 1.4s cubic-bezier(.3, 1.6, .5, 1) infinite; }
.flow__demo--calm i { animation: fl-fade 4s ease-in-out infinite; }
.flow__demo i:nth-child(2) { animation-delay: .15s; }
.flow__demo i:nth-child(3) { animation-delay: .3s; }
@keyframes fl-rise { 0%, 15% { translate: 0 30px; opacity: 0; } 45%, 85% { translate: 0 0; opacity: 1; } 100% { opacity: 0; } }
@keyframes fl-reveal { 0%, 10% { clip-path: inset(0 50% 0 50%); } 40%, 90% { clip-path: inset(0 0 0 0); } 100% { clip-path: inset(0 50% 0 50%); } }
@keyframes fl-sweep { 0%, 30% { background-position: 120% 0; } 70%, 100% { background-position: -40% 0; } }
@keyframes fl-bounce { 0%, 100% { translate: 0 0; } 35% { translate: 0 -16px; } 55% { translate: 0 0; } 70% { translate: 0 -5px; } }
@keyframes fl-fade { 0%, 100% { opacity: .15; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .flow__demo i, .flow__demo::after { animation: none !important; } }
.finetune { border-top: 1px solid var(--line); padding-top: .9rem; }
.finetune summary { cursor: pointer; font-weight: 600; color: var(--ink-2); width: fit-content; }
.finetune summary:hover { color: var(--ink); }
.finetune__body { display: grid; gap: .2rem; padding-top: 1rem; }

/* --- builder: content ----------------------------------------------------------------------- */
.bgroup { padding: 0; gap: 0; }
.bgroup summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.15rem 1.5rem; cursor: pointer; list-style: none; }
.bgroup summary::-webkit-details-marker { display: none; }
.bgroup summary::after { content: ""; flex: none; width: 10px; height: 10px; border-right: 2px solid var(--accent); border-bottom: 2px solid var(--accent); rotate: 45deg; translate: 0 -3px; transition: rotate .3s var(--ease); }
.bgroup[open] summary::after { rotate: 225deg; translate: 0 3px; }
.bgroup__body { display: grid; gap: 0; padding: 0 1.5rem 1.4rem; }
.bfield { display: grid; grid-template-columns: minmax(150px, 220px) 1fr; gap: .45rem 1.2rem; align-items: start; padding-block: .85rem; border-top: 1px solid var(--line); }
.bfield__label { padding-top: .7rem; font-size: .9rem; font-weight: 600; color: var(--ink-2); }
.bfield__hint { grid-column: 2; margin: 0; }
/* Sample text the client has not replaced yet. */
.sampletag { display: none; margin-inline-start: .35rem; padding: .05rem .45rem; border-radius: 5px; background: var(--champagne); color: var(--ink); font-size: .7rem; font-weight: 600; vertical-align: .1em; }
.bfield.is-sample .sampletag { display: inline-block; }
.essentials { border-top: 3px solid var(--champagne); }
.essentials__head { display: grid; gap: .8rem; }
.essentials__body { padding: 0; }
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.checklist li { display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .75rem .3rem .45rem; border-radius: 999px; font-size: .82rem; font-weight: 600; background: var(--paper-2); color: var(--ink-2); }
[dir="rtl"] .checklist li { padding: .3rem .45rem .3rem .75rem; }
.checklist li::before { content: ""; width: 16px; height: 16px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--line-2); transition: all .25s var(--ease); }
.checklist li.is-optional { font-weight: 500; color: var(--muted); }
.checklist li.is-done { background: color-mix(in srgb, var(--ok) 13%, transparent); color: var(--ink); }
.checklist li.is-done::before { box-shadow: none; background: var(--ok) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 8.3 7 10.7l4.6-5' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat; }
.bfield .ferr { grid-column: 2; }
.bfield--bool { align-items: center; }
.bfield--bool .bfield__label { padding-top: 0; }
.bpair { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.bpair__in { position: relative; }
.btag { position: absolute; top: -.5rem; inset-inline-end: .6rem; z-index: 1; padding: 0 .4rem; border-radius: 5px; background: var(--paper-2); color: var(--muted); font: 600 .68rem/1.5 var(--f-body); font-style: normal; }
label .btag { position: static; margin-inline-start: .3rem; }
.bld .input { width: 100%; min-height: 46px; padding: .6rem .85rem; border: 1px solid var(--line-2); border-radius: var(--r-field); background: var(--paper); color: var(--ink); font: inherit; font-size: .95rem; }
.bld textarea.input { min-height: 84px; resize: vertical; line-height: 1.5; }
.bld .input:focus { outline: 3px solid color-mix(in srgb, var(--accent) 28%, transparent); border-color: var(--accent); }
.bld [lang="ar"] .input, .bld .input[lang="ar"] { font-family: "IBM Plex Sans Arabic", sans-serif; font-size: 1.02rem; }
.switch { position: relative; display: inline-block; flex: none; width: 46px; height: 26px; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--line-2); transition: background-color .2s; }
.switch span::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .25); transition: translate .2s var(--ease); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { translate: 20px 0; }
[dir="rtl"] .switch input:checked + span::after { translate: -20px 0; }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.blist { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; position: relative; }
.bsec, .bitem { position: relative; display: grid; align-items: center; gap: .6rem .9rem; padding: .6rem .8rem; border-radius: var(--r-field); background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); }
.bsec { grid-template-columns: auto 1fr auto auto; }
.bsec__label { font-weight: 600; }
.bsec__move, .bitem__tools { display: flex; gap: .3rem; }
.bitem { grid-template-columns: auto 1fr auto; align-items: start; padding: .9rem; }
.bitem__grid { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem .8rem; }
.bitem__grid label { display: grid; gap: .25rem; font-size: .8rem; font-weight: 600; color: var(--muted); }
.bitem__time { grid-column: 1 / -1; max-width: 180px; }
.bitem__tools { flex-direction: column; }
.handle { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: grab; touch-action: none; }
.handle:hover { background: var(--paper-2); color: var(--ink); }
.handle .ico { width: 18px; height: 18px; }
.is-dragging { box-shadow: 0 18px 44px -12px rgb(0 0 0 / .35), inset 0 0 0 1px var(--line-2); background: var(--card); }
.bitems { display: grid; gap: .75rem; padding-top: 1.1rem; border-top: 1px solid var(--line); justify-items: start; }
.bitems .blist { width: 100%; }
@media (max-width: 760px) {
  .bfield { grid-template-columns: 1fr; }
  .bfield__label { padding-top: 0; }
  .bfield .ferr, .bfield__hint { grid-column: 1; }
  .bpair, .bitem__grid { grid-template-columns: 1fr; gap: .9rem; }
  .bitem { grid-template-columns: auto 1fr; }
  .bitem__tools { grid-column: 1 / -1; flex-direction: row; justify-content: end; }
  .bsec { grid-template-columns: auto 1fr auto; }
  .bsec__move { display: none; }
  .bgroup summary { padding: 1rem 1.1rem; }
  .bgroup__body { padding: 0 1.1rem 1.1rem; }
}

/* --- builder: artwork and link ------------------------------------------------------------------ */
.artgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 1rem; }
.artslot { gap: .55rem; padding: .7rem .7rem 1rem; }
.artslot__thumb { display: grid; place-items: center; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 14px; background: var(--bg, var(--paper-2)); box-shadow: inset 0 0 0 1px var(--line); }
.artslot__thumb > svg, .artslot__thumb > img { width: 100%; height: 100%; object-fit: contain; }
.artslot__thumb > .artslot__ico { width: 40px; height: 40px; color: var(--muted); }
.artslot h3, .artslot > p { padding-inline: .3rem; }
.artslot .row { padding-inline: .3rem; gap: .4rem; }
.artslot.is-busy { opacity: .6; pointer-events: none; }
.filebtn { cursor: pointer; }
.slug { display: flex; align-items: center; min-height: 52px; border: 1px solid var(--line-2); border-radius: var(--r-field); background: var(--paper); overflow: hidden; }
.slug:focus-within { outline: 3px solid color-mix(in srgb, var(--accent) 28%, transparent); border-color: var(--accent); }
.slug__base { padding-inline: .9rem .1rem; color: var(--muted); white-space: nowrap; font-size: .95rem; }
.slug__in { flex: 1; min-width: 0; height: 50px; border: 0; background: none; color: var(--ink); font: 600 1rem var(--f-body); outline: none; padding-inline-end: .9rem; }
.slug__in[readonly] { color: var(--muted); }
.has-error .slug { border-color: var(--danger); }
.ogcard { display: grid; grid-template-columns: 112px 1fr; max-width: 460px; overflow: hidden; border-radius: 14px; background: var(--paper-2); box-shadow: inset 0 0 0 1px var(--line); }
.ogcard img { width: 112px; height: 100%; object-fit: cover; }
.ogcard div { display: grid; gap: .15rem; padding: .7rem .9rem; font-size: .85rem; min-width: 0; }
.ogcard b { font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ogcard span { color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ogcard small { color: var(--muted); }
.bcta { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
.bcta p { color: color-mix(in srgb, var(--accent-ink) 80%, transparent); max-width: 52ch; }
.bcta .btn:not(.btn--ghost) { background: var(--accent-ink); color: var(--accent); }
.bcta .btn--ghost { color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent-ink) 40%, transparent); }
.bcta .btn--ghost:hover { background: transparent; border-color: var(--accent-ink); }

/* --- RSVP inbox (docs/milestones/23-replies-page.md) -------------------------------------------------
   One summary panel (the head count, the split, and past a perforated edge the filter), then the
   replies as a list: a card each on a phone, aligned rows on a wide screen. */
.rsum { display: grid; grid-template-columns: minmax(0, 16rem) minmax(0, 1fr); padding: 0; margin-bottom: 1.25rem; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line), 0 24px 50px -38px color-mix(in srgb, var(--ink) 55%, transparent); }
.rsum__count { display: grid; gap: .3rem; align-content: center; padding: 1.3rem 1.6rem; }
.rsum__label { margin: 0; font-size: .9rem; color: var(--muted); }
.rsum__n { margin: 0; font: 600 clamp(3.2rem, 2.4rem + 3vw, 4.2rem)/1 var(--f-display); color: var(--accent); }
.rsum__bar { height: .5rem; margin-top: .55rem; border-radius: 999px; overflow: hidden; background: color-mix(in srgb, var(--danger) 22%, var(--paper-2)); }
.rsum__bar i { display: block; width: var(--yes); height: 100%; background: var(--ok); }
/* The perforation of the invitation card's reply stub: here it parts the count from the filter. */
.rsum__tools { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .9rem 1.25rem; align-items: center; align-content: center; padding: 1.3rem 1.6rem; border-inline-start: 2px dashed var(--line-2); }
.rsum__tools::before, .rsum__tools::after { content: ""; position: absolute; inset-inline-start: -.7rem; width: 1.4rem; height: 1.4rem; border-radius: 50%; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); }
.rsum__tools::before { top: -.7rem; }
.rsum__tools::after { bottom: -.7rem; }
/* The filter: three equal segments, each its count over its name. */
.rseg { display: grid; grid-template-columns: repeat(3, minmax(6.6rem, 1fr)); padding: .25rem; border-radius: 14px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line-2); }
.rseg__a { display: grid; gap: .1rem; justify-items: center; padding: .5rem .5rem .55rem; border-radius: 10px; text-align: center; text-decoration: none; color: var(--ink-2); transition: background .2s var(--ease), color .2s var(--ease); }
.rseg__a b { font: 600 1.5rem/1.1 var(--f-display); color: var(--ink); }
.rseg__a span { display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; font-weight: 500; white-space: nowrap; }
.rseg__a i { width: .45rem; height: .45rem; border-radius: 50%; background: var(--ok); }
.rseg__a--no i { background: color-mix(in srgb, var(--danger) 55%, var(--paper-2)); }
.rseg__a:hover { background: var(--paper-2); }
.rseg__a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rseg__a.is-on { background: var(--accent); color: var(--accent-ink); }
.rseg__a.is-on b { color: inherit; }
.rseg__a.is-on i { background: currentColor; }
.rsearch { display: flex; align-items: center; gap: .5rem; max-width: 30rem; min-height: 46px; padding-inline: .9rem .35rem; border-radius: 999px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line-2); }
.rsearch:focus-within { box-shadow: inset 0 0 0 2px var(--accent); }
.rsearch .ico { flex: none; color: var(--muted); }
.rsearch input { flex: 1; width: 100%; min-width: 0; padding: .5rem 0; border: 0; outline: 0; background: none; color: var(--ink); font: inherit; }
.rsum__shown { grid-column: 1 / -1; margin: 0; }

.replies { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: auto minmax(9rem, 1.1fr) minmax(0, 1.6fr) auto auto; background: var(--card); border-radius: var(--r-surface); box-shadow: inset 0 0 0 1px var(--line); }
.reply { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; gap: .4rem 1.2rem; align-items: center; padding: 1rem 1.3rem; border-top: 1px solid var(--line); }
.reply:first-child { border-top: 0; }
.reply.is-contacted { background: color-mix(in srgb, var(--ok) 6%, transparent); }
.reply__party { margin: 0; display: grid; place-items: center; width: 3.1rem; height: 3.1rem; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font: 600 1.7rem/1 var(--f-display); }
.reply--no .reply__party { background: var(--paper-2); color: var(--muted); font-size: 1.1rem; }
.reply__who { min-width: 0; }
.reply__who h2 { font: 600 1.05rem/1.3 var(--f-body); overflow-wrap: anywhere; }
.reply__co { margin: 0; font-size: .88rem; color: var(--ink-2); }
.reply__when { margin: .15rem 0 0; display: flex; flex-wrap: wrap; gap: .1rem .6rem; align-items: center; font-size: .8rem; color: var(--muted); font-variant-numeric: lining-nums tabular-nums !important; }
.reply__lang { padding: 0 .4rem; border-radius: 4px; box-shadow: inset 0 0 0 1px var(--line-2); font-size: .7rem; font-weight: 600; }
.reply__msg { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink-2); font-size: .95rem; }
.reply__msg:not(:empty) { padding-inline-start: .8rem; border-inline-start: 2px solid var(--champagne); }
.reply__answer { margin: 0; }
.reply__acts { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; justify-content: flex-end; }
.reply__acts form { margin: 0; }
.ract { display: inline-flex; align-items: center; gap: .4rem; min-height: 38px; padding: .3rem .75rem; border: 0; border-radius: 999px; background: none; box-shadow: inset 0 0 0 1px var(--line-2); color: var(--ink); font: 500 .84rem/1 var(--f-body); text-decoration: none; white-space: nowrap; cursor: pointer; transition: box-shadow .2s var(--ease), background .2s var(--ease); }
.ract:hover { box-shadow: inset 0 0 0 1px var(--ink); }
.ract:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ract .ico { width: 1.05rem; height: 1.05rem; }
.ract--wa { color: var(--ok); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ok) 45%, transparent); }
.ract--wa:hover { box-shadow: inset 0 0 0 1px var(--ok); }
.ract--mark .ico { opacity: .35; }
.ract--mark.is-on { background: var(--ok); box-shadow: none; color: #fff; }
.ract--mark.is-on .ico { opacity: 1; }
.ract--del { padding-inline: .6rem; color: var(--danger); }
.ract--del:hover { box-shadow: inset 0 0 0 1px var(--danger); }
.reply--none { display: block; padding: 2.2rem; text-align: center; color: var(--muted); }
.rempty { display: grid; justify-items: center; gap: .6rem; padding: clamp(2.5rem, 7vw, 4.5rem) 1.5rem; text-align: center; }
.rempty .ico { font-size: 2.6rem; color: var(--accent); }
.rempty h2 { font-size: var(--step-2); }
.rempty p { margin: 0 0 .6rem; max-width: 44ch; }

@media (max-width: 1100px) {
  /* The message and the actions drop under the name; the answer stays at the row's end. */
  .replies { grid-template-columns: minmax(0, 1fr); }
  .reply { grid-column: auto; grid-template-columns: 3.1rem minmax(0, 1fr) auto; align-items: start; }
  .reply__msg, .reply__acts { grid-column: 2 / -1; }
  .reply__msg:empty { display: none; }
  .reply__answer { grid-column: 3; grid-row: 1; }
  .reply__acts { justify-content: flex-start; margin-top: .35rem; }
  .rsum__tools { grid-template-columns: minmax(0, 1fr); }
  .rsearch { max-width: none; }
}
@media (max-width: 760px) {
  .rsum { grid-template-columns: minmax(0, 1fr); }
  .rsum__count { padding: 1.2rem 1.2rem 1.1rem; }
  .rsum__tools { padding: 1.1rem 1.2rem 1.2rem; border-inline-start: 0; border-top: 2px dashed var(--line-2); }
  .rsum__tools::before, .rsum__tools::after { top: -.7rem; bottom: auto; }
  .rsum__tools::after { inset-inline: auto -.7rem; }
  .rseg { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rseg__a span { font-size: .74rem; }
  /* Each reply is its own card: everything visible, nothing to scroll sideways for. */
  .replies { gap: .75rem; background: none; box-shadow: none; }
  .reply, .reply:first-child { grid-template-columns: 2.7rem minmax(0, 1fr) auto; gap: .5rem .8rem; padding: 1rem; border: 0; border-radius: var(--r-surface); background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
  .reply.is-contacted { background: color-mix(in srgb, var(--ok) 6%, var(--card)); }
  .reply__party { width: 2.7rem; height: 2.7rem; font-size: 1.45rem; }
  .reply__msg { grid-column: 1 / -1; }
  .reply__acts { grid-column: 1 / -1; padding-top: .75rem; border-top: 1px dashed var(--line-2); }
  .ract { min-height: 42px; }
  .reply__acts form:last-child { margin-inline-start: auto; }
}

/* --- platform admin ------------------------------------------------------------ */
/* A little zoomed out on computers, like the site (design/site.css). */
@media (min-width: 1024px) { html.admin-root { font-size: 90%; } }
.admin {
  /* The Momenti brand (site.css), light only: cherry berry on warm ivory, espresso text. */
  --c-night: var(--momenti-espresso); --c-ivory: var(--momenti-ivory); --c-ivory-2: var(--momenti-champagne);
  --c-gold: var(--momenti-cherry); --c-gold-2: var(--momenti-blush); --c-gold-3: var(--momenti-cherry);
  --a-bg: var(--momenti-ivory); --a-surface: color-mix(in srgb, var(--momenti-ivory) 45%, #fff); --a-ink: var(--momenti-espresso);
  --a-muted: color-mix(in srgb, var(--momenti-espresso) 72%, var(--momenti-ivory));
  --a-line: color-mix(in srgb, var(--momenti-espresso) 12%, transparent); --a-accent: var(--momenti-cherry);
  --a-danger: #a8333f; --a-ok: #2f6b4f;      /* status colours: not in the guidelines */
  margin: 0; min-height: 100vh; background: var(--a-bg); color: var(--a-ink);
  font: 15px/1.5 var(--momenti-font-body);
}
.admin *, .admin *::before, .admin *::after { box-sizing: border-box; }
.admin a { color: inherit; }
.admin h1 { font: 600 2.2rem/1.1 var(--momenti-font-display); margin: 0 0 1.2rem; }
.admin h2 { font: 600 1.1rem/1.3 var(--momenti-font-body); margin: 1.6rem 0 .8rem; }
.a-shell { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.a-side { background: var(--a-ink); color: var(--c-ivory); padding: 1.4rem 1rem; display: flex; flex-direction: column; gap: .2rem; }
.a-brand { display: flex; align-items: center; gap: .6rem; color: var(--c-ivory); --spark: var(--momenti-champagne); padding: 0 .6rem 1.2rem; }
.a-brand__word { height: 22px; width: auto; }
.a-brand span { font: 500 .8rem/1 var(--momenti-font-body); letter-spacing: .08em; text-transform: uppercase; color: var(--c-ivory-2); }
.a-side a { display: block; padding: .55rem .7rem; border-radius: 8px; text-decoration: none; color: var(--c-ivory-2); }
.a-side a:hover, .a-side a.is-active { background: color-mix(in srgb, var(--c-gold) 18%, transparent); color: #fff; }
.a-side .a-sub { padding-inline-start: 1.4rem; font-size: .9rem; }
.a-side .a-spacer { flex: 1; }
.a-main { padding: 2rem clamp(1rem, 3vw, 2.6rem); max-width: 1180px; width: 100%; }
.a-card { background: var(--a-surface); border: 1px solid var(--a-line); border-radius: 12px; padding: 1.3rem; }
.a-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; }
.a-stat b { display: block; font: 600 2.2rem/1.1 var(--momenti-font-display); }
.a-stat span { color: var(--a-muted); font-size: .85rem; }
.a-flash { padding: .75rem 1rem; border-radius: 12px; background: color-mix(in srgb, var(--momenti-blush) 46%, #fff); border: 1px solid color-mix(in srgb, var(--momenti-cherry) 25%, transparent); margin-bottom: 1rem; }
.a-btn {
  display: inline-flex; align-items: center; gap: .4rem; padding: .55rem 1rem; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--a-ink); background: var(--a-ink); color: #fff; font: inherit; text-decoration: none;
}
.a-btn--ghost { background: transparent; color: var(--a-ink); }
.a-btn--danger { background: var(--a-danger); border-color: var(--a-danger); }
.a-btn--sm { padding: .3rem .6rem; font-size: .85rem; }
.a-row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.a-field { display: grid; gap: .3rem; margin-bottom: 1rem; }
.a-field label { font-size: .85rem; color: var(--a-muted); }
.a-field input, .a-field textarea, .a-field select {
  width: 100%; padding: .55rem .7rem; border: 1px solid var(--a-line); border-radius: 8px; background: #fff; font: inherit; color: inherit;
}
.a-field textarea { min-height: 90px; resize: vertical; }
.a-field [dir="rtl"] { font-family: "IBM Plex Sans Arabic", sans-serif; font-size: 1.05rem; }
.a-error { color: var(--a-danger); font-size: .85rem; }
.a-auth { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.a-auth .a-card { width: min(100%, 380px); }
@media (max-width: 760px) {
  .a-shell { grid-template-columns: 1fr; }
  .a-side { flex-direction: row; flex-wrap: wrap; padding: .8rem; }
  .a-brand { width: 100%; padding-bottom: .4rem; }
  .a-side .a-spacer { display: none; }
}

/* --- milestone 4 ------------------------------------------------------------ */
.a-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .6rem; }
.a-head h1 { margin: 0; }
.a-hint { color: var(--a-muted); margin: 0 0 1rem; max-width: 70ch; }
.a-muted { color: var(--a-muted); }
.a-nowrap { white-space: nowrap; }
.a-navhead { margin: 1rem .7rem .2rem; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: color-mix(in srgb, var(--c-ivory) 55%, transparent); }
.a-form { display: grid; gap: 0; }
.a-group { margin-bottom: 1rem; }
.a-group h2 { margin-top: 0; }
.a-fieldrow { display: grid; grid-template-columns: 220px 1fr; gap: .4rem 1.2rem; align-items: start; padding: .8rem 0; border-bottom: 1px solid var(--a-line); }
.a-fieldrow:last-of-type { border-bottom: 0; }
.a-fieldrow__label label { font-weight: 500; }
.a-fieldrow .a-error { grid-column: 2; margin: 0; }
.a-fieldrow.has-error :is(input, textarea, select) { border-color: var(--a-danger); }
.a-pair { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.a-lang { position: relative; }
.a-tag { display: inline-block; min-width: 1.6rem; padding: 0 .35rem; border-radius: 4px; background: color-mix(in srgb, var(--momenti-blush) 46%, #fff); color: var(--a-muted); font-size: .72rem; text-align: center; line-height: 1.5; }
.a-lang > .a-tag { position: absolute; top: -.55rem; inset-inline-end: .5rem; }
.admin :is(input:not([type=checkbox]):not([type=hidden]), textarea, select) {
  width: 100%; padding: .55rem .7rem; border: 1px solid var(--a-line); border-radius: 8px; background: #fff; font: inherit; color: inherit;
}
.admin textarea { resize: vertical; }
.admin [dir="rtl"] :is(input, textarea) { font-family: "IBM Plex Sans Arabic", sans-serif; font-size: 1.08rem; }
.admin :is(input, textarea, select):focus { outline: 2px solid color-mix(in srgb, var(--c-gold) 55%, transparent); outline-offset: 0; border-color: var(--c-gold-3); }
.a-switch { position: relative; display: inline-block; width: 42px; height: 24px; }
.a-switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.a-switch span { position: absolute; inset: 0; border-radius: 999px; background: color-mix(in srgb, var(--momenti-champagne) 80%, var(--momenti-ivory)); transition: background .2s; }
.a-switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgb(0 0 0 / .25); }
.a-switch input:checked + span { background: var(--a-ok); }
.a-switch input:checked + span::after { transform: translateX(18px); }
.a-switch input:focus-visible + span { outline: 2px solid var(--c-gold); outline-offset: 2px; }
.a-actions { display: flex; flex-wrap: wrap; gap: .6rem; padding-top: 1rem; }
.a-inline { display: inline-flex; align-items: center; gap: .5rem; color: var(--a-muted); font-size: .9rem; }
.a-inline select { width: auto; }

.a-items, .a-sections { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; position: relative; }
.a-item, .a-section { position: relative; display: grid; grid-template-columns: auto 1fr auto; gap: .8rem; align-items: start; padding: .9rem; border: 1px solid var(--a-line); border-radius: 10px; background: var(--a-surface); }
.a-section { grid-template-columns: auto 1fr auto auto auto; align-items: center; }
.a-section--fixed { grid-template-columns: 1fr auto auto; margin-bottom: .6rem; background: var(--a-bg); }
.a-section__label { font-weight: 500; }
.a-section__move { display: flex; gap: .3rem; }
.a-handle { cursor: grab; border: 0; background: none; font-size: 1.2rem; line-height: 1; padding: .3rem .2rem; color: var(--a-muted); touch-action: none; }
.is-dragging { box-shadow: 0 14px 40px rgb(0 0 0 / .18); background: #fff; }
.a-item__grid { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem .8rem; }
.a-item__grid label { display: grid; gap: .25rem; font-size: .82rem; color: var(--a-muted); }
.a-item__time { grid-column: 1 / -1; max-width: 200px; }
.a-item__tools { display: flex; flex-direction: column; gap: .3rem; }

.a-filters { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; margin: 1rem 0; }
.a-filters input[type=search] { width: min(320px, 100%); }
.a-count { margin-inline-start: auto; color: var(--a-muted); font-size: .9rem; }
.a-table-wrap { overflow-x: auto; padding: 0; }
.a-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.a-table th { text-align: start; font-weight: 500; color: var(--a-muted); font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; }
.a-table :is(th, td) { padding: .7rem .8rem; border-bottom: 1px solid var(--a-line); vertical-align: top; }
.a-table tr:last-child td { border-bottom: 0; }
.a-table tr.is-contacted td { background: color-mix(in srgb, var(--a-ok) 5%, #fff); }
.a-msg { max-width: 280px; white-space: pre-wrap; }
.a-empty { text-align: center; color: var(--a-muted); padding: 2rem !important; }
.a-pill { display: inline-block; padding: .1rem .6rem; border-radius: 999px; font-size: .8rem; font-weight: 500; }
.a-pill--yes { background: color-mix(in srgb, var(--a-ok) 14%, #fff); color: var(--a-ok); }
.a-pill--no { background: color-mix(in srgb, var(--a-danger) 13%, #fff); color: var(--a-danger); }
.a-wa { font-size: .78rem; margin-inline-start: .3rem; color: var(--a-ok); }
.a-check { border: 1px solid var(--a-line); background: #fff; border-radius: 999px; padding: .25rem .7rem; font: inherit; font-size: .82rem; cursor: pointer; white-space: nowrap; }
.a-check.is-on { background: var(--a-ok); border-color: var(--a-ok); color: #fff; }
.a-main h2 { display: flex; gap: .5rem; align-items: baseline; }

@media (max-width: 760px) {
  .a-fieldrow { grid-template-columns: 1fr; }
  .a-fieldrow .a-error { grid-column: 1; }
  .a-pair, .a-item__grid { grid-template-columns: 1fr; }
  .a-item { grid-template-columns: auto 1fr; }
  .a-item__tools { grid-column: 1 / -1; flex-direction: row; }
  .a-section { grid-template-columns: auto 1fr; }
  .a-section .a-inline, .a-section__move { grid-column: 2; }
}

/* Buttons that are links: the generic .admin a colour must not win. */
.admin a.a-btn { color: #fff; }
.admin a.a-btn--ghost { color: var(--a-ink); }
.a-lbl { display: flex; align-items: center; gap: .4rem; }
.a-item__tools .a-btn--ghost, .a-section__move .a-btn--ghost { min-width: 34px; justify-content: center; font-size: 1rem; color: var(--a-ink); }
@media (max-width: 760px) {
  .a-side { flex-wrap: nowrap; overflow-x: auto; gap: .1rem; -webkit-overflow-scrolling: touch; }
  .a-side .a-brand { display: none; }
  .a-side .a-navhead { display: none; }
  .a-side a { white-space: nowrap; }
  .a-side .a-sub { padding-inline-start: .7rem; }
}
.a-brand { text-decoration: none; }

/* --- publish: packages and the receipt ------------------------------------------------ */
.pkgs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: .75rem; }
.pkg { position: relative; display: block; cursor: pointer; }
.pkg input { position: absolute; inset-block-start: 1rem; inset-inline-end: 1rem; accent-color: var(--accent); width: 1.1rem; height: 1.1rem; }
.pkg__body {
  display: grid; gap: .35rem; height: 100%; padding: 1.1rem 1.2rem; border-radius: var(--r-field);
  box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .2s, background .2s;
}
.pkg:hover .pkg__body { box-shadow: inset 0 0 0 1px var(--ink-2); }
.pkg input:checked + .pkg__body { box-shadow: inset 0 0 0 2px var(--accent); background: var(--accent-soft); }
.pkg input:focus-visible + .pkg__body { outline: 2px solid var(--accent); outline-offset: 2px; }
.pkg__name { font-weight: 700; padding-inline-end: 1.6rem; }
.pkg__price b { font: 600 2rem/1 var(--f-display); }
.pkg__feats { font-size: .88rem; color: var(--ink-2); }
.pkg__term { font-size: .82rem; color: var(--muted); }
.bcard .addon { margin: 0; }
.receipt { display: grid; gap: 1rem; max-width: 760px; }
.receipt .apphead { margin-bottom: .2rem; }
.receipt .stamp { color: var(--accent); }
.receipt__link { font-size: 1.1rem; font-weight: 600; overflow-wrap: anywhere; }
.receipt__link a { color: inherit; }
.receipt__dl { display: grid; grid-template-columns: max-content 1fr; gap: .5rem 1.5rem; margin: 0; }
.receipt__dl dt { color: var(--muted); }
.receipt__dl dd { margin: 0; font-weight: 600; }

/* --- milestone 7: the platform admin ---------------------------------------------- */
.a-card { border-radius: 16px; }
.a-btn { border-radius: 999px; }
.a-btn:not(.a-btn--ghost):not(.a-btn--danger) { background: var(--a-ink); border-color: var(--a-ink); }
.a-side { background: var(--a-ink); }
.a-side a.is-active { background: color-mix(in srgb, var(--a-accent) 55%, transparent); }
.a-stat--link { text-decoration: none; transition: box-shadow .2s; }
.a-stat--link:hover { box-shadow: inset 0 0 0 1px var(--a-ink); }
.a-temp { margin-bottom: 1rem; border-color: var(--a-accent); }
.a-temp code { font-size: 1.2rem; padding: .3rem .6rem; border-radius: 8px; background: var(--a-bg); user-select: all; }
.a-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 1rem; }
.a-grid .a-card h2 { margin-top: 0; }
.admin .a-num { width: 5.5rem; }
.a-narrow { max-width: 560px; }
.a-filters select { width: auto; }
.a-main { min-width: 0; }
.a-table form.a-row { flex-direction: column; align-items: stretch; gap: .35rem; }
.admin .a-table input[name=note] { width: 9rem; }
.a-note { margin: 0 0 .4rem; }

/* Beside the preview the form column is narrower: labels go above their fields. */
@media (min-width: 1024px) and (max-width: 1239px) {
  .bld--pv .bfield { grid-template-columns: 1fr; }
  .bld--pv .bfield__label { padding-top: 0; }
  .bld--pv .bfield .ferr, .bld--pv .bfield__hint { grid-column: 1; }
}

/* --- design with AI -------------------------------------------------------------------- */
.aid { display: grid; gap: 1.6rem; max-width: 860px; }
.aid--view { max-width: none; }
.aid__head h1 { font-size: var(--step-4); }
.aid__eyebrow { display: inline-flex; align-items: center; gap: .45rem; color: var(--accent); }
.aid__eyebrow a { display: inline-flex; align-items: center; gap: .45rem; }
.aid__eyebrow .ico { width: 1.1em; height: 1.1em; }
.aid__form { display: grid; gap: 1rem; }
.aiq { border: 0; margin: 0; }
/* A legend floated inside its fieldset sits in the card, not on its border. */
.aiq__q { float: inline-start; width: 100%; display: flex; align-items: center; gap: .7rem; padding: 0; font: 600 1.3rem/1.3 var(--f-display); }
.aiq__q + * { clear: both; }
.aiq__n { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: .9rem; }
.aid .input { width: 100%; min-height: 46px; padding: .6rem .85rem; border: 1px solid var(--line-2); border-radius: var(--r-field); background: var(--paper); color: var(--ink); font: inherit; }
.aid textarea.input { resize: vertical; line-height: 1.5; }
.aid .input:focus { outline: 3px solid color-mix(in srgb, var(--accent) 28%, transparent); border-color: var(--accent); }
.aicol { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: .6rem; }
.aicol__o { position: relative; display: flex; align-items: center; gap: .6rem; padding: .5rem .8rem .5rem .5rem; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line-2); font-size: .9rem; font-weight: 500; cursor: pointer; }
.aicol__o input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.aicol__o:has(input:checked) { box-shadow: inset 0 0 0 2px var(--accent); }
.aicol__o:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
.aicol__sw { flex: none; width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(135deg, var(--a) 50%, var(--b) 50%); box-shadow: inset 0 0 0 1px var(--line-2); }
.aicol__sw--any { background: conic-gradient(var(--momenti-cherry), var(--momenti-blush), var(--momenti-champagne), var(--momenti-ivory), var(--momenti-cherry)); }
.aid__go { display: grid; justify-items: start; gap: .5rem; padding-top: .4rem; }
.aid__go .ico { width: 1.2em; height: 1.2em; }
.aid__mine h2 { font-size: 1.2rem; margin-bottom: .6rem; }
.aimine { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.aimine a { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .7rem 1rem; border-radius: var(--r-field); background: var(--card); box-shadow: inset 0 0 0 1px var(--line); text-decoration: none; }
.aimine a:hover { box-shadow: inset 0 0 0 1px var(--ink); }
.pill--ready { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.pill--failed { background: color-mix(in srgb, var(--danger) 13%, transparent); color: var(--danger); }
.pill--running, .pill--queued { background: var(--accent-soft); color: var(--ink); }
/* Progress: each stage lights as the worker reaches it. */
.aisteps { list-style: none; margin: 0; padding: 0; display: grid; gap: .8rem; max-width: 520px; }
.aisteps li { display: flex; align-items: center; gap: .8rem; color: var(--muted); font-weight: 500; }
.aisteps li::before { content: ""; flex: none; width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--line-2); }
.aisteps li.is-on { color: var(--ink); }
.aisteps li.is-on::before { box-sizing: border-box; box-shadow: none; border: 3px solid var(--accent-soft); border-top-color: var(--accent); animation: aispin .9s linear infinite; }
.aisteps li.is-done { color: var(--ink); }
.aisteps li.is-done::before { box-shadow: none; background: var(--ok) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 8.3 7 10.7l4.6-5' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat; }
@keyframes aispin { to { rotate: 360deg; } }
@media (prefers-reduced-motion: reduce) { .aisteps li.is-on::before { animation: none; } }
/* The result: the words and choices beside the design playing itself in a phone. */
.aires { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 2.5rem; align-items: center; }
.aires__info { display: grid; gap: 1.1rem; align-content: start; }
.aires__info h1 { font-size: var(--step-4); }
.aires__pals { display: flex; flex-wrap: wrap; gap: .5rem; }
.aires .pv__phone { width: min(100%, 320px, calc((100dvh - 168px) * 390 / 844)); }
@media (max-width: 860px) { .aires { grid-template-columns: 1fr; } .aires .pv { order: -1; } .aires .pv__phone { width: min(100%, 280px); } }

/* --- builder: the song card on the artwork step --------------------------------------- */
.musiccard__head { display: flex; gap: 1rem; align-items: center; }
.musiccard__ico { display: grid; place-items: center; flex: none; width: 46px; height: 46px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); font-size: 1.5rem; }
.musiccard__now { display: grid; gap: .35rem; padding: .9rem 1rem; border-radius: var(--r-field); background: var(--paper-2); }
.musiccard__now audio { width: 100%; height: 40px; }
.musiccard .bfield { border-top: 0; padding-block: 0; }
.musiccard.is-busy { opacity: .6; pointer-events: none; }

/* --- milestone 15: signed in as a client ------------------------------------------ */
.imp { background: var(--momenti-espresso); color: var(--momenti-ivory); }
.imp .wrap { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; justify-content: space-between; padding-block: .55rem; font-size: .9rem; }
.imp form { margin: 0; }

/* --- milestone 15: admin charts and the user page ---------------------------------- */
.a-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; }
.a-bars { display: flex; align-items: flex-end; gap: 3px; height: 110px; margin-top: .6rem; }
.a-bars span { flex: 1; min-width: 4px; min-height: 2px; border-radius: 3px 3px 0 0; background: var(--a-accent); opacity: .8; }
.a-bars span:hover { opacity: 1; }
.a-axis { display: flex; justify-content: space-between; margin-top: .3rem; color: var(--a-muted); font-size: .75rem; }
.a-hbar { display: grid; grid-template-columns: 150px 1fr 3ch; gap: .6rem; align-items: center; font-size: .9rem; padding: .22rem 0; }
.a-hbar i { display: block; height: 10px; border-radius: 5px; background: var(--a-accent); opacity: .75; }
.a-hbar b { text-align: end; font-weight: 500; }
.a-user { display: flex; flex-wrap: wrap; gap: .6rem 1.4rem; align-items: baseline; color: var(--a-muted); margin-bottom: 1rem; }
.a-user b { color: var(--a-ink); font-weight: 500; }
.a-pill--off { background: color-mix(in srgb, var(--momenti-champagne) 40%, var(--momenti-ivory)); color: var(--a-muted); }
.a-form-inline { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.a-form-inline input { width: min(100%, 280px); }
.a-list { list-style: none; margin: 0; padding: 0; }
.a-list li { padding: .45rem 0; border-bottom: 1px solid var(--a-line); font-size: .9rem; }
.a-list li:last-child { border-bottom: 0; }
.a-time { color: var(--a-muted); font-size: .8rem; white-space: nowrap; }

/* --- milestone 17: the set-once date, the music library ------------------------------ */
.datepick { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.datepick .input { flex: 1 1 13rem; width: auto; }
.datelock { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.datelock__day { display: inline-flex; align-items: center; gap: .45rem; min-height: 46px; padding: .5rem .9rem; border-radius: var(--r-field); background: var(--paper-2); font-variant-numeric: lining-nums tabular-nums !important; }
.datelock__day .ico { color: var(--muted); }
.datelock .input { width: auto; flex: 0 1 9rem; }

.tracks__head { margin: 1rem 0 .5rem; font: 600 .8rem/1.2 var(--f-body); letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
:root[lang="ar"] .tracks__head { letter-spacing: 0; font-size: .95rem; }
.tracks { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.track { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .8rem; align-items: center; padding: .55rem .7rem; border-radius: var(--r-field); box-shadow: inset 0 0 0 1px var(--line); }
.track.is-on { box-shadow: inset 0 0 0 2px var(--accent); background: var(--accent-soft); }
.track__play { display: grid; place-items: center; width: 42px; height: 42px; border: 0; border-radius: 50%; background: var(--ink); color: var(--paper); font-size: 1.05rem; cursor: pointer; }
.track__play:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.track__i-pause, .track.is-playing .track__i-play { display: none; }
.track.is-playing .track__i-pause { display: block; }
.track.is-playing .track__play { background: var(--accent); color: var(--accent-ink); }
.track__name { display: grid; min-width: 0; }
.track__name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.track__name small { color: var(--muted); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
[data-lib].is-busy { opacity: .6; pointer-events: none; }

/* --- milestone 17: the phone editor --------------------------------------------------
   Under 1024 px a builder tab with a preview fills the screen: a slim bar, the invitation
   as a whole phone scaled to the space left, and .bsheet as a bottom sheet with the tabs
   and the tab's form. --sheet-h is the sheet's height: data-sheet picks one of three, and
   app.js sets it directly while the grip is dragged. The preview never sits behind the
   sheet up to its half height; above that the sheet covers it. */
@media (max-width: 1023px) {
  .app--editor .topbar, .app--editor .imp { display: none; }
  .app--editor .flashes { position: fixed; z-index: 90; top: 3.75rem; inset-inline: .75rem; padding: 0; animation: flashout .4s 6s forwards; }
  .bld--pv {
    --bar-h: 3.25rem; --sheet-h: 58dvh; --half: 58dvh;       /* enough of the form to work in; the invitation stays whole above */
    position: fixed; inset: 0; z-index: 70; display: block; background: var(--paper-2); overflow: hidden;
  }
  .bld--pv[data-sheet="peek"] { --sheet-h: 5.75rem; }
  .bld--pv[data-sheet="full"] { --sheet-h: calc(100dvh - var(--bar-h) - .5rem); }

  .bld--pv .bld__head {
    position: absolute; z-index: 3; top: 0; inset-inline: 0; height: var(--bar-h); flex-wrap: nowrap; gap: .5rem;
    padding: 0 .6rem; background: var(--card); border-bottom: 1px solid var(--line);
  }
  .bld--pv .bld__back { display: grid; place-items: center; flex: none; width: 2.4rem; height: 2.4rem; border-radius: 50%; color: var(--ink); font-size: 1.15rem; }
  .bld--pv .bld__title { flex: 1 1 0; }
  .bld--pv .bld__title .eyebrow { display: none; }
  .bld--pv .bld__head h1 { font: 600 1rem/1.2 var(--f-body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  [lang="ar"] .bld--pv .bld__head h1 { font-family: "IBM Plex Sans Arabic", sans-serif; }
  .bld--pv .bld__head .pill { flex: none; }
  /* The saved state as a dot: its text stays for screen readers. */
  .bld--pv .bld__head .bstatus { flex: none; min-width: 0; width: 10px; height: 10px; padding: 0; overflow: hidden; background: none; box-shadow: none; color: transparent; font-size: 0; }
  .bld--pv .bld__head .bstatus::before { flex: none; width: 10px; height: 10px; }
  .bld--pv .bld__go { flex: none; }

  .bld--pv .bsplit { display: block; }
  .bld--pv .bsplit__side {
    position: absolute; top: var(--bar-h); inset-inline: 0; bottom: min(var(--sheet-h), var(--half));
    display: grid; place-items: center; padding: .4rem .75rem; transition: bottom .35s var(--ease);
  }
  .bld--pv .pv { gap: .4rem; width: 100%; }
  .bld--pv .pv__bar { order: -1; gap: .4rem; }
  .bld--pv .pv__bar .btn, .bld--pv .seg__b { min-height: 30px; padding-block: .2rem; font-size: .78rem; }
  .bld--pv .pv__phone {
    width: min(100%, calc((100dvh - var(--bar-h) - min(var(--sheet-h), var(--half)) - 3.6rem) * 390 / 844));
    padding: 5px; border-radius: 28px; transition: width .35s var(--ease);
  }
  /* The screen, not the frame, keeps the phone's proportions, and the page inside is laid
     out at a constant 390 by 844: resizing the sheet only rescales it, so the invitation
     never rebuilds its animations while the client drags. */
  .bld--pv .pv__phone { aspect-ratio: auto; }
  .bld--pv .pv__screen { height: auto; aspect-ratio: 390 / 844; border-radius: 23px; }
  .bld--pv .pv__screen iframe { height: 844px; }

  .bld--pv .bsheet {
    position: absolute; z-index: 4; inset-inline: 0; bottom: 0; height: var(--sheet-h); max-height: calc(100dvh - var(--bar-h));
    display: flex; flex-direction: column; background: var(--paper); border-radius: 22px 22px 0 0;
    box-shadow: 0 -10px 34px -8px rgb(48 40 39 / .28); transition: height .35s var(--ease);
  }
  .bld--pv .bsheet.is-dragging, .bld--pv:has(.is-dragging) :is(.bsplit__side, .pv__phone) { transition: none; }
  /* The handle row and the tab bar are both the sheet's handle (app.js): a finger's width tall,
     with a button that says what it does. The tabs keep their sideways scroll. */
  .bld--pv .bsheet__top { position: relative; display: block; flex: none; touch-action: none; }
  .bld--pv .bsheet__grip { display: grid; place-items: center; width: 100%; height: 2.6rem; border: 0; background: none; cursor: grab; touch-action: none; }
  .bld--pv .bsheet__grip i { width: 56px; height: 5px; border-radius: 3px; background: var(--line-2); }
  .bld--pv .bsheet__grip:focus-visible i { background: var(--accent); }
  .bld--pv .bsheet__size {
    position: absolute; top: .35rem; inset-inline-end: .6rem; display: inline-flex; align-items: center; gap: .3rem;
    min-height: 1.9rem; padding-block: .25rem; padding-inline: .55rem .75rem; border: 0; border-radius: 999px; background: var(--paper-2); color: var(--ink-2);
    font: 600 .78rem/1 var(--f-body); cursor: pointer; touch-action: manipulation;
  }
  [lang="ar"] .bld--pv .bsheet__size { font-family: "IBM Plex Sans Arabic", sans-serif; }
  .bld--pv .bsheet__size:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .bld--pv .bsheet__caret { rotate: 180deg; transition: rotate .25s var(--ease); }
  .bld--pv[data-sheet="full"] .bsheet__caret { rotate: 0deg; }
  .bld--pv:not([data-sheet="full"]) .bsheet__size [data-less], .bld--pv[data-sheet="full"] .bsheet__size [data-more] { display: none; }
  .bld--pv .bsteps { touch-action: pan-x; }

  .bld--pv .bsteps { flex: none; margin: 0; padding: 0 .35rem; border-bottom: 1px solid var(--line); }
  .bld--pv .bsteps__where, .bld--pv .bsteps li + li::before { display: none; }
  .bld--pv .bsteps__num, .bld--pv .bsteps__a.is-done .bsteps__check { display: none; }
  .bld--pv .bsteps__ico { display: block; }
  .bld--pv .bsteps ol { gap: 0; }
  .bld--pv .bsteps__a {
    flex-direction: column; gap: .15rem; min-width: 4.4rem; padding: .25rem .5rem .5rem; border-radius: 0; background: none;
    box-shadow: none; border-bottom: 2px solid transparent; font-size: .74rem; color: var(--muted);
  }
  .bld--pv a.bsteps__a:hover { box-shadow: none; }
  .bld--pv .bsteps__n { width: auto; height: auto; background: none; font-size: 1.3rem; }
  .bld--pv .bsteps__a.is-on { background: none; color: var(--accent); border-bottom-color: var(--accent); box-shadow: none; }
  .bld--pv .bsteps__a.is-done { color: var(--ink); box-shadow: none; }
  .bld--pv .bsteps__a.is-done .bsteps__n { background: none; color: inherit; font-size: 1.3rem; }
  .bld--pv .bsteps__a.is-on .bsteps__n { background: none; color: inherit; }

  .bld--pv .bsheet__body {
    flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; gap: 1rem;
    padding: 1rem 1rem 0;            /* the bar below carries the bottom space */
  }
  .bld--pv[data-sheet="peek"] .bsheet__body { visibility: hidden; }
  /* Back, where you are, Next: stuck to the bottom of the sheet (and above the keyboard). */
  .bld--pv .bld__foot {
    flex-wrap: nowrap; gap: .5rem; margin-inline: -1rem; padding: .5rem .75rem calc(.6rem + env(safe-area-inset-bottom) + var(--kb, 0px));
    background: var(--paper); box-shadow: 0 -8px 18px -12px rgb(48 40 39 / .35);
  }
  .bld--pv .bld__foot .btn { min-height: 2.6rem; padding: .45rem .9rem; font-size: .85rem; white-space: nowrap; }
  .bld--pv .bld__where { font-size: .78rem; }
  .bld--pv .bld__where span { display: none; }
  .bld--pv .bnote { padding: .5rem .75rem; gap: .5rem; font-size: .8rem; line-height: 1.4; }
  .bld--pv .bcard { padding: 1rem; }
  .bld--pv .bcard :is(h2, h3) { font: 600 1.05rem/1.35 var(--f-body); }
  .bld--pv .artgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
  .bld--pv .pkgs { grid-template-columns: 1fr; }
}
@keyframes flashout { to { opacity: 0; visibility: hidden; } }
@media (prefers-reduced-motion: reduce) {
  .bld--pv .bsheet, .bld--pv .bsplit__side, .bld--pv .pv__phone { transition: none; }
}

/* --- milestone 20: the client's own area ----------------------------------------------
   The subject's own material: a wax seal for the account, invitations as cards with a
   reply stub under a tear line, the next date said as a sentence. */

/* The seal: the account's monogram on a wax disc with a scalloped edge. */
.seal {
  display: grid; place-items: center; flex: none; width: 2.6rem; height: 2.6rem; background: var(--accent); color: var(--accent-ink);
  clip-path: polygon(100.0% 50.0%, 98.4% 54.2%, 95.1% 58.0%, 92.9% 61.5%, 93.0% 65.7%, 94.0% 70.5%, 93.3% 75.0%, 89.8% 77.9%, 85.1% 79.4%, 81.4% 81.4%, 79.4% 85.1%, 77.9% 89.8%, 75.0% 93.3%, 70.5% 94.0%, 65.7% 93.0%, 61.5% 92.9%, 58.0% 95.1%, 54.2% 98.4%, 50.0% 100.0%, 45.8% 98.4%, 42.0% 95.1%, 38.5% 92.9%, 34.3% 93.0%, 29.5% 94.0%, 25.0% 93.3%, 22.1% 89.8%, 20.6% 85.1%, 18.6% 81.4%, 14.9% 79.4%, 10.2% 77.9%, 6.7% 75.0%, 6.0% 70.5%, 7.0% 65.7%, 7.1% 61.5%, 4.9% 58.0%, 1.6% 54.2%, 0.0% 50.0%, 1.6% 45.8%, 4.9% 42.0%, 7.1% 38.5%, 7.0% 34.3%, 6.0% 29.5%, 6.7% 25.0%, 10.2% 22.1%, 14.9% 20.6%, 18.6% 18.6%, 20.6% 14.9%, 22.1% 10.2%, 25.0% 6.7%, 29.5% 6.0%, 34.3% 7.0%, 38.5% 7.1%, 42.0% 4.9%, 45.8% 1.6%, 50.0% 0.0%, 54.2% 1.6%, 58.0% 4.9%, 61.5% 7.1%, 65.7% 7.0%, 70.5% 6.0%, 75.0% 6.7%, 77.9% 10.2%, 79.4% 14.9%, 81.4% 18.6%, 85.1% 20.6%, 89.8% 22.1%, 93.3% 25.0%, 94.0% 29.5%, 93.0% 34.3%, 92.9% 38.5%, 95.1% 42.0%, 98.4% 45.8%);
  font: 600 1.05rem/1 var(--f-display); letter-spacing: .02em; cursor: pointer; list-style: none; position: relative;
}
.seal::-webkit-details-marker { display: none; }
.seal::after { content: ""; position: absolute; inset: 13%; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--accent-ink) 40%, transparent); }
.seal > span { position: relative; translate: 0 -.04em; }
[lang="ar"] .seal { font-family: "IBM Plex Sans Arabic", sans-serif; font-size: .9rem; }
.seal--xl { width: 7.5rem; height: 7.5rem; font-size: 3rem; cursor: default; }
[lang="ar"] .seal--xl { font-size: 2.4rem; }
.acct { position: relative; }
.acct[open] > .seal, .acct > .seal:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 50%; }
.acct__menu, .more__menu {
  position: absolute; z-index: 40; inset-inline-end: 0; top: calc(100% + .6rem); min-width: 15rem; padding: .4rem; display: grid; gap: .1rem;
  background: var(--card); border-radius: 12px; box-shadow: 0 30px 70px -30px color-mix(in srgb, var(--ink) 60%, transparent), inset 0 0 0 1px var(--line);
}
.acct__who { margin: 0; display: grid; gap: .1rem; padding: .7rem .8rem .8rem; border-bottom: 1px solid var(--line); margin-bottom: .3rem; }
.acct__who b { font: 600 1.25rem/1.2 var(--f-display); }
.acct__who span { color: var(--muted); font-size: .85rem; overflow: hidden; text-overflow: ellipsis; }
.acct__menu a, .more__menu a, .more__menu button {
  display: flex; align-items: center; gap: .7rem; width: 100%; padding: .65rem .8rem; border: 0; border-radius: 8px; background: none;
  color: var(--ink); font: inherit; font-size: .95rem; text-align: start; text-decoration: none; cursor: pointer;
}
.acct__menu a:hover, .more__menu a:hover, .more__menu button:hover, .acct__menu a:focus-visible, .more__menu :is(a, button):focus-visible { background: var(--paper-2); outline: none; }
.acct__menu .ico, .more__menu .ico { color: var(--muted); font-size: 1.15rem; }
.more__menu form { margin: 0; }
.more__menu .is-danger, .more__menu .is-danger .ico { color: var(--danger); }

/* A phone: the way around is a bar at the bottom, with a round New in the middle. */
.dock { display: none; }
@media (max-width: 900px) {
  .dock {
    position: fixed; z-index: 45; inset-inline: 0; bottom: 0; display: grid; grid-template-columns: 1fr 1fr auto 1fr 1fr; align-items: end;
    padding: .35rem .5rem calc(.35rem + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--card) 94%, transparent);
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-top: 1px solid var(--line);
  }
  .dock a { display: grid; justify-items: center; gap: .15rem; padding: .35rem .2rem; color: var(--muted); font-size: .7rem; font-weight: 600; text-decoration: none; }
  .dock a .ico { font-size: 1.4rem; }
  .dock a.is-on { color: var(--accent); }
  .dock .dock__new { align-self: center; width: 3.4rem; height: 3.4rem; margin: -1.3rem .4rem 0; place-content: center; border-radius: 50%; background: var(--accent); color: var(--accent-ink); box-shadow: 0 10px 24px -10px var(--accent); }
  .dock .dock__new .ico { font-size: 1.5rem; }
  body:has(.dock) .appmain { padding-bottom: 6.5rem; }
}

/* The desk: who, the next date as a sentence, one line of where things stand. */
.desk { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1.5rem 3rem; align-items: end; padding-block: clamp(1.5rem, 4vw, 3.5rem) clamp(1.5rem, 3vw, 2.75rem); }
.desk__hello { margin: 0 0 .6rem; font-size: 1.1rem; color: var(--muted); }
.desk h1 { font-size: clamp(2.4rem, 1.5rem + 3.6vw, 4.6rem); line-height: 1.02; max-width: 18ch; text-wrap: balance; overflow-wrap: anywhere; }
[lang="ar"] .desk h1 { line-height: 1.4; }
.desk__sum { margin: 1rem 0 0; font-size: 1.1rem; color: var(--ink-2); }
.desk__do { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }

/* An invitation: the cover and what it is above the tear line; who is coming and what
   to do next on the stub below it. The notches are the page showing through. */
.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19.5rem), 1fr)); gap: 1.6rem; align-items: stretch; }
.icard { position: relative; display: grid; grid-template-rows: auto 1fr auto; min-width: 0; background: var(--card); border-radius: 10px; box-shadow: inset 0 0 0 1px var(--line), 0 24px 50px -36px color-mix(in srgb, var(--ink) 55%, transparent); }
.icard__face { display: block; margin: .6rem .6rem 0; border-radius: 5px; overflow: hidden; aspect-ratio: 400 / 300; background: var(--bg, var(--paper-2)); }
.icard__face img { display: block; width: 100%; height: 100%; object-fit: cover; }
.icard--paused .icard__face img, .icard--expired .icard__face img { filter: grayscale(.7); opacity: .75; }
.icard__body { display: grid; gap: .55rem; align-content: start; padding: 1.1rem 1.25rem 1.2rem; min-width: 0; }
.icard__top { margin: 0; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.icard__tpl { font-size: .85rem; color: var(--muted); }
.icard h3 { font-size: 1.85rem; line-height: 1.1; overflow-wrap: anywhere; }
[lang="ar"] .icard h3 { line-height: 1.4; font-size: 1.6rem; }
.icard h3 a { color: inherit; text-decoration: none; }
.icard h3 a:hover, .icard h3 a:focus-visible { color: var(--accent); outline: none; }
.icard__when { margin: 0; display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; font-size: .95rem; }
.icard__when .ico { color: var(--accent); font-size: 1.1rem; }
.icard__when small { color: var(--muted); font-size: .88rem; }
.icard__when--none, .icard__when--none .ico { color: var(--muted); }
.icard__link { justify-self: start; max-width: 100%; display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .7rem; border: 0; border-radius: 999px; background: var(--paper-2); color: var(--ink-2); font: inherit; font-size: .85rem; cursor: pointer; }
.icard__link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icard__link:hover, .icard__link:focus-visible { background: var(--accent-soft); color: var(--accent); outline: none; }
.icard__stub { position: relative; display: grid; gap: .8rem; padding: 1.1rem 1.25rem 1.2rem; border-top: 2px dashed var(--line-2); }
.icard__stub::before, .icard__stub::after { content: ""; position: absolute; top: -.7rem; width: 1.4rem; height: 1.4rem; border-radius: 50%; background: var(--paper); }
.icard__stub::before { inset-inline-start: -.7rem; }
.icard__stub::after { inset-inline-end: -.7rem; }
.icard__count { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .45rem; font-size: 1rem; }
.icard__count b { font: 600 2rem/1 var(--f-display); }
.icard__count small { flex-basis: 100%; color: var(--muted); font-size: .86rem; }
.icard__count > span { color: var(--muted); }
.icard__note { margin: 0; font-size: .85rem; color: var(--muted); }
.icard__note--bad { color: var(--danger); }
.icard__acts { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.more { position: relative; margin-inline-start: auto; }
.more > summary { display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 50%; list-style: none; cursor: pointer; color: var(--ink-2); font-size: 1.4rem; }
.more > summary::-webkit-details-marker { display: none; }
.more > summary:hover, .more[open] > summary, .more > summary:focus-visible { background: var(--paper-2); outline: none; }
.more__menu { top: auto; bottom: calc(100% + .4rem); }
/* The blank card: the next one. */
.icard--new { background: none; box-shadow: none; border: 2px dashed var(--line-2); min-height: 16rem; }
.icard--new a { display: grid; place-content: center; justify-items: center; gap: .5rem; height: 100%; padding: 2rem 1.5rem; text-align: center; text-decoration: none; color: var(--ink-2); grid-row: 1 / -1; }
.icard--new .ico { font-size: 1.6rem; width: 3.2rem; height: 3.2rem; padding: .8rem; border-radius: 50%; background: var(--accent); color: var(--accent-ink); }
.icard--new b { font: 600 1.6rem/1.15 var(--f-display); color: var(--ink); }
.icard--new span { font-size: .9rem; color: var(--muted); max-width: 22ch; }
.icard--new a:hover b, .icard--new a:focus-visible b { color: var(--accent); }
.icard--new a:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 8px; }
/* Nothing yet: three covers on the desk, as an invitation to start. */
.deskempty { position: relative; height: clamp(15rem, 34vw, 24rem); margin-top: 1rem; }
.deskempty__card { position: absolute; top: 8%; inset-inline-start: 50%; width: clamp(11rem, 26vw, 19rem); margin: 0; padding: .5rem .5rem 0; border-radius: 4px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line), 0 26px 50px -30px color-mix(in srgb, var(--ink) 60%, transparent); transform: translate(calc(-50% + var(--x)), var(--y)) rotate(var(--r)); }
[dir="rtl"] .deskempty__card { transform: translate(calc(50% - var(--x)), var(--y)) rotate(calc(var(--r) * -1)); }
.deskempty__card img { display: block; width: 100%; height: auto; border-radius: 2px; }
.deskempty__card figcaption { padding: .4rem .2rem .45rem; font: 500 1rem/1.2 var(--f-display); text-align: center; }
.deskempty__card--1 { --x: -62%; --y: 6%; --r: -8deg; }
.deskempty__card--2 { --x: 62%; --y: 0%; --r: 7deg; }
.deskempty__card--3 { --x: 0%; --y: 12%; --r: -1deg; z-index: 1; }
@media (max-width: 760px) {
  .desk { grid-template-columns: 1fr; }
  .desk__do .btn--ghost { display: none; }      /* the dock carries it */
  .cards { gap: 1.2rem; }
}

/* Profile: the seal and who you are; your details on a sheet of the same stationery. */
.prof { display: grid; grid-template-columns: minmax(0, 20rem) minmax(0, 38rem); gap: clamp(1.5rem, 5vw, 5rem); align-items: start; justify-content: center; padding-block: clamp(1.5rem, 4vw, 3.5rem); }
.prof__id { display: grid; justify-items: start; gap: .5rem; position: sticky; top: 6rem; }
.prof__id h1 { margin-top: .9rem; font-size: clamp(2.2rem, 1.6rem + 1.6vw, 3.2rem); overflow-wrap: anywhere; }
.prof__mail { margin: 0; color: var(--ink-2); overflow-wrap: anywhere; }
.prof__since { margin: 0; color: var(--muted); font-size: .92rem; }
.prof__links { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.prof__form { display: grid; gap: 1.6rem; padding: clamp(2rem, 1.2rem + 3vw, 3.4rem) clamp(1.6rem, 1rem + 2.6vw, 3.2rem); }
.prof__form h2 { font-size: 2rem; }
.prof__note { margin: 0; font-size: .9rem; color: var(--muted); }
.prof__save { display: flex; justify-content: flex-end; }
.langpick { display: flex; gap: .6rem; padding-top: .7rem; }
.langpick label { cursor: pointer; }
.langpick input { position: absolute; opacity: 0; }
.langpick span { display: inline-flex; padding: .5rem 1.1rem; border-radius: 999px; box-shadow: inset 0 0 0 1.5px var(--line-2); font-weight: 500; }
.langpick input:checked + span { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
.langpick input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (max-width: 900px) {
  .prof { grid-template-columns: 1fr; }
  .prof__id { position: static; justify-items: center; text-align: center; }
  .prof__links { justify-content: center; }
}

/* --- milestone 21: the Preview step's list of what is ready ----------------------------- */
.pvlist { list-style: none; margin: 0; padding: 0; display: grid; }
.pvlist li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .8rem; align-items: center; padding: .75rem 0; border-top: 1px solid var(--line); }
.pvlist li:first-child { border-top: 0; }
.pvlist__mark { display: grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--line-2); color: transparent; font-size: .95rem; }
.pvlist .is-done .pvlist__mark { background: var(--accent); box-shadow: none; color: var(--accent-ink); }
.pvlist small { color: var(--muted); font-size: .85rem; }
.pvlist .is-open small { color: var(--accent); }
.pvlist a { font-weight: 600; font-size: .9rem; text-underline-offset: .2em; }
