/* rs201 Etched reply (INV-21 Acrylic Glass W1, A2757; plan docs/plans/plan_inv21_acrylic_glass.md, row 11): one frosted pane
   (the skin's .k-ag-pane) with both jobs (D-156): the heading, the reply-by date and the form. Restyle only of rs060:
   section.js, handOff, HAND = 4000, the "Send" label, id="kjy-reply" and every field are as forked. Everything is cut into
   the glass with the skin's --ag-etched-* recipe: a field is a groove under the words (gold while in use), the answers,
   the counts, the note and Send are etched patches, never outlined boxes; field text is 16 px or more (no zoom on an
   iPhone). The guest's own reply ("You replied on … / Change your reply") shows under the reply-by date. Phone and
   tablet: one column. Laptop: the title and date on top, then two columns (the name, the answer and the note on the
   left, the counts on the right). A sent card narrows to one centred column. */
.rs201 {
  --rs201-ink: var(--ag-gold-1); /* the signed name */
  --rs201-fs: max(16px, calc(16 * var(--ag-u))); /* field text: never under 16 px */
  /* a dropdown's chevron, engraved: an ink stroke (the skin's --ag-ink, #4F4030) over a lit lip 1 px below */
  --rs201-chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1.2 1.6 6 6.3l4.8-4.7' fill='none' stroke='%234F4030' stroke-opacity='.85' stroke-width='1.3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --rs201-chev-lip: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1.2 1.6 6 6.3l4.8-4.7' fill='none' stroke='%23FFFFFF' stroke-opacity='.8' stroke-width='1.3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  position: relative; padding: var(--k-section-pad) var(--k-gutter); text-align: center;
}

/* ---- the pane ---- */
.rs201 .rs201__body { padding: calc(30 * var(--ag-u)) calc(20 * var(--ag-u)) calc(32 * var(--ag-u)); }
@media (min-width: 700px), (min-aspect-ratio: 1/1) { .rs201 .rs201__body { padding: calc(34 * var(--ag-u)) calc(40 * var(--ag-u)) calc(38 * var(--ag-u)); } }

/* ---- the top: the heading, the reply-by date, the guest's own reply, the plain WhatsApp button (no script) ---- */
.rs201 .rs201__side { display: flex; flex-direction: column; align-items: center; }
.rs201 .rs201__rule { margin: calc(12 * var(--ag-u)) auto calc(14 * var(--ag-u)); }
.rs201 .rs201__by { font: italic 500 calc(15 * var(--ag-u))/1.6 var(--k-font-body); color: var(--ag-ink-2); }
.rs201 .rs201__by b { display: inline-block; margin-top: calc(6 * var(--ag-u)); font: 500 calc(18 * var(--ag-u))/1.35 var(--k-font-display); font-style: normal;
  letter-spacing: .16em; padding-left: .16em; text-transform: uppercase; color: var(--ag-ink); }
.rs201 .rs201__rule--end { margin-top: calc(18 * var(--ag-u)); margin-bottom: 0; }
.rs201 .rs201-mine { margin-top: calc(18 * var(--ag-u)); }
.rs201 .rs201-mine__t { margin: 0 0 calc(12 * var(--ag-u)); font: italic 500 calc(15 * var(--ag-u))/1.55 var(--k-font-body); color: var(--ag-ink); text-wrap: balance; }
.rs201 .rs201__plain { margin-top: calc(22 * var(--ag-u)); }
.rs201 .rs201-mine[hidden], .rs201 .rs201__plain[hidden], .rs201 .rs201-form[hidden], .rs201 .rs201-field[hidden],
.rs201 .rs201-yes[hidden], .rs201 .rs201-thanks[hidden], .rs201 .rs201-extra:empty { display: none; }

/* ---- the form (its container query lives on the form, which holds no mist) ---- */
.rs201 .rs201-form { display: grid; gap: calc(20 * var(--ag-u)); width: 100%; max-width: calc(460 * var(--ag-u)); margin: calc(24 * var(--ag-u)) auto 0;
  text-align: left; container-type: inline-size; }
