/* Consistent CJK/Latin fallback in editable and delivered letters. */
:is(#letter-rich,.yobu-letter-content,.preview-letter-body,.letter-paper .letter-body,.message-body,.admin-message-body){font-family:"Noto Sans SC","CloverSans","PingFang SC","Microsoft YaHei",system-ui,sans-serif!important;font-size:16px;font-weight:400;line-height:1.95;overflow-wrap:anywhere;word-break:normal;font-variant-ligatures:none}
:is(#letter-rich,.yobu-letter-content,.preview-letter-body,.letter-paper .letter-body) :is(span,strong,b,em,i,s,strike){font-family:inherit!important;line-height:inherit}
:is(#letter-rich,.yobu-letter-content,.preview-letter-body,.letter-paper .letter-body) :is(b,strong){font-weight:700}
:is(#letter-rich,.yobu-letter-content,.preview-letter-body,.letter-paper .letter-body) :is(i,em){font-style:italic}
#letter-writing-surface #letter-body{display:none!important}
.letter-rich{min-height:240px;max-height:500px;overflow-y:auto;overscroll-behavior:contain;white-space:pre-wrap;border:1px solid #85b990;border-radius:22px;background:var(--art-card,#fff);padding:16px 20px;outline:none;color:var(--deep,#354f40);cursor:text}
.letter-rich:focus{border-color:#438d63;box-shadow:0 0 0 3px #84bd982e}
.letter-rich:empty::before{content:attr(data-placeholder);color:var(--muted);pointer-events:none}
.letter-rich[contenteditable=false]{opacity:.65;cursor:default}
.letter-rich img{user-select:all;cursor:default}
.letter-editor #letter-rich{min-height:0;max-height:none;flex:1}
.emote-picker-grid{grid-template-columns:repeat(5,minmax(0,1fr))!important;gap:7px}
.emote-picker-grid span{font-family:"Noto Sans SC",system-ui,sans-serif;font-size:10px}
#mailbox .compose-stamp:not(.has-stamp){width:145px;height:164px;top:18px;right:22px;border:0;border-radius:0;background:url('../assets/design37/mail-stamp.png') center/contain no-repeat;box-shadow:none;transform:none;padding:0;opacity:.8}
#mailbox .compose-stamp:not(.has-stamp) .stamp-art,#mailbox .compose-stamp:not(.has-stamp) .stamp-caption{display:none}
#mailbox .compose-stamp:not(.has-stamp)::after{content:'YOBU\a POST';white-space:pre;text-align:center;position:absolute;right:3px;top:7px;width:66px;font:9px/32px "Noto Sans SC",sans-serif;letter-spacing:1.6px;color:#7f8d6b;transform:rotate(6deg);display:block}
#mailbox .compose-head{padding-right:132px}
#mailbox .compose-stamp:not(.has-stamp):hover{opacity:1;filter:drop-shadow(0 2px 4px #82957035)}
/* Keep the opened paper in normal stage flow: no translated title above its clip. */
.letter-reading-room.opened .envelope-stage{min-height:0;padding:16px 0 22px}
.letter-reading-room.opened .envelope{height:auto;min-height:450px;perspective:none;cursor:default;display:block}
.letter-reading-room.opened .letter-paper{position:relative;left:auto;right:auto;bottom:auto;width:100%;height:min(560px,68vh);min-height:300px;max-height:none;transform:none!important;opacity:1;z-index:8;padding:22px 26px 28px;scroll-padding-top:0}
.letter-paper-head{position:relative;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px 16px;align-items:start;padding:12px 0 20px!important;overflow:visible;min-height:106px}
.letter-paper-head>.small-label{grid-column:1;margin:0!important}
.letter-paper-head>#reader-title{grid-column:1;grid-row:2;margin:0!important;padding:0!important;line-height:1.6!important;overflow:visible;overflow-wrap:anywhere;align-self:start;font-size:25px}
#reader-postage{grid-column:2;grid-row:1/3;align-self:start}
.reader-postage .yobu-received-stamp{margin:0;transform:rotate(4deg);width:77px;max-width:100%;padding:5px}
.reader-postage .yobu-postage-image{width:65px;height:65px}
#letter-preview-dialog .dialog-head{align-items:flex-start}
#letter-preview-dialog .dialog-head>div:first-child{flex:1;min-width:0}
#preview-title{line-height:1.6;overflow-wrap:anywhere}
.preview-letter-body{white-space:pre-wrap}
@media(max-width:760px){
 .sidebar-messages{display:flex;align-items:center;gap:13px;padding:10px 14px;min-height:44px;width:100%;border:0;background:none;color:var(--deep);font:12px/1.5 "Noto Sans SC",sans-serif;letter-spacing:.1em;text-align:left;border-radius:13px;cursor:pointer}
 .sidebar-messages svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.35;stroke-linecap:round;stroke-linejoin:round;opacity:.65;flex:none}
 .sidebar-messages:hover{background:var(--art-mint)}
 #mailbox .compose-stamp:not(.has-stamp){width:94px;height:108px;right:10px;top:15px;opacity:.8}
 #mailbox .compose-stamp:not(.has-stamp)::after{right:2px;top:3px;width:43px;font-size:6px;line-height:21px;letter-spacing:1px}
 #mailbox .compose-head{padding-right:84px}
 .emote-picker-grid{gap:4px;padding:12px 8px}
 .emote-picker-grid button{padding:4px 1px;border-radius:10px}
 .emote-picker-grid span{font-size:9px}
 .emote-picker header h3{font-size:15px}
 .letter-rich{padding:14px 16px}
 .letter-reading-room.opened .letter-paper{padding:16px;height:65vh}
 #reader-title{font-size:21px!important}
}
@media(max-width:760px) and (max-height:700px){.sidebar-messages{min-height:35px;padding:7px 12px;font-size:11px}}
html[data-theme=dark] .letter-rich{background:var(--surface);color:var(--deep)}
