/* memories: styles for these activities (memories, memory books, little notes).
   Class names start with mem-, bk- and nt-. */

/* ============ memories: the album ============ */
.mem-playbtn {
  display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 16px 0 12px; border-radius: 14px; flex: none;
  background: rgba(255, 255, 255, .85); box-shadow: 0 3px 0 rgba(74, 55, 67, .08); font-weight: 600; font-size: 15px;
  transition: transform .15s var(--spring);
}
.mem-playbtn:active { transform: scale(.92); }
.mem-playbtn .ic { color: var(--sky-d); }

.mem-month { margin-bottom: 18px; }
.mem-month-head { display: flex; align-items: baseline; justify-content: space-between; margin: 2px 4px 10px; }
.mem-month-head h3 { margin: 0; font-size: 18px; font-weight: 600; }
.mem-month-head small { font-size: 13px; color: var(--ink2); }

.mem-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.mem-grid.mem-grid4 { grid-template-columns: repeat(4, 1fr); }
.mem-tile {
  position: relative; display: block; width: 100%; aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: var(--sand);
  box-shadow: 0 2px 0 var(--line); transition: transform .18s var(--spring), box-shadow .2s;
  animation: memPop .5s var(--spring) backwards; animation-delay: var(--d, 0ms);
}
.mem-tile:active { transform: scale(.93); }
.mem-tile > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .35s ease; }
.mem-tile > img.mem-in { opacity: 1; }
.mem-tile::after { content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(74, 55, 67, .06); pointer-events: none; }
.mem-vid {
  position: absolute; left: 6px; bottom: 6px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(40, 28, 38, .55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); z-index: 1;
}
.mem-vid .ic { margin-left: 2px; }
.mem-heart { position: absolute; right: 4px; top: 4px; z-index: 1; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .25)); }
.mem-heart .spr { width: 20px; height: 20px; }
.mem-tile.mem-on { box-shadow: 0 0 0 3px var(--cream), 0 0 0 6px var(--pink); transform: scale(.9); }
.mem-check {
  position: absolute; right: 5px; bottom: 5px; z-index: 1; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: var(--pink); color: #fff; box-shadow: 0 0 0 2px #fff; animation: pop .35s var(--spring);
}
.mem-tile.mem-fresh { animation: memPop .5s var(--spring) backwards, memGlow 2.6s ease .4s; }
@keyframes memPop { from { transform: scale(.6); opacity: 0; } }
@keyframes memGlow { 0%, 55% { box-shadow: 0 0 0 3px var(--cream), 0 0 0 6px var(--pink); } 100% { box-shadow: 0 2px 0 var(--line); } }