.rs201 .rs201__ink, .rs201 .rs201-yes, .rs201 .rs201-extra { display: grid; gap: calc(20 * var(--ag-u)); min-width: 0; }
.rs201 .rs201-field { display: block; min-width: 0; }
.rs201 .rs201-field__l { display: block; margin: 0 0 calc(6 * var(--ag-u)); padding: 0; font: 600 calc(10.5 * var(--ag-u))/1.5 var(--k-font-body);
  letter-spacing: .22em; text-transform: uppercase; color: var(--ag-ink-2); }
.rs201 .rs201-field__l i { font-style: italic; font-weight: 500; letter-spacing: .04em; text-transform: none; }
/* a field: a groove cut under the words, gold while in use */
.rs201 .rs201-input { display: block; width: 100%; min-height: 48px; margin: 0; padding: 10px 2px; border: 0; border-radius: 0;
  background: transparent; box-shadow: var(--ag-etched-groove); -webkit-appearance: none; appearance: none;
  font: 500 var(--rs201-fs)/1.4 var(--k-font-body); color: var(--ag-ink); text-shadow: none; }
.rs201 .rs201-input:focus { outline: none; box-shadow: var(--ag-etched-groove-on); }
/* the note: a patch etched into the glass to write in */
.rs201 .rs201-input--note { min-height: 108px; resize: none; padding: 12px 14px; border-radius: var(--ag-etched-radius);
  background: var(--ag-etched-fill); box-shadow: var(--ag-etched-cut); }
.rs201 .rs201-input--note:focus { box-shadow: var(--ag-etched-cut-deep), inset 0 -2.5px 0 var(--ag-gold-2); }
/* a dropdown: an etched patch with an engraved chevron */
.rs201 select.rs201-input { padding: 10px 40px 10px 14px; cursor: pointer; border-radius: var(--ag-etched-radius);
  background: var(--rs201-chev-lip) calc(100% - 16px) calc(50% + 1px) / 12px 8px no-repeat, var(--rs201-chev) calc(100% - 16px) 50% / 12px 8px no-repeat,
    var(--ag-etched-fill);
  box-shadow: var(--ag-etched-cut); text-shadow: var(--ag-etched-text); font-variant-numeric: lining-nums; }
.rs201 select.rs201-input:focus { box-shadow: var(--ag-etched-cut-deep), inset 0 -2.5px 0 var(--ag-gold-2); }
.rs201 .rs201-input option { color: var(--ag-ink); background: var(--k-paper); }
.rs201 .rs201-input[name="one"], .rs201 .rs201-input[name="all"] { width: min(100%, 12rem); }
.rs201 .rs201-input:-webkit-autofill { -webkit-text-fill-color: var(--ag-ink); transition: background-color 600000s 0s; }

/* the signature: the field's own text is invisible; the mirror shows the name in gold script on the groove */
.rs201 .rs201-sig { --rs201-sfs: max(26px, calc(28 * var(--ag-u)));
  position: relative; display: block; height: max(52px, calc(var(--rs201-sfs) * 1.5)); border-radius: 0;
  box-shadow: var(--ag-etched-groove); font-size: calc(var(--rs201-sfs) * var(--rs201-k, 1)); }
.rs201 .rs201-sig:focus-within { box-shadow: var(--ag-etched-groove-on); }
.rs201 .rs201-sig__in, .rs201 .rs201-sig__ink { position: absolute; left: 0; top: 0; height: 100%; margin: 0; padding: 0 .3em 0 .35em; border: 0;
  font: 400 1em/max(52px, calc(var(--rs201-sfs) * 1.5)) var(--k-font-script); letter-spacing: 0; }
.rs201 .rs201-sig__in { width: 100%; border-radius: 0; background: transparent; color: transparent; -webkit-text-fill-color: transparent;
  caret-color: var(--rs201-ink); }
.rs201 .rs201-sig__in:focus { outline: none; }
.rs201 .rs201-sig__in:-webkit-autofill { -webkit-text-fill-color: transparent; transition: background-color 600000s 0s; }
.rs201 .rs201-sig__ink { pointer-events: none; white-space: pre; color: var(--rs201-ink); text-shadow: var(--ag-etched-text); clip-path: inset(-.6em -.8em -.6em -.8em); }

