/* Story helper (2026-12-01): a guided way to write "Our story", loaded by the editor.
   Parts: a block at the top of the story row (the way in, then tone / another take / change your answers / the paragraph
   in hand), a focused sheet that asks one question at a time, and on phones a dock under the invitation. Uses the editor's
   own colours and type. */

/* ---- the block at the top of the story row: a quiet ground of its own, so the tool reads apart from the fields */
.sh-entry { margin: 6px 0 30px; padding: 20px 22px 22px; background: var(--side); border-radius: var(--r); }
.sh-t { margin: 0 0 12px; font: 400 21px/1.2 var(--serif); }
.sh-t + .sh-fine { margin: -4px 0 0; max-width: 46ch; }
.sh-fine { display: block; margin-top: 10px; font-size: 12.5px; line-height: 1.5; color: var(--fg3); }
.sh-more { align-items: center; gap: 8px 20px; margin-top: 14px; }
/* the tone is a setting: one joined switch beside its label */
.sh-set { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.sh-lab { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--fg3); }
.sh-seg { display: inline-flex; border: .75px solid var(--fg3); border-radius: var(--r); overflow: hidden; background: var(--bg); }
.sh-seg button { min-height: 36px; padding: 0 16px; border: 0; border-radius: 0; background: none; cursor: pointer; font-size: 14px; color: var(--fg2); white-space: nowrap;
  transition: background-color var(--t-s), color var(--t-s); }
.sh-seg button + button { border-left: .75px solid var(--line); }
.sh-seg button:hover { background: var(--hover); }
.sh-seg button[aria-pressed="true"] { background: var(--fg); color: var(--bg); }
/* the rest are things to do: plain links under a hairline */
.sh-do { display: flex; flex-wrap: wrap; gap: 0 26px; margin-top: 16px; padding-top: 8px; border-top: .75px solid var(--line); }
.sh-do .link { min-height: 36px; font-size: 14px; }
.sh-more .link { min-height: 36px; font-size: 14px; }
.sh-entry .sh-pill, .sh-entry .btn.ghost { background: var(--bg); }
.sh-entry .sh-pill:hover { background: var(--hover); }
.sh-rows { display: flex; flex-wrap: wrap; gap: 8px; }
.sh-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.sh-pill { min-height: 36px; padding: 0 14px; border: .75px solid var(--line); border-radius: 99px; background: none; cursor: pointer; font-size: 14px; color: var(--fg2); white-space: nowrap;
  transition: background-color var(--t-s), border-color var(--t-s), color var(--t-s); }
.sh-pill:hover { background: var(--hover); }
.sh-pill[aria-pressed="true"] { background: var(--sel); border-color: var(--fg3); color: var(--fg); }
.sh-hint { margin: 14px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--fg3); }
.sh-see { display: none; margin-top: 14px; }
.sh-note { margin: 12px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--gold-ink); }
.sh-entry .sh-demo { margin-top: 12px; padding: 0; background: none; }
.sh-entry .sh-sent { background: var(--bg); }
/* the paragraph in hand */
.sh-sent { margin-top: 16px; padding: 16px 18px; background: var(--side); border-radius: var(--r); }
.sh-quote { margin: 0; font: 400 19px/1.4 var(--serif); }
.sh-origin { margin-top: 8px; }
.sh-edit { display: block; width: 100%; padding: 6px 0; border: 0; border-bottom: .75px solid var(--fg); border-radius: 0; background: none; resize: none; font: 400 18px/1.4 var(--serif); }
.sh-edit:focus { outline: none; }
.sh-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.sh-acts .link { margin-left: auto; min-height: 36px; }

/* ---- the questions: over the form column on wide screens, so the phone stays in view; the whole screen on phones */
.sh { position: fixed; z-index: 12; left: 0; top: 60px; bottom: 0; width: var(--sh-w, 520px); display: flex; flex-direction: column;
  background: var(--bg); border-right: .75px solid var(--line); overflow-y: auto; overscroll-behavior: contain; animation: sh-in var(--t-l) var(--ease) both; }
@keyframes sh-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.sh-x { position: absolute; top: 10px; right: 12px; width: 44px; height: 44px; border: 0; background: none; cursor: pointer; color: var(--fg2); }
.sh-x::before, .sh-x::after { content: ""; position: absolute; left: 50%; top: 50%; width: 16px; margin-left: -8px; border-top: .75px solid currentColor; }
.sh-x::before { transform: rotate(45deg); } .sh-x::after { transform: rotate(-45deg); }
.sh-x:hover { color: var(--fg); }
.sh-body { width: 100%; max-width: 560px; margin: auto; padding: 56px 56px 72px; }
.sh:not(.dock) .sh-body > * { animation: sh-rise var(--t-m) var(--ease) both; }
@keyframes sh-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.sh-prog { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 30px; }
.sh-prog i { border-top: .75px solid var(--line); transition: border-color var(--t-l) var(--ease); }
.sh-prog i.on { border-top-color: var(--gold); }
.sh-k { margin: 0 0 12px; font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--gold-ink); }
.sh-q { margin: 0 0 26px; font: 400 clamp(30px, 3.2vw, 40px)/1.1 var(--serif); letter-spacing: -.01em; text-wrap: balance; }
.sh-q:focus { outline: none; }
.sh-a { display: block; width: 100%; min-height: 128px; padding: 8px 0; border: 0; border-bottom: .75px solid var(--fg3); border-radius: 0; background: none; resize: none;
  font-size: 18px; line-height: 1.55; }
