/* Approved physical paper plate; all writing and hit areas remain live HTML. */
#stories .memo-material{background-image:url('assets/sunlit-fifteen-paper-plate.webp');background-size:548.5246% 437.2093%;background-position:var(--sprite-x) var(--sprite-y);background-color:transparent;background-blend-mode:normal;clip-path:none;box-shadow:none;border-radius:0}
#stories .memo-material:after{display:none}
#stories .weekly-frame .memo-paper{filter:none!important;border:0;box-shadow:none!important;transform:none!important;translate:none!important;padding:15% 15% 12%}
#stories .weekly-frame .memo-message,#stories .weekly-frame .memo-paper.is-own .memo-message{font:400 13.4cqw/1.5 'Gaegu',sans-serif;max-height:4.5em;color:#3d3b30;letter-spacing:0}
#stories .memo-fixed-line{line-height:1.5}
#stories .weekly-frame .memo-time{font:400 8cqw/1.2 'Gaegu',sans-serif;color:#77705f;white-space:nowrap;text-align:right}
#stories .memo-write-invite{font:400 9cqw/1.6 'Gowun Batang',serif;color:#848373;white-space:nowrap}
#stories .memo-add-mark{font:300 22cqw/1 sans-serif;color:#828574}
#stories .weekly-frame .memo-blank{padding:15%;gap:10px}
#stories .weekly-frame .memo-paper:hover{outline:1px solid #7f826b66;outline-offset:-9px}
@media(min-width:1051px){
#stories:not(.viewing-archive) .weekly-wall-area{position:relative;display:block;min-height:0;background:url('assets/sunlit-fifteen-paper-plate.webp') center/100% 100% no-repeat;container-type:size;margin-bottom:20px}
#stories:not(.viewing-archive) .weekly-topic-banner{position:absolute;left:6.8%;top:4.5%;width:31%;padding:0;z-index:2}
#stories:not(.viewing-archive) .topic-dateline{display:flex;gap:6px;flex-wrap:wrap;margin:0 0 7px;flex-direction:row}
#stories:not(.viewing-archive) .topic-dateline>span,#stories:not(.viewing-archive) #weekly-date{font-size:1.15cqw;color:#777264}
#stories:not(.viewing-archive) .weekly-topic-banner h3{font:400 3.7cqw/1.4 'Gowun Batang',serif;white-space:nowrap;margin:0 0 4px;letter-spacing:-1px;color:#34352d}
#stories:not(.viewing-archive) .weekly-topic-banner p{font:400 1.5cqw/1.6 'Gowun Batang',serif;color:#555344;white-space:nowrap}
#stories:not(.viewing-archive) .weekly-view-controls{position:absolute;left:40%;top:11%;width:55%;padding:0 0 0 2%;border-left:1px solid #7d79614d;gap:5px;z-index:2}
#stories:not(.viewing-archive) .weekly-view-controls #weekly-future-story,#stories:not(.viewing-archive) .weekly-view-controls #weekly-view-hint{font:400 1.3cqw/1.7 'Gowun Batang',serif;color:#676452;white-space:nowrap}
#stories:not(.viewing-archive) .weekly-view-controls .room-mobile-break{display:none}
#stories:not(.viewing-archive) .weekly-frame{position:absolute;inset:0;padding:0;container-type:normal}
#stories:not(.viewing-archive) .weekly-frame #room-memo-board{position:absolute;inset:0;display:block;padding:0;container-type:normal;overflow:visible}
#stories:not(.viewing-archive) .weekly-frame .memo-paper:nth-child(n){position:absolute;grid-column:auto;grid-row:auto;left:var(--plate-left);top:var(--plate-top);width:13.8%;height:18.9%;aspect-ratio:auto;min-height:0;max-height:none;padding:1.4% 1.3% 1%;container-type:inline-size;display:grid;grid-template-rows:minmax(0,1fr) auto}
#stories:not(.viewing-archive) .weekly-frame .memo-blank:nth-child(n){display:flex;gap:8px}
#stories:not(.viewing-archive) .memo-material{display:none}
#stories:not(.viewing-archive) .weekly-frame .memo-message{font-size:13.4cqw}
#stories:not(.viewing-archive) .story-wall-footer{position:absolute;left:0;right:0;bottom:-25px;padding:0 5px}
}
@media(max-width:1050px){
#stories .weekly-frame #room-memo-board,#stories .weekly-frame #room-memo-board.archived-wall{grid-template-columns:repeat(2,minmax(0,1fr));gap:15px 4px;padding:8px 0 24px}
#stories .weekly-frame .memo-paper:nth-child(n){width:100%;height:auto;aspect-ratio:1;position:relative;left:auto;top:auto;padding:15%;container-type:inline-size}
#stories .weekly-view-controls #weekly-future-story,#stories .weekly-view-controls #weekly-view-hint{font-size:12px;line-height:1.8;white-space:normal}
#stories .weekly-view-controls .room-mobile-break{display:block}
}
#story-note-writer,#story-note-reader{background-image:linear-gradient(#fff7,#fff5),url('assets/natural-note-paper.webp');background-size:cover;background-color:#f4e7af;border:0;border-radius:1px;box-shadow:6px 16px 35px #3c302746}
#story-note-writer input{background:#fff8;border:0;border-bottom:1px solid #8b826052;border-radius:0;color:#383a2c}
#story-note-input{font-family:'Gaegu',sans-serif;font-size:24px}
/* Enlarged writing/reading sheet uses the same photographed yellow paper. */
#story-note-writer,#story-note-reader{background-image:url('assets/sunlit-fifteen-paper-plate.webp');background-size:727.4% 522.2%;background-position:8.04% 31.58%;background-color:#f4e8b0;box-shadow:5px 14px 35px #3c302746}
#story-note-writer input{background:#fff4}