/* the answer: two patches etched into the glass; the chosen one is cut deeper, tinted gold, with a gold tick */
.rs201 .rs201-choice { display: grid; gap: calc(12 * var(--ag-u)); min-width: 0; margin: 0; padding: 0; border: 0; }
.rs201 .rs201-opt { position: relative; display: flex; align-items: center; justify-content: center; min-height: 52px; padding: 10px 12px;
  border-radius: var(--ag-etched-radius); background: var(--ag-etched-fill); box-shadow: var(--ag-etched-cut);
  text-shadow: var(--ag-etched-text); cursor: pointer; -webkit-tap-highlight-color: transparent; transition: box-shadow .2s; }
.rs201 .rs201-opt:has(input:checked) { background: linear-gradient(var(--ag-etched-tint) 0 0), var(--ag-etched-fill); box-shadow: var(--ag-etched-cut-deep); }
.rs201 .rs201-opt input { position: absolute; left: 50%; top: 50%; width: 1px; height: 1px; margin: 0; opacity: 0; }
.rs201 .rs201-opt__t { font: 600 max(12px, calc(10.5 * var(--ag-u)))/1.3 var(--k-font-body); letter-spacing: .16em; padding-left: .16em; text-transform: uppercase; color: var(--ag-ink); }
.rs201 .rs201-opt:has(input:checked) .rs201-opt__t::before { content: ""; display: inline-block; width: .95em; height: .48em; margin-right: .75em;
  border-left: 1.5px solid var(--ag-gold-1); border-bottom: 1.5px solid var(--ag-gold-1); transform: translateY(-.28em) rotate(-45deg); }
.rs201 .rs201-opt input:focus-visible ~ .rs201-opt__t { outline: 2px solid var(--ag-gold-1); outline-offset: 5px; }
.rs201 .rs201-ring { display: none; } /* the hand-drawn ring of an earlier design: markup kept, never shown */
/* W2.2 (A2802, "Answer presses in"): under the finger the answer presses softly into the glass (the deep cut is already its
   checked state) and its tick draws: the short stroke down, then the long one out, while the words make room */
.rs201 .rs201-opt.is-press { animation: rs201-press .44s cubic-bezier(.3, 0, .2, 1); }
@keyframes rs201-press { 0% { scale: 1; } 35% { scale: .965; } 100% { scale: 1; } }
.rs201 .rs201-opt.is-press:has(input:checked) .rs201-opt__t::before { animation: rs201-tick .55s cubic-bezier(.45, 0, .3, 1) .06s both; }
@keyframes rs201-tick { 0% { width: 0; margin-right: 0; clip-path: inset(0 100% 100% 0); } 35% { clip-path: inset(0 calc(100% - 2px) 0 0); } 100% { width: .95em; margin-right: .75em; clip-path: inset(0); } }
html.motion-reduce .rs201 .rs201-opt.is-press, html.motion-reduce .rs201 .rs201-opt.is-press .rs201-opt__t::before, html.kjy-lite .rs201 .rs201-opt.is-press,
html.kjy-lite .rs201 .rs201-opt.is-press .rs201-opt__t::before { animation: none; }
@container (min-width: 420px) { .rs201 .rs201-choice { grid-template-columns: 1fr 1fr; } }

/* the counts: one row per event (name and time, then the count), gold day headings when the events span days */
.rs201 .rs201-help { margin: calc(-10 * var(--ag-u)) 0 0; font: italic 500 calc(14 * var(--ag-u))/1.5 var(--k-font-body); color: var(--ag-ink-2); }
.rs201 .rs201-evs { margin: 0; }
.rs201 .rs201-ev { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 14px; align-items: center;
  padding: calc(10 * var(--ag-u)) 0; background: var(--ag-hair) bottom / 100% 1px no-repeat; }
