@font-face {
  font-family: "Marck Script";
  src: url("fonts/marck-script.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

/* The room stays in place while the reader moves down the sheet. */
body:has(#reader-room) {
  color-scheme: only light;
  isolation:isolate;
  background:linear-gradient(90deg,#14221840,#242a1e12 58%,#211d1425) center / cover fixed,
    url("kartentisch.webp") calc(50% + 13vw + 205px) 45% / cover no-repeat fixed, #29291f;
}
body:has(#reader-room)::before {
  content:""; position:fixed; inset:0 auto 0 0; z-index:-1; pointer-events:none;
  width:clamp(12rem,calc((100vw - 820px) / 2 + 7rem),42rem);
  background:url("tintenfass-am-fenster.webp") 40% center / cover no-repeat;
  mask-image:linear-gradient(90deg,#000 72%,transparent);
}
body:has(#reader-room) main { width:100%; max-width:none; padding:0; margin:0 auto; }
.rd-map-window {
  position:fixed; z-index:-2; inset:0;
  overflow:hidden; pointer-events:none;
}
body:has(.rd-map-window) { background:#20231b; }
/* Anchor the photograph's lower paper edge just outside the right of the letter. */
.rd-map-window .art-reader-map { left:max(0px,calc(50% + clamp(20.75rem,30vw,26rem) - 58.2dvh)); }
body:has(#reader-room) .mast { background:#14251f; }
body:has(#reader-room) .mast-inner { min-height:54px; padding-block:.55rem; }
body:has(#reader-room) .brand { flex-shrink:0; }
body:has(#reader-room) .brand small { white-space:nowrap; }
.rd-tool-inner,.rd-tool-actions,.rd-letter-line,.rd-heading,.rd-end,.rd-type,
.rd-links,.rd-zoom,.rd-compare-head,.rd-jumps { display:flex; align-items:center; }
.rd-toolbar { position:sticky; top:0; z-index:4; background:#17271ff5; border-block:1px solid #a99a6c60; color:#efe8d4; }
.rd-tool-inner { max-width:820px; justify-content:space-between; gap:.4rem; padding:.35rem .9rem; margin:auto; }
.rd-tool-actions { gap:.35rem; }
.rd-toolbar button,.rd-picker summary {
  display:inline-flex; align-items:center; gap:.5rem; min-height:40px; padding:.43rem .7rem;
  font:600 .91rem/1.25 var(--ui); border:1px solid transparent; border-radius:3px; color:#f4efdf;
  background:transparent; cursor:pointer;
}
.rd-toolbar button:hover,.rd-picker summary:hover { color:white; background:#324439; }
.rd-toolbar .rd-compare-trigger { border-color:#a6a78996; }
.rd-envelope-icon { width:17px; height:12px; border:1px solid currentColor; border-radius:1px; position:relative; overflow:hidden; }
.rd-envelope-icon::after { content:""; position:absolute; width:10px; height:10px; border:solid currentColor; border-width:0 1px 1px 0; left:2px; top:-6px; transform:rotate(45deg); }
.rd-compare-icon { width:13px; height:15px; border:1px solid currentColor; box-shadow:2px 2px #24392d,3px 3px #ddd8bb; transform:rotate(-5deg); margin-right:2px; }
.rd-picker { position:relative; margin:0; padding:0; border:0; }
.rd-picker summary { list-style:none; }
.rd-picker[open]>summary { margin:0; }
.rd-picker summary::-webkit-details-marker { display:none; }
.rd-picker summary::after { content:""; width:.4rem; height:.4rem; border:solid currentColor; border-width:0 1px 1px 0; transform:rotate(45deg); margin:-3px 0 0 2px; }
.rd-picker nav {
  display:grid; position:absolute; top:calc(100% + .35rem); left:0; min-width:12rem; max-height:60vh; overflow:auto;
  padding:.4rem; color:#28382e; background:#fff9eb; border:1px solid #c6b999; border-radius:3px; box-shadow:0 8px 20px #17231948;
}
.rd-picker nav a,.rd-menu-label { padding:.45rem .65rem; }
.rd-menu-label { font-size:.75rem; color:#5a604f; letter-spacing:.05em; }
.rd-picker nav a { color:#294639; border-radius:2px; text-decoration:none; }
.rd-picker nav a:hover,.rd-picker nav a[aria-current] { background:#e4e8d8; }
.rd-menu-shipments { margin-top:.25rem; border-top:1px solid #d1c6ad; }
.rd-table,.rd-tool-inner { width:min(calc(100% - 2rem),clamp(41.5rem,60vw,52rem)); }
.rd-tool-inner { padding-inline:0; }
.rd-table { margin:clamp(1.3rem,2.2vw,2.15rem) auto 2.8rem; }
.rd-letter {
  margin:0 auto; width:100%; padding:clamp(1.35rem,2vw,1.85rem) clamp(1.2rem,4.85vw,4.3rem) clamp(1.7rem,4vw,3rem);
}
.rd-letter::selection,.rd-letter ::selection { color:#18221b; background:#c9dacabf; }
.rd-letter-line { align-items:center; justify-content:space-between; gap:.8rem; padding-bottom:.85rem; border-bottom:1px solid #b7a68680; }
.rd-provenance { margin:0; color:#535849; font:500 clamp(.95rem,2vw,1.12rem)/1.2 var(--serif); }
.rd-type { flex:none; border:1px solid #aca68f; border-radius:3px; overflow:hidden; }
.rd-type button,.rd-zoom button {
  min-height:36px; padding:.4rem .62rem; border:0; border-radius:0;
  color:#34483e; background:transparent; font:600 .78rem/1.35 var(--ui);
}
.rd-type button[aria-pressed=true],.rd-zoom button:hover { background:#324a3e; color:white; }
.rd-type button:focus-visible { outline-offset:-3px; outline-color:#c98134; }
.rd-heading { justify-content:space-between; gap:1rem; margin:1.4rem 0 0; }
.rd-heading img { order:2; width:clamp(5rem,10.25vw,9rem); height:auto; transform:rotate(-4deg); }
.rd-heading h1 { font:500 clamp(2.7rem,5.2vw,4.15rem)/1 var(--serif); letter-spacing:-.04em; margin:0; }
.rd-date { text-align:right; font:400 clamp(1.38rem,2.15vw,1.72rem)/1.4 "Marck Script","Segoe Print",cursive; margin:.8rem 0 1.15rem; }
.rd-body .rd-mention {
  display:inline; min-height:0; margin:0; padding:0; border:0; border-radius:0;
  color:#28585b; background:transparent; font:inherit; user-select:text;
  text-decoration:underline; text-decoration-style:dotted; text-underline-offset:.19em;
}
.rd-body .rd-mention:hover { color:#183f41; background:transparent; text-decoration-style:solid; }
[data-script=print] .rd-date { font-family:Georgia,"Times New Roman",serif; font-size:clamp(1.08rem,1.6vw,1.3rem); }
[data-script=print] .rd-date,[data-script=print] .rd-signature { font-style:italic; }
.rd-end { flex-wrap:wrap; gap:.5rem 1.2rem; margin-top:1.8rem; padding-top:.65rem; border-top:1px solid #c8b898; }
.rd-file-button { padding:.25rem 0; border:0; border-radius:0; background:transparent; color:#294c3b; text-decoration:underline; text-underline-offset:.21em; font-size:.92rem; }
.rd-file-button:hover { background:transparent; color:#121e17; }
#reader-room #meine-sendungen,#reader-room #meine-sendungen>.ship-panel { scroll-margin-top:4.1rem; }
.rd-wait { width:min(92%,720px); margin:1.2rem auto; background:#f6efdf; border:1px solid #cdb895; }
.rd-wait+#meine-sendungen { width:min(92%,720px); margin:0 auto; }
#rd-compare,.rd-file-dialog {
  padding:0; width:min(1120px,95vw); max-width:none; max-height:92dvh; border:1px solid #b5ae97;
  border-radius:5px; background:#ede7d8; color:#27352b; box-shadow:0 15px 75px #121e17ab;
}
html:has(#reader-room) { scrollbar-gutter:stable; }
.rd-modal-open { overflow:hidden; }
.rd-compare-head { position:sticky; top:0; z-index:2; flex-wrap:wrap; justify-content:space-between; gap:.4rem 1rem; padding:.75rem 1.2rem; border-bottom:1px solid #bcb39e; background:#f8f3e5; }
.rd-compare-head h2 { font:500 clamp(1.5rem,3vw,2.1rem)/1.1 var(--serif); margin:0; }
.rd-compare-head button { min-height:40px; font-size:.88rem; padding:.4rem .75rem; }
.rd-pair { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); align-items:start; gap:1rem; padding:1rem; }
.rd-jumps { display:none; gap:1.2rem; padding:.45rem 1rem; font-size:.9rem; }
.rd-links,.rd-zoom { flex-wrap:wrap; gap:.45rem 1rem; }
.rd-file-dialog { width:min(620px,93vw); }
#rd-files { padding:1.15rem; background:#fff8e8; }
.rd-enclosures h3 { margin:0 0 .5rem; }
.rd-enclosures ul { list-style:none; padding:0; margin:0; }
.rd-enclosures li { display:flex; align-items:center; gap:.75rem; margin:.8rem 0; }
.rd-enclosures img { width:58px; height:80px; object-fit:contain; box-shadow:1px 2px 4px #463c2d33; }
.rd-enclosures h4 { margin:0; font:600 1rem var(--ui); }
.rd-file,.rd-links .link-btn { min-height:40px; display:inline-flex; align-items:center; font-size:.88rem; }
.rd-downloads { border-top:1px dotted #b3a386; margin-top:1rem; padding-top:.5rem; }
.rd-place {
  border: 1px solid #b4ae98;
  border-radius: 4px;
  padding: clamp(.8rem,2vw,1.35rem);
  background: #f9f4e6;
  min-width: 0;
  scroll-margin-top: 1rem;
}
.rd-place h3 { margin: 0 0 .8rem; font-size: 1.6rem; }
.rd-selectors { display: grid; gap: .7rem; grid-template-columns: 2fr 3fr; margin-bottom: .9rem; }
.rd-selectors label { display: grid; font: 600 .83rem/1.5 var(--ui); min-width: 0; }
.rd-selectors select { width: 100%; min-width: 0; padding: .4rem .25rem; min-height: 42px; font-weight: 400; }
.rd-scroll {
  height: clamp(345px,62vh,680px);
  overflow: auto;
  overscroll-behavior: contain;
  background: #ded8c8;
  border: 1px solid #c9bea7;
}
.rd-scrollsheet img { display: block; margin: 0 auto; width: auto; max-width: none; height: auto; }
.rd-scrolltext { background: #fff9ea; padding: 1rem; }
.rd-scrolltext .rd-date { font-size: 1.1rem; margin: 0 0 .8rem; }
.rd-zoom { gap: .2rem; margin-top: .6rem; }
.rd-zoom button { border: 1px solid #b9baa6; border-radius: 3px; min-width: 39px; min-height: 39px; }
.rd-zoom button:disabled { cursor: default; opacity: .45; }
.rd-zoom output { text-align: center; min-width: 3.5em; font-size: .9rem; }
.rd-zoom [data-large] { margin-left: auto; }

@media(max-width:760px) {
  .rd-map-window {
    position:relative; inset:auto; z-index:0; width:100%; height:clamp(4.6rem,19vw,6.5rem);
    background:#393426;
  }
  .rd-map-window .art-reader-map { left:0; }
  body:has(.rd-map-window)::before { display:none; }
  body:has(#reader-room) { background-image:linear-gradient(90deg,#0c1a1430,#2e291d20),url("kartentisch-klein.webp"); background-position:center,70% center; }
  body:has(#reader-room .rd-map-window) { background:#302a20; }
  .rd-table { width:calc(100% - .8rem); margin-top:.65rem; }
  .rd-tool-inner { width:100%; padding-inline:.5rem; }
  .rd-pair { grid-template-columns:1fr; padding:.65rem; gap:.65rem; }
  .rd-jumps { display:flex; }
  .rd-scroll { height:clamp(315px,59dvh,560px); }
  .rd-place { scroll-margin-top:4rem; }
  .rd-selectors { grid-template-columns:1fr 1.5fr; }
}
@media(max-width:485px) {
  body:has(#reader-room) .mast-inner { padding-inline:.7rem; gap:.7rem; }
  body:has(#reader-room) .brand { gap:.45rem; }
  body:has(#reader-room) .back { font-size:.82rem; }
  .rd-tool-inner { padding:.2rem .38rem; }
  .rd-toolbar button,.rd-picker summary { font-size:.83rem; gap:.36rem; min-height:42px; padding:.3rem .45rem; }
  .rd-compare-icon { width:10px; height:12px; }
  .rd-provenance { max-width:15ch; }
  .rd-type button { padding:.38rem .46rem; min-height:38px; }
  .rd-letter { padding:1.12rem 1.18rem; }
  .rd-heading { margin:.9rem 0 0; }
  .rd-heading img { width:clamp(4.5rem,21vw,6rem); }
  .rd-date { margin:.65rem 0 1.2rem; }
  .rd-compare-head { padding:.6rem .7rem; }
  .rd-compare-head h2 { font-size:1.5rem; }
  .rd-compare-head button { font-size:.81rem; padding:.35rem .5rem; }
}
@media print {
  .rd-map-window { display:none; }
  body:has(#reader-room)::before,.rd-letter::before { display:none; }
  .rd-toolbar,.rd-type,.rd-end,.rd-table>#meine-sendungen,dialog { display:none!important; }
  body:has(#reader-room),.rd-table,.rd-letter { color:black; background:white; padding:0; box-shadow:none; border:0; }
  .rd-table { width:100%; margin:0; }
}

/* The writing area has the same usable width on every leaf, including the turn in letter five. */
.rd-folio { min-height:30rem; }
.rd-folio:focus { outline:none; }
.rd-writing-area { position:relative; min-width:0; }
.rd-first { display:flow-root; }
.rd-original { position:absolute; inset:0 0 auto; height:0; overflow:hidden; visibility:hidden; pointer-events:none; }
.rd-body { overflow-wrap:anywhere; }
.rd-folio [hidden],.rd-cover-tools[hidden] { display:none!important; }
.rd-first[hidden]+.rd-body { margin-top:0; }
.rd-letter-line { margin:0 0 .45rem; }
.rd-cover-tools { color:#eee8da; background:#1b3028; padding:.45rem .8rem; }
.rd-cover-tools .rd-letter-line { border:0; padding:0; margin:0; }
.rd-cover-tools .rd-provenance { color:inherit; }
.rd-cover-tools .rd-type { background:#f6efdf; }
.rd-front {
  min-height:clamp(26rem,65svh,44rem);
  padding-top:clamp(3.5rem,10vh,7.5rem); color:#373632;
  font:400 clamp(1.65rem,2.4vw,2rem)/1.5 "Marck Script","Segoe Print",cursive;
  background:repeating-linear-gradient(to bottom,transparent 0 calc(1lh - 1px),#ddd5c4 calc(1lh - 1px) 1lh);
}
.rd-front p { margin:0; font:inherit; }
.rd-pagenav {
  display:grid; grid-template-columns:1fr auto 1fr; align-items:center; gap:.65rem;
  padding:.55rem clamp(.55rem,2.5vw,1.4rem); border-block:1px solid #897b5e;
  background:#20352c; color:#f6efdf; box-shadow:0 6px 13px #11170f44; font:500 .92rem/1.35 var(--ui);
}
.rd-pagenav button {
  justify-self:start; min-height:44px; padding:.45rem .8rem; border:1px solid #bbac86; border-radius:3px;
  font:600 .91rem/1.25 var(--ui); background:transparent; color:#f6efdf;
}
.rd-pagenav button:last-child { justify-self:end; background:#efdfb6; color:#27372e; border-color:#efdfb6; }
.rd-pagenav button:hover:enabled { background:#394f42; color:white; }
.rd-pagenav button:disabled { color:#d0cbbb; background:transparent; border-color:transparent; opacity:.72; cursor:default; }
.rd-page-number { text-align:center; font-variant-numeric:tabular-nums; white-space:nowrap; }
.rd-pagenav button:focus-visible { outline:3px solid #ffcd70; outline-offset:2px; }
@media(max-width:485px) {
  .rd-pagenav { gap:.3rem; padding:.34rem .38rem; font-size:.83rem; }
  .rd-pagenav button { font-size:.83rem; padding:.35rem .4rem; }
}
@media print {
  .rd-pagenav,.rd-cover-tools,.rd-folio .rd-letter-line,.rd-writing-area>.rd-first,#briefseite { display:none!important; }
  .rd-folio,.rd-writing-area { min-height:0; }
  .rd-original { position:static; height:auto; overflow:visible; visibility:visible; }
  .rd-folio .rd-front,.rd-folio .rd-front[hidden] { display:block!important; min-height:0; break-after:page; }
}
