/* Playable sketches of TaleWhale (tw-) and Safari Day (sd-).
   Colours are each app's own, so they stay the same in the site's light and dark themes. */

/* ── shared phone frame ─────────────────────────────────────────────── */
.tw-wrap, .sd-wrap {
  width: 100%; max-width: 330px; margin: 0 auto; min-width: 0;
  display: flex; flex-direction: column; gap: 10px;
  font-family: var(--f-body, "Barlow", "Helvetica Neue", Arial, sans-serif);
  -webkit-font-smoothing: antialiased; text-align: left;
}
.tw-wrap *, .sd-wrap * { box-sizing: border-box; }
.tw-phone, .sd-phone {
  position: relative; width: 100%; aspect-ratio: 9 / 18.5;
  border: 7px solid #17181c; border-radius: 34px; overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .55);
}
.tw-caption, .sd-caption {
  margin: 0; font-size: 12px; line-height: 1.4; text-align: center;
  color: inherit; opacity: .72;
}
:where(.tw-wrap, .sd-wrap) button { font: inherit; color: inherit; cursor: pointer; margin: 0; }
:where(.tw-wrap, .sd-wrap) button:disabled { cursor: default; }
.tw-wrap [hidden], .sd-wrap [hidden] { display: none !important; }
.tw-wrap :focus-visible { outline: 2px solid #1E44C4; outline-offset: 2px; border-radius: 8px; }
.sd-wrap :focus-visible { outline: 2px solid #ffe08a; outline-offset: 2px; }

/* ══ TaleWhale ("Bound": warm paper, serif for the story, gradient only for AI) ══ */
.tw-wrap {
  --tw-paper: #FAF8F4; --tw-ink: #111111; --tw-body2: #45443F; --tw-muted: #77756F; --tw-hair: #E8E4DB; --tw-ctl: #D6D2C8;
  --tw-action: #1E44C4; --tw-plot: #D4301C; --tw-ok: #1B7A52;
  --tw-ai: linear-gradient(135deg, #12B3A4, #276BF2 45%, #513DD9 80%, #7B4DFF);
  --tw-serif: var(--f-serif, "DM Serif Display", Georgia, serif);
  --tw-text: Georgia, "Iowan Old Style", "Times New Roman", serif;
}
.tw-phone { background: var(--tw-paper); color: var(--tw-ink); }
.tw-status {
  flex: none; height: 26px; padding: 0 20px; display: flex; align-items: center; justify-content: space-between;
  font-size: 11px; font-weight: 600;
}
.tw-status i { width: 62px; height: 16px; border-radius: 10px; background: #111; }
.tw-bars { width: 26px; height: 8px; background: linear-gradient(90deg, #111 0 3px, transparent 3px 5px, #111 5px 8px, transparent 8px 10px, #111 10px 13px, transparent 13px 16px, #111 16px 26px); }

.tw-screen { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.tw-body { position: relative; flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 0 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.tw-body > .tw-nav + * { margin-top: -6px; }
.tw-foot { flex: none; padding: 8px 12px 12px; display: flex; align-items: center; gap: 8px; background: linear-gradient(rgba(250, 248, 244, 0), var(--tw-paper) 10px); }
.tw-foot.tw-stack { flex-direction: column; align-items: stretch; gap: 6px; }
.tw-pair { display: flex; gap: 8px; }
.tw-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.tw-mid { text-align: center; align-self: center; }

/* chrome: round glassy buttons and the phase pill */
.tw-nav {
  flex: none; position: sticky; top: 0; z-index: 3; margin: 0 -12px; padding: 4px 12px 8px;
  display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 52px;
  background: linear-gradient(var(--tw-paper) 62%, rgba(250, 248, 244, 0));
}
.tw-round {
  flex: none; width: 40px; height: 40px; padding: 0; border: 1px solid rgba(255, 255, 255, .9); border-radius: 50%;
  display: grid; place-items: center; background: rgba(255, 255, 255, .78); color: var(--tw-ink);
  box-shadow: 0 1px 2px rgba(17, 17, 17, .06), 0 6px 14px -8px rgba(17, 17, 17, .3);
  font-size: 24px; line-height: 1; font-weight: 500;
}
button.tw-round { padding-bottom: 3px; }
button.tw-round:hover { background: #fff; }
.tw-round svg { width: 18px; height: 18px; fill: var(--tw-ink); }
.tw-phase {
  min-width: 0; display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 18px;
  background: rgba(255, 255, 255, .78); border: 1px solid rgba(255, 255, 255, .9);
  box-shadow: 0 1px 2px rgba(17, 17, 17, .06), 0 6px 14px -8px rgba(17, 17, 17, .3);
  font-size: 14px; font-weight: 600; white-space: nowrap;
}
.tw-phase i { width: 6px; height: 6px; border: solid var(--tw-ink); border-width: 0 1.6px 1.6px 0; transform: translateY(-2px) rotate(45deg); }
.tw-brand { display: inline-flex; align-items: center; gap: 7px; font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.tw-whale svg { display: block; width: 26px; height: 20px; fill: var(--tw-ink); }

/* type */
.tw-wrap .tw-h:focus-visible { outline: none; }
.tw-h { margin: 0; font-family: var(--tw-serif); font-weight: 400; font-size: 23px; line-height: 1.08; letter-spacing: -.005em; outline: none; text-wrap: balance; }
.tw-h.tw-big { font-size: 27px; }
.tw-h.tw-chtitle { text-align: center; font-size: 22px; }
.tw-label { font-size: 9.5px; font-weight: 600; letter-spacing: .15em; text-transform: uppercase; color: var(--tw-muted); }
.tw-meta { margin: 2px 0 0; font-size: 11.5px; line-height: 1.4; color: var(--tw-muted); }
.tw-hint { margin: 0; min-height: 14px; font-size: 10.5px; line-height: 14px; color: var(--tw-muted); text-align: center; }
.tw-prose { font-family: var(--tw-text); font-size: 14.5px; line-height: 1.6; color: #1d1c1a; }
.tw-rule { width: 28px; margin: 0 auto; border: 0; border-top: 1px solid var(--tw-ctl); }
.tw-reading { gap: 12px; }
.tw-reading .tw-prose { margin: 4px 4px 0; font-size: 15px; line-height: 1.75; }

/* buttons: gradient only where AI starts, ink for the way forward, white for the rest */
.tw-btn {
  flex: 1; min-width: 0; min-height: 44px; padding: 0 14px; border: 0; border-radius: 22px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 13.5px; font-weight: 700; white-space: nowrap;
  transition: transform .12s ease, filter .15s ease, background-color .15s ease;
}
.tw-btn:active:not(:disabled) { transform: scale(.97); }
.tw-ai { background: var(--tw-ai); color: #fff; box-shadow: 0 8px 16px -10px #513DD9; }
.tw-ai:hover { filter: brightness(1.08) saturate(1.1); }
.tw-ink { background: var(--tw-ink); color: #fff; }
.tw-ink:hover:not(:disabled) { background: var(--tw-action); }
.tw-ink:disabled { background: #bdb9b0; color: #fff; }
.tw-sec { background: #fff; color: var(--tw-ink); border: 1px solid var(--tw-ctl); }
.tw-sec:hover:not(:disabled) { border-color: var(--tw-ink); }
.tw-sec:disabled { color: var(--tw-muted); }
.tw-slim { flex: none; min-height: 40px; padding: 0 16px; font-size: 13px; }
.tw-bi svg { display: block; width: 15px; height: 15px; fill: currentColor; }

/* cards */
.tw-card { background: #fff; border: 1px solid var(--tw-hair); border-radius: 14px; box-shadow: 0 1px 2px rgba(17, 17, 17, .03); }
.tw-bookcard { display: flex; gap: 12px; padding: 12px; align-items: flex-start; }
.tw-mini { flex: none; width: 60px; height: 88px; box-shadow: 0 6px 12px -7px rgba(17, 17, 17, .5), 0 0 0 1px rgba(17, 17, 17, .08); }
.tw-mini .tw-ctitle { font-size: 7.5px; } .tw-mini .tw-cby { display: none; }
.tw-bookinfo { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.tw-booktitle { font-family: var(--tw-serif); font-size: 17px; line-height: 1.12; text-wrap: balance; }
.tw-bookinfo .tw-btn { margin-top: 6px; }
.tw-cover.tw-seed { background: #C8401F; display: grid; place-items: center; padding: 0; }
.tw-seed i { width: 42%; aspect-ratio: 1; background: #fff; transform: rotate(45deg); }

/* spark rows */
.tw-c-chars { --c: #2563EB; } .tw-c-locs { --c: #5B3FD6; } .tw-c-objs { --c: #C7810A; } .tw-c-lore { --c: #5F7A1F; }
.tw-row { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 8px; padding: 9px 0 0; border-top: 1px solid var(--tw-hair); align-items: start; }
.tw-row:first-of-type { border-top: 0; padding-top: 2px; }
.tw-rl { display: flex; flex-direction: column; gap: 3px; padding-top: 3px; }
.tw-rl b { font-size: 17px; font-weight: 500; font-variant-numeric: tabular-nums; }
.tw-rc { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.tw-title { font-family: var(--tw-serif); font-size: 19px; line-height: 1.1; text-wrap: balance; }
.tw-beats { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.tw-beats li { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 4px; font-size: 12.5px; line-height: 1.35; }
.tw-beats b { color: var(--tw-plot); font-weight: 700; }
.tw-tokens { display: flex; flex-wrap: wrap; gap: 4px 0; }
.tw-token {
  width: 58px; min-height: 58px; padding: 2px 0; border: 0; background: none;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.tw-disc {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: #EFEDE7; box-shadow: none; transition: background-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.tw-disc svg { width: 20px; height: 20px; fill: #A9A59B; transition: fill .15s ease; }
.tw-tn { max-width: 100%; font-size: 10px; font-weight: 600; line-height: 1.1; color: var(--tw-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tw-token[aria-pressed="true"] .tw-disc { background: color-mix(in srgb, var(--c) 15%, #fff); box-shadow: 0 0 0 1.5px var(--c); }
.tw-token[aria-pressed="true"] .tw-disc svg { fill: var(--c); }
.tw-token[aria-pressed="true"] .tw-tn { color: var(--tw-ink); }
.tw-token:hover .tw-disc { transform: translateY(-1px); }
.tw-addtoken .tw-disc { background: none; border: 1.5px dashed var(--c); color: var(--c); font-size: 20px; line-height: 1; padding-bottom: 2px; }
.tw-addform { display: flex; gap: 6px; }
.tw-input {
  flex: 1; min-width: 0; height: 40px; padding: 0 12px; border: 1px solid var(--tw-ctl); border-radius: 20px;
  background: #fff; font: inherit; font-size: 13px; color: var(--tw-ink);
}
.tw-input::placeholder, .tw-cinput::placeholder { color: #73726F; opacity: 1; }
.tw-lore { min-height: 40px; padding: 0; border: 0; background: none; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; text-align: left; }
.tw-quote { font-family: var(--tw-text); font-style: italic; font-size: 13px; line-height: 1.3; color: var(--tw-body2); }
.tw-swap { font-size: 11px; font-weight: 700; color: var(--c); text-decoration: underline; text-underline-offset: 2px; }

/* the gradient-rimmed composer */
.tw-composer {
  display: flex; align-items: center; gap: 4px; padding: 0 2px 0 14px; border: 2px solid transparent; border-radius: 24px;
  background: linear-gradient(#fff, #fff) padding-box, var(--tw-ai) border-box;
}
.tw-cinput { flex: 1; min-width: 0; height: 40px; padding: 0; border: 0; background: none; font: inherit; font-size: 13px; color: var(--tw-ink); outline-offset: 4px; }
.tw-mic svg { display: block; width: 17px; height: 17px; fill: var(--tw-ink); }
.tw-send { flex: none; width: 40px; height: 40px; padding: 0 0 2px; border: 0; border-radius: 50%; background: none; color: #fff; font-size: 17px; font-weight: 700; position: relative; z-index: 0; }
.tw-send::before { content: ""; position: absolute; inset: 4px; z-index: -1; border-radius: 50%; background: var(--tw-ink); transition: background-color .15s ease; }
.tw-send:hover::before { background: var(--tw-action); }

/* blueprint and writing */
.tw-chapters { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.tw-chap { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 6px; }
.tw-num { padding-top: 12px; font-size: 12px; font-weight: 600; color: var(--tw-body2); text-align: center; }
.tw-chap .tw-card { padding: 10px 12px 9px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tw-ct { font-family: var(--tw-serif); font-size: 16.5px; line-height: 1.12; }
.tw-cp { margin: 0; font-size: 12.5px; line-height: 1.4; color: var(--tw-body2); }
.tw-cp.tw-prose { font-size: 13px; line-height: 1.5; min-height: 2.9em; }
.tw-state { font-size: 10.5px; color: var(--tw-muted); }
.tw-live .tw-card { border-color: #b9c6f3; }
.tw-live .tw-state { color: var(--tw-action); font-weight: 600; }
.tw-ready .tw-state { color: var(--tw-ok); font-weight: 700; }
.tw-e { color: var(--c); }
.tw-caret { display: inline-block; width: 1.5px; height: 1.05em; margin-left: 1px; vertical-align: -0.15em; background: var(--tw-action); }
.tw-pause { align-self: flex-start; }
.tw-pause i { width: 9px; height: 11px; border: solid var(--tw-ink); border-width: 0 3px; }
.tw-pause[aria-pressed="true"] i { width: 0; height: 0; border: solid transparent; border-width: 6px 0 6px 10px; border-left-color: var(--tw-ink); }
.tw-pause:disabled i { display: none; }

/* design */
.tw-seg { flex: none; display: flex; padding: 3px; border: 1px solid var(--tw-hair); border-radius: 22px; background: #fff; }
.tw-seg button { flex: 1; min-height: 40px; padding: 0 6px; border: 0; border-radius: 19px; background: none; font-size: 13px; font-weight: 600; color: var(--tw-muted); white-space: nowrap; }
.tw-seg button[aria-pressed="true"] { background: var(--tw-ink); color: #fff; }
.tw-pane { display: flex; flex-direction: column; gap: 10px; }

/* cover styles: --cv ground, --ink title, --art picture, --motif whale tail */
.tw-st-0 { --cv: #FFD21F; --ink: #14213D; --motif: #17A398; --art: radial-gradient(circle at 76% 24%, #F2542D 0 15%, transparent 15.5%), linear-gradient(#FFE66D 0 62%, #17A398 62%); }
.tw-st-1 { --cv: #16323A; --ink: #F3E3B3; --motif: #F3C969; --art: radial-gradient(circle at 50% 12%, #F6D98B 0, transparent 46%), linear-gradient(165deg, #2B6F77 0 46%, #1D4E5F 46% 70%, #12303A 70%); }
.tw-st-2 { --cv: #E2531E; --ink: #FFF3D6; --motif: #3A1A0C; --art: repeating-conic-gradient(from 0deg at 50% 100%, #F6B13B 0 9deg, #E7742B 9deg 18deg); }
.tw-st-3 { --cv: #F6F2EA; --ink: #2B4A6F; --motif: #2B4A6F; --art: radial-gradient(circle at 28% 32%, #9CC3F0 0, transparent 56%), radial-gradient(circle at 74% 66%, #C7B6EC 0, transparent 58%), radial-gradient(circle at 60% 20%, #F6C9B8 0, transparent 44%), #F1EADB; }
.tw-st-4 { --cv: #1F6FEB; --ink: #FFFFFF; --motif: #FFFFFF; --art: radial-gradient(circle at 24% 26%, #FFD23F 0 14%, transparent 14.5%), linear-gradient(#FF7A3D 0 58%, #1552B8 58%); }
.tw-st-5 { --cv: #EFE4C8; --ink: #4B3A26; --motif: #6E7F5B; --art: radial-gradient(circle at 50% 46%, #F7EFD9 0 44%, transparent 44.5%), repeating-linear-gradient(45deg, #D9C79C 0 3px, #E6D7B2 3px 8px); }

.tw-cover {
  width: 100%; height: 100%; padding: 7%; display: flex; flex-direction: column; gap: 6%;
  background: var(--cv); color: var(--ink); overflow: hidden;
}
.tw-art { flex: 1; min-height: 0; background: var(--art); display: grid; place-items: center; }
.tw-art svg, .tw-sw svg { width: 58%; max-height: 82%; fill: var(--motif); stroke: var(--cv); stroke-width: 5; paint-order: stroke; stroke-linejoin: round; }
.tw-ctitle { font-family: var(--tw-serif); font-size: 13px; line-height: 1.08; text-wrap: balance; }
.tw-cby { font-size: 7px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; opacity: .8; }

.tw-preview { align-self: center; width: 106px; height: 152px; box-shadow: 0 10px 20px -10px rgba(17, 17, 17, .55), 0 0 0 1px rgba(17, 17, 17, .1); }
@media (prefers-reduced-motion: no-preference) {
  .tw-painting { animation: tw-paint .5s ease-out; }
  @keyframes tw-paint { 40% { filter: saturate(1.5) brightness(1.08); transform: scale(1.05) rotate(-1.5deg); } }
  .tw-caret { animation: tw-blink 1s steps(1) infinite; }
  @keyframes tw-blink { 50% { opacity: 0; } }
}
.tw-styles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 6px; }
.tw-style { display: flex; flex-direction: column; gap: 4px; min-height: 62px; padding: 0; border: 0; background: none; font-size: 10px; line-height: 1.15; color: var(--tw-muted); text-align: center; }
.tw-sw { display: grid; place-items: center; height: 44px; border-radius: 8px; background: var(--art); box-shadow: 0 0 0 1px rgba(17, 17, 17, .12); overflow: hidden; }
.tw-sw svg { width: 34%; stroke-width: 7; }
.tw-style[aria-pressed="true"] { color: var(--tw-ink); font-weight: 700; }
.tw-style[aria-pressed="true"] .tw-sw { box-shadow: 0 0 0 2px var(--tw-paper), 0 0 0 4px var(--tw-ink); }

.tw-spread { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; padding: 10px; border-radius: 10px; background: #e6e1d6; }
.tw-page { position: relative; aspect-ratio: 5 / 7.4; min-width: 0; padding: 14% 11% 16%; background: #fffdf8; display: flex; flex-direction: column; gap: 5px; overflow: hidden; }
.tw-page:first-child { justify-content: center; align-items: center; text-align: center; box-shadow: inset -8px 0 10px -8px rgba(17, 17, 17, .18); }
.tw-page:last-child { box-shadow: inset 8px 0 10px -8px rgba(17, 17, 17, .18); }
.tw-pk { font-size: 6.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--tw-muted); }
.tw-page b { font-family: var(--tw-serif); font-weight: 400; font-size: 12.5px; line-height: 1.1; text-wrap: balance; }
.tw-page hr { width: 16px; margin: 3px 0 0; border: 0; border-top: 1px solid var(--tw-ctl); }
.tw-page p { margin: 0; font-family: var(--tw-text); font-size: 7.5px; line-height: 1.55; color: #2a2926; }
.tw-page i { height: 2px; border-radius: 1px; background: #dcd6c8; } .tw-page i:last-of-type { width: 64%; }
.tw-pn { position: absolute; left: 0; right: 0; bottom: 7%; text-align: center; font-family: var(--tw-text); font-size: 7px; color: var(--tw-muted); }

/* share & print: the hardcover */
.tw-real { padding: 4px 10px 12px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.tw-stage { position: relative; flex: none; width: 100%; height: 196px; display: grid; place-items: center; perspective: 640px; touch-action: pan-y; cursor: grab; user-select: none; -webkit-user-select: none; }
.tw-stage.tw-grab { cursor: grabbing; }
.tw-book { --w: 108px; --h: 158px; --d: 22px; position: relative; width: var(--w); height: var(--h); transform-style: preserve-3d; transform: rotateX(5deg) rotateY(var(--a, -28deg)); }
.tw-book.tw-ed-0 { --d: 9px; }
.tw-ed-2 .tw-cover { --cv: #CFC3A6; --ink: #2B2924; justify-content: center; text-align: center; background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .05) 0 1px, transparent 1px 2px), repeating-linear-gradient(90deg, rgba(0, 0, 0, .05) 0 1px, transparent 1px 2px), var(--cv); }
.tw-ed-2 .tw-art { display: none; }
.tw-book.tw-ed-2 { --cv: #CFC3A6; --ink: #2B2924; }
.tw-face { position: absolute; }
.tw-front { inset: 0; transform: translateZ(calc(var(--d) / 2)); backface-visibility: hidden; box-shadow: inset 4px 0 0 rgba(0, 0, 0, .12); }
.tw-rear { inset: 0; transform: rotateY(180deg) translateZ(calc(var(--d) / 2)); backface-visibility: hidden; background: var(--cv); padding: 34% 16% 0; display: flex; flex-direction: column; gap: 7px; }
.tw-rear i { height: 3px; background: var(--ink); opacity: .45; } .tw-rear i:last-child { width: 60%; }
.tw-spine { top: 0; left: calc(50% - var(--d) / 2); width: var(--d); height: 100%; transform: rotateY(-90deg) translateZ(calc(var(--w) / 2)); background: var(--cv); display: grid; place-items: center; overflow: hidden; }
.tw-spine::after { content: ""; position: absolute; inset: 0; background: rgba(0, 0, 0, .14); }
.tw-spine span { writing-mode: vertical-rl; font-family: var(--tw-serif); font-size: 8px; color: var(--ink); white-space: nowrap; max-height: 92%; overflow: hidden; }
.tw-ed-0 .tw-spine span { font-size: 6px; }
.tw-edge { top: 3px; left: calc(50% - var(--d) / 2 + 1px); width: calc(var(--d) - 2px); height: calc(100% - 6px); transform: rotateY(90deg) translateZ(calc(var(--w) / 2 - 3px)); background: repeating-linear-gradient(90deg, #f6f1e3 0 2px, #d6cfbb 2px 3px); }
.tw-top { left: 0; top: calc(50% - var(--d) / 2 + 1px); width: calc(100% - 3px); height: calc(var(--d) - 2px); transform: rotateX(90deg) translateZ(calc(var(--h) / 2 - 3px)); background: repeating-linear-gradient(0deg, #f6f1e3 0 2px, #d6cfbb 2px 3px); }
.tw-shadow { position: absolute; left: 50%; bottom: 4px; width: 130px; height: 12px; margin-left: -65px; border-radius: 50%; background: radial-gradient(closest-side, rgba(17, 17, 17, .26), transparent); pointer-events: none; }
.tw-editions { display: flex; flex-direction: column; border-top: 1px solid var(--tw-hair); }
.tw-edition { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 2px; border-bottom: 1px solid var(--tw-hair); cursor: pointer; }
.tw-edition input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: #111111; }
.tw-edition span { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.tw-edition b { font-size: 14px; font-weight: 600; }
.tw-edition small { font-size: 11px; line-height: 1.3; color: var(--tw-muted); }

/* ══ Safari Day (a picture book: pixel art for the world, smooth cream-and-leaf chrome) ══ */
.sd-wrap { --sd-ink: #342e4a; --sd-night: #1a172d; --sd-cream: #fefbf2; --sd-paper: #faf2df; --sd-edge: #dbba86; --sd-leaf: #267c43; --sd-deep: #013c33; --sd-orange: #ea802a; }
.sd-wrap :focus-visible { outline: 3px solid #1a172d; outline-offset: 2px; box-shadow: 0 0 0 6px #fee68a; }
.sd-phone { background: #013c33; color: var(--sd-ink); font-weight: 600; }
.sd-stage { position: relative; flex: 1; min-height: 0; overflow: hidden; background: #005c3e; }
.sd-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; image-rendering: pixelated; touch-action: manipulation; }
.sd-pix { display: block; image-rendering: pixelated; }
.sd-layer { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 6px; padding: 8px; pointer-events: none; }
.sd-layer > * { pointer-events: auto; }

.sd-top { position: absolute; z-index: 3; left: 8px; right: 8px; top: 8px; display: flex; justify-content: space-between; pointer-events: none; }
.sd-pill {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px 0 5px; border-radius: 15px;
  background: var(--sd-cream); border: 2px solid var(--sd-edge); box-shadow: 0 2px 0 rgba(26, 23, 45, .28); font-size: 14px; font-weight: 800; line-height: 1;
}
.sd-pill svg { width: 18px; height: 18px; flex: none; }
.sd-lv { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--sd-leaf); color: var(--sd-cream); font-size: 12px; }
.sd-xp { width: 40px; height: 6px; border-radius: 3px; background: #ebd0a3; overflow: hidden; }
.sd-xp i { display: block; height: 100%; width: 0; border-radius: 3px; background: #faa124; transition: width .3s ease; }

/* buttons and type */
.sd-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 8px 16px; border-radius: 21px; border: 0;
  background: var(--sd-leaf); color: var(--sd-cream); font-size: 14px; font-weight: 800; line-height: 1.1; box-shadow: 0 3px 0 #005c3e; text-align: center;
}
.sd-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #005c3e; }
.sd-btn svg { width: 18px; height: 18px; flex: none; }
.sd-cream { background: var(--sd-cream); color: var(--sd-ink); box-shadow: 0 3px 0 var(--sd-edge); border: 2px solid var(--sd-edge); }
.sd-photo { background: var(--sd-orange); box-shadow: 0 3px 0 #c5582f; }
.sd-link { min-height: 42px; padding: 8px 6px; border: 0; background: none; font-size: 13px; font-weight: 800; color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.sd-round { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--sd-edge); background: var(--sd-cream); color: var(--sd-ink); box-shadow: 0 2px 0 rgba(26, 23, 45, .28); padding: 0; }
.sd-round svg { width: 20px; height: 20px; }
.sd-h { margin: 0; font-size: 18px; font-weight: 800; line-height: 1.1; color: var(--sd-night); }
.sd-light { color: var(--sd-cream); }
.sd-center { text-align: center; }
.sd-p { margin: 0; font-size: 13px; line-height: 1.35; font-weight: 500; }
.sd-meta { margin: 0; font-size: 12px; font-weight: 700; color: #7e7590; }
.sd-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* sanctuary map */
.sd-l-map { padding-top: 46px; }
.sd-chip {
  display: flex; flex-direction: column; gap: 1px; min-height: 42px; padding: 6px 28px 7px 12px; border-radius: 14px; text-align: left; position: relative;
  background: var(--sd-cream); border: 2px solid var(--sd-edge); box-shadow: 0 2px 0 rgba(26, 23, 45, .28); color: var(--sd-ink);
}
.sd-chip span { font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #c5582f; }
.sd-chip b { font-size: 13px; line-height: 1.2; }
.sd-chip::after { content: "›"; position: absolute; right: 10px; top: 50%; transform: translateY(-55%); font-size: 20px; }
.sd-pins { position: absolute; inset: 0; pointer-events: none; }
.sd-pin { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 44px; min-height: 44px; padding: 2px; border: 0; background: none; pointer-events: auto; }
.sd-pin-dot { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--sd-cream); border: 2px solid var(--sd-ink); box-shadow: 0 2px 0 rgba(26, 23, 45, .35); }
.sd-pin-dot svg { width: 16px; height: 16px; }
.sd-pin-name { padding: 2px 7px; border-radius: 9px; background: var(--sd-cream); border: 1.5px solid var(--sd-edge); font-size: 10px; font-weight: 800; white-space: nowrap; color: var(--sd-ink); }
.sd-sheet { margin-top: auto; display: flex; flex-direction: column; gap: 5px; padding: 12px; border-radius: 16px; background: var(--sd-cream); border: 2px solid var(--sd-edge); box-shadow: 0 -2px 0 rgba(26, 23, 45, .12), 0 6px 14px rgba(1, 60, 51, .5); position: relative; z-index: 2; }
.sd-kind { margin: 0; display: flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--sd-leaf); }
.sd-kind svg { width: 13px; height: 13px; }

/* habitat and expedition */
.sd-bar { display: flex; align-items: center; gap: 6px; }
.sd-where { display: inline-flex; align-items: center; gap: 5px; min-height: 34px; padding: 4px 12px 4px 8px; border-radius: 17px; background: var(--sd-cream); border: 2px solid var(--sd-edge); box-shadow: 0 2px 0 rgba(26, 23, 45, .28); font-size: 13px; min-width: 0; }
.sd-where svg { width: 15px; height: 15px; flex: none; }
.sd-where b { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sd-two { flex: 1; flex-direction: column; align-items: center; gap: 0; padding: 4px 10px; border-radius: 14px; text-align: center; }
.sd-two small { font-size: 11px; font-weight: 700; color: var(--sd-leaf); }
.sd-film { display: grid; place-items: center; flex: none; min-width: 40px; height: 34px; padding: 0 8px; border-radius: 12px; background: var(--sd-cream); border: 2px solid var(--sd-edge); font-size: 14px; font-weight: 800; }
.sd-hint, .sd-bubble { margin: 0; align-self: center; max-width: 100%; padding: 6px 12px; border-radius: 14px; background: var(--sd-cream); border: 2px solid var(--sd-edge); font-size: 12px; line-height: 1.3; text-align: center; }
.sd-hint { margin-top: auto; }
.sd-care { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.sd-carebtn { display: inline-flex; align-items: center; gap: 4px; flex: none; min-height: 40px; padding: 4px 12px 4px 8px; border-radius: 20px; background: var(--sd-cream); border: 2px solid var(--sd-edge); font-size: 12px; font-weight: 800; color: var(--sd-ink); }
.sd-carebtn svg { width: 14px; height: 14px; }
.sd-actions { display: flex; gap: 8px; }
.sd-actions .sd-btn { flex: 1; }
.sd-frame { position: absolute; left: 22%; right: 22%; top: 30%; height: 32%; pointer-events: none; }
.sd-frame i { position: absolute; width: 18px; height: 18px; border: 3px solid var(--sd-cream); filter: drop-shadow(0 1px 0 rgba(26, 23, 45, .5)); }
.sd-frame i:nth-child(1) { left: 0; top: 0; border-right: 0; border-bottom: 0; border-radius: 6px 0 0 0; }
.sd-frame i:nth-child(2) { right: 0; top: 0; border-left: 0; border-bottom: 0; border-radius: 0 6px 0 0; }
.sd-frame i:nth-child(3) { left: 0; bottom: 0; border-right: 0; border-top: 0; border-radius: 0 0 0 6px; }
.sd-frame i:nth-child(4) { right: 0; bottom: 0; border-left: 0; border-top: 0; border-radius: 0 0 6px 0; }
.sd-shutter { margin: auto auto 4px; display: grid; place-items: center; width: 60px; height: 60px; border-radius: 50%; border: 4px solid var(--sd-leaf); background: var(--sd-cream); padding: 0; box-shadow: 0 0 0 3px var(--sd-cream), 0 4px 10px rgba(1, 60, 51, .5); }
.sd-shutter span { width: 40px; height: 40px; border-radius: 50%; background: var(--sd-cream); border: 2px solid #ebd0a3; }
.sd-shutter:active { transform: scale(.94); }
.sd-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none !important; }
.sd-toast {
  position: absolute; z-index: 4; left: 10px; right: 10px; bottom: 172px; margin: 0; padding: 8px 12px; border-radius: 14px; text-align: center;
  background: var(--sd-night); color: var(--sd-cream); font-size: 12px; line-height: 1.3; font-weight: 700; opacity: 0; transform: translateY(6px); pointer-events: none;
}
.sd-toast.sd-show { opacity: 1; transform: none; }

/* atlas */
.sd-l-atlas { padding: 46px 10px 12px; background: #013c33; overflow-y: auto; overscroll-behavior: contain; pointer-events: auto; }
.sd-atlas { display: flex; flex-direction: column; gap: 8px; }
.sd-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.sd-tile { display: flex; flex-direction: column; gap: 2px; padding: 6px 6px 8px; border-radius: 14px; background: var(--sd-cream); border: 2px solid var(--sd-edge); color: var(--sd-ink); text-align: center; min-width: 0; }
.sd-tile canvas { width: 100%; height: auto; border-radius: 9px; }
.sd-tile b { font-size: 13px; font-weight: 800; line-height: 1.15; }
.sd-tile small { font-size: 10px; line-height: 1.2; color: #7e7590; }
.sd-bonded { display: inline-flex; align-items: center; justify-content: center; gap: 3px; font-size: 10px; font-weight: 800; color: var(--sd-leaf); }
.sd-bonded svg { width: 11px; height: 11px; }
.sd-find { justify-content: center; align-items: center; gap: 6px; min-height: 96px; }
.sd-findcam { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: #fee68a; color: #c5582f; }
.sd-findcam svg { width: 22px; height: 22px; }
.sd-count { margin: -4px 0 0; font-size: 12px; font-weight: 700; color: #b4dd6b; }
.sd-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.sd-mini { display: flex; flex-direction: column; gap: 3px; padding: 4px 4px 6px; border-radius: 10px; background: var(--sd-paper); border: 2px solid var(--sd-edge); text-align: center; min-width: 0; }
.sd-mini canvas { width: 100%; height: auto; border-radius: 6px; }
.sd-mini small { font-size: 9px; line-height: 1.15; font-weight: 700; color: #7e7590; }
.sd-met small { color: var(--sd-ink); }

/* reveal, naming, the letter */
.sd-over { position: absolute; z-index: 5; inset: 0; display: flex; flex-direction: column; gap: 8px; padding: 10px; overflow-y: auto; overscroll-behavior: contain; background: #013c33; color: var(--sd-cream); }
.sd-over .sd-h { color: var(--sd-cream); }
.sd-burst { position: relative; flex: none; display: grid; place-items: center; aspect-ratio: 5 / 4; border-radius: 16px; overflow: hidden; border: 2px solid var(--sd-cream); background: repeating-conic-gradient(from 0deg at 50% 62%, #daf485 0 9deg, #f4fbcf 9deg 18deg); }
.sd-burst.sd-small { aspect-ratio: 5 / 3; }
.sd-hero { width: 52%; height: auto; }
.sd-small .sd-hero { width: 34%; }
.sd-ribbon { position: absolute; left: 8px; top: 10px; padding: 3px 10px; border-radius: 10px; background: #c13a60; color: var(--sd-cream); font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; transform: rotate(-6deg); }
.sd-latin { margin: -6px 0 0; text-align: center; font-size: 12px; font-style: italic; font-weight: 500; color: #b4dd6b; }
.sd-tags { margin: 0; display: flex; justify-content: center; gap: 5px; }
.sd-tags span { padding: 2px 9px; border-radius: 9px; background: var(--sd-cream); color: var(--sd-ink); font-size: 10px; font-weight: 800; }
.sd-know { padding: 9px 11px; border-radius: 12px; background: #fff7c5; border: 2px solid #fee68a; color: var(--sd-ink); }
.sd-know small { display: block; margin-bottom: 3px; font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #c5582f; }
.sd-know p { margin: 0; font-size: 13px; line-height: 1.35; font-weight: 500; }
.sd-reveal .sd-row { margin-top: auto; }
.sd-reveal .sd-link { color: var(--sd-cream); }
.sd-reveal > .sd-go { margin-top: auto; }
.sd-names { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.sd-name { min-height: 40px; padding: 6px 14px; border-radius: 20px; border: 2px solid var(--sd-edge); background: var(--sd-cream); color: var(--sd-ink); font-size: 13px; font-weight: 800; }
.sd-name[aria-pressed="true"] { background: #fee68a; border-color: #faa124; }
.sd-mail { justify-content: center; background: rgba(1, 60, 51, .9); }
.sd-letter {
  display: flex; flex-direction: column; gap: 8px; padding: 14px 14px 12px; color: var(--sd-ink); transform: rotate(-2deg); margin: 4px 4px 10px;
  border: 7px solid transparent; border-radius: 4px;
  background: linear-gradient(#fefbf2, #fefbf2) padding-box, repeating-linear-gradient(-45deg, #e75d76 0 7px, #fefbf2 7px 14px, #4191c6 14px 21px, #fefbf2 21px 28px) border-box;
}
.sd-letter small { font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #c5582f; }
.sd-hand { margin: 0; font-family: "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive; font-style: italic; font-weight: 400; font-size: 15px; line-height: 1.5; }
.sd-sign { text-align: right; }

/* tab bar */
.sd-tabs { flex: none; display: flex; align-items: center; gap: 2px; margin: 6px 8px 8px; padding: 4px; border-radius: 20px; background: var(--sd-paper); border: 2px solid var(--sd-edge); }
.sd-tab { flex: 1; display: grid; place-items: center; min-width: 0; height: 42px; border: 0; border-radius: 14px; background: none; color: #7e7590; padding: 0; }
.sd-tab svg { width: 22px; height: 22px; }
.sd-tab.sd-on { background: #f3e5c7; color: var(--sd-leaf); }
.sd-camtab { background: var(--sd-orange); color: var(--sd-cream); box-shadow: 0 3px 0 #c5582f; }

@media (prefers-reduced-motion: no-preference) {
  .sd-toast { transition: opacity .2s ease, transform .2s ease; }
  .sd-btn, .sd-shutter { transition: transform .08s ease; }
  .sd-flash.sd-fire { animation: sd-fire .32s ease-out; }
  .sd-over:not([hidden]) > * { animation: sd-rise .3s ease-out both; }
  .sd-mail .sd-letter { animation: sd-drop .45s cubic-bezier(.3, 1.4, .5, 1) both; }
}
@keyframes sd-fire { from { opacity: .9; } to { opacity: 0; } }
@keyframes sd-rise { from { opacity: 0; translate: 0 8px; } }
@keyframes sd-drop { from { opacity: 0; transform: rotate(4deg) translateY(-24px); } }
