.borrowed-chapter-desk[hidden],
.borrowed-chapter-desk [hidden],
.borrowed-object-change[hidden],
.borrowed-object-change [hidden] {
  display: none !important;
}

.borrowed-chapter-desk {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 3px double var(--yard-ink);
}

.borrowed-chapter-heading {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
}

.borrowed-chapter-form-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 2px solid var(--yard-ink);
  border-radius: 50%;
  color: #fff8e8;
  background: var(--yard-red);
  box-shadow: 2px 3px 0 var(--yard-ink);
  font: 950 0.48rem/1.05 ui-monospace, "SFMono-Regular", Menlo, monospace;
  text-align: center;
  transform: rotate(-5deg);
}

.borrowed-chapter-heading p,
.borrowed-chapter-receipt > p {
  margin: 0 0 4px;
  color: var(--yard-blue);
  font: 900 0.5rem/1.25 ui-monospace, "SFMono-Regular", Menlo, monospace;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.borrowed-chapter-heading h4 {
  margin: 0;
  font-size: 0.82rem;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.borrowed-chapter-choice > p {
  margin: 12px 0;
  color: #4b5047;
  font-size: 0.62rem;
  font-weight: 680;
  line-height: 1.45;
}

#borrowed-chapter-options {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

#borrowed-chapter-options legend {
  margin-bottom: 8px;
  color: var(--yard-ink);
  font-size: 0.63rem;
  font-weight: 900;
}

.borrowed-chapter-option {
  display: grid;
  grid-template-columns: auto 54px minmax(0, 1fr);
  gap: 8px;
  min-height: 62px;
  padding: 9px;
  align-items: center;
  border: 2px solid var(--yard-ink);
  border-radius: 4px;
  background: #fff;
  box-shadow: 2px 3px 0 rgb(24 36 28 / 24%);
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

.borrowed-chapter-option:has(input:checked) {
  background: #fff0b9;
  box-shadow: 4px 4px 0 var(--yard-ink);
  transform: translate(-1px, -1px);
}

.borrowed-chapter-option input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--yard-red);
}

.borrowed-chapter-option > span:nth-of-type(1) {
  color: var(--yard-red);
  font: 950 0.5rem/1.2 ui-monospace, "SFMono-Regular", Menlo, monospace;
}

.borrowed-chapter-option > span:last-child {
  display: grid;
  gap: 3px;
}

.borrowed-chapter-option strong {
  font-size: 0.65rem;
  line-height: 1.25;
}

.borrowed-chapter-option small {
  color: #5a5d53;
  font-size: 0.54rem;
  font-weight: 670;
  line-height: 1.35;
}

#borrowed-chapter-lend-action,
#borrowed-chapter-story-action {
  display: inline-flex;
  width: 100%;
  min-height: 44px;
  margin-top: 12px;
  padding: 9px 11px;
  align-items: center;
  justify-content: space-between;
  border: 2px solid var(--yard-ink);
  border-radius: 4px;
  color: #fff;
  background: var(--yard-dark-green);
  box-shadow: 3px 3px 0 var(--yard-yellow);
  font-family: inherit;
  font-size: 0.61rem;
  font-weight: 900;
  line-height: 1.25;
  text-decoration: none;
  cursor: pointer;
}

#borrowed-chapter-lend-action:disabled {
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.48;
}

.borrowed-chapter-receipt {
  position: relative;
  margin-top: 13px;
  padding: 14px 13px;
  border: 2px solid var(--yard-ink);
  border-left: 8px solid var(--yard-red);
  border-radius: 3px;
  background:
    repeating-linear-gradient(0deg, transparent 0 22px, rgb(24 36 28 / 5%) 22px 23px),
    #fff;
  box-shadow: 3px 4px 0 var(--yard-ink);
}

.borrowed-chapter-receipt:focus {
  outline: 4px solid var(--yard-yellow);
  outline-offset: 4px;
}

.borrowed-chapter-receipt > strong {
  display: block;
  font-size: 0.76rem;
  line-height: 1.3;
}

.borrowed-chapter-receipt > span {
  display: block;
  margin-top: 7px;
  color: #4b5047;
  font-size: 0.6rem;
  font-weight: 680;
  line-height: 1.45;
}

.borrowed-chapter-receipt dl {
  display: grid;
  gap: 5px;
  margin: 11px 0 0;
}

