[hidden] { display: none !important; }
.book-link,.collection a { color: var(--accent); text-underline-offset: 3px; }
.book-link { font-size: 14px; font-weight: 600; }
[data-link-icon] { align-items: center; gap: 6px; }
[data-link-icon]:not(.settings-link) { display: inline-flex; }
[data-link-icon] i svg { width: 17px; height: 17px; }
[data-link-icon="next"] i { order: 1; }
.primary,.selection-actions a {
  display: inline-flex; align-items: center; justify-content: center; min-height: 40px;
  padding: 8px 15px; border: 1px solid var(--ink); border-radius: 8px;
  background: var(--orange); color: white; font-weight: 650; font-size: 13px;
}
.selection-actions a {
  background: var(--cream); color: var(--accent); border-color: var(--edge);
}
.paper-dialog {
  position: fixed; width: min(90vw,385px); max-height: 90dvh; overflow: auto;
  border: 1px solid var(--line); border-radius: 16px; padding: 28px;
  background: var(--sheet); color: var(--ink); box-shadow: 0 20px 70px #30213444;
}
.paper-dialog::backdrop { background: #260c116b; }
.paper-dialog h2,.review-sheet h2 { overflow-wrap: anywhere; padding-right: 16px; margin: 0 0 18px; }
.paper-dialog form,.review-sheet form { display: grid; gap: 14px; }
.paper-dialog label,.review-sheet label { display: grid; gap: 5px; font-size: 14px; font-weight: 600; }
.paper-dialog input,.paper-dialog select,.review-sheet input {
  box-sizing: border-box; width: 100%; border-radius: 6px; padding: 9px;
  background: white; border: 1px solid var(--edge); font: inherit; font-size: 16px;
}
.dismiss { position: absolute; right: 6px; top: 4px; width: 42px; height: 42px; font-size: 24px; }
.auth-options,.selection-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.auth-options button { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; padding: 6px 3px; }
.form-message,.paper-dialog [role=status],.review-sheet form p { margin: 0; color: var(--ink); font-size: 14px; }
.form-message:empty,.review-sheet form p:empty { display: none; }
#account-notice {
  position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 8;
  width: max-content; max-width: 92vw; margin: 0; border-radius: 8px; background: var(--ink);
  color: white; padding: 10px 18px; box-shadow: 0 3px 18px #26102430; pointer-events: none;
}
body.collection {
  display: block; height: auto; min-height: 100dvh; background: var(--paper);

}
.collection .brand { color: var(--ink); text-decoration: none; white-space: nowrap; }
.collection .collection-main { max-width: 1060px; padding: clamp(22px,4vw,52px) clamp(14px,4vw,50px); margin: auto; }
.collection h1 { font-size: clamp(32px,5vw,56px); font-weight: 720; line-height: 1.07; letter-spacing: -.04em; color: var(--ink); margin: 0 0 22px; }
.collection .create-sticker:not([hidden]) {
  display: grid; place-items: center; width: 44px; height: 44px;
  color: var(--accent); text-decoration: none;
}
.album-frame {
  --album-gutter: 16px;
  display: grid; grid-template-columns: minmax(0,1fr); margin-inline: auto;
  max-width: max(240px,calc(78dvh * var(--album-ratio) + 2 * var(--album-gutter)));
  container-type: inline-size;
}
.album-fitted-page {
  display: grid; align-items: center; min-height: 160px; padding: var(--album-gutter);
}
.album-fitted-page > :is(.album-sheet,.collector-front) { grid-area: 1 / 1; width: min(100%,calc(78dvh * var(--album-ratio))); }
.album-turn-leaf { z-index: 6; transform-origin: left center; backface-visibility: hidden; pointer-events: none; }
.album-turn-return { z-index: 7; transform-origin: left center; backface-visibility: hidden; }
.create-sticker:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 12px; }
.album-sheet {
  position: relative; isolation: isolate; margin-inline: auto;
  border-radius: 8px 14px 14px 8px;
  background-color: var(--paper);
  background-image: radial-gradient(#aa997c47 .8px,transparent 1px),linear-gradient(90deg,#d4c3a9,#fff8e6 4%,transparent 10%);
  background-size: 13px 13px,100% 100%;
  box-shadow: 1px 3px #eee0c7,2px 4px #b6a28a,3px 7px #f0e4cd,4px 8px #ab9781,4px 12px 22px #5035251a;
}
:is(.album-sheet,.collector-front)::before {
  content: ''; position: absolute; top: 5%; bottom: 5%; left: -13px; width: 28px;
  background: repeating-linear-gradient(180deg,transparent 0 35px,#705e55 36px,#fffcf1 39px,#9d9187 42px,transparent 44px 90px);
  border-radius: 4px; pointer-events: none;
}
.collector-front::before { z-index: 1; }
.album-page { position: relative; }
:is(.album-page,.collector-front) { touch-action: pan-y pinch-zoom; }
.delete-drop {
  position: absolute; left: 50%; bottom: 8px; translate: -50% 0; z-index: 4;
  display: grid; place-items: center; width: 42px; height: 42px; overflow: hidden;
  border: 1px solid #ba3445; border-radius: 50%; background: #fff2f3; color: #a01e34;
  box-shadow: 0 2px 8px #90273738; pointer-events: none;
}
.delete-drop.is-armed { border-color: #a01e34; }
.delete-drop-fill { position: absolute; inset: 0; clip-path: inset(100% 0 0); background: #f6a4af; }
.delete-drop > [data-link-icon] { position: relative; }
.move-drop { top: 8px; bottom: auto; }
.move-drop, .edge-turn {
  border-color: var(--edge); background: var(--sheet); color: var(--ink);
  box-shadow: 0 2px 8px #36425a24;
}
.move-drop.is-armed, .edge-turn.is-armed { border-color: var(--accent); }
.move-drop .delete-drop-fill, .edge-turn .delete-drop-fill { background: var(--mint-light); }
.edge-turn { top: 50%; bottom: auto; left: auto; translate: 0 -50%; }
.edge-turn[data-side="left"] { left: 10px; }
.edge-turn[data-side="right"] { right: 10px; }
#move-sticker-title,#delete-sticker-dialog h2,#delete-sticker-description { margin: 0; }
#delete-sticker-dialog .delete-sticker-confirm { background: #a01e34; border-color: #791427; }
.sticker-placement { position: absolute; pointer-events: none; transform: rotate(var(--sticker-angle, 0deg)); }
.sticker-placement.is-positioned { z-index: 1; }
.sticker-placement:focus-within { z-index: 2; }
.sticker-placement.is-dragging { z-index: 3; }
.sticker,.sticker-rotation { position: absolute; padding: 0; touch-action: pinch-zoom; user-select: none; cursor: grab; pointer-events: auto; }
.sticker { display: block; inset: 0; width: 100%; height: 100%; }
.sticker-rotation[data-link-icon] {
  display: grid; place-items: center; top: 0; right: 0; translate: 75% -75%;
  width: 34px; height: 34px; border-radius: 50%; color: var(--ink);
}
.sticker-rotation i {
  display: grid; place-items: center; width: 25px; height: 25px; border: 1px solid var(--edge);
  border-radius: 50%; background: var(--sheet); box-shadow: 0 1px 3px #3f2c3045;
}
.is-dragging :is(.sticker,.sticker-rotation) { cursor: grabbing; }
.album-page:has(.is-dragging) { cursor: grabbing; }
@media (any-pointer: coarse) { .sticker-rotation[data-link-icon] { width: 44px; height: 44px; } }
.album-print { position: absolute; pointer-events: none; }
.sticker .album-print { inset: 0; }
.album-print :is(img,.album-turn-preview) { display: block; width: 100%; height: 100%; }
.album-print canvas:not(.album-turn-preview) { position: absolute; inset: -8px; width: calc(100% + 16px); height: calc(100% + 16px); }
.sticker .album-print {
  --shadow-depth: 2px;
  --shadow-blur: 1.5px;
  --shadow-color: #3f2c3045;
  --shadow-cos: cos(var(--sticker-angle, 0deg));
  --shadow-sin: sin(var(--sticker-angle, 0deg));
  filter: drop-shadow(
    calc(0.5px * var(--shadow-cos) + var(--shadow-depth) * var(--shadow-sin))
    calc(var(--shadow-depth) * var(--shadow-cos) - 0.5px * var(--shadow-sin))
    var(--shadow-blur) var(--shadow-color));
}
.sticker:hover .album-print,.sticker:focus-visible .album-print {
  --shadow-depth: 3px;
  --shadow-blur: 2px;
  --shadow-color: #3f2c3066;
}
.album-sheet::after { content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit; box-shadow: inset 0 0 0 1px var(--edge); pointer-events: none; }
.unplaced button {
  min-height: 42px; padding: 7px 12px; border: 1px solid var(--edge); border-radius: 8px; background: var(--sheet); color: var(--ink);
}
.empty-book,.unplaced p { color: var(--muted); }
.empty-book { text-align: center; }
.book-dimensions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.dialog-actions { display: flex; gap: 12px; justify-content: flex-end; }
.dialog-actions button { min-height: 44px; }
.save-destination { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 5px 8px; }
.save-destination label { grid-column: 1 / -1; }
.save-destination button {
  min-width: 44px; min-height: 44px; border: 1px solid var(--edge); border-radius: 6px;
  background: var(--cream); color: var(--accent); font-size: 24px; line-height: 1;
}
.unplaced { margin-top: 20px; background: var(--sheet); border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.unplaced h2 { margin: 0; font-size: 18px; }
.unplaced p { margin: 4px 0 10px; }
.unplaced button { max-width: 100%; margin: 3px 6px 3px 0; overflow-wrap: anywhere; touch-action: pinch-zoom; }
.page-turn {
  display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.15fr) minmax(0,1fr);
  align-items: center; gap: clamp(6px,2vw,14px); width: min(100%,22rem);
  margin: 16px auto 0;
}
.page-turn > span {
  color: var(--ink); text-align: center; font-size: 14px; font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.page-turn button {
  justify-content: center; min-width: 44px; min-height: 44px; padding: 6px 4px;
  border: 1px solid var(--edge); border-radius: 8px; background: var(--sheet);
  color: var(--ink); font-size: 13px; font-weight: 650; box-shadow: 0 1px 2px #36425a1a;
}
.page-turn button:hover:not(:disabled) {
  background: var(--mint-light); border-color: var(--edge); filter: none;
}
.page-turn button:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.page-turn button:disabled {
  color: var(--muted); background: var(--paper); border-color: var(--line); opacity: 1; box-shadow: none;
}
@media (min-width: 740px) {
  .album-frame:has(.page-turn) {
    --page-turn-space: 52px;
    max-width: max(240px,calc(78dvh * var(--album-ratio) + 2 * (var(--album-gutter) + var(--page-turn-space))));
  }
  .album-page-layout:has(.page-turn) {
    display: grid; grid-template-columns: minmax(0,1fr); position: relative;
    margin-inline: var(--page-turn-space); container-type: inline-size;
  }
  .page-turn { display: block; text-align: center; }
  .page-turn .page-turn-label { display: none; }
  .page-turn button {
    position: absolute; grid-row: 1 / 2; top: 50%; transform: translateY(-50%);
    width: 44px; height: 44px; touch-action: manipulation;
  }
  .page-turn [data-link-icon="previous"] { right: calc(100% + 8px); }
  .page-turn [data-link-icon="next"] { left: calc(100% + 8px); }
}
#selection {
  width: min(calc(100% - 24px), 690px); max-width: none;
  padding: 58px clamp(14px,4vw,28px) 20px;
  border: 1px solid var(--edge); border-radius: 8px 14px 14px 8px;
  background: linear-gradient(90deg,var(--cream),transparent 24px),var(--sheet);
}
#selection .dismiss {
  top: 7px; right: 8px; width: 44px; height: 44px;
  display: grid; place-items: center; padding: 0;
  border: 1px solid var(--line); border-radius: 50%; background: var(--sheet); color: var(--ink);
}
.selection-card {
  display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.15fr);
  align-items: stretch; gap: clamp(14px,3vw,24px);
}
.selection-mat {
  display: grid; place-items: center; min-width: 0; padding: 16px;
  border: 1px solid var(--line); border-radius: 6px;
  background: radial-gradient(#747c924d .8px,transparent 1px) 0 0 / 13px 13px,var(--cream);
  box-shadow: inset 0 0 12px #36425a21;
}
.selection-preview {
  display: grid; position: relative; place-items: center; width: 100%;
  height: clamp(124px,25dvh,230px);
  filter: drop-shadow(1px 3px 3px #45303655);
}
#selection h2 {
  margin: 0 0 12px; padding: 0; color: var(--ink);
  font: bold clamp(23px,4vw,30px)/1.14 var(--display-face);
}
.selection-specs {
  display: grid; grid-template-columns: max-content minmax(0,1fr);
  margin: 0; padding: 7px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--sheet);
  font-size: 14px;
}
.selection-specs > * { padding-block: 7px; }
.selection-specs > :nth-child(n+3) { border-top: 1px solid var(--line); }
.selection-specs dt { padding-right: 12px; color: var(--muted); }
.selection-specs dd { margin: 0; font-weight: 650; overflow-wrap: anywhere; }
#selection .selection-actions {
  display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.4fr);
  align-items: stretch;
}
#selection #order-sticker { grid-column: 1 / -1; }
.selection-actions :is(a,button) {
  min-height: 44px; padding-inline: 5px; text-align: center; text-decoration: none;
}
.selection-actions a:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
#move-sticker select { min-height: 44px; }
#selection [role=status]:not(:empty) { margin-top: 10px; }
@media (max-width: 600px) {
  #selection { padding-top: 54px; }
  .selection-card { grid-template-columns: minmax(0,1fr); }
  #selection .selection-preview { height: auto; aspect-ratio: 1 / 1; }
}
@media (max-width: 360px) {
  .selection-actions :is(a,button) { gap: 4px; font-size: 12px; }
}
.review-sheet {
  display: grid; grid-template-columns: minmax(160px,.9fr) minmax(0,1fr); align-items: start; gap: clamp(15px,4vw,42px);
  padding: clamp(18px,4vw,38px); border: 1px solid var(--line); border-radius: 14px; background: var(--sheet);
}
.review-preview { display: grid; position: relative; place-items: center; width: 100%; height: clamp(180px,32vw,340px); filter: drop-shadow(1px 3px 2px #3f2c3045); }
.review-mat {
  min-width: 0; padding: clamp(12px,2vw,20px);
  border: 1px solid var(--line); border-radius: 8px;
}
.review-sheet h2 {
  margin: 0 0 14px; padding: 0; font-size: clamp(23px,3vw,32px); line-height: 1.14;
}
.review-sheet dl {
  display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1fr);
  margin: 0; padding-inline: clamp(12px,2vw,16px);
  border: 1px solid var(--line); border-radius: 8px; background: var(--paper);
  font-size: 15px; line-height: 1.4;
}
.review-sheet dl > * { padding-block: 9px; overflow-wrap: anywhere; }
.review-sheet dl > :nth-child(n+3) { border-top: 1px solid var(--line); }
.review-sheet dt { padding-inline-end: 12px; color: var(--muted); }
.review-sheet dd { margin: 0; font-weight: 650; }
.review-sheet form { max-width: 240px; margin-top: 20px; }
.review-sheet form :is(input, .primary) { min-height: 44px; }
.review-sheet form .primary { font-size: 15px; text-align: center; }
.cart-link { color: var(--accent); font-size: 14px; font-weight: 600; }
.cart-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(315px, .58fr);
  align-items: start;
  gap: clamp(16px, 2.5vw, 28px);
}
.cart-items { min-width: 0; container-type: inline-size; }
.cart-panel { padding: 22px; }
.cart-panel h2,.cart-panel h3 { margin: 0 0 8px; }
.cart-panel h3 { margin-top: 20px; font-size: 15px; }
.cart-summary,.cart-empty { min-width: 0; padding: clamp(16px, 2.5vw, 24px); overflow-wrap: anywhere; }
.cart-summary h2,.cart-empty h2 { font-size: 23px; margin-bottom: 4px; }
.cart-meta,.cart-tier,.cart-unit-price,.cart-feedback,.cart-options p { font-size: 13px; color: var(--muted); }
.cart-meta,.cart-tier { margin: 0; }
.cart-tier { margin-top: 6px; color: var(--focus); }
.cart-receipt { margin: 16px 0 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.cart-receipt > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 10px; padding-block: 4px; }
.cart-receipt > [hidden] { display: none; }
.cart-receipt dt { color: var(--muted); }
.cart-receipt dd { margin: 0; font-weight: 650; text-align: right; }
.cart-receipt .cart-credit :is(dt,dd) { color: var(--focus); }
.cart-receipt .cart-total {
  align-items: center;
  margin-top: 10px;
  padding: 10px 12px;
  border-top: 1px dashed var(--edge);
  border-radius: 0 0 8px 8px;
  background: var(--cream);
}
.cart-total dt { color: var(--ink); font-weight: 750; }
.cart-total dd { font-size: clamp(19px, 2.2vw, 24px); font-weight: 750; letter-spacing: -.025em; }
.cart-summary .cart-checkout {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 48px; padding: 8px 12px; text-align: center;
}
.cart-summary .cart-feedback { line-height: 1.4; margin: 8px 0; }
.cart-summary .cart-feedback:empty { display: none; }
.cart-summary .cart-options,.cart-summary .cart-links {
  border-top: 1px solid var(--line); margin-top: 16px; padding-top: 12px;
}
.cart-options > p { margin: 12px 0 0; }
.cart-promo,.cart-options .redeem-box {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 8px;
}
.cart-promo label,.cart-options .redeem-box label { font-size: 13px; font-weight: 600; }
.cart-promo label { display: grid; gap: 4px; }
.cart-options .redeem-box {
  margin: 14px 0 0; padding: 10px; border-color: var(--line); background: var(--paper); font-size: 13px;
}
.cart-options .redeem-box :is(p, output, small, label:has(textarea)),.cart-promo .cart-feedback { grid-column: 1 / -1; }
.cart-options .redeem-box p { margin: 0; }
.cart-options .redeem-box label[hidden] { display: none; }
.cart-options .redeem-box :is(input,textarea) { margin-top: 4px; font-size: 16px; }
.cart-options .redeem-box output { font-weight: 600; }
.cart-summary :is(input,textarea),.cart-item input {
  min-width: 0; min-height: 44px; padding: 6px 8px;
  border: 1px solid var(--edge); border-radius: 7px; background: white; font-size: 16px;
}
.cart-summary :is(input,textarea) { width: 100%; }
.cart-summary :is(.catalog-add,.redeem-box button) {
  min-height: 44px; padding: 6px 10px; border: 1px solid var(--edge); border-radius: 8px; font-size: 13px;
}
.cart-links { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 12px; }
.cart-links a.peely-link:not([hidden]) { min-height: 44px; justify-content: flex-start; text-align: start; }
.cart-summary .cart-links a.peely-link:not([hidden]) { padding-inline: 4px; border-color: transparent; color: var(--muted); }
.cart-empty > p { margin: 6px 0 0; color: var(--muted); }
.cart-empty { max-width: 560px; }
.cart-item {
  display: grid; grid-template-columns: 100px minmax(0, 1fr) auto;
  grid-template-areas: "art title price" "art details details" "art controls controls";
  align-items: start; gap: 8px 16px; padding: 20px;
}
.cart-item + .cart-item { border-top: 1px solid var(--line); }
.cart-art {
  grid-area: art; display: grid; place-items: center; aspect-ratio: 1;
  border: 1px solid var(--line); border-radius: 10px; background: var(--paper); padding: 10px;
}
.cart-art .review-preview { width: 100%; height: 100%; }
.cart-item h2 {
  grid-area: title; margin: 0; font-size: 18px; line-height: 1.25; overflow-wrap: anywhere;
}
.cart-item .line-price { grid-area: price; justify-self: end; margin: 0; font-weight: 750; text-align: right; }
.cart-receipt,.line-price { font-variant-numeric: tabular-nums; }
.cart-item-details { grid-area: details; }
.cart-item dl { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; line-height: 1.35; }
.cart-item dl > div { min-width: 0; }
.cart-item dt { font-size: 12px; color: var(--muted); }
.cart-item dd { margin: 0; font-size: 14px; overflow-wrap: anywhere; }
.cart-unit-price { margin: 5px 0 0; }
.cart-item form { grid-area: controls; display: flex; align-items: center; gap: 6px 8px; flex-wrap: wrap; }
.cart-item label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.cart-item input { width: calc(7ch + 22px); }
.cart-item form .primary { min-height: 44px; padding: 6px 10px; }
.cart-item .remove-item { min-height: 44px; margin-left: auto; padding: 6px 4px; color: var(--muted); font-size: 13px; text-decoration: underline; }
.cart-item .remove-item:hover { color: var(--accent); }
.cart-item [role=status] { order: 1; width: 100%; margin: 0; color: var(--accent); font-size: 13px; overflow-wrap: anywhere; }
.cart-item [role=status]:empty { display: none; }
@container (max-width: 460px) {
  .cart-item {
    grid-template-columns: 72px minmax(0, 1fr);
    grid-template-areas: "art title" "art price" "details details" "controls controls";
    gap: 6px 12px; padding: 14px;
  }
  .cart-art { padding: 7px; }
  .cart-item h2 { align-self: end; }
  .cart-item dl { column-gap: 12px; }
  .cart-item .line-price { justify-self: end; }
}
.cart-panel button:disabled { background: var(--line); color: var(--muted); border-color: var(--line); }
@media(max-width: 800px) { .cart-layout { grid-template-columns: minmax(0, 1fr); } }
@media(max-width:620px) {
  .review-sheet { grid-template-columns: minmax(0,1fr); }
  .review-sheet form { margin-inline: auto; }
  .review-sheet label { text-align: center; }
  .review-sheet .review-back { justify-self: center; margin-top: 2px; }
}
@media(width > 620px) {
  .review-sheet form {
    max-width: none; grid-template-columns: minmax(78px,120px) auto auto;
    align-items: end; justify-content: start; gap: 8px;
  }
  .review-sheet form > :is(label, .primary) { grid-row: 1; }
  .review-sheet form .primary { padding: 4px clamp(6px,1vw,15px); }
  .review-sheet form [role=status] { grid-column: 1 / -1; grid-row: 2; }
}

