:root {
  --ink: #f1f1ee;
  --mute: #8d8e91;
  --line: rgba(255,255,255,.09);
  --panel: #161618;
  --accent: #e9e3d6;
  --serif: "Instrument Serif", Georgia, serif;
  --mono: "DM Mono", ui-monospace, monospace;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  background: #0c0c0d;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input, textarea { font: inherit; color: inherit; }

/* ---------- metal surfaces (board + auth background) ---------- */
.metal, .board {
  --streak: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='700' height='700'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.0025 0.85' numOctaves='2' seed='7'/%3E%3CfeColorMatrix values='1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 .5'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.board {
  position: absolute; left: 0; top: 0;
  width: 900px; height: 1200px;
  transform-origin: 0 0;
  border-radius: 26px;
  overflow: hidden;
  touch-action: none;
  user-select: none; -webkit-user-select: none;
  box-shadow: 0 30px 80px rgba(0,0,0,.6), inset 0 0 0 1px rgba(255,255,255,.18), inset 0 2px 0 rgba(255,255,255,.25);
}
.board::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: var(--streak);
  background-size: 700px 700px;
  mix-blend-mode: overlay;
  opacity: .9;
}
.board-sheen {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(98deg, transparent 52%, rgba(255,255,255,.35) 60%, rgba(255,255,255,.05) 66%, transparent 72%),
    linear-gradient(180deg, rgba(255,255,255,.10), transparent 30%, transparent 70%, rgba(0,0,0,.28));
}
.bg-silver   { background: linear-gradient(90deg, #36383b 0%, #5f6266 16%, #9a9da1 36%, #dfe0e2 56%, #f4f4f5 61%, #b4b7ba 72%, #74777b 88%, #3f4144 100%); }
.bg-gunmetal { background: linear-gradient(90deg, #18191b 0%, #2c2e31 22%, #4c4f53 48%, #7a7d81 60%, #4a4d51 74%, #232427 100%); }
.bg-pearl    { background: linear-gradient(90deg, #9e9a94 0%, #c9c5bf 22%, #ebe8e3 50%, #faf8f5 60%, #d8d4ce 76%, #a8a49e 100%); }
.bg-rose     { background: linear-gradient(90deg, #6d5560 0%, #a4858f 22%, #d8bcc4 48%, #f3e1e6 60%, #c9a4af 76%, #7a5c67 100%); }

/* ---------- auth ---------- */
.auth {
  position: fixed; inset: 0;
  display: grid; place-items: center;
  padding: 24px;
  background: radial-gradient(1200px 700px at 70% 20%, #2a2b2e, #0c0c0d 70%);
}
.auth-card {
  position: relative;
  width: min(380px, 100%);
  padding: 40px 28px 28px;
  border-radius: 24px;
  background: linear-gradient(90deg, #5f6266, #a6a9ad 30%, #e9eaeb 58%, #b0b3b6 75%, #6c6f73);
  box-shadow: 0 40px 90px rgba(0,0,0,.7), inset 0 1px 0 rgba(255,255,255,.6);
  color: #18191b;
  overflow: hidden;
}
.auth-card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='500' height='500'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.003 0.9' numOctaves='2'/%3E%3CfeColorMatrix values='1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 .5'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}
.auth-card > * { position: relative; }
.auth-magnet {
  position: absolute; top: 14px; left: 50%; margin-left: -15px;
  width: 30px; height: 30px; border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #fff 0 8%, #ececec 16%, #b5b8bb 40%, #7d8084 64%, #d3d5d7 84%, #8b8e92 100%);
  box-shadow: 0 6px 8px rgba(0,0,0,.4);
}
.brand { font-family: var(--serif); font-weight: 400; font-size: 46px; margin: 10px 0 0; text-align: center; letter-spacing: -.5px; }
.brand em { font-style: italic; }
.auth-sub { text-align: center; margin: 4px 0 22px; font-size: 12px; color: #3a3b3e; }
.tabs { display: flex; background: rgba(0,0,0,.12); border-radius: 999px; padding: 4px; margin-bottom: 18px; }
.tabs button { flex: 1; padding: 9px 0; border-radius: 999px; font-size: 12px; color: #2b2c2f; }
.tabs button.on { background: #141416; color: #f3f3f1; }
.f { display: block; margin-bottom: 12px; }
.f span { display: block; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: #333437; margin-bottom: 5px; }
.f input {
  width: 100%; padding: 12px 14px; border-radius: 12px;
  border: 1px solid rgba(0,0,0,.15);
  background: rgba(255,255,255,.75);
  color: #141416; font-size: 15px; outline: none;
}
.f input:focus { border-color: #141416; background: #fff; }
.auth-err { min-height: 18px; margin: 2px 0 8px; color: #8a1f2d; font-size: 12px; }
.btn-primary {
  width: 100%; padding: 13px 0; border-radius: 999px;
  background: #141416; color: #f3f3f1; font-size: 14px; letter-spacing: .02em;
  box-shadow: 0 8px 18px rgba(0,0,0,.3);
}
.btn-primary:disabled { opacity: .5; }
.btn-primary.small { width: auto; padding: 11px 22px; background: var(--accent); color: #141416; }

/* ---------- app layout ---------- */
.app { position: fixed; inset: 0; display: flex; flex-direction: column; }
.top {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px;
  padding: calc(10px + var(--safe-t)) 18px 8px;
}
.title {
  justify-self: start; font-family: var(--serif); font-size: 24px; font-style: italic;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
  text-align: left;
}
.datenav { display: flex; align-items: center; gap: 4px; }
.datenav .icon { width: 34px; height: 34px; border-radius: 50%; font-size: 22px; line-height: 1; color: var(--mute); }
.datenav .icon:hover { color: var(--ink); background: rgba(255,255,255,.06); }
.date { display: flex; align-items: baseline; gap: 8px; padding: 4px 10px; border-radius: 10px; }
.date:hover { background: rgba(255,255,255,.06); }
#dateMain { font-family: var(--serif); font-size: 22px; }
#dateYear { color: var(--mute); font-size: 11px; }
.top-right { justify-self: end; display: flex; align-items: center; gap: 8px; }
.status { display: flex; align-items: center; gap: 6px; color: var(--mute); font-size: 11px; margin-right: 4px; }
.status i { width: 6px; height: 6px; border-radius: 50%; background: #7fd39a; }
.status.saving i { background: #e7c66b; }
.status.error i { background: #e86a6a; }
.chip {
  padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: rgba(255,255,255,.04); font-size: 12px; white-space: nowrap;
}
.chip:hover { background: rgba(255,255,255,.09); }
.chip.round { padding: 7px 10px; letter-spacing: 1px; }

.stage { position: relative; flex: 1; min-height: 0; display: grid; place-items: center; }
.board-wrap { position: relative; }

.empty {
  position: absolute; left: 0; right: 0; top: 46%;
  text-align: center; pointer-events: none;
  color: rgba(20,20,22,.42);
  text-shadow: 0 1px 0 rgba(255,255,255,.35);
}
.empty p { font-family: var(--serif); font-style: italic; font-size: 54px; margin: 0; }
.empty span { font-size: 18px; letter-spacing: .08em; text-transform: uppercase; }
.bg-gunmetal .empty { color: rgba(255,255,255,.35); text-shadow: none; }

/* ---------- dock ---------- */
.dock { display: flex; justify-content: center; padding: 8px 12px calc(12px + var(--safe-b)); }
.bar {
  display: flex; gap: 4px; padding: 6px;
  border-radius: 999px; background: rgba(28,28,31,.92);
  border: 1px solid var(--line);
  box-shadow: 0 12px 30px rgba(0,0,0,.5);
  max-width: 100%; overflow-x: auto; scrollbar-width: none;
}
.bar::-webkit-scrollbar { display: none; }
.bar button {
  display: flex; align-items: center; gap: 7px;
  padding: 10px 16px; border-radius: 999px; white-space: nowrap; font-size: 12.5px;
}
.bar button b { font-weight: 400; font-size: 15px; opacity: .85; }
.bar button:hover { background: rgba(255,255,255,.08); }
.bar button.on { background: var(--accent); color: #141416; }
.bar button.danger { color: #ff8f8f; }
.bar .sep { width: 1px; background: var(--line); margin: 6px 2px; flex: none; }

/* ---------- items ---------- */
.item {
  position: absolute;
  transform-origin: 50% 50%;
  cursor: grab;
  touch-action: none;
}
.item:active { cursor: grabbing; }
.item .body { position: relative; }
.item.sel::after {
  content: ""; position: absolute; pointer-events: none;
  inset: calc(-8px * var(--inv, 1));
  border: calc(1.6px * var(--inv, 1)) dashed rgba(255,255,255,.95);
  border-radius: calc(6px * var(--inv, 1));
  box-shadow: 0 0 0 calc(1px * var(--inv, 1)) rgba(0,0,0,.35);
}
.handle {
  display: none;
  position: absolute; z-index: 3;
  right: calc(-22px * var(--inv, 1)); bottom: calc(-22px * var(--inv, 1));
  width: calc(32px * var(--inv, 1)); height: calc(32px * var(--inv, 1));
  border-radius: 50%; background: #fff; color: #141416;
  box-shadow: 0 2px 8px rgba(0,0,0,.45);
  place-items: center;
  font-size: calc(17px * var(--inv, 1)); line-height: 1;
  cursor: nwse-resize;
}
.item.sel .handle { display: grid; }
.item img { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; -webkit-user-drag: none; }

/* pins */
.pin { position: absolute; z-index: 2; pointer-events: none; }
.pin.magnet {
  top: -14px; width: 36px; height: 36px; margin-left: -18px; border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #fff 0 7%, #efefef 15%, #b9bcbf 38%, #7e8185 62%, #d6d8da 82%, #8a8d91 100%);
  box-shadow: 0 7px 9px rgba(0,0,0,.42), 0 1px 2px rgba(0,0,0,.5), inset 0 -2px 3px rgba(0,0,0,.25);
}
.pin.tape {
  top: -16px; width: 104px; height: 30px;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.08) 0 3px, transparent 3px 7px),
    linear-gradient(180deg, rgba(236,233,224,.82), rgba(214,210,198,.78));
  clip-path: polygon(3% 8%, 9% 0, 15% 9%, 22% 1%, 30% 7%, 70% 3%, 78% 9%, 86% 0, 93% 8%, 100% 2%, 97% 50%, 100% 98%, 92% 91%, 85% 100%, 77% 92%, 68% 99%, 30% 94%, 21% 100%, 13% 92%, 6% 100%, 0 94%, 3% 50%);
  box-shadow: 0 1px 2px rgba(0,0,0,.2);
  opacity: .92;
}

/* photos */
.ph { position: relative; box-shadow: 0 1px 1px rgba(0,0,0,.3), 0 10px 22px rgba(0,0,0,.38); }
.ph .ph-img { overflow: hidden; background: #b8b8b8; }
.ph.polaroid { background: #fbfaf6; padding: .62em .62em 0; }
.ph.polaroid .ph-img { aspect-ratio: 1 / 1.08; }
.ph.polaroid .cap {
  min-height: 3.2em; padding: .35em .2em .5em;
  font-family: "Reenie Beanie", cursive; font-size: 1.75em; line-height: .95;
  color: #1c1c1f; text-align: center; white-space: pre-wrap; word-break: break-word;
}
.ph.polaroid .cap:empty { min-height: 2.6em; }
.ph.print { background: #fff; padding: .4em; }
.ph.bare { padding: 0; }
.ph.bw img { filter: grayscale(1) contrast(1.08) brightness(1.03); }
.ph.egg {
  aspect-ratio: 1 / 1.14;
  padding: 13% 15% 0;
  border-radius: 50% 50% 47% 47% / 56% 56% 44% 44%;
  background:
    radial-gradient(60% 40% at 32% 22%, rgba(255,255,255,.75), transparent 60%),
    linear-gradient(150deg, #f5dce7, #c995ad 45%, #e9c3d3 65%, #9b6680);
  box-shadow: inset 0 -.5em 1em rgba(0,0,0,.22), inset 0 .3em .6em rgba(255,255,255,.6), 0 12px 24px rgba(0,0,0,.4);
}
.ph.egg .ph-img {
  aspect-ratio: 1; border-radius: 10%;
  border: .55em solid #2d2a2c;
  box-shadow: 0 0 0 .22em #e8c5d4, inset 0 0 .6em rgba(0,0,0,.4);
}
.ph.egg .egg-btns { display: flex; justify-content: center; gap: 14%; margin-top: 9%; }
.ph.egg .egg-btns i {
  width: 12%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #6b5560, #241c20);
  box-shadow: 0 2px 2px rgba(0,0,0,.35), inset 0 1px 1px rgba(255,255,255,.25);
}
.ph.egg .egg-btns i:nth-child(2) { transform: translateY(35%); }

/* papers (notes) */
.paper {
  position: relative; color: #1c1c1f;
  box-shadow: 0 1px 1px rgba(0,0,0,.25), 0 9px 20px rgba(0,0,0,.33);
}
.paper .txt { white-space: pre-wrap; word-break: break-word; }
.paper .ph-hint { opacity: .38; }

.gc { background: #f7d6db; }
.gc-top { display: flex; justify-content: space-between; align-items: baseline; padding: .45em .6em .25em; background: #fbf6f1; }
.gc-top b { font-family: "Oswald", sans-serif; font-weight: 700; font-size: 1.55em; color: #26388f; letter-spacing: -.01em; }
.gc-no { font-family: "Oswald", sans-serif; color: #d14a4f; font-size: .95em; letter-spacing: .1em; }
.gc-cols { display: grid; grid-template-columns: repeat(4,1fr); background: #fbf6f1; border-top: 1px solid #9aa6d4; border-bottom: 2px solid #9aa6d4; }
.gc-cols span { font-family: "Oswald", sans-serif; font-size: .5em; text-transform: uppercase; color: #4b5aa0; padding: .3em .5em; border-right: 1px solid #9aa6d4; }
.gc .txt {
  font-family: "Gochi Hand", cursive; font-size: 1.45em; line-height: 1.55em;
  padding: .15em .45em .4em 1.2em; min-height: 6.2em;
  background-image: repeating-linear-gradient(transparent 0 calc(1.55em - 1px), #9aa6d4 calc(1.55em - 1px) 1.55em);
  background-position: 0 .15em;
}
.gc-foot { display: flex; justify-content: space-between; padding: .3em .6em .45em; font-family: "Oswald", sans-serif; font-size: .55em; text-transform: uppercase; color: #4b5aa0; border-top: 2px dashed #9aa6d4; background: #fbf6f1; }

.pc {
  background: #efe6d4;
  background-image: radial-gradient(circle at 20% 30%, rgba(160,130,90,.10), transparent 50%), radial-gradient(circle at 80% 80%, rgba(160,130,90,.12), transparent 45%);
  padding: .8em 1em 1em;
}
.pc-head { font-family: var(--mono); font-size: .62em; letter-spacing: .5em; color: #6b5d47; margin-bottom: .7em; }
.pc-stamp { position: absolute; top: .8em; right: .9em; width: 3.2em; height: 3.8em; border: 2px dashed #a8987d; }
.pc .txt {
  font-family: "Caveat", cursive; font-weight: 500; font-size: 1.7em; line-height: 1.32em; color: #25336e;
  padding-right: 2.2em; min-height: 5.3em;
  background-image: repeating-linear-gradient(transparent 0 calc(1.32em - 1px), rgba(107,93,71,.4) calc(1.32em - 1px) 1.32em);
}

.ln {
  background: #fdfdfb;
  padding: 1.4em .8em 1em 2.4em;
  background-image:
    linear-gradient(90deg, transparent 1.9em, #e7a2a2 1.9em, #e7a2a2 calc(1.9em + 2px), transparent 0),
    repeating-linear-gradient(transparent 0 calc(1.7em - 1px), #b7cbe6 calc(1.7em - 1px) 1.7em);
  background-position: 0 0, 0 .9em;
}
.ln .txt { font-family: "Kalam", cursive; font-size: 1.12em; line-height: 1.52em; min-height: 7.5em; color: #22284a; }

.rc {
  background: #fbfbf7; padding: 1em .9em 1.6em;
  font-family: "VT323", monospace; color: #2a2a2a; text-align: center;
  --zz: .7em;
  -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / calc(var(--zz) * 2) 100%;
          mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / calc(var(--zz) * 2) 100%;
  box-shadow: none;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,.32));
}
.rc-h { font-size: 1.35em; letter-spacing: .04em; }
.rc-h2 { font-size: 1.05em; color: #555; }
.rc-sep { border-top: 2px dashed #8a8a8a; margin: .55em 0; }
.rc .txt { font-size: 1.4em; line-height: 1.05; text-align: left; min-height: 4em; text-transform: uppercase; }
.rc-f { font-size: 1.05em; letter-spacing: .06em; }
.rc-bar { height: 2.2em; margin: .6em auto 0; width: 80%; background: repeating-linear-gradient(90deg, #222 0 2px, transparent 2px 4px, #222 4px 5px, transparent 5px 8px, #222 8px 11px, transparent 11px 12px); }

.tk {
  background: #e3ecd2; padding: .7em 1.5em .7em;
  font-family: "Special Elite", monospace; color: #2c3326;
  -webkit-mask: radial-gradient(circle .9em at left center, #0000 98%, #000) left / 51% 100% no-repeat, radial-gradient(circle .9em at right center, #0000 98%, #000) right / 51% 100% no-repeat;
          mask: radial-gradient(circle .9em at left center, #0000 98%, #000) left / 51% 100% no-repeat, radial-gradient(circle .9em at right center, #0000 98%, #000) right / 51% 100% no-repeat;
  box-shadow: none;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,.3));
}
.tk::before { content: ""; position: absolute; inset: .35em .8em; border: 1.5px solid rgba(44,51,38,.35); pointer-events: none; }
.tk-top, .tk-bot { display: flex; justify-content: space-between; font-size: .78em; letter-spacing: .12em; }
.tk-top span:first-child { font-size: 1.25em; }
.tk .txt { font-size: 1.12em; line-height: 1.35; text-transform: uppercase; padding: .5em 0; min-height: 3.4em; }

.st {
  background: linear-gradient(170deg, #fbe98a, #f3d85f);
  padding: 1em .9em 1.2em; aspect-ratio: 1 / 1;
  box-shadow: 0 1px 1px rgba(0,0,0,.2), 0 14px 18px -8px rgba(0,0,0,.45);
}
.st .txt { font-family: "Caveat", cursive; font-weight: 700; font-size: 1.85em; line-height: 1.05; color: #2c2a22; }

.ty {
  background: #f4f2ec; padding: 1.1em 1.1em 1.6em;
  clip-path: polygon(0 0, 100% 0, 100% 94%, 96% 97%, 91% 94%, 85% 98%, 78% 95%, 71% 99%, 64% 95%, 57% 98%, 49% 94%, 41% 99%, 34% 95%, 27% 98%, 19% 94%, 12% 99%, 6% 95%, 0 98%);
  box-shadow: none;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,.3));
}
.ty .txt { font-family: "Special Elite", monospace; font-size: 1.02em; line-height: 1.5; color: #222; min-height: 6em; }

.lb {
  background: linear-gradient(180deg, #2a2a2d, #0f0f11 55%, #1b1b1e);
  border-radius: .18em; padding: .38em .7em .32em;
  box-shadow: 0 1px 0 rgba(255,255,255,.15) inset, 0 6px 10px rgba(0,0,0,.4);
}
.lb .txt {
  font-family: "Rubik Mono One", monospace; font-size: 1.1em; color: #f4f4f4; letter-spacing: .14em;
  text-transform: uppercase; white-space: nowrap;
  text-shadow: 0 -1px 0 rgba(0,0,0,.6), 0 1px 0 rgba(255,255,255,.25);
}
.t-label { width: max-content !important; }

/* stickers */
.stk { width: 100%; }
.stk svg { display: block; width: 100%; height: auto; overflow: visible; filter: drop-shadow(0 6px 7px rgba(0,0,0,.4)); }
.badge {
  width: 100%; aspect-ratio: 1; border-radius: 50%;
  display: grid; place-items: center; text-align: center;
  padding: 16%;
  font-family: "Oswald", sans-serif; font-weight: 700; text-transform: lowercase;
  font-size: 1.15em; line-height: .95; letter-spacing: -.01em;
  box-shadow: 0 8px 12px rgba(0,0,0,.4), inset 0 0 0 .3em rgba(255,255,255,.5), inset 0 -.4em .8em rgba(0,0,0,.18), inset 0 .3em .5em rgba(255,255,255,.8);
  word-break: break-word;
}
.badge.pink  { background: radial-gradient(circle at 35% 25%, #fff, #ffd1e2 40%, #f49ab9); color: #c3185c; }
.badge.ink   { background: radial-gradient(circle at 35% 25%, #555, #1b1b1e 55%); color: #f2f2f2; }
.badge.cream { background: radial-gradient(circle at 35% 25%, #fff, #f2ead8 50%, #d9ccb0); color: #2c3e8c; }
.badge.mint  { background: radial-gradient(circle at 35% 25%, #fff, #c7f0e3 45%, #7fcdb5); color: #10624f; }
.disc {
  width: 100%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #fff 0 7%, #efefef 15%, #b9bcbf 38%, #7e8185 62%, #d6d8da 82%, #8a8d91 100%);
  box-shadow: 0 7px 9px rgba(0,0,0,.42), inset 0 -2px 3px rgba(0,0,0,.25);
}

/* ---------- sheets ---------- */
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 40; }
.sheet {
  position: fixed; z-index: 50;
  left: 50%; bottom: 0; transform: translateX(-50%);
  width: min(560px, 100%);
  max-height: 82dvh; overflow: auto;
  background: var(--panel); border: 1px solid var(--line); border-bottom: 0;
  border-radius: 24px 24px 0 0;
  padding: 16px 18px calc(18px + var(--safe-b));
  box-shadow: 0 -20px 60px rgba(0,0,0,.6);
  animation: up .22s ease-out;
}
@keyframes up { from { transform: translate(-50%, 30px); opacity: 0; } }
@media (min-width: 700px) {
  .sheet { bottom: auto; top: 50%; transform: translate(-50%, -50%); border-radius: 24px; border-bottom: 1px solid var(--line); animation: pop .2s ease-out; }
  @keyframes pop { from { transform: translate(-50%, -46%); opacity: 0; } }
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.sheet-head h3 { margin: 0; font-family: var(--serif); font-weight: 400; font-style: italic; font-size: 26px; }
.x { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.06); }
.grid { display: grid; gap: 12px; }
.papers { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.stickers { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }
.tile {
  position: relative; border-radius: 16px; overflow: hidden;
  background: linear-gradient(90deg, #5f6266, #a6a9ad 35%, #e2e3e5 60%, #9fa2a6 80%, #66696d);
  height: 150px; display: grid; place-items: center;
  border: 1px solid rgba(255,255,255,.12);
}
.stickers .tile { height: 92px; }
.tile .pv { width: 128px; pointer-events: none; transform: rotate(-2deg); max-height: 120px; overflow: hidden; }
.stickers .tile .pv { width: 58px; max-height: none; overflow: visible; }
.tile .nm {
  position: absolute; left: 8px; bottom: 7px;
  font-size: 10px; letter-spacing: .08em; text-transform: uppercase;
  background: rgba(14,14,16,.82); color: #eee; padding: 3px 7px; border-radius: 999px;
}
.tile:hover { outline: 2px solid var(--accent); }

.edit-paper { border-radius: 16px; overflow: hidden; margin-bottom: 12px; }
.edit-paper textarea {
  display: block; width: 100%; min-height: 180px; resize: vertical;
  border: 0; outline: none; padding: 16px 18px;
  background: #f6f3ec; color: #1c1c1f; font-size: 20px; line-height: 1.5;
}
.edit-paper.f-gc textarea { font-family: "Gochi Hand", cursive; font-size: 24px; background: #f7d6db; }
.edit-paper.f-pc textarea { font-family: "Caveat", cursive; font-size: 28px; color: #25336e; background: #efe6d4; }
.edit-paper.f-ln textarea { font-family: "Kalam", cursive; color: #22284a; background: #fdfdfb; }
.edit-paper.f-rc textarea { font-family: "VT323", monospace; font-size: 26px; text-transform: uppercase; }
.edit-paper.f-tk textarea { font-family: "Special Elite", monospace; text-transform: uppercase; background: #e3ecd2; }
.edit-paper.f-st textarea { font-family: "Caveat", cursive; font-weight: 700; font-size: 30px; background: #f8e47a; }
.edit-paper.f-ty textarea { font-family: "Special Elite", monospace; font-size: 18px; }
.edit-paper.f-lb textarea { font-family: "Rubik Mono One", monospace; text-transform: uppercase; background: #141416; color: #f4f4f4; font-size: 18px; letter-spacing: .12em; min-height: 70px; }
.edit-paper.f-cap textarea { font-family: "Reenie Beanie", cursive; font-size: 34px; line-height: 1; background: #fbfaf6; min-height: 110px; }
.edit-paper.f-badge textarea { font-family: "Oswald", sans-serif; font-weight: 700; font-size: 26px; text-transform: lowercase; min-height: 80px; background: #ffd1e2; color: #c3185c; }
.edit-paper.f-title textarea { font-family: var(--serif); font-style: italic; font-size: 30px; min-height: 70px; }
.edit-row { display: flex; align-items: center; gap: 10px; }
.spacer { flex: 1; }

.days-tools { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.jump { display: flex; align-items: center; gap: 8px; }
.jump input { background: transparent; border: 0; color: var(--ink); color-scheme: dark; font-size: 12px; }
.days-list { display: grid; gap: 8px; }
.day-row {
  display: flex; align-items: center; gap: 14px; text-align: left;
  padding: 8px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.03);
}
.day-row:hover { background: rgba(255,255,255,.07); }
.day-row.cur { border-color: var(--accent); }
.day-thumb { width: 52px; height: 52px; border-radius: 10px; overflow: hidden; flex: none; background: linear-gradient(90deg, #5f6266, #d9dadc 60%, #7d8084); }
.day-thumb img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(.2); }
.day-row b { display: block; font-family: var(--serif); font-weight: 400; font-size: 20px; }
.day-row small { color: var(--mute); }
.days-empty { color: var(--mute); padding: 20px 4px; }

.who { color: var(--mute); margin: -4px 0 14px; }
.menu-list { display: grid; gap: 8px; }
.menu-list button { text-align: left; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.03); }
.menu-list button:hover { background: rgba(255,255,255,.07); }
.menu-list .danger { color: #ff8f8f; }
.menu-list .danger.armed { background: #5c1d22; color: #fff; }

.toast {
  position: fixed; z-index: 60; left: 50%; transform: translateX(-50%);
  bottom: calc(92px + var(--safe-b));
  display: flex; align-items: center; gap: 14px;
  padding: 11px 16px; border-radius: 999px;
  background: #f1efe9; color: #141416; font-size: 12.5px;
  box-shadow: 0 12px 30px rgba(0,0,0,.5);
  max-width: calc(100% - 32px);
}
.toast button { font-weight: 500; text-decoration: underline; }

/* ---------- small screens ---------- */
@media (max-width: 640px) {
  .top { grid-template-columns: 1fr auto; grid-template-areas: "title right" "date date"; row-gap: 4px; padding-left: 14px; padding-right: 12px; }
  .title { grid-area: title; font-size: 21px; }
  .top-right { grid-area: right; }
  .datenav { grid-area: date; justify-self: center; }
  .status span { display: none; }
  #dateMain { font-size: 20px; }
  .bar button { padding: 10px 12px; }
}

/* ---------- vintage photobooth strip ---------- */
.booth {
  position: relative;
  padding: .55em .55em 0;
  background:
    radial-gradient(120% 60% at 50% 0%, transparent 60%, rgba(150,120,70,.16)),
    linear-gradient(180deg, #f5f1e6, #ece5d3);
  box-shadow: 0 1px 1px rgba(0,0,0,.3), 0 12px 22px rgba(0,0,0,.4), inset 0 0 1.2em rgba(140,110,60,.18);
  border-radius: 2px;
}
.booth-shots { display: grid; gap: .45em; }
.bf {
  position: relative; overflow: hidden;
  aspect-ratio: 4 / 3.5;
  background: #222;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.25);
}
.bf::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  background-size: 160px;
  mix-blend-mode: overlay;
  box-shadow: inset 0 0 1.4em rgba(0,0,0,.55);
}
.booth.tone-bw .bf img    { filter: grayscale(1) contrast(1.22) brightness(1.06); }
.booth.tone-sepia .bf img { filter: grayscale(1) sepia(.65) contrast(1.12) brightness(1.04) saturate(.9); }
.booth.tone-faded .bf img { filter: saturate(.6) contrast(.92) brightness(1.08) sepia(.25) hue-rotate(-6deg); }
.booth-foot {
  display: flex; justify-content: space-between; align-items: center;
  padding: .55em .25em .7em;
  font-family: var(--mono); font-size: .6em; letter-spacing: .25em; color: #7a705e;
}
.booth-foot span:first-child, .booth-foot span:last-child { letter-spacing: 0; font-size: .9em; }

/* ---------- add sheet ---------- */
.sheet.wide { width: min(720px, 100%); }
.sec {
  margin: 18px 0 10px; font-weight: 500; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent);
  display: flex; align-items: baseline; gap: 10px;
}
.sec:first-of-type { margin-top: 4px; }
.sec span { text-transform: none; letter-spacing: 0; color: var(--mute); font-size: 11.5px; }
.frames { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.frames .tile { height: 172px; }
.frames .tile .pv { max-height: none; overflow: visible; transform: rotate(-3deg) translateY(-8px); }
.frames .frame-booth .pv { transform: rotate(2deg) translateY(-6px) scale(.92); }
.bar button.add { background: var(--accent); color: #141416; padding-left: 20px; padding-right: 22px; }
.bar button.add:hover { background: #fff; }

/* ---------- gadget frames ---------- */
.fr { position: relative; width: 100%; }
.fr > svg { display: block; width: 100%; height: 100%; position: absolute; inset: 0; filter: drop-shadow(0 8px 12px rgba(0,0,0,.38)); overflow: visible; }
.fr .scr { position: absolute; overflow: hidden; background: #151517; }
.fr .scr img { width: 100%; height: 100%; object-fit: cover; }
.fr.bw .scr img { filter: grayscale(1) contrast(1.08); }
.fr .over { position: absolute; inset: 0; pointer-events: none; }
.fr .over svg { width: 100%; height: 100%; display: block; overflow: visible; }
.fr-text { position: absolute; color: #2a3c8f; white-space: nowrap; overflow: hidden; max-width: 42%; }

/* ---------- clip cards ---------- */
.cc { position: relative; width: 100%; }
.cc > svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 8px 12px rgba(0,0,0,.32)); }
.cc-txt {
  position: absolute; overflow: hidden; display: flex; align-items: center; justify-content: center; text-align: center;
  font-family: "Caveat", cursive; font-weight: 500; font-size: 1.7em; line-height: 1.08; color: #2b2b30;
  white-space: pre-wrap; word-break: break-word;
}
.cc-cc-ring { justify-content: flex-start; align-items: flex-start; text-align: left; font-family: "Kalam", cursive; font-size: 1.15em;
  background-image: repeating-linear-gradient(transparent 0 calc(1.45em - 1px), rgba(122,150,200,.45) calc(1.45em - 1px) 1.45em); line-height: 1.45em; }
.cc-cc-popup { font-family: "Silkscreen", monospace; font-size: 1.05em; color: #b33c6c; }
.cc-cc-nowplaying { font-family: "DM Mono", monospace; font-size: .8em; color: #fff; letter-spacing: .06em; justify-content: flex-start; text-transform: lowercase; }
.cc-cc-oval, .cc-cc-pink { font-family: "Homemade Apple", cursive; font-size: .95em; line-height: 1.5; }
.cc-cc-dash { font-family: "Shadows Into Light", cursive; font-size: 1.6em; }
.ff { font-size: inherit; }

/* ---------- word art ---------- */
.wt { text-align: center; line-height: 1.02; white-space: pre-wrap; word-break: break-word; }
.wt.fx-sticker span { -webkit-text-stroke: .17em #fff; paint-order: stroke fill; filter: drop-shadow(0 .05em .07em rgba(0,0,0,.35)); }
.wt.fx-plain span { filter: drop-shadow(0 1px 0 rgba(255,255,255,.35)); }
.wt.fx-outline span { color: transparent; -webkit-text-stroke: .035em var(--ink); }
.wt.fx-chrome span {
  background: linear-gradient(180deg, #ffffff 0%, #d4d6da 30%, #5f636a 52%, #eef0f2 68%, #8d9197 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 1px 0 #2e3034) drop-shadow(0 .05em .07em rgba(0,0,0,.4));
  padding: 0 .06em;
}
.wt.fx-label span {
  display: inline; background: #fbfaf6; padding: .08em .35em; box-decoration-break: clone; -webkit-box-decoration-break: clone;
  box-shadow: 0 .05em .12em rgba(0,0,0,.3); font-size: .55em; line-height: 1.9;
}

/* ---------- add library ---------- */
.addtabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: -2px -18px 10px; padding: 0 18px 4px; position: sticky; top: -16px; z-index: 2; background: var(--panel); padding-top: 6px; }
.addtabs::-webkit-scrollbar { display: none; }
.addtabs button { flex: none; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); font-size: 12px; white-space: nowrap; }
.addtabs button.on { background: var(--accent); color: #141416; border-color: transparent; }
.addhint { margin: 0 0 12px; color: var(--mute); font-size: 11.5px; }
.g-photos { grid-template-columns: repeat(auto-fill, minmax(126px, 1fr)); }
.g-photos .tile { height: 176px; }
.g-photos .tile .pv { max-height: none; overflow: visible; transform: rotate(-3deg) translateY(-10px); }
.g-write { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.g-write .tile { height: 158px; }
.g-write .tile .pv { max-height: 128px; }
.g-write .tile.is-label .pv { width: auto !important; }
.g-words { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.g-words .tile { height: 110px; }
.g-words .tile .pv { max-height: none; overflow: visible; }
.g-stk { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
.g-stk .tile { height: 88px; }
.g-stk .tile .pv { max-height: none; overflow: visible; transform: none; }
.stk svg { overflow: visible; }

/* editor fonts + ink */
.fontrow, .inkrow { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin-bottom: 10px; padding-bottom: 2px; }
.fontrow::-webkit-scrollbar, .inkrow::-webkit-scrollbar { display: none; }
.fontrow button { flex: none; padding: 7px 12px; border-radius: 12px; border: 1px solid var(--line); font-size: 15px; white-space: nowrap; background: rgba(255,255,255,.04); }
.fontrow button.on { background: var(--accent); color: #141416; }
.inkrow button { flex: none; width: 30px; height: 30px; border-radius: 50%; border: 2px solid rgba(255,255,255,.2); font-size: 9px; color: var(--mute); }
.inkrow button.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--accent); }
.edit-paper.f-card textarea { font-family: "Caveat", cursive; font-size: 26px; background: #f8f3e8; }
.edit-paper.f-words textarea { font-size: 30px; min-height: 110px; background: linear-gradient(90deg, #8e9194, #d9dadc 55%, #a5a8ac); text-align: center; }
.g-stk .tile { background: radial-gradient(120% 100% at 30% 20%, #4a4c50, #26272a 70%); }
.g-words .tile { background: linear-gradient(90deg, #8e9195, #d6d7d9 50%, #a3a6aa); }

.link-btn { display: block; margin: 14px auto 0; font-size: 12px; color: #2b2c2f; text-decoration: underline; text-underline-offset: 3px; }
.f.dark span { color: var(--mute); }
.f.dark input { background: rgba(255,255,255,.06); color: var(--ink); border-color: var(--line); }
#pwErr { color: #ff9a9a; }