.borrowed-chapter-receipt dl div {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr);
  gap: 8px;
  padding-top: 5px;
  border-top: 1px dashed rgb(24 36 28 / 32%);
}

.borrowed-chapter-receipt :is(dt, dd) {
  margin: 0;
  font-size: 0.52rem;
  line-height: 1.35;
}

.borrowed-chapter-receipt dt {
  color: #676354;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-weight: 850;
  text-transform: uppercase;
}

.borrowed-chapter-receipt dd {
  font-weight: 800;
  overflow-wrap: anywhere;
}

.borrowed-chapter-status {
  min-height: 1.3em;
  margin: 11px 0 0;
  color: var(--yard-green);
  font: 800 0.53rem/1.4 ui-monospace, "SFMono-Regular", Menlo, monospace;
}

.borrowed-chapter-status.is-warning {
  color: var(--yard-red);
}

.courtyard[data-borrowed-state="choice"] .courtyard-scene {
  min-height: 900px;
}

.borrowed-object-change {
  --borrowed-ink: #263238;
  --borrowed-paper: #fffaf0;
  --borrowed-gold: #f0bd5e;
  --borrowed-red: #a34835;
  display: grid;
  width: min(calc(100% - 32px), 1180px);
  grid-template-columns: minmax(270px, 0.8fr) minmax(320px, 1.2fr);
  margin: 24px auto 4px;
  overflow: hidden;
  border: 2px solid var(--borrowed-ink);
  border-radius: 9px;
  color: var(--borrowed-ink);
  background: var(--borrowed-paper);
  box-shadow: 8px 9px 0 var(--borrowed-ink);
}

.borrowed-object-change:focus {
  outline: 4px solid var(--borrowed-gold);
  outline-offset: 5px;
}

.borrowed-object-scene {
  position: relative;
  min-height: 300px;
  overflow: hidden;
  border-right: 2px solid var(--borrowed-ink);
  background:
    linear-gradient(150deg, transparent 0 54%, rgb(38 50 56 / 12%) 54.5% 55.5%, transparent 56%),
    repeating-linear-gradient(0deg, transparent 0 31px, rgb(38 50 56 / 7%) 31px 32px),
    #d9e3d3;
}

.borrowed-object-folder {
  position: absolute;
  top: 42px;
  left: 8%;
  width: 62%;
  height: 176px;
  border: 3px solid var(--borrowed-ink);
  border-radius: 5px;
  background: #f3cf75;
  box-shadow: 9px 10px 0 rgb(38 50 56 / 18%);
  transform: rotate(-4deg);
}

.borrowed-object-folder::before {
  position: absolute;
  top: -23px;
  left: -3px;
  width: 46%;
  height: 23px;
  border: 3px solid var(--borrowed-ink);
  border-bottom: 0;
  border-radius: 5px 8px 0 0;
  background: #f3cf75;
  content: "";
}

.borrowed-object-folder i {
  position: absolute;
  right: 14px;
  left: 14px;
  height: 1px;
  background: rgb(38 50 56 / 32%);
}

.borrowed-object-folder i:first-child { top: 56px; }
.borrowed-object-folder i:nth-child(2) { top: 82px; }

.borrowed-object-folder strong {
  position: absolute;
  right: 15px;
  bottom: 18px;
  padding: 5px 8px;
  border: 2px solid var(--borrowed-red);
  color: var(--borrowed-red);
  font: 950 0.62rem/1 ui-monospace, "SFMono-Regular", Menlo, monospace;
  transform: rotate(-7deg);
}

.borrowed-object-icon {
  position: absolute;
  right: 7%;
  bottom: 31px;
  z-index: 3;
  display: block;
  width: 112px;
  height: 112px;
  border: 3px solid var(--borrowed-ink);
  border-radius: 50%;
  background: #fff4cc;
  box-shadow: 5px 6px 0 var(--borrowed-ink);
}

.borrowed-object-icon::before,
.borrowed-object-icon::after {
  position: absolute;
  content: "";
}

.borrowed-object-change[data-borrowed-object="plant"] .borrowed-object-icon::before {
  top: 18px;
  left: 50px;
  width: 11px;
  height: 57px;
  border-radius: 9px;
  background: #47764b;
  box-shadow: -22px -5px 0 4px #5f9255, 22px -14px 0 5px #5f9255;
}