.stickerbook .collection-main { padding-top: 18px; }
.stickerbook header nav [aria-current=page] {
  color: var(--ink); font-weight: 700; text-decoration: none;
}
.book-back[data-link-icon] {
  align-items: center; min-height: 44px; padding: 6px 10px;
  border: 1px solid var(--edge); border-radius: 8px;
  background: var(--sheet); color: var(--ink); font-weight: 650; text-decoration: none;
}
.book-back:hover { background: var(--mint-light); border-color: var(--ink); }
.stickerbook .collection-heading { display: block; }
.book-header:has(.book-header-actions:not([hidden])) {
  --book-header-side: 11.25rem;
  display: grid; align-items: center; gap: 6px;
  grid-template-columns: minmax(var(--book-header-side),1fr) minmax(0,3fr) minmax(var(--book-header-side),1fr);
}
.book-header:has(.book-header-actions:not([hidden])) h1 {
  margin: 0; min-width: 0; text-align: center; overflow-wrap: anywhere;
}
#back-to-stickerbooks { justify-self: start; }
.book-header-actions { display: flex; align-items: center; justify-self: end; gap: 8px; }
.stickerbook #page-size { margin: 4px 0 12px; color: var(--muted); font-size: 13px; text-align: center; }
.shelf-actions {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 16px;
}
.shelf-actions :is(button,a) { display: inline-flex; align-items: center; min-height: 44px; }
.stickerbook .book-actions { position: relative; flex: none; }
.stickerbook .book-actions summary {
  display: grid; place-items: center; list-style: none;
  width: 44px; height: 44px; border: 1px solid var(--edge); border-radius: 8px;
  color: var(--ink); font-size: 24px; line-height: 1;
}
.stickerbook .book-actions summary::-webkit-details-marker { display: none; }
.stickerbook .book-actions > div {
  position: absolute; z-index: 5; inset: calc(100% + 4px) 0 auto auto; width: 11rem;
  padding: 4px; border: 1px solid var(--ink); border-radius: 8px;
  background: var(--sheet); box-shadow: var(--control-shadow);
}
.stickerbook .book-actions button {
  display: block; width: 100%; min-height: 44px; padding: 6px 10px; border-radius: 4px;
  text-align: left; color: var(--ink);
}
.stickerbook .book-actions button:hover { background: var(--mint-light); }
.stickerbook .book-actions button:focus-visible { outline-offset: -3px; }
#book-dialog {
  --book-dialog-gutter: 12px;
  inset-inline: 0;
  top: calc(var(--book-viewport-top, 0px) + var(--book-viewport-height, 100dvh) / 2);
  transform: translateY(-50%); margin: 0 auto;
  width: min(calc(100% - 2 * var(--book-dialog-gutter)),420px);
  max-height: calc(var(--book-viewport-height, 100dvh) - 2 * var(--book-dialog-gutter));
  padding: 0;
}
#book-dialog[open] { display: flex; }
#book-dialog form {
  width: 100%; min-width: 0; display: flex; flex-direction: column; gap: 0;
}
#book-title {
  margin: 0; padding: 12px 16px 9px; font-size: 21px;
}
#book-dialog .book-fields { min-height: 0; overflow: auto; padding: 5px 16px 14px; }
#book-dialog .book-fields input { min-height: 44px; }
#book-dialog .book-fields fieldset { min-width: 0; margin: 12px 0 0; padding: 0; border: 0; }
#book-dialog .book-fields legend { margin-bottom: 5px; padding: 0; font-weight: 700; }
#book-dialog .book-fields [role=status]:not(:empty) { margin-top: 10px; }
#book-dialog .dialog-actions {
  gap: clamp(4px,2vw,12px); padding: 8px 16px;
  border-top: 1px solid var(--line); background: var(--sheet);
}
#book-dialog .dialog-actions > button {
  padding-inline: clamp(6px,2vw,15px); line-height: 1.2; white-space: nowrap;
}
#book-dialog .dialog-actions i { flex: none; }
#book-dialog .book-delete { margin-inline-end: auto; }
.paper-dialog .dialog-actions > .primary.cancel { background: var(--sheet); color: var(--ink); }
.paper-dialog .dialog-actions > .primary.cancel:hover:not(:disabled) { background: var(--mint-light); }
.paper-dialog .dialog-actions > .book-delete {
  background-color: #a01e34; color: white;
}
.paper-dialog .dialog-actions > .book-delete:hover:not(:disabled) {
  background-color: #8b1930; color: white;
}
.book-delete-dialog { max-width: min(calc(100% - 24px),420px); }
.paper-dialog.book-delete-dialog .dialog-actions > .book-delete-hold {
  touch-action: none; user-select: none;
  background-image: linear-gradient(#791429,#791429);
  background-repeat: no-repeat; background-size: 0 100%;
}
.paper-dialog.book-delete-dialog .dialog-actions > .book-delete-hold.is-holding {
  background-size: 100% 100%; transition: background-size 1s linear;
}

@media(max-width:620px) {
  .stickerbook .collection-main { padding-top: 10px; }
  .book-header:has(.book-header-actions:not([hidden])) { --book-header-side: 96px; }
  .book-header:has(.book-header-actions:not([hidden])) h1 { font-size: clamp(18px,5vw,32px); }
  #back-to-stickerbooks { justify-content: center; padding-inline: 6px; font-size: 12px; text-align: center; }
  #back-to-stickerbooks i { display: none; }
}
@media(max-width:420px) {
  #book-dialog .dialog-actions { gap: 4px; padding-inline: 8px; }
  #book-dialog .dialog-actions > button { gap: 4px; padding-inline: 5px; font-size: 12px; }
  #book-dialog .dialog-actions svg { width: 14px; height: 14px; }
}

/* The cover and binding carry the print treatment outside the sticker artwork. */
body.stickerbook {
  background: radial-gradient(#6149301c .75px, transparent 1px) 0 0 / 8px 8px, var(--paper);
}
.stickerbook .book-actions summary, .page-turn button {
  background: var(--sheet);
  border-color: var(--edge);
}
.stickerbook .book-actions summary:hover, .stickerbook .book-actions[open] summary,
.page-turn button:hover:not(:disabled) { background: var(--mint-light); border-color: var(--ink); }
.stickerbook .create-sticker { border-radius: 50%; }
.page-turn button:disabled, .cart-panel .primary:disabled {
  color: var(--muted); background: #eee8df; border-color: var(--line); box-shadow: none;
}
.stickerbook #book-title { padding: 15px 16px; background: var(--cream); border-bottom: 1px solid var(--line); }
.stickerbook .book-fields { padding-top: 14px; }
#selection { background: var(--sheet); border-color: var(--ink); box-shadow: var(--display-shadow); }
.selection-mat { background: radial-gradient(#7774 .8px, transparent 1px) 0 0 / 13px 13px, #f1f1ee; }
#account-dialog { border-top: 6px solid var(--orange); }
#account-dialog .dismiss:hover, #selection .dismiss:hover { background: var(--mint-light); }
.collection header nav [aria-current=page] { text-decoration: underline; text-decoration-thickness: 2px; }

.book-shelf .personal-book-cover {
  position:relative; box-sizing:border-box; display:grid; place-items:center;
  width:min(100%,7.25rem); min-height:var(--cover-height,6rem);
  padding:12px 10px 12px 22px; margin-bottom:6px;
  border:1px solid #3b2018; border-radius:5px 7px 7px 5px;
  color:#ffebc6;
  background:
    linear-gradient(90deg,#29150f70,#ffcc8a30 5px,#23140ec4 12px,#ffcc8a30 13px,transparent 15px),
    radial-gradient(#25110e35 .55px,transparent .9px) 0 0 / 3px 4px,
    linear-gradient(145deg,#794538,#4d2921);
  box-shadow:inset 0 1px #f6c38635,inset -2px -2px #29150f55,2px 3px #be9b78,3px 4px #503123;
}
.book-shelf .personal-book-cover::before {
  content:""; position:absolute; inset:5px 5px 5px 17px;
  border:1px solid #ebbb794f; border-radius:2px 4px 4px 2px; pointer-events:none;
}
.book-shelf .personal-book-cover strong {
  min-width:0; font:bold 1rem/1.15 Georgia,serif; overflow-wrap:anywhere;
}

.profile-page .collection-main { max-width: 1240px; }
.profile-page .profile-hub {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: clamp(14px, 2vw, 24px);
  align-items: start;
}
.profile-page :is(.profile-links, .profile-journal) { grid-column: 1 / -1; }
.profile-page .profile-links {
  display: flex; flex-wrap: wrap; gap: .5rem;
  padding: .65rem; background: var(--cream);
  border: 1px solid var(--line); border-radius: 12px;
}
.profile-page .profile-links a[href="#points-wallet"] { background: var(--mint-light); }
.profile-page .profile-links a[href="#points-wallet"]:hover { background: var(--mint); }
.profile-page :is(.profile-panel, .profile-journal, #points-wallet, #quest-log) { scroll-margin-block-start: 1rem; }
.profile-page .profile-hub :focus-visible { outline: 3px solid var(--link-focus, var(--focus)); outline-offset: 3px; }
.profile-page :is(.profile-journal, #points-wallet, #quest-log):focus-visible { outline-color: #d6aa61; }
.profile-page .profile-panel {
  padding: clamp(14px, 2.2vw, 26px); overflow-wrap: anywhere;
  border: 1px solid var(--line); border-radius: 14px;
  background: var(--sheet); box-shadow: 0 3px 0 var(--cream);
}
.profile-page .profile-panel h2 {
  display: flex; align-items: center; gap: .6rem; margin: 0;
  font-size: clamp(1.15rem, 2.4vw, 1.45rem); line-height: 1.2;
}
.profile-page .profile-panel h2 i {
  display: grid; place-items: center; flex: none; inline-size: 2.35rem; block-size: 2.35rem;
  border-radius: 8px; background: var(--cream); color: var(--accent);
}
.profile-page .profile-identity {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: .3rem; margin: 1.15rem 0 0;
}
.profile-page .profile-identity dt,
.profile-page .profile-order-amount p,
.profile-page .profile-orders time { color: var(--muted); font-size: .875rem; }
.profile-page .profile-identity dt:not(:first-child) { margin-top: .55rem; }
.profile-page .profile-identity dd { margin: 0; font-weight: 650; }
.profile-page .profile-security { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.profile-page .profile-security h3 { margin: 0 0 .7rem; font-size: 1rem; }
.profile-page .profile-panel button { min-height: 44px; gap: .4rem; text-align: start; }
.profile-page .profile-action-message { margin: .75rem 0 0; font-size: .875rem; }
.profile-page .profile-action-message:empty { display: none; }
.profile-page .profile-state { margin: 1rem 0 0; padding: .85rem 0 0; border-top: 1px solid var(--line); }
.profile-page .profile-sign-in { max-width: 30rem; }
.profile-page .profile-sign-in p { margin: 0 0 .75rem; }
.profile-page .profile-orders { padding: 0; margin: 1rem 0 0; list-style: none; }
.profile-page .profile-orders li {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 9.5rem);
  grid-template-areas: "details status amount" "details status link";
  align-items: start; gap: .5rem 1rem; padding: .9rem 0;
  border-top: 1px solid var(--line);
}
.profile-page .profile-orders li:last-child { padding-bottom: 0; }
.profile-page .profile-orders :is(h3, p) { margin: 0; }
.profile-page .profile-orders h3 { font-size: 1.03rem; margin-bottom: .25rem; }
.profile-page .profile-order-details { grid-area: details; }
.profile-page .profile-order-amount {
  grid-area: amount; text-align: end; font-variant-numeric: tabular-nums; max-width: 12rem;
}
.profile-page .profile-order-amount strong { display: block; margin-block: .12rem; }
.profile-page .profile-orders li > a { grid-area: link; justify-self: end; }
.profile-page .profile-order-statuses { grid-area: status; display: flex; flex-wrap: wrap; gap: .35rem; }
.profile-page :is(.profile-order-status, .profile-identity-status) {
  display: inline-block; border: 1px solid var(--line); border-radius: 6px;
  padding: .18rem .48rem; background: var(--cream); font-size: .8125rem; font-weight: 700;
}
.profile-page :is([data-payment="paid"], [data-verified="true"]) { background: var(--mint-light); border-color: #afcfc1; }
.profile-page .profile-journal > h2 { display: flex; align-items: center; gap: .55rem; }
.profile-page .profile-journal > h2 i svg { width: 1em; height: 1em; }
@media (max-width: 860px) {
  .profile-page .profile-hub { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .profile-page .profile-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-page .profile-links a:last-child { grid-column: 1 / -1; }
  .profile-page .profile-orders li {
    grid-template-columns: minmax(0, 1fr) minmax(0, auto);
    grid-template-areas: "details amount" "status link"; align-items: center; gap: .65rem .5rem;
  }
}
.auth-options { border-top: 1px solid var(--line); padding-top: 10px; }
