/* Full-screen scrapbook editor */
body.editor-open{overflow:hidden}.editor-back{position:fixed;inset:0;z-index:10;background:#35282dbb;backdrop-filter:blur(7px);padding:14px;display:grid;place-items:center}.diary-editor{width:min(1440px,100%);height:min(940px,100%);background:#fcf9f7;border:1px solid #eadedb;border-radius:24px;box-shadow:0 35px 100px #24151845;display:grid;grid-template-rows:auto minmax(0,1fr);overflow:hidden;color:#382d30}.editor-topbar{display:grid;grid-template-columns:minmax(160px,1fr) auto minmax(250px,1fr);gap:18px;align-items:center;padding:15px 22px;background:#fffdfa;border-bottom:1px solid #eadedb}.editor-back-button,.editor-ghost{border:0;background:transparent;color:#89666c;font-weight:600;padding:10px;border-radius:10px}.editor-back-button:hover,.editor-ghost:hover{background:#f8eef0}.editor-heading-wrap{text-align:center;min-width:0}.editor-kicker{display:block;font-size:9px;letter-spacing:.2em;color:#b27782;text-transform:uppercase;margin-bottom:4px}.editor-heading{font:600 17px Georgia,serif}.editor-actions{display:flex;justify-content:flex-end;align-items:center;gap:7px}.editor-actions .button{padding:10px 16px}.editor-layout{display:grid;grid-template-columns:272px minmax(0,1fr);min-height:0}.editor-sidebar{overflow-y:auto;padding:23px 19px;background:#f8f0ee;border-right:1px solid #ecdfdc}.editor-section{padding-bottom:21px;margin-bottom:20px;border-bottom:1px solid #eadbd8}.editor-section:last-child{border-bottom:0}.editor-section h3{margin:0 0 12px;font:600 15px Georgia,serif;color:#554147}.editor-field{display:block;margin-bottom:12px}.editor-field>span,.color-field>span{display:block;margin-bottom:6px;font-size:10px;font-weight:700;letter-spacing:.06em;color:#90777b}.editor-field input,.editor-field select{width:100%;height:40px;border:1px solid #e5d7d3;border-radius:10px;padding:0 10px;background:#fffdfa;color:#43373a;outline:0}.editor-field input:focus,.editor-field select:focus{border-color:#ba7c88;box-shadow:0 0 0 3px #a4515c13}.mood-editor-row{display:flex;align-items:center;gap:10px}.mood-editor-row select{flex:1;min-width:0}.mood-editor-row img{width:42px;height:42px;object-fit:contain}.theme-list{display:grid;gap:7px}.theme-chip{width:100%;display:flex;align-items:center;gap:10px;border:1px solid #e7dcd9;border-radius:11px;background:#fffdfa;text-align:left;padding:8px 10px;color:#56474a;font-size:11px;font-weight:600}.theme-chip[aria-pressed=true]{border-color:#bf8791;box-shadow:0 0 0 2px #be849022;color:#98535f}.theme-preview{width:29px;height:24px;border-radius:7px;border:1px solid #d8caca;box-shadow:inset 0 -5px 0 #00000008}.theme-preview.pink{background:#fff1f5}.theme-preview.vintage{background:#eee1c8}.theme-preview.dark{background:#302735}.theme-preview.minimal{background:#fff}.theme-preview.coquette{background:#fff4f8}.palette-row{display:flex;gap:8px;margin:4px 0 15px}.palette-swatch{width:27px;height:27px;padding:0;border:2px solid #fff;border-radius:50%;box-shadow:0 0 0 1px #d9c9c6;cursor:pointer}.palette-swatch:hover{transform:scale(1.1)}.color-fields{display:grid;grid-template-columns:1fr 1fr;gap:10px}.color-field{display:block;font-size:9px}.color-field input{width:100%;height:34px;padding:3px;border:1px solid #dfd1ce;border-radius:8px;background:#fff}.color-value{display:block;margin-top:3px;color:#927f80;font:9px monospace}.editor-main{min-width:0;min-height:0;display:grid;grid-template-rows:auto auto minmax(0,1fr);overflow:hidden}.editor-title-row{padding:17px clamp(18px,4vw,55px) 12px}.paper-title-input{display:block;width:100%;border:0;border-bottom:1px solid #eadeda;border-radius:0;background:transparent;padding:4px 0 12px;color:#3b2e34;font:600 clamp(22px,3vw,31px) Georgia,serif;outline:0}.paper-title-input::placeholder{color:#c3b3b4}.paper-title-input:focus{border-color:#bc7c89}.editor-toolbar{display:flex;align-items:center;flex-wrap:wrap;gap:7px;padding:10px clamp(14px,3vw,38px);border-top:1px solid #f0e8e5;border-bottom:1px solid #e9dfdc;background:#fffdfa}.toolbar-select{display:flex;align-items:center;gap:6px;padding:0 5px;font-size:9px;color:#927a7d}.toolbar-select select{height:32px;max-width:135px;border:1px solid #eadedb;border-radius:8px;background:#fff;padding:0 8px;color:#4d4143;font-size:11px}.toolbar-divider{height:24px;width:1px;background:#eadedb;margin:0 2px}.format-button{height:32px;min-width:32px;border:1px solid transparent;border-radius:8px;background:transparent;color:#6b555c;font:600 13px Georgia,serif}.format-button:hover,.format-button[aria-pressed=true]{background:#f8eef0;border-color:#ead7d8;color:#a4515c}.format-button.italic{font-style:italic}.format-button.underline{text-decoration:underline}.format-button.align{font:12px Arial,sans-serif}.text-color-control{height:32px;width:36px;border:1px solid #eadedb;border-radius:8px;padding:3px;background:#fff}.paper-stage{min-height:0;overflow:auto;padding:28px clamp(16px,5vw,64px) 48px;background:radial-gradient(ellipse at 25% 15%,#f4e8e3 0,transparent 38%),#eee9e6}.paper-sheet{--sheet-bg:#fff7fa;--sheet-accent:#b9687c;--sheet-ink:#45383c;position:relative;width:min(780px,100%);min-height:690px;margin:0 auto;padding:clamp(25px,5vw,62px) clamp(23px,6vw,76px) 70px;background:var(--sheet-bg);color:var(--sheet-ink);border-radius:3px 3px 10px 3px;box-shadow:0 10px 36px #60434b20,0 0 0 1px #ffffffa0;transition:background .2s,color .2s}.paper-sheet:before{content:"";position:absolute;inset:13px;border:1px solid color-mix(in srgb,var(--sheet-accent) 18%,transparent);pointer-events:none}.paper-sheet:after{content:"";position:absolute;top:0;bottom:0;left:34px;width:1px;background:color-mix(in srgb,var(--sheet-accent) 22%,transparent)}.paper-sheet[data-theme=pink]{--sheet-ink:#503c43;background-image:radial-gradient(#b9687c10 .7px,transparent .7px);background-size:8px 8px}.paper-sheet[data-theme=vintage]{--sheet-ink:#4e4338;background-image:repeating-linear-gradient(0deg,transparent 0 31px,#8b6b4910 32px)}.paper-sheet[data-theme=dark]{--sheet-ink:#f4e8ee;background-image:radial-gradient(#cf91ad0e .7px,transparent .7px);background-size:9px 9px}.paper-sheet[data-theme=minimal]{--sheet-ink:#403c3b}.paper-sheet[data-theme=coquette]{--sheet-ink:#553c47;background-image:radial-gradient(#d1849b12 .8px,transparent .8px);background-size:10px 10px}.sheet-brand{position:relative;display:flex;justify-content:space-between;gap:12px;align-items:center;color:var(--sheet-accent);font-size:9px;letter-spacing:.2em;text-transform:uppercase;margin-bottom:14px}.sheet-meta{position:relative;display:flex;gap:8px;flex-wrap:wrap;color:var(--sheet-accent);font:italic 12px Georgia,serif;margin-bottom:18px}.sheet-meta span+span:before{content:"·";margin-right:8px}.sheet-rule{position:relative;height:1px;background:color-mix(in srgb,var(--sheet-accent) 24%,transparent);margin-bottom:25px}.sheet-title-preview{position:relative;margin:0 0 18px;font:600 26px Georgia,serif;color:var(--sheet-ink);overflow-wrap:anywhere}.sheet-content{position:relative;z-index:1;min-height:370px;outline:0;color:var(--sheet-ink);font:18px/1.85 Georgia,serif;white-space:pre-wrap;overflow-wrap:anywhere}.sheet-content:empty:before{content:attr(data-placeholder);color:color-mix(in srgb,var(--sheet-ink) 43%,transparent);font-style:italic}.sheet-content p{margin:0 0 .8em}.sheet-content:focus{caret-color:var(--sheet-accent)}.sheet-content ul,.sheet-content ol{padding-left:24px}.sheet-foot{position:absolute;bottom:28px;right:clamp(23px,6vw,76px);color:var(--sheet-accent);font:italic 11px Georgia,serif;opacity:.8}.entry-rich{padding:15px 18px;margin:10px 0 12px;border:1px solid color-mix(in srgb,var(--note-accent) 20%,transparent);border-radius:14px;background:var(--note-bg);color:#493f42;font:15px/1.75 Georgia,serif;white-space:pre-wrap;overflow-wrap:anywhere}.entry-rich.theme-vintage{font-family:Georgia,serif;color:#514436;background-image:repeating-linear-gradient(0deg,transparent 0 26px,#8b6b4910 27px)}.entry-rich.theme-dark{color:#f1e4ea}.entry-rich.theme-minimal{font-family:Arial,sans-serif;color:#484341}.entry-rich.theme-coquette{color:#58434b}.entry-rich p{margin:0 0 .7em}.entry-rich p:last-child{margin-bottom:0}.preview-mode .editor-layout{grid-template-columns:minmax(0,1fr)}.preview-mode .editor-sidebar,.preview-mode .editor-toolbar{display:none}.preview-mode .editor-main{grid-template-rows:auto minmax(0,1fr)}.preview-mode .editor-title-row{display:none}.preview-mode .paper-stage{padding-top:38px}.preview-mode .paper-sheet{min-height:calc(100% - 12px)}.preview-mode .sheet-title-preview{display:block}.preview-mode .sheet-content{min-height:400px;cursor:default}.editor-back.hidden{display:none!important}
@media(max-width:850px){.editor-back{padding:8px}.diary-editor{height:calc(100dvh - 16px);grid-template-rows:auto minmax(0,1fr);border-radius:19px}.editor-layout{grid-template-columns:230px minmax(0,1fr)}.editor-sidebar{padding:18px 14px}.editor-topbar{grid-template-columns:auto 1fr auto;padding:12px 14px;gap:8px}.editor-heading-wrap{text-align:left}.editor-actions{gap:4px}.editor-actions .editor-ghost{display:none}.editor-actions .button{padding:9px 12px}.paper-sheet{min-height:630px}.paper-stage{padding:20px 18px 36px}}
@media(max-width:620px){.editor-back{inset:0;padding:0;background:#f8f0ee}.diary-editor{width:100%;height:100dvh;height:100svh;border:0;border-radius:0;grid-template-rows:auto minmax(0,1fr)}.editor-topbar{grid-template-columns:auto 1fr auto;padding:calc(8px + env(safe-area-inset-top)) 10px 9px;gap:5px}.editor-back-button{font-size:11px;padding:8px 5px;white-space:nowrap}.editor-kicker{font-size:8px}.editor-heading{font-size:13px}.editor-actions .button{font-size:11px;padding:9px 10px;white-space:nowrap}.editor-layout{grid-template-columns:1fr;grid-template-rows:auto minmax(0,1fr);overflow:auto}.editor-sidebar{display:grid;grid-template-columns:1fr 1fr;gap:0 12px;padding:12px 14px 8px;border-right:0;border-bottom:1px solid #eadedb;overflow:visible}.editor-section{padding-bottom:10px;margin-bottom:10px}.editor-section h3{font-size:12px;margin-bottom:8px}.editor-section.date-mood{grid-column:1/-1;display:grid;grid-template-columns:1fr 1.2fr;gap:0 12px}.editor-section.date-mood h3{grid-column:1/-1}.editor-section.style-section{grid-column:1/-1}.theme-list{display:flex;overflow-x:auto;padding:2px 1px 5px}.theme-chip{width:auto;min-width:max-content;padding:6px 8px}.theme-preview{width:20px;height:17px}.editor-main{min-height:650px;overflow:visible;grid-template-rows:auto auto minmax(0,1fr)}.editor-title-row{padding:11px 14px 8px}.paper-title-input{font-size:22px;padding-bottom:8px}.editor-toolbar{gap:4px;padding:7px 8px;overflow-x:auto;flex-wrap:nowrap}.toolbar-select{gap:3px;padding:0 2px;font-size:8px;white-space:nowrap}.toolbar-select select{max-width:92px;height:30px;font-size:10px;padding:0 4px}.toolbar-divider{margin:0}.format-button{height:30px;min-width:29px}.text-color-control{height:30px;min-width:34px}.paper-stage{padding:14px 9px 24px;overflow:visible}.paper-sheet{width:100%;min-height:560px;padding:31px 23px 58px;border-radius:3px}.paper-sheet:before{inset:9px}.paper-sheet:after{left:15px}.sheet-brand{font-size:8px;letter-spacing:.13em}.sheet-meta{font-size:10px;margin-bottom:14px}.sheet-title-preview{font-size:22px}.sheet-content{min-height:350px;font-size:16px;line-height:1.8}.sheet-foot{bottom:22px;right:22px}.preview-mode .editor-sidebar,.preview-mode .editor-toolbar{display:none}.preview-mode .editor-main{min-height:0;grid-template-rows:minmax(0,1fr)}.preview-mode .paper-stage{padding:12px 9px 20px}.preview-mode .paper-sheet{min-height:calc(100dvh - 80px);min-height:calc(100svh - 80px)}.preview-mode .sheet-content{min-height:45vh}}
@media(max-width:390px){.editor-back-button{font-size:10px}.editor-actions .button{font-size:10px;padding:8px}.editor-heading{font-size:12px}.editor-sidebar{padding-inline:10px}.theme-chip{font-size:10px}.toolbar-select select{max-width:79px}.paper-sheet{padding-inline:20px}.sheet-content{font-size:15px}}
.sheet-canvas{position:relative;min-height:440px}.sheet-content{position:absolute;left:0;top:0;z-index:1;min-height:160px;padding:17px 12px 20px}.scene-layer{position:absolute;inset:0;z-index:2;pointer-events:none}.scene-item{position:absolute;display:grid;place-items:center;line-height:1;user-select:none;touch-action:none;pointer-events:auto;cursor:grab;filter:drop-shadow(0 3px 4px #6b435322);transform-origin:center}.scene-item:active{cursor:grabbing}.scene-item.selected{outline:1px dashed #b9687c;outline-offset:4px;border-radius:6px}.scene-symbol{display:block}.scene-resize{position:absolute;right:-8px;bottom:-8px;width:16px;height:16px;border:1px solid #b9687c;border-radius:50%;background:#fff;cursor:nwse-resize}.sticker-hint{font-size:10px;line-height:1.45;color:#90777b;margin:-4px 0 10px}.sticker-library{display:grid;grid-template-columns:repeat(6,1fr);gap:6px}.sticker-library button{height:39px;border:1px solid #e7dcd9;border-radius:10px;background:#fffdfa;color:#a97894;font-size:20px}.sticker-library button:hover{background:#f8eef2;transform:translateY(-1px)}.selected-tools{display:flex;align-items:center;gap:7px;margin-top:10px}.selected-tools button{border:1px solid #e7dcd9;border-radius:8px;background:#fffdfa;color:#795f68;padding:5px 8px;font-size:10px}.selected-tools span{font-size:9px;color:#90777b}.preview-mode .scene-item .scene-resize{display:none}.entry-scene{position:relative;min-height:110px}.entry-scene .scene-item{pointer-events:none;filter:none}@media(max-width:620px){.sheet-canvas{min-height:400px}.sheet-content{min-height:160px}.sticker-library{grid-template-columns:repeat(6,1fr)}}@media(max-width:390px){.sticker-library{gap:4px}.sticker-library button{height:34px}}
.photo-add{display:block;margin-bottom:9px}.photo-add span{display:block;padding:10px;border:1px dashed #c8a3ad;border-radius:10px;background:#fffdfa;color:#955f70;text-align:center;font-size:11px;font-weight:600;cursor:pointer}.photo-add span:hover{background:#faeff3}.scene-photo{display:block;height:auto;max-height:260px;object-fit:contain;border:7px solid #fff;border-radius:3px;box-shadow:0 4px 14px #46313a33;pointer-events:none}.entry-scene .scene-photo{max-height:180px}.scene-item:has(.scene-photo){width:max-content;max-width:60%}

/* Selection controls stay on the editable canvas and never enter saved page markup. */
.sheet-content.text-selected{outline:1px dashed #b9687c;outline-offset:4px;border-radius:4px}
.scene-text-handle,.scene-text-resize{position:absolute;z-index:4;pointer-events:auto;touch-action:none}
.scene-text-handle{transform:translateY(-100%);border:1px solid #e7d2d8;border-radius:8px;padding:4px 8px;background:#fffafc;color:#916879;font-size:11px;line-height:1.2;cursor:grab;box-shadow:0 2px 8px #53303a18}
.scene-text-resize{transform:translate(-50%,-100%);width:14px;height:14px;border:1px solid #b9687c;border-radius:50%;background:#fff;cursor:ew-resize}
.scene-layer:empty{pointer-events:none}
.scene-photo{width:100%;max-width:100%;height:auto;max-height:260px;object-fit:contain}
.scene-item:has(.scene-photo){width:max-content;max-width:80%}
.selected-tools{flex-wrap:wrap}
.entry[data-entry-view]{cursor:pointer;transition:background .16s ease}
.entry[data-entry-view]:hover{background:#fffaf7}
.entry[data-entry-view]:focus-visible{outline:2px solid #bf8791;outline-offset:3px;border-radius:10px}
.entry-view-open{overflow:hidden}
.entry-view-back{position:fixed;inset:0;z-index:20;overflow:auto;background:#f5efec;padding:0 14px 36px}
.entry-view-back.hidden{display:none!important}
.entry-view-topbar{position:sticky;top:0;z-index:10;display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:12px;max-width:1180px;margin:0 auto;padding:12px 4px;background:#f5efeced;backdrop-filter:blur(10px)}
.entry-view-topbar h2{margin:0;text-align:center;font:600 16px Georgia,serif;color:#5e4b50}
.entry-view-topbar .button{justify-self:end}
.entry-view-back-button{justify-self:start;border:0;border-radius:10px;background:#fffdfa;padding:10px 13px;color:#89666c;font-weight:600}
.entry-view-content{max-width:1100px;margin:10px auto 0}
.view-sheet{width:min(850px,100%);min-height:760px;padding:clamp(30px,6vw,74px) clamp(24px,7vw,86px) 78px}
.view-canvas{min-height:440px}
.view-text{position:absolute;z-index:1;min-height:160px;padding:17px 12px 20px;color:var(--sheet-ink);font:18px/1.85 Georgia,serif;white-space:pre-wrap;overflow-wrap:anywhere;pointer-events:none}
.view-text p{margin:0 0 .8em}
.view-text p:last-child{margin-bottom:0}
.view-canvas .scene-layer,.view-canvas .scene-item{pointer-events:none}
.view-canvas .scene-item{filter:drop-shadow(0 3px 4px #6b435322)}
@media(max-width:620px){.entry-view-back{padding:0 8px 24px}.entry-view-topbar{gap:5px;padding:calc(8px + env(safe-area-inset-top)) 2px 9px}.entry-view-topbar h2{font-size:12px}.entry-view-back-button{font-size:11px;padding:9px 7px}.entry-view-topbar .button{font-size:11px;padding:9px 10px}.view-sheet{min-height:calc(100svh - 100px);padding:31px 23px 58px}.view-text{font-size:16px;line-height:1.8;padding:17px 12px 20px}}
.entry-view-dialog{min-height:100%;max-width:1180px;margin:0 auto;padding-bottom:30px}.entry-view-toolbar{position:sticky;top:0;z-index:10;display:flex;justify-content:space-between;align-items:center;gap:12px;max-width:850px;margin:0 auto;padding:12px 4px;background:#f5efeced;backdrop-filter:blur(10px)}.entry-view-content{max-width:1100px;margin:10px auto 0}.entry-view-toolbar .button{min-height:40px}.trash-toolbar{display:flex;justify-content:flex-end;margin:4px 0 10px}.trash-toolbar .button{padding:8px 12px;font-size:12px}.scene-item.selected{z-index:3}.scene-text-handle{white-space:nowrap}.view-text{user-select:text}
@media(max-width:620px){.entry-view-toolbar{padding:calc(8px + env(safe-area-inset-top)) 2px 9px}.entry-view-toolbar .button{font-size:11px;padding:9px 10px}.entry-view-content{margin-top:4px}}