.borrowed-object-change[data-borrowed-object="plant"] .borrowed-object-icon::after {
  bottom: 14px;
  left: 30px;
  width: 52px;
  height: 31px;
  border-top: 7px solid #8d4c37;
  border-radius: 3px 3px 18px 18px;
  background: #c66c49;
}

.borrowed-object-change[data-borrowed-object="clock"] .borrowed-object-icon::before {
  inset: 17px;
  border: 5px solid #39465a;
  border-radius: 50%;
  background: #fffdf4;
}

.borrowed-object-change[data-borrowed-object="clock"] .borrowed-object-icon::after {
  top: 36px;
  left: 54px;
  width: 4px;
  height: 31px;
  background: #39465a;
  box-shadow: 9px 20px 0 -1px #39465a;
  transform: rotate(-22deg);
  transform-origin: bottom;
}

.borrowed-object-change[data-borrowed-object="chair"] .borrowed-object-icon::before {
  top: 20px;
  left: 30px;
  width: 52px;
  height: 49px;
  border: 6px solid #3c454d;
  border-radius: 22px 22px 8px 8px;
  background: #dd8a5c;
  box-shadow: 0 33px 0 -7px #dd8a5c;
}

.borrowed-object-change[data-borrowed-object="printer"] .borrowed-object-icon::before {
  top: 38px;
  left: 22px;
  width: 68px;
  height: 48px;
  border: 5px solid #46535a;
  border-radius: 7px;
  background: #9eb0b2;
}

.borrowed-object-change[data-borrowed-object="printer"] .borrowed-object-icon::after {
  top: 14px;
  left: 35px;
  width: 43px;
  height: 42px;
  border: 3px solid #46535a;
  background: #fff;
}

.borrowed-object-pip {
  position: absolute;
  top: 32px;
  right: 5%;
  z-index: 5;
  width: 62px;
  height: 74px;
  border: 2px solid var(--borrowed-ink);
  border-radius: 54% 54% 43% 43%;
  background: #82918a;
  box-shadow: 3px 4px 0 rgb(38 50 56 / 24%);
  transform: rotate(5deg);
}

.borrowed-object-pip::before {
  position: absolute;
  top: -21px;
  left: 12px;
  width: 36px;
  height: 36px;
  border: 2px solid var(--borrowed-ink);
  border-radius: 50%;
  background: #93a29a;
  content: "";
}

.borrowed-object-pip::after {
  position: absolute;
  top: -11px;
  right: -11px;
  width: 17px;
  height: 11px;
  border: 2px solid var(--borrowed-ink);
  background: #f0bd5e;
  content: "";
  transform: skewX(-22deg);
}

.borrowed-object-pip i {
  position: absolute;
  z-index: 2;
  display: block;
  border-radius: 50%;
  background: var(--borrowed-ink);
}

.borrowed-object-pip i:first-child {
  top: -7px;
  left: 24px;
  width: 5px;
  height: 5px;
}

.borrowed-object-pip i:nth-child(2),
.borrowed-object-pip i:nth-child(3) {
  bottom: -13px;
  width: 3px;
  height: 18px;
}

.borrowed-object-pip i:nth-child(2) { left: 19px; }
.borrowed-object-pip i:nth-child(3) { right: 19px; }

.borrowed-object-pip b {
  position: absolute;
  right: 7px;
  bottom: 13px;
  left: 7px;
  padding: 3px;
  border: 1px solid var(--borrowed-ink);
  color: var(--borrowed-ink);
  background: #fffaf0;
  font: 950 0.43rem/1 ui-monospace, "SFMono-Regular", Menlo, monospace;
  text-align: center;
}

.borrowed-object-stamp {
  position: absolute;
  bottom: 19px;
  left: 9%;
  z-index: 6;
  padding: 8px 10px;
  border: 3px double var(--borrowed-red);
  color: var(--borrowed-red);
  background: rgb(255 250 240 / 88%);
  font: 950 0.66rem/1 ui-monospace, "SFMono-Regular", Menlo, monospace;
  letter-spacing: 0.04em;
  transform: rotate(4deg);
}

.borrowed-object-copy {
  display: grid;
  padding: clamp(24px, 4vw, 48px);
  align-content: center;
}