.rs201 .rs201-ev__n { grid-column: 1; grid-row: 1; font: 500 calc(16 * var(--ag-u))/1.3 var(--k-font-display); color: var(--ag-ink); text-wrap: balance; }
.rs201 .rs201-ev__d { grid-column: 1; grid-row: 2; font: italic 500 calc(13.5 * var(--ag-u))/1.45 var(--k-font-body); white-space: nowrap; color: var(--ag-ink-2); }
/* the count fits "Can't come" at the field size (16 px or more) and leaves the event's name room */
.rs201 select.rs201-ev__c { grid-column: 2; grid-row: 1 / span 2; width: calc(9 * var(--rs201-fs)); padding: 10px 36px 10px 12px; }
.rs201 .rs201-day { margin: calc(16 * var(--ag-u)) 0 0; padding-bottom: calc(6 * var(--ag-u)); background: var(--ag-hair) bottom / 100% 1px no-repeat;
  font: 600 calc(10.5 * var(--ag-u))/1.4 var(--k-font-body); letter-spacing: .24em; text-transform: uppercase; font-variant-numeric: lining-nums; color: var(--ag-gold-1); }
.rs201 .rs201-day:first-child { margin-top: 2px; }

/* Send, and the lines around it */
.rs201 .rs201-send { justify-self: center; min-width: min(100%, 220px); margin-top: calc(4 * var(--ag-u)); }
.rs201 .rs201-small { margin: calc(-8 * var(--ag-u)) 0 0; text-align: center; font: italic 500 calc(13.5 * var(--ag-u))/1.5 var(--k-font-body); color: var(--ag-ink-2); }
.rs201 .rs201-thanks { margin: 2px 0 0; text-align: center; }
.rs201 .rs201-tl { margin: 0; font: italic 500 calc(16 * var(--ag-u))/1.6 var(--k-font-body); color: var(--ag-ink); text-wrap: balance; }
/* W2.2 (A2802): "Thank you" in gold script (the heading's Pinyon, the skin's foil), written on from the left after a fresh Send.
   Padded for the gold fill's box (background-clip) and the script's swashes; the margins give the room back */
.rs201 .rs201-ty { margin: -.2em auto -.1em; padding: .2em .5em .25em; width: fit-content; font: 400 calc(44 * var(--ag-u))/1.1 var(--k-font-script);
  /* the foil's two deeper golds only: its pale middle washed out on the frost (W2.2 look) */
  background: linear-gradient(100deg, var(--ag-gold-1) 0%, var(--ag-gold-2) 48%, var(--ag-gold-1) 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 1px 0 rgb(255 255 255 / .45)); }
