.friend-book {
  display:grid;
  grid-template-columns:205px minmax(0,820px);
  gap:22px;
  justify-content:center;
  align-items:start;
  padding:4px 0 8px;
}
.friend-tools {
  background:#fff4e9;
  color:#563750;
  border:1px solid #c798a9;
  border-bottom:3px double #c798a9;
  box-shadow:3px 4px #e6c8ce;
}
.friend-tools summary {
  cursor:pointer;
  padding:11px 12px;
  background:#eedbe9;
  color:#60395a;
  font:15px/1.5 V4JP,V4CN,sans-serif;
}
.friend-tools summary span { font-size:10px; margin-inline-start:5px; white-space:nowrap }
.friend-tools-body,.friend-actions { padding:11px 12px }
.friend-tools-body>label:first-child { margin-top:0 }
.friend-tools fieldset { margin:10px 0; padding:5px 0 0; border:0; min-width:0 }
.friend-tools select { padding:5px 6px; background-color:#fffdf7 }
.friend-swatches { display:flex; flex-wrap:wrap; gap:7px }
.friend-swatches button {
  background:var(--swatch);
  padding:0;
  width:25px;
  height:25px;
  border-radius:8px 8px 9px 9px;
}
.friend-swatches button[aria-pressed=true] { outline:1.5px solid #784765; outline-offset:2px; background:var(--swatch) }
.friend-sticker-picker { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:5px }
.friend-sticker-picker button {
  display:grid;
  place-items:center;
  padding:2px;
  min-width:0;
  min-height:38px;
  color:#8f547c;
  background:#fffbf4;
  text-align:center;
}
.friend-sticker-picker img { width:100%; height:28px; object-fit:contain; pointer-events:none }
.friend-sticker-picker span { font:12px/1.08 Hand,sans-serif; overflow-wrap:anywhere }
.friend-tip { font-size:11px; line-height:1.55; margin:6px 0 0 }
.friend-actions { display:grid; gap:8px; border-top:1px dashed #c798a9 }
.friend-sticker-actions { display:flex; gap:5px; flex-wrap:wrap; margin-top:7px }
.friend-sticker-actions button,#friend-remove-photo { padding:4px 6px; font-size:11px }
.friend-form { min-width:0; margin:0 }
.friend-sheet {
  isolation:isolate;
  position:relative;
  width:100%;
  background:#f8e5ed;
  box-shadow:3px 5px 12px #633d5740;
}
.friend-sheet canvas { display:block; width:100%; height:100%; pointer-events:none }
.friend-field {
  position:absolute;
  margin:0;
  padding:0;
  border:0;
  border-radius:2px;
  min-width:0;
  min-height:0;
  resize:none;
  background:transparent;
  color:#4b344c;
  outline:none;
  font:14px/19px "Microsoft YaHei","Yu Gothic",sans-serif;
  overflow-wrap:anywhere;
  scrollbar-width:thin;
  scrollbar-color:#d7adc6 transparent;
  transition:background-color 120ms;
}
.friend-field:hover,.friend-field:focus-visible { background:#fffdf478 }
.friend-field:focus-visible,.friend-photo-slot:focus-within { outline:2px solid #99587b; outline-offset:1px }
.friend-field::placeholder { color:#876e80; opacity:1 }
.friend-photo-slot {
  display:block;
  position:absolute;
  margin:0;
  cursor:pointer;
  border-radius:12px;
}
.friend-photo-slot:hover { box-shadow:inset 0 0 0 2px #ba78a296 }
.friend-sr {
  position:absolute;
  width:1px;
  height:1px;
  overflow:hidden;
  clip-path:inset(50%);
  white-space:nowrap;
}
.friend-sheet button.friend-placed-sticker {
  position:absolute;
  touch-action:none;
  padding:0;
  border:1px solid transparent;
  border-radius:8px;
  background:none;
  box-shadow:none;
  cursor:grab;
  transform:none;
}
.friend-sheet button.friend-placed-sticker[aria-pressed=true] { border:1px dashed #965980 }
.friend-sheet button.friend-placed-sticker:active { cursor:grabbing }
.friend-sheet button.friend-placed-sticker:focus-visible { outline:2px solid #965980; outline-offset:1px }
.friend-save-bottom { display:block; margin:15px 0 2px auto }
.friend-sheet-compact .friend-field { font-size:16px }
.friend-export-preview {
  display:block;
  max-width:100%;
  max-height:65vh;
  margin:auto;
  object-fit:contain;
}
@media(max-width:760px) {
  .friend-book { grid-template-columns:minmax(0,1fr); gap:14px }
  .friend-actions { grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px }
  .friend-actions .primary,.friend-actions p { grid-column:1/-1 }
  .friend-sticker-picker { grid-template-columns:repeat(6,minmax(0,1fr)) }
}