.borrowed-object-copy > p:first-child {
  margin: 0 0 8px;
  color: var(--borrowed-red);
  font: 950 0.62rem/1.25 ui-monospace, "SFMono-Regular", Menlo, monospace;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.borrowed-object-copy h2 {
  max-width: 650px;
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 3.8rem);
  letter-spacing: -0.06em;
  line-height: 0.95;
}

.borrowed-object-copy > p:nth-of-type(2) {
  max-width: 680px;
  margin: 17px 0 0;
  color: color-mix(in srgb, var(--borrowed-ink) 78%, white);
  font-size: clamp(0.84rem, 1.25vw, 1rem);
  font-weight: 620;
  line-height: 1.55;
}

#borrowed-chapter-trace {
  width: fit-content;
  max-width: 100%;
  min-height: 43px;
  margin-top: 20px;
  padding: 9px 12px;
  border: 2px solid var(--borrowed-ink);
  border-radius: 4px;
  color: var(--borrowed-ink);
  background: #f5d985;
  box-shadow: 4px 4px 0 var(--borrowed-ink);
  font: 900 0.67rem/1.35 ui-monospace, "SFMono-Regular", Menlo, monospace;
  text-align: left;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

#borrowed-chapter-trace:hover {
  box-shadow: 6px 6px 0 var(--borrowed-ink);
  transform: translate(-1px, -1px);
}

#borrowed-chapter-trace:focus-visible {
  outline: 4px solid #fff;
  outline-offset: 3px;
  box-shadow: 0 0 0 7px var(--borrowed-ink);
}

.borrowed-object-copy > small {
  display: block;
  margin-top: 14px;
  color: color-mix(in srgb, var(--borrowed-ink) 66%, white);
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1.45;
}

.pip-return {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 3px double var(--borrowed-ink);
}

.pip-return-heading {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.pip-return-heading > span {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 2px solid var(--borrowed-ink);
  border-radius: 50%;
  color: #fffaf0;
  background: #426b49;
  box-shadow: 3px 3px 0 var(--borrowed-ink);
  font: 950 0.48rem/1 ui-monospace, "SFMono-Regular", Menlo, monospace;
  text-align: center;
  transform: rotate(-4deg);
}

.pip-return-heading p,
.pip-return-result > p:first-child {
  margin: 0 0 4px;
  color: var(--borrowed-red);
  font: 950 0.53rem/1.25 ui-monospace, "SFMono-Regular", Menlo, monospace;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.pip-return-heading h3,
.pip-return-result h3 {
  margin: 0;
  font-size: clamp(0.92rem, 1.5vw, 1.15rem);
  letter-spacing: -0.025em;
  line-height: 1.22;
}

#pip-return-action {
  display: inline-flex;
  width: 100%;
  min-height: 46px;
  margin-top: 15px;
  padding: 10px 12px;
  align-items: center;
  justify-content: space-between;
  border: 2px solid var(--borrowed-ink);
  border-radius: 4px;
  color: #fffaf0;
  background: #315b3b;
  box-shadow: 4px 4px 0 var(--borrowed-gold);
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
}

#pip-return-action:hover {
  box-shadow: 6px 6px 0 var(--borrowed-gold);
  transform: translate(-1px, -1px);
}

#pip-return-action:focus-visible,
.pip-return-choices button:focus-visible {
  outline: 4px solid #fff;
  outline-offset: 3px;
  box-shadow: 0 0 0 7px var(--borrowed-ink);
}

.pip-return-choices {
  margin-top: 15px;
  padding: 14px;
  border: 2px solid var(--borrowed-ink);
  border-radius: 5px;
  background:
    repeating-linear-gradient(0deg, transparent 0 25px, rgb(38 50 56 / 6%) 25px 26px),
    #fff;
  box-shadow: 4px 4px 0 var(--borrowed-ink);
}

.pip-return-choices > p {
  margin: 0 0 12px;
  color: #4c5049;
  font-size: 0.65rem;
  font-weight: 720;
  line-height: 1.45;
}

.pip-return-choices fieldset {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin: 0;
  padding: 0;
  border: 0;
}

.pip-return-choices legend {
  grid-column: 1 / -1;
  margin-bottom: 9px;
  color: var(--borrowed-ink);
  font-size: 0.67rem;
  font-weight: 900;
  line-height: 1.35;
}