.rs201 .rs201-thanks.is-writing .rs201-ty { animation: rs201-write 1.5s cubic-bezier(.45, .05, .35, 1) .45s both; }
@keyframes rs201-write { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.rs201 .rs201-late { margin: 0; text-align: center; font: italic 500 calc(15 * var(--ag-u))/1.5 var(--k-font-body); color: var(--ag-gold-1); }
.rs201 .rs201-err { margin: 0; padding: 10px 14px; border-radius: var(--ag-etched-radius); text-align: center; font: 500 max(15px, calc(15 * var(--ag-u)))/1.5 var(--k-font-body);
  color: var(--ag-ink); background: linear-gradient(var(--ag-etched-tint) 0 0), var(--ag-etched-fill); box-shadow: var(--ag-etched-cut-deep); }
.rs201 .rs201-trap { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.rs201 .rs201__card select, .rs201 .rs201__card button { min-height: 44px; }

/* sent: the signed name and the chosen answer stay; the other fields fold away (as forked) */
.rs201 .rs201-form.is-sent > .rs201-field, .rs201 .rs201-form.is-sent > .rs201-send, .rs201 .rs201-form.is-sent > .rs201-small,
.rs201 .rs201-form.is-sent .rs201__ink > .rs201-field:not(.rs201-field--sig), .rs201 .rs201-form.is-sent .rs201-field--sig > .rs201-field__l,
.rs201 .rs201-form.is-sent .rs201-choice > .rs201-field__l, .rs201 .rs201-form.is-sent .rs201-opt:not(.is-chosen),
.rs201 .rs201-form.is-sent > .rs201-yes, .rs201 .rs201-form.is-sent > .rs201-late, .rs201 .rs201-form.is-sent > .rs201-err { display: none; }
.rs201 .rs201-form.is-sent { gap: calc(14 * var(--ag-u)); }
.rs201 .rs201-form.is-sent .rs201-choice { grid-template-columns: minmax(0, 22rem); justify-content: center; }
/* W2.1 (A2798, owner: "that reply section just snaps into a shorter version ... very smoother, and also the expansion"): the
   glide (section.js change()). The words that go fade first (is-folding on Send, is-unsealing on "Change your reply",
   is-reword when the save answers late); then the body eases to its new height while the words that stay slide on the same
   clock, and the words that come fade in (is-new, is-unfolding, is-reworded). Opacity only here; the script moves. */
.rs201.is-folding .rs201-form > .rs201-field, .rs201.is-folding .rs201-form > .rs201-send, .rs201.is-folding .rs201-form > .rs201-small,
.rs201.is-folding .rs201-form .rs201-field--sig > .rs201-field__l, .rs201.is-folding .rs201-form .rs201-choice > .rs201-field__l,
.rs201.is-folding .rs201-form .rs201-opt:not(.is-chosen), .rs201.is-folding .rs201-form > .rs201-yes, .rs201.is-folding .rs201-form > .rs201-late,
.rs201.is-folding .rs201-form > .rs201-err, .rs201.is-unsealing .rs201-thanks, .rs201.is-reword .rs201-tl, .rs201.is-reword .rs201-mine__t {
  opacity: 0; transition: opacity .42s ease; }
.rs201 .is-new { animation: rs201-glide-in .9s cubic-bezier(.33, 0, .2, 1) .35s both; }
.rs201.is-unfolding .rs201-form > :not(.rs201__ink), .rs201.is-unfolding .rs201-form .rs201-field--sig > .rs201-field__l,
.rs201.is-unfolding .rs201-form .rs201-choice > .rs201-field__l { animation: rs201-glide-in .8s ease .3s both; }
.rs201.is-reworded .rs201-tl, .rs201.is-reworded .rs201-mine__t { animation: rs201-glide-in .5s ease both; }
@keyframes rs201-glide-in { from { opacity: 0; } }

/* laptop: the title and date on top, the fields in two columns below (many events: the name, the answer and the note on
   the left, the counts on the right; one event: the name and the answer on the left, the count and the note on the
   right; a "no": the note beside the answer). A sent card narrows to one centred column. */
@media (min-aspect-ratio: 1/1) and (min-width: 1000px) {
  .rs201 .rs201-form { max-width: calc(560 * var(--ag-u)); margin-top: calc(28 * var(--ag-u)); }
  .rs201 .rs201-form:not(.is-sent) { max-width: min(100%, calc(1000 * var(--ag-u))); grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto 1fr;
    column-gap: calc(56 * var(--ag-u)); align-items: start; }
  .rs201 .rs201-form:not(.is-sent) > * { grid-column: 1 / -1; }
  .rs201 .rs201-form:not(.is-sent) > .rs201__ink { grid-column: 1; grid-row: 1; }
  .rs201 .rs201-form:not(.is-sent) > .rs201-field { grid-column: 1; grid-row: 2; }
  .rs201 .rs201-form:not(.is-sent) > .rs201-yes { grid-column: 2; grid-row: 1 / span 2; }
  .rs201 .rs201-form:not(.is-sent):not(:has(.rs201-evs)) > .rs201__ink { grid-row: 1 / span 2; }
  .rs201 .rs201-form:not(.is-sent):not(:has(.rs201-evs)) > .rs201-yes { grid-row: 1; }
  .rs201 .rs201-form:not(.is-sent):not(:has(.rs201-evs)) > .rs201-field { grid-column: 2; grid-row: 2; }
  .rs201 .rs201-form:not(.is-sent):has(> .rs201-yes[hidden]) > .rs201__ink { grid-row: 1; }
  .rs201 .rs201-form:not(.is-sent):has(> .rs201-yes[hidden]) > .rs201-field { grid-column: 2; grid-row: 1; }
}
