@charset "UTF-8";
:root{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;color:#594343;background:#fff9f4;--bg:#fff9f4;--paper:#fffefc;--soft:#f5ebe6;--ink:#594343;--muted:#a18c84;--rose:#b45a76;--line:#eaded8;color-scheme:light;font-synthesis:none}
*{box-sizing:border-box}body{margin:0}button,input,select,textarea{font:inherit}button,a,input,select,textarea{-webkit-tap-highlight-color:transparent}button{cursor:pointer;border:0;background:var(--soft);color:var(--rose);padding:13px 17px;border-radius:17px;min-height:46px;font-weight:600;touch-action:manipulation}button:hover{filter:brightness(.97)}button:focus-visible,a:focus-visible{outline:3px solid #b45a76;outline-offset:3px}button:disabled{opacity:.5;cursor:wait}.primary{background:var(--rose);color:white}.plain{background:none;padding:7px}.danger{color:#b34848}.full{width:100%}.small{font-size:12px}.muted,.help{color:var(--muted)}.help{font-size:12px;line-height:1.8;margin:8px 0}.row{display:flex;align-items:center;gap:10px}.between{justify-content:space-between}.grow{flex:1;min-width:0}.stack{display:grid;gap:12px}.grid2{display:grid;grid-template-columns:1fr 1fr;gap:10px}.hide{display:none!important}
#app{max-width:650px;margin:auto;padding:calc(env(safe-area-inset-top) + 24px) 22px calc(env(safe-area-inset-bottom) + 110px)}header{margin:0 0 25px}h1{font-size:24px;letter-spacing:-.6px;line-height:1.4;margin:0 0 7px}h2{font-size:20px;font-weight:600;margin:0}h3{font-size:16px;margin:0 0 12px}p{line-height:1.7}header .eyebrow{font-size:10px;letter-spacing:1.4px;color:var(--muted)}.heart{color:#df4f70}.settings-button{background:none;font-size:26px;color:var(--rose);padding:8px;min-width:46px}.section{margin:26px 0 15px}.panel{background:var(--paper);border:1px solid #f0e5df;border-radius:26px;padding:21px;margin-bottom:15px}.filters{display:flex;gap:8px;overflow:auto;scrollbar-width:none;margin:16px 0}.filters button{white-space:nowrap;border-radius:30px;padding:10px 17px;min-height:41px;font-size:13px}.selected{background:var(--rose)!important;color:white!important}.empty{text-align:center;background:var(--soft);border-radius:28px;padding:30px 22px}.empty img{width:190px;height:128px;object-fit:contain}.empty p{font-size:14px;color:var(--muted)}.footer-quote{text-align:center;font-size:11px;color:var(--muted);margin:28px 0}.event{width:100%;text-align:left;display:flex;align-items:center;gap:13px;padding:21px 18px;border-radius:23px;background:var(--paper);border:1px solid var(--line);color:var(--ink);margin:0 0 11px;font-weight:400}.event .pet{width:54px;height:54px;object-fit:contain;flex:none}.event-title{font-size:16px;font-weight:600;overflow-wrap:anywhere}.event-date{font-size:11px;color:var(--muted);margin-top:7px}.event-count{text-align:right;flex:none}.event-count strong{font-size:29px;font-weight:500;color:var(--rose)}.event-count small{display:block;color:var(--muted);font-size:10px;margin-top:4px}.note-text{white-space:pre-wrap;overflow-wrap:anywhere;font-size:15px}.note-head .pet{width:53px;height:53px}.note-photos{display:grid;grid-template-columns:repeat(3,1fr);gap:5px;margin:15px 0}.note-photos img{width:100%;aspect-ratio:1;object-fit:cover;border-radius:12px}.note-actions{margin-top:13px;border-top:1px solid var(--line);padding-top:8px}.note-actions button{font-size:12px}nav{position:fixed;bottom:0;left:50%;transform:translateX(-50%);width:min(650px,100%);padding:10px 14px calc(env(safe-area-inset-bottom) + 12px);display:flex;gap:6px;background:var(--paper);border-top:1px solid var(--line);z-index:10}nav button{flex:1;font-weight:500;font-size:13px;background:none;padding:14px 4px}nav button.active{background:var(--soft);color:var(--rose)}nav button:not(.active){color:var(--muted)}
.love-card{width:100%;aspect-ratio:5/3;background:#f9dfd8;border-radius:27px;position:relative;overflow:hidden;color:#594343;isolation:isolate;container-type:inline-size}.love-card.square{aspect-ratio:1}.love-card .card-photo{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;z-index:-2}.love-card .shade{position:absolute;inset:0;background:#000;z-index:-1}.love-card.has-photo{color:white!important}.love-card .watermark{position:absolute;right:19px;top:14px;font-size:48px;color:currentColor;opacity:.07}.card-inner{padding:7.5%;height:100%;display:flex;flex-direction:column;justify-content:center}.card-caption{font-size:clamp(12px,3.8cqw,20px);font-weight:500;max-width:75%;overflow-wrap:anywhere}.card-number{font-size:clamp(45px,15cqw,95px);line-height:1.2;font-weight:500;letter-spacing:-3px;margin:10px 0 4px}.card-number small{font-size:13px;letter-spacing:0;margin-left:7px;opacity:.65}.card-date{font-size:clamp(9px,2.4cqw,12px);opacity:.65;margin-top:5px}.card-signature{font-size:9px;opacity:.5;margin-top:18px;letter-spacing:.8px}.card-sticker{position:absolute;right:5%;top:32%;width:36%;height:52%;object-fit:contain;pointer-events:none}.card-sticker.single{width:28%;right:7%}.layout-1 .card-inner{align-items:center;text-align:center;justify-content:flex-start;padding-top:8%}.layout-1 .card-caption{max-width:100%}.layout-1 .card-number{margin:6px 0}.layout-1 .card-sticker{width:32%;height:31%;top:auto;bottom:3%;right:34%}.layout-1 .card-signature{margin-top:8px}.layout-2{border:9px solid var(--paper);outline:1px solid var(--line)}.layout-2 .card-inner{border-left:1px dashed #b69b8a;margin-left:10px;padding-left:6%}.layout-2 .card-caption{font-size:13px}.layout-2 .card-number{font-family:Georgia,serif}.preview-wrap{background:var(--soft);padding:17px;border-radius:29px;margin-bottom:18px}.preview-wrap .love-card{border-radius:21px}
dialog{border:0;border-radius:27px;background:var(--paper);color:var(--ink);padding:0;width:min(560px,calc(100% - 24px));max-height:90dvh;box-shadow:0 20px 90px #2e182b38;overscroll-behavior:contain}dialog::backdrop{background:#21172088;backdrop-filter:blur(3px)}.modal-head{padding:22px 22px 15px;position:sticky;top:0;background:var(--paper);border-bottom:1px solid var(--line);z-index:2}.modal-head h2{font-size:22px}.modal-body{padding:20px 22px}.modal-foot{padding:14px 22px calc(14px + env(safe-area-inset-bottom));position:sticky;bottom:0;background:var(--paper);border-top:1px solid var(--line)}label.field{display:block;font-size:14px;margin:0 0 17px}label.field>span{display:block;margin:0 0 9px}input:not([type=checkbox]):not([type=range]),textarea,select{display:block;width:100%;border:1px solid transparent;border-radius:15px;background:var(--soft);color:var(--ink);padding:13px 14px;min-height:47px;max-width:100%;font-size:16px;outline:none}input:focus,textarea:focus,select:focus{border-color:var(--rose)!important}textarea{min-height:100px;resize:vertical}input[type=date],input[type=datetime-local]{min-width:0;-webkit-appearance:none}input[type=range]{accent-color:var(--rose);width:100%;margin:14px 0}select{appearance:auto}.toggle{display:flex;align-items:center;justify-content:space-between;gap:18px;min-height:54px;font-size:14px;cursor:pointer}.toggle input{appearance:none;width:43px;height:26px;background:#d8cecb;border-radius:20px;position:relative;transition:.2s;flex:none}.toggle input:after{content:'';position:absolute;left:3px;top:3px;background:white;border-radius:50%;width:20px;height:20px;transition:.2s}.toggle input:checked{background:var(--rose)}.toggle input:checked:after{left:20px}details{border-top:1px solid var(--line);margin-top:14px;padding-top:14px}summary{cursor:pointer;font-size:14px;padding:7px 0}.milestone-row{padding:7px 0;border-bottom:1px solid var(--line)}.milestone-row .toggle{min-height:36px}.milestone-row button{font-size:11px;min-height:32px;padding:6px 9px;border-radius:10px}.preset-row{display:flex;gap:7px;flex-wrap:wrap;margin-bottom:14px}.preset-row button{font-size:11px;min-height:34px;padding:8px 11px}.option-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:7px}.option-grid button{font-size:12px;padding:11px 4px}.mood-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}.mood-grid button{padding:8px;font-size:12px;background:var(--soft);color:var(--ink)}.mood-grid img{width:100%;height:80px;object-fit:contain;display:block;margin-bottom:6px}.mood-grid button.chosen{outline:2px solid var(--rose)}.sheet-title{margin:23px 0 12px}.error{color:#b34848;font-size:13px;white-space:pre-wrap}.install{background:#f4e4e4;border-radius:22px;padding:19px;margin-bottom:22px;font-size:13px;line-height:1.8}.crop-canvas{width:100%;display:block;border-radius:18px;background:var(--soft);touch-action:none;max-height:44vh;object-fit:contain}.crop-pointers{font-size:11px;color:var(--muted)}.photo-tile{position:relative}.photo-tile button{position:absolute;right:3px;top:3px;min-height:26px;padding:2px 8px;font-size:13px;background:#fff9}.photo-tile img{width:100%;aspect-ratio:1;object-fit:cover;border-radius:13px}#toast{position:fixed;left:50%;bottom:calc(100px + env(safe-area-inset-bottom));transform:translateX(-50%);background:#594343ed;color:white;padding:12px 19px;border-radius:16px;font-size:13px;max-width:90%;z-index:100;display:none;text-align:center}.loading{padding:60px 22px;text-align:center}.status{font-size:12px;line-height:1.8;background:var(--soft);border-radius:16px;padding:14px}.install-help li{margin:12px 0;line-height:1.8}hr{border:0;border-top:1px solid var(--line);margin:23px 0}
html[data-theme=dark]{--bg:#201b20;--paper:#2b242a;--soft:#3b2e34;--ink:#f1e1df;--muted:#bba4a5;--rose:#d985a0;--line:#4b3b43;color:var(--ink);background:var(--bg);color-scheme:dark}html[data-theme=dark] .panel{border-color:var(--line)}html[data-theme=dark] .install{background:#3b2e34}html[data-theme=dark] .love-card:not(.has-photo){filter:brightness(.78)}
@media(min-width:700px){#app{padding-top:42px}.love-card{aspect-ratio:1.85}.card-number{font-size:83px}.event{padding:23px}.modal-body{padding:24px 28px}}@media(prefers-reduced-motion:reduce){*{transition:none!important;scroll-behavior:auto!important}}
/* Three short notebook tabs stay balanced on small screens. */
.notebook-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;overflow:visible}
.notebook-tabs button{white-space:nowrap;min-width:0;padding:12px 6px}
.responses{border-top:1px solid var(--line,#dfc9c633);margin-top:18px;padding-top:12px}
.response-trigger{font-size:13px;padding:8px 12px;white-space:nowrap}
.response-row{display:flex;gap:10px;align-items:center;margin-top:12px}
.response-row>div{min-width:0;flex:1}.response-row p{margin:4px 0 0;white-space:pre-wrap;overflow-wrap:anywhere;font-size:14px;line-height:1.6}
.response-pet{width:46px;height:46px;object-fit:contain;flex-shrink:0}
.reply-choice{text-align:center;padding:12px;border-radius:18px;background:var(--soft,#f1c4ca22)}
.reply-preview{width:92px;height:92px;object-fit:contain}
.note-fold-row{display:flex;justify-content:flex-end;margin:-10px -5px 4px}.note-fold-row button{font-size:12px;padding:7px 12px}
.compact-note{padding:14px 16px}.compact-toggle{padding:0;width:100%;display:flex;align-items:center;gap:12px;text-align:left;background:none;font-weight:400;color:var(--ink)}
.compact-toggle .pet{width:40px;height:40px;flex:none}.compact-toggle .grow{min-width:0}.compact-toggle .small{display:block;font-size:11px;line-height:1.6}
.one-line{display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;max-width:100%;font-size:14px;margin:4px 0}
.journal-heading{display:flex;align-items:center;gap:14px}.journal-heading h2{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:18px;margin:0}.journal-heading button{flex-shrink:0;white-space:nowrap;padding-inline:12px}.journal-heading .fold-all{min-height:44px;padding:10px 6px;background:transparent;color:var(--muted);font-size:12px;font-weight:400}.journal-heading .fold-all:focus-visible{outline:2px solid var(--rose);outline-offset:1px}@media(max-width:380px){.journal-heading{gap:12px}.journal-heading h2{font-size:15px}.journal-heading button{padding-inline:10px;font-size:14px}.journal-heading .fold-all{padding-inline:4px;font-size:12px}}
.recovery-card{border-color:var(--rose)}.recovery-preview{border-radius:16px;padding:10px 14px;background:var(--soft)}

@media(max-width:350px){.journal-heading h2{font-size:13px}}

/* The preview and actions stay outside the scrolling editing options. */
dialog.card-editor{height:90dvh;overflow:hidden}dialog.card-editor form{height:100%;display:flex;flex-direction:column;min-height:0}dialog.card-editor .modal-head,dialog.card-editor .modal-foot{flex-shrink:0;position:static}dialog.card-editor .modal-head h2{margin:0}dialog.card-editor .style-preview-dock{flex-shrink:0;padding:12px 22px;background:var(--paper);border-bottom:1px solid var(--line);z-index:2}dialog.card-editor #style-preview{display:flex;justify-content:center}dialog.card-editor #style-preview .love-card{width:min(100%,calc(27dvh * 5 / 3));aspect-ratio:5/3;flex-shrink:0}dialog.card-editor .modal-body{min-height:0;flex:1;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;padding-top:8px}dialog.card-editor .modal-body .sheet-title:first-child{margin-top:12px}@media(max-height:500px){dialog.card-editor .modal-head{padding-block:8px}dialog.card-editor .modal-head h2{font-size:17px}dialog.card-editor .style-preview-dock{padding-block:6px}dialog.card-editor .modal-foot{padding-block:8px}dialog.card-editor .modal-body>.help:first-child{display:none}}

.response-content{min-width:0;flex:1}.response-meta{display:flex;align-items:center;justify-content:space-between;gap:12px}.response-edit{font-size:11px;min-height:32px;flex-shrink:0}.response-copy{white-space:pre-wrap;overflow-wrap:anywhere}.response-collapsed{display:-webkit-box;-webkit-line-clamp:4;-webkit-box-orient:vertical;overflow:hidden}.response-more{font-size:12px;min-height:36px;font-weight:400;padding:6px 4px}

/* One viewport shell: the dock is a flex sibling, never a fixed descendant of scrolling content. */
html,body{height:100%;overflow:hidden}#app{position:fixed;top:var(--app-top,0px);left:0;right:0;height:var(--app-height,100dvh);max-width:650px;margin:0 auto;padding:0;display:flex;flex-direction:column;overflow:hidden}#page-scroll{flex:1;min-height:0;overflow-y:auto;overscroll-behavior-y:contain;-webkit-overflow-scrolling:touch;padding:calc(env(safe-area-inset-top) + 24px) 22px 24px}#app>nav{position:relative;bottom:auto;left:auto;transform:none;width:100%;flex:none;margin:0;z-index:10}html[data-keyboard=open] #app>nav{visibility:hidden;pointer-events:none}.cloud-status{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.cloud-account>.row>div:first-child{min-width:0}@media(min-width:700px){#page-scroll{padding-top:42px}}

.journal-search-filters{margin:12px 0;color:var(--muted);font-size:14px}.journal-search-filters summary{cursor:pointer;padding:8px 0}.journal-search-filters .field{min-width:0;flex:1}.journal-search-filters .row{gap:12px}.journal-search-filters input{min-width:0;width:100%;box-sizing:border-box}

/* One shared journal toolbar sticks after the account panel scrolls away. */
.journal-sticky{position:sticky;top:0;z-index:6;background:var(--bg);margin-top:20px;padding:12px 0;isolation:isolate;box-shadow:0 8px 12px -12px #38232d55}.journal-sticky .journal-heading{margin:0 0 12px}.search-line{display:flex;align-items:center;gap:10px}.search-line>input{flex:1;min-width:0;width:0;margin:0}.date-toggle{width:46px;height:46px;padding:12px;flex:none;display:grid;place-items:center}.date-toggle.active{color:var(--paper);background:var(--rose)}.date-panel{padding-top:14px}.date-panel[hidden]{display:none}.date-fields{display:grid;grid-template-columns:minmax(0,1fr);gap:12px}.date-field{min-width:0;display:block;margin:0}.date-entry{display:flex;align-items:center;margin-top:6px;border-radius:16px;background:var(--soft);min-width:0}.date-entry>input{background:transparent;min-width:0;width:0;flex:1;padding:12px;margin:0;border:0}.date-picker-icon{position:relative;display:grid;place-items:center;width:44px;height:44px;color:var(--rose);flex:none;overflow:hidden}.date-picker-icon>input{position:absolute;inset:0;margin:0;width:100%;height:100%;opacity:0;cursor:pointer;min-width:0;padding:0}.date-help{gap:12px;margin-top:8px}.date-help .plain{font-size:12px;flex:none;white-space:nowrap}.date-error{color:var(--rose);margin:0}.date-field>span:first-child{font-size:12px}@media(min-width:480px){.date-fields{grid-template-columns:repeat(2,minmax(0,1fr))}}.journal-sticky input{font-size:15px}

/* Fixed opaque page title, scroll-only content, and a single compose action. */
#app>.app-header{flex:none;position:relative;z-index:20;isolation:isolate;background:var(--bg);margin:0;padding:calc(env(safe-area-inset-top) + 18px) 22px 16px;box-shadow:0 1px var(--line)}#page-scroll{padding:0 22px 24px}.journal-sticky{margin-top:0;padding:10px 0;background:var(--bg);z-index:6}.journal-heading.section{margin:20px 0 6px}.journal-heading .fold-all{padding:8px 12px;background:var(--soft);border-radius:14px;min-height:40px}.search-open{width:100%;display:flex;gap:10px;align-items:center;text-align:left;min-height:50px;background:var(--soft);color:var(--muted);font-size:14px;font-weight:400;padding:12px 14px}.search-open>svg{flex:none}.search-open>span{flex:1;min-width:0;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.search-open small{flex:none;color:var(--rose)}.search-hit{color:inherit;background:#f5d99099;border-radius:3px;box-decoration-break:clone;-webkit-box-decoration-break:clone}.mood-hit{background:#f5d99077;border-radius:16px;outline:2px solid #d7a95577}.compose-fab{position:absolute;right:22px;z-index:12;width:142px;height:56px;padding:0;background:var(--rose);color:white;border-radius:28px;box-shadow:0 5px 18px #73445525;display:flex;align-items:center;overflow:hidden;white-space:nowrap;transition:width .24s ease}.compose-plus{width:56px;flex:none;font-size:29px;font-weight:400;line-height:56px}.compose-label{font-size:15px;opacity:1;transition:opacity .18s ease,transform .24s ease}.compose-fab.compact:not(:focus-visible):not(:hover){width:56px}.compose-fab.compact:not(:focus-visible):not(:hover) .compose-label{opacity:0;transform:translateX(-8px)}#main:has(.journal-search){padding-bottom:84px}html[data-keyboard=open] .compose-fab{visibility:hidden;pointer-events:none}.journal-search-dialog .modal-foot>.row{gap:10px}.journal-search-dialog .date-fields{grid-template-columns:minmax(0,1fr)}
@media(prefers-reduced-motion:reduce){.compose-fab,.compose-label{transition:none}}

@media(hover:none){.compose-fab.compact:not(:focus-visible){width:56px}.compose-fab.compact:not(:focus-visible) .compose-label{opacity:0;transform:translateX(-8px)}}

/* Small, softly colored compose action with a geometrically centered plus. */
.compose-fab{width:116px;height:48px;min-height:48px;border-radius:24px;background:var(--soft);color:var(--rose);border:1px solid var(--line);box-shadow:0 2px 10px #73445512}.compose-plus{width:48px;height:48px;line-height:normal;display:grid;place-items:center;transform:translateX(10px);transition:transform .24s ease}.compose-label{margin-left:4px;font-size:14px;line-height:20px}.compose-fab.compact:not(:focus-visible):not(:hover){width:48px}.compose-fab.compact:not(:focus-visible):not(:hover) .compose-plus{transform:translateX(0)}@media(hover:none){.compose-fab.compact:not(:focus-visible){width:48px}.compose-fab.compact:not(:focus-visible) .compose-plus{transform:translateX(0)}}

.compose-fab{background:#efdfdc}html[data-theme=dark] .compose-fab{background:#3b2e34}

/* Approved rose palette; center the icon and caption as one compact content group. */
#journal-compose{background:#b45a76;color:#fffaf7;border-color:#b45a76;justify-content:center;align-items:center}#journal-compose .compose-content{display:flex;align-items:center;justify-content:center;gap:8px;transform:translateX(-2px);transition:gap .24s ease,transform .24s ease}#journal-compose .compose-plus{width:20px;height:20px;flex:0 0 20px;transform:none;line-height:1}#journal-compose .compose-label{margin:0;max-width:70px;min-width:0;display:block;overflow:hidden;line-height:20px;transform:none;transition:max-width .24s ease,opacity .18s ease}#journal-compose.compact:not(:focus-visible):not(:hover) .compose-content{gap:0;transform:none}#journal-compose.compact:not(:focus-visible):not(:hover) .compose-label{max-width:0;opacity:0;transform:none}@media(hover:none){#journal-compose.compact:not(:focus-visible) .compose-content{gap:0;transform:none}#journal-compose.compact:not(:focus-visible) .compose-label{max-width:0;opacity:0;transform:none}}

#journal-compose .compose-label{font-weight:700;-webkit-text-stroke:.12px currentColor}

#journal-compose{color:#ffffff}#journal-compose .compose-label{font-size:15px;line-height:22px}

/* Calendar glyph and native picker share one centered 48px target. */
.journal-search-dialog .date-picker-icon{width:48px;height:48px;min-width:48px;flex:0 0 48px;display:flex;align-items:center;justify-content:center}.journal-search-dialog .date-picker-icon>svg{display:block;flex:none;pointer-events:none}.journal-search-dialog .date-picker-icon>input[type=date]{position:absolute;inset:0;box-sizing:border-box;width:100%;height:100%;min-width:0;min-height:0;max-width:100%;max-height:100%;margin:0;padding:0;border:0;opacity:0}

.note-head{display:flex;align-items:center;gap:12px;flex-wrap:nowrap}.note-head>.pet{flex:none}.note-head>div:not(.note-fold-row){flex:1;min-width:0}.note-head h3{overflow-wrap:anywhere}.note-head>.note-fold-row{flex:none;margin:0;align-self:center}.note-fold-row button{white-space:nowrap}
.event.dragging{opacity:.55;outline:2px solid var(--rose)}.event.drop-target{box-shadow:0 -3px var(--rose)}.event{touch-action:pan-y;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}

.event .pet.event-photo{object-fit:cover;border-radius:14px}

.response-row{align-items:flex-start}.response-row>.response-pet{align-self:flex-start}.note-head[data-fold-note]{cursor:pointer}.photo-gallery{max-width:900px}.gallery-stage{height:65dvh;display:flex;align-items:center;justify-content:center;background:#171317;border-radius:16px;overflow:auto}.gallery-stage img{max-width:100%;max-height:100%;object-fit:contain}.gallery-count{text-align:center}.photo-gallery .modal-foot{gap:8px}.photo-gallery .modal-foot button{font-size:12px;padding:10px}.photo-gallery .modal-foot a{font-size:12px;color:var(--rose)}

.mood-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}.mood-tabs button{font-size:13px;padding:10px 4px}

.gallery-stage.zoomed{display:block}.gallery-stage.zoomed img{max-width:none;max-height:none;object-fit:initial;cursor:zoom-out}.gallery-stage:not(.zoomed) img{cursor:zoom-in}

.photo-gallery .gallery-count{margin:0 0 10px;text-align:center;line-height:20px;min-height:20px}.photo-gallery .gallery-stage{height:min(56dvh,560px)}.photo-gallery .modal-foot{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.photo-gallery .modal-foot button,.photo-gallery .modal-foot a{display:flex;align-items:center;justify-content:center;min-width:0;min-height:48px;padding:10px 4px;border-radius:18px;background:var(--soft);color:var(--rose);font-size:13px;font-weight:600;text-decoration:none;white-space:nowrap}

/* Reply preview and actions remain separate touch targets in both themes. */
.reply-dialog .reply-choice{margin:12px 0;padding:16px;border:1px solid var(--line);background:transparent;min-height:88px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px}
.reply-dialog .reply-choice p{margin:0;line-height:1.6}
.reply-dialog .reply-actions{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(0,1fr);gap:12px;margin:0 0 20px}
.reply-dialog .reply-actions button{min-width:0;min-height:48px;width:100%;margin:0;padding:12px 8px;line-height:1.4;font-size:14px}
.reply-dialog .reply-actions [data-act=clear-reaction]{background:transparent;border:1px solid var(--line);color:var(--muted);font-weight:400}
.reply-dialog .reply-actions button:focus-visible{outline:2px solid var(--rose);outline-offset:2px}
.reply-dialog .reply-actions+.field{margin-top:0}

.reply-dialog.draft-enabled .modal-foot{display:flex;flex-wrap:wrap;gap:10px;align-items:center}
.reply-dialog.draft-enabled .modal-foot button{min-height:44px;padding:11px 14px;font-size:13px;white-space:nowrap}
.reply-dialog.draft-enabled .modal-foot [type=submit]{margin-left:auto}
.reply-exit-dialog .modal-foot{display:flex;flex-wrap:wrap;gap:10px}
.reply-exit-dialog .modal-foot button{min-height:44px;padding:11px 12px;font-size:13px}
.reply-dialog:focus,.reply-exit-dialog:focus{outline:none}

.note-draft-dialog .modal-foot{display:flex;flex-wrap:wrap;gap:10px}.note-draft-dialog .modal-foot button{min-height:44px;font-size:13px;padding:11px 13px;white-space:nowrap}.note-draft-dialog .modal-foot [type=submit]{margin-left:auto}.note-draft-dialog:focus{outline:none}

/* The picker keeps navigation outside its scrolling grid. */
dialog.emoji-picker{height:min(90dvh,850px);overflow:hidden}dialog.emoji-picker:focus{outline:none}.emoji-picker form{height:100%;display:flex;flex-direction:column;min-height:0}.emoji-picker .modal-head,.emoji-picker .modal-foot{flex:none;position:static}.emoji-picker .modal-head{padding:19px 20px 14px}.emoji-picker .modal-head h2{font-size:21px;margin:0}.emoji-picker .modal-body{padding:0;min-height:0;flex:1;display:flex;flex-direction:column;overflow:hidden}.emoji-picker-top{flex:none;padding:14px 20px 12px;border-bottom:1px solid var(--line);background:var(--paper)}.emoji-picker .mood-tabs{gap:8px}.emoji-picker .mood-tabs button{min-height:46px;padding:12px 4px;font-size:14px}.emoji-basic-hint{font-size:11px;color:var(--muted);line-height:1.6;margin:10px 0 0}.emoji-interaction-tools[hidden],.emoji-basic-hint[hidden]{display:none}.emoji-search{display:flex;align-items:center;gap:8px;background:var(--soft);border-radius:15px;margin-top:12px;padding:0 12px}.emoji-search span{font-size:24px;color:var(--muted)}.emoji-search input[type=search]{min-width:0;background:transparent;min-height:44px;padding:10px 0;border:0;font-size:14px}.emoji-chips{display:flex;gap:6px;margin-top:10px}.emoji-chips button{flex:1;min-width:0;min-height:40px;white-space:nowrap;font-size:12px;padding:9px 2px;border-radius:13px;font-weight:400}.emoji-chips button.selected{background:var(--rose);color:var(--paper);font-weight:600}.emoji-scroll{overflow-y:auto;overscroll-behavior:contain;min-height:0;flex:1;padding:12px 20px 15px;-webkit-overflow-scrolling:touch}.emoji-scroll .mood-grid{gap:8px}.emoji-scroll .emoji-cell{position:relative;min-width:0;border:1px solid transparent;border-radius:17px;padding:6px 3px;color:var(--ink);user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;touch-action:pan-y}.emoji-scroll .emoji-cell img{height:58px;pointer-events:none;margin-bottom:3px}.emoji-scroll .emoji-cell span{font-size:12px;line-height:22px}.emoji-scroll .emoji-cell.chosen{border-color:var(--rose)}.emoji-favorite{position:absolute;right:6px;top:4px;color:var(--rose);font-size:12px;font-style:normal}.emoji-group h3{display:flex;justify-content:space-between;align-items:center;gap:8px;margin:0 0 10px;font-size:13px;color:var(--ink)}.emoji-group h3 small{font-size:10px;font-weight:400;color:var(--muted)}.emoji-group+.emoji-group{margin-top:18px}.emoji-group .emoji-cell img{height:72px}.emoji-empty{padding:45px 8px;text-align:center;font-size:13px;line-height:2;color:var(--muted)}.emoji-picker .modal-foot{gap:8px;padding:12px 20px calc(12px + env(safe-area-inset-bottom))}.emoji-picker .modal-foot button{font-size:12px;min-height:40px;padding:10px 14px}.emoji-picker-status{font-size:11px;line-height:1.5;color:var(--muted);flex:1;min-width:0}@media(max-height:700px){.emoji-scroll .emoji-cell img{height:49px}.emoji-picker-top{padding-top:10px;padding-bottom:10px}.emoji-picker .modal-head{padding-block:12px}}

/* One continuous straight-edged canvas; the dock shares its full inner width. */
#app{background:var(--bg)}
#app>nav{width:100%;margin:0;border:0;border-top:1px solid var(--line);border-radius:0;box-shadow:none;align-self:stretch;min-width:0}
#app>.app-header,#page-scroll{min-width:0}
@media(min-width:651px){#app{border-left:1px solid var(--line);border-right:1px solid var(--line)}}
#page-scroll{scrollbar-width:thin;scrollbar-color:var(--line) var(--bg)}
#page-scroll::-webkit-scrollbar{width:6px}#page-scroll::-webkit-scrollbar-track{background:var(--bg)}#page-scroll::-webkit-scrollbar-thumb{background:var(--line);border:1px solid var(--bg);border-radius:3px}