.pip-return-choices button {
  display: grid;
  min-height: 112px;
  gap: 7px;
  padding: 12px;
  align-content: start;
  border: 2px solid var(--borrowed-ink);
  border-radius: 4px;
  color: var(--borrowed-ink);
  background: #f5d985;
  box-shadow: 3px 3px 0 var(--borrowed-ink);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.pip-return-choices button:nth-of-type(2) {
  background: #d9e3d3;
}

.pip-return-choices button:hover {
  box-shadow: 5px 5px 0 var(--borrowed-ink);
  transform: translate(-1px, -1px) rotate(-0.4deg);
}

.pip-return-choices button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.pip-return-choices strong {
  font-size: 0.72rem;
  line-height: 1.25;
}

.pip-return-choices span {
  color: #4c5049;
  font-size: 0.6rem;
  font-weight: 670;
  line-height: 1.4;
}

.pip-return-result {
  margin-top: 16px;
  padding: 17px;
  border: 2px solid var(--borrowed-ink);
  border-left: 9px solid #426b49;
  border-radius: 4px;
  background: #fff;
  box-shadow: 5px 6px 0 var(--borrowed-ink);
  animation: pip-return-result-in 420ms cubic-bezier(0.16, 0.86, 0.26, 1.12) both;
}

.pip-return-result:focus {
  outline: 4px solid var(--borrowed-gold);
  outline-offset: 4px;
}

.pip-return-branch-proof {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 14px;
}

.pip-return-branch-proof > div {
  position: relative;
  display: grid;
  min-height: 118px;
  gap: 5px;
  padding: 12px;
  align-content: start;
  overflow: hidden;
  border: 2px solid var(--borrowed-ink);
  border-radius: 28px 4px 4px;
  background: #e5efd9;
}

.pip-return-branch-proof > div::after {
  position: absolute;
  right: -3px;
  bottom: -5px;
  width: 39px;
  height: 31px;
  border: 2px solid var(--borrowed-ink);
  border-radius: 70% 20% 70% 25%;
  background: #6d9a55;
  content: "";
  transform: rotate(-19deg);
}

.pip-return-branch-proof .is-newer {
  border-radius: 4px;
  background: #efede6;
  filter: saturate(0.45);
}

.pip-return-branch-proof .is-newer::after {
  background: #b7b3a6;
  transform: rotate(19deg);
}

.pip-return-branch-proof span {
  color: #315b3b;
  font: 950 0.49rem/1.3 ui-monospace, "SFMono-Regular", Menlo, monospace;
  text-transform: uppercase;
}

.pip-return-branch-proof small {
  color: #6a6b63;
  font-size: 0.53rem;
  font-weight: 750;
  line-height: 1.35;
}

.pip-return-branch-proof .is-source small {
  text-decoration: line-through;
  text-decoration-color: var(--borrowed-red);
  text-decoration-thickness: 2px;
}

.pip-return-branch-proof strong {
  max-width: 90%;
  font-size: 0.67rem;
  line-height: 1.3;
}

.pip-return-branch-proof .is-source strong {
  animation: pip-return-growth 620ms 180ms cubic-bezier(0.16, 0.86, 0.26, 1.18) both;
}

#pip-return-result-copy {
  margin: 14px 0 0;
  color: #464c47;
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1.5;
}

#pip-return-result-note {
  display: block;
  margin-top: 10px;
  color: #66665e;
  font: 800 0.53rem/1.4 ui-monospace, "SFMono-Regular", Menlo, monospace;
}

.pip-return-status {
  min-height: 1.3em;
  margin: 12px 0 0;
  color: #315b3b;
  font: 850 0.55rem/1.4 ui-monospace, "SFMono-Regular", Menlo, monospace;
}

.pip-return-status.is-warning {
  color: var(--borrowed-red);
}

@keyframes pip-return-result-in {
  from { opacity: 0; transform: translateY(13px) rotate(0.7deg); }
  to { opacity: 1; transform: translateY(0) rotate(0); }
}