.mem-otd {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; padding: 12px 16px 12px 12px; margin: 0 0 18px;
  border-radius: 24px; background: linear-gradient(135deg, #FFF3CC 0%, #FFE1EA 100%); box-shadow: 0 4px 0 #F3D9C2, var(--shadow-s);
  transition: transform .12s; animation: popBig .55s var(--spring) backwards;
}
.mem-otd:active { transform: scale(.98); }
.mem-otd b { display: block; font-size: 19px; font-weight: 600; }
.mem-otd small { display: block; font-size: 14px; color: var(--ink2); margin-top: 2px; }
.mem-otd-pics { position: relative; width: 108px; height: 80px; flex: none; }
.mem-pol {
  position: absolute; top: 4px; left: var(--x); width: 60px; height: 70px; padding: 4px 4px 13px; border-radius: 6px; background: #fff;
  box-shadow: 0 3px 8px rgba(74, 55, 67, .18); transform: rotate(var(--r));
}
.mem-pol img { width: 100%; height: 100%; object-fit: cover; border-radius: 3px; display: block; }

.mem-adding {
  display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 16px 10px 12px; border-radius: 18px; text-align: left;
  background: #fff; box-shadow: 0 4px 0 var(--line), var(--shadow-s);
}
.mem-adding .spr { animation: bob 1.1s ease-in-out infinite; }
.mem-adding b { display: block; font-weight: 600; font-size: 16px; margin-bottom: 6px; color: var(--ink); }

/* ============ one memory, big ============ */
.mem-view { position: absolute; inset: 0; display: flex; flex-direction: column; background: #1C151E; color: #fff; overflow: hidden; }
.mem-vtop { flex: none; display: flex; align-items: center; gap: 10px; padding: calc(var(--top) + 10px) 12px 6px; }
.mem-vbtn {
  width: 44px; height: 44px; border-radius: 14px; flex: none; display: grid; place-items: center; color: #fff;
  background: rgba(255, 255, 255, .14); transition: transform .12s;
}
.mem-vbtn:active { transform: scale(.9); }
.mem-vbtn.mem-ghost { visibility: hidden; }
.mem-vcount { flex: 1; text-align: center; font-weight: 600; font-size: 15px; color: rgba(255, 255, 255, .8); }
.mem-stage { flex: 1; min-height: 0; position: relative; overflow: hidden; touch-action: pan-y; }
.mem-slide { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 6px 12px 16px; transition: transform .35s var(--spring); }
.mem-slide.mem-in-r { animation: memInR .42s var(--spring) backwards; }
.mem-slide.mem-in-l { animation: memInL .42s var(--spring) backwards; }
@keyframes memInR { from { transform: translateX(46%) scale(.94); opacity: 0; } }
@keyframes memInL { from { transform: translateX(-46%) scale(.94); opacity: 0; } }
.mem-big { display: block; flex: none; max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 12px; box-shadow: 0 12px 40px rgba(0, 0, 0, .4); pointer-events: none; }
.mem-big.mem-video { width: 100%; height: 100%; flex: 1 1 auto; border-radius: 0; box-shadow: none; pointer-events: auto; background: transparent; }
.mem-wait { width: 56px; height: 56px; border-radius: 50%; border: 4px solid rgba(255, 255, 255, .18); border-top-color: #fff; animation: spin .8s linear infinite; }
.mem-arrow {
  position: absolute; top: 50%; z-index: 2; width: 40px; height: 40px; margin-top: -20px; border-radius: 50%; display: grid; place-items: center;
  color: #fff; background: rgba(28, 21, 30, .45); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); transition: transform .12s;
}
.mem-arrow:active { transform: scale(.86); }
.mem-arrow-l { left: 8px; }
.mem-arrow-r { right: 8px; }

.mem-panel {
  flex: none; display: flex; flex-direction: column; gap: 12px; color: var(--ink); background: var(--cream);
  border-radius: 28px 28px 0 0; padding: 14px 16px calc(var(--bottom) + 16px); animation: up .45s var(--spring) backwards;
}
.mem-cap { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; text-align: left; font-size: 20px; font-weight: 600; line-height: 1.25; }
.mem-cap > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.mem-cap .ic { color: var(--ink3); flex: none; }
.mem-cap.mem-cap-empty { color: var(--ink3); font-weight: 500; }
.mem-capedit { display: flex; align-items: center; gap: 8px; }
.mem-capedit .field { padding: 10px 14px; font-size: 17px; }
.mem-ok { width: 46px; height: 46px; border-radius: 14px; flex: none; display: grid; place-items: center; color: #fff; background: var(--pink); box-shadow: 0 4px 0 var(--pink-d); }
.mem-ok:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--pink-d); }
.mem-meta { display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--ink2); }
.mem-meta .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mem-date {
  position: relative; display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px 0 8px; border-radius: 999px; flex: none;
  background: #fff; box-shadow: 0 3px 0 var(--line); color: var(--ink); font-weight: 600; font-size: 14px; white-space: nowrap; cursor: pointer;
}
.mem-date input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; opacity: 0; cursor: pointer; }
.mem-loves { display: flex; align-items: center; gap: 8px; }
.mem-love {
  display: inline-flex; align-items: center; gap: 5px; height: 42px; padding: 0 12px 0 5px; border-radius: 999px;
  background: #fff; box-shadow: 0 3px 0 var(--line); transition: transform .2s var(--spring), background .2s;
}
.mem-love:active { transform: scale(.9); }
.mem-love.mem-on { background: var(--pink-l); box-shadow: 0 3px 0 #F7C3D2; }
.mem-love.mem-on .ic { animation: memHeart .5s var(--spring); }
.mem-love.mem-theirs { background: rgba(255, 255, 255, .55); box-shadow: none; }
.mem-love.mem-theirs.mem-on { background: var(--pink-l); }
.mem-both { font-size: 14px; font-weight: 600; color: var(--pink-d); margin-left: 2px; animation: pop .4s var(--spring); }
@keyframes memHeart { 0% { transform: scale(.4); } 60% { transform: scale(1.35); } 100% { transform: scale(1); } }
.mem-acts { display: flex; justify-content: center; }
.mem-act { width: 25%; display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 0 2px; font-size: 12.5px; font-weight: 500; line-height: 1.15; text-align: center; color: var(--ink); }
.mem-act i { width: 54px; height: 54px; border-radius: 18px; display: grid; place-items: center; background: #fff; box-shadow: 0 3px 0 var(--line); transition: transform .15s var(--spring); }
.mem-act:active i { transform: scale(.86); }
.mem-act .spr { width: 32px; height: 32px; }
.mem-act.mem-del { color: var(--ink2); }
.mem-act.mem-del i { color: var(--red); }

/* ============ play memories ============ */
.mem-show { position: absolute; inset: 0; overflow: hidden; background: #000; color: #fff; cursor: pointer; }
.mem-sl { position: absolute; inset: 0; overflow: hidden; animation: memFade 1.1s ease backwards; }
.mem-sl-bg { position: absolute; inset: -40px; background-size: cover; background-position: center; filter: blur(30px) brightness(.5) saturate(1.3); }
.mem-sl img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.mem-sl img.mem-kb0 { animation: memKb0 5.6s ease-out both; }
.mem-sl img.mem-kb1 { animation: memKb1 5.6s ease-out both; }
.mem-sl img.mem-kb2 { animation: memKb2 5.6s ease-out both; }
.mem-sl img.mem-kb3 { animation: memKb3 5.6s ease-out both; }
.mem-show.mem-paused .mem-sl img, .mem-show.mem-paused .mem-prog i { animation-play-state: paused; }
@keyframes memFade { from { opacity: 0; } }
@keyframes memKb0 { from { transform: scale(1); } to { transform: scale(1.13) translate(-1.5%, -1%); } }
@keyframes memKb1 { from { transform: scale(1.13) translate(1.5%, 1%); } to { transform: scale(1.01); } }
@keyframes memKb2 { from { transform: scale(1.03) translate(-2%, 0); } to { transform: scale(1.14) translate(2%, -1%); } }
@keyframes memKb3 { from { transform: scale(1.11) translate(0, 2%); } to { transform: scale(1.02) translate(0, -1%); } }
.mem-showtop {
  position: absolute; left: 0; right: 0; top: 0; z-index: 3; display: flex; align-items: center; gap: 12px;
  padding: calc(var(--top) + 10px) 12px 34px; background: linear-gradient(rgba(0, 0, 0, .42), transparent);
}
.mem-prog { flex: 1; height: 4px; border-radius: 2px; overflow: hidden; background: rgba(255, 255, 255, .3); }
.mem-prog i { display: block; height: 100%; border-radius: 2px; background: #fff; transform-origin: left; animation: memProg 4s linear forwards; }
@keyframes memProg { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.mem-showcount { min-width: 50px; text-align: right; font-size: 14px; font-weight: 600; opacity: .85; }
.mem-showcap {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; padding: 80px 22px calc(var(--bottom) + 34px);
  background: linear-gradient(transparent, rgba(0, 0, 0, .62)); animation: memCap .9s var(--ease) .35s backwards; pointer-events: none;
}
.mem-showcap b { display: block; font-size: 25px; font-weight: 600; line-height: 1.2; text-shadow: 0 2px 10px rgba(0, 0, 0, .3); }
.mem-showcap small { display: block; margin-top: 4px; font-size: 15px; opacity: .85; }
@keyframes memCap { from { opacity: 0; transform: translateY(16px); } }
.mem-pause {
  position: absolute; left: 50%; top: 50%; z-index: 4; width: 90px; height: 90px; margin: -45px 0 0 -45px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255, 255, 255, .22); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); animation: pop .35s var(--spring); pointer-events: none;
}
.mem-pause .ic { margin-left: 5px; }

/* ============ photo frames ============ */
.mem-wall {
  position: relative; display: grid; place-items: center; margin: 14px 0 4px; padding: 30px 16px 24px; border-radius: 24px;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .4) 0 18px, transparent 18px 36px), var(--wall, #FFF1E6);
  box-shadow: inset 0 -12px 0 rgba(74, 55, 67, .05), inset 0 0 0 1px rgba(74, 55, 67, .04);
}
.mem-wall::before { content: ''; position: absolute; top: 12px; left: 50%; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: #B9A2AD; box-shadow: 0 2px 0 rgba(0, 0, 0, .12); }
.mem-frame {
  display: inline-grid; place-items: center; flex: none; padding: 9px; border-radius: 10px; background: var(--fc);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .1), inset 0 2px 0 rgba(255, 255, 255, .3), 0 4px 10px rgba(74, 55, 67, .16);
}
.mem-frame .mem-mat { display: grid; place-items: center; width: 100%; aspect-ratio: 78 / 98; padding: 5px; border-radius: 3px; background: #fff; overflow: hidden; }
.mem-frame.mem-fr-wide .mem-mat { aspect-ratio: 130 / 90; }
.mem-frame .mem-mat img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 2px; }
.mem-frame .mem-none { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 2px; background: #FCEBEF; color: #F5B5C5; }
.mem-frame.mem-fr-big { width: 54%; padding: 12px; border-radius: 14px; }
.mem-frame.mem-fr-big.mem-fr-wide { width: 84%; }
.mem-frame.mem-fr-big .mem-mat { padding: 7px; }
.mem-frame.mem-fr-small { width: 42px; padding: 4px; border-radius: 6px; }
.mem-frame.mem-fr-small.mem-fr-wide { width: 56px; }
.mem-frame.mem-fr-small .mem-mat { padding: 2px; }
.mem-frame.mem-fr-bump { animation: memSwing .9s var(--spring); transform-origin: 50% -18px; }
@keyframes memSwing { 0% { transform: rotate(-7deg) scale(.95); } 35% { transform: rotate(4deg); } 65% { transform: rotate(-2deg); } 100% { transform: none; } }
.mem-frow {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 14px 10px 10px; border-radius: 20px; text-align: left;
  background: #fff; box-shadow: 0 3px 0 var(--line); transition: transform .1s;
}
.mem-frow:active { transform: scale(.98); }
.mem-frow .mem-fa { width: 60px; height: 60px; flex: none; display: grid; place-items: center; border-radius: 14px; background: var(--cream); }
.mem-frow b { display: block; font-weight: 600; font-size: 16px; }
.mem-frow small { display: block; font-size: 13px; color: var(--ink2); }
.mem-frow.mem-on { box-shadow: inset 0 0 0 2.5px var(--mint), 0 3px 0 var(--line); }

/* ============ memory books: the shelf ============ */
.bk-case {
  position: relative; margin: 2px 0 12px; padding: 12px 12px 2px; border-radius: 24px;
  background: linear-gradient(180deg, #E0A874, #C98A5B); box-shadow: inset 0 3px 0 rgba(255, 255, 255, .25), 0 6px 0 #A06A42, var(--shadow-s);
}
.bk-row {
  display: flex; align-items: flex-end; gap: 4px; min-height: 186px; padding: 16px 10px 0; border-radius: 12px 12px 0 0;
  background: linear-gradient(180deg, #6A432F 0%, #855840 45%, #92634A 100%); box-shadow: inset 0 10px 16px rgba(0, 0, 0, .2);
}
.bk-plank {
  position: relative; z-index: 1; height: 14px; margin: 0 -5px 12px; border-radius: 5px;
  background: linear-gradient(180deg, #F2C08A, #D49A62); box-shadow: 0 5px 0 #A86E45, 0 9px 10px rgba(0, 0, 0, .12);
}
.bk-shelf:last-child .bk-plank { margin-bottom: 10px; }
.bk-spine {
  position: relative; flex: 0 0 var(--w, 14%); height: var(--h, 150px); display: flex; align-items: center; justify-content: center;
  padding: 24px 0 20px; border-radius: 7px 7px 3px 3px; background: var(--bc);
  box-shadow: inset -6px 0 0 rgba(0, 0, 0, .09), inset 4px 0 0 rgba(255, 255, 255, .3);
  transform-origin: 50% 100%; transition: transform .3s var(--spring);
  animation: bkIn .6s var(--spring) backwards; animation-delay: var(--d, 0ms);
}
.bk-spine::before, .bk-spine::after { content: ''; position: absolute; left: 0; right: 0; height: 5px; background: var(--bd); opacity: .5; }
.bk-spine::before { top: 11px; }
.bk-spine::after { bottom: 10px; }
.bk-spine.bk-done::before, .bk-spine.bk-done::after { background: #F2C14E; opacity: 1; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5); }
.bk-spine:active { transform: translateY(-14px) rotate(-3deg); }
.bk-title {
  writing-mode: vertical-rl; max-height: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 14px; font-weight: 600; line-height: 1; letter-spacing: .2px; color: var(--ink);
}
.bk-ribbon {
  position: absolute; z-index: 2; top: -12px; right: 16%; width: 9px; height: 30px; background: linear-gradient(180deg, #FFE38F, #E6A93A);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%);
}
.bk-ribbon.bk-ribbon-mini { position: static; display: inline-block; width: 8px; height: 17px; flex: none; }
.bk-dot {
  position: absolute; z-index: 3; top: -6px; left: 50%; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%;
  background: var(--heart); box-shadow: 0 0 0 3px #fff; animation: beckon 1.8s ease-in-out infinite;
}
.bk-decor { width: 62px; height: 62px; margin-left: auto; align-self: flex-end; margin-bottom: -1px; animation: pop .6s var(--spring) .3s backwards; }
@keyframes bkIn { from { transform: translateY(-70px); opacity: 0; } }
.bk-legend { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 2px 0 4px; font-size: 13px; color: var(--ink2); }
.bk-turncard {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 14px 12px 12px; border-radius: 20px; text-align: left;
  background: #fff; box-shadow: 0 3px 0 var(--line); transition: transform .1s;
}
.bk-turncard:active { transform: scale(.98); }
.bk-turncard b { display: block; font-weight: 600; font-size: 16px; }
.bk-turncard small { display: block; font-size: 13px; line-height: 1.3; color: var(--ink2); }
.bk-mini { position: relative; flex: none; width: 30px; height: 40px; border-radius: 4px 7px 7px 4px; background: var(--bc); box-shadow: inset 5px 0 0 var(--bd); }

/* starting a book */
.bk-prompts { display: flex; flex-direction: column; gap: 8px; }
.bk-prompt {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px 12px 12px; border-radius: 20px; text-align: left;
  background: #fff; box-shadow: 0 3px 0 var(--line); transition: transform .1s; animation: bkRise .45s var(--spring) backwards; animation-delay: var(--d, 0ms);
}
.bk-prompt:active { transform: scale(.98); }
.bk-prompt b { display: block; font-weight: 600; font-size: 16px; }
.bk-prompt small { display: block; margin-top: 1px; font-size: 13px; line-height: 1.3; color: var(--ink2); }
.bk-prompt.bk-own { background: var(--butter-l); box-shadow: 0 3px 0 #F0DCA0; }
@keyframes bkRise { from { transform: translateY(18px); opacity: 0; } }
.bk-back { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 6px; font-weight: 600; color: var(--ink2); }

/* the cover */
.bk-cover-wrap { display: grid; place-items: center; padding: 8px 0 4px; }
.bk-cover {
  position: relative; width: 196px; display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 16px 16px 14px 28px; border-radius: 8px 18px 18px 8px; background: var(--bc);
  box-shadow: inset 12px 0 0 var(--bd), inset 15px 0 0 rgba(255, 255, 255, .28), 6px 4px 0 #FFF9F0, 6px 4px 0 1.5px #E7D6C4, 0 14px 30px rgba(74, 55, 67, .18);
  transform-origin: left center; animation: bkCover .65s var(--spring) backwards;
}
.bk-cover.bk-cover-small { width: 156px; gap: 8px; padding: 12px 12px 12px 22px; }
.bk-photo {
  position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 1; overflow: hidden; border-radius: 12px;
  background: var(--bl); box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .75);
}
button.bk-photo { transition: transform .15s var(--spring); }
button.bk-photo:active { transform: scale(.96); }
.bk-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.bk-photo .spr { width: 86px; height: 86px; margin-bottom: 14px; }
.bk-cover.bk-cover-small .bk-photo .spr { width: 64px; height: 64px; margin: 0; }
.bk-photo small { position: absolute; left: 0; right: 0; bottom: 10px; font-size: 13px; font-weight: 600; color: var(--ink); opacity: .7; }
.bk-photo-edit {
  position: absolute; right: 8px; bottom: 8px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255, 253, 249, .92); color: var(--ink); box-shadow: 0 2px 6px rgba(0, 0, 0, .15);
}
.bk-ctitle { font-size: 18px; font-weight: 600; line-height: 1.2; text-align: center; color: var(--ink); overflow-wrap: anywhere; }
.bk-author { font-size: 14px; font-weight: 600; text-align: center; color: rgba(60, 40, 52, .7); }
.bk-ribbon.bk-ribbon-big { top: -10px; right: 24px; width: 14px; height: 46px; }
@keyframes bkCover { from { transform: perspective(900px) rotateY(-30deg) scale(.9); opacity: 0; } }
.bk-q { margin: 16px 14px 0; text-align: center; font-size: 16px; line-height: 1.4; color: var(--ink2); }

/* the two sides */
.bk-sides { position: relative; display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.bk-page {
  padding: 14px 16px 10px; border-radius: 20px; border-top: 6px solid var(--bc); background: #FFFEFB;
  box-shadow: 0 3px 0 var(--line), var(--shadow-s); animation: bkRise .45s var(--spring) backwards;
}
.bk-page-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.bk-page-head b { font-weight: 600; font-size: 17px; }
.bk-text {
  padding-bottom: 4px; font-size: 17px; line-height: 28px; white-space: pre-wrap; overflow-wrap: anywhere; user-select: text; -webkit-user-select: text;
  background-image: repeating-linear-gradient(180deg, transparent 0 27px, rgba(184, 162, 173, .28) 27px 28px);
}
.bk-when { display: block; margin-top: 6px; text-align: right; font-size: 13px; color: var(--ink2); }
.bk-edit { display: inline-flex; align-items: center; gap: 4px; height: 36px; padding: 0 12px; border-radius: 12px; font-weight: 600; font-size: 14px; color: var(--ink2); background: var(--sand); }
.bk-edit:active { transform: scale(.94); }
.bk-writer {
  display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 22px; border-top: 6px solid var(--bc); background: #fff;
  box-shadow: 0 3px 0 var(--line), var(--shadow-s); animation: bkRise .4s var(--spring) backwards;
}
.bk-writer .bk-page-head { margin-bottom: 0; }
.bk-paper {
  width: 100%; min-height: 252px; padding: 2px 4px; border: 0; outline: 0; resize: none; border-radius: 6px;
  font-size: 17px; line-height: 28px; color: var(--ink); background-color: #FFFEFB; background-attachment: local;
  background-image: repeating-linear-gradient(180deg, transparent 0 27px, rgba(184, 162, 173, .32) 27px 28px);
}
.bk-paper::placeholder { color: var(--ink3); }
.bk-locked, .bk-hidden { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 20px; color: var(--ink2); background: var(--sand); }
.bk-hidden { background: #fff; box-shadow: 0 3px 0 var(--line); }
.bk-locked b, .bk-hidden b { display: block; font-weight: 600; color: var(--ink); }
.bk-locked small, .bk-hidden small { display: block; font-size: 14px; line-height: 1.3; }
.bk-startside { justify-content: flex-start; gap: 12px; padding-left: 12px; }
.bk-del { margin-top: 6px; color: var(--red); }

/* both sides done: the page turns */
.bk-turn {
  position: absolute; inset: -4px; z-index: 5; display: grid; place-items: center; text-align: center; border-radius: 22px;
  background: repeating-linear-gradient(180deg, transparent 0 27px, rgba(184, 162, 173, .2) 27px 28px), #FFFDF8;
  box-shadow: 0 8px 26px rgba(74, 55, 67, .2); transform-origin: left center; backface-visibility: hidden;
  animation: bkTurn 1.3s cubic-bezier(.5, 0, .3, 1) 1s forwards;
}
.bk-turn-in { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 20px; animation: popBig .5s var(--spring) backwards; }
.bk-turn-in b { font-size: 22px; font-weight: 600; }
.bk-turn-in small { font-size: 15px; color: var(--ink2); }
.bk-turn-in .spr { animation: bob 1.4s ease-in-out infinite; }
@keyframes bkTurn { 0% { transform: perspective(1600px) rotateY(0); opacity: 1; } 75% { opacity: 1; } 100% { transform: perspective(1600px) rotateY(-120deg); opacity: 0; } }

/* ============ little notes ============ */
.nt-widget {
  position: relative; display: block; width: 100%; aspect-ratio: 1 / .92; overflow: hidden; border-radius: 30px; text-align: left;
  background: #fff; box-shadow: 0 6px 0 rgba(74, 55, 67, .08), var(--shadow); transition: transform .15s; animation: ntDrop .6s var(--spring) backwards;
}
.nt-widget:active { transform: scale(.98); }
.nt-widget > .nt-paper, .nt-widget > .nt-pic { position: absolute; inset: 0; }
.nt-from {
  position: absolute; left: 12px; bottom: 12px; display: inline-flex; align-items: center; gap: 6px; padding: 4px 14px 4px 4px; border-radius: 999px;
  background: rgba(255, 253, 249, .94); box-shadow: 0 2px 10px rgba(74, 55, 67, .14);
}
.nt-from b { font-weight: 600; font-size: 15px; }
.nt-from small { font-size: 13px; color: var(--ink2); }
.nt-new {
  position: absolute; top: 14px; right: 14px; padding: 4px 12px; border-radius: 999px; font-weight: 600; font-size: 14px; color: #fff;
  background: var(--heart); box-shadow: 0 3px 0 var(--pink-d); animation: pop .5s var(--spring) .35s backwards;
}
@keyframes ntDrop { from { transform: translateY(-30px) scale(.9) rotate(-3deg); opacity: 0; } }
.nt-nonote { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 22px; background: #fff; box-shadow: 0 3px 0 var(--line); }
.nt-nonote b { display: block; font-weight: 600; }
.nt-nonote small { display: block; font-size: 14px; color: var(--ink2); }

/* a note's face */
.nt-paper {
  display: grid; place-items: center; width: 100%; height: 100%; padding: 12%;
  background: radial-gradient(circle at 18% 12%, rgba(255, 255, 255, .6), transparent 42%), var(--nc);
}
.nt-paper p {
  margin: 0; text-align: center; font-weight: 600; line-height: 1.25; color: var(--ink); overflow-wrap: anywhere;
  display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden;
}
.nt-paper.nt-xl.nt-short p { font-size: 34px; }
.nt-paper.nt-xl.nt-mid p { font-size: 27px; }
.nt-paper.nt-xl.nt-long p { font-size: 21px; }
.nt-paper.nt-m { padding: 10%; }
.nt-paper.nt-m.nt-short p { font-size: 19px; }
.nt-paper.nt-m.nt-mid p { font-size: 15px; -webkit-line-clamp: 5; }
.nt-paper.nt-m.nt-long p { font-size: 13px; -webkit-line-clamp: 6; }
.nt-paper.nt-s.nt-short p { font-size: 18px; }
.nt-paper.nt-s.nt-mid p { font-size: 14px; -webkit-line-clamp: 5; }
.nt-paper.nt-s.nt-long p { font-size: 12px; -webkit-line-clamp: 6; }
.nt-paper.nt-xs.nt-short p { font-size: 18px; }
.nt-paper.nt-xs.nt-mid p { font-size: 14px; -webkit-line-clamp: 5; }
.nt-paper.nt-xs.nt-long p { font-size: 12px; -webkit-line-clamp: 6; }
.nt-pic { width: 100%; height: 100%; background: var(--sand); }
.nt-pic img { display: block; width: 100%; height: 100%; object-fit: cover; animation: fade .3s ease; }

/* the scrapbook */
.nt-scrap { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 14px; padding: 10px 4px 4px; }
.nt-item {
  position: relative; display: flex; flex-direction: column; gap: 8px; padding: 8px 8px 10px; border-radius: 8px; text-align: left; background: #fff;
  box-shadow: 0 3px 0 var(--line), 0 6px 16px rgba(74, 55, 67, .08); transform: rotate(var(--r)); transition: transform .25s var(--spring);
  animation: ntIn .55s var(--spring) backwards; animation-delay: var(--d, 0ms);
}
.nt-item:active { transform: rotate(0) scale(.95); }
.nt-tape { position: absolute; z-index: 1; top: -9px; left: 50%; width: 58px; height: 20px; margin-left: -29px; border-radius: 3px; background: var(--tape); transform: rotate(-5deg); }
.nt-face { position: relative; aspect-ratio: 1; overflow: hidden; border-radius: 5px; }
.nt-face > * { position: absolute; inset: 0; }
.nt-by { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 13px; font-weight: 600; }
.nt-by .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nt-by small { font-weight: 450; color: var(--ink2); white-space: nowrap; }
.nt-dot { position: absolute; top: -5px; right: -5px; width: 14px; height: 14px; border-radius: 50%; background: var(--heart); box-shadow: 0 0 0 3px var(--cream); }
@keyframes ntIn { from { transform: translateY(26px) rotate(0) scale(.9); opacity: 0; } }

/* one note, big */
.nt-big { position: relative; width: 100%; aspect-ratio: 1; overflow: hidden; border-radius: 24px; box-shadow: 0 4px 0 var(--line), var(--shadow-s); animation: popBig .45s var(--spring) backwards; }
.nt-big > * { position: absolute; inset: 0; }
.nt-del { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 14px; color: var(--red); background: #fff; box-shadow: 0 3px 0 var(--line); }
.nt-del:active { transform: scale(.9); }

/* sending */
.nt-fromrow { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-weight: 600; color: var(--ink2); }
.nt-fromrow .chip { padding: 4px 14px 4px 4px; }
.nt-mode { margin: 14px 0 16px; animation: fade .25s ease; }
.nt-canvas {
  display: block; width: min(100%, 44vh); height: auto; aspect-ratio: 1; margin: 0 auto; border-radius: 24px; touch-action: none; cursor: crosshair;
  box-shadow: 0 4px 0 var(--line), inset 0 0 0 1px rgba(74, 55, 67, .06);
}
.nt-pens { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 14px; }
.nt-pen { width: 36px; height: 36px; border-radius: 50%; background: var(--pc); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .12); transition: transform .2s var(--spring), box-shadow .2s; }
.nt-pen.nt-on { transform: scale(1.14); box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--pc); }
.nt-pen:active { transform: scale(.9); }
.nt-tools { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 10px; }
.nt-tool {
  width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 14px; color: var(--ink);
  background: #fff; box-shadow: 0 3px 0 var(--line); transition: transform .15s var(--spring), background .2s;
}
.nt-tool:active { transform: scale(.88); }
.nt-tool.nt-on { color: #fff; background: var(--ink); box-shadow: 0 3px 0 #2E2229; }
.nt-tool:disabled { opacity: .4; pointer-events: none; }
.nt-tool.nt-on .nt-size { box-shadow: 0 0 0 2px #fff; }
.nt-size { display: block; border-radius: 50%; }
.nt-tool.nt-paperbtn i { display: block; width: 22px; height: 26px; border-radius: 4px 10px 4px 4px; box-shadow: inset 0 0 0 2px rgba(74, 55, 67, .28); }
.nt-sep { width: 2px; height: 24px; margin: 0 2px; border-radius: 1px; background: var(--line); }
.nt-card {
  position: relative; padding: 22px 18px; border-radius: 24px; transform: rotate(-1deg); transition: background .3s;
  background: radial-gradient(circle at 15% 10%, rgba(255, 255, 255, .6), transparent 40%), var(--nc); box-shadow: 0 4px 0 rgba(74, 55, 67, .08), var(--shadow-s);
}
.nt-card textarea {
  display: block; width: 100%; min-height: 150px; border: 0; outline: 0; resize: none; background: transparent;
  text-align: center; font-size: 24px; font-weight: 600; line-height: 1.3; color: var(--ink);
}
.nt-card textarea::placeholder { color: rgba(74, 55, 67, .35); }
.nt-card small { position: absolute; right: 16px; bottom: 10px; font-size: 13px; color: var(--ink2); }
.nt-quick { margin: 12px -2px 8px; }
.nt-pv { position: relative; width: min(100%, 40vh); aspect-ratio: 1; margin: 0 auto; overflow: hidden; border-radius: 24px; background: #fff; box-shadow: 0 4px 0 var(--line), var(--shadow-s); }
.nt-pv img { display: block; width: 100%; height: 100%; object-fit: cover; animation: fade .3s ease; }
.nt-pv-none { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font-weight: 600; color: var(--ink2); background: var(--sky-l); }
.nt-bob { animation: bob 1s ease-in-out infinite; }
.nt-pbtns { display: flex; gap: 8px; margin-top: 14px; }
.nt-pbtns .btn { flex: 1; min-width: 0; gap: 6px; padding: 8px 6px; font-size: 14.5px; white-space: nowrap; }
@media (max-width: 370px) { .nt-pbtns .btn { font-size: 13.5px; } }
.nt-label { margin: 16px 4px 4px; font-size: 14px; font-weight: 500; color: var(--ink2); }
.nt-strip { display: flex; gap: 8px; overflow-x: auto; padding: 6px 4px 10px; scrollbar-width: none; }
.nt-strip::-webkit-scrollbar { display: none; }
.nt-strip .mem-tile { flex: 0 0 70px; width: 70px; height: 70px; }

/* the home screen, as it will look */
.nt-hs {
  display: flex; flex-direction: column; gap: 14px; padding: 16px; border-radius: 34px;
  background: radial-gradient(circle at 85% 8%, rgba(255, 255, 255, .55), transparent 35%), linear-gradient(160deg, #FFD3DF 0%, #E6DAFF 55%, #CFE6FF 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .6), var(--shadow-s);
}
.nt-wm { display: flex; gap: 12px; height: 150px; padding: 12px; border-radius: 26px; background: rgba(255, 255, 255, .92); box-shadow: 0 8px 20px rgba(74, 55, 67, .12); }
.nt-wface { position: relative; width: 126px; height: 126px; flex: none; overflow: hidden; border-radius: 16px; }
.nt-wface > * { position: absolute; inset: 0; }
.nt-winfo { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 2px; padding-top: 6px; }
.nt-winfo b { font-weight: 600; font-size: 16px; }
.nt-winfo small { font-size: 13px; color: var(--ink2); }
.nt-app { display: flex; align-items: center; gap: 4px; margin-top: auto; font-size: 12px; font-weight: 600; color: var(--ink2); }
.nt-hsrow { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.nt-ws { position: relative; aspect-ratio: 1; overflow: hidden; border-radius: 26px; background: #fff; box-shadow: 0 8px 20px rgba(74, 55, 67, .12); }
.nt-ws > .nt-paper, .nt-ws > .nt-pic { position: absolute; inset: 0; }
.nt-wshead { position: absolute; left: 8px; bottom: 8px; }
.nt-icons { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-content: center; }
.nt-icon { display: grid; place-items: center; aspect-ratio: 1; border-radius: 22%; background: var(--ic); box-shadow: 0 6px 14px rgba(74, 55, 67, .12); }
.nt-icon .spr { width: 62%; height: 62%; }
.nt-wnone { position: absolute; inset: 0; display: grid; place-items: center; background: var(--pink-l); }
