/* The canvas draws its own scene; these colors style the surrounding controls. */
body.exchange,
body.reading-ui {
  --page: #f3e8d2;
  --surface: #fff9eb;
  --raised: #f6ead5;
  --text: #493326;
  --secondary: #6d5342;
  --muted: #705b4a;
  --mint: #43644e;
  --line: #af8c6250;
  --radius: 14px;
  color: var(--text);
  background: #edf0dd;
  font-family: "Nunito", "Noto Sans KR", sans-serif;
}
:root:has(body.exchange), :root:has(body.reading-ui) { background: #edf0dd; }
.exchange .topbar, .reading-ui .topbar {
  background: var(--surface);
  border-bottom: 1px solid #ddc6a7;
}
.exchange .brand, .exchange a.button { text-decoration: none; }
.exchange .brand { color: #4e392c; font-size: 23px; font-weight: 800; }
.reading-ui .topbar { column-gap: 12px; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; background: #e9edda; border-radius: 12px; font-size: 20px; }
.exchange-main { display: block; width: min(740px, 100%); padding: 32px 20px 56px; margin: auto; }
body.exchange { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
body.reading-ui {
  display: grid;
  height: 100dvh;
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-columns: minmax(0, 1fr);
}
.reading-ui > main {
  width: 100%;
  min-height: 0;
  overflow-y: auto;
  scroll-padding-block: 12px;
}
.reading-ui > .bookmate-nav { position: static; }
.bookmate-nav {
  position: fixed; z-index: 10; bottom: 0; left: 0; right: 0;
  display: flex; justify-content: center; gap: clamp(8px, 5vw, 48px);
  padding: 6px 12px calc(6px + env(safe-area-inset-bottom));
  border-top: 1px solid #ddc6a7; background: var(--surface);
  box-shadow: 0 -3px 12px #49332615;
}
.bookmate-nav a {
  display: grid; justify-items: center; align-content: center; width: 86px;
  min-height: 48px; border-radius: 14px; color: var(--secondary);
  text-decoration: none; font-size: 13px; font-weight: 750;
}
.bookmate-nav a[aria-current="page"] { color: var(--mint); background: #e3ead5; }
.bookmate-nav .wardrobe-icon {
  display: block; position: relative; width: 17px; height: 17px; margin: 1px 0 2px;
  border: 1.5px solid currentColor; border-radius: 3px 3px 1px 1px;
  background: linear-gradient(currentColor, currentColor) center / 1px 100% no-repeat;
}
.wardrobe-icon::before, .wardrobe-icon::after {
  content: ""; position: absolute; top: 6px; width: 1px; height: 4px; background: currentColor;
}
.wardrobe-icon::before { left: 4px; }
.wardrobe-icon::after { right: 4px; }
.bookmate-nav a span { font-size: 20px; line-height: 20px; }
@media (hover: hover) {
  .bookmate-nav a:hover { background: #e7ecd7; color: var(--mint); }
}
.room-card { color: var(--text); text-decoration: none; }
.room-card:hover { background: #fff2db; }
#wardrobe-editor {
  --shop-width: min(700px, calc(100vw - 40px));
  --awning-overlap: calc(var(--shop-width) * .048);
  position: relative;
  min-width: 0;
}
#wardrobe-editor .avatar-shop-panel {
  height: clamp(340px, calc(100svh - 220px - var(--shop-width) / 7.4 - env(safe-area-inset-bottom)), 490px);
}
@media (max-width: 520px) {
  .wardrobe-editor .avatar-category { min-width: 44px; min-height: 44px; }
  .wardrobe-editor .avatar-tile-face { font-size: 12px; }
  .wardrobe-editor .avatar-actions, .wardrobe-editor .avatar-confirm-actions { gap: 4px; }
  .wardrobe-editor .avatar-actions .button { min-width: 44px; min-height: 44px; padding-inline: 8px; white-space: nowrap; }
}
.exchange-main section { display: grid; gap: 16px; }
.exchange-main [hidden] { display: none !important; }
.exchange-heading, .exchange-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.exchange-heading { justify-content: space-between; }
.exchange-main h1, .exchange-main h2, .exchange-main p { margin: 0; }
.exchange-main h1 { font-size: clamp(23px, 5vw, 32px); font-weight: 800; }
.exchange-main h2 { font-weight: 800; }
.exchange-card { display: grid; gap: 14px; padding: 20px; min-width: 0; background: var(--surface); border: 1px solid #ddc6a7; border-radius: 20px; box-shadow: 0 3px 0 #d8c4a360; }
.exchange-card label { display: grid; gap: 6px; font-weight: 700; }
.exchange-card input, .exchange-card select, #finish-form select, #shelf-review select {
  width: 100%; min-width: 0; min-height: 44px; padding: 9px 12px; border-radius: 12px;
  border: 1px solid #ddc6a7; color: var(--text); background: #fffdf5; font: inherit;
}
#code-form input { flex: 1; }
#waiting-members { display: grid; gap: 8px; list-style: none; margin: 0; padding: 0; }
#waiting-members .waiting-member {
  display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 3px 8px 3px 12px;
  border: 1px solid #ddc6a7; border-radius: 10px; background: #fffdf5;
}
.waiting-name { min-width: 0; overflow-wrap: anywhere; }
.waiting-host {
  flex-shrink: 0; padding: 3px 7px; border-radius: 999px;
  background: #e8edd9; color: #38513b; font-size: 11px; font-weight: 750;
}
.member-drag {
  flex-shrink: 0; width: 44px; height: 44px; margin-left: auto; border: 0;
  border-radius: 8px; background: transparent; color: #6d5342; font-size: 21px;
  cursor: grab; touch-action: none; user-select: none;
}
.member-drag:hover { background: #f3e8d2; }
.drag-source .member-drag { cursor: grabbing; }
#waiting-members .drag-source { background: #f3e8d2; }
.drop-before { box-shadow: 0 -3px 0 #66846b; }
.drop-after { box-shadow: 0 3px 0 #66846b; }
.exchange-list { display: grid; gap: 12px; }
.exchange-card a, .exchange-heading a { color: var(--mint); }
.exchange-card ol { padding-left: 22px; margin: 0; }
.exchange-card li { padding: 4px; }
#exchange-status:not(:empty) { margin: 0 0 12px; color: var(--mint); }
#save-toast {
  position: fixed; z-index: 20; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: max-content; max-width: calc(100vw - 32px); padding: 8px 14px;
  border-radius: 999px; background: #493326; color: #fff9eb;
  font-size: 13px; text-align: center; pointer-events: none; opacity: 0;
}
#save-toast:empty { padding: 0; }
#ticket-preview { border-radius: 14px; cursor: default; image-rendering: auto; }
.exchange-main:has(#history-view:not([hidden])) {
  width: min(1080px, 100%);
  padding-inline: 16px;
}
#history-view {
  position: relative;
  isolation: isolate;
  min-width: 0;
  padding: 12px 14px 18px;
  border: 1px solid #783d2c;
  border-radius: 17px 17px 22px 22px;
  background: linear-gradient(#a35839, #783b2a);
  box-shadow: 0 6px 0 #623322, 0 12px 24px #49332630;
  overflow: hidden;
}
.history-spread {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-radius: 9px 9px 13px 13px;
  background: #fff4de;
  box-shadow: -3px 2px #deb58c, 3px 2px #deb58c, 0 4px #b47b58, 0 7px #e0ba92;
  overflow: hidden;
}
.history-page {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  min-width: 0;
  padding: clamp(16px, 3vw, 34px);
}
.history-ticket-page { background: linear-gradient(90deg, #f4dfbf, #fff5e1 7%, #fff5e1 88%, #e6c6a0); }
.history-reviews-page { background: linear-gradient(90deg, #e8c7a0, #fff4dc 9%, #fff4dc 94%, #f4dfbf); }
.history-page > h2 {
  padding-bottom: 8px;
  border-bottom: 1px solid #c59a73;
  color: #67442e;
}
.history-page #ticket-download { align-self: flex-start; }
#history-book { overflow-wrap: anywhere; }
#history-list .history-reader {
  background: #fff9ebc9;
  border-radius: 9px;
  box-shadow: none;
  overflow-wrap: anywhere;
}
.history-review-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: auto;
  padding-top: 4px;
}
#history-position { color: var(--muted); font-size: 12px; }
.history-review-nav button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid #a9764f;
  border-radius: 50%;
  background: #f5dfbc;
  color: #694630;
  font-size: 12px;
}
.history-review-nav button:hover:not(:disabled) { background: #eed0a5; }
.history-turns { display: none; }
@media (min-width: 641px) and (prefers-reduced-motion: no-preference) {
  #history-view:not([hidden]) .history-turns {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 1;
    perspective: 1600px;
    pointer-events: none;
  }
  .history-turns span {
    position: absolute;
    inset: 0 0 0 50%;
    border-radius: 3px 12px 14px 3px;
    background: linear-gradient(90deg, #e0bd95, #fff5e1 23%, #f9e8cc);
    box-shadow: inset -3px 0 #e7c19a;
    transform-origin: left center;
    visibility: hidden;
    animation: history-page-turn 500ms cubic-bezier(.35,.06,.25,.98) forwards;
  }
  .history-turns span:nth-child(2) { animation-delay: 100ms; --flutter: 2deg; }
  .history-turns span:nth-child(3) { animation-delay: 205ms; --flutter: -2deg; }
  @keyframes history-page-turn {
    0% { visibility: visible; transform: rotateY(0); opacity: 1; }
    45% { transform: rotateY(-90deg) skewY(var(--flutter, 0deg)) scaleX(.86); }
    82% { transform: rotateY(-162deg) skewY(calc(-1 * var(--flutter, 0deg))); opacity: .9; }
    100% { visibility: hidden; transform: rotateY(-180deg); opacity: 0; }
  }
}
@media (max-width: 640px) {
  #history-view { padding: 8px 8px 13px; }
  .history-spread { grid-template-columns: 1fr; }
  .history-page { padding: 16px; }
  .history-reviews-page { border-top: 2px solid #c99d76; background: #fff4dc; }
}
@media (max-width: 640px) and (prefers-reduced-motion: no-preference) {
  #history-view:not([hidden]) .history-spread { animation: history-unfold 380ms ease-out both; }
  @keyframes history-unfold {
    from { opacity: .25; transform: translateY(6px) scale(.98); }
    to { opacity: 1; transform: none; }
  }
}
.bookshelf {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(39px, 1fr));
  grid-auto-rows: 190px;
  align-items: end;
  align-content: start;
  gap: 0 3px;
  min-height: 570px;
  padding: 0 12px;
  border: 10px solid #a16e4f;
  border-radius: 12px;
  background: repeating-linear-gradient(to bottom,
    #74503b 0, #a77550 12px, #c39266 183px,
    #efc393 183px, #efc393 186px, #9a6241 186px, #9a6241 190px);
  box-shadow: inset 8px 0 16px #472a2460, inset -8px 0 16px #472a2460, 0 6px 0 #6f4734;
}
.shelf-book {
  display: grid;
  place-items: center;
  min-width: 0;
  height: var(--book-height);
  margin-bottom: 7px;
  padding: 13px 3px;
  border: 1px solid #51362155;
  border-radius: 4px 4px 2px 2px;
  color: #39291f;
  background: linear-gradient(90deg, #fff4, transparent 22%, transparent 76%, #43292152), var(--spine);
  box-shadow: inset 0 7px #fff3, inset 0 -9px #50342139, 2px 1px 3px #3c231e55;
}
.shelf-book span {
  writing-mode: vertical-rl; text-orientation: mixed;
  max-height: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 13px; font-weight: 800;
}
.shelf-book:hover { transform: translateY(-4px); }
.shelf-dialog-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.shelf-dialog-actions .button { display: inline-flex; align-items: center; justify-content: center; text-align: center; }
#shelf-review-status:empty, #room-settings-status:empty { display: none; }
#room-settings .exchange-card { padding: 0; border: 0; box-shadow: none; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.reading-ui .reading-badge {
  position: absolute; left: 50%; bottom: calc(100% + 1px); transform: translateX(-50%);
  color: #fff5de; text-shadow: 0 1px 2px #302118, 0 0 3px #302118;
}
.reading-ui .reading-badge[hidden] { display: none; }
.reading-ui :is(#record, #complete)[hidden] { display: none; }
.pet-book-label {
  position: absolute; transform: translateX(-50%); pointer-events: none;
  max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: #fff5de; text-shadow: 0 1px 2px #302118, 0 0 3px #302118;
}
.avatar-preview-stage { position: relative; width: min(285px, 100%); padding-bottom: 3px; }
#avatar-preview { display: block; width: 100%; }
#avatar-owner { max-width: 100%; text-align: center; overflow-wrap: anywhere; }
#avatar-pet-title {
  position: absolute; top: 84%; left: 88%; transform: translateX(-50%);
  max-width: 92px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  font-size: 11px;
}
#avatar-pet-title:empty { display: none; }
.reader-heading, .reader-dates { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.reader-heading h3 { margin: 0; }
.reader-face { width: 56px; height: auto; border-radius: 12px; background: #e9edda; cursor: default; }
.duration-chip { color: #38513b; background: #e8edd9; border-radius: 999px; padding: 3px 9px; font-size: 13px; }
.rating-label { display: grid; gap: 4px; justify-items: start; }
.rating-picker { position: relative; border-radius: 6px; }
.rating-picker:has(input:focus-visible):not([data-pointer]) {
  outline: 2px solid var(--mint);
  outline-offset: 3px;
}
.rating-picker input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  touch-action: none;
}
.rating-stars { display: inline-flex; font: 30px/38px system-ui, sans-serif; color: #8d6a4b; }
.rating-stars > span {
  position: relative;
  width: 1.16em;
  text-align: center;
}
.rating-stars > span::after {
  content: "★";
  position: absolute;
  inset: 0;
  clip-path: inset(0 calc(100% - var(--star-fill)) 0 0);
  color: #e6ab16;
}
.reader-stars .rating-stars { font-size: 23px; line-height: 28px; }
.history-reader blockquote { margin: 0; padding-left: 10px; border-left: 2px solid #c6a483; }
.exchange-cover, .sample-cover {
  display: grid; place-items: center; flex-shrink: 0; width: 64px; height: 84px; padding: 8px;
  border-left: 5px solid #51362144; color: #3c2921; border-radius: 6px 12px 12px 6px;
  font-size: 12px; text-align: center; word-break: keep-all; overflow-wrap: anywhere;
  box-shadow: 3px 4px 0 #d4b9986b;
}
.exchange-book { display: flex; align-items: center; gap: 14px; min-width: 0; }
.exchange-book > div { min-width: 0; overflow-wrap: anywhere; }
#finish-status { color: var(--mint); }
body.exchange .button, body.reading-ui .button, body.reading-ui .movement button { border-radius: 999px; font-weight: 750; }
body.exchange .button.primary, body.reading-ui .button.primary {
  background: #ac4d26; border-color: #97401e; color: #fff9eb;
  box-shadow: 0 2px 0 #79361c;
}
body.exchange .button.primary:hover, body.reading-ui .button.primary:hover { background: #93431f; }
body.exchange .button.secondary, body.reading-ui .button.secondary {
  background: #fff4df; color: #614331; border-color: #d9bd97;
}
body.exchange .button.secondary:hover, body.reading-ui .button.secondary:hover { background: #f3e2c5; }
.cover-preview { display: grid; place-items: center; padding: 24px; border-radius: 16px; background: #e9edda; }
.preview-book {
  width: 118px; height: 156px; grid-template-rows: auto auto 1fr; gap: 6px;
  padding: 18px 10px 10px; box-shadow: 5px 6px 0 #94785752;
}
.preview-book strong, #cover-author { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.preview-book strong { font-size: 16px; -webkit-line-clamp: 3; }
#cover-author { -webkit-line-clamp: 1; }
.cover-ornament { font-size: 27px; opacity: .62; }
.theme-field { border: 0; margin: 0; padding: 0; min-width: 0; }
.theme-field legend { margin-bottom: 8px; font-size: 13px; font-weight: 800; color: var(--secondary); }
#theme-options { display: flex; flex-wrap: wrap; gap: 4px; }
.exchange-card .theme-option { display: grid; position: relative; place-items: center; width: 38px; height: 42px; cursor: pointer; }
.theme-option input { position: absolute; width: 1px; min-height: 0; padding: 0; opacity: 0; }
.theme-option span { width: 32px; height: 32px; border-radius: 50%; border: 1px solid #51362144; }
.theme-option input:checked + span { outline: 2px solid #624532; outline-offset: 2px; }
.theme-option input:focus-visible + span { outline: 2px solid var(--mint); outline-offset: 3px; }
.invite-code-row { display: flex; align-items: center; gap: 12px; }
#copy-code { display: flex; padding: 0; background: transparent; border: 0; border-radius: 999px; }
.invite-code-row code { background: #e8edd9; border-radius: 999px; padding: 7px 12px; color: #3d5b43; font-weight: 800; letter-spacing: .08em; }
.invite-link-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.invite-link-row button { white-space: nowrap; }
#share-invite { justify-self: start; margin-top: 4px; }
#invite-status:empty { display: none; }
#invite-status { color: var(--mint); font-size: 13px; }
.sample-rooms { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.sample-card {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px;
  padding: 10px; border-radius: 16px; background: var(--surface); border: 1px solid #ddc6a7;
  text-decoration: none; color: var(--text); min-width: 0;
}
.sample-card:hover { background: #fff2db; }
.sample-cover { width: 36px; height: 49px; font-size: 20px; }
.sample-cover.plum { background: #c5b1d5; }
.sample-cover.mint { background: #9db795; }
.sample-cover.rust { background: #e4a185; }
.sample-cover.butter { background: #eac779; }
.sample-card small { display: block; color: var(--muted); font-size: 11px; line-height: 1.4; }
.sample-card strong { font-size: 13px; }
.reading-ui .sidebar { min-height: 0; border-color: #ddc6a7; }
@media (min-width: 600px) and (max-width: 950px) and (max-height: 500px) {
  .reading-ui .topbar { height: 44px; padding-inline: 16px; }
  .reading-ui > main {
    grid-template-columns: min(58%, calc((100dvh - 128px) * 1.6)) minmax(0, 1fr);
    grid-auto-rows: max-content;
    grid-template-areas:
      "scene heading"
      "scene controls"
      "scene finish"
      "chat book"
      "chat members";
    align-items: start;
    align-content: start;
    gap: 8px 16px;
    padding: 8px 16px 16px;
  }
  .reading-ui .world-panel, .reading-ui .sidebar { display: contents; }
  .reading-ui .canvas-wrap { grid-area: scene; aspect-ratio: 640 / 400; }
  .reading-ui .room-heading { grid-area: heading; margin: 0; }
  .reading-ui .room-heading h1 { font-size: 20px; line-height: 1.25; }
  .reading-ui .world-controls {
    grid-area: controls;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin: 0;
  }
  .reading-ui .movement { grid-column: span 2; margin: 0; }
  .reading-ui .movement button { flex: 1; }
  .reading-ui .completion { grid-area: finish; }
  .reading-ui #chat-panel { grid-area: chat; margin: 0; }
  .reading-ui .book-section { grid-area: book; }
  .reading-ui .members-section { grid-area: members; }
  .reading-ui .sidebar > section { padding: 12px; background: var(--surface); border-radius: var(--radius); }
  .reading-ui #chat-form { width: 76%; }
}
.reading-ui dialog:not(#avatar-dialog), .wardrobe-editor .avatar-shop-panel { border: 1px solid #d3b48e; border-radius: 23px; box-shadow: 0 8px 0 #49332624; }
.wardrobe-editor .avatar-shop-panel { border-start-start-radius: 0; border-start-end-radius: 0; }
.reading-ui dialog::backdrop { background: #392a20a6; }
.wardrobe-editor .avatar-preview { background: radial-gradient(ellipse at center, #dfe9ce, #f3e8d2 78%); }
.wardrobe-editor .avatar-category[aria-pressed="true"],
.wardrobe-editor .avatar-tile input:checked + .avatar-tile-face { background: #dce8ce; box-shadow: inset 0 0 0 1px var(--mint); }
.reading-ui .note-preview { background: #f5e7d0; }
.reading-ui .note-preview:hover, .reading-ui .chat-older:hover { background: #f0ddbd; }
.wardrobe-editor #avatar-status { color: #943b2c; }
.reading-ui .skin-swatch { border-color: #6b4b3655; }
.reading-ui #chat-status { color: #80533c; }
.reading-ui .avatar-label.active:not(.offline), .reading-ui .room-overlay span:first-child { color: #cce8b7; }
.reading-ui #action-state { color: #f1eadb; }
@media (max-width: 640px) {
  .sample-rooms { grid-template-columns: 1fr; }
}
@media (max-width: 380px) {
  .exchange-main { padding-inline: 12px; }
  .exchange-card { padding: 14px; }
}

#wardrobe-view > h2 { margin: 24px 0 10px; }
#profile-form .profile-visibility { display: flex; align-items: center; gap: 8px; min-height: 44px; }
#profile-form .profile-visibility[hidden], #profile-status:empty { display: none; }
#profile-form input[type="checkbox"] { width: 20px; height: 20px; min-height: 0; accent-color: var(--mint); }
.profile-books { list-style: none; padding: 0; display: grid; gap: 8px; }
.profile-books li { border-inline-start: 6px solid var(--spine); padding: 6px 12px; display: grid; gap: 3px; overflow-wrap: anywhere; }
.profile-books small { color: var(--muted); }
#peer-bio { white-space: pre-wrap; overflow-wrap: anywhere; }
.profile-icon { display: inline-grid; justify-items: center; align-content: center; gap: 1px; width: 20px; height: 20px; }
.profile-icon::before, .profile-icon::after { content: ""; border: 2px solid currentColor; }
.profile-icon::before { width: 6px; height: 6px; border-radius: 50%; }
.profile-icon::after { width: 14px; height: 6px; border-radius: 8px 8px 2px 2px; }
#peer-profile { width: min(400px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto; }
#peer-title { overflow-wrap: anywhere; }

.miniature-shelf {
  --shelf-row: 88px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(24px, 1fr));
  grid-auto-rows: var(--shelf-row);
  min-height: calc(3 * var(--shelf-row) + 12px);
  box-sizing: border-box;
  padding: 0 6px;
  gap: 0 2px;
  border-width: 6px;
  border-radius: 7px;
  background: repeating-linear-gradient(to bottom, #79523c 0, #ad7d56 7px, #c39266 84px,
    #efc393 84px, #efc393 86px, #925e40 86px, #925e40 var(--shelf-row));
  box-shadow: inset 3px 0 8px #472a2460, inset -3px 0 8px #472a2460, 0 3px 0 #6f4734;
}
.peer-intro { display: flex; align-items: center; justify-content: center; gap: 14px; margin-block: 10px 18px; }
.peer-identity { flex: 0 1 96px; min-width: 0; display: grid; justify-items: center; }
#peer-avatar { width: 88px; max-width: 100%; height: auto; image-rendering: pixelated; }
#peer-avatar.offline { filter: grayscale(1); }
#peer-name { margin: 0; font-size: 14px; line-height: 1.35; text-align: center; overflow-wrap: anywhere; }
#peer-bio {
  position: relative; flex: 1; min-width: 0; padding: 10px 12px; margin: 0; line-height: 1.5;
  border: 1px solid #cbb699; border-radius: 12px; background: #fffdf5; font-size: 14px;
}
#peer-bio::before {
  content: ""; position: absolute; top: calc(50% - 5px); left: -6px; width: 9px; height: 9px;
  transform: rotate(45deg); border: solid #cbb699; border-width: 0 0 1px 1px; background: #fffdf5;
}
.peer-shelf-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.peer-shelf-heading h3 { flex: none; margin: 0; font-size: 15px; }
.peer-reading { display: flex; align-items: baseline; gap: 12px; margin: 14px 0 0; }
.peer-reading dt { flex: none; color: var(--muted); font-size: 13px; }
.peer-reading dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.miniature-shelf .shelf-book { margin-bottom: 4px; padding: 5px 1px; cursor: pointer; }
.miniature-shelf .shelf-book span { font-size: 12px; }
.miniature-shelf .shelf-book:focus-visible { outline: 2px solid #fff7dc; outline-offset: -3px; }
#peer-book-detail { text-align: end; margin: 0; font-size: 13px; overflow-wrap: anywhere; }
#peer-bio:empty, #peer-status:empty { display: none; }