@keyframes pip-return-growth {
  from { opacity: 0; transform: translateY(12px) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.borrowed-object-change[data-borrowed-view="before"] {
  background: #f0eee6;
}

.borrowed-object-change[data-borrowed-view="before"] .borrowed-object-scene {
  filter: grayscale(0.75);
}

.borrowed-object-change[data-borrowed-view="before"] .borrowed-object-folder {
  background: #d7d2c5;
  transform: rotate(0);
}

.borrowed-object-change[data-borrowed-view="before"] .borrowed-object-folder::before {
  background: #d7d2c5;
}

.borrowed-object-change[data-borrowed-view="before"] .borrowed-object-pip {
  opacity: 0;
  transform: translateX(35px);
}

.borrowed-object-change[data-borrowed-view="missing"] {
  border-style: dashed;
  background: #f0eee6;
}

.borrowed-object-change[data-borrowed-view="missing"] .borrowed-object-scene {
  filter: grayscale(0.8);
}

.borrowed-object-change[data-borrowed-view="missing"] .borrowed-object-pip {
  opacity: 0.28;
}

.room-object.has-borrowed-amendment::after,
.room-newcomer.has-borrowed-amendment::after {
  position: absolute;
  top: 22%;
  right: 3%;
  z-index: 40;
  padding: 7px 8px;
  border: 2px solid #263238;
  color: #8f382d;
  background: #fff4bb;
  box-shadow: 3px 3px 0 #263238;
  content: "PIP / AMENDED";
  font: 950 0.51rem/1.05 ui-monospace, "SFMono-Regular", Menlo, monospace;
  letter-spacing: 0.035em;
  transform: rotate(7deg);
  animation: borrowed-stamp-in 440ms cubic-bezier(0.16, 0.85, 0.25, 1.2) both;
}

.room-stage[data-borrowed-view="before"] .has-borrowed-amendment::after {
  display: none;
}

@keyframes borrowed-stamp-in {
  from { opacity: 0; transform: translateY(-22px) rotate(15deg) scale(1.25); }
  to { opacity: 1; transform: translateY(0) rotate(7deg) scale(1); }
}

@media (max-width: 860px) {
  .courtyard[data-borrowed-state="choice"] .courtyard-scene {
    min-height: 0;
  }

  .borrowed-object-change {
    grid-template-columns: minmax(0, 1fr);
    width: min(calc(100% - 24px), 720px);
  }

  .borrowed-object-scene {
    min-height: 250px;
    border-right: 0;
    border-bottom: 2px solid var(--borrowed-ink);
  }

  .borrowed-object-folder {
    top: 41px;
    width: 55%;
    height: 145px;
  }
}

@media (max-width: 520px) {
  .borrowed-chapter-option {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .borrowed-chapter-option > span:nth-of-type(1) {
    grid-column: 2;
  }

  .borrowed-chapter-option > span:last-child {
    grid-column: 2;
  }

  .borrowed-chapter-receipt dl div {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }

  .borrowed-object-change {
    margin-top: 16px;
    box-shadow: 5px 6px 0 var(--borrowed-ink);
  }

  .borrowed-object-scene {
    min-height: 218px;
  }

  .borrowed-object-folder {
    top: 43px;
    left: 6%;
    width: 62%;
    height: 118px;
  }

  .borrowed-object-pip {
    top: 27px;
    right: 6%;
    transform: scale(0.86) rotate(5deg);
  }

  .borrowed-object-icon {
    right: 5%;
    bottom: 16px;
    width: 91px;
    height: 91px;
    transform: scale(0.82);
  }

  .borrowed-object-stamp {
    bottom: 15px;
    left: 6%;
    font-size: 0.56rem;
  }

  .borrowed-object-copy {
    padding: 24px 18px 27px;
  }

  #borrowed-chapter-trace {
    width: 100%;
  }

  .pip-return-heading {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .pip-return-heading > span {
    width: 42px;
    height: 42px;
  }

  .pip-return-choices fieldset,
  .pip-return-branch-proof {
    grid-template-columns: minmax(0, 1fr);
  }

  .pip-return-choices button {
    min-height: 92px;
  }

  .pip-return-branch-proof > div {
    min-height: 96px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .borrowed-chapter-option,
  #borrowed-chapter-trace,
  #pip-return-action,
  .pip-return-choices button,
  .pip-return-result,
  .pip-return-branch-proof .is-source strong,
  .room-object.has-borrowed-amendment::after,
  .room-newcomer.has-borrowed-amendment::after {
    animation: none;
    transition: none;
  }
}
