:root{font:16px/1.5 -apple-system,BlinkMacSystemFont,"PingFang SC",sans-serif;color:#2b1c48;background:#eceaff;--blue:#3545f5;--muted:#645d78}*{box-sizing:border-box}body{margin:0;min-height:100dvh;background:radial-gradient(ellipse at top left,#d7d5ff,transparent 48%),radial-gradient(at bottom right,#e6dff8,transparent 55%)}button,textarea{font:inherit;color:inherit}button{cursor:pointer;border:0;background:none}button:disabled{opacity:.42;cursor:default}button:focus-visible,textarea:focus-visible{outline:3px solid #786ad6;outline-offset:2px}main{width:min(100%,490px);margin:auto;padding:max(16px,env(safe-area-inset-top)) 16px max(24px,env(safe-area-inset-bottom));min-height:100dvh}
.brand { margin: 0; }
.brand img { display: block; width: min(46vw, 185px); height: auto; }
.titlebar, header { display: flex; align-items: center; justify-content: space-between; }
.cover {
  position: relative;
  display: block;
  width: 100%;
  margin: 0 0 16px;
  padding: 0;
  overflow: hidden;
  border-radius: 18px;
  background: #dcd8ec;
}
.cover img { display: block; width: 100%; height: auto; }
.caption {
  position: absolute;
  inset: auto 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  min-height: 44px;
  color: #2b1c48;
  background: rgb(248 247 255 / 52%);
}
.caption b { font-size: 1.2rem; }
.caption i { font: normal 1.5rem/1 system-ui; }
header{height:48px;margin-bottom:12px}header h1{font-size:22px;margin:0}header>*:first-child,header>*:last-child{width:44px}.round{border-radius:50%;background:#f8f7ffb8;min-height:44px;font-size:24px}.tabs button,.sort button{flex:1;border-radius:22px;min-height:44px}.active,.primary{background:var(--blue);color:white}.primary,.pill{border-radius:24px;padding:8px 18px;min-height:44px;font-weight:600}.pill{background:#eceaff}.poster{position:relative;margin-top:16px;isolation:isolate;overflow:hidden;border-radius:20px;background:#211b2c;height:clamp(290px,calc(100dvh - 170px),720px);touch-action:pan-y}.poster>img{width:100%;height:100%;object-fit:cover}.arr,.like,.page{position:absolute;color:white;z-index:1;background:#21172e70}.arr {
  width: 44px; height: 44px;
  top: 50%; transform: translateY(-50%);
  display: grid; place-content: center;
  border-radius: 50%; font-size: 26px; line-height: 1;
}.prev{left:8px}.next{right:8px}.page{bottom:18px;left:14px;border-radius:16px;font-size:13px;padding:4px 12px}.like {
  bottom: 8px; right: 8px; min-width: 44px; min-height: 44px;
  padding: 4px; background: transparent;
  text-shadow: 0 1px 4px #24192b, 0 0 2px #24192b;
}.like b,.like small{display:block}.like b{font:28px/1.1 system-ui}.like[aria-pressed=true] b{color:#ffc8e0}.titlebar { min-height: 44px; margin: 6px 0 4px; }.titlebar h2{font-size:20px;margin:0}
.grid { position: relative; --flow-gap: 8px; }
.tile { position: absolute; top: 0; left: 0; width: calc((100% - var(--flow-gap)) / 2); overflow: hidden; padding: 0; border-radius: 12px; background: #dbd8f8; }
.tile img { display: block; width: 100%; height: auto; aspect-ratio: auto 1; }
.tile.pending { aspect-ratio: 7 / 8; }
.badge{position:absolute;bottom:8px;right:7px;background:#221c32a8;color:white;border-radius:16px;padding:2px 8px;font-size:13px}.sort { width: min(54%, 224px); margin: 4px auto; }.empty { text-align: center; padding: 24px 12px; }.empty svg{width:78px;color:#8c89df}.empty h2{font-size:20px}.empty p{color:var(--muted);font-size:14px}.pending{display:grid;align-content:center;text-align:center;padding:10px}.pending button{color:var(--blue);min-height:44px}.spin{margin:0 auto 8px;border:3px solid #bab9ef;border-top-color:var(--blue);width:28px;height:28px;border-radius:50%;animation:spin 1s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}dialog{border:0;background:#f8f7ff;color:inherit;width:min(100%,490px);max-width:100%;max-height:90dvh;overflow:auto;border-radius:22px 22px 0 0;margin:auto auto 0;padding:20px 20px max(20px,env(safe-area-inset-bottom));box-shadow:0 -4px 35px #27174622}dialog::backdrop{background:#21152c60}dialog h2{font-size:20px;margin:0}dialog header{margin:0}dialog header>*:first-child{width:auto}textarea{width:100%;resize:vertical;min-height:96px;background:white;border:1px solid #c8c3e5;border-radius:12px;padding:12px;margin:12px 0}.actions{display:flex;gap:8px}.actions button{flex:1}.wide{width:100%;margin-top:14px}.lightbox {
  margin: auto auto 0;
  border-radius: 20px 20px 0 0;
  padding: 10px 10px max(10px, env(safe-area-inset-bottom));
}
.photo-close {
  position: absolute; z-index: 2; top: 18px; right: 18px;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgb(33 23 46 / 55%); color: white; font-size: 24px;
}.lightbox .poster {
  margin: 0;
  height: auto;
  border-radius: 0;
}
.lightbox .poster > img {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(72dvh, 700px);
  object-fit: contain;
}#notice:not(:empty){position:fixed;bottom:24px;left:50%;transform:translateX(-50%);background:#302843;color:white;padding:8px 16px;border-radius:20px;z-index:8}@media(prefers-reduced-motion:reduce){.spin{animation:none}}

/* Album pages share the same top edge and photo gutters. */
main:has(.tabs) {
  display: flex;
  flex-direction: column;
  padding-inline: 10px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
}
main > header { margin: 0 4px 4px; }
main > .tabs { margin-inline: 4px; }
main:has(> .deck) {
  height: 100dvh;
  padding-bottom: max(clamp(28px, 8.5vw, 40px), env(safe-area-inset-bottom));
  overflow-x: clip;
}
.deck {
  --deck-scale: .92;
  container-type: size;
  touch-action: pan-y;
  position: relative;
  isolation: isolate;
  flex: 1;
  min-height: 0;
  margin: clamp(20px, 6vw, 28px) clamp(14px, 4.7vw, 22px) 0;
  user-select: none;
}
.deck > .poster, .deck-preview, .deck-back { position: absolute; inset: 0; }
.deck > .poster { height: 100%; margin: 0; transform-origin: 50% 80%; }
.deck-preview { container-type: size; pointer-events: none; clip-path: inset(0 0 0 clamp(-28px, -5.5vw, -16px)); }
.deck-back {
  width: 100%; height: 100%; border-radius: 20px;
  transform: translateX(max(-19px, -4.7%)) rotate(-5deg) scale(var(--deck-scale));
  background: #dbd8ed;
}
@media (max-width: 360px) { .deck { --deck-scale: .88; } }
.deck > .poster:not(.album-end), .deck:has(> .poster > img):not(.turning) > .deck-preview, img.deck-back {
  width: min(100cqw, calc(100cqh * var(--photo-ratio, 1)));
  height: min(100cqh, calc(100cqw / var(--photo-ratio, 1)));
  margin: auto;
}
.deck > .poster:not(.album-end), img.deck-back {
  background: transparent;
  box-shadow: 0 5px 16px rgb(45 32 66 / 15%);
}
.deck > .poster > img, img.deck-back { display: block; object-fit: contain; }
img.deck-back[hidden] { display: none; }
.deck > .poster img { -webkit-user-drag: none; }
.tabs, .sort {
  display: flex;
  position: relative;
  isolation: isolate;
  padding: 0;
}
.tabs::before, .sort::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 3px 0;
  border-radius: 24px;
  background: #f8f7ffb8;
}
.tabs button, .sort button, .titlebar .primary {
  position: relative;
  isolation: isolate;
  background: transparent;
}
.tabs button.active::before, .sort button.active::before, .titlebar .primary::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 3px 0;
  border-radius: 22px;
  background: var(--blue);
}
.sort::before { inset-block: 6px; }
.sort button.active::before, .titlebar .primary::before { inset-block: 6px; }
.titlebar { padding-inline: 3px; }
.titlebar .primary { font-size: 15px; padding-inline: 14px; }
main > .empty, .list-scroll > .empty { min-height: 100%; display: grid; place-content: center; justify-items: center; }
.custom-empty-art { width: clamp(96px, 28dvh, 184px); max-width: 100%; height: auto; }
.empty:has(.custom-empty-art) .primary { min-width: 124px; }
.empty h2 { margin: 12px 0 20px; }
.empty .primary { min-width: min(200px, 100%); }
.editor { padding: 0 16px max(16px, env(safe-area-inset-bottom)); }
.editor form { display: flex; flex-direction: column; max-height: calc(90dvh - max(16px, env(safe-area-inset-bottom))); }
.editor h2 { text-align: center; }
.editor .handle:focus-visible { outline: none; }
.handle:focus-visible span { outline: 2px solid var(--blue); outline-offset: 3px; }
.editor .handle {
  display: grid; place-items: center; justify-self: center;
  width: 64px; height: 44px;
}
.handle span { display: block; width: 38px; height: 4px; border-radius: 4px; background: #9b94af; }
.editor h2, .editor .handle, .editor .wide { flex: none; }
.editor .handle { align-self: center; }
.editor-scroll { overflow: auto; min-height: 0; padding: 4px; margin: 10px -4px 0; }
.input-group { background: #fff; border: 1px solid #d8d3e8; border-radius: 16px; padding: 12px 14px 2px; }
.idea-input { display: block; font-weight: 600; }
.editor textarea, .detail-input input {
  display: block; box-sizing: border-box; width: 100%; min-width: 0;
  border: 0; border-radius: 5px; background: transparent; color: inherit;
  font-family: inherit; font-size: 1rem; font-weight: 400; line-height: 1.5;
}
.editor textarea { margin: 4px 0 10px; padding: 4px; resize: vertical; min-height: 52px; }
.input-group fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
 .detail-toolbar { display:flex; align-items:center; flex-wrap:wrap; gap:2px 5px; margin-bottom:4px; }
.detail-toolbar span { font-size:.88rem; color:var(--muted); }
.detail-chip { min-height:44px; padding:0 8px; position:relative; isolation:isolate; font-size:.88rem; color:#5046ac; }
.detail-chip::before { content:""; position:absolute; inset:7px 0; background:#eeebff; border-radius:999px; z-index:-1; }
.detail-chip[aria-expanded="true"]::before { background:#e0ddfc; }
.detail-input[hidden] { display:none; }
.detail-input { display: grid; grid-template-columns: 3em minmax(0,1fr) auto; align-items: center; border-top: 1px solid #eeebf6; }
.detail-input label { font-weight: 550; }
.detail-input input { min-height: 44px; padding: 6px 4px; }
.editor :is(input,textarea):focus-visible { outline: 2px solid #7776e6; outline-offset: 0; }
.input-error { margin: 6px 0 0; font-size: .87rem; color: #803651; }
.input-error:empty { display:none; }

dialog #notice:not(:empty) {
  position: sticky;
  bottom: 0;
  left: auto;
  transform: none;
  text-align: center;
}
.sort-error { padding: 8px; text-align: center; }

* { scrollbar-width: none; }
*::-webkit-scrollbar { display: none; }
html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
main { display: flex; flex-direction: column; height: 100dvh; min-height: 0; overflow: hidden; }
main > :not(.deck):not(.list-scroll) { flex-shrink: 0; }
.list-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior-y: contain; }
.cover:focus-visible { outline-offset: -3px; }
.deck .album-end, .end-preview {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; text-align: center;
  background: linear-gradient(155deg, #faf9ff, #ece8fa);
  border: 1px solid #fff;
  box-shadow: 0 8px 24px #61498f14;
}
.end-preview[hidden] { display: none; }
.end-art {
  position: relative;
  width: clamp(132px, 42vw, 196px);
  aspect-ratio: 1;
  margin-bottom: 10px;
  flex: none;
}
.end-print, .end-signature {
  position: absolute;
  border-radius: 5%;
  background: white;
  box-shadow: 0 4px 12px #42336420;
}
.end-print {
  inset: 5% 19% 5% 5%;
  padding: 3% 3% 10%;
  transform: rotate(-7deg);
}
.end-art .end-print img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 3%; }
.end-signature {
  inset: 52% 2% 4% 58%;
  transform: rotate(9deg);
  background: white url('/icons/app.svg') center 26% / 85% auto no-repeat;
}
.album-end h2, .end-preview h2 { margin: 0 0 8px; font-size: 1.25rem; }
.end-return { min-height: 44px; color: var(--muted); }
@media (max-height: 450px) {
  .end-art { width: min(72px, 16dvh); margin-bottom: 0; }
  .deck .album-end, .end-preview { gap: 2px; overflow-y: auto; justify-content: safe center; }
}
@media (max-height: 450px) {
  main:has(> .deck) { padding-block: max(4px, env(safe-area-inset-top)) max(6px, env(safe-area-inset-bottom)); }
  .deck { margin-top: 6px; }
}
.remove-detail { min-width: 44px; min-height: 44px; color: var(--muted); font-size: .85rem; }
.editor-actions { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; margin-top: 14px; }
.editor-actions .wide { margin: 0; }

.roster-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0 16px; }
.account-link { min-height: 44px; padding: 0 18px; border-radius: 24px; color: var(--blue); background: #f8f7ff; font-weight: 600; }
.account-link.avatar { display: grid; place-items: center; width: 44px; padding: 0; border-radius: 50%; color: #7064a3; box-shadow: inset 0 0 0 1px #d3cdeb; }
.avatar svg { width: 28px; height: 28px; }
#account form:not([hidden]), #account label { display: grid; gap: 8px; }
#account form { margin-top: 12px; }
#account label { margin-top: 6px; font-weight: 600; }
#account input { width: 100%; min-width: 0; padding: 12px; border: 1px solid #ccc6db; border-radius: 12px; font: inherit; color: inherit; background: white; }
.account-hint { font-size: .9rem; }
.account-toggle { min-height: 44px; color: var(--blue); }
.account-email { overflow-wrap: anywhere; }

.initial-shell { display: grid; gap: 16px; }
.initial-shell i { border-radius: 18px; background: rgb(248 247 255 / 55%); aspect-ratio: 1.66; }
.initial-shell i:first-child { width: 36%; height: 32px; margin: 16px 0; }
.route-error { position: fixed; z-index: 4; bottom: max(20px, env(safe-area-inset-bottom)); align-self: center;
  max-width: calc(100% - 32px); padding: 6px 8px 6px 16px; background: #f8f7ff; border-radius: 18px;
  box-shadow: 0 4px 20px #382a6229; }