/* Local responsive study only. Approved desktop above 1050px remains untouched. */
@media(max-width:1050px){#stories .weekly-frame .memo-paper:nth-child(n){aspect-ratio:1.2}#stories .memo-material{background-size:548.5246% 437.2093%}}
@media(max-width:720px){#stories .weekly-frame #room-memo-board,#stories .weekly-frame #room-memo-board.archived-wall{grid-template-columns:repeat(3,minmax(0,1fr))}}
/* Original room background, with the approved paper wall unchanged. */
#stories{background:#fcfbf7}
#stories:before{background-image:url('assets/reading-room-sketch.jpg');background-repeat:no-repeat;background-size:cover;background-position:center;mask-image:linear-gradient(90deg,#000,transparent 13%,transparent 88%,#000);opacity:.43;filter:none}
@media(max-width:720px){#stories:before{mask-image:linear-gradient(90deg,#000,transparent 17%,transparent 83%,#000);opacity:.4}}

/* Fixed-ratio paper tiles at EVERY width: never stretch an entire wall plate. */
#stories:not(.viewing-archive) .weekly-wall-area{position:relative;display:grid;grid-template-columns:1fr 1fr;grid-template-rows:auto minmax(0,1fr) 26px!important;gap:18px 24px;background:none;container-type:normal;margin-bottom:0}
#stories:not(.viewing-archive) .weekly-topic-banner{position:relative;left:auto;top:auto;width:auto;grid-column:1;grid-row:1;padding:0 4px;pointer-events:auto}
#stories:not(.viewing-archive) .topic-dateline{flex-direction:row;gap:8px}
#stories:not(.viewing-archive) .topic-dateline>span,#stories:not(.viewing-archive) #weekly-date{font-size:11px}
#stories:not(.viewing-archive) .weekly-topic-banner h3{font-size:30px;line-height:1.4}
#stories:not(.viewing-archive) .weekly-topic-banner p{font-size:13px;white-space:normal}
#stories:not(.viewing-archive) .weekly-view-controls{position:relative;left:auto;top:auto;width:auto;grid-column:2;grid-row:1;align-self:center;padding:0 0 0 15px;gap:6px}
#stories:not(.viewing-archive) .weekly-view-controls #weekly-future-story,#stories:not(.viewing-archive) .weekly-view-controls #weekly-view-hint{font-size:12px;line-height:1.8;white-space:normal}
#stories:not(.viewing-archive) .weekly-frame{position:relative;inset:auto;grid-column:1/-1;grid-row:2;padding:0;min-height:0;container-type:normal}
#stories:not(.viewing-archive) .weekly-frame #room-memo-board,#stories .weekly-frame #room-memo-board.archived-wall{position:relative;inset:auto;display:grid;grid-template-columns:repeat(var(--memo-columns,5),minmax(0,1fr));grid-template-rows:none;grid-auto-rows:var(--square-row);align-items:start;align-content:start;justify-items:stretch;gap:14px 8px;padding:8px 0 20px;height:100%;max-height:none;min-height:0;overflow-y:auto;overflow-x:hidden;container-type:normal;overscroll-behavior:contain;background:none}
#stories:not(.viewing-archive) .weekly-frame .memo-paper:nth-child(n),#stories .weekly-frame .memo-paper:nth-child(n){position:relative;left:auto;top:auto;grid-column:auto;grid-row:auto;width:100%;height:auto;min-height:0;max-height:none;aspect-ratio:1.2;padding:14% 15% 12%;container-type:inline-size;display:grid;grid-template-rows:minmax(0,1fr) auto}
#stories:not(.viewing-archive) .weekly-frame .memo-blank:nth-child(n){display:flex}
#stories:not(.viewing-archive) .memo-material,#stories .memo-material{display:block;background-size:548.5246% 391.6667%;background-position:var(--sprite-x) var(--sprite-y);mask-image:linear-gradient(90deg,transparent,#000 2%,#000 98%,transparent);filter:none}
#stories:not(.viewing-archive) .story-wall-footer{position:relative;left:auto;right:auto;bottom:auto;grid-column:1/-1;grid-row:3}
@media(max-width:1050px){#stories:not(.viewing-archive) .weekly-wall-area{grid-template-columns:1fr;grid-template-rows:auto auto auto auto!important}#stories:not(.viewing-archive) .weekly-view-controls{grid-column:1;grid-row:2;padding:10px 3px 0}#stories:not(.viewing-archive) .weekly-frame{grid-row:3}#stories:not(.viewing-archive) .story-wall-footer{grid-row:4}#stories:not(.viewing-archive) .weekly-frame #room-memo-board{height:550px;max-height:72svh;min-height:360px}#stories:not(.viewing-archive) .weekly-view-controls .room-mobile-break{display:block}}

#stories:not(.viewing-archive) .weekly-frame #room-memo-board,#stories .weekly-frame #room-memo-board.archived-wall{grid-template-columns:repeat(var(--memo-columns,5),var(--memo-tile-width,minmax(0,1fr)));justify-content:space-between}
#stories:not(.viewing-archive) .weekly-frame .memo-paper:nth-child(n),#stories .weekly-frame .memo-paper:nth-child(n){padding:12% 15% 22%}
#stories:not(.viewing-archive) .weekly-view-controls>p{width:100%;max-width:none;flex:0 0 auto}
#stories:not(.viewing-archive) .weekly-wall-area{background:url('assets/quiet-plaster-wall.png') center/cover;padding:14px 12px;box-sizing:border-box}
#stories .memo-material{mask-image:linear-gradient(90deg,transparent,#000 10%,#000 90%,transparent),linear-gradient(180deg,transparent,#000 4%,#000 91%,transparent);mask-composite:intersect}
#stories:not(.viewing-archive) .weekly-frame #room-memo-board,#stories .weekly-frame #room-memo-board.archived-wall{grid-template-columns:repeat(var(--memo-columns,5),minmax(0,1fr));width:100%;min-width:0;box-sizing:border-box}
#stories:not(.viewing-archive) .weekly-frame .memo-paper:nth-child(n),#stories .weekly-frame .memo-paper:nth-child(n){width:min(100%,var(--memo-tile-width,100%));justify-self:center}
@media(max-width:1050px){#stories:not(.viewing-archive) .weekly-wall-area{grid-template-columns:minmax(0,1fr);width:100%;min-width:0}#stories:not(.viewing-archive) .weekly-frame{width:100%;min-width:0}}

/* Deterministic CSS sizing: no ResizeObserver writes or scrollbar feedback. */
#stories:not(.viewing-archive) .weekly-frame,#stories .weekly-frame{container-type:size;container-name:memo-wall;min-width:0;min-height:0}
#stories:not(.viewing-archive) .weekly-frame #room-memo-board,#stories .weekly-frame #room-memo-board.archived-wall{--cols:3;--tile:calc((100cqw - 51px)/3);grid-template-columns:repeat(var(--cols),minmax(0,1fr));grid-template-rows:none;grid-auto-rows:calc(var(--tile)/1.2);gap:14px 8px;padding:8px 10px 20px;scrollbar-gutter:stable;overflow-anchor:none}
#stories:not(.viewing-archive) .weekly-frame .memo-paper:nth-child(n),#stories .weekly-frame .memo-paper:nth-child(n){width:var(--tile);height:calc(var(--tile)/1.2);max-width:100%;aspect-ratio:1.2;justify-self:center;transition:none}
#stories:not(.viewing-archive) .memo-material,#stories .weekly-frame .memo-material{background-repeat:no-repeat;mask-image:linear-gradient(90deg,transparent,#000 11%,#000 89%,transparent),linear-gradient(180deg,transparent,#000 5%,#000 85%,transparent 95%);mask-composite:intersect;filter:none}
@container memo-wall (min-width:600px){#stories:not(.viewing-archive) .weekly-frame #room-memo-board,#stories .weekly-frame #room-memo-board.archived-wall{--cols:4;--tile:calc((100cqw - 59px)/4)}}
@container memo-wall (min-width:800px){#stories:not(.viewing-archive) .weekly-frame #room-memo-board,#stories .weekly-frame #room-memo-board.archived-wall{--cols:5;--tile:min(calc((100cqw - 67px)/5),calc((100cqh - 56px)/3*1.2))}}
@media(max-width:1050px){#stories:not(.viewing-archive) .weekly-frame,#stories .weekly-frame{height:min(550px,72svh);min-height:360px;container-type:size}}

/* Original wall is one continuous layer. Only alpha paper/shadow sprites move. */
#stories:not(.viewing-archive) .weekly-wall-area{background-image:url('assets/sunlit-continuous-wall.png');background-position:center;background-size:cover;background-repeat:no-repeat}
#stories:not(.viewing-archive) .memo-material,#stories .weekly-frame .memo-material{background-image:url('assets/sunlit-notes-transparent.png');background-color:transparent;background-blend-mode:normal;box-shadow:none;filter:none}

#stories:not(.viewing-archive) .memo-material,#stories .weekly-frame .memo-material{background-size:597.5% 437.2093%;mask-image:none;clip-path:inset(0 0 1% 0)}

#stories:not(.viewing-archive) .memo-material,#stories .weekly-frame .memo-material{background-size:548.5246% 391.6667%;clip-path:none;mask-image:linear-gradient(90deg,transparent,#000 11%,#000 89%,transparent),linear-gradient(180deg,transparent,#000 5%,#000 85%,transparent 95%);mask-composite:intersect}
/* Keep the instructions near the topic; center real writing on each paper. */
@media(min-width:1051px){#stories:not(.viewing-archive) .weekly-wall-area{grid-template-columns:minmax(200px,240px) minmax(0,1fr);column-gap:24px}#stories:not(.viewing-archive) .weekly-view-controls{padding-left:20px}}
#stories .weekly-frame .memo-message,#stories .weekly-frame .memo-paper.is-own .memo-message{width:100%;text-align:center;align-self:center;justify-self:center}
#stories .memo-fixed-line{text-align:center}
@media(max-width:1050px){#stories:not(.viewing-archive) .weekly-wall-area{row-gap:12px}#stories:not(.viewing-archive) .weekly-view-controls{padding-top:8px}}

/* One real paragraph: equal side insets, left aligned lines, native punctuation. */
#stories:not(.viewing-archive) .weekly-frame .memo-paper:nth-child(n),#stories .weekly-frame .memo-paper:nth-child(n){padding-inline:21%;padding-top:12%;padding-bottom:22%}
#stories .weekly-frame .memo-message,#stories .weekly-frame .memo-paper.is-own .memo-message{display:block;width:100%;text-align:left;text-align-last:left;white-space:normal;word-break:normal;overflow-wrap:anywhere;line-break:strict;font-size:13.4cqw;line-height:1.5;max-height:4.5em;letter-spacing:0;align-self:center;justify-self:stretch}
#stories .memo-fixed-line{display:inline;text-align:left;white-space:normal}
#stories:not(.viewing-archive) .weekly-frame .memo-paper:nth-child(n),#stories .weekly-frame .memo-paper:nth-child(n){padding-inline:18%}
#stories:not(.viewing-archive) .weekly-frame .memo-blank:nth-child(n),#stories .weekly-frame .memo-blank:nth-child(n){padding-inline:15%}
/* Justified paragraphs; the final line remains left aligned. */
#stories .weekly-frame .memo-message,#stories .weekly-frame .memo-paper.is-own .memo-message{text-align:justify;text-align-last:left;text-justify:inter-character}

/* Text coordinates belong to the visible paper, not its transparent canvas. */
#stories:not(.viewing-archive) .weekly-frame .memo-paper:nth-child(n),#stories .weekly-frame .memo-paper:nth-child(n){padding:0;container-type:inline-size}
#stories .memo-writing-area{position:absolute;left:var(--ink-left);top:var(--ink-top);width:var(--ink-width);height:var(--ink-height);container-type:inline-size;display:grid;grid-template-rows:minmax(0,1fr) auto;row-gap:5%;pointer-events:none;min-width:0}
#stories .memo-writing-area .memo-message,#stories .memo-paper.is-own .memo-writing-area .memo-message{display:block;align-self:center;justify-self:stretch;box-sizing:border-box;width:100%;font:400 12cqw/1.5 'Gaegu',sans-serif;text-align:justify;text-align-last:left;text-justify:inter-character;white-space:normal;word-break:normal;overflow-wrap:anywhere;line-break:strict;letter-spacing:0;max-height:4.5em;overflow:hidden;margin:0;padding:0;color:#3d3b30}
#stories .memo-writing-area .memo-time{font:400 7cqw/1.2 'Gaegu',sans-serif;white-space:nowrap;text-align:right;color:#77705f;min-height:0;margin:0;padding:0;overflow:hidden}
#stories .blank-writing-area{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12%;container-type:inline-size}
#stories .blank-writing-area .memo-add-mark{font:300 25cqw/1 sans-serif}
#stories .blank-writing-area .memo-write-invite{font:400 11cqw/1.6 'Gowun Batang',serif;white-space:nowrap}
#stories .weekly-frame .memo-paper:hover{outline:none!important;box-shadow:none!important;transform:none!important}
#stories .weekly-frame .memo-paper:focus-visible{outline:2px solid #808b6e;outline-offset:-7px}
#stories:not(.viewing-archive) .weekly-frame .memo-paper .memo-writing-area .memo-message,#stories .weekly-frame .memo-paper.is-own .memo-writing-area .memo-message{font-size:12cqw;line-height:1.5}

@font-face{font-family:SnackMemo;src:url('assets/gangwon-modu.woff') format('woff');font-weight:300;font-style:normal;font-display:swap}
#stories:not(.viewing-archive) .weekly-frame .memo-paper .memo-writing-area .memo-message,#stories:not(.viewing-archive) .weekly-frame .memo-paper.is-own .memo-writing-area .memo-message{font-family:SnackMemo,serif;font-weight:300;font-size:11.5cqw;line-height:1.45}
#story-note-input,#story-note-reader .paper-reading-text{font-family:SnackMemo,sans-serif}

/* Remove the wall fringe above each paper's actual sloping top edge. */
#stories:not(.viewing-archive) .memo-material,#stories .weekly-frame .memo-material{clip-path:polygon(0 var(--paper-edge-left,9%),100% var(--paper-edge-right,9%),100% 100%,0 100%);mask-image:linear-gradient(90deg,transparent,#000 11%,#000 89%,transparent),linear-gradient(180deg,#000 0%,#000 82%,transparent 89%);mask-composite:intersect}
#stories:not(.viewing-archive) .weekly-view-controls #weekly-future-story,#stories:not(.viewing-archive) .weekly-view-controls #weekly-view-hint{font-size:14px;line-height:1.7}

@media(min-width:1051px){#stories:not(.viewing-archive) .weekly-topic-banner{transform:translateX(var(--topic-paper-offset,0px))}}

/* Give the topic a deliberate margin and an organic pencil-filled title band. */
#stories:not(.viewing-archive) .weekly-wall-area{padding-top:36px;row-gap:24px}
#stories:not(.viewing-archive) #story-wall-topic{position:relative;isolation:isolate;width:max-content;max-width:100%;margin-top:10px;margin-bottom:13px;color:#303a29;font-weight:700}
#stories:not(.viewing-archive) .weekly-view-controls{gap:8px}
#stories:not(.viewing-archive) .weekly-view-controls #weekly-view-hint{color:#3f5034;font-weight:700}
#stories:not(.viewing-archive) .weekly-view-controls #weekly-future-story{color:#555a43;font-weight:600}

@media(min-width:1051px){#stories:not(.viewing-archive) .weekly-view-controls{box-sizing:border-box;width:calc(100% - var(--topic-guide-offset,0px));transform:translateX(var(--topic-guide-offset,0px));padding-left:24px;border-left:1px solid #7d796143}}
