/* The live editor: everything that sits around and on top of the story while it is being
   edited. The chrome keeps one neutral look so it reads the same over every theme. */

[hidden] { display: none !important; }

.ed {
  --u-ink: #3c0a22; --u-soft: #7d5a6a; --u-line: #eddcd2; --u-bg: #fff; --u-cream: #fdf6ee; --u-blush: #fbe4ea; --u-hover: #f8eee8;
  --u-brand: #b8104a; --u-brand-2: #9a1b55; --u-shadow: 0 8px 26px -10px rgba(60, 10, 34, .38), 0 0 0 1px rgba(60, 10, 34, .06);
  --u-head: 'Rubik', 'Heebo', system-ui, sans-serif;
  background: var(--u-cream);
}
.ui { font-family: var(--ui-font); line-height: 1.4; letter-spacing: 0; direction: rtl; }
:where(.ui) button, :where(.ui) input { font: inherit; color: inherit; }
.ui button { cursor: pointer; }
.ui svg { display: block; }

/* ---------- buttons ---------- */
.btn-main {
  appearance: none; border: 0; border-radius: 999px; padding: 0 20px; height: 40px;
  background: linear-gradient(100deg, var(--u-brand), var(--u-brand-2)); color: #fff !important; font-family: var(--u-head); font-weight: 700; font-size: .98rem;
  box-shadow: 0 8px 18px -8px rgba(150, 10, 60, .75); white-space: nowrap;
}
.btn-main:hover { filter: brightness(1.05); }
.btn-main:disabled { opacity: .6; cursor: default; }
.btn-main.is-big { height: 54px; font-size: 1.12rem; width: 100%; }
.btn-ghost {
  appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 40px; padding: 0 14px;
  border: 1px solid var(--u-line); border-radius: 999px; background: #fff; color: var(--u-ink); font-weight: 600; font-size: .93rem;
  text-decoration: none; white-space: nowrap;
}
.btn-ghost:hover { background: #fdf8f4; }
.btn-ghost svg { width: 19px; height: 19px; }
.btn-ghost.is-icon { width: 40px; padding: 0; }
:where(.ui) :focus-visible { outline: 2.5px solid var(--u-brand); outline-offset: 2px; }

/* ---------- top bar ---------- */
.bar {
  position: fixed; top: 0; inset-inline: 0; z-index: 40; height: 58px; display: flex; align-items: center; gap: 10px;
  padding: 0 max(12px, env(safe-area-inset-left)) 0 max(12px, env(safe-area-inset-right));
  background: rgba(255, 255, 255, .88); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--u-line); color: var(--u-ink);
}
.brand { display: inline-flex; align-items: center; gap: 7px; color: var(--u-ink); text-decoration: none; font-family: var(--u-head); font-weight: 800; font-size: 1.12rem; direction: ltr; }
.brand-gift { width: 28px; height: 28px; color: var(--u-brand); }
.status { font-size: .84rem; color: var(--u-soft); white-space: nowrap; }
.status[data-state='error'] { color: #b42318; }
.btn-ghost.opened { border-color: #f6c9d8; background: #fff5f8; color: var(--u-brand); font-weight: 700; padding: 0 12px; }
.bar-end { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; }
@media (max-width: 560px) {
  .brand span { display: none; }
  #preview-btn span { display: none; }
  #preview-btn { width: 40px; padding: 0; }
  .btn-ghost.opened { width: 40px; padding: 0; }
  .btn-ghost.opened #opened-label { display: none; }
}

/* ---------- the story while editing ---------- */
.ed .story { padding-top: 58px; padding-bottom: 96px; }
.ed .is-edit .hero { min-height: 0; padding-block: 40px 48px; }
.ed .is-edit .chapter { padding-top: 104px; }
.ed .is-edit .ending { padding-top: 96px; }

.is-edit [data-f] {
  outline: 1.5px dashed color-mix(in srgb, var(--ink) 24%, transparent); outline-offset: 6px; border-radius: 6px;
  cursor: text; min-width: 3ch; caret-color: var(--accent); -webkit-user-modify: read-write-plaintext-only;
  transition: outline-color .15s ease;
}
.is-edit [data-f]:hover { outline-color: color-mix(in srgb, var(--ink) 55%, transparent); }
.is-edit [data-f]:focus { outline: 2px solid var(--accent); }
.is-edit [data-f]:empty::before { content: attr(data-ph); color: var(--soft); -webkit-text-fill-color: var(--soft); opacity: .6; pointer-events: none; }
.is-edit .chapter-body, .is-edit .hero-in, .is-edit .ending-in { width: 100%; }
.is-edit .chapter-body { gap: 22px; }
.is-edit .hero-in { gap: 26px; }

.edit-tag { padding: 5px 12px; border-radius: 999px; background: color-mix(in srgb, var(--ink) 9%, transparent); color: var(--ink); font-size: .84rem; font-weight: 600; }

/* picture slots */
.slot-add {
  appearance: none; width: 100%; aspect-ratio: 4 / 3; display: grid; place-content: center; justify-items: center; gap: 10px;
  border: 2px dashed color-mix(in srgb, var(--ink) 34%, transparent); border-radius: 20px;
  background: color-mix(in srgb, var(--card) 45%, transparent); color: var(--ink) !important; font-weight: 600; font-size: 1rem;
  transition: border-color .15s ease, background .15s ease;
}
.slot-add:hover, .frame.is-drop .slot-add { border-color: var(--accent); background: color-mix(in srgb, var(--card) 75%, transparent); }
.slot-add .ic { width: 34px; height: 34px; opacity: .75; }
.frame.is-empty::before { display: none; }
.is-edit .frame.is-empty { transform: none !important; padding: 0 !important; border: 0 !important; background: none !important; box-shadow: none !important; }
.frame.is-drop { outline: 3px solid var(--accent); outline-offset: 8px; border-radius: 12px; }
.slot-tools { position: absolute; bottom: 12px; inset-inline-start: 12px; z-index: 2; display: flex; gap: 6px; }
.slot-tools button {
  appearance: none; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 13px; border: 0; border-radius: 999px;
  background: rgba(255, 255, 255, .95); color: var(--u-ink) !important; font-weight: 600; font-size: .86rem; box-shadow: var(--u-shadow);
}
.slot-tools button[data-act='img-remove'] { width: 36px; padding: 0; justify-content: center; }
.slot-tools .ic { width: 17px; height: 17px; }
.frame.is-uploading img { opacity: .5; }
.frame.is-uploading::after {
  content: ''; position: absolute; top: 50%; left: 50%; width: 34px; height: 34px; margin: -17px; border-radius: 50%;
  border: 3.5px solid rgba(255, 255, 255, .9); border-top-color: var(--u-brand); animation: spin .8s linear infinite; z-index: 2;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* hero picture: a small optional circle */
.is-edit .hero-photo { overflow: visible; }
.is-edit .hero-photo img { border-radius: 50%; }
.is-edit .hero-photo .slot-add { aspect-ratio: 1; border-radius: 50%; gap: 3px; font-size: .78rem; }
.is-edit .hero-photo .slot-add .ic { width: 26px; height: 26px; }
.is-edit .hero-photo.is-empty { width: 112px; }
.is-edit .hero-photo .slot-tools { bottom: -14px; inset-inline: 0; justify-content: center; }
.is-edit .hero-photo .slot-tools span:not(.ic) { display: none; }
.is-edit .hero-photo .slot-tools button { width: 36px; padding: 0; justify-content: center; }

.is-edit .chapter, .is-edit .gate, .is-edit .hero, .is-edit .ending { scroll-margin-top: 64px; }

/* ---------- dock (photos, theme) and the theme sheet ---------- */
.dock { position: fixed; z-index: 41; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; gap: 8px; transition: opacity .2s ease, transform .2s ease; }
.dock button {
  appearance: none; display: inline-flex; align-items: center; gap: 8px; height: 50px; padding: 0 18px; border: 0; border-radius: 999px;
  background: var(--u-ink); color: #fff !important; font-family: var(--u-head); font-weight: 700; font-size: .98rem; box-shadow: 0 14px 34px -12px rgba(60, 10, 34, .7); white-space: nowrap;
}
.dock button svg { width: 20px; height: 20px; }
@media (max-width: 380px) { .dock button { padding: 0 14px; font-size: .9rem; } }
.is-typing .dock, .sheet-open .dock, .tray-open .dock { opacity: 0; pointer-events: none; transform: translate(-50%, 20px); }
.sheet {
  position: fixed; z-index: 45; left: 50%; bottom: max(12px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  width: min(600px, calc(100% - 16px)); padding: 14px 14px 16px; border-radius: 24px; background: #fff; color: var(--u-ink);
  box-shadow: 0 24px 70px -18px rgba(60, 10, 34, .55), 0 0 0 1px rgba(60, 10, 34, .06); animation: sheet-in .28s cubic-bezier(.2, .8, .2, 1);
}
@keyframes sheet-in { from { transform: translate(-50%, 30px); opacity: 0; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 4px 10px 0; font-size: 1.02rem; }
.sheet-head strong, .tray-head strong { font-family: var(--u-head); font-weight: 800; font-size: 1.08rem; }
.sheet-head div { display: grid; }
.sheet-head span { font-size: .8rem; color: var(--u-soft); }
.sheet-head .btn-ghost { height: 34px; width: 34px; border: 0; background: var(--u-hover); }
.themes { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(96px, 1fr); gap: 10px; overflow-x: auto; padding: 4px; margin: -4px; scrollbar-width: none; }
.themes::-webkit-scrollbar { display: none; }
.theme-tile { appearance: none; display: grid; gap: 7px; padding: 0; border: 0; background: none; text-align: center; }
.tile-prev {
  display: grid; place-items: center; height: 78px; border-radius: 16px; background: var(--sky); background-color: var(--bg); color: var(--ink);
  font-family: var(--font-head); font-weight: var(--head-weight); font-size: 1.12rem; box-shadow: inset 0 0 0 1px rgba(60, 10, 34, .1);
}
.tile-name { font-size: .84rem; font-weight: 600; color: var(--u-soft); }
.theme-tile[aria-pressed='true'] .tile-prev { box-shadow: 0 0 0 3px #fff, 0 0 0 5.5px var(--u-brand); }
.theme-tile[aria-pressed='true'] .tile-name { color: var(--u-ink); font-weight: 700; }

/* ---------- small controls that sit inside the page ---------- */
/* a setting of one part of the gift: the tune on the opening screen, candles at the end */
.edit-chip {
  appearance: none; display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px 0 12px; border: 0; border-radius: 999px;
  background: #fff; color: var(--u-ink) !important; font-weight: 600; font-size: .88rem; box-shadow: var(--u-shadow); white-space: nowrap;
}
.edit-chip .emo { font-size: 1.05rem; line-height: 1; }
.edit-chip .chev { width: 15px; height: 15px; opacity: .6; }
.edit-chip[aria-pressed='false'] { background: rgba(255, 255, 255, .7); color: var(--u-soft) !important; }
.edit-chip[aria-pressed='false'] .emo { filter: grayscale(1); opacity: .6; }
.is-edit .cake { width: 132px; }

/* writing help */
.ai-btn {
  appearance: none; justify-self: start; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 13px 0 11px; border: 0; border-radius: 999px;
  background: linear-gradient(100deg, #7a5cff, #e8457a); color: #fff !important; font-weight: 700; font-size: .84rem; box-shadow: 0 8px 18px -10px rgba(122, 92, 255, .9);
}
.ai-btn .ic { width: 15px; height: 15px; }
.is-edit .ending-words .ai-btn, .is-edit .no-media .ai-btn, .is-edit [data-look='spotlight'] .ai-btn { justify-self: center; }
@media (max-width: 859.980px) { .ai-btn { justify-self: center; } }
.write-form { display: grid; gap: 12px; margin-top: 4px; }
.write-form label { display: grid; gap: 7px; text-align: start; font-weight: 600; font-size: .92rem; }
.write-form input { height: 52px; padding: 0 15px; border: 2px solid var(--u-line); border-radius: 15px; font-size: 1.02rem; background: #fff; width: 100%; }
.write-form input:focus { outline: none; border-color: #7a5cff; }

/* position of a cropped picture inside its frame */
.slot-move { display: none !important; }
.frame.is-cropped .slot-move { display: inline-flex !important; width: 36px; padding: 0 !important; justify-content: center; }
.frame.is-moving { outline: 3px solid var(--u-brand); outline-offset: 6px; border-radius: 12px; }
.hero-photo.is-moving { border-radius: 50%; }
.frame.is-moving img { cursor: grab; touch-action: none; }
.frame.is-moving img:active { cursor: grabbing; }
.frame.is-moving .slot-tools button:not(.slot-move) { display: none; }
.frame.is-moving .slot-move { width: auto !important; padding: 0 14px !important; gap: 6px; background: var(--u-brand); color: #fff !important; }
.frame.is-moving .slot-move::after { content: 'סיום'; font-weight: 700; }
.frame.is-moving::after {
  content: 'גוררים את התמונה למקום'; position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 3; white-space: nowrap;
  padding: 7px 12px; border-radius: 999px; background: rgba(60, 10, 34, .88); color: #fff; font: 600 .78rem var(--ui-font); pointer-events: none;
}
.hero-photo.is-moving::after { top: -40px; }

/* ---------- style of one chapter: the sheet draws each look with the real story.css rules ---------- */
.look-tile { appearance: none; display: block; border: 0; background: none; }
.look-prev {
  position: relative; display: block; height: 84px; border-radius: 16px; overflow: hidden; background: var(--sky); background-color: var(--bg);
  box-shadow: 0 0 0 1px rgba(60, 10, 34, .1);
}
/* the chapter whose style is being chosen */
.is-styling { outline: 3px solid var(--u-brand); outline-offset: -8px; border-radius: 26px; }

/* ---------- photo panel: every uploaded picture, placed or not ---------- */
.tray { display: none; position: fixed; z-index: 44; background: #fff; color: var(--u-ink); }
.tray-head { display: flex; align-items: center; justify-content: space-between; min-height: 34px; font-size: 1.02rem; }
.tray-head .btn-ghost { height: 34px; width: 34px; border: 0; background: var(--u-hover); }
.tray-hint { margin: 2px 0 10px; font-size: .86rem; line-height: 1.45; color: var(--u-soft); }
.tray-hint.is-live { color: var(--u-brand); font-weight: 600; }
.tray-actions { display: flex; gap: 8px; margin: -2px 0 10px; }
.tray-actions .btn-ghost { height: 36px; padding: 0 14px; font-size: .86rem; }
.btn-ghost.is-danger { color: #b42318; border-color: #f3c5c0; }
.thumbs { display: flex; gap: 9px; overflow-x: auto; padding: 7px; margin: -7px; scrollbar-width: none; }
.thumbs::-webkit-scrollbar { display: none; }
.thumb, .thumb-add { appearance: none; position: relative; flex: 0 0 76px; height: 76px; padding: 0; border: 0; border-radius: 14px; background: var(--u-hover); }
.thumb { cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; transition: transform .15s ease, box-shadow .15s ease; }
.thumb img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.thumb.is-used img { opacity: .5; }
.thumb .tick {
  position: absolute; top: 5px; inset-inline-end: 5px; display: grid; place-items: center; width: 21px; height: 21px; border-radius: 50%;
  background: #1fa855; color: #fff; font-size: .72rem; font-weight: 800; box-shadow: 0 0 0 2px #fff;
}
.thumb.is-armed { transform: translateY(-3px); box-shadow: 0 0 0 3px #fff, 0 0 0 5.5px var(--u-brand); }
.thumb.is-armed img { opacity: 1; }
.thumb.is-uploading img { opacity: .4; }
.thumb.is-uploading::after {
  content: ''; position: absolute; top: 50%; left: 50%; width: 24px; height: 24px; margin: -12px; border-radius: 50%;
  border: 3px solid #fff; border-top-color: var(--u-brand); animation: spin .8s linear infinite;
}
.thumb-add {
  display: grid; place-content: center; justify-items: center; gap: 3px; border: 2px dashed #d9d3e6; background: #fff;
  color: var(--u-ink) !important; font-size: .7rem; font-weight: 600; line-height: 1.2;
}
.thumb-add svg { width: 22px; height: 22px; color: var(--u-brand); }
.thumb-add:hover, .tray.is-drop .thumb-add { border-color: var(--u-brand); background: #fff5f8; }

/* phone: a strip along the bottom, opened from the dock */
@media (max-width: 1099.98px) {
  .is-editing .tray.is-open {
    display: block; inset-inline: 8px; bottom: max(10px, env(safe-area-inset-bottom)); padding: 12px 12px 14px; border-radius: 22px;
    box-shadow: 0 24px 70px -18px rgba(60, 10, 34, .55), 0 0 0 1px rgba(60, 10, 34, .06); animation: tray-in .26s cubic-bezier(.2, .8, .2, 1);
  }
  .tray-open.ed .story { padding-bottom: 230px; }
  .tray-open .toasts { bottom: 214px; }
}
@keyframes tray-in { from { transform: translateY(30px); opacity: 0; } }

/* wide screen: always there, beside the page */
@media (min-width: 1100px) {
  /* over the page, not beside it: a floating panel of frosted glass, folding to a tab */
  .is-edit-on .tray {
    display: block; top: 82px; bottom: 16px; inset-inline-end: 16px; width: 300px; padding: 16px 14px 18px; overflow-y: auto; border-radius: 26px;
    background: color-mix(in srgb, #fff 90%, transparent); -webkit-backdrop-filter: blur(16px) saturate(1.2); backdrop-filter: blur(16px) saturate(1.2);
    box-shadow: 0 30px 70px -30px rgba(60, 10, 34, .55), 0 0 0 1px rgba(60, 10, 34, .07);
    scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--u-ink) 22%, transparent) transparent;
    transition: transform .35s cubic-bezier(.2, .8, .2, 1), opacity .25s ease;
  }
  .panel-folded.is-edit-on .tray { transform: translateX(calc(-100% - 32px)); opacity: 0; pointer-events: none; }
  #tray-fold { display: inline-flex; }
  .panel-folded.is-edit-on .tray-tab { display: grid; }
  .is-editing .thumbs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: visible; }
  .is-editing .thumb, .is-editing .thumb-add { flex: none; width: 100%; height: auto; aspect-ratio: 1; }
  .is-editing .thumb-add { grid-column: 1 / -1; aspect-ratio: auto; height: 74px; grid-auto-flow: column; gap: 8px; font-size: .92rem; }
  .is-editing .thumb { cursor: grab; }
  #tray-close { display: none; }
}
.is-preview .tray { display: none !important; }

/* a picture is on its way to a slot: chosen in the panel (is-placing) or being dragged */
.is-placing [data-img], .is-dragging .is-edit [data-img] { cursor: copy; }
.is-placing [data-img]::after, .is-dragging .is-edit [data-img]::after {
  content: 'להניח כאן'; position: absolute; inset: 0; top: 0; left: 0; z-index: 3; width: auto; height: auto; margin: 0; border: 0;
  display: grid; place-items: center; border-radius: 18px; background: rgba(255, 255, 255, .74);
  outline: 3px dashed var(--u-brand); outline-offset: -3px; color: var(--u-ink); font: 700 1.05rem var(--ui-font);
  animation: place-pulse 1.3s ease-in-out infinite;
}
.is-placing .hero-photo::after, .is-dragging .is-edit .hero-photo::after { border-radius: 50%; font-size: .74rem; }
.is-dragging .is-edit .frame.is-drop::after { background: #fff0f5; outline-style: solid; animation: none; }
@keyframes place-pulse { 50% { background: rgba(255, 240, 245, .9); } }
.frame.is-target { outline: 3px solid var(--u-brand); outline-offset: 8px; border-radius: 12px; }
.frame.is-uploading:not(.hero-photo) img { min-height: 200px; background: color-mix(in srgb, var(--card) 55%, transparent); }
.is-edit .frame.has-img { cursor: grab; }

/* ---------- popovers (confetti picker, menu) ---------- */
.pop {
  position: fixed; z-index: 60; padding: 6px; border-radius: 18px; background: #fff; color: var(--u-ink);
  box-shadow: 0 18px 50px -14px rgba(60, 10, 34, .5), 0 0 0 1px rgba(60, 10, 34, .07); animation: pop-in .16s ease;
}
@keyframes pop-in { from { opacity: 0; transform: translateY(-6px) scale(.97); } }
.pop button { appearance: none; border: 0; background: none; border-radius: 12px; color: var(--u-ink) !important; }
.pop button:hover { background: var(--u-hover); }
.pop-grid { display: grid; grid-template-columns: repeat(3, 84px); gap: 2px; }
.pop-grid button { display: grid; justify-items: center; gap: 3px; padding: 10px 4px 8px; font-size: .82rem; font-weight: 600; }
.pop-grid .emo { font-size: 1.5rem; line-height: 1.15; }
.pop-grid button.on { background: #ffeef3; box-shadow: inset 0 0 0 2px var(--u-brand); }
.pop-list { display: grid; min-width: 200px; }
.pop-list button { padding: 11px 14px; text-align: start; font-size: .95rem; font-weight: 500; }
.pop-list button.on { font-weight: 700; color: var(--u-brand) !important; }
.pop-list button.on::after { content: ' ✓'; }

/* ---------- loading ---------- */
.boot { position: fixed; inset: 0; z-index: 65; display: grid; place-content: center; justify-items: center; gap: 14px; background: #fff8f5; color: var(--u-soft); }
.boot .btn-ghost { margin-top: 4px; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3.5px solid #f3d5df; border-top-color: var(--u-brand); animation: spin .8s linear infinite; }

/* ---------- preview ---------- */
.is-preview .bar, .is-preview .dock, .is-preview .sheet { display: none !important; }
.preview-exit {
  font-family: var(--u-head); position: fixed; z-index: 90; top: max(12px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); appearance: none; height: 42px; padding: 0 20px;
  border: 0; border-radius: 999px; background: rgba(60, 10, 34, .92); color: #fff !important; font-weight: 700; font-size: .93rem;
  box-shadow: 0 12px 30px -12px rgba(0, 0, 0, .6); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.ed #preview.story { padding: 0; }

/* ---------- share dialog ---------- */
.dlg {
  width: min(440px, calc(100vw - 24px)); padding: 30px 24px 22px; border: 0; border-radius: 28px; background: #fff; color: var(--u-ink);
  text-align: center; box-shadow: 0 40px 100px -30px rgba(60, 10, 34, .6);
}
.dlg::backdrop { background: rgba(50, 8, 28, .5); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.dlg[open] { display: grid; gap: 12px; animation: pop-in .22s ease; }
.dlg h2 { margin: 0; font-family: var(--u-head); font-size: 1.55rem; font-weight: 800; letter-spacing: -.01em; }
.dlg p { margin: 0; color: var(--u-soft); font-size: .97rem; }
.dlg-emoji { font-size: 2.6rem; line-height: 1; }
.dlg-x { position: absolute; z-index: 2; top: 14px; inset-inline-end: 14px; appearance: none; width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--u-hover); }
.dlg-x .ic { width: 17px; height: 17px; }
.link-row { display: flex; gap: 8px; margin-top: 6px; }
.link-row input { flex: 1; min-width: 0; height: 46px; padding: 0 14px; border: 1.5px solid var(--u-line); border-radius: 14px; background: #fdf8f4; font-size: .9rem; direction: ltr; text-align: left; }
.link-row .btn-ghost { height: 46px; border-radius: 14px; }
.btn-wa {
  display: flex; align-items: center; justify-content: center; gap: 10px; height: 52px; border-radius: 999px; background: #1fa855; color: #fff !important;
  font-weight: 700; font-size: 1.05rem; text-decoration: none; box-shadow: 0 10px 22px -10px rgba(31, 168, 85, .8);
}
.btn-wa .ic { width: 22px; height: 22px; }
.btn-wa .ic svg { width: 100%; height: 100%; display: block; }

/* ---------- the share dialog: the message as it will arrive, then one button and four tools ---------- */
.share-chat {
  position: relative; display: grid; justify-items: start; gap: 10px; margin: -4px -6px 2px; padding: 16px 12px 14px; border-radius: 22px;
  background-color: #efe7dd; background-image: radial-gradient(rgba(120, 90, 60, .07) 1.2px, transparent 1.3px); background-size: 14px 14px;
}
.share-chat::before {
  content: 'היום'; justify-self: center; padding: 3px 12px; border-radius: 8px; background: rgba(255, 255, 255, .85); color: #54656f;
  font-size: .72rem; font-weight: 600; box-shadow: 0 1px 1px rgba(0, 0, 0, .06);
}
/* an outgoing message: on the left in a Hebrew chat, with its little tail */
.share-bubble {
  position: relative; justify-self: end; display: grid; gap: 6px; width: min(100%, 300px); padding: 4px 4px 6px; border-radius: 0 12px 12px 12px;
  background: #d9fdd3; box-shadow: 0 1px 1.5px rgba(0, 0, 0, .13); text-align: start; animation: bubble-in .5s .15s cubic-bezier(.2, 1.2, .4, 1) both;
}
.share-bubble::after {
  content: ''; position: absolute; top: 0; left: -7px; width: 8px; height: 13px; background: #d9fdd3;
  clip-path: polygon(100% 0, 0 0, 100% 100%);
}
.share-card { display: grid; overflow: hidden; border-radius: 9px; background: rgba(0, 0, 0, .05); }
.share-card img { width: 100%; aspect-ratio: 1.91; object-fit: cover; display: block; }
.share-card-text { display: grid; gap: 2px; padding: 8px 10px 9px; min-width: 0; }
.share-card-text b { font-size: .9rem; line-height: 1.3; color: #111b21; }
.share-card-text span { font-size: .78rem; line-height: 1.35; color: #54656f; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.share-card-text small { font-size: .74rem; color: #8696a0; direction: ltr; text-align: right; }
.share-url { padding: 0 6px; font-size: .82rem; color: #027eb5; text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; text-align: left; }
.share-time { justify-self: end; display: flex; align-items: center; gap: 3px; padding: 0 6px; font-size: .68rem; color: #667781; direction: ltr; }
.share-time i { font-style: normal; letter-spacing: -.28em; padding-inline-end: .28em; color: #8696a0; animation: ticks-read .3s 1.6s forwards; }
@keyframes bubble-in { from { opacity: 0; transform: translateY(14px) scale(.96); } }
@keyframes ticks-read { to { color: #53bdeb; } }

.share-title { margin-top: 4px !important; }
.share-stats { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
.share-stats span {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: #fff5f8;
  color: var(--u-ink); font-size: .86rem; font-weight: 600;
}
.share-stats .ic { width: 16px; height: 16px; color: var(--u-brand); }

.share-tools { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; margin-top: 2px; }
.share-tool {
  appearance: none; display: grid; justify-items: center; gap: 7px; padding: 4px 0; border: 0; background: none; color: var(--u-ink) !important;
  font: inherit; font-size: .8rem; font-weight: 600; line-height: 1.15; text-decoration: none; cursor: pointer;
}
.share-tool-ic {
  display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; background: var(--u-blush); color: var(--u-brand);
  transition: background .18s ease, color .18s ease, transform .18s ease;
}
.share-tool-ic .ic { width: 23px; height: 23px; }
.share-tool:hover .share-tool-ic, .share-tool:focus-visible .share-tool-ic { background: var(--u-brand); color: #fff; transform: translateY(-2px); }
.share-tool:active .share-tool-ic { transform: scale(.94); }

.share-foot { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; padding-top: 4px; }
.share-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 999px; background: var(--u-hover);
  color: var(--u-ink) !important; font-size: .8rem; font-weight: 600; text-decoration: none;
}
.share-chip .ic { width: 15px; height: 15px; color: var(--u-brand); }
.share-chip.is-soft { background: none; color: var(--u-soft) !important; font-weight: 500; }
.share-chip.is-soft .ic { color: var(--u-soft); }
@media (prefers-reduced-motion: reduce) {
  .share-bubble, .share-time i { animation: none; }
  .share-time i { color: #53bdeb; }
}
.dlg .btn-ghost.is-wide { height: 48px; }
.dlg-note { font-size: .84rem !important; padding-top: 4px; }
.dlg-stat { padding: 10px 12px; border-radius: 14px; background: #fff5f8; color: var(--u-ink) !important; font-weight: 600; font-size: .9rem !important; }
.dlg-actions { display: flex; gap: 10px; margin-top: 8px; }
.dlg-actions button { flex: 1; height: 48px; }
.btn-danger { appearance: none; border: 0; border-radius: 999px; background: #c62f2f; color: #fff !important; font-weight: 700; font-size: .98rem; }
.linklike { appearance: none; border: 0; background: none; padding: 0; color: var(--u-brand) !important; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- toasts ---------- */
.toasts { position: fixed; z-index: 95; left: 50%; bottom: max(80px, calc(env(safe-area-inset-bottom) + 72px)); transform: translateX(-50%); display: grid; gap: 8px; justify-items: center; width: max-content; max-width: calc(100vw - 24px); pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 14px; padding: 12px 18px; border-radius: 16px; background: rgba(60, 10, 34, .95); color: #fff; font-size: .93rem; font-weight: 500;
  box-shadow: 0 14px 34px -12px rgba(0, 0, 0, .6); pointer-events: auto; animation: toast-in .25s cubic-bezier(.2, .8, .2, 1);
}
.toast button { appearance: none; border: 0; background: none; padding: 0; color: #ffb3c9 !important; font-weight: 700; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } }

@media (prefers-reduced-motion: reduce) {
  .sheet, .pop, .toast, .dlg[open], .tray, .is-placing [data-img]::after, .is-dragging .is-edit [data-img]::after, .sec-look::before, .sec-look::after { animation: none !important; }
  .thumb { transition: none; }
}

/* ---------- the style dial: the lower half of a circle under a chapter's style button ---------- */
.is-edit .chapter { transition: padding-top .3s ease; }
.ed .is-edit .chapter.is-styling { padding-top: 292px; } /* the chapter makes room, so the dial covers nothing */
.dial {
  position: absolute; top: 92px; left: 50%; z-index: 6; width: 340px; height: 176px; margin-left: -170px; overflow: hidden;
  border-radius: 0 0 170px 170px; background: #fff; color: var(--u-ink);
  box-shadow: 0 26px 60px -22px rgba(60, 10, 34, .55), 0 0 0 1px rgba(60, 10, 34, .07);
  transform-origin: 50% 0; animation: dial-in .32s cubic-bezier(.2, .8, .2, 1); touch-action: pan-y; user-select: none; -webkit-user-select: none;
}
@keyframes dial-in { from { transform: scale(.4); opacity: 0; } }
.dial-head { position: absolute; top: 9px; left: 50%; z-index: 2; transform: translateX(-50%); display: flex; align-items: center; gap: 4px; direction: rtl; }
.dial-name { min-width: 84px; text-align: center; font-size: .92rem; font-weight: 700; white-space: nowrap; }
.dial-arrow { appearance: none; display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 50%; background: var(--u-hover); color: var(--u-ink) !important; }
.dial-arrow .ic { width: 15px; height: 15px; }
.dial-arrow.is-prev .ic { transform: rotate(-90deg); }
.dial-arrow.is-next .ic { transform: rotate(90deg); }
.dial-wheel { position: absolute; top: 0; left: 50%; width: 0; height: 0; }
.dial .look-tile { position: absolute; top: 0; left: 0; width: 64px; padding: 0; transition: transform .38s cubic-bezier(.2, .8, .2, 1), opacity .3s ease; }
.dial .look-prev { height: 50px; border-radius: 12px; }
.dial .look-tile.is-on .look-prev { box-shadow: 0 0 0 2.500px #fff, 0 0 0 5px var(--u-brand); }
@media (max-width: 380px) { .dial { transform: scale(.92); } }

/* ---------- more small controls inside the page ---------- */
.chip-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 560px; }
.edit-chip { height: 36px; padding: 0 13px 0 11px; font-size: .84rem; }
.more-add {
  appearance: none; justify-self: center; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px 0 10px; border: 0; border-radius: 999px;
  background: #fff; color: var(--u-ink) !important; font-weight: 600; font-size: .84rem; box-shadow: var(--u-shadow);
}
.more-add .ic { width: 15px; height: 15px; }
.chapter-media > .more-add { grid-column: 1 / -1; margin-top: 6px; }
.chapter-media:not(.is-collage) { flex-direction: column; align-items: center; gap: 14px; }
.is-collage .slot-move { display: none !important; }
.is-collage .slot-tools span:not(.ic) { display: none; }
.is-collage .slot-tools button { width: 36px; padding: 0; justify-content: center; }
.ideas { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: -10px; font-size: .8rem; color: var(--ink); }
.ideas button {
  appearance: none; padding: 6px 11px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, .85); color: var(--u-ink) !important;
  font-weight: 600; font-size: .8rem; box-shadow: 0 0 0 1px rgba(60, 10, 34, .1);
}
.ideas button:hover { background: #fff; }
@media (max-width: 859.980px) { .ideas { justify-content: center; } }

.item-list { display: grid; gap: 14px; width: 100%; }
.item-row { display: flex; align-items: center; gap: 10px; }
.item-row .item-text { flex: 1; min-width: 0; text-align: start; padding: 2px 4px; }
.item-del, .item-mark {
  appearance: none; flex: none; display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 50%;
  background: #fff; color: var(--u-ink) !important; box-shadow: var(--u-shadow); font-weight: 800;
}
.item-del .ic { width: 14px; height: 14px; }
.item-mark[aria-pressed='false'] { color: transparent !important; box-shadow: inset 0 0 0 2px #cfc9dc; background: rgba(255, 255, 255, .7); }
.item-mark[aria-pressed='true'] { background: #1fa855; color: #fff !important; }
.is-edit .voucher { min-height: 120px; }
.is-edit .wall .note, .is-edit .gallery-grid img { cursor: default; }

/* ---------- dialogs: recording, greetings, the look-over before publishing ---------- */
.rec-status { min-height: 2.800em; font-variant-numeric: tabular-nums; }
.rec-player { width: 100%; }
.rec-actions { display: grid; gap: 8px; }
.btn-danger.is-big { height: 54px; font-size: 1.1rem; }
.greet-list, .issues { display: grid; gap: 8px; max-height: 240px; overflow-y: auto; text-align: start; }
.greet { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 14px; background: #fdf8f4; }
.greet div { flex: 1; min-width: 0; display: grid; gap: 2px; font-size: .88rem; }
.greet span { color: var(--u-soft); overflow-wrap: anywhere; }
.greet .item-del { box-shadow: none; background: #efeaf5; }
.issue {
  appearance: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 0; border-radius: 14px;
  background: #fff8ea; color: var(--u-ink) !important; font-weight: 600; font-size: .92rem; text-align: start;
}
.issue-go { flex: none; color: var(--u-brand); font-weight: 700; font-size: .84rem; }
.replies { display: grid; gap: 6px; padding: 10px 12px; border-radius: 14px; background: var(--u-hover); text-align: start; font-size: .9rem; }
.replies p { color: var(--u-ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.pop-list .emo { font-size: 1.1rem; }

@media (prefers-reduced-motion: reduce) {
  .dial, .dial .look-tile, .is-edit .chapter { animation: none; transition: none; }
}

/* ---------- quieter text fields ---------- */
/* With a mouse the dashed outlines appear when the pointer is over the part being edited; on a
   touch screen, where nothing hovers, they stay. An empty field always shows where it is. */
@media (hover: hover) {
  .is-edit [data-f]:not(:empty):not(:focus) { outline-color: transparent; }
  .is-edit .gate:hover [data-f], .is-edit .hero:hover [data-f], .is-edit .chapter:hover [data-f], .is-edit .ending:hover [data-f] { outline-color: color-mix(in srgb, var(--ink) 24%, transparent); }
  .is-edit [data-f]:not(:focus):hover { outline-color: color-mix(in srgb, var(--ink) 55%, transparent) !important; }
}
.is-edit .chapter-label:empty { font-weight: 500; letter-spacing: 0; }
.is-edit .chapter-label:empty::before { all: unset; content: attr(data-ph); color: var(--soft); -webkit-text-fill-color: var(--soft); opacity: .6; pointer-events: none; }
.is-edit .letter [data-f] { outline-color: rgba(42, 34, 51, .24); }
.is-edit .letter [data-f]:empty::before { color: #6b5f78; -webkit-text-fill-color: #6b5f78; }
.is-edit .letter { transform: none; }

/* ---------- highlight: a small button that follows the selected words ---------- */
.hl-btn {
  position: fixed; z-index: 60; appearance: none; display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px; border: 0; border-radius: 999px;
  background: var(--u-ink); color: #fff !important; font: 700 .86rem var(--ui-font); box-shadow: 0 12px 28px -10px rgba(60, 10, 34, .7); white-space: nowrap; cursor: pointer;
}
.hl-btn[hidden] { display: none; }

/* ---------- the typeface row in the design sheet ---------- */
.fonts-title { display: block; padding: 12px 4px 0; font-size: .8rem; font-weight: 700; color: var(--u-soft); }
.fonts { display: flex; gap: 8px; overflow-x: auto; padding: 8px 2px 2px; scrollbar-width: none; }
.fonts::-webkit-scrollbar { display: none; }
.font-chip {
  appearance: none; flex: none; display: grid; gap: 1px; justify-items: center; min-width: 84px; padding: 8px 12px; border: 0; border-radius: 14px;
  background: var(--u-hover); color: var(--u-ink) !important; box-shadow: inset 0 0 0 1px rgba(60, 10, 34, .06);
}
.font-chip b { font-size: 1.12rem; line-height: 1.25; font-weight: 700; }
.font-chip span { font-size: .8125rem; font-weight: 600; color: var(--u-soft); }
.font-chip[aria-pressed='true'] { background: #fff; box-shadow: inset 0 0 0 2.5px var(--u-brand); }
.font-chip[data-font='serif'] b { font-family: 'Frank Ruhl Libre', serif; font-weight: 900; }
.font-chip[data-font='round'] b { font-family: 'Fredoka', sans-serif; }
.font-chip[data-font='bold'] b { font-family: 'Rubik', sans-serif; font-weight: 900; }
.font-chip[data-font='hand'] b { font-family: 'Playpen Sans Hebrew', cursive; }

/* ---------- extras: one list for the opening and the ending ---------- */
.extras { display: grid; gap: 6px; text-align: start; }
.extras-title { padding: 8px 4px 0; font-size: .78rem; font-weight: 700; color: var(--u-soft); }
.extra {
  appearance: none; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 11px 14px; border: 0; border-radius: 14px;
  background: #fdf8f4; color: var(--u-ink) !important; text-align: start;
}
.extra-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: #fff; color: var(--u-brand); box-shadow: inset 0 0 0 1px rgba(60, 10, 34, .07); }
.extra-icon .ic { width: 20px; height: 20px; }
.extra[aria-pressed='true'] .extra-icon { color: #14803d; }
.extra-text { display: grid; gap: 1px; min-width: 0; }
.extra-text b { font-size: .95rem; font-weight: 700; }
.extra-text span { font-size: .875rem; color: var(--u-soft); }
.extra-state { font-size: .84rem; font-weight: 700; color: var(--u-soft); white-space: nowrap; }
.extra[aria-pressed='true'] { background: #eefaf2; }
.extra[aria-pressed='true'] .extra-state { color: #14803d; }
.extra-tunes { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 4px 4px; }
.extra-tunes button { appearance: none; height: 34px; padding: 0 13px; border: 0; border-radius: 999px; background: var(--u-hover); color: var(--u-ink) !important; font-weight: 600; font-size: .84rem; }
.extra-tunes button[aria-checked='true'] { background: var(--u-ink); color: #fff !important; }

/* ---------- the dock steps aside while a phone's page is scrolled down ---------- */
@media (max-width: 1099px) {
  .dock-away .dock { opacity: 0; pointer-events: none; transform: translate(-50%, 20px); }
}
.dlg { max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); overflow-y: auto; }

/* ---------- the address's name ---------- */
.alias-row {
  appearance: none; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 11px 14px; border: 1.5px dashed var(--u-line);
  border-radius: 14px; background: #fff; color: var(--u-ink) !important; font-size: .9rem; text-align: start; cursor: pointer;
}
.alias-row bdi { font-weight: 700; color: var(--u-brand); white-space: nowrap; }
.alias-go { font-size: .84rem; font-weight: 700; color: var(--u-brand); }
.alias-field { display: flex; align-items: center; height: 52px; border: 2px solid var(--u-line); border-radius: 15px; background: #fdf8f4; overflow: hidden; }
.alias-field:focus-within { border-color: #7a5cff; }
.alias-field span { flex: none; padding: 0 2px 0 12px; font-size: .82rem; color: var(--u-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 58%; }
.alias-field .alias-suffix { padding: 0 12px 0 2px; }
.write-form .alias-field input { height: 100%; border: 0; border-radius: 0; padding: 0 12px 0 2px; background: transparent; font-weight: 700; text-align: left; }
.write-form .alias-field:has(.alias-suffix) input { flex: 1; min-width: 0; padding: 0 2px 0 12px; }
.alias-status { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 1.6em; font-size: .86rem !important; font-weight: 600; }
.alias-status[data-state='ok'] { color: #14803d !important; }
.alias-status[data-state='no'] { color: #b42318 !important; }
.alias-try { appearance: none; height: 30px; padding: 0 11px; border: 0; border-radius: 999px; background: var(--u-hover); color: var(--u-ink) !important; font-weight: 700; font-size: .82rem; cursor: pointer; }

/* ---------- the top bar: the photos counter, undo and redo, a word on the preview button ---------- */
.progress {
  appearance: none; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 11px 0 6px; border: 0; border-radius: 999px;
  background: var(--u-blush); color: var(--u-brand) !important; font-family: var(--u-head); font-weight: 800; font-size: .86rem; white-space: nowrap;
}
.progress-ring {
  display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: radial-gradient(closest-side, var(--u-blush) 72%, transparent 74%), conic-gradient(var(--u-brand) calc(var(--p, 0) * 1%), color-mix(in srgb, var(--u-brand) 18%, transparent) 0);
}
.progress-ring svg { width: 13px; height: 13px; }
.progress.is-bump { animation: bump .5s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes bump { 40% { transform: scale(1.15); } }
.steps-btns { display: none; gap: 4px; }
@media (min-width: 900px) { .steps-btns { display: inline-flex; } }
.steps-btns .btn-ghost:disabled { opacity: .35; cursor: default; }
#preview-btn .short { display: none; }
@media (max-width: 560px) {
  #preview-btn { width: auto; padding: 0 12px; }
  #preview-btn span.long { display: none; }
  #preview-btn span.short { display: inline; }
  .status[data-state='saved'] { display: none; }
  .bar { gap: 6px; }
  .bar-end { gap: 6px; }
}
@media (max-width: 360px) { #preview-btn span.short { display: none; } #preview-btn { width: 40px; padding: 0; } }

/* ---------- calmer fields ---------- */
/* On a touch screen nothing hovers, so the dashed lines showed everywhere and the page looked like
   a form. Now a filled text shows its line only in the part of the page being worked on (the one
   in the middle of the screen); an empty one always shows where it is. */
@media (hover: none) {
  .is-edit [data-f]:not(:empty):not(:focus) { outline-color: transparent; }
  .is-edit .is-current [data-f]:not(:empty):not(:focus) { outline-color: color-mix(in srgb, var(--ink) 22%, transparent); }
}
/* An empty label is a small button, not a line of the form. */
.is-edit .chapter-label:empty:not(:focus) {
  justify-self: center; padding: 6px 14px; border-radius: 999px; outline-offset: 0; outline-style: dashed; font-size: .86rem; letter-spacing: 0;
}
.is-edit .chapter-label:empty:not(:focus)::before { opacity: .85; font-weight: 600; }
@media (min-width: 860px) {
  .is-edit .chapter:not(.no-media, .only-media, [data-look='spotlight']) .chapter-label:empty:not(:focus) { justify-self: start; }
}

/* ---------- one card that asks for all the photos ---------- */
.photo-cta { display: grid; justify-items: center; padding: 0 16px 36px; }
.photo-cta-btn {
  appearance: none; position: relative; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 14px; width: min(100%, 560px); padding: 18px 20px;
  border: 2px dashed color-mix(in srgb, var(--u-brand) 45%, transparent); border-radius: 24px; background: #fff; color: var(--u-ink) !important; text-align: start;
  box-shadow: 0 22px 44px -28px rgba(150, 10, 60, .6); cursor: pointer; transition: transform .15s ease, border-color .15s ease;
}
.photo-cta-btn:hover { transform: translateY(-2px); border-color: var(--u-brand); }
.photo-cta-icon {
  display: grid; place-items: center; width: 58px; height: 58px; border-radius: 18px; background: linear-gradient(135deg, var(--u-brand), var(--u-brand-2)); color: #fff;
  box-shadow: 0 10px 22px -12px rgba(150, 10, 60, .8); animation: cta-bob 2.6s ease-in-out infinite;
}
.photo-cta-icon .ic { width: 28px; height: 28px; }
@keyframes cta-bob { 50% { transform: translateY(-4px) rotate(-4deg); } }
.photo-cta-text { display: grid; gap: 3px; }
.photo-cta-text b { font-family: var(--u-head); font-weight: 800; font-size: 1.12rem; line-height: 1.25; }
.photo-cta-text span { font-size: .9rem; color: var(--u-soft); line-height: 1.4; }

/* ---------- what to add: a card for each kind of chapter, drawn in the gift's design ---------- */
.dlg.is-wide { width: min(600px, calc(100vw - 24px)); }
.kinds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; text-align: start; }
@media (min-width: 560px) { .kinds { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.kind-tile {
  appearance: none; display: grid; gap: 6px; padding: 8px 8px 12px; border: 1.5px solid var(--u-line); border-radius: 18px; background: #fff; color: var(--u-ink) !important;
  text-align: start; cursor: pointer; transition: border-color .15s ease, transform .2s cubic-bezier(.3, 1.4, .5, 1), box-shadow .2s ease;
}
.kind-tile:hover, .kind-tile:focus-visible { border-color: var(--u-brand); transform: translateY(-3px); box-shadow: 0 16px 30px -20px rgba(150, 10, 60, .6); }
.kind-tile b { padding: 0 4px; font-family: var(--u-head); font-weight: 800; font-size: .98rem; }
.kind-tile > span:last-child { padding: 0 4px; font-size: .82rem; line-height: 1.35; color: var(--u-soft); }
.kp {
  position: relative; display: grid; place-items: center; gap: 6px; aspect-ratio: 4 / 3; padding: 10px; overflow: hidden; border-radius: 12px;
  background: var(--sky); background-color: var(--bg); color: var(--ink);
}
.kp i, .kp em { display: block; font-style: normal; }
.kp .ln { height: 6px; border-radius: 4px; background: var(--ink); opacity: .55; }
.kp .ln.t { height: 8px; opacity: .85; }
.kp-photo { grid-template-columns: 1fr 1fr; gap: 8px; }
.kp-photo .pic { aspect-ratio: 3 / 4; width: 100%; border-radius: 6px; background: linear-gradient(160deg, var(--accent-2), var(--accent)); box-shadow: 0 0 0 3px var(--card, #fff); }
.kp-photo .txt { display: grid; gap: 5px; width: 100%; }
.kp-then { padding: 0; }
.kp-then .half { position: absolute; inset: 0; background: linear-gradient(160deg, #c9a27a, #8a6446); clip-path: inset(0 50% 0 0); }
.kp-then .half + .half { background: linear-gradient(160deg, var(--accent-2), var(--accent)); clip-path: inset(0 0 0 50%); }
.kp-then .bar { position: absolute; top: 0; bottom: 0; left: 50%; width: 3px; margin-left: -1.5px; background: #fff; }
.kp-then .knob { position: absolute; top: 50%; left: 50%; width: 22px; height: 22px; margin: -11px; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, .3); }
.kp-reasons { grid-template-columns: repeat(3, 1fr); gap: 7px; place-items: center stretch; padding-inline: 14px; }
.kp-reasons i { display: grid; place-items: center; aspect-ratio: 3 / 4; border-radius: 6px; background: var(--btn-bg); color: var(--btn-ink); font: 800 1rem var(--font-head); }
.kp-quiz { align-content: center; justify-items: stretch; gap: 5px; }
.kp-quiz i { height: 13px; border-radius: 999px; background: var(--card, #fff); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--ink) 25%, transparent); }
.kp-quiz i.ok { background: #3fb36b; box-shadow: none; }
.kp-voucher em {
  display: grid; place-items: center; width: 82%; height: 58%; border-radius: 10px; border: 2px dashed var(--accent);
  background: linear-gradient(120deg, #cfcfd8, #f1f1f6 50%, #bdbdc8); color: #6b6680; font-size: .9rem;
}
.kp-quote { align-content: center; gap: 5px; }
.kp-quote em { font: 900 2.4rem/0.6 var(--font-head); color: var(--accent); }
.kp-quote .ln { width: 70%; }
.kp-letter em { position: relative; display: grid; align-content: start; gap: 5px; width: 74%; height: 84%; padding: 12px 10px; background: var(--f-paper, #fff); border-radius: 3px; rotate: -3deg; box-shadow: 0 8px 16px -10px rgba(0, 0, 0, .5); }
.kp-letter em::before { content: ''; position: absolute; top: -6px; left: 50%; width: 34px; height: 11px; margin-left: -17px; background: var(--f-tape, #f7c3d3); }
.kp-letter .ln { background: #3a3247; opacity: .4; height: 4px; }

/* ---------- small moments ---------- */
/* a picture that lands in its place */
.frame.is-landed { animation: land .55s cubic-bezier(.3, 1.5, .5, 1); }
@keyframes land { 0% { transform: scale(.88); opacity: .4; } 60% { transform: scale(1.03); opacity: 1; } 100% { transform: none; } }
/* a new chapter */
.chapter.is-new { animation: arrive .5s cubic-bezier(.2, .8, .2, 1); }
@keyframes arrive { from { opacity: 0; transform: translateY(24px) scale(.98); } }
@media (prefers-reduced-motion: reduce) {
  .frame.is-landed, .chapter.is-new, .photo-cta-icon, .progress.is-bump { animation: none; }
}
.pop-list button.is-danger { color: #b42318 !important; }
.pop-list button.is-danger:hover { background: #fdecec; }

/* ---------- the round icon at the top of a dialog ---------- */
.dlg-icon {
  display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 2px; border-radius: 50%;
  background: var(--u-blush); color: var(--u-brand); font-size: 2rem; line-height: 1;
}
.dlg-icon .ic { width: 30px; height: 30px; }
.dlg-icon.is-danger { background: #fdecec; color: #b42318; }

/* ---------- how the link will look in a chat ---------- */
.link-card {
  display: grid; grid-template-columns: 92px 1fr; align-items: center; gap: 12px; padding: 8px; border-radius: 16px; background: #e9f6ec;
  text-align: start; box-shadow: inset 0 0 0 1px rgba(20, 120, 60, .12);
}
.link-card img { width: 92px; height: 62px; border-radius: 10px; object-fit: cover; }
.link-card div { display: grid; gap: 2px; min-width: 0; }
.link-card b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; color: #1a2e22; }
.link-card span { font-size: .78rem; color: #4f6b58; }
.link-card small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .74rem; color: #6b8a75; direction: ltr; text-align: right; }
.link-card-note { margin-top: -6px; font-size: .78rem !important; }

/* ---------- small drawn icons in the dialogs' lines ---------- */
.dlg-stat { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.dlg-stat .ic { width: 18px; height: 18px; color: var(--u-brand); flex: none; }
.dlg-stat .ic:not(:first-child) { margin-inline-start: 6px; }
.dlg-note.has-icon { display: flex; align-items: flex-start; gap: 7px; text-align: start; }
.dlg-note.has-icon .ic { flex: none; width: 16px; height: 16px; margin-top: 2px; color: var(--u-soft); }
.alias-icon { display: grid; place-items: center; color: var(--u-brand); }
.alias-icon .ic { width: 18px; height: 18px; }
.hl-btn .ic { width: 17px; height: 17px; }

/* ---------- looking and editing ---------- */
/* The page opens as the site itself (is-view): no lines around the words, no tools on the
   chapters. The pencil in the bar turns editing on (is-edit), and even then the page stays
   quiet: a text shows a ring of light when it is touched, a picture shows its tools when it is
   touched, and everything that can be done with a chapter is in the one bar at the bottom. */
.edit-btn {
  appearance: none; flex: none; display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 15px 0 12px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--u-ink); color: #fff !important; font-family: var(--u-head); font-weight: 800; font-size: .95rem; white-space: nowrap;
  box-shadow: 0 8px 18px -10px rgba(60, 10, 34, .8); transition: transform .15s ease;
}
.edit-btn:active { transform: scale(.95); }
.edit-btn svg { width: 18px; height: 18px; }
.edit-btn .i-done, .edit-btn[aria-pressed='true'] .i-pen { display: none; }
.edit-btn[aria-pressed='true'] { background: linear-gradient(100deg, var(--u-brand), var(--u-brand-2)); }
.edit-btn[aria-pressed='true'] .i-done { display: block; }
/* While editing the bar holds only what editing needs: done, undo, redo, the menu. */
.is-edit-on .steps-btns { display: inline-flex; }
.is-view .steps-btns, .is-edit-on #preview-btn, .is-edit-on #publish-btn, .is-edit-on #opened-btn { display: none; }
@media (max-width: 560px) {
  #preview-btn span.short { display: none; }
  #preview-btn { width: 40px; padding: 0; }
  .bar { gap: 5px; }
  .bar-end { gap: 5px; }
  .btn-main { padding: 0 15px; }
}
@media (max-width: 372px) { .progress-word { display: none; } }
.edit-hint {
  position: fixed; top: 68px; left: 50%; z-index: 39; margin: 0; padding: 9px 17px; border-radius: 999px; transform: translateX(-50%);
  background: #fff; color: var(--u-ink); font: 700 .92rem var(--u-head); white-space: nowrap; box-shadow: var(--u-shadow); pointer-events: none;
  animation: hint-in .45s cubic-bezier(.2, 1.4, .4, 1) both;
}
@keyframes hint-in { from { opacity: 0; transform: translate(-50%, -12px) scale(.9); } }

/* looking: what belongs to the recipient's visit, and does nothing here, stays out */
.is-view .made-card, .is-view .wish, .is-view .blow-btn, .is-view .voice-btn { display: none; }
.is-view .answer.is-wait { opacity: .5; border-style: dashed; cursor: default; }
.is-view .reason.is-wait { opacity: .45; cursor: default; }

/* a frame that waits for its picture, in both modes: a soft pane in the design's colour */
.slot-add {
  border: 0; background: color-mix(in srgb, var(--accent) 9%, var(--card));
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 32%, transparent); cursor: pointer;
}
.slot-add:hover, .frame.is-drop .slot-add { background: color-mix(in srgb, var(--accent) 16%, var(--card)); box-shadow: inset 0 0 0 2px var(--accent); }
.frame.is-empty::after { display: none; } /* a look's second sheet must not cover the button (the "stack" look did) */
.is-view .frame.is-empty { transform: none !important; padding: 0 !important; border: 0 !important; background: none !important; box-shadow: none !important; }
.is-view .hero-photo.is-empty { width: 112px; overflow: visible; }
.is-view .hero-photo .slot-add { aspect-ratio: 1; border-radius: 50%; gap: 3px; font-size: .78rem; }
.is-view .hero-photo .slot-add .ic { width: 26px; height: 26px; }
.is-view .chapter-media.is-collage .slot-add { aspect-ratio: 1; font-size: .86rem; }

/* editing: the page keeps its own look */
.ed .story.is-edit .chapter { padding-top: 64px; }
.ed .story.is-edit .chapter.is-styling, .ed .story.is-edit .ending.is-styling { padding-top: 250px; }
.is-edit .ending { transition: padding-top .3s ease; }
.look-prev.is-sign { display: grid; place-items: center; font-size: 1.55rem; line-height: 1; }
.look-prev.is-cake { display: grid; place-items: center; }
.look-prev.is-cake svg { height: 92%; width: auto; overflow: visible; }
.is-edit .cake { cursor: pointer; }
.dial { top: 46px; }
.ed .story.is-edit [data-f]:not(:empty):not(:focus) { outline-color: transparent !important; }
/* An empty field is a line of pale words, never a box. */
.ed .story.is-edit [data-f]:empty:not(:focus) { outline: 0; }
.ed .story.is-edit [data-f]:empty::before { opacity: .42; }
/* A chapter keeps its smaller offers to itself until it is touched: when and where, who said
   it, one more reason, the cross that removes one. One more picture is offered by the picture
   that was touched, and ideas for a title only while an empty title is being written. */
.is-edit .chapter:not(.is-picked) .chapter-label:empty, .is-edit .chapter:not(.is-picked) .quote-by:empty, .is-edit .hero:not(.is-picked) .hero-sub:empty { display: none; }
.is-edit .chapter:not(.is-picked) .item-del { visibility: hidden; }
.is-edit .ideas, .is-edit .more-add { display: none; }
.is-edit .chapter-title:empty:focus + .ideas { display: flex; }
.is-edit .is-picked .item-list .more-add, .is-edit .chapter-media:has(.frame.is-held) > .more-add { display: inline-flex; }
@media (hover: hover) { .is-edit .chapter-media:hover > .more-add { display: inline-flex; } }
.ed .story.is-edit [data-f]:focus { outline: 2px solid var(--accent); box-shadow: 0 0 0 8px color-mix(in srgb, var(--accent) 15%, transparent); }
@media (hover: hover) {
  .ed .story.is-edit [data-f]:not(:empty):not(:focus):hover { outline: 1.5px solid color-mix(in srgb, var(--accent) 45%, transparent) !important; }
}
/* the part that was touched */
.is-edit .is-picked { outline: 1.5px solid color-mix(in srgb, var(--accent) 30%, transparent); outline-offset: -8px; border-radius: 26px; }
/* a picture's tools show once it is touched (or under the mouse) */
.is-edit .slot-tools { display: none; }
.is-edit .frame.is-held .slot-tools, .is-edit .frame.is-moving .slot-tools { display: flex; }
@media (hover: hover) { .is-edit .frame:hover .slot-tools { display: flex; } }

/* ---------- the one bar at the bottom ---------- */
.dock { gap: 3px; padding: 5px; border-radius: 999px; background: var(--u-ink); max-width: calc(100vw - 14px); box-shadow: 0 18px 40px -16px rgba(60, 10, 34, .7); }
.dock button { height: 46px; padding: 0 15px; gap: 7px; background: none; box-shadow: none; font-size: .93rem; cursor: pointer; transition: background-color .15s ease, transform .15s ease; }
.dock button:active:not(:disabled) { transform: scale(.94); }
.dock button:hover:not(:disabled) { background: rgba(255, 255, 255, .13); }
.dock button:disabled { opacity: .3; cursor: default; }
.dock button .ic { width: 20px; height: 20px; }
.dock button.is-main { padding: 0 22px; background: linear-gradient(100deg, var(--u-brand), var(--u-brand-2)); }
.dock button.is-add { background: rgba(255, 255, 255, .16); }
.dock .emo { font-size: 1.05rem; line-height: 1; }
.dock-confetti.is-off .emo { filter: grayscale(1); opacity: .6; }
.dock.is-part button:not(.dock-confetti) { width: 44px; padding: 0; justify-content: center; }
@media (max-width: 380px) {
  .dock button { padding: 0 11px; }
  .dock.is-part button:not(.dock-confetti) { width: 40px; }
}
.fx-light .dock button { color: var(--u-ink) !important; }
.fx-light .dock button:hover:not(:disabled) { background: rgba(60, 10, 34, .08); }
.fx-light .dock button.is-add { background: rgba(60, 10, 34, .09); }
.fx-light .dock button.is-main { color: #fff !important; background: linear-gradient(100deg, var(--u-brand), var(--u-brand-2)); }

/* while typing: to finish, and to say the words instead of typing them */
.type-bar {
  position: fixed; z-index: 42; left: 50%; bottom: max(12px, env(safe-area-inset-bottom)); display: flex; gap: 3px; padding: 5px; border-radius: 999px;
  background: #fff; box-shadow: var(--u-shadow); opacity: 0; pointer-events: none; transform: translate(-50%, 20px); transition: opacity .2s ease, transform .2s ease;
}
.is-edit-on.is-typing .type-bar { opacity: 1; pointer-events: auto; transform: translateX(-50%); }
.type-bar button {
  appearance: none; display: inline-flex; align-items: center; gap: 7px; height: 44px; padding: 0 16px; border: 0; border-radius: 999px; cursor: pointer;
  background: none; color: var(--u-ink) !important; font-family: var(--u-head); font-weight: 700; font-size: .93rem; white-space: nowrap;
}
.type-bar button svg { width: 19px; height: 19px; }
.type-bar #type-done { background: var(--u-ink); color: #fff !important; }
#mic-btn { display: none; }
.type-bar.has-mic #mic-btn { display: inline-flex; }
.is-listening #mic-btn { background: var(--u-brand); color: #fff !important; animation: listening 1.2s ease-in-out infinite; }
@keyframes listening { 50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--u-brand) 22%, transparent); } }
.gate-line {
  height: 50px; padding: 0 14px; border: 1.5px solid var(--u-line); border-radius: 14px; background: var(--u-cream); color: var(--u-ink);
  font-size: 1rem; font-weight: 600; text-align: center;
}
.gate-line:focus { outline: none; border-color: var(--u-brand); }

/* wide screens: the side panel belongs to editing; while looking, the photos open as the strip */
@media (min-width: 1100px) {
  .is-view .tray { display: none; top: auto; width: auto; border: 0; overflow: visible; }
  .is-view .tray.is-open {
    display: block; inset-inline: max(8px, calc(50% - 360px)); bottom: 10px; padding: 12px 12px 14px; border-radius: 22px;
    box-shadow: 0 24px 70px -18px rgba(60, 10, 34, .55), 0 0 0 1px rgba(60, 10, 34, .06);
  }
  .is-view .thumbs { display: flex; overflow-x: auto; }
  .is-view .thumb, .is-view .thumb-add { flex: none; width: 74px; height: 74px; aspect-ratio: auto; }
  .is-view .thumb-add { grid-column: auto; grid-auto-flow: row; gap: 3px; font-size: .7rem; }
  .is-view #tray-close { display: inline-flex; }
  .is-view .outline { display: none; }
  .ed.is-view #story { padding-inline-end: 0; }
  .is-view .dock, .is-view .sheet, .is-view .toasts { left: 50%; }
}
@media (prefers-reduced-motion: reduce) {
  .edit-hint, .is-listening #mic-btn { animation: none; }
}

/* ---------- arrows on the touched chapter: its look, one after another ---------- */
.look-arrows {
  position: absolute; top: min(200px, 50%); inset-inline: 6px; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  transform: translateY(-50%); pointer-events: none;
}
.is-styling > .look-arrows { display: none; }
/* orbs, as the arrows that turn the sites at /start: glass around a disc in the design's button colour */
.look-arrow {
  appearance: none; pointer-events: auto; position: relative; display: grid; place-items: center; width: 52px; height: 52px; border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(255, 255, 255, .18); -webkit-backdrop-filter: blur(14px) saturate(1.8); backdrop-filter: blur(14px) saturate(1.8); color: var(--btn-ink, #fff) !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .6), inset 0 2px 0 rgba(255, 255, 255, .75), 0 0 0 1px rgba(0, 0, 0, .06), 0 14px 28px -14px rgba(0, 0, 0, .5);
  transition: transform .2s cubic-bezier(.3, 1.5, .5, 1), background-color .2s ease;
}
.look-arrow::before {
  content: ''; position: absolute; inset: 7px; border-radius: 50%; background: var(--btn-bg, var(--u-brand, #1d5bd8));
  box-shadow: 0 6px 14px -6px rgba(0, 0, 0, .55), inset 0 1.5px 0 rgba(255, 255, 255, .3), inset 0 0 0 1px rgba(255, 255, 255, .14);
  transition: transform .2s cubic-bezier(.3, 1.5, .5, 1);
}
@media (hover: hover) {
  .look-arrow:hover { background-color: rgba(255, 255, 255, .32); }
  .look-arrow:hover::before { transform: scale(1.07); }
}
.look-arrow:active { transform: scale(.88); }
.look-arrow .ic { position: relative; z-index: 1; width: 19px; height: 19px; }
.look-arrow .ic svg { stroke-width: 2.8; }
.look-arrow.is-prev .ic { transform: rotate(-90deg); }
.look-arrow.is-next .ic { transform: rotate(90deg); }
.look-name {
  padding: 7px 15px; border-radius: 999px; background: rgba(255, 255, 255, .94); color: var(--u-ink); font: 700 .9rem var(--u-head); white-space: nowrap;
  box-shadow: var(--u-shadow); opacity: 0; transform: scale(.9); transition: opacity .25s ease, transform .25s ease;
}
.look-name.on { opacity: 1; transform: none; }

/* ---------- the bar: two panes at the top corners, the page showing between and under them ---------- */
.bar {
  top: max(8px, env(safe-area-inset-top)); height: auto; align-items: flex-start; justify-content: space-between; gap: 8px;
  padding: 0 max(8px, env(safe-area-inset-left)) 0 max(8px, env(safe-area-inset-right));
  background: none; border: 0; -webkit-backdrop-filter: none; backdrop-filter: none; pointer-events: none;
}
.bar-main, .bar-end { display: flex; align-items: center; gap: 4px; margin: 0; padding: 5px; border-radius: 999px; background: #fff; box-shadow: var(--u-shadow); pointer-events: auto; }
.bar .btn-ghost:not(.opened) { border: 0; background: none; }
.bar .btn-ghost:not(.opened):hover:not(:disabled) { background: var(--u-hover); }
.bar .status { padding-inline: 4px 8px; }
.bar .status:empty { display: none; }
.bar .progress { height: 40px; }
@media (max-width: 480px) {
  .progress-word { display: none; }
  .bar .progress { padding: 0 11px 0 7px; }
  .bar .status:not([data-state='error']) { display: none; } /* a phone has no room for "saving"; a failure still shows */
}
/* Looking, the site runs to the very top, under the panes; editing, it starts below them. */
.ed .story.is-view { padding-top: 0; }
.ed .story.is-edit { padding-top: 62px; }
.edit-hint { top: 70px; }
@media (prefers-reduced-motion: reduce) { .look-name, .look-arrow { transition: none; } }

/* the three newer kinds, drawn small */
.kp-numbers { align-content: center; justify-items: stretch; gap: 4px; padding-inline: 16px; }
.kp-numbers i { padding: 2px 8px; border-radius: 6px; background: var(--btn-bg); color: var(--btn-ink); font: 800 .82rem/1.4 var(--font-head); text-align: start; }
.kp-numbers i:nth-child(2) { background: var(--accent-2); color: #1d1a2b; }
.kp-numbers i:nth-child(3) { background: var(--ink); color: var(--bg); }
.kp-cover em { position: relative; display: grid; grid-template-rows: auto 1fr; width: 56%; height: 92%; overflow: hidden; border-radius: 3px; background: var(--btn-bg); rotate: -3deg; box-shadow: 0 8px 16px -10px rgba(0, 0, 0, .5); }
.kp-cover b { font: 900 1.05rem/1.2 'Frank Ruhl Libre', serif; color: var(--btn-ink); text-align: center; }
.kp-cover .pic { background: linear-gradient(160deg, var(--accent-2), var(--accent)); }
.kp-cover .ln { position: absolute; bottom: 8px; inset-inline: 8px; height: 4px; background: #fff; opacity: .8; }
.kp-card em { display: grid; justify-items: center; gap: 3px; width: 50%; height: 92%; padding: 5px; border-radius: 8px; background: linear-gradient(160deg, #fff3c4, #f2b632 45%, #c98a12); color: #3a2500; box-shadow: 0 8px 16px -10px rgba(0, 0, 0, .5); }
.kp-card b { font: 900 .9rem/1 'Rubik', sans-serif; justify-self: start; }
.kp-card .pic { width: 54%; aspect-ratio: 1; border-radius: 50% 50% 10% 10%; background: rgba(58, 37, 0, .35); }
.kp-card .ln { width: 80%; height: 3px; background: #3a2500; opacity: .45; }

.kp-balloons { grid-template-columns: repeat(3, 1fr); gap: 6px; padding-inline: 18px; }
.kp-balloons i { aspect-ratio: 3 / 4; border-radius: 50% 50% 46% 46%; background: var(--accent); box-shadow: inset -4px -6px 0 rgba(0, 0, 0, .12); }
.kp-balloons i.b1 { background: var(--accent-2); translate: 0 -8px; }
.kp-balloons i.b2 { background: var(--btn-bg); }
.kp-wheel em { width: 62%; aspect-ratio: 1; border-radius: 50%; background: conic-gradient(var(--accent) 0 60deg, var(--accent-2) 0 120deg, var(--btn-bg) 0 180deg, var(--accent) 0 240deg, var(--accent-2) 0 300deg, var(--btn-bg) 0); box-shadow: 0 0 0 3px var(--card, #fff); }
.kp-wheel .pin { position: absolute; top: 10%; left: 50%; width: 14px; height: 16px; margin-left: -7px; background: var(--ink); clip-path: polygon(50% 100%, 0 0, 100% 0); }

/* ---------- the story of the site: the builder, as a sheet over the site ---------- */
/* The column and the shelf wear the gift's design ([data-theme] on .story-build). */
.dlg.is-story { width: min(520px, calc(100vw - 20px)); }
.story-build {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; min-width: 0; padding: 12px; border-radius: 24px; text-align: start;
  background: var(--sky, var(--bg)); background-color: var(--bg); color: var(--ink);
}
.story-build > * { min-width: 0; }
.story-build .ph { display: block; background: linear-gradient(140deg, var(--accent-2), var(--accent)); }
.story-build .site {
  display: flex; flex-direction: column; gap: 6px; padding: 9px; border-radius: 22px; max-height: min(46dvh, 420px);
  background: color-mix(in srgb, var(--card, #fff) 66%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 9%, transparent);
}
.story-build .site.is-full { animation: st-shake .42s ease; }
@keyframes st-shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
.story-build .site-cap { flex-shrink: 0; display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 10px; border-radius: 15px; }
.story-build .site-cap.is-top { background: var(--btn-bg, var(--accent)); color: var(--btn-ink, #fff); }
.story-build .cap-face { flex: none; width: 30px; height: 30px; overflow: hidden; border-radius: 50%; background: color-mix(in srgb, #fff 40%, transparent); box-shadow: 0 0 0 2px color-mix(in srgb, #fff 70%, transparent); }
.story-build .cap-face img { width: 100%; height: 100%; object-fit: cover; }
.story-build .cap-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-head); font-weight: var(--head-weight); font-size: 1rem; }
.story-build .site-cap.is-end { justify-content: center; background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent); }
.story-build .site-cap.is-end .ic { width: 24px; height: 24px; }
.story-build .site-list {
  flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 2px; list-style: none; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--ink) 26%, transparent) transparent;
}
.story-build .blk {
  position: relative; flex-shrink: 0; display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 6px 0 2px; border-radius: 14px;
  background: var(--card, #fff); color: var(--ink); box-shadow: 0 6px 14px -10px color-mix(in srgb, var(--ink) 60%, transparent);
}
.story-build .blk .art { font-size: 6.4px; }
.story-build .blk-name {
  flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; background: none; color: inherit; cursor: pointer; text-align: start;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--u-head, 'Rubik', sans-serif); font-weight: 700; font-size: .95rem;
}
.story-build .blk-grip { flex: none; display: grid; place-items: center; width: 28px; height: 100%; color: color-mix(in srgb, var(--ink) 34%, transparent); cursor: grab; touch-action: none; }
.story-build .blk-grip svg { width: 16px; height: 16px; }
.story-build .blk-x {
  flex: none; display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  background: color-mix(in srgb, var(--ink) 7%, transparent); color: var(--ink); font: 700 1.15rem/1 'Rubik', sans-serif;
}
.story-build .blk.is-drag { z-index: 3; scale: 1.03; cursor: grabbing; box-shadow: 0 0 0 2px var(--accent), 0 18px 30px -12px color-mix(in srgb, var(--ink) 70%, transparent); }
.story-build .blk.is-waiting { animation: st-blk-in .3s ease both; }
.story-build .blk.is-waiting .art { opacity: 0; }
@keyframes st-blk-in { from { opacity: 0; transform: translateY(10px); } }
.story-build .blk.is-landed { animation: st-blk-glow 1s ease; }
.story-build .blk.is-landed .art { animation: st-land .45s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes st-land { from { opacity: 0; transform: scale(.4) rotate(-12deg); } }
@keyframes st-blk-glow { from { box-shadow: 0 0 0 3px var(--accent), 0 6px 14px -10px color-mix(in srgb, var(--ink) 60%, transparent); } }
.story-build .blk.is-going { animation: st-blk-out .32s ease forwards; pointer-events: none; }
@keyframes st-blk-out { to { opacity: 0; transform: translateX(50px) scale(.9); height: 0; margin-bottom: -6px; } }
.story-build .shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); gap: 8px; }
.story-build .mo {
  position: relative; display: grid; justify-items: center; gap: 3px; padding: 8px 0 7px; border: 0; border-radius: 16px; cursor: pointer;
  background: color-mix(in srgb, var(--card, #fff) 70%, transparent); color: var(--ink); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 8%, transparent);
  transition: transform .15s ease;
}
.story-build .mo:hover { transform: translateY(-2px); }
.story-build .mo:active { transform: scale(.92); }
.story-build .mo .art { font-size: 8.5px; }
.story-build .mo b { font-family: var(--u-head, 'Rubik', sans-serif); font-weight: 700; font-size: .72rem; line-height: 1.1; white-space: nowrap; }
.story-build .mo-n {
  position: absolute; top: 4px; inset-inline-end: 4px; min-width: 19px; height: 19px; padding: 0 4px; border-radius: 99px; background: var(--accent); color: #fff;
  font: normal 800 .68rem/19px 'Rubik', sans-serif; text-align: center; transform: scale(0); transition: transform .25s cubic-bezier(.2, 1.6, .4, 1);
}
.story-build .mo.is-in .mo-n { transform: scale(1); }

/* the drawings: a box of 6em, so one drawing serves the shelf, the column and the flight between */
.story-build .art { position: relative; display: block; flex: none; width: 6em; height: 6em; }
.story-build .art > * { position: absolute; }
.story-build .art img, .story-build .art .ph { display: block; width: 100%; height: 100%; object-fit: cover; }
.story-build .ghost { position: absolute; z-index: 30; pointer-events: none; transform-origin: 0 0; }
.story-build .art-photo .pf { inset: .9em 1.1em; padding: .3em .3em .9em; border-radius: .35em; background: #fff; overflow: hidden; box-shadow: 0 .4em .8em -.4em rgba(0, 0, 0, .55); transform: rotate(-7deg); animation: st-tilt 3.2s ease-in-out infinite alternate; }
.story-build .art-photo .pf.pf-under { background: linear-gradient(var(--accent-2), var(--accent-2)) content-box, #fff; transform: rotate(10deg) translate(.5em, .2em); animation: none; }
@keyframes st-tilt { to { transform: rotate(-2deg) translateY(-.25em); } }
.story-build .art-then .tn { inset: .6em; border-radius: .7em; overflow: hidden; }
.story-build .art-then .tn.is-old img, .story-build .art-then .tn.is-old .ph { filter: sepia(.9) saturate(.7); }
.story-build .art-then .tn.is-old { clip-path: inset(0 0 0 50%); animation: st-wipe 2.6s ease-in-out infinite alternate; }
.story-build .art-then .tn-bar { top: .6em; bottom: .6em; left: 50%; width: .3em; margin-left: -.15em; border-radius: .2em; background: #fff; box-shadow: 0 0 .3em rgba(0, 0, 0, .4); animation: st-bar 2.6s ease-in-out infinite alternate; }
@keyframes st-wipe { from { clip-path: inset(0 0 0 22%); } to { clip-path: inset(0 0 0 78%); } }
@keyframes st-bar { from { left: 22%; } to { left: 78%; } }
.story-build .art-reasons i { top: 1.3em; left: 1.8em; display: grid; place-items: center; width: 2.4em; height: 3.3em; border-radius: .45em; background: var(--accent); color: #fff; font: normal 700 1em/1 'Rubik', sans-serif; box-shadow: 0 .3em .6em -.3em rgba(0, 0, 0, .5); }
.story-build .art-reasons i:nth-child(1) { transform: translateX(1.3em) rotate(16deg); background: var(--accent-2); }
.story-build .art-reasons i:nth-child(3) { transform: translateX(-1.3em) rotate(-16deg); background: var(--accent-2); }
.story-build .art-reasons i:nth-child(2) { z-index: 1; animation: st-flip 3s ease-in-out infinite; }
@keyframes st-flip { 0%, 30% { transform: rotateY(0); } 50%, 80% { transform: rotateY(180deg); background: #fff; color: var(--accent); } 100% { transform: rotateY(360deg); } }
.story-build .art-quiz i { left: .8em; right: .8em; display: grid; place-items: center; height: 1.15em; border-radius: 99px; background: color-mix(in srgb, var(--ink) 14%, transparent); color: transparent; font: normal 900 .8em/1 'Rubik', sans-serif; }
.story-build .art-quiz i:nth-child(1) { top: 1.2em; }
.story-build .art-quiz i:nth-child(2) { top: 2.45em; animation: st-right 2.8s ease infinite; }
.story-build .art-quiz i:nth-child(3) { top: 3.7em; }
@keyframes st-right { 0%, 35% { background: color-mix(in srgb, var(--ink) 14%, transparent); color: transparent; transform: none; } 45% { transform: scale(1.12); } 55%, 100% { background: var(--accent); color: #fff; transform: none; } }
.story-build .art-letter .paper { inset: .7em 1.1em; border-radius: .3em; background: #fffdf7; box-shadow: 0 .4em .8em -.4em rgba(0, 0, 0, .5); transform: rotate(-4deg); }
.story-build .art-letter u { position: absolute; right: .5em; left: .5em; height: .26em; border-radius: 9px; background: #c4b2a2; transform-origin: right; animation: st-write 3s ease infinite; }
.story-build .art-letter u:nth-child(1) { top: 1em; background: var(--accent); }
.story-build .art-letter u:nth-child(2) { top: 1.9em; animation-delay: .4s; }
.story-build .art-letter u:nth-child(3) { top: 2.8em; left: 1.6em; animation-delay: .8s; }
@keyframes st-write { 0% { transform: scaleX(0); } 35%, 100% { transform: scaleX(1); } }
.story-build .art-numbers b { inset: 0; display: grid; place-items: center; color: var(--accent); font: 900 2.1em/1 'Rubik', sans-serif; font-variant-numeric: tabular-nums; animation: st-beat 2.2s ease-in-out infinite; }
@keyframes st-beat { 50% { transform: scale(1.1); } }
.story-build .art-cover .cv { inset: .35em 1.25em; overflow: hidden; border-radius: .3em; box-shadow: 0 .4em .8em -.4em rgba(0, 0, 0, .55); }
.story-build .art-cover .cv b { position: absolute; top: 0; left: 0; right: 0; height: 1.5em; background: var(--accent); color: #fff; font: 900 1.05em/1.45em var(--font-head); text-align: center; }
.story-build .art-card .gc { inset: .55em 1.3em; display: grid; place-items: center; overflow: hidden; border-radius: .5em; background: linear-gradient(160deg, #fff3c4, #f2b632 45%, #c98a12); box-shadow: 0 .4em .8em -.4em rgba(0, 0, 0, .55); }
.story-build .art-card .gc b { color: #4d3200; font: 900 1.4em/1 'Rubik', sans-serif; }
.story-build .art-card .gc::after { content: ''; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, .7) 50%, transparent 65%) 150% 0 / 250% 100% no-repeat; animation: st-shine 2.6s ease-in-out infinite; }
@keyframes st-shine { to { background-position: -50% 0; } }
.story-build .art-balloons i { top: .7em; width: 1.75em; height: 2.15em; border-radius: 50% 50% 46% 46%; background: var(--accent); animation: st-bob 2.4s ease-in-out infinite alternate; }
.story-build .art-balloons i::after { content: ''; position: absolute; top: 100%; left: 50%; width: .1em; height: 1.7em; background: color-mix(in srgb, var(--ink) 40%, transparent); }
.story-build .art-balloons i:nth-child(1) { right: .45em; }
.story-build .art-balloons i:nth-child(2) { right: 2.12em; top: .3em; background: var(--accent-2); animation-delay: -.8s; }
.story-build .art-balloons i:nth-child(3) { right: 3.8em; background: #7a5cff; animation-delay: -1.6s; }
@keyframes st-bob { to { transform: translateY(-.45em) rotate(4deg); } }
.story-build .art-wheel .wh { inset: .8em; border-radius: 50%; background: conic-gradient(var(--accent) 0 60deg, var(--accent-2) 0 120deg, #7a5cff 0 180deg, var(--accent) 0 240deg, var(--accent-2) 0 300deg, #2ec4b6 0); box-shadow: inset 0 0 0 .25em #fff, 0 .3em .6em -.3em rgba(0, 0, 0, .5); animation: st-spin 4s cubic-bezier(.3, 0, .2, 1) infinite; }
.story-build .art-wheel .pin { top: .35em; left: 50%; width: 0; height: 0; border: .45em solid transparent; border-top: .75em solid var(--ink); transform: translateX(-50%); }
@keyframes st-spin { to { transform: rotate(1turn); } }
.story-build .art-voucher .tk { inset: 1.5em .6em; overflow: hidden; border-radius: .5em; background: var(--accent); box-shadow: 0 .4em .8em -.4em rgba(0, 0, 0, .5); }
.story-build .art-voucher .tk-silver { inset: .35em; border-radius: .3em; background: repeating-linear-gradient(45deg, #d5d9de 0 .3em, #b8bdc4 .3em .6em); animation: st-scratch 3s ease-in-out infinite; }
@keyframes st-scratch { 0%, 20% { clip-path: inset(0 0 0 0); } 70%, 100% { clip-path: inset(0 0 0 100%); } }
.story-build .art-quote b { inset: 0; display: grid; place-items: center; padding-top: .3em; color: var(--accent); font: 900 4.6em/1 var(--font-head); }
@media (prefers-reduced-motion: reduce) {
  .story-build *, .story-build *::after { animation: none !important; }
}

/* ---------- the side panel: the story builder in it ---------- */
#tray-fold { display: none; }
.tray-head #tray-fold .ic, .tray-head #tray-fold svg { width: 18px; height: 18px; }
.tray-tab {
  position: fixed; z-index: 44; top: 50%; left: 0; display: none; place-items: center; width: 38px; height: 92px; padding: 0; border: 0; cursor: pointer;
  border-radius: 0 20px 20px 0; transform: translateY(-50%); background: var(--u-ink); color: #fff;
  box-shadow: 0 18px 40px -16px rgba(60, 10, 34, .7);
}
.tray-tab svg { width: 20px; height: 20px; }
.outline { display: none; }
@media (min-width: 1100px) {
  .is-edit-on .outline { display: grid; gap: 10px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--u-line); }
  .outline > strong { font-family: var(--u-head); font-weight: 800; font-size: 1.02rem; }
  .outline .story-build { padding: 10px; border-radius: 22px; }
  .outline .story-build .site { max-height: none; }
  .outline .story-build .shelf { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.story-build .blk.is-current { box-shadow: 0 0 0 2px var(--accent), 0 6px 14px -10px color-mix(in srgb, var(--ink) 60%, transparent); }
.story-build .shelf.is-pick { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
.story-build .shelf.is-pick .art { font-size: 10px; }

/* ---------- on each chapter while editing: a floating strip, and a + on the seam below ---------- */
/* The strip belongs to the chapter in the middle of the screen (or the one touched, or under the
   mouse) and follows the page down it; the + sits on the seam between two chapters. */
.sec-rail-track { position: absolute; z-index: 7; top: 18px; bottom: 18px; inset-inline-start: 12px; pointer-events: none; opacity: 0; transition: opacity .25s ease; }
.is-edit .chapter.is-current > .sec-rail-track, .is-edit .chapter.is-picked > .sec-rail-track { opacity: 1; }
.is-edit .chapter.is-current > .sec-rail-track .sec-rail, .is-edit .chapter.is-picked > .sec-rail-track .sec-rail { pointer-events: auto; }
@media (hover: hover) {
  .is-edit .chapter:hover > .sec-rail-track { opacity: 1; }
  .is-edit .chapter:hover > .sec-rail-track .sec-rail { pointer-events: auto; }
}
.sec-rail {
  position: sticky; top: calc(50vh - 96px); display: grid; gap: 5px; padding: 5px; border-radius: 999px;
  background: color-mix(in srgb, var(--u-ink) 88%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: 0 16px 32px -12px rgba(30, 0, 15, .6), 0 0 0 1px rgba(255, 255, 255, .1);
}
.sec-btn {
  appearance: none; display: grid; place-items: center; width: 42px; height: 42px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  background: none; color: #fff !important; transition: background-color .15s ease, transform .15s ease;
}
.sec-btn:hover:not(:disabled) { background: rgba(255, 255, 255, .15); }
.sec-btn:active:not(:disabled) { transform: scale(.9); }
.sec-btn:disabled { opacity: .3; cursor: default; }
.sec-btn .ic { width: 20px; height: 20px; }
.sec-btn.is-confetti { background: rgba(255, 255, 255, .12); }
.sec-btn .emo { font-size: 1.15rem; line-height: 1; }
.sec-btn.is-off .emo { filter: grayscale(1); opacity: .6; }
/* below the wide screen (no side panel) the strip sits on the other side, where Hebrew lines end and leave room */
@media (max-width: 1099.98px) {
  .sec-rail-track { inset-inline-start: auto; inset-inline-end: 8px; }
  .look-arrows { inset-inline-start: 6px; inset-inline-end: 62px; }
}
@media (max-width: 700px) {
  .sec-rail-track { inset-inline-end: 5px; }
  .sec-btn { width: 38px; height: 38px; }
  .look-arrows { inset-inline-end: 52px; }
}
/* the look arrows of a touched chapter leave room for the strip */
@media (min-width: 1100px) { .look-arrows { inset-inline-start: 66px; } }
.sec-plus {
  position: absolute; z-index: 8; left: 50%; bottom: 0; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%;
  cursor: pointer; transform: translate(-50%, 50%); background: #fff; color: var(--u-brand) !important;
  box-shadow: 0 0 0 1px rgba(60, 10, 34, .08), 0 12px 26px -12px rgba(60, 10, 34, .6); transition: transform .2s cubic-bezier(.3, 1.5, .5, 1), background-color .2s ease, color .2s ease;
}
.sec-plus .ic { width: 22px; height: 22px; }
.sec-plus:hover, .sec-plus:focus-visible { transform: translate(-50%, 50%) scale(1.12); background: var(--u-brand); color: #fff !important; }
.is-view .sec-plus, .is-view .sec-rail-track, .is-preview .sec-plus, .is-preview .sec-rail-track { display: none; }
@media (prefers-reduced-motion: reduce) {
  .sec-rail-track, .sec-plus, .tray { transition: none; }
}
/* the panel speaks only while a picture is on its way to a slot (no standing helper line) */
.tray-hint:not(.is-live) { display: none; }

/* ---------- choosing on the page: a half circle from the strip, a ring around the + ---------- */
/* the half circle: the strip's button is its centre; it opens towards the page */
.sec-rail-track:has(.sec-rail.is-open) { opacity: 1; }
.sec-btn.is-open { background: rgba(255, 255, 255, .26); box-shadow: 0 0 0 2px var(--accent, #fff); }
.side-dial { position: absolute; left: 50%; z-index: 9; width: 0; height: 0; touch-action: none; user-select: none; -webkit-user-select: none; }
.side-disc {
  position: absolute; left: -168px; top: -168px; width: 336px; height: 336px; border-radius: 50%; pointer-events: auto;
  background: color-mix(in srgb, #fff 88%, transparent); -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 26px 60px -22px rgba(60, 10, 34, .55), 0 0 0 1px rgba(60, 10, 34, .07);
  animation: side-in .36s cubic-bezier(.2, .9, .2, 1) both;
}
.side-dial.to-left .side-disc { clip-path: inset(0 50% 0 0); }
.side-dial.to-right .side-disc { clip-path: inset(0 0 0 50%); }
@keyframes side-in { from { transform: scale(.15); opacity: 0; } }
.side-wheel { position: absolute; left: 0; top: 0; }
.side-dial .look-tile {
  position: absolute; left: 0; top: 0; width: 56px; padding: 0; cursor: pointer;
  transition: transform .4s cubic-bezier(.2, .9, .25, 1.1), opacity .3s ease;
}
.side-dial .look-prev { height: 48px; border-radius: 14px; }
.side-dial .look-tile.is-on .look-prev { box-shadow: 0 0 0 2.5px #fff, 0 0 0 5px var(--u-brand); }
.side-head { position: absolute; top: 0; display: grid; justify-items: center; gap: 4px; transform: translate(-50%, -50%); animation: side-head-in .4s .12s ease both; }
.side-dial.to-left .side-head { left: -52px; }
.side-dial.to-right .side-head { left: 52px; }
@keyframes side-head-in { from { opacity: 0; } }
.side-name { min-width: 64px; color: var(--u-ink); font-family: var(--u-head); font-weight: 800; font-size: .82rem; text-align: center; white-space: nowrap; }
.side-arrow {
  appearance: none; display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  background: var(--btn-bg, var(--u-brand, #1d5bd8)); color: var(--btn-ink, #fff) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, #fff 55%, transparent), 0 6px 12px -6px rgba(0, 0, 0, .5), inset 0 1.5px 0 rgba(255, 255, 255, .28);
  transition: transform .2s cubic-bezier(.3, 1.5, .5, 1);
}
.side-arrow:active { transform: scale(.88); }
.side-arrow .ic svg { stroke-width: 2.8; }
.side-arrow .ic { width: 15px; height: 15px; }
.side-arrow.is-up .ic { transform: rotate(180deg); }

/* the ring: around the + on a seam, every moment drawn as itself; the one at the top is chosen */
.sec-plus.is-open { transform: translate(-50%, 50%) rotate(45deg) scale(.7); opacity: 0; pointer-events: none; }
.story-build.ring {
  position: absolute; left: 50%; bottom: 0; z-index: 20; display: block; width: 0; height: 0; padding: 0; border-radius: 0; background: none;
  touch-action: none; user-select: none; -webkit-user-select: none;
}
.ring-disc {
  position: absolute; left: calc((var(--r) + 58px) * -1); top: calc((var(--r) + 58px) * -1); width: calc(var(--r) * 2 + 116px); height: calc(var(--r) * 2 + 116px);
  border-radius: 50%; background: color-mix(in srgb, var(--card, #fff) 84%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(1.25); backdrop-filter: blur(16px) saturate(1.25);
  box-shadow: 0 30px 70px -24px rgba(30, 0, 15, .6), 0 0 0 1px color-mix(in srgb, var(--ink) 9%, transparent), inset 0 0 60px color-mix(in srgb, var(--accent) 14%, transparent);
  animation: ring-in .42s cubic-bezier(.2, .9, .2, 1) both;
}
@keyframes ring-in { from { transform: scale(.12); opacity: 0; } }
.ring-orbit {
  position: absolute; left: calc(var(--r) * -1); top: calc(var(--r) * -1); width: calc(var(--r) * 2); height: calc(var(--r) * 2); border-radius: 50%;
  border: 1.5px dashed color-mix(in srgb, var(--accent) 50%, transparent); animation: ring-in .5s .05s ease both, ring-spin 40s linear infinite;
}
@keyframes ring-spin { to { rotate: 1turn; } }
.ring-wheel { position: absolute; left: 0; top: 0; }
.ring-tile {
  position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 62px; height: 62px; padding: 0; border: 0; border-radius: 18px; cursor: pointer;
  background: var(--card, #fff); box-shadow: 0 10px 22px -12px rgba(30, 0, 15, .55), 0 0 0 1px color-mix(in srgb, var(--ink) 8%, transparent);
  transition: transform .45s cubic-bezier(.2, .9, .25, 1.1), opacity .3s ease, box-shadow .25s ease;
}
.ring-tile .art { font-size: 8.6px; }
.ring-tile.is-on { box-shadow: 0 0 0 3px var(--accent), 0 14px 28px -12px color-mix(in srgb, var(--accent) 70%, transparent); }
.ring-core { position: absolute; left: 0; top: 0; display: grid; justify-items: center; gap: 8px; transform: translate(-50%, -50%); animation: side-head-in .4s .2s ease both; }
.ring-name { color: var(--ink); font-family: var(--font-head); font-weight: var(--head-weight); font-size: 1.15rem; line-height: 1.1; white-space: nowrap; }
.ring-row { display: flex; align-items: center; gap: 6px; }
.ring-arrow {
  appearance: none; display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  background: var(--btn-bg, var(--accent)); color: var(--btn-ink, #fff) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, #fff 55%, transparent), 0 6px 12px -6px rgba(0, 0, 0, .5), inset 0 1.5px 0 rgba(255, 255, 255, .28);
  transition: transform .2s cubic-bezier(.3, 1.5, .5, 1);
}
.ring-arrow:active { transform: scale(.88); }
.ring-arrow .ic svg { stroke-width: 2.8; }
.ring-arrow .ic { width: 16px; height: 16px; }
.ring-arrow.is-prev .ic { transform: rotate(-90deg); }
.ring-arrow.is-next .ic { transform: rotate(90deg); }
.ring-add {
  appearance: none; display: inline-flex; align-items: center; gap: 5px; height: 38px; padding: 0 14px 0 12px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--btn-bg, var(--accent)); color: var(--btn-ink, #fff) !important; font-family: var(--u-head, 'Rubik', sans-serif); font-weight: 800; font-size: .92rem;
  box-shadow: 0 10px 22px -10px color-mix(in srgb, var(--accent) 80%, transparent);
}
.ring-add .ic { width: 17px; height: 17px; }
@media (max-width: 519.98px) {
  .ring-tile { width: 54px; height: 54px; border-radius: 16px; }
  .ring-tile .art { font-size: 7.6px; }
  .ring-name { font-size: 1rem; }
  .ring-add { height: 34px; padding: 0 11px 0 9px; font-size: .84rem; }
  .ring-arrow { width: 28px; height: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  .side-disc, .side-head, .ring-disc, .ring-orbit, .ring-core { animation: none; }
  .side-dial .look-tile, .ring-tile { transition: none; }
}
/* while the ring is open: its chapter above the next, and no strips over it */
.is-edit .is-ringing { z-index: 30; }
.story:has(.ring) .sec-rail-track { opacity: 0 !important; pointer-events: none; }
.side-dial:focus { outline: none; }

/* the draft under the ring: the chosen moment as it would sit on the page, below the ring's disc */
.ed .story.is-edit .chapter.is-ghost {
  margin-top: var(--ring-gap, 230px); outline: 2px dashed color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: -10px; border-radius: 26px;
  animation: ghost-in .45s cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes ghost-in { from { opacity: 0; transform: translateY(18px) scale(.985); } }
@media (prefers-reduced-motion: reduce) { .ed .story.is-edit .chapter.is-ghost { animation: none; } }

/* ---------- building a new site: the loading screen, in the chosen design ---------- */
.forge {
  position: fixed; inset: 0; z-index: 100; display: grid; place-content: center; justify-items: center; gap: 12px; padding: 24px; text-align: center;
  background: var(--sky); background-color: var(--bg); color: var(--ink); font-family: var(--font-body);
  transition: opacity .6s ease, transform .6s cubic-bezier(.3, 0, .2, 1);
}
.forge.is-gone { opacity: 0; transform: scale(1.08); pointer-events: none; }
.forge-dial { position: relative; display: grid; place-items: center; width: 240px; height: 210px; margin-bottom: 4px; animation: forge-in .7s cubic-bezier(.2, 1.2, .4, 1) both; }
@keyframes forge-in { from { opacity: 0; transform: scale(.8) translateY(14px); } }
/* a warm light behind the cake, growing with every candle lit (--warm, 0 to 1) */
.forge-glow {
  position: absolute; left: 50%; top: 34%; width: 260px; height: 220px; border-radius: 50%; transform: translate(-50%, -50%) scale(calc(.55 + var(--warm, 0) * .45));
  background: radial-gradient(closest-side, color-mix(in srgb, #ffc65c 70%, transparent), color-mix(in srgb, var(--accent) 22%, transparent) 60%, transparent);
  opacity: calc(var(--warm, 0) * .9); transition: opacity .6s ease, transform .6s ease; pointer-events: none;
}
.forge.is-blown .forge-glow { opacity: 0; transition-duration: .9s; }
.forge-cake { position: relative; width: 220px; }
.forge-cake svg { display: block; width: 100%; overflow: visible; }
/* a candle not yet lit has no flame; lighting, it pops up out of the wick */
.forge .flame { transition: scale .4s cubic-bezier(.2, 1.8, .4, 1), opacity .25s ease; }
.forge .flame:not(.lit) { opacity: 0; scale: .15; }
.forge-pct { font-family: var(--font-head); font-weight: var(--head-weight); font-size: 3rem; line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; direction: ltr; }
.forge-title { max-width: 340px; font-family: var(--font-head); font-weight: var(--head-weight); font-size: clamp(1.35rem, 6vw, 1.75rem); line-height: 1.15; text-wrap: balance; }
.forge-marks { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; max-width: 260px; margin-top: 4px; }
.forge-marks i { width: 22px; height: 8px; border-radius: 999px; background: color-mix(in srgb, var(--ink) 12%, transparent); transition: background-color .4s ease, transform .4s cubic-bezier(.3, 1.6, .5, 1); }
.forge-marks i.on { background: var(--accent); transform: scaleY(1.25); }
.forge-step { min-height: 1.5em; color: var(--soft); font-size: .98rem; font-weight: 500; }
.forge.is-ready .forge-cake { animation: forge-pop .6s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes forge-pop { 40% { transform: scale(1.08); } }
.forge.is-ready .forge-step { color: var(--accent); font-weight: 800; font-size: 1.2rem; }
@media (prefers-reduced-motion: reduce) { .forge, .forge * { animation: none !important; transition: none !important; } }

/* the wedding's moments, drawn as themselves */
.story-build .art-timeline .tl-line { top: .9em; bottom: .9em; left: 50%; width: .22em; margin-left: -.11em; border-radius: .2em; background: color-mix(in srgb, var(--accent) 60%, transparent); }
.story-build .art-timeline .tl-a, .story-build .art-timeline .tl-b { left: 50%; width: .9em; height: .9em; margin-left: -.45em; border-radius: 50%; background: #fff; box-shadow: 0 0 0 .2em var(--accent); }
.story-build .art-timeline .tl-a { top: 1.1em; }
.story-build .art-timeline .tl-b { top: 2.5em; animation: st-beat 2.2s ease-in-out infinite; }
.story-build .art-timeline .tl-c { top: 3.7em; left: 50%; display: grid; place-items: center; width: 1.5em; height: 1.5em; margin-left: -.75em; border-radius: 50%; background: var(--accent); color: #fff; font: normal 700 .8em/1 sans-serif; }
/* three envelopes, each sealed with its letter */
.story-build .art-blessings i {
  top: 1.4em; display: grid; place-items: center; width: 2.3em; height: 2.9em; padding-bottom: .5em; box-sizing: border-box; border-radius: .35em;
  background: radial-gradient(circle at 50% 40%, var(--btn-bg, var(--accent)) 0 .62em, transparent .66em), #fff;
  color: var(--btn-ink, #fff); font: normal 700 .9em/1 'Bellefair', serif; box-shadow: 0 .3em .6em -.3em rgba(0, 0, 0, .5);
}
.story-build .art-blessings i:nth-child(1) { right: .4em; transform: rotate(10deg); }
.story-build .art-blessings i:nth-child(2) { right: 1.85em; top: 1em; z-index: 1; animation: st-beat 2.4s ease-in-out infinite; }
.story-build .art-blessings i:nth-child(3) { right: 3.3em; transform: rotate(-10deg); }
.story-build .art-ketubah .kt { inset: .5em 1.3em; border-radius: 2.2em 2.2em .3em .3em; background: #fffdf7; box-shadow: 0 0 0 .18em color-mix(in srgb, var(--accent) 60%, transparent), 0 .4em .8em -.4em rgba(0, 0, 0, .5); }
.story-build .art-ketubah u { position: absolute; right: .55em; left: .55em; height: .22em; border-radius: 9px; background: #c4b2a2; }
.story-build .art-ketubah u:nth-child(1) { top: 1.6em; background: var(--accent); }
.story-build .art-ketubah u:nth-child(2) { top: 2.4em; }
.story-build .art-ketubah u:nth-child(3) { top: 3.2em; left: 1.3em; }
.story-build .art-song .rc { inset: .5em; border-radius: 50%; background: repeating-radial-gradient(circle, #1b1815 0 .14em, #2a2521 .14em .28em); box-shadow: 0 .4em .8em -.4em rgba(0, 0, 0, .6); animation: st-spin 5s linear infinite; }
.story-build .art-song .rc img, .story-build .art-song .rc .ph { position: absolute; inset: 32%; width: 36%; height: 36%; border-radius: 50%; background: var(--accent); }

/* After the wedding: a pile of notes, ticked boxes, a house with lit windows, a sealed tin. */
.story-build .art-guestbook .gb { inset: .6em 1.2em .5em; border-radius: .25em; background: #fffdf8; box-shadow: 0 .3em .6em -.3em rgba(0, 0, 0, .45); }
.story-build .art-guestbook .gb:nth-child(1) { transform: rotate(-9deg); }
.story-build .art-guestbook .gb:nth-child(2) { transform: rotate(6deg); }
.story-build .art-guestbook .gb:nth-child(3) { animation: st-beat 2.4s ease-in-out infinite; }
.story-build .art-guestbook u { position: absolute; right: .5em; left: .5em; height: .2em; border-radius: 9px; background: #c4b2a2; }
.story-build .art-guestbook u:nth-child(1) { top: 1.2em; background: var(--accent); }
.story-build .art-guestbook u:nth-child(2) { top: 2em; left: 1.2em; }
.story-build .art-firsts i { position: absolute; right: .8em; width: 1.3em; height: 1.3em; border-radius: .35em; box-shadow: inset 0 0 0 .16em var(--accent); display: grid; place-items: center; color: #fff; font: normal 800 .8em/1 sans-serif; }
.story-build .art-firsts i::after { content: ''; position: absolute; right: 1.8em; width: 2.6em; height: .22em; border-radius: 9px; background: #c4b2a2; }
.story-build .art-firsts i.on { background: var(--accent); box-shadow: none; }
.story-build .art-firsts i:nth-child(1) { top: .6em; }
.story-build .art-firsts i:nth-child(2) { top: 2.2em; }
.story-build .art-firsts i:nth-child(3) { top: 3.8em; animation: st-beat 2.2s ease-in-out infinite; }
.story-build .art-home .hs { inset: 1.6em 1.3em .4em; border-radius: 0 0 .3em .3em; background: #fffdf8; display: grid; grid-template-columns: 1fr 1fr; gap: .3em; padding: .45em; box-shadow: 0 .3em .6em -.3em rgba(0, 0, 0, .45); }
.story-build .art-home .hs::before { content: ''; position: absolute; left: -.5em; right: -.5em; bottom: 100%; height: 1.4em; background: var(--accent); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.story-build .art-home u { position: relative; border-radius: .15em; background: #2b3550; }
.story-build .art-home u.lit { background: #ffd77a; box-shadow: 0 0 .5em #ffd77a; }
.story-build .art-capsule .cp { inset: 1.3em .8em 1em; border-radius: .3em; background: repeating-linear-gradient(-45deg, var(--accent) 0 .35em, #fff .35em .55em, var(--accent-2) .55em .9em, #fff .9em 1.1em); display: grid; place-items: center; box-shadow: 0 .3em .6em -.3em rgba(0, 0, 0, .45); }
.story-build .art-capsule .cp::before { content: ''; position: absolute; inset: .22em; border-radius: .15em; background: #fffaf2; }
.story-build .art-capsule .cp b { position: relative; display: grid; place-items: center; width: 1.4em; height: 1.4em; border-radius: 50%; background: var(--accent); color: #fff; font: normal 700 .75em/1 sans-serif; animation: st-beat 2.4s ease-in-out infinite; }

/* ---------- the side panel's three tabs: the photos, the story, the design (wide screen, editing) ---------- */
/* One thing at a time instead of one long scroll, and the design beside the page instead of over it. */
.tray-tabs { display: none; }
@keyframes pane-in { from { opacity: 0; transform: translateY(6px); } }
@media (min-width: 1100px) {
  .is-edit-on .tray { width: 320px; padding-top: 12px; }
  .is-edit-on .tray-head {
    position: sticky; top: -12px; z-index: 2; gap: 8px; margin: -12px -14px 14px; padding: 12px 14px 10px;
    background: color-mix(in srgb, #fff 94%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  }
  .is-edit-on .tray-title { display: none; }
  .is-edit-on .tray-tabs { display: flex; flex: 1; gap: 3px; padding: 4px; border-radius: 999px; background: var(--u-hover); }
  .tray-tabs button {
    appearance: none; flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 6px; border: 0;
    border-radius: 999px; background: none; color: var(--u-soft) !important; font: 700 .86rem var(--u-head); cursor: pointer; white-space: nowrap;
    transition: background-color .2s ease, color .2s ease, box-shadow .2s ease;
  }
  .tray-tabs button svg { flex: none; width: 18px; height: 18px; }
  .tray-tabs button:hover { color: var(--u-ink) !important; }
  .tray-tabs button[aria-selected='true'] {
    background: #fff; color: var(--u-brand) !important; box-shadow: 0 4px 12px -6px rgba(60, 10, 34, .45), 0 0 0 1px rgba(60, 10, 34, .06);
  }
  .is-edit-on .tray-pane { display: none; }
  .is-edit-on .tray[data-tab='photos'] [data-pane='photos'], .is-edit-on .tray[data-tab='design'] [data-pane='design'] { display: block; animation: pane-in .25s ease; }
  .is-edit-on .tray[data-tab='story'] [data-pane='story'] { display: grid; animation: pane-in .25s ease; }
  .is-edit-on .outline { margin-top: 0; padding-top: 0; border-top: 0; }
  .is-edit-on .outline > strong { display: none; }

  /* the design, in the panel: big tiles in two columns, the typefaces under them */
  .tray .sheet { position: static; transform: none; width: auto; padding: 0; border-radius: 0; background: none; box-shadow: none; animation: none; }
  .tray .sheet-head { display: none; }
  .tray .sheet::before, .tray .fonts-title { display: block; padding: 0 2px 10px; font-size: .8rem; font-weight: 700; color: var(--u-soft); }
  .tray .sheet::before { content: 'צבעים ואווירה'; }
  .tray .fonts-title { padding-top: 20px; padding-bottom: 0; }
  .tray .themes { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 10px; overflow: visible; margin: 0; padding: 4px; }
  .tray .tile-prev { height: 92px; border-radius: 18px; font-size: 1.3rem; transition: transform .18s ease; }
  .tray .theme-tile:hover .tile-prev { transform: translateY(-2px); }
  .tray .fonts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; overflow: visible; padding: 8px 0 2px; }
  .tray .font-chip { min-width: 0; padding: 10px 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .tray-pane, .tray .tile-prev { animation: none !important; transition: none; }
}
