@font-face { font-family: "Forward Serif"; src: url("../assets/ds/forward-serif.otf") format("opentype"); font-display: swap; }
/* =========================================================
   Paper Trails — Scrapbook Calendar · Design System V1
   ========================================================= */
:root {
  /* paper */
  --crumple: #EFEBE8;
  --canvas: #F7F5F5;
  --cream: #EEEBDD;
  --cream-pressed: #E6E2D2;
  --crease: #D9CFC8;
  /* ink & graphite */
  --ink: #2B2B2B;
  --ink-hover: #4A4545;
  --graphite: #5E5757;
  --pencil: #A9A9A9;
  --faded: #8D8686;
  /* raspberry accent */
  --washi: #993D62;
  --magenta: #B8416B;
  --washi-pressed: #7A2F4E;
  --blush: #E8D5E1;
  /* label pastels */
  --lilac: #E5D3E3;
  --lavender: #CDBFDA;
  --periwinkle: #8E9ACB;
  --cornflower: #7EA1D6;
  --steel: #6E93B5;
  --seaglass: #6E95A3;
  --rose: #C96A92;
  --sand: #D9D4C0;

  --f-body: "Montserrat", system-ui, sans-serif;
  --f-display: "Luckiest Guy", "Archivo Black", sans-serif;
  --f-script: "Forward Serif", Georgia, serif;
  --f-words: "Forward Serif", Georgia, serif;

  --lift-0: 0 1px 1px rgba(43, 37, 35, .10), 0 1px 3px rgba(43, 37, 35, .06);
  --lift-1: 0 4px 8px rgba(43, 37, 35, .14), 0 2px 3px rgba(43, 37, 35, .10);
  --lift-2: 0 14px 28px rgba(43, 37, 35, .20), 0 6px 10px rgba(43, 37, 35, .12);
  --ease-over: cubic-bezier(.34, 1.56, .64, 1);

  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .22 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { overflow-x: hidden; }
body {
  font-family: var(--f-body);
  font-weight: 500;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--canvas) url("../assets/paper.jpg") center / cover fixed;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

:focus { outline: none; }
:focus-visible { outline: none; }

.caps { text-transform: uppercase; font-weight: 700; letter-spacing: .28em; font-size: 13px; }
.muted { color: var(--graphite); }

/* ---------- screens ---------- */
#app { min-height: 100vh; min-height: 100dvh; }
.screen {
  max-width: 1180px;
  margin: 0 auto;
  padding: calc(124px + var(--safe-top)) clamp(14px, 3vw, 32px) calc(32px + var(--safe-bottom));
  animation: screen-in .35s ease both;
}
@keyframes screen-in { from { opacity: 0; transform: translateY(6px); } }

/* ---------- washi tape CTA: the original tape artwork, zig-zag ends kept intact ---------- */
.washi {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 48px; padding: 0 18px;
  color: #fff;
  border-style: solid; border-width: 0 10px;
  border-image: url("../assets/ds/tape.png") 0 26 fill / 0 10px / 0 stretch;
  font-weight: 700; font-size: 12px; letter-spacing: .26em; text-transform: uppercase;
  white-space: nowrap;
  transform: rotate(var(--tilt, -1deg));
  transition: transform .18s cubic-bezier(.3,1.4,.6,1), filter .18s;
}
.washi:hover { transform: rotate(-2.5deg) translateY(-3px); filter: drop-shadow(0 8px 8px rgba(43,43,43,.3)) brightness(1.12); }
.washi:active { transform: rotate(0) translateY(1px); filter: brightness(.8); }
.washi:focus-visible { outline: none; }
.washi:focus-visible::after { content: ""; position: absolute; inset: 7px 2px; border: 2px dashed #fff; pointer-events: none; }
.washi[disabled] { cursor: not-allowed; transform: rotate(var(--tilt, -1deg)); filter: grayscale(1) brightness(1.35); color: #4A4545; }
.washi.lg { height: 56px; padding: 0 30px; font-size: 13px; letter-spacing: .28em; }
.washi.sm { height: 40px; padding: 0 12px; font-size: 11px; letter-spacing: .24em; }
.washi.loading::after { content: "•••"; letter-spacing: .1em; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .3; } }

/* ---------- secondary: paper scrap ---------- */
.scrap-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px;
  background: url("../assets/paper.jpg") center / 520px auto, var(--cream);
  background-blend-mode: multiply;
  color: var(--ink);
  font-weight: 700; font-size: 12px; letter-spacing: .24em; text-transform: uppercase;
  clip-path: polygon(1% 7%, 99% 0, 100% 93%, 2% 100%);
  transform: rotate(.8deg);
  transition: transform .18s, background-color .15s, filter .18s;
  white-space: nowrap;
}
.scrap-btn:hover { transform: rotate(2deg) translateY(-3px); background-color: var(--lilac); }
.scrap-btn:active { background-color: var(--lavender); transform: none; }
.scrap-btn:focus-visible { outline: 2px dashed var(--magenta); outline-offset: -8px; }
.scrap-btn.on { background-color: var(--ink); color: var(--cream); }
.scrap-btn[disabled] { opacity: .5; pointer-events: none; }
.scrap-btn.sm { min-height: 36px; padding: 0 14px; font-size: 11px; }

.link-btn {
  font-weight: 700; font-size: 12px; letter-spacing: .26em; text-transform: uppercase;
  padding: 10px 4px; color: var(--ink);
  text-decoration: underline wavy var(--magenta) 2px; text-underline-offset: 6px;
  transition: text-decoration-color .15s;
}
.link-btn:hover { color: var(--magenta); text-decoration-thickness: 3px; }
.link-btn:active { color: var(--washi-pressed); text-decoration-color: var(--washi-pressed); }

.icon-btn {
  width: 44px; height: 44px; display: inline-grid; place-items: center;
  border-radius: 50%;
  color: var(--ink);
  transition: background-color .15s, transform .2s var(--ease-over);
}
.icon-btn:hover { background: rgba(43,43,43,.06); transform: translateY(-1px); }
.icon-btn[disabled] { opacity: .3; pointer-events: none; }
.icon-btn svg { width: 24px; height: 24px; }

.sticker-btn {
  width: 56px; height: 56px; border-radius: 50%;
  display: grid; place-items: center;
  background: #fff; color: var(--washi);
  box-shadow: 0 0 0 3px #fff, var(--lift-1);
}

/* ---------- cut-out labels ---------- */
.label {
  display: inline-block;
  padding: .4em 1em .36em;
  line-height: 1;
  background: url("../assets/paper.jpg") center / 520px auto, var(--lilac);
  background-blend-mode: multiply;
  clip-path: polygon(1% 7%, 99% 0, 100% 93%, 2% 100%);
  font-family: "Montserrat"; font-weight: 800; letter-spacing: .14em;
  color: var(--ink);
  transform: rotate(var(--tilt, -1.5deg));
  white-space: nowrap;
  user-select: none;
}
.label.lux { font-family: "Montserrat"; font-weight: 800; letter-spacing: .14em; }
.label.lora { font-family: "Lora"; font-weight: 500; }
.label.lobster { font-family: "Lobster"; border-radius: .45em; padding: .08em .4em .14em; }
.label.mont { font-family: "Montserrat"; font-weight: 500; letter-spacing: .02em; }
.label.montb { font-family: "Montserrat"; font-weight: 800; }
.label.archivo { font-family: "Archivo Black"; }
.label.alfa { font-family: "Alfa Slab One"; }
.label.white { color: #fff; }

.month-label { font-size: clamp(36px, 6vw, 56px); }
/* month names + year sticker: original artwork images */
.month-art { display: inline-flex; align-items: flex-end; gap: .3em; user-select: none; }
.month-art img { height: 1.3em; width: auto; }
.month-art .ma-suffix { font-family: var(--f-body); font-weight: 700; font-size: .5em; letter-spacing: .2em; padding-bottom: .2em; }
.ransom-art { display: inline-block; user-select: none; }
.ransom-art img { width: 100%; height: auto; }
.ransom-art.l { width: 300px; max-width: 80vw; }
.ransom-art.m { width: 150px; }
.ransom-art.s { width: 90px; }
.ransom-art.digits { display: inline-flex; align-items: center; gap: .04em; width: auto !important; height: var(--rh, 50px); }
.ransom-art.digits img { height: 100%; width: auto; }
.ransom-art.digits img:nth-child(odd) { transform: none; }
.ransom-art.digits img:nth-child(even) { transform: none; }
.ransom-art.digits.l { --rh: 96px; }
.ransom-art.digits.m { --rh: 48px; }
.ransom-art.digits.s { --rh: 30px; }

/* ransom-note year sticker */
.ransom {
  display: inline-flex; align-items: center; gap: .04em;
  padding: .08em .14em;
  background: var(--grain), rgba(169,169,169,.35);
  transform: rotate(-2deg);
  user-select: none;
}
.ransom span {
  display: inline-grid; place-items: center;
  min-width: .82em; height: 1.08em; padding: 0 .06em;
  line-height: 1;
  background: var(--grain), var(--pencil);
  color: var(--ink);
  box-shadow: 0 1px 0 rgba(0,0,0,.08);
}
.ransom span:nth-child(4n+1) { font-family: "Luckiest Guy"; transform: rotate(-4deg); }
.ransom span:nth-child(4n+2) { font-family: "Archivo Black"; background-color: var(--ink); color: var(--pencil); transform: rotate(3deg) translateY(1px); font-size: .86em; }
.ransom span:nth-child(4n+3) { font-family: "Alfa Slab One"; background-color: #c9c6c4; transform: rotate(-1deg); }
.ransom span:nth-child(4n+4) { font-family: "Lobster"; background-color: #8f8b89; color: var(--ink); transform: rotate(6deg) translateY(-2px); font-size: 1.04em; }
.ransom.l { font-size: 64px; }
.ransom.m { font-size: 40px; }
.ransom.s { font-size: 24px; }

.script { font-family: var(--f-script); font-size: 40px; line-height: 1; }

/* ---------- torn paper scrap ---------- */
/* the cream scrap is the design system's original artwork, used as-is */
.scrap { background: url("../assets/ds/scrap.png") center / 100% 100% no-repeat; }

/* ---------- pull-out menu ---------- */
.menu { position: fixed; top: 0; left: 50%; z-index: 60; transform: translateX(-50%); width: 340px; max-width: 100vw; pointer-events: none; }
.menu-handle {
  pointer-events: auto;
  position: relative; display: block;
  width: 240px; max-width: 64vw; height: calc(96px + var(--safe-top));
  margin: 0 auto;
  color: var(--ink);
  background: url("../assets/ds/scrap.png") center bottom / 100% 96px no-repeat;
  filter: drop-shadow(0 4px 5px rgba(43,43,43,.18));
  transition: transform .2s cubic-bezier(.3,1.4,.6,1), filter .2s;
  transform-origin: top center;
}
.menu-handle .chev { position: absolute; left: 50%; top: calc(54px + var(--safe-top)); margin-left: -10px; pointer-events: none; transition: transform .2s; }
.menu-handle:hover { transform: translateY(8px); filter: drop-shadow(0 10px 10px rgba(43,43,43,.28)); }
.menu-handle:active { transform: translateY(3px) scaleY(.96); filter: drop-shadow(0 2px 2px rgba(43,43,43,.25)) brightness(.95); }
.menu-handle:active .chev { color: var(--magenta); }
.menu-handle:focus-visible { outline: none; }
.menu-handle .stitch { position: absolute; left: 16px; right: 16px; top: calc(16px + var(--safe-top)); bottom: 30px; border: 2px dashed var(--magenta); opacity: 0; pointer-events: none; }
.menu-handle:focus-visible .stitch { opacity: 1; }
.menu.open .menu-handle { display: none; }
.menu-badge {
  position: absolute; right: -8px; top: calc(10px + var(--safe-top));
  border-style: solid; border-width: 0 10px; border-image: url("../assets/ds/tape.png") 0 26 fill / 0 10px / 0 stretch;
  padding: 4px 4px; font-size: 11px; font-weight: 700; font-style: italic; color: #fff;
  transform: rotate(6deg);
}

/* the sheet: same scrap artwork; torn edges and corners stay intact, only the middle stretches */
.menu-sheet {
  pointer-events: auto;
  position: absolute; left: 0; right: 0; top: 0;
  padding: calc(8px + var(--safe-top)) 0 0 0;
  border-style: solid; border-width: 22px 16px 46px 16px;
  border-image: url("../assets/ds/scrap.png") 70 50 150 50 fill stretch;
  transform: translateY(-105%);
  transition: transform .2s cubic-bezier(.3,1.4,.6,1);
  filter: drop-shadow(0 14px 16px rgba(43,43,43,.32));
  max-height: 100vh; overflow-y: auto; overflow-x: hidden;
}
.menu.open .menu-sheet { transform: translateY(0); }
.menu-title { margin: 0 6px 12px; font-size: 11px; letter-spacing: .32em; color: var(--graphite); font-weight: 700; }
.menu-item {
  z-index: 0;
  position: relative;
  display: flex; align-items: center; gap: 14px; width: 100%;
  height: 48px; padding: 0 6px;
  font-weight: 700; font-size: 13px; letter-spacing: .22em; text-transform: uppercase; text-align: left;
}
.menu-sheet .menu-item, .menu-sheet .menu-title { width: calc(100% + 16px); margin-left: -16px; padding-left: 34px; }
.menu-item .n { font-style: italic; font-weight: 600; color: var(--magenta); letter-spacing: 0; }
.menu-item:hover { background: var(--lilac); }
.menu-item:active { background: var(--lavender); }
.menu-item:active .n { color: var(--washi-pressed); }
.menu-item.sel { color: #fff; }
.menu-item.sel::before {
  content: ""; position: absolute; left: 10px; right: 26px; top: 5px; bottom: 5px; z-index: -1;
  border-style: solid; border-width: 0 10px;
  border-image: url("../assets/ds/tape.png") 0 26 fill / 0 10px / 0 stretch;
  transform: rotate(-1deg);
}
.menu-item.sel .n { color: #fff; }
.menu-item.sel:hover { background: none; }
.menu-item:focus-visible { outline: 2px dashed var(--magenta); outline-offset: -4px; }
.menu-item[disabled] { color: #6E6767; cursor: default; }
.menu-item[disabled] .n { color: inherit; }
.menu-item[disabled] .t { text-decoration: line-through; text-decoration-thickness: 2px; }
.menu-item[disabled]:hover { background: none; }
.menu-item .soon { margin-left: auto; margin-right: 16px; font-size: 11px; font-weight: 600; font-style: italic; letter-spacing: .1em; }
.menu-item .count { margin-left: auto; margin-right: 16px; font-size: 11px; font-style: italic; color: var(--magenta); letter-spacing: .05em; }
.menu-gap { margin: 10px 6px; border-top: 2px dotted var(--crease); }
.menu-close { display: flex; justify-content: center; align-items: center; width: 56px; height: 44px; margin: 14px auto 0; color: var(--ink); transition: transform .2s; }
.menu-close:hover { transform: translateY(-3px); }
.menu-dim { position: fixed; inset: 0; z-index: 55; background: rgba(43,43,43,.2); animation: fade-in .2s; }
@keyframes fade-in { from { opacity: 0; } }

/* ---------- welcome / onboarding ---------- */
.welcome {
  min-height: 100vh; min-height: 100dvh;
  display: grid; place-items: center; text-align: center;
  padding: 48px 20px;
}
.welcome-inner { display: grid; justify-items: center; gap: 22px; max-width: 460px; }
.welcome .script { font-size: clamp(40px, 8vw, 56px); margin-bottom: -10px; }
.welcome p { margin: 0; color: var(--graphite); }
.welcome .motto { font-weight: 700; letter-spacing: .3em; text-transform: uppercase; font-size: 12px; color: var(--ink); }
.field {
  width: min(320px, 100%);
  display: grid; gap: 6px; text-align: left;
}
.field label { font-size: 11px; font-weight: 700; letter-spacing: .26em; text-transform: uppercase; color: var(--graphite); }
.field input, .field select {
  height: 48px; padding: 0 14px;
  border: 0; border-bottom: 2px solid var(--magenta);
  background: rgba(255,255,255,.55);
}
.field input:focus { outline: 2px dashed var(--magenta); outline-offset: 2px; }
.fine { font-size: 12px; color: var(--graphite); max-width: 340px; }

/* sign in / sign up: "welcome to" + the 2027 sticker, as in the design */
.welcome.auth .welcome-inner { gap: 18px; width: min(360px, 100%); }
.welcome-title { margin: 0 0 14px; display: grid; justify-items: center; gap: 4px; font-weight: 400; line-height: 1; }
.welcome-title .script { font-size: clamp(36px, 7vw, 48px); margin: 0; color: var(--ink); }
.welcome-title .welcome-year { display: block; line-height: 0; }
.welcome-title .welcome-year .ransom-art.digits { --rh: clamp(64px, 16vw, 92px); }
.auth-tabs { display: flex; align-items: center; gap: 4px; }
.auth-tabs button { min-height: 40px; padding: 0 14px; font-size: 11px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: var(--graphite); border-bottom: 2px solid transparent; }
.auth-tabs button.on { color: var(--ink); border-bottom-color: var(--magenta); }
.auth-tabs button:hover { color: var(--ink); }
.auth-tabs .vs-sep { width: 2px; height: 18px; margin: 0 4px; border-left: 2px dotted var(--crease); }
.auth-form { width: 100%; display: grid; justify-items: center; gap: 16px; }
.auth-form .field { width: 100%; }
.auth-form .washi { margin-top: 6px; }
.auth-note { font-size: 14px; color: var(--graphite); max-width: 340px; margin: 0; }
.code-input { letter-spacing: .4em; font-size: 22px; text-align: center; }


.onboard-card {
  width: min(420px, 92vw); padding: 36px 30px 30px;
  background: var(--grain), #fbfaf7;
  box-shadow: var(--lift-1);
  transform: rotate(var(--tilt, -1deg));
  text-align: center;
  display: grid; gap: 16px; justify-items: center;
  animation: card-in .4s var(--ease-over) both;
}
@keyframes card-in { from { opacity: 0; transform: translateY(16px) rotate(2deg); } }
.onboard-card h2 { margin: 0; }
.onboard-card p { margin: 0; color: var(--graphite); }
.onboard-art { height: 120px; display: grid; place-items: center; }
.dots { display: flex; gap: 8px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--crease); }
.dots i.on { background: var(--magenta); }

/* ---------- shared top bar (year view) ---------- */
.month-top {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px;
  margin-bottom: 18px;
}
.month-title { display: flex; align-items: center; justify-content: center; gap: clamp(4px, 2vw, 20px); }
.month-title .label { cursor: default; }
.year-name { margin: 0 clamp(8px, 2vw, 24px); line-height: 0; font-size: inherit; }
.year-name .ransom-art.m { width: clamp(150px, 20vw, 230px); }
.year-name .ransom-art.digits.m { --rh: clamp(44px, 6vw, 68px); }
.view-switch { display: inline-flex; gap: 0; justify-self: end; }
.view-switch button { min-height: 40px; padding: 0 14px; font-size: 11px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: var(--graphite); border-bottom: 2px solid transparent; }
.view-switch button.on { color: var(--ink); border-bottom-color: var(--magenta); }
.view-switch button:hover { color: var(--ink); }
.top-left { justify-self: start; display: flex; align-items: center; gap: 8px; }

/* ---------- month page (design system 05 · month view) ---------- */
.screen.month { max-width: 960px; padding-top: calc(112px + var(--safe-top)); }

/* the month's own scrapbook page, inside a dashed frame */
.month-page {
  position: relative; display: block; width: 100%; margin: 0 auto; /* as wide as the calendar */
  aspect-ratio: 1274 / 628;
  text-align: left;
  background: url("../assets/ds/grid-paper.png") center / 100% 100% no-repeat;
  filter: drop-shadow(0 6px 10px rgba(43,43,43,.18));
  transition: transform .18s, filter .18s;
}
.month-page:hover { transform: translateY(-3px); filter: drop-shadow(0 12px 16px rgba(43,43,43,.24)); }
.month-page:focus-visible { outline: 2px dashed var(--magenta); outline-offset: 4px; }
.month-page .mini { position: absolute; inset: 0; }
.mp-empty { position: absolute; inset: 0 10% 20% 0; display: flex; align-items: center; gap: clamp(14px, 3vw, 28px); padding: 0 0 0 clamp(18px, 5%, 36px); }
.mp-photo {
  flex: none; width: clamp(110px, 20vw, 200px); aspect-ratio: 25 / 18;
  background: url("../assets/ds/roses.jpg") 40% 30% / cover;
  transform: rotate(-3deg);
  box-shadow: 0 6px 12px -6px rgba(43,43,43,.45);
}
.mp-tape {
  position: absolute; left: calc(clamp(18px, 5%, 36px) + clamp(110px, 20vw, 200px) * .3); top: calc(50% - clamp(110px, 20vw, 200px) * .36 - 10px);
  width: 90px; height: 28px; transform: rotate(-6deg);
  border-style: solid; border-width: 0 10px; border-image: url("../assets/ds/tape.png") 0 26 fill / 0 10px / 0 stretch;
}
.mp-text { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.mp-kicker { font-size: 11px; font-weight: 700; letter-spacing: .3em; text-transform: uppercase; color: var(--graphite); }
.mp-copy { font-size: 14px; line-height: 1.6; color: #4A4545; max-width: 420px; }
.mp-ph { font-family: var(--f-words); font-size: 22px; color: var(--faded); }

/* arrows + month artwork + year sticker */
.month-head { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.month-name { margin: 0; display: flex; align-items: flex-end; gap: 18px; line-height: 0; font-size: inherit; }
.month-name .mh-month { font-size: clamp(42px, 6.6vw, 66px); }
.month-name .mh-month img { height: auto; width: auto; max-height: 1.35em; max-width: min(320px, 46vw); }
.month-name .ransom-art.m { width: clamp(90px, 16vw, 150px); margin-bottom: 4px; }
.month-name .ransom { font-size: clamp(24px, 4vw, 36px); margin-bottom: 4px; }
.arrow { width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; color: var(--ink); transition: transform .15s; flex: none; }
.arrow:hover { transform: scale(1.12); }
.arrow:focus-visible { outline: 2px dashed var(--magenta); outline-offset: 0; }

/* grid: 2 px magenta rules, 4 px gutter */
.cal { margin-top: 14px; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; touch-action: pan-y; }
.cal .wd {
  height: 46px; display: flex; align-items: center; justify-content: center;
  background: var(--ink); color: #F3EFE3;
  outline: 2px solid var(--magenta); outline-offset: -2px;
  font-weight: 700; font-size: 12px; letter-spacing: .45em; padding-left: .45em;
}
.day {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; text-align: left;
  height: 88px; padding: 8px 10px;
  outline: 2px solid var(--magenta); outline-offset: -2px;
  background: transparent;
  transition: background-color .15s;
  overflow: hidden;
}
.day:hover { background: rgba(232,213,225,.55); }
.day:focus-visible { outline: 2px dashed var(--ink); outline-offset: -2px; }
.day .num { position: relative; z-index: 2; font-weight: 700; font-style: italic; font-size: 13px; line-height: 1; color: var(--ink); }
.day.off .num { color: var(--faded); }
.day.today .num {
  width: 30px; height: 30px; margin: -5px 0 0 -6px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--blush); box-shadow: inset 0 0 0 2px var(--magenta);
}
/* a memory in the grid: the first words of the day, on a cut-out note */
.day .note {
  max-width: 100%;
  padding: 5px 9px;
  font-family: var(--f-words); font-size: 14px; line-height: 1.2; color: var(--ink);
  background-image: url("../assets/paper.jpg"); background-size: 520px auto; background-blend-mode: multiply;
  transform: rotate(var(--tilt, 0deg));
  word-break: break-word;
}
.day .note > span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.note.cut-a { clip-path: polygon(1% 7%, 99% 0, 100% 93%, 2% 100%); }
.note.cut-b { clip-path: polygon(0 0, 97% 5%, 100% 100%, 3% 94%); }
.note.cut-c { clip-path: polygon(2% 3%, 100% 0, 98% 97%, 0 100%); }
.note.n-lilac { background-color: var(--lilac); }
.note.n-sand { background-color: var(--sand); }
.note.n-lav { background-color: var(--lavender); }
.note.n-tape {
  background: none; color: #fff; padding: 5px 2px;
  border-style: solid; border-width: 0 8px; border-image: url("../assets/ds/tape.png") 0 26 fill / 0 8px / 0 stretch;
}
.day .thumb {
  position: absolute; right: 8px; bottom: 6px; transform: rotate(var(--tilt, -2deg));
  height: 58%; aspect-ratio: 4 / 5;
  background: #fbfaf7; padding: 2px;
  box-shadow: 0 6px 12px -6px rgba(43,43,43,.45);
  pointer-events: none;
}
.day .thumb .mini { width: 100%; height: 100%; }
.day .fav { position: absolute; top: 6px; right: 8px; color: var(--magenta); font-size: 12px; }
.hint-tag {
  position: absolute; z-index: 5; left: 50%; bottom: 10%; transform: translateX(-50%) rotate(-3deg);
  width: 88%; text-align: center; line-height: 1.35;
  padding: 3px 4px;
  border-style: solid; border-width: 0 6px; border-image: url("../assets/ds/tape.png") 0 26 fill / 0 6px / 0 stretch;
  color: #fff;
  font-size: 10px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase;
  animation: bob 1.6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes bob { 50% { transform: translateX(-50%) rotate(-3deg) translateY(-4px); } }

@media (max-width: 700px) {
  .screen.month { padding-top: calc(92px + var(--safe-top)); }
  .mp-empty { gap: 16px; padding: 0 16px; }
  .mp-copy { display: none; }
  .mp-ph { font-size: 17px; }
  .mp-tape { width: 64px; height: 22px; }
  .month-head { margin-top: 6px; }
  .month-name { gap: 8px; min-width: 0; }
  .month-name .mh-month img { max-width: 44vw; }
  .month-name .ransom-art.m { width: 22vw; }
  .arrow { width: 44px; }
  .cal { gap: 3px; }
  .cal .wd { height: 34px; font-size: 10px; letter-spacing: .1em; padding-left: .1em; }
  .day { height: 64px; padding: 5px; gap: 4px; }
  .day .num { font-size: 12px; }
  .day.today .num { width: 24px; height: 24px; margin: -3px 0 0 -3px; }
  .day .note { font-size: 10px; padding: 3px 5px; }
  .day .thumb { height: 50%; right: 4px; bottom: 4px; }
  .hint-tag { font-size: 8px; letter-spacing: .08em; padding: 2px 3px; }
  .month-top { grid-template-columns: 1fr auto; grid-template-areas: "left switch" "title title"; row-gap: 4px; }
  .month-top .top-left { grid-area: left; }
  .month-top .view-switch { grid-area: switch; }
  .month-top .month-title { grid-area: title; }
  .month-label { font-size: 34px; }
  .screen { padding-top: calc(92px + var(--safe-top)); }
  .menu-handle { width: 200px; height: calc(80px + var(--safe-top)); background-size: 100% 80px; }
  .menu-handle .chev { top: calc(42px + var(--safe-top)); }
  .menu-handle .stitch { left: 14px; right: 14px; top: calc(14px + var(--safe-top)); bottom: 26px; }
}

/* ---------- mini page renders (thumbnails) ---------- */
.mini { position: relative; overflow: hidden; }
.mini-inner { position: absolute; left: 0; top: 0; transform-origin: 0 0; pointer-events: none; }
.mini-inner .item { pointer-events: none; }

/* ---------- year view ----------
   The year photo with the twelve month-number circles glued onto it. Sizes use cqw
   so it scales as one piece on desktop, iPad and phone. */
.screen.year { max-width: 1180px; }
/* the year's top bar is exactly as wide as the photo below it */
.screen.year .month-top { width: min(100%, 896px); margin-left: auto; margin-right: auto; }
.yr-card {
  position: relative;
  width: min(100%, 896px); /* same width as the month calendar */
  margin: 4px auto 40px;
}
.yr-bottom {
  container-type: inline-size; position: relative; aspect-ratio: 1420 / 960; overflow: hidden;
  box-shadow: 0 10px 24px -14px rgba(43,43,43,.5);
}
.yr-img {
  position: absolute; inset: 0;
  background: radial-gradient(120% 90% at 30% 20%, #5a5454, #2b2b2b 70%) center / cover no-repeat;
}
/* the user's own photo, in its own colours */
.yr-img.has { background-size: cover; background-position: center; }

/* month buttons: the number circles, each cut from its own piece of paper */
.mcircle {
  position: absolute; z-index: 1;
  width: 13cqw; aspect-ratio: 1; border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: transform .2s cubic-bezier(.3,1.4,.6,1), filter .2s, opacity .2s;
}
.mcircle img { width: 100%; height: 100%; border-radius: 50%; pointer-events: none; user-select: none; }
.mcircle:hover { transform: translate(-50%, -50%) translateY(-6px) rotate(-4deg); filter: drop-shadow(0 16px 12px rgba(0,0,0,.55)); }
.mcircle:active { transform: translate(-50%, -50%) scale(.97); filter: none; }
.mcircle:focus-visible { outline: 3px dashed #fff; outline-offset: 5px; }
.mcircle.past { opacity: .6; filter: grayscale(.6); }
.mcircle.past:hover { opacity: 1; filter: drop-shadow(0 16px 12px rgba(0,0,0,.55)); }
.mcircle .mc-tape {
  position: absolute; left: 18%; top: -6%; width: 63%; height: 22%; transform: rotate(-8deg);
  border-style: solid; border-width: 0 8px; border-image: url("../assets/ds/tape.png") 0 26 fill / 0 8px / 0 stretch;
}
.mcircle small {
  position: absolute; left: 50%; bottom: -4%; transform: translateX(-50%) rotate(-2deg);
  padding: 2px 8px; background: var(--cream); color: var(--ink);
  font-size: max(9px, 1.15cqw); font-style: italic; font-weight: 700; letter-spacing: .05em; white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0,0,0,.25);
}

/* change the photo: a round paper icon sticker (design system) pinned to the top-right
   corner, with a cream paper tag so it reads at a glance */
.yr-photo {
  position: absolute; z-index: 3; right: -10px; bottom: -16px;
  display: flex; align-items: center; flex-direction: row-reverse; gap: 0;
}
.yr-photo-sticker {
  position: relative; z-index: 1;
  width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center;
  background: url("../assets/paper.jpg") 30% 40% / 260px auto, var(--crumple);
  color: var(--magenta);
  box-shadow: 0 2px 3px rgba(43,43,43,.25);
  transition: transform .18s, box-shadow .18s, background-color .15s;
}
.yr-photo-sticker svg { width: 21px; height: 21px; }
.yr-photo-tag {
  margin-right: -10px; padding: 9px 22px 9px 14px;
  background: url("../assets/paper.jpg") center / 520px auto, var(--cream);
  background-blend-mode: multiply;
  clip-path: polygon(1% 7%, 99% 0, 100% 93%, 2% 100%);
  font-size: 11px; font-weight: 700; letter-spacing: .24em; text-transform: uppercase; color: var(--ink);
  transform: rotate(-2deg);
  filter: drop-shadow(0 1px 1px rgba(43,43,43,.15));
  transition: background-color .15s;
}
.yr-photo:hover .yr-photo-sticker { transform: rotate(-8deg) translateY(-3px); box-shadow: 0 10px 14px -6px rgba(43,43,43,.4); }
.yr-photo:hover .yr-photo-tag { background-color: var(--lilac); }
.yr-photo:active .yr-photo-sticker { transform: none; background-color: var(--blush); background-blend-mode: multiply; box-shadow: none; color: var(--washi-pressed); }
.yr-photo:focus-visible { outline: none; }
.yr-photo:focus-visible .yr-photo-sticker { outline: 2px dashed var(--magenta); outline-offset: 4px; }
@media (max-width: 700px) {
  .yr-photo { position: static; margin: 18px auto 0; justify-content: center; }
  .yr-photo-sticker { width: 44px; height: 44px; }
  .yr-photo-sticker svg { width: 20px; height: 20px; }
  .yr-photo-tag { font-size: 10px; letter-spacing: .18em; padding: 7px 18px 7px 10px; }
}

.minis { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 26px 22px; }
.mini-month {
  position: relative; display: grid; gap: 10px; align-content: start; text-align: left;
  padding: 14px 14px 16px;
  background: rgba(251,250,247,.75);
  box-shadow: var(--lift-0);
  transform: rotate(var(--tilt, 0deg));
  transition: transform .2s var(--ease-over), box-shadow .2s;
}
.mini-month:hover { transform: rotate(var(--tilt, 0deg)) translateY(-3px); box-shadow: var(--lift-1); }
.mini-month.cur { box-shadow: 0 0 0 2px var(--magenta), var(--lift-1); }
.mini-month .label { font-size: 22px; justify-self: start; }
.mini-month .mcover { aspect-ratio: 16 / 7; background: #fbfaf7; overflow: hidden; }
.mini-month .mcover .mini { width: 100%; height: 100%; }
.mini-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; font-size: 10px; text-align: center; }
.mini-grid b { font-weight: 700; color: var(--graphite); font-size: 9px; letter-spacing: .1em; }
.mini-grid span { position: relative; height: 20px; line-height: 20px; font-style: italic; font-weight: 500; }
.mini-grid span.today { color: var(--magenta); font-weight: 700; }
.mini-grid span.has::after { content: ""; position: absolute; left: 50%; bottom: 0; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--magenta); }

/* ---------- diary page (design system 06 · diary editor) ---------- */
.diary { padding-top: calc(100px + var(--safe-top)); padding-bottom: 0; max-width: 960px; }
.diary-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 64px; margin-bottom: 12px;
}
.date-block { display: flex; align-items: center; gap: 4px; min-width: 0; }
.dh-month { display: flex; align-items: center; gap: 12px; padding: 0 10px; line-height: 0; transition: transform .15s; }
.dh-month:hover { transform: translateY(-2px); }
.dh-month:focus-visible { outline: 2px dashed var(--magenta); outline-offset: 4px; }
.dh-month .dh-art { font-size: 31px; }
.dh-month .dh-art img { height: 40px; max-width: 34vw; object-fit: contain; }
.dh-month .ransom-art.s { width: 107px; }
.dh-month .ransom { font-size: 22px; }
.dh-kicker { font-size: 11px; font-weight: 700; letter-spacing: .3em; text-transform: uppercase; color: var(--graphite); margin-left: 6px; }
.arrow.sm { width: 44px; height: 44px; }
.arrow.sm svg { width: 14px; height: 24px; }
.head-actions { display: flex; align-items: center; gap: 6px; }
.head-actions .icon-btn { border-radius: 0; }
.head-actions .icon-btn:hover { background: rgba(229,211,227,.7); transform: none; }
.head-actions .icon-btn svg { width: 22px; height: 22px; }
.head-actions .sep { display: none; }
.save-state {
  display: inline-flex; align-items: center; gap: 8px; min-width: 118px; min-height: 28px;
  padding-left: 12px; border-left: 2px dotted var(--crease);
  font-size: 11px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: var(--graphite);
}
.save-state svg { width: 16px; height: 16px; color: var(--magenta); }
.save-state.err { color: var(--washi); }
.save-state.err svg { color: var(--washi); }
.save-state .dots3 { display: inline-flex; gap: 3px; }
.save-state .dots3 i { width: 4px; height: 4px; border-radius: 50%; background: var(--graphite); animation: dot3 1s infinite; }
.save-state .dots3 i:nth-child(2) { animation-delay: .15s; }
.save-state .dots3 i:nth-child(3) { animation-delay: .3s; }
@keyframes dot3 { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.save-state .retry { margin-left: 4px; padding: 4px 0; font-size: 11px; letter-spacing: .2em; }

.diary-body { display: flex; flex-direction: column; gap: 16px; }
.page-wrap { display: grid; justify-items: center; position: relative; }

/* options bar + tool row stay pinned to the bottom of the screen */
.tool-area {
  position: sticky; bottom: 0; z-index: 40;
  display: grid; gap: 14px;
  padding: 4px 0 calc(14px + var(--safe-bottom));
  background: var(--canvas) url("../assets/paper.jpg") center / cover fixed;
}
.dock { display: flex; gap: 10px; align-items: stretch; }
.dock-btn {
  position: relative; flex: 1;
  min-height: 72px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: .24em; text-transform: uppercase; color: var(--ink);
  transition: transform .15s;
}
.dock-btn svg { width: 26px; height: 26px; }
.dock-btn:hover { transform: translateY(-3px); }
.dock-btn.on {
  color: #fff; transform: rotate(-1deg);
  border-style: solid; border-width: 0 10px;
  border-image: url("../assets/ds/tape.png") 0 26 fill / 0 10px / 0 stretch;
}
.dock-btn:focus-visible { outline: 2px dashed var(--magenta); outline-offset: -6px; }

.tool-opts {
  background: url("../assets/paper.jpg") center / 520px auto, var(--cream);
  background-blend-mode: multiply;
  padding: 14px 22px;
  box-shadow: 0 2px 3px rgba(43,43,43,.15);
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px;
  min-height: 88px;
}
.tool-opts .grow { flex: 1; }
.opt-group { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.opt-sep { width: 1px; height: 44px; background: var(--crease); margin: 0 4px; }
.opt-label { font-size: 11px; font-weight: 700; letter-spacing: .25em; text-transform: uppercase; color: var(--graphite); margin-right: 6px; }
.opt-hint { font-size: 12px; color: #4A4545; margin: 0; }
.chip {
  min-width: 44px; min-height: 44px; padding: 0 16px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--canvas);
  font-weight: 700; font-size: 11px; letter-spacing: .2em; text-transform: uppercase;
  transition: background-color .15s;
}
.chip:hover { background: var(--lilac); }
.chip.on { background: var(--ink); color: #F3EFE3; }
.chip:focus-visible { outline: 2px dashed var(--magenta); outline-offset: 2px; }
.chip svg { width: 18px; height: 18px; }
.swatch { width: 30px; height: 30px; border-radius: 50%; background: var(--c); }
.swatch.on { outline: 2px solid var(--ink); outline-offset: 3px; }
.swatch-hit { width: 44px; height: 44px; display: grid; place-items: center; }
.swatch-hit:focus-visible { outline: none; }
.swatch-hit:focus-visible .swatch { outline: 2px solid var(--ink); outline-offset: 3px; }

@media (max-width: 700px) {
  .diary { padding-top: calc(86px + var(--safe-top)); }
  .diary-head { min-height: 52px; margin-bottom: 8px; }
  .dh-month { gap: 8px; padding: 0 4px; }
  .dh-month .dh-art img { height: 30px; }
  .dh-month .ransom-art.s { width: 80px; }
  .head-actions { gap: 0; }
  .head-actions .icon-btn { width: 40px; }
  .save-state { min-width: 0; padding-left: 8px; letter-spacing: .12em; font-size: 10px; }
  .save-state .st-txt { display: none; }
  .tool-area { gap: 8px; padding-bottom: calc(8px + var(--safe-bottom)); }
  .tool-opts { padding: 10px 12px; min-height: 64px; gap: 8px 10px; }
  .dock { gap: 2px; }
  .dock-btn { min-height: 58px; font-size: 9px; letter-spacing: .12em; gap: 4px; }
  .dock-btn svg { width: 22px; height: 22px; }
}

/* month collages are made on the grid paper */
.page-frame.grid-paper { border-color: transparent; background: url("../assets/ds/grid-paper.png") center / 100% 100% no-repeat; filter: drop-shadow(0 6px 10px rgba(43,43,43,.18)); }
/* page canvas */
.page-frame {
  position: relative;
  border: 2px solid var(--magenta);
  background: rgba(255,255,255,.38);
  touch-action: none;
  user-select: none; -webkit-user-select: none;
}
.page-inner { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.page-bg { position: absolute; inset: 0; }
/* the date, made of cut-out digits + the weekday artwork, glued to the page */
.page-date { position: absolute; left: 28px; top: 22px; display: flex; align-items: center; gap: 16px; pointer-events: none; z-index: 0; }
.page-date .digits { display: flex; align-items: center; gap: 2px; }
.page-date .digits img { height: 88px; width: auto; }
.page-date .digits img:nth-child(odd) { transform: rotate(-4deg); }
.page-date .digits img:nth-child(even) { transform: rotate(3deg); }
.page-date .wd-art { height: 55px; width: auto; transform: rotate(1.5deg); }
.dear { position: absolute; left: 40px; top: 160px; cursor: text; }
.dear .caps { color: var(--magenta); font-size: 15px; letter-spacing: .3em; }
.dear p { margin: 10px 0 0; font-family: var(--f-words); font-size: 25px; color: var(--graphite); }
.page-help { position: absolute; right: 16px; bottom: 10px; font-size: 13px; color: var(--graphite); pointer-events: none; }

/* items */
.item { position: absolute; transform-origin: center center; touch-action: none; }
.item-content { position: relative; }
.item.editable { cursor: grab; }
.item.editable:hover > .item-content { filter: drop-shadow(0 8px 8px rgba(43,43,43,.22)); }
.item.moving { cursor: grabbing; z-index: 9999 !important; }
.item.moving > .item-content { filter: drop-shadow(0 18px 16px rgba(43,43,43,.4)); }
.ghost { position: absolute; border: 2px dashed var(--pencil); pointer-events: none; transform-origin: center; }

.sel-box { position: absolute; inset: calc(-10px * var(--inv, 1)); border: calc(2px * var(--inv, 1)) dashed var(--magenta); pointer-events: none; }
.handle {
  position: absolute; width: calc(14px * var(--inv, 1)); height: calc(14px * var(--inv, 1));
  margin: calc(-7px * var(--inv, 1)) 0 0 calc(-7px * var(--inv, 1));
  border-radius: 50%; background: var(--canvas); border: calc(2px * var(--inv, 1)) solid var(--magenta);
  box-sizing: content-box;
  pointer-events: auto; touch-action: none;
}
.handle::after { content: ""; position: absolute; inset: calc(-14px * var(--inv, 1)); }
.handle.nw { left: calc(-10px * var(--inv, 1)); top: calc(-10px * var(--inv, 1)); cursor: nwse-resize; }
.handle.ne { left: calc(100% + 10px * var(--inv, 1)); top: calc(-10px * var(--inv, 1)); cursor: nesw-resize; }
.handle.sw { left: calc(-10px * var(--inv, 1)); top: calc(100% + 10px * var(--inv, 1)); cursor: nesw-resize; }
.handle.se { left: calc(100% + 10px * var(--inv, 1)); top: calc(100% + 10px * var(--inv, 1)); cursor: nwse-resize; }
.handle.rot {
  left: 50%; top: calc(-42px * var(--inv, 1));
  width: calc(20px * var(--inv, 1)); height: calc(20px * var(--inv, 1));
  margin: calc(-10px * var(--inv, 1)) 0 0 calc(-10px * var(--inv, 1));
  border: 0; background: var(--magenta) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.4' stroke-linecap='round'%3E%3Cpath d='M20 12a8 8 0 11-2.3-5.6M20 4v5h-5'/%3E%3C/svg%3E") center / 60% no-repeat;
  cursor: grab;
}
.handle.rot::before { content: ""; position: absolute; left: 50%; top: 100%; width: calc(2px * var(--inv, 1)); height: calc(22px * var(--inv, 1)); background: var(--magenta); transform: translateX(-50%); }
/* rotating: a tape tag shows the angle */
.angle-tag {
  position: absolute; right: calc(-14px * var(--inv, 1)); top: calc(-52px * var(--inv, 1));
  padding: calc(6px * var(--inv, 1)) calc(6px * var(--inv, 1));
  border-style: solid; border-width: 0 calc(10px * var(--inv, 1));
  border-image: url("../assets/ds/tape.png") 0 26 fill / 0 calc(10px * var(--inv, 1)) / 0 stretch;
  font-size: calc(13px * var(--inv, 1)); font-weight: 700; font-style: italic; color: #fff; white-space: nowrap; pointer-events: none;
}

/* text item */
.t-text {
  min-width: 60px; padding: 6px 8px;
  white-space: pre-wrap; word-break: break-word;
  outline: none; cursor: inherit;
}
.t-text[contenteditable="true"] { cursor: text; background: rgba(255,255,255,.55); user-select: text; -webkit-user-select: text; }
.t-text:empty::before { content: attr(data-ph); color: var(--faded); }

/* photo cut-outs: scissor (with two strips of tape), circle, torn */
.cut img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; -webkit-user-drag: none; user-select: none; }
.cut.scissor img { clip-path: polygon(1% 7%, 99% 0, 100% 93%, 2% 100%); }
.cut.scissor .tape {
  position: absolute; width: 28%; min-width: 60px; height: 26px; transform: rotate(-32deg);
  border-style: solid; border-width: 0 10px; border-image: url("../assets/ds/tape.png") 0 26 fill / 0 10px / 0 stretch;
  opacity: .92;
}
.cut.scissor .tape.t1 { left: -6%; top: 3%; }
.cut.scissor .tape.t2 { right: -6%; bottom: 5%; }
.cut.circle img { border-radius: 50%; }
.cut.torn img { clip-path: polygon(0 3%,6% 0,14% 2%,22% 0,31% 3%,40% 1%,49% 3%,58% 0,67% 2%,76% 0,85% 3%,93% 1%,100% 4%,98% 14%,100% 26%,98% 38%,100% 50%,98% 62%,100% 74%,98% 86%,100% 97%,92% 100%,83% 97%,74% 100%,65% 98%,56% 100%,47% 97%,38% 100%,29% 98%,20% 100%,11% 97%,3% 100%,0 96%,2% 84%,0 72%,2% 60%,0 48%,2% 36%,0 24%,2% 12%); }
.wrap-shadow { filter: drop-shadow(0 2px 3px rgba(43,43,43,.25)); }
.cut.scan { background: #fbfaf6; padding: 2.5%; box-shadow: 0 2px 3px rgba(43,43,43,.25); }

/* stickers */
.st-img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; -webkit-user-drag: none; }
.outline .st-img {
  filter: drop-shadow(3px 0 0 #fff) drop-shadow(-3px 0 0 #fff) drop-shadow(0 3px 0 #fff) drop-shadow(0 -3px 0 #fff) drop-shadow(0 4px 5px rgba(43,37,35,.28));
}
.no-outline .st-img { filter: drop-shadow(0 3px 4px rgba(43,37,35,.22)); }
.bi { width: 100%; height: 100%; display: grid; place-items: center; }
.bi .label { transform: none; }
.tape-strip { width: 100%; height: 100%; background: var(--grain), var(--c); opacity: .9; }
.tape-strip.art { background: none; opacity: 1; border-style: solid; border-width: 0 10px; border-image: url("../assets/ds/tape.png") 0 26 fill / 0 10px / 0 stretch; }
.tape-strip.zig {
  -webkit-mask:
    conic-gradient(from 45deg at left, #0000, #000 1deg 89deg, #0000 90deg) left / 51% 10px repeat-y,
    conic-gradient(from -135deg at right, #0000, #000 1deg 89deg, #0000 90deg) right / 51% 10px repeat-y;
  mask:
    conic-gradient(from 45deg at left, #0000, #000 1deg 89deg, #0000 90deg) left / 51% 10px repeat-y,
    conic-gradient(from -135deg at right, #0000, #000 1deg 89deg, #0000 90deg) right / 51% 10px repeat-y;
}

/* doodles */
.doodle-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.draw-layer { position: absolute; inset: 0; z-index: 100000; cursor: crosshair; touch-action: none; }
.draw-layer.erase { cursor: cell; }

/* item toolbar */
.item-bar {
  position: absolute; z-index: 30;
  display: flex; align-items: center;
  background: var(--ink); color: var(--cream);
  box-shadow: 0 10px 18px -8px rgba(43,43,43,.6);
  transform: translateX(-50%);
  white-space: nowrap;
}
.item-bar button { width: 44px; height: 44px; display: grid; place-items: center; }
.item-bar button:hover { background: var(--ink-hover); }
.item-bar button svg { width: 20px; height: 20px; }
.item-bar .del { color: #F3B8CF; }
.item-bar .div { width: 1px; align-self: stretch; margin: 10px 2px; background: #5E5757; }
@media (max-width: 520px) { .item-bar button { width: 40px; } }

/* sticker tray */
.tray { width: 100%; display: grid; gap: 12px; }
.tray-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tray-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px;
  max-height: 280px; overflow-y: auto; padding: 4px;
}
.tray-cell {
  position: relative; height: 84px; display: grid; place-items: center;
  background: rgba(255,255,255,.55);
  transition: transform .15s var(--ease-over), background-color .15s;
  overflow: hidden;
}
.tray-cell:hover { transform: translateY(-2px); background: #fff; }
.tray-cell .bi-prev { position: absolute; left: 50%; top: 50%; width: max-content; transform: translate(-50%, -50%) scale(var(--ps, .5)); transform-origin: center; pointer-events: none; }
.tray-cell .bi-prev .label { transform: none; }
.tray-cell img { max-width: 76%; max-height: 76%; object-fit: contain; filter: drop-shadow(0 2px 2px rgba(0,0,0,.2)); }
.tray-empty { font-size: 13px; color: var(--graphite); padding: 8px 0; grid-column: 1 / -1; }

/* ---------- toasts ---------- */
.toasts { position: fixed; z-index: 90; left: 50%; bottom: calc(24px + var(--safe-bottom)); transform: translateX(-50%); display: grid; gap: 10px; justify-items: center; pointer-events: none; }
.toast {
  pointer-events: auto;
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  min-width: 280px; max-width: calc(100vw - 24px);
  padding: 0 6px 0 10px;
  border-style: solid; border-width: 22px 16px 46px 16px;
  border-image: url("../assets/ds/scrap.png") 70 50 150 50 fill stretch;
  filter: drop-shadow(0 6px 8px rgba(43,43,43,.3));
  font-size: 13px; font-weight: 600;
  margin-bottom: -26px;
  animation: toast-in .25s var(--ease-over);
}
.toast .washi { height: 38px; padding: 0 8px; font-size: 11px; letter-spacing: .24em; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } }

/* ---------- modal ---------- */
.modal-back { position: fixed; inset: 0; z-index: 80; background: rgba(43,43,43,.32); display: grid; place-items: center; padding: 16px; animation: fade-in .2s; }
.modal {
  width: min(560px, 100%); max-height: calc(100dvh - 32px); overflow: auto;
  background: var(--grain), #fbfaf7;
  box-shadow: var(--lift-2);
  padding: 28px 26px 24px;
  display: grid; gap: 18px;
  animation: card-in .3s var(--ease-over) both;
}
.modal.wide { width: min(900px, 100%); }
.modal h2 { margin: 0; font-family: "Luckiest Guy"; font-weight: 400; font-size: 28px; letter-spacing: .02em; }
.modal p { margin: 0; color: var(--graphite); }
.modal-actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: flex-end; }
.checker { background: repeating-conic-gradient(#eee 0 25%, #fff 0 50%) 50% / 20px 20px; }
.preview-box { display: grid; place-items: center; min-height: 160px; max-height: 50vh; padding: 10px; }
.preview-box img, .preview-box canvas { max-height: 46vh; max-width: 100%; object-fit: contain; }

/* scanner */
.scan-stage { position: relative; background: #1d1b1b; display: grid; place-items: center; min-height: 260px; overflow: hidden; touch-action: none; }
.scan-stage video, .scan-stage canvas.src { max-width: 100%; max-height: 58vh; display: block; }
.scan-stage svg.quad { position: absolute; pointer-events: none; }
.corner { position: absolute; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; border: 3px solid #fff; background: rgba(184,65,107,.75); touch-action: none; cursor: grab; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.scan-queue { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.scan-queue img { height: 72px; background: #fff; padding: 3px; box-shadow: var(--lift-0); }

/* ---------- lists (memories, stickers, settings) ---------- */
.panel-title { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.panel-title .label { font-size: clamp(30px, 5vw, 44px); }
.mem-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 26px 20px; }
.mem-card { display: grid; gap: 8px; text-align: left; transition: transform .2s var(--ease-over); }
.mem-card:hover { transform: translateY(-3px) rotate(-.5deg); }
.mem-card .pg { aspect-ratio: 4 / 5; background: #fbfaf7; padding: 4px; box-shadow: var(--lift-1); transform: rotate(var(--tilt, -1deg)); }
.mem-card .pg .mini { width: 100%; height: 100%; }
.mem-card .d { font-weight: 700; font-size: 12px; letter-spacing: .2em; text-transform: uppercase; }
.mem-card .d em { color: var(--magenta); font-size: 18px; letter-spacing: 0; margin-right: 6px; }
.empty-note { padding: 40px 0; color: var(--graphite); display: grid; gap: 16px; justify-items: start; }

.sticker-lib { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 18px; }
.sticker-lib .cell { position: relative; aspect-ratio: 1; display: grid; place-items: center; background: rgba(255,255,255,.55); box-shadow: var(--lift-0); }
.sticker-lib img { max-width: 80%; max-height: 80%; object-fit: contain; filter: drop-shadow(0 2px 3px rgba(0,0,0,.2)); }
.sticker-lib .rm { position: absolute; top: 4px; right: 4px; }
.sticker-lib .src { position: absolute; left: 6px; bottom: 4px; font-size: 9px; letter-spacing: .2em; font-weight: 700; text-transform: uppercase; color: var(--graphite); }

.settings { display: grid; gap: 26px; max-width: 640px; }
.set-row { display: grid; gap: 10px; padding-bottom: 22px; border-bottom: 1px solid var(--crease); }
.set-row h3 { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .28em; text-transform: uppercase; }
.set-row p { margin: 0; font-size: 14px; color: var(--graphite); }
.set-row .row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; }
.toggle input { width: 20px; height: 20px; accent-color: var(--washi); }

/* page turn overlay */
.turn-clone { position: fixed; z-index: 50; pointer-events: none; transform-style: preserve-3d; backface-visibility: hidden; }
.turn-clone .shade { position: absolute; inset: 0; pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
.reduce-motion *, .reduce-motion *::before, .reduce-motion *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }

@media print {
  .menu, .dock, .tool-opts, .head-actions, .toasts { display: none !important; }
}

@media (max-width: 520px) { .hide-xs { display: none; } .head-actions .sep, .save-state { min-width: 0; } .save-state { font-size: 10px; letter-spacing: .12em; } }

@media (max-width: 700px) {
  .diary { padding-top: calc(76px + var(--safe-top)); }
  .diary-head { grid-template-columns: 1fr; gap: 4px; }
  .head-actions { justify-content: flex-end; }
  .date-num { font-size: 44px; }
  .date-meta .wd { font-size: 11px; letter-spacing: .3em; }
  .diary-body { padding-bottom: calc(84px + var(--safe-bottom)); }
}

/* ---------- sign-in & sync ---------- */
.auth-err { margin: -6px 0 0; color: var(--washi); font-size: 14px; font-weight: 700; max-width: 340px; }
.auth-alt { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.welcome b { color: var(--ink); }
.account { display: grid; gap: 10px; }
.sync-line { display: flex; align-items: center; gap: 8px; }
.sync-line svg { color: var(--magenta); flex: none; }
.sync-line.err { color: var(--washi); }
.sync-line .dots3 { animation: blink 1s infinite; }
body:has(.screen.diary) .toasts { bottom: calc(200px + var(--safe-bottom)); }
@media (max-width: 700px) { body:has(.screen.diary) .toasts { bottom: calc(150px + var(--safe-bottom)); } }
@media (hover: hover) and (pointer: fine) { .tool-opts [data-act="camera"] { display: none; } }
@media (max-width: 520px) {
  .diary-head { flex-wrap: wrap; justify-content: center; row-gap: 0; }
  .date-block { width: 100%; justify-content: space-between; }
  .head-actions { width: 100%; justify-content: flex-end; margin-top: -4px; }
  .head-actions .icon-btn { width: 40px; height: 40px; }
  .dh-month .dh-art img { height: 28px; max-width: 46vw; }
  .dh-month .ransom-art.s { width: 74px; }
}
/* Today sits with Month / Year on the year page */
.view-switch { align-items: center; }
.view-switch .vs-today { min-height: 40px; padding: 0 14px; font-size: 11px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: var(--magenta); border-bottom: 2px solid transparent; }
.view-switch .vs-today:hover { color: var(--washi-pressed); }
.view-switch .vs-sep { width: 2px; height: 18px; margin: 0 4px; border-left: 2px dotted var(--crease); }

/* paper cut-out arrows (year page) */
.paper-arrow { width: 72px; height: 48px; display: grid; place-items: center; flex: none; transition: transform .18s cubic-bezier(.3,1.4,.6,1), filter .18s; filter: drop-shadow(0 1px 1px rgba(43,43,43,.3)) drop-shadow(0 4px 5px rgba(43,43,43,.22)); }
.paper-arrow img { width: 100%; height: auto; pointer-events: none; user-select: none; }
.paper-arrow.prev { transform: none; }
.paper-arrow.next { transform: none; }
.paper-arrow.prev:hover { transform: translateX(-3px); filter: drop-shadow(0 8px 8px rgba(43,43,43,.28)); }
.paper-arrow.next:hover { transform: translateX(3px); filter: drop-shadow(0 8px 8px rgba(43,43,43,.28)); }
.paper-arrow:active { filter: drop-shadow(0 1px 1px rgba(43,43,43,.2)) brightness(.95); }
.paper-arrow:focus-visible { outline: 2px dashed var(--magenta); outline-offset: 2px; }
@media (max-width: 700px) { .paper-arrow { width: 56px; height: 44px; } }
.paper-arrow.prev img { transform: scaleX(-1); }


/* no dashed focus frames anywhere (on request); the calendar days keep their normal magenta rule */
.washi:focus-visible::after, .menu-handle .stitch { display: none !important; }
.scrap-btn:focus-visible, .menu-item:focus-visible, .month-page:focus-visible, .arrow:focus-visible,
.mcircle:focus-visible, .dh-month:focus-visible, .dock-btn:focus-visible, .chip:focus-visible,
.paper-arrow:focus-visible, .yr-photo:focus-visible .yr-photo-sticker, .link-btn:focus-visible,
.icon-btn:focus-visible, .hole:focus-visible, .menu-close:focus-visible, .auth-tabs button:focus-visible,
.view-switch button:focus-visible { outline: none !important; }
.day:focus-visible { outline: 2px solid var(--magenta); outline-offset: -2px; }
.field input:focus { outline: none; border-bottom-color: var(--washi-pressed); background: rgba(255,255,255,.75); }

/* year page: arrows + year sit at the left edge of the photo, the switch at the right */
.screen.year .month-top { grid-template-columns: auto 1fr; }
.screen.year .month-top .top-left { display: none; }
.screen.year .month-top .month-title { justify-content: flex-start; margin-left: -12px; }
@media (max-width: 700px) {
  .screen.year .month-top { grid-template-columns: 1fr; grid-template-areas: "switch" "title"; }
  .screen.year .month-top .view-switch { justify-self: end; }
}

/* diary tip: fades away after a few seconds; the small "?" sticker above the tools brings it back */
.tool-opts { transition: opacity .35s ease, max-height .35s ease, padding .35s ease, min-height .35s ease; max-height: 400px; }
.tool-opts.tip-gone { opacity: 0; max-height: 0; min-height: 0; padding-top: 0; padding-bottom: 0; overflow: hidden; box-shadow: none; pointer-events: none; }
.tool-area { position: sticky; }
.help-btn {
  position: absolute; right: 0; top: -40px; z-index: 2;
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  background: url("../assets/paper.jpg") 30% 40% / 200px auto, var(--crumple);
  color: var(--magenta); font-weight: 700; font-size: 15px; line-height: 1;
  box-shadow: 0 2px 3px rgba(43,43,43,.25);
  transition: transform .18s, box-shadow .18s;
}
.help-btn:hover { transform: rotate(-8deg) translateY(-2px); box-shadow: 0 8px 12px -6px rgba(43,43,43,.4); }
.help-btn:active { transform: none; background-color: var(--blush); box-shadow: none; }
@media (max-width: 700px) { .help-btn { top: -36px; width: 28px; height: 28px; font-size: 14px; } }

/* text boxes: side handles stretch the box wider or narrower */
.handle.e, .handle.w { width: calc(10px * var(--inv, 1)); height: calc(26px * var(--inv, 1)); margin: calc(-13px * var(--inv, 1)) 0 0 calc(-5px * var(--inv, 1)); border-radius: calc(6px * var(--inv, 1)); top: 50%; cursor: ew-resize; }
.handle.e { left: calc(100% + 10px * var(--inv, 1)); }
.handle.w { left: calc(-10px * var(--inv, 1)); }
.item.editable .t-text[contenteditable="true"], .item.editable .t-text[contenteditable="plaintext-only"] { cursor: text; }

/* opacity chips: a dot of the current colour at that strength */
.alpha-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--c); display: inline-block; }
.chip.on .alpha-dot { box-shadow: 0 0 0 1.5px #F3EFE3; }
.opt-group.palette { gap: 0; }

/* toast text: Montserrat label style from the design system, with room to breathe */
.toast { padding: 8px 20px 6px 26px; min-width: 320px; gap: 22px; }
.toast > span {
  font-family: var(--f-body); font-weight: 700; font-size: 12px;
  letter-spacing: .22em; text-transform: uppercase; line-height: 1.5;
  padding: 6px 0;
}
.toast:not(:has(button)) { justify-content: center; padding-right: 26px; }

/* freehand cut: draw a line around the part of the photo to keep */
.lasso-layer { position: absolute; inset: 0; z-index: 100001; cursor: crosshair; touch-action: none; }
.lasso-layer svg { position: absolute; inset: 0; overflow: visible; }
.lasso-path { fill: rgba(232,213,225,.25); stroke: var(--magenta); stroke-width: calc(3px * var(--inv, 1)); stroke-dasharray: calc(10px * var(--inv, 1)) calc(7px * var(--inv, 1)); stroke-linejoin: round; stroke-linecap: round; }
.cut.lasso img, .cut.plain img { object-fit: fill; }

/* straight-line cut: dashed edges, a live line to the pointer, a dot on every corner */
.lasso-next { fill: none; stroke: var(--magenta); stroke-width: calc(2px * var(--inv, 1)); stroke-dasharray: calc(6px * var(--inv, 1)) calc(6px * var(--inv, 1)); opacity: .8; }
.lasso-layer.poly .lasso-path { fill: rgba(232,213,225,.18); }
.lasso-dots circle { fill: #fff; stroke: var(--magenta); stroke-width: calc(2px * var(--inv, 1)); }
.lasso-dots circle.first { fill: var(--blush); }
.lasso-layer.can-close { cursor: pointer; }
.lasso-layer.can-close .lasso-dots circle.first { fill: var(--magenta); }

/* the tools sit like a sheet laid over the bottom of the page: no strip of background above them */
.tool-area { padding-top: 0; }
.tool-area::before { content: ""; position: absolute; left: 0; right: 0; top: -14px; height: 14px; pointer-events: none;
  background: linear-gradient(to top, rgba(43,43,43,.10), rgba(43,43,43,0)); }

/* one piece of paper for the options bar: no repeating texture, so no seams */
.tool-opts { background: url("../assets/paper.jpg") center / cover no-repeat, var(--cream); background-blend-mode: multiply; }

/* the date on a diary page: bigger cut-out digits and weekday */
.page-date { left: 30px; top: 26px; gap: 22px; }
.page-date .digits img { height: 145px; }
.page-date .wd-art { height: 88px; }
.dear { top: 215px; }

/* diary header: month and year 20% bigger */
.dh-month .dh-art img { height: 48px; }
.dh-month .ransom-art.digits.s { --rh: 36px; }
@media (max-width: 700px) { .dh-month .dh-art img { height: 36px; } .dh-month .ransom-art.digits.s { --rh: 29px; } }
@media (max-width: 520px) { .dh-month .dh-art img { height: 34px; } }

/* month grid: the day's photos and stickers as cut-outs that spill over the square */
.day { overflow: visible; }
.day:has(.day-cut) { z-index: 2; }
.day:hover:has(.day-cut) { z-index: 3; }
.day-cut {
  position: absolute; z-index: 1; pointer-events: none;
  width: min(80%, calc(var(--ar, 1) * 96px));
  aspect-ratio: var(--ar, 1);
  right: -16%; bottom: -24%;
  transform: rotate(var(--tilt, -3deg));
  filter: drop-shadow(0 4px 5px rgba(43,43,43,.28));
  transition: transform .18s var(--ease-over);
}
.day-cut.c1 { width: min(58%, calc(var(--ar, 1) * 70px)); right: auto; left: -12%; bottom: -14%; z-index: 0; }
.day-cut .mini { width: 100%; height: 100%; overflow: visible; }
.day:hover .day-cut { transform: rotate(var(--tilt, -3deg)) translateY(-3px) scale(1.04); }
.day .note { position: relative; z-index: 2; }
@media (max-width: 700px) {
  .day-cut { width: min(86%, calc(var(--ar, 1) * 60px)); right: -14%; bottom: -20%; }
  .day-cut.c1 { width: min(60%, calc(var(--ar, 1) * 44px)); }
}

/* password field with a Show / Hide button */
.pw-wrap { position: relative; }
.pw-wrap input { width: 100%; padding-right: 64px; }
.pw-show { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); padding: 6px 8px; font-size: 10px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--graphite); }
.pw-show:hover { color: var(--magenta); }

/* onboarding: a cream torn scrap (design system artwork) per card; Montserrat + Forward Serif only */
.onboard-card {
  width: min(440px, 92vw); padding: 10px 14px 0;
  background: none; box-shadow: none; transform: none;
  border-style: solid; border-width: 22px 16px 46px 16px;
  border-image: url("../assets/ds/scrap.png") 70 50 150 50 fill stretch;
  filter: drop-shadow(0 10px 14px rgba(43,43,43,.22));
  gap: 14px;
  animation: card-in .4s var(--ease-over) both;
}
@keyframes card-in { from { opacity: 0; transform: translateY(16px); } }
.onboard-title {
  margin: 0; display: inline-block; padding: .45em 1em .4em;
  font-family: var(--f-body); font-weight: 800; font-size: 15px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink);
  background: url("../assets/paper.jpg") center / 520px auto, var(--lilac); background-blend-mode: multiply;
  clip-path: polygon(1% 7%, 99% 0, 100% 93%, 2% 100%);
}
.onboard-card p { font-family: var(--f-body); font-weight: 500; font-size: 14px; line-height: 1.6; color: #4A4545; max-width: 340px; }
.onboard-art { height: 150px; }
.welcome .dots i { width: 7px; height: 7px; }

.ob-date { display: flex; align-items: center; gap: 4px; }
.ob-date img { height: 66px; width: auto; }
.ob-date img:nth-child(1) { transform: rotate(-4deg); }
.ob-date img:nth-child(2) { transform: rotate(3deg); }
.ob-date img.wd { height: 38px; margin-left: 10px; transform: rotate(1.5deg); }

.ob-diary { position: relative; width: 300px; height: 140px; }
.ob-photo { position: absolute; left: 6px; top: 14px; width: 150px; height: 112px; background: url("../assets/ds/roses.jpg") 40% 30% / cover; transform: rotate(-4deg); box-shadow: 0 6px 12px -6px rgba(43,43,43,.45); }
.ob-tape { position: absolute; left: 44px; top: 2px; width: 84px; height: 26px; transform: rotate(-8deg); border-style: solid; border-width: 0 10px; border-image: url("../assets/ds/tape.png") 0 26 fill / 0 10px / 0 stretch; }
.ob-words { position: absolute; left: 170px; top: 40px; font-family: var(--f-words); font-size: 20px; line-height: 1.35; color: var(--ink); text-align: left; transform: rotate(-2deg); }

.ob-cuts { display: flex; align-items: center; gap: 18px; }
.ob-cut { display: block; width: 92px; height: 92px; background: url("../assets/ds/roses.jpg") 40% 30% / 260px auto; filter: drop-shadow(0 4px 5px rgba(43,43,43,.3)); }
.ob-cut.circle { border-radius: 50%; transform: rotate(-3deg); }
.ob-cut.torn { width: 104px; height: 84px; transform: rotate(3deg); clip-path: polygon(0 3%,6% 0,14% 2%,22% 0,31% 3%,40% 1%,49% 3%,58% 0,67% 2%,76% 0,85% 3%,93% 1%,100% 4%,98% 14%,100% 26%,98% 38%,100% 50%,98% 62%,100% 74%,98% 86%,100% 97%,92% 100%,83% 97%,74% 100%,65% 98%,56% 100%,47% 97%,38% 100%,29% 98%,20% 100%,11% 97%,3% 100%,0 96%,2% 84%,0 72%,2% 60%,0 48%,2% 36%,0 24%,2% 12%); }
.ob-cut.poly { transform: rotate(-2deg); clip-path: polygon(8% 18%, 62% 0, 100% 34%, 84% 96%, 22% 100%, 0 58%); }

.ob-year { display: flex; gap: 12px; align-items: center; padding: 18px 22px; background: url("../assets/ds/roses-soft.jpg") center / cover; box-shadow: 0 6px 12px -6px rgba(43,43,43,.45); }
.ob-year img { width: 74px; height: 74px; border-radius: 50%; }
.ob-year img:nth-child(2) { transform: translateY(-4px) rotate(-4deg); filter: drop-shadow(0 8px 6px rgba(0,0,0,.45)); }

@media (max-width: 420px) {
  .ob-diary { transform: scale(.85); }
  .ob-cut { width: 76px; height: 76px; } .ob-cut.torn { width: 86px; height: 70px; }
}

/* month view: day cut-outs stay mostly inside their square, peeking just over the edge */
.day-cut { width: min(66%, calc(var(--ar, 1) * 74px)); right: -5%; bottom: -8%; }
.day-cut.c1 { width: min(46%, calc(var(--ar, 1) * 54px)); left: 4%; bottom: -5%; }
@media (max-width: 700px) {
  .day-cut { width: min(72%, calc(var(--ar, 1) * 46px)); right: -6%; bottom: -8%; }
  .day-cut.c1 { width: min(50%, calc(var(--ar, 1) * 34px)); left: 2%; }
}

/* the menu tab tucks halfway up once the page is scrolled, so it doesn't sit on the page's controls */
.menu-handle { transition: transform .25s var(--ease-over), filter .2s; }
body.scrolled .menu-handle { transform: translateY(-62px); }
body.scrolled .menu-handle:hover, body.scrolled .menu-handle:focus-visible { transform: translateY(0); }


/* onboarding: < Skip > like the year and month arrows; the hidden arrow keeps its space */
.ob-nav { display: flex; align-items: center; justify-content: center; gap: 28px; }
.ob-nav .arrow[hidden] { display: flex; visibility: hidden; }

/* tape buttons: a strip of the tape colour under the joins between the torn ends and the middle,
   so no pale seam shows through (the torn edges themselves stay transparent) */
.washi, .dock-btn.on, .menu-item.sel::before {
  background: linear-gradient(rgb(150,66,94), rgb(150,66,94)) center / calc(100% - 10px) calc(100% - 4px) no-repeat border-box;
}

/* sign in / sign up: the animated title video (the title with stars bursting out around it,
   cropped from the original 2420 x 3424 frame to 1280 x 620); multiply lets its white melt into the paper */
.welcome-anim { display: block; width: min(640px, 96vw); aspect-ratio: 1280 / 620; margin: -10px 0 0; }
.welcome-anim video { display: block; width: 100%; height: 100%; mix-blend-mode: multiply; pointer-events: none; }