.sh-a:focus { outline: none; border-bottom-color: var(--fg); }
.sh-a::placeholder { font: italic 300 1.14em/1.4 "Cormorant Garamond", Georgia, serif; letter-spacing: .01em; color: var(--fg3); opacity: .72; }   /* an example: another face, thin and pale (see editor.html) */
.sh-count { margin: 22px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--fg3); }
.sh-count .link { min-height: 0; font-size: inherit; }
.sh-nav .btn[disabled] { opacity: .35; cursor: default; }
.sh-nav { display: flex; align-items: center; gap: 24px; margin-top: 30px; }
.sh-nav .sh-back { margin-left: auto; }
.sh-tones { display: grid; gap: 8px; margin: 0; padding: 0; border: 0; }
.sh-tone { position: relative; display: grid; gap: 2px; padding: 16px 18px; border: .75px solid var(--line); border-radius: var(--r); cursor: pointer; transition: border-color var(--t-s), background-color var(--t-s); }
.sh-tone:hover { background: var(--hover); }
.sh-tone input { position: absolute; opacity: 0; pointer-events: none; }
.sh-tone b { font: 400 21px/1.2 var(--serif); } .sh-tone span { font-size: 14px; color: var(--fg3); }
.sh-tone:has(input:checked) { border-color: var(--fg); background: var(--sel); }
.sh-tone:has(input:focus-visible) { outline: 1px solid var(--fg); outline-offset: 2px; }
.sh-wait { display: flex; align-items: center; gap: 14px; margin: 0; font: 400 26px/1.2 var(--serif); }
.sh-ring { flex: none; width: 18px; height: 18px; border-radius: 50%; border: 1.25px solid var(--line); border-top-color: var(--fg); animation: sh-turn .9s linear infinite; }
@keyframes sh-turn { to { transform: rotate(360deg); } }
.sh-demo { margin: 34px 0 0; padding: 10px 12px; background: var(--side); border-radius: var(--r); font-size: 12.5px; line-height: 1.5; color: var(--fg2); }

/* ---- phones: questions fill the screen; afterwards the invitation fills it and the tools dock at its foot */
@media (max-width: 880px) {
  .sh { inset: 0; width: auto; border: 0; }
  .sh-body { padding: 64px 20px 40px; margin: 0 auto; }
  .sh-q { font-size: 30px; }
  .sh-wide { display: none; } .sh-see { display: inline-flex; }
  .sh.dock { inset: auto 0 0 0; max-height: 52svh; border-top: .75px solid var(--line); animation-name: sh-up; }
  @keyframes sh-up { from { transform: translateY(100%); } to { transform: none; } }
  .sh.dock .sh-body { padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); }
  .sh.dock .sh-set { flex-wrap: nowrap; } .sh.dock .sh-seg { flex: 1; } .sh.dock .sh-seg button { flex: 1; padding: 0 6px; }
  .sh.dock .sh-hint { margin-top: 10px; font-size: 12.5px; }
  .sh.dock .sh-sent { margin: 0; padding: 0; background: none; }
  .sh.dock .sh-quote { font-size: 17px; }
  .sh.dock .sh-acts { flex-wrap: nowrap; margin-top: 10px; } .sh.dock .sh-acts .sh-pill { padding: 0 12px; }
  .sh.dock .sh-nav { margin-top: 12px; }
  .sh.dock .sh-nav .btn { flex: 1; } .sh.dock .sh-nav { gap: 16px; } .sh.dock .sh-nav .link { font-size: 13.5px; white-space: nowrap; }
  /* while the tools are docked the invitation is shown as guests get it: edge to edge, no phone drawn inside the phone,
     ending where the dock begins; the preview's own links step aside */
  body.sh-docked .preview { padding: 0 0 var(--sh-dock, 170px); }
  body.sh-docked .preview .phone { width: 100%; height: 100%; max-height: none; aspect-ratio: auto; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
  body.sh-docked .preview .screen { border-radius: 0; }
  body.sh-docked .preview .under { display: none; }
  /* the cross over the invitation's top corner: on a soft disc of the page colour, so it reads on any artwork */
  .sh-shut { position: fixed; z-index: 13; top: max(10px, env(safe-area-inset-top)); right: 10px; width: 44px; height: 44px; border: 0; border-radius: 50%; cursor: pointer;
    background: color-mix(in srgb, var(--bg) 78%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); color: var(--fg); animation: sh-in var(--t-l) var(--ease) both; }
  .sh-shut::before, .sh-shut::after { content: ""; position: absolute; left: 50%; top: 50%; width: 16px; margin-left: -8px; border-top: 1px solid currentColor; }
  .sh-shut::before { transform: rotate(45deg); } .sh-shut::after { transform: rotate(-45deg); }
}
@media (prefers-reduced-motion: reduce) { .sh, .sh-body > *, .sh-shut { animation: none !important; } }
